ai-client-sdk 3.0.5 → 3.0.7

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/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
  ## Features
6
6
 
7
7
  - 兼容多种大模型
8
- - AI 聊天面板
8
+ - AI 对话界面
9
9
  - 配置系统消息
10
- - 接入自定义工具函数(Function Calling,将 AI 聊天与业务逻辑相结合)
10
+ - 接入自定义工具函数(Function Calling,将 AI 对话与业务逻辑相结合)
11
11
  - 提供一些常用的工具函数(如解析中文语境的相对时间),开发者可按需使用
12
12
  - 纯原生实现,技术栈无关,适配任意前端框架(React、Vue 等)及纯 HTML 页面
13
13
  - 封装了与大模型交互的基础工具类(Agent class),开发者可基于此构建灵活的工作流
@@ -48,9 +48,9 @@ npm run build
48
48
 
49
49
  ## 快速开始
50
50
 
51
- ### 初始化 AI 聊天面板
51
+ ### 初始化 AI 对话界面
52
52
 
53
- 实例化 `AIChatPanel` 把 Web 端的 AI 聊天面板挂载到指定容器。
53
+ 实例化 `AIChatPanel` 把 Web 端的 AI 对话界面挂载到指定容器。
54
54
 
55
55
  ### 示例
56
56
 
@@ -65,7 +65,7 @@ const panel = new AIChatPanel({container});
65
65
 
66
66
  | Parameter | Type | Required | Description |
67
67
  | ----------- | --------------------- | :------: | ----------------------- |
68
- | `container` | `HTMLElement \| null` | Y | 聊天面板挂载的 DOM 容器 |
68
+ | `container` | `HTMLElement \| null` | Y | 对话界面挂载的 DOM 容器 |
69
69
 
70
70
  ### 注意事项
71
71
 
