ant-design-x-vue 1.0.2 → 1.0.3

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  var k0 = Object.defineProperty;
2
2
  var K0 = (e, t, n) => t in e ? k0(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var qn = (e, t, n) => K0(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { computed as $, inject as ve, provide as be, shallowRef as K, defineComponent as W, watch as Q, unref as ie, triggerRef as Dt, Fragment as Ie, isVNode as Nt, Comment as X0, Text as nm, reactive as ut, getCurrentInstance as Pt, onMounted as we, onUpdated as Eo, onUnmounted as Er, ref as G, watchEffect as ye, onBeforeUnmount as Be, createVNode as p, h as vo, Transition as un, withDirectives as Ao, resolveDirective as U0, cloneVNode as om, nextTick as We, toRef as xe, withModifiers as $u, vShow as Ar, onBeforeMount as G0, Teleport as Xi, createTextVNode as sr, isRef as q0, toRefs as Ps, toRaw as ho, render as cr, onBeforeUpdate as rm, TransitionGroup as Is, createApp as Y0, useSlots as zt, mergeProps as _e, onWatcherCleanup as Mo, toValue as Me, mergeDefaults as Je, useAttrs as im, openBlock as Ts, createBlock as Z0, toHandlers as Q0, withCtx as J0, renderSlot as ey, useTemplateRef as yo, createElementBlock as am, createElementVNode as so, useId as ty } from "vue";
4
+ import { computed as $, inject as ve, provide as be, shallowRef as K, defineComponent as W, watch as Q, unref as ie, triggerRef as Dt, Fragment as Ie, isVNode as Nt, Comment as X0, Text as nm, reactive as ut, getCurrentInstance as Pt, onMounted as we, onUpdated as Eo, onUnmounted as Er, ref as G, watchEffect as ye, onBeforeUnmount as Be, createVNode as p, h as vo, Transition as un, withDirectives as Ao, resolveDirective as U0, cloneVNode as om, nextTick as We, toRef as xe, withModifiers as $u, vShow as Ar, onBeforeMount as G0, Teleport as Xi, createTextVNode as sr, isRef as q0, toRefs as Ps, toRaw as ho, render as cr, onBeforeUpdate as rm, TransitionGroup as Is, createApp as Y0, useSlots as zt, mergeProps as _e, onWatcherCleanup as Mo, toValue as Me, mergeDefaults as qe, useAttrs as im, openBlock as Ts, createBlock as Z0, toHandlers as Q0, withCtx as J0, renderSlot as ey, useTemplateRef as yo, createElementBlock as am, createElementVNode as so, useId as ty } from "vue";
5
5
  const ur = function() {
6
6
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
7
7
  t[n] = arguments[n];
@@ -39,7 +39,7 @@ function pe(e) {
39
39
  default: e
40
40
  };
41
41
  }
42
- function Ze(e, t) {
42
+ function Qe(e, t) {
43
43
  const n = {
44
44
  validator: () => !0,
45
45
  default: e
@@ -62,7 +62,7 @@ function St(e, t) {
62
62
  return e ? {
63
63
  type: e,
64
64
  default: t
65
- } : Ze(t);
65
+ } : Qe(t);
66
66
  }
67
67
  const Es = "anticon", oy = Symbol("GlobalFormContextKey"), ry = (e) => {
68
68
  be(oy, e);
@@ -3545,8 +3545,8 @@ var L1 = function(e, t) {
3545
3545
  const F1 = () => ({
3546
3546
  prefixCls: String,
3547
3547
  imageStyle: he(),
3548
- image: Ze(),
3549
- description: Ze()
3548
+ image: Qe(),
3549
+ description: Qe()
3550
3550
  }), Vs = W({
3551
3551
  name: "AEmpty",
3552
3552
  compatConfig: {
@@ -3748,10 +3748,10 @@ var Ln = function(e) {
3748
3748
  return Gu(e) !== !1 && typeof (t = e.constructor) == "function" && Gu(n = t.prototype) !== !1 && n.hasOwnProperty("isPrototypeOf") !== !1;
3749
3749
  }, pg = function(e) {
3750
3750
  return e;
3751
- }, Qe = pg;
3751
+ }, Je = pg;
3752
3752
  if (process.env.NODE_ENV !== "production") {
3753
3753
  var W1 = typeof console < "u";
3754
- Qe = W1 ? function(e) {
3754
+ Je = W1 ? function(e) {
3755
3755
  console.warn("[VueTypes warn]: " + e);
3756
3756
  } : pg;
3757
3757
  }
@@ -3793,16 +3793,16 @@ function kn(e, t, n) {
3793
3793
  }
3794
3794
  if (!r) {
3795
3795
  var l = a + 'value "' + t + '" should be of type "' + i + '"';
3796
- return n === !1 ? (Qe(l), !1) : l;
3796
+ return n === !1 ? (Je(l), !1) : l;
3797
3797
  }
3798
3798
  if (Sr(o, "validator") && wo(o.validator)) {
3799
- var s = Qe, c = [];
3800
- if (Qe = function(d) {
3799
+ var s = Je, c = [];
3800
+ if (Je = function(d) {
3801
3801
  c.push(d);
3802
- }, r = o.validator(t), Qe = s, !r) {
3802
+ }, r = o.validator(t), Je = s, !r) {
3803
3803
  var u = (c.length > 1 ? "* " : "") + c.join(`
3804
3804
  * `);
3805
- return c.length = 0, n === !1 ? (Qe(u), r) : u;
3805
+ return c.length = 0, n === !1 ? (Je(u), r) : u;
3806
3806
  }
3807
3807
  }
3808
3808
  return r;
@@ -3815,14 +3815,14 @@ function ft(e, t) {
3815
3815
  return [].concat(r);
3816
3816
  } : Ln(r) ? function() {
3817
3817
  return Object.assign({}, r);
3818
- } : r, this) : (Qe(this._vueTypes_name + ' - invalid default value: "' + r + '"'), this) : this;
3818
+ } : r, this) : (Je(this._vueTypes_name + ' - invalid default value: "' + r + '"'), this) : this;
3819
3819
  } } }), o = n.validator;
3820
3820
  return wo(o) && (n.validator = Ws(o, n)), n;
3821
3821
  }
3822
3822
  function Rt(e, t) {
3823
3823
  var n = ft(e, t);
3824
3824
  return Object.defineProperty(n, "validate", { value: function(o) {
3825
- return wo(this.validator) && Qe(this._vueTypes_name + ` - calling .validate() will overwrite the current custom validator function. Validator info:
3825
+ return wo(this.validator) && Je(this._vueTypes_name + ` - calling .validate() will overwrite the current custom validator function. Validator info:
3826
3826
  ` + JSON.stringify(this)), this.validator = Ws(o, this), this;
3827
3827
  } });
3828
3828
  }
@@ -3870,7 +3870,7 @@ function eS(e, t) {
3870
3870
  if (t === void 0 && (t = "custom validation failed"), typeof e != "function") throw new TypeError("[VueTypes error]: You must provide a function as argument");
3871
3871
  return ft(e.name || "<<anonymous function>>", { validator: function(n) {
3872
3872
  var o = e(n);
3873
- return o || Qe(this._vueTypes_name + " - " + t), o;
3873
+ return o || Je(this._vueTypes_name + " - " + t), o;
3874
3874
  } });
3875
3875
  }
3876
3876
  function tS(e) {
@@ -3884,7 +3884,7 @@ function tS(e) {
3884
3884
  }, []);
3885
3885
  return ft("oneOf", { type: n.length > 0 ? n : void 0, validator: function(o) {
3886
3886
  var r = e.indexOf(o) !== -1;
3887
- return r || Qe(t), r;
3887
+ return r || Je(t), r;
3888
3888
  } });
3889
3889
  }
3890
3890
  function nS(e) {
@@ -3910,7 +3910,7 @@ function nS(e) {
3910
3910
  var c = kn(Ai(s) && s._vueTypes_name === "oneOf" ? s.type || null : s, i, !0);
3911
3911
  return typeof c == "string" && a.push(c), c === !0;
3912
3912
  });
3913
- return l || Qe("oneOfType - provided value does not match any of the " + a.length + ` passed-in validators:
3913
+ return l || Je("oneOfType - provided value does not match any of the " + a.length + ` passed-in validators:
3914
3914
  ` + ta(a.join(`
3915
3915
  `))), l;
3916
3916
  } } : { type: n });
@@ -3920,7 +3920,7 @@ function oS(e) {
3920
3920
  var n, o = t.every(function(r) {
3921
3921
  return (n = kn(e, r, !0)) === !0;
3922
3922
  });
3923
- return o || Qe(`arrayOf - value validation error:
3923
+ return o || Je(`arrayOf - value validation error:
3924
3924
  ` + ta(n)), o;
3925
3925
  } });
3926
3926
  }
@@ -3932,7 +3932,7 @@ function iS(e) {
3932
3932
  var n, o = Object.keys(t).every(function(r) {
3933
3933
  return (n = kn(e, t[r], !0)) === !0;
3934
3934
  });
3935
- return o || Qe(`objectOf - value validation error:
3935
+ return o || Je(`objectOf - value validation error:
3936
3936
  ` + ta(n)), o;
3937
3937
  } });
3938
3938
  }
@@ -3950,12 +3950,12 @@ function aS(e) {
3950
3950
  var l = n.filter(function(s) {
3951
3951
  return a.indexOf(s) === -1;
3952
3952
  });
3953
- return Qe(l.length === 1 ? 'shape - required property "' + l[0] + '" is not defined.' : 'shape - required properties "' + l.join('", "') + '" are not defined.'), !1;
3953
+ return Je(l.length === 1 ? 'shape - required property "' + l[0] + '" is not defined.' : 'shape - required properties "' + l.join('", "') + '" are not defined.'), !1;
3954
3954
  }
3955
3955
  return a.every(function(s) {
3956
- if (t.indexOf(s) === -1) return i._vueTypes_isLoose === !0 || (Qe('shape - shape definition does not include a "' + s + '" property. Allowed keys: "' + t.join('", "') + '".'), !1);
3956
+ if (t.indexOf(s) === -1) return i._vueTypes_isLoose === !0 || (Je('shape - shape definition does not include a "' + s + '" property. Allowed keys: "' + t.join('", "') + '".'), !1);
3957
3957
  var c = kn(e[s], r[s], !0);
3958
- return typeof c == "string" && Qe('shape - "' + s + `" property validation error:
3958
+ return typeof c == "string" && Je('shape - "' + s + `" property validation error:
3959
3959
  ` + ta(c)), c === !0;
3960
3960
  });
3961
3961
  } });
@@ -8862,7 +8862,7 @@ const $w = W({
8862
8862
  // Icons
8863
8863
  allowClear: ce,
8864
8864
  clearIcon: Se,
8865
- showArrow: qe,
8865
+ showArrow: Ye,
8866
8866
  inputIcon: pt,
8867
8867
  // Others
8868
8868
  disabled: Gn,
@@ -8910,7 +8910,7 @@ const $w = W({
8910
8910
  }), Ta == null || Ta.forEach((vn) => {
8911
8911
  delete Ea[vn];
8912
8912
  });
8913
- const hu = qe !== void 0 ? qe : Zt || !i.value && ge !== "combobox";
8913
+ const hu = Ye !== void 0 ? Ye : Zt || !i.value && ge !== "combobox";
8914
8914
  let yu;
8915
8915
  hu && (yu = p(Oo, {
8916
8916
  class: ne(`${X}-arrow`, {
@@ -12921,8 +12921,8 @@ const qP = (e) => {
12921
12921
  width: 177
12922
12922
  };
12923
12923
  }), i4 = () => v(v({}, hv()), {
12924
- content: Ze(),
12925
- title: Ze()
12924
+ content: Qe(),
12925
+ title: Qe()
12926
12926
  }), a4 = W({
12927
12927
  compatConfig: {
12928
12928
  MODE: 3
@@ -15433,18 +15433,18 @@ const s6 = () => ({
15433
15433
  }, [ce.charAt(0)]) : p("span", {
15434
15434
  class: `${C.value}-title-content`
15435
15435
  }, [ce]);
15436
- const qe = Wt(ce) && ce.type === "span";
15436
+ const Ye = Wt(ce) && ce.type === "span";
15437
15437
  return p(Ie, null, [Ae(typeof Se == "function" ? Se(e.originItemValue) : Se, {
15438
15438
  class: `${C.value}-item-icon`
15439
- }, !1), qe ? ce : p("span", {
15439
+ }, !1), Ye ? ce : p("span", {
15440
15440
  class: `${C.value}-title-content`
15441
15441
  }, [ce])]);
15442
15442
  }, ge = $(() => I.value !== "inline" && g.value.length > 1 ? "vertical" : I.value), Pe = $(() => I.value === "horizontal" ? "vertical" : I.value), Te = $(() => ge.value === "horizontal" ? "vertical" : ge.value), je = () => {
15443
15443
  var ce, Se;
15444
- const qe = B.value, pt = (ce = e.icon) !== null && ce !== void 0 ? ce : (Se = n.icon) === null || Se === void 0 ? void 0 : Se.call(n, e), Gn = e.expandIcon || n.expandIcon || _.value, Zt = se(Rr(n, e, "title"), pt);
15444
+ const Ye = B.value, pt = (ce = e.icon) !== null && ce !== void 0 ? ce : (Se = n.icon) === null || Se === void 0 ? void 0 : Se.call(n, e), Gn = e.expandIcon || n.expandIcon || _.value, Zt = se(Rr(n, e, "title"), pt);
15445
15445
  return p("div", {
15446
15446
  style: le.value,
15447
- class: `${qe}-title`,
15447
+ class: `${Ye}-title`,
15448
15448
  tabindex: N.value ? null : -1,
15449
15449
  ref: j,
15450
15450
  title: typeof Zt == "string" ? Zt : null,
@@ -15458,7 +15458,7 @@ const s6 = () => ({
15458
15458
  }, [Zt, I.value !== "horizontal" && Gn ? Gn(v(v({}, e), {
15459
15459
  isOpen: J.value
15460
15460
  })) : p("i", {
15461
- class: `${qe}-arrow`
15461
+ class: `${Ye}-arrow`
15462
15462
  }, null)]);
15463
15463
  };
15464
15464
  return () => {
@@ -15466,10 +15466,10 @@ const s6 = () => ({
15466
15466
  if (l)
15467
15467
  return T ? (ce = n.default) === null || ce === void 0 ? void 0 : ce.call(n) : null;
15468
15468
  const Se = B.value;
15469
- let qe = () => null;
15469
+ let Ye = () => null;
15470
15470
  if (!R.value && I.value !== "inline") {
15471
15471
  const pt = I.value === "horizontal" ? [0, 8] : [10, 0];
15472
- qe = () => p(Pf, {
15472
+ Ye = () => p(Pf, {
15473
15473
  mode: ge.value,
15474
15474
  prefixCls: Se,
15475
15475
  visible: !e.internalPopupClose && J.value,
@@ -15491,7 +15491,7 @@ const s6 = () => ({
15491
15491
  })
15492
15492
  });
15493
15493
  } else
15494
- qe = () => p(Pf, null, {
15494
+ Ye = () => p(Pf, null, {
15495
15495
  default: je
15496
15496
  });
15497
15497
  return p(_i, {
@@ -15511,7 +15511,7 @@ const s6 = () => ({
15511
15511
  onMouseleave: te,
15512
15512
  "data-submenu-id": u
15513
15513
  }), {
15514
- default: () => p(Ie, null, [qe(), !R.value && p(l6, {
15514
+ default: () => p(Ie, null, [Ye(), !R.value && p(l6, {
15515
15515
  id: ee,
15516
15516
  open: J.value,
15517
15517
  keyPath: g.value
@@ -18548,7 +18548,7 @@ const nI = W({
18548
18548
  if (ge && !se)
18549
18549
  Te = I.value.filter((je) => ln(je) !== X);
18550
18550
  else {
18551
- const je = se ? ee.filter((qe) => qe !== X) : [...ee, X];
18551
+ const je = se ? ee.filter((Ye) => Ye !== X) : [...ee, X];
18552
18552
  let ce;
18553
18553
  se ? {
18554
18554
  checkedKeys: ce
@@ -19559,7 +19559,7 @@ Vi.newInstance = function(t, n) {
19559
19559
  let {
19560
19560
  attrs: C
19561
19561
  } = S;
19562
- const x = K(), w = $(() => Ye.getPrefixCls(r, l)), [, O] = d(w);
19562
+ const x = K(), w = $(() => Ze.getPrefixCls(r, l)), [, O] = d(w);
19563
19563
  return we(() => {
19564
19564
  n({
19565
19565
  notice(I) {
@@ -19576,7 +19576,7 @@ Vi.newInstance = function(t, n) {
19576
19576
  component: x
19577
19577
  });
19578
19578
  }), () => {
19579
- const I = Ye, b = I.getRootPrefixCls(s, w.value), E = u ? c : `${w.value}-${c}`;
19579
+ const I = Ze, b = I.getRootPrefixCls(s, w.value), E = u ? c : `${w.value}-${c}`;
19580
19580
  return p(go, F(F({}, I), {}, {
19581
19581
  prefixCls: b
19582
19582
  }), {
@@ -20953,24 +20953,24 @@ var lT = function(e, t) {
20953
20953
  };
20954
20954
  const sT = "ant";
20955
20955
  function mo() {
20956
- return Ye.prefixCls || sT;
20956
+ return Ze.prefixCls || sT;
20957
20957
  }
20958
20958
  function Ch() {
20959
- return Ye.iconPrefixCls || Es;
20959
+ return Ze.iconPrefixCls || Es;
20960
20960
  }
20961
- const _c = ut({}), Ye = ut({});
20961
+ const _c = ut({}), Ze = ut({});
20962
20962
  ye(() => {
20963
- v(Ye, _c), Ye.prefixCls = mo(), Ye.iconPrefixCls = Ch(), Ye.getPrefixCls = (e, t) => t || (e ? `${Ye.prefixCls}-${e}` : Ye.prefixCls), Ye.getRootPrefixCls = () => Ye.prefixCls ? Ye.prefixCls : mo();
20963
+ v(Ze, _c), Ze.prefixCls = mo(), Ze.iconPrefixCls = Ch(), Ze.getPrefixCls = (e, t) => t || (e ? `${Ze.prefixCls}-${e}` : Ze.prefixCls), Ze.getRootPrefixCls = () => Ze.prefixCls ? Ze.prefixCls : mo();
20964
20964
  });
20965
20965
  let rl;
20966
20966
  const cT = (e) => {
20967
20967
  rl && rl(), rl = ye(() => {
20968
- v(_c, ut(e)), v(Ye, ut(e));
20968
+ v(_c, ut(e)), v(Ze, ut(e));
20969
20969
  }), e.theme && rT(mo(), e.theme);
20970
20970
  }, uT = () => ({
20971
20971
  getPrefixCls: (e, t) => t || (e ? `${mo()}-${e}` : mo()),
20972
20972
  getIconPrefixCls: Ch,
20973
- getRootPrefixCls: () => Ye.prefixCls ? Ye.prefixCls : mo()
20973
+ getRootPrefixCls: () => Ze.prefixCls ? Ze.prefixCls : mo()
20974
20974
  }), go = W({
20975
20975
  compatConfig: {
20976
20976
  MODE: 3
@@ -21900,13 +21900,13 @@ const ST = ["text", "input"], CT = W({
21900
21900
  props: {
21901
21901
  prefixCls: String,
21902
21902
  inputType: V.oneOf(ur("text", "input")),
21903
- value: Ze(),
21904
- defaultValue: Ze(),
21903
+ value: Qe(),
21904
+ defaultValue: Qe(),
21905
21905
  allowClear: {
21906
21906
  type: Boolean,
21907
21907
  default: void 0
21908
21908
  },
21909
- element: Ze(),
21909
+ element: Qe(),
21910
21910
  handleReset: Function,
21911
21911
  disabled: {
21912
21912
  type: Boolean,
@@ -21918,10 +21918,10 @@ const ST = ["text", "input"], CT = W({
21918
21918
  size: {
21919
21919
  type: String
21920
21920
  },
21921
- suffix: Ze(),
21922
- prefix: Ze(),
21923
- addonBefore: Ze(),
21924
- addonAfter: Ze(),
21921
+ suffix: Qe(),
21922
+ prefix: Qe(),
21923
+ addonBefore: Qe(),
21924
+ addonAfter: Qe(),
21925
21925
  readonly: {
21926
21926
  type: Boolean,
21927
21927
  default: void 0
@@ -22563,7 +22563,7 @@ const BT = {
22563
22563
  showInfo: Ce(),
22564
22564
  strokeWidth: Number,
22565
22565
  strokeLinecap: Ve(),
22566
- strokeColor: Ze(),
22566
+ strokeColor: Qe(),
22567
22567
  trailColor: String,
22568
22568
  /** @deprecated Use `size` instead */
22569
22569
  width: Number,
@@ -22632,7 +22632,7 @@ var HT = function(e, t) {
22632
22632
  return n;
22633
22633
  };
22634
22634
  const jT = () => v(v({}, Sa()), {
22635
- strokeColor: Ze(),
22635
+ strokeColor: Qe(),
22636
22636
  direction: Ve()
22637
22637
  }), VT = (e) => {
22638
22638
  let t = [];
@@ -22900,7 +22900,7 @@ const qT = W({
22900
22900
  };
22901
22901
  }
22902
22902
  }), YT = () => v(v({}, Sa()), {
22903
- strokeColor: Ze()
22903
+ strokeColor: Qe()
22904
22904
  }), ZT = 3, QT = (e) => ZT / e * 100, JT = W({
22905
22905
  compatConfig: {
22906
22906
  MODE: 3
@@ -24364,10 +24364,10 @@ const _E = Jv("webkitLineClamp"), HE = Jv("textOverflow"), lp = "...", Fr = () =
24364
24364
  let Te = z, je;
24365
24365
  if (oe && l.isEllipsis && !l.expanded && !se) {
24366
24366
  const {
24367
- title: qe
24367
+ title: Ye
24368
24368
  } = re;
24369
- let pt = qe || "";
24370
- !qe && (typeof z == "string" || typeof z == "number") && (pt = String(z)), pt = pt == null ? void 0 : pt.slice(String(l.ellipsisContent || "").length), Te = p(Ie, null, [ho(l.ellipsisContent), p("span", {
24369
+ let pt = Ye || "";
24370
+ !Ye && (typeof z == "string" || typeof z == "number") && (pt = String(z)), pt = pt == null ? void 0 : pt.slice(String(l.ellipsisContent || "").length), Te = p(Ie, null, [ho(l.ellipsisContent), p("span", {
24371
24371
  title: pt,
24372
24372
  "aria-hidden": "true"
24373
24373
  }, [lp]), U]);
@@ -26703,7 +26703,7 @@ const u8 = () => ({
26703
26703
  align: Ve(),
26704
26704
  flex: St([Number, String]),
26705
26705
  gap: St([Number, String]),
26706
- component: Ze()
26706
+ component: Qe()
26707
26707
  });
26708
26708
  var d8 = function(e, t) {
26709
26709
  var n = {};
@@ -28430,7 +28430,7 @@ const { genStyleHooks: gn, genComponentStyleHook: FM, genSubStyleComponent: _M }
28430
28430
  }), u0 = /* @__PURE__ */ W({
28431
28431
  name: "AXBubble",
28432
28432
  __name: "Bubble",
28433
- props: Je({
28433
+ props: qe({
28434
28434
  prefixCls: null,
28435
28435
  rootClassName: null,
28436
28436
  styles: null,
@@ -28664,7 +28664,7 @@ const q5 = 1, Y5 = /* @__PURE__ */ W({
28664
28664
  name: "AXBubbleList",
28665
28665
  inheritAttrs: !1,
28666
28666
  __name: "BubbleList",
28667
- props: Je({
28667
+ props: qe({
28668
28668
  prefixCls: null,
28669
28669
  rootClassName: null,
28670
28670
  items: null,
@@ -29034,7 +29034,7 @@ const yl = "__ungrouped", tA = (e, t = []) => {
29034
29034
  ), jM = /* @__PURE__ */ W({
29035
29035
  name: "AXConversations",
29036
29036
  __name: "Conversations",
29037
- props: Je({
29037
+ props: qe({
29038
29038
  items: null,
29039
29039
  activeKey: null,
29040
29040
  defaultActiveKey: null,
@@ -29185,7 +29185,7 @@ function cA(e) {
29185
29185
  const VM = /* @__PURE__ */ W({
29186
29186
  name: "AXWelcome",
29187
29187
  __name: "Welcome",
29188
- props: Je({
29188
+ props: qe({
29189
29189
  prefixCls: null,
29190
29190
  rootClassName: null,
29191
29191
  className: null,
@@ -29392,7 +29392,7 @@ const VM = /* @__PURE__ */ W({
29392
29392
  ), mA = /* @__PURE__ */ W({
29393
29393
  name: "AXPrompts",
29394
29394
  __name: "Prompts",
29395
- props: Je({
29395
+ props: qe({
29396
29396
  items: null,
29397
29397
  title: null,
29398
29398
  onItemClick: {
@@ -29577,7 +29577,7 @@ function yA(e, t, n, o, r) {
29577
29577
  const WM = /* @__PURE__ */ W({
29578
29578
  name: "AXSuggestion",
29579
29579
  __name: "Suggestion",
29580
- props: Je({
29580
+ props: qe({
29581
29581
  prefixCls: null,
29582
29582
  className: null,
29583
29583
  rootClassName: null,
@@ -29699,7 +29699,7 @@ const WM = /* @__PURE__ */ W({
29699
29699
  }), Oa = /* @__PURE__ */ W({
29700
29700
  name: "AXSenderActionButton",
29701
29701
  __name: "index",
29702
- props: Je({
29702
+ props: qe({
29703
29703
  prefixCls: null,
29704
29704
  type: null,
29705
29705
  htmlType: null,
@@ -29748,7 +29748,7 @@ const WM = /* @__PURE__ */ W({
29748
29748
  }), wA = /* @__PURE__ */ W({
29749
29749
  name: "AXSenderClearButton",
29750
29750
  __name: "ClearButton",
29751
- props: Je({
29751
+ props: qe({
29752
29752
  prefixCls: null,
29753
29753
  type: null,
29754
29754
  htmlType: null,
@@ -29828,7 +29828,7 @@ const WM = /* @__PURE__ */ W({
29828
29828
  }), Up = /* @__PURE__ */ W({
29829
29829
  name: "AXSenderLoadingButton",
29830
29830
  __name: "LoadingButton",
29831
- props: Je({
29831
+ props: qe({
29832
29832
  prefixCls: null,
29833
29833
  type: null,
29834
29834
  htmlType: null,
@@ -29875,7 +29875,7 @@ const WM = /* @__PURE__ */ W({
29875
29875
  }), Gp = /* @__PURE__ */ W({
29876
29876
  name: "AXSenderLoadingButton",
29877
29877
  __name: "SendButton",
29878
- props: Je({
29878
+ props: qe({
29879
29879
  prefixCls: null,
29880
29880
  type: null,
29881
29881
  htmlType: null,
@@ -29956,7 +29956,7 @@ const WM = /* @__PURE__ */ W({
29956
29956
  }), IA = /* @__PURE__ */ W({
29957
29957
  name: "AXSenderSpeechButton",
29958
29958
  __name: "index",
29959
- props: Je({
29959
+ props: qe({
29960
29960
  prefixCls: null,
29961
29961
  type: null,
29962
29962
  htmlType: null,
@@ -30223,47 +30223,60 @@ function DA(e, t) {
30223
30223
  const NA = /* @__PURE__ */ W({
30224
30224
  name: "AXSender",
30225
30225
  __name: "Sender",
30226
- props: {
30227
- onKeyPress: {},
30228
- prefixCls: {},
30229
- defaultValue: {},
30230
- value: {},
30226
+ props: qe({
30227
+ onKeyPress: {
30228
+ type: Function
30229
+ },
30230
+ prefixCls: null,
30231
+ defaultValue: null,
30232
+ value: null,
30231
30233
  loading: {
30232
30234
  type: Boolean
30233
30235
  },
30234
- placeholder: {},
30236
+ placeholder: null,
30235
30237
  readOnly: {
30236
30238
  type: Boolean
30237
30239
  },
30238
30240
  submitType: {
30239
- type: [String, Boolean],
30240
- default: "enter"
30241
+ type: [String, Boolean]
30241
30242
  },
30242
30243
  disabled: {
30243
- type: Boolean,
30244
- default: void 0
30244
+ type: Boolean
30245
30245
  },
30246
- onSubmit: {},
30247
- onChange: {},
30248
- onCancel: {},
30249
- onKeyDown: {},
30250
- onPaste: {},
30251
- onPasteFile: {},
30252
- components: {},
30253
- styles: {
30254
- default: () => ({})
30255
- },
30256
- rootClassName: {},
30257
- classNames: {
30258
- default: () => ({})
30259
- },
30260
- style: {},
30261
- className: {},
30262
- actions: {},
30263
- allowSpeech: {},
30264
- prefix: {},
30265
- header: {}
30266
- },
30246
+ onSubmit: {
30247
+ type: Function
30248
+ },
30249
+ onChange: {
30250
+ type: Function
30251
+ },
30252
+ onCancel: null,
30253
+ onKeyDown: {
30254
+ type: Function
30255
+ },
30256
+ onPaste: {
30257
+ type: Function
30258
+ },
30259
+ onPasteFile: {
30260
+ type: Function
30261
+ },
30262
+ components: null,
30263
+ styles: null,
30264
+ rootClassName: null,
30265
+ classNames: null,
30266
+ style: null,
30267
+ className: null,
30268
+ actions: {
30269
+ type: Function
30270
+ },
30271
+ allowSpeech: null,
30272
+ prefix: null,
30273
+ header: null
30274
+ }, {
30275
+ styles: () => ({}),
30276
+ classNames: () => ({}),
30277
+ submitType: "enter",
30278
+ disabled: void 0
30279
+ }),
30267
30280
  emits: ["update:value"],
30268
30281
  setup(e, {
30269
30282
  expose: t,
@@ -30463,7 +30476,7 @@ const NA = /* @__PURE__ */ W({
30463
30476
  name: "AXSenderHeader",
30464
30477
  inheritAttrs: !1,
30465
30478
  __name: "SenderHeader",
30466
- props: Je({
30479
+ props: qe({
30467
30480
  forceRender: {
30468
30481
  type: Boolean
30469
30482
  },
@@ -30557,7 +30570,7 @@ const NA = /* @__PURE__ */ W({
30557
30570
  }), _A = /* @__PURE__ */ W({
30558
30571
  name: "AXAttachmentsPlaceholderUploader",
30559
30572
  __name: "PlaceholderUploader",
30560
- props: Je({
30573
+ props: qe({
30561
30574
  prefixCls: null,
30562
30575
  placeholder: null,
30563
30576
  upload: null,
@@ -31616,15 +31629,17 @@ const YA = (e) => {
31616
31629
  name: "AXAttachmentsFileList",
31617
31630
  __name: "FileList",
31618
31631
  props: {
31619
- prefixCls: {},
31620
- items: {},
31621
- onRemove: {},
31622
- overflow: {},
31623
- upload: {},
31624
- listClassName: {},
31625
- listStyle: {},
31626
- itemClassName: {},
31627
- itemStyle: {}
31632
+ prefixCls: null,
31633
+ items: null,
31634
+ onRemove: {
31635
+ type: Function
31636
+ },
31637
+ overflow: null,
31638
+ upload: null,
31639
+ listClassName: null,
31640
+ listStyle: null,
31641
+ itemClassName: null,
31642
+ itemStyle: null
31628
31643
  },
31629
31644
  setup(e) {
31630
31645
  const t = $(() => `${e.prefixCls}-list`), n = yo("file-list-container"), [o, r] = He(!1), i = Pa();
@@ -31702,7 +31717,7 @@ function tM(e) {
31702
31717
  const nM = /* @__PURE__ */ W({
31703
31718
  name: "AXAttachments",
31704
31719
  __name: "Attachments",
31705
- props: Je({
31720
+ props: qe({
31706
31721
  capture: null,
31707
31722
  type: null,
31708
31723
  name: null,
@@ -31808,62 +31823,7 @@ const nM = /* @__PURE__ */ W({
31808
31823
  ...E == null ? void 0 : E.style
31809
31824
  }
31810
31825
  }, null);
31811
- }, I = $(() => {
31812
- let b;
31813
- if (e.children)
31814
- return p(Ie, null, [p(h0, {
31815
- upload: x.value,
31816
- rootClassName: e.rootClassName,
31817
- ref: "attachments-upload",
31818
- children: e.children
31819
- }, null), p(Yp, {
31820
- getDropContainer: e.getDropContainer,
31821
- prefixCls: a,
31822
- className: ue(g.value, e.rootClassName),
31823
- children: O("drop")
31824
- }, null)]);
31825
- const E = y.value.length > 0;
31826
- return p("div", {
31827
- class: ue(a, g.value, {
31828
- [`${a}-rtl`]: i.value === "rtl"
31829
- }, e.className, e.rootClassName),
31830
- style: {
31831
- ...e.rootStyle,
31832
- ...e.style
31833
- },
31834
- dir: i.value || "ltr",
31835
- ref: "attachments-container"
31836
- }, [p(eM, {
31837
- prefixCls: a,
31838
- items: y.value,
31839
- onRemove: w,
31840
- overflow: e.overflow,
31841
- upload: x.value,
31842
- listClassName: ue(s.value.list, e.classNames.list),
31843
- listStyle: {
31844
- ...c.value.list,
31845
- ...e.styles.list,
31846
- ...!E && {
31847
- display: "none"
31848
- }
31849
- },
31850
- itemClassName: ue(s.value.item, e.classNames.item),
31851
- itemStyle: {
31852
- ...c.value.item,
31853
- ...e.styles.item
31854
- }
31855
- }, null), O("inline", E ? {
31856
- style: {
31857
- display: "none"
31858
- }
31859
- } : {}, d.value), p(Yp, {
31860
- getDropContainer: e.getDropContainer || (() => u.value),
31861
- prefixCls: a,
31862
- className: g.value
31863
- }, tM(b = O("drop")) ? b : {
31864
- default: () => [b]
31865
- })]);
31866
- });
31826
+ }, I = $(() => y.value.length > 0);
31867
31827
  return t({
31868
31828
  nativeElement: u.value,
31869
31829
  upload: (b) => {
@@ -31879,13 +31839,65 @@ const nM = /* @__PURE__ */ W({
31879
31839
  }));
31880
31840
  }
31881
31841
  }
31882
- }), () => f(p(FA, {
31883
- value: {
31884
- disabled: e.disabled
31885
- }
31886
- }, {
31887
- default: () => [I.value]
31888
- }));
31842
+ }), () => {
31843
+ let b;
31844
+ return f(p(FA, {
31845
+ value: {
31846
+ disabled: e.disabled
31847
+ }
31848
+ }, {
31849
+ default: () => [e.children ? p(Ie, null, [p(h0, {
31850
+ upload: x.value,
31851
+ rootClassName: e.rootClassName,
31852
+ ref: "attachments-upload",
31853
+ children: e.children
31854
+ }, null), p(Yp, {
31855
+ getDropContainer: e.getDropContainer,
31856
+ prefixCls: a,
31857
+ className: ue(g.value, e.rootClassName),
31858
+ children: O("drop")
31859
+ }, null)]) : p("div", {
31860
+ class: ue(a, g.value, {
31861
+ [`${a}-rtl`]: i.value === "rtl"
31862
+ }, e.className, e.rootClassName),
31863
+ style: {
31864
+ ...e.rootStyle,
31865
+ ...e.style
31866
+ },
31867
+ dir: i.value || "ltr",
31868
+ ref: "attachments-container"
31869
+ }, [p(eM, {
31870
+ prefixCls: a,
31871
+ items: y.value,
31872
+ onRemove: w,
31873
+ overflow: e.overflow,
31874
+ upload: x.value,
31875
+ listClassName: ue(s.value.list, e.classNames.list),
31876
+ listStyle: {
31877
+ ...c.value.list,
31878
+ ...e.styles.list,
31879
+ ...!I.value && {
31880
+ display: "none"
31881
+ }
31882
+ },
31883
+ itemClassName: ue(s.value.item, e.classNames.item),
31884
+ itemStyle: {
31885
+ ...c.value.item,
31886
+ ...e.styles.item
31887
+ }
31888
+ }, null), O("inline", I.value ? {
31889
+ style: {
31890
+ display: "none"
31891
+ }
31892
+ } : {}, d.value), p(Yp, {
31893
+ getDropContainer: e.getDropContainer || (() => u.value),
31894
+ prefixCls: a,
31895
+ className: g.value
31896
+ }, tM(b = O("drop")) ? b : {
31897
+ default: () => [b]
31898
+ })])]
31899
+ }));
31900
+ };
31889
31901
  }
31890
31902
  }), KM = Object.assign(nM, {
31891
31903
  FileCard: S0
@@ -32145,7 +32157,7 @@ const rM = (e) => {
32145
32157
  }), fM = /* @__PURE__ */ W({
32146
32158
  name: "AXThoughtChainNode",
32147
32159
  __name: "item",
32148
- props: Je({
32160
+ props: qe({
32149
32161
  info: null,
32150
32162
  nextStatus: null,
32151
32163
  onClick: {
@@ -32230,7 +32242,7 @@ const rM = (e) => {
32230
32242
  }), XM = /* @__PURE__ */ W({
32231
32243
  name: "AXThoughtChain",
32232
32244
  __name: "ThoughtChain",
32233
- props: Je({
32245
+ props: qe({
32234
32246
  items: null,
32235
32247
  collapsible: {
32236
32248
  type: Boolean
package/dist/index.umd.js CHANGED
@@ -286,7 +286,7 @@ summary tabindex target title type usemap value width wmode wrap onCopy onCut on
286
286
  onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel
287
287
  onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough
288
288
  onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata
289
- onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),m8="aria-",g8="data-";function T0(e,t){return e.indexOf(t)===0}function uo(e,t=!1){let n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n={...t};const o={};return Object.keys(e).forEach(r=>{(n.aria&&(r==="role"||T0(r,m8))||n.data&&T0(r,g8)||n.attr&&(I0.includes(r)||I0.includes(r.toLowerCase())))&&(o[r]=e[r])}),o}function h8(e){const[t,n]=Ie(e.value.length),o=i.computed(()=>e.value.slice(0,i.unref(t))),r=i.computed(()=>{const l=i.unref(o)[i.unref(o).length-1];return l?l.key:null});i.watch(e,()=>{var l;if(!(i.unref(o).length&&i.unref(o).every((s,c)=>{var u;return s.key===((u=e.value[c])==null?void 0:u.key)}))){if(i.unref(o).length===0)n(1);else for(let s=0;s<i.unref(o).length;s+=1)if(i.unref(o)[s].key!==((l=e.value[s])==null?void 0:l.key)){n(s);break}}},{immediate:!0,deep:!0});const a=ki(l=>{l===i.unref(r)&&n(i.unref(t)+1)});return[o,a]}function v8(e,t){const n=(r,a)=>typeof t.value=="function"?t.value(r,a):t?t.value[r.role]||{}:{};return i.computed(()=>(e.value||[]).map((r,a)=>{const l=r.key??`preset_${a}`;return{...n(r,a),...r,key:l}}))}const y8=1,N0=i.defineComponent({name:"AXBubbleList",inheritAttrs:!1,__name:"BubbleList",props:i.mergeDefaults({prefixCls:null,rootClassName:null,items:null,autoScroll:{type:Boolean},roles:null},{autoScroll:!0}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","items","autoScroll","roles"]);i.toRef(e,"roles"),i.toRef(e,"items"),i.toRef(e,"prefixCls");const o=i.useAttrs(),r=uo(i.mergeProps(n,o),{attr:!0,aria:!0}),a=i.ref(e.items),l=i.ref(e.roles);i.watch(()=>e.items,()=>{a.value=e.items}),i.watch(()=>e.roles,()=>{l.value=e.roles});const s=i.ref(null),c=i.ref({}),{getPrefixCls:u}=Ke(),d=u("bubble",e.prefixCls),f=`${d}-list`,[p,m,v]=$0(d),[g,y]=Ie(!1);i.watchEffect(()=>{y(!0),i.onWatcherCleanup(()=>{y(!1)})});const C=v8(a,l),[S,$]=h8(C),[x,w]=Ie(!0),[P,b]=Ie(0),I=R=>{const B=R.target;w(B.scrollHeight-Math.abs(B.scrollTop)-B.clientHeight<=y8)};i.watch(P,()=>{e.autoScroll&&i.unref(s)&&i.unref(x)&&i.nextTick(()=>{i.unref(s).scrollTo({top:i.unref(s).scrollHeight})})}),i.watch(()=>i.unref(S).length,()=>{var R;if(e.autoScroll){const B=(R=i.unref(S)[i.unref(S).length-2])==null?void 0:R.key,M=i.unref(c)[B];if(M){const{nativeElement:z}=M,{top:O=0,bottom:T=0}=(z==null?void 0:z.getBoundingClientRect())??{},{top:D,bottom:L}=i.unref(s).getBoundingClientRect();O<L&&T>D&&(b(i.unref(P)+1),w(!0))}}});const E=ki(()=>{e.autoScroll&&b(i.unref(P)+1)}),A=i.computed(()=>({onUpdate:E}));return t({nativeElement:s,scrollTo:({key:R,offset:B,behavior:M="smooth",block:z})=>{if(typeof B=="number")i.unref(s).scrollTo({top:B,behavior:M});else if(R!==void 0){const O=i.unref(c)[R];if(O){const T=i.unref(S).findIndex(D=>D.key===R);w(T===i.unref(S).length-1),O.nativeElement.scrollIntoView({behavior:M,block:z})}}}}),()=>p(i.createVNode(f8,{value:A.value},{default:()=>[i.createVNode("div",i.mergeProps(r,{class:re(f,e.rootClassName,m.value,v,{[`${f}-reach-end`]:x.value}),ref:s,onScroll:I}),[i.unref(S).map(({key:R,onTypingComplete:B,...M})=>i.createVNode(O0,i.mergeProps(M,{key:R,ref:z=>{z?c.value[R]=z:delete c.value[R]},typing:g.value?M.typing:!1,onTypingComplete:()=>{B==null||B(),$(R)}}),null))])]}))}}),b8=Object.assign(O0,{List:N0}),C8=i.defineComponent({name:"AXConversationsItem",__name:"ConversationsItem",props:{info:null,prefixCls:null,direction:null,menu:null,active:{type:Boolean},onClick:{type:Function}},setup(e){const t=He(e,["prefixCls","info","class","direction","onClick","active","menu"]);i.toRef(e,"class");const n=i.computed(()=>uo(t,{aria:!0,data:!0,attr:!0})),o=p=>{p.stopPropagation()},r=i.computed(()=>e.info.disabled),[a,l]=Ie(!1),[s,c]=Ie(!1),u=i.computed(()=>re(e.class,`${e.prefixCls}-item`,{[`${e.prefixCls}-item-active`]:e.active&&!r.value},{[`${e.prefixCls}-item-disabled`]:r.value})),d=()=>{!r.value&&e.onClick&&e.onClick(e.info)},f=p=>{p&&c(!p)};return()=>i.createVNode(Ht,{title:e.info.label,open:a.value&&s.value,onOpenChange:c,placement:e.direction==="rtl"?"left":"right"},{default:()=>[i.createVNode("li",i.mergeProps(n.value,{class:u.value,onClick:d}),[e.info.icon&&i.createVNode("div",{class:`${e.prefixCls}-icon`},[e.info.icon]),i.createVNode($e.Text,{class:`${e.prefixCls}-label`,ellipsis:{onEllipsis:l}},{default:()=>[e.info.label]}),e.menu&&!r.value&&i.createVNode(bn,{placement:e.direction==="rtl"?"bottomLeft":"bottomRight",trigger:["click"],disabled:r.value,onOpenChange:f},{default:()=>i.createVNode(Ko,{onClick:o,disabled:r.value,class:`${e.prefixCls}-menu-icon`},null),overlay:()=>i.createVNode(jt,e.menu,null)})])]})}}),E0=Symbol("GroupTitleContext"),bc=i.shallowRef(),S8=e=>{i.provide(E0,e),i.watch(e,()=>{bc.value=i.unref(e),i.triggerRef(bc)},{immediate:!0,deep:!0})},w8=()=>i.inject(E0,i.computed(()=>bc.value||{})),$8=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return S8(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),R0=i.defineComponent({name:"AXConversationsGroupTitle",__name:"GroupTitle",setup(e){const t=i.useSlots(),n=w8(),o=i.computed(()=>{var r;return(r=t.default)==null?void 0:r.call(t)});return()=>i.createVNode("div",{class:re(`${n.value.prefixCls}-group-title`)},[o.value&&i.createVNode($e.Text,null,{default:()=>[o.value]})])}});function A0(e,t){const{defaultValue:n,value:o=i.ref()}=t||{};let r=typeof e=="function"?e():e;o.value!==void 0&&(r=i.unref(o)),n!==void 0&&(r=typeof n=="function"?n():n);const a=i.ref(r),l=i.ref(r);i.watchEffect(()=>{let c=o.value!==void 0?o.value:a.value;t.postState&&(c=t.postState(c)),l.value=c});function s(c){const u=l.value;a.value=c,i.toRaw(l.value)!==c&&t.onChange&&t.onChange(c,u)}return i.watch(o,()=>{a.value=o.value}),[l,s]}const Cc="__ungrouped",x8=(e,t=[])=>{const n=i.computed(()=>{if(!i.toValue(e))return{enableGroup:!1,sort:void 0,title:void 0};let o={sort:void 0,title:void 0};return typeof i.toValue(e)=="object"&&(o={...o,...i.toValue(e)}),{enableGroup:!0,sort:o.sort,title:o.title}});return i.computed(()=>{if(!n.value.enableGroup)return{groupList:[{name:Cc,data:i.toValue(t),title:void 0}],enableGroup:n.value.enableGroup};const o=i.toValue(t).reduce((l,s)=>{const c=s.group||Cc;return l[c]||(l[c]=[]),l[c].push(s),l},{});return{groupList:(n.value.sort?Object.keys(o).sort(n.value.sort):Object.keys(o)).map(l=>({name:l===Cc?void 0:l,title:n.value.title,data:o[l]})),enableGroup:n.value.enableGroup}})},O8=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",gap:e.paddingXXS,overflowY:"auto",padding:e.paddingSM,[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-list`]:{display:"flex",gap:e.paddingXXS,flexDirection:"column",paddingLeft:0,[`& ${t}-item`]:{paddingInlineStart:e.paddingXL},[`& ${t}-label`]:{color:e.colorTextDescription}},[`& ${t}-item`]:{display:"flex",height:e.controlHeightLG,minHeight:e.controlHeightLG,gap:e.paddingXS,padding:`0 ${ft(e.paddingXS)}`,alignItems:"center",borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,"&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{backgroundColor:e.colorBgTextHover,[`& ${t}-label, ${t}-menu-icon`]:{color:e.colorText}},"&-disabled":{cursor:"not-allowed",[`& ${t}-label`]:{color:e.colorTextDisabled}},"&:hover, &-active":{[`& ${t}-menu-icon`]:{opacity:1}}},[`& ${t}-label`]:{flex:1,color:e.colorText},[`& ${t}-menu-icon`]:{opacity:0,fontSize:e.fontSizeXL},[`& ${t}-group-title`]:{display:"flex",alignItems:"center",height:e.controlHeightLG,minHeight:e.controlHeightLG,padding:`0 ${ft(e.paddingXS)}`}}}},P8=Gt("Conversations",e=>{const t=Ct(e,{});return O8(t)},()=>({})),I8=i.defineComponent({name:"AXConversations",__name:"Conversations",props:i.mergeDefaults({items:null,activeKey:null,defaultActiveKey:null,onActiveChange:{type:Function},menu:{type:Function},groupable:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","rootClassName","items","activeKey","defaultActiveKey","onActiveChange","menu","styles","classNames","groupable","class","style"]);i.toRef(e,"class"),i.toRef(e,"activeKey"),i.toRef(e,"prefixCls");const n=i.ref(e.activeKey),o=i.computed(()=>uo(t,{attr:!0,aria:!0,data:!0})),[r,a]=A0(e.defaultActiveKey,{value:n});i.watch(()=>e.activeKey,()=>{n.value=e.activeKey});const l=x8(()=>e.groupable,()=>e.items),{getPrefixCls:s,direction:c}=Ke(),u=i.computed(()=>s("conversations",e.prefixCls)),d=Ut("conversations"),[f,p,m]=P8(u),v=i.computed(()=>re(u.value,d.value.className,e.class,e.rootClassName,p.value,m,{[`${u.value}-rtl`]:c.value==="rtl"})),g=y=>{a(y.key),e.onActiveChange&&e.onActiveChange(y.key)};return()=>f(i.createVNode("ul",i.mergeProps(o.value,{style:{...typeof d.value.style=="object"?d.value.style:{},...typeof e.style=="object"?e.style:{}},class:v.value}),[l.value.groupList.map((y,C)=>{const S=y.data.map(($,x)=>i.createVNode(C8,{key:$.key||`key-${x}`,info:$,prefixCls:u.value,direction:c.value,class:re(e.classNames.item,d.value.classNames.item),style:{...d.value.styles.item,...e.styles.item},menu:typeof e.menu=="function"?e.menu($):e.menu,active:r.value===$.key,onClick:g},null));return l.value.enableGroup?i.createVNode("li",{key:y.name||`key-${C}`},[i.createVNode($8,{value:{prefixCls:u.value}},{default:()=>{var $;return[(($=y.title)==null?void 0:$.call(y,y.name,{components:{GroupTitle:R0}}))||i.createVNode(R0,{key:y.name},{default:()=>[y.name]})]}}),i.createVNode("ul",{class:`${u.value}-list`},[S])]):S})]))}}),T8=e=>{const{componentCls:t,calc:n}=e,o=n(e.fontSizeHeading3).mul(e.lineHeightHeading3).equal(),r=n(e.fontSize).mul(e.lineHeight).equal();return{[t]:{gap:e.padding,[`${t}-icon`]:{height:n(o).add(r).add(e.paddingXXS).equal(),display:"flex",img:{height:"100%"}},[`${t}-content-wrapper`]:{gap:e.paddingXS,flex:"auto",minWidth:0,[`${t}-title-wrapper`]:{gap:e.paddingXS},[`${t}-title`]:{margin:0},[`${t}-extra`]:{marginInlineStart:"auto"}}}}},N8=e=>{const{componentCls:t}=e;return{[t]:{"&-filled":{paddingInline:e.padding,paddingBlock:e.paddingSM,background:e.colorFillContent,borderRadius:e.borderRadiusLG},"&-borderless":{[`${t}-title`]:{fontSize:e.fontSizeHeading3,lineHeight:e.lineHeightHeading3}}}}},E8=Gt("Welcome",e=>{const t=Ct(e,{});return[T8(t),N8(t)]},()=>({}));function R8(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const A8=i.defineComponent({name:"AXWelcome",__name:"Welcome",props:i.mergeDefaults({prefixCls:null,rootClassName:null,className:null,style:null,variant:null,classNames:null,styles:null,icon:null,title:null,description:null,extra:null},{variant:"filled",classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Ke(),r=o("welcome",e.prefixCls),a=Ut("welcome"),[l,s,c]=E8(r),u=i.computed(()=>{const m=t.icon?t.icon():e.icon;if(!m)return null;let v=m;return typeof m=="string"&&m.startsWith("http")&&(v=i.createVNode("img",{src:m,alt:"icon"},null)),i.createVNode("div",{class:re(`${r}-icon`,a.value.classNames.icon,e.classNames.icon),style:e.styles.icon},[v])}),d=i.computed(()=>{const m=t.title?t.title():e.title;return m?i.createVNode($e.Title,{level:4,class:re(`${r}-title`,a.value.classNames.title,e.classNames.title),style:e.styles.title},R8(m)?m:{default:()=>[m]}):null}),f=i.computed(()=>t.description?t.description():e.description),p=i.computed(()=>{const m=t.extra?t.extra():e.extra;return m?i.createVNode("div",{class:re(`${r}-extra`,a.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[m]):null});return()=>l(i.createVNode(sr,{class:re(r,a.value.className,e.className,e.rootClassName,s.value,c,`${r}-${e.variant}`,{[`${r}-rtl`]:n.value==="rtl"}),style:e.style},{default:()=>[u.value,i.createVNode(sr,{vertical:!0,class:`${r}-content-wrapper`},{default:()=>[t.extra||e.extra?i.createVNode(sr,{align:"flex-start",class:`${r}-title-wrapper`},{default:()=>[d.value,p.value]}):d.value,f.value&&i.createVNode($e.Text,{class:re(`${r}-description`,a.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[f.value]})]})]}))}}),M8=e=>{const{componentCls:t}=e;return{[t]:{"&, & *":{boxSizing:"border-box"},maxWidth:"100%",[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-title`]:{marginBlockStart:0,fontWeight:"normal",color:e.colorTextTertiary},[`& ${t}-list`]:{display:"flex",gap:e.paddingSM,overflowX:"scroll","&::-webkit-scrollbar":{display:"none"},listStyle:"none",paddingInlineStart:0,marginBlock:0,alignItems:"stretch","&-wrap":{flexWrap:"wrap"},"&-vertical":{flexDirection:"column",alignItems:"flex-start"}},[`${t}-item`]:{flex:"none",display:"flex",gap:e.paddingXS,height:"auto",paddingBlock:e.paddingSM,paddingInline:e.padding,alignItems:"flex-start",justifyContent:"flex-start",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,transition:["border","background"].map(n=>`${n} ${e.motionDurationSlow}`).join(","),border:`${ft(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,[`&:not(${t}-item-has-nest)`]:{"&:hover":{cursor:"pointer",background:e.colorFillTertiary},"&:active":{background:e.colorFill}},[`${t}-content`]:{flex:"auto",minWidth:0,display:"flex",gap:e.paddingXXS,flexDirection:"column",alignItems:"flex-start"},[`${t}-icon, ${t}-label, ${t}-desc`]:{margin:0,padding:0,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start",whiteSpace:"normal"},[`${t}-label`]:{color:e.colorTextHeading,fontWeight:500},[`${t}-label + ${t}-desc`]:{color:e.colorTextTertiary},[`&${t}-item-disabled`]:{pointerEvents:"none",background:e.colorBgContainerDisabled,[`${t}-label, ${t}-desc`]:{color:e.colorTextTertiary}}}}}},V8=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-item-has-nest`]:{[`> ${t}-content`]:{[`> ${t}-label`]:{fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}}},[`&${t}-nested`]:{marginTop:e.paddingXS,alignSelf:"stretch",[`${t}-list`]:{alignItems:"stretch"},[`${t}-item`]:{border:0,background:e.colorFillQuaternary}}}}},D8=Gt("Prompts",e=>{const t=Ct(e,{});return[M8(t),V8(t)]},()=>({})),M0=i.defineComponent({name:"AXPrompts",__name:"Prompts",props:i.mergeDefaults({items:null,title:null,onItemClick:{type:Function},vertical:{type:Boolean},wrap:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","title","class","items","onItemClick","vertical","wrap","rootClassName","styles","classNames","style"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.useSlots(),{getPrefixCls:o,direction:r}=Ke(),a=o("prompts",e.prefixCls),l=Ut("prompts"),[s,c,u]=D8(a),d=i.computed(()=>re(a,l.value.className,e.class,e.rootClassName,c.value,u,{[`${a}-rtl`]:r.value==="rtl"})),f=i.computed(()=>re(`${a}-list`,l.value.classNames.list,e.classNames.list,{[`${a}-list-wrap`]:e.wrap},{[`${a}-list-vertical`]:e.vertical})),p=i.computed(()=>n.title?n.title():e.title);return()=>{var m;return s(i.createVNode("div",i.mergeProps(t,{class:d.value,style:{...typeof e.style=="object"?e.style:{},...typeof l.value.style=="object"?l.value.style:{}}}),[p.value&&i.createVNode($e.Title,{level:5,class:re(`${a}-title`,l.value.classNames.title,e.classNames.title),style:{...l.value.styles.title,...e.styles.title}},{default:()=>[p.value]}),i.createVNode("div",{class:f.value,style:{...l.value.styles.list,...e.styles.list}},[(m=e.items)==null?void 0:m.map((v,g)=>{const y=v.children&&v.children.length>0;return i.createVNode("div",{key:v.key||`key_${g}`,style:{...l.value.styles.item,...e.styles.item},class:re(`${a}-item`,l.value.classNames.item,e.classNames.item,{[`${a}-item-disabled`]:v.disabled,[`${a}-item-has-nest`]:y}),onClick:()=>{!y&&e.onItemClick&&e.onItemClick({data:v})}},[v.icon&&i.createVNode("div",{class:`${a}-icon`},[v.icon]),i.createVNode("div",{class:re(`${a}-content`,l.value.classNames.itemContent,e.classNames.itemContent),style:{...l.value.styles.itemContent,...e.styles.itemContent}},[v.label&&i.createVNode("h6",{class:`${a}-label`},[v.label]),v.description&&i.createVNode("p",{class:`${a}-desc`},[v.description]),y&&i.createVNode(M0,{class:`${a}-nested`,items:v.children,vertical:!0,onItemClick:e.onItemClick,classNames:{list:e.classNames.subList,item:e.classNames.subItem},styles:{list:e.styles.subList,item:e.styles.subItem}},null)])])})])]))}}}),B8=e=>{const{componentCls:t,antCls:n}=e;return{[t]:{[`${n}-cascader-menus ${n}-cascader-menu`]:{height:"auto"},[`${t}-item`]:{"&-icon":{marginInlineEnd:e.paddingXXS},"&-extra":{marginInlineStart:e.padding}},[`&${t}-block`]:{[`${t}-item-extra`]:{marginInlineStart:"auto"}}}}},L8=Gt("Suggestion",e=>{const t=Ct(e,{});return B8(t)},()=>({}));function z8(e,t,n,o,r){const[a,l]=Ie([]),s=(m,v=a.value)=>{let g=i.toValue(e);for(let y=0;y<m-1;y+=1){const C=v[y],S=g.find($=>$.value===C);if(!S)break;g=S.children||[]}return g},c=m=>m.map((v,g)=>{const C=s(g+1,m).find(S=>S.value===v);return C==null?void 0:C.value}),u=m=>{const v=a.value.length||1,g=s(v),y=g.findIndex($=>$.value===a.value[v-1]),C=g.length,S=g[(y+m+C)%C];l([...a.value.slice(0,v-1),S.value])},d=()=>{a.value.length>1&&l(a.value.slice(0,a.value.length-1))},f=()=>{const m=s(a.value.length+1);m.length&&l([...a.value,m[0].value])},p=ki(m=>{if(i.toValue(t))switch(console.log("e.key",m),m.key){case"ArrowDown":u(1),m.preventDefault();break;case"ArrowUp":u(-1),m.preventDefault();break;case"ArrowRight":i.toValue(n)?d():f(),m.preventDefault();break;case"ArrowLeft":i.toValue(n)?f():d(),m.preventDefault();break;case"Enter":s(a.value.length+1).length||o(c(a.value)),m.preventDefault();break;case"Escape":r(),m.preventDefault();break}});return i.watch(()=>i.toValue(t),()=>{i.toValue(t)&&l([i.toValue(e)[0].value])},{immediate:!0}),[a,p]}const F8=i.defineComponent({name:"AXSuggestion",__name:"Suggestion",props:i.mergeDefaults({prefixCls:null,className:null,rootClassName:null,style:null,children:{type:Function},open:{type:Boolean},onOpenChange:{type:Function},items:{type:Function},onSelect:{type:Function},block:{type:Boolean},styles:null,classNames:null},{open:!1}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Ke(),r=i.computed(()=>o("suggestion",e.prefixCls));`${r.value}`;const a=i.computed(()=>n.value==="rtl"),l=Ut("suggestion"),[s,c,u]=L8(r),[d,f]=Ie(e.open),[p,m]=Ie(),v=P=>{var b;f(P),(b=e.onOpenChange)==null||b.call(e,P)},g=P=>{P===!1?v(!1):(m(P),v(!0))},y=()=>{v(!1)},C=i.computed(()=>typeof e.items=="function"?e.items(p.value):e.items),S=P=>{e.onSelect&&e.onSelect(P[P.length-1]),v(!1)},[$,x]=z8(C,d,a,S,y),w=i.computed(()=>{var P;return t.default?t.default({onTrigger:g,onKeyDown:x}):(P=e.children)==null?void 0:P.call(e,{onTrigger:g,onKeyDown:x})});return()=>s(i.createVNode(k4,{options:C.value,open:d.value,value:$.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:P=>{P||y()},class:re(e.rootClassName,r.value,c,u,{[`${r.value}-block`]:e.block}),onChange:S,dropdownMatchSelectWidth:e.block},{default:()=>i.createVNode("div",{class:re(r.value,l.value.className,e.rootClassName,e.className,`${r.value}-wrapper`,c.value,u),style:{...l.value.style,...e.style}},[w.value])}))}}),V0=Symbol("SenderHeaderContext"),Sc=i.shallowRef(),H8=e=>{i.provide(V0,e),i.watch(e,()=>{Sc.value=i.unref(e),i.triggerRef(Sc)},{immediate:!0,deep:!0})},_8=()=>i.inject(V0,i.computed(()=>Sc.value||{})),j8=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return H8(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),D0=Symbol("ActionButtonContext"),wc=i.shallowRef(),W8=e=>{i.provide(D0,e),i.watch(e,()=>{wc.value=i.unref(e),i.triggerRef(wc)},{immediate:!0,deep:!0})},$c=()=>i.inject(D0,i.computed(()=>wc.value||{})),k8=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return W8(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),Ki=i.defineComponent({name:"AXSenderActionButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null,action:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["action","type","disabled","onClick"]);i.toRef(e,"onClick"),i.toRef(e,"disabled");const n=i.useSlots(),o=$c(),r=i.computed(()=>{var u;const s=o.value.disabled,c=(u=o.value)==null?void 0:u[`${e.action}Disabled`];return s??e.disabled??c}),a=i.computed(()=>o.value.prefixCls),l=i.computed(()=>{var s;return(s=o.value)==null?void 0:s[e.action]});return()=>i.createVNode(We,i.mergeProps({type:e.type},t,{onClick:s=>{r.value||(l.value&&l.value(),e.onClick&&!Array.isArray(e.onClick)&&e.onClick(s))},class:re(a.value,{[`${a.value}-disabled`]:r.value})}),{icon:()=>n.default()})}}),K8=i.defineComponent({name:"AXSenderClearButton",__name:"ClearButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{disabled:void 0}),setup(e){const t=He(e,["disabled"]);return()=>i.createVNode(Ki,i.mergeProps({disabled:e.disabled},t,{action:"onClear"}),{default:()=>[i.createVNode(Gs,null,null)]})}}),U8=i.defineComponent({name:"AXSenderStopLoading",__name:"StopLoading",props:{className:null},setup(e){const t=e;return()=>i.createVNode("svg",{color:"currentColor",viewBox:"0 0 1000 1000",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:t.className},[i.createVNode("title",null,[i.createTextVNode("Stop Loading")]),i.createVNode("rect",{fill:"currentColor",height:"250",rx:"24",ry:"24",width:"250",x:"375",y:"375"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100",opacity:"0.45"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100","stroke-dasharray":"600 9999999"},[i.createVNode("animateTransform",{attributeName:"transform",dur:"1s",from:"0 500 500",repeatCount:"indefinite",to:"360 500 500",type:"rotate"},null)])])}}),B0=i.defineComponent({name:"AXSenderLoadingButton",__name:"LoadingButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",icon:null,disabled:void 0}),setup(e){const t=He(e,["type","shape","icon","disabled"]),n=$c(),{token:o}=cr.useToken();return()=>i.createVNode(Ki,i.mergeProps({type:e.type,disabled:e.disabled,shape:e.shape},t,{style:{backgroundColor:"transparent",color:o.value.colorPrimary},class:re(`${n.value.prefixCls}-loading-button`),action:"onCancel"}),{default:()=>[i.createVNode(U8,{className:`${n.value.prefixCls}-loading-icon`},null)]})}}),L0=i.defineComponent({name:"AXSenderLoadingButton",__name:"SendButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",disabled:void 0}),setup(e){const t=He(e,["type","shape","disabled"]);return()=>i.createVNode(Ki,i.mergeProps({type:e.type,shape:e.shape,disabled:e.disabled},t,{action:"onSend"}),{default:()=>[i.createVNode(Ks,null,null)]})}}),pr=1e3,mr=4,Ui=140,Xi=250,z0=500,Gi=.8,X8=i.defineComponent({name:"AXSenderRecordingIcon",__name:"RecordingIcon",props:{className:null},setup(e){const t=Ui/2;return()=>i.createVNode("svg",{color:"currentColor",viewBox:`0 0 ${pr} ${pr}`,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:e.className},[i.createVNode("title",null,[i.createTextVNode("Speech Recording")]),Array.from({length:mr}).map((n,o)=>{const r=(pr-Ui*mr)/(mr-1),a=o*(r+Ui),l=pr/2-Xi/2,s=pr/2-z0/2;return i.createVNode("rect",{fill:"currentColor",rx:t,ry:t,height:Xi,width:Ui,x:a,y:l,key:o},[i.createVNode("animate",{attributeName:"height",values:`${Xi}; ${z0}; ${Xi}`,keyTimes:"0; 0.5; 1",dur:`${Gi}s`,begin:`${Gi/mr*o}s`,repeatCount:"indefinite"},null),i.createVNode("animate",{attributeName:"y",values:`${l}; ${s}; ${l}`,keyTimes:"0; 0.5; 1",dur:`${Gi}s`,begin:`${Gi/mr*o}s`,repeatCount:"indefinite"},null)])})])}}),G8=i.defineComponent({name:"AXSenderSpeechButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["type","disabled"]),n=$c(),{token:o}=cr.useToken(),r=i.computed(()=>n.value.speechRecording),a=i.computed(()=>n.value.prefixCls),l=i.computed(()=>{let s;return r.value?s=i.createVNode(X8,{className:`${a.value}-recording-icon`},null):n.value.onSpeechDisabled?s=i.createVNode(Us,null,null):s=i.createVNode(Xs,null,null),s});return()=>i.createVNode(Ki,i.mergeProps({type:e.type,disabled:e.disabled},t,{style:{display:"flex",justifyContent:"center",alignItems:"center",color:o.value.colorPrimary},action:"onSpeech"}),{default:()=>[l.value]})}}),q8=e=>{const{componentCls:t,calc:n}=e,o=`${t}-header`;return{[t]:{[o]:{borderBottomWidth:e.lineWidth,borderBottomStyle:"solid",borderBottomColor:e.colorBorder,"&-header":{background:e.colorFillAlter,fontSize:e.fontSize,lineHeight:e.lineHeight,paddingBlock:n(e.paddingSM).sub(e.lineWidthBold).equal(),paddingInlineStart:e.padding,paddingInlineEnd:e.paddingXS,display:"flex",[`${o}-title`]:{flex:"auto"}},"&-content":{padding:e.padding},"&-motion":{transition:["height","border"].map(r=>`${r} ${e.motionDurationSlow}`).join(","),overflow:"hidden","&-enter-start, &-leave-active":{borderBottomColor:"transparent"},"&-hidden":{display:"none"}},"&-collapse-transition":{"&-enter-active":{transition:["max-height","padding-top","padding-bottom"].map(r=>`${r} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")},"&-leave-active":{transition:["max-height","padding-top","padding-bottom"].map(r=>`${r} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")}}}}}},Y8=e=>{const{componentCls:t,padding:n,paddingSM:o,paddingXS:r,lineWidth:a,lineWidthBold:l,calc:s}=e;return{[t]:{position:"relative",width:"100%",boxSizing:"border-box",boxShadow:`${e.boxShadowTertiary}`,transition:`background ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:s(e.borderRadius).mul(2).equal()},borderColor:e.colorBorder,borderWidth:0,borderStyle:"solid","&:after":{content:'""',position:"absolute",inset:0,pointerEvents:"none",transition:`border-color ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:"inherit"},borderStyle:"inherit",borderColor:"inherit",borderWidth:a},"&:focus-within":{boxShadow:`${e.boxShadowSecondary}`,borderColor:e.colorPrimary,"&:after":{borderWidth:l}},"&-disabled":{background:e.colorBgContainerDisabled},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{display:"flex",gap:r,width:"100%",paddingBlock:o,paddingInlineStart:n,paddingInlineEnd:o,boxSizing:"border-box",alignItems:"flex-end"},[`${t}-prefix`]:{flex:"none"},[`${t}-input`]:{padding:0,borderRadius:0,flex:"auto",alignSelf:"center",minHeight:"auto"},[`${t}-actions-list`]:{flex:"none",display:"flex","&-presets":{gap:e.paddingXS}},[`${t}-actions-btn`]:{"&-disabled":{opacity:.45},"&-loading-button":{padding:0,border:0},"&-loading-icon":{height:e.controlHeight,width:e.controlHeight,verticalAlign:"top"},"&-recording-icon":{height:"1.2em",width:"1.2em",verticalAlign:"top"}}}}},Z8=Gt("Sender",e=>{const{paddingXS:t,calc:n}=e,o=Ct(e,{SenderContentMaxWidth:`calc(100% - ${ft(n(t).add(32).equal())})`});return[Y8(o),q8(o)]},()=>({}));let qi;!qi&&typeof window<"u"&&(qi=window.SpeechRecognition||window.webkitSpeechRecognition);function Q8(e,t){const n=e,o=i.computed(()=>{const g=i.toValue(t);return typeof g=="object"?{controlledRecording:g.recording,onControlledRecordingChange:g.onRecordingChange,speechInControlled:typeof g.recording=="boolean"}:{controlledRecording:void 0,onControlledRecordingChange:void 0,speechInControlled:!1}}),r=i.computed(()=>o.value.controlledRecording),a=o.value.onControlledRecordingChange,l=o.value.speechInControlled,s=i.ref(null);i.watchEffect(()=>{if(typeof navigator<"u"&&"permissions"in navigator){let g=null;navigator.permissions.query({name:"microphone"}).then(y=>{s.value=y.state,y.onchange=function(){s.value=this.state},g=y}),i.onWatcherCleanup(()=>{g&&(g.onchange=null)})}});const c=i.computed(()=>qi&&s.value!=="denied"),u=i.ref(null),[d,f]=A0(!1,{value:r}),p=i.ref(!1),m=()=>{if(c.value&&!u.value){const g=new qi;g.onstart=()=>{f(!0)},g.onend=()=>{f(!1)},g.onresult=y=>{var C,S,$;if(!p.value){const x=($=(S=(C=y.results)==null?void 0:C[0])==null?void 0:S[0])==null?void 0:$.transcript;n(x)}p.value=!1},u.value=g}};return{speechPermission:c,triggerSpeech:g=>{g&&!d.value||(p.value=g,l?a==null||a(!d.value):(m(),u.value&&(d.value?(u.value.stop(),a==null||a(!1)):(u.value.start(),a==null||a(!0)))))},recording:d}}function J8(e,t){for(var n=e,o=0;o<t.length;o+=1){if(n==null)return;n=n[t[o]]}return n}const eR=i.defineComponent({name:"AXSender",__name:"Sender",props:{onKeyPress:{},prefixCls:{},defaultValue:{},value:{},loading:{type:Boolean},placeholder:{},readOnly:{type:Boolean},submitType:{type:[String,Boolean],default:"enter"},disabled:{type:Boolean,default:void 0},onSubmit:{},onChange:{},onCancel:{},onKeyDown:{},onPaste:{},onPasteFile:{},components:{},styles:{default:()=>({})},rootClassName:{},classNames:{default:()=>({})},style:{},className:{},actions:{},allowSpeech:{},prefix:{},header:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const o=He(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","header","onPaste","onPasteFile"]);i.toRef(e,"prefixCls");function r(X,J,te){return J8(X,J)||te}const a=n,l=i.useSlots(),{direction:s,getPrefixCls:c}=Ke(),u=i.computed(()=>c("sender",e.prefixCls)),d=i.ref(null),f=i.ref(null),p=Ut("sender"),m=i.computed(()=>`${u.value}-input`),[v,g,y]=Z8(u.value),C=i.computed(()=>re(u.value,p.value.className,e.className,e.rootClassName,g.value,y,{[`${u.value}-rtl`]:s.value==="rtl",[`${u.value}-disabled`]:e.disabled})),S=i.computed(()=>`${u.value}-actions-btn`),$=i.computed(()=>`${u.value}-actions-list`),x=i.ref(e.value??e.defaultValue??""),w=X=>{x.value=X};i.watch(()=>e.value,()=>{w(e.value)});const P=(X,J)=>{w(X),a("update:value",X),e.onChange&&e.onChange(X,J)},{speechPermission:b,triggerSpeech:I,recording:E}=Q8(X=>{P(`${x.value} ${X}`)},()=>e.allowSpeech),A=r(e.components,["input"],Ee.TextArea),R=i.computed(()=>uo(o,{attr:!0,aria:!0,data:!0})),B=i.computed(()=>({...R.value,ref:f})),M=()=>{x.value&&e.onSubmit&&!e.loading&&e.onSubmit(x.value)},z=()=>{P("")},O=i.ref(!1),T=()=>{O.value=!0},D=()=>{O.value=!1},L=X=>{const J=X.key==="Enter"&&!O.value;switch(e.submitType){case"enter":J&&!X.shiftKey&&(X.preventDefault(),M());break;case"shiftEnter":J&&X.shiftKey&&(X.preventDefault(),M());break}e.onKeyPress&&e.onKeyPress(X)},N=X=>{var te,U;const J=(te=X.clipboardData)==null?void 0:te.files[0];J&&e.onPasteFile&&(e.onPasteFile(J),X.preventDefault()),(U=e.onPaste)==null||U.call(e,X)},H=X=>{var J,te;X.target!==((J=d.value)==null?void 0:J.querySelector(`.${m.value}`))&&X.preventDefault(),(te=f.value)==null||te.focus()},j=i.computed(()=>{let X=i.createVNode(sr,{class:`${$.value}-presets`},{default:()=>[e.allowSpeech&&i.createVNode(G8,null,null),e.loading?i.createVNode(B0,null,null):i.createVNode(L0,null,null)]});const J={components:{SendButton:L0,ClearButton:K8,LoadingButton:B0}};return l.actions?X=l.actions({ori:X,info:J}):typeof e.actions=="function"?X=e.actions(X,J):e.actions&&(X=e.actions),X}),Y=i.computed(()=>l.header?l.header():e.header),Z=i.computed(()=>l.prefix?l.prefix():e.prefix);return t({nativeElement:d.value,focus:X=>{var J;return(J=f.value)==null?void 0:J.focus(X)},blur:()=>{var X;return(X=f.value)==null?void 0:X.blur()}}),()=>v(i.createVNode("div",{ref:d,class:C.value,style:{...p.value.style,...e.style}},[Y.value&&i.createVNode(j8,{value:{prefixCls:u.value}},{default:()=>[Y.value]}),i.createVNode("div",{class:`${u.value}-content`,onMousedown:H},[Z.value&&i.createVNode("div",{class:re(`${u.value}-prefix`,p.value.classNames.prefix,e.classNames.prefix),style:{...p.value.styles.prefix,...e.styles.prefix}},[Z.value]),i.createVNode(A,i.mergeProps(B.value,{disabled:e.disabled,style:{...p.value.styles.input,...e.styles.input},class:re(m.value,p.value.classNames.input,e.classNames.input),autoSize:{maxRows:8},value:x.value,onChange:X=>{P(X.target.value,X),I(!0)},onPressEnter:L,onCompositionstart:T,onCompositionend:D,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:N,bordered:!1,readOnly:e.readOnly}),null),i.createVNode("div",{class:re($.value,p.value.classNames.actions,e.classNames.actions),style:{...p.value.styles.actions,...e.styles.actions}},[i.createVNode(k8,{value:{prefixCls:S.value,onSend:M,onSendDisabled:!x.value,onClear:z,onClearDisabled:!x.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>I(!1),onSpeechDisabled:!b.value,speechRecording:E.value,disabled:e.disabled}},{default:()=>[j.value]})])])]))}}),tR=i.defineComponent({name:"AXCollapseTransition",__name:"CollapseTransition",props:{prefixCls:null},setup(e){const t=e,n=i.computed(()=>t.prefixCls+"-collapse-transition"),o={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){r.dataset.oldOverflow=r.style.overflow,r.scrollHeight!==0?(r.style.maxHeight=`${r.scrollHeight}px`,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom):(r.style.maxHeight=`${r.dataset.oldMaxHeight||999}px`,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom),r.style.overflow="hidden"},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldMaxHeight=r.scrollHeight,r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.overflow="hidden",r.style.maxHeight=`${r.scrollHeight}px`},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom}};return(r,a)=>(i.openBlock(),i.createBlock(i.Transition,i.mergeProps({name:n.value},i.toHandlers(o)),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}}),nR=i.defineComponent({name:"AXSenderHeader",inheritAttrs:!1,__name:"SenderHeader",props:i.mergeDefaults({forceRender:{type:Boolean},open:{type:Boolean},onOpenChange:{type:Function},title:null,children:null,className:null,style:null,classNames:null,styles:null,closable:{type:Boolean}},{classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"classNames");const t=i.useSlots(),n=_8(),o=i.computed(()=>`${n.value.prefixCls}-header`),r=i.useAttrs();return()=>i.createVNode(tR,{prefixCls:o.value},{default:()=>{var a;return[e.open&&i.createVNode("div",i.mergeProps(r,{class:re(o.value,e.className),style:{...e.style}}),[(e.closable!==!1||e.title)&&i.createVNode("div",{class:re(`${o.value}-header`,e.classNames.header),style:{...e.styles.header}},[i.createVNode("div",{class:`${o.value}-title`},[e.title]),e.closable!==!1&&i.createVNode("div",{class:`${o.value}-close`},[i.createVNode(We,{type:"text",icon:i.createVNode(Ft,null,null),size:"small",onClick:()=>{var l;(l=e.onOpenChange)==null||l.call(e,!e.open)}},null)])]),t.default&&i.createVNode("div",{class:re(`${o.value}-content`,e.classNames.content),style:{...e.styles.content}},[(a=t.default)==null?void 0:a.call(t)])])]}})}}),oR=Object.assign(eR,{Header:nR}),F0=Symbol("AttachmentContext"),xc=i.shallowRef(),rR=e=>{i.provide(F0,e),i.watch(e,()=>{xc.value=i.unref(e),i.triggerRef(xc)},{immediate:!0,deep:!0})},Yi=()=>i.inject(F0,i.computed(()=>xc.value||{})),iR=i.defineComponent({inheritAttrs:!1,props:{value:St()},setup(e,{slots:t}){return rR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),aR=i.defineComponent({name:"AXAttachmentsPlaceholderUploader",__name:"PlaceholderUploader",props:i.mergeDefaults({prefixCls:null,placeholder:null,upload:null,className:null,style:null},{placeholder:()=>({})}),setup(e,{expose:t}){const n=`${e.prefixCls}-placeholder`,o=i.computed(()=>e.placeholder||{}),r=i.useTemplateRef("upload-dragger"),a=Yi(),[l,s]=Ie(!1),c=()=>{s(!0)},u=p=>{p.currentTarget.contains(p.relatedTarget)||s(!1)},d=()=>{s(!1)};t({nativeElement:r});const f=i.computed(()=>i.isVNode(e.placeholder)?e.placeholder:i.createVNode(sr,{align:"center",justify:"center",vertical:!0,class:`${n}-inner`},{default:()=>[i.createVNode($e.Text,{class:`${n}-icon`},{default:()=>[o.value.icon]}),i.createVNode($e.Title,{class:`${n}-title`,level:5},{default:()=>[o.value.title]}),i.createVNode($e.Text,{class:`${n}-description`,type:"secondary"},{default:()=>[o.value.description]})]}));return()=>i.createVNode("div",{class:re(n,{[`${n}-drag-in`]:l.value,[`${n}-disabled`]:a.value.disabled},e.className),onDragenter:c,onDragleave:u,onDrop:d,"aria-hidden":a.value.disabled,style:e.style},[i.createVNode(wh.Dragger,i.mergeProps({showUploadList:!1},e.upload,{ref:"upload-dragger",style:{padding:0,border:0,background:"transparent"}}),{default:()=>[f.value]})])}}),H0=i.defineComponent({name:"AXAttachmentsDropArea",__name:"DropArea",props:{prefixCls:null,className:null,getDropContainer:{type:Function},children:null},setup(e){const t=Yi(),[n,o]=Ie(),[r,a]=Ie(null);i.watch(()=>e.getDropContainer,()=>{var u;const c=(u=e.getDropContainer)==null?void 0:u.call(e);n.value!==c&&o(c)}),i.watch(()=>!!n.value,()=>{if(n.value){const c=()=>{a(!0)},u=p=>{p.preventDefault()},d=p=>{p.relatedTarget||a(!1)},f=p=>{a(!1),p.preventDefault()};document.addEventListener("dragenter",c),document.addEventListener("dragover",u),document.addEventListener("dragleave",d),document.addEventListener("drop",f),i.onWatcherCleanup(()=>{document.removeEventListener("dragenter",c),document.removeEventListener("dragover",u),document.removeEventListener("dragleave",d),document.removeEventListener("drop",f)})}});const l=i.computed(()=>e.getDropContainer&&n.value&&!t.value.disabled),s=`${e.prefixCls}-drop-area`;return()=>l.value?i.createVNode(i.Teleport,{to:n.value},{default:()=>[i.createVNode("div",{class:re(s,e.className,{[`${s}-on-body`]:n.value.tagName==="BODY"}),style:{display:r.value?"block":"none"}},[e.children])]}):null}}),_0=i.defineComponent({name:"AXAttachmentsSilentUploader",__name:"SilentUploader",props:{children:null,upload:null,rootClassName:null},setup(e,{expose:t}){const n=i.useTemplateRef("upload");return t({nativeElement:n}),()=>i.createVNode(wh,i.mergeProps(e.upload,{showUploadList:!1,ref:"upload"}),{default:()=>[e.children]})}}),j0=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},lR={},sR={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function cR(e,t){return i.openBlock(),i.createElementBlock("svg",sR,t[0]||(t[0]=[i.createElementVNode("title",null,"audio",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M10.7315824,7.11216117 C10.7428131,7.15148751 10.7485063,7.19218979 10.7485063,7.23309113 L10.7485063,8.07742614 C10.7484199,8.27364959 10.6183424,8.44607275 10.4296853,8.50003683 L8.32984514,9.09986306 L8.32984514,11.7071803 C8.32986605,12.5367078 7.67249692,13.217028 6.84345686,13.2454634 L6.79068592,13.2463395 C6.12766108,13.2463395 5.53916361,12.8217001 5.33010655,12.1924966 C5.1210495,11.563293 5.33842118,10.8709227 5.86959669,10.4741173 C6.40077221,10.0773119 7.12636292,10.0652587 7.67042486,10.4442027 L7.67020842,7.74937024 L7.68449368,7.74937024 C7.72405122,7.59919041 7.83988806,7.48101083 7.98924584,7.4384546 L10.1880418,6.81004755 C10.42156,6.74340323 10.6648954,6.87865515 10.7315824,7.11216117 Z M9.60714286,1.31785714 L12.9678571,4.67857143 L9.60714286,4.67857143 L9.60714286,1.31785714 Z",fill:"currentColor"})],-1)]))}const uR=j0(lR,[["render",cR]]),dR={},fR={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function pR(e,t){return i.openBlock(),i.createElementBlock("svg",fR,t[0]||(t[0]=[i.createElementVNode("title",null,"video",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M12.9678571,4.67857143 L9.60714286,1.31785714 L9.60714286,4.67857143 L12.9678571,4.67857143 Z M10.5379461,10.3101106 L6.68957555,13.0059749 C6.59910784,13.0693494 6.47439406,13.0473861 6.41101953,12.9569184 C6.3874624,12.9232903 6.37482581,12.8832269 6.37482581,12.8421686 L6.37482581,7.45043999 C6.37482581,7.33998304 6.46436886,7.25043999 6.57482581,7.25043999 C6.61588409,7.25043999 6.65594753,7.26307658 6.68957555,7.28663371 L10.5379461,9.98249803 C10.6284138,10.0458726 10.6503772,10.1705863 10.5870027,10.2610541 C10.5736331,10.2801392 10.5570312,10.2967411 10.5379461,10.3101106 Z",fill:"currentColor"})],-1)]))}const mR=j0(dR,[["render",pR]]),gR=e=>e.indexOf("image/")===0,Zi=200;function hR(e){return new Promise(t=>{if(!e||!e.type||!gR(e.type)){t("");return}const n=new Image;if(n.onload=()=>{const{width:o,height:r}=n,a=o/r,l=a>1?Zi:Zi*a,s=a>1?Zi/a:Zi,c=document.createElement("canvas");c.width=l,c.height=s,c.style.cssText=`position: fixed; left: 0; top: 0; width: ${l}px; height: ${s}px; z-index: 9999; display: none;`,document.body.appendChild(c),c.getContext("2d").drawImage(n,0,0,l,s);const d=c.toDataURL();document.body.removeChild(c),window.URL.revokeObjectURL(n.src),t(d)},n.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(n.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else n.src=window.URL.createObjectURL(e)})}const Re=Math.round;function Oc(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],o=n.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)o[r]=t(o[r]||0,n[r]||"",r);return n[3]?o[3]=n[3].includes("%")?o[3]/100:o[3]:o[3]=1,o}const W0=(e,t,n)=>n===0?e:e/100;function gr(e,t){const n=t||255;return e>n?n:e<0?0:e}class Pc{constructor(t){Xe(this,"isValid",!0),Xe(this,"r",0),Xe(this,"g",0),Xe(this,"b",0),Xe(this,"a",1),Xe(this,"_h",void 0),Xe(this,"_s",void 0),Xe(this,"_l",void 0),Xe(this,"_v",void 0),Xe(this,"_max",void 0),Xe(this,"_min",void 0),Xe(this,"_brightness",void 0);function n(o){return o[0]in t&&o[1]in t&&o[2]in t}if(t)if(typeof t=="string"){let r=function(a){return o.startsWith(a)};const o=t.trim();/^#?[A-F\d]{3,8}$/i.test(o)?this.fromHexString(o):r("rgb")?this.fromRgbString(o):r("hsl")?this.fromHslString(o):(r("hsv")||r("hsb"))&&this.fromHsvString(o)}else if(t instanceof Pc)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=gr(t.r),this.g=gr(t.g),this.b=gr(t.b),this.a=typeof t.a=="number"?gr(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(a){const l=a/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=t(this.r),o=t(this.g),r=t(this.b);return .2126*n+.7152*o+.0722*r}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=Re(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()-t/100;return r<0&&(r=0),this._c({h:n,s:o,l:r,a:this.a})}lighten(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()+t/100;return r>1&&(r=1),this._c({h:n,s:o,l:r,a:this.a})}mix(t,n=50){const o=this._c(t),r=n/100,a=s=>(o[s]-this[s])*r+this[s],l={r:Re(a("r")),g:Re(a("g")),b:Re(a("b")),a:Re(a("a")*100)/100};return this._c(l)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),o=this.a+n.a*(1-this.a),r=a=>Re((this[a]*this.a+n[a]*n.a*(1-this.a))/o);return this._c({r:r("r"),g:r("g"),b:r("b"),a:o})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const o=(this.g||0).toString(16);t+=o.length===2?o:"0"+o;const r=(this.b||0).toString(16);if(t+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const a=Re(this.a*255).toString(16);t+=a.length===2?a:"0"+a}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=Re(this.getSaturation()*100),o=Re(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${o}%,${this.a})`:`hsl(${t},${n}%,${o}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,o){const r=this.clone();return r[t]=gr(n,o),r}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function o(r,a){return parseInt(n[r]+n[a||r],16)}n.length<6?(this.r=o(0),this.g=o(1),this.b=o(2),this.a=n[3]?o(3)/255:1):(this.r=o(0,1),this.g=o(2,3),this.b=o(4,5),this.a=n[6]?o(6,7)/255:1)}fromHsl({h:t,s:n,l:o,a:r}){if(this._h=t%360,this._s=n,this._l=o,this.a=typeof r=="number"?r:1,n<=0){const p=Re(o*255);this.r=p,this.g=p,this.b=p}let a=0,l=0,s=0;const c=t/60,u=(1-Math.abs(2*o-1))*n,d=u*(1-Math.abs(c%2-1));c>=0&&c<1?(a=u,l=d):c>=1&&c<2?(a=d,l=u):c>=2&&c<3?(l=u,s=d):c>=3&&c<4?(l=d,s=u):c>=4&&c<5?(a=d,s=u):c>=5&&c<6&&(a=u,s=d);const f=o-u/2;this.r=Re((a+f)*255),this.g=Re((l+f)*255),this.b=Re((s+f)*255)}fromHsv({h:t,s:n,v:o,a:r}){this._h=t%360,this._s=n,this._v=o,this.a=typeof r=="number"?r:1;const a=Re(o*255);if(this.r=a,this.g=a,this.b=a,n<=0)return;const l=t/60,s=Math.floor(l),c=l-s,u=Re(o*(1-n)*255),d=Re(o*(1-n*c)*255),f=Re(o*(1-n*(1-c))*255);switch(s){case 0:this.g=f,this.b=u;break;case 1:this.r=d,this.b=u;break;case 2:this.r=u,this.b=f;break;case 3:this.r=u,this.g=d;break;case 4:this.r=f,this.g=u;break;case 5:default:this.g=u,this.b=d;break}}fromHsvString(t){const n=Oc(t,W0);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=Oc(t,W0);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=Oc(t,(o,r)=>r.includes("%")?Re(o/100*255):o);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const vR=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list-card`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[o]:{borderRadius:e.borderRadius,position:"relative",background:e.colorFillContent,borderWidth:e.lineWidth,borderStyle:"solid",borderColor:"transparent",flex:"none",[`${o}-name,${o}-desc`]:{display:"flex",flexWrap:"nowrap",maxWidth:"100%"},[`${o}-ellipsis-prefix`]:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},[`${o}-ellipsis-suffix`]:{flex:"none"},"&-type-overview":{padding:n(e.paddingSM).sub(e.lineWidth).equal(),paddingInlineStart:n(e.padding).add(e.lineWidth).equal(),display:"flex",flexWrap:"nowrap",gap:e.paddingXS,alignItems:"flex-start",width:236,[`${o}-icon`]:{fontSize:n(e.fontSizeLG).mul(2).equal(),lineHeight:1,paddingTop:n(e.paddingXXS).mul(1.5).equal(),flex:"none"},[`${o}-content`]:{flex:"auto",minWidth:0,display:"flex",flexDirection:"column",alignItems:"stretch"},[`${o}-desc`]:{color:e.colorTextTertiary}},"&-type-preview":{width:r,height:r,lineHeight:1,[`&:not(${o}-status-error)`]:{border:0},img:{width:"100%",height:"100%",verticalAlign:"top",objectFit:"cover",borderRadius:"inherit"},[`${o}-img-mask`]:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",background:`rgba(0, 0, 0, ${e.opacityLoading})`,borderRadius:"inherit"},[`&${o}-status-error`]:{[`img, ${o}-img-mask`]:{borderRadius:n(e.borderRadius).sub(e.lineWidth).equal()},[`${o}-desc`]:{paddingInline:e.paddingXXS}},[`${o}-progress`]:{}},[`${o}-remove`]:{position:"absolute",top:0,insetInlineEnd:0,border:0,padding:e.paddingXXS,background:"transparent",lineHeight:1,transform:"translate(50%, -50%)",fontSize:e.fontSize,cursor:"pointer",opacity:e.opacityLoading,display:"none","&:dir(rtl)":{transform:"translate(-50%, -50%)"},"&:hover":{opacity:1},"&:active":{opacity:e.opacityLoading}},[`&:hover ${o}-remove`]:{display:"block"},"&-status-error":{borderColor:e.colorError,[`${o}-desc`]:{color:e.colorError}},"&-motion":{overflow:"hidden",transition:["opacity","width","margin","padding"].map(a=>`${a} ${e.motionDurationSlow}`).join(","),[`${o}-remove`]:{display:"none !important"},"&-appear-start":{width:0,transition:"none"},"&-leave-active":{opacity:0,width:0,paddingInline:0,borderInlineWidth:0,marginInlineEnd:n(e.paddingSM).mul(-1).equal()}}}}},Ic={"&, *":{boxSizing:"border-box"}},yR=e=>{const{componentCls:t,calc:n,antCls:o}=e,r=`${t}-drop-area`,a=`${t}-placeholder`;return{[r]:{position:"absolute",inset:0,zIndex:e.zIndexPopupBase,...Ic,"&-on-body":{position:"fixed",inset:0},"&-hide-placement":{[`${a}-inner`]:{display:"none"}},[a]:{padding:0}},"&":{[a]:{height:"100%",borderRadius:e.borderRadius,borderWidth:e.lineWidthBold,borderStyle:"dashed",borderColor:"transparent",padding:e.padding,position:"relative",backdropFilter:"blur(10px)",...Ic,[`${o}-upload-wrapper ${o}-upload${o}-upload-btn`]:{padding:0},[`&${a}-drag-in`]:{borderColor:e.colorPrimaryHover},[`&${a}-disabled`]:{opacity:.25,pointerEvents:"none"},[`${a}-inner`]:{gap:n(e.paddingXXS).div(2).equal()},[`${a}-icon`]:{fontSize:e.fontSizeHeading2,lineHeight:1},[`${a}-title${a}-title`]:{margin:0,fontSize:e.fontSize,lineHeight:e.lineHeight},[`${a}-description`]:{}}}}},bR=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[t]:{position:"relative",width:"100%",...Ic,[o]:{display:"flex",flexWrap:"wrap",gap:e.paddingSM,fontSize:e.fontSize,lineHeight:e.lineHeight,color:e.colorText,paddingBlock:e.paddingSM,paddingInline:e.padding,width:"100%",background:e.colorBgContainer,scrollbarWidth:"none","-ms-overflow-style":"none","&::-webkit-scrollbar":{display:"none"},"&-overflow-scrollX, &-overflow-scrollY":{"&:before, &:after":{content:'""',position:"absolute",opacity:0,transition:`opacity ${e.motionDurationSlow}`,zIndex:1}},"&-overflow-ping-start:before":{opacity:1},"&-overflow-ping-end:after":{opacity:1},"&-overflow-scrollX":{overflowX:"auto",overflowY:"hidden",flexWrap:"nowrap","&:before, &:after":{insetBlock:0,width:8},"&:before":{insetInlineStart:0,background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetInlineEnd:0,background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:dir(rtl)":{"&:before":{background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"}}},"&-overflow-scrollY":{overflowX:"hidden",overflowY:"auto",maxHeight:n(r).mul(3).equal(),"&:before, &:after":{insetInline:0,height:8},"&:before":{insetBlockStart:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetBlockEnd:0,background:"linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0));"}},"&-upload-btn":{width:r,height:r,fontSize:e.fontSizeHeading2,color:"#999"},"&-prev-btn, &-next-btn":{position:"absolute",top:"50%",transform:"translateY(-50%)",boxShadow:e.boxShadowTertiary,opacity:0,pointerEvents:"none"},"&-prev-btn":{left:{_skip_check_:!0,value:e.padding}},"&-next-btn":{right:{_skip_check_:!0,value:e.padding}},"&:dir(ltr)":{[`&${o}-overflow-ping-start ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-end ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}},"&:dir(rtl)":{[`&${o}-overflow-ping-end ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-start ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}}}}}},k0=Gt("Attachments",e=>{const t=Ct(e,{});return[yR(t),bR(t),vR(t)]},e=>{const{colorBgContainer:t}=e;return{colorBgPlaceholderHover:new Pc(t).setA(.85).toRgbString()}}),Tc=" ",Nc="#8c8c8c",K0=i.defineComponent({name:"AXAttachmentsFileListCard",__name:"FileListCard",props:{prefixCls:null,item:null,onRemove:{type:Function},className:null,style:null},setup(e,{expose:t}){i.toRef(e,"prefixCls");const n=["png","jpg","jpeg","gif","bmp","webp","svg"],o=[{icon:i.createVNode(qs,null,null),color:"#22b35e",ext:["xlsx","xls"]},{icon:i.createVNode(Ys,null,null),color:Nc,ext:n},{icon:i.createVNode(Zs,null,null),color:Nc,ext:["md","mdx"]},{icon:i.createVNode(Qs,null,null),color:"#ff4d4f",ext:["pdf"]},{icon:i.createVNode(Js,null,null),color:"#ff6e31",ext:["ppt","pptx"]},{icon:i.createVNode(tc,null,null),color:"#1677ff",ext:["doc","docx"]},{icon:i.createVNode(nc,null,null),color:"#fab714",ext:["zip","rar","7z","tar","gz"]},{icon:i.createVNode(mR,null,null),color:"#ff4d4f",ext:["mp4","avi","mov","wmv","flv","mkv"]},{icon:i.createVNode(uR,null,null),color:"#8c8c8c",ext:["mp3","wav","flac","ape","aac","ogg"]}];function r(M,z){return z.some(O=>M.toLowerCase()===`.${O}`)}function a(M){let z=M;const O=["B","KB","MB","GB","TB","PB","EB"];let T=0;for(;z>=1024&&T<O.length-1;)z/=1024,T++;return`${z.toFixed(0)} ${O[T]}`}const l=Yi(),s=i.computed(()=>l.value.disabled),c=i.computed(()=>e.item.name),u=i.computed(()=>e.item.size),d=i.computed(()=>e.item.percent),f=i.computed(()=>e.item.status||"done"),p=i.computed(()=>e.item.description),{getPrefixCls:m}=Ke(),v=i.computed(()=>m("attachment",e.prefixCls)),g=`${v.value}-list-card`,[y,C,S]=k0(v),$=i.useTemplateRef("file-list-card-container"),x=i.computed(()=>{const M=c.value||"",z=M.match(/^(.*)\.[^.]+$/);return{namePrefix:z?z[1]:M,nameSuffix:z?M.slice(z[1].length):""}}),w=i.computed(()=>r(x.value.nameSuffix,n)),P=i.computed(()=>p.value?p.value:f.value==="uploading"?`${d.value||0}%`:f.value==="error"?e.item.response||Tc:u.value?a(u.value):Tc),b=i.computed(()=>{for(const{ext:M,icon:z,color:O}of o)if(r(x.value.nameSuffix,M))return{icon:z,iconColor:O};return{icon:i.createVNode(ec,{key:"defaultIcon"},null),iconColor:Nc}}),[I,E]=Ie();i.watch(()=>e.item.originFileObj,()=>{if(e.item.originFileObj){let M=!0;hR(e.item.originFileObj).then(z=>{M&&E(z)}),i.onWatcherCleanup(()=>{M=!1})}E(void 0)},{immediate:!0});const A=i.computed(()=>e.item.thumbUrl||e.item.url||I.value),R=i.computed(()=>w.value&&(e.item.originFileObj||A.value)),B=i.computed(()=>R.value?i.createVNode(i.Fragment,null,[A.value&&i.createVNode("img",{alt:"preview",src:A.value},null),f.value!=="done"&&i.createVNode("div",{class:`${g}-img-mask`},[f.value==="uploading"&&d.value!==void 0&&i.createVNode(th,{percent:d.value,prefixCls:g},null),f.value==="error"&&i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${g}-icon`,style:{color:b.value.iconColor}},[b.value.icon]),i.createVNode("div",{class:`${g}-content`},[i.createVNode("div",{class:`${g}-name`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[x.value.namePrefix??Tc]),i.createVNode("div",{class:`${g}-ellipsis-suffix`},[x.value.nameSuffix])]),i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]));return t({nativeElement:$}),()=>y(i.createVNode("div",{class:re(g,{[`${g}-status-${f.value}`]:f.value,[`${g}-type-preview`]:R.value,[`${g}-type-overview`]:!R.value},e.className,C.value,S),style:e.style,ref:"file-list-card-container"},[B.value,!s.value&&e.onRemove&&i.createVNode("button",{type:"button",class:`${g}-remove`,onClick:()=>{e.onRemove(e.item)}},[i.createVNode(dt,null,null)])]))}}),U0=1,CR=i.defineComponent({name:"AXAttachmentsFileList",__name:"FileList",props:{prefixCls:{},items:{},onRemove:{},overflow:{},upload:{},listClassName:{},listStyle:{},itemClassName:{},itemStyle:{}},setup(e){const t=i.computed(()=>`${e.prefixCls}-list`),n=i.useTemplateRef("file-list-container"),[o,r]=Ie(!1),a=Yi();i.watchEffect(()=>{r(!0),i.onWatcherCleanup(()=>{r(!1)})});const[l,s]=Ie(!1),[c,u]=Ie(!1),d=()=>{const v=n.value;v&&(e.overflow==="scrollX"?(s(Math.abs(v.scrollLeft)>=U0),u(v.scrollWidth-v.clientWidth-Math.abs(v.scrollLeft)>=U0)):e.overflow==="scrollY"&&(s(v.scrollTop!==0),u(v.scrollHeight-v.clientHeight!==v.scrollTop)))};i.watch(()=>e.overflow,()=>{d()},{immediate:!0});const f=v=>{const g=n.value;g&&g.scrollTo({left:g.scrollLeft+v*g.clientWidth,behavior:"smooth"})},p=()=>{f(-1)},m=()=>{f(1)};return()=>i.createVNode("div",{class:re(t.value,{[`${t.value}-overflow-${e.overflow}`]:e.overflow,[`${t.value}-overflow-ping-start`]:l.value,[`${t.value}-overflow-ping-end`]:c.value},e.listClassName),ref:"file-list-container",onScroll:d,style:e.listStyle},[e.items.map(v=>i.createVNode(K0,{key:v.uid,prefixCls:e.prefixCls,item:v,onRemove:e.onRemove,className:re(e.itemClassName),style:{...e.itemStyle}},null)),!a.value.disabled&&i.createVNode(_0,{upload:e.upload,children:i.createVNode(We,{class:`${t.value}-upload-btn`,type:"dashed"},{default:()=>[i.createVNode(ps,{class:`${t.value}-upload-btn-icon`},null)]})},null),e.overflow==="scrollX"&&i.createVNode(i.Fragment,null,[i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-prev-btn`,icon:i.createVNode(Zo,null,null),onClick:p},null),i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-next-btn`,icon:i.createVNode(yn,null,null),onClick:m},null)])])}});function SR(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const wR=i.defineComponent({name:"AXAttachments",__name:"Attachments",props:i.mergeDefaults({capture:null,type:null,name:null,defaultFileList:null,action:null,directory:null,data:null,method:null,headers:null,showUploadList:null,multiple:null,accept:null,beforeUpload:null,onChange:{type:Function},"onUpdate:fileList":null,onDrop:null,listType:null,onPreview:null,onDownload:null,onReject:null,onRemove:null,remove:null,supportServerRender:null,disabled:{type:Boolean},prefixCls:null,customRequest:null,withCredentials:null,openFileDialogOnClick:null,locale:null,id:null,previewFile:null,transformFile:null,iconRender:null,isImageUrl:null,progress:null,itemRender:null,maxCount:null,height:null,removeIcon:null,downloadIcon:null,previewIcon:null,rootClassName:null,rootStyle:null,style:null,className:null,classNames:null,styles:null,children:null,placeholder:{type:Function},getDropContainer:{type:Function},items:null,overflow:null},{items:()=>[],classNames:()=>({}),styles:()=>({})}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","rootStyle","className","style","items","children","getDropContainer","placeholder","onChange","overflow","disabled","classNames","styles"]);i.toRef(e,"prefixCls");const o=i.useSlots(),{getPrefixCls:r,direction:a}=Ke(),l=r("attachment",e.prefixCls),s=Ut("attachments"),c=i.computed(()=>s.value.classNames),u=i.computed(()=>s.value.styles),d=i.useTemplateRef("attachments-container"),f=i.useTemplateRef("attachments-upload"),[p,m,v]=k0(l),g=i.computed(()=>re(m.value,v)),[y,C]=Ie(e.items);i.watch(()=>e.items,()=>{C(e.items)});const S=b=>{var I;C(b.fileList),(I=e.onChange)==null||I.call(e,b)},$=i.computed(()=>({...n,fileList:y.value,onChange:S})),x=b=>{const I=y.value.filter(E=>E.uid!==b.uid);S({file:b,fileList:I})},w=(b,I,E)=>{const A=o.placeholder?o.placeholder({type:b}):typeof e.placeholder=="function"?e.placeholder(b):e.placeholder;return i.createVNode(aR,{placeholder:A,upload:$.value,prefixCls:l,className:re(c.value.placeholder,e.classNames.placeholder),style:{...u.value.placeholder,...e.styles.placeholder,...I==null?void 0:I.style}},null)},P=i.computed(()=>{let b;if(e.children)return i.createVNode(i.Fragment,null,[i.createVNode(_0,{upload:$.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),i.createVNode(H0,{getDropContainer:e.getDropContainer,prefixCls:l,className:re(g.value,e.rootClassName),children:w("drop")},null)]);const I=y.value.length>0;return i.createVNode("div",{class:re(l,g.value,{[`${l}-rtl`]:a.value==="rtl"},e.className,e.rootClassName),style:{...e.rootStyle,...e.style},dir:a.value||"ltr",ref:"attachments-container"},[i.createVNode(CR,{prefixCls:l,items:y.value,onRemove:x,overflow:e.overflow,upload:$.value,listClassName:re(c.value.list,e.classNames.list),listStyle:{...u.value.list,...e.styles.list,...!I&&{display:"none"}},itemClassName:re(c.value.item,e.classNames.item),itemStyle:{...u.value.item,...e.styles.item}},null),w("inline",I?{style:{display:"none"}}:{},f.value),i.createVNode(H0,{getDropContainer:e.getDropContainer||(()=>d.value),prefixCls:l,className:g.value},SR(b=w("drop"))?b:{default:()=>[b]})])});return t({nativeElement:d.value,upload:b=>{var E,A;const I=(A=(E=f.value)==null?void 0:E.nativeElement)==null?void 0:A.querySelector('input[type="file"]');if(I){const R=new DataTransfer;R.items.add(b),I.files=R.files,I.dispatchEvent(new Event("change",{bubbles:!0}))}}}),()=>p(i.createVNode(iR,{value:{disabled:e.disabled}},{default:()=>[P.value]}))}}),$R=Object.assign(wR,{FileCard:K0}),xR=(e,t,n)=>{const o=i.computed(()=>{const s=i.toValue(e);let c={expandedKeys:[],onExpand:()=>{}};return s?(typeof s=="object"&&(c={...c,...s}),{enableCollapse:!0,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}):{enableCollapse:!1,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}}),[r,a]=Ie(o.value.customizeExpandedKeys),l=s=>{var u,d;if(!o.value.enableCollapse)return;const c=r.value.includes(s)?r.value.filter(f=>f!==s):[...r.value,s];(d=(u=o.value).customizeOnExpand)==null||d.call(u,c),a(c)};return[i.computed(()=>o.value.enableCollapse),r,l]};var Qi=(e=>(e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e))(Qi||{});const OR=e=>{const{componentCls:t}=e,n=`${t}-item`,o={[Qi.PENDING]:e.colorPrimaryText,[Qi.SUCCESS]:e.colorSuccessText,[Qi.ERROR]:e.colorErrorText},r=Object.keys(o);return r.reduce((a,l)=>{const s=o[l];return r.forEach(c=>{const u=`& ${n}-${l}-${c}`,d=l===c?{}:{backgroundColor:"none !important",backgroundImage:`linear-gradient(${s}, ${o[c]})`};a[u]={[`& ${n}-icon, & > *::before`]:{backgroundColor:`${s} !important`},"& > :last-child::before":d}}),a},{})},PR=e=>{const{calc:t,componentCls:n}=e,o=`${n}-item`,r={content:'""',width:t(e.lineWidth).mul(2).equal(),display:"block",position:"absolute",insetInlineEnd:"none",backgroundColor:e.colorTextPlaceholder};return{"& > :last-child > :last-child":{"&::before":{display:"none !important"},[`&${o}-footer`]:{"&::before":{display:"block !important",bottom:0}}},[`& > ${o}`]:{[`& ${o}-header, & ${o}-content, & ${o}-footer`]:{position:"relative","&::before":{bottom:t(e.itemGap).mul(-1).equal()}},[`& ${o}-header, & ${o}-content`]:{marginInlineStart:t(e.itemSize).mul(-1).equal(),"&::before":{...r,insetInlineStart:t(e.itemSize).div(2).sub(e.lineWidth).equal()}},[`& ${o}-header::before`]:{top:e.itemSize,bottom:t(e.itemGap).mul(-2).equal()},[`& ${o}-content::before`]:{top:"100%"},[`& ${o}-footer::before`]:{...r,top:0,insetInlineStart:t(e.itemSize).div(-2).sub(e.lineWidth).equal()}}}},IR=e=>{const{componentCls:t}=e,n=`${t}-item`;return{[n]:{display:"flex",flexDirection:"column",[`& ${n}-collapsible`]:{cursor:"pointer"},[`& ${n}-header`]:{display:"flex",marginBottom:e.itemGap,gap:e.itemGap,alignItems:"flex-start",[`& ${n}-icon`]:{height:e.itemSize,width:e.itemSize,fontSize:e.itemFontSize,display:"flex",justifyContent:"center",alignItems:"center"},[`& ${n}-extra`]:{height:e.itemSize,maxHeight:e.itemSize},[`& ${n}-header-box`]:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",[`& ${n}-title`]:{height:e.itemSize,lineHeight:`${ft(e.itemSize)}`,maxHeight:e.itemSize,fontSize:e.itemFontSize,[`& ${n}-collapse-icon`]:{marginInlineEnd:e.marginXS}},[`& ${n}-desc`]:{fontSize:e.itemFontSize}}},[`& ${n}-content`]:{[`& ${n}-content-hidden`]:{display:"none"},[`& ${n}-content-box`]:{padding:e.itemGap,display:"inline-block",maxWidth:`calc(100% - ${e.itemSize})`,borderRadius:e.borderRadiusLG,backgroundColor:e.colorBgContainer,border:`${ft(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${n}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},Ec=(e,t="middle")=>{const{componentCls:n}=e,o={large:{itemSize:e.itemSizeLG,itemGap:e.itemGapLG,itemFontSize:e.itemFontSizeLG},middle:{itemSize:e.itemSize,itemGap:e.itemGap,itemFontSize:e.itemFontSize},small:{itemSize:e.itemSizeSM,itemGap:e.itemGapSM,itemFontSize:e.itemFontSizeSM}}[t];return{[`&${n}-${t}`]:{paddingInlineStart:o.itemSize,gap:o.itemGap,...IR({...e,...o}),...PR({...e,...o})}}},TR=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...OR(e),...Ec(e),...Ec(e,"large"),...Ec(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},NR=Gt("ThoughtChain",e=>{const t=Ct(e,{itemFontSizeSM:e.fontSizeSM,itemSizeSM:e.calc(e.controlHeightXS).add(e.controlHeightSM).div(2).equal(),itemGapSM:e.marginSM,itemFontSize:e.fontSize,itemSize:e.calc(e.controlHeightSM).add(e.controlHeight).div(2).equal(),itemGap:e.margin,itemFontSizeLG:e.fontSizeLG,itemSizeLG:e.calc(e.controlHeight).add(e.controlHeightLG).div(2).equal(),itemGapLG:e.marginLG});return[TR(t)]}),X0=Symbol("ThoughtChainNodeContext"),Rc=i.shallowRef(),ER=e=>{i.provide(X0,e),i.watch(e,()=>{Rc.value=i.unref(e),i.triggerRef(Rc)},{immediate:!0,deep:!0})},RR=()=>i.inject(X0,i.computed(()=>Rc.value||{})),AR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return ER(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),MR=i.defineComponent({name:"AXThoughtChainNode",__name:"item",props:i.mergeDefaults({info:null,nextStatus:null,onClick:{type:Function}},{info:()=>({})}),setup(e){const t=He(e,["info","nextStatus","onClick"]),n=i.computed(()=>uo(t,{attr:!0,aria:!0,data:!0})),o=RR(),r=i.computed(()=>o.value.prefixCls),a=i.computed(()=>o.value.enableCollapse),l=i.computed(()=>o.value.expandedKeys),s=i.computed(()=>o.value.direction),c=i.computed(()=>o.value.classNames),u=i.computed(()=>o.value.styles),d=i.useId(),f=i.computed(()=>e.info.key??d),p=i.computed(()=>e.info.icon),m=i.computed(()=>e.info.title),v=i.computed(()=>e.info.extra),g=i.computed(()=>e.info.content),y=i.computed(()=>e.info.footer),C=i.computed(()=>e.info.status),S=i.computed(()=>e.info.description),$=i.computed(()=>`${r.value}-item`),x=()=>{var b;return(b=e.onClick)==null?void 0:b.call(e,f.value)},w=i.computed(()=>{var b;return(b=l.value)==null?void 0:b.includes(f.value)}),P=i.computed(()=>a.value?w.value:!0);return()=>i.createVNode("div",i.mergeProps(n.value,{class:re($.value,{[`${$.value}-${C.value}${e.nextStatus?`-${e.nextStatus}`:""}`]:C.value},t.class),style:t.style}),[i.createVNode("div",{class:re(`${$.value}-header`,c.value.itemHeader),style:u.value.itemHeader,onClick:x},[i.createVNode(vn,{icon:p.value,class:`${$.value}-icon`},null),i.createVNode("div",{class:re(`${$.value}-header-box`,{[`${$.value}-collapsible`]:a.value&&g.value})},[i.createVNode($e.Text,{strong:!0,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:m.value}},class:`${$.value}-title`},{default:()=>[a.value&&g.value&&(s.value==="rtl"?i.createVNode(Zo,{class:`${$.value}-collapse-icon`,rotate:w.value?-90:0},null):i.createVNode(yn,{class:`${$.value}-collapse-icon`,rotate:w.value?90:0},null)),m.value]}),S.value&&i.createVNode($e.Text,{class:`${$.value}-desc`,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:S.value}},type:"secondary"},{default:()=>[S.value]})]),v.value&&i.createVNode("div",{class:`${$.value}-extra`},[v.value])]),g.value&&i.withDirectives(i.createVNode("div",{class:re(`${$.value}-content`)},[i.createVNode("div",{class:re(`${$.value}-content-box`,c.value.itemContent),style:u.value.itemContent},[g.value])]),[[i.vShow,P.value]]),y.value&&i.createVNode("div",{class:re(`${$.value}-footer`,c.value.itemFooter),style:u.value.itemFooter},[y.value])])}}),VR=i.defineComponent({name:"AXThoughtChain",__name:"ThoughtChain",props:i.mergeDefaults({items:null,collapsible:{type:Boolean},size:null,styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({}),size:"middle"}),setup(e){const t=He(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.computed(()=>uo(t,{attr:!0,aria:!0,data:!0})),{getPrefixCls:o,direction:r}=Ke(),a=i.computed(()=>o()),l=i.computed(()=>o("thought-chain",e.prefixCls)),s=Ut("thoughtChain"),[c,u,d]=xR(()=>e.collapsible,l.value,a.value),[f,p,m]=NR(l),v=i.computed(()=>re(e.class,e.rootClassName,l.value,s.value.className,p.value,m,{[`${l.value}-rtl`]:r.value==="rtl"},`${l.value}-${e.size}`));return()=>f(i.createVNode("div",i.mergeProps(n.value,{class:v.value,style:{...typeof s.value.style=="object"?s.value.style:{},...typeof e.style=="object"?e.style:{}}}),[i.createVNode(AR,{value:{prefixCls:l.value,enableCollapse:c.value,expandedKeys:u.value,direction:r.value,classNames:{itemHeader:re(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:re(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:re(s.value.classNames.itemFooter,e.classNames.itemFooter)},styles:{itemHeader:{...s.value.styles.itemHeader,...e.styles.itemHeader},itemContent:{...s.value.styles.itemContent,...e.styles.itemContent},itemFooter:{...s.value.styles.itemFooter,...e.styles.itemFooter}}}},{default:()=>{var g;return[(g=e.items)==null?void 0:g.map((y,C)=>{var S;return i.createVNode(MR,{key:y.key||`key_${C}`,class:re(s.value.classNames.item,e.classNames.item),style:{...s.value.styles.item,...e.styles.item},info:{...y,icon:y.icon||C+1},onClick:d,nextStatus:((S=e.items[C+1])==null?void 0:S.status)||y.status},null)})]}})]))}}),DR=`
289
+ onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`.split(/[\s\n]+/),m8="aria-",g8="data-";function T0(e,t){return e.indexOf(t)===0}function uo(e,t=!1){let n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n={...t};const o={};return Object.keys(e).forEach(r=>{(n.aria&&(r==="role"||T0(r,m8))||n.data&&T0(r,g8)||n.attr&&(I0.includes(r)||I0.includes(r.toLowerCase())))&&(o[r]=e[r])}),o}function h8(e){const[t,n]=Ie(e.value.length),o=i.computed(()=>e.value.slice(0,i.unref(t))),r=i.computed(()=>{const l=i.unref(o)[i.unref(o).length-1];return l?l.key:null});i.watch(e,()=>{var l;if(!(i.unref(o).length&&i.unref(o).every((s,c)=>{var u;return s.key===((u=e.value[c])==null?void 0:u.key)}))){if(i.unref(o).length===0)n(1);else for(let s=0;s<i.unref(o).length;s+=1)if(i.unref(o)[s].key!==((l=e.value[s])==null?void 0:l.key)){n(s);break}}},{immediate:!0,deep:!0});const a=ki(l=>{l===i.unref(r)&&n(i.unref(t)+1)});return[o,a]}function v8(e,t){const n=(r,a)=>typeof t.value=="function"?t.value(r,a):t?t.value[r.role]||{}:{};return i.computed(()=>(e.value||[]).map((r,a)=>{const l=r.key??`preset_${a}`;return{...n(r,a),...r,key:l}}))}const y8=1,N0=i.defineComponent({name:"AXBubbleList",inheritAttrs:!1,__name:"BubbleList",props:i.mergeDefaults({prefixCls:null,rootClassName:null,items:null,autoScroll:{type:Boolean},roles:null},{autoScroll:!0}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","items","autoScroll","roles"]);i.toRef(e,"roles"),i.toRef(e,"items"),i.toRef(e,"prefixCls");const o=i.useAttrs(),r=uo(i.mergeProps(n,o),{attr:!0,aria:!0}),a=i.ref(e.items),l=i.ref(e.roles);i.watch(()=>e.items,()=>{a.value=e.items}),i.watch(()=>e.roles,()=>{l.value=e.roles});const s=i.ref(null),c=i.ref({}),{getPrefixCls:u}=Ke(),d=u("bubble",e.prefixCls),f=`${d}-list`,[p,m,v]=$0(d),[g,y]=Ie(!1);i.watchEffect(()=>{y(!0),i.onWatcherCleanup(()=>{y(!1)})});const C=v8(a,l),[S,$]=h8(C),[x,w]=Ie(!0),[P,b]=Ie(0),I=R=>{const B=R.target;w(B.scrollHeight-Math.abs(B.scrollTop)-B.clientHeight<=y8)};i.watch(P,()=>{e.autoScroll&&i.unref(s)&&i.unref(x)&&i.nextTick(()=>{i.unref(s).scrollTo({top:i.unref(s).scrollHeight})})}),i.watch(()=>i.unref(S).length,()=>{var R;if(e.autoScroll){const B=(R=i.unref(S)[i.unref(S).length-2])==null?void 0:R.key,M=i.unref(c)[B];if(M){const{nativeElement:z}=M,{top:O=0,bottom:T=0}=(z==null?void 0:z.getBoundingClientRect())??{},{top:D,bottom:L}=i.unref(s).getBoundingClientRect();O<L&&T>D&&(b(i.unref(P)+1),w(!0))}}});const E=ki(()=>{e.autoScroll&&b(i.unref(P)+1)}),A=i.computed(()=>({onUpdate:E}));return t({nativeElement:s,scrollTo:({key:R,offset:B,behavior:M="smooth",block:z})=>{if(typeof B=="number")i.unref(s).scrollTo({top:B,behavior:M});else if(R!==void 0){const O=i.unref(c)[R];if(O){const T=i.unref(S).findIndex(D=>D.key===R);w(T===i.unref(S).length-1),O.nativeElement.scrollIntoView({behavior:M,block:z})}}}}),()=>p(i.createVNode(f8,{value:A.value},{default:()=>[i.createVNode("div",i.mergeProps(r,{class:re(f,e.rootClassName,m.value,v,{[`${f}-reach-end`]:x.value}),ref:s,onScroll:I}),[i.unref(S).map(({key:R,onTypingComplete:B,...M})=>i.createVNode(O0,i.mergeProps(M,{key:R,ref:z=>{z?c.value[R]=z:delete c.value[R]},typing:g.value?M.typing:!1,onTypingComplete:()=>{B==null||B(),$(R)}}),null))])]}))}}),b8=Object.assign(O0,{List:N0}),C8=i.defineComponent({name:"AXConversationsItem",__name:"ConversationsItem",props:{info:null,prefixCls:null,direction:null,menu:null,active:{type:Boolean},onClick:{type:Function}},setup(e){const t=He(e,["prefixCls","info","class","direction","onClick","active","menu"]);i.toRef(e,"class");const n=i.computed(()=>uo(t,{aria:!0,data:!0,attr:!0})),o=p=>{p.stopPropagation()},r=i.computed(()=>e.info.disabled),[a,l]=Ie(!1),[s,c]=Ie(!1),u=i.computed(()=>re(e.class,`${e.prefixCls}-item`,{[`${e.prefixCls}-item-active`]:e.active&&!r.value},{[`${e.prefixCls}-item-disabled`]:r.value})),d=()=>{!r.value&&e.onClick&&e.onClick(e.info)},f=p=>{p&&c(!p)};return()=>i.createVNode(Ht,{title:e.info.label,open:a.value&&s.value,onOpenChange:c,placement:e.direction==="rtl"?"left":"right"},{default:()=>[i.createVNode("li",i.mergeProps(n.value,{class:u.value,onClick:d}),[e.info.icon&&i.createVNode("div",{class:`${e.prefixCls}-icon`},[e.info.icon]),i.createVNode($e.Text,{class:`${e.prefixCls}-label`,ellipsis:{onEllipsis:l}},{default:()=>[e.info.label]}),e.menu&&!r.value&&i.createVNode(bn,{placement:e.direction==="rtl"?"bottomLeft":"bottomRight",trigger:["click"],disabled:r.value,onOpenChange:f},{default:()=>i.createVNode(Ko,{onClick:o,disabled:r.value,class:`${e.prefixCls}-menu-icon`},null),overlay:()=>i.createVNode(jt,e.menu,null)})])]})}}),E0=Symbol("GroupTitleContext"),bc=i.shallowRef(),S8=e=>{i.provide(E0,e),i.watch(e,()=>{bc.value=i.unref(e),i.triggerRef(bc)},{immediate:!0,deep:!0})},w8=()=>i.inject(E0,i.computed(()=>bc.value||{})),$8=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return S8(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),R0=i.defineComponent({name:"AXConversationsGroupTitle",__name:"GroupTitle",setup(e){const t=i.useSlots(),n=w8(),o=i.computed(()=>{var r;return(r=t.default)==null?void 0:r.call(t)});return()=>i.createVNode("div",{class:re(`${n.value.prefixCls}-group-title`)},[o.value&&i.createVNode($e.Text,null,{default:()=>[o.value]})])}});function A0(e,t){const{defaultValue:n,value:o=i.ref()}=t||{};let r=typeof e=="function"?e():e;o.value!==void 0&&(r=i.unref(o)),n!==void 0&&(r=typeof n=="function"?n():n);const a=i.ref(r),l=i.ref(r);i.watchEffect(()=>{let c=o.value!==void 0?o.value:a.value;t.postState&&(c=t.postState(c)),l.value=c});function s(c){const u=l.value;a.value=c,i.toRaw(l.value)!==c&&t.onChange&&t.onChange(c,u)}return i.watch(o,()=>{a.value=o.value}),[l,s]}const Cc="__ungrouped",x8=(e,t=[])=>{const n=i.computed(()=>{if(!i.toValue(e))return{enableGroup:!1,sort:void 0,title:void 0};let o={sort:void 0,title:void 0};return typeof i.toValue(e)=="object"&&(o={...o,...i.toValue(e)}),{enableGroup:!0,sort:o.sort,title:o.title}});return i.computed(()=>{if(!n.value.enableGroup)return{groupList:[{name:Cc,data:i.toValue(t),title:void 0}],enableGroup:n.value.enableGroup};const o=i.toValue(t).reduce((l,s)=>{const c=s.group||Cc;return l[c]||(l[c]=[]),l[c].push(s),l},{});return{groupList:(n.value.sort?Object.keys(o).sort(n.value.sort):Object.keys(o)).map(l=>({name:l===Cc?void 0:l,title:n.value.title,data:o[l]})),enableGroup:n.value.enableGroup}})},O8=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",gap:e.paddingXXS,overflowY:"auto",padding:e.paddingSM,[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-list`]:{display:"flex",gap:e.paddingXXS,flexDirection:"column",paddingLeft:0,[`& ${t}-item`]:{paddingInlineStart:e.paddingXL},[`& ${t}-label`]:{color:e.colorTextDescription}},[`& ${t}-item`]:{display:"flex",height:e.controlHeightLG,minHeight:e.controlHeightLG,gap:e.paddingXS,padding:`0 ${ft(e.paddingXS)}`,alignItems:"center",borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,"&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{backgroundColor:e.colorBgTextHover,[`& ${t}-label, ${t}-menu-icon`]:{color:e.colorText}},"&-disabled":{cursor:"not-allowed",[`& ${t}-label`]:{color:e.colorTextDisabled}},"&:hover, &-active":{[`& ${t}-menu-icon`]:{opacity:1}}},[`& ${t}-label`]:{flex:1,color:e.colorText},[`& ${t}-menu-icon`]:{opacity:0,fontSize:e.fontSizeXL},[`& ${t}-group-title`]:{display:"flex",alignItems:"center",height:e.controlHeightLG,minHeight:e.controlHeightLG,padding:`0 ${ft(e.paddingXS)}`}}}},P8=Gt("Conversations",e=>{const t=Ct(e,{});return O8(t)},()=>({})),I8=i.defineComponent({name:"AXConversations",__name:"Conversations",props:i.mergeDefaults({items:null,activeKey:null,defaultActiveKey:null,onActiveChange:{type:Function},menu:{type:Function},groupable:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","rootClassName","items","activeKey","defaultActiveKey","onActiveChange","menu","styles","classNames","groupable","class","style"]);i.toRef(e,"class"),i.toRef(e,"activeKey"),i.toRef(e,"prefixCls");const n=i.ref(e.activeKey),o=i.computed(()=>uo(t,{attr:!0,aria:!0,data:!0})),[r,a]=A0(e.defaultActiveKey,{value:n});i.watch(()=>e.activeKey,()=>{n.value=e.activeKey});const l=x8(()=>e.groupable,()=>e.items),{getPrefixCls:s,direction:c}=Ke(),u=i.computed(()=>s("conversations",e.prefixCls)),d=Ut("conversations"),[f,p,m]=P8(u),v=i.computed(()=>re(u.value,d.value.className,e.class,e.rootClassName,p.value,m,{[`${u.value}-rtl`]:c.value==="rtl"})),g=y=>{a(y.key),e.onActiveChange&&e.onActiveChange(y.key)};return()=>f(i.createVNode("ul",i.mergeProps(o.value,{style:{...typeof d.value.style=="object"?d.value.style:{},...typeof e.style=="object"?e.style:{}},class:v.value}),[l.value.groupList.map((y,C)=>{const S=y.data.map(($,x)=>i.createVNode(C8,{key:$.key||`key-${x}`,info:$,prefixCls:u.value,direction:c.value,class:re(e.classNames.item,d.value.classNames.item),style:{...d.value.styles.item,...e.styles.item},menu:typeof e.menu=="function"?e.menu($):e.menu,active:r.value===$.key,onClick:g},null));return l.value.enableGroup?i.createVNode("li",{key:y.name||`key-${C}`},[i.createVNode($8,{value:{prefixCls:u.value}},{default:()=>{var $;return[(($=y.title)==null?void 0:$.call(y,y.name,{components:{GroupTitle:R0}}))||i.createVNode(R0,{key:y.name},{default:()=>[y.name]})]}}),i.createVNode("ul",{class:`${u.value}-list`},[S])]):S})]))}}),T8=e=>{const{componentCls:t,calc:n}=e,o=n(e.fontSizeHeading3).mul(e.lineHeightHeading3).equal(),r=n(e.fontSize).mul(e.lineHeight).equal();return{[t]:{gap:e.padding,[`${t}-icon`]:{height:n(o).add(r).add(e.paddingXXS).equal(),display:"flex",img:{height:"100%"}},[`${t}-content-wrapper`]:{gap:e.paddingXS,flex:"auto",minWidth:0,[`${t}-title-wrapper`]:{gap:e.paddingXS},[`${t}-title`]:{margin:0},[`${t}-extra`]:{marginInlineStart:"auto"}}}}},N8=e=>{const{componentCls:t}=e;return{[t]:{"&-filled":{paddingInline:e.padding,paddingBlock:e.paddingSM,background:e.colorFillContent,borderRadius:e.borderRadiusLG},"&-borderless":{[`${t}-title`]:{fontSize:e.fontSizeHeading3,lineHeight:e.lineHeightHeading3}}}}},E8=Gt("Welcome",e=>{const t=Ct(e,{});return[T8(t),N8(t)]},()=>({}));function R8(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const A8=i.defineComponent({name:"AXWelcome",__name:"Welcome",props:i.mergeDefaults({prefixCls:null,rootClassName:null,className:null,style:null,variant:null,classNames:null,styles:null,icon:null,title:null,description:null,extra:null},{variant:"filled",classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Ke(),r=o("welcome",e.prefixCls),a=Ut("welcome"),[l,s,c]=E8(r),u=i.computed(()=>{const m=t.icon?t.icon():e.icon;if(!m)return null;let v=m;return typeof m=="string"&&m.startsWith("http")&&(v=i.createVNode("img",{src:m,alt:"icon"},null)),i.createVNode("div",{class:re(`${r}-icon`,a.value.classNames.icon,e.classNames.icon),style:e.styles.icon},[v])}),d=i.computed(()=>{const m=t.title?t.title():e.title;return m?i.createVNode($e.Title,{level:4,class:re(`${r}-title`,a.value.classNames.title,e.classNames.title),style:e.styles.title},R8(m)?m:{default:()=>[m]}):null}),f=i.computed(()=>t.description?t.description():e.description),p=i.computed(()=>{const m=t.extra?t.extra():e.extra;return m?i.createVNode("div",{class:re(`${r}-extra`,a.value.classNames.extra,e.classNames.extra),style:e.styles.extra},[m]):null});return()=>l(i.createVNode(sr,{class:re(r,a.value.className,e.className,e.rootClassName,s.value,c,`${r}-${e.variant}`,{[`${r}-rtl`]:n.value==="rtl"}),style:e.style},{default:()=>[u.value,i.createVNode(sr,{vertical:!0,class:`${r}-content-wrapper`},{default:()=>[t.extra||e.extra?i.createVNode(sr,{align:"flex-start",class:`${r}-title-wrapper`},{default:()=>[d.value,p.value]}):d.value,f.value&&i.createVNode($e.Text,{class:re(`${r}-description`,a.value.classNames.description,e.classNames.description),style:e.styles.description},{default:()=>[f.value]})]})]}))}}),M8=e=>{const{componentCls:t}=e;return{[t]:{"&, & *":{boxSizing:"border-box"},maxWidth:"100%",[`&${t}-rtl`]:{direction:"rtl"},[`& ${t}-title`]:{marginBlockStart:0,fontWeight:"normal",color:e.colorTextTertiary},[`& ${t}-list`]:{display:"flex",gap:e.paddingSM,overflowX:"scroll","&::-webkit-scrollbar":{display:"none"},listStyle:"none",paddingInlineStart:0,marginBlock:0,alignItems:"stretch","&-wrap":{flexWrap:"wrap"},"&-vertical":{flexDirection:"column",alignItems:"flex-start"}},[`${t}-item`]:{flex:"none",display:"flex",gap:e.paddingXS,height:"auto",paddingBlock:e.paddingSM,paddingInline:e.padding,alignItems:"flex-start",justifyContent:"flex-start",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,transition:["border","background"].map(n=>`${n} ${e.motionDurationSlow}`).join(","),border:`${ft(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,[`&:not(${t}-item-has-nest)`]:{"&:hover":{cursor:"pointer",background:e.colorFillTertiary},"&:active":{background:e.colorFill}},[`${t}-content`]:{flex:"auto",minWidth:0,display:"flex",gap:e.paddingXXS,flexDirection:"column",alignItems:"flex-start"},[`${t}-icon, ${t}-label, ${t}-desc`]:{margin:0,padding:0,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start",whiteSpace:"normal"},[`${t}-label`]:{color:e.colorTextHeading,fontWeight:500},[`${t}-label + ${t}-desc`]:{color:e.colorTextTertiary},[`&${t}-item-disabled`]:{pointerEvents:"none",background:e.colorBgContainerDisabled,[`${t}-label, ${t}-desc`]:{color:e.colorTextTertiary}}}}}},V8=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-item-has-nest`]:{[`> ${t}-content`]:{[`> ${t}-label`]:{fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}}},[`&${t}-nested`]:{marginTop:e.paddingXS,alignSelf:"stretch",[`${t}-list`]:{alignItems:"stretch"},[`${t}-item`]:{border:0,background:e.colorFillQuaternary}}}}},D8=Gt("Prompts",e=>{const t=Ct(e,{});return[M8(t),V8(t)]},()=>({})),M0=i.defineComponent({name:"AXPrompts",__name:"Prompts",props:i.mergeDefaults({items:null,title:null,onItemClick:{type:Function},vertical:{type:Boolean},wrap:{type:Boolean},styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({})}),setup(e){const t=He(e,["prefixCls","title","class","items","onItemClick","vertical","wrap","rootClassName","styles","classNames","style"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.useSlots(),{getPrefixCls:o,direction:r}=Ke(),a=o("prompts",e.prefixCls),l=Ut("prompts"),[s,c,u]=D8(a),d=i.computed(()=>re(a,l.value.className,e.class,e.rootClassName,c.value,u,{[`${a}-rtl`]:r.value==="rtl"})),f=i.computed(()=>re(`${a}-list`,l.value.classNames.list,e.classNames.list,{[`${a}-list-wrap`]:e.wrap},{[`${a}-list-vertical`]:e.vertical})),p=i.computed(()=>n.title?n.title():e.title);return()=>{var m;return s(i.createVNode("div",i.mergeProps(t,{class:d.value,style:{...typeof e.style=="object"?e.style:{},...typeof l.value.style=="object"?l.value.style:{}}}),[p.value&&i.createVNode($e.Title,{level:5,class:re(`${a}-title`,l.value.classNames.title,e.classNames.title),style:{...l.value.styles.title,...e.styles.title}},{default:()=>[p.value]}),i.createVNode("div",{class:f.value,style:{...l.value.styles.list,...e.styles.list}},[(m=e.items)==null?void 0:m.map((v,g)=>{const y=v.children&&v.children.length>0;return i.createVNode("div",{key:v.key||`key_${g}`,style:{...l.value.styles.item,...e.styles.item},class:re(`${a}-item`,l.value.classNames.item,e.classNames.item,{[`${a}-item-disabled`]:v.disabled,[`${a}-item-has-nest`]:y}),onClick:()=>{!y&&e.onItemClick&&e.onItemClick({data:v})}},[v.icon&&i.createVNode("div",{class:`${a}-icon`},[v.icon]),i.createVNode("div",{class:re(`${a}-content`,l.value.classNames.itemContent,e.classNames.itemContent),style:{...l.value.styles.itemContent,...e.styles.itemContent}},[v.label&&i.createVNode("h6",{class:`${a}-label`},[v.label]),v.description&&i.createVNode("p",{class:`${a}-desc`},[v.description]),y&&i.createVNode(M0,{class:`${a}-nested`,items:v.children,vertical:!0,onItemClick:e.onItemClick,classNames:{list:e.classNames.subList,item:e.classNames.subItem},styles:{list:e.styles.subList,item:e.styles.subItem}},null)])])})])]))}}}),B8=e=>{const{componentCls:t,antCls:n}=e;return{[t]:{[`${n}-cascader-menus ${n}-cascader-menu`]:{height:"auto"},[`${t}-item`]:{"&-icon":{marginInlineEnd:e.paddingXXS},"&-extra":{marginInlineStart:e.padding}},[`&${t}-block`]:{[`${t}-item-extra`]:{marginInlineStart:"auto"}}}}},L8=Gt("Suggestion",e=>{const t=Ct(e,{});return B8(t)},()=>({}));function z8(e,t,n,o,r){const[a,l]=Ie([]),s=(m,v=a.value)=>{let g=i.toValue(e);for(let y=0;y<m-1;y+=1){const C=v[y],S=g.find($=>$.value===C);if(!S)break;g=S.children||[]}return g},c=m=>m.map((v,g)=>{const C=s(g+1,m).find(S=>S.value===v);return C==null?void 0:C.value}),u=m=>{const v=a.value.length||1,g=s(v),y=g.findIndex($=>$.value===a.value[v-1]),C=g.length,S=g[(y+m+C)%C];l([...a.value.slice(0,v-1),S.value])},d=()=>{a.value.length>1&&l(a.value.slice(0,a.value.length-1))},f=()=>{const m=s(a.value.length+1);m.length&&l([...a.value,m[0].value])},p=ki(m=>{if(i.toValue(t))switch(console.log("e.key",m),m.key){case"ArrowDown":u(1),m.preventDefault();break;case"ArrowUp":u(-1),m.preventDefault();break;case"ArrowRight":i.toValue(n)?d():f(),m.preventDefault();break;case"ArrowLeft":i.toValue(n)?f():d(),m.preventDefault();break;case"Enter":s(a.value.length+1).length||o(c(a.value)),m.preventDefault();break;case"Escape":r(),m.preventDefault();break}});return i.watch(()=>i.toValue(t),()=>{i.toValue(t)&&l([i.toValue(e)[0].value])},{immediate:!0}),[a,p]}const F8=i.defineComponent({name:"AXSuggestion",__name:"Suggestion",props:i.mergeDefaults({prefixCls:null,className:null,rootClassName:null,style:null,children:{type:Function},open:{type:Boolean},onOpenChange:{type:Function},items:{type:Function},onSelect:{type:Function},block:{type:Boolean},styles:null,classNames:null},{open:!1}),setup(e){i.toRef(e,"prefixCls");const t=i.useSlots(),{direction:n,getPrefixCls:o}=Ke(),r=i.computed(()=>o("suggestion",e.prefixCls));`${r.value}`;const a=i.computed(()=>n.value==="rtl"),l=Ut("suggestion"),[s,c,u]=L8(r),[d,f]=Ie(e.open),[p,m]=Ie(),v=P=>{var b;f(P),(b=e.onOpenChange)==null||b.call(e,P)},g=P=>{P===!1?v(!1):(m(P),v(!0))},y=()=>{v(!1)},C=i.computed(()=>typeof e.items=="function"?e.items(p.value):e.items),S=P=>{e.onSelect&&e.onSelect(P[P.length-1]),v(!1)},[$,x]=z8(C,d,a,S,y),w=i.computed(()=>{var P;return t.default?t.default({onTrigger:g,onKeyDown:x}):(P=e.children)==null?void 0:P.call(e,{onTrigger:g,onKeyDown:x})});return()=>s(i.createVNode(k4,{options:C.value,open:d.value,value:$.value,placement:a.value?"topRight":"topLeft",onDropdownVisibleChange:P=>{P||y()},class:re(e.rootClassName,r.value,c,u,{[`${r.value}-block`]:e.block}),onChange:S,dropdownMatchSelectWidth:e.block},{default:()=>i.createVNode("div",{class:re(r.value,l.value.className,e.rootClassName,e.className,`${r.value}-wrapper`,c.value,u),style:{...l.value.style,...e.style}},[w.value])}))}}),V0=Symbol("SenderHeaderContext"),Sc=i.shallowRef(),H8=e=>{i.provide(V0,e),i.watch(e,()=>{Sc.value=i.unref(e),i.triggerRef(Sc)},{immediate:!0,deep:!0})},_8=()=>i.inject(V0,i.computed(()=>Sc.value||{})),j8=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return H8(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),D0=Symbol("ActionButtonContext"),wc=i.shallowRef(),W8=e=>{i.provide(D0,e),i.watch(e,()=>{wc.value=i.unref(e),i.triggerRef(wc)},{immediate:!0,deep:!0})},$c=()=>i.inject(D0,i.computed(()=>wc.value||{})),k8=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return W8(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),Ki=i.defineComponent({name:"AXSenderActionButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null,action:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["action","type","disabled","onClick"]);i.toRef(e,"onClick"),i.toRef(e,"disabled");const n=i.useSlots(),o=$c(),r=i.computed(()=>{var u;const s=o.value.disabled,c=(u=o.value)==null?void 0:u[`${e.action}Disabled`];return s??e.disabled??c}),a=i.computed(()=>o.value.prefixCls),l=i.computed(()=>{var s;return(s=o.value)==null?void 0:s[e.action]});return()=>i.createVNode(We,i.mergeProps({type:e.type},t,{onClick:s=>{r.value||(l.value&&l.value(),e.onClick&&!Array.isArray(e.onClick)&&e.onClick(s))},class:re(a.value,{[`${a.value}-disabled`]:r.value})}),{icon:()=>n.default()})}}),K8=i.defineComponent({name:"AXSenderClearButton",__name:"ClearButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{disabled:void 0}),setup(e){const t=He(e,["disabled"]);return()=>i.createVNode(Ki,i.mergeProps({disabled:e.disabled},t,{action:"onClear"}),{default:()=>[i.createVNode(Gs,null,null)]})}}),U8=i.defineComponent({name:"AXSenderStopLoading",__name:"StopLoading",props:{className:null},setup(e){const t=e;return()=>i.createVNode("svg",{color:"currentColor",viewBox:"0 0 1000 1000",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:t.className},[i.createVNode("title",null,[i.createTextVNode("Stop Loading")]),i.createVNode("rect",{fill:"currentColor",height:"250",rx:"24",ry:"24",width:"250",x:"375",y:"375"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100",opacity:"0.45"},null),i.createVNode("circle",{cx:"500",cy:"500",fill:"none",r:"450",stroke:"currentColor","stroke-width":"100","stroke-dasharray":"600 9999999"},[i.createVNode("animateTransform",{attributeName:"transform",dur:"1s",from:"0 500 500",repeatCount:"indefinite",to:"360 500 500",type:"rotate"},null)])])}}),B0=i.defineComponent({name:"AXSenderLoadingButton",__name:"LoadingButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",icon:null,disabled:void 0}),setup(e){const t=He(e,["type","shape","icon","disabled"]),n=$c(),{token:o}=cr.useToken();return()=>i.createVNode(Ki,i.mergeProps({type:e.type,disabled:e.disabled,shape:e.shape},t,{style:{backgroundColor:"transparent",color:o.value.colorPrimary},class:re(`${n.value.prefixCls}-loading-button`),action:"onCancel"}),{default:()=>[i.createVNode(U8,{className:`${n.value.prefixCls}-loading-icon`},null)]})}}),L0=i.defineComponent({name:"AXSenderLoadingButton",__name:"SendButton",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"primary",shape:"circle",disabled:void 0}),setup(e){const t=He(e,["type","shape","disabled"]);return()=>i.createVNode(Ki,i.mergeProps({type:e.type,shape:e.shape,disabled:e.disabled},t,{action:"onSend"}),{default:()=>[i.createVNode(Ks,null,null)]})}}),pr=1e3,mr=4,Ui=140,Xi=250,z0=500,Gi=.8,X8=i.defineComponent({name:"AXSenderRecordingIcon",__name:"RecordingIcon",props:{className:null},setup(e){const t=Ui/2;return()=>i.createVNode("svg",{color:"currentColor",viewBox:`0 0 ${pr} ${pr}`,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",class:e.className},[i.createVNode("title",null,[i.createTextVNode("Speech Recording")]),Array.from({length:mr}).map((n,o)=>{const r=(pr-Ui*mr)/(mr-1),a=o*(r+Ui),l=pr/2-Xi/2,s=pr/2-z0/2;return i.createVNode("rect",{fill:"currentColor",rx:t,ry:t,height:Xi,width:Ui,x:a,y:l,key:o},[i.createVNode("animate",{attributeName:"height",values:`${Xi}; ${z0}; ${Xi}`,keyTimes:"0; 0.5; 1",dur:`${Gi}s`,begin:`${Gi/mr*o}s`,repeatCount:"indefinite"},null),i.createVNode("animate",{attributeName:"y",values:`${l}; ${s}; ${l}`,keyTimes:"0; 0.5; 1",dur:`${Gi}s`,begin:`${Gi/mr*o}s`,repeatCount:"indefinite"},null)])})])}}),G8=i.defineComponent({name:"AXSenderSpeechButton",__name:"index",props:i.mergeDefaults({prefixCls:null,type:null,htmlType:null,shape:null,size:null,loading:null,disabled:null,ghost:null,block:null,danger:null,icon:null,href:null,target:null,title:null,onClick:null,onMousedown:null},{type:"text",disabled:void 0}),setup(e){const t=He(e,["type","disabled"]),n=$c(),{token:o}=cr.useToken(),r=i.computed(()=>n.value.speechRecording),a=i.computed(()=>n.value.prefixCls),l=i.computed(()=>{let s;return r.value?s=i.createVNode(X8,{className:`${a.value}-recording-icon`},null):n.value.onSpeechDisabled?s=i.createVNode(Us,null,null):s=i.createVNode(Xs,null,null),s});return()=>i.createVNode(Ki,i.mergeProps({type:e.type,disabled:e.disabled},t,{style:{display:"flex",justifyContent:"center",alignItems:"center",color:o.value.colorPrimary},action:"onSpeech"}),{default:()=>[l.value]})}}),q8=e=>{const{componentCls:t,calc:n}=e,o=`${t}-header`;return{[t]:{[o]:{borderBottomWidth:e.lineWidth,borderBottomStyle:"solid",borderBottomColor:e.colorBorder,"&-header":{background:e.colorFillAlter,fontSize:e.fontSize,lineHeight:e.lineHeight,paddingBlock:n(e.paddingSM).sub(e.lineWidthBold).equal(),paddingInlineStart:e.padding,paddingInlineEnd:e.paddingXS,display:"flex",[`${o}-title`]:{flex:"auto"}},"&-content":{padding:e.padding},"&-motion":{transition:["height","border"].map(r=>`${r} ${e.motionDurationSlow}`).join(","),overflow:"hidden","&-enter-start, &-leave-active":{borderBottomColor:"transparent"},"&-hidden":{display:"none"}},"&-collapse-transition":{"&-enter-active":{transition:["max-height","padding-top","padding-bottom"].map(r=>`${r} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")},"&-leave-active":{transition:["max-height","padding-top","padding-bottom"].map(r=>`${r} ${e.motionDurationSlow} ${e.motionEaseInOut}`).join(",")}}}}}},Y8=e=>{const{componentCls:t,padding:n,paddingSM:o,paddingXS:r,lineWidth:a,lineWidthBold:l,calc:s}=e;return{[t]:{position:"relative",width:"100%",boxSizing:"border-box",boxShadow:`${e.boxShadowTertiary}`,transition:`background ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:s(e.borderRadius).mul(2).equal()},borderColor:e.colorBorder,borderWidth:0,borderStyle:"solid","&:after":{content:'""',position:"absolute",inset:0,pointerEvents:"none",transition:`border-color ${e.motionDurationSlow}`,borderRadius:{_skip_check_:!0,value:"inherit"},borderStyle:"inherit",borderColor:"inherit",borderWidth:a},"&:focus-within":{boxShadow:`${e.boxShadowSecondary}`,borderColor:e.colorPrimary,"&:after":{borderWidth:l}},"&-disabled":{background:e.colorBgContainerDisabled},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{display:"flex",gap:r,width:"100%",paddingBlock:o,paddingInlineStart:n,paddingInlineEnd:o,boxSizing:"border-box",alignItems:"flex-end"},[`${t}-prefix`]:{flex:"none"},[`${t}-input`]:{padding:0,borderRadius:0,flex:"auto",alignSelf:"center",minHeight:"auto"},[`${t}-actions-list`]:{flex:"none",display:"flex","&-presets":{gap:e.paddingXS}},[`${t}-actions-btn`]:{"&-disabled":{opacity:.45},"&-loading-button":{padding:0,border:0},"&-loading-icon":{height:e.controlHeight,width:e.controlHeight,verticalAlign:"top"},"&-recording-icon":{height:"1.2em",width:"1.2em",verticalAlign:"top"}}}}},Z8=Gt("Sender",e=>{const{paddingXS:t,calc:n}=e,o=Ct(e,{SenderContentMaxWidth:`calc(100% - ${ft(n(t).add(32).equal())})`});return[Y8(o),q8(o)]},()=>({}));let qi;!qi&&typeof window<"u"&&(qi=window.SpeechRecognition||window.webkitSpeechRecognition);function Q8(e,t){const n=e,o=i.computed(()=>{const g=i.toValue(t);return typeof g=="object"?{controlledRecording:g.recording,onControlledRecordingChange:g.onRecordingChange,speechInControlled:typeof g.recording=="boolean"}:{controlledRecording:void 0,onControlledRecordingChange:void 0,speechInControlled:!1}}),r=i.computed(()=>o.value.controlledRecording),a=o.value.onControlledRecordingChange,l=o.value.speechInControlled,s=i.ref(null);i.watchEffect(()=>{if(typeof navigator<"u"&&"permissions"in navigator){let g=null;navigator.permissions.query({name:"microphone"}).then(y=>{s.value=y.state,y.onchange=function(){s.value=this.state},g=y}),i.onWatcherCleanup(()=>{g&&(g.onchange=null)})}});const c=i.computed(()=>qi&&s.value!=="denied"),u=i.ref(null),[d,f]=A0(!1,{value:r}),p=i.ref(!1),m=()=>{if(c.value&&!u.value){const g=new qi;g.onstart=()=>{f(!0)},g.onend=()=>{f(!1)},g.onresult=y=>{var C,S,$;if(!p.value){const x=($=(S=(C=y.results)==null?void 0:C[0])==null?void 0:S[0])==null?void 0:$.transcript;n(x)}p.value=!1},u.value=g}};return{speechPermission:c,triggerSpeech:g=>{g&&!d.value||(p.value=g,l?a==null||a(!d.value):(m(),u.value&&(d.value?(u.value.stop(),a==null||a(!1)):(u.value.start(),a==null||a(!0)))))},recording:d}}function J8(e,t){for(var n=e,o=0;o<t.length;o+=1){if(n==null)return;n=n[t[o]]}return n}const eR=i.defineComponent({name:"AXSender",__name:"Sender",props:i.mergeDefaults({onKeyPress:{type:Function},prefixCls:null,defaultValue:null,value:null,loading:{type:Boolean},placeholder:null,readOnly:{type:Boolean},submitType:{type:[String,Boolean]},disabled:{type:Boolean},onSubmit:{type:Function},onChange:{type:Function},onCancel:null,onKeyDown:{type:Function},onPaste:{type:Function},onPasteFile:{type:Function},components:null,styles:null,rootClassName:null,classNames:null,style:null,className:null,actions:{type:Function},allowSpeech:null,prefix:null,header:null},{styles:()=>({}),classNames:()=>({}),submitType:"enter",disabled:void 0}),emits:["update:value"],setup(e,{expose:t,emit:n}){const o=He(e,["prefixCls","styles","classNames","className","rootClassName","style","defaultValue","value","placeholder","readOnly","submitType","onSubmit","loading","components","onCancel","onChange","actions","onKeyPress","onKeyDown","disabled","allowSpeech","prefix","header","onPaste","onPasteFile"]);i.toRef(e,"prefixCls");function r(X,J,te){return J8(X,J)||te}const a=n,l=i.useSlots(),{direction:s,getPrefixCls:c}=Ke(),u=i.computed(()=>c("sender",e.prefixCls)),d=i.ref(null),f=i.ref(null),p=Ut("sender"),m=i.computed(()=>`${u.value}-input`),[v,g,y]=Z8(u.value),C=i.computed(()=>re(u.value,p.value.className,e.className,e.rootClassName,g.value,y,{[`${u.value}-rtl`]:s.value==="rtl",[`${u.value}-disabled`]:e.disabled})),S=i.computed(()=>`${u.value}-actions-btn`),$=i.computed(()=>`${u.value}-actions-list`),x=i.ref(e.value??e.defaultValue??""),w=X=>{x.value=X};i.watch(()=>e.value,()=>{w(e.value)});const P=(X,J)=>{w(X),a("update:value",X),e.onChange&&e.onChange(X,J)},{speechPermission:b,triggerSpeech:I,recording:E}=Q8(X=>{P(`${x.value} ${X}`)},()=>e.allowSpeech),A=r(e.components,["input"],Ee.TextArea),R=i.computed(()=>uo(o,{attr:!0,aria:!0,data:!0})),B=i.computed(()=>({...R.value,ref:f})),M=()=>{x.value&&e.onSubmit&&!e.loading&&e.onSubmit(x.value)},z=()=>{P("")},O=i.ref(!1),T=()=>{O.value=!0},D=()=>{O.value=!1},L=X=>{const J=X.key==="Enter"&&!O.value;switch(e.submitType){case"enter":J&&!X.shiftKey&&(X.preventDefault(),M());break;case"shiftEnter":J&&X.shiftKey&&(X.preventDefault(),M());break}e.onKeyPress&&e.onKeyPress(X)},N=X=>{var te,U;const J=(te=X.clipboardData)==null?void 0:te.files[0];J&&e.onPasteFile&&(e.onPasteFile(J),X.preventDefault()),(U=e.onPaste)==null||U.call(e,X)},H=X=>{var J,te;X.target!==((J=d.value)==null?void 0:J.querySelector(`.${m.value}`))&&X.preventDefault(),(te=f.value)==null||te.focus()},j=i.computed(()=>{let X=i.createVNode(sr,{class:`${$.value}-presets`},{default:()=>[e.allowSpeech&&i.createVNode(G8,null,null),e.loading?i.createVNode(B0,null,null):i.createVNode(L0,null,null)]});const J={components:{SendButton:L0,ClearButton:K8,LoadingButton:B0}};return l.actions?X=l.actions({ori:X,info:J}):typeof e.actions=="function"?X=e.actions(X,J):e.actions&&(X=e.actions),X}),Y=i.computed(()=>l.header?l.header():e.header),Z=i.computed(()=>l.prefix?l.prefix():e.prefix);return t({nativeElement:d.value,focus:X=>{var J;return(J=f.value)==null?void 0:J.focus(X)},blur:()=>{var X;return(X=f.value)==null?void 0:X.blur()}}),()=>v(i.createVNode("div",{ref:d,class:C.value,style:{...p.value.style,...e.style}},[Y.value&&i.createVNode(j8,{value:{prefixCls:u.value}},{default:()=>[Y.value]}),i.createVNode("div",{class:`${u.value}-content`,onMousedown:H},[Z.value&&i.createVNode("div",{class:re(`${u.value}-prefix`,p.value.classNames.prefix,e.classNames.prefix),style:{...p.value.styles.prefix,...e.styles.prefix}},[Z.value]),i.createVNode(A,i.mergeProps(B.value,{disabled:e.disabled,style:{...p.value.styles.input,...e.styles.input},class:re(m.value,p.value.classNames.input,e.classNames.input),autoSize:{maxRows:8},value:x.value,onChange:X=>{P(X.target.value,X),I(!0)},onPressEnter:L,onCompositionstart:T,onCompositionend:D,onKeydown:e.onKeyDown,placeholder:e.placeholder,onPaste:N,bordered:!1,readOnly:e.readOnly}),null),i.createVNode("div",{class:re($.value,p.value.classNames.actions,e.classNames.actions),style:{...p.value.styles.actions,...e.styles.actions}},[i.createVNode(k8,{value:{prefixCls:S.value,onSend:M,onSendDisabled:!x.value,onClear:z,onClearDisabled:!x.value,onCancel:e.onCancel,onCancelDisabled:!e.loading,onSpeech:()=>I(!1),onSpeechDisabled:!b.value,speechRecording:E.value,disabled:e.disabled}},{default:()=>[j.value]})])])]))}}),tR=i.defineComponent({name:"AXCollapseTransition",__name:"CollapseTransition",props:{prefixCls:null},setup(e){const t=e,n=i.computed(()=>t.prefixCls+"-collapse-transition"),o={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){r.dataset.oldOverflow=r.style.overflow,r.scrollHeight!==0?(r.style.maxHeight=`${r.scrollHeight}px`,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom):(r.style.maxHeight=`${r.dataset.oldMaxHeight||999}px`,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom),r.style.overflow="hidden"},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldMaxHeight=r.scrollHeight,r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.overflow="hidden",r.style.maxHeight=`${r.scrollHeight}px`},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom}};return(r,a)=>(i.openBlock(),i.createBlock(i.Transition,i.mergeProps({name:n.value},i.toHandlers(o)),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}}),nR=i.defineComponent({name:"AXSenderHeader",inheritAttrs:!1,__name:"SenderHeader",props:i.mergeDefaults({forceRender:{type:Boolean},open:{type:Boolean},onOpenChange:{type:Function},title:null,children:null,className:null,style:null,classNames:null,styles:null,closable:{type:Boolean}},{classNames:()=>({}),styles:()=>({})}),setup(e){i.toRef(e,"classNames");const t=i.useSlots(),n=_8(),o=i.computed(()=>`${n.value.prefixCls}-header`),r=i.useAttrs();return()=>i.createVNode(tR,{prefixCls:o.value},{default:()=>{var a;return[e.open&&i.createVNode("div",i.mergeProps(r,{class:re(o.value,e.className),style:{...e.style}}),[(e.closable!==!1||e.title)&&i.createVNode("div",{class:re(`${o.value}-header`,e.classNames.header),style:{...e.styles.header}},[i.createVNode("div",{class:`${o.value}-title`},[e.title]),e.closable!==!1&&i.createVNode("div",{class:`${o.value}-close`},[i.createVNode(We,{type:"text",icon:i.createVNode(Ft,null,null),size:"small",onClick:()=>{var l;(l=e.onOpenChange)==null||l.call(e,!e.open)}},null)])]),t.default&&i.createVNode("div",{class:re(`${o.value}-content`,e.classNames.content),style:{...e.styles.content}},[(a=t.default)==null?void 0:a.call(t)])])]}})}}),oR=Object.assign(eR,{Header:nR}),F0=Symbol("AttachmentContext"),xc=i.shallowRef(),rR=e=>{i.provide(F0,e),i.watch(e,()=>{xc.value=i.unref(e),i.triggerRef(xc)},{immediate:!0,deep:!0})},Yi=()=>i.inject(F0,i.computed(()=>xc.value||{})),iR=i.defineComponent({inheritAttrs:!1,props:{value:St()},setup(e,{slots:t}){return rR(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),aR=i.defineComponent({name:"AXAttachmentsPlaceholderUploader",__name:"PlaceholderUploader",props:i.mergeDefaults({prefixCls:null,placeholder:null,upload:null,className:null,style:null},{placeholder:()=>({})}),setup(e,{expose:t}){const n=`${e.prefixCls}-placeholder`,o=i.computed(()=>e.placeholder||{}),r=i.useTemplateRef("upload-dragger"),a=Yi(),[l,s]=Ie(!1),c=()=>{s(!0)},u=p=>{p.currentTarget.contains(p.relatedTarget)||s(!1)},d=()=>{s(!1)};t({nativeElement:r});const f=i.computed(()=>i.isVNode(e.placeholder)?e.placeholder:i.createVNode(sr,{align:"center",justify:"center",vertical:!0,class:`${n}-inner`},{default:()=>[i.createVNode($e.Text,{class:`${n}-icon`},{default:()=>[o.value.icon]}),i.createVNode($e.Title,{class:`${n}-title`,level:5},{default:()=>[o.value.title]}),i.createVNode($e.Text,{class:`${n}-description`,type:"secondary"},{default:()=>[o.value.description]})]}));return()=>i.createVNode("div",{class:re(n,{[`${n}-drag-in`]:l.value,[`${n}-disabled`]:a.value.disabled},e.className),onDragenter:c,onDragleave:u,onDrop:d,"aria-hidden":a.value.disabled,style:e.style},[i.createVNode(wh.Dragger,i.mergeProps({showUploadList:!1},e.upload,{ref:"upload-dragger",style:{padding:0,border:0,background:"transparent"}}),{default:()=>[f.value]})])}}),H0=i.defineComponent({name:"AXAttachmentsDropArea",__name:"DropArea",props:{prefixCls:null,className:null,getDropContainer:{type:Function},children:null},setup(e){const t=Yi(),[n,o]=Ie(),[r,a]=Ie(null);i.watch(()=>e.getDropContainer,()=>{var u;const c=(u=e.getDropContainer)==null?void 0:u.call(e);n.value!==c&&o(c)}),i.watch(()=>!!n.value,()=>{if(n.value){const c=()=>{a(!0)},u=p=>{p.preventDefault()},d=p=>{p.relatedTarget||a(!1)},f=p=>{a(!1),p.preventDefault()};document.addEventListener("dragenter",c),document.addEventListener("dragover",u),document.addEventListener("dragleave",d),document.addEventListener("drop",f),i.onWatcherCleanup(()=>{document.removeEventListener("dragenter",c),document.removeEventListener("dragover",u),document.removeEventListener("dragleave",d),document.removeEventListener("drop",f)})}});const l=i.computed(()=>e.getDropContainer&&n.value&&!t.value.disabled),s=`${e.prefixCls}-drop-area`;return()=>l.value?i.createVNode(i.Teleport,{to:n.value},{default:()=>[i.createVNode("div",{class:re(s,e.className,{[`${s}-on-body`]:n.value.tagName==="BODY"}),style:{display:r.value?"block":"none"}},[e.children])]}):null}}),_0=i.defineComponent({name:"AXAttachmentsSilentUploader",__name:"SilentUploader",props:{children:null,upload:null,rootClassName:null},setup(e,{expose:t}){const n=i.useTemplateRef("upload");return t({nativeElement:n}),()=>i.createVNode(wh,i.mergeProps(e.upload,{showUploadList:!1,ref:"upload"}),{default:()=>[e.children]})}}),j0=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},lR={},sR={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function cR(e,t){return i.openBlock(),i.createElementBlock("svg",sR,t[0]||(t[0]=[i.createElementVNode("title",null,"audio",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M10.7315824,7.11216117 C10.7428131,7.15148751 10.7485063,7.19218979 10.7485063,7.23309113 L10.7485063,8.07742614 C10.7484199,8.27364959 10.6183424,8.44607275 10.4296853,8.50003683 L8.32984514,9.09986306 L8.32984514,11.7071803 C8.32986605,12.5367078 7.67249692,13.217028 6.84345686,13.2454634 L6.79068592,13.2463395 C6.12766108,13.2463395 5.53916361,12.8217001 5.33010655,12.1924966 C5.1210495,11.563293 5.33842118,10.8709227 5.86959669,10.4741173 C6.40077221,10.0773119 7.12636292,10.0652587 7.67042486,10.4442027 L7.67020842,7.74937024 L7.68449368,7.74937024 C7.72405122,7.59919041 7.83988806,7.48101083 7.98924584,7.4384546 L10.1880418,6.81004755 C10.42156,6.74340323 10.6648954,6.87865515 10.7315824,7.11216117 Z M9.60714286,1.31785714 L12.9678571,4.67857143 L9.60714286,4.67857143 L9.60714286,1.31785714 Z",fill:"currentColor"})],-1)]))}const uR=j0(lR,[["render",cR]]),dR={},fR={width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function pR(e,t){return i.openBlock(),i.createElementBlock("svg",fR,t[0]||(t[0]=[i.createElementVNode("title",null,"video",-1),i.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[i.createElementVNode("path",{d:"M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M12.9678571,4.67857143 L9.60714286,1.31785714 L9.60714286,4.67857143 L12.9678571,4.67857143 Z M10.5379461,10.3101106 L6.68957555,13.0059749 C6.59910784,13.0693494 6.47439406,13.0473861 6.41101953,12.9569184 C6.3874624,12.9232903 6.37482581,12.8832269 6.37482581,12.8421686 L6.37482581,7.45043999 C6.37482581,7.33998304 6.46436886,7.25043999 6.57482581,7.25043999 C6.61588409,7.25043999 6.65594753,7.26307658 6.68957555,7.28663371 L10.5379461,9.98249803 C10.6284138,10.0458726 10.6503772,10.1705863 10.5870027,10.2610541 C10.5736331,10.2801392 10.5570312,10.2967411 10.5379461,10.3101106 Z",fill:"currentColor"})],-1)]))}const mR=j0(dR,[["render",pR]]),gR=e=>e.indexOf("image/")===0,Zi=200;function hR(e){return new Promise(t=>{if(!e||!e.type||!gR(e.type)){t("");return}const n=new Image;if(n.onload=()=>{const{width:o,height:r}=n,a=o/r,l=a>1?Zi:Zi*a,s=a>1?Zi/a:Zi,c=document.createElement("canvas");c.width=l,c.height=s,c.style.cssText=`position: fixed; left: 0; top: 0; width: ${l}px; height: ${s}px; z-index: 9999; display: none;`,document.body.appendChild(c),c.getContext("2d").drawImage(n,0,0,l,s);const d=c.toDataURL();document.body.removeChild(c),window.URL.revokeObjectURL(n.src),t(d)},n.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(n.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else n.src=window.URL.createObjectURL(e)})}const Re=Math.round;function Oc(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],o=n.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)o[r]=t(o[r]||0,n[r]||"",r);return n[3]?o[3]=n[3].includes("%")?o[3]/100:o[3]:o[3]=1,o}const W0=(e,t,n)=>n===0?e:e/100;function gr(e,t){const n=t||255;return e>n?n:e<0?0:e}class Pc{constructor(t){Xe(this,"isValid",!0),Xe(this,"r",0),Xe(this,"g",0),Xe(this,"b",0),Xe(this,"a",1),Xe(this,"_h",void 0),Xe(this,"_s",void 0),Xe(this,"_l",void 0),Xe(this,"_v",void 0),Xe(this,"_max",void 0),Xe(this,"_min",void 0),Xe(this,"_brightness",void 0);function n(o){return o[0]in t&&o[1]in t&&o[2]in t}if(t)if(typeof t=="string"){let r=function(a){return o.startsWith(a)};const o=t.trim();/^#?[A-F\d]{3,8}$/i.test(o)?this.fromHexString(o):r("rgb")?this.fromRgbString(o):r("hsl")?this.fromHslString(o):(r("hsv")||r("hsb"))&&this.fromHsvString(o)}else if(t instanceof Pc)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=gr(t.r),this.g=gr(t.g),this.b=gr(t.b),this.a=typeof t.a=="number"?gr(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(a){const l=a/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=t(this.r),o=t(this.g),r=t(this.b);return .2126*n+.7152*o+.0722*r}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=Re(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()-t/100;return r<0&&(r=0),this._c({h:n,s:o,l:r,a:this.a})}lighten(t=10){const n=this.getHue(),o=this.getSaturation();let r=this.getLightness()+t/100;return r>1&&(r=1),this._c({h:n,s:o,l:r,a:this.a})}mix(t,n=50){const o=this._c(t),r=n/100,a=s=>(o[s]-this[s])*r+this[s],l={r:Re(a("r")),g:Re(a("g")),b:Re(a("b")),a:Re(a("a")*100)/100};return this._c(l)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),o=this.a+n.a*(1-this.a),r=a=>Re((this[a]*this.a+n[a]*n.a*(1-this.a))/o);return this._c({r:r("r"),g:r("g"),b:r("b"),a:o})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const o=(this.g||0).toString(16);t+=o.length===2?o:"0"+o;const r=(this.b||0).toString(16);if(t+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const a=Re(this.a*255).toString(16);t+=a.length===2?a:"0"+a}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=Re(this.getSaturation()*100),o=Re(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${o}%,${this.a})`:`hsl(${t},${n}%,${o}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,o){const r=this.clone();return r[t]=gr(n,o),r}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function o(r,a){return parseInt(n[r]+n[a||r],16)}n.length<6?(this.r=o(0),this.g=o(1),this.b=o(2),this.a=n[3]?o(3)/255:1):(this.r=o(0,1),this.g=o(2,3),this.b=o(4,5),this.a=n[6]?o(6,7)/255:1)}fromHsl({h:t,s:n,l:o,a:r}){if(this._h=t%360,this._s=n,this._l=o,this.a=typeof r=="number"?r:1,n<=0){const p=Re(o*255);this.r=p,this.g=p,this.b=p}let a=0,l=0,s=0;const c=t/60,u=(1-Math.abs(2*o-1))*n,d=u*(1-Math.abs(c%2-1));c>=0&&c<1?(a=u,l=d):c>=1&&c<2?(a=d,l=u):c>=2&&c<3?(l=u,s=d):c>=3&&c<4?(l=d,s=u):c>=4&&c<5?(a=d,s=u):c>=5&&c<6&&(a=u,s=d);const f=o-u/2;this.r=Re((a+f)*255),this.g=Re((l+f)*255),this.b=Re((s+f)*255)}fromHsv({h:t,s:n,v:o,a:r}){this._h=t%360,this._s=n,this._v=o,this.a=typeof r=="number"?r:1;const a=Re(o*255);if(this.r=a,this.g=a,this.b=a,n<=0)return;const l=t/60,s=Math.floor(l),c=l-s,u=Re(o*(1-n)*255),d=Re(o*(1-n*c)*255),f=Re(o*(1-n*(1-c))*255);switch(s){case 0:this.g=f,this.b=u;break;case 1:this.r=d,this.b=u;break;case 2:this.r=u,this.b=f;break;case 3:this.r=u,this.g=d;break;case 4:this.r=f,this.g=u;break;case 5:default:this.g=u,this.b=d;break}}fromHsvString(t){const n=Oc(t,W0);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=Oc(t,W0);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=Oc(t,(o,r)=>r.includes("%")?Re(o/100*255):o);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const vR=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list-card`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[o]:{borderRadius:e.borderRadius,position:"relative",background:e.colorFillContent,borderWidth:e.lineWidth,borderStyle:"solid",borderColor:"transparent",flex:"none",[`${o}-name,${o}-desc`]:{display:"flex",flexWrap:"nowrap",maxWidth:"100%"},[`${o}-ellipsis-prefix`]:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},[`${o}-ellipsis-suffix`]:{flex:"none"},"&-type-overview":{padding:n(e.paddingSM).sub(e.lineWidth).equal(),paddingInlineStart:n(e.padding).add(e.lineWidth).equal(),display:"flex",flexWrap:"nowrap",gap:e.paddingXS,alignItems:"flex-start",width:236,[`${o}-icon`]:{fontSize:n(e.fontSizeLG).mul(2).equal(),lineHeight:1,paddingTop:n(e.paddingXXS).mul(1.5).equal(),flex:"none"},[`${o}-content`]:{flex:"auto",minWidth:0,display:"flex",flexDirection:"column",alignItems:"stretch"},[`${o}-desc`]:{color:e.colorTextTertiary}},"&-type-preview":{width:r,height:r,lineHeight:1,[`&:not(${o}-status-error)`]:{border:0},img:{width:"100%",height:"100%",verticalAlign:"top",objectFit:"cover",borderRadius:"inherit"},[`${o}-img-mask`]:{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",background:`rgba(0, 0, 0, ${e.opacityLoading})`,borderRadius:"inherit"},[`&${o}-status-error`]:{[`img, ${o}-img-mask`]:{borderRadius:n(e.borderRadius).sub(e.lineWidth).equal()},[`${o}-desc`]:{paddingInline:e.paddingXXS}},[`${o}-progress`]:{}},[`${o}-remove`]:{position:"absolute",top:0,insetInlineEnd:0,border:0,padding:e.paddingXXS,background:"transparent",lineHeight:1,transform:"translate(50%, -50%)",fontSize:e.fontSize,cursor:"pointer",opacity:e.opacityLoading,display:"none","&:dir(rtl)":{transform:"translate(-50%, -50%)"},"&:hover":{opacity:1},"&:active":{opacity:e.opacityLoading}},[`&:hover ${o}-remove`]:{display:"block"},"&-status-error":{borderColor:e.colorError,[`${o}-desc`]:{color:e.colorError}},"&-motion":{overflow:"hidden",transition:["opacity","width","margin","padding"].map(a=>`${a} ${e.motionDurationSlow}`).join(","),[`${o}-remove`]:{display:"none !important"},"&-appear-start":{width:0,transition:"none"},"&-leave-active":{opacity:0,width:0,paddingInline:0,borderInlineWidth:0,marginInlineEnd:n(e.paddingSM).mul(-1).equal()}}}}},Ic={"&, *":{boxSizing:"border-box"}},yR=e=>{const{componentCls:t,calc:n,antCls:o}=e,r=`${t}-drop-area`,a=`${t}-placeholder`;return{[r]:{position:"absolute",inset:0,zIndex:e.zIndexPopupBase,...Ic,"&-on-body":{position:"fixed",inset:0},"&-hide-placement":{[`${a}-inner`]:{display:"none"}},[a]:{padding:0}},"&":{[a]:{height:"100%",borderRadius:e.borderRadius,borderWidth:e.lineWidthBold,borderStyle:"dashed",borderColor:"transparent",padding:e.padding,position:"relative",backdropFilter:"blur(10px)",...Ic,[`${o}-upload-wrapper ${o}-upload${o}-upload-btn`]:{padding:0},[`&${a}-drag-in`]:{borderColor:e.colorPrimaryHover},[`&${a}-disabled`]:{opacity:.25,pointerEvents:"none"},[`${a}-inner`]:{gap:n(e.paddingXXS).div(2).equal()},[`${a}-icon`]:{fontSize:e.fontSizeHeading2,lineHeight:1},[`${a}-title${a}-title`]:{margin:0,fontSize:e.fontSize,lineHeight:e.lineHeight},[`${a}-description`]:{}}}}},bR=e=>{const{componentCls:t,calc:n}=e,o=`${t}-list`,r=n(e.fontSize).mul(e.lineHeight).mul(2).add(e.paddingSM).add(e.paddingSM).equal();return{[t]:{position:"relative",width:"100%",...Ic,[o]:{display:"flex",flexWrap:"wrap",gap:e.paddingSM,fontSize:e.fontSize,lineHeight:e.lineHeight,color:e.colorText,paddingBlock:e.paddingSM,paddingInline:e.padding,width:"100%",background:e.colorBgContainer,scrollbarWidth:"none","-ms-overflow-style":"none","&::-webkit-scrollbar":{display:"none"},"&-overflow-scrollX, &-overflow-scrollY":{"&:before, &:after":{content:'""',position:"absolute",opacity:0,transition:`opacity ${e.motionDurationSlow}`,zIndex:1}},"&-overflow-ping-start:before":{opacity:1},"&-overflow-ping-end:after":{opacity:1},"&-overflow-scrollX":{overflowX:"auto",overflowY:"hidden",flexWrap:"nowrap","&:before, &:after":{insetBlock:0,width:8},"&:before":{insetInlineStart:0,background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetInlineEnd:0,background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:dir(rtl)":{"&:before":{background:"linear-gradient(to left, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{background:"linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0));"}}},"&-overflow-scrollY":{overflowX:"hidden",overflowY:"auto",maxHeight:n(r).mul(3).equal(),"&:before, &:after":{insetInline:0,height:8},"&:before":{insetBlockStart:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.06), rgba(0,0,0,0));"},"&:after":{insetBlockEnd:0,background:"linear-gradient(to top, rgba(0,0,0,0.06), rgba(0,0,0,0));"}},"&-upload-btn":{width:r,height:r,fontSize:e.fontSizeHeading2,color:"#999"},"&-prev-btn, &-next-btn":{position:"absolute",top:"50%",transform:"translateY(-50%)",boxShadow:e.boxShadowTertiary,opacity:0,pointerEvents:"none"},"&-prev-btn":{left:{_skip_check_:!0,value:e.padding}},"&-next-btn":{right:{_skip_check_:!0,value:e.padding}},"&:dir(ltr)":{[`&${o}-overflow-ping-start ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-end ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}},"&:dir(rtl)":{[`&${o}-overflow-ping-end ${o}-prev-btn`]:{opacity:1,pointerEvents:"auto"},[`&${o}-overflow-ping-start ${o}-next-btn`]:{opacity:1,pointerEvents:"auto"}}}}}},k0=Gt("Attachments",e=>{const t=Ct(e,{});return[yR(t),bR(t),vR(t)]},e=>{const{colorBgContainer:t}=e;return{colorBgPlaceholderHover:new Pc(t).setA(.85).toRgbString()}}),Tc=" ",Nc="#8c8c8c",K0=i.defineComponent({name:"AXAttachmentsFileListCard",__name:"FileListCard",props:{prefixCls:null,item:null,onRemove:{type:Function},className:null,style:null},setup(e,{expose:t}){i.toRef(e,"prefixCls");const n=["png","jpg","jpeg","gif","bmp","webp","svg"],o=[{icon:i.createVNode(qs,null,null),color:"#22b35e",ext:["xlsx","xls"]},{icon:i.createVNode(Ys,null,null),color:Nc,ext:n},{icon:i.createVNode(Zs,null,null),color:Nc,ext:["md","mdx"]},{icon:i.createVNode(Qs,null,null),color:"#ff4d4f",ext:["pdf"]},{icon:i.createVNode(Js,null,null),color:"#ff6e31",ext:["ppt","pptx"]},{icon:i.createVNode(tc,null,null),color:"#1677ff",ext:["doc","docx"]},{icon:i.createVNode(nc,null,null),color:"#fab714",ext:["zip","rar","7z","tar","gz"]},{icon:i.createVNode(mR,null,null),color:"#ff4d4f",ext:["mp4","avi","mov","wmv","flv","mkv"]},{icon:i.createVNode(uR,null,null),color:"#8c8c8c",ext:["mp3","wav","flac","ape","aac","ogg"]}];function r(M,z){return z.some(O=>M.toLowerCase()===`.${O}`)}function a(M){let z=M;const O=["B","KB","MB","GB","TB","PB","EB"];let T=0;for(;z>=1024&&T<O.length-1;)z/=1024,T++;return`${z.toFixed(0)} ${O[T]}`}const l=Yi(),s=i.computed(()=>l.value.disabled),c=i.computed(()=>e.item.name),u=i.computed(()=>e.item.size),d=i.computed(()=>e.item.percent),f=i.computed(()=>e.item.status||"done"),p=i.computed(()=>e.item.description),{getPrefixCls:m}=Ke(),v=i.computed(()=>m("attachment",e.prefixCls)),g=`${v.value}-list-card`,[y,C,S]=k0(v),$=i.useTemplateRef("file-list-card-container"),x=i.computed(()=>{const M=c.value||"",z=M.match(/^(.*)\.[^.]+$/);return{namePrefix:z?z[1]:M,nameSuffix:z?M.slice(z[1].length):""}}),w=i.computed(()=>r(x.value.nameSuffix,n)),P=i.computed(()=>p.value?p.value:f.value==="uploading"?`${d.value||0}%`:f.value==="error"?e.item.response||Tc:u.value?a(u.value):Tc),b=i.computed(()=>{for(const{ext:M,icon:z,color:O}of o)if(r(x.value.nameSuffix,M))return{icon:z,iconColor:O};return{icon:i.createVNode(ec,{key:"defaultIcon"},null),iconColor:Nc}}),[I,E]=Ie();i.watch(()=>e.item.originFileObj,()=>{if(e.item.originFileObj){let M=!0;hR(e.item.originFileObj).then(z=>{M&&E(z)}),i.onWatcherCleanup(()=>{M=!1})}E(void 0)},{immediate:!0});const A=i.computed(()=>e.item.thumbUrl||e.item.url||I.value),R=i.computed(()=>w.value&&(e.item.originFileObj||A.value)),B=i.computed(()=>R.value?i.createVNode(i.Fragment,null,[A.value&&i.createVNode("img",{alt:"preview",src:A.value},null),f.value!=="done"&&i.createVNode("div",{class:`${g}-img-mask`},[f.value==="uploading"&&d.value!==void 0&&i.createVNode(th,{percent:d.value,prefixCls:g},null),f.value==="error"&&i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]):i.createVNode(i.Fragment,null,[i.createVNode("div",{class:`${g}-icon`,style:{color:b.value.iconColor}},[b.value.icon]),i.createVNode("div",{class:`${g}-content`},[i.createVNode("div",{class:`${g}-name`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[x.value.namePrefix??Tc]),i.createVNode("div",{class:`${g}-ellipsis-suffix`},[x.value.nameSuffix])]),i.createVNode("div",{class:`${g}-desc`},[i.createVNode("div",{class:`${g}-ellipsis-prefix`},[P.value])])])]));return t({nativeElement:$}),()=>y(i.createVNode("div",{class:re(g,{[`${g}-status-${f.value}`]:f.value,[`${g}-type-preview`]:R.value,[`${g}-type-overview`]:!R.value},e.className,C.value,S),style:e.style,ref:"file-list-card-container"},[B.value,!s.value&&e.onRemove&&i.createVNode("button",{type:"button",class:`${g}-remove`,onClick:()=>{e.onRemove(e.item)}},[i.createVNode(dt,null,null)])]))}}),U0=1,CR=i.defineComponent({name:"AXAttachmentsFileList",__name:"FileList",props:{prefixCls:null,items:null,onRemove:{type:Function},overflow:null,upload:null,listClassName:null,listStyle:null,itemClassName:null,itemStyle:null},setup(e){const t=i.computed(()=>`${e.prefixCls}-list`),n=i.useTemplateRef("file-list-container"),[o,r]=Ie(!1),a=Yi();i.watchEffect(()=>{r(!0),i.onWatcherCleanup(()=>{r(!1)})});const[l,s]=Ie(!1),[c,u]=Ie(!1),d=()=>{const v=n.value;v&&(e.overflow==="scrollX"?(s(Math.abs(v.scrollLeft)>=U0),u(v.scrollWidth-v.clientWidth-Math.abs(v.scrollLeft)>=U0)):e.overflow==="scrollY"&&(s(v.scrollTop!==0),u(v.scrollHeight-v.clientHeight!==v.scrollTop)))};i.watch(()=>e.overflow,()=>{d()},{immediate:!0});const f=v=>{const g=n.value;g&&g.scrollTo({left:g.scrollLeft+v*g.clientWidth,behavior:"smooth"})},p=()=>{f(-1)},m=()=>{f(1)};return()=>i.createVNode("div",{class:re(t.value,{[`${t.value}-overflow-${e.overflow}`]:e.overflow,[`${t.value}-overflow-ping-start`]:l.value,[`${t.value}-overflow-ping-end`]:c.value},e.listClassName),ref:"file-list-container",onScroll:d,style:e.listStyle},[e.items.map(v=>i.createVNode(K0,{key:v.uid,prefixCls:e.prefixCls,item:v,onRemove:e.onRemove,className:re(e.itemClassName),style:{...e.itemStyle}},null)),!a.value.disabled&&i.createVNode(_0,{upload:e.upload,children:i.createVNode(We,{class:`${t.value}-upload-btn`,type:"dashed"},{default:()=>[i.createVNode(ps,{class:`${t.value}-upload-btn-icon`},null)]})},null),e.overflow==="scrollX"&&i.createVNode(i.Fragment,null,[i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-prev-btn`,icon:i.createVNode(Zo,null,null),onClick:p},null),i.createVNode(We,{size:"small",shape:"circle",class:`${t.value}-next-btn`,icon:i.createVNode(yn,null,null),onClick:m},null)])])}});function SR(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const wR=i.defineComponent({name:"AXAttachments",__name:"Attachments",props:i.mergeDefaults({capture:null,type:null,name:null,defaultFileList:null,action:null,directory:null,data:null,method:null,headers:null,showUploadList:null,multiple:null,accept:null,beforeUpload:null,onChange:{type:Function},"onUpdate:fileList":null,onDrop:null,listType:null,onPreview:null,onDownload:null,onReject:null,onRemove:null,remove:null,supportServerRender:null,disabled:{type:Boolean},prefixCls:null,customRequest:null,withCredentials:null,openFileDialogOnClick:null,locale:null,id:null,previewFile:null,transformFile:null,iconRender:null,isImageUrl:null,progress:null,itemRender:null,maxCount:null,height:null,removeIcon:null,downloadIcon:null,previewIcon:null,rootClassName:null,rootStyle:null,style:null,className:null,classNames:null,styles:null,children:null,placeholder:{type:Function},getDropContainer:{type:Function},items:null,overflow:null},{items:()=>[],classNames:()=>({}),styles:()=>({})}),setup(e,{expose:t}){const n=He(e,["prefixCls","rootClassName","rootStyle","className","style","items","children","getDropContainer","placeholder","onChange","overflow","disabled","classNames","styles"]);i.toRef(e,"prefixCls");const o=i.useSlots(),{getPrefixCls:r,direction:a}=Ke(),l=r("attachment",e.prefixCls),s=Ut("attachments"),c=i.computed(()=>s.value.classNames),u=i.computed(()=>s.value.styles),d=i.useTemplateRef("attachments-container"),f=i.useTemplateRef("attachments-upload"),[p,m,v]=k0(l),g=i.computed(()=>re(m.value,v)),[y,C]=Ie(e.items);i.watch(()=>e.items,()=>{C(e.items)});const S=b=>{var I;C(b.fileList),(I=e.onChange)==null||I.call(e,b)},$=i.computed(()=>({...n,fileList:y.value,onChange:S})),x=b=>{const I=y.value.filter(E=>E.uid!==b.uid);S({file:b,fileList:I})},w=(b,I,E)=>{const A=o.placeholder?o.placeholder({type:b}):typeof e.placeholder=="function"?e.placeholder(b):e.placeholder;return i.createVNode(aR,{placeholder:A,upload:$.value,prefixCls:l,className:re(c.value.placeholder,e.classNames.placeholder),style:{...u.value.placeholder,...e.styles.placeholder,...I==null?void 0:I.style}},null)},P=i.computed(()=>y.value.length>0);return t({nativeElement:d.value,upload:b=>{var E,A;const I=(A=(E=f.value)==null?void 0:E.nativeElement)==null?void 0:A.querySelector('input[type="file"]');if(I){const R=new DataTransfer;R.items.add(b),I.files=R.files,I.dispatchEvent(new Event("change",{bubbles:!0}))}}}),()=>{let b;return p(i.createVNode(iR,{value:{disabled:e.disabled}},{default:()=>[e.children?i.createVNode(i.Fragment,null,[i.createVNode(_0,{upload:$.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),i.createVNode(H0,{getDropContainer:e.getDropContainer,prefixCls:l,className:re(g.value,e.rootClassName),children:w("drop")},null)]):i.createVNode("div",{class:re(l,g.value,{[`${l}-rtl`]:a.value==="rtl"},e.className,e.rootClassName),style:{...e.rootStyle,...e.style},dir:a.value||"ltr",ref:"attachments-container"},[i.createVNode(CR,{prefixCls:l,items:y.value,onRemove:x,overflow:e.overflow,upload:$.value,listClassName:re(c.value.list,e.classNames.list),listStyle:{...u.value.list,...e.styles.list,...!P.value&&{display:"none"}},itemClassName:re(c.value.item,e.classNames.item),itemStyle:{...u.value.item,...e.styles.item}},null),w("inline",P.value?{style:{display:"none"}}:{},f.value),i.createVNode(H0,{getDropContainer:e.getDropContainer||(()=>d.value),prefixCls:l,className:g.value},SR(b=w("drop"))?b:{default:()=>[b]})])]}))}}}),$R=Object.assign(wR,{FileCard:K0}),xR=(e,t,n)=>{const o=i.computed(()=>{const s=i.toValue(e);let c={expandedKeys:[],onExpand:()=>{}};return s?(typeof s=="object"&&(c={...c,...s}),{enableCollapse:!0,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}):{enableCollapse:!1,customizeExpandedKeys:c.expandedKeys,customizeOnExpand:c.onExpand}}),[r,a]=Ie(o.value.customizeExpandedKeys),l=s=>{var u,d;if(!o.value.enableCollapse)return;const c=r.value.includes(s)?r.value.filter(f=>f!==s):[...r.value,s];(d=(u=o.value).customizeOnExpand)==null||d.call(u,c),a(c)};return[i.computed(()=>o.value.enableCollapse),r,l]};var Qi=(e=>(e.PENDING="pending",e.SUCCESS="success",e.ERROR="error",e))(Qi||{});const OR=e=>{const{componentCls:t}=e,n=`${t}-item`,o={[Qi.PENDING]:e.colorPrimaryText,[Qi.SUCCESS]:e.colorSuccessText,[Qi.ERROR]:e.colorErrorText},r=Object.keys(o);return r.reduce((a,l)=>{const s=o[l];return r.forEach(c=>{const u=`& ${n}-${l}-${c}`,d=l===c?{}:{backgroundColor:"none !important",backgroundImage:`linear-gradient(${s}, ${o[c]})`};a[u]={[`& ${n}-icon, & > *::before`]:{backgroundColor:`${s} !important`},"& > :last-child::before":d}}),a},{})},PR=e=>{const{calc:t,componentCls:n}=e,o=`${n}-item`,r={content:'""',width:t(e.lineWidth).mul(2).equal(),display:"block",position:"absolute",insetInlineEnd:"none",backgroundColor:e.colorTextPlaceholder};return{"& > :last-child > :last-child":{"&::before":{display:"none !important"},[`&${o}-footer`]:{"&::before":{display:"block !important",bottom:0}}},[`& > ${o}`]:{[`& ${o}-header, & ${o}-content, & ${o}-footer`]:{position:"relative","&::before":{bottom:t(e.itemGap).mul(-1).equal()}},[`& ${o}-header, & ${o}-content`]:{marginInlineStart:t(e.itemSize).mul(-1).equal(),"&::before":{...r,insetInlineStart:t(e.itemSize).div(2).sub(e.lineWidth).equal()}},[`& ${o}-header::before`]:{top:e.itemSize,bottom:t(e.itemGap).mul(-2).equal()},[`& ${o}-content::before`]:{top:"100%"},[`& ${o}-footer::before`]:{...r,top:0,insetInlineStart:t(e.itemSize).div(-2).sub(e.lineWidth).equal()}}}},IR=e=>{const{componentCls:t}=e,n=`${t}-item`;return{[n]:{display:"flex",flexDirection:"column",[`& ${n}-collapsible`]:{cursor:"pointer"},[`& ${n}-header`]:{display:"flex",marginBottom:e.itemGap,gap:e.itemGap,alignItems:"flex-start",[`& ${n}-icon`]:{height:e.itemSize,width:e.itemSize,fontSize:e.itemFontSize,display:"flex",justifyContent:"center",alignItems:"center"},[`& ${n}-extra`]:{height:e.itemSize,maxHeight:e.itemSize},[`& ${n}-header-box`]:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",[`& ${n}-title`]:{height:e.itemSize,lineHeight:`${ft(e.itemSize)}`,maxHeight:e.itemSize,fontSize:e.itemFontSize,[`& ${n}-collapse-icon`]:{marginInlineEnd:e.marginXS}},[`& ${n}-desc`]:{fontSize:e.itemFontSize}}},[`& ${n}-content`]:{[`& ${n}-content-hidden`]:{display:"none"},[`& ${n}-content-box`]:{padding:e.itemGap,display:"inline-block",maxWidth:`calc(100% - ${e.itemSize})`,borderRadius:e.borderRadiusLG,backgroundColor:e.colorBgContainer,border:`${ft(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${n}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},Ec=(e,t="middle")=>{const{componentCls:n}=e,o={large:{itemSize:e.itemSizeLG,itemGap:e.itemGapLG,itemFontSize:e.itemFontSizeLG},middle:{itemSize:e.itemSize,itemGap:e.itemGap,itemFontSize:e.itemFontSize},small:{itemSize:e.itemSizeSM,itemGap:e.itemGapSM,itemFontSize:e.itemFontSizeSM}}[t];return{[`&${n}-${t}`]:{paddingInlineStart:o.itemSize,gap:o.itemGap,...IR({...e,...o}),...PR({...e,...o})}}},TR=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...OR(e),...Ec(e),...Ec(e,"large"),...Ec(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},NR=Gt("ThoughtChain",e=>{const t=Ct(e,{itemFontSizeSM:e.fontSizeSM,itemSizeSM:e.calc(e.controlHeightXS).add(e.controlHeightSM).div(2).equal(),itemGapSM:e.marginSM,itemFontSize:e.fontSize,itemSize:e.calc(e.controlHeightSM).add(e.controlHeight).div(2).equal(),itemGap:e.margin,itemFontSizeLG:e.fontSizeLG,itemSizeLG:e.calc(e.controlHeight).add(e.controlHeightLG).div(2).equal(),itemGapLG:e.marginLG});return[TR(t)]}),X0=Symbol("ThoughtChainNodeContext"),Rc=i.shallowRef(),ER=e=>{i.provide(X0,e),i.watch(e,()=>{Rc.value=i.unref(e),i.triggerRef(Rc)},{immediate:!0,deep:!0})},RR=()=>i.inject(X0,i.computed(()=>Rc.value||{})),AR=i.defineComponent({props:{value:St()},setup(e,{slots:t}){return ER(i.computed(()=>e.value)),()=>{var n;return(n=t.default)==null?void 0:n.call(t)}}}),MR=i.defineComponent({name:"AXThoughtChainNode",__name:"item",props:i.mergeDefaults({info:null,nextStatus:null,onClick:{type:Function}},{info:()=>({})}),setup(e){const t=He(e,["info","nextStatus","onClick"]),n=i.computed(()=>uo(t,{attr:!0,aria:!0,data:!0})),o=RR(),r=i.computed(()=>o.value.prefixCls),a=i.computed(()=>o.value.enableCollapse),l=i.computed(()=>o.value.expandedKeys),s=i.computed(()=>o.value.direction),c=i.computed(()=>o.value.classNames),u=i.computed(()=>o.value.styles),d=i.useId(),f=i.computed(()=>e.info.key??d),p=i.computed(()=>e.info.icon),m=i.computed(()=>e.info.title),v=i.computed(()=>e.info.extra),g=i.computed(()=>e.info.content),y=i.computed(()=>e.info.footer),C=i.computed(()=>e.info.status),S=i.computed(()=>e.info.description),$=i.computed(()=>`${r.value}-item`),x=()=>{var b;return(b=e.onClick)==null?void 0:b.call(e,f.value)},w=i.computed(()=>{var b;return(b=l.value)==null?void 0:b.includes(f.value)}),P=i.computed(()=>a.value?w.value:!0);return()=>i.createVNode("div",i.mergeProps(n.value,{class:re($.value,{[`${$.value}-${C.value}${e.nextStatus?`-${e.nextStatus}`:""}`]:C.value},t.class),style:t.style}),[i.createVNode("div",{class:re(`${$.value}-header`,c.value.itemHeader),style:u.value.itemHeader,onClick:x},[i.createVNode(vn,{icon:p.value,class:`${$.value}-icon`},null),i.createVNode("div",{class:re(`${$.value}-header-box`,{[`${$.value}-collapsible`]:a.value&&g.value})},[i.createVNode($e.Text,{strong:!0,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:m.value}},class:`${$.value}-title`},{default:()=>[a.value&&g.value&&(s.value==="rtl"?i.createVNode(Zo,{class:`${$.value}-collapse-icon`,rotate:w.value?-90:0},null):i.createVNode(yn,{class:`${$.value}-collapse-icon`,rotate:w.value?90:0},null)),m.value]}),S.value&&i.createVNode($e.Text,{class:`${$.value}-desc`,ellipsis:{tooltip:{placement:s.value==="rtl"?"topRight":"topLeft",title:S.value}},type:"secondary"},{default:()=>[S.value]})]),v.value&&i.createVNode("div",{class:`${$.value}-extra`},[v.value])]),g.value&&i.withDirectives(i.createVNode("div",{class:re(`${$.value}-content`)},[i.createVNode("div",{class:re(`${$.value}-content-box`,c.value.itemContent),style:u.value.itemContent},[g.value])]),[[i.vShow,P.value]]),y.value&&i.createVNode("div",{class:re(`${$.value}-footer`,c.value.itemFooter),style:u.value.itemFooter},[y.value])])}}),VR=i.defineComponent({name:"AXThoughtChain",__name:"ThoughtChain",props:i.mergeDefaults({items:null,collapsible:{type:Boolean},size:null,styles:null,classNames:null,prefixCls:null,rootClassName:null},{styles:()=>({}),classNames:()=>({}),size:"middle"}),setup(e){const t=He(e,["prefixCls","rootClassName","class","items","collapsible","styles","style","classNames","size"]);i.toRef(e,"class"),i.toRef(e,"prefixCls");const n=i.computed(()=>uo(t,{attr:!0,aria:!0,data:!0})),{getPrefixCls:o,direction:r}=Ke(),a=i.computed(()=>o()),l=i.computed(()=>o("thought-chain",e.prefixCls)),s=Ut("thoughtChain"),[c,u,d]=xR(()=>e.collapsible,l.value,a.value),[f,p,m]=NR(l),v=i.computed(()=>re(e.class,e.rootClassName,l.value,s.value.className,p.value,m,{[`${l.value}-rtl`]:r.value==="rtl"},`${l.value}-${e.size}`));return()=>f(i.createVNode("div",i.mergeProps(n.value,{class:v.value,style:{...typeof s.value.style=="object"?s.value.style:{},...typeof e.style=="object"?e.style:{}}}),[i.createVNode(AR,{value:{prefixCls:l.value,enableCollapse:c.value,expandedKeys:u.value,direction:r.value,classNames:{itemHeader:re(s.value.classNames.itemHeader,e.classNames.itemHeader),itemContent:re(s.value.classNames.itemContent,e.classNames.itemContent),itemFooter:re(s.value.classNames.itemFooter,e.classNames.itemFooter)},styles:{itemHeader:{...s.value.styles.itemHeader,...e.styles.itemHeader},itemContent:{...s.value.styles.itemContent,...e.styles.itemContent},itemFooter:{...s.value.styles.itemFooter,...e.styles.itemFooter}}}},{default:()=>{var g;return[(g=e.items)==null?void 0:g.map((y,C)=>{var S;return i.createVNode(MR,{key:y.key||`key_${C}`,class:re(s.value.classNames.item,e.classNames.item),style:{...s.value.styles.item,...e.styles.item},info:{...y,icon:y.icon||C+1},onClick:d,nextStatus:((S=e.items[C+1])==null?void 0:S.status)||y.status},null)})]}})]))}}),DR=`
290
290
 
291
291
  `,BR=`
292
292
  `,G0=":",Ac=e=>(e??"").trim()!=="";function LR(){let e="";return new TransformStream({transform(t,n){e+=t;const o=e.split(DR);o.slice(0,-1).forEach(r=>{Ac(r)&&n.enqueue(r)}),e=o[o.length-1]},flush(t){Ac(e)&&t.enqueue(e)}})}function zR(){return new TransformStream({transform(e,t){const o=e.split(BR).reduce((r,a)=>{const l=a.indexOf(G0);if(l===-1)throw new Error(`The key-value separator "${G0}" is not found in the sse line chunk!`);const s=a.slice(0,l);if(!Ac(s))return r;const c=a.slice(l+1);return{...r,[s]:c}},{});Object.keys(o).length!==0&&t.enqueue(o)}})}function Mc(e){const{readableStream:t,transformStream:n}=e;if(!(t instanceof ReadableStream))throw new Error("The options.readableStream must be an instance of ReadableStream.");const o=new TextDecoderStream,r=n?t.pipeThrough(o).pipeThrough(n):t.pipeThrough(o).pipeThrough(LR()).pipeThrough(zR());return r[Symbol.asyncIterator]=async function*(){const a=this.getReader();for(;;){const{done:l,value:s}=await a.read();if(l)break;s&&(yield s)}},r}const q0=async(e,t={})=>{const{fetch:n=globalThis.fetch,middlewares:o={},...r}=t;if(typeof n!="function")throw new Error("The options.fetch must be a typeof fetch function!");let a=[e,r];typeof o.onRequest=="function"&&(a=await o.onRequest(...a));let l=await n(...a);if(typeof o.onResponse=="function"){const s=await o.onResponse(l);if(!(s instanceof Response))throw new Error("The options.onResponse must return a Response instance!");l=s}if(!l.ok)throw new Error(`Fetch failed with status ${l.status}`);if(!l.body)throw new Error("The response body is empty.");return l},In=class In{constructor(t){this.create=async(l,s,c)=>{var d;const u={method:"POST",body:JSON.stringify({model:this.model,...l}),headers:this.defaultHeaders};try{const f=await q0(this.baseURL,{fetch:this.customOptions.fetch,...u});if(c){await this.customResponseHandler(f,s,c);return}const p=f.headers.get("content-type")||"";switch(p.split(";")[0].trim()){case"text/event-stream":await this.sseResponseHandler(f,s);break;case"application/json":await this.jsonResponseHandler(f,s);break;default:throw new Error(`The response content-type: ${p} is not support!`)}}catch(f){const p=f instanceof Error?f:new Error("Unknown error!");throw(d=s==null?void 0:s.onError)==null||d.call(s,p),p}},this.customResponseHandler=async(l,s,c)=>{var d,f;const u=[];for await(const p of Mc({readableStream:l.body,transformStream:c}))u.push(p),(d=s==null?void 0:s.onUpdate)==null||d.call(s,p);(f=s==null?void 0:s.onSuccess)==null||f.call(s,u)},this.sseResponseHandler=async(l,s)=>{var u,d;const c=[];for await(const f of Mc({readableStream:l.body}))c.push(f),(u=s==null?void 0:s.onUpdate)==null||u.call(s,f);(d=s==null?void 0:s.onSuccess)==null||d.call(s,c)},this.jsonResponseHandler=async(l,s)=>{var u,d;const c=await l.json();(u=s==null?void 0:s.onUpdate)==null||u.call(s,c),(d=s==null?void 0:s.onSuccess)==null||d.call(s,[c])};const{baseURL:n,model:o,dangerouslyApiKey:r,...a}=t;this.baseURL=t.baseURL,this.model=t.model,this.defaultHeaders={"Content-Type":"application/json",...t.dangerouslyApiKey&&{Authorization:t.dangerouslyApiKey}},this.customOptions=a}static init(t){if(!t.baseURL||typeof t.baseURL!="string")throw new Error("The baseURL is not valid!");const n=t.fetch||t.baseURL;return In.instanceBuffer.has(n)||In.instanceBuffer.set(n,new In(t)),In.instanceBuffer.get(n)}};In.instanceBuffer=new Map;let Vc=In;const Y0=Vc.init;let Z0=0;class Q0{constructor(t){this.requestingMap={},this.request=(n,o)=>{const{request:r}=this.config,{onUpdate:a,onSuccess:l,onError:s}=o,c=Z0;Z0+=1,this.requestingMap[c]=!0,r==null||r(n,{onUpdate:u=>{this.requestingMap[c]&&a(u)},onSuccess:u=>{this.requestingMap[c]&&(l(u),this.finishRequest(c))},onError:u=>{this.requestingMap[c]&&(s(u),this.finishRequest(c))}})},this.config=t}finishRequest(t){delete this.requestingMap[t]}isRequesting(){return Object.keys(this.requestingMap).length>0}}function FR(e){const{request:t,...n}=e;return[i.computed(()=>new Q0({request:t||Y0({baseURL:n.baseURL,model:n.model,dangerouslyApiKey:n.dangerouslyApiKey}).create,...n}))]}function HR(e,t){const n=i.ref(e);function o(r){const a=typeof r=="function"?r(n.value):r;a!==n.value&&t(a,n.value),n.value=a}return[n,o]}function _R(e){return Array.isArray(e)?e:[e]}function jR(e){const{defaultMessages:t,agent:n,requestFallback:o,requestPlaceholder:r,parser:a}=e,l=i.ref(0),s=i.computed(()=>(t||[]).map((g,y)=>({id:`default_${y}`,status:"local",...g}))),[c,u]=HR(s.value,()=>{}),d=(g,y)=>{const C={id:`msg_${l.value}`,message:g,status:y};return l.value+=1,C},f=i.computed(()=>{const g=[];return c.value.forEach(y=>{const C=a?a(y.message):y.message,S=_R(C);S.forEach(($,x)=>{let w=y.id;S.length>1&&(w=`${w}_${x}`),g.push({id:w,message:$,status:y.status})})}),g}),p=g=>g.filter(y=>y.status!=="loading"&&y.status!=="error").map(y=>y.message),m=()=>p(c.value);return{onRequest:ki(g=>{if(!n)throw new Error("The agent parameter is required when using the onRequest method in an agent generated by useXAgent.");let y=null;u($=>{let x=[...$,d(g,"local")];if(r){let w;typeof r=="function"?w=r(g,{messages:p(x)}):w=r;const P=d(w,"loading");y=P.id,x=[...x,P]}return x});let C=null;const S=($,x)=>{let w=c.value.find(P=>P.id===C);return w?u(P=>P.map(b=>b.id===C?{...b,message:$,status:x}:b)):(w=d($,x),u(P=>[...P.filter(I=>I.id!==y),w]),C=w.id),w};n.request({message:g,messages:m()},{onUpdate:$=>{S($,"loading")},onSuccess:$=>{S($,"success")},onError:async $=>{if(o){let x;typeof o=="function"?x=await o(g,{error:$,messages:m()}):x=o,u(w=>[...w.filter(P=>P.id!==y&&P.id!==C),d(x,"error")])}else u(x=>x.filter(w=>w.id!==y&&w.id!==C))}})}),messages:c,parsedMessages:f,setMessages:u}}ce.Attachments=$R,ce.Bubble=b8,ce.BubbleList=N0,ce.Conversations=I8,ce.Prompts=M0,ce.Sender=oR,ce.Suggestion=F8,ce.ThoughtChain=VR,ce.Welcome=A8,ce.XAgent=Q0,ce.XFetch=q0,ce.XProvider=k6,ce.XRequest=Y0,ce.XStream=Mc,ce.defaultPrefixCls=pv,ce.theme=cr,ce.useXAgent=FR,ce.useXChat=jR,ce.useXProviderContext=Ke,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ant-design-x-vue",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Craft AI-driven interfaces effortlessly",
5
5
  "keywords": [
6
6
  "AI",