@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.4

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 (150) hide show
  1. package/dist/es/AgentClientUI.mjs +97 -110
  2. package/dist/es/Dialog/AgentChat/index.mjs +516 -467
  3. package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
  4. package/dist/es/Dialog/FileCard/index.mjs +48 -55
  5. package/dist/es/Dialog/FilePreview/index.mjs +35 -42
  6. package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
  7. package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
  8. package/dist/es/Dialog/PromptManager/index.mjs +29 -36
  9. package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
  10. package/dist/es/Dialog/SessionAction/index.mjs +92 -91
  11. package/dist/es/Dialog/SessionList/index.mjs +135 -121
  12. package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
  13. package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
  14. package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
  15. package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
  16. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
  17. package/dist/es/Dialog/index.mjs +125 -93
  18. package/dist/es/QuillEditor/index.mjs +91 -86
  19. package/dist/es/_virtual/index.mjs +2 -2
  20. package/dist/es/components/Markdown/Image/index.mjs +20 -20
  21. package/dist/es/components/Markdown/index.mjs +27 -22
  22. package/dist/es/constant.mjs +8 -5
  23. package/dist/es/index.mjs +178 -152
  24. package/dist/es/node_modules/classnames/index.mjs +1 -1
  25. package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
  26. package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
  27. package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
  28. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
  29. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
  30. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
  31. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
  32. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
  33. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
  34. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
  35. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
  36. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
  37. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
  38. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
  39. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
  40. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
  41. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
  42. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
  43. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
  44. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
  45. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
  46. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
  47. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
  48. package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
  49. package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
  50. package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
  51. package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
  52. package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
  53. package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
  54. package/dist/es/node_modules/longest-streak/index.mjs +12 -0
  55. package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
  56. package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
  57. package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
  58. package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
  59. package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
  60. package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
  61. package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
  62. package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
  63. package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
  64. package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
  65. package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
  66. package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
  67. package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
  68. package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
  69. package/dist/es/utils/index.mjs +44 -27
  70. package/dist/lib/index.js +278 -138
  71. package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
  72. package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
  73. package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
  74. package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
  75. package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
  76. package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
  77. package/dist/src/Dialog/SessionList/index.d.ts +5 -4
  78. package/dist/src/QuillEditor/index.d.ts +1 -0
  79. package/dist/src/components/Markdown/Text/index.d.ts +8 -0
  80. package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
  81. package/dist/src/components/MathJaxRender/index.d.ts +6 -0
  82. package/dist/src/constant.d.ts +1 -1
  83. package/dist/src/contexts/MathJaxContext.d.ts +12 -0
  84. package/dist/src/index.d.ts +4 -1
  85. package/dist/src/types.d.ts +26 -6
  86. package/dist/src/utils/index.d.ts +15 -0
  87. package/package.json +18 -17
  88. package/dist/es/_virtual/index2.mjs +0 -4
  89. package/dist/es/_virtual/index3.mjs +0 -4
  90. package/dist/es/_virtual/index4.mjs +0 -4
  91. package/dist/es/_virtual/minio-zj.mjs +0 -4
  92. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
  93. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
  94. package/dist/es/node_modules/base64-js/index.mjs +0 -47
  95. package/dist/es/node_modules/buffer/index.mjs +0 -927
  96. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
  97. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
  98. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
  99. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
  100. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
  101. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
  102. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
  103. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
  104. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
  105. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
  106. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
  107. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
  108. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
  109. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
  110. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
  111. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
  112. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
  113. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
  114. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
  115. package/dist/es/node_modules/ieee754/index.mjs +0 -28
  116. package/dist/es/node_modules/js-base64/base64.mjs +0 -31
  117. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
  118. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
  119. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
  120. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
  121. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
  122. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
  123. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
  124. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
  125. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
  126. package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
  127. package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
  128. package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
  129. package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
  130. package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
  131. package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
  132. package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
  133. package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
  134. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
  135. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
  136. package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
  137. package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
  138. package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
  139. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
  140. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
  141. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
  142. package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
  143. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
  144. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
  145. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
  146. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
  147. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
  148. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
  149. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
  150. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
