@ibiz-template-plugin/ai-chat 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -151,29 +151,29 @@ function vs(n) {
151
151
  };
152
152
  }
153
153
  function zr(n, e, t, i, r, s, o, l, a, c) {
154
- var d, u, h, f, p, m, y, v, b, w, k, S, _, M, O, I, ue, me = e.type;
154
+ var d, u, h, f, p, m, y, v, b, w, S, k, _, M, O, I, ue, me = e.type;
155
155
  if (e.constructor != null)
156
156
  return null;
157
157
  128 & t.__u && (a = !!(32 & t.__u), s = [l = e.__e = t.__e]), (d = D.__b) && d(e);
158
158
  e:
159
159
  if (typeof me == "function")
160
160
  try {
161
- if (v = e.props, b = "prototype" in me && me.prototype.render, w = (d = me.contextType) && i[d.__c], k = d ? w ? w.props.value : d.__ : i, t.__c ? y = (u = e.__c = t.__c).__ = u.__E : (b ? e.__c = u = new me(v, k) : (e.__c = u = new De(v, k), u.constructor = me, u.render = id), w && w.sub(u), u.props = v, u.state || (u.state = {}), u.context = k, u.__n = i, h = u.__d = !0, u.__h = [], u._sb = []), b && u.__s == null && (u.__s = u.state), b && me.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = je({}, u.__s)), je(u.__s, me.getDerivedStateFromProps(v, u.__s))), f = u.props, p = u.state, u.__v = e, h)
161
+ if (v = e.props, b = "prototype" in me && me.prototype.render, w = (d = me.contextType) && i[d.__c], S = d ? w ? w.props.value : d.__ : i, t.__c ? y = (u = e.__c = t.__c).__ = u.__E : (b ? e.__c = u = new me(v, S) : (e.__c = u = new De(v, S), u.constructor = me, u.render = id), w && w.sub(u), u.props = v, u.state || (u.state = {}), u.context = S, u.__n = i, h = u.__d = !0, u.__h = [], u._sb = []), b && u.__s == null && (u.__s = u.state), b && me.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = je({}, u.__s)), je(u.__s, me.getDerivedStateFromProps(v, u.__s))), f = u.props, p = u.state, u.__v = e, h)
162
162
  b && me.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), b && u.componentDidMount != null && u.__h.push(u.componentDidMount);
163
163
  else {
164
- if (b && me.getDerivedStateFromProps == null && v !== f && u.componentWillReceiveProps != null && u.componentWillReceiveProps(v, k), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(v, u.__s, k) === !1 || e.__v == t.__v) {
164
+ if (b && me.getDerivedStateFromProps == null && v !== f && u.componentWillReceiveProps != null && u.componentWillReceiveProps(v, S), !u.__e && u.shouldComponentUpdate != null && u.shouldComponentUpdate(v, u.__s, S) === !1 || e.__v == t.__v) {
165
165
  for (e.__v != t.__v && (u.props = v, u.state = u.__s, u.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(Ne) {
166
166
  Ne && (Ne.__ = e);
167
- }), S = 0; S < u._sb.length; S++)
168
- u.__h.push(u._sb[S]);
167
+ }), k = 0; k < u._sb.length; k++)
168
+ u.__h.push(u._sb[k]);
169
169
  u._sb = [], u.__h.length && o.push(u);
170
170
  break e;
171
171
  }
