@ibiz-template-plugin/ai-chat 0.0.9 → 0.0.11

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.
Files changed (83) hide show
  1. package/dist/index.es.js +1915 -1282
  2. package/dist/index.legacy.js +1 -1
  3. package/dist/polyfills.legacy.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/types/app.d.ts +1 -0
  6. package/dist/types/components/chat-container/chat-container.d.ts +213 -0
  7. package/dist/types/components/chat-input/chat-input.d.ts +22 -0
  8. package/dist/types/components/chat-input-material/chat-input-material.d.ts +12 -0
  9. package/dist/types/components/chat-input-material-item/chat-input-material-item.d.ts +30 -0
  10. package/dist/types/components/chat-input-material-item/common-material/common-material.d.ts +8 -0
  11. package/dist/types/components/chat-input-material-item/ossfile-material/ossfile-material.d.ts +7 -0
  12. package/dist/types/components/chat-message-item/chat-message-item.d.ts +30 -0
  13. package/dist/types/components/chat-message-item/error-message/error-message.d.ts +30 -0
  14. package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +30 -0
  15. package/dist/types/components/chat-message-item/unknown-message/unknown-message.d.ts +13 -0
  16. package/dist/types/components/chat-message-item/user-message/user-message.d.ts +23 -0
  17. package/dist/types/components/chat-messages/chat-messages.d.ts +20 -0
  18. package/dist/types/components/chat-thought-chain/chat-thought-chain.d.ts +10 -0
  19. package/dist/types/components/chat-toolbar/chat-toolbar.d.ts +41 -0
  20. package/dist/types/components/chat-topic-item/chat-topic-item.d.ts +9 -0
  21. package/dist/types/components/chat-topics/chat-topics.d.ts +12 -0
  22. package/dist/types/components/index.d.ts +1 -0
  23. package/dist/types/components/popup/popup.d.ts +16 -0
  24. package/dist/types/constants/index.d.ts +22 -0
  25. package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +203 -0
  26. package/dist/types/controller/ai-material/ai-material-factory.d.ts +6 -0
  27. package/dist/types/controller/ai-material/common-helper.d.ts +12 -0
  28. package/dist/types/controller/ai-material/file-helper.d.ts +21 -0
  29. package/dist/types/controller/ai-material/material-helper.d.ts +15 -0
  30. package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +96 -0
  31. package/dist/types/controller/chat/chat.controller.d.ts +122 -0
  32. package/dist/types/controller/index.d.ts +4 -0
  33. package/dist/types/entity/chart-material/chart-material.d.ts +9 -0
  34. package/dist/types/entity/chart-topic/chart-topic.d.ts +20 -0
  35. package/dist/types/entity/chat-message/chat-message.d.ts +37 -0
  36. package/dist/types/entity/index.d.ts +3 -0
  37. package/dist/types/global.d.ts +2 -0
  38. package/dist/types/icons/ai-svg.d.ts +1 -0
  39. package/dist/types/icons/audio-svg.d.ts +1 -0
  40. package/dist/types/icons/checkmark-circle-svg.d.ts +3 -0
  41. package/dist/types/icons/chevron-down-svg.d.ts +3 -0
  42. package/dist/types/icons/close-full-screen-svg.d.ts +1 -0
  43. package/dist/types/icons/close-svg.d.ts +1 -0
  44. package/dist/types/icons/copy-svg.d.ts +1 -0
  45. package/dist/types/icons/default-material-svg.d.ts +1 -0
  46. package/dist/types/icons/delete-svg.d.ts +1 -0
  47. package/dist/types/icons/fill-svg.d.ts +1 -0
  48. package/dist/types/icons/full-screen-svg.d.ts +1 -0
  49. package/dist/types/icons/index.d.ts +23 -0
  50. package/dist/types/icons/link-svg.d.ts +3 -0
  51. package/dist/types/icons/loading-svg.d.ts +3 -0
  52. package/dist/types/icons/material-remove-svg.d.ts +1 -0
  53. package/dist/types/icons/minimize-svg.d.ts +1 -0
  54. package/dist/types/icons/more-svg.d.ts +4 -0
  55. package/dist/types/icons/new-dialogue.d.ts +1 -0
  56. package/dist/types/icons/paperclip-svg.d.ts +1 -0
  57. package/dist/types/icons/recording-svg.d.ts +1 -0
  58. package/dist/types/icons/refresh-svg.d.ts +1 -0
  59. package/dist/types/icons/remove-svg.d.ts +1 -0
  60. package/dist/types/icons/send-svg.d.ts +1 -0
  61. package/dist/types/icons/upload-svg.d.ts +1 -0
  62. package/dist/types/index.d.ts +3 -0
  63. package/dist/types/interface/i-chat-container/i-chat-container.d.ts +66 -0
  64. package/dist/types/interface/i-chat-message/i-chat-message.d.ts +91 -0
  65. package/dist/types/interface/i-chat-options/i-chat-options.d.ts +156 -0
  66. package/dist/types/interface/i-chat-thought-chain/i-chat-thought-chain.d.ts +35 -0
  67. package/dist/types/interface/i-chat-toolbar-item/i-chat-toolbar-item.d.ts +62 -0
  68. package/dist/types/interface/i-config-service/i-config-service.d.ts +27 -0
  69. package/dist/types/interface/i-container-options/i-container-options.d.ts +45 -0
  70. package/dist/types/interface/i-file-uploader-options/i-file-uploader-options.d.ts +27 -0
  71. package/dist/types/interface/i-material/i-material.d.ts +34 -0
  72. package/dist/types/interface/i-message-item-provider/i-message-item-provider.d.ts +18 -0
  73. package/dist/types/interface/i-portal-async-action/i-portal-async-action.d.ts +90 -0
  74. package/dist/types/interface/i-topic-options/i-topic-options.d.ts +102 -0
  75. package/dist/types/interface/index.d.ts +11 -0
  76. package/dist/types/main.d.ts +1 -0
  77. package/dist/types/utils/index.d.ts +6 -0
  78. package/dist/types/utils/plugin-static-resource/plugin-static-resource.d.ts +63 -0
  79. package/dist/types/utils/util/file-uploader.d.ts +36 -0
  80. package/dist/types/utils/util/indexdb-util.d.ts +91 -0
  81. package/dist/types/utils/util/material-resource-parser.d.ts +66 -0
  82. package/dist/types/utils/util/util.d.ts +29 -0
  83. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,50 +1,50 @@
1
1
  import './style.css';