@@ -1,101 +1,88 @@
1
- var B = Object.defineProperty;
2
- var C = Object.getOwnPropertySymbols;
3
- var w = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
4
- var F = (i, a, e) => a in i ? B(i, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[a] = e, x = (i, a) => {
5
- for (var e in a || (a = {}))
6
- w.call(a, e) && F(i, e, a[e]);
7
- if (C)
8
- for (var e of C(a))
9
- E.call(a, e) && F(i, e, a[e]);
10
- return i;
1
+ var I = Object.defineProperty;
2
+ var h = Object.getOwnPropertySymbols;
3
+ var P = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
4
+ var y = (n, t, e) => t in n ? I(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, v = (n, t) => {
5
+ for (var e in t || (t = {}))
6
+ P.call(t, e) && y(n, e, t[e]);
7
+ if (h)
8
+ for (var e of h(t))
9
+ q.call(t, e) && y(n, e, t[e]);
10
+ return n;
11
11
  };
12
- import { jsx as r, jsxs as f } from "../../_virtual/jsx-runtime.mjs";
13
- import { forwardRef as L, useState as j, useContext as A, useImperativeHandle as z, useEffect as h } from "react";
12
+ import { jsx as r, jsxs as d } from "../../_virtual/jsx-runtime.mjs";
13
+ import { forwardRef as B, useState as S, useContext as b, useImperativeHandle as w, useEffect as g } from "react";
14
14
  import "./style.less.mjs";
15
- import { Form as v, Space as I, Button as D, Popover as H, Input as R } from "antd";
16
- import W from "../../context.mjs";
17
- import k from "../../Iconfont/index.mjs";
18
- const G = L((i, a) => {
19
- var N;
15
+ import { Form as p, Space as k, Button as E, Popover as L, Input as j } from "antd";
16
+ import A from "../../context.mjs";
17
+ import u from "../../Iconfont/index.mjs";
18
+ const z = B((n, t) => {
20
19
  const {
21
20
  promptVariables: e,
22
- setPromptVariables: p,
23
- currentSession: t
24
- } = i, [u] = v.useForm(), [y, q] = j(!0), {
25
- agentClient: d,
26
- depId: g
27
- } = A(W);
28
- z(a, () => ({
21
+ setPromptVariables: f,
22
+ currentSession: l,
23
+ setCurrentSession: D
24
+ } = n, [c] = p.useForm(), [m, C] = S(!0);
25
+ b(A), w(t, () => ({
29
26
  clear() {
30
- u.resetFields();
27
+ c.resetFields();
31
28
  }
32
- })), h(() => {
33
- var m;
34
- const n = ((d == null ? void 0 : d.promptVariables) || []).filter((l) => l.key !== "query" && l.status === 1).map((l, c) => ({
35
- id: c + "",
36
- key: l.key,
37
- name: l.name,
38
- value: ""
39
- }));
40
- p([...n].sort((l, c) => l.key.localeCompare(c.key))), g && (d == null || d.reloadSession((m = t == null ? void 0 : t.data) == null ? void 0 : m.id));
41
- }, [g]), h(() => {
42
- var s;
43
- if (!((s = t == null ? void 0 : t.data) != null && s.id))
29
+ })), g(() => {
30
+ if (!l)
44
31
  return;
45
32
  const o = () => {
46
- const m = t.promptVariables.filter((l) => l.key !== "query");
47
- p(m.sort((l, c) => l.key.localeCompare(c.key)));
33
+ const a = l.promptVariables.filter((i) => i.key !== "query");
34
+ f(a.sort((i, x) => i.key.localeCompare(x.key)));
48
35
  };
49
- return t == null || t.addEventListener("activated", o), () => {
50
- t == null || t.removeEventListener("activated", o);
36
+ return l.addEventListener("activated", o), () => {
37
+ l == null || l.removeEventListener("activated", o);
51
38
  };
52
- }, [(N = t == null ? void 0 : t.data) == null ? void 0 : N.id]), h(() => {
39
+ }, [l]), g(() => {
53
40
  if (!e)
54
41
  return;
55
- const o = e == null ? void 0 : e.reduce((s, n) => (s[n.key] = n.value, s), {});
56
- u.setFieldsValue(x({}, o));
42
+ const o = e == null ? void 0 : e.reduce((s, a) => (s[a.key] = a.value, s), {});
43
+ c.setFieldsValue(v({}, o));
57
44
  }, [e]);
58
- const P = (o, s) => {
59
- e.map((n) => {
60
- n.id === o && (n.value = s.target.value);
61
- }), p([...e].sort((n, m) => n.key.localeCompare(m.key)));
62
- }, b = () => {
63
- q(!y);
45
+ const N = (o, s) => {
46
+ e.map((a) => {
47
+ a.id === o && (a.value = s.target.value);
48
+ }), f([...e].sort((a, i) => a.key.localeCompare(i.key)));
49
+ }, F = () => {
50
+ C(!m);
64
51
  };
65
52
  return e != null && e.length ? /* @__PURE__ */ r("div", {
66
53
  className: "prompt-setting-panel",
67
- children: /* @__PURE__ */ f("div", {
54
+ children: /* @__PURE__ */ d("div", {
68
55
  className: "agent-prompt",
69
56
  children: [/* @__PURE__ */ r("div", {
70
57
  className: "prompt-header",
71
- children: /* @__PURE__ */ f(I, {
72
- children: [/* @__PURE__ */ r(D, {
58
+ children: /* @__PURE__ */ d(k, {
59
+ children: [/* @__PURE__ */ r(E, {
73
60
  className: "prompt-action",
74
- icon: y ? /* @__PURE__ */ r(k, {
61
+ icon: m ? /* @__PURE__ */ r(u, {
75
62
  type: "icon-biaoge-shouqi"
76
- }) : /* @__PURE__ */ r(k, {
63
+ }) : /* @__PURE__ */ r(u, {
77
64
  type: "icon-biaoge-zhankai"
78
65
  }),
79
66
  type: "link",
80
- onClick: b
81
- }), /* @__PURE__ */ f(I, {
67
+ onClick: F
68
+ }), /* @__PURE__ */ d(k, {
82
69
  className: "prompt-title",
83
70
  children: [/* @__PURE__ */ r("span", {
84
71
  children: "变量输入"
85
- }), /* @__PURE__ */ r(H, {
72
+ }), /* @__PURE__ */ r(L, {
86
73
  placement: "top",
87
74
  overlayClassName: "title-popover",
88
75
  content: "填入变量的值,每次启动新会话时该变量将自动替换提示词中的变量",
89
- children: /* @__PURE__ */ r(k, {
76
+ children: /* @__PURE__ */ r(u, {
90
77
  className: "icon-prompt-question",
91
78
  type: "icon-wenti"
92
79
  })
93
80
  })]
94
81
  })]
95
82
  })
96
- }), y && /* @__PURE__ */ r(v, {
83
+ }), m && /* @__PURE__ */ r(p, {
97
84
  autoComplete: "off",
98
- form: u,
85
+ form: c,
99
86
  labelWrap: !0,
100
87
  labelAlign: "left",
101
88
  labelCol: {
@@ -104,7 +91,7 @@ const G = L((i, a) => {
104
91
  }
105
92
  },
106
93
  className: "prompt-form",
107
- children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ r(v.Item, {
94
+ children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ r(p.Item, {
108
95
  label: o.name,
109
96
  name: o.key,
110
97
  style: {
@@ -114,17 +101,17 @@ const G = L((i, a) => {
114
101
  required: !0,
115
102
  message: "请输入"
116
103
  }],
117
- children: /* @__PURE__ */ r(R, {
104
+ children: /* @__PURE__ */ r(j, {
118
105
  placeholder: "请输入",
119
106
  maxLength: 1e3,
120
- onBlur: (s) => P(o.id, s)
107
+ onBlur: (s) => N(o.id, s)
121
108
  })
122
109
  }, o.key))
123
110
  })]
124
111
  })
125
112
  }) : null;
126
113
  });
127
- G.displayName = "PromptSetting";
114
+ z.displayName = "PromptSetting";
128
115
  export {
129
- G as default
116
+ z as default
130
117
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as l, jsx as n } from "../../_virtual/jsx-runtime.mjs";
2
- import { useState as d, useContext as D, useEffect as L } from "react";
3
- import { Space as z, Popover as H, Popconfirm as Q, Input as $, message as S, notification as g, Button as F } from "antd";
4
- import r from "../../Iconfont/index.mjs";
5
- import G from "../../node_modules/copy-to-clipboard/index.mjs";
6
- import J from "../../node_modules/classnames/index.mjs";
1
+ import { jsxs as r, jsx as n } from "../../_virtual/jsx-runtime.mjs";
2
+ import { useState as l, useContext as O, useEffect as D } from "react";
3
+ import { Space as z, Popover as L, Popconfirm as M, Input as H, message as w, notification as u, Button as Q } from "antd";
4
+ import m from "../../Iconfont/index.mjs";
5
+ import $ from "../../node_modules/copy-to-clipboard/index.mjs";
6
+ import F from "../../node_modules/classnames/index.mjs";
7
7
  import "./style.less.mjs";
8
- import K from "../../context.mjs";
9
- const M = [{
8
+ import G from "../../context.mjs";
9
+ const J = [{
10
10
  id: 1,
11
11
  name: "展示信息不正确"
12
12
  }, {
@@ -18,97 +18,98 @@ const M = [{
18
18
  }, {
19
19
  id: 4,
20
20
  name: "其他原因"
21
- }], ne = (w) => {
22
- var b;
21
+ }], te = (P) => {
22
+ var A;
23
23
  const {
24
- appId: p,
24
+ appId: v,
25
25
  history: t,
26
- isLastHistory: P = !1,
27
- sessionId: i,
28
- onAgainClick: h
29
- } = w, [s, C] = d([]), [N, I] = d(), [T, v] = d(!1), [_, A] = d(!1), {
30
- service: o,
31
- popupContainer: m,
32
- transform: k,
33
- features: y,
34
- onComment: f
35
- } = D(K), [u, x] = d(() => {
26
+ isLastHistory: T = !1,
27
+ sessionId: d,
28
+ currentSession: i,
29
+ onAgainClick: g
30
+ } = P, [a, h] = l([]), [C, x] = l(), [_, I] = l(!1), [y, b] = l(!1), {
31
+ service: K,
32
+ popupContainer: o,
33
+ transform: N,
34
+ features: U,
35
+ onComment: p
36
+ } = O(G), [f, k] = l(() => {
36
37
  var e;
37
38
  return (e = t == null ? void 0 : t.comment) == null ? void 0 : e.isAgree;
38
39
  });
39
- L(() => {
40
+ D(() => {
40
41
  var e;
41
- x((e = t == null ? void 0 : t.comment) == null ? void 0 : e.isAgree);
42
- }, [(b = t == null ? void 0 : t.comment) == null ? void 0 : b.isAgree]);
42
+ k((e = t == null ? void 0 : t.comment) == null ? void 0 : e.isAgree);
43
+ }, [(A = t == null ? void 0 : t.comment) == null ? void 0 : A.isAgree]);
43
44
  const R = () => {
44
- S.config({
45
- getContainer: () => (m == null ? void 0 : m.current) || document.body
46
- }), G(t.content), S.success("复制成功");
47
- }, j = (e) => {
48
- if (!i || !(t != null && t.messageId))
45
+ w.config({
46
+ getContainer: () => (o == null ? void 0 : o.current) || document.body
47
+ }), $(t.content), w.success("复制成功");
48
+ }, S = (e) => {
49
+ if (!d || !(t != null && t.messageId))
49
50
  return;
50
- const a = {
51
+ const s = {
51
52
  messageId: t.messageId,
52
53
  isAgree: e
53
54
  };
54
- o == null || o.postComments(p, i, a).then(() => {
55
- x(e), t != null && t.comment && (t.comment.isAgree = e), !(e <= 0) && (A(!0), setTimeout(() => {
56
- A(!1);
55
+ i == null || i.postMessageComment(s).then(() => {
56
+ k(e), t != null && t.comment && (t.comment.isAgree = e), !(e <= 0) && (b(!0), setTimeout(() => {
57
+ b(!1);
57
58
  }, 2e3));
58
- }), f && f({
59
- applicationId: p,
60
- sessionId: i,
61
- comment: a
59
+ }), p && p({
60
+ applicationId: v,
61
+ sessionId: d,
62
+ comment: s
62
63
  });
63
- }, B = (e) => {
64
- if (s.some((a) => a.id === e.id)) {
65
- const a = s.filter((c) => c.id !== e.id);
66
- C([...a]);
64
+ }, j = (e) => {
65
+ if (a.some((s) => s.id === e.id)) {
66
+ const s = a.filter((c) => c.id !== e.id);
67
+ h([...s]);
67
68
  } else
68
- C([...s, e]);
69
- }, E = (e) => {
70
- I(e.target.value);
71
- }, O = () => {
72
- if (!i)
69
+ h([...a, e]);
70
+ }, B = (e) => {
71
+ x(e.target.value);
72
+ }, E = () => {
73
+ if (!d)
73
74
  return;
74
- if (!(s != null && s.length))
75
- return v(!0), Promise.reject();
75
+ if (!(a != null && a.length))
76
+ return I(!0), Promise.reject();
76
77
  let e = [];
77
- s != null && s.length && (e = [...e, ...s.map((c) => c.name)]), N && (e = [...e, N]);
78
- const a = {
78
+ a != null && a.length && (e = [...e, ...a.map((c) => c.name)]), C && (e = [...e, C]);
79
+ const s = {
79
80
  messageId: t.messageId,
80
81
  isAgree: -1,
81
82
  againstReason: e
82
83
  };
83
- g.config({
84
- getContainer: () => (m == null ? void 0 : m.current) || document.body
85
- }), o == null || o.postComments(p, i, a).then(() => {
86
- x(-1), t != null && t.comment && (t.comment.isAgree = -1);
84
+ u.config({
85
+ getContainer: () => (o == null ? void 0 : o.current) || document.body
86
+ }), i == null || i.postMessageComment(s).then(() => {
87
+ k(-1), t != null && t.comment && (t.comment.isAgree = -1);
87
88
  const c = `open${Date.now()}`;
88
- g.success({
89
+ u.success({
89
90
  message: "提交反馈成功",
90
91
  description: "感谢您的参与,我们会认真评估每一条建议!",
91
92
  duration: 2,
92
- btn: /* @__PURE__ */ n(F, {
93
+ btn: /* @__PURE__ */ n(Q, {
93
94
  type: "primary",
94
- onClick: () => g.close(c),
95
+ onClick: () => u.close(c),
95
96
  children: "我知道了"
96
97
  }),
97
98
  key: c,
98
- onClose: () => g.close(c)
99
+ onClose: () => u.close(c)
99
100
  });
100
- }), f && f({
101
- applicationId: p,
102
- sessionId: i,
103
- comment: a
101
+ }), p && p({
102
+ applicationId: v,
103
+ sessionId: d,
104
+ comment: s
104
105
  });
105
106
  };
106
- return console.log("features in SessionAction", y), /* @__PURE__ */ l("div", {
107
+ return /* @__PURE__ */ r("div", {
107
108
  className: "session-action",
108
- children: [k != null && k.again && P ? /* @__PURE__ */ l(z, {
109
+ children: [N != null && N.again && T ? /* @__PURE__ */ r(z, {
109
110
  className: "session-action-again",
110
- onClick: () => h == null ? void 0 : h(),
111
- children: [/* @__PURE__ */ n(r, {
111
+ onClick: () => g == null ? void 0 : g(),
112
+ children: [/* @__PURE__ */ n(m, {
112
113
  type: "icon-zaicihuida"
113
114
  }), /* @__PURE__ */ n("span", {
114
115
  style: {
@@ -118,23 +119,23 @@ const M = [{
118
119
  })]
119
120
  }) : /* @__PURE__ */ n("span", {}), /* @__PURE__ */ n("div", {
120
121
  className: "session-action-comment",
121
- children: /* @__PURE__ */ l(z, {
122
+ children: /* @__PURE__ */ r(z, {
122
123
  size: 8,
123
124
  className: "action-comment-feedback",
124
125
  children: [!t.isSuspend && /* @__PURE__ */ n("span", {
125
126
  className: "comment-feedback-item comment-feedback-copy",
126
127
  onClick: R,
127
- children: /* @__PURE__ */ n(r, {
128
+ children: /* @__PURE__ */ n(m, {
128
129
  type: "icon-fuzhi"
129
130
  })
130
- }), u === 0 && !t.isSuspend && /* @__PURE__ */ n("span", {
131
+ }), f === 0 && !t.isSuspend && /* @__PURE__ */ n("span", {
131
132
  className: "comment-feedback-item",
132
- children: /* @__PURE__ */ n(r, {
133
+ children: /* @__PURE__ */ n(m, {
133
134
  type: "icon-zan",
134
- onClick: () => j(1)
135
+ onClick: () => S(1)
135
136
  })
136
- }), u === 1 && /* @__PURE__ */ n(H, {
137
- open: _,
137
+ }), f === 1 && /* @__PURE__ */ n(L, {
138
+ open: y,
138
139
  getPopupContainer: (e) => e.parentNode,
139
140
  content: /* @__PURE__ */ n("div", {
140
141
  className: "zan-text",
@@ -143,23 +144,23 @@ const M = [{
143
144
  trigger: "click",
144
145
  children: /* @__PURE__ */ n("span", {
145
146
  className: "comment-feedback-item comment-feedback-item__active",
146
- children: /* @__PURE__ */ n(r, {
147
+ children: /* @__PURE__ */ n(m, {
147
148
  type: "icon-zan"
148
149
  })
149
150
  })
150
- }), u === 0 && !t.isSuspend && /* @__PURE__ */ n(Q, {
151
+ }), f === 0 && !t.isSuspend && /* @__PURE__ */ n(M, {
151
152
  showArrow: !1,
152
153
  arrowPointAtCenter: !0,
153
154
  okText: "确定",
154
155
  cancelText: "取消",
155
156
  getPopupContainer: (e) => e.parentNode,
156
157
  onOpenChange: (e) => {
157
- e && (C([]), I(""), v(!1));
158
+ e && (h([]), x(""), I(!1));
158
159
  },
159
160
  icon: !1,
160
- title: /* @__PURE__ */ l("div", {
161
+ title: /* @__PURE__ */ r("div", {
161
162
  className: "cai-pannel",
162
- children: [/* @__PURE__ */ l("div", {
163
+ children: [/* @__PURE__ */ r("div", {
163
164
  className: "cai-title",
164
165
  children: [/* @__PURE__ */ n("span", {
165
166
  className: "cai-require",
@@ -170,15 +171,15 @@ const M = [{
170
171
  })]
171
172
  }), /* @__PURE__ */ n("div", {
172
173
  className: "cai-list",
173
- children: M.map((e) => /* @__PURE__ */ n("span", {
174
- className: J({
174
+ children: J.map((e) => /* @__PURE__ */ n("span", {
175
+ className: F({
175
176
  "cai-item": !0,
176
- "cai-item__active": s.some((a) => a.id === e.id)
177
+ "cai-item__active": a.some((s) => s.id === e.id)
177
178
  }),
178
- onClick: () => B(e),
179
+ onClick: () => j(e),
179
180
  children: e.name
180
181
  }, e.id))
181
- }), T && /* @__PURE__ */ n("div", {
182
+ }), _ && /* @__PURE__ */ n("div", {
182
183
  className: "cai-error",
183
184
  children: /* @__PURE__ */ n("span", {
184
185
  className: "cai-error-text",
@@ -190,9 +191,9 @@ const M = [{
190
191
  className: "cai-question",
191
192
  children: "您还有哪些建议?"
192
193
  })
193
- }), /* @__PURE__ */ n($.TextArea, {
194
- onChange: E,
195
- value: N,
194
+ }), /* @__PURE__ */ n(H.TextArea, {
195
+ onChange: B,
196
+ value: C,
196
197
  autoSize: {
197
198
  minRows: 3,
198
199
  maxRows: 6
@@ -204,7 +205,7 @@ const M = [{
204
205
  maxLength: 300
205
206
  })]
206
207
  }),
207
- onConfirm: () => O(),
208
+ onConfirm: () => E(),
208
209
  cancelButtonProps: {
209
210
  size: "middle"
210
211
  },
@@ -213,13 +214,13 @@ const M = [{
213
214
  },
214
215
  children: /* @__PURE__ */ n("span", {
215
216
  className: "comment-feedback-item",
216
- children: /* @__PURE__ */ n(r, {
217
+ children: /* @__PURE__ */ n(m, {
217
218
  type: "icon-cai"
218
219
  })
219
220
  })
220
- }), u === -1 && /* @__PURE__ */ n("span", {
221
+ }), f === -1 && /* @__PURE__ */ n("span", {
221
222
  className: "comment-feedback-item comment-feedback-item__active",
222
- children: /* @__PURE__ */ n(r, {
223
+ children: /* @__PURE__ */ n(m, {
223
224
  type: "icon-cai"
224
225
  })
225
226
  })]
@@ -228,5 +229,5 @@ const M = [{
228
229
  });
229
230
  };
230
231
  export {
231
- ne as default
232
+ te as default
232
233
  };