@opentiny/tiny-robot 0.2.0-alpha.3 → 0.2.0-alpha.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.
@@ -1,148 +1,157 @@
1
- import { ref as _, watch as A, reactive as a0, defineComponent as t0, computed as x, resolveComponent as r0, createElementBlock as y, openBlock as u, createBlock as M, createCommentVNode as S, withCtx as B, createVNode as T, unref as k, createElementVNode as R, normalizeClass as O, resolveDynamicComponent as c0, nextTick as s0, onMounted as d0, Fragment as e0, renderList as n0, toDisplayString as j, withModifiers as u0, Transition as Y, renderSlot as q, isRef as f0, normalizeStyle as p0 } from "vue";
2
- import { I as h0 } from "../index5.js";
3
- import { B as Q } from "../index3.js";
4
- import { i as m0 } from "../close.js";
5
- import { _ as g0 } from "../_plugin-vue_export-helper.js";
6
- function y0(o, f) {
7
- const c = _(o.modelValue || o.defaultValue || ""), a = _(null);
8
- A(
9
- () => o.modelValue,
10
- (d) => {
11
- d !== void 0 && d !== c.value && (c.value = d);
1
+ import { ref as b, watch as q, reactive as L0, defineComponent as c0, computed as S, resolveComponent as _0, createElementBlock as C, openBlock as d, createBlock as V, createCommentVNode as R, withCtx as $, createVNode as W, unref as F, createElementVNode as B, normalizeClass as z, resolveDynamicComponent as b0, nextTick as A, onMounted as k0, Fragment as r0, renderList as v0, toDisplayString as U, withModifiers as S0, useSlots as x0, Transition as a0, renderSlot as P, isRef as F0, normalizeStyle as D0, createTextVNode as E0 } from "vue";
2
+ import { I as R0 } from "../index5.js";
3
+ import { B as n0 } from "../index3.js";
4
+ import { i as B0 } from "../close.js";
5
+ import { _ as I0 } from "../_plugin-vue_export-helper.js";
6
+ function $0(n, h) {
7
+ const c = b(n.modelValue || n.defaultValue || ""), i = b(null);
8
+ q(
9
+ () => n.modelValue,
10
+ (f) => {
11
+ f !== void 0 && f !== c.value && (c.value = f);
12
12
  }
13
- ), A(
13
+ ), q(
14
14
  () => c.value,
15
- (d) => {
16
- f("update:modelValue", d);
15
+ (f) => {
16
+ h("update:modelValue", f);
17
17
  }
18
18
  );
19
- const p = (d) => {
20
- c.value = d, f("update:modelValue", d);
21
- }, v = (d) => {
22
- d == null || d.preventDefault();
23
- const w = c.value;
24
- !o.disabled && !o.loading && w.trim() && f("submit", w);
25
- }, i = () => {
26
- c.value = "", f("update:modelValue", ""), f("clear");
27
- }, l = _(!1);
19
+ const m = (f) => {
20
+ c.value = f, h("update:modelValue", f);
21
+ }, w = (f) => {
22
+ f == null || f.preventDefault();
23
+ const a = c.value;
24
+ !n.disabled && !n.loading && a.trim() && h("submit", a);
25
+ }, r = () => {
26
+ c.value = "", h("update:modelValue", ""), h("clear");
27
+ }, s = b(!1);
28
28
  return {
29
29
  inputValue: c,
30
- inputWrapper: a,
31
- isComposing: l,
32
- handleChange: p,
33
- handleSubmit: v,
34
- handleClear: i,
30
+ inputWrapper: i,
31
+ isComposing: s,
32
+ handleChange: m,
33
+ handleSubmit: w,
34
+ handleClear: r,
35
35
  clearInput: () => {
36
- i();
36
+ r();
37
37
  }
38
38
  };
39
39
  }
40
- function v0(o, f, c, a, p, v, i) {
41
- const l = (s) => !o.disabled && !o.loading && s.trim().length > 0, h = () => {
42
- l(c.value) && f("submit", c.value.trim());
43
- }, d = (s, g) => {
44
- if (!(s.key === "Enter")) return !1;
45
- switch (g) {
40
+ function M0(n, h, c, i, m, w, r, s, k) {
41
+ const f = (l) => !n.disabled && !n.loading && l.trim().length > 0, a = () => {
42
+ f(c.value) && h("submit", c.value.trim());
43
+ }, v = (l, L) => {
44
+ if (!(l.key === "Enter")) return !1;
45
+ switch (L) {
46
46
  case "enter":
47
- return !s.shiftKey && !s.ctrlKey && !s.metaKey;
47
+ return !l.shiftKey && !l.ctrlKey && !l.metaKey;
48
48
  case "ctrlEnter":
49
- return (s.ctrlKey || s.metaKey) && !s.shiftKey;
49
+ return (l.ctrlKey || l.metaKey) && !l.shiftKey;
50
50
  case "shiftEnter":
51
- return s.shiftKey && !s.ctrlKey && !s.metaKey;
51
+ return l.shiftKey && !l.ctrlKey && !l.metaKey;
52
52
  default:
53
53
  return !1;
54
54
  }
55
55
  };
56
56
  return {
57
- handleKeyPress: (s) => {
58
- if (a.value) return;
59
- if (s.key === "Escape") {
60
- v.value ? (v.value = !1, s.preventDefault()) : p.isRecording && (i(), s.preventDefault()), f("escape-press");
57
+ handleKeyPress: (l) => {
58
+ if (i.value) return;
59
+ if (l.key === "Enter" && l.shiftKey && (s == null ? void 0 : s.value) === "single" && k) {
60
+ l.preventDefault(), k();
61
+ const x = l.target, I = x.selectionStart, M = c.value;
62
+ c.value = M.substring(0, I) + `
63
+ ` + M.substring(I), setTimeout(() => {
64
+ x.selectionStart = x.selectionEnd = I + 1;
65
+ }, 0);
61
66
  return;
62
67
  }
63
- d(s, o.submitType) && l(c.value) && (s.preventDefault(), h());
68
+ if (l.key === "Escape") {
69
+ w.value ? (w.value = !1, l.preventDefault()) : m.isRecording && (r(), l.preventDefault()), h("escape-press");
70
+ return;
71
+ }
72
+ v(l, n.submitType) && f(c.value) && (l.preventDefault(), a());
64
73
  },
65
- triggerSubmit: h
74
+ triggerSubmit: a
66
75
  };
67
76
  }
68
- function C0(o) {
69
- const f = a0({
77
+ function T0(n) {
78
+ const h = L0({
70
79
  isRecording: !1,
71
80
  isSupported: typeof window < "u" && "webkitSpeechRecognition" in window || "SpeechRecognition" in window,
72
81
  error: void 0
73
- }), c = f.isSupported ? new (window.webkitSpeechRecognition || window.SpeechRecognition)() : void 0;
74
- c !== void 0 && (c.continuous = o.continuous ?? !1, c.interimResults = o.interimResults ?? !0, c.lang = o.lang ?? navigator.language, c.onstart = () => {
75
- var i;
76
- f.isRecording = !0, f.error = void 0, (i = o.onStart) == null || i.call(o);
82
+ }), c = h.isSupported ? new (window.webkitSpeechRecognition || window.SpeechRecognition)() : void 0;
83
+ c !== void 0 && (c.continuous = n.continuous ?? !1, c.interimResults = n.interimResults ?? !0, c.lang = n.lang ?? navigator.language, c.onstart = () => {
84
+ var r;
85
+ h.isRecording = !0, h.error = void 0, (r = n.onStart) == null || r.call(n);
77
86
  }, c.onend = () => {
78
- var i;
79
- f.isRecording = !1, (i = o.onEnd) == null || i.call(o);
80
- }, c.onresult = (i) => {
81
- var h, d;
82
- const l = Array.from(i.results).map((w) => w[0].transcript).join("");
83
- i.results[0].isFinal ? (h = o.onFinal) == null || h.call(o, l) : (d = o.onInterim) == null || d.call(o, l);
84
- }, c.onerror = (i) => {
85
- var l;
86
- f.error = new Error(i.error), f.isRecording = !1, (l = o.onError) == null || l.call(o, f.error);
87
+ var r;
88
+ h.isRecording = !1, (r = n.onEnd) == null || r.call(n);
89
+ }, c.onresult = (r) => {
90
+ var k, f;
91
+ const s = Array.from(r.results).map((a) => a[0].transcript).join("");
92
+ r.results[0].isFinal ? (k = n.onFinal) == null || k.call(n, s) : (f = n.onInterim) == null || f.call(n, s);
93
+ }, c.onerror = (r) => {
94
+ var s;
95
+ h.error = new Error(r.error), h.isRecording = !1, (s = n.onError) == null || s.call(n, h.error);
87
96
  });
88
- const a = () => {
89
- var i;
97
+ const i = () => {
98
+ var r;
90
99
  if (!c) {
91
- const l = new Error("浏览器不支持语音识别");
92
- f.error = l, (i = o.onError) == null || i.call(o, l);
100
+ const s = new Error("浏览器不支持语音识别");
101
+ h.error = s, (r = n.onError) == null || r.call(n, s);
93
102
  return;
94
103
  }
95
- if (f.isRecording) {
104
+ if (h.isRecording) {
96
105
  try {
97
106
  c.stop(), setTimeout(() => {
98
107
  try {
99
108
  c.start();
100
- } catch (l) {
101
- v(l);
109
+ } catch (s) {
110
+ w(s);
102
111
  }
103
112
  }, 100);
104
- } catch (l) {
105
- v(l);
113
+ } catch (s) {
114
+ w(s);
106
115
  }
107
116
  return;
108
117
  }
109
118
  try {
110
119
  c.start();
111
- } catch (l) {
112
- v(l);
120
+ } catch (s) {
121
+ w(s);
113
122
  }
114
- }, p = () => {
115
- if (c && f.isRecording)
123
+ }, m = () => {
124
+ if (c && h.isRecording)
116
125
  try {
117
126
  c.stop();
118
- } catch (i) {
119
- v(i);
127
+ } catch (r) {
128
+ w(r);
120
129
  }
121
- }, v = (i) => {
122
- var l;
123
- f.error = i instanceof Error ? i : new Error("语音识别操作失败"), f.isRecording = !1, (l = o.onError) == null || l.call(o, f.error);
130
+ }, w = (r) => {
131
+ var s;
132
+ h.error = r instanceof Error ? r : new Error("语音识别操作失败"), h.isRecording = !1, (s = n.onError) == null || s.call(n, h.error);
124
133
  };
125
134
  return {
126
- speechState: f,
127
- start: a,
128
- stop: p
135
+ speechState: h,
136
+ start: i,
137
+ stop: m
129
138
  };
130
139
  }
131
- const L0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs/%3e%3crect%20id='矩形'%20rx='8.000000'%20width='32.000000'%20height='32.000000'%20fill='%23000000'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='0.500000'%20y='0.500000'%20rx='8.000000'%20width='31.000000'%20height='31.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='4.000000'%20y='4.000000'%20width='24.000000'%20height='24.000000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='4.500000'%20y='4.500000'%20width='23.000000'%20height='23.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3cpath%20id='路径%203'%20d='M13.37%2010.32L13.23%2010.26L15.44%2011.19L12.61%2018.98C12.2%2020.11%2012.81%2021.36%2013.95%2021.72C15.04%2022.07%2016.2%2021.5%2016.59%2020.43L19.35%2012.85L18.8%2012.65L18.79%2012.62C18.79%2012.61%2018.8%2012.61%2018.8%2012.6L15.44%2011.19L15.83%2010.14C16.49%208.31%2018.52%207.37%2020.35%208.03C22.18%208.7%2023.12%2010.72%2022.46%2012.55L19.15%2021.65C18.21%2024.21%2015.38%2025.54%2012.82%2024.6C10.25%2023.67%208.93%2020.83%209.86%2018.27L12.83%2010.12L12.28%209.92L12.27%209.9C12.39%209.58%2012.73%209.42%2013.04%209.54C13.36%209.65%2013.52%209.99%2013.4%2010.31L13.37%2010.32Z'%20fill='%23D8D8D8'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20id='路径%203'%20d='M12.84%2010.1L9.86%2018.27C8.93%2020.83%2010.25%2023.67%2012.82%2024.6C15.38%2025.54%2018.21%2024.21%2019.15%2021.65L22.46%2012.55C23.12%2010.72%2022.18%208.7%2020.35%208.03C18.52%207.37%2016.49%208.31%2015.83%2010.14L12.61%2018.98C12.2%2020.11%2012.81%2021.36%2013.95%2021.72C15.04%2022.07%2016.2%2021.5%2016.59%2020.43L19.35%2012.83'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linecap='round'/%3e%3c/svg%3e", w0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3clinearGradient%20x1='12.999998'%20y1='21.128080'%20x2='20.000002'%20y2='6.999999'%20id='paint_linear_447_301_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E280FF'/%3e%3cstop%20offset='0.517615'%20stop-color='%236686FF'/%3e%3cstop%20offset='1.000000'%20stop-color='%234DDDFF'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20id='矩形'%20rx='8.000000'%20width='32.000000'%20height='32.000000'%20fill='%23000000'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='0.500000'%20y='0.500000'%20rx='8.000000'%20width='31.000000'%20height='31.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='4.000000'%20y='4.000000'%20width='24.000000'%20height='24.000000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='4.500000'%20y='4.500000'%20width='23.000000'%20height='23.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='13.000000'%20y='7.000000'%20rx='3.500000'%20width='7.000000'%20height='11.000000'%20fill='url(%23paint_linear_447_301_0)'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='13.000000'%20y='7.000000'%20rx='3.500000'%20width='7.000000'%20height='11.000000'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linejoin='round'/%3e%3cpath%20id='路径'%20d='M8.41%2014.02L8.39%2014C8.39%2013.66%208.66%2013.4%209%2013.4C9.33%2013.4%209.6%2013.66%209.6%2014L23.39%2014C23.39%2013.66%2023.66%2013.4%2024%2013.4C24.33%2013.4%2024.6%2013.66%2024.6%2014L24.58%2014.02L24%2014.02C23.98%2018.42%2020.63%2022%2016.5%2022C12.36%2022%209.01%2018.42%209%2014.02L8.41%2014.02Z'%20fill='%23D8D8D8'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20id='路径'%20d='M9%2014C9%2018.41%2012.35%2022%2016.5%2022C20.64%2022%2024%2018.41%2024%2014'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linecap='round'/%3e%3cpath%20id='路径%202'%20d='M15.91%2022.6L15.89%2022.58C15.89%2022.24%2016.16%2021.98%2016.5%2021.98C16.83%2021.98%2017.1%2022.24%2017.1%2022.58L17.08%2022.6L15.91%2022.6ZM17.08%2025.34L17.1%2025.36C17.1%2025.7%2016.83%2025.96%2016.5%2025.96C16.16%2025.96%2015.89%2025.7%2015.89%2025.36L15.91%2025.34L17.08%2025.34Z'%20fill='%23D8D8D8'%20fill-opacity='0'%20fill-rule='nonzero'/%3e%3cpath%20id='路径%202'%20d='M16.5%2022.58L16.5%2025.36'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linecap='round'/%3e%3c/svg%3e", k0 = "data:image/svg+xml,%3csvg%20width='152.343506'%20height='18.000000'%20viewBox='0%200%20152.344%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3clinearGradient%20x1='159.655945'%20y1='6.532532'%20x2='-2.217805'%20y2='3.665466'%20id='paint_linear_498_7491_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E6FF7D'%20stop-opacity='0.200000'/%3e%3cstop%20offset='0.264015'%20stop-color='%23FFB22E'%20stop-opacity='0.200000'/%3e%3cstop%20offset='0.522782'%20stop-color='%2397A7FF'%20stop-opacity='0.258824'/%3e%3cstop%20offset='0.702223'%20stop-color='%2376ADFF'%20stop-opacity='0.400000'/%3e%3cstop%20offset='0.830214'%20stop-color='%2367D1FF'%20stop-opacity='0.301961'/%3e%3cstop%20offset='1.000000'%20stop-color='%23D27EFF'%20stop-opacity='0.090196'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20id='Fill%203'%20d='M9.52%209.61C12.69%209.9%2015.86%2010.31%2019.04%2010.74C20.63%2010.94%2022.21%2011.28%2023.8%2011.78C25.39%2012.26%2026.97%2012.84%2028.56%2013.26C30.15%2013.67%2031.73%2013.89%2033.32%2013.89C34.11%2013.88%2034.91%2013.69%2035.7%2013.33C36.49%2012.98%2037.29%2012.49%2038.08%2012.06C38.87%2011.63%2039.67%2011.29%2040.46%2011.19C40.86%2011.13%2041.25%2011.13%2041.65%2011.17C42.05%2011.22%2042.45%2011.31%2042.84%2011.39C44.43%2011.75%2046.02%2012.36%2047.6%2013.19C50.78%2014.81%2053.95%2016.29%2057.12%2017.28C60.3%2018.29%2063.47%2018.26%2066.65%2016.96C69.82%2015.68%2072.99%2014.04%2076.17%2012.73C79.34%2011.4%2082.51%2011.19%2085.69%2011.85C88.86%2012.53%2092.04%2014.04%2095.21%2014.41C96%2014.51%2096.8%2014.56%2097.59%2014.56C98.38%2014.55%2099.18%2014.5%2099.97%2014.46C101.56%2014.35%20103.14%2014.18%20104.73%2013.94C107.91%2013.45%20111.08%2012.64%20114.25%2011.93C117.43%2011.19%20120.6%2010.62%20123.77%2010.26C126.95%209.88%20130.12%209.49%20133.3%209.28C136.47%209.06%20139.64%209%20142.82%209L152.34%209L142.82%209C139.64%208.99%20136.47%208.93%20133.3%208.71C130.12%208.5%20126.95%208.11%20123.77%207.73C120.6%207.37%20117.43%206.8%20114.25%206.06C111.08%205.35%20107.91%204.54%20104.73%204.05C103.14%203.81%20101.56%203.64%2099.97%203.53C99.18%203.49%2098.38%203.44%2097.59%203.43C96.8%203.43%2096%203.48%2095.21%203.58C92.04%203.95%2088.86%205.46%2085.69%206.14C82.51%206.8%2079.34%206.59%2076.17%205.26C72.99%203.95%2069.82%202.31%2066.65%201.03C63.47%20-0.27%2060.3%20-0.31%2057.12%200.71C53.95%201.7%2050.78%203.18%2047.6%204.8C46.02%205.63%2044.43%206.24%2042.84%206.6C42.45%206.68%2042.05%206.77%2041.65%206.82C41.25%206.86%2040.86%206.86%2040.46%206.8C39.67%206.7%2038.87%206.36%2038.08%205.93C37.29%205.51%2036.49%205.01%2035.7%204.66C34.91%204.3%2034.11%204.11%2033.32%204.1C31.73%204.1%2030.15%204.32%2028.56%204.73C26.97%205.15%2025.39%205.73%2023.8%206.21C22.21%206.71%2020.63%207.05%2019.04%207.25C15.86%207.68%2012.69%208.09%209.52%208.38C6.34%208.69%203.17%208.94%200%209C3.17%209.05%206.34%209.3%209.52%209.61Z'%20fill='url(%23paint_linear_498_7491_0)'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3c/svg%3e", _0 = "data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3cfilter%20id='filter_447_4247_dd'%20x='0'%20y='0'%20width='36'%20height='36'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dx='0'%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='1.66667'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'%20k2='-1'%20k3='1'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.039%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect_dropShadow_1'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect_dropShadow_1'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3cg%20filter='url(%23filter_447_4247_dd)'%3e%3crect%20id='Rectangle'%20x='0'%20y='0'%20rx='18'%20width='36'%20height='36'%20fill='%231476FF'%20fill-opacity='1'/%3e%3c/g%3e%3cpath%20id='Fill%201'%20d='M26.38%208.7L7.99%2017.45C7.59%2017.64%207.58%2018.21%207.98%2018.4L12.56%2020.7C12.78%2020.81%2013.05%2020.77%2013.23%2020.62L23.54%2011.95C23.71%2011.81%2023.94%2012.05%2023.78%2012.21L14.9%2021.42C14.72%2021.61%2014.63%2021.87%2014.66%2022.14L15.21%2026.9C15.26%2027.36%2015.83%2027.54%2016.14%2027.19L18.36%2024.65C18.49%2024.5%2018.46%2024.25%2018.29%2024.13L16.45%2022.88C16.34%2022.81%2016.44%2022.64%2016.56%2022.7L19%2023.92L21.87%2025.35C22.17%2025.5%2022.52%2025.35%2022.62%2025.03L27.44%209.62C27.64%208.98%2026.98%208.41%2026.38%208.7Z'%20fill='%23FFFFFF'%20fill-opacity='1'%20fill-rule='evenodd'/%3e%3c/svg%3e", b0 = "data:image/svg+xml,%3csvg%20width='102.000000'%20height='36.000000'%20viewBox='0%200%20102%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs/%3e%3crect%20id='沉浸式/输入框/停止生成按钮'%20rx='18.000000'%20width='102.000000'%20height='36.000000'%20fill='%231476FF'%20fill-opacity='0.060000'/%3e%3cpath%20id='停止回答'%20d='M79.96%2013.66L78.75%2013.66C78.4%2014.31%2078.01%2014.92%2077.56%2015.46L76.71%2014.92C77.59%2013.85%2078.23%2012.69%2078.63%2011.42L79.59%2011.63C79.47%2012.01%2079.33%2012.37%2079.19%2012.73L82.95%2012.73L82.95%2013.66L80.98%2013.66C81.25%2014.1%2081.47%2014.53%2081.64%2014.92L80.73%2015.25C80.5%2014.69%2080.24%2014.16%2079.96%2013.66ZM85.88%2013.66L84.54%2013.66C84.28%2014.09%2084%2014.5%2083.71%2014.89L82.87%2014.37C83.6%2013.49%2084.12%2012.51%2084.44%2011.43L85.4%2011.64C85.28%2012.03%2085.14%2012.4%2085%2012.73L89.2%2012.73L89.2%2013.66L86.93%2013.66C87.26%2014.19%2087.54%2014.69%2087.76%2015.14L86.84%2015.46Q86.42%2014.52%2085.88%2013.66ZM34.48%2017.26C35.8%2015.57%2036.77%2013.64%2037.37%2011.49L38.31%2011.92C37.98%2012.96%2037.59%2013.95%2037.13%2014.87L37.13%2024.4L36.11%2024.4L36.11%2016.62C35.72%2017.21%2035.28%2017.79%2034.82%2018.32L34.48%2017.26ZM41.56%2011.65L42.58%2011.49C42.72%2011.84%2042.84%2012.24%2042.98%2012.69L46.97%2012.69L46.97%2013.59L38.31%2013.59L38.31%2012.69L41.98%2012.69C41.85%2012.33%2041.71%2011.98%2041.56%2011.65ZM55.09%2022.81L55.09%2011.63L56.13%2011.63L56.13%2016.18L60.44%2016.18L60.44%2017.16L56.13%2017.16L56.13%2022.81L61.21%2022.81L61.21%2023.79L48.78%2023.79L48.78%2022.81L51.16%2022.81L51.16%2014.08L52.17%2014.08L52.17%2022.81L55.09%2022.81ZM63.38%2012.4L74.61%2012.4L74.61%2024.17L73.63%2024.17L73.63%2023.57L64.36%2023.57L64.36%2024.17L63.38%2024.17L63.38%2012.4ZM64.36%2013.29L64.36%2022.67L73.63%2022.67L73.63%2013.29L64.36%2013.29ZM39.23%2017.04L39.23%2014.4L45.9%2014.4L45.9%2017.04L39.23%2017.04ZM79.78%2018.65L79.78%2018.03C78.96%2018.46%2078.08%2018.87%2077.14%2019.24L76.67%2018.36C79.06%2017.46%2081.05%2016.34%2082.65%2015.01L83.32%2015.01C85.08%2016.44%2087.11%2017.56%2089.41%2018.39L88.92%2019.26C87.96%2018.89%2087.07%2018.47%2086.24%2018.03L86.24%2018.65L79.78%2018.65ZM40.21%2016.28L44.92%2016.28L44.92%2015.17L40.21%2015.17L40.21%2016.28ZM66.31%2020.45L66.31%2015.46L71.71%2015.46L71.71%2020.45L66.31%2020.45ZM80.32%2017.72L85.7%2017.72C84.7%2017.14%2083.79%2016.5%2082.98%2015.8C82.21%2016.48%2081.33%2017.13%2080.32%2017.72ZM67.25%2019.59L70.76%2019.59L70.76%2016.33L67.25%2016.33L67.25%2019.59ZM38.18%2017.86L47%2017.86L47%2020.25L46.25%2020.25L46.25%2020.88L43.22%2020.88L43.22%2023.15C43.22%2023.9%2042.8%2024.3%2041.99%2024.3L40.41%2024.3L40.2%2023.32C40.7%2023.34%2041.18%2023.37%2041.64%2023.37C42%2023.37%2042.18%2023.2%2042.18%2022.9L42.18%2020.88L39.12%2020.88L39.12%2020.25L38.18%2020.25L38.18%2017.86ZM39.16%2018.74L39.16%2020.01L46.04%2020.01L46.04%2018.74L39.16%2018.74ZM78.81%2019.96L87.18%2019.96L87.18%2024.38L86.21%2024.38L86.21%2023.75L79.78%2023.75L79.78%2024.38L78.81%2024.38L78.81%2019.96ZM79.78%2020.88L79.78%2022.83L86.21%2022.83L86.21%2020.88L79.78%2020.88Z'%20fill='%231476FF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3crect%20id='矩形'%20x='7.713867'%20y='7.714844'%20width='20.571428'%20height='20.571428'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='8.213867'%20y='8.214844'%20width='19.571428'%20height='19.571428'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='6.000000'%20y='6.000000'%20width='24.000000'%20height='24.000000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='6.500000'%20y='6.500000'%20width='23.000000'%20height='23.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='14.666992'%20y='14.666016'%20rx='1.500000'%20width='6.666667'%20height='6.666667'%20fill='%231476FF'%20fill-opacity='1.000000'/%3e%3ccircle%20id='椭圆形'%20cx='18.000000'%20cy='18.000000'%20r='8.250000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3ccircle%20id='椭圆形'%20cx='18.000000'%20cy='18.000000'%20r='8.250000'%20stroke='%231476FF'%20stroke-opacity='1.000000'%20stroke-width='1.500000'/%3e%3cpath%20id='路径'%20d='M17.8%2010.47C17.48%2010.39%2017.25%2010.1%2017.25%209.75C17.25%209.33%2017.58%209%2018%209L18.02%209.02L18.02%209.75C22.56%209.76%2026.25%2013.45%2026.25%2018C26.25%2022.55%2022.55%2026.25%2018%2026.25C16.52%2026.25%2015.13%2025.86%2013.93%2025.18L13.57%2025.81L13.54%2025.82C13.18%2025.61%2013.06%2025.16%2013.26%2024.8C13.44%2024.49%2013.78%2024.35%2014.11%2024.44L17.8%2010.47Z'%20fill='%23595959'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20id='路径'%20d='M13.91%2025.17C15.12%2025.85%2016.51%2026.25%2018%2026.25C22.55%2026.25%2026.25%2022.55%2026.25%2018C26.25%2013.44%2022.55%209.75%2018%209.75'%20stroke='%231476FF'%20stroke-opacity='1.000000'%20stroke-width='1.500000'%20stroke-linecap='round'/%3e%3c/svg%3e", F0 = { class: "action-buttons" }, x0 = {
140
+ const V0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs/%3e%3crect%20id='矩形'%20rx='8.000000'%20width='32.000000'%20height='32.000000'%20fill='%23000000'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='0.500000'%20y='0.500000'%20rx='8.000000'%20width='31.000000'%20height='31.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='4.000000'%20y='4.000000'%20width='24.000000'%20height='24.000000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='4.500000'%20y='4.500000'%20width='23.000000'%20height='23.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3cpath%20id='路径%203'%20d='M13.37%2010.32L13.23%2010.26L15.44%2011.19L12.61%2018.98C12.2%2020.11%2012.81%2021.36%2013.95%2021.72C15.04%2022.07%2016.2%2021.5%2016.59%2020.43L19.35%2012.85L18.8%2012.65L18.79%2012.62C18.79%2012.61%2018.8%2012.61%2018.8%2012.6L15.44%2011.19L15.83%2010.14C16.49%208.31%2018.52%207.37%2020.35%208.03C22.18%208.7%2023.12%2010.72%2022.46%2012.55L19.15%2021.65C18.21%2024.21%2015.38%2025.54%2012.82%2024.6C10.25%2023.67%208.93%2020.83%209.86%2018.27L12.83%2010.12L12.28%209.92L12.27%209.9C12.39%209.58%2012.73%209.42%2013.04%209.54C13.36%209.65%2013.52%209.99%2013.4%2010.31L13.37%2010.32Z'%20fill='%23D8D8D8'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20id='路径%203'%20d='M12.84%2010.1L9.86%2018.27C8.93%2020.83%2010.25%2023.67%2012.82%2024.6C15.38%2025.54%2018.21%2024.21%2019.15%2021.65L22.46%2012.55C23.12%2010.72%2022.18%208.7%2020.35%208.03C18.52%207.37%2016.49%208.31%2015.83%2010.14L12.61%2018.98C12.2%2020.11%2012.81%2021.36%2013.95%2021.72C15.04%2022.07%2016.2%2021.5%2016.59%2020.43L19.35%2012.83'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linecap='round'/%3e%3c/svg%3e", Z0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3clinearGradient%20x1='12.999998'%20y1='21.128080'%20x2='20.000002'%20y2='6.999999'%20id='paint_linear_447_301_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E280FF'/%3e%3cstop%20offset='0.517615'%20stop-color='%236686FF'/%3e%3cstop%20offset='1.000000'%20stop-color='%234DDDFF'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20id='矩形'%20rx='8.000000'%20width='32.000000'%20height='32.000000'%20fill='%23000000'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='0.500000'%20y='0.500000'%20rx='8.000000'%20width='31.000000'%20height='31.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='4.000000'%20y='4.000000'%20width='24.000000'%20height='24.000000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='4.500000'%20y='4.500000'%20width='23.000000'%20height='23.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='13.000000'%20y='7.000000'%20rx='3.500000'%20width='7.000000'%20height='11.000000'%20fill='url(%23paint_linear_447_301_0)'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='13.000000'%20y='7.000000'%20rx='3.500000'%20width='7.000000'%20height='11.000000'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linejoin='round'/%3e%3cpath%20id='路径'%20d='M8.41%2014.02L8.39%2014C8.39%2013.66%208.66%2013.4%209%2013.4C9.33%2013.4%209.6%2013.66%209.6%2014L23.39%2014C23.39%2013.66%2023.66%2013.4%2024%2013.4C24.33%2013.4%2024.6%2013.66%2024.6%2014L24.58%2014.02L24%2014.02C23.98%2018.42%2020.63%2022%2016.5%2022C12.36%2022%209.01%2018.42%209%2014.02L8.41%2014.02Z'%20fill='%23D8D8D8'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20id='路径'%20d='M9%2014C9%2018.41%2012.35%2022%2016.5%2022C20.64%2022%2024%2018.41%2024%2014'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linecap='round'/%3e%3cpath%20id='路径%202'%20d='M15.91%2022.6L15.89%2022.58C15.89%2022.24%2016.16%2021.98%2016.5%2021.98C16.83%2021.98%2017.1%2022.24%2017.1%2022.58L17.08%2022.6L15.91%2022.6ZM17.08%2025.34L17.1%2025.36C17.1%2025.7%2016.83%2025.96%2016.5%2025.96C16.16%2025.96%2015.89%2025.7%2015.89%2025.36L15.91%2025.34L17.08%2025.34Z'%20fill='%23D8D8D8'%20fill-opacity='0'%20fill-rule='nonzero'/%3e%3cpath%20id='路径%202'%20d='M16.5%2022.58L16.5%2025.36'%20stroke='%23595959'%20stroke-opacity='1.000000'%20stroke-width='1.200000'%20stroke-linecap='round'/%3e%3c/svg%3e", K0 = "data:image/svg+xml,%3csvg%20width='152.343506'%20height='18.000000'%20viewBox='0%200%20152.344%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3clinearGradient%20x1='159.655945'%20y1='6.532532'%20x2='-2.217805'%20y2='3.665466'%20id='paint_linear_498_7491_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E6FF7D'%20stop-opacity='0.200000'/%3e%3cstop%20offset='0.264015'%20stop-color='%23FFB22E'%20stop-opacity='0.200000'/%3e%3cstop%20offset='0.522782'%20stop-color='%2397A7FF'%20stop-opacity='0.258824'/%3e%3cstop%20offset='0.702223'%20stop-color='%2376ADFF'%20stop-opacity='0.400000'/%3e%3cstop%20offset='0.830214'%20stop-color='%2367D1FF'%20stop-opacity='0.301961'/%3e%3cstop%20offset='1.000000'%20stop-color='%23D27EFF'%20stop-opacity='0.090196'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20id='Fill%203'%20d='M9.52%209.61C12.69%209.9%2015.86%2010.31%2019.04%2010.74C20.63%2010.94%2022.21%2011.28%2023.8%2011.78C25.39%2012.26%2026.97%2012.84%2028.56%2013.26C30.15%2013.67%2031.73%2013.89%2033.32%2013.89C34.11%2013.88%2034.91%2013.69%2035.7%2013.33C36.49%2012.98%2037.29%2012.49%2038.08%2012.06C38.87%2011.63%2039.67%2011.29%2040.46%2011.19C40.86%2011.13%2041.25%2011.13%2041.65%2011.17C42.05%2011.22%2042.45%2011.31%2042.84%2011.39C44.43%2011.75%2046.02%2012.36%2047.6%2013.19C50.78%2014.81%2053.95%2016.29%2057.12%2017.28C60.3%2018.29%2063.47%2018.26%2066.65%2016.96C69.82%2015.68%2072.99%2014.04%2076.17%2012.73C79.34%2011.4%2082.51%2011.19%2085.69%2011.85C88.86%2012.53%2092.04%2014.04%2095.21%2014.41C96%2014.51%2096.8%2014.56%2097.59%2014.56C98.38%2014.55%2099.18%2014.5%2099.97%2014.46C101.56%2014.35%20103.14%2014.18%20104.73%2013.94C107.91%2013.45%20111.08%2012.64%20114.25%2011.93C117.43%2011.19%20120.6%2010.62%20123.77%2010.26C126.95%209.88%20130.12%209.49%20133.3%209.28C136.47%209.06%20139.64%209%20142.82%209L152.34%209L142.82%209C139.64%208.99%20136.47%208.93%20133.3%208.71C130.12%208.5%20126.95%208.11%20123.77%207.73C120.6%207.37%20117.43%206.8%20114.25%206.06C111.08%205.35%20107.91%204.54%20104.73%204.05C103.14%203.81%20101.56%203.64%2099.97%203.53C99.18%203.49%2098.38%203.44%2097.59%203.43C96.8%203.43%2096%203.48%2095.21%203.58C92.04%203.95%2088.86%205.46%2085.69%206.14C82.51%206.8%2079.34%206.59%2076.17%205.26C72.99%203.95%2069.82%202.31%2066.65%201.03C63.47%20-0.27%2060.3%20-0.31%2057.12%200.71C53.95%201.7%2050.78%203.18%2047.6%204.8C46.02%205.63%2044.43%206.24%2042.84%206.6C42.45%206.68%2042.05%206.77%2041.65%206.82C41.25%206.86%2040.86%206.86%2040.46%206.8C39.67%206.7%2038.87%206.36%2038.08%205.93C37.29%205.51%2036.49%205.01%2035.7%204.66C34.91%204.3%2034.11%204.11%2033.32%204.1C31.73%204.1%2030.15%204.32%2028.56%204.73C26.97%205.15%2025.39%205.73%2023.8%206.21C22.21%206.71%2020.63%207.05%2019.04%207.25C15.86%207.68%2012.69%208.09%209.52%208.38C6.34%208.69%203.17%208.94%200%209C3.17%209.05%206.34%209.3%209.52%209.61Z'%20fill='url(%23paint_linear_498_7491_0)'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3c/svg%3e", P0 = "data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3cfilter%20id='filter_447_4247_dd'%20x='0'%20y='0'%20width='36'%20height='36'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dx='0'%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='1.66667'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'%20k2='-1'%20k3='1'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.039%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect_dropShadow_1'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect_dropShadow_1'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3cg%20filter='url(%23filter_447_4247_dd)'%3e%3crect%20id='Rectangle'%20x='0'%20y='0'%20rx='18'%20width='36'%20height='36'%20fill='%231476FF'%20fill-opacity='1'/%3e%3c/g%3e%3cpath%20id='Fill%201'%20d='M26.38%208.7L7.99%2017.45C7.59%2017.64%207.58%2018.21%207.98%2018.4L12.56%2020.7C12.78%2020.81%2013.05%2020.77%2013.23%2020.62L23.54%2011.95C23.71%2011.81%2023.94%2012.05%2023.78%2012.21L14.9%2021.42C14.72%2021.61%2014.63%2021.87%2014.66%2022.14L15.21%2026.9C15.26%2027.36%2015.83%2027.54%2016.14%2027.19L18.36%2024.65C18.49%2024.5%2018.46%2024.25%2018.29%2024.13L16.45%2022.88C16.34%2022.81%2016.44%2022.64%2016.56%2022.7L19%2023.92L21.87%2025.35C22.17%2025.5%2022.52%2025.35%2022.62%2025.03L27.44%209.62C27.64%208.98%2026.98%208.41%2026.38%208.7Z'%20fill='%23FFFFFF'%20fill-opacity='1'%20fill-rule='evenodd'/%3e%3c/svg%3e", W0 = "data:image/svg+xml,%3csvg%20width='102.000000'%20height='36.000000'%20viewBox='0%200%20102%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs/%3e%3crect%20id='沉浸式/输入框/停止生成按钮'%20rx='18.000000'%20width='102.000000'%20height='36.000000'%20fill='%231476FF'%20fill-opacity='0.060000'/%3e%3cpath%20id='停止回答'%20d='M79.96%2013.66L78.75%2013.66C78.4%2014.31%2078.01%2014.92%2077.56%2015.46L76.71%2014.92C77.59%2013.85%2078.23%2012.69%2078.63%2011.42L79.59%2011.63C79.47%2012.01%2079.33%2012.37%2079.19%2012.73L82.95%2012.73L82.95%2013.66L80.98%2013.66C81.25%2014.1%2081.47%2014.53%2081.64%2014.92L80.73%2015.25C80.5%2014.69%2080.24%2014.16%2079.96%2013.66ZM85.88%2013.66L84.54%2013.66C84.28%2014.09%2084%2014.5%2083.71%2014.89L82.87%2014.37C83.6%2013.49%2084.12%2012.51%2084.44%2011.43L85.4%2011.64C85.28%2012.03%2085.14%2012.4%2085%2012.73L89.2%2012.73L89.2%2013.66L86.93%2013.66C87.26%2014.19%2087.54%2014.69%2087.76%2015.14L86.84%2015.46Q86.42%2014.52%2085.88%2013.66ZM34.48%2017.26C35.8%2015.57%2036.77%2013.64%2037.37%2011.49L38.31%2011.92C37.98%2012.96%2037.59%2013.95%2037.13%2014.87L37.13%2024.4L36.11%2024.4L36.11%2016.62C35.72%2017.21%2035.28%2017.79%2034.82%2018.32L34.48%2017.26ZM41.56%2011.65L42.58%2011.49C42.72%2011.84%2042.84%2012.24%2042.98%2012.69L46.97%2012.69L46.97%2013.59L38.31%2013.59L38.31%2012.69L41.98%2012.69C41.85%2012.33%2041.71%2011.98%2041.56%2011.65ZM55.09%2022.81L55.09%2011.63L56.13%2011.63L56.13%2016.18L60.44%2016.18L60.44%2017.16L56.13%2017.16L56.13%2022.81L61.21%2022.81L61.21%2023.79L48.78%2023.79L48.78%2022.81L51.16%2022.81L51.16%2014.08L52.17%2014.08L52.17%2022.81L55.09%2022.81ZM63.38%2012.4L74.61%2012.4L74.61%2024.17L73.63%2024.17L73.63%2023.57L64.36%2023.57L64.36%2024.17L63.38%2024.17L63.38%2012.4ZM64.36%2013.29L64.36%2022.67L73.63%2022.67L73.63%2013.29L64.36%2013.29ZM39.23%2017.04L39.23%2014.4L45.9%2014.4L45.9%2017.04L39.23%2017.04ZM79.78%2018.65L79.78%2018.03C78.96%2018.46%2078.08%2018.87%2077.14%2019.24L76.67%2018.36C79.06%2017.46%2081.05%2016.34%2082.65%2015.01L83.32%2015.01C85.08%2016.44%2087.11%2017.56%2089.41%2018.39L88.92%2019.26C87.96%2018.89%2087.07%2018.47%2086.24%2018.03L86.24%2018.65L79.78%2018.65ZM40.21%2016.28L44.92%2016.28L44.92%2015.17L40.21%2015.17L40.21%2016.28ZM66.31%2020.45L66.31%2015.46L71.71%2015.46L71.71%2020.45L66.31%2020.45ZM80.32%2017.72L85.7%2017.72C84.7%2017.14%2083.79%2016.5%2082.98%2015.8C82.21%2016.48%2081.33%2017.13%2080.32%2017.72ZM67.25%2019.59L70.76%2019.59L70.76%2016.33L67.25%2016.33L67.25%2019.59ZM38.18%2017.86L47%2017.86L47%2020.25L46.25%2020.25L46.25%2020.88L43.22%2020.88L43.22%2023.15C43.22%2023.9%2042.8%2024.3%2041.99%2024.3L40.41%2024.3L40.2%2023.32C40.7%2023.34%2041.18%2023.37%2041.64%2023.37C42%2023.37%2042.18%2023.2%2042.18%2022.9L42.18%2020.88L39.12%2020.88L39.12%2020.25L38.18%2020.25L38.18%2017.86ZM39.16%2018.74L39.16%2020.01L46.04%2020.01L46.04%2018.74L39.16%2018.74ZM78.81%2019.96L87.18%2019.96L87.18%2024.38L86.21%2024.38L86.21%2023.75L79.78%2023.75L79.78%2024.38L78.81%2024.38L78.81%2019.96ZM79.78%2020.88L79.78%2022.83L86.21%2022.83L86.21%2020.88L79.78%2020.88Z'%20fill='%231476FF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3crect%20id='矩形'%20x='7.713867'%20y='7.714844'%20width='20.571428'%20height='20.571428'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='8.213867'%20y='8.214844'%20width='19.571428'%20height='19.571428'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='6.000000'%20y='6.000000'%20width='24.000000'%20height='24.000000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3crect%20id='矩形'%20x='6.500000'%20y='6.500000'%20width='23.000000'%20height='23.000000'%20stroke='%23979797'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3crect%20id='矩形'%20x='14.666992'%20y='14.666016'%20rx='1.500000'%20width='6.666667'%20height='6.666667'%20fill='%231476FF'%20fill-opacity='1.000000'/%3e%3ccircle%20id='椭圆形'%20cx='18.000000'%20cy='18.000000'%20r='8.250000'%20fill='%23D8D8D8'%20fill-opacity='0'/%3e%3ccircle%20id='椭圆形'%20cx='18.000000'%20cy='18.000000'%20r='8.250000'%20stroke='%231476FF'%20stroke-opacity='1.000000'%20stroke-width='1.500000'/%3e%3cpath%20id='路径'%20d='M17.8%2010.47C17.48%2010.39%2017.25%2010.1%2017.25%209.75C17.25%209.33%2017.58%209%2018%209L18.02%209.02L18.02%209.75C22.56%209.76%2026.25%2013.45%2026.25%2018C26.25%2022.55%2022.55%2026.25%2018%2026.25C16.52%2026.25%2015.13%2025.86%2013.93%2025.18L13.57%2025.81L13.54%2025.82C13.18%2025.61%2013.06%2025.16%2013.26%2024.8C13.44%2024.49%2013.78%2024.35%2014.11%2024.44L17.8%2010.47Z'%20fill='%23595959'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20id='路径'%20d='M13.91%2025.17C15.12%2025.85%2016.51%2026.25%2018%2026.25C22.55%2026.25%2026.25%2022.55%2026.25%2018C26.25%2013.44%2022.55%209.75%2018%209.75'%20stroke='%231476FF'%20stroke-opacity='1.000000'%20stroke-width='1.500000'%20stroke-linecap='round'/%3e%3c/svg%3e", O0 = { class: "action-buttons" }, j0 = {
132
141
  key: 0,
133
- src: w0,
142
+ src: Z0,
134
143
  class: "button-icon",
135
144
  alt: "录音"
136
- }, S0 = {
145
+ }, A0 = {
137
146
  key: 1,
138
- src: k0,
147
+ src: K0,
139
148
  class: "button-icon recording-icon",
140
149
  alt: "语音中"
141
- }, D0 = { class: "button-content" }, E0 = {
150
+ }, U0 = { class: "button-content" }, z0 = {
142
151
  key: 0,
143
- src: _0,
152
+ src: P0,
144
153
  alt: "发送"
145
- }, o0 = /* @__PURE__ */ t0({
154
+ }, m0 = /* @__PURE__ */ c0({
146
155
  __name: "ActionButtons",
147
156
  props: {
148
157
  loading: { type: Boolean, default: !1 },
@@ -156,38 +165,39 @@ const L0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%2
156
165
  }) },
157
166
  allowFiles: { type: Boolean, default: !1 },
158
167
  submitType: { default: "enter" },
159
- showShortcuts: { type: Boolean }
168
+ showShortcuts: { type: Boolean },
169
+ isOverLimit: { type: Boolean, default: !1 }
160
170
  },
161
171
  emits: ["clear", "toggle-speech", "submit", "cancel"],
162
- setup(o, { emit: f }) {
163
- const c = m0(), a = o, p = f, v = x(() => a.allowSpeech), i = x(() => a.speechStatus.isRecording), l = x(() => a.disabled), h = () => {
164
- l.value || p("clear");
165
- }, d = () => {
166
- if (!l.value) {
167
- const g = !a.speechStatus.isRecording;
168
- p("toggle-speech", g);
172
+ setup(n, { emit: h }) {
173
+ const c = B0(), i = n, m = h, w = S(() => i.allowSpeech), r = S(() => i.speechStatus.isRecording), s = S(() => i.disabled), k = S(() => s.value || i.isOverLimit), f = () => {
174
+ s.value || m("clear");
175
+ }, a = () => {
176
+ if (!s.value) {
177
+ const l = !i.speechStatus.isRecording;
178
+ m("toggle-speech", l);
169
179
  }
170
- }, w = () => {
171
- l.value || p("submit");
172
- }, s = () => {
173
- l.value || p("cancel");
180
+ }, v = () => {
181
+ k.value || m("submit");
182
+ }, Z = () => {
183
+ s.value || m("cancel");
174
184
  };
175
- return (g, F) => {
176
- const I = r0("tiny-tooltip");
177
- return u(), y("div", F0, [
178
- g.allowFiles && !g.loading ? (u(), M(I, {
185
+ return (l, L) => {
186
+ const x = _0("tiny-tooltip");
187
+ return d(), C("div", O0, [
188
+ l.allowFiles && !l.loading ? (d(), V(x, {
179
189
  key: 0,
180
190
  content: "上传文件",
181
191
  placement: "top"
182
192
  }, {
183
- default: B(() => [
184
- T(k(Q), {
193
+ default: $(() => [
194
+ W(F(n0), {
185
195
  type: "text",
186
- disabled: l.value
196
+ disabled: s.value
187
197
  }, {
188
- default: B(() => F[1] || (F[1] = [
189
- R("img", {
190
- src: L0,
198
+ default: $(() => L[1] || (L[1] = [
199
+ B("img", {
200
+ src: V0,
191
201
  class: "button-icon",
192
202
  alt: "上传文件"
193
203
  }, null, -1)
@@ -196,268 +206,268 @@ const L0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%2
196
206
  }, 8, ["disabled"])
197
207
  ]),
198
208
  _: 1
199
- })) : S("", !0),
200
- v.value && !g.loading ? (u(), M(k(Q), {
209
+ })) : R("", !0),
210
+ w.value && !l.loading ? (d(), V(F(n0), {
201
211
  key: 1,
202
212
  type: "text",
203
- disabled: l.value,
204
- onClick: d,
205
- class: O(["speech-button", { "is-recording": i.value }])
213
+ disabled: s.value,
214
+ onClick: a,
215
+ class: z(["speech-button", { "is-recording": r.value }])
206
216
  }, {
207
- default: B(() => [
208
- i.value ? (u(), y("img", S0)) : (u(), y("img", x0))
217
+ default: $(() => [
218
+ r.value ? (d(), C("img", A0)) : (d(), C("img", j0))
209
219
  ]),
210
220
  _: 1
211
- }, 8, ["disabled", "class"])) : S("", !0),
212
- g.showClear ? (u(), M(I, {
221
+ }, 8, ["disabled", "class"])) : R("", !0),
222
+ l.showClear ? (d(), V(x, {
213
223
  key: 2,
214
224
  content: "清空内容",
215
225
  placement: "top"
216
226
  }, {
217
- default: B(() => [
218
- T(k(Q), {
227
+ default: $(() => [
228
+ W(F(n0), {
219
229
  type: "text",
220
- disabled: l.value || !g.hasContent,
221
- onClick: h,
230
+ disabled: s.value || !l.hasContent,
231
+ onClick: f,
222
232
  style: { "margin-left": "0" }
223
233
  }, {
224
- default: B(() => [
225
- (u(), M(c0(k(c)), { class: "button-icon" }))
234
+ default: $(() => [
235
+ (d(), V(b0(F(c)), { class: "button-icon" }))
226
236
  ]),
227
237
  _: 1
228
238
  }, 8, ["disabled"])
229
239
  ]),
230
240
  _: 1
231
- })) : S("", !0),
232
- g.hasContent || g.loading ? (u(), M(k(Q), {
241
+ })) : R("", !0),
242
+ l.hasContent || l.loading ? (d(), V(F(n0), {
233
243
  key: 3,
234
244
  type: "text",
235
- class: O(g.loading ? "cancel-button" : "submit-button"),
236
- disabled: l.value,
237
- onClick: F[0] || (F[0] = ($) => g.loading ? s() : w())
245
+ class: z(l.loading ? "cancel-button" : "submit-button"),
246
+ disabled: l.loading ? s.value : k.value,
247
+ onClick: L[0] || (L[0] = (I) => l.loading ? Z() : v())
238
248
  }, {
239
- default: B(() => [
240
- R("div", D0, [
241
- g.loading ? (u(), M(I, {
249
+ default: $(() => [
250
+ B("div", U0, [
251
+ l.loading ? (d(), V(x, {
242
252
  key: 1,
243
253
  content: "停止生成",
244
254
  placement: "top"
245
255
  }, {
246
- default: B(() => F[2] || (F[2] = [
247
- R("img", {
248
- src: b0,
256
+ default: $(() => L[2] || (L[2] = [
257
+ B("img", {
258
+ src: W0,
249
259
  alt: "加载中",
250
260
  class: "loading"
251
261
  }, null, -1)
252
262
  ])),
253
263
  _: 1
254
- })) : (u(), y("img", E0))
264
+ })) : (d(), C("img", z0))
255
265
  ])
256
266
  ]),
257
267
  _: 1
258
- }, 8, ["class", "disabled"])) : S("", !0)
268
+ }, 8, ["class", "disabled"])) : R("", !0)
259
269
  ]);
260
270
  };
261
271
  }
262
- }), B0 = { class: "template-editor" }, R0 = { key: 0 }, I0 = ["onClick"], M0 = ["onInput"], $0 = {
272
+ }), q0 = { class: "template-editor" }, G0 = { key: 0 }, H0 = ["onClick"], N0 = ["onInput"], Q0 = {
263
273
  key: 1,
264
274
  class: "template-placeholder"
265
- }, V0 = /* @__PURE__ */ t0({
275
+ }, J0 = /* @__PURE__ */ c0({
266
276
  __name: "TemplateEditor",
267
277
  props: {
268
278
  template: {},
269
279
  value: {}
270
280
  },
271
281
  emits: ["update:value", "input", "content-status", "field-active"],
272
- setup(o, { expose: f, emit: c }) {
273
- const a = o, p = c, v = _(null), i = _({}), l = _(-1), h = _(!1), d = _(!1), w = _(!1), s = _([]), g = (t) => {
274
- const n = [];
275
- let r = 0, C = 0;
276
- const m = /\[(.*?)\]/g;
277
- let b;
278
- for (; (b = m.exec(t)) !== null; )
279
- b.index > r && n.push({
280
- content: t.substring(r, b.index),
282
+ setup(n, { expose: h, emit: c }) {
283
+ const i = n, m = c, w = b(null), r = b({}), s = b(-1), k = b(!1), f = b(!1), a = b(!1), v = b([]), Z = (t) => {
284
+ const o = [];
285
+ let u = 0, _ = 0;
286
+ const y = /\[(.*?)\]/g;
287
+ let D;
288
+ for (; (D = y.exec(t)) !== null; )
289
+ D.index > u && o.push({
290
+ content: t.substring(u, D.index),
281
291
  isField: !1
282
- }), n.push({
283
- content: b[1],
292
+ }), o.push({
293
+ content: D[1],
284
294
  // 使用占位符作为默认内容
285
- placeholder: b[1],
295
+ placeholder: D[1],
286
296
  isField: !0,
287
- fieldIndex: C++
288
- }), r = b.index + b[0].length;
289
- return r < t.length && n.push({
290
- content: t.substring(r),
297
+ fieldIndex: _++
298
+ }), u = D.index + D[0].length;
299
+ return u < t.length && o.push({
300
+ content: t.substring(u),
291
301
  isField: !1
292
- }), n;
293
- }, F = () => {
294
- s.value = g(a.template), a.value && I(a.value);
295
- }, I = (t) => {
296
- if (!t || w.value || $() === t) return;
297
- const r = g(a.template), C = [];
298
- r.forEach((L) => {
299
- L.isField ? C.push(`__FIELD_${L.fieldIndex}__`) : C.push(L.content);
302
+ }), o;
303
+ }, l = () => {
304
+ v.value = Z(i.template), i.value && L(i.value);
305
+ }, L = (t) => {
306
+ if (!t || a.value || x() === t) return;
307
+ const u = Z(i.template), _ = [];
308
+ u.forEach((E) => {
309
+ E.isField ? _.push(`__FIELD_${E.fieldIndex}__`) : _.push(E.content);
300
310
  });
301
- let m = t, b = 0;
302
- for (let L = 0; L < s.value.length; L++) {
303
- if (!s.value[L].isField) continue;
304
- const z = C[b];
305
- b++;
306
- const e = C[b] || "";
307
- if (z && m.startsWith(z))
308
- if (m = m.substring(z.length), e && m.includes(e)) {
309
- const D = m.indexOf(e), E = m.substring(0, D);
310
- E && (s.value[L].content = E, l.value === L && i.value[L] && (d.value = !0)), m = m.substring(D);
311
- } else !e && m && (s.value[L].content = m, m = "");
311
+ let y = t, D = 0;
312
+ for (let E = 0; E < v.value.length; E++) {
313
+ if (!v.value[E].isField) continue;
314
+ const N = _[D];
315
+ D++;
316
+ const T = _[D] || "";
317
+ if (N && y.startsWith(N))
318
+ if (y = y.substring(N.length), T && y.includes(T)) {
319
+ const l0 = y.indexOf(T), K = y.substring(0, l0);
320
+ K && (v.value[E].content = K, s.value === E && r.value[E] && (f.value = !0)), y = y.substring(l0);
321
+ } else !T && y && (v.value[E].content = y, y = "");
312
322
  }
313
- Z(t);
314
- }, $ = () => s.value.map((t) => t.content).join(""), V = () => {
315
- w.value = !0;
316
- const t = $();
317
- p("update:value", t), p("input", t), Z(t), setTimeout(() => {
318
- w.value = !1;
323
+ M(t);
324
+ }, x = () => v.value.map((t) => t.content).join(""), I = () => {
325
+ a.value = !0;
326
+ const t = x();
327
+ m("update:value", t), m("input", t), M(t), setTimeout(() => {
328
+ a.value = !1;
319
329
  }, 0);
320
- }, Z = (t) => {
321
- const r = (t || $()).trim().length > 0;
322
- h.value !== r && (h.value = r, p("content-status", r));
323
- }, K = (t, n) => {
324
- t && (i.value[n] = t, t.textContent || (t.textContent = s.value[n].content), new MutationObserver(() => {
325
- l.value === n && !d.value && (d.value = !0, setTimeout(() => {
326
- s.value[n].content = t.textContent !== null ? t.textContent : "", d.value = !1;
330
+ }, M = (t) => {
331
+ const u = (t || x()).trim().length > 0;
332
+ k.value !== u && (k.value = u, m("content-status", u));
333
+ }, G = (t, o) => {
334
+ t && (r.value[o] = t, t.textContent || (t.textContent = v.value[o].content), new MutationObserver(() => {
335
+ s.value === o && !f.value && (f.value = !0, setTimeout(() => {
336
+ v.value[o].content = t.textContent !== null ? t.textContent : "", f.value = !1;
327
337
  }, 0));
328
338
  }).observe(t, {
329
339
  characterData: !0,
330
340
  childList: !0,
331
341
  subtree: !0
332
342
  }));
333
- }, G = (t, n) => {
334
- d.value = !0;
335
- const r = t.target, C = r.textContent !== null ? r.textContent : "";
336
- s.value[n].content !== C && (s.value[n].content = C, V()), setTimeout(() => {
337
- d.value = !1;
343
+ }, O = (t, o) => {
344
+ f.value = !0;
345
+ const u = t.target, _ = u.textContent !== null ? u.textContent : "";
346
+ v.value[o].content !== _ && (v.value[o].content = _, I()), setTimeout(() => {
347
+ f.value = !1;
338
348
  }, 10);
339
- }, W = (t) => {
349
+ }, X = (t) => {
340
350
  if (document.createRange) {
341
- const n = document.createRange();
342
- n.selectNodeContents(t), n.collapse(!1);
343
- const r = window.getSelection();
344
- r && (r.removeAllRanges(), r.addRange(n));
351
+ const o = document.createRange();
352
+ o.selectNodeContents(t), o.collapse(!1);
353
+ const u = window.getSelection();
354
+ u && (u.removeAllRanges(), u.addRange(o));
345
355
  }
346
- }, P = (t) => {
347
- if (l.value !== t) {
348
- if (l.value !== -1) {
349
- const n = l.value, r = i.value[n];
350
- r && (s.value[n].content = r.textContent !== null ? r.textContent : "", V());
356
+ }, Y = (t) => {
357
+ if (s.value !== t) {
358
+ if (s.value !== -1) {
359
+ const o = s.value, u = r.value[o];
360
+ u && (v.value[o].content = u.textContent !== null ? u.textContent : "", I());
351
361
  }
352
- l.value = t, p("field-active", !0, t), s0(() => {
353
- const n = i.value[t];
354
- n && (n.focus(), !n.textContent && s.value[t].content && (n.textContent = s.value[t].content), W(n));
362
+ s.value = t, m("field-active", !0, t), A(() => {
363
+ const o = r.value[t];
364
+ o && (o.focus(), !o.textContent && v.value[t].content && (o.textContent = v.value[t].content), X(o));
355
365
  });
356
366
  }
357
367
  }, H = () => {
358
- const t = l.value;
368
+ const t = s.value;
359
369
  if (t >= 0) {
360
- const n = i.value[t];
361
- if (n) {
362
- const r = n.textContent !== null ? n.textContent : "";
363
- s.value[t].content = r;
370
+ const o = r.value[t];
371
+ if (o) {
372
+ const u = o.textContent !== null ? o.textContent : "";
373
+ v.value[t].content = u;
364
374
  }
365
- p("field-active", !1, t);
375
+ m("field-active", !1, t);
366
376
  }
367
- V(), l.value = -1;
368
- }, U = (t) => {
377
+ I(), s.value = -1;
378
+ }, e0 = (t) => {
369
379
  t.key === "Enter" && (t.preventDefault(), H());
370
380
  };
371
- A(
372
- () => a.value,
381
+ q(
382
+ () => i.value,
373
383
  (t) => {
374
- t === "" ? N() : t && !w.value && I(t);
384
+ t === "" ? t0() : t && !a.value && L(t);
375
385
  }
376
- ), A(
377
- () => a.template,
386
+ ), q(
387
+ () => i.template,
378
388
  () => {
379
- F(), s0(() => {
380
- Z();
389
+ l(), A(() => {
390
+ M();
381
391
  });
382
392
  },
383
393
  { immediate: !0 }
384
394
  );
385
- const N = () => {
386
- s.value.forEach((t) => {
395
+ const t0 = () => {
396
+ v.value.forEach((t) => {
387
397
  t.isField && (t.content = t.placeholder || "");
388
- }), V();
389
- }, X = () => {
390
- N();
398
+ }), I();
399
+ }, j = () => {
400
+ t0();
391
401
  };
392
- return d0(() => {
393
- Z();
394
- }), f({
402
+ return k0(() => {
403
+ M();
404
+ }), h({
395
405
  activateFirstField: () => {
396
- for (let t = 0; t < s.value.length; t++)
397
- if (s.value[t].isField) {
398
- P(t);
406
+ for (let t = 0; t < v.value.length; t++)
407
+ if (v.value[t].isField) {
408
+ Y(t);
399
409
  break;
400
410
  }
401
411
  },
402
- resetFields: X
403
- }), (t, n) => (u(), y("div", B0, [
404
- R("div", {
412
+ resetFields: j
413
+ }), (t, o) => (d(), C("div", q0, [
414
+ B("div", {
405
415
  class: "template-content",
406
416
  ref_key: "editorRef",
407
- ref: v
417
+ ref: w
408
418
  }, [
409
- (u(!0), y(e0, null, n0(s.value, (r, C) => (u(), y(e0, { key: C }, [
410
- r.isField ? (u(), y("span", {
419
+ (d(!0), C(r0, null, v0(v.value, (u, _) => (d(), C(r0, { key: _ }, [
420
+ u.isField ? (d(), C("span", {
411
421
  key: 1,
412
- class: O(["template-field", { "template-field-active": l.value === C }]),
413
- onClick: (m) => P(C)
422
+ class: z(["template-field", { "template-field-active": s.value === _ }]),
423
+ onClick: (y) => Y(_)
414
424
  }, [
415
- l.value === C ? (u(), y("span", {
425
+ s.value === _ ? (d(), C("span", {
416
426
  key: 0,
417
427
  ref_for: !0,
418
- ref: (m) => K(m, C),
428
+ ref: (y) => G(y, _),
419
429
  class: "template-editable",
420
430
  contenteditable: "true",
421
- onInput: (m) => G(m, C),
422
- onBlur: n[0] || (n[0] = (m) => H()),
423
- onKeydown: n[1] || (n[1] = (m) => U(m)),
424
- onClick: n[2] || (n[2] = u0(() => {
431
+ onInput: (y) => O(y, _),
432
+ onBlur: o[0] || (o[0] = (y) => H()),
433
+ onKeydown: o[1] || (o[1] = (y) => e0(y)),
434
+ onClick: o[2] || (o[2] = S0(() => {
425
435
  }, ["stop"]))
426
- }, null, 40, M0)) : (u(), y("span", $0, j(r.content), 1))
427
- ], 10, I0)) : (u(), y("span", R0, j(r.content), 1))
436
+ }, null, 40, N0)) : (d(), C("span", Q0, U(u.content), 1))
437
+ ], 10, H0)) : (d(), C("span", G0, U(u.content), 1))
428
438
  ], 64))), 128))
429
439
  ], 512)
430
440
  ]));
431
441
  }
432
- }), T0 = /* @__PURE__ */ g0(V0, [["__scopeId", "data-v-09e9c7ed"]]), Z0 = ["data-theme"], K0 = { class: "tiny-sender__container" }, P0 = { class: "tiny-sender__input-wrapper" }, j0 = {
442
+ }), X0 = /* @__PURE__ */ I0(J0, [["__scopeId", "data-v-09e9c7ed"]]), Y0 = ["data-theme"], e2 = { class: "tiny-sender__container" }, t2 = {
433
443
  key: 0,
434
444
  class: "tiny-sender__header-slot"
435
- }, U0 = {
445
+ }, l2 = {
436
446
  key: 0,
437
447
  class: "tiny-sender__prefix-slot"
438
- }, z0 = { class: "tiny-sender__content-area" }, A0 = {
448
+ }, s2 = { class: "tiny-sender__content-area" }, n2 = {
449
+ key: 0,
450
+ class: "tiny-sender__decorative-content"
451
+ }, o2 = {
439
452
  key: 1,
440
453
  class: "tiny-sender__actions-slot"
441
- }, O0 = { class: "tiny-sender__buttons-container" }, G0 = {
442
- key: 0,
443
- class: "tiny-sender__footer-slot"
444
- }, W0 = {
445
- key: 0,
446
- class: "tiny-sender__word-limit"
447
- }, H0 = {
454
+ }, i2 = { class: "tiny-sender__footer-left" }, a2 = { class: "tiny-sender__footer-right" }, r2 = { class: "real-word-length" }, c2 = {
448
455
  key: 1,
449
456
  class: "tiny-sender__toolbar"
450
- }, N0 = { class: "tiny-sender__buttons-container" }, q0 = {
457
+ }, u2 = { class: "tiny-sender__buttons-container" }, d2 = {
458
+ key: 1,
459
+ class: "tiny-sender__footer-slot"
460
+ }, f2 = {
451
461
  key: 0,
452
462
  class: "tiny-sender__suggestions"
453
- }, Q0 = ["onClick"], J0 = {
463
+ }, p2 = ["onClick"], h2 = {
454
464
  key: 0,
455
465
  class: "tiny-sender__error"
456
- }, J = /* @__PURE__ */ t0({
466
+ }, o0 = /* @__PURE__ */ c0({
457
467
  __name: "index",
458
468
  props: {
459
469
  autofocus: { type: Boolean, default: !1 },
460
- autoSize: { type: [Boolean, Object], default: !1 },
470
+ autoSize: { type: [Boolean, Object], default: () => ({ minRows: 1, maxRows: 3 }) },
461
471
  allowSpeech: { type: Boolean, default: !0 },
462
472
  allowFiles: { type: Boolean, default: !1 },
463
473
  clearable: { type: Boolean, default: !1 },
@@ -474,210 +484,289 @@ const L0 = "data:image/svg+xml,%3csvg%20width='32.000000'%20height='32.000000'%2
474
484
  suggestions: {},
475
485
  theme: { default: "light" },
476
486
  template: { default: "" },
477
- hasContent: { type: Boolean, default: void 0 }
487
+ hasContent: { type: Boolean, default: void 0 },
488
+ tipsMessage: {}
478
489
  },
479
- emits: ["update:modelValue", "submit", "clear", "speech-start", "speech-end", "speech-interim", "speech-error", "suggestion-select", "focus", "blur", "escape-press", "cancel", "reset-template"],
480
- setup(o, { expose: f, emit: c }) {
481
- const a = o, p = c, v = _(null), i = _(null), l = x(() => !!a.template), { inputValue: h, isComposing: d, clearInput: w } = y0(a, p), s = () => {
482
- w(), a.template && p("reset-template");
483
- }, g = _(!1), F = x(() => !a.suggestions || !h.value ? [] : a.suggestions.filter((e) => e.toLowerCase().includes(h.value.toLowerCase()))), I = (e) => {
484
- h.value = e, g.value = !1, p("suggestion-select", e);
485
- }, $ = (e) => {
486
- h.value = e, p("update:modelValue", e);
487
- }, V = () => {
488
- i.value && i.value.activateFirstField();
489
- }, Z = x(() => ({
490
- ...typeof a.speech == "object" ? a.speech : {},
491
- onStart: () => p("speech-start"),
492
- onEnd: (e) => p("speech-end", e),
493
- onInterim: (e) => p("speech-interim", e),
494
- onFinal: (e) => {
495
- h.value = e, p("speech-end", e);
496
- },
497
- onError: (e) => {
498
- l0(e.message), p("speech-error", e);
499
- }
500
- })), { speechState: K, start: G, stop: W } = C0(Z.value), P = () => {
501
- K.isRecording ? W() : G();
502
- }, { handleKeyPress: H, triggerSubmit: U } = v0(
490
+ emits: ["update:modelValue", "submit", "clear", "speech-start", "speech-end", "speech-interim", "speech-error", "suggestion-select", "focus", "blur", "escape-press", "cancel", "reset-template", "fixed-link-click"],
491
+ setup(n, { expose: h, emit: c }) {
492
+ const i = n, m = c, w = b(null), r = b(null), s = b(null), k = b(null), f = S(() => !!i.template), { inputValue: a, isComposing: v, clearInput: Z } = $0(i, m), l = b(i.mode), L = b(!1), x = () => {
493
+ l.value === "single" && (l.value = "multiple", A(() => {
494
+ setTimeout(() => {
495
+ const e = document.querySelector(".tiny-textarea__inner");
496
+ if (e) {
497
+ e.style.whiteSpace = "pre-wrap";
498
+ const p = a.value.length;
499
+ e.focus(), e.setSelectionRange(p, p);
500
+ }
501
+ }, 50);
502
+ }));
503
+ }, I = (e, p) => {
504
+ const g = document.createElement("span");
505
+ g.style.visibility = "hidden", g.style.position = "absolute", g.style.whiteSpace = "nowrap", g.style.font = p, g.textContent = e, document.body.appendChild(g);
506
+ const J = g.offsetWidth;
507
+ return document.body.removeChild(g), J;
508
+ }, M = () => {
509
+ if (i.mode !== "single" || !w.value || L.value) return;
510
+ const p = document.querySelector(".tiny-sender__content-area").querySelector(".tiny-input__inner"), g = k.value || document.querySelector(".tiny-sender__buttons-container");
511
+ if (!p) return;
512
+ const J = window.getComputedStyle(p).font, p0 = I(a.value, J), w0 = p.offsetWidth - ((g == null ? void 0 : g.offsetWidth) || 0) - 20;
513
+ p0 > w0 && l.value === "single" && (L.value = !0, l.value = "multiple", A(() => {
514
+ w.value ? setTimeout(() => {
515
+ const s0 = document.querySelector(".tiny-textarea__inner");
516
+ if (s0) {
517
+ s0.style.whiteSpace = "pre-wrap";
518
+ const h0 = a.value.length;
519
+ s0.focus(), s0.setSelectionRange(h0, h0);
520
+ }
521
+ L.value = !1;
522
+ }, 300) : L.value = !1;
523
+ }));
524
+ }, G = () => {
525
+ Z(), l.value = "single", i.template && m("reset-template"), A(() => {
526
+ a.value === "" && (l.value = i.mode || "single");
527
+ });
528
+ }, O = b(!1), X = S(() => !i.suggestions || !a.value ? [] : i.suggestions.filter((e) => e.toLowerCase().includes(a.value.toLowerCase()))), Y = (e) => {
529
+ a.value = e, O.value = !1, m("suggestion-select", e);
530
+ }, H = (e) => {
531
+ a.value = e, m("update:modelValue", e);
532
+ }, e0 = () => {
533
+ r.value && r.value.activateFirstField();
534
+ }, t0 = S(() => {
535
+ const e = typeof i.speech == "object" ? i.speech : {};
536
+ return {
537
+ ...e,
538
+ onStart: () => m("speech-start"),
539
+ onEnd: (p) => m("speech-end", p),
540
+ onInterim: (p) => m("speech-interim", p),
541
+ onFinal: (p) => {
542
+ if (e.autoReplace)
543
+ a.value = p;
544
+ else {
545
+ const g = a.value;
546
+ g && p && !g.endsWith(" ") && !p.startsWith(" ") && g.length > 0 ? a.value = g + " " + p : a.value = g + p;
547
+ }
548
+ m("speech-end", p);
549
+ },
550
+ onError: (p) => {
551
+ y0(p.message), m("speech-error", p);
552
+ }
553
+ };
554
+ }), { speechState: j, start: t, stop: o } = T0(t0.value), u = () => {
555
+ j.isRecording ? o() : t();
556
+ }, { handleKeyPress: _, triggerSubmit: y } = M0(
557
+ i,
558
+ m,
503
559
  a,
504
- p,
505
- h,
506
- d,
507
- K,
508
- g,
509
- P
510
- ), N = (e) => {
511
- p("focus", e);
512
- }, X = (e) => {
513
- p("blur", e);
514
- }, t = x(() => a.mode === "multiple" ? { minRows: 2, maxRows: 5 } : { maxRows: 1 }), n = x(
560
+ v,
561
+ j,
562
+ O,
563
+ u,
564
+ l,
565
+ x
566
+ ), D = (e) => {
567
+ m("focus", e);
568
+ }, E = (e) => {
569
+ m("blur", e);
570
+ }, u0 = S(() => l.value === "multiple" ? "textarea" : "text"), N = S(
515
571
  () => ({
516
572
  display: "flex",
517
- justifyContent: a.showWordLimit && a.maxLength !== 1 / 0 ? "space-between" : "flex-end",
573
+ justifyContent: i.showWordLimit && i.maxLength !== 1 / 0 ? "space-between" : "flex-end",
518
574
  alignItems: "center"
519
575
  })
520
- ), r = x(() => a.disabled), C = x(() => a.loading), m = x(() => a.hasContent !== void 0 ? a.hasContent : !!h.value), b = x(() => ({
521
- "is-disabled": r.value,
522
- "is-loading": C.value,
523
- "has-error": !!L.value
524
- })), L = _(""), l0 = (e) => {
525
- L.value = e, setTimeout(() => L.value = "", 5e3);
526
- }, z = () => {
527
- d.value = !1, setTimeout(() => d.value = !1, 50);
528
- };
529
- return A(h, () => {
530
- g.value = !!a.suggestions && !!h.value;
531
- }), f({
576
+ ), T = x0(), l0 = S(() => {
577
+ var e;
578
+ return !!((e = T.decorativeContent) != null && e.call(T));
579
+ }), K = S(() => i.disabled || l0.value), d0 = S(() => i.loading), f0 = S(() => i.hasContent !== void 0 ? i.hasContent : !!a.value), g0 = S(() => ({
580
+ "is-disabled": K.value,
581
+ "is-loading": d0.value,
582
+ "has-error": !!Q.value,
583
+ "is-auto-switching": L.value
584
+ })), Q = b(""), y0 = (e) => {
585
+ Q.value = e, setTimeout(() => Q.value = "", 5e3);
586
+ }, C0 = () => {
587
+ v.value = !1, setTimeout(() => v.value = !1, 50);
588
+ }, i0 = S(() => i.maxLength !== 1 / 0 && a.value.length > i.maxLength);
589
+ return q(a, () => {
590
+ O.value = !!i.suggestions && !!a.value, A(M), a.value === "" && i.mode === "single" && (l.value = "single");
591
+ }), q(
592
+ () => f.value,
593
+ (e) => {
594
+ e && (l.value = "multiple");
595
+ }
596
+ ), h({
532
597
  focus: () => {
533
- if (l.value && i.value)
534
- V();
535
- else if (v.value)
536
- v.value.focus();
598
+ if (f.value && r.value)
599
+ e0();
600
+ else if (w.value)
601
+ w.value.focus();
537
602
  else {
538
603
  const e = document.querySelector(".tiny-input__inner");
539
604
  e == null || e.focus();
540
605
  }
541
606
  },
542
607
  blur: () => {
543
- if (v.value)
544
- v.value.blur();
608
+ if (w.value)
609
+ w.value.blur();
545
610
  else {
546
611
  const e = document.querySelector(".tiny-input__inner");
547
612
  e == null || e.blur();
548
613
  }
549
614
  },
550
- clear: s,
551
- submit: U,
552
- startSpeech: G,
553
- stopSpeech: W,
554
- activateTemplateFirstField: V
555
- }), (e, D) => (u(), y("div", {
556
- class: O(["tiny-sender", [b.value, `theme-${e.theme}`, `mode-${e.mode}`]]),
615
+ clear: G,
616
+ submit: y,
617
+ startSpeech: t,
618
+ stopSpeech: o,
619
+ activateTemplateFirstField: e0
620
+ }), (e, p) => (d(), C("div", {
621
+ class: z(["tiny-sender", [g0.value, `theme-${e.theme}`, `mode-${l.value}`]]),
557
622
  "data-theme": e.theme
558
623
  }, [
559
- R("div", K0, [
560
- R("div", P0, [
561
- T(Y, { name: "tiny-sender-slide-down" }, {
562
- default: B(() => [
563
- e.$slots.header ? (u(), y("div", j0, [
564
- q(e.$slots, "header")
565
- ])) : S("", !0)
624
+ B("div", e2, [
625
+ B("div", {
626
+ class: "tiny-sender__input-wrapper",
627
+ ref_key: "inputWrapperRef",
628
+ ref: s
629
+ }, [
630
+ W(a0, { name: "tiny-sender-slide-down" }, {
631
+ default: $(() => [
632
+ e.$slots.header ? (d(), C("div", t2, [
633
+ P(e.$slots, "header")
634
+ ])) : R("", !0)
566
635
  ]),
567
636
  _: 3
568
637
  }),
569
- R("div", {
570
- class: O(["tiny-sender__input-row", { "has-prefix": e.$slots.prefix, "has-header": e.$slots.header }])
638
+ B("div", {
639
+ class: z(["tiny-sender__input-row", { "has-prefix": e.$slots.prefix, "has-header": e.$slots.header }])
571
640
  }, [
572
- e.$slots.prefix ? (u(), y("div", U0, [
573
- q(e.$slots, "prefix")
574
- ])) : S("", !0),
575
- R("div", z0, [
576
- l.value ? (u(), M(T0, {
577
- key: 0,
641
+ e.$slots.prefix ? (d(), C("div", l2, [
642
+ P(e.$slots, "prefix")
643
+ ])) : R("", !0),
644
+ B("div", s2, [
645
+ e.$slots.decorativeContent ? (d(), C("div", n2, [
646
+ P(e.$slots, "decorativeContent")
647
+ ])) : R("", !0),
648
+ f.value ? (d(), V(X0, {
649
+ key: 1,
578
650
  ref_key: "templateEditorRef",
579
- ref: i,
651
+ ref: r,
580
652
  template: e.template,
581
- value: k(h),
582
- "onUpdate:value": $,
583
- onInput: $
584
- }, null, 8, ["template", "value"])) : (u(), M(k(h0), {
585
- key: 1,
653
+ value: F(a),
654
+ "onUpdate:value": H,
655
+ onInput: H
656
+ }, null, 8, ["template", "value"])) : (d(), V(F(R0), {
657
+ key: 2,
586
658
  ref_key: "inputRef",
587
- ref: v,
588
- autosize: t.value,
589
- type: "textarea",
590
- readonly: C.value,
659
+ ref: w,
660
+ autosize: e.autoSize,
661
+ type: u0.value,
662
+ readonly: d0.value,
591
663
  resize: "none",
592
- modelValue: k(h),
593
- "onUpdate:modelValue": D[0] || (D[0] = (E) => f0(h) ? h.value = E : null),
594
- disabled: r.value,
664
+ modelValue: F(a),
665
+ "onUpdate:modelValue": p[0] || (p[0] = (g) => F0(a) ? a.value = g : null),
666
+ disabled: K.value,
595
667
  placeholder: e.placeholder,
596
- maxlength: e.maxLength,
597
668
  autofocus: e.autofocus,
598
- onKeydown: k(H),
599
- onCompositionstart: D[1] || (D[1] = (E) => d.value = !0),
600
- onCompositionend: z,
601
- onFocus: N,
602
- onBlur: X
603
- }, null, 8, ["autosize", "readonly", "modelValue", "disabled", "placeholder", "maxlength", "autofocus", "onKeydown"]))
669
+ onKeydown: F(_),
670
+ onCompositionstart: p[1] || (p[1] = (g) => v.value = !0),
671
+ onCompositionend: C0,
672
+ onFocus: D,
673
+ onBlur: E
674
+ }, null, 8, ["autosize", "type", "readonly", "modelValue", "disabled", "placeholder", "autofocus", "onKeydown"]))
604
675
  ]),
605
- e.mode === "single" ? (u(), y("div", A0, [
606
- R("div", O0, [
607
- q(e.$slots, "actions"),
608
- T(o0, {
676
+ l.value === "single" ? (d(), C("div", o2, [
677
+ B("div", {
678
+ class: "tiny-sender__buttons-container",
679
+ ref_key: "buttonsContainerRef",
680
+ ref: k
681
+ }, [
682
+ P(e.$slots, "actions"),
683
+ W(m0, {
609
684
  class: "inline-buttons",
610
685
  "allow-speech": e.allowSpeech,
611
686
  "allow-files": e.allowFiles,
612
687
  loading: e.loading,
613
- disabled: r.value,
688
+ disabled: K.value,
614
689
  "show-clear": e.clearable,
615
- "has-content": m.value,
616
- "speech-status": k(K),
690
+ "has-content": f0.value,
691
+ "speech-status": F(j),
617
692
  "submit-type": e.submitType,
618
- onClear: s,
619
- onToggleSpeech: P,
620
- onSubmit: k(U),
621
- onCancel: D[2] || (D[2] = (E) => e.$emit("cancel"))
622
- }, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "onSubmit"])
623
- ])
624
- ])) : S("", !0)
693
+ "is-over-limit": i0.value,
694
+ onClear: G,
695
+ onToggleSpeech: u,
696
+ onSubmit: F(y),
697
+ onCancel: p[2] || (p[2] = (g) => e.$emit("cancel"))
698
+ }, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "is-over-limit", "onSubmit"])
699
+ ], 512)
700
+ ])) : R("", !0)
625
701
  ], 2),
626
- T(Y, { name: "tiny-sender-slide-up" }, {
627
- default: B(() => [
628
- e.$slots.footer ? (u(), y("div", G0, [
629
- q(e.$slots, "footer")
630
- ])) : e.mode !== "single" || e.showWordLimit && e.maxLength !== 1 / 0 ? (u(), y("div", {
631
- key: 1,
632
- style: p0(n.value),
702
+ W(a0, { name: "tiny-sender-slide-up" }, {
703
+ default: $(() => [
704
+ l.value === "multiple" ? (d(), C("div", {
705
+ key: 0,
706
+ style: D0(N.value),
633
707
  class: "tiny-sender__footer-slot tiny-sender__bottom-row"
634
708
  }, [
635
- e.showWordLimit && e.maxLength !== 1 / 0 ? (u(), y("div", W0, j(k(h).length) + "/" + j(e.maxLength), 1)) : S("", !0),
636
- e.mode === "multiple" ? (u(), y("div", H0, [
637
- R("div", N0, [
638
- T(o0, {
639
- "allow-speech": e.allowSpeech,
640
- "allow-files": e.allowFiles,
641
- loading: e.loading,
642
- disabled: r.value,
643
- "show-clear": e.clearable,
644
- "has-content": m.value,
645
- "speech-status": k(K),
646
- "submit-type": e.submitType,
647
- onClear: s,
648
- onToggleSpeech: P,
649
- onSubmit: k(U),
650
- onCancel: D[3] || (D[3] = (E) => e.$emit("cancel"))
651
- }, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "onSubmit"])
652
- ])
653
- ])) : S("", !0)
654
- ], 4)) : S("", !0)
709
+ B("div", i2, [
710
+ P(e.$slots, "footer-left")
711
+ ]),
712
+ B("div", a2, [
713
+ P(e.$slots, "footer-right"),
714
+ e.showWordLimit && e.maxLength !== 1 / 0 ? (d(), C("div", {
715
+ key: 0,
716
+ class: z(["tiny-sender__word-limit", { "is-over-limit": i0.value }])
717
+ }, [
718
+ B("span", r2, U(F(a).length), 1),
719
+ E0("/" + U(e.maxLength), 1)
720
+ ], 2)) : R("", !0),
721
+ l.value === "multiple" ? (d(), C("div", c2, [
722
+ B("div", u2, [
723
+ W(m0, {
724
+ "allow-speech": e.allowSpeech,
725
+ "allow-files": e.allowFiles,
726
+ loading: e.loading,
727
+ disabled: K.value,
728
+ "show-clear": e.clearable,
729
+ "has-content": f0.value,
730
+ "speech-status": F(j),
731
+ "submit-type": e.submitType,
732
+ "is-over-limit": i0.value,
733
+ onClear: G,
734
+ onToggleSpeech: u,
735
+ onSubmit: F(y),
736
+ onCancel: p[3] || (p[3] = (g) => e.$emit("cancel"))
737
+ }, null, 8, ["allow-speech", "allow-files", "loading", "disabled", "show-clear", "has-content", "speech-status", "submit-type", "is-over-limit", "onSubmit"])
738
+ ])
739
+ ])) : R("", !0)
740
+ ])
741
+ ], 4)) : e.$slots.footer ? (d(), C("div", d2, [
742
+ P(e.$slots, "footer")
743
+ ])) : R("", !0)
655
744
  ]),
656
745
  _: 3
657
746
  })
658
- ])
747
+ ], 512)
659
748
  ]),
660
- T(Y, { name: "tiny-sender-slide-up" }, {
661
- default: B(() => [
662
- g.value && F.value.length ? (u(), y("div", q0, [
663
- (u(!0), y(e0, null, n0(F.value, (E, i0) => (u(), y("div", {
664
- key: i0,
749
+ W(a0, { name: "tiny-sender-slide-up" }, {
750
+ default: $(() => [
751
+ O.value && X.value.length ? (d(), C("div", f2, [
752
+ (d(!0), C(r0, null, v0(X.value, (g, J) => (d(), C("div", {
753
+ key: J,
665
754
  class: "suggestion-item",
666
- onClick: (Y0) => I(E)
667
- }, j(E), 9, Q0))), 128))
668
- ])) : S("", !0)
755
+ onClick: (p0) => Y(g)
756
+ }, U(g), 9, p2))), 128))
757
+ ])) : R("", !0)
669
758
  ]),
670
759
  _: 1
671
760
  }),
672
- L.value ? (u(), y("div", J0, j(L.value), 1)) : S("", !0)
673
- ], 10, Z0));
761
+ Q.value ? (d(), C("div", h2, U(Q.value), 1)) : R("", !0)
762
+ ], 10, Y0));
674
763
  }
675
764
  });
676
- J.name = "TrSender";
677
- const X0 = function(o) {
678
- o.component(J.name, J);
765
+ o0.name = "TrSender";
766
+ const m2 = function(n) {
767
+ n.component(o0.name, o0);
679
768
  };
680
- J.install = X0;
769
+ o0.install = m2;
681
770
  export {
682
- J as default
771
+ o0 as default
683
772
  };