@matechat/core 1.10.0 → 1.11.0-alpha.1

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 (115) hide show
  1. package/Attachment/Attachment.vue.d.ts +121 -0
  2. package/Attachment/attachment-types.d.ts +103 -0
  3. package/Attachment/drop-area.vue.d.ts +13 -0
  4. package/Attachment/index.css +1 -1
  5. package/Attachment/index.d.ts +2 -0
  6. package/Attachment/index.js +211 -311
  7. package/Attachment/uploader.d.ts +11 -0
  8. package/Attachment/use-upload.d.ts +8 -0
  9. package/Bubble/Bubble.vue.d.ts +75 -0
  10. package/Bubble/BubbleLoading.vue.d.ts +3 -0
  11. package/Bubble/bubble-constants.d.ts +4 -0
  12. package/Bubble/bubble-types.d.ts +38 -0
  13. package/Bubble/components/Avatar.vue.d.ts +57 -0
  14. package/Bubble/components/AvatarBodyIcon.vue.d.ts +24 -0
  15. package/Bubble/components/AvatarNoBodyIcon.vue.d.ts +24 -0
  16. package/Bubble/components/avatar-types.d.ts +25 -0
  17. package/Bubble/index.css +1 -1
  18. package/Bubble/index.d.ts +2 -0
  19. package/Bubble/index.js +11 -11
  20. package/FileList/FileIcon/CodeFile.vue.d.ts +10 -0
  21. package/FileList/FileIcon/CompressedFile.vue.d.ts +10 -0
  22. package/FileList/FileIcon/DefaultFileIcon.vue.d.ts +10 -0
  23. package/FileList/FileIcon/Document.vue.d.ts +10 -0
  24. package/FileList/FileIcon/DrawingBoard.vue.d.ts +10 -0
  25. package/FileList/FileIcon/EmailFile.vue.d.ts +10 -0
  26. package/FileList/FileIcon/Excel.vue.d.ts +10 -0
  27. package/FileList/FileIcon/FlowChart.vue.d.ts +10 -0
  28. package/FileList/FileIcon/FolderClosed.vue.d.ts +10 -0
  29. package/FileList/FileIcon/FolderOpen.vue.d.ts +10 -0
  30. package/FileList/FileIcon/Image.vue.d.ts +10 -0
  31. package/FileList/FileIcon/Markdown.vue.d.ts +10 -0
  32. package/FileList/FileIcon/Mind.vue.d.ts +10 -0
  33. package/FileList/FileIcon/Mp4.vue.d.ts +10 -0
  34. package/FileList/FileIcon/MultidimentionalTable.vue.d.ts +10 -0
  35. package/FileList/FileIcon/Page.vue.d.ts +10 -0
  36. package/FileList/FileIcon/Pdf.vue.d.ts +10 -0
  37. package/FileList/FileIcon/Ppt.vue.d.ts +10 -0
  38. package/FileList/FileIcon/Unknown.vue.d.ts +10 -0
  39. package/FileList/FileIcon/Wrong.vue.d.ts +10 -0
  40. package/FileList/FileList.vue.d.ts +36 -0
  41. package/FileList/fileList-types.d.ts +21 -0
  42. package/FileList/index.d.ts +2 -0
  43. package/FileList/index.js +220 -228
  44. package/Header/Header.vue.d.ts +47 -0
  45. package/Header/header-types.d.ts +14 -0
  46. package/Header/index.d.ts +2 -0
  47. package/Input/Input.vue.d.ts +165 -0
  48. package/Input/components/EditableBlock.vue.d.ts +101 -0
  49. package/Input/components/InputTag.vue.d.ts +30 -0
  50. package/Input/components/LoadingIcon.vue.d.ts +3 -0
  51. package/Input/components/SendIcon.vue.d.ts +3 -0
  52. package/Input/components/button.vue.d.ts +3 -0
  53. package/Input/components/textarea-utils.d.ts +17 -0
  54. package/Input/components/textarea.vue.d.ts +3 -0
  55. package/Input/components/use-textarea-autosize.d.ts +12 -0
  56. package/Input/components/util.d.ts +3 -0
  57. package/Input/index.css +1 -1
  58. package/Input/index.d.ts +2 -0
  59. package/Input/index.js +593 -165
  60. package/Input/input-types.d.ts +118 -0
  61. package/Introduction/Introduction.vue.d.ts +88 -0
  62. package/Introduction/index.css +1 -1
  63. package/Introduction/index.d.ts +2 -0
  64. package/Introduction/index.js +41 -32
  65. package/Introduction/introduction-types.d.ts +37 -0
  66. package/Layout/Aside.vue.d.ts +13 -0
  67. package/Layout/Content.vue.d.ts +13 -0
  68. package/Layout/Header.vue.d.ts +13 -0
  69. package/Layout/Layout.vue.d.ts +13 -0
  70. package/Layout/Sender.vue.d.ts +13 -0
  71. package/Layout/index.d.ts +6 -0
  72. package/List/List.vue.d.ts +98 -0
  73. package/List/const.d.ts +5 -0
  74. package/List/index.d.ts +3 -0
  75. package/List/list-types.d.ts +52 -0
  76. package/List/use-list.d.ts +13 -0
  77. package/Locale/i18n.d.ts +21 -0
  78. package/Locale/index.d.ts +7 -0
  79. package/Locale/index.js +33 -51
  80. package/Locale/lang/en-us.d.ts +34 -0
  81. package/Locale/lang/zh-cn.d.ts +34 -0
  82. package/MarkdownCard/CodeBlock.vue.d.ts +76 -0
  83. package/MarkdownCard/MDCardParser.d.ts +12 -0
  84. package/MarkdownCard/MDCardService.d.ts +14 -0
  85. package/MarkdownCard/MermaidService.d.ts +22 -0
  86. package/MarkdownCard/index.css +1 -1
  87. package/MarkdownCard/index.d.ts +2 -0
  88. package/MarkdownCard/index.js +159 -159
  89. package/MarkdownCard/mdCard.types.d.ts +88 -0
  90. package/MarkdownCard/mdCard.vue.d.ts +29 -0
  91. package/Mention/Mention.vue.d.ts +51 -0
  92. package/Mention/const.d.ts +4 -0
  93. package/Mention/index.d.ts +2 -0
  94. package/Mention/mention-types.d.ts +24 -0
  95. package/Mention/use-mention.d.ts +10 -0
  96. package/Prompt/Prompt.vue.d.ts +38 -0
  97. package/Prompt/PromptItem.vue.d.ts +11 -0
  98. package/Prompt/components/Icon.vue.d.ts +42 -0
  99. package/Prompt/components/icon-types.d.ts +18 -0
  100. package/Prompt/index.d.ts +2 -0
  101. package/Prompt/prompt-types.d.ts +33 -0
  102. package/Toolbar/Toolbar.vue.d.ts +68 -0
  103. package/Toolbar/icon/CopyIcon.vue.d.ts +42 -0
  104. package/Toolbar/icon/DeleteIcon.vue.d.ts +42 -0
  105. package/Toolbar/icon/DislikeIcon.vue.d.ts +46 -0
  106. package/Toolbar/icon/LikeIcon.vue.d.ts +46 -0
  107. package/Toolbar/icon/RefreshIcon.vue.d.ts +42 -0
  108. package/Toolbar/icon/ShareIcon.vue.d.ts +42 -0
  109. package/Toolbar/index.css +1 -0
  110. package/Toolbar/index.d.ts +9 -0
  111. package/Toolbar/index.js +520 -0
  112. package/Toolbar/toolbar.types.d.ts +60 -0
  113. package/index.d.ts +18 -6
  114. package/mate-chat.js +11 -2
  115. package/package.json +1 -1
package/Input/index.js CHANGED
@@ -1,15 +1,20 @@
1
1
  import "./index.css";