2
- var Kt = Object.defineProperty;
3
- var Qt = (n, e, t) => e in n ? Kt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
- var y = (n, e, t) => (Qt(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import Ae from "interactjs";
6
- import en from "cherry-markdown";
7
- var Se, v, kt, $t, X, Xe, Nt, Re, Q = {}, xt = [], tn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
8
- function B(n, e) {
2
+ var hn = Object.defineProperty;
3
+ var fn = (n, e, t) => e in n ? hn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
+ var w = (n, e, t) => (fn(n, typeof e != "symbol" ? e + "" : e, t), t);
5
+ import ze from "interactjs";
6
+ import pn from "cherry-markdown";
7
+ var Ne, m, Dt, zt, G, et, Ht, Ve, Lt, ne = {}, Ot = [], _n = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
8
+ function F(n, e) {
9
9
  for (var t in e)
10
10
  n[t] = e[t];
11
11
  return n;
12
12
  }
13
- function At(n) {
13
+ function Rt(n) {
14
14
  var e = n.parentNode;
15
15
  e && e.removeChild(n);
16
16
  }
17
- function H(n, e, t) {
17
+ function I(n, e, t) {
18
18
  var i, s, o, r = {};
19
19
  for (o in e)
20
20
  o == "key" ? i = e[o] : o == "ref" ? s = e[o] : r[o] = e[o];
21
- if (arguments.length > 2 && (r.children = arguments.length > 3 ? Se.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
21
+ if (arguments.length > 2 && (r.children = arguments.length > 3 ? Ne.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
22
22
  for (o in n.defaultProps)
23
23
  r[o] === void 0 && (r[o] = n.defaultProps[o]);
24
- return me(n, r, i, s, null);
24
+ return be(n, r, i, s, null);
25
25
  }
26
- function me(n, e, t, i, s) {
27
- var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++kt : s };
28
- return s == null && v.vnode != null && v.vnode(o), o;
26
+ function be(n, e, t, i, s) {
27
+ var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++Dt : s };
28
+ return s == null && m.vnode != null && m.vnode(o), o;
29
29
  }
30
- function Ie() {
30
+ function He() {
31
31
  return { current: null };
32
32
  }
33
- function te(n) {
33
+ function se(n) {
34
34
  return n.children;
35
35
  }
36
- function M(n, e) {
36
+ function H(n, e) {
37
37
  this.props = n, this.context = e;
38
38
  }
39
- function le(n, e) {
39
+ function fe(n, e) {
40
40
  if (e == null)
41
- return n.__ ? le(n.__, n.__.__k.indexOf(n) + 1) : null;
41
+ return n.__ ? fe(n.__, n.__.__k.indexOf(n) + 1) : null;
42
42
  for (var t; e < n.__k.length; e++)
43
43
  if ((t = n.__k[e]) != null && t.__e != null)
44
44
  return t.__d || t.__e;
45
- return typeof n.type == "function" ? le(n) : null;
45
+ return typeof n.type == "function" ? fe(n) : null;
46
46
  }
47
- function It(n) {
47
+ function Pt(n) {
48
48
  var e, t;
49
49
  if ((n = n.__) != null && n.__c != null) {
50
50
  for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
@@ -52,68 +52,68 @@ function It(n) {
52
52
  n.__e = n.__c.base = t.__e;
53
53
  break;
54
54
  }
55
- return It(n);
55
+ return Pt(n);
56
56
  }
57
57
  }
58
- function Ze(n) {
59
- (!n.__d && (n.__d = !0) && X.push(n) && !be.__r++ || Xe !== v.debounceRendering) && ((Xe = v.debounceRendering) || Nt)(be);
60
- }
61
- function be() {
62
- var n, e, t, i, s, o, r, c, u;
63
- for (X.sort(Re); n = X.shift(); )
64
- n.__d && (e = X.length, i = void 0, s = void 0, o = void 0, c = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = B({}, r)).__v = r.__v + 1, Fe(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [c] : null, i, c == null ? le(r) : c, r.__h, s), Ht(i, r, s), r.__e != c && It(r)), X.length > e && X.sort(Re));
65
- be.__r = 0;
66
- }
67
- function Dt(n, e, t, i, s, o, r, c, u, d, h) {
68
- var a, _, p, f, g, N, b, C, x, T = 0, E = i && i.__k || xt, L = E.length, I = L, R = e.length;
69
- for (t.__k = [], a = 0; a < R; a++)
70
- (f = t.__k[a] = (f = e[a]) == null || typeof f == "boolean" || typeof f == "function" ? null : typeof f == "string" || typeof f == "number" || typeof f == "bigint" ? me(null, f, null, null, f) : ke(f) ? me(te, { children: f }, null, null, null) : f.__b > 0 ? me(f.type, f.props, f.key, f.ref ? f.ref : null, f.__v) : f) != null ? (f.__ = t, f.__b = t.__b + 1, (C = nn(f, E, b = a + T, I)) === -1 ? p = Q : (p = E[C] || Q, E[C] = void 0, I--), Fe(n, f, p, s, o, r, c, u, d, h), g = f.__e, (_ = f.ref) && p.ref != _ && (p.ref && We(p.ref, null, f), h.push(_, f.__c || g, f)), g != null && (N == null && (N = g), (x = p === Q || p.__v === null) ? C == -1 && T-- : C !== b && (C === b + 1 ? T++ : C > b ? I > R - b ? T += C - b : T-- : T = C < b && C == b - 1 ? C - b : 0), b = a + T, typeof f.type != "function" || C === b && p.__k !== f.__k ? typeof f.type == "function" || C === b && !x ? f.__d !== void 0 ? (u = f.__d, f.__d = void 0) : u = g.nextSibling : u = zt(n, g, u) : u = Mt(f, u, n), typeof t.type == "function" && (t.__d = u))) : (p = E[a]) && p.key == null && p.__e && (p.__e == u && (p.__ = i, u = le(p)), Oe(p, p, !1), E[a] = null);
71
- for (t.__e = N, a = L; a--; )
72
- E[a] != null && (typeof t.type == "function" && E[a].__e != null && E[a].__e == t.__d && (t.__d = E[a].__e.nextSibling), Oe(E[a], E[a]));
73
- }
74
- function Mt(n, e, t) {
58
+ function qe(n) {
59
+ (!n.__d && (n.__d = !0) && G.push(n) && !Te.__r++ || et !== m.debounceRendering) && ((et = m.debounceRendering) || Ht)(Te);
60
+ }
61
+ function Te() {
62
+ var n, e, t, i, s, o, r, a, u;
63
+ for (G.sort(Ve); n = G.shift(); )
64
+ n.__d && (e = G.length, i = void 0, s = void 0, o = void 0, a = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = F({}, r)).__v = r.__v + 1, Ze(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [a] : null, i, a == null ? fe(r) : a, r.__h, s), Vt(i, r, s), r.__e != a && Pt(r)), G.length > e && G.sort(Ve));
65
+ Te.__r = 0;
66
+ }
67
+ function Bt(n, e, t, i, s, o, r, a, u, f, d) {
68
+ var c, _, v, h, p, y, b, C, N, T = 0, E = i && i.__k || Ot, R = E.length, D = R, P = e.length;
69
+ for (t.__k = [], c = 0; c < P; c++)
70
+ (h = t.__k[c] = (h = e[c]) == null || typeof h == "boolean" || typeof h == "function" ? null : typeof h == "string" || typeof h == "number" || typeof h == "bigint" ? be(null, h, null, null, h) : ke(h) ? be(se, { children: h }, null, null, null) : h.__b > 0 ? be(h.type, h.props, h.key, h.ref ? h.ref : null, h.__v) : h) != null ? (h.__ = t, h.__b = t.__b + 1, (C = vn(h, E, b = c + T, D)) === -1 ? v = ne : (v = E[C] || ne, E[C] = void 0, D--), Ze(n, h, v, s, o, r, a, u, f, d), p = h.__e, (_ = h.ref) && v.ref != _ && (v.ref && Ge(v.ref, null, h), d.push(_, h.__c || p, h)), p != null && (y == null && (y = p), (N = v === ne || v.__v === null) ? C == -1 && T-- : C !== b && (C === b + 1 ? T++ : C > b ? D > P - b ? T += C - b : T-- : T = C < b && C == b - 1 ? C - b : 0), b = c + T, typeof h.type != "function" || C === b && v.__k !== h.__k ? typeof h.type == "function" || C === b && !N ? h.__d !== void 0 ? (u = h.__d, h.__d = void 0) : u = p.nextSibling : u = Ft(n, p, u) : u = Ut(h, u, n), typeof t.type == "function" && (t.__d = u))) : (v = E[c]) && v.key == null && v.__e && (v.__e == u && (v.__ = i, u = fe(v)), We(v, v, !1), E[c] = null);
71
+ for (t.__e = y, c = R; c--; )
72
+ E[c] != null && (typeof t.type == "function" && E[c].__e != null && E[c].__e == t.__d && (t.__d = E[c].__e.nextSibling), We(E[c], E[c]));
73
+ }
74
+ function Ut(n, e, t) {
75
75
  for (var i, s = n.__k, o = 0; s && o < s.length; o++)
76
- (i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Mt(i, e, t) : zt(t, i.__e, e));
76
+ (i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Ut(i, e, t) : Ft(t, i.__e, e));
77
77
  return e;
78
78
  }
79
- function we(n, e) {
79
+ function Se(n, e) {
80
80
  return e = e || [], n == null || typeof n == "boolean" || (ke(n) ? n.some(function(t) {
81
- we(t, e);
81
+ Se(t, e);
82
82
  }) : e.push(n)), e;
83
83
  }
84
- function zt(n, e, t) {
84
+ function Ft(n, e, t) {
85
85
  return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
86
86
  }
87
- function nn(n, e, t, i) {
88
- var s = n.key, o = n.type, r = t - 1, c = t + 1, u = e[t];
87
+ function vn(n, e, t, i) {
88
+ var s = n.key, o = n.type, r = t - 1, a = t + 1, u = e[t];
89
89
  if (u === null || u && s == u.key && o === u.type)
90
90
  return t;
91
91
  if (i > (u != null ? 1 : 0))
92
- for (; r >= 0 || c < e.length; ) {
92
+ for (; r >= 0 || a < e.length; ) {
93
93
  if (r >= 0) {
94
94
  if ((u = e[r]) && s == u.key && o === u.type)
95
95
  return r;
96
96
  r--;
97
97
  }
98
- if (c < e.length) {
99
- if ((u = e[c]) && s == u.key && o === u.type)
100
- return c;
101
- c++;
98
+ if (a < e.length) {
99
+ if ((u = e[a]) && s == u.key && o === u.type)
100
+ return a;
101
+ a++;
102
102
  }
103
103
  }
104
104
  return -1;
105
105
  }
106
- function sn(n, e, t, i, s) {
106
+ function mn(n, e, t, i, s) {
107
107
  var o;
108
108
  for (o in t)
109
- o === "children" || o === "key" || o in e || Ce(n, o, null, t[o], i);
109
+ o === "children" || o === "key" || o in e || xe(n, o, null, t[o], i);
110
110
  for (o in e)
111
- s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || Ce(n, o, e[o], t[o], i);
111
+ s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || xe(n, o, e[o], t[o], i);
112
112
  }
113
- function Ge(n, e, t) {
114
- e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || tn.test(e) ? t : t + "px";
113
+ function tt(n, e, t) {
114
+ e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || _n.test(e) ? t : t + "px";
115
115
  }
116
- function Ce(n, e, t, i, s) {
116
+ function xe(n, e, t, i, s) {
117
117
  var o;
118
118
  e:
119
119
  if (e === "style")
@@ -122,13 +122,13 @@ function Ce(n, e, t, i, s) {
122
122
  else {
123
123
  if (typeof i == "string" && (n.style.cssText = i = ""), i)
124
124
  for (e in i)
125
- t && e in t || Ge(n.style, e, "");
125
+ t && e in t || tt(n.style, e, "");
126
126
  if (t)
127
127
  for (e in t)
128
- i && t[e] === i[e] || Ge(n.style, e, t[e]);
128
+ i && t[e] === i[e] || tt(n.style, e, t[e]);
129
129
  }
130
130
  else if (e[0] === "o" && e[1] === "n")
131
- o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? Ke : Je, o)) : n.removeEventListener(e, o ? Ke : Je, o);
131
+ o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? it : nt, o)) : n.removeEventListener(e, o ? it : nt, o);
132
132
  else if (e !== "dangerouslySetInnerHTML") {
133
133
  if (s)
134
134
  e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
@@ -141,158 +141,179 @@ function Ce(n, e, t, i, s) {
141
141
  typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
142
142
  }
143
143
  }
144
- function Je(n) {
144
+ function nt(n) {
145
145
  var e = this.l[n.type + !1];
146
146
  if (n.t) {
147
147
  if (n.t <= e.u)
148
148
  return;
149
149
  } else
150
150
  n.t = Date.now();
151
- return e(v.event ? v.event(n) : n);
151
+ return e(m.event ? m.event(n) : n);
152
152
  }
153
- function Ke(n) {
154
- return this.l[n.type + !0](v.event ? v.event(n) : n);
153
+ function it(n) {
154
+ return this.l[n.type + !0](m.event ? m.event(n) : n);
155
155
  }
156
- function Fe(n, e, t, i, s, o, r, c, u, d) {
157
- var h, a, _, p, f, g, N, b, C, x, T, E, L, I, R, D = e.type;
156
+ function Ze(n, e, t, i, s, o, r, a, u, f) {
157
+ var d, c, _, v, h, p, y, b, C, N, T, E, R, D, P, z = e.type;
158
158
  if (e.constructor !== void 0)
159
159
  return null;
160
- t.__h != null && (u = t.__h, c = e.__e = t.__e, e.__h = null, o = [c]), (h = v.__b) && h(e);
160
+ t.__h != null && (u = t.__h, a = e.__e = t.__e, e.__h = null, o = [a]), (d = m.__b) && d(e);
161
161
  e:
162
- if (typeof D == "function")
162
+ if (typeof z == "function")
163
163
  try {
164
- if (b = e.props, C = (h = D.contextType) && i[h.__c], x = h ? C ? C.props.value : h.__ : i, t.__c ? N = (a = e.__c = t.__c).__ = a.__E : ("prototype" in D && D.prototype.render ? e.__c = a = new D(b, x) : (e.__c = a = new M(b, x), a.constructor = D, a.render = rn), C && C.sub(a), a.props = b, a.state || (a.state = {}), a.context = x, a.__n = i, _ = a.__d = !0, a.__h = [], a._sb = []), a.__s == null && (a.__s = a.state), D.getDerivedStateFromProps != null && (a.__s == a.state && (a.__s = B({}, a.__s)), B(a.__s, D.getDerivedStateFromProps(b, a.__s))), p = a.props, f = a.state, a.__v = e, _)
165
- D.getDerivedStateFromProps == null && a.componentWillMount != null && a.componentWillMount(), a.componentDidMount != null && a.__h.push(a.componentDidMount);
164
+ if (b = e.props, C = (d = z.contextType) && i[d.__c], N = d ? C ? C.props.value : d.__ : i, t.__c ? y = (c = e.__c = t.__c).__ = c.__E : ("prototype" in z && z.prototype.render ? e.__c = c = new z(b, N) : (e.__c = c = new H(b, N), c.constructor = z, c.render = yn), C && C.sub(c), c.props = b, c.state || (c.state = {}), c.context = N, c.__n = i, _ = c.__d = !0, c.__h = [], c._sb = []), c.__s == null && (c.__s = c.state), z.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = F({}, c.__s)), F(c.__s, z.getDerivedStateFromProps(b, c.__s))), v = c.props, h = c.state, c.__v = e, _)
165
+ z.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), c.componentDidMount != null && c.__h.push(c.componentDidMount);
166
166
  else {
167
- if (D.getDerivedStateFromProps == null && b !== p && a.componentWillReceiveProps != null && a.componentWillReceiveProps(b, x), !a.__e && (a.shouldComponentUpdate != null && a.shouldComponentUpdate(b, a.__s, x) === !1 || e.__v === t.__v)) {
168
- for (e.__v !== t.__v && (a.props = b, a.state = a.__s, a.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(fe) {
169
- fe && (fe.__ = e);
170
- }), T = 0; T < a._sb.length; T++)
171
- a.__h.push(a._sb[T]);
172
- a._sb = [], a.__h.length && r.push(a);
167
+ if (z.getDerivedStateFromProps == null && b !== v && c.componentWillReceiveProps != null && c.componentWillReceiveProps(b, N), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(b, c.__s, N) === !1 || e.__v === t.__v)) {
168
+ for (e.__v !== t.__v && (c.props = b, c.state = c.__s, c.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(ve) {
169
+ ve && (ve.__ = e);
170
+ }), T = 0; T < c._sb.length; T++)
171
+ c.__h.push(c._sb[T]);
172
+ c._sb = [], c.__h.length && r.push(c);
173
173
  break e;
174
174
  }
175
- a.componentWillUpdate != null && a.componentWillUpdate(b, a.__s, x), a.componentDidUpdate != null && a.__h.push(function() {
176
- a.componentDidUpdate(p, f, g);
175
+ c.componentWillUpdate != null && c.componentWillUpdate(b, c.__s, N), c.componentDidUpdate != null && c.__h.push(function() {
176
+ c.componentDidUpdate(v, h, p);
177
177
  });
178
178
  }
179
- if (a.context = x, a.props = b, a.__P = n, a.__e = !1, E = v.__r, L = 0, "prototype" in D && D.prototype.render) {
180
- for (a.state = a.__s, a.__d = !1, E && E(e), h = a.render(a.props, a.state, a.context), I = 0; I < a._sb.length; I++)
181
- a.__h.push(a._sb[I]);
182
- a._sb = [];
179
+ if (c.context = N, c.props = b, c.__P = n, c.__e = !1, E = m.__r, R = 0, "prototype" in z && z.prototype.render) {
180
+ for (c.state = c.__s, c.__d = !1, E && E(e), d = c.render(c.props, c.state, c.context), D = 0; D < c._sb.length; D++)
181
+ c.__h.push(c._sb[D]);
182
+ c._sb = [];
183
183
  } else
184
184
  do
185
- a.__d = !1, E && E(e), h = a.render(a.props, a.state, a.context), a.state = a.__s;
186
- while (a.__d && ++L < 25);
187
- a.state = a.__s, a.getChildContext != null && (i = B(B({}, i), a.getChildContext())), _ || a.getSnapshotBeforeUpdate == null || (g = a.getSnapshotBeforeUpdate(p, f)), Dt(n, ke(R = h != null && h.type === te && h.key == null ? h.props.children : h) ? R : [R], e, t, i, s, o, r, c, u, d), a.base = e.__e, e.__h = null, a.__h.length && r.push(a), N && (a.__E = a.__ = null);
188
- } catch (fe) {
189
- e.__v = null, (u || o != null) && (e.__e = c, e.__h = !!u, o[o.indexOf(c)] = null), v.__e(fe, e, t);
185
+ c.__d = !1, E && E(e), d = c.render(c.props, c.state, c.context), c.state = c.__s;
186
+ while (c.__d && ++R < 25);
187
+ c.state = c.__s, c.getChildContext != null && (i = F(F({}, i), c.getChildContext())), _ || c.getSnapshotBeforeUpdate == null || (p = c.getSnapshotBeforeUpdate(v, h)), Bt(n, ke(P = d != null && d.type === se && d.key == null ? d.props.children : d) ? P : [P], e, t, i, s, o, r, a, u, f), c.base = e.__e, e.__h = null, c.__h.length && r.push(c), y && (c.__E = c.__ = null);
188
+ } catch (ve) {
189
+ e.__v = null, (u || o != null) && (e.__e = a, e.__h = !!u, o[o.indexOf(a)] = null), m.__e(ve, e, t);
190
190
  }
191
191
  else
192
- o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = on(t.__e, e, t, i, s, o, r, u, d);
193
- (h = v.diffed) && h(e);
192
+ o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = gn(t.__e, e, t, i, s, o, r, u, f);
193
+ (d = m.diffed) && d(e);
194
194
  }
195
- function Ht(n, e, t) {
195
+ function Vt(n, e, t) {
196
196
  for (var i = 0; i < t.length; i++)
197
- We(t[i], t[++i], t[++i]);
198
- v.__c && v.__c(e, n), n.some(function(s) {
197
+ Ge(t[i], t[++i], t[++i]);
198
+ m.__c && m.__c(e, n), n.some(function(s) {
199
199
  try {
200
200
  n = s.__h, s.__h = [], n.some(function(o) {
201
201
  o.call(s);
202
202
  });
203
203
  } catch (o) {
204
- v.__e(o, s.__v);
204
+ m.__e(o, s.__v);
205
205
  }
206
206
  });
207
207
  }
208
- function on(n, e, t, i, s, o, r, c, u) {
209
- var d, h, a, _ = t.props, p = e.props, f = e.type, g = 0;
210
- if (f === "svg" && (s = !0), o != null) {
211
- for (; g < o.length; g++)
212
- if ((d = o[g]) && "setAttribute" in d == !!f && (f ? d.localName === f : d.nodeType === 3)) {
213
- n = d, o[g] = null;
208
+ function gn(n, e, t, i, s, o, r, a, u) {
209
+ var f, d, c, _ = t.props, v = e.props, h = e.type, p = 0;
210
+ if (h === "svg" && (s = !0), o != null) {
211
+ for (; p < o.length; p++)
212
+ if ((f = o[p]) && "setAttribute" in f == !!h && (h ? f.localName === h : f.nodeType === 3)) {
213
+ n = f, o[p] = null;
214
214
  break;
215
215
  }
216
216
  }
217
217
  if (n == null) {
218
- if (f === null)
219
- return document.createTextNode(p);
220
- n = s ? document.createElementNS("http://www.w3.org/2000/svg", f) : document.createElement(f, p.is && p), o = null, c = !1;
218
+ if (h === null)
219
+ return document.createTextNode(v);
220
+ n = s ? document.createElementNS("http://www.w3.org/2000/svg", h) : document.createElement(h, v.is && v), o = null, a = !1;
221
221
  }
222
- if (f === null)
223
- _ === p || c && n.data === p || (n.data = p);
222
+ if (h === null)
223
+ _ === v || a && n.data === v || (n.data = v);
224
224
  else {
225
- if (o = o && Se.call(n.childNodes), h = (_ = t.props || Q).dangerouslySetInnerHTML, a = p.dangerouslySetInnerHTML, !c) {
225
+ if (o = o && Ne.call(n.childNodes), d = (_ = t.props || ne).dangerouslySetInnerHTML, c = v.dangerouslySetInnerHTML, !a) {
226
226
  if (o != null)
227
- for (_ = {}, g = 0; g < n.attributes.length; g++)
228
- _[n.attributes[g].name] = n.attributes[g].value;
229
- (a || h) && (a && (h && a.__html == h.__html || a.__html === n.innerHTML) || (n.innerHTML = a && a.__html || ""));
227
+ for (_ = {}, p = 0; p < n.attributes.length; p++)
228
+ _[n.attributes[p].name] = n.attributes[p].value;
229
+ (c || d) && (c && (d && c.__html == d.__html || c.__html === n.innerHTML) || (n.innerHTML = c && c.__html || ""));
230
230
  }
231
- if (sn(n, p, _, s, c), a)
231
+ if (mn(n, v, _, s, a), c)
232
232
  e.__k = [];
233
- else if (Dt(n, ke(g = e.props.children) ? g : [g], e, t, i, s && f !== "foreignObject", o, r, o ? o[0] : t.__k && le(t, 0), c, u), o != null)
234
- for (g = o.length; g--; )
235
- o[g] != null && At(o[g]);
236
- c || ("value" in p && (g = p.value) !== void 0 && (g !== n.value || f === "progress" && !g || f === "option" && g !== _.value) && Ce(n, "value", g, _.value, !1), "checked" in p && (g = p.checked) !== void 0 && g !== n.checked && Ce(n, "checked", g, _.checked, !1));
233
+ else if (Bt(n, ke(p = e.props.children) ? p : [p], e, t, i, s && h !== "foreignObject", o, r, o ? o[0] : t.__k && fe(t, 0), a, u), o != null)
234
+ for (p = o.length; p--; )
235
+ o[p] != null && Rt(o[p]);
236
+ a || ("value" in v && (p = v.value) !== void 0 && (p !== n.value || h === "progress" && !p || h === "option" && p !== _.value) && xe(n, "value", p, _.value, !1), "checked" in v && (p = v.checked) !== void 0 && p !== n.checked && xe(n, "checked", p, _.checked, !1));
237
237
  }
238
238
  return n;
239
239
  }
240
- function We(n, e, t) {
240
+ function Ge(n, e, t) {
241
241
  try {
242
242
  typeof n == "function" ? n(e) : n.current = e;
243
243
  } catch (i) {
244
- v.__e(i, t);
244
+ m.__e(i, t);
245
245
  }
246
246
  }
247
- function Oe(n, e, t) {
247
+ function We(n, e, t) {
248
248
  var i, s;
249
- if (v.unmount && v.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || We(i, null, e)), (i = n.__c) != null) {
249
+ if (m.unmount && m.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Ge(i, null, e)), (i = n.__c) != null) {
250
250
  if (i.componentWillUnmount)
251
251
  try {
252
252
  i.componentWillUnmount();
253
253
  } catch (o) {
254
- v.__e(o, e);
254
+ m.__e(o, e);
255
255
  }
256
256
  i.base = i.__P = null, n.__c = void 0;
257
257
  }
258
258
  if (i = n.__k)
259
259
  for (s = 0; s < i.length; s++)
260
- i[s] && Oe(i[s], e, t || typeof n.type != "function");
261
- t || n.__e == null || At(n.__e), n.__ = n.__e = n.__d = void 0;
260
+ i[s] && We(i[s], e, t || typeof n.type != "function");
261
+ t || n.__e == null || Rt(n.__e), n.__ = n.__e = n.__d = void 0;
262
262
  }
263
- function rn(n, e, t) {
263
+ function yn(n, e, t) {
264
264
  return this.constructor(n, t);
265
265
  }
266
- function K(n, e, t) {
266
+ function te(n, e, t) {
267
267
  var i, s, o, r;
268
- v.__ && v.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Fe(e, n = (!i && t || e).__k = H(te, null, [n]), s || Q, Q, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Se.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Ht(o, n, r);
268
+ m.__ && m.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Ze(e, n = (!i && t || e).__k = I(se, null, [n]), s || ne, ne, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Ne.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Vt(o, n, r);
269
+ }
270
+ function bn(n, e) {
271
+ var t = { __c: e = "__cC" + Lt++, __: n, Consumer: function(i, s) {
272
+ return i.children(s);
273
+ }, Provider: function(i) {
274
+ var s, o;
275
+ return this.getChildContext || (s = [], (o = {})[e] = this, this.getChildContext = function() {
276
+ return o;
277
+ }, this.shouldComponentUpdate = function(r) {
278
+ this.props.value !== r.value && s.some(function(a) {
279
+ a.__e = !0, qe(a);
280
+ });
281
+ }, this.sub = function(r) {
282
+ s.push(r);
283
+ var a = r.componentWillUnmount;
284
+ r.componentWillUnmount = function() {
285
+ s.splice(s.indexOf(r), 1), a && a.call(r);
286
+ };
287
+ }), i.children;
288
+ } };
289
+ return t.Provider.__ = t.Consumer.contextType = t;
269
290
  }
270
- Se = xt.slice, v = { __e: function(n, e, t, i) {
291
+ Ne = Ot.slice, m = { __e: function(n, e, t, i) {
271
292
  for (var s, o, r; e = e.__; )
272
293
  if ((s = e.__c) && !s.__)
273
294
  try {
274
295
  if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(n)), r = s.__d), s.componentDidCatch != null && (s.componentDidCatch(n, i || {}), r = s.__d), r)
275
296
  return s.__E = s;
276
- } catch (c) {
277
- n = c;
297
+ } catch (a) {
298
+ n = a;
278
299
  }
279
300
  throw n;
280
- } }, kt = 0, $t = function(n) {
301
+ } }, Dt = 0, zt = function(n) {
281
302
  return n != null && n.constructor === void 0;
282
- }, M.prototype.setState = function(n, e) {
303
+ }, H.prototype.setState = function(n, e) {
283
304
  var t;
284
- t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = B({}, this.state), typeof n == "function" && (n = n(B({}, t), this.props)), n && B(t, n), n != null && this.__v && (e && this._sb.push(e), Ze(this));
285
- }, M.prototype.forceUpdate = function(n) {
286
- this.__v && (this.__e = !0, n && this.__h.push(n), Ze(this));
287
- }, M.prototype.render = te, X = [], Nt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Re = function(n, e) {
305
+ t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = F({}, this.state), typeof n == "function" && (n = n(F({}, t), this.props)), n && F(t, n), n != null && this.__v && (e && this._sb.push(e), qe(this));
306
+ }, H.prototype.forceUpdate = function(n) {
307
+ this.__v && (this.__e = !0, n && this.__h.push(n), qe(this));
308
+ }, H.prototype.render = se, G = [], Ht = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ve = function(n, e) {
288
309
  return n.__v.__b - e.__v.__b;
289
- }, be.__r = 0;
290
- const an = "ibiz", cn = "is-";
291
- function j(n, e, t, i, s) {
310
+ }, Te.__r = 0, Lt = 0;
311
+ const wn = "ibiz", Cn = "is-";
312
+ function X(n, e, t, i, s) {
292
313
  let o = "".concat(n, "-").concat(e);
293
314
  return t && (o += "-".concat(t)), i && (o += "__".concat(i)), s && (o += "--".concat(s)), o;
294
315
  }
295
- class A {
316
+ class M {
296
317
  /**
297
318
  * Creates an instance of Namespace.
298
319
  *
@@ -309,8 +330,8 @@ class A {
309
330
  * @date 2023-11-03 10:11:31
310
331
  * @type {string}
311
332
  */
312
- y(this, "namespace");
313
- this.block = e, this.namespace = t || an;
333
+ w(this, "namespace");
334
+ this.block = e, this.namespace = t || wn;
314
335
  }
315
336
  /**
316
337
  * namespace-block
@@ -322,7 +343,7 @@ class A {
322
343
  * @return {*} {string}
323
344
  */
324
345
  b(e = "") {
325
- return j(this.namespace, this.block, e, "", "");
346
+ return X(this.namespace, this.block, e, "", "");
326
347
  }
327
348
  /**
328
349
  * namespace-block__element
@@ -333,7 +354,7 @@ class A {
333
354
  * @return {*} {string}
334
355
  */
335
356
  e(e) {
336
- return e ? j(this.namespace, this.block, "", e, "") : "";
357
+ return e ? X(this.namespace, this.block, "", e, "") : "";
337
358
  }
338
359
  /**
339
360
  * namespace-block--modifier
@@ -344,7 +365,7 @@ class A {
344
365
  * @return {*} {string}
345
366
  */
346
367
  m(e) {
347
- return e ? j(this.namespace, this.block, "", "", e) : "";
368
+ return e ? X(this.namespace, this.block, "", "", e) : "";
348
369
  }
349
370
  /**
350
371
  * namespace-block-blockSuffix__element
@@ -356,7 +377,7 @@ class A {
356
377
  * @return {*} {string}
357
378
  */
358
379
  be(e, t) {
359
- return e && t ? j(this.namespace, this.block, e, t, "") : "";
380
+ return e && t ? X(this.namespace, this.block, e, t, "") : "";
360
381
  }
361
382
  /**
362
383
  * namespace-block__element--modifier
@@ -368,7 +389,7 @@ class A {
368
389
  * @return {*} {string}
369
390
  */
370
391
  em(e, t) {
371
- return e && t ? j(this.namespace, this.block, "", e, t) : "";
392
+ return e && t ? X(this.namespace, this.block, "", e, t) : "";
372
393
  }
373
394
  /**
374
395
  * namespace-block-blockSuffix--modifier
@@ -380,7 +401,7 @@ class A {
380
401
  * @return {*} {string}
381
402
  */
382
403
  bm(e, t) {
383
- return e && t ? j(this.namespace, this.block, e, "", t) : "";
404
+ return e && t ? X(this.namespace, this.block, e, "", t) : "";
384
405
  }
385
406
  /**
386
407
  * namespace-block-blockSuffix__element--modifier
@@ -393,7 +414,7 @@ class A {
393
414
  * @return {*} {string}
394
415
  */
395
416
  bem(e, t, i) {
396
- return e && t && i ? j(this.namespace, this.block, e, t, i) : "";
417
+ return e && t && i ? X(this.namespace, this.block, e, t, i) : "";
397
418
  }
398
419
  /**
399
420
  * 返回状态 class
@@ -408,7 +429,7 @@ class A {
408
429
  * @return {*} {string}
409
430
  */
410
431
  is(e, t) {
411
- return e && t ? "".concat(cn).concat(e) : "";
432
+ return e && t ? "".concat(Cn).concat(e) : "";
412
433
  }
413
434
  /**
414
435
  * 生成使用到的 css 变量 style 对象
@@ -461,107 +482,107 @@ class A {
461
482
  return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
462
483
  }
463
484
  }
464
- function z(n) {
485
+ function L(n) {
465
486
  if (typeof n != "string")
466
487
  throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
467
488
  }
468
- function Qe(n, e) {
469
- for (var t = "", i = 0, s = -1, o = 0, r, c = 0; c <= n.length; ++c) {
470
- if (c < n.length)
471
- r = n.charCodeAt(c);
489
+ function st(n, e) {
490
+ for (var t = "", i = 0, s = -1, o = 0, r, a = 0; a <= n.length; ++a) {
491
+ if (a < n.length)
492
+ r = n.charCodeAt(a);
472
493
  else {
473
494
  if (r === 47)
474
495
  break;
475
496
  r = 47;
476
497
  }
477
498
  if (r === 47) {
478
- if (!(s === c - 1 || o === 1))
479
- if (s !== c - 1 && o === 2) {
499
+ if (!(s === a - 1 || o === 1))
500
+ if (s !== a - 1 && o === 2) {
480
501
  if (t.length < 2 || i !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
481
502
  if (t.length > 2) {
482
503
  var u = t.lastIndexOf("/");
483
504
  if (u !== t.length - 1) {
484
- u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s = c, o = 0;
505
+ u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s = a, o = 0;
485
506
  continue;
486
507
  }
487
508
  } else if (t.length === 2 || t.length === 1) {
488
- t = "", i = 0, s = c, o = 0;
509
+ t = "", i = 0, s = a, o = 0;
489
510
  continue;
490
511
  }
491
512
  }
492
513
  e && (t.length > 0 ? t += "/.." : t = "..", i = 2);
493
514
  } else
494
- t.length > 0 ? t += "/" + n.slice(s + 1, c) : t = n.slice(s + 1, c), i = c - s - 1;
495
- s = c, o = 0;
515
+ t.length > 0 ? t += "/" + n.slice(s + 1, a) : t = n.slice(s + 1, a), i = a - s - 1;
516
+ s = a, o = 0;
496
517
  } else
497
518
  r === 46 && o !== -1 ? ++o : o = -1;
498
519
  }
499
520
  return t;
500
521
  }
501
- function ln(n, e) {
522
+ function Tn(n, e) {
502
523
  var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
503
524
  return t ? t === e.root ? t + i : t + n + i : i;
504
525
  }
505
- var re = {
526
+ var ue = {
506
527
  // path.resolve([from ...], to)
507
528
  resolve: function() {
508
529
  for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
509
530
  var o;
510
- s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), z(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
531
+ s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), L(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
511
532
  }
512
- return e = Qe(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
533
+ return e = st(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
513
534
  },
514
535
  normalize: function(e) {
515
- if (z(e), e.length === 0)
536
+ if (L(e), e.length === 0)
516
537
  return ".";
517
538
  var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
518
- return e = Qe(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
539
+ return e = st(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
519
540
  },
520
541
  isAbsolute: function(e) {
521
- return z(e), e.length > 0 && e.charCodeAt(0) === 47;
542
+ return L(e), e.length > 0 && e.charCodeAt(0) === 47;
522
543
  },
523
544
  join: function() {
524
545
  if (arguments.length === 0)
525
546
  return ".";
526
547
  for (var e, t = 0; t < arguments.length; ++t) {
527
548
  var i = arguments[t];
528
- z(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
549
+ L(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
529
550
  }
530
- return e === void 0 ? "." : re.normalize(e);
551
+ return e === void 0 ? "." : ue.normalize(e);
531
552
  },
532
553
  relative: function(e, t) {
533
- if (z(e), z(t), e === t || (e = re.resolve(e), t = re.resolve(t), e === t))
554
+ if (L(e), L(t), e === t || (e = ue.resolve(e), t = ue.resolve(t), e === t))
534
555
  return "";
535
556
  for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
536
557
  ;
537
558
  for (var s = e.length, o = s - i, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
538
559
  ;
539
- for (var c = t.length, u = c - r, d = o < u ? o : u, h = -1, a = 0; a <= d; ++a) {
540
- if (a === d) {
541
- if (u > d) {
542
- if (t.charCodeAt(r + a) === 47)
543
- return t.slice(r + a + 1);
544
- if (a === 0)
545
- return t.slice(r + a);
560
+ for (var a = t.length, u = a - r, f = o < u ? o : u, d = -1, c = 0; c <= f; ++c) {
561
+ if (c === f) {
562
+ if (u > f) {
563
+ if (t.charCodeAt(r + c) === 47)
564
+ return t.slice(r + c + 1);
565
+ if (c === 0)
566
+ return t.slice(r + c);
546
567
  } else
547
- o > d && (e.charCodeAt(i + a) === 47 ? h = a : a === 0 && (h = 0));
568
+ o > f && (e.charCodeAt(i + c) === 47 ? d = c : c === 0 && (d = 0));
548
569
  break;
549
570
  }
550
- var _ = e.charCodeAt(i + a), p = t.charCodeAt(r + a);
551
- if (_ !== p)
571
+ var _ = e.charCodeAt(i + c), v = t.charCodeAt(r + c);
572
+ if (_ !== v)
552
573
  break;
553
- _ === 47 && (h = a);
574
+ _ === 47 && (d = c);
554
575
  }
555
- var f = "";
556
- for (a = i + h + 1; a <= s; ++a)
557
- (a === s || e.charCodeAt(a) === 47) && (f.length === 0 ? f += ".." : f += "/..");
558
- return f.length > 0 ? f + t.slice(r + h) : (r += h, t.charCodeAt(r) === 47 && ++r, t.slice(r));
576
+ var h = "";
577
+ for (c = i + d + 1; c <= s; ++c)
578
+ (c === s || e.charCodeAt(c) === 47) && (h.length === 0 ? h += ".." : h += "/..");
579
+ return h.length > 0 ? h + t.slice(r + d) : (r += d, t.charCodeAt(r) === 47 && ++r, t.slice(r));
559
580
  },
560
581
  _makeLong: function(e) {
561
582
  return e;
562
583
  },
563
584
  dirname: function(e) {
564
- if (z(e), e.length === 0)
585
+ if (L(e), e.length === 0)
565
586
  return ".";
566
587
  for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0, r = e.length - 1; r >= 1; --r)
567
588
  if (t = e.charCodeAt(r), t === 47) {
@@ -576,21 +597,21 @@ var re = {
576
597
  basename: function(e, t) {
577
598
  if (t !== void 0 && typeof t != "string")
578
599
  throw new TypeError('"ext" argument must be a string');
579
- z(e);
600
+ L(e);
580
601
  var i = 0, s = -1, o = !0, r;
581
602
  if (t !== void 0 && t.length > 0 && t.length <= e.length) {
582
603
  if (t.length === e.length && t === e)
583
604
  return "";
584
- var c = t.length - 1, u = -1;
605
+ var a = t.length - 1, u = -1;
585
606
  for (r = e.length - 1; r >= 0; --r) {
586
- var d = e.charCodeAt(r);
587
- if (d === 47) {
607
+ var f = e.charCodeAt(r);
608
+ if (f === 47) {
588
609
  if (!o) {
589
610
  i = r + 1;
590
611
  break;
591
612
  }
592
613
  } else
593
- u === -1 && (o = !1, u = r + 1), c >= 0 && (d === t.charCodeAt(c) ? --c === -1 && (s = r) : (c = -1, s = u));
614
+ u === -1 && (o = !1, u = r + 1), a >= 0 && (f === t.charCodeAt(a) ? --a === -1 && (s = r) : (a = -1, s = u));
594
615
  }
595
616
  return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
596
617
  } else {
@@ -606,17 +627,17 @@ var re = {
606
627
  }
607
628
  },
608
629
  extname: function(e) {
609
- z(e);
610
- for (var t = -1, i = 0, s = -1, o = !0, r = 0, c = e.length - 1; c >= 0; --c) {
611
- var u = e.charCodeAt(c);
630
+ L(e);
631
+ for (var t = -1, i = 0, s = -1, o = !0, r = 0, a = e.length - 1; a >= 0; --a) {
632
+ var u = e.charCodeAt(a);
612
633
  if (u === 47) {
613
634
  if (!o) {
614
- i = c + 1;
635
+ i = a + 1;
615
636
  break;
616
637
  }
617
638
  continue;
618
639
  }
619
- s === -1 && (o = !1, s = c + 1), u === 46 ? t === -1 ? t = c : r !== 1 && (r = 1) : t !== -1 && (r = -1);
640
+ s === -1 && (o = !1, s = a + 1), u === 46 ? t === -1 ? t = a : r !== 1 && (r = 1) : t !== -1 && (r = -1);
620
641
  }
621
642
  return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
622
643
  r === 0 || // The (right-most) trimmed path component is exactly '..'
@@ -625,42 +646,42 @@ var re = {
625
646
  format: function(e) {
626
647
  if (e === null || typeof e != "object")
627
648
  throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
628
- return ln("/", e);
649
+ return Tn("/", e);
629
650
  },
630
651
  parse: function(e) {
631
- z(e);
652
+ L(e);
632
653
  var t = { root: "", dir: "", base: "", ext: "", name: "" };
633
654
  if (e.length === 0)
634
655
  return t;
635
656
  var i = e.charCodeAt(0), s = i === 47, o;
636
657
  s ? (t.root = "/", o = 1) : o = 0;
637
- for (var r = -1, c = 0, u = -1, d = !0, h = e.length - 1, a = 0; h >= o; --h) {
638
- if (i = e.charCodeAt(h), i === 47) {
639
- if (!d) {
640
- c = h + 1;
658
+ for (var r = -1, a = 0, u = -1, f = !0, d = e.length - 1, c = 0; d >= o; --d) {
659
+ if (i = e.charCodeAt(d), i === 47) {
660
+ if (!f) {
661
+ a = d + 1;
641
662
  break;
642
663
  }
643
664
  continue;
644
665
  }
645
- u === -1 && (d = !1, u = h + 1), i === 46 ? r === -1 ? r = h : a !== 1 && (a = 1) : r !== -1 && (a = -1);
666
+ u === -1 && (f = !1, u = d + 1), i === 46 ? r === -1 ? r = d : c !== 1 && (c = 1) : r !== -1 && (c = -1);
646
667
  }
647
668
  return r === -1 || u === -1 || // We saw a non-dot character immediately before the dot
648
- a === 0 || // The (right-most) trimmed path component is exactly '..'
649
- a === 1 && r === u - 1 && r === c + 1 ? u !== -1 && (c === 0 && s ? t.base = t.name = e.slice(1, u) : t.base = t.name = e.slice(c, u)) : (c === 0 && s ? (t.name = e.slice(1, r), t.base = e.slice(1, u)) : (t.name = e.slice(c, r), t.base = e.slice(c, u)), t.ext = e.slice(r, u)), c > 0 ? t.dir = e.slice(0, c - 1) : s && (t.dir = "/"), t;
669
+ c === 0 || // The (right-most) trimmed path component is exactly '..'
670
+ c === 1 && r === u - 1 && r === a + 1 ? u !== -1 && (a === 0 && s ? t.base = t.name = e.slice(1, u) : t.base = t.name = e.slice(a, u)) : (a === 0 && s ? (t.name = e.slice(1, r), t.base = e.slice(1, u)) : (t.name = e.slice(a, r), t.base = e.slice(a, u)), t.ext = e.slice(r, u)), a > 0 ? t.dir = e.slice(0, a - 1) : s && (t.dir = "/"), t;
650
671
  },
651
672
  sep: "/",
652
673
  delimiter: ":",
653
674
  win32: null,
654
675
  posix: null
655
676
  };
656
- re.posix = re;
657
- function O() {
677
+ ue.posix = ue;
678
+ function B() {
658
679
  return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
659
680
  }
660
- function Lt() {
661
- return "".concat(O() + O(), "-").concat(O(), "-").concat(O(), "-").concat(O(), "-").concat(O()).concat(O()).concat(O());
681
+ function qt() {
682
+ return "".concat(B() + B(), "-").concat(B(), "-").concat(B(), "-").concat(B(), "-").concat(B()).concat(B()).concat(B());
662
683
  }
663
- class Rt {
684
+ class Wt {
664
685
  /**
665
686
  * 拷贝文本
666
687
  *
@@ -681,8 +702,8 @@ class Rt {
681
702
  * @private
682
703
  * @type {(HTMLInputElement | null)}
683
704
  */
684
- y(Rt, "inputElement", null);
685
- const m = class m {
705
+ w(Wt, "inputElement", null);
706
+ const g = class g {
686
707
  /**
687
708
  * 检查数据库是否存在
688
709
  *
@@ -705,7 +726,7 @@ const m = class m {
705
726
  */
706
727
  static async deleteDatabase(e) {
707
728
  var t, i;
708
- return m.lastLink && ((i = (t = m.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
729
+ return g.lastLink && ((i = (t = g.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
709
730
  const r = indexedDB.deleteDatabase(e);
710
731
  r.onsuccess = () => {
711
732
  s(!0);
@@ -725,16 +746,16 @@ const m = class m {
725
746
  * @memberof IndexedDBUtil
726
747
  */
727
748
  static async checkTableExists(e, t) {
728
- return await m.checkDataBaseExists(e) ? new Promise((s, o) => {
749
+ return await g.checkDataBaseExists(e) ? new Promise((s, o) => {
729
750
  const r = indexedDB.open(e);
730
- r.onupgradeneeded = (c) => {
731
- m.db = c.target.result, m.version = m.db.version;
732
- }, r.onsuccess = (c) => {
733
- m.db = c.target.result, m.lastLink = r.result;
734
- const u = m.db.objectStoreNames.contains(t);
751
+ r.onupgradeneeded = (a) => {
752
+ g.db = a.target.result, g.version = g.db.version;
753
+ }, r.onsuccess = (a) => {
754
+ g.db = a.target.result, g.lastLink = r.result;
755
+ const u = g.db.objectStoreNames.contains(t);
735
756
  r.result.close(), s(u);
736
- }, r.onerror = (c) => {
737
- o(c.target.error);
757
+ }, r.onerror = (a) => {
758
+ o(a.target.error);
738
759
  };
739
760
  }) : !1;
740
761
  }
@@ -749,16 +770,16 @@ const m = class m {
749
770
  */
750
771
  static async createTable(e, t, i, s = !1) {
751
772
  return new Promise((o) => {
752
- var c, u;
753
- m.version += 1, m.lastLink && ((u = (c = m.lastLink).close) == null || u.call(c));
754
- const r = indexedDB.open(e, m.version);
755
- r.onupgradeneeded = (d) => {
756
- if (m.db = d.target.result, !m.db.objectStoreNames.contains(t)) {
757
- const h = {};
758
- i ? h.keyPath = i : s && (h.autoIncrement = !0), m.db.createObjectStore(t, h);
773
+ var a, u;
774
+ g.version += 1, g.lastLink && ((u = (a = g.lastLink).close) == null || u.call(a));
775
+ const r = indexedDB.open(e, g.version);
776
+ r.onupgradeneeded = (f) => {
777
+ if (g.db = f.target.result, !g.db.objectStoreNames.contains(t)) {
778
+ const d = {};
779
+ i ? d.keyPath = i : s && (d.autoIncrement = !0), g.db.createObjectStore(t, d);
759
780
  }
760
781
  }, r.onsuccess = () => {
761
- m.lastLink = r.result, r.result.close(), o(!0);
782
+ g.lastLink = r.result, r.result.close(), o(!0);
762
783
  }, r.onerror = () => {
763
784
  o(!1);
764
785
  };
@@ -774,12 +795,12 @@ const m = class m {
774
795
  static async deleteTable(e, t) {
775
796
  return new Promise((i) => {
776
797
  var o, r;
777
- m.version += 1, m.lastLink && ((r = (o = m.lastLink).close) == null || r.call(o));
778
- const s = indexedDB.open(e, m.version);
779
- s.onupgradeneeded = (c) => {
780
- m.db = c.target.result, m.lastLink = s.result, m.db.objectStoreNames.contains(t) && m.db.deleteObjectStore(t);
781
- }, s.onsuccess = (c) => {
782
- m.db = c.target.result, m.lastLink = s.result, s.result.close(), i(!0);
798
+ g.version += 1, g.lastLink && ((r = (o = g.lastLink).close) == null || r.call(o));
799
+ const s = indexedDB.open(e, g.version);
800
+ s.onupgradeneeded = (a) => {
801
+ g.db = a.target.result, g.lastLink = s.result, g.db.objectStoreNames.contains(t) && g.db.deleteObjectStore(t);
802
+ }, s.onsuccess = (a) => {
803
+ g.db = a.target.result, g.lastLink = s.result, s.result.close(), i(!0);
783
804
  }, s.onerror = () => {
784
805
  s.result.close(), i(!1);
785
806
  };
@@ -796,12 +817,12 @@ const m = class m {
796
817
  static async addData(e, t, i) {
797
818
  return new Promise((s, o) => {
798
819
  const r = indexedDB.open(e);
799
- r.onsuccess = (c) => {
800
- if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
801
- const h = m.db.transaction([t], "readwrite").objectStore(t).add(i);
802
- h.onsuccess = (a) => {
820
+ r.onsuccess = (a) => {
821
+ if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
822
+ const d = g.db.transaction([t], "readwrite").objectStore(t).add(i);
823
+ d.onsuccess = (c) => {
803
824
  s(i);
804
- }, h.onerror = () => {
825
+ }, d.onerror = () => {
805
826
  s(null);
806
827
  };
807
828
  }
@@ -822,12 +843,12 @@ const m = class m {
822
843
  static async deleteData(e, t, i) {
823
844
  return new Promise((s, o) => {
824
845
  const r = indexedDB.open(e);
825
- r.onsuccess = (c) => {
826
- if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
827
- const h = m.db.transaction([t], "readwrite").objectStore(t).delete(i);
828
- h.onsuccess = (a) => {
846
+ r.onsuccess = (a) => {
847
+ if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
848
+ const d = g.db.transaction([t], "readwrite").objectStore(t).delete(i);
849
+ d.onsuccess = (c) => {
829
850
  s(!0);
830
- }, h.onerror = () => {
851
+ }, d.onerror = () => {
831
852
  s(!1);
832
853
  };
833
854
  }
@@ -848,12 +869,12 @@ const m = class m {
848
869
  static async updateData(e, t, i) {
849
870
  return new Promise((s, o) => {
850
871
  const r = indexedDB.open(e);
851
- r.onsuccess = (c) => {
852
- if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
853
- const h = m.db.transaction([t], "readwrite").objectStore(t).put(i);
854
- h.onsuccess = (a) => {
872
+ r.onsuccess = (a) => {
873
+ if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
874
+ const d = g.db.transaction([t], "readwrite").objectStore(t).put(i);
875
+ d.onsuccess = (c) => {
855
876
  s(i);
856
- }, h.onerror = () => {
877
+ }, d.onerror = () => {
857
878
  s(i);
858
879
  };
859
880
  }
@@ -874,12 +895,12 @@ const m = class m {
874
895
  static async getData(e, t, i) {
875
896
  return new Promise((s, o) => {
876
897
  const r = indexedDB.open(e);
877
- r.onsuccess = (c) => {
878
- if (m.db = c.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
879
- const h = m.db.transaction([t], "readonly").objectStore(t).get(i);
880
- h.onsuccess = (a) => {
881
- s(h.result);
882
- }, h.onerror = () => {
898
+ r.onsuccess = (a) => {
899
+ if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
900
+ const d = g.db.transaction([t], "readonly").objectStore(t).get(i);
901
+ d.onsuccess = (c) => {
902
+ s(d.result);
903
+ }, d.onerror = () => {
883
904
  o(new Error("未找到数据".concat(i)));
884
905
  };
885
906
  }
@@ -900,11 +921,11 @@ const m = class m {
900
921
  return new Promise((i, s) => {
901
922
  const o = indexedDB.open(e);
902
923
  o.onsuccess = (r) => {
903
- if (m.db = r.target.result, m.lastLink = o.result, m.db.objectStoreNames.contains(t)) {
904
- const d = m.db.transaction([t], "readonly").objectStore(t).getAll();
905
- d.onsuccess = (h) => {
906
- i(d.result);
907
- }, d.onerror = () => {
924
+ if (g.db = r.target.result, g.lastLink = o.result, g.db.objectStoreNames.contains(t)) {
925
+ const f = g.db.transaction([t], "readonly").objectStore(t).getAll();
926
+ f.onsuccess = (d) => {
927
+ i(f.result);
928
+ }, f.onerror = () => {
908
929
  i([]);
909
930
  };
910
931
  }
@@ -916,155 +937,326 @@ const m = class m {
916
937
  }
917
938
  };
918
939
  // 数据库版本
919
- y(m, "version", 1), // 数据库连接句柄
920
- y(m, "db", null), // 上一个连接
921
- y(m, "lastLink");
922
- let U = m;
923
- var ue, S, De, et, he = 0, Ot = [], ge = [], tt = v.__b, nt = v.__r, it = v.diffed, st = v.__c, ot = v.unmount;
924
- function Ve(n, e) {
925
- v.__h && v.__h(S, n, he || e), he = 0;
940
+ w(g, "version", 1), // 数据库连接句柄
941
+ w(g, "db", null), // 上一个连接
942
+ w(g, "lastLink");
943
+ let V = g;
944
+ class Sn {
945
+ /**
946
+ * Creates an instance of FileUploader.
947
+ * @author tony001
948
+ * @date 2025-02-28 15:02:15
949
+ * @param {FileUploaderOptions<T>} options
950
+ */
951
+ constructor(e) {
952
+ w(this, "options");
953
+ this.options = {
954
+ multiple: !0,
955
+ accept: "*/*",
956
+ maxSize: 5 * 1024 * 1024,
957
+ ...e
958
+ };
959
+ }
960
+ /**
961
+ * 打开文件选择对话框
962
+ */
963
+ openFilePicker() {
964
+ const e = document.createElement("input");
965
+ e.type = "file", e.multiple = this.options.multiple, e.accept = this.options.accept || "", e.onchange = (t) => {
966
+ const i = Array.from(t.target.files || []);
967
+ this.handleFiles(i);
968
+ }, e.click();
969
+ }
970
+ /**
971
+ * 处理选择的文件
972
+ */
973
+ async handleFiles(e) {
974
+ var i, s;
975
+ if (e.length === 0)
976
+ return;
977
+ const t = e.filter((o) => {
978
+ var r, a;
979
+ return this.options.maxSize && o.size > this.options.maxSize ? ((a = (r = this.options).onError) == null || a.call(r, new Error("文件大小超过限制 (".concat(this.formatSize(o.size), " > ").concat(this.formatSize(this.options.maxSize), ")")), o), !1) : !0;
980
+ });
981
+ (s = (i = this.options).onSelect) == null || s.call(i, t), await Promise.all(t.map((o) => this.processFile(o)));
982
+ }
983
+ /**
984
+ * 处理单个文件上传
985
+ */
986
+ async processFile(e) {
987
+ var t, i, s, o, r, a;
988
+ try {
989
+ const u = (d) => {
990
+ var c, _;
991
+ (_ = (c = this.options).onProgress) == null || _.call(c, e, d);
992
+ }, f = await this.options.onUpload(e, u);
993
+ (i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, f, e);
994
+ } catch (u) {
995
+ (a = (r = this.options).onError) == null || a.call(r, u instanceof Error ? u : new Error("上传失败"), e);
996
+ }
997
+ }
998
+ /**
999
+ * 格式化文件大小
1000
+ */
1001
+ formatSize(e) {
1002
+ if (e === 0)
1003
+ return "0 B";
1004
+ const t = ["B", "KB", "MB", "GB"], i = Math.floor(Math.log(e) / Math.log(1024));
1005
+ return "".concat((e / 1024 ** i).toFixed(2), " ").concat(t[i]);
1006
+ }
1007
+ }
1008
+ class jt {
1009
+ /**
1010
+ * 从XML元素中提取CDATA内容
1011
+ *
1012
+ * @author tony001
1013
+ * @date 2025-03-03 15:03:43
1014
+ * @private
1015
+ * @static
1016
+ * @param {(Element | null)} element
1017
+ * @return {*} {(string | null)}
1018
+ */
1019
+ static getCdataContent(e) {
1020
+ if (!e)
1021
+ return null;
1022
+ const t = Array.from(e.childNodes).find((i) => i.nodeType === i.CDATA_SECTION_NODE);
1023
+ return (t == null ? void 0 : t.nodeValue) || e.textContent;
1024
+ }
1025
+ /**
1026
+ * XML 字符串转数据对象
1027
+ *
1028
+ * @author tony001
1029
+ * @date 2025-03-03 11:03:17
1030
+ * @static
1031
+ * @param {string} xmlString
1032
+ * @return {*} {IMaterial[]}
1033
+ */
1034
+ static parse(e) {
1035
+ const i = new DOMParser().parseFromString(e, "text/xml");
1036
+ return Array.from(i.querySelectorAll("resource")).map((o) => {
1037
+ const r = o.getAttribute("type") || "", a = o.querySelector("data"), u = o.querySelector("metadata");
1038
+ try {
1039
+ const f = this.getCdataContent(a), d = this.getCdataContent(u), c = f ? JSON.parse(f) : {}, _ = d ? JSON.parse(d) : {};
1040
+ return {
1041
+ id: c.id,
1042
+ type: r,
1043
+ data: c,
1044
+ metadata: _
1045
+ };
1046
+ } catch (f) {
1047
+ throw new Error("XML 解析错误: ".concat(f.message));
1048
+ }
1049
+ });
1050
+ }
1051
+ /**
1052
+ * 混合内容解析
1053
+ *
1054
+ * @author tony001
1055
+ * @date 2025-03-03 13:03:35
1056
+ * @static
1057
+ * @param {string} input 包含 XML 和其他文本的混合字符串
1058
+ * @return {*} {{
1059
+ * resources: IMaterial[];
1060
+ * remainingText: string;
1061
+ * hasResources: boolean;
1062
+ * error?: string;
1063
+ * }}
1064
+ */
1065
+ static parseMixedContent(e) {
1066
+ const i = /<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(e);
1067
+ if (!i)
1068
+ return {
1069
+ resources: [],
1070
+ remainingText: e,
1071
+ hasResources: !1
1072
+ };
1073
+ const [s] = i, o = i.index, r = o + s.length, a = e.slice(0, o) + e.slice(r);
1074
+ try {
1075
+ return {
1076
+ resources: this.parse(s),
1077
+ remainingText: a,
1078
+ hasResources: !0
1079
+ };
1080
+ } catch (u) {
1081
+ return {
1082
+ resources: [],
1083
+ remainingText: a,
1084
+ hasResources: !0,
1085
+ error: "资源解析失败: ".concat(u.message)
1086
+ };
1087
+ }
1088
+ }
1089
+ /**
1090
+ * 数据对象转 XML 字符串
1091
+ *
1092
+ * @author tony001
1093
+ * @date 2025-03-03 11:03:51
1094
+ * @static
1095
+ * @param {IMaterial[]} resources
1096
+ * @return {*} {string}
1097
+ */
1098
+ static stringify(e) {
1099
+ const t = document.implementation.createDocument(null, null, null), i = t.createElement("resources");
1100
+ return i.setAttribute("version", "1.0"), e.forEach((s) => {
1101
+ const o = t.createElement("resource");
1102
+ o.setAttribute("type", s.type), o.setAttribute("version", "1.0");
1103
+ const r = (a, u) => {
1104
+ const f = t.createElement(a), d = t.createCDATASection(JSON.stringify(u));
1105
+ return f.appendChild(d), f;
1106
+ };
1107
+ o.appendChild(r("data", s.data)), o.appendChild(r("metadata", s.metadata)), i.appendChild(o);
1108
+ }), t.appendChild(i), new XMLSerializer().serializeToString(t);
1109
+ }
1110
+ }
1111
+ var oe, S, Le, ot, pe = 0, Yt = [], we = [], rt = m.__b, at = m.__r, ct = m.diffed, lt = m.__c, ut = m.unmount;
1112
+ function Me(n, e) {
1113
+ m.__h && m.__h(S, n, pe || e), pe = 0;
926
1114
  var t = S.__H || (S.__H = { __: [], __h: [] });
927
- return n >= t.__.length && t.__.push({ __V: ge }), t.__[n];
1115
+ return n >= t.__.length && t.__.push({ __V: we }), t.__[n];
928
1116
  }
929
- function Pt(n) {
930
- return he = 1, un(Ut, n);
1117
+ function Je(n) {
1118
+ return pe = 1, xn(Zt, n);
931
1119
  }
932
- function un(n, e, t) {
933
- var i = Ve(ue++, 2);
934
- if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Ut(void 0, e), function(c) {
935
- var u = i.__N ? i.__N[0] : i.__[0], d = i.t(u, c);
936
- u !== d && (i.__N = [d, i.__[1]], i.__c.setState({}));
1120
+ function xn(n, e, t) {
1121
+ var i = Me(oe++, 2);
1122
+ if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Zt(void 0, e), function(a) {
1123
+ var u = i.__N ? i.__N[0] : i.__[0], f = i.t(u, a);
1124
+ u !== f && (i.__N = [f, i.__[1]], i.__c.setState({}));
937
1125
  }], i.__c = S, !S.u)) {
938
- var s = function(c, u, d) {
1126
+ var s = function(a, u, f) {
939
1127
  if (!i.__c.__H)
940
1128
  return !0;
941
- var h = i.__c.__H.__.filter(function(_) {
1129
+ var d = i.__c.__H.__.filter(function(_) {
942
1130
  return _.__c;
943
1131
  });
944
- if (h.every(function(_) {
1132
+ if (d.every(function(_) {
945
1133
  return !_.__N;
946
1134
  }))
947
- return !o || o.call(this, c, u, d);
948
- var a = !1;
949
- return h.forEach(function(_) {
1135
+ return !o || o.call(this, a, u, f);
1136
+ var c = !1;
1137
+ return d.forEach(function(_) {
950
1138
  if (_.__N) {
951
- var p = _.__[0];
952
- _.__ = _.__N, _.__N = void 0, p !== _.__[0] && (a = !0);
1139
+ var v = _.__[0];
1140
+ _.__ = _.__N, _.__N = void 0, v !== _.__[0] && (c = !0);
953
1141
  }
954
- }), !(!a && i.__c.props === c) && (!o || o.call(this, c, u, d));
1142
+ }), !(!c && i.__c.props === a) && (!o || o.call(this, a, u, f));
955
1143
  };
956
1144
  S.u = !0;
957
1145
  var o = S.shouldComponentUpdate, r = S.componentWillUpdate;
958
- S.componentWillUpdate = function(c, u, d) {
1146
+ S.componentWillUpdate = function(a, u, f) {
959
1147
  if (this.__e) {
960
- var h = o;
961
- o = void 0, s(c, u, d), o = h;
1148
+ var d = o;
1149
+ o = void 0, s(a, u, f), o = d;
962
1150
  }
963
- r && r.call(this, c, u, d);
1151
+ r && r.call(this, a, u, f);
964
1152
  }, S.shouldComponentUpdate = s;
965
1153
  }
966
1154
  return i.__N || i.__;
967
1155
  }
968
- function F(n, e) {
969
- var t = Ve(ue++, 3);
970
- !v.__s && Bt(t.__H, e) && (t.__ = n, t.i = e, S.__H.__h.push(t));
1156
+ function q(n, e) {
1157
+ var t = Me(oe++, 3);
1158
+ !m.__s && Xt(t.__H, e) && (t.__ = n, t.i = e, S.__H.__h.push(t));
971
1159
  }
972
- function Z(n) {
973
- return he = 5, G(function() {
1160
+ function K(n) {
1161
+ return pe = 5, j(function() {
974
1162
  return { current: n };
975
1163
  }, []);
976
1164
  }
977
- function G(n, e) {
978
- var t = Ve(ue++, 7);
979
- return Bt(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
1165
+ function j(n, e) {
1166
+ var t = Me(oe++, 7);
1167
+ return Xt(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
980
1168
  }
981
- function rt(n, e) {
982
- return he = 8, G(function() {
1169
+ function dt(n, e) {
1170
+ return pe = 8, j(function() {
983
1171
  return n;
984
1172
  }, e);
985
1173
  }
986
- function hn() {
987
- for (var n; n = Ot.shift(); )
1174
+ function En(n) {
1175
+ var e = S.context[n.__c], t = Me(oe++, 9);
1176
+ return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(S)), e.props.value) : n.__;
1177
+ }
1178
+ function $n() {
1179
+ for (var n; n = Yt.shift(); )
988
1180
  if (n.__P && n.__H)
989
1181
  try {
990
- n.__H.__h.forEach(ye), n.__H.__h.forEach(Pe), n.__H.__h = [];
1182
+ n.__H.__h.forEach(Ce), n.__H.__h.forEach(je), n.__H.__h = [];
991
1183
  } catch (e) {
992
- n.__H.__h = [], v.__e(e, n.__v);
1184
+ n.__H.__h = [], m.__e(e, n.__v);
993
1185
  }
994
1186
  }
995
- v.__b = function(n) {
996
- S = null, tt && tt(n);
997
- }, v.__r = function(n) {
998
- nt && nt(n), ue = 0;
1187
+ m.__b = function(n) {
1188
+ S = null, rt && rt(n);
1189
+ }, m.__r = function(n) {
1190
+ at && at(n), oe = 0;
999
1191
  var e = (S = n.__c).__H;
1000
- e && (De === S ? (e.__h = [], S.__h = [], e.__.forEach(function(t) {
1001
- t.__N && (t.__ = t.__N), t.__V = ge, t.__N = t.i = void 0;
1002
- })) : (e.__h.forEach(ye), e.__h.forEach(Pe), e.__h = [], ue = 0)), De = S;
1003
- }, v.diffed = function(n) {
1004
- it && it(n);
1192
+ e && (Le === S ? (e.__h = [], S.__h = [], e.__.forEach(function(t) {
1193
+ t.__N && (t.__ = t.__N), t.__V = we, t.__N = t.i = void 0;
1194
+ })) : (e.__h.forEach(Ce), e.__h.forEach(je), e.__h = [], oe = 0)), Le = S;
1195
+ }, m.diffed = function(n) {
1196
+ ct && ct(n);
1005
1197
  var e = n.__c;
1006
- e && e.__H && (e.__H.__h.length && (Ot.push(e) !== 1 && et === v.requestAnimationFrame || ((et = v.requestAnimationFrame) || dn)(hn)), e.__H.__.forEach(function(t) {
1007
- t.i && (t.__H = t.i), t.__V !== ge && (t.__ = t.__V), t.i = void 0, t.__V = ge;
1008
- })), De = S = null;
1009
- }, v.__c = function(n, e) {
1198
+ e && e.__H && (e.__H.__h.length && (Yt.push(e) !== 1 && ot === m.requestAnimationFrame || ((ot = m.requestAnimationFrame) || Nn)($n)), e.__H.__.forEach(function(t) {
1199
+ t.i && (t.__H = t.i), t.__V !== we && (t.__ = t.__V), t.i = void 0, t.__V = we;
1200
+ })), Le = S = null;
1201
+ }, m.__c = function(n, e) {
1010
1202
  e.some(function(t) {
1011
1203
  try {
1012
- t.__h.forEach(ye), t.__h = t.__h.filter(function(i) {
1013
- return !i.__ || Pe(i);
1204
+ t.__h.forEach(Ce), t.__h = t.__h.filter(function(i) {
1205
+ return !i.__ || je(i);
1014
1206
  });
1015
1207
  } catch (i) {
1016
1208
  e.some(function(s) {
1017
1209
  s.__h && (s.__h = []);
1018
- }), e = [], v.__e(i, t.__v);
1210
+ }), e = [], m.__e(i, t.__v);
1019
1211
  }
1020
- }), st && st(n, e);
1021
- }, v.unmount = function(n) {
1022
- ot && ot(n);
1212
+ }), lt && lt(n, e);
1213
+ }, m.unmount = function(n) {
1214
+ ut && ut(n);
1023
1215
  var e, t = n.__c;
1024
1216
  t && t.__H && (t.__H.__.forEach(function(i) {
1025
1217
  try {
1026
- ye(i);
1218
+ Ce(i);
1027
1219
  } catch (s) {
1028
1220
  e = s;
1029
1221
  }
1030
- }), t.__H = void 0, e && v.__e(e, t.__v));
1222
+ }), t.__H = void 0, e && m.__e(e, t.__v));
1031
1223
  };
1032
- var at = typeof requestAnimationFrame == "function";
1033
- function dn(n) {
1224
+ var ht = typeof requestAnimationFrame == "function";
1225
+ function Nn(n) {
1034
1226
  var e, t = function() {
1035
- clearTimeout(i), at && cancelAnimationFrame(e), setTimeout(n);
1227
+ clearTimeout(i), ht && cancelAnimationFrame(e), setTimeout(n);
1036
1228
  }, i = setTimeout(t, 100);
1037
- at && (e = requestAnimationFrame(t));
1229
+ ht && (e = requestAnimationFrame(t));
1038
1230
  }
1039
- function ye(n) {
1231
+ function Ce(n) {
1040
1232
  var e = S, t = n.__c;
1041
1233
  typeof t == "function" && (n.__c = void 0, t()), S = e;
1042
1234
  }
1043
- function Pe(n) {
1235
+ function je(n) {
1044
1236
  var e = S;
1045
1237
  n.__c = n.__(), S = e;
1046
1238
  }
1047
- function Bt(n, e) {
1239
+ function Xt(n, e) {
1048
1240
  return !n || n.length !== e.length || e.some(function(t, i) {
1049
1241
  return t !== n[i];
1050
1242
  });
1051
1243
  }
1052
- function Ut(n, e) {
1244
+ function Zt(n, e) {
1053
1245
  return typeof e == "function" ? e(n) : e;
1054
1246
  }
1055
- function $e() {
1247
+ function Ae() {
1056
1248
  throw new Error("Cycle detected");
1057
1249
  }
1058
- var fn = Symbol.for("preact-signals");
1059
- function je() {
1060
- if (ee > 1)
1061
- ee--;
1250
+ var kn = Symbol.for("preact-signals");
1251
+ function Ke() {
1252
+ if (ie > 1)
1253
+ ie--;
1062
1254
  else {
1063
- for (var n, e = !1; ae !== void 0; ) {
1064
- var t = ae;
1065
- for (ae = void 0, Be++; t !== void 0; ) {
1255
+ for (var n, e = !1; de !== void 0; ) {
1256
+ var t = de;
1257
+ for (de = void 0, Ye++; t !== void 0; ) {
1066
1258
  var i = t.o;
1067
- if (t.o = void 0, t.f &= -3, !(8 & t.f) && Wt(t))
1259
+ if (t.o = void 0, t.f &= -3, !(8 & t.f) && Jt(t))
1068
1260
  try {
1069
1261
  t.c();
1070
1262
  } catch (s) {
@@ -1073,39 +1265,39 @@ function je() {
1073
1265
  t = i;
1074
1266
  }
1075
1267
  }
1076
- if (Be = 0, ee--, e)
1268
+ if (Ye = 0, ie--, e)
1077
1269
  throw n;
1078
1270
  }
1079
1271
  }
1080
- var w = void 0, ae = void 0, ee = 0, Be = 0, Te = 0;
1081
- function Ft(n) {
1082
- if (w !== void 0) {
1272
+ var x = void 0, de = void 0, ie = 0, Ye = 0, Ee = 0;
1273
+ function Gt(n) {
1274
+ if (x !== void 0) {
1083
1275
  var e = n.n;
1084
- if (e === void 0 || e.t !== w)
1085
- return e = { i: 0, S: n, p: w.s, n: void 0, t: w, e: void 0, x: void 0, r: e }, w.s !== void 0 && (w.s.n = e), w.s = e, n.n = e, 32 & w.f && n.S(e), e;
1276
+ if (e === void 0 || e.t !== x)
1277
+ return e = { i: 0, S: n, p: x.s, n: void 0, t: x, e: void 0, x: void 0, r: e }, x.s !== void 0 && (x.s.n = e), x.s = e, n.n = e, 32 & x.f && n.S(e), e;
1086
1278
  if (e.i === -1)
1087
- return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = w.s, e.n = void 0, w.s.n = e, w.s = e), e;
1279
+ return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = x.s, e.n = void 0, x.s.n = e, x.s = e), e;
1088
1280
  }
1089
1281
  }
1090
- function $(n) {
1282
+ function A(n) {
1091
1283
  this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
1092
1284
  }
1093
- $.prototype.brand = fn;
1094
- $.prototype.h = function() {
1285
+ A.prototype.brand = kn;
1286
+ A.prototype.h = function() {
1095
1287
  return !0;
1096
1288
  };
1097
- $.prototype.S = function(n) {
1289
+ A.prototype.S = function(n) {
1098
1290
  this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
1099
1291
  };
1100
- $.prototype.U = function(n) {
1292
+ A.prototype.U = function(n) {
1101
1293
  if (this.t !== void 0) {
1102
1294
  var e = n.e, t = n.x;
1103
1295
  e !== void 0 && (e.x = t, n.e = void 0), t !== void 0 && (t.e = e, n.x = void 0), n === this.t && (this.t = t);
1104
1296
  }
1105
1297
  };
1106
- $.prototype.subscribe = function(n) {
1298
+ A.prototype.subscribe = function(n) {
1107
1299
  var e = this;
1108
- return Ne(function() {
1300
+ return Ie(function() {
1109
1301
  var t = e.value, i = 32 & this.f;
1110
1302
  this.f &= -33;
1111
1303
  try {
@@ -1115,44 +1307,44 @@ $.prototype.subscribe = function(n) {
1115
1307
  }
1116
1308
  });
1117
1309
  };
1118
- $.prototype.valueOf = function() {
1310
+ A.prototype.valueOf = function() {
1119
1311
  return this.value;
1120
1312
  };
1121
- $.prototype.toString = function() {
1313
+ A.prototype.toString = function() {
1122
1314
  return this.value + "";
1123
1315
  };
1124
- $.prototype.toJSON = function() {
1316
+ A.prototype.toJSON = function() {
1125
1317
  return this.value;
1126
1318
  };
1127
- $.prototype.peek = function() {
1319
+ A.prototype.peek = function() {
1128
1320
  return this.v;
1129
1321
  };
1130
- Object.defineProperty($.prototype, "value", { get: function() {
1131
- var n = Ft(this);
1322
+ Object.defineProperty(A.prototype, "value", { get: function() {
1323
+ var n = Gt(this);
1132
1324
  return n !== void 0 && (n.i = this.i), this.v;
1133
1325
  }, set: function(n) {
1134
- if (w instanceof V && function() {
1326
+ if (x instanceof Y && function() {
1135
1327
  throw new Error("Computed cannot have side-effects");
1136
1328
  }(), n !== this.v) {
1137
- Be > 100 && $e(), this.v = n, this.i++, Te++, ee++;
1329
+ Ye > 100 && Ae(), this.v = n, this.i++, Ee++, ie++;
1138
1330
  try {
1139
1331
  for (var e = this.t; e !== void 0; e = e.x)
1140
1332
  e.t.N();
1141
1333
  } finally {
1142
- je();
1334
+ Ke();
1143
1335
  }
1144
1336
  }
1145
1337
  } });
1146
- function ne(n) {
1147
- return new $(n);
1338
+ function J(n) {
1339
+ return new A(n);
1148
1340
  }
1149
- function Wt(n) {
1341
+ function Jt(n) {
1150
1342
  for (var e = n.s; e !== void 0; e = e.n)
1151
1343
  if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
1152
1344
  return !0;
1153
1345
  return !1;
1154
1346
  }
1155
- function Vt(n) {
1347
+ function Kt(n) {
1156
1348
  for (var e = n.s; e !== void 0; e = e.n) {
1157
1349
  var t = e.S.n;
1158
1350
  if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
@@ -1161,99 +1353,99 @@ function Vt(n) {
1161
1353
  }
1162
1354
  }
1163
1355
  }
1164
- function jt(n) {
1356
+ function Qt(n) {
1165
1357
  for (var e = n.s, t = void 0; e !== void 0; ) {
1166
1358
  var i = e.p;
1167
1359
  e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
1168
1360
  }
1169
1361
  n.s = t;
1170
1362
  }
1171
- function V(n) {
1172
- $.call(this, void 0), this.x = n, this.s = void 0, this.g = Te - 1, this.f = 4;
1363
+ function Y(n) {
1364
+ A.call(this, void 0), this.x = n, this.s = void 0, this.g = Ee - 1, this.f = 4;
1173
1365
  }
1174
- (V.prototype = new $()).h = function() {
1366
+ (Y.prototype = new A()).h = function() {
1175
1367
  if (this.f &= -3, 1 & this.f)
1176
1368
  return !1;
1177
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Te))
1369
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ee))
1178
1370
  return !0;
1179
- if (this.g = Te, this.f |= 1, this.i > 0 && !Wt(this))
1371
+ if (this.g = Ee, this.f |= 1, this.i > 0 && !Jt(this))
1180
1372
  return this.f &= -2, !0;
1181
- var n = w;
1373
+ var n = x;
1182
1374
  try {
1183
- Vt(this), w = this;
1375
+ Kt(this), x = this;
1184
1376
  var e = this.x();
1185
1377
  (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
1186
1378
  } catch (t) {
1187
1379
  this.v = t, this.f |= 16, this.i++;
1188
1380
  }
1189
- return w = n, jt(this), this.f &= -2, !0;
1381
+ return x = n, Qt(this), this.f &= -2, !0;
1190
1382
  };
1191
- V.prototype.S = function(n) {
1383
+ Y.prototype.S = function(n) {
1192
1384
  if (this.t === void 0) {
1193
1385
  this.f |= 36;
1194
1386
  for (var e = this.s; e !== void 0; e = e.n)
1195
1387
  e.S.S(e);
1196
1388
  }
1197
- $.prototype.S.call(this, n);
1389
+ A.prototype.S.call(this, n);
1198
1390
  };
1199
- V.prototype.U = function(n) {
1200
- if (this.t !== void 0 && ($.prototype.U.call(this, n), this.t === void 0)) {
1391
+ Y.prototype.U = function(n) {
1392
+ if (this.t !== void 0 && (A.prototype.U.call(this, n), this.t === void 0)) {
1201
1393
  this.f &= -33;
1202
1394
  for (var e = this.s; e !== void 0; e = e.n)
1203
1395
  e.S.U(e);
1204
1396
  }
1205
1397
  };
1206
- V.prototype.N = function() {
1398
+ Y.prototype.N = function() {
1207
1399
  if (!(2 & this.f)) {
1208
1400
  this.f |= 6;
1209
1401
  for (var n = this.t; n !== void 0; n = n.x)
1210
1402
  n.t.N();
1211
1403
  }
1212
1404
  };
1213
- V.prototype.peek = function() {
1214
- if (this.h() || $e(), 16 & this.f)
1405
+ Y.prototype.peek = function() {
1406
+ if (this.h() || Ae(), 16 & this.f)
1215
1407
  throw this.v;
1216
1408
  return this.v;
1217
1409
  };
1218
- Object.defineProperty(V.prototype, "value", { get: function() {
1219
- 1 & this.f && $e();
1220
- var n = Ft(this);
1410
+ Object.defineProperty(Y.prototype, "value", { get: function() {
1411
+ 1 & this.f && Ae();
1412
+ var n = Gt(this);
1221
1413
  if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
1222
1414
  throw this.v;
1223
1415
  return this.v;
1224
1416
  } });
1225
- function Yt(n) {
1226
- return new V(n);
1417
+ function en(n) {
1418
+ return new Y(n);
1227
1419
  }
1228
- function qt(n) {
1420
+ function tn(n) {
1229
1421
  var e = n.u;
1230
1422
  if (n.u = void 0, typeof e == "function") {
1231
- ee++;
1232
- var t = w;
1233
- w = void 0;
1423
+ ie++;
1424
+ var t = x;
1425
+ x = void 0;
1234
1426
  try {
1235
1427
  e();
1236
1428
  } catch (i) {
1237
- throw n.f &= -2, n.f |= 8, Ye(n), i;
1429
+ throw n.f &= -2, n.f |= 8, Qe(n), i;
1238
1430
  } finally {
1239
- w = t, je();
1431
+ x = t, Ke();
1240
1432
  }
1241
1433
  }
1242
1434
  }
1243
- function Ye(n) {
1435
+ function Qe(n) {
1244
1436
  for (var e = n.s; e !== void 0; e = e.n)
1245
1437
  e.S.U(e);
1246
- n.x = void 0, n.s = void 0, qt(n);
1438
+ n.x = void 0, n.s = void 0, tn(n);
1247
1439
  }
1248
- function _n(n) {
1249
- if (w !== this)
1440
+ function Mn(n) {
1441
+ if (x !== this)
1250
1442
  throw new Error("Out-of-order effect");
1251
- jt(this), w = n, this.f &= -2, 8 & this.f && Ye(this), je();
1443
+ Qt(this), x = n, this.f &= -2, 8 & this.f && Qe(this), Ke();
1252
1444
  }
1253
- function de(n) {
1445
+ function _e(n) {
1254
1446
  this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
1255
1447
  }
1256
- de.prototype.c = function() {
1448
+ _e.prototype.c = function() {
1257
1449
  var n = this.S();
1258
1450
  try {
1259
1451
  if (8 & this.f || this.x === void 0)
@@ -1264,19 +1456,19 @@ de.prototype.c = function() {
1264
1456
  n();
1265
1457
  }
1266
1458
  };
1267
- de.prototype.S = function() {
1268
- 1 & this.f && $e(), this.f |= 1, this.f &= -9, qt(this), Vt(this), ee++;
1269
- var n = w;
1270
- return w = this, _n.bind(this, n);
1459
+ _e.prototype.S = function() {
1460
+ 1 & this.f && Ae(), this.f |= 1, this.f &= -9, tn(this), Kt(this), ie++;
1461
+ var n = x;
1462
+ return x = this, Mn.bind(this, n);
1271
1463
  };
1272
- de.prototype.N = function() {
1273
- 2 & this.f || (this.f |= 2, this.o = ae, ae = this);
1464
+ _e.prototype.N = function() {
1465
+ 2 & this.f || (this.f |= 2, this.o = de, de = this);
1274
1466
  };
1275
- de.prototype.d = function() {
1276
- this.f |= 8, 1 & this.f || Ye(this);
1467
+ _e.prototype.d = function() {
1468
+ this.f |= 8, 1 & this.f || Qe(this);
1277
1469
  };
1278
- function Ne(n) {
1279
- var e = new de(n);
1470
+ function Ie(n) {
1471
+ var e = new _e(n);
1280
1472
  try {
1281
1473
  e.c();
1282
1474
  } catch (t) {
@@ -1284,18 +1476,18 @@ function Ne(n) {
1284
1476
  }
1285
1477
  return e.d.bind(e);
1286
1478
  }
1287
- var xe, Me;
1288
- function ie(n, e) {
1289
- v[n] = e.bind(null, v[n] || function() {
1479
+ var De, Oe;
1480
+ function re(n, e) {
1481
+ m[n] = e.bind(null, m[n] || function() {
1290
1482
  });
1291
1483
  }
1292
- function Ee(n) {
1293
- Me && Me(), Me = n && n.S();
1484
+ function $e(n) {
1485
+ Oe && Oe(), Oe = n && n.S();
1294
1486
  }
1295
- function Xt(n) {
1487
+ function nn(n) {
1296
1488
  var e = this, t = n.data, i = W(t);
1297
1489
  i.value = t;
1298
- var s = G(function() {
1490
+ var s = j(function() {
1299
1491
  for (var o = e.__v; o = o.__; )
1300
1492
  if (o.__c) {
1301
1493
  o.__c.__$f |= 4;
@@ -1303,46 +1495,46 @@ function Xt(n) {
1303
1495
  }
1304
1496
  return e.__$u.c = function() {
1305
1497
  var r;
1306
- !$t(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
1307
- }, Yt(function() {
1498
+ !zt(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
1499
+ }, en(function() {
1308
1500
  var r = i.value.value;
1309
1501
  return r === 0 ? 0 : r === !0 ? "" : r || "";
1310
1502
  });
1311
1503
  }, []);
1312
1504
  return s.value;
1313
1505
  }
1314
- Xt.displayName = "_st";
1315
- Object.defineProperties($.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Xt }, props: { configurable: !0, get: function() {
1506
+ nn.displayName = "_st";
1507
+ Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: nn }, props: { configurable: !0, get: function() {
1316
1508
  return { data: this };
1317
1509
  } }, __b: { configurable: !0, value: 1 } });
1318
- ie("__b", function(n, e) {
1510
+ re("__b", function(n, e) {
1319
1511
  if (typeof e.type == "string") {
1320
1512
  var t, i = e.props;
1321
1513
  for (var s in i)
1322
1514
  if (s !== "children") {
1323
1515
  var o = i[s];
1324
- o instanceof $ && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
1516
+ o instanceof A && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
1325
1517
  }
1326
1518
  }
1327
1519
  n(e);
1328
1520
  });
1329
- ie("__r", function(n, e) {
1330
- Ee();
1521
+ re("__r", function(n, e) {
1522
+ $e();
1331
1523
  var t, i = e.__c;
1332
1524
  i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
1333
1525
  var o;
1334
- return Ne(function() {
1526
+ return Ie(function() {
1335
1527
  o = this;
1336
1528
  }), o.c = function() {
1337
1529
  i.__$f |= 1, i.setState({});
1338
1530
  }, o;
1339
- }())), xe = i, Ee(t), n(e);
1531
+ }())), De = i, $e(t), n(e);
1340
1532
  });
1341
- ie("__e", function(n, e, t, i) {
1342
- Ee(), xe = void 0, n(e, t, i);
1533
+ re("__e", function(n, e, t, i) {
1534
+ $e(), De = void 0, n(e, t, i);
1343
1535
  });
1344
- ie("diffed", function(n, e) {
1345
- Ee(), xe = void 0;
1536
+ re("diffed", function(n, e) {
1537
+ $e(), De = void 0;
1346
1538
  var t;
1347
1539
  if (typeof e.type == "string" && (t = e.__e)) {
1348
1540
  var i = e.__np, s = e.props;
@@ -1350,29 +1542,29 @@ ie("diffed", function(n, e) {
1350
1542
  var o = t.U;
1351
1543
  if (o)
1352
1544
  for (var r in o) {
1353
- var c = o[r];
1354
- c !== void 0 && !(r in i) && (c.d(), o[r] = void 0);
1545
+ var a = o[r];
1546
+ a !== void 0 && !(r in i) && (a.d(), o[r] = void 0);
1355
1547
  }
1356
1548
  else
1357
1549
  t.U = o = {};
1358
1550
  for (var u in i) {
1359
- var d = o[u], h = i[u];
1360
- d === void 0 ? (d = pn(t, u, h, s), o[u] = d) : d.o(h, s);
1551
+ var f = o[u], d = i[u];
1552
+ f === void 0 ? (f = An(t, u, d, s), o[u] = f) : f.o(d, s);
1361
1553
  }
1362
1554
  }
1363
1555
  }
1364
1556
  n(e);
1365
1557
  });
1366
- function pn(n, e, t, i) {
1367
- var s = e in n && n.ownerSVGElement === void 0, o = ne(t);
1368
- return { o: function(r, c) {
1369
- o.value = r, i = c;
1370
- }, d: Ne(function() {
1558
+ function An(n, e, t, i) {
1559
+ var s = e in n && n.ownerSVGElement === void 0, o = J(t);
1560
+ return { o: function(r, a) {
1561
+ o.value = r, i = a;
1562
+ }, d: Ie(function() {
1371
1563
  var r = o.value.value;
1372
1564
  i[e] !== r && (i[e] = r, s ? n[e] = r : r ? n.setAttribute(e, r) : n.removeAttribute(e));
1373
1565
  }) };
1374
1566
  }
1375
- ie("unmount", function(n, e) {
1567
+ re("unmount", function(n, e) {
1376
1568
  if (typeof e.type == "string") {
1377
1569
  var t = e.__e;
1378
1570
  if (t) {
@@ -1388,16 +1580,16 @@ ie("unmount", function(n, e) {
1388
1580
  } else {
1389
1581
  var r = e.__c;
1390
1582
  if (r) {
1391
- var c = r.__$u;
1392
- c && (r.__$u = void 0, c.d());
1583
+ var a = r.__$u;
1584
+ a && (r.__$u = void 0, a.d());
1393
1585
  }
1394
1586
  }
1395
1587
  n(e);
1396
1588
  });
1397
- ie("__h", function(n, e, t, i) {
1589
+ re("__h", function(n, e, t, i) {
1398
1590
  (i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
1399
1591
  });
1400
- M.prototype.shouldComponentUpdate = function(n, e) {
1592
+ H.prototype.shouldComponentUpdate = function(n, e) {
1401
1593
  var t = this.__$u;
1402
1594
  if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
1403
1595
  return !0;
@@ -1412,45 +1604,45 @@ M.prototype.shouldComponentUpdate = function(n, e) {
1412
1604
  return !1;
1413
1605
  };
1414
1606
  function W(n) {
1415
- return G(function() {
1416
- return ne(n);
1607
+ return j(function() {
1608
+ return J(n);
1417
1609
  }, []);
1418
1610
  }
1419
- function qe(n) {
1420
- var e = Z(n);
1421
- return e.current = n, xe.__$f |= 4, G(function() {
1422
- return Yt(function() {
1611
+ function O(n) {
1612
+ var e = K(n);
1613
+ return e.current = n, De.__$f |= 4, j(function() {
1614
+ return en(function() {
1423
1615
  return e.current();
1424
1616
  });
1425
1617
  }, []);
1426
1618
  }
1427
- function vn(n) {
1428
- var e = Z(n);
1429
- e.current = n, F(function() {
1430
- return Ne(function() {
1619
+ function In(n) {
1620
+ var e = K(n);
1621
+ e.current = n, q(function() {
1622
+ return Ie(function() {
1431
1623
  return e.current();
1432
1624
  });
1433
1625
  }, []);
1434
1626
  }
1435
- var mn = 0;
1627
+ var Dn = 0;
1436
1628
  function l(n, e, t, i, s, o) {
1437
- var r, c, u = {};
1438
- for (c in e)
1439
- c == "ref" ? r = e[c] : u[c] = e[c];
1440
- var d = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --mn, __source: s, __self: o };
1629
+ var r, a, u = {};
1630
+ for (a in e)
1631
+ a == "ref" ? r = e[a] : u[a] = e[a];
1632
+ var f = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Dn, __source: s, __self: o };
1441
1633
  if (typeof n == "function" && (r = n.defaultProps))
1442
- for (c in r)
1443
- u[c] === void 0 && (u[c] = r[c]);
1444
- return v.vnode && v.vnode(d), d;
1634
+ for (a in r)
1635
+ u[a] === void 0 && (u[a] = r[a]);
1636
+ return m.vnode && m.vnode(f), f;
1445
1637
  }
1446
- const gn = () => l("svg", {
1638
+ const zn = () => l("svg", {
1447
1639
  viewBox: "0 0 1024 1024",
1448
1640
  version: "1.1",
1449
1641
  xmlns: "http://www.w3.org/2000/svg",
1450
1642
  children: l("path", {
1451
1643
  d: "M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"
1452
1644
  })
1453
- }), yn = () => l("svg", {
1645
+ }), Hn = () => l("svg", {
1454
1646
  className: "icon",
1455
1647
  viewBox: "0 0 1024 1024",
1456
1648
  version: "1.1",
@@ -1458,56 +1650,56 @@ const gn = () => l("svg", {
1458
1650
  children: l("path", {
1459
1651
  d: "M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"
1460
1652
  })
1461
- }), bn = () => l("svg", {
1653
+ }), Ln = () => l("svg", {
1462
1654
  viewBox: "0 0 1024 1024",
1463
1655
  version: "1.1",
1464
1656
  xmlns: "http://www.w3.org/2000/svg",
1465
1657
  children: l("path", {
1466
1658
  d: "M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"
1467
1659
  })
1468
- }), wn = () => l("svg", {
1660
+ }), On = () => l("svg", {
1469
1661
  viewBox: "0 0 1024 1024",
1470
1662
  version: "1.1",
1471
1663
  xmlns: "http://www.w3.org/2000/svg",
1472
1664
  children: l("path", {
1473
1665
  d: "M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"
1474
1666
  })
1475
- }), ct = () => l("svg", {
1667
+ }), ft = () => l("svg", {
1476
1668
  viewBox: "0 0 1024 1024",
1477
1669
  version: "1.1",
1478
1670
  xmlns: "http://www.w3.org/2000/svg",
1479
1671
  children: l("path", {
1480
1672
  d: "M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"
1481
1673
  })
1482
- }), Cn = () => l("svg", {
1674
+ }), Rn = () => l("svg", {
1483
1675
  viewBox: "0 0 1024 1024",
1484
1676
  version: "1.1",
1485
1677
  xmlns: "http://www.w3.org/2000/svg",
1486
1678
  children: l("path", {
1487
1679
  d: "M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"
1488
1680
  })
1489
- }), Tn = () => l("svg", {
1681
+ }), Pn = () => l("svg", {
1490
1682
  viewBox: "0 0 1024 1024",
1491
1683
  version: "1.1",
1492
1684
  xmlns: "http://www.w3.org/2000/svg",
1493
1685
  children: l("path", {
1494
1686
  d: "M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"
1495
1687
  })
1496
- }), En = () => l("svg", {
1688
+ }), Bn = () => l("svg", {
1497
1689
  viewBox: "0 0 1024 1024",
1498
1690
  version: "1.1",
1499
1691
  xmlns: "http://www.w3.org/2000/svg",
1500
1692
  children: l("path", {
1501
1693
  d: "M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"
1502
1694
  })
1503
- }), Sn = () => l("svg", {
1695
+ }), Un = () => l("svg", {
1504
1696
  viewBox: "0 0 1024 1024",
1505
1697
  version: "1.1",
1506
1698
  xmlns: "http://www.w3.org/2000/svg",
1507
1699
  children: l("path", {
1508
1700
  d: "M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"
1509
1701
  })
1510
- }), kn = () => l("svg", {
1702
+ }), Fn = () => l("svg", {
1511
1703
  viewBox: "0 0 1024 1024",
1512
1704
  version: "1.1",
1513
1705
  xmlns: "http://www.w3.org/2000/svg",
@@ -1524,7 +1716,7 @@ const gn = () => l("svg", {
1524
1716
  }), l("path", {
1525
1717
  d: "M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
1526
1718
  })]
1527
- }), $n = () => l("svg", {
1719
+ }), Vn = () => l("svg", {
1528
1720
  viewBox: "0 0 18 18",
1529
1721
  fill: "none",
1530
1722
  xmlns: "http://www.w3.org/2000/svg",
@@ -1538,7 +1730,7 @@ const gn = () => l("svg", {
1538
1730
  d: "M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",
1539
1731
  fill: "currentColor"
1540
1732
  })]
1541
- }), Nn = () => l("svg", {
1733
+ }), qn = () => l("svg", {
1542
1734
  viewBox: "64 64 896 896",
1543
1735
  focusable: "false",
1544
1736
  width: "1em",
@@ -1548,23 +1740,23 @@ const gn = () => l("svg", {
1548
1740
  children: l("path", {
1549
1741
  d: "M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
1550
1742
  })
1551
- }), xn = () => l("svg", {
1743
+ }), Wn = () => l("svg", {
1552
1744
  fill: "currentColor",
1553
1745
  viewBox: "0 0 1000 1000",
1554
1746
  xmlns: "http://www.w3.org/2000/svg",
1555
1747
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1556
1748
  children: Array.from({
1557
1749
  length: 4
1558
- }).map((c, u) => {
1559
- const h = u * (146.66666666666666 + 140), a = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
1750
+ }).map((a, u) => {
1751
+ const d = u * (146.66666666666666 + 140), c = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
1560
1752
  return l("rect", {
1561
1753
  fill: "currentColor",
1562
1754
  rx: 70,
1563
1755
  ry: 70,
1564
1756
  height: 250,
1565
1757
  width: 140,
1566
- x: h,
1567
- y: a,
1758
+ x: d,
1759
+ y: c,
1568
1760
  children: [l("animate", {
1569
1761
  attributeName: "height",
1570
1762
  values: "250; 500; 250",
@@ -1574,7 +1766,7 @@ const gn = () => l("svg", {
1574
1766
  repeatCount: "indefinite"
1575
1767
  }), l("animate", {
1576
1768
  attributeName: "y",
1577
- values: "".concat(a, "; ").concat(_, "; ").concat(a),
1769
+ values: "".concat(c, "; ").concat(_, "; ").concat(c),
1578
1770
  keyTimes: "0; 0.5; 1",
1579
1771
  dur: "".concat(0.8, "s"),
1580
1772
  begin: "".concat(0.8 / 4 * u, "s"),
@@ -1582,7 +1774,7 @@ const gn = () => l("svg", {
1582
1774
  })]
1583
1775
  }, u);
1584
1776
  })
1585
- }), An = (n) => l("svg", {
1777
+ }), jn = (n) => l("svg", {
1586
1778
  className: n.className,
1587
1779
  onClick: n.onClick,
1588
1780
  viewBox: "0 0 1024 1024",
@@ -1591,7 +1783,7 @@ const gn = () => l("svg", {
1591
1783
  children: l("path", {
1592
1784
  d: "M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"
1593
1785
  })
1594
- }), In = (n) => l("svg", {
1786
+ }), Yn = (n) => l("svg", {
1595
1787
  className: n.className,
1596
1788
  viewBox: "0 0 1024 1024",
1597
1789
  version: "1.1",
@@ -1599,7 +1791,7 @@ const gn = () => l("svg", {
1599
1791
  children: l("path", {
1600
1792
  d: "M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"
1601
1793
  })
1602
- }), Dn = (n) => l("svg", {
1794
+ }), Xn = (n) => l("svg", {
1603
1795
  xmlns: "http://www.w3.org/2000/svg",
1604
1796
  className: n.className,
1605
1797
  viewBox: "0 0 512 512",
@@ -1611,14 +1803,14 @@ const gn = () => l("svg", {
1611
1803
  strokeWidth: "48",
1612
1804
  d: "M112 184l144 144 144-144"
1613
1805
  })
1614
- }), lt = (n) => l("svg", {
1806
+ }), pt = (n) => l("svg", {
1615
1807
  xmlns: "http://www.w3.org/2000/svg",
1616
1808
  className: "".concat(n.className, " icon"),
1617
1809
  viewBox: "0 0 512 512",
1618
1810
  children: l("path", {
1619
1811
  d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"
1620
1812
  })
1621
- }), ze = (n) => l("svg", {
1813
+ }), Re = (n) => l("svg", {
1622
1814
  className: n.className,
1623
1815
  width: "16",
1624
1816
  height: "16",
@@ -1642,38 +1834,83 @@ const gn = () => l("svg", {
1642
1834
  repeatCount: "indefinite"
1643
1835
  })
1644
1836
  })
1837
+ }), Zn = () => l("svg", {
1838
+ className: "icon",
1839
+ viewBox: "0 0 1024 1024",
1840
+ version: "1.1",
1841
+ xmlns: "http://www.w3.org/2000/svg",
1842
+ width: "18",
1843
+ height: "18",
1844
+ children: l("path", {
1845
+ d: "M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"
1846
+ })
1847
+ }), sn = () => l("svg", {
1848
+ className: "icon",
1849
+ viewBox: "0 0 1024 1024",
1850
+ version: "1.1",
1851
+ xmlns: "http://www.w3.org/2000/svg",
1852
+ width: "18",
1853
+ height: "18",
1854
+ children: [l("path", {
1855
+ d: "M842.666667 285.866667l-187.733334-187.733334c-14.933333-14.933333-32-21.333333-53.333333-21.333333H234.666667C194.133333 74.666667 160 108.8 160 149.333333v725.333334c0 40.533333 34.133333 74.666667 74.666667 74.666666h554.666666c40.533333 0 74.666667-34.133333 74.666667-74.666666V337.066667c0-19.2-8.533333-38.4-21.333333-51.2z m-44.8 44.8c-2.133333 2.133333-4.266667 0-8.533334 0h-170.666666c-6.4 0-10.666667-4.266667-10.666667-10.666667V149.333333c0-2.133333 0-6.4-2.133333-8.533333 0 0 2.133333 0 2.133333 2.133333l189.866667 187.733334z m-8.533334 554.666666H234.666667c-6.4 0-10.666667-4.266667-10.666667-10.666666V149.333333c0-6.4 4.266667-10.666667 10.666667-10.666666h311.466666c-2.133333 4.266667-2.133333 6.4-2.133333 10.666666v170.666667c0 40.533333 34.133333 74.666667 74.666667 74.666667h170.666666c4.266667 0 6.4 0 10.666667-2.133334V874.666667c0 6.4-4.266667 10.666667-10.666667 10.666666z",
1856
+ fill: "currentColor"
1857
+ }), l("path", {
1858
+ d: "M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",
1859
+ fill: "currentColor"
1860
+ })]
1861
+ }), Gn = () => l("svg", {
1862
+ className: "icon",
1863
+ viewBox: "0 0 1024 1024",
1864
+ version: "1.1",
1865
+ xmlns: "http://www.w3.org/2000/svg",
1866
+ width: "18",
1867
+ height: "18",
1868
+ children: l("path", {
1869
+ d: "M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",
1870
+ fill: "currentColor"
1871
+ })
1872
+ }), Jn = () => l("svg", {
1873
+ className: "icon",
1874
+ viewBox: "0 0 1024 1024",
1875
+ version: "1.1",
1876
+ xmlns: "http://www.w3.org/2000/svg",
1877
+ width: "18",
1878
+ height: "18",
1879
+ children: l("path", {
1880
+ d: "M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"
1881
+ })
1645
1882
  });
1646
- const Mn = (n) => {
1883
+ const Kn = (n) => {
1647
1884
  const {
1648
1885
  items: e
1649
- } = n, t = W([]), i = new A("chat-thought-chain"), s = W([]);
1650
- F(() => {
1651
- s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, c) => {
1652
- r.done && (t.value = [...t.value, c]);
1886
+ } = n, t = W([]), i = new M("chat-thought-chain"), s = W([]);
1887
+ q(() => {
1888
+ s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, a) => {
1889
+ r.done && (t.value = [...t.value, a]);
1653
1890
  });
1654
1891
  }, [e]);
1655
1892
  const o = (r) => {
1656
- t.value.includes(r) ? t.value = t.value.filter((c) => c !== r) : t.value = [...t.value, r];
1893
+ t.value.includes(r) ? t.value = t.value.filter((a) => a !== r) : t.value = [...t.value, r];
1657
1894
  };
1658
1895
  return s.value.length === 0 ? null : l("div", {
1659
1896
  className: "".concat(i.b(), " ").concat(i.is("single", s.value.length === 1)),
1660
- children: s.value.map((r, c) => {
1897
+ children: s.value.map((r, a) => {
1661
1898
  if (!r.description)
1662
1899
  return;
1663
- const u = t.value.includes(c);
1900
+ const u = t.value.includes(a);
1664
1901
  return l("div", {
1665
1902
  className: "".concat(i.e("item"), " ").concat(i.is("collapsed", u)),
1666
1903
  children: [l("div", {
1667
1904
  className: i.e("item-icon"),
1668
1905
  children: r.icon || l("span", {
1669
- children: c
1906
+ children: a
1670
1907
  })
1671
1908
  }), l("div", {
1672
1909
  className: i.e("item-content"),
1673
1910
  children: [l("div", {
1674
1911
  className: i.e("item-title"),
1675
- onClick: () => o(c),
1676
- children: [r.title, l(Dn, {
1912
+ onClick: () => o(a),
1913
+ children: [r.title, l(Xn, {
1677
1914
  className: i.e("icon")
1678
1915
  })]
1679
1916
  }), l("div", {
@@ -1681,132 +1918,230 @@ const Mn = (n) => {
1681
1918
  children: r.description
1682
1919
  })]
1683
1920
  })]
1684
- }, c);
1921
+ }, a);
1685
1922
  })
1686
1923
  });
1687
- }, Y = new A("markdown-message"), zn = (n) => {
1924
+ }, Z = new M("markdown-message"), Qn = (n) => {
1688
1925
  const {
1689
1926
  message: e,
1690
1927
  size: t
1691
- } = n, i = W(Lt()), s = W(null), o = G(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = G(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), c = W({
1928
+ } = n, i = W(qt()), s = W(null), o = j(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = j(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), a = W({
1692
1929
  title: "思考过程",
1693
1930
  description: "",
1694
- icon: l(ze, {})
1695
- }), u = (d) => {
1696
- const h = d.indexOf("<think>"), a = d.indexOf("</think>");
1697
- let _ = "", p = "", f = !1;
1698
- return a === -1 ? (f = !1, _ = d.slice(h + 7), p = "") : (f = !0, _ = d.slice(h + 7, a), p = d.slice(a + 8)), {
1699
- isThoughtCompleted: f,
1931
+ icon: l(Re, {})
1932
+ }), u = (f) => {
1933
+ const d = f.indexOf("<think>"), c = f.indexOf("</think>");
1934
+ let _ = "", v = "", h = !1;
1935
+ return c === -1 ? (h = !1, _ = f.slice(d + 7), v = "") : (h = !0, _ = f.slice(d + 7, c), v = f.slice(c + 8)), {
1936
+ isThoughtCompleted: h,
1700
1937
  thoughtContent: _,
1701
- answerContent: p
1938
+ answerContent: v
1702
1939
  };
1703
1940
  };
1704
- return F(() => {
1941
+ return q(() => {
1705
1942
  if (t >= 0 && s.value)
1706
1943
  if (e.content.indexOf("<think>") !== -1) {
1707
1944
  const {
1708
- isThoughtCompleted: d,
1709
- thoughtContent: h,
1710
- answerContent: a
1945
+ isThoughtCompleted: f,
1946
+ thoughtContent: d,
1947
+ answerContent: c
1711
1948
  } = u(e.content);
1712
- d && (c.value.icon = d ? l(lt, {}) : l(ze, {})), h && (c.value.description = h), a && s.value.setMarkdown(a);
1949
+ f && (a.value.icon = f ? l(pt, {}) : l(Re, {})), d && (a.value.description = d), c && s.value.setMarkdown(c);
1713
1950
  } else
1714
1951
  s.value.setMarkdown(e.content);
1715
- }, [e, t]), F(() => {
1716
- let d = "";
1952
+ }, [e, t]), q(() => {
1953
+ let f = "";
1717
1954
  if (e.content.indexOf("<think>") !== -1) {
1718
1955
  const {
1719
- isThoughtCompleted: h,
1720
- thoughtContent: a,
1956
+ isThoughtCompleted: d,
1957
+ thoughtContent: c,
1721
1958
  answerContent: _
1722
1959
  } = u(e.content);
1723
- c.value = {
1960
+ a.value = {
1724
1961
  title: "思考过程",
1725
- description: a || "",
1726
- icon: h ? l(lt, {}) : l(ze, {})
1727
- }, _ && (d = _);
1962
+ description: c || "",
1963
+ icon: d ? l(pt, {}) : l(Re, {})
1964
+ }, _ && (f = _);
1728
1965
  } else
1729
- d = e.content;
1730
- s.value = new en({
1966
+ f = e.content;
1967
+ s.value = new pn({
1731
1968
  id: i,
1732
- value: d || "",
1969
+ value: f || "",
1733
1970
  editor: {
1734
1971
  defaultModel: "previewOnly"
1735
1972
  }
1736
1973
  });
1737
1974
  }, []), l("div", {
1738
- className: "".concat(Y.b(), " ").concat(Y.is("loading", o)),
1975
+ className: "".concat(Z.b(), " ").concat(Z.is("loading", o)),
1739
1976
  children: [l("div", {
1740
- className: Y.b("header"),
1977
+ className: Z.b("header"),
1741
1978
  children: [l("div", {
1742
- className: Y.be("header", "caption"),
1979
+ className: Z.be("header", "caption"),
1743
1980
  children: "AI "
1744
1981
  }), n.children, r ? l("div", {
1745
- className: Y.be("header", "timeout"),
1982
+ className: Z.be("header", "timeout"),
1746
1983
  children: "请求超时"
1747
1984
  }) : null]
1748
1985
  }), l("div", {
1749
- className: "".concat(Y.b("content"), " pre-wrap-container"),
1750
- children: [l(Mn, {
1751
- items: [c.value]
1986
+ className: "".concat(Z.b("content"), " pre-wrap-container"),
1987
+ children: [l(Kn, {
1988
+ items: [a.value]
1752
1989
  }), l("div", {
1753
1990
  id: i
1754
1991
  })]
1755
1992
  }), l("div", {
1756
- className: Y.b("footer")
1993
+ className: Z.b("footer")
1994
+ })]
1995
+ });
1996
+ };
1997
+ const ae = new M("ossfile-material"), ei = (n) => {
1998
+ const e = O(() => n.material.data.name), t = O(() => n.material.metadata.size), i = O(() => {
1999
+ const o = n.material.metadata.state;
2000
+ return o === "successed" ? "上传成功" : o === "uploading" ? "上传中" : o === "failed" ? "上传失败" : "未知状态";
2001
+ }), s = O(() => {
2002
+ switch (n.material.metadata.state) {
2003
+ case "successed":
2004
+ return "#1890ff";
2005
+ case "uploading":
2006
+ return "#52c41a";
2007
+ case "failed":
2008
+ return "#ff4d4f";
2009
+ default:
2010
+ return "#ff4d4f";
2011
+ }
2012
+ });
2013
+ return l("div", {
2014
+ className: ae.b(),
2015
+ children: [l("div", {
2016
+ className: ae.b("left"),
2017
+ children: l(sn, {})
2018
+ }), l("div", {
2019
+ className: ae.b("right"),
2020
+ children: [l("div", {
2021
+ className: ae.e("name"),
2022
+ title: e,
2023
+ children: e
2024
+ }), l("div", {
2025
+ className: ae.e("metadata"),
2026
+ children: [l("div", {
2027
+ children: [t, "B"]
2028
+ }), l("div", {
2029
+ style: {
2030
+ color: s.value
2031
+ },
2032
+ children: i
2033
+ })]
2034
+ })]
2035
+ })]
2036
+ });
2037
+ };
2038
+ const ce = new M("common-material"), ti = (n) => {
2039
+ var i;
2040
+ const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((s) => s.id === n.material.metadata.actionId), t = O(() => n.material.metadata.name);
2041
+ return l("div", {
2042
+ className: ce.b(),
2043
+ children: [l("div", {
2044
+ className: ce.b("left"),
2045
+ children: e && e.icon ? typeof e.icon == "function" ? e.icon(I) : e.icon : l(Jn, {})
2046
+ }), l("div", {
2047
+ className: ce.b("right"),
2048
+ children: [l("div", {
2049
+ className: ce.e("name"),
2050
+ title: t,
2051
+ children: t
2052
+ }), l("div", {
2053
+ className: ce.e("metadata"),
2054
+ children: l("div", {
2055
+ children: (e == null ? void 0 : e.label) || "素材资源"
2056
+ })
2057
+ })]
1757
2058
  })]
1758
2059
  });
1759
2060
  };
1760
- const se = new A("user-message-question"), Hn = (n) => {
1761
- const e = qe(() => n.message.content);
2061
+ const Pe = new M("chat-input-material-item"), on = (n) => {
2062
+ const {
2063
+ material: e
2064
+ } = n;
2065
+ let t = null;
2066
+ switch (e.type) {
2067
+ case "ossfile":
2068
+ t = ei;
2069
+ break;
2070
+ default:
2071
+ t = ti;
2072
+ }
2073
+ const i = () => {
2074
+ n.controller.deleteMaterial(e);
2075
+ };
2076
+ return l("div", {
2077
+ className: "".concat(Pe.b(), " ").concat(Pe.is("disabled", n.disabled)),
2078
+ children: [l("div", {
2079
+ className: Pe.e("icon"),
2080
+ onClick: i,
2081
+ children: l(Gn, {})
2082
+ }), I(t, {
2083
+ material: e,
2084
+ controller: n.controller
2085
+ })]
2086
+ });
2087
+ }, Q = new M("user-message-question"), ni = (n) => {
2088
+ const e = O(() => n.message.content), t = O(() => jt.parseMixedContent(e.value));
1762
2089
  return l("div", {
1763
- className: se.b(),
2090
+ className: Q.b(),
1764
2091
  children: [l("div", {
1765
- className: se.e("user-header"),
2092
+ className: Q.e("user-header"),
1766
2093
  children: [n.children, l("div", {
1767
- className: se.e("user"),
2094
+ className: Q.e("user"),
1768
2095
  children: "我"
1769
2096
  })]
1770
2097
  }), l("div", {
1771
- className: se.e("content"),
2098
+ className: Q.e("content"),
1772
2099
  children: l("div", {
1773
2100
  dir: "auto",
1774
- className: se.em("content", "body"),
1775
- children: l("p", {
2101
+ className: Q.em("content", "body"),
2102
+ children: [l("p", {
2103
+ dir: "auto",
2104
+ className: Q.em("content", "material"),
2105
+ children: t.value.hasResources && t.value.resources.map((i) => l(on, {
2106
+ material: i,
2107
+ disabled: !0,
2108
+ controller: n.controller
2109
+ }, i.id))
2110
+ }), l("p", {
1776
2111
  dir: "auto",
1777
2112
  className: "pre-wrap-container",
1778
- children: e
1779
- })
2113
+ children: t.value.remainingText
2114
+ })]
1780
2115
  })
1781
2116
  })]
1782
2117
  });
1783
2118
  };
1784
- const _e = new A("error-message"), Ln = (n) => {
1785
- const e = qe(() => n.message.content);
2119
+ const me = new M("error-message"), ii = (n) => {
2120
+ const e = O(() => n.message.content);
1786
2121
  return l("div", {
1787
- className: _e.b(),
2122
+ className: me.b(),
1788
2123
  children: [l("div", {
1789
- className: _e.b("header"),
2124
+ className: me.b("header"),
1790
2125
  children: [l("div", {
1791
- className: _e.be("header", "caption"),
2126
+ className: me.be("header", "caption"),
1792
2127
  children: "AI "
1793
2128
  }), n.children]
1794
2129
  }), l("div", {
1795
- className: "".concat(_e.e("content"), " pre-wrap-container"),
2130
+ className: "".concat(me.e("content"), " pre-wrap-container"),
1796
2131
  children: l("span", {
1797
2132
  children: e
1798
2133
  })
1799
2134
  })]
1800
2135
  });
1801
2136
  };
1802
- const ut = new A("unknown-message"), Rn = (n) => l("div", {
1803
- className: ut.b(),
2137
+ const _t = new M("unknown-message"), si = (n) => l("div", {
2138
+ className: _t.b(),
1804
2139
  children: l("span", {
1805
- className: "".concat(ut.e("content"), " pre-wrap-container"),
2140
+ className: "".concat(_t.e("content"), " pre-wrap-container"),
1806
2141
  children: ["暂未支持的消息类型: ", n.message.type]
1807
2142
  })
1808
2143
  });
1809
- const On = new A("chat-message-item"), Pn = (n) => {
2144
+ const oi = new M("chat-message-item"), ri = (n) => {
1810
2145
  const {
1811
2146
  message: e,
1812
2147
  size: t
@@ -1814,17 +2149,17 @@ const On = new A("chat-message-item"), Pn = (n) => {
1814
2149
  let i = null;
1815
2150
  switch (e.type) {
1816
2151
  case "DEFAULT":
1817
- i = e.role === "ASSISTANT" ? zn : Hn;
2152
+ i = e.role === "ASSISTANT" ? Qn : ni;
1818
2153
  break;
1819
2154
  case "ERROR":
1820
- i = Ln;
2155
+ i = ii;
1821
2156
  break;
1822
2157
  default:
1823
- i = Rn;
2158
+ i = si;
1824
2159
  }
1825
2160
  return l("div", {
1826
- className: On.b(),
1827
- children: H(i, {
2161
+ className: oi.b(),
2162
+ children: I(i, {
1828
2163
  size: t,
1829
2164
  message: e,
1830
2165
  controller: n.controller,
@@ -1832,7 +2167,7 @@ const On = new A("chat-message-item"), Pn = (n) => {
1832
2167
  })
1833
2168
  });
1834
2169
  };
1835
- const J = new A("chat-toolbar"), Ue = (n) => {
2170
+ const ee = new M("chat-toolbar"), Xe = (n) => {
1836
2171
  const {
1837
2172
  controller: e,
1838
2173
  items: t = [],
@@ -1840,99 +2175,99 @@ const J = new A("chat-toolbar"), Ue = (n) => {
1840
2175
  type: s,
1841
2176
  className: o
1842
2177
  } = n;
1843
- let r = [], c = "default";
2178
+ let r = [], a = "default";
1844
2179
  const u = [{
1845
2180
  label: "新建对话",
1846
2181
  title: "新建对话",
1847
- icon: l($n, {}),
2182
+ icon: l(Vn, {}),
1848
2183
  onClick: () => {
1849
2184
  e.newDialogue();
1850
2185
  }
1851
- }], d = [{
2186
+ }], f = [{
1852
2187
  label: "回填",
1853
2188
  title: "回填",
1854
- icon: l(yn, {}),
2189
+ icon: l(Hn, {}),
1855
2190
  onClick: () => {
1856
2191
  e.backfill(i);
1857
2192
  }
1858
2193
  }, {
1859
2194
  label: "刷新",
1860
2195
  title: "刷新",
1861
- icon: l(ct, {}),
2196
+ icon: l(ft, {}),
1862
2197
  onClick: () => {
1863
2198
  e.refreshMessage(i);
1864
2199
  }
1865
2200
  }, {
1866
2201
  label: "删除",
1867
2202
  title: "删除",
1868
- icon: l(wn, {}),
2203
+ icon: l(On, {}),
1869
2204
  onClick: () => {
1870
2205
  e.deleteMessage(i);
1871
2206
  }
1872
2207
  }, {
1873
2208
  label: "复制",
1874
2209
  title: "复制",
1875
- icon: l(Cn, {}),
2210
+ icon: l(Rn, {}),
1876
2211
  onClick: () => {
1877
2212
  e.copyMessage(i);
1878
2213
  }
1879
- }], h = [{
2214
+ }], d = [{
1880
2215
  label: "刷新",
1881
2216
  title: "刷新",
1882
- icon: l(ct, {}),
2217
+ icon: l(ft, {}),
1883
2218
  onClick: () => {
1884
2219
  e.refreshMessage(i, !0);
1885
2220
  }
1886
2221
  }];
1887
2222
  if (s === "content")
1888
- switch (c = "circle", i.type) {
2223
+ switch (a = "circle", i.type) {
1889
2224
  case "DEFAULT":
1890
- i.role === "ASSISTANT" ? r = [...d, ...t] : r = [...h];
2225
+ i.role === "ASSISTANT" ? r = [...f, ...t] : r = [...d];
1891
2226
  break;
1892
2227
  case "ERROR":
1893
- r = [...d, ...t];
2228
+ r = [...f, ...t];
1894
2229
  break;
1895
2230
  }
1896
2231
  else
1897
2232
  r = [...u, ...t];
1898
- const a = (f) => typeof f.hidden == "function" ? f.hidden(i) : f.hidden === !0, _ = (f) => typeof f.disabled == "function" ? f.disabled(i) : f.disabled === !0, p = (f, g) => {
1899
- var N;
1900
- _(g) || (N = g.onClick) == null || N.call(g, f, e.context, e.params, i);
1901
- };
2233
+ const c = (p) => typeof p.hidden == "function" ? p.hidden(i) : p.hidden === !0, _ = (p) => typeof p.disabled == "function" ? p.disabled(i) : p.disabled === !0, v = (p, y) => {
2234
+ var b;
2235
+ _(y) || (b = y.onClick) == null || b.call(y, p, e.context, e.params, i);
2236
+ }, h = j(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
1902
2237
  return l("div", {
1903
- className: "".concat(J.b(), " ").concat(J.e(c), " ").concat(o || ""),
1904
- children: r.map((f, g) => {
1905
- if (!a(f))
2238
+ className: "".concat(ee.b(), " ").concat(ee.e(a), " ").concat(o || ""),
2239
+ children: r.map((p, y) => {
2240
+ if (!c(p))
1906
2241
  return l("div", {
1907
- className: "".concat(J.e("item"), " ").concat(J.is("disabled", _(f)), " ").concat(o || ""),
1908
- title: f.title,
1909
- onClick: (N) => p(N, f),
2242
+ className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", _(p) || h), " ").concat(o || ""),
2243
+ title: p.title,
2244
+ onClick: (b) => v(b, p),
1910
2245
  children: [l("div", {
1911
- className: "".concat(J.em("item", "icon")),
1912
- children: typeof f.icon == "function" ? f.icon(H) : f.icon
2246
+ className: "".concat(ee.em("item", "icon")),
2247
+ children: typeof p.icon == "function" ? p.icon(I) : p.icon
1913
2248
  }), l("div", {
1914
- className: "".concat(J.em("item", "label")),
1915
- children: typeof f.label == "function" ? f.label(H) : f.label
2249
+ className: "".concat(ee.em("item", "label")),
2250
+ children: typeof p.label == "function" ? p.label(I) : p.label
1916
2251
  })]
1917
- }, g);
2252
+ }, y);
1918
2253
  })
1919
2254
  });
1920
2255
  };
1921
- const Bn = new A("chat-messages"), ht = (n) => {
1922
- const e = Z(null), t = n.controller.messages;
1923
- return vn(() => {
2256
+ const ai = new M("chat-messages"), vt = (n) => {
2257
+ const e = K(null), t = n.controller.messages;
2258
+ return In(() => {
1924
2259
  e.current && t.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
1925
2260
  }), l("div", {
1926
2261
  ref: e,
1927
- className: Bn.b(),
2262
+ className: ai.b(),
1928
2263
  children: t.value.map((i) => {
1929
2264
  var o;
1930
2265
  const s = ((o = i.content) == null ? void 0 : o.length) || 0;
1931
- return l(Pn, {
2266
+ return l(ri, {
1932
2267
  size: s,
1933
2268
  message: i,
1934
2269
  controller: n.controller,
1935
- children: l(Ue, {
2270
+ children: l(Xe, {
1936
2271
  data: i,
1937
2272
  type: "content",
1938
2273
  items: n.toolbarItems,
@@ -1942,12 +2277,12 @@ const Bn = new A("chat-messages"), ht = (n) => {
1942
2277
  })
1943
2278
  });
1944
2279
  };
1945
- function Un(n, e) {
2280
+ function ci(n, e) {
1946
2281
  for (var t in e)
1947
2282
  n[t] = e[t];
1948
2283
  return n;
1949
2284
  }
1950
- function dt(n, e) {
2285
+ function mt(n, e) {
1951
2286
  for (var t in n)
1952
2287
  if (t !== "__source" && !(t in e))
1953
2288
  return !0;
@@ -1956,84 +2291,84 @@ function dt(n, e) {
1956
2291
  return !0;
1957
2292
  return !1;
1958
2293
  }
1959
- function ft(n) {
2294
+ function gt(n) {
1960
2295
  this.props = n;
1961
2296
  }
1962
- (ft.prototype = new M()).isPureReactComponent = !0, ft.prototype.shouldComponentUpdate = function(n, e) {
1963
- return dt(this.props, n) || dt(this.state, e);
2297
+ (gt.prototype = new H()).isPureReactComponent = !0, gt.prototype.shouldComponentUpdate = function(n, e) {
2298
+ return mt(this.props, n) || mt(this.state, e);
1964
2299
  };
1965
- var _t = v.__b;
1966
- v.__b = function(n) {
1967
- n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), _t && _t(n);
2300
+ var yt = m.__b;
2301
+ m.__b = function(n) {
2302
+ n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), yt && yt(n);
1968
2303
  };
1969
- var Fn = v.__e;
1970
- v.__e = function(n, e, t, i) {
2304
+ var li = m.__e;
2305
+ m.__e = function(n, e, t, i) {
1971
2306
  if (n.then) {
1972
2307
  for (var s, o = e; o = o.__; )
1973
2308
  if ((s = o.__c) && s.__c)
1974
2309
  return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
1975
2310
  }
1976
- Fn(n, e, t, i);
2311
+ li(n, e, t, i);
1977
2312
  };
1978
- var pt = v.unmount;
1979
- function Zt(n, e, t) {
2313
+ var bt = m.unmount;
2314
+ function rn(n, e, t) {
1980
2315
  return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
1981
2316
  typeof i.__c == "function" && i.__c();
1982
- }), n.__c.__H = null), (n = Un({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
1983
- return Zt(i, e, t);
2317
+ }), n.__c.__H = null), (n = ci({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
2318
+ return rn(i, e, t);
1984
2319
  })), n;
1985
2320
  }
1986
- function Gt(n, e, t) {
2321
+ function an(n, e, t) {
1987
2322
  return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
1988
- return Gt(i, e, t);
2323
+ return an(i, e, t);
1989
2324
  }), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
1990
2325
  }
1991
- function He() {
2326
+ function Be() {
1992
2327
  this.__u = 0, this.t = null, this.__b = null;
1993
2328
  }
1994
- function Jt(n) {
2329
+ function cn(n) {
1995
2330
  var e = n.__.__c;
1996
2331
  return e && e.__a && e.__a(n);
1997
2332
  }
1998
- function pe() {
2333
+ function ge() {
1999
2334
  this.u = null, this.o = null;
2000
2335
  }
2001
- v.unmount = function(n) {
2336
+ m.unmount = function(n) {
2002
2337
  var e = n.__c;
2003
- e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), pt && pt(n);
2004
- }, (He.prototype = new M()).__c = function(n, e) {
2338
+ e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), bt && bt(n);
2339
+ }, (Be.prototype = new H()).__c = function(n, e) {
2005
2340
  var t = e.__c, i = this;
2006
2341
  i.t == null && (i.t = []), i.t.push(t);
2007
- var s = Jt(i.__v), o = !1, r = function() {
2008
- o || (o = !0, t.__R = null, s ? s(c) : c());
2342
+ var s = cn(i.__v), o = !1, r = function() {
2343
+ o || (o = !0, t.__R = null, s ? s(a) : a());
2009
2344
  };
2010
2345
  t.__R = r;
2011
- var c = function() {
2346
+ var a = function() {
2012
2347
  if (!--i.__u) {
2013
2348
  if (i.state.__a) {
2014
- var d = i.state.__a;
2015
- i.__v.__k[0] = Gt(d, d.__c.__P, d.__c.__O);
2349
+ var f = i.state.__a;
2350
+ i.__v.__k[0] = an(f, f.__c.__P, f.__c.__O);
2016
2351
  }
2017
- var h;
2018
- for (i.setState({ __a: i.__b = null }); h = i.t.pop(); )
2019
- h.forceUpdate();
2352
+ var d;
2353
+ for (i.setState({ __a: i.__b = null }); d = i.t.pop(); )
2354
+ d.forceUpdate();
2020
2355
  }
2021
2356
  }, u = e.__h === !0;
2022
2357
  i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(r, r);
2023
- }, He.prototype.componentWillUnmount = function() {
2358
+ }, Be.prototype.componentWillUnmount = function() {
2024
2359
  this.t = [];
2025
- }, He.prototype.render = function(n, e) {
2360
+ }, Be.prototype.render = function(n, e) {
2026
2361
  if (this.__b) {
2027
2362
  if (this.__v.__k) {
2028
2363
  var t = document.createElement("div"), i = this.__v.__k[0].__c;
2029
- this.__v.__k[0] = Zt(this.__b, t, i.__O = i.__P);
2364
+ this.__v.__k[0] = rn(this.__b, t, i.__O = i.__P);
2030
2365
  }
2031
2366
  this.__b = null;
2032
2367
  }
2033
- var s = e.__a && H(te, null, n.fallback);
2034
- return s && (s.__h = null), [H(te, null, e.__a ? null : n.children), s];
2368
+ var s = e.__a && I(se, null, n.fallback);
2369
+ return s && (s.__h = null), [I(se, null, e.__a ? null : n.children), s];
2035
2370
  };
2036
- var vt = function(n, e, t) {
2371
+ var wt = function(n, e, t) {
2037
2372
  if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
2038
2373
  for (t = n.u; t; ) {
2039
2374
  for (; t.length > 3; )
@@ -2043,652 +2378,157 @@ var vt = function(n, e, t) {
2043
2378
  n.u = t = t[2];
2044
2379
  }
2045
2380
  };
2046
- function Wn(n) {
2381
+ function ui(n) {
2047
2382
  return this.getChildContext = function() {
2048
2383
  return n.context;
2049
2384
  }, n.children;
2050
2385
  }
2051
- function Vn(n) {
2386
+ function di(n) {
2052
2387
  var e = this, t = n.i;
2053
2388
  e.componentWillUnmount = function() {
2054
- K(null, e.l), e.l = null, e.i = null;
2389
+ te(null, e.l), e.l = null, e.i = null;
2055
2390
  }, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(i) {
2056
2391
  this.childNodes.push(i), e.i.appendChild(i);
2057
2392
  }, insertBefore: function(i, s) {
2058
2393
  this.childNodes.push(i), e.i.appendChild(i);
2059
2394
  }, removeChild: function(i) {
2060
2395
  this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
2061
- } }), K(H(Wn, { context: e.context }, n.__v), e.l);
2396
+ } }), te(I(ui, { context: e.context }, n.__v), e.l);
2062
2397
  }
2063
- function jn(n, e) {
2064
- var t = H(Vn, { __v: n, i: e });
2398
+ function hi(n, e) {
2399
+ var t = I(di, { __v: n, i: e });
2065
2400
  return t.containerInfo = e, t;
2066
2401
  }
2067
- (pe.prototype = new M()).__a = function(n) {
2068
- var e = this, t = Jt(e.__v), i = e.o.get(n);
2402
+ (ge.prototype = new H()).__a = function(n) {
2403
+ var e = this, t = cn(e.__v), i = e.o.get(n);
2069
2404
  return i[0]++, function(s) {
2070
2405
  var o = function() {
2071
- e.props.revealOrder ? (i.push(s), vt(e, n, i)) : s();
2406
+ e.props.revealOrder ? (i.push(s), wt(e, n, i)) : s();
2072
2407
  };
2073
2408
  t ? t(o) : o();
2074
2409
  };
2075
- }, pe.prototype.render = function(n) {
2410
+ }, ge.prototype.render = function(n) {
2076
2411
  this.u = null, this.o = /* @__PURE__ */ new Map();
2077
- var e = we(n.children);
2412
+ var e = Se(n.children);
2078
2413
  n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
2079
2414
  for (var t = e.length; t--; )
2080
2415
  this.o.set(e[t], this.u = [1, 0, this.u]);
2081
2416
  return n.children;
2082
- }, pe.prototype.componentDidUpdate = pe.prototype.componentDidMount = function() {
2417
+ }, ge.prototype.componentDidUpdate = ge.prototype.componentDidMount = function() {
2083
2418
  var n = this;
2084
2419
  this.o.forEach(function(e, t) {
2085
- vt(n, t, e);
2420
+ wt(n, t, e);
2086
2421
  });
2087
2422
  };
2088
- var Yn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, qn = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Xn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Zn = /[A-Z0-9]/g, Gn = typeof document < "u", Jn = function(n) {
2423
+ var fi = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, pi = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, _i = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, vi = /[A-Z0-9]/g, mi = typeof document < "u", gi = function(n) {
2089
2424
  return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
2090
2425
  };
2091
- M.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
2092
- Object.defineProperty(M.prototype, n, { configurable: !0, get: function() {
2426
+ H.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
2427
+ Object.defineProperty(H.prototype, n, { configurable: !0, get: function() {
2093
2428
  return this["UNSAFE_" + n];
2094
2429
  }, set: function(e) {
2095
2430
  Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
2096
2431
  } });
2097
2432
  });
2098
- var mt = v.event;
2099
- function Kn() {
2433
+ var Ct = m.event;
2434
+ function yi() {
2100
2435
  }
2101
- function Qn() {
2436
+ function bi() {
2102
2437
  return this.cancelBubble;
2103
2438
  }
2104
- function ei() {
2439
+ function wi() {
2105
2440
  return this.defaultPrevented;
2106
2441
  }
2107
- v.event = function(n) {
2108
- return mt && (n = mt(n)), n.persist = Kn, n.isPropagationStopped = Qn, n.isDefaultPrevented = ei, n.nativeEvent = n;
2442
+ m.event = function(n) {
2443
+ return Ct && (n = Ct(n)), n.persist = yi, n.isPropagationStopped = bi, n.isDefaultPrevented = wi, n.nativeEvent = n;
2109
2444
  };
2110
- var ti = { enumerable: !1, configurable: !0, get: function() {
2445
+ var Ci = { enumerable: !1, configurable: !0, get: function() {
2111
2446
  return this.class;
2112
- } }, gt = v.vnode;
2113
- v.vnode = function(n) {
2447
+ } }, Tt = m.vnode;
2448
+ m.vnode = function(n) {
2114
2449
  typeof n.type == "string" && function(e) {
2115
2450
  var t = e.props, i = e.type, s = {};
2116
2451
  for (var o in t) {
2117
2452
  var r = t[o];
2118
- if (!(o === "value" && "defaultValue" in t && r == null || Gn && o === "children" && i === "noscript" || o === "class" || o === "className")) {
2119
- var c = o.toLowerCase();
2120
- o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : c === "ondoubleclick" ? o = "ondblclick" : c !== "onchange" || i !== "input" && i !== "textarea" || Jn(t.type) ? c === "onfocus" ? o = "onfocusin" : c === "onblur" ? o = "onfocusout" : Xn.test(o) ? o = c : i.indexOf("-") === -1 && qn.test(o) ? o = o.replace(Zn, "-$&").toLowerCase() : r === null && (r = void 0) : c = o = "oninput", c === "oninput" && s[o = c] && (o = "oninputCapture"), s[o] = r;
2453
+ if (!(o === "value" && "defaultValue" in t && r == null || mi && o === "children" && i === "noscript" || o === "class" || o === "className")) {
2454
+ var a = o.toLowerCase();
2455
+ o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || i !== "input" && i !== "textarea" || gi(t.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : _i.test(o) ? o = a : i.indexOf("-") === -1 && pi.test(o) ? o = o.replace(vi, "-$&").toLowerCase() : r === null && (r = void 0) : a = o = "oninput", a === "oninput" && s[o = a] && (o = "oninputCapture"), s[o] = r;
2121
2456
  }
2122
2457
  }
2123
- i == "select" && s.multiple && Array.isArray(s.value) && (s.value = we(t.children).forEach(function(u) {
2458
+ i == "select" && s.multiple && Array.isArray(s.value) && (s.value = Se(t.children).forEach(function(u) {
2124
2459
  u.props.selected = s.value.indexOf(u.props.value) != -1;
2125
- })), i == "select" && s.defaultValue != null && (s.value = we(t.children).forEach(function(u) {
2460
+ })), i == "select" && s.defaultValue != null && (s.value = Se(t.children).forEach(function(u) {
2126
2461
  u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
2127
- })), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", ti)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
2128
- }(n), n.$$typeof = Yn, gt && gt(n);
2462
+ })), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Ci)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
2463
+ }(n), n.$$typeof = fi, Tt && Tt(n);
2129
2464
  };
2130
- var yt = v.__r;
2131
- v.__r = function(n) {
2132
- yt && yt(n), n.__c;
2465
+ var St = m.__r;
2466
+ m.__r = function(n) {
2467
+ St && St(n), n.__c;
2133
2468
  };
2134
- var bt = v.diffed;
2135
- v.diffed = function(n) {
2136
- bt && bt(n);
2469
+ var xt = m.diffed;
2470
+ m.diffed = function(n) {
2471
+ xt && xt(n);
2137
2472
  var e = n.props, t = n.__e;
2138
2473
  t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
2139
2474
  };
2140
- var ce = /* @__PURE__ */ new Map();
2141
- function ni(n) {
2142
- var e = ce.get(n);
2475
+ var he = /* @__PURE__ */ new Map();
2476
+ function Ti(n) {
2477
+ var e = he.get(n);
2143
2478
  e && e.destroy();
2144
2479
  }
2145
- function ii(n) {
2146
- var e = ce.get(n);
2480
+ function Si(n) {
2481
+ var e = he.get(n);
2147
2482
  e && e.update();
2148
2483
  }
2149
- var oe = null;
2150
- typeof window > "u" ? ((oe = function(n) {
2484
+ var le = null;
2485
+ typeof window > "u" ? ((le = function(n) {
2151
2486
  return n;
2152
2487
  }).destroy = function(n) {
2153
2488
  return n;
2154
- }, oe.update = function(n) {
2489
+ }, le.update = function(n) {
2155
2490
  return n;
2156
- }) : ((oe = function(n, e) {
2491
+ }) : ((le = function(n, e) {
2157
2492
  return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
2158
2493
  return function(i) {
2159
- if (i && i.nodeName && i.nodeName === "TEXTAREA" && !ce.has(i)) {
2160
- var s, o = null, r = window.getComputedStyle(i), c = (s = i.value, function() {
2161
- d({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
2162
- }), u = (function(a) {
2163
- i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", h), i.removeEventListener("input", c), window.removeEventListener("resize", h), Object.keys(a).forEach(function(_) {
2164
- return i.style[_] = a[_];
2165
- }), ce.delete(i);
2494
+ if (i && i.nodeName && i.nodeName === "TEXTAREA" && !he.has(i)) {
2495
+ var s, o = null, r = window.getComputedStyle(i), a = (s = i.value, function() {
2496
+ f({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
2497
+ }), u = (function(c) {
2498
+ i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", d), i.removeEventListener("input", a), window.removeEventListener("resize", d), Object.keys(c).forEach(function(_) {
2499
+ return i.style[_] = c[_];
2500
+ }), he.delete(i);
2166
2501
  }).bind(i, { height: i.style.height, resize: i.style.resize, textAlign: i.style.textAlign, overflowY: i.style.overflowY, overflowX: i.style.overflowX, wordWrap: i.style.wordWrap });
2167
- i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", h), i.addEventListener("input", c), window.addEventListener("resize", h), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", ce.set(i, { destroy: u, update: h }), h();
2502
+ i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", d), i.addEventListener("input", a), window.addEventListener("resize", d), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", he.set(i, { destroy: u, update: d }), d();
2168
2503
  }
2169
- function d(a) {
2170
- var _, p, f = a.restoreTextAlign, g = f === void 0 ? null : f, N = a.testForHeightReduction, b = N === void 0 || N, C = r.overflowY;
2504
+ function f(c) {
2505
+ var _, v, h = c.restoreTextAlign, p = h === void 0 ? null : h, y = c.testForHeightReduction, b = y === void 0 || y, C = r.overflowY;
2171
2506
  if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), b && (_ = function(T) {
2172
2507
  for (var E = []; T && T.parentNode && T.parentNode instanceof Element; )
2173
2508
  T.parentNode.scrollTop && E.push([T.parentNode, T.parentNode.scrollTop]), T = T.parentNode;
2174
2509
  return function() {
2175
- return E.forEach(function(L) {
2176
- var I = L[0], R = L[1];
2177
- I.style.scrollBehavior = "auto", I.scrollTop = R, I.style.scrollBehavior = null;
2510
+ return E.forEach(function(R) {
2511
+ var D = R[0], P = R[1];
2512
+ D.style.scrollBehavior = "auto", D.scrollTop = P, D.style.scrollBehavior = null;
2178
2513
  });
2179
2514
  };
2180
- }(i), i.style.height = ""), p = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && p > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), p = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = p + "px", g && (i.style.textAlign = g), _ && _(), o !== p && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = p), C !== r.overflow && !g)) {
2181
- var x = r.textAlign;
2182
- r.overflow === "hidden" && (i.style.textAlign = x === "start" ? "end" : "start"), d({ restoreTextAlign: x, testForHeightReduction: !0 });
2515
+ }(i), i.style.height = ""), v = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && v > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), v = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = v + "px", p && (i.style.textAlign = p), _ && _(), o !== v && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = v), C !== r.overflow && !p)) {
2516
+ var N = r.textAlign;
2517
+ r.overflow === "hidden" && (i.style.textAlign = N === "start" ? "end" : "start"), f({ restoreTextAlign: N, testForHeightReduction: !0 });
2183
2518
  }
2184
2519
  }
2185
- function h() {
2186
- d({ testForHeightReduction: !0, restoreTextAlign: null });
2520
+ function d() {
2521
+ f({ testForHeightReduction: !0, restoreTextAlign: null });
2187
2522
  }
2188
2523
  }(t);
2189
2524
  }), n;
2190
2525
  }).destroy = function(n) {
2191
- return n && Array.prototype.forEach.call(n.length ? n : [n], ni), n;
2192
- }, oe.update = function(n) {
2193
- return n && Array.prototype.forEach.call(n.length ? n : [n], ii), n;
2526
+ return n && Array.prototype.forEach.call(n.length ? n : [n], Ti), n;
2527
+ }, le.update = function(n) {
2528
+ return n && Array.prototype.forEach.call(n.length ? n : [n], Si), n;
2194
2529
  });
2195
- var wt = oe;
2196
- const q = new A("chat-input"), Ct = window.SpeechRecognition || window.webkitSpeechRecognition, Tt = (n) => {
2197
- const e = Z(null), t = n.controller.input, i = W(!1), s = W(!1), o = Z();
2198
- Ct && !o.current && (o.current = new Ct(), o.current.onstart = () => {
2199
- s.value = !0;
2200
- }, o.current.onend = () => {
2201
- s.value = !1;
2202
- }, o.current.onresult = (a) => {
2203
- var p, f, g;
2204
- const _ = (g = (f = (p = a.results) == null ? void 0 : p[0]) == null ? void 0 : f[0]) == null ? void 0 : g.transcript;
2205
- _ && (t.value = "".concat(t.value).concat(_));
2206
- });
2207
- const r = () => {
2208
- o.current && !s.value && o.current.start();
2209
- }, c = rt((a) => {
2210
- t.value = a.target.value;
2211
- }, [t]), u = qe(() => t.value.length <= 0 || i.value === !0);
2212
- F(() => (e.current && wt(e.current), () => {
2213
- e.current && wt.destroy(e.current);
2214
- }), [e]);
2215
- const d = rt(async () => {
2216
- i.value = !0;
2217
- try {
2218
- await n.controller.question(t.value), t.value = "";
2219
- } catch (a) {
2220
- console.error(a);
2221
- } finally {
2222
- i.value = !1;
2223
- }
2224
- }, [t, i]), h = (a) => {
2225
- a.code === "Enter" && (a.stopPropagation(), a.shiftKey === !1 && d());
2226
- };
2227
- return l("div", {
2228
- className: q.b(),
2229
- children: [l("textarea", {
2230
- className: q.e("textarea"),
2231
- type: "text",
2232
- rows: 6,
2233
- autoCorrect: "off",
2234
- autoCapitalize: "off",
2235
- autoComplete: "off",
2236
- value: t,
2237
- onInput: c,
2238
- onKeyDown: h,
2239
- ref: e,
2240
- disabled: i
2241
- }), l("div", {
2242
- className: q.b("action-wrapper"),
2243
- children: [l("div", {
2244
- title: s.value ? "语音输入中..." : "语音输入",
2245
- className: "".concat(q.be("action-wrapper", "action-item")),
2246
- onClick: r,
2247
- children: s.value ? l(xn, {}) : l(Nn, {})
2248
- }), l("div", {
2249
- title: i.value ? "思考中..." : "发送消息",
2250
- className: "".concat(q.be("action-wrapper", "action-item"), " ").concat(q.is("disabled", u.value), " ").concat(q.is("loading", i.value)),
2251
- onClick: d,
2252
- disabled: u,
2253
- children: l(bn, {})
2254
- })]
2255
- })]
2256
- });
2257
- };
2258
- var k = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))(k || {});
2259
- const si = ({
2260
- children: n,
2261
- actions: e,
2262
- // 接收行为数据
2263
- position: t = "bottom",
2264
- isOpen: i,
2265
- onToggleOpen: s,
2266
- onAction: o
2267
- // 接收行为事件回调
2268
- }) => {
2269
- const r = new A("pop"), [c, u] = Pt(i || !1), d = Z(null), h = Z(null);
2270
- F(() => {
2271
- i !== void 0 && u(i);
2272
- }, [i]), F(() => (h.current || (h.current = document.createElement("div"), h.current.className = r.b("content-container"), document.body.appendChild(h.current)), () => {
2273
- h.current && document.body.removeChild(h.current);
2274
- }), []), F(() => {
2275
- const _ = (p) => {
2276
- d.current && !d.current.contains(p.target) && !p.target.closest(r.b("content")) && (u(!1), s == null || s(!1));
2277
- };
2278
- return c && document.addEventListener("mousedown", _), () => {
2279
- document.removeEventListener("mousedown", _);
2280
- };
2281
- }, [c, s]);
2282
- const a = () => {
2283
- if (!d.current)
2284
- return {};
2285
- const _ = d.current.getBoundingClientRect(), p = {
2286
- position: "absolute",
2287
- zIndex: 1e3
2288
- }, f = {
2289
- bottom: {
2290
- top: _.bottom + window.scrollY,
2291
- left: _.left + window.scrollX
2292
- },
2293
- top: {
2294
- bottom: window.innerHeight - _.top + window.scrollY,
2295
- left: _.left + window.scrollX
2296
- },
2297
- left: {
2298
- top: _.top + window.scrollY,
2299
- right: window.innerWidth - _.left + window.scrollX
2300
- },
2301
- right: {
2302
- top: _.top + window.scrollY,
2303
- left: _.right + window.scrollX
2304
- }
2305
- };
2306
- return {
2307
- ...p,
2308
- ...f[t]
2309
- };
2310
- };
2311
- return l("span", {
2312
- className: "".concat(r.b("trigger-container")),
2313
- children: [l("span", {
2314
- className: "".concat(r.b("trigger-element")),
2315
- ref: d,
2316
- onClick: (_) => {
2317
- _.stopPropagation();
2318
- const p = !c;
2319
- u(p), s == null || s(p);
2320
- },
2321
- children: n
2322
- }), c && h.current && jn(l("div", {
2323
- className: "".concat(r.b("content"), " pop-").concat(t),
2324
- style: a(),
2325
- children: e == null ? void 0 : e.map((_) => l("div", {
2326
- className: r.b("content-item"),
2327
- onMouseDown: (p) => {
2328
- p.stopPropagation(), o == null || o(_.id, p);
2329
- },
2330
- children: [_.icon && l("img", {
2331
- className: r.b("content-item__icon"),
2332
- src: _.icon,
2333
- alt: _.caption
2334
- }), l("div", {
2335
- className: r.b("content-item__caption"),
2336
- children: _.caption
2337
- })]
2338
- }, _.id))
2339
- }), h.current)]
2340
- });
2341
- };
2342
- const P = new A("chat-topic-item"), oi = (n) => {
2343
- const {
2344
- current: e,
2345
- active: t,
2346
- topic: i,
2347
- onClick: s,
2348
- onAction: o
2349
- } = n, [r, c] = Pt(!1), u = (h) => {
2350
- h.stopPropagation(), o("LINK", h);
2351
- }, d = (h, a) => {
2352
- h === "DELETE" && o("DELETE", a), c(!1);
2353
- };
2354
- return l("div", {
2355
- className: "".concat(P.b(), " ").concat(P.is("active", t)),
2356
- onClick: s.bind(void 0),
2357
- children: [l("div", {
2358
- className: P.b("caption"),
2359
- title: i.caption,
2360
- children: i.caption
2361
- }), l("div", {
2362
- className: P.b("icon"),
2363
- children: [l("span", {
2364
- className: P.be("icon", "item"),
2365
- title: "跳转主视图",
2366
- onClick: u.bind(void 0),
2367
- children: l(In, {
2368
- className: P.b("link-icon")
2369
- })
2370
- }), e ? null : l(si, {
2371
- actions: [{
2372
- id: "DELETE",
2373
- caption: "删除话题"
2374
- }],
2375
- position: "bottom",
2376
- isOpen: r,
2377
- onToggleOpen: c,
2378
- onAction: d.bind(void 0),
2379
- children: l("span", {
2380
- className: P.be("icon", "item"),
2381
- title: "更多",
2382
- children: l(An, {
2383
- className: P.b("more-icon")
2384
- })
2385
- })
2386
- })]
2387
- })]
2388
- });
2389
- };
2390
- const ri = new A("chat-topics"), ai = (n) => {
2391
- const e = n.controller.topics, t = (s) => {
2392
- n.controller.handleTopicChange(s);
2393
- }, i = (s, o, r) => {
2394
- n.controller.handleTopicAction(s, o, r);
2395
- };
2396
- return l("div", {
2397
- className: ri.b(),
2398
- children: e.value.map((s) => {
2399
- var o, r;
2400
- return l(oi, {
2401
- topic: s,
2402
- current: s.id === ((o = n.controller.currentTopicOptions) == null ? void 0 : o.id),
2403
- active: s.id === ((r = n.controller.activedTopic.value) == null ? void 0 : r.id),
2404
- onClick: () => t(s),
2405
- onAction: (c, u) => i(c, s, u)
2406
- }, s.id);
2407
- })
2408
- });
2409
- };
2410
- class Et extends M {
2411
- constructor(t) {
2412
- super(t);
2413
- y(this, "ns", new A("chat-container"));
2414
- y(this, "containerRef", Ie());
2415
- y(this, "dragHandle", Ie());
2416
- y(this, "minimizeRef", Ie());
2417
- y(this, "data", {
2418
- x: window.innerWidth - 600,
2419
- y: 0,
2420
- width: 600,
2421
- height: window.innerHeight,
2422
- minWidth: 300,
2423
- minHeight: 300
2424
- });
2425
- y(this, "minimizeData", {
2426
- x: window.innerWidth - 86,
2427
- y: window.innerHeight - 86
2428
- });
2429
- /**
2430
- * 是否禁止拖动
2431
- * - 拖拽边时应禁止拖动
2432
- * @type {boolean}
2433
- * @memberof ChatContainer
2434
- */
2435
- y(this, "disabled", !1);
2436
- /**
2437
- * 最小化是否在拖拽中
2438
- * - 在拖拽时不应触发点击事件
2439
- * @type {boolean}
2440
- * @memberof ChatContainer
2441
- */
2442
- y(this, "isDragging", !1);
2443
- this.state = {
2444
- isFullScreen: !1,
2445
- isMinimize: !1
2446
- };
2447
- }
2448
- calcWindowStyle() {
2449
- return {
2450
- left: "".concat(this.data.x, "px"),
2451
- top: "".concat(this.data.y, "px"),
2452
- height: "".concat(this.data.height, "px"),
2453
- width: "".concat(this.data.width, "px"),
2454
- "z-index": "1000"
2455
- };
2456
- }
2457
- calcMinimizeStyle() {
2458
- return {
2459
- left: "".concat(this.minimizeData.x, "px"),
2460
- top: "".concat(this.minimizeData.y, "px"),
2461
- "z-index": "99999"
2462
- };
2463
- }
2464
- setStyle() {
2465
- Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
2466
- }
2467
- componentDidMount() {
2468
- const t = localStorage.getItem(k.MINIMIZE_STYLY_CHCHE);
2469
- t && (this.minimizeData = JSON.parse(t));
2470
- const i = localStorage.getItem(k.STYLE_CACHE);
2471
- i && (this.data = JSON.parse(i), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
2472
- const s = this.data;
2473
- this.minimizeRef.current.onmousedown = (o) => {
2474
- document.body.style.userSelect = "none";
2475
- const r = o.clientX - this.minimizeRef.current.offsetLeft, c = o.clientY - this.minimizeRef.current.offsetTop, u = Date.now(), d = (a) => {
2476
- this.minimizeData.x = a.clientX - r, this.minimizeData.y = a.clientY - c, this.setStyle();
2477
- }, h = () => {
2478
- const a = Date.now();
2479
- this.isDragging = a - u > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", h);
2480
- };
2481
- document.addEventListener("mousemove", d), document.addEventListener("mouseup", h);
2482
- }, this.dragHandle.current.onmousedown = (o) => {
2483
- if (this.disabled || this.state.isFullScreen)
2484
- return;
2485
- document.body.style.userSelect = "none";
2486
- const r = o.clientX - this.containerRef.current.offsetLeft, c = o.clientY - this.containerRef.current.offsetTop, u = (h) => {
2487
- s.x = h.clientX - r, s.y = h.clientY - c, this.setStyle();
2488
- }, d = () => {
2489
- document.body.style.userSelect = "", document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", d);
2490
- };
2491
- document.addEventListener("mousemove", u), document.addEventListener("mouseup", d);
2492
- }, Ae(this.containerRef.current).resizable({
2493
- // 可拖拽的边缘
2494
- edges: {
2495
- top: !0,
2496
- right: !0,
2497
- bottom: !0,
2498
- left: !0
2499
- },
2500
- margin: 6,
2501
- modifiers: [
2502
- // 保持在父对象内部
2503
- Ae.modifiers.restrictEdges({
2504
- outer: document.body
2505
- }),
2506
- // 缩放最小宽度
2507
- Ae.modifiers.restrictSize({
2508
- min: {
2509
- width: s.minWidth,
2510
- height: s.minHeight
2511
- }
2512
- })
2513
- ],
2514
- inertia: !0,
2515
- listeners: {
2516
- move: (o) => {
2517
- this.state.isFullScreen || (s.x = o.rect.left, s.y = o.rect.top, s.width = o.rect.width, s.height = o.rect.height, this.setStyle());
2518
- },
2519
- start: () => {
2520
- this.disabled = !0, document.body.style.userSelect = "none";
2521
- },
2522
- end: () => {
2523
- this.disabled = !1, document.body.style.userSelect = "";
2524
- }
2525
- }
2526
- });
2527
- }
2528
- componentWillUnmount() {
2529
- localStorage.setItem(k.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(k.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
2530
- }
2531
- /**
2532
- * 关闭聊天窗口
2533
- *
2534
- * @author chitanda
2535
- * @date 2023-10-15 19:10:31
2536
- */
2537
- close() {
2538
- this.props.close();
2539
- }
2540
- /**
2541
- * 全屏
2542
- *
2543
- * @author ljx
2544
- * @date 2024-05-07 15:10:31
2545
- */
2546
- fullScreen() {
2547
- const t = this.containerRef.current;
2548
- t && (t.requestFullscreen(), this.setState({
2549
- isFullScreen: !0
2550
- }), this.props.fullscreen(!0));
2551
- }
2552
- /**
2553
- * 关闭全屏
2554
- *
2555
- * @author ljx
2556
- * @date 2024-05-07 15:10:31
2557
- */
2558
- closeFullScreen() {
2559
- this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
2560
- isFullScreen: !1
2561
- }), this.props.fullscreen(!1), this.setStyle());
2562
- }
2563
- /**
2564
- * 最小化
2565
- *
2566
- * @memberof ChatContainer
2567
- */
2568
- minimize() {
2569
- this.closeFullScreen(), this.setState({
2570
- isMinimize: !0
2571
- }), this.props.minimize(!0);
2572
- }
2573
- /**
2574
- * 退出最小化
2575
- *
2576
- * @memberof ChatContainer
2577
- */
2578
- exitMinimize() {
2579
- this.isDragging || (this.setState({
2580
- isMinimize: !1
2581
- }), this.props.minimize(!1));
2582
- }
2583
- /**
2584
- * 阻止冒泡
2585
- * - 防止点击头部行为时误触发拖动监听
2586
- * @param {MouseEvent} evt
2587
- * @memberof ChatContainer
2588
- */
2589
- stopPropagation(t) {
2590
- t.stopPropagation();
2591
- }
2592
- render() {
2593
- return l("div", {
2594
- className: "".concat(this.ns.b()),
2595
- children: [l("div", {
2596
- className: "".concat(this.ns.e("dialog"), " ").concat(this.ns.is("full-screen", this.state.isFullScreen), " ").concat(this.ns.is("hidden", this.state.isMinimize)),
2597
- ref: this.containerRef,
2598
- children: [l("div", {
2599
- ref: this.dragHandle,
2600
- className: this.ns.b("header"),
2601
- children: [l("div", {
2602
- className: this.ns.b("header-caption"),
2603
- children: this.props.caption || "AI助手"
2604
- }), l("div", {
2605
- className: this.ns.b("header-action-wrapper"),
2606
- children: [l("div", {
2607
- title: "最小化",
2608
- className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
2609
- onMouseDown: this.stopPropagation.bind(this),
2610
- onClick: this.minimize.bind(this),
2611
- children: l(Sn, {})
2612
- }), this.state.isFullScreen ? l("div", {
2613
- title: "退出全屏",
2614
- className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
2615
- onMouseDown: this.stopPropagation.bind(this),
2616
- onClick: this.closeFullScreen.bind(this),
2617
- children: l(En, {})
2618
- }) : l("div", {
2619
- title: "全屏",
2620
- className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
2621
- onMouseDown: this.stopPropagation.bind(this),
2622
- onClick: this.fullScreen.bind(this),
2623
- children: l(Tn, {})
2624
- }), l("div", {
2625
- title: "关闭",
2626
- className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
2627
- onMouseDown: this.stopPropagation.bind(this),
2628
- onClick: this.close.bind(this),
2629
- children: l(gn, {})
2630
- })]
2631
- })]
2632
- }), this.props.mode === "TOPIC" ? l("div", {
2633
- className: "".concat(this.ns.b("main")),
2634
- children: [l("div", {
2635
- className: "".concat(this.ns.be("main", "left")),
2636
- children: l(ai, {
2637
- controller: this.props.aiTopic
2638
- })
2639
- }), l("div", {
2640
- className: "".concat(this.ns.be("main", "right")),
2641
- children: [l("div", {
2642
- className: this.ns.b("content"),
2643
- children: l(ht, {
2644
- controller: this.props.aiChat,
2645
- toolbarItems: this.props.contentToolbarItems
2646
- })
2647
- }), l(Ue, {
2648
- data: this.props.aiTopic.activedTopic.value,
2649
- type: "footer",
2650
- className: this.ns.e("toolbar"),
2651
- controller: this.props.aiChat,
2652
- items: this.props.footerToolbarItems
2653
- }), l("div", {
2654
- className: this.ns.b("footer"),
2655
- children: l(Tt, {
2656
- controller: this.props.aiChat
2657
- })
2658
- })]
2659
- })]
2660
- }) : l("div", {
2661
- className: "".concat(this.ns.be("main", "default")),
2662
- children: [l("div", {
2663
- className: this.ns.b("content"),
2664
- children: l(ht, {
2665
- controller: this.props.aiChat,
2666
- toolbarItems: this.props.contentToolbarItems
2667
- })
2668
- }), l(Ue, {
2669
- data: this.props.aiTopic.activedTopic.value,
2670
- type: "footer",
2671
- className: this.ns.e("toolbar"),
2672
- controller: this.props.aiChat,
2673
- items: this.props.footerToolbarItems
2674
- }), l("div", {
2675
- className: this.ns.b("footer"),
2676
- children: l(Tt, {
2677
- controller: this.props.aiChat
2678
- })
2679
- })]
2680
- })]
2681
- }), l("div", {
2682
- title: "AI助手",
2683
- ref: this.minimizeRef,
2684
- className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
2685
- onClick: this.exitMinimize.bind(this),
2686
- children: l(kn, {})
2687
- })]
2688
- });
2689
- }
2690
- }
2691
- class Le {
2530
+ var Et = le;
2531
+ class Ue {
2692
2532
  constructor(e) {
2693
2533
  this.msg = e;
2694
2534
  }
@@ -2734,7 +2574,7 @@ class Le {
2734
2574
  this.msg.completed = e;
2735
2575
  }
2736
2576
  }
2737
- class ve {
2577
+ class ye {
2738
2578
  constructor(e) {
2739
2579
  this.data = e;
2740
2580
  }
@@ -2757,7 +2597,25 @@ class ve {
2757
2597
  return this.data.aiChat;
2758
2598
  }
2759
2599
  }
2760
- class St {
2600
+ class Fe {
2601
+ constructor(e) {
2602
+ this.material = e;
2603
+ }
2604
+ get id() {
2605
+ return this.material.id;
2606
+ }
2607
+ get type() {
2608
+ return this.material.type;
2609
+ }
2610
+ get metadata() {
2611
+ return this.material.metadata;
2612
+ }
2613
+ get data() {
2614
+ return this.material.data;
2615
+ }
2616
+ }
2617
+ var $ = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))($ || {});
2618
+ class $t {
2761
2619
  /**
2762
2620
  * Creates an instance of AiChatController.
2763
2621
  *
@@ -2773,7 +2631,15 @@ class St {
2773
2631
  * @date 2023-10-16 16:10:29
2774
2632
  * @type {Signal<ChatMessage[]>}
2775
2633
  */
2776
- y(this, "messages", ne([]));
2634
+ w(this, "messages", J([]));
2635
+ /**
2636
+ * 素材列表
2637
+ *
2638
+ * @author tony001
2639
+ * @date 2025-02-27 18:02:46
2640
+ * @type {Signal<IMaterial[]>}
2641
+ */
2642
+ w(this, "materials", J([]));
2777
2643
  /**
2778
2644
  * 聊天框输入值
2779
2645
  *
@@ -2781,7 +2647,7 @@ class St {
2781
2647
  * @date 2023-10-16 15:10:43
2782
2648
  * @type {Signal<string>}
2783
2649
  */
2784
- y(this, "input", ne(""));
2650
+ w(this, "input", J(""));
2785
2651
  /**
2786
2652
  * 视图参数
2787
2653
  *
@@ -2789,7 +2655,7 @@ class St {
2789
2655
  * @date 2025-02-24 14:02:23
2790
2656
  * @type {object}
2791
2657
  */
2792
- y(this, "context");
2658
+ w(this, "context");
2793
2659
  /**
2794
2660
  * 视图参数
2795
2661
  *
@@ -2797,7 +2663,7 @@ class St {
2797
2663
  * @date 2025-02-24 14:02:32
2798
2664
  * @type {object}
2799
2665
  */
2800
- y(this, "params");
2666
+ w(this, "params");
2801
2667
  /**
2802
2668
  * 应用实体标记
2803
2669
  *
@@ -2805,7 +2671,7 @@ class St {
2805
2671
  * @date 2025-02-24 14:02:10
2806
2672
  * @type {string}
2807
2673
  */
2808
- y(this, "appDataEntityId");
2674
+ w(this, "appDataEntityId");
2809
2675
  /**
2810
2676
  * 话题标识
2811
2677
  *
@@ -2813,7 +2679,7 @@ class St {
2813
2679
  * @date 2025-02-24 18:02:02
2814
2680
  * @type {(string | undefined)}
2815
2681
  */
2816
- y(this, "topicId");
2682
+ w(this, "topicId");
2817
2683
  this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.fecthHistory();
2818
2684
  }
2819
2685
  /**
@@ -2825,7 +2691,7 @@ class St {
2825
2691
  */
2826
2692
  async fecthHistory() {
2827
2693
  if (this.topicId) {
2828
- const e = await U.getData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, this.topicId);
2694
+ const e = await V.getData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, this.topicId);
2829
2695
  if (e && e.data && e.data.length > 0)
2830
2696
  return e.data.forEach((t) => {
2831
2697
  const i = {
@@ -2858,7 +2724,7 @@ class St {
2858
2724
  data: this.messages.value.map((t) => t._origin),
2859
2725
  timestamp: (/* @__PURE__ */ new Date()).getTime()
2860
2726
  };
2861
- await U.updateData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, e);
2727
+ await V.updateData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, e);
2862
2728
  }
2863
2729
  /**
2864
2730
  * 设置聊天框值
@@ -2879,7 +2745,7 @@ class St {
2879
2745
  */
2880
2746
  addMessage(e) {
2881
2747
  const t = this.messages.value.find((i) => i.messageid === e.messageid);
2882
- t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Le(e)], this.asyncToIndexDB();
2748
+ t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ue(e)], this.asyncToIndexDB();
2883
2749
  }
2884
2750
  /**
2885
2751
  * 更新消息完成状态
@@ -2902,7 +2768,25 @@ class St {
2902
2768
  */
2903
2769
  replaceMessage(e) {
2904
2770
  const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
2905
- t !== -1 ? (this.messages.value[t] = new Le(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Le(e)], this.asyncToIndexDB();
2771
+ t !== -1 ? (this.messages.value[t] = new Ue(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ue(e)], this.asyncToIndexDB();
2772
+ }
2773
+ /**
2774
+ * 数据对象转 XML 字符串
2775
+ *
2776
+ * @author tony001
2777
+ * @date 2025-03-03 11:03:55
2778
+ * @return {*} {string}
2779
+ */
2780
+ stringlyMaterialResource() {
2781
+ let e = "";
2782
+ const t = [];
2783
+ return this.materials.value && this.materials.value.length > 0 && (this.materials.value.forEach((i) => {
2784
+ if (i.type === "ossfile") {
2785
+ const s = i.metadata;
2786
+ s.state && s.state === "successed" && t.push(i);
2787
+ } else
2788
+ t.push(i);
2789
+ }), this.materials.value = []), t && t.length > 0 && (e = jt.stringify(t)), e;
2906
2790
  }
2907
2791
  /**
2908
2792
  * 提问
@@ -2912,15 +2796,16 @@ class St {
2912
2796
  * @return {*} {Promise<void>}
2913
2797
  */
2914
2798
  async question(e) {
2915
- this.addMessage({
2799
+ let t = this.stringlyMaterialResource();
2800
+ t ? t += e : t = e, this.addMessage({
2916
2801
  state: 30,
2917
- messageid: Lt(),
2802
+ messageid: qt(),
2918
2803
  role: "USER",
2919
2804
  type: "DEFAULT",
2920
- content: e
2805
+ content: t
2921
2806
  }), await this.opts.question(this.context, this.params, {
2922
2807
  appDataEntityId: this.appDataEntityId
2923
- }, this.messages.value.filter((t) => t.type !== "ERROR").map((t) => t._origin)), this.opts.action && this.opts.action("question", e);
2808
+ }, this.messages.value.filter((i) => i.type !== "ERROR").map((i) => i._origin)), this.opts.action && this.opts.action("question", e);
2924
2809
  }
2925
2810
  /**
2926
2811
  * 回填选中的消息
@@ -2972,7 +2857,7 @@ class St {
2972
2857
  */
2973
2858
  copyMessage(e) {
2974
2859
  const t = e.content;
2975
- Rt.copy(t), this.opts.action && this.opts.action("copymsg", e);
2860
+ Wt.copy(t), this.opts.action && this.opts.action("copymsg", e);
2976
2861
  }
2977
2862
  /**
2978
2863
  * 新建对话
@@ -2980,12 +2865,45 @@ class St {
2980
2865
  * @memberof AiChatController
2981
2866
  */
2982
2867
  async newDialogue() {
2983
- this.messages.value.length = 0, this.topicId && await U.deleteData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
2868
+ this.messages.value.length = 0, this.topicId && await V.deleteData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
2984
2869
  appDataEntityId: this.appDataEntityId
2985
2870
  });
2986
2871
  }
2872
+ /**
2873
+ * 新增素材资源
2874
+ *
2875
+ * @author tony001
2876
+ * @date 2025-02-27 18:02:00
2877
+ * @param {IMaterial} data
2878
+ */
2879
+ addMaterial(e) {
2880
+ this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Fe(e)];
2881
+ }
2882
+ /**
2883
+ * 替换素材资源
2884
+ *
2885
+ * @author tony001
2886
+ * @date 2025-02-28 15:02:24
2887
+ * @param {string} id
2888
+ * @param {IMaterial} data
2889
+ */
2890
+ replaceMaterial(e, t) {
2891
+ const i = this.materials.value.findIndex((s) => s.id === e);
2892
+ i !== -1 ? (this.materials.value[i] = new Fe(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Fe(t)];
2893
+ }
2894
+ /**
2895
+ * 删除指定素材资源
2896
+ *
2897
+ * @author tony001
2898
+ * @date 2025-02-27 18:02:33
2899
+ * @param {IMaterial} data
2900
+ */
2901
+ deleteMaterial(e) {
2902
+ const t = this.materials.value.findIndex((i) => i.id === e.id);
2903
+ t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
2904
+ }
2987
2905
  }
2988
- class ci {
2906
+ class xi {
2989
2907
  /**
2990
2908
  * Creates an instance of AiTopicController.
2991
2909
  * @author tony001
@@ -3000,7 +2918,7 @@ class ci {
3000
2918
  * @date 2025-02-20 16:02:38
3001
2919
  * @type {Signal<ChatTopic[]>}
3002
2920
  */
3003
- y(this, "topics", ne([]));
2921
+ w(this, "topics", J([]));
3004
2922
  /**
3005
2923
  * 激活话题
3006
2924
  *
@@ -3008,7 +2926,7 @@ class ci {
3008
2926
  * @date 2025-02-24 16:02:44
3009
2927
  * @type {(Signal<ITopic | null>)}
3010
2928
  */
3011
- y(this, "activedTopic", ne(null));
2929
+ w(this, "activedTopic", J(null));
3012
2930
  /**
3013
2931
  * 当前话题配置备份
3014
2932
  *
@@ -3017,7 +2935,7 @@ class ci {
3017
2935
  * @public
3018
2936
  * @type {(ITopicOptions | undefined)}
3019
2937
  */
3020
- y(this, "currentTopicOptions");
2938
+ w(this, "currentTopicOptions");
3021
2939
  this.chat = e;
3022
2940
  }
3023
2941
  /**
@@ -3030,7 +2948,7 @@ class ci {
3030
2948
  async fetchHistory(e) {
3031
2949
  const i = await e.configService(e.appid, "aitopics", e.type).load();
3032
2950
  i && i.length > 0 && i.forEach((s) => {
3033
- this.topics.value = [...this.topics.value, new ve(s)];
2951
+ this.topics.value = [...this.topics.value, new ye(s)];
3034
2952
  });
3035
2953
  }
3036
2954
  /**
@@ -3043,8 +2961,8 @@ class ci {
3043
2961
  */
3044
2962
  async updateCurrentTopic(e) {
3045
2963
  this.currentTopicOptions = e;
3046
- const t = this.topics.value.findIndex((r) => r.id === e.id), i = new ve(e);
3047
- t !== -1 ? this.topics.value.splice(t, 1, new ve(e)) : this.topics.value = [...this.topics.value, new ve(e)];
2964
+ const t = this.topics.value.findIndex((r) => r.id === e.id), i = new ye(e);
2965
+ t !== -1 ? this.topics.value.splice(t, 1, new ye(e)) : this.topics.value = [...this.topics.value, new ye(e)];
3048
2966
  const s = this.topics.value.map((r) => ({
3049
2967
  appid: r.appid,
3050
2968
  id: r.id,
@@ -3068,21 +2986,21 @@ class ci {
3068
2986
  * @return {*} {Promise<void>}
3069
2987
  */
3070
2988
  async removeTopic(e, t, i, s, o) {
3071
- var h;
2989
+ var d;
3072
2990
  let r = !0;
3073
2991
  if (e.beforeDelete && (r = await e.beforeDelete(t, i, s, o)), !r)
3074
2992
  return;
3075
- const c = this.topics.value.findIndex((a) => a.id === s.id);
3076
- c !== -1 && (this.topics.value.splice(c, 1), this.topics.value = [...this.topics.value]);
3077
- const u = this.topics.value.map((a) => ({
3078
- appid: a.appid,
3079
- id: a.id,
3080
- type: a.type,
3081
- caption: a.caption,
3082
- url: a.url,
3083
- aiChat: a.aiChat
3084
- })), d = e.configService(e.appid, "aitopics", e.type);
3085
- await (d == null ? void 0 : d.save(u)), await U.deleteData(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((h = this.activedTopic.value) == null ? void 0 : h.id) && this.handleTopicChange(this.topics.value[0]);
2993
+ const a = this.topics.value.findIndex((c) => c.id === s.id);
2994
+ a !== -1 && (this.topics.value.splice(a, 1), this.topics.value = [...this.topics.value]);
2995
+ const u = this.topics.value.map((c) => ({
2996
+ appid: c.appid,
2997
+ id: c.id,
2998
+ type: c.type,
2999
+ caption: c.caption,
3000
+ url: c.url,
3001
+ aiChat: c.aiChat
3002
+ })), f = e.configService(e.appid, "aitopics", e.type);
3003
+ await (f == null ? void 0 : f.save(u)), await V.deleteData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((d = this.activedTopic.value) == null ? void 0 : d.id) && this.handleTopicChange(this.topics.value[0]);
3086
3004
  }
3087
3005
  /**
3088
3006
  * 处理选中变化
@@ -3107,59 +3025,190 @@ class ci {
3107
3025
  */
3108
3026
  async handleTopicAction(e, t, i) {
3109
3027
  var o, r;
3110
- const s = this.topics.value.find((c) => c.id === t.id);
3028
+ const s = this.topics.value.find((a) => a.id === t.id);
3111
3029
  if (this.currentTopicOptions && s && s.aiChat) {
3112
3030
  const {
3113
- context: c,
3031
+ context: a,
3114
3032
  params: u
3115
3033
  } = s.aiChat;
3116
- e === "DELETE" && await this.removeTopic(this.currentTopicOptions, c, u, s, i), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, c, u, t, i);
3034
+ e === "DELETE" && await this.removeTopic(this.currentTopicOptions, a, u, s, i), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, a, u, t, i);
3117
3035
  }
3118
3036
  }
3119
3037
  }
3120
- class li {
3038
+ class ln {
3039
+ constructor(e) {
3040
+ this.aiChat = e;
3041
+ }
3042
+ }
3043
+ class Ei extends ln {
3121
3044
  /**
3122
- * Creates an instance of ChatController.
3045
+ * 执行操作
3046
+ *
3123
3047
  * @author tony001
3124
- * @date 2025-02-24 11:02:20
3048
+ * @date 2025-02-28 15:02:48
3049
+ * @return {*} {Promise<void>}
3125
3050
  */
3126
- constructor() {
3127
- /**
3128
- * 聊天框容器
3129
- *
3130
- * @author chitanda
3131
- * @date 2023-10-13 17:10:03
3132
- * @protected
3133
- * @type {HTMLDivElement}
3134
- */
3135
- y(this, "container");
3136
- /**
3137
- * 默认模式(聊天框)和话题模式(支持多话题切换),聊天框为默认模式
3138
- *
3139
- * @author tony001
3140
- * @date 2025-02-20 16:02:50
3141
- * @protected
3142
- * @type {('DEFAULT' | 'TOPIC')}
3143
- */
3144
- y(this, "mode", "DEFAULT");
3145
- /**
3146
- * 是否挂载ai话题
3147
- *
3148
- * @author tony001
3149
- * @date 2025-02-23 16:02:54
3150
- * @protected
3151
- * @type {boolean}
3152
- */
3153
- y(this, "isMountedAiTopic", !1);
3154
- /**
3155
- * 容器配置备份
3156
- *
3051
+ async excuteAction(e, t) {
3052
+ if (t && t.onClick) {
3053
+ const i = await t.onClick(e, this.aiChat.context, this.aiChat.params);
3054
+ if (i && i.data && i.data.length > 0) {
3055
+ const s = i.data[0], o = {
3056
+ id: s.id,
3057
+ type: s.type,
3058
+ data: s.data || {},
3059
+ metadata: s.metadata || {}
3060
+ };
3061
+ t.id && Object.assign(o.metadata, {
3062
+ actionId: t.id
3063
+ }), this.aiChat.addMaterial(o);
3064
+ }
3065
+ }
3066
+ }
3067
+ }
3068
+ class $i extends ln {
3069
+ /**
3070
+ * 执行操作
3071
+ *
3072
+ * @author tony001
3073
+ * @date 2025-02-28 15:02:27
3074
+ * @return {*} {Promise<void>}
3075
+ */
3076
+ async excuteAction(e, t) {
3077
+ const i = this.aiChat.opts.uploader, {
3078
+ multiple: s,
3079
+ accept: o,
3080
+ maxSize: r,
3081
+ onSelect: a,
3082
+ onUpload: u,
3083
+ onSuccess: f,
3084
+ onError: d,
3085
+ onProgress: c
3086
+ } = i, _ = {
3087
+ multiple: s || !0,
3088
+ accept: o || "*/*",
3089
+ maxSize: r || 5 * 1024 * 1024,
3090
+ onSelect: (h) => {
3091
+ a == null || a(h), h.length > 0 && h.forEach((p) => {
3092
+ const y = this.buildMaterialObject(p);
3093
+ Object.assign(y.metadata, {
3094
+ state: "uploading"
3095
+ }), this.aiChat.addMaterial(y);
3096
+ });
3097
+ },
3098
+ onUpload: async (h, p) => u(h, p, {
3099
+ context: this.aiChat.context,
3100
+ params: this.aiChat.params
3101
+ }),
3102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3103
+ onSuccess: (h, p) => {
3104
+ const y = {
3105
+ id: h.id,
3106
+ type: "ossfile",
3107
+ data: {
3108
+ id: h.id,
3109
+ name: h.name
3110
+ },
3111
+ metadata: {
3112
+ ext: h.ext,
3113
+ fileext: h.fileext,
3114
+ fileid: h.fileid,
3115
+ filename: h.filename,
3116
+ size: h.size,
3117
+ filesize: h.filesize,
3118
+ state: "successed"
3119
+ }
3120
+ };
3121
+ this.aiChat.replaceMaterial(p.name, y), f == null || f(h, p);
3122
+ },
3123
+ onError: (h, p) => {
3124
+ const y = this.buildMaterialObject(p);
3125
+ Object.assign(y.metadata, {
3126
+ state: "failed"
3127
+ }), this.aiChat.replaceMaterial(p.name, y), d == null || d(h, p);
3128
+ },
3129
+ onProgress: (h, p) => {
3130
+ c == null || c(h, p);
3131
+ }
3132
+ };
3133
+ new Sn(_).openFilePicker();
3134
+ }
3135
+ /**
3136
+ * 构建素材对象
3137
+ *
3138
+ * @author tony001
3139
+ * @date 2025-02-28 15:02:12
3140
+ * @param {File} file
3141
+ * @return {*} {IMaterial}
3142
+ */
3143
+ buildMaterialObject(e) {
3144
+ return {
3145
+ id: e.name,
3146
+ type: "ossfile",
3147
+ data: {
3148
+ name: e.name,
3149
+ id: e.name
3150
+ },
3151
+ metadata: {
3152
+ size: e.size,
3153
+ type: e.type,
3154
+ lastModified: e.lastModified
3155
+ }
3156
+ };
3157
+ }
3158
+ }
3159
+ class Nt {
3160
+ static getMaterialHelper(e, t) {
3161
+ switch (e) {
3162
+ case "ossfile":
3163
+ return new $i(t);
3164
+ default:
3165
+ return new Ei(t);
3166
+ }
3167
+ }
3168
+ }
3169
+ class Ni {
3170
+ /**
3171
+ * Creates an instance of ChatController.
3172
+ * @author tony001
3173
+ * @date 2025-02-24 11:02:20
3174
+ */
3175
+ constructor() {
3176
+ /**
3177
+ * 聊天框容器
3178
+ *
3179
+ * @author chitanda
3180
+ * @date 2023-10-13 17:10:03
3181
+ * @protected
3182
+ * @type {HTMLDivElement}
3183
+ */
3184
+ w(this, "container");
3185
+ /**
3186
+ * 默认模式(聊天框)和话题模式(支持多话题切换),聊天框为默认模式
3187
+ *
3188
+ * @author tony001
3189
+ * @date 2025-02-20 16:02:50
3190
+ * @protected
3191
+ * @type {('DEFAULT' | 'TOPIC')}
3192
+ */
3193
+ w(this, "mode", "DEFAULT");
3194
+ /**
3195
+ * 是否挂载ai话题
3196
+ *
3197
+ * @author tony001
3198
+ * @date 2025-02-23 16:02:54
3199
+ * @protected
3200
+ * @type {boolean}
3201
+ */
3202
+ w(this, "isMountedAiTopic", !1);
3203
+ /**
3204
+ * 容器配置备份
3205
+ *
3157
3206
  * @author tony001
3158
3207
  * @date 2025-02-24 11:02:49
3159
3208
  * @protected
3160
3209
  * @type {(IContainerOptions | undefined)}
3161
3210
  */
3162
- y(this, "backupChatOptions");
3211
+ w(this, "backupChatOptions");
3163
3212
  /**
3164
3213
  * 话题控制器
3165
3214
  *
@@ -3168,7 +3217,7 @@ class li {
3168
3217
  * @public
3169
3218
  * @type {AiTopicController}
3170
3219
  */
3171
- y(this, "aiTopic");
3220
+ w(this, "aiTopic");
3172
3221
  /**
3173
3222
  * 聊天控制器
3174
3223
  *
@@ -3177,8 +3226,8 @@ class li {
3177
3226
  * @public
3178
3227
  * @type {(AiChatController | undefined)}
3179
3228
  */
3180
- y(this, "aiChat");
3181
- this.aiTopic = new ci(this);
3229
+ w(this, "aiChat");
3230
+ this.aiTopic = new xi(this);
3182
3231
  }
3183
3232
  /**
3184
3233
  * 初始化IndexDB
@@ -3188,7 +3237,7 @@ class li {
3188
3237
  * @return {*} {Promise<void>}
3189
3238
  */
3190
3239
  async initIndexDB() {
3191
- await U.checkTableExists(k.DATA_BASE_NAME, k.DATA_TABLE_NAME) || await U.createTable(k.DATA_BASE_NAME, k.DATA_TABLE_NAME, k.DATA_TABLE_KEY_NAME, !1);
3240
+ await V.checkTableExists($.DATA_BASE_NAME, $.DATA_TABLE_NAME) || await V.createTable($.DATA_BASE_NAME, $.DATA_TABLE_NAME, $.DATA_TABLE_KEY_NAME, !1);
3192
3241
  }
3193
3242
  /**
3194
3243
  * 创建聊天窗口(会同时显示出来)
@@ -3209,17 +3258,20 @@ class li {
3209
3258
  params: t.params,
3210
3259
  appDataEntityId: t.appDataEntityId,
3211
3260
  contentToolbarItems: t.contentToolbarItems,
3212
- footerToolbarItems: t.footerToolbarItems
3261
+ footerToolbarItems: t.footerToolbarItems,
3262
+ questionToolbarItems: t.questionToolbarItems
3213
3263
  }
3214
3264
  }), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
3215
3265
  topicId: i == null ? void 0 : i.id
3216
- }), this.aiChat = new St(t), K(H(Et, {
3266
+ }), this.aiChat = new $t(t), te(I(At, {
3217
3267
  aiTopic: this.aiTopic,
3218
3268
  aiChat: this.aiChat,
3219
3269
  mode: e.mode ? e.mode : "DEFAULT",
3270
+ containerOptions: e.containerOptions,
3220
3271
  caption: e.mode && e.mode === "TOPIC" ? "AI助手" : t.caption,
3221
3272
  contentToolbarItems: t.contentToolbarItems,
3222
3273
  footerToolbarItems: t.footerToolbarItems,
3274
+ questionToolbarItems: t.questionToolbarItems,
3223
3275
  close: () => {
3224
3276
  this.close(), t.closed && t.closed(t.context, t.params);
3225
3277
  },
@@ -3239,7 +3291,7 @@ class li {
3239
3291
  * @param {ChatTopic} topic
3240
3292
  */
3241
3293
  switchAiChatController(e) {
3242
- var i, s;
3294
+ var i, s, o;
3243
3295
  const t = {
3244
3296
  ...this.backupChatOptions.chatOptions
3245
3297
  };
@@ -3249,23 +3301,26 @@ class li {
3249
3301
  params: e.aiChat.params,
3250
3302
  contentToolbarItems: e.aiChat.contentToolbarItems,
3251
3303
  footerToolbarItems: e.aiChat.footerToolbarItems,
3304
+ questionToolbarItems: e.aiChat.questionToolbarItems,
3252
3305
  appDataEntityId: e.aiChat.appDataEntityId,
3253
3306
  topicId: e.id
3254
- }), this.aiChat = new St(t), this.container && (K(null, this.container), K(H(Et, {
3307
+ }), this.aiChat = new $t(t), this.container && (te(null, this.container), te(I(At, {
3255
3308
  aiTopic: this.aiTopic,
3256
3309
  aiChat: this.aiChat,
3257
3310
  mode: (i = this.backupChatOptions) != null && i.mode ? this.backupChatOptions.mode : "DEFAULT",
3258
- caption: (s = this.backupChatOptions) != null && s.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
3311
+ containerOptions: (s = this.backupChatOptions) == null ? void 0 : s.containerOptions,
3312
+ caption: (o = this.backupChatOptions) != null && o.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
3259
3313
  contentToolbarItems: t.contentToolbarItems,
3260
3314
  footerToolbarItems: t.footerToolbarItems,
3315
+ questionToolbarItems: t.questionToolbarItems,
3261
3316
  close: () => {
3262
3317
  this.close(), t.closed && t.closed(t.context, t.params);
3263
3318
  },
3264
- fullscreen: (o) => {
3265
- t.fullscreen && t.fullscreen(o, t.context, t.params);
3319
+ fullscreen: (r) => {
3320
+ t.fullscreen && t.fullscreen(r, t.context, t.params);
3266
3321
  },
3267
- minimize: (o) => {
3268
- t.minimize && t.minimize(o, t.context, t.params);
3322
+ minimize: (r) => {
3323
+ t.minimize && t.minimize(r, t.context, t.params);
3269
3324
  }
3270
3325
  }), this.container));
3271
3326
  }
@@ -3294,11 +3349,589 @@ class li {
3294
3349
  * @date 2023-10-13 17:10:10
3295
3350
  */
3296
3351
  close() {
3297
- this.container && (K(null, this.container), this.container.remove(), this.container = void 0);
3352
+ this.container && (te(null, this.container), this.container.remove(), this.container = void 0);
3353
+ }
3354
+ }
3355
+ const Oi = new Ni();
3356
+ const ki = new M("chat-input-material"), Mi = (n) => {
3357
+ const e = n.controller.materials;
3358
+ return l("div", {
3359
+ className: ki.b(),
3360
+ children: e.value.map((t) => l(on, {
3361
+ material: t,
3362
+ disabled: !1,
3363
+ controller: n.controller
3364
+ }, t.id))
3365
+ });
3366
+ };
3367
+ const un = ({
3368
+ children: n,
3369
+ actions: e,
3370
+ // 接收行为数据
3371
+ content: t,
3372
+ position: i = "bottom",
3373
+ isOpen: s,
3374
+ onToggleOpen: o,
3375
+ onAction: r
3376
+ // 接收行为事件回调
3377
+ }) => {
3378
+ const a = new M("pop"), u = En(dn), [f, d] = Je(s || !1), c = K(null), _ = K(null);
3379
+ q(() => {
3380
+ s !== void 0 && d(s);
3381
+ }, [s]), q(() => (_.current || (_.current = document.createElement("div"), _.current.className = a.b("content-container"), document.body.appendChild(_.current)), () => {
3382
+ _.current && document.body.removeChild(_.current);
3383
+ }), []), q(() => {
3384
+ const h = (p) => {
3385
+ c.current && !c.current.contains(p.target) && !p.target.closest(".".concat(a.b("content"))) && !p.target.closest(".ibiz-quick-edit") && !p.target.closest(".ibiz-picker__transfer") && (d(!1), o == null || o(!1));
3386
+ };
3387
+ return f && document.addEventListener("mousedown", h), () => {
3388
+ document.removeEventListener("mousedown", h);
3389
+ };
3390
+ }, [f, o]);
3391
+ const v = () => {
3392
+ if (!c.current)
3393
+ return {};
3394
+ const h = c.current.getBoundingClientRect(), p = {
3395
+ position: "absolute",
3396
+ zIndex: u.zIndex + 1
3397
+ }, y = {
3398
+ bottom: {
3399
+ top: h.bottom + window.scrollY,
3400
+ left: h.left + window.scrollX
3401
+ },
3402
+ top: {
3403
+ bottom: window.innerHeight - h.top + window.scrollY,
3404
+ left: h.left + window.scrollX
3405
+ },
3406
+ left: {
3407
+ top: h.top + window.scrollY,
3408
+ right: window.innerWidth - h.left + window.scrollX
3409
+ },
3410
+ right: {
3411
+ top: h.top + window.scrollY,
3412
+ left: h.right + window.scrollX
3413
+ },
3414
+ "top-left": {
3415
+ bottom: window.innerHeight - h.top + window.scrollY,
3416
+ right: window.innerWidth - h.left + window.scrollX
3417
+ }
3418
+ };
3419
+ return {
3420
+ ...p,
3421
+ ...y[i]
3422
+ };
3423
+ };
3424
+ return l("span", {
3425
+ className: "".concat(a.b("trigger-container")),
3426
+ children: [l("span", {
3427
+ className: "".concat(a.b("trigger-element")),
3428
+ ref: c,
3429
+ onClick: (h) => {
3430
+ h.stopPropagation();
3431
+ const p = !f;
3432
+ d(p), o == null || o(p);
3433
+ },
3434
+ children: n
3435
+ }), f && _.current && hi(l("div", {
3436
+ className: "".concat(a.b("content"), " pop-").concat(i),
3437
+ style: v(),
3438
+ children: t || (e == null ? void 0 : e.map((h) => l("div", {
3439
+ className: a.b("content-item"),
3440
+ onMouseDown: (p) => {
3441
+ p.stopPropagation(), r == null || r(h.id, p);
3442
+ },
3443
+ children: [h.icon && l("img", {
3444
+ className: a.b("content-item__icon"),
3445
+ src: h.icon,
3446
+ alt: h.caption
3447
+ }), l("div", {
3448
+ className: a.b("content-item__caption"),
3449
+ children: h.caption
3450
+ })]
3451
+ }, h.id)))
3452
+ }), _.current)]
3453
+ });
3454
+ }, k = new M("chat-input"), kt = window.SpeechRecognition || window.webkitSpeechRecognition, Mt = (n) => {
3455
+ var p;
3456
+ const [e, t] = Je(!1), i = K(null), s = n.controller.input, o = W(!1), r = W(!1), a = K();
3457
+ kt && !a.current && (a.current = new kt(), a.current.onstart = () => {
3458
+ r.value = !0;
3459
+ }, a.current.onend = () => {
3460
+ r.value = !1;
3461
+ }, a.current.onresult = (y) => {
3462
+ var C, N, T;
3463
+ const b = (T = (N = (C = y.results) == null ? void 0 : C[0]) == null ? void 0 : N[0]) == null ? void 0 : T.transcript;
3464
+ b && (s.value = "".concat(s.value).concat(b));
3465
+ });
3466
+ const u = () => {
3467
+ a.current && !r.value && a.current.start();
3468
+ }, f = dt((y) => {
3469
+ s.value = y.target.value;
3470
+ }, [s]), d = O(() => s.value.length <= 0 || o.value === !0);
3471
+ q(() => (i.current && Et(i.current), () => {
3472
+ i.current && Et.destroy(i.current);
3473
+ }), [i]);
3474
+ const c = dt(async () => {
3475
+ o.value = !0;
3476
+ try {
3477
+ await n.controller.question(s.value), s.value = "";
3478
+ } catch (y) {
3479
+ console.error(y);
3480
+ } finally {
3481
+ o.value = !1;
3482
+ }
3483
+ }, [s, o]), _ = (y) => {
3484
+ y.code === "Enter" && (y.stopPropagation(), y.shiftKey === !1 && c());
3485
+ }, v = async (y) => {
3486
+ await Nt.getMaterialHelper("ossfile", n.controller).excuteAction(y), t(!1);
3487
+ }, h = async (y, b) => {
3488
+ await Nt.getMaterialHelper("common", n.controller).excuteAction(y, b), t(!1);
3489
+ };
3490
+ return l("div", {
3491
+ className: k.b("wrapper"),
3492
+ children: [l("div", {
3493
+ className: k.b("material-wrapper"),
3494
+ children: l(Mi, {
3495
+ controller: n.controller
3496
+ })
3497
+ }), l("div", {
3498
+ className: k.b("main-wrapper"),
3499
+ children: [l("textarea", {
3500
+ className: k.e("textarea"),
3501
+ type: "text",
3502
+ rows: 6,
3503
+ autoCorrect: "off",
3504
+ autoCapitalize: "off",
3505
+ autoComplete: "off",
3506
+ value: s,
3507
+ onInput: f,
3508
+ onKeyDown: _,
3509
+ ref: i,
3510
+ disabled: o
3511
+ }), l("div", {
3512
+ className: k.b("action-wrapper"),
3513
+ children: [l("div", {
3514
+ className: "".concat(k.be("action-wrapper", "action-item")),
3515
+ children: l(un, {
3516
+ content: l("div", {
3517
+ className: k.b("pop-actions"),
3518
+ children: [l("div", {
3519
+ className: k.b("pop-action-item"),
3520
+ onClick: (y) => {
3521
+ v(y);
3522
+ },
3523
+ children: [l("span", {
3524
+ className: k.b("pop-action-item-icon"),
3525
+ children: l(sn, {})
3526
+ }), l("span", {
3527
+ className: k.b("pop-action-item-title"),
3528
+ children: "文件资料"
3529
+ })]
3530
+ }), (p = n.questionToolbarItems) == null ? void 0 : p.map((y) => l("div", {
3531
+ className: k.b("pop-action-item"),
3532
+ onClick: (b) => {
3533
+ h(b, y);
3534
+ },
3535
+ children: [l("span", {
3536
+ className: k.b("pop-action-item-icon"),
3537
+ children: typeof y.icon == "function" ? y.icon(I) : y.icon
3538
+ }), l("span", {
3539
+ className: k.b("pop-action-item-title"),
3540
+ children: typeof y.label == "function" ? y.label(I) : y.label
3541
+ })]
3542
+ }, y.id))]
3543
+ }),
3544
+ position: "top-left",
3545
+ isOpen: e,
3546
+ onToggleOpen: t,
3547
+ children: l(Zn, {})
3548
+ })
3549
+ }), l("div", {
3550
+ title: r.value ? "语音输入中..." : "语音输入",
3551
+ className: "".concat(k.be("action-wrapper", "action-item")),
3552
+ onClick: u,
3553
+ children: r.value ? l(Wn, {}) : l(qn, {})
3554
+ }), l("div", {
3555
+ title: o.value ? "思考中..." : "发送消息",
3556
+ className: "".concat(k.be("action-wrapper", "action-item"), " ").concat(k.is("disabled", d.value), " ").concat(k.is("loading", o.value)),
3557
+ onClick: c,
3558
+ disabled: d,
3559
+ children: l(Ln, {})
3560
+ })]
3561
+ })]
3562
+ })]
3563
+ });
3564
+ };
3565
+ const U = new M("chat-topic-item"), Ai = (n) => {
3566
+ const {
3567
+ current: e,
3568
+ active: t,
3569
+ topic: i,
3570
+ onClick: s,
3571
+ onAction: o
3572
+ } = n, [r, a] = Je(!1), u = (d) => {
3573
+ d.stopPropagation(), o("LINK", d);
3574
+ }, f = (d, c) => {
3575
+ d === "DELETE" && o("DELETE", c), a(!1);
3576
+ };
3577
+ return l("div", {
3578
+ className: "".concat(U.b(), " ").concat(U.is("active", t)),
3579
+ onClick: s.bind(void 0),
3580
+ children: [l("div", {
3581
+ className: U.b("caption"),
3582
+ title: i.caption,
3583
+ children: i.caption
3584
+ }), l("div", {
3585
+ className: U.b("icon"),
3586
+ children: [l("span", {
3587
+ className: U.be("icon", "item"),
3588
+ title: "跳转主视图",
3589
+ onClick: u.bind(void 0),
3590
+ children: l(Yn, {
3591
+ className: U.b("link-icon")
3592
+ })
3593
+ }), e ? null : l(un, {
3594
+ actions: [{
3595
+ id: "DELETE",
3596
+ caption: "删除话题"
3597
+ }],
3598
+ position: "bottom",
3599
+ isOpen: r,
3600
+ onToggleOpen: a,
3601
+ onAction: f.bind(void 0),
3602
+ children: l("span", {
3603
+ className: U.be("icon", "item"),
3604
+ title: "更多",
3605
+ children: l(jn, {
3606
+ className: U.b("more-icon")
3607
+ })
3608
+ })
3609
+ })]
3610
+ })]
3611
+ });
3612
+ };
3613
+ const Ii = new M("chat-topics"), Di = (n) => {
3614
+ const e = n.controller.topics, t = (s) => {
3615
+ n.controller.handleTopicChange(s);
3616
+ }, i = (s, o, r) => {
3617
+ n.controller.handleTopicAction(s, o, r);
3618
+ };
3619
+ return l("div", {
3620
+ className: Ii.b(),
3621
+ children: e.value.map((s) => {
3622
+ var o, r;
3623
+ return l(Ai, {
3624
+ topic: s,
3625
+ current: s.id === ((o = n.controller.currentTopicOptions) == null ? void 0 : o.id),
3626
+ active: s.id === ((r = n.controller.activedTopic.value) == null ? void 0 : r.id),
3627
+ onClick: () => t(s),
3628
+ onAction: (a, u) => i(a, s, u)
3629
+ }, s.id);
3630
+ })
3631
+ });
3632
+ };
3633
+ const dn = bn({
3634
+ zIndex: 10
3635
+ });
3636
+ var It;
3637
+ class At extends H {
3638
+ constructor(t) {
3639
+ super(t);
3640
+ w(this, "ns", new M("chat-container"));
3641
+ w(this, "containerRef", He());
3642
+ w(this, "dragHandle", He());
3643
+ w(this, "minimizeRef", He());
3644
+ w(this, "data", {
3645
+ x: window.innerWidth - 600,
3646
+ y: 0,
3647
+ width: 600,
3648
+ height: window.innerHeight,
3649
+ minWidth: 300,
3650
+ minHeight: 300
3651
+ });
3652
+ w(this, "minimizeData", {
3653
+ x: window.innerWidth - 86,
3654
+ y: window.innerHeight - 86
3655
+ });
3656
+ /**
3657
+ * 是否禁止拖动
3658
+ * - 拖拽边时应禁止拖动
3659
+ * @type {boolean}
3660
+ * @memberof ChatContainer
3661
+ */
3662
+ w(this, "disabled", !1);
3663
+ /**
3664
+ * 最小化是否在拖拽中
3665
+ * - 在拖拽时不应触发点击事件
3666
+ * @type {boolean}
3667
+ * @memberof ChatContainer
3668
+ */
3669
+ w(this, "isDragging", !1);
3670
+ /**
3671
+ * 容器上下文
3672
+ *
3673
+ * @author tony001
3674
+ * @date 2025-03-03 16:03:44
3675
+ * @type {ContainerContext}
3676
+ */
3677
+ w(this, "containerContext", {
3678
+ zIndex: ((It = this.props.containerOptions) == null ? void 0 : It.zIndex) || 10
3679
+ });
3680
+ this.state = {
3681
+ isFullScreen: !1,
3682
+ isMinimize: !1
3683
+ };
3684
+ }
3685
+ calcWindowStyle() {
3686
+ var t, i;
3687
+ return {
3688
+ left: "".concat(this.data.x, "px"),
3689
+ top: "".concat(this.data.y, "px"),
3690
+ height: "".concat(this.data.height, "px"),
3691
+ width: "".concat(this.data.width, "px"),
3692
+ "z-index": ((i = (t = this.props.containerOptions) == null ? void 0 : t.zIndex) == null ? void 0 : i.toString()) || "10"
3693
+ };
3694
+ }
3695
+ calcMinimizeStyle() {
3696
+ return {
3697
+ left: "".concat(this.minimizeData.x, "px"),
3698
+ top: "".concat(this.minimizeData.y, "px"),
3699
+ "z-index": "99999"
3700
+ };
3701
+ }
3702
+ setStyle() {
3703
+ Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
3704
+ }
3705
+ componentDidMount() {
3706
+ const t = localStorage.getItem($.MINIMIZE_STYLY_CHCHE);
3707
+ t && (this.minimizeData = JSON.parse(t));
3708
+ const i = localStorage.getItem($.STYLE_CACHE);
3709
+ i && (this.data = JSON.parse(i), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
3710
+ const s = this.data;
3711
+ this.minimizeRef.current.onmousedown = (o) => {
3712
+ document.body.style.userSelect = "none";
3713
+ const r = o.clientX - this.minimizeRef.current.offsetLeft, a = o.clientY - this.minimizeRef.current.offsetTop, u = Date.now(), f = (c) => {
3714
+ this.minimizeData.x = c.clientX - r, this.minimizeData.y = c.clientY - a, this.setStyle();
3715
+ }, d = () => {
3716
+ const c = Date.now();
3717
+ this.isDragging = c - u > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", d);
3718
+ };
3719
+ document.addEventListener("mousemove", f), document.addEventListener("mouseup", d);
3720
+ }, this.dragHandle.current.onmousedown = (o) => {
3721
+ if (this.disabled || this.state.isFullScreen)
3722
+ return;
3723
+ document.body.style.userSelect = "none";
3724
+ const r = o.clientX - this.containerRef.current.offsetLeft, a = o.clientY - this.containerRef.current.offsetTop, u = (d) => {
3725
+ s.x = d.clientX - r, s.y = d.clientY - a, this.setStyle();
3726
+ }, f = () => {
3727
+ document.body.style.userSelect = "", document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f);
3728
+ };
3729
+ document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
3730
+ }, ze(this.containerRef.current).resizable({
3731
+ // 可拖拽的边缘
3732
+ edges: {
3733
+ top: !0,
3734
+ right: !0,
3735
+ bottom: !0,
3736
+ left: !0
3737
+ },
3738
+ margin: 6,
3739
+ modifiers: [
3740
+ // 保持在父对象内部
3741
+ ze.modifiers.restrictEdges({
3742
+ outer: document.body
3743
+ }),
3744
+ // 缩放最小宽度
3745
+ ze.modifiers.restrictSize({
3746
+ min: {
3747
+ width: s.minWidth,
3748
+ height: s.minHeight
3749
+ }
3750
+ })
3751
+ ],
3752
+ inertia: !0,
3753
+ listeners: {
3754
+ move: (o) => {
3755
+ this.state.isFullScreen || (s.x = o.rect.left, s.y = o.rect.top, s.width = o.rect.width, s.height = o.rect.height, this.setStyle());
3756
+ },
3757
+ start: () => {
3758
+ this.disabled = !0, document.body.style.userSelect = "none";
3759
+ },
3760
+ end: () => {
3761
+ this.disabled = !1, document.body.style.userSelect = "";
3762
+ }
3763
+ }
3764
+ });
3765
+ }
3766
+ componentWillUnmount() {
3767
+ localStorage.setItem($.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem($.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
3768
+ }
3769
+ /**
3770
+ * 关闭聊天窗口
3771
+ *
3772
+ * @author chitanda
3773
+ * @date 2023-10-15 19:10:31
3774
+ */
3775
+ close() {
3776
+ this.props.close();
3777
+ }
3778
+ /**
3779
+ * 全屏
3780
+ *
3781
+ * @author ljx
3782
+ * @date 2024-05-07 15:10:31
3783
+ */
3784
+ fullScreen() {
3785
+ const t = this.containerRef.current;
3786
+ t && (t.requestFullscreen(), this.setState({
3787
+ isFullScreen: !0
3788
+ }), this.props.fullscreen(!0));
3789
+ }
3790
+ /**
3791
+ * 关闭全屏
3792
+ *
3793
+ * @author ljx
3794
+ * @date 2024-05-07 15:10:31
3795
+ */
3796
+ closeFullScreen() {
3797
+ this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
3798
+ isFullScreen: !1
3799
+ }), this.props.fullscreen(!1), this.setStyle());
3800
+ }
3801
+ /**
3802
+ * 最小化
3803
+ *
3804
+ * @memberof ChatContainer
3805
+ */
3806
+ minimize() {
3807
+ this.closeFullScreen(), this.setState({
3808
+ isMinimize: !0
3809
+ }), this.props.minimize(!0);
3810
+ }
3811
+ /**
3812
+ * 退出最小化
3813
+ *
3814
+ * @memberof ChatContainer
3815
+ */
3816
+ exitMinimize() {
3817
+ this.isDragging || (this.setState({
3818
+ isMinimize: !1
3819
+ }), this.props.minimize(!1));
3820
+ }
3821
+ /**
3822
+ * 阻止冒泡
3823
+ * - 防止点击头部行为时误触发拖动监听
3824
+ * @param {MouseEvent} evt
3825
+ * @memberof ChatContainer
3826
+ */
3827
+ stopPropagation(t) {
3828
+ t.stopPropagation();
3829
+ }
3830
+ render() {
3831
+ return l(dn.Provider, {
3832
+ value: this.containerContext,
3833
+ children: l("div", {
3834
+ className: "".concat(this.ns.b()),
3835
+ children: [l("div", {
3836
+ className: "".concat(this.ns.e("dialog"), " ").concat(this.ns.is("full-screen", this.state.isFullScreen), " ").concat(this.ns.is("hidden", this.state.isMinimize)),
3837
+ ref: this.containerRef,
3838
+ children: [l("div", {
3839
+ ref: this.dragHandle,
3840
+ className: this.ns.b("header"),
3841
+ children: [l("div", {
3842
+ className: this.ns.b("header-caption"),
3843
+ children: this.props.caption || "AI助手"
3844
+ }), l("div", {
3845
+ className: this.ns.b("header-action-wrapper"),
3846
+ children: [l("div", {
3847
+ title: "最小化",
3848
+ className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
3849
+ onMouseDown: this.stopPropagation.bind(this),
3850
+ onClick: this.minimize.bind(this),
3851
+ children: l(Un, {})
3852
+ }), this.state.isFullScreen ? l("div", {
3853
+ title: "退出全屏",
3854
+ className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
3855
+ onMouseDown: this.stopPropagation.bind(this),
3856
+ onClick: this.closeFullScreen.bind(this),
3857
+ children: l(Bn, {})
3858
+ }) : l("div", {
3859
+ title: "全屏",
3860
+ className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
3861
+ onMouseDown: this.stopPropagation.bind(this),
3862
+ onClick: this.fullScreen.bind(this),
3863
+ children: l(Pn, {})
3864
+ }), l("div", {
3865
+ title: "关闭",
3866
+ className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
3867
+ onMouseDown: this.stopPropagation.bind(this),
3868
+ onClick: this.close.bind(this),
3869
+ children: l(zn, {})
3870
+ })]
3871
+ })]
3872
+ }), this.props.mode === "TOPIC" ? l("div", {
3873
+ className: "".concat(this.ns.b("main")),
3874
+ children: [l("div", {
3875
+ className: "".concat(this.ns.be("main", "left")),
3876
+ children: l(Di, {
3877
+ controller: this.props.aiTopic
3878
+ })
3879
+ }), l("div", {
3880
+ className: "".concat(this.ns.be("main", "right")),
3881
+ children: [l("div", {
3882
+ className: this.ns.b("content"),
3883
+ children: l(vt, {
3884
+ controller: this.props.aiChat,
3885
+ toolbarItems: this.props.contentToolbarItems
3886
+ })
3887
+ }), l(Xe, {
3888
+ data: this.props.aiTopic.activedTopic.value,
3889
+ type: "footer",
3890
+ className: this.ns.e("toolbar"),
3891
+ controller: this.props.aiChat,
3892
+ items: this.props.footerToolbarItems
3893
+ }), l("div", {
3894
+ className: this.ns.b("footer"),
3895
+ children: l(Mt, {
3896
+ controller: this.props.aiChat,
3897
+ questionToolbarItems: this.props.questionToolbarItems
3898
+ })
3899
+ })]
3900
+ })]
3901
+ }) : l("div", {
3902
+ className: "".concat(this.ns.be("main", "default")),
3903
+ children: [l("div", {
3904
+ className: this.ns.b("content"),
3905
+ children: l(vt, {
3906
+ controller: this.props.aiChat,
3907
+ toolbarItems: this.props.contentToolbarItems
3908
+ })
3909
+ }), l(Xe, {
3910
+ data: this.props.aiTopic.activedTopic.value,
3911
+ type: "footer",
3912
+ className: this.ns.e("toolbar"),
3913
+ controller: this.props.aiChat,
3914
+ items: this.props.footerToolbarItems
3915
+ }), l("div", {
3916
+ className: this.ns.b("footer"),
3917
+ children: l(Mt, {
3918
+ controller: this.props.aiChat,
3919
+ questionToolbarItems: this.props.questionToolbarItems
3920
+ })
3921
+ })]
3922
+ })]
3923
+ }), l("div", {
3924
+ title: "AI助手",
3925
+ ref: this.minimizeRef,
3926
+ className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
3927
+ onClick: this.exitMinimize.bind(this),
3928
+ children: l(Fn, {})
3929
+ })]
3930
+ })
3931
+ });
3298
3932
  }
3299
3933
  }
3300
- const fi = new li();
3301
3934
  export {
3302
- Et as ChatContainer,
3303
- fi as chat
3935
+ At as ChatContainer,
3936
+ Oi as chat
3304
3937
  };