172
- u.componentWillUpdate != null && u.componentWillUpdate(v, u.__s, k), b && u.componentDidUpdate != null && u.__h.push(function() {
172
+ u.componentWillUpdate != null && u.componentWillUpdate(v, u.__s, S), b && u.componentDidUpdate != null && u.__h.push(function() {
173
173
  u.componentDidUpdate(f, p, m);
174
174
  });
175
175
  }
176
- if (u.context = k, u.props = v, u.__P = n, u.__e = !1, _ = D.__r, M = 0, b) {
176
+ if (u.context = S, u.props = v, u.__P = n, u.__e = !1, _ = D.__r, M = 0, b) {
177
177
  for (u.state = u.__s, u.__d = !1, _ && _(e), d = u.render(u.props, u.state, u.context), O = 0; O < u._sb.length; O++)
178
178
  u.__h.push(u._sb[O]);
179
179
  u._sb = [];
@@ -1889,7 +1889,7 @@ function F(n) {
1889
1889
  return We(n);
1890
1890
  }, []);
1891
1891
  }
1892
- function we(n) {
1892
+ function Ce(n) {
1893
1893
  var e = se(n);
1894
1894
  return e.current = n, mi.__$f |= 4, Ee(function() {
1895
1895
  return Pl(function() {
@@ -2402,8 +2402,8 @@ const nu = (n) => {
2402
2402
  c(f, p).forEach((v, b) => {
2403
2403
  const w = document.createElement("div");
2404
2404
  w.className = "code-line";
2405
- const k = document.createElement("span");
2406
- k && (k.className = "line-number", k.textContent = (b + 1).toString(), w.appendChild(k), w.innerHTML += v, m.appendChild(w));
2405
+ const S = document.createElement("span");
2406
+ S && (S.className = "line-number", S.textContent = (b + 1).toString(), w.appendChild(S), w.innerHTML += v, m.appendChild(w));
2407
2407
  });
2408
2408
  }, c = (h, f = 0) => {
2409
2409
  const p = " ".repeat(f), m = [];
@@ -2419,13 +2419,13 @@ const nu = (n) => {
2419
2419
  if (y.length === 0)
2420
2420
  return ["".concat(p, '<span class="property">{}</span>')];
2421
2421
  m.push("".concat(p, '<span class="property">{</span>')), y.forEach((v, b) => {
2422
- const w = h[v], k = b < y.length - 1 ? "," : "", S = '<span class="json-key">"'.concat(v, '":</span>');
2422
+ const w = h[v], S = b < y.length - 1 ? "," : "", k = '<span class="json-key">"'.concat(v, '":</span>');
2423
2423
  if (typeof w == "object" && w !== null) {
2424
2424
  const _ = c(w, f + 1);
2425
- m.push("".concat(p, " ").concat(S, " ").concat(_[0].trim())), _.length > 1 && (m.push(..._.slice(1, -1)), m.push("".concat(_[_.length - 1]).concat(k)));
2425
+ m.push("".concat(p, " ").concat(k, " ").concat(_[0].trim())), _.length > 1 && (m.push(..._.slice(1, -1)), m.push("".concat(_[_.length - 1]).concat(S)));
2426
2426
  } else {
2427
2427
  const _ = d(w);
2428
- m.push("".concat(p, " ").concat(S, " ").concat(_).concat(k));
2428
+ m.push("".concat(p, " ").concat(k, " ").concat(_).concat(S));
2429
2429
  }
2430
2430
  }), m.push("".concat(p, '<span class="property">}</span>'));
2431
2431
  } else
@@ -2530,7 +2530,7 @@ const iu = (n) => {
2530
2530
  K(() => {
2531
2531
  i.value = e.filter((a) => a), s.value = e.length > 4;
2532
2532
  }, [e]);
2533
- const o = we(() => s.value && !r.value ? i.value.slice(0, 4) : i.value), l = () => {
2533
+ const o = Ce(() => s.value && !r.value ? i.value.slice(0, 4) : i.value), l = () => {
2534
2534
  r.value = !r.value;
2535
2535
  };
2536
2536
  return /* @__PURE__ */ g("div", { className: "".concat(t.b()), children: [
@@ -2538,8 +2538,8 @@ const iu = (n) => {
2538
2538
  s.value && /* @__PURE__ */ g("div", { className: t.e("toggle"), onClick: l, children: r.value ? "收起工具调用" : "展开全部 ".concat(i.value.length, " 个工具调用") })
2539
2539
  ] });
2540
2540
  };
2541
- const Ce = new L("chat-select"), ru = (n) => {
2542
- var y;
2541
+ const ve = new L("chat-select"), ru = (n) => {
2542
+ var v;
2543
2543
  const {
2544
2544
  options: e,
2545
2545
  value: t,
@@ -2554,45 +2554,45 @@ const Ce = new L("chat-select"), ru = (n) => {
2554
2554
  K(() => {
2555
2555
  t !== void 0 && u(t);
2556
2556
  }, [t]);
2557
- const p = (v) => {
2558
- u(v.value), o == null || o(v.value), f(!1);
2557
+ const p = (b) => {
2558
+ u(b.value), o == null || o(b.value), f(!1);
2559
2559
  };
2560
2560
  K(() => {
2561
- const v = (b) => {
2562
- var w, k;
2563
- l || (w = c.current) != null && w.contains(b.target) || ((k = a.current) != null && k.contains(b.target) ? f((S) => !S) : f(!1));
2561
+ const b = (w) => {
2562
+ var S, k;
2563
+ l || (S = c.current) != null && S.contains(w.target) || ((k = a.current) != null && k.contains(w.target) ? f((_) => !_) : f(!1));
2564
2564
  };
2565
- return document.addEventListener("mousedown", v), () => {
2566
- document.removeEventListener("mousedown", v);
2565
+ return document.addEventListener("mousedown", b), () => {
2566
+ document.removeEventListener("mousedown", b);
2567
2567
  };
2568
2568
  }, []);
2569
- const m = ((y = e == null ? void 0 : e.find((v) => v.value === d)) == null ? void 0 : y.label) || s;
2569
+ const m = ((v = e == null ? void 0 : e.find((b) => b.value === d)) == null ? void 0 : v.label) || s, y = !!(e != null && e.length);
2570
2570
  return /* @__PURE__ */ g(
2571
2571
  "div",
2572
2572
  {
2573
- className: "".concat(Ce.b(), " ").concat(r || "", " ").concat(Ce.is("visble", h), " ").concat(Ce.is("disabled", l)),
2573
+ className: "".concat(ve.b(), " ").concat(r || "", " ").concat(ve.is("visble", h), " ").concat(ve.is("disabled", l), " ").concat(ve.is("no-options", !y)),
2574
2574
  children: [
2575
- /* @__PURE__ */ g("div", { className: Ce.e("header"), ref: a, children: [
2576
- /* @__PURE__ */ g("span", { className: Ce.em("header", "prefix"), title: "智能体", children: Yd() }),
2577
- /* @__PURE__ */ g("span", { className: Ce.em("header", "display-value"), title: m, children: m }),
2578
- /* @__PURE__ */ g(
2575
+ /* @__PURE__ */ g("div", { className: ve.e("header"), ref: a, children: [
2576
+ /* @__PURE__ */ g("span", { className: ve.em("header", "prefix"), title: "智能体", children: Yd() }),
2577
+ /* @__PURE__ */ g("span", { className: ve.em("header", "display-value"), title: m, children: m }),
2578
+ y ? /* @__PURE__ */ g(
2579
2579
  "span",
2580
2580
  {
2581
- className: "".concat(Ce.em("header", "suffix"), " ").concat(Ce.is("disabled", l)),
2581
+ className: "".concat(ve.em("header", "suffix"), " ").concat(ve.is("disabled", l)),
2582
2582
  children: Xd()
2583
2583
  }
2584
- )
2584
+ ) : null
2585
2585
  ] }),
2586
- /* @__PURE__ */ g("div", { className: Ce.e("dropdown"), ref: c, children: /* @__PURE__ */ g("ul", { className: Ce.em("dropdown", "list"), children: e == null ? void 0 : e.map((v) => /* @__PURE__ */ g(
2586
+ y ? /* @__PURE__ */ g("div", { className: ve.e("dropdown"), ref: c, children: /* @__PURE__ */ g("ul", { className: ve.em("dropdown", "list"), children: e == null ? void 0 : e.map((b) => /* @__PURE__ */ g(
2587
2587
  "li",
2588
2588
  {
2589
- className: "".concat(Ce.em("dropdown", "item"), " ").concat(Ce.is("active", v.value === d)),
2590
- title: v.label,
2591
- onClick: () => p(v),
2592
- children: v.label
2589
+ className: "".concat(ve.em("dropdown", "item"), " ").concat(ve.is("active", b.value === d)),
2590
+ title: b.label,
2591
+ onClick: () => p(b),
2592
+ children: b.label
2593
2593
  },
2594
- v.value
2595
- )) }) })
2594
+ b.value
2595
+ )) }) }) : null
2596
2596
  ]
2597
2597
  }
2598
2598
  );
@@ -2750,10 +2750,10 @@ const ht = new L("markdown-message"), ou = (n) => {
2750
2750
  ] });
2751
2751
  };
2752
2752
  const en = new L("ossfile-material"), lu = (n) => {
2753
- const e = we(() => n.material.data.name), t = we(() => n.material.metadata.size), i = we(() => {
2753
+ const e = Ce(() => n.material.data.name), t = Ce(() => n.material.metadata.size), i = Ce(() => {
2754
2754
  const s = n.material.metadata.state;
2755
2755
  return s === "successed" ? "上传成功" : s === "uploading" ? "上传中" : s === "failed" ? "上传失败" : "未知状态";
2756
- }), r = we(() => {
2756
+ }), r = Ce(() => {
2757
2757
  switch (n.material.metadata.state) {
2758
2758
  case "successed":
2759
2759
  return "#1890ff";
@@ -2783,7 +2783,7 @@ const tn = new L("common-material"), au = (n) => {
2783
2783
  var i, r, s, o;
2784
2784
  const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find(
2785
2785
  (l) => l.id === n.material.metadata.actionId
2786
- ), t = we(() => n.material.metadata.name);
2786
+ ), t = Ce(() => n.material.metadata.name);
2787
2787
  return /* @__PURE__ */ g("div", { className: tn.b(), children: [
2788
2788
  /* @__PURE__ */ g("div", { className: tn.b("left"), children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((r = e.icon) == null ? void 0 : r.showIcon) && /* @__PURE__ */ g(ze, { children: (s = e.icon) != null && s.cssClass ? /* @__PURE__ */ g("i", { className: e.icon.cssClass }) : (o = e.icon) != null && o.imagePath ? fi(e.icon.imagePath) ? /* @__PURE__ */ g(
2789
2789
  "div",
@@ -2821,7 +2821,7 @@ const $i = new L("chat-input-material-item"), Fl = (n) => {
2821
2821
  ] });
2822
2822
  };
2823
2823
  const Re = new L("user-message-question"), cu = (n) => {
2824
- const e = F(He()), t = F(null), i = F(135), r = F(!0), s = F(!1), o = se(null), l = we(() => n.message.content), a = we(() => dr.parseMixedContent(l.value));
2824
+ const e = F(He()), t = F(null), i = F(135), r = F(!0), s = F(!1), o = se(null), l = Ce(() => n.message.content), a = Ce(() => dr.parseMixedContent(l.value));
2825
2825
  return K(() => {
2826
2826
  t.value = new dl({
2827
2827
  id: e,
@@ -2913,7 +2913,7 @@ const Re = new L("user-message-question"), cu = (n) => {
2913
2913
  ] });
2914
2914
  };
2915
2915
  const On = new L("error-message"), du = (n) => {
2916
- const e = we(() => n.message.content);
2916
+ const e = Ce(() => n.message.content);
2917
2917
  return /* @__PURE__ */ g("div", { className: On.b(), children: [
2918
2918
  /* @__PURE__ */ g("div", { className: On.b("header"), children: [
2919
2919
  /* @__PURE__ */ g("div", { className: On.be("header", "caption"), children: "AI " }),
@@ -3135,12 +3135,12 @@ const ge = new L("chat-toolbar-item"), mu = (n) => {
3135
3135
  if (d(e))
3136
3136
  return /* @__PURE__ */ g(ze, {});
3137
3137
  const u = (b) => r ? !0 : typeof b.disabled == "function" ? b.disabled(t) : b.disabled === !0, h = (b) => {
3138
- var w, k, S, _;
3138
+ var w, S, k, _;
3139
3139
  if (typeof b.icon == "function")
3140
3140
  return b.icon();
3141
- if ((w = b.icon) != null && w.showIcon && ((k = b.icon) != null && k.cssClass))
3141
+ if ((w = b.icon) != null && w.showIcon && ((S = b.icon) != null && S.cssClass))
3142
3142
  return /* @__PURE__ */ g("i", { className: b.icon.cssClass });
3143
- if ((S = b.icon) != null && S.showIcon && ((_ = b.icon) != null && _.imagePath))
3143
+ if ((k = b.icon) != null && k.showIcon && ((_ = b.icon) != null && _.imagePath))
3144
3144
  return fi(b.icon.imagePath) ? /* @__PURE__ */ g(
3145
3145
  "div",
3146
3146
  {
@@ -3194,7 +3194,7 @@ const ge = new L("chat-toolbar-item"), mu = (n) => {
3194
3194
  "div",
3195
3195
  {
3196
3196
  title: b.title,
3197
- onClick: (k) => p(k, b),
3197
+ onClick: (S) => p(S, b),
3198
3198
  className: "".concat(ge.be("dropdown", "item"), " ").concat(b.customClass || "", " ").concat(ge.is("disabled", u(b))),
3199
3199
  children: [
3200
3200
  /* @__PURE__ */ g("div", { className: ge.bem("dropdown", "item", "icon"), children: h(b) }),
@@ -3400,19 +3400,19 @@ const Ds = new L("chat-messages"), Is = (n) => {
3400
3400
  return;
3401
3401
  const { scrollTop: v, scrollHeight: b, clientHeight: w } = y;
3402
3402
  v < 100 && !s && h && (o(!0), setTimeout(() => {
3403
- const S = Math.min(
3403
+ const k = Math.min(
3404
3404
  i + t,
3405
3405
  d.value.length
3406
3406
  );
3407
- r(S);
3407
+ r(k);
3408
3408
  const _ = y.scrollHeight;
3409
3409
  setTimeout(() => {
3410
3410
  const M = y.scrollHeight;
3411
3411
  y.scrollTop = M - _ + y.scrollTop, o(!1);
3412
3412
  }, 0);
3413
3413
  }, 300));
3414
- const k = b - (v + w) < 50;
3415
- a(k);
3414
+ const S = b - (v + w) < 50;
3415
+ a(S);
3416
3416
  }, m = () => {
3417
3417
  c.current = !0, a(!0);
3418
3418
  };
@@ -5188,7 +5188,7 @@ class Vu {
5188
5188
  const r = this.aiTopic.getCurrentTopicByID(
5189
5189
  e.id
5190
5190
  );
5191
- if (e.sequence = r.sequence, e.isTop = r.isTop, r && r.aiChat && r.aiChat.activeAIAgentID)
5191
+ if (r && (e.sequence = r.sequence, e.isTop = r.isTop), r && r.aiChat && r.aiChat.activeAIAgentID)
5192
5192
  t.activeAIAgentID = r.aiChat.activeAIAgentID, e.aiChat.activeAIAgentID = r.aiChat.activeAIAgentID;
5193
5193
  else if (t.aiAgentlist && t.aiAgentlist.length > 0 && !t.activeAIAgentID) {
5194
5194
  const o = t.aiAgentlist.find(
@@ -5235,8 +5235,11 @@ class Vu {
5235
5235
  extendToolbarClick: this.backupChatOptions.chatOptions.extendToolbarClick,
5236
5236
  recommendPrompt: this.backupChatOptions.chatOptions.recommendPrompt
5237
5237
  });
5238
- let i;
5239
- this.aiTopicMap.has("".concat(e.id)) ? i = this.aiTopicMap.get("".concat(e.id)) : (i = new Ws(t, this.resourceOptions), this.aiTopicMap.set("".concat(e.id), i)), this.container && (Lt(null, this.container), Lt(
5238
+ const i = new Ws(
5239
+ t,
5240
+ this.resourceOptions
5241
+ );
5242
+ this.aiTopicMap.set("".concat(e.id), i), this.container && (Lt(null, this.container), Lt(
5240
5243
  Ke(sl, {
5241
5244
  aiChat: i,
5242
5245
  aiTopic: this.aiTopic,
@@ -8270,15 +8273,15 @@ class wr {
8270
8273
  return (this.delInfo & qn) > 0;
8271
8274
  }
8272
8275
  }
8273
- class be {
8276
+ class we {
8274
8277
  /**
8275
8278
  Create a position map. The modifications to the document are
8276
8279
  represented as an array of numbers, in which each group of three
8277
8280
  represents a modified chunk as `[start, oldSize, newSize]`.
8278
8281
  */
8279
8282
  constructor(e, t = !1) {
8280
- if (this.ranges = e, this.inverted = t, !e.length && be.empty)
8281
- return be.empty;
8283
+ if (this.ranges = e, this.inverted = t, !e.length && we.empty)
8284
+ return we.empty;
8282
8285
  }
8283
8286
  /**
8284
8287
  @internal
@@ -8349,7 +8352,7 @@ class be {
8349
8352
  map positions in the post-step document to the pre-step document.
8350
8353
  */
8351
8354
  invert() {
8352
- return new be(this.ranges, !this.inverted);
8355
+ return new we(this.ranges, !this.inverted);
8353
8356
  }
8354
8357
  /**
8355
8358
  @internal
@@ -8363,10 +8366,10 @@ class be {
8363
8366
  sub-document to a larger document, or vice-versa.
8364
8367
  */
8365
8368
  static offset(e) {
8366
- return e == 0 ? be.empty : new be(e < 0 ? [0, -e, 0] : [0, 0, e]);
8369
+ return e == 0 ? we.empty : new we(e < 0 ? [0, -e, 0] : [0, 0, e]);
8367
8370
  }
8368
8371
  }
8369
- be.empty = new be([]);
8372
+ we.empty = new we([]);
8370
8373
  class bn {
8371
8374
  /**
8372
8375
  Create a new mapping with the given position maps.
@@ -8482,7 +8485,7 @@ class de {
8482
8485
  and the new document.
8483
8486
  */
8484
8487
  getMap() {
8485
- return be.empty;
8488
+ return we.empty;
8486
8489
  }
8487
8490
  /**
8488
8491
  Try to merge this step with another one, to be applied directly
@@ -8732,7 +8735,7 @@ class G extends de {
8732
8735
  return this.structure && Cr(e, this.from, this.to) ? J.fail("Structure replace would overwrite content") : J.fromReplace(e, this.from, this.to, this.slice);
8733
8736
  }
8734
8737
  getMap() {
8735
- return new be([this.from, this.to - this.from, this.slice.size]);
8738
+ return new we([this.from, this.to - this.from, this.slice.size]);
8736
8739
  }
8737
8740
  invert(e) {
8738
8741
  return new G(this.from, this.from + this.slice.size, e.slice(this.from, this.to));
@@ -8787,7 +8790,7 @@ class Q extends de {
8787
8790
  return i ? J.fromReplace(e, this.from, this.to, i) : J.fail("Content does not fit in gap");
8788
8791
  }
8789
8792
  getMap() {
8790
- return new be([
8793
+ return new we([
8791
8794
  this.from,
8792
8795
  this.gapFrom - this.from,
8793
8796
  this.insert,
@@ -9431,7 +9434,7 @@ class Ht extends de {
9431
9434
  return J.fromReplace(e, this.pos, this.pos + 1, new x(C.from(r), 0, t.isLeaf ? 0 : 1));
9432
9435
  }
9433
9436
  getMap() {
9434
- return be.empty;
9437
+ return we.empty;
9435
9438
  }
9436
9439
  invert(e) {
9437
9440
  return new Ht(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
@@ -9466,7 +9469,7 @@ class wn extends de {
9466
9469
  return J.ok(i);
9467
9470
  }
9468
9471
  getMap() {
9469
- return be.empty;
9472
+ return we.empty;
9470
9473
  }
9471
9474
  invert(e) {
9472
9475
  return new wn(this.attr, e.attrs[this.attr]);
@@ -14213,32 +14216,32 @@ function Vp(n, e, t, i, r) {
14213
14216
  return M(n, mt(13, "Enter"));
14214
14217
  });
14215
14218
  }, 20));
14216
- let w = p.start, k = p.endA, S = (M) => {
14217
- let O = M || n.state.tr.replace(w, k, c.doc.slice(p.start - c.from, p.endB - c.from));
14219
+ let w = p.start, S = p.endA, k = (M) => {
14220
+ let O = M || n.state.tr.replace(w, S, c.doc.slice(p.start - c.from, p.endB - c.from));
14218
14221
  if (c.sel) {
14219
14222
  let I = Lo(n, O.doc, c.sel);
14220
- I && !(Z && n.composing && I.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (I.head == w || I.head == O.mapping.map(k) - 1) || ye && I.empty && I.head == w) && O.setSelection(I);
14223
+ I && !(Z && n.composing && I.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (I.head == w || I.head == O.mapping.map(S) - 1) || ye && I.empty && I.head == w) && O.setSelection(I);
14221
14224
  }
14222
14225
  return s && O.setMeta("composition", s), O.scrollIntoView();
14223
14226
  }, _;
14224
14227
  if (b)
14225
14228
  if (m.pos == y.pos) {
14226
14229
  ye && ot <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Je(n), 20));
14227
- let M = S(n.state.tr.delete(w, k)), O = d.resolve(p.start).marksAcross(d.resolve(p.endA));
14230
+ let M = k(n.state.tr.delete(w, S)), O = d.resolve(p.start).marksAcross(d.resolve(p.endA));
14228
14231
  O && M.ensureMarks(O), n.dispatch(M);
14229
14232
  } else if (
14230
14233
  // Adding or removing a mark
14231
14234
  p.endA == p.endB && (_ = Hp(m.parent.content.cut(m.parentOffset, y.parentOffset), v.parent.content.cut(v.parentOffset, p.endA - v.start())))
14232
14235
  ) {
14233
- let M = S(n.state.tr);
14234
- _.type == "add" ? M.addMark(w, k, _.mark) : M.removeMark(w, k, _.mark), n.dispatch(M);
14236
+ let M = k(n.state.tr);
14237
+ _.type == "add" ? M.addMark(w, S, _.mark) : M.removeMark(w, S, _.mark), n.dispatch(M);
14235
14238
  } else if (m.parent.child(m.index()).isText && m.index() == y.index() - (y.textOffset ? 0 : 1)) {
14236
- let M = m.parent.textBetween(m.parentOffset, y.parentOffset), O = () => S(n.state.tr.insertText(M, w, k));
14237
- n.someProp("handleTextInput", (I) => I(n, w, k, M, O)) || n.dispatch(O());
14239
+ let M = m.parent.textBetween(m.parentOffset, y.parentOffset), O = () => k(n.state.tr.insertText(M, w, S));
14240
+ n.someProp("handleTextInput", (I) => I(n, w, S, M, O)) || n.dispatch(O());
14238
14241
  } else
14239
- n.dispatch(S());
14242
+ n.dispatch(k());
14240
14243
  else
14241
- n.dispatch(S());
14244
+ n.dispatch(k());
14242
14245
  }
14243
14246
  function Lo(n, e, t) {
14244
14247
  return Math.max(t.anchor, t.head) > e.content.size ? null : Yr(n, e.resolve(t.anchor), e.resolve(t.head));
@@ -15302,8 +15305,8 @@ var Cm = (n) => !("type" in n), km = (n, e, t) => ({ tr: i, dispatch: r, editor:
15302
15305
  i.insertText(m, d, u);
15303
15306
  } else {
15304
15307
  m = l;
15305
- const y = i.doc.resolve(d), v = y.node(), b = y.parentOffset === 0, w = v.isText || v.isTextblock, k = v.content.size > 0;
15306
- b && w && k && (d = Math.max(0, d - 1)), i.replaceWith(d, u, m);
15308
+ const y = i.doc.resolve(d), v = y.node(), b = y.parentOffset === 0, w = v.isText || v.isTextblock, S = v.content.size > 0;
15309
+ b && w && S && (d = Math.max(0, d - 1)), i.replaceWith(d, u, m);
15307
15310
  }
15308
15311
  t.updateSelection && wm(i, i.steps.length - 1, -1), t.applyInputRules && i.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && i.setMeta("applyPasteRules", { from: d, text: m });
15309
15312
  }
@@ -15860,8 +15863,8 @@ function Ir(n, e, t = {}) {
15860
15863
  return;
15861
15864
  const v = Math.max(f, y), b = Math.min(p, y + m.nodeSize), w = b - v;
15862
15865
  o += w, l.push(
15863
- ...m.marks.map((k) => ({
15864
- mark: k,
15866
+ ...m.marks.map((S) => ({
15867
+ mark: S,
15865
15868
  from: v,
15866
15869
  to: b
15867
15870
  }))
@@ -16082,11 +16085,11 @@ var v0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16082
16085
  const w = (
16083
16086
  // eslint-disable-next-line no-nested-ternary
16084
16087
  a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
16085
- ), k = {
16088
+ ), S = {
16086
16089
  ...Un(h, a.node().type.name, a.node().attrs),
16087
16090
  ...e
16088
- }, S = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(k)) || void 0;
16089
- v = v.append(C.from(l.createAndFill(null, S) || void 0));
16091
+ }, k = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(S)) || void 0;
16092
+ v = v.append(C.from(l.createAndFill(null, k) || void 0));
16090
16093
  const _ = a.before(a.depth - (b - 1));
16091
16094
  t.replace(_, a.after(-w), new x(v, 4 - b, 0));
16092
16095
  let M = -1;
@@ -16113,11 +16116,11 @@ var v0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16113
16116
  if (!Vt(t.doc, a.pos, 2))
16114
16117
  return !1;
16115
16118
  if (r) {
16116
- const { selection: v, storedMarks: b } = i, { splittableMarks: w } = s.extensionManager, k = b || v.$to.parentOffset && v.$from.marks();
16117
- if (t.split(a.pos, 2, y).scrollIntoView(), !k || !r)
16119
+ const { selection: v, storedMarks: b } = i, { splittableMarks: w } = s.extensionManager, S = b || v.$to.parentOffset && v.$from.marks();
16120
+ if (t.split(a.pos, 2, y).scrollIntoView(), !S || !r)
16118
16121
  return !0;
16119
- const S = k.filter((_) => w.includes(_.type.name));
16120
- t.ensureMarks(S);
16122
+ const k = S.filter((_) => w.includes(_.type.name));
16123
+ t.ensureMarks(k);
16121
16124
  }
16122
16125
  return !0;
16123
16126
  }, nr = (n, e) => {
@@ -16139,18 +16142,18 @@ var v0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16139
16142
  const r = n.doc.nodeAt(i);
16140
16143
  return t.node.type === (r == null ? void 0 : r.type) && At(n.doc, i) && n.join(i), !0;
16141
16144
  }, w0 = (n, e, t, i = {}) => ({ editor: r, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
16142
- const { extensions: u, splittableMarks: h } = r.extensionManager, f = te(n, o.schema), p = te(e, o.schema), { selection: m, storedMarks: y } = o, { $from: v, $to: b } = m, w = v.blockRange(b), k = y || m.$to.parentOffset && m.$from.marks();
16145
+ const { extensions: u, splittableMarks: h } = r.extensionManager, f = te(n, o.schema), p = te(e, o.schema), { selection: m, storedMarks: y } = o, { $from: v, $to: b } = m, w = v.blockRange(b), S = y || m.$to.parentOffset && m.$from.marks();
16143
16146
  if (!w)
16144
16147
  return !1;
16145
- const S = ss((_) => Go(_.type.name, u))(m);
16146
- if (w.depth >= 1 && S && w.depth - S.depth <= 1) {
16147
- if (S.node.type === f)
16148
+ const k = ss((_) => Go(_.type.name, u))(m);
16149
+ if (w.depth >= 1 && k && w.depth - k.depth <= 1) {
16150
+ if (k.node.type === f)
16148
16151
  return c.liftListItem(p);
16149
- if (Go(S.node.type.name, u) && f.validContent(S.node.content) && l)
16150
- return a().command(() => (s.setNodeMarkup(S.pos, f), !0)).command(() => nr(s, f)).command(() => ir(s, f)).run();
16152
+ if (Go(k.node.type.name, u) && f.validContent(k.node.content) && l)
16153
+ return a().command(() => (s.setNodeMarkup(k.pos, f), !0)).command(() => nr(s, f)).command(() => ir(s, f)).run();
16151
16154
  }
16152
- return !t || !k || !l ? a().command(() => d().wrapInList(f, i) ? !0 : c.clearNodes()).wrapInList(f, i).command(() => nr(s, f)).command(() => ir(s, f)).run() : a().command(() => {
16153
- const _ = d().wrapInList(f, i), M = k.filter((O) => h.includes(O.type.name));
16155
+ return !t || !S || !l ? a().command(() => d().wrapInList(f, i) ? !0 : c.clearNodes()).wrapInList(f, i).command(() => nr(s, f)).command(() => ir(s, f)).run() : a().command(() => {
16156
+ const _ = d().wrapInList(f, i), M = S.filter((O) => h.includes(O.type.name));
16154
16157
  return s.ensureMarks(M), _ ? !0 : c.clearNodes();
16155
16158
  }).wrapInList(f, i).command(() => nr(s, f)).command(() => ir(s, f)).run();
16156
16159
  }, C0 = (n, e = {}, t = {}) => ({ state: i, commands: r }) => {
@@ -16232,10 +16235,10 @@ var v0 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16232
16235
  ...e
16233
16236
  })), o && y.marks.length && y.marks.forEach((b) => {
16234
16237
  if (o === b.type && (a = !0, r)) {
16235
- const w = Math.max(v, d), k = Math.min(v + y.nodeSize, u);
16238
+ const w = Math.max(v, d), S = Math.min(v + y.nodeSize, u);
16236
16239
  t.addMark(
16237
16240
  w,
16238
- k,
16241
+ S,
16239
16242
  o.create({
16240
16243
  ...b.attrs,
16241
16244
  ...e
@@ -16519,14 +16522,14 @@ function B0(n) {
16519
16522
  var m, y, v, b, w;
16520
16523
  if ((y = (m = f.type) == null ? void 0 : m.spec) != null && y.code || !(f.isText || f.isTextblock || f.isInline))
16521
16524
  return;
16522
- const k = (w = (b = (v = f.content) == null ? void 0 : v.size) != null ? b : f.nodeSize) != null ? w : 0, S = Math.max(i, p), _ = Math.min(r, p + k);
16523
- if (S >= _)
16525
+ const S = (w = (b = (v = f.content) == null ? void 0 : v.size) != null ? b : f.nodeSize) != null ? w : 0, k = Math.max(i, p), _ = Math.min(r, p + S);
16526
+ if (k >= _)
16524
16527
  return;
16525
- const M = f.isText ? f.text || "" : f.textBetween(S - p, _ - p, void 0, "");
16528
+ const M = f.isText ? f.text || "" : f.textBetween(k - p, _ - p, void 0, "");
16526
16529
  L0(M, s.find, o).forEach((I) => {
16527
16530
  if (I.index === void 0)
16528
16531
  return;
16529
- const ue = S + I.index + 1, me = ue + I[0].length, Ne = {
16532
+ const ue = k + I.index + 1, me = ue + I[0].length, Ne = {
16530
16533
  from: t.tr.mapping.map(ue),
16531
16534
  to: t.tr.mapping.map(me)
16532
16535
  }, Ai = s.handler({
@@ -16625,9 +16628,9 @@ function V0(n) {
16625
16628
  if (!m && !y && !b)
16626
16629
  return;
16627
16630
  if (b) {
16628
- let { text: S } = v;
16629
- typeof S == "string" ? S = S : S = as(C.from(S), f.schema);
16630
- const { from: _ } = v, M = _ + S.length, O = F0(S);
16631
+ let { text: k } = v;
16632
+ typeof k == "string" ? k = k : k = as(C.from(k), f.schema);
16633
+ const { from: _ } = v, M = _ + k.length, O = F0(k);
16631
16634
  return a({
16632
16635
  rule: d,
16633
16636
  state: f,
@@ -16636,13 +16639,13 @@ function V0(n) {
16636
16639
  pasteEvt: O
16637
16640
  });
16638
16641
  }
16639
- const w = h.doc.content.findDiffStart(f.doc.content), k = h.doc.content.findDiffEnd(f.doc.content);
16640
- if (!(!$0(w) || !k || w === k.b))
16642
+ const w = h.doc.content.findDiffStart(f.doc.content), S = h.doc.content.findDiffEnd(f.doc.content);
16643
+ if (!(!$0(w) || !S || w === S.b))
16641
16644
  return a({
16642
16645
  rule: d,
16643
16646
  state: f,
16644
16647
  from: w,
16645
- to: k,
16648
+ to: S,
16646
16649
  pasteEvt: o
16647
16650
  });
16648
16651
  }
@@ -16933,7 +16936,7 @@ var X = class Dc extends us {
16933
16936
  d.steps.forEach((f, p) => {
16934
16937
  var m, y;
16935
16938
  if (f instanceof Oe) {
16936
- const v = h.slice(p).map(f.from, -1), b = h.slice(p).map(f.to), w = h.invert().map(v, -1), k = h.invert().map(b), S = (m = d.doc.nodeAt(v - 1)) == null ? void 0 : m.marks.some((M) => M.eq(f.mark)), _ = (y = d.doc.nodeAt(b)) == null ? void 0 : y.marks.some((M) => M.eq(f.mark));
16939
+ const v = h.slice(p).map(f.from, -1), b = h.slice(p).map(f.to), w = h.invert().map(v, -1), S = h.invert().map(b), k = (m = d.doc.nodeAt(v - 1)) == null ? void 0 : m.marks.some((M) => M.eq(f.mark)), _ = (y = d.doc.nodeAt(b)) == null ? void 0 : y.marks.some((M) => M.eq(f.mark));
16937
16940
  this.editor.emit("delete", {
16938
16941
  type: "mark",
16939
16942
  mark: f.mark,
@@ -16941,13 +16944,13 @@ var X = class Dc extends us {
16941
16944
  to: f.to,
16942
16945
  deletedRange: {
16943
16946
  from: w,
16944
- to: k
16947
+ to: S
16945
16948
  },
16946
16949
  newRange: {
16947
16950
  from: v,
16948
16951
  to: b
16949
16952
  },
16950
- partial: !!(_ || S),
16953
+ partial: !!(_ || k),
16951
16954
  editor: this.editor,
16952
16955
  transaction: n,
16953
16956
  combinedTransform: d
@@ -18127,10 +18130,10 @@ function Z0(n) {
18127
18130
  if (!y)
18128
18131
  return;
18129
18132
  const [v, b = ""] = y, w = r(b);
18130
- let k = 1;
18131
- const S = v.length;
18133
+ let S = 1;
18134
+ const k = v.length;
18132
18135
  let _ = "";
18133
- const M = /^:::([\w-]*)(\s.*)?/gm, O = u.slice(S);
18136
+ const M = /^:::([\w-]*)(\s.*)?/gm, O = u.slice(k);
18134
18137
  for (M.lastIndex = 0; ; ) {
18135
18138
  const I = M.exec(O);
18136
18139
  if (I === null)
@@ -18138,11 +18141,11 @@ function Z0(n) {
18138
18141
  const ue = I.index, me = I[1];
18139
18142
  if (!((p = I[2]) != null && p.endsWith(":::"))) {
18140
18143
  if (me)
18141
- k += 1;
18142
- else if (k -= 1, k === 0) {
18144
+ S += 1;
18145
+ else if (S -= 1, S === 0) {
18143
18146
  const Ne = O.slice(0, ue);
18144
18147
  _ = Ne.trim();
18145
- const Ai = u.slice(0, S + ue + I[0].length);
18148
+ const Ai = u.slice(0, k + ue + I[0].length);
18146
18149
  let Xe = [];
18147
18150
  if (_)
18148
18151
  if (l === "block")
@@ -18228,11 +18231,11 @@ function t1(n) {
18228
18231
  return;
18229
18232
  let v = "", b = "";
18230
18233
  if (l) {
18231
- const [, k] = y;
18232
- b = k;
18234
+ const [, S] = y;
18235
+ b = S;
18233
18236
  } else {
18234
- const [, k, S] = y;
18235
- b = k, v = S || "";
18237
+ const [, S, k] = y;
18238
+ b = S, v = k || "";
18236
18239
  }
18237
18240
  const w = r(b.trim());
18238
18241
  return {
@@ -18271,30 +18274,30 @@ function n1(n, e, t) {
18271
18274
  c = "".concat(c).concat(h, "\n");
18272
18275
  const v = [y];
18273
18276
  for (d += 1; d < l.length; ) {
18274
- const S = l[d];
18275
- if (S.trim() === "") {
18277
+ const k = l[d];
18278
+ if (k.trim() === "") {
18276
18279
  const M = l.slice(d + 1).findIndex((ue) => ue.trim() !== "");
18277
18280
  if (M === -1)
18278
18281
  break;
18279
18282
  if ((((r = (i = l[d + 1 + M].match(/^(\s*)/)) == null ? void 0 : i[1]) == null ? void 0 : r.length) || 0) > m) {
18280
- v.push(S), c = "".concat(c).concat(S, "\n"), d += 1;
18283
+ v.push(k), c = "".concat(c).concat(k, "\n"), d += 1;
18281
18284
  continue;
18282
18285
  } else
18283
18286
  break;
18284
18287
  }
18285
- if ((((o = (s = S.match(/^(\s*)/)) == null ? void 0 : s[1]) == null ? void 0 : o.length) || 0) > m)
18286
- v.push(S), c = "".concat(c).concat(S, "\n"), d += 1;
18288
+ if ((((o = (s = k.match(/^(\s*)/)) == null ? void 0 : s[1]) == null ? void 0 : o.length) || 0) > m)
18289
+ v.push(k), c = "".concat(c).concat(k, "\n"), d += 1;
18287
18290
  else
18288
18291
  break;
18289
18292
  }
18290
18293
  let b;
18291
18294
  const w = v.slice(1);
18292
18295
  if (w.length > 0) {
18293
- const S = w.map((_) => _.slice(m + u)).join("\n");
18294
- S.trim() && (e.customNestedParser ? b = e.customNestedParser(S) : b = t.blockTokens(S));
18296
+ const k = w.map((_) => _.slice(m + u)).join("\n");
18297
+ k.trim() && (e.customNestedParser ? b = e.customNestedParser(k) : b = t.blockTokens(k));
18295
18298
  }
18296
- const k = e.createToken(p, b);
18297
- a.push(k);
18299
+ const S = e.createToken(p, b);
18300
+ a.push(S);
18298
18301
  }
18299
18302
  if (a.length !== 0)
18300
18303
  return {
@@ -19589,20 +19592,20 @@ const j = new L("chat-input"), il = window.SpeechRecognition || window.webkitSpe
19589
19592
  }, s.current.onend = () => {
19590
19593
  r.value = !1;
19591
19594
  }, s.current.onresult = (v) => {
19592
- var w, k, S, _;
19593
- const b = (S = (k = (w = v.results) == null ? void 0 : w[0]) == null ? void 0 : k[0]) == null ? void 0 : S.transcript;
19595
+ var w, S, k, _;
19596
+ const b = (k = (S = (w = v.results) == null ? void 0 : w[0]) == null ? void 0 : S[0]) == null ? void 0 : k.transcript;
19594
19597
  b && ((_ = o.current) == null || _.commands.insertContent(b));
19595
19598
  });
19596
19599
  const l = () => {
19597
19600
  s.current && !r.value && s.current.start();
19598
19601
  }, a = (v) => {
19599
19602
  const b = new DOMParser().parseFromString(v, "text/html");
19600
- function w(S) {
19601
- if (S.nodeType === Node.TEXT_NODE)
19602
- return S.textContent || "";
19603
- if (S.nodeType !== Node.ELEMENT_NODE)
19603
+ function w(k) {
19604
+ if (k.nodeType === Node.TEXT_NODE)
19605
+ return k.textContent || "";
19606
+ if (k.nodeType !== Node.ELEMENT_NODE)
19604
19607
  return "";
19605
- const _ = S, M = _.tagName.toLowerCase(), O = Array.from(_.childNodes).map((I) => w(I)).join("");
19608
+ const _ = k, M = _.tagName.toLowerCase(), O = Array.from(_.childNodes).map((I) => w(I)).join("");
19606
19609
  switch (M) {
19607
19610
  case "p":
19608
19611
  return "".concat(O, "\n");
@@ -19611,11 +19614,11 @@ const j = new L("chat-input"), il = window.SpeechRecognition || window.webkitSpe
19611
19614
  return I ? "\n![".concat(ue, "](").concat(I, ")\n") : "";
19612
19615
  }
19613
19616
  default:
19614
- return S.textContent || "";
19617
+ return k.textContent || "";
19615
19618
  }
19616
19619
  }
19617
19620
  return Array.from(b.body.childNodes).map(w).join("").replace(/\n+/g, "\n").replace(/^\n|\n$/g, "");
19618
- }, c = we(() => a(i.value).length <= 0), d = Ts(async () => {
19621
+ }, c = Ce(() => a(i.value).length <= 0), d = Ts(async () => {
19619
19622
  var v;
19620
19623
  try {
19621
19624
  const b = a(i.value);
@@ -19705,16 +19708,16 @@ const j = new L("chat-input"), il = window.SpeechRecognition || window.webkitSpe
19705
19708
  }
19706
19709
  ),
19707
19710
  (y = n.questionToolbarItems) == null ? void 0 : y.map((v) => {
19708
- var b, w, k;
19711
+ var b, w, S;
19709
19712
  return /* @__PURE__ */ g(
19710
19713
  "div",
19711
19714
  {
19712
19715
  className: j.b("pop-action-item"),
19713
- onClick: (S) => {
19714
- p(S, v);
19716
+ onClick: (k) => {
19717
+ p(k, v);
19715
19718
  },
19716
19719
  children: [
19717
- /* @__PURE__ */ g("span", { className: j.b("pop-action-item-icon"), children: typeof v.icon == "function" ? v.icon() : ((b = v.icon) == null ? void 0 : b.showIcon) && /* @__PURE__ */ g(ze, { children: (w = v.icon) != null && w.cssClass ? /* @__PURE__ */ g("i", { className: v.icon.cssClass }) : (k = v.icon) != null && k.imagePath ? fi(v.icon.imagePath) ? /* @__PURE__ */ g(
19720
+ /* @__PURE__ */ g("span", { className: j.b("pop-action-item-icon"), children: typeof v.icon == "function" ? v.icon() : ((b = v.icon) == null ? void 0 : b.showIcon) && /* @__PURE__ */ g(ze, { children: (w = v.icon) != null && w.cssClass ? /* @__PURE__ */ g("i", { className: v.icon.cssClass }) : (S = v.icon) != null && S.imagePath ? fi(v.icon.imagePath) ? /* @__PURE__ */ g(
19718
19721
  "div",
19719
19722
  {
19720
19723
  dangerouslySetInnerHTML: {
@@ -19774,8 +19777,8 @@ const j = new L("chat-input"), il = window.SpeechRecognition || window.webkitSpe
19774
19777
  ] })
19775
19778
  ] });
19776
19779
  };
19777
- const ve = new L("chat-topic-item"), $1 = (n) => {
19778
- const { controller: e, topic: t, onClick: i, onAction: r } = n, s = se(null), o = we(() => {
19780
+ const be = new L("chat-topic-item"), $1 = (n) => {
19781
+ const { controller: e, topic: t, onClick: i, onAction: r } = n, s = se(null), o = Ce(() => {
19779
19782
  var y;
19780
19783
  return ((y = e.activedTopic.value) == null ? void 0 : y.id) === t.id;
19781
19784
  }), [l, a] = xe(!1), c = F(!1), d = (m) => {
@@ -19796,13 +19799,13 @@ const ve = new L("chat-topic-item"), $1 = (n) => {
19796
19799
  return /* @__PURE__ */ g(
19797
19800
  "div",
19798
19801
  {
19799
- className: "".concat(ve.b(), " ").concat(ve.is("active", o.value), " ").concat(ve.is(
19802
+ className: "".concat(be.b(), " ").concat(be.is("active", o.value), " ").concat(be.is(
19800
19803
  "edit",
19801
19804
  c.value
19802
19805
  )),
19803
19806
  onClick: i.bind(void 0),
19804
19807
  children: [
19805
- /* @__PURE__ */ g("div", { className: ve.e("caption"), title: t.caption, children: c.value ? /* @__PURE__ */ g(
19808
+ /* @__PURE__ */ g("div", { className: be.e("caption"), title: t.caption, children: c.value ? /* @__PURE__ */ g(
19806
19809
  "input",
19807
19810
  {
19808
19811
  ref: s,
@@ -19811,20 +19814,20 @@ const ve = new L("chat-topic-item"), $1 = (n) => {
19811
19814
  onKeyDown: p,
19812
19815
  onClick: (m) => m.stopPropagation(),
19813
19816
  onChange: (m) => h(m),
19814
- className: ve.em("caption", "editor")
19817
+ className: be.em("caption", "editor")
19815
19818
  }
19816
- ) : /* @__PURE__ */ g("div", { className: ve.em("caption", "readonly"), children: [
19817
- /* @__PURE__ */ g("span", { className: ve.em("caption", "text"), children: t.caption }),
19818
- t.isTop ? /* @__PURE__ */ g("span", { className: ve.em("caption", "icon"), children: /* @__PURE__ */ g(As, {}) }) : null
19819
+ ) : /* @__PURE__ */ g("div", { className: be.em("caption", "readonly"), children: [
19820
+ /* @__PURE__ */ g("span", { className: be.em("caption", "text"), children: t.caption }),
19821
+ t.isTop ? /* @__PURE__ */ g("span", { className: be.em("caption", "icon"), children: /* @__PURE__ */ g(As, {}) }) : null
19819
19822
  ] }) }),
19820
- !c.value && /* @__PURE__ */ g("div", { className: ve.e("icon"), children: [
19823
+ !c.value && /* @__PURE__ */ g("div", { className: be.e("icon"), children: [
19821
19824
  /* @__PURE__ */ g(
19822
19825
  "span",
19823
19826
  {
19824
19827
  title: "跳转主视图",
19825
- className: ve.em("icon", "item"),
19828
+ className: be.em("icon", "item"),
19826
19829
  onClick: d.bind(void 0),
19827
- children: /* @__PURE__ */ g($d, { className: ve.b("link-icon") })
19830
+ children: /* @__PURE__ */ g($d, { className: be.b("link-icon") })
19828
19831
  }
19829
19832
  ),
19830
19833
  o.value ? null : /* @__PURE__ */ g(
@@ -19843,7 +19846,7 @@ const ve = new L("chat-topic-item"), $1 = (n) => {
19843
19846
  isOpen: l,
19844
19847
  onToggleOpen: a,
19845
19848
  onAction: u.bind(void 0),
19846
- children: /* @__PURE__ */ g("span", { className: ve.em("icon", "item"), title: "更多", children: /* @__PURE__ */ g(zd, { className: ve.e("more-icon") }) })
19849
+ children: /* @__PURE__ */ g("span", { className: be.em("icon", "item"), title: "更多", children: /* @__PURE__ */ g(zd, { className: be.e("more-icon") }) })
19847
19850
  }
19848
19851
  )
19849
19852
  ] })
@@ -19945,14 +19948,14 @@ const Rt = new L("chat-minimize"), F1 = (n) => {
19945
19948
  const e = se(null), [t, i] = xe(""), [r, s] = xe(0), o = se(!1), l = {
19946
19949
  x: (window.innerWidth - 86) / window.innerWidth,
19947
19950
  y: (window.innerHeight - 86) / window.innerHeight
19948
- }, a = we(() => {
19951
+ }, a = Ce(() => {
19949
19952
  const p = n.controller.messages.value[n.controller.messages.value.length - 1];
19950
19953
  return p ? p.role === "ASSISTANT" && p.state === 20 && p.completed !== !0 : !1;
19951
19954
  }), c = (p) => {
19952
19955
  const m = p.indexOf("<think>"), y = p.indexOf("</think>");
19953
19956
  let v = "", b = "";
19954
19957
  return y === -1 ? (v = p.slice(m + 7), b = "") : (v = p.slice(m + 7, y), b = p.slice(y + 8)), { thoughtContent: v, answerContent: b };
19955
- }, d = we(() => {
19958
+ }, d = Ce(() => {
19956
19959
  let p = "";
19957
19960
  if (!a.value)
19958
19961
  return i(""), s(0), p;
@@ -19976,21 +19979,21 @@ const Rt = new L("chat-minimize"), F1 = (n) => {
19976
19979
  const p = e.current;
19977
19980
  p && (p.onmousedown = (m) => {
19978
19981
  document.body.style.userSelect = "none";
19979
- const y = m.clientX - p.offsetLeft, v = m.clientY - p.offsetTop, b = Date.now(), w = (S) => {
19982
+ const y = m.clientX - p.offsetLeft, v = m.clientY - p.offsetTop, b = Date.now(), w = (k) => {
19980
19983
  const _ = 56 / window.innerWidth, M = 56 / window.innerHeight, { x: O, y: I } = _l(
19981
- S.clientX - y,
19982
- S.clientY - v,
19984
+ k.clientX - y,
19985
+ k.clientY - v,
19983
19986
  _,
19984
19987
  M
19985
19988
  );
19986
19989
  Object.assign(l, { x: O, y: I }), requestAnimationFrame(() => {
19987
19990
  u();
19988
19991
  });
19989
- }, k = () => {
19990
- const S = Date.now();
19991
- o.current = S - b > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", k);
19992
+ }, S = () => {
19993
+ const k = Date.now();
19994
+ o.current = k - b > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", S);
19992
19995
  };
19993
- document.addEventListener("mousemove", w), document.addEventListener("mouseup", k);
19996
+ document.addEventListener("mousemove", w), document.addEventListener("mouseup", S);
19994
19997
  });
19995
19998
  }, f = () => {
19996
19999
  o.current || n.onClick();