@@ -1392,7 +1392,7 @@ function Hu(e, t) {
1392
1392
  function bt(e) {
1393
1393
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
1394
1394
  }
1395
- const Ye = Ut(/[A-Za-z]/), Ue = Ut(/[\dA-Za-z]/), wd = Ut(/[#-'*+\--9=?A-Z^-~]/);
1395
+ const Ye = qt(/[A-Za-z]/), Ue = qt(/[\dA-Za-z]/), wd = qt(/[#-'*+\--9=?A-Z^-~]/);
1396
1396
  function di(e) {
1397
1397
  return (
1398
1398
  // Special whitespace codes (which have negative values), C0 and Control
@@ -1400,7 +1400,7 @@ function di(e) {
1400
1400
  e !== null && (e < 32 || e === 127)
1401
1401
  );
1402
1402
  }
1403
- const Bs = Ut(/\d/), _d = Ut(/[\dA-Fa-f]/), vd = Ut(/[!-/:-@[-`{-~]/);
1403
+ const Bs = qt(/\d/), _d = qt(/[\dA-Fa-f]/), vd = qt(/[!-/:-@[-`{-~]/);
1404
1404
  function ie(e) {
1405
1405
  return e !== null && e < -2;
1406
1406
  }
@@ -1410,8 +1410,8 @@ function we(e) {
1410
1410
  function de(e) {
1411
1411
  return e === -2 || e === -1 || e === 32;
1412
1412
  }
1413
- const Ei = Ut(new RegExp("\\p{P}|\\p{S}", "u")), Qt = Ut(/\s/);
1414
- function Ut(e) {
1413
+ const Ei = qt(new RegExp("\\p{P}|\\p{S}", "u")), Qt = qt(/\s/);
1414
+ function qt(e) {
1415
1415
  return t;
1416
1416
  function t(n) {
1417
1417
  return n !== null && n > -1 && e.test(String.fromCharCode(n));
@@ -5543,9 +5543,9 @@ function rg() {
5543
5543
  text: xt
5544
5544
  };
5545
5545
  }
5546
- let Vt = 48;
5547
- for (; Vt < 123; )
5548
- xt[Vt] = It, Vt++, Vt === 58 ? Vt = 65 : Vt === 91 && (Vt = 97);
5546
+ let Wt = 48;
5547
+ for (; Wt < 123; )
5548
+ xt[Wt] = It, Wt++, Wt === 58 ? Wt = 65 : Wt === 91 && (Wt = 97);
5549
5549
  xt[43] = It;
5550
5550
  xt[45] = It;
5551
5551
  xt[46] = It;
@@ -9186,7 +9186,7 @@ function Jc() {
9186
9186
  } catch {
9187
9187
  y($);
9188
9188
  }
9189
- }, Bt = function($, W) {
9189
+ }, Vt = function($, W) {
9190
9190
  try {
9191
9191
  An(t.removed, {
9192
9192
  attribute: W.getAttributeNode($),
@@ -9334,22 +9334,22 @@ function Jc() {
9334
9334
  value: $t
9335
9335
  } = ze, an = Ne(Ce), Gi = $t;
9336
9336
  let Le = Ce === "value" ? Gi : B0(Gi);
9337
- if (te.attrName = an, te.attrValue = Le, te.keepAttr = !0, te.forceKeepAttr = void 0, Dt(C.uponSanitizeAttribute, $, te), Le = te.attrValue, pt && (an === "id" || an === "name") && (Bt(Ce, $), Le = je + Le), G && Be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, Le)) {
9338
- Bt(Ce, $);
9337
+ if (te.attrName = an, te.attrValue = Le, te.keepAttr = !0, te.forceKeepAttr = void 0, Dt(C.uponSanitizeAttribute, $, te), Le = te.attrValue, pt && (an === "id" || an === "name") && (Vt(Ce, $), Le = je + Le), G && Be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, Le)) {
9338
+ Vt(Ce, $);
9339
9339
  continue;
9340
9340
  }
9341
9341
  if (an === "attributename" && hs(Le, "href")) {
9342
- Bt(Ce, $);
9342
+ Vt(Ce, $);
9343
9343
  continue;
9344
9344
  }
9345
9345
  if (te.forceKeepAttr)
9346
9346
  continue;
9347
9347
  if (!te.keepAttr) {
9348
- Bt(Ce, $);
9348
+ Vt(Ce, $);
9349
9349
  continue;
9350
9350
  }
9351
9351
  if (!R && Be(/\/>/i, Le)) {
9352
- Bt(Ce, $);
9352
+ Vt(Ce, $);
9353
9353
  continue;
9354
9354
  }
9355
9355
  z && ir([U, K, H], (Wa) => {
@@ -9357,7 +9357,7 @@ function Jc() {
9357
9357
  });
9358
9358
  const Va = Ne($.nodeName);
9359
9359
  if (!qa(Va, an, Le)) {
9360
- Bt(Ce, $);
9360
+ Vt(Ce, $);
9361
9361
  continue;
9362
9362
  }
9363
9363
  if (S && typeof d == "object" && typeof d.getAttributeType == "function" && !Qe)
@@ -9375,7 +9375,7 @@ function Jc() {
9375
9375
  try {
9376
9376
  Qe ? $.setAttributeNS(Qe, Ce, Le) : $.setAttribute(Ce, Le), Yi($) ? kt($) : No(t.removed);
9377
9377
  } catch {
9378
- Bt(Ce, $);
9378
+ Vt(Ce, $);
9379
9379
  }
9380
9380
  }
9381
9381
  Dt(C.afterSanitizeAttributes, $, null);
@@ -9458,7 +9458,7 @@ async function Uo(e) {
9458
9458
  const t = await fd().use(gp).use(Ng).use(vy, { allowDangerousHtml: !0 }).use(L0, { allowDangerousHtml: !0 }).process(e), n = String(t);
9459
9459
  return sb.sanitize(n);
9460
9460
  }
9461
- let Zt = null;
9461
+ let Jt = null;
9462
9462
  const ab = {
9463
9463
  userInputContainer: "user-input-container",
9464
9464
  userInput: "user-input",
@@ -9468,16 +9468,16 @@ const ab = {
9468
9468
  createButton: "create-button"
9469
9469
  };
9470
9470
  function ob(e) {
9471
- if (Zt) return Zt;
9472
- Zt = {}, Zt.root = e;
9471
+ if (Jt) return Jt;
9472
+ Jt = {}, Jt.root = e;
9473
9473
  for (const [t, n] of Object.entries(ab)) {
9474
9474
  const r = e.getElementById(n);
9475
- r || console.warn(`Element with id '${n}' not found`), Zt[t] = r;
9475
+ r || console.warn(`Element with id '${n}' not found`), Jt[t] = r;
9476
9476
  }
9477
- return Zt;
9477
+ return Jt;
9478
9478
  }
9479
9479
  function We() {
9480
- return Zt;
9480
+ return Jt;
9481
9481
  }
9482
9482
  class lb {
9483
9483
  #n = {
@@ -9619,11 +9619,11 @@ class lb {
9619
9619
  }), this.#e.observe(r);
9620
9620
  }
9621
9621
  }
9622
- const Jt = {
9622
+ const Ut = {
9623
9623
  get value() {
9624
9624
  return We().userInput.value.trim();
9625
9625
  },
9626
- set value(e) {
9626
+ setValue(e) {
9627
9627
  const t = We();
9628
9628
  t.userInput.value = e;
9629
9629
  },
@@ -9640,7 +9640,7 @@ const Jt = {
9640
9640
  const { submitIcon: e, stopIcon: t } = We();
9641
9641
  e.style.display = "flex", t.style.display = "none";
9642
9642
  },
9643
- // 聊天状态:只显示停止按钮
9643
+ // 对话状态:只显示停止按钮
9644
9644
  chatting() {
9645
9645
  const { submitIcon: e, stopIcon: t } = We();
9646
9646
  e.style.display = "none", t.style.display = "flex";
@@ -9655,7 +9655,7 @@ const Jt = {
9655
9655
  });
9656
9656
  }
9657
9657
  }, ot = new lb();
9658
- var ar = { exports: {} }, bs = {}, Ot = {}, Wt = {}, ws = {}, _s = {}, vs = {}, qo;
9658
+ var ar = { exports: {} }, bs = {}, Ot = {}, Yt = {}, ws = {}, _s = {}, vs = {}, qo;
9659
9659
  function yi() {
9660
9660
  return qo || (qo = 1, (function(e) {
9661
9661
  Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
@@ -10605,7 +10605,7 @@ function me() {
10605
10605
  return ce.checkStrictMode = S, ce;
10606
10606
  }
10607
10607
  var or = {}, Yo;
10608
- function qt() {
10608
+ function Ht() {
10609
10609
  if (Yo) return or;
10610
10610
  Yo = 1, Object.defineProperty(or, "__esModule", { value: !0 });
10611
10611
  const e = /* @__PURE__ */ he(), t = {
@@ -10643,7 +10643,7 @@ var Go;
10643
10643
  function Di() {
10644
10644
  return Go || (Go = 1, (function(e) {
10645
10645
  Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
10646
- const t = /* @__PURE__ */ he(), n = /* @__PURE__ */ me(), r = /* @__PURE__ */ qt();
10646
+ const t = /* @__PURE__ */ he(), n = /* @__PURE__ */ me(), r = /* @__PURE__ */ Ht();
10647
10647
  e.keywordError = {
10648
10648
  message: ({ keyword: y }) => (0, t.str)`must pass "${y}" keyword validation`
10649
10649
  }, e.keyword$DataError = {
@@ -10717,21 +10717,21 @@ function Di() {
10717
10717
  }
10718
10718
  var Ko;
10719
10719
  function cb() {
10720
- if (Ko) return Wt;
10721
- Ko = 1, Object.defineProperty(Wt, "__esModule", { value: !0 }), Wt.boolOrEmptySchema = Wt.topBoolOrEmptySchema = void 0;
10722
- const e = /* @__PURE__ */ Di(), t = /* @__PURE__ */ he(), n = /* @__PURE__ */ qt(), r = {
10720
+ if (Ko) return Yt;
10721
+ Ko = 1, Object.defineProperty(Yt, "__esModule", { value: !0 }), Yt.boolOrEmptySchema = Yt.topBoolOrEmptySchema = void 0;
10722
+ const e = /* @__PURE__ */ Di(), t = /* @__PURE__ */ he(), n = /* @__PURE__ */ Ht(), r = {
10723
10723
  message: "boolean schema is false"
10724
10724
  };
10725
10725
  function i(o) {
10726
10726
  const { gen: l, schema: u, validateName: c } = o;
10727
10727
  u === !1 ? a(o, !1) : typeof u == "object" && u.$async === !0 ? l.return(n.default.data) : (l.assign((0, t._)`${c}.errors`, null), l.return(!0));
10728
10728
  }
10729
- Wt.topBoolOrEmptySchema = i;
10729
+ Yt.topBoolOrEmptySchema = i;
10730
10730
  function s(o, l) {
10731
10731
  const { gen: u, schema: c } = o;
10732
10732
  c === !1 ? (u.var(l, !1), a(o)) : u.var(l, !0);
10733
10733
  }
10734
- Wt.boolOrEmptySchema = s;
10734
+ Yt.boolOrEmptySchema = s;
10735
10735
  function a(o, l) {
10736
10736
  const { gen: u, data: c } = o, f = {
10737
10737
  gen: u,
@@ -10745,17 +10745,17 @@ function cb() {
10745
10745
  };
10746
10746
  (0, e.reportError)(f, r, void 0, l);
10747
10747
  }
10748
- return Wt;
10748
+ return Yt;
10749
10749
  }
10750
- var Fe = {}, Yt = {}, Zo;
10750
+ var Fe = {}, Gt = {}, Zo;
10751
10751
  function Xc() {
10752
- if (Zo) return Yt;
10753
- Zo = 1, Object.defineProperty(Yt, "__esModule", { value: !0 }), Yt.getRules = Yt.isJSONType = void 0;
10752
+ if (Zo) return Gt;
10753
+ Zo = 1, Object.defineProperty(Gt, "__esModule", { value: !0 }), Gt.getRules = Gt.isJSONType = void 0;
10754
10754
  const e = ["string", "number", "integer", "boolean", "null", "object", "array"], t = new Set(e);
10755
10755
  function n(i) {
10756
10756
  return typeof i == "string" && t.has(i);
10757
10757
  }
10758
- Yt.isJSONType = n;
10758
+ Gt.isJSONType = n;
10759
10759
  function r() {
10760
10760
  const i = {
10761
10761
  number: { type: "number", rules: [] },
@@ -10771,7 +10771,7 @@ function Xc() {
10771
10771
  keywords: {}
10772
10772
  };
10773
10773
  }
10774
- return Yt.getRules = r, Yt;
10774
+ return Gt.getRules = r, Gt;
10775
10775
  }
10776
10776
  var Ct = {}, Jo;
10777
10777
  function Qc() {
@@ -10971,7 +10971,7 @@ var gt = {}, be = {}, el;
10971
10971
  function wt() {
10972
10972
  if (el) return be;
10973
10973
  el = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.validateUnion = be.validateArray = be.usePattern = be.callValidateCode = be.schemaProperties = be.allSchemaProperties = be.noPropertyInData = be.propertyInData = be.isOwnProperty = be.hasPropFunc = be.reportMissingProp = be.checkMissingProp = be.checkReportMissingProp = void 0;
10974
- const e = /* @__PURE__ */ he(), t = /* @__PURE__ */ me(), n = /* @__PURE__ */ qt(), r = /* @__PURE__ */ me();
10974
+ const e = /* @__PURE__ */ he(), t = /* @__PURE__ */ me(), n = /* @__PURE__ */ Ht(), r = /* @__PURE__ */ me();
10975
10975
  function i(p, b) {
10976
10976
  const { gen: S, data: v, it: w } = p;
10977
10977
  S.if(c(S, v, b, w.opts.ownProperties), () => {
@@ -11080,7 +11080,7 @@ var tl;
11080
11080
  function db() {
11081
11081
  if (tl) return gt;
11082
11082
  tl = 1, Object.defineProperty(gt, "__esModule", { value: !0 }), gt.validateKeywordUsage = gt.validSchemaType = gt.funcKeywordCode = gt.macroKeywordCode = void 0;
11083
- const e = /* @__PURE__ */ he(), t = /* @__PURE__ */ qt(), n = /* @__PURE__ */ wt(), r = /* @__PURE__ */ Di();
11083
+ const e = /* @__PURE__ */ he(), t = /* @__PURE__ */ Ht(), n = /* @__PURE__ */ wt(), r = /* @__PURE__ */ Di();
11084
11084
  function i(h, d) {
11085
11085
  const { gen: g, keyword: T, schema: y, parentSchema: m, it: p } = h, b = d.macro.call(p.self, y, m, p), S = u(g, T, b);
11086
11086
  p.opts.validateSchema !== !1 && p.self.validateSchema(b, !0);
@@ -11437,7 +11437,7 @@ var al;
11437
11437
  function Oi() {
11438
11438
  if (al) return Ot;
11439
11439
  al = 1, Object.defineProperty(Ot, "__esModule", { value: !0 }), Ot.getData = Ot.KeywordCxt = Ot.validateFunctionCode = void 0;
11440
- const e = /* @__PURE__ */ cb(), t = /* @__PURE__ */ bi(), n = /* @__PURE__ */ Qc(), r = /* @__PURE__ */ bi(), i = /* @__PURE__ */ fb(), s = /* @__PURE__ */ db(), a = /* @__PURE__ */ hb(), o = /* @__PURE__ */ he(), l = /* @__PURE__ */ qt(), u = /* @__PURE__ */ $i(), c = /* @__PURE__ */ me(), f = /* @__PURE__ */ Di();
11440
+ const e = /* @__PURE__ */ cb(), t = /* @__PURE__ */ bi(), n = /* @__PURE__ */ Qc(), r = /* @__PURE__ */ bi(), i = /* @__PURE__ */ fb(), s = /* @__PURE__ */ db(), a = /* @__PURE__ */ hb(), o = /* @__PURE__ */ he(), l = /* @__PURE__ */ Ht(), u = /* @__PURE__ */ $i(), c = /* @__PURE__ */ me(), f = /* @__PURE__ */ Di();
11441
11441
  function h(O) {
11442
11442
  if (v(O) && (x(O), S(O))) {
11443
11443
  y(O);
@@ -11773,7 +11773,7 @@ var it = {}, ul;
11773
11773
  function xa() {
11774
11774
  if (ul) return it;
11775
11775
  ul = 1, Object.defineProperty(it, "__esModule", { value: !0 }), it.resolveSchema = it.getCompilingSchema = it.resolveRef = it.compileSchema = it.SchemaEnv = void 0;
11776
- const e = /* @__PURE__ */ he(), t = /* @__PURE__ */ Sa(), n = /* @__PURE__ */ qt(), r = /* @__PURE__ */ $i(), i = /* @__PURE__ */ me(), s = /* @__PURE__ */ Oi();
11776
+ const e = /* @__PURE__ */ he(), t = /* @__PURE__ */ Sa(), n = /* @__PURE__ */ Ht(), r = /* @__PURE__ */ $i(), i = /* @__PURE__ */ me(), s = /* @__PURE__ */ Oi();
11777
11777
  class a {
11778
11778
  constructor(m) {
11779
11779
  var p;
@@ -12803,7 +12803,7 @@ var jt = {}, gl;
12803
12803
  function Pb() {
12804
12804
  if (gl) return jt;
12805
12805
  gl = 1, Object.defineProperty(jt, "__esModule", { value: !0 }), jt.callRef = jt.getValidate = void 0;
12806
- const e = /* @__PURE__ */ Ci(), t = /* @__PURE__ */ wt(), n = /* @__PURE__ */ he(), r = /* @__PURE__ */ qt(), i = /* @__PURE__ */ xa(), s = /* @__PURE__ */ me(), a = {
12806
+ const e = /* @__PURE__ */ Ci(), t = /* @__PURE__ */ wt(), n = /* @__PURE__ */ he(), r = /* @__PURE__ */ Ht(), i = /* @__PURE__ */ xa(), s = /* @__PURE__ */ me(), a = {
12807
12807
  keyword: "$ref",
12808
12808
  schemaType: "string",
12809
12809
  code(u) {
@@ -13522,7 +13522,7 @@ var Cr = {}, Fl;
13522
13522
  function sf() {
13523
13523
  if (Fl) return Cr;
13524
13524
  Fl = 1, Object.defineProperty(Cr, "__esModule", { value: !0 });
13525
- const e = /* @__PURE__ */ wt(), t = /* @__PURE__ */ he(), n = /* @__PURE__ */ qt(), r = /* @__PURE__ */ me(), s = {
13525
+ const e = /* @__PURE__ */ wt(), t = /* @__PURE__ */ he(), n = /* @__PURE__ */ Ht(), r = /* @__PURE__ */ me(), s = {
13526
13526
  keyword: "additionalProperties",
13527
13527
  type: ["object"],
13528
13528
  schemaType: ["boolean", "object"],
@@ -13923,9 +13923,9 @@ function n1() {
13923
13923
  const t = [(/* @__PURE__ */ t1()).default];
13924
13924
  return Ur.default = t, Ur;
13925
13925
  }
13926
- var Gt = {}, Zl;
13926
+ var Kt = {}, Zl;
13927
13927
  function r1() {
13928
- return Zl || (Zl = 1, Object.defineProperty(Gt, "__esModule", { value: !0 }), Gt.contentVocabulary = Gt.metadataVocabulary = void 0, Gt.metadataVocabulary = [
13928
+ return Zl || (Zl = 1, Object.defineProperty(Kt, "__esModule", { value: !0 }), Kt.contentVocabulary = Kt.metadataVocabulary = void 0, Kt.metadataVocabulary = [
13929
13929
  "title",
13930
13930
  "description",
13931
13931
  "default",
@@ -13933,11 +13933,11 @@ function r1() {
13933
13933
  "readOnly",
13934
13934
  "writeOnly",
13935
13935
  "examples"
13936
- ], Gt.contentVocabulary = [
13936
+ ], Kt.contentVocabulary = [
13937
13937
  "contentMediaType",
13938
13938
  "contentEncoding",
13939
13939
  "contentSchema"
13940
- ]), Gt;
13940
+ ]), Kt;
13941
13941
  }
13942
13942
  var Jl;
13943
13943
  function i1() {
@@ -14824,24 +14824,24 @@ const V_ = (e) => {
14824
14824
  const t = document.createElement("div");
14825
14825
  return t.textContent = e, t.innerHTML;
14826
14826
  }, hu = async () => {
14827
- if (Jt.value)
14827
+ if (Ut.value)
14828
14828
  try {
14829
- const e = V_(Jt.value);
14830
- ta.chatting(), Jt.clear();
14829
+ const e = V_(Ut.value);
14830
+ ta.chatting(), Ut.clear();
14831
14831
  const t = { role: "user", content: e };
14832
14832
  ot.pushMessage(t), await Ca.emit("send", t);
14833
14833
  } finally {
14834
- ta.default(), Jt.focus();
14834
+ ta.default(), Ut.focus();
14835
14835
  }
14836
14836
  }, W_ = () => {
14837
- aa(), ta.default(), Jt.focus();
14837
+ aa(), ta.default(), Ut.focus();
14838
14838
  }, Y_ = async () => {
14839
- ot.clear(), ub.show("新聊天已创建"), Jt.focus(), await Ca.emit("create");
14839
+ ot.clear(), ub.show("新对话已创建"), Ut.focus(), await Ca.emit("create");
14840
14840
  };
14841
14841
  function G_() {
14842
14842
  const { submitIcon: e, createButton: t, messagesContainer: n, userInputContainer: r, userInput: i, stopIcon: s } = We();
14843
14843
  r.addEventListener("click", (a) => {
14844
- !e.contains(a.target) && !s.contains(a.target) && Jt.focus();
14844
+ !e.contains(a.target) && !s.contains(a.target) && Ut.focus();
14845
14845
  }), i.addEventListener("keydown", (a) => {
14846
14846
  a.key === "Enter" && !a.shiftKey && (a.preventDefault(), hu());
14847
14847
  }), e.addEventListener("click", hu), s.addEventListener("click", W_), t.addEventListener("click", Y_), n.addEventListener("click", function(a) {
@@ -14898,9 +14898,9 @@ kf.innerHTML = `
14898
14898
  <div class="messages-container" id="messages-container"></div>
14899
14899
  <div class="bottom-container">
14900
14900
  <div class="action-bar">
14901
- <button class="icon square plain tooltip" id="create-button" type="button" aria-label="新聊天">
14901
+ <button class="icon square plain tooltip" id="create-button" type="button" aria-label="新对话">
14902
14902
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 1024 1024"><path d="M597.333 128v85.333H170.667v571.094l75.221-59.094h607.445V426.667h85.334V768A42.667 42.667 0 0 1 896 810.667H275.413L85.333 960V170.667A42.667 42.667 0 0 1 128 128h469.333zm213.334 0V0H896v128h128v85.333H896v128h-85.333v-128h-128V128h128z"/></svg>
14903
- <span class="tooltip-text bottom-right">新聊天</span>
14903
+ <span class="tooltip-text bottom-right">新对话</span>
14904
14904
  </button>
14905
14905
  </div>
14906
14906
  <div class="user-input-container" id="user-input-container">
@@ -15466,7 +15466,7 @@ const oa = {
15466
15466
  october: 10,
15467
15467
  november: 11,
15468
15468
  december: 12
15469
- }, Ht = {
15469
+ }, Bt = {
15470
15470
  ...Af,
15471
15471
  jan: 1,
15472
15472
  "jan.": 1,
@@ -15669,13 +15669,13 @@ class hv extends ke {
15669
15669
  return r ? Te.createRelativeFromReference(t.reference, r) : null;
15670
15670
  }
15671
15671
  }
15672
- const pv = new RegExp(`(?:on\\s{0,3})?(${vi})(?:\\s{0,3}(?:to|\\-|\\–|until|through|till)?\\s{0,3}(${vi}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Pt(Ht)})(?:(?:-|/|,?\\s{0,3})(${zi}(?!\\w)))?(?=\\W|$)`, "i"), gu = 1, yu = 2, mv = 3, bu = 4;
15672
+ const pv = new RegExp(`(?:on\\s{0,3})?(${vi})(?:\\s{0,3}(?:to|\\-|\\–|until|through|till)?\\s{0,3}(${vi}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Pt(Bt)})(?:(?:-|/|,?\\s{0,3})(${zi}(?!\\w)))?(?=\\W|$)`, "i"), gu = 1, yu = 2, mv = 3, bu = 4;
15673
15673
  class gv extends ke {
15674
15674
  innerPattern() {
15675
15675
  return pv;
15676
15676
  }
15677
15677
  innerExtract(t, n) {
15678
- const r = t.createParsingResult(n.index, n[0]), i = Ht[n[mv].toLowerCase()], s = Ti(n[gu]);
15678
+ const r = t.createParsingResult(n.index, n[0]), i = Bt[n[mv].toLowerCase()], s = Ti(n[gu]);
15679
15679
  if (s > 31)
15680
15680
  return n.index = n.index + n[gu].length, null;
15681
15681
  if (r.start.assign("month", i), r.start.assign("day", s), n[bu]) {
@@ -15692,7 +15692,7 @@ class gv extends ke {
15692
15692
  return r;
15693
15693
  }
15694
15694
  }
15695
- const yv = new RegExp(`(${Pt(Ht)})(?:-|/|\\s*,?\\s*)(${vi})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${vi})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${zi}))?(?=\\W|$)(?!\\:\\d)`, "i"), bv = 1, wu = 2, $s = 3, Os = 4;
15695
+ const yv = new RegExp(`(${Pt(Bt)})(?:-|/|\\s*,?\\s*)(${vi})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${vi})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${zi}))?(?=\\W|$)(?!\\:\\d)`, "i"), bv = 1, wu = 2, $s = 3, Os = 4;
15696
15696
  class wv extends ke {
15697
15697
  shouldSkipYearLikeDate;
15698
15698
  constructor(t) {
@@ -15702,7 +15702,7 @@ class wv extends ke {
15702
15702
  return yv;
15703
15703
  }
15704
15704
  innerExtract(t, n) {
15705
- const r = Ht[n[bv].toLowerCase()], i = Ti(n[wu]);
15705
+ const r = Bt[n[bv].toLowerCase()], i = Ti(n[wu]);
15706
15706
  if (i > 31 || this.shouldSkipYearLikeDate && !n[$s] && !n[Os] && n[wu].match(/^2[0-5]$/))
15707
15707
  return null;
15708
15708
  const s = t.createParsingComponents({
@@ -15722,7 +15722,7 @@ class wv extends ke {
15722
15722
  return o.start = s, o.end = s.clone(), o.end.assign("day", a), o;
15723
15723
  }
15724
15724
  }
15725
- const _v = new RegExp(`((?:in)\\s*)?(${Pt(Ht)})\\s*(?:(?:,|-|of)?\\s*(${zi})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`, "i"), vv = 1, Tv = 2, _u = 3;
15725
+ const _v = new RegExp(`((?:in)\\s*)?(${Pt(Bt)})\\s*(?:(?:,|-|of)?\\s*(${zi})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`, "i"), vv = 1, Tv = 2, _u = 3;
15726
15726
  class kv extends ke {
15727
15727
  innerPattern() {
15728
15728
  return _v;
@@ -15733,7 +15733,7 @@ class kv extends ke {
15733
15733
  return null;
15734
15734
  const i = t.createParsingResult(n.index + (n[vv] || "").length, n.index + n[0].length);
15735
15735
  i.start.imply("day", 1), i.start.addTag("parser/ENMonthNameParser");
15736
- const s = Ht[r];
15736
+ const s = Bt[r];
15737
15737
  if (i.start.assign("month", s), n[_u]) {
15738
15738
  const a = Ui(n[_u]);
15739
15739
  i.start.assign("year", a);
@@ -15744,7 +15744,7 @@ class kv extends ke {
15744
15744
  return i;
15745
15745
  }
15746
15746
  }
15747
- const Ev = new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${Pt(Ht)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`, "i"), Sv = 1, xv = 2, vu = 3, Pv = 4;
15747
+ const Ev = new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${Pt(Bt)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`, "i"), Sv = 1, xv = 2, vu = 3, Pv = 4;
15748
15748
  class Av extends ke {
15749
15749
  strictMonthDateOrder;
15750
15750
  constructor(t) {
@@ -15755,7 +15755,7 @@ class Av extends ke {
15755
15755
  }
15756
15756
  innerExtract(t, n) {
15757
15757
  const r = parseInt(n[Sv]);
15758
- let i = parseInt(n[Pv]), s = n[vu] ? parseInt(n[vu]) : Ht[n[xv].toLowerCase()];
15758
+ let i = parseInt(n[Pv]), s = n[vu] ? parseInt(n[vu]) : Bt[n[xv].toLowerCase()];
15759
15759
  if (s < 1 || s > 12) {
15760
15760
  if (this.strictMonthDateOrder)
15761
15761
  return null;
@@ -15784,7 +15784,7 @@ function Rv(e, t, n, r) {
15784
15784
  function Nv(e, t) {
15785
15785
  return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`, "i");
15786
15786
  }
15787
- const Cs = 2, Kt = 3, Br = 4, Vr = 5, cn = 6;
15787
+ const Cs = 2, Zt = 3, Br = 4, Vr = 5, cn = 6;
15788
15788
  class Mv {
15789
15789
  strictMode;
15790
15790
  constructor(t = !1) {
@@ -15818,16 +15818,16 @@ class Mv {
15818
15818
  const i = t.createParsingComponents();
15819
15819
  let s = 0, a = null, o = parseInt(n[Cs]);
15820
15820
  if (o > 100) {
15821
- if (n[Cs].length == 4 && n[Kt] == null && !n[cn] || this.strictMode || n[Kt] != null)
15821
+ if (n[Cs].length == 4 && n[Zt] == null && !n[cn] || this.strictMode || n[Zt] != null)
15822
15822
  return null;
15823
15823
  s = o % 100, o = Math.floor(o / 100);
15824
15824
  }
15825
15825
  if (o > 24)
15826
15826
  return null;
15827
- if (n[Kt] != null) {
15828
- if (n[Kt].length == 1 && !n[cn])
15827
+ if (n[Zt] != null) {
15828
+ if (n[Zt].length == 1 && !n[cn])
15829
15829
  return null;
15830
- s = parseInt(n[Kt]);
15830
+ s = parseInt(n[Zt]);
15831
15831
  }
15832
15832
  if (s >= 60)
15833
15833
  return null;
@@ -15866,7 +15866,7 @@ class Mv {
15866
15866
  i.assign("second", l);
15867
15867
  }
15868
15868
  let s = parseInt(n[Cs]), a = 0, o = -1;
15869
- if (n[Kt] != null ? a = parseInt(n[Kt]) : s > 100 && (a = s % 100, s = Math.floor(s / 100)), a >= 60 || s > 24)
15869
+ if (n[Zt] != null ? a = parseInt(n[Zt]) : s > 100 && (a = s % 100, s = Math.floor(s / 100)), a >= 60 || s > 24)
15870
15870
  return null;
15871
15871
  if (s >= 12 && (o = ye.PM), n[cn] != null) {
15872
15872
  if (s > 12)
@@ -17470,6 +17470,7 @@ class Hk {
17470
17470
  updateLoadingMessageReasoningContent = ot.updateLoadingMessageReasoningContent;
17471
17471
  updateLoadingMessageContent = ot.updateLoadingMessageContent;
17472
17472
  finishLoadingMessage = ot.finishLoadingMessage;
17473
+ setInputValue = Ut.setValue;
17473
17474
  constructor(t) {
17474
17475
  const { container: n } = t;
17475
17476
  if (!n)