2
- import { ref as _, defineComponent as M, inject as P, computed as k, watch as F, onMounted as T, withDirectives as U, createElementBlock as h, openBlock as m, normalizeClass as I, normalizeStyle as N, unref as l, isRef as W, vModelText as G, nextTick as X, createElementVNode as C, reactive as q, createCommentVNode as x, createBlock as Z, toDisplayString as E, provide as J, renderSlot as y, createVNode as w } from "vue";
3
- import { useMcI18n as A } from "@matechat/core/Locale";
4
- var S = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(S || {}), H = /* @__PURE__ */ ((e) => (e.Bordered = "bordered", e.BorderLess = "borderless", e))(H || {}), $ = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))($ || {}), b = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.ShiftEnter = "shiftEnter", e))(b || {});
5
- const Q = {
2
+ import { ref as w, defineComponent as X, inject as oe, computed as ae, watch as Y, onMounted as te, withDirectives as be, createElementBlock as x, openBlock as m, normalizeClass as q, normalizeStyle as ce, unref as g, isRef as ye, vModelText as xe, nextTick as pe, createElementVNode as $, withModifiers as le, toDisplayString as Z, resolveComponent as Ce, createCommentVNode as _, createBlock as O, withCtx as de, renderSlot as A, Fragment as ee, renderList as Te, createTextVNode as Le, reactive as Se, provide as _e, createVNode as ie } from "vue";
3
+ import { useMcI18n as fe } from "@matechat/core/Locale";
4
+ var V = /* @__PURE__ */ ((n) => (n.Simple = "simple", n.Full = "full", n))(V || {}), me = /* @__PURE__ */ ((n) => (n.Bordered = "bordered", n.BorderLess = "borderless", n))(me || {}), ne = /* @__PURE__ */ ((n) => (n.Simple = "simple", n.Full = "full", n))(ne || {}), K = /* @__PURE__ */ ((n) => (n.Enter = "enter", n.ShiftEnter = "shiftEnter", n))(K || {});
5
+ const we = {
6
6
  minRows: 1,
7
7
  maxRows: 5
8
- }, e1 = {
8
+ }, ke = {
9
9
  value: {
10
10
  type: String,
11
11
  default: ""
12
12
  },
13
+ formatContentOptions: {
14
+ type: Object,
15
+ default: () => {
16
+ }
17
+ },
13
18
  placeholder: {
14
19
  type: String
15
20
  },
@@ -60,7 +65,7 @@ const Q = {
60
65
  type: Boolean,
61
66
  default: !0
62
67
  }
63
- }, t1 = ["change", "submit", "cancel", "focus", "blur"], z = "mc-input", o1 = [
68
+ }, Ee = ["change", "submit", "cancel", "focus", "blur"], Q = "mc-input", Ie = [
64
69
  "letter-spacing",
65
70
  "line-height",
66
71
  "padding-top",
@@ -79,7 +84,7 @@ const Q = {
79
84
  "box-sizing",
80
85
  "word-break",
81
86
  "white-space"
82
- ], n1 = `
87
+ ], Be = `
83
88
  min-height:0 !important;
84
89
  max-height:none !important;
85
90
  height:0 !important;
@@ -91,133 +96,483 @@ const Q = {
91
96
  right:0 !important;
92
97
  pointer-events: none !important;
93
98
  `;
94
- function s1(e) {
95
- const o = window.getComputedStyle(e), s = o.getPropertyValue("box-sizing"), t = Number.parseFloat(o.getPropertyValue("padding-top")) + Number.parseFloat(o.getPropertyValue("padding-bottom")), n = Number.parseFloat(o.getPropertyValue("border-top-width")) + Number.parseFloat(o.getPropertyValue("border-bottom-width"));
96
- return { contextStyle: o1.map(
97
- (u) => `${u}:${o.getPropertyValue(u)}`
98
- ).join(";"), paddingSize: t, borderSize: n, boxSizing: s };
99
+ function $e(n) {
100
+ const a = window.getComputedStyle(n), s = a.getPropertyValue("box-sizing"), t = Number.parseFloat(a.getPropertyValue("padding-top")) + Number.parseFloat(a.getPropertyValue("padding-bottom")), l = Number.parseFloat(a.getPropertyValue("border-top-width")) + Number.parseFloat(a.getPropertyValue("border-bottom-width"));
101
+ return { contextStyle: Ie.map(
102
+ (r) => `${r}:${a.getPropertyValue(r)}`
103
+ ).join(";"), paddingSize: t, borderSize: l, boxSizing: s };
99
104
  }
100
- function i1(e, o = 1, s) {
101
- const { contextStyle: t, paddingSize: n, borderSize: a, boxSizing: u } = s1(e), r = document.createElement("textarea");
102
- r.setAttribute("style", `${t};${n1}`), r.value = e.value || e.placeholder || "", document.body.appendChild(r);
103
- let d = r.scrollHeight;
104
- const f = {
105
- height: `${d}px`
105
+ function Ne(n, a = 1, s) {
106
+ const { contextStyle: t, paddingSize: l, borderSize: i, boxSizing: r } = $e(n), u = document.createElement("textarea");
107
+ u.setAttribute("style", `${t};${Be}`), u.value = n.value || n.placeholder || "", document.body.appendChild(u);
108
+ let f = u.scrollHeight;
109
+ const h = {
110
+ height: `${f}px`
106
111
  };
107
- if (o !== void 0 || s !== void 0) {
108
- r.value = " ";
109
- const i = r.scrollHeight - n;
110
- if (o !== void 0) {
111
- let p = i * o;
112
- u === "border-box" && (p = p + n + a), d = Math.max(p, d), f.minHeight = `${p}px`;
112
+ if (a !== void 0 || s !== void 0) {
113
+ u.value = " ";
114
+ const C = u.scrollHeight - l;
115
+ if (a !== void 0) {
116
+ let p = C * a;
117
+ r === "border-box" && (p = p + l + i), f = Math.max(p, f), h.minHeight = `${p}px`;
113
118
  }
114
119
  if (s !== void 0) {
115
- let p = i * s;
116
- u === "border-box" && (p = p + n + a), d > p ? (d = p, f.overflowY = "auto") : f.overflowY = "hidden";
120
+ let p = C * s;
121
+ r === "border-box" && (p = p + l + i), f > p ? (f = p, h.overflowY = "auto") : h.overflowY = "hidden";
117
122
  }
118
123
  }
119
- return f.height = `${d}px`, r.remove(), f;
124
+ return h.height = `${f}px`, u.remove(), h;
120
125
  }
121
- function a1(e) {
122
- const { textareaRef: o, autosize: s } = e, t = _({}), n = () => typeof s == "boolean" ? Q : s;
126
+ function Me(n) {
127
+ const { textareaRef: a, autosize: s } = n, t = w({}), l = () => typeof s == "boolean" ? we : s;
123
128
  return {
124
129
  textareaStyle: t,
125
130
  updateTextareaStyle: () => {
126
- if (!o.value || s === !1) {
131
+ if (!a.value || s === !1) {
127
132
  t.value = {};
128
133
  return;
129
134
  }
130
- const u = n(), r = i1(
131
- o.value,
132
- u.minRows,
133
- u.maxRows
135
+ const r = l(), u = Ne(
136
+ a.value,
137
+ r.minRows,
138
+ r.maxRows
134
139
  );
135
140
  t.value = {
136
- ...r,
141
+ ...u,
137
142
  resize: "none"
138
143
  };
139
144
  }
140
145
  };
141
146
  }
142
- const r1 = ["placeholder", "disabled", "maxlength"], l1 = /* @__PURE__ */ M({
147
+ const De = ["placeholder", "disabled", "maxlength"], Re = /* @__PURE__ */ X({
143
148
  __name: "textarea",
144
- setup(e) {
145
- const { t: o } = A(), s = _(null), { inputValue: t, rootProps: n, rootEmits: a, clearInputAfterSubmit: u } = P(z), r = k(() => {
146
- let c = "", g = "";
147
- return n.submitShortKey === b.Enter && (c = "Enter", g = "Shift + Enter"), n.submitShortKey === b.ShiftEnter && (c = "Shift + Enter", g = "Enter"), n.placeholder ?? (c ? o("Input.pleaseEnterPlaceholder", { enterKey: c, shiftEnterKey: g }) : o("Input.pleaseEnter"));
148
- }), { textareaStyle: d, updateTextareaStyle: f } = a1({
149
+ setup(n) {
150
+ const { t: a } = fe(), s = w(null), { inputValue: t, rootProps: l, rootEmits: i, clearInputAfterSubmit: r } = oe(Q), u = ae(() => {
151
+ let v = "", E = "";
152
+ return l.submitShortKey === K.Enter && (v = "Enter", E = "Shift + Enter"), l.submitShortKey === K.ShiftEnter && (v = "Shift + Enter", E = "Enter"), l.placeholder ?? (v ? a("Input.pleaseEnterPlaceholder", { enterKey: v, shiftEnterKey: E }) : a("Input.pleaseEnter"));
153
+ }), { textareaStyle: f, updateTextareaStyle: h } = Me({
149
154
  textareaRef: s,
150
- autosize: n.autosize
155
+ autosize: l.autosize
151
156
  });
152
- F(
157
+ Y(
153
158
  () => t.value,
154
159
  () => {
155
- f();
160
+ h();
156
161
  }
157
- ), T(() => {
158
- f();
162
+ ), te(() => {
163
+ h();
159
164
  });
160
- let i = !1;
165
+ let C = !1;
161
166
  const p = () => {
162
- X(() => {
163
- a("change", t.value);
167
+ pe(() => {
168
+ i("change", t.value);
164
169
  });
165
- }, v = () => {
166
- i || p();
167
- }, L = () => {
168
- i = !0;
169
- }, D = () => {
170
+ }, T = () => {
171
+ C || p();
172
+ }, b = () => {
173
+ C = !0;
174
+ }, B = () => {
170
175
  setTimeout(() => {
171
- i = !1, p();
176
+ C = !1, p();
172
177
  }, 10);
173
- }, R = (c) => {
174
- if (n.submitShortKey === null)
178
+ }, z = (v) => {
179
+ if (l.submitShortKey === null)
175
180
  return;
176
- (n.submitShortKey === b.Enter ? !c.shiftKey : n.submitShortKey === b.ShiftEnter ? c.shiftKey : !1) && c.key === "Enter" && !i && (c.preventDefault(), a("submit", t.value), u(), a("change", t.value));
177
- }, Y = (c) => {
178
- a("focus", c);
179
- }, j = (c) => {
180
- a("blur", c);
181
+ (l.submitShortKey === K.Enter ? !v.shiftKey : l.submitShortKey === K.ShiftEnter ? v.shiftKey : !1) && v.key === "Enter" && !C && (v.preventDefault(), i("submit", t.value), r(), i("change", t.value));
182
+ }, F = (v) => {
183
+ i("focus", v);
184
+ }, k = (v) => {
185
+ i("blur", v);
181
186
  };
182
- return T(() => {
183
- n.autofocus && s.value && !n.disabled && s.value.focus();
184
- }), (c, g) => U((m(), h("textarea", {
187
+ return te(() => {
188
+ l.autofocus && s.value && !l.disabled && s.value.focus();
189
+ }), (v, E) => be((m(), x("textarea", {
185
190
  ref_key: "textareaRef",
186
191
  ref: s,
187
- "onUpdate:modelValue": g[0] || (g[0] = (O) => W(t) ? t.value = O : null),
188
- placeholder: r.value,
189
- disabled: l(n).disabled,
190
- maxlength: l(n).maxLength,
191
- style: N(l(d)),
192
- class: I([
192
+ "onUpdate:modelValue": E[0] || (E[0] = (H) => ye(t) ? t.value = H : null),
193
+ placeholder: u.value,
194
+ disabled: g(l).disabled,
195
+ maxlength: g(l).maxLength,
196
+ style: ce(g(f)),
197
+ class: q([
193
198
  "mc-textarea",
194
- { "mc-textarea-simple": l(n).displayType === l(S).Simple, "mc-textarea-disabled": l(n).disabled }
199
+ { "mc-textarea-simple": g(l).displayType === g(V).Simple, "mc-textarea-disabled": g(l).disabled }
195
200
  ]),
196
- onInput: v,
197
- onCompositionstart: L,
198
- onCompositionend: D,
199
- onKeydown: R,
200
- onFocus: Y,
201
- onBlur: j
202
- }, null, 46, r1)), [
203
- [G, l(t)]
201
+ onInput: T,
202
+ onCompositionstart: b,
203
+ onCompositionend: B,
204
+ onKeydown: z,
205
+ onFocus: F,
206
+ onBlur: k
207
+ }, null, 46, De)), [
208
+ [xe, g(t)]
204
209
  ]);
205
210
  }
206
- }), B = (e, o) => {
207
- const s = e.__vccOpts || e;
208
- for (const [t, n] of o)
209
- s[t] = n;
211
+ });
212
+ function he(n) {
213
+ const a = window.getSelection();
214
+ if (a && a.rangeCount > 0) {
215
+ const s = a.getRangeAt(0);
216
+ s.deleteContents();
217
+ const t = document.createTextNode(n);
218
+ s.insertNode(t), s.setStartAfter(t), s.setEndAfter(t), a.removeAllRanges(), a.addRange(s);
219
+ }
220
+ }
221
+ const Ae = (n) => {
222
+ var t;
223
+ n.preventDefault();
224
+ const s = (((t = n.clipboardData) == null ? void 0 : t.getData("text/plain")) || "").replace(/[\r\n]+/g, " ");
225
+ s && he(s);
226
+ }, Ke = (n) => {
227
+ if (n) {
228
+ const a = document.createRange(), s = window.getSelection();
229
+ a.selectNodeContents(n), a.collapse(!1), s == null || s.removeAllRanges(), s == null || s.addRange(a);
230
+ }
231
+ }, Pe = {
232
+ class: "editable-span",
233
+ contenteditable: "false"
234
+ }, ze = ["contenteditable", "placeholder"], Fe = /* @__PURE__ */ X({
235
+ __name: "InputTag",
236
+ props: {
237
+ content: String,
238
+ placeholder: {
239
+ type: String,
240
+ default: ""
241
+ },
242
+ disabled: {
243
+ type: Boolean,
244
+ default: !1
245
+ }
246
+ },
247
+ emits: ["change"],
248
+ setup(n, { emit: a }) {
249
+ const s = a, t = n, l = w(!1), i = w(t.content), r = w(null);
250
+ Y(() => t.content, (p) => {
251
+ i.value = p;
252
+ });
253
+ const u = () => {
254
+ l.value = !t.disabled;
255
+ }, f = () => {
256
+ l.value = !1;
257
+ }, h = (p) => {
258
+ var b;
259
+ const T = ((b = r.value) == null ? void 0 : b.textContent) || "";
260
+ i.value = T, s("change", T);
261
+ }, C = (p) => {
262
+ Ae(p), h();
263
+ };
264
+ return (p, T) => {
265
+ var b, B;
266
+ return m(), x("span", Pe, [
267
+ $("span", {
268
+ ref_key: "editableSpanRef",
269
+ ref: r,
270
+ contenteditable: l.value,
271
+ placeholder: n.placeholder,
272
+ class: q(["input-custom-item", { "input-custom-placeholder": !((b = i.value) != null && b.length), "inline-text": (B = i.value) == null ? void 0 : B.length }]),
273
+ tabindex: "0",
274
+ onInput: le(h, ["stop"]),
275
+ onFocus: u,
276
+ onBlur: f,
277
+ onPaste: le(C, ["stop"])
278
+ }, Z(n.content), 43, ze)
279
+ ]);
280
+ };
281
+ }
282
+ }), W = (n, a) => {
283
+ const s = n.__vccOpts || n;
284
+ for (const [t, l] of a)
285
+ s[t] = l;
210
286
  return s;
211
- }, u1 = {}, p1 = {
287
+ }, Ve = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-967e21e0"]]), Ze = ["contenteditable", "placeholder"], Oe = { contenteditable: "false" }, He = {
288
+ id: "ai-input-prefix",
289
+ class: "ai-input-prefix"
290
+ }, Ue = /* @__PURE__ */ X({
291
+ __name: "EditableBlock",
292
+ props: {
293
+ templateParts: {
294
+ type: Array,
295
+ default: () => []
296
+ },
297
+ placeholder: {
298
+ type: String,
299
+ default: ""
300
+ },
301
+ maxLength: {
302
+ type: Number,
303
+ default: 2e3
304
+ },
305
+ disabled: {
306
+ type: Boolean,
307
+ default: !1
308
+ },
309
+ submitShortKey: {
310
+ type: [String, null],
311
+ default: K.Enter
312
+ },
313
+ autofocus: {
314
+ type: Boolean,
315
+ default: !1
316
+ }
317
+ },
318
+ emits: ["send", "input", "blur", "focus", "onBlockKeyArrowUp"],
319
+ setup(n, { expose: a, emit: s }) {
320
+ const { rootProps: t } = oe(Q), l = s, i = n, r = w({
321
+ themeTagText: "",
322
+ clearInput: !1,
323
+ popoverContent: "",
324
+ type: "themeTag"
325
+ }), u = w(null), f = w([...i.templateParts]);
326
+ Y(() => i.templateParts, (e) => {
327
+ f.value = [...e];
328
+ });
329
+ const h = () => {
330
+ const e = u.value;
331
+ e && (e.innerHTML = "", k());
332
+ }, C = () => {
333
+ var d;
334
+ const e = (d = u.value) == null ? void 0 : d.textContent;
335
+ e.length > i.maxLength || (l("send", e), h());
336
+ }, p = () => {
337
+ var e;
338
+ (e = u.value) == null || e.focus(), Ke(u.value);
339
+ }, T = (e) => {
340
+ l("blur", e);
341
+ }, b = (e) => {
342
+ l("focus", e);
343
+ }, B = w(!1), z = () => {
344
+ B.value = !0;
345
+ }, F = () => {
346
+ B.value = !1, k();
347
+ }, k = () => {
348
+ B.value || E();
349
+ }, v = () => {
350
+ var d, c;
351
+ let e = (d = u.value) == null ? void 0 : d.textContent;
352
+ if (r.value.themeTagText) {
353
+ const y = (c = u.value) == null ? void 0 : c.querySelector(".ai-input-prefix-wrapper");
354
+ if (y) {
355
+ const D = y.textContent || "";
356
+ e = e.replace(D, " ");
357
+ }
358
+ }
359
+ return e;
360
+ }, E = () => {
361
+ setTimeout(() => {
362
+ const e = v();
363
+ l("input", e);
364
+ }, 50);
365
+ }, H = (e) => {
366
+ const d = i.submitShortKey === K.Enter ? !e.shiftKey : i.submitShortKey === K.ShiftEnter ? e.shiftKey : !1;
367
+ if (e.key === "Enter" && d && (e.preventDefault(), C()), ["ArrowLeft", "ArrowRight", "Backspace", "Delete"].includes(e.key)) {
368
+ const c = window.getSelection();
369
+ if (!(c != null && c.rangeCount) || !c.isCollapsed)
370
+ return;
371
+ const y = c.getRangeAt(0), { startContainer: D, startOffset: J } = y, S = e.key === "ArrowLeft" || e.key === "Backspace" ? "previous" : "next", P = L(D, J, S);
372
+ if (P && P.nodeType === Node.ELEMENT_NODE) {
373
+ const N = P.querySelector(".input-custom-item");
374
+ if (!N)
375
+ return;
376
+ if (e.preventDefault(), N.contentEditable = "true", e.key === "ArrowLeft" || e.key === "ArrowRight") {
377
+ const R = document.createRange();
378
+ R.setStart(N, S === "previous" ? N.childNodes.length : 0), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
379
+ } else if (e.key === "Backspace" || e.key === "Delete")
380
+ if (N.textContent.trim()) {
381
+ const R = document.createRange();
382
+ R.setStart(N, S === "previous" ? N.childNodes.length : 0), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
383
+ } else
384
+ P.remove();
385
+ }
386
+ }
387
+ e.key === "ArrowUp" && o() && l("onBlockKeyArrowUp", e);
388
+ };
389
+ function o() {
390
+ var y;
391
+ const e = window.getSelection();
392
+ if (!(e != null && e.rangeCount))
393
+ return !0;
394
+ const d = e.getRangeAt(0);
395
+ if (d.startOffset !== 0)
396
+ return !1;
397
+ let c = d.startContainer;
398
+ for (; c && !((y = c.classList) != null && y.contains("editable-container")); ) {
399
+ if (c.previousSibling)
400
+ return !1;
401
+ c = c.parentNode;
402
+ }
403
+ return !0;
404
+ }
405
+ function L(e, d, c) {
406
+ var P;
407
+ if (!e)
408
+ return null;
409
+ let y = e;
410
+ const D = (P = e.classList) == null ? void 0 : P.contains("editable-container");
411
+ if (D) {
412
+ const N = e.childNodes, R = Math.min(d, N.length - 1);
413
+ y = N[R];
414
+ }
415
+ if (!D && c === "previous" && d !== 0 || !D && c === "next" && d !== e.textContent.length)
416
+ return null;
417
+ let J = null, S = y;
418
+ for (; S; )
419
+ if (S = c === "next" ? S.nextSibling : S.previousSibling, !!S && S.nodeType !== Node.COMMENT_NODE && (S.nodeType !== Node.TEXT_NODE || S.nodeType === Node.TEXT_NODE && S.nodeValue.trim() !== "")) {
420
+ J = S;
421
+ break;
422
+ }
423
+ return J;
424
+ }
425
+ const I = (e) => {
426
+ var c;
427
+ e.preventDefault();
428
+ const d = (c = (e.originalEvent || e).clipboardData) == null ? void 0 : c.getData("text/plain");
429
+ he(d), k();
430
+ }, M = (e, d, c) => {
431
+ i.disabled || (f.value.push({
432
+ key: e,
433
+ type: "input",
434
+ placeholder: d,
435
+ content: c
436
+ }), G(), k());
437
+ }, U = (e) => {
438
+ i.disabled || (f.value = [...e], G(), k());
439
+ }, ge = (e) => {
440
+ i.disabled || (f.value.push({
441
+ type: "text",
442
+ content: e
443
+ }), G(), k());
444
+ }, ve = (e, d, c) => {
445
+ i.disabled || (r.value = {
446
+ themeTagText: e,
447
+ clearInput: c || !1,
448
+ popoverContent: d,
449
+ type: "themeTag"
450
+ });
451
+ }, se = () => {
452
+ r.value.themeTagText && r.value.clearInput ? h() : (r.value = {
453
+ themeTagText: "",
454
+ clearInput: !1,
455
+ popoverContent: "",
456
+ type: "themeTag"
457
+ }, E());
458
+ }, G = () => {
459
+ pe(() => {
460
+ p();
461
+ });
462
+ };
463
+ return te(() => {
464
+ i.autofocus && u.value && !i.disabled && G();
465
+ }), a({
466
+ clearInput: h,
467
+ getInput: v,
468
+ focusInput: p,
469
+ setMixTags: U,
470
+ setText: ge,
471
+ setInputTag: M,
472
+ openTipTag: ve,
473
+ closeTipTag: se
474
+ }), (e, d) => {
475
+ const c = Ce("d-popover");
476
+ return m(), x("div", {
477
+ ref_key: "editableDivRef",
478
+ ref: u,
479
+ class: q(["editable-container", { "mc-input-disabled": i.disabled, "mc-input-simple": g(t).displayType === g(V).Simple }]),
480
+ contenteditable: !i.disabled,
481
+ spellcheck: "false",
482
+ placeholder: i.placeholder,
483
+ onInput: k,
484
+ onKeydown: H,
485
+ onPaste: I,
486
+ onCompositionstart: z,
487
+ onCompositionend: F,
488
+ onBlur: T,
489
+ onFocus: b
490
+ }, [
491
+ _(" 前置标签 "),
492
+ r.value.themeTagText ? (m(), O(c, {
493
+ key: 0,
494
+ trigger: "hover",
495
+ content: r.value.popoverContent
496
+ }, {
497
+ default: de(() => [
498
+ $("span", Oe, [
499
+ r.value.themeTagText ? (m(), x("span", {
500
+ key: 0,
501
+ class: "ai-input-prefix-wrapper",
502
+ onClick: se,
503
+ contenteditable: "false"
504
+ }, [
505
+ A(e.$slots, "themeTag", { themeTag: r.value }, () => [
506
+ $(
507
+ "span",
508
+ He,
509
+ Z(r.value.themeTagText),
510
+ 1
511
+ /* TEXT */
512
+ )
513
+ ], !0)
514
+ ])) : _("v-if", !0),
515
+ d[0] || (d[0] = $(
516
+ "span",
517
+ {
518
+ contenteditable: "false",
519
+ style: { display: "inline-block", width: "4px" }
520
+ },
521
+ null,
522
+ -1
523
+ /* HOISTED */
524
+ ))
525
+ ])
526
+ ]),
527
+ _: 3
528
+ /* FORWARDED */
529
+ }, 8, ["content"])) : _("v-if", !0),
530
+ (m(!0), x(
531
+ ee,
532
+ null,
533
+ Te(f.value, (y, D) => (m(), x(
534
+ ee,
535
+ null,
536
+ [
537
+ y.type === "text" ? (m(), x(
538
+ ee,
539
+ { key: 0 },
540
+ [
541
+ Le(
542
+ Z(y.content),
543
+ 1
544
+ /* TEXT */
545
+ )
546
+ ],
547
+ 64
548
+ /* STABLE_FRAGMENT */
549
+ )) : y.type === "input" ? (m(), O(Ve, {
550
+ key: `input${D}`,
551
+ content: y.content,
552
+ placeholder: y.placeholder,
553
+ disabled: i.disabled,
554
+ onChange: k
555
+ }, null, 8, ["content", "placeholder", "disabled"])) : _("v-if", !0)
556
+ ],
557
+ 64
558
+ /* STABLE_FRAGMENT */
559
+ ))),
560
+ 256
561
+ /* UNKEYED_FRAGMENT */
562
+ ))
563
+ ], 42, Ze);
564
+ };
565
+ }
566
+ }), je = /* @__PURE__ */ W(Ue, [["__scopeId", "data-v-86573c82"]]), Ye = {}, Xe = {
212
567
  width: "16px",
213
568
  height: "16px",
214
569
  viewBox: "0 0 16 16",
215
570
  version: "1.1",
216
571
  xmlns: "http://www.w3.org/2000/svg"
217
572
  };
218
- function d1(e, o) {
219
- return m(), h("svg", p1, [...o[0] || (o[0] = [
220
- C(
573
+ function qe(n, a) {
574
+ return m(), x("svg", Xe, a[0] || (a[0] = [
575
+ $(
221
576
  "g",
222
577
  {
223
578
  stroke: "none",
@@ -226,23 +581,23 @@ function d1(e, o) {
226
581
  "fill-rule": "evenodd"
227
582
  },
228
583
  [
229
- C("path", { d: "M8,12 C8.27614237,12 8.5,12.2238576 8.5,12.5 L8.5,14.5 C8.5,14.7761424 8.27614237,15 8,15 C7.72385763,15 7.5,14.7761424 7.5,14.5 L7.5,12.5 C7.5,12.2238576 7.72385763,12 8,12 Z M11.0495421,11.3466838 L12.2251126,12.9647178 C12.3874251,13.1881217 12.3379006,13.5008065 12.1144968,13.663119 C11.8910929,13.8254314 11.5784081,13.775907 11.4160956,13.5525031 L10.2405251,11.9344691 C10.0782127,11.7110652 10.1277371,11.3983804 10.351141,11.236068 C10.5745449,11.0737556 10.8872297,11.12328 11.0495421,11.3466838 Z M5.64885899,11.236068 C5.87226287,11.3983804 5.92178728,11.7110652 5.75947486,11.9344691 L4.58390436,13.5525031 C4.42159194,13.775907 4.10890711,13.8254314 3.88550323,13.663119 C3.66209936,13.5008065 3.61257495,13.1881217 3.77488736,12.9647178 L4.95045787,11.3466838 C5.11277028,11.12328 5.42545512,11.0737556 5.64885899,11.236068 Z M12.4342628,8.91504822 L14.3363759,9.53308221 C14.5990029,9.61841489 14.7427283,9.90049196 14.6573956,10.163119 C14.5720629,10.425746 14.2899859,10.5694714 14.0273589,10.4841387 L12.1252458,9.86610473 C11.8626188,9.78077205 11.7188934,9.49869498 11.8042261,9.23606798 C11.8895588,8.97344097 12.1716358,8.82971553 12.4342628,8.91504822 Z M4.19577393,9.23606798 C4.28110662,9.49869498 4.13738118,9.78077205 3.87475417,9.86610473 L1.97264114,10.4841387 C1.71001414,10.5694714 1.42793707,10.425746 1.34260439,10.163119 C1.2572717,9.90049196 1.40099714,9.61841489 1.66362415,9.53308221 L3.56573718,8.91504822 C3.82836418,8.82971553 4.11044125,8.97344097 4.19577393,9.23606798 Z M14.6573956,5.83688104 C14.7427283,6.09950804 14.5990029,6.38158511 14.3363759,6.46691779 L12.4342628,7.08495178 C12.1716358,7.17028447 11.8895588,7.02655903 11.8042261,6.76393202 C11.7188934,6.50130502 11.8626188,6.21922795 12.1252458,6.13389527 L14.0273589,5.51586128 C14.2899859,5.43052859 14.5720629,5.57425403 14.6573956,5.83688104 Z M1.97264114,5.51586128 L3.87475417,6.13389527 C4.13738118,6.21922795 4.28110662,6.50130502 4.19577393,6.76393202 C4.11044125,7.02655903 3.82836418,7.17028447 3.56573718,7.08495178 L1.66362415,6.46691779 C1.40099714,6.38158511 1.2572717,6.09950804 1.34260439,5.83688104 C1.42793707,5.57425403 1.71001414,5.43052859 1.97264114,5.51586128 Z M12.1144968,2.33688104 C12.3379006,2.49919345 12.3874251,2.81187829 12.2251126,3.03528216 L11.0495421,4.65331615 C10.8872297,4.87672003 10.5745449,4.92624444 10.351141,4.76393202 C10.1277371,4.60161961 10.0782127,4.28893477 10.2405251,4.0655309 L11.4160956,2.44749691 C11.5784081,2.22409304 11.8910929,2.17456862 12.1144968,2.33688104 Z M4.58390436,2.44749691 L5.75947486,4.0655309 C5.92178728,4.28893477 5.87226287,4.60161961 5.64885899,4.76393202 C5.42545512,4.92624444 5.11277028,4.87672003 4.95045787,4.65331615 L3.77488736,3.03528216 C3.61257495,2.81187829 3.66209936,2.49919345 3.88550323,2.33688104 C4.10890711,2.17456862 4.42159194,2.22409304 4.58390436,2.44749691 Z M8,1 C8.27614237,1 8.5,1.22385763 8.5,1.5 L8.5,3.5 C8.5,3.77614237 8.27614237,4 8,4 C7.72385763,4 7.5,3.77614237 7.5,3.5 L7.5,1.5 C7.5,1.22385763 7.72385763,1 8,1 Z" })
584
+ $("path", { d: "M8,12 C8.27614237,12 8.5,12.2238576 8.5,12.5 L8.5,14.5 C8.5,14.7761424 8.27614237,15 8,15 C7.72385763,15 7.5,14.7761424 7.5,14.5 L7.5,12.5 C7.5,12.2238576 7.72385763,12 8,12 Z M11.0495421,11.3466838 L12.2251126,12.9647178 C12.3874251,13.1881217 12.3379006,13.5008065 12.1144968,13.663119 C11.8910929,13.8254314 11.5784081,13.775907 11.4160956,13.5525031 L10.2405251,11.9344691 C10.0782127,11.7110652 10.1277371,11.3983804 10.351141,11.236068 C10.5745449,11.0737556 10.8872297,11.12328 11.0495421,11.3466838 Z M5.64885899,11.236068 C5.87226287,11.3983804 5.92178728,11.7110652 5.75947486,11.9344691 L4.58390436,13.5525031 C4.42159194,13.775907 4.10890711,13.8254314 3.88550323,13.663119 C3.66209936,13.5008065 3.61257495,13.1881217 3.77488736,12.9647178 L4.95045787,11.3466838 C5.11277028,11.12328 5.42545512,11.0737556 5.64885899,11.236068 Z M12.4342628,8.91504822 L14.3363759,9.53308221 C14.5990029,9.61841489 14.7427283,9.90049196 14.6573956,10.163119 C14.5720629,10.425746 14.2899859,10.5694714 14.0273589,10.4841387 L12.1252458,9.86610473 C11.8626188,9.78077205 11.7188934,9.49869498 11.8042261,9.23606798 C11.8895588,8.97344097 12.1716358,8.82971553 12.4342628,8.91504822 Z M4.19577393,9.23606798 C4.28110662,9.49869498 4.13738118,9.78077205 3.87475417,9.86610473 L1.97264114,10.4841387 C1.71001414,10.5694714 1.42793707,10.425746 1.34260439,10.163119 C1.2572717,9.90049196 1.40099714,9.61841489 1.66362415,9.53308221 L3.56573718,8.91504822 C3.82836418,8.82971553 4.11044125,8.97344097 4.19577393,9.23606798 Z M14.6573956,5.83688104 C14.7427283,6.09950804 14.5990029,6.38158511 14.3363759,6.46691779 L12.4342628,7.08495178 C12.1716358,7.17028447 11.8895588,7.02655903 11.8042261,6.76393202 C11.7188934,6.50130502 11.8626188,6.21922795 12.1252458,6.13389527 L14.0273589,5.51586128 C14.2899859,5.43052859 14.5720629,5.57425403 14.6573956,5.83688104 Z M1.97264114,5.51586128 L3.87475417,6.13389527 C4.13738118,6.21922795 4.28110662,6.50130502 4.19577393,6.76393202 C4.11044125,7.02655903 3.82836418,7.17028447 3.56573718,7.08495178 L1.66362415,6.46691779 C1.40099714,6.38158511 1.2572717,6.09950804 1.34260439,5.83688104 C1.42793707,5.57425403 1.71001414,5.43052859 1.97264114,5.51586128 Z M12.1144968,2.33688104 C12.3379006,2.49919345 12.3874251,2.81187829 12.2251126,3.03528216 L11.0495421,4.65331615 C10.8872297,4.87672003 10.5745449,4.92624444 10.351141,4.76393202 C10.1277371,4.60161961 10.0782127,4.28893477 10.2405251,4.0655309 L11.4160956,2.44749691 C11.5784081,2.22409304 11.8910929,2.17456862 12.1144968,2.33688104 Z M4.58390436,2.44749691 L5.75947486,4.0655309 C5.92178728,4.28893477 5.87226287,4.60161961 5.64885899,4.76393202 C5.42545512,4.92624444 5.11277028,4.87672003 4.95045787,4.65331615 L3.77488736,3.03528216 C3.61257495,2.81187829 3.66209936,2.49919345 3.88550323,2.33688104 C4.10890711,2.17456862 4.42159194,2.22409304 4.58390436,2.44749691 Z M8,1 C8.27614237,1 8.5,1.22385763 8.5,1.5 L8.5,3.5 C8.5,3.77614237 8.27614237,4 8,4 C7.72385763,4 7.5,3.77614237 7.5,3.5 L7.5,1.5 C7.5,1.22385763 7.72385763,1 8,1 Z" })
230
585
  ],
231
586
  -1
232
- /* CACHED */
587
+ /* HOISTED */
233
588
  )
234
- ])]);
589
+ ]));
235
590
  }
236
- const c1 = /* @__PURE__ */ B(u1, [["render", d1]]), f1 = {}, m1 = {
591
+ const We = /* @__PURE__ */ W(Ye, [["render", qe]]), Ge = {}, Je = {
237
592
  width: "16px",
238
593
  height: "16px",
239
594
  viewBox: "0 0 16 16",
240
595
  version: "1.1",
241
596
  xmlns: "http://www.w3.org/2000/svg"
242
597
  };
243
- function h1(e, o) {
244
- return m(), h("svg", m1, [...o[0] || (o[0] = [
245
- C(
598
+ function Qe(n, a) {
599
+ return m(), x("svg", Je, a[0] || (a[0] = [
600
+ $(
246
601
  "g",
247
602
  {
248
603
  stroke: "none",
@@ -251,129 +606,202 @@ function h1(e, o) {
251
606
  "fill-rule": "evenodd"
252
607
  },
253
608
  [
254
- C("path", { d: "M13.5105149,2.56164948 C14.1211149,2.35546948 14.7829149,2.68328948 14.9892149,3.29376948 C15.0349149,3.42925948 15.0552149,3.57159948 15.0495149,3.71368948 L15.0495149,3.71368948 L15.0351149,3.85546948 L13.6575149,12.2717195 C13.5237149,13.0892195 12.7524149,13.6435195 11.9348149,13.5097195 C11.8542149,13.4965195 11.7751149,13.4768195 11.6980149,13.4508195 L11.6980149,13.4508195 L11.5840149,13.4071195 L9.3049349,12.4260195 L8.4482449,13.5422195 C8.1958049,13.8708195 7.8205549,14.0786195 7.4128449,14.1207195 L7.4128449,14.1207195 L7.2585449,14.1286195 C6.4787649,14.1286195 5.8381349,13.5337195 5.7653849,12.7731195 L5.7653849,12.7731195 L5.7585449,12.6286195 L5.7602549,10.5258195 L5.7756349,10.4384195 L5.7944349,10.3824195 L5.8266649,10.3168995 L5.8735349,10.2503695 L5.9177249,10.2039195 L12.6909149,3.89392948 L2.3403349,7.38903948 C2.2329149,7.42529948 2.1418449,7.49676948 2.0808149,7.59063948 L2.0808149,7.59063948 L2.0412649,7.66497948 C1.9440949,7.89044948 2.0258749,8.14788948 2.2236349,8.27917948 L2.2236349,8.27917948 L2.3029749,8.32214948 L4.4799849,9.26177948 C4.7333949,9.37121948 4.8503449,9.66546948 4.7409649,9.91894948 C4.6435549,10.1443495 4.4003949,10.2616595 4.1694349,10.2081295 L4.1694349,10.2081295 L4.0837449,10.1798795 L1.9072249,9.24047948 C1.1462449,8.91284948 0.795166898,8.03039948 1.1225549,7.26953948 C1.2700249,6.92755948 1.5380849,6.65435948 1.8730449,6.50018948 L1.8730449,6.50018948 L2.0205049,6.44158948 Z M6.7578149,11.3299195 L6.7585449,12.6286195 L6.7666013,12.7185103 C6.80894095,12.9517898 7.0131049,13.1286195 7.2585449,13.1286195 C7.3828149,13.1286195 7.5014649,13.0824195 7.5925349,13.0008195 L7.5925349,13.0008195 L7.6550349,12.9332195 L8.3569349,12.0179195 L6.7578149,11.3299195 Z M13.9888149,4.05090948 L7.1599149,10.4129195 L11.9795149,12.4886195 C11.9980149,12.4966195 12.0173149,12.5035195 12.0369149,12.5093195 L12.0369149,12.5093195 L12.0964149,12.5228195 C12.3386149,12.5624195 12.5686149,12.4209195 12.6482149,12.1975195 L12.6482149,12.1975195 L12.6706149,12.1101195 L13.9888149,4.05090948 Z" })
609
+ $("path", { d: "M13.5105149,2.56164948 C14.1211149,2.35546948 14.7829149,2.68328948 14.9892149,3.29376948 C15.0349149,3.42925948 15.0552149,3.57159948 15.0495149,3.71368948 L15.0495149,3.71368948 L15.0351149,3.85546948 L13.6575149,12.2717195 C13.5237149,13.0892195 12.7524149,13.6435195 11.9348149,13.5097195 C11.8542149,13.4965195 11.7751149,13.4768195 11.6980149,13.4508195 L11.6980149,13.4508195 L11.5840149,13.4071195 L9.3049349,12.4260195 L8.4482449,13.5422195 C8.1958049,13.8708195 7.8205549,14.0786195 7.4128449,14.1207195 L7.4128449,14.1207195 L7.2585449,14.1286195 C6.4787649,14.1286195 5.8381349,13.5337195 5.7653849,12.7731195 L5.7653849,12.7731195 L5.7585449,12.6286195 L5.7602549,10.5258195 L5.7756349,10.4384195 L5.7944349,10.3824195 L5.8266649,10.3168995 L5.8735349,10.2503695 L5.9177249,10.2039195 L12.6909149,3.89392948 L2.3403349,7.38903948 C2.2329149,7.42529948 2.1418449,7.49676948 2.0808149,7.59063948 L2.0808149,7.59063948 L2.0412649,7.66497948 C1.9440949,7.89044948 2.0258749,8.14788948 2.2236349,8.27917948 L2.2236349,8.27917948 L2.3029749,8.32214948 L4.4799849,9.26177948 C4.7333949,9.37121948 4.8503449,9.66546948 4.7409649,9.91894948 C4.6435549,10.1443495 4.4003949,10.2616595 4.1694349,10.2081295 L4.1694349,10.2081295 L4.0837449,10.1798795 L1.9072249,9.24047948 C1.1462449,8.91284948 0.795166898,8.03039948 1.1225549,7.26953948 C1.2700249,6.92755948 1.5380849,6.65435948 1.8730449,6.50018948 L1.8730449,6.50018948 L2.0205049,6.44158948 Z M6.7578149,11.3299195 L6.7585449,12.6286195 L6.7666013,12.7185103 C6.80894095,12.9517898 7.0131049,13.1286195 7.2585449,13.1286195 C7.3828149,13.1286195 7.5014649,13.0824195 7.5925349,13.0008195 L7.5925349,13.0008195 L7.6550349,12.9332195 L8.3569349,12.0179195 L6.7578149,11.3299195 Z M13.9888149,4.05090948 L7.1599149,10.4129195 L11.9795149,12.4886195 C11.9980149,12.4966195 12.0173149,12.5035195 12.0369149,12.5093195 L12.0369149,12.5093195 L12.0964149,12.5228195 C12.3386149,12.5624195 12.5686149,12.4209195 12.6482149,12.1975195 L12.6482149,12.1975195 L12.6706149,12.1101195 L13.9888149,4.05090948 Z" })
255
610
  ],
256
611
  -1
257
- /* CACHED */
612
+ /* HOISTED */
258
613
  )
259
- ])]);
614
+ ]));
260
615
  }
261
- const v1 = /* @__PURE__ */ B(f1, [["render", h1]]), g1 = ["disabled"], C1 = { class: "mc-button-content" }, L1 = { key: 2 }, y1 = /* @__PURE__ */ M({
616
+ const et = /* @__PURE__ */ W(Ge, [["render", Qe]]), tt = ["disabled"], nt = { class: "mc-button-content" }, ot = { key: 2 }, at = /* @__PURE__ */ X({
262
617
  __name: "button",
263
- setup(e) {
264
- const { t: o } = A(), { inputValue: s, rootProps: t, rootEmits: n, clearInputAfterSubmit: a } = P(
265
- z
266
- ), u = _(!1), r = _(!1), d = q({
618
+ setup(n) {
619
+ const { t: a } = fe(), { inputValue: s, rootProps: t, rootEmits: l, clearInputAfterSubmit: i } = oe(
620
+ Q
621
+ ), r = w(!1), u = w(!1), f = Se({
267
622
  top: "0px",
268
623
  left: "0px"
269
- }), f = k(() => ({
624
+ }), h = ae(() => ({
270
625
  "mc-button": !0,
271
626
  "mc-button-loading": t.loading,
272
- mousedown: u.value,
273
- "mc-button-simple": t.sendBtnVariant === $.Simple
274
- })), i = (v) => {
275
- d.left = v.offsetX + "px", d.top = v.offsetY + "px", r.value = !0, setTimeout(() => {
276
- r.value = !1;
627
+ mousedown: r.value,
628
+ "mc-button-simple": t.sendBtnVariant === ne.Simple
629
+ })), C = (T) => {
630
+ f.left = T.offsetX + "px", f.top = T.offsetY + "px", u.value = !0, setTimeout(() => {
631
+ u.value = !1;
277
632
  }, 300);
278
- }, p = (v) => {
279
- i(v), t.loading ? n("cancel") : (n("submit", s.value), a(), n("change", s.value));
633
+ }, p = (T) => {
634
+ C(T), t.loading ? l("cancel") : (l("submit", s.value), i(), l("change", s.value));
280
635
  };
281
- return (v, L) => (m(), h("button", {
282
- disabled: l(t).disabled || !l(t).loading && !l(s),
283
- class: I(f.value),
636
+ return (T, b) => (m(), x("button", {
637
+ disabled: g(t).disabled || !g(t).loading && !g(s),
638
+ class: q(h.value),
284
639
  onClick: p,
285
- onMousedown: L[0] || (L[0] = () => u.value = !0),
286
- onMouseup: L[1] || (L[1] = () => u.value = !1)
640
+ onMousedown: b[0] || (b[0] = () => r.value = !0),
641
+ onMouseup: b[1] || (b[1] = () => r.value = !1)
287
642
  }, [
288
- C("span", C1, [
289
- l(t).loading ? (m(), Z(c1, { key: 0 })) : (m(), Z(v1, { key: 1 })),
290
- l(t).sendBtnVariant === l($).Full ? (m(), h(
643
+ $("span", nt, [
644
+ g(t).loading ? (m(), O(We, { key: 0 })) : (m(), O(et, { key: 1 })),
645
+ g(t).sendBtnVariant === g(ne).Full ? (m(), x(
291
646
  "span",
292
- L1,
293
- E(l(t).loading ? l(o)("Input.pauseAnswer") : l(o)("Input.send")),
647
+ ot,
648
+ Z(g(t).loading ? g(a)("Input.pauseAnswer") : g(a)("Input.send")),
294
649
  1
295
650
  /* TEXT */
296
- )) : x("v-if", !0)
651
+ )) : _("v-if", !0)
297
652
  ]),
298
- r.value ? (m(), h(
653
+ u.value ? (m(), x(
299
654
  "div",
300
655
  {
301
656
  key: 0,
302
657
  class: "mc-button-water-wave",
303
- style: N(d)
658
+ style: ce(f)
304
659
  },
305
660
  null,
306
661
  4
307
662
  /* STYLE */
308
- )) : x("v-if", !0)
309
- ], 42, g1));
663
+ )) : _("v-if", !0)
664
+ ], 42, tt));
310
665
  }
311
- }), V = /* @__PURE__ */ B(y1, [["__scopeId", "data-v-dbbf3b38"]]), b1 = { class: "mc-input-content" }, x1 = {
666
+ }), re = /* @__PURE__ */ W(at, [["__scopeId", "data-v-dbbf3b38"]]), st = { class: "mc-input-content" }, lt = {
667
+ key: 0,
668
+ class: "editable-block-container"
669
+ }, it = {
312
670
  key: 0,
313
671
  class: "mc-input-foot"
314
- }, S1 = { class: "mc-input-foot-left" }, _1 = {
672
+ }, rt = { class: "mc-input-foot-left" }, ut = {
315
673
  key: 0,
316
674
  class: "mc-input-foot-count"
317
- }, K = /* @__PURE__ */ M({
675
+ }, j = 50, ue = /* @__PURE__ */ X({
318
676
  __name: "Input",
319
- props: e1,
320
- emits: t1,
321
- setup(e, { expose: o, emit: s }) {
322
- const t = e, n = s, a = _(""), u = k(() => ({
677
+ props: ke,
678
+ emits: Ee,
679
+ setup(n, { expose: a, emit: s }) {
680
+ const t = n, l = s, i = w(null), r = w(!1), u = w(""), f = ae(() => ({
323
681
  "mc-input": !0,
324
682
  "mc-input-disabled": t.disabled,
325
- "mc-input-simple": t.displayType === S.Simple,
326
- "mc-input-borderless": t.variant === H.BorderLess
327
- })), r = () => {
328
- a.value = "";
329
- }, d = () => {
330
- t.autoClear && r();
331
- }, f = () => a.value;
332
- return F(
683
+ "mc-input-simple": t.displayType === V.Simple,
684
+ "mc-input-borderless": t.variant === me.BorderLess
685
+ })), h = () => {
686
+ var o;
687
+ r.value ? (o = i.value) == null || o.clearInput() : u.value = "";
688
+ }, C = () => {
689
+ t.autoClear && h();
690
+ }, p = () => {
691
+ var o;
692
+ return r.value ? (o = i.value) == null ? void 0 : o.getInput() : u.value;
693
+ }, T = (o, L, I) => {
694
+ t.disabled || (r.value = !0, setTimeout(() => {
695
+ var M;
696
+ (M = i.value) == null || M.setInputTag(o, L, I);
697
+ }, j));
698
+ }, b = (o) => {
699
+ t.disabled || (r.value = !0, setTimeout(() => {
700
+ var L;
701
+ (L = i.value) == null || L.setText(o);
702
+ }, j));
703
+ }, B = (o) => {
704
+ t.disabled || (r.value = !0, setTimeout(() => {
705
+ var L;
706
+ (L = i.value) == null || L.setMixTags(o);
707
+ }, j));
708
+ }, z = (o, L, I) => {
709
+ t.disabled || (r.value = !0, setTimeout(() => {
710
+ var M;
711
+ (M = i.value) == null || M.openTipTag(o, L, I);
712
+ }, j));
713
+ }, F = () => {
714
+ var o;
715
+ r.value && ((o = i.value) == null || o.closeTipTag());
716
+ }, k = (o) => {
717
+ o || setTimeout(() => {
718
+ r.value = !1;
719
+ }, j), u.value = o, l("change", o);
720
+ }, v = (o) => {
721
+ l("submit", o);
722
+ }, E = (o) => {
723
+ l("blur", o);
724
+ }, H = (o) => {
725
+ l("focus", o);
726
+ };
727
+ return Y(
333
728
  () => t.value,
334
729
  () => {
335
- a.value = t.value;
730
+ u.value = t.value;
336
731
  },
337
732
  { immediate: !0 }
338
- ), o({ clearInput: r, getInput: f }), J(z, { inputValue: a, rootProps: t, rootEmits: n, clearInputAfterSubmit: d }), (i, p) => (m(), h(
733
+ ), Y(
734
+ () => t.formatContentOptions,
735
+ (o) => {
736
+ const L = o == null ? void 0 : o.formatContent, I = L.filter((U) => U.type === "themeTag");
737
+ I.length ? z(I[0].themeTagText, I[0].popoverContent, I[0].clearInput) : F();
738
+ const M = L.filter((U) => U.type !== "themeTag");
739
+ B(M);
740
+ },
741
+ { deep: !0 }
742
+ ), a({ clearInput: h, getInput: p, setInputTag: T, setText: b, setMixTags: B, openTipTag: z, closeTipTag: F }), _e(Q, { inputValue: u, rootProps: t, rootEmits: l, clearInputAfterSubmit: C }), (o, L) => (m(), x(
339
743
  "div",
340
744
  {
341
- class: I(u.value)
745
+ class: q(f.value)
342
746
  },
343
747
  [
344
- y(i.$slots, "head"),
345
- C("div", b1, [
346
- y(i.$slots, "prefix"),
347
- w(l1),
348
- y(i.$slots, "suffix"),
349
- i.displayType === l(S).Simple ? y(i.$slots, "button", { key: 0 }, () => [
350
- w(V)
351
- ]) : x("v-if", !0)
748
+ A(o.$slots, "head"),
749
+ $("div", st, [
750
+ A(o.$slots, "prefix"),
751
+ _(" 替换Textarea "),
752
+ r.value ? (m(), x("div", lt, [
753
+ _(" 可编辑块 "),
754
+ r.value ? (m(), O(je, {
755
+ key: 0,
756
+ ref_key: "editableBlockRef",
757
+ ref: i,
758
+ placeholder: t.placeholder,
759
+ maxLength: t.maxLength,
760
+ disabled: t.disabled,
761
+ "submit-short-key": t.submitShortKey,
762
+ autofocus: t.autofocus,
763
+ onInput: k,
764
+ onSend: v,
765
+ onBlur: E,
766
+ onFocus: H
767
+ }, {
768
+ themeTag: de(({ themeTag: I }) => [
769
+ A(o.$slots, "themeTag", { themeTag: I })
770
+ ]),
771
+ _: 3
772
+ /* FORWARDED */
773
+ }, 8, ["placeholder", "maxLength", "disabled", "submit-short-key", "autofocus"])) : _("v-if", !0)
774
+ ])) : _("v-if", !0),
775
+ r.value ? _("v-if", !0) : (m(), O(Re, { key: 1 })),
776
+ A(o.$slots, "suffix"),
777
+ o.displayType === g(V).Simple ? A(o.$slots, "button", { key: 2 }, () => [
778
+ ie(re)
779
+ ]) : _("v-if", !0)
352
780
  ]),
353
- i.displayType === l(S).Full ? (m(), h("div", x1, [
354
- C("div", S1, [
355
- y(i.$slots, "extra"),
356
- i.showCount ? (m(), h(
781
+ o.displayType === g(V).Full ? (m(), x("div", it, [
782
+ $("div", rt, [
783
+ A(o.$slots, "extra"),
784
+ o.showCount ? (m(), x(
357
785
  "span",
358
- _1,
359
- E(a.value.length) + E(i.maxLength ?? !1 ? `/${i.maxLength}` : ""),
786
+ ut,
787
+ Z(u.value.length) + Z(o.maxLength ?? !1 ? `/${o.maxLength}` : ""),
360
788
  1
361
789
  /* TEXT */
362
- )) : x("v-if", !0)
790
+ )) : _("v-if", !0)
363
791
  ]),
364
- y(i.$slots, "button", {}, () => [
365
- w(V)
792
+ A(o.$slots, "button", {}, () => [
793
+ ie(re)
366
794
  ])
367
- ])) : x("v-if", !0)
795
+ ])) : _("v-if", !0)
368
796
  ],
369
797
  2
370
798
  /* CLASS */
371
799
  ));
372
800
  }
373
801
  });
374
- K.install = (e) => {
375
- e.component("McInput", K);
802
+ ue.install = (n) => {
803
+ n.component("McInput", ue);
376
804
  };
377
805
  export {
378
- K as McInput
806
+ ue as McInput
379
807
  };