bstp-agent-widget 0.2.48 → 0.2.49

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.
@@ -15691,15 +15691,15 @@ var ub = ({ ...e }) => {
15691
15691
  };
15692
15692
  ub.Body = cb, ub.Footer = lb;
15693
15693
  var db = {
15694
- root: "_root_1i7u8_1",
15695
- inner: "_inner_1i7u8_6",
15696
- content: "_content_1i7u8_12",
15697
- header: "_header_1i7u8_20",
15698
- headerMeta: "_headerMeta_1i7u8_32",
15699
- statusDot: "_statusDot_1i7u8_39",
15700
- topSubHeader: "_topSubHeader_1i7u8_46",
15701
- body: "_body_1i7u8_57",
15702
- title: "_title_1i7u8_62"
15694
+ root: "_root_emg6a_1",
15695
+ inner: "_inner_emg6a_6",
15696
+ content: "_content_emg6a_12",
15697
+ header: "_header_emg6a_20",
15698
+ headerMeta: "_headerMeta_emg6a_32",
15699
+ statusDot: "_statusDot_emg6a_39",
15700
+ topSubHeader: "_topSubHeader_emg6a_46",
15701
+ body: "_body_emg6a_57",
15702
+ title: "_title_emg6a_62"
15703
15703
  };
15704
15704
  //#endregion
15705
15705
  //#region node_modules/marked/lib/marked.esm.js
@@ -23750,8 +23750,8 @@ function YO({ ...e }) {
23750
23750
  }
23751
23751
  //#endregion
23752
23752
  //#region src/components/AgentChat/AgentChatDrawer.tsx
23753
- function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1 }) {
23754
- let A = Math.max(280, S + b.offset), j = _.hasCustomerToken && _.hasGenaiToken;
23753
+ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1, drawerHeaderHeight: A = 56 }) {
23754
+ let j = Math.max(280, S + b.offset), M = _.hasCustomerToken && _.hasGenaiToken;
23755
23755
  return f(() => {
23756
23756
  if (typeof document > "u") return;
23757
23757
  let t = document.documentElement;
@@ -23759,13 +23759,13 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23759
23759
  t.style.setProperty("--agent-widget-drawer-width", "0px");
23760
23760
  return;
23761
23761
  }
23762
- return t.style.setProperty("--agent-widget-drawer-width", `${A}px`), () => {
23762
+ return t.style.setProperty("--agent-widget-drawer-width", `${j}px`), () => {
23763
23763
  t.style.setProperty("--agent-widget-drawer-width", "0px");
23764
23764
  };
23765
- }, [e, A]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23765
+ }, [e, j]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23766
23766
  opened: e,
23767
23767
  onClose: t,
23768
- size: A,
23768
+ size: j,
23769
23769
  zIndex: n,
23770
23770
  withinPortal: r,
23771
23771
  overlayProps: i ? {
@@ -23790,7 +23790,8 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23790
23790
  marginRight: D,
23791
23791
  height: `calc(100dvh - ${C}px)`,
23792
23792
  borderRadius: O,
23793
- boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none"
23793
+ boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none",
23794
+ "--agent-widget-drawer-header-height": `${A}px`
23794
23795
  } },
23795
23796
  title: /* @__PURE__ */ E(Y, { children: [/* @__PURE__ */ T(Xd, {
23796
23797
  className: db.title,
@@ -23799,11 +23800,11 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23799
23800
  className: db.headerMeta,
23800
23801
  children: [/* @__PURE__ */ T(Y, {
23801
23802
  className: db.statusDot,
23802
- style: { background: j ? "#22c55e" : "#ef4444" }
23803
+ style: { background: M ? "#22c55e" : "#ef4444" }
23803
23804
  }), /* @__PURE__ */ E(Xd, {
23804
23805
  size: "10",
23805
23806
  c: "dimmed",
23806
- children: [j ? "Online" : "Offline", " · Billing Intelligence"]
23807
+ children: [M ? "Online" : "Offline", " · Billing Intelligence"]
23807
23808
  })]
23808
23809
  })] }),
23809
23810
  children: [
@@ -29138,33 +29139,33 @@ var XF = 1e4, ZF = {
29138
29139
  };
29139
29140
  function QF({ ui: e }) {
29140
29141
  YF();
29141
- let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = e?.drawerRightOffset ?? 0, u = e?.drawerBorderRadius ?? 0, d = e?.drawerShadow ?? !1, f = {
29142
+ let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = e?.drawerRightOffset ?? 0, u = e?.drawerBorderRadius ?? 0, d = e?.drawerShadow ?? !1, f = e?.drawerHeaderHeight ?? 56, p = {
29142
29143
  bottom: e?.fabBottomOffset ?? ZF.bottom,
29143
29144
  right: e?.fabRightOffset ?? ZF.right
29144
- }, { messages: p, composerText: m, setComposerText: h, isLoading: g, error: v, sendMessage: y, sendInitialMessage: b, canSend: x } = zF(), { runtimeInfo: S, refreshRuntimeInfo: C } = BF(), D = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), O = VF({ axis: "y" }), k = VF({
29145
+ }, { messages: m, composerText: h, setComposerText: g, isLoading: v, error: y, sendMessage: b, sendInitialMessage: x, canSend: S } = zF(), { runtimeInfo: C, refreshRuntimeInfo: D } = BF(), O = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), k = VF({ axis: "y" }), A = VF({
29145
29146
  axis: "x",
29146
29147
  direction: -1
29147
- }), A = UF([p.length, g]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = WF({
29148
+ }), j = UF([m.length, v]), { isListening: M, isSupported: N, startListening: P, stopListening: F, reset: ee } = WF({
29148
29149
  lang: GF(),
29149
29150
  continuous: !0,
29150
29151
  pauseOnSubmit: !0,
29151
- onTextChange: h
29152
- }), ee = _(() => /* @__PURE__ */ T(Xd, {
29152
+ onTextChange: g
29153
+ }), te = _(() => /* @__PURE__ */ T(Xd, {
29153
29154
  fw: 800,
29154
29155
  children: e?.drawerTitle ?? e?.fabButtonLabel ?? "Agent Chat"
29155
- }), [e?.drawerTitle, e?.fabButtonLabel]), te = async () => {
29156
- n(), await C(), await b();
29156
+ }), [e?.drawerTitle, e?.fabButtonLabel]), I = async () => {
29157
+ n(), await D(), await x();
29157
29158
  };
29158
29159
  return /* @__PURE__ */ E(w, { children: [!t && /* @__PURE__ */ T(nk, {
29159
- onClick: () => void te(),
29160
+ onClick: () => void I(),
29160
29161
  zIndex: i,
29161
- position: f,
29162
+ position: p,
29162
29163
  color: e?.accentColor,
29163
29164
  label: e?.fabButtonLabel
29164
29165
  }), /* @__PURE__ */ T(XO, {
29165
29166
  opened: t,
29166
29167
  onClose: () => {
29167
- j && P(), r();
29168
+ M && F(), r();
29168
29169
  },
29169
29170
  zIndex: i,
29170
29171
  withinPortal: a,
@@ -29174,26 +29175,27 @@ function QF({ ui: e }) {
29174
29175
  drawerRightOffset: l,
29175
29176
  drawerBorderRadius: u,
29176
29177
  drawerShadow: d,
29177
- messages: p,
29178
- composerText: m,
29179
- onComposerTextChange: h,
29180
- isLoading: g,
29181
- error: v,
29182
- canSend: x,
29178
+ drawerHeaderHeight: f,
29179
+ messages: m,
29180
+ composerText: h,
29181
+ onComposerTextChange: g,
29182
+ isLoading: v,
29183
+ error: y,
29184
+ canSend: S,
29183
29185
  onSubmit: () => {
29184
- j && P(), F(), y(m);
29186
+ M && F(), ee(), b(h);
29185
29187
  },
29186
- isListening: j,
29187
- isVoiceSupported: M,
29188
+ isListening: M,
29189
+ isVoiceSupported: N,
29188
29190
  onToggleVoice: () => {
29189
- j ? P() : (h(""), N());
29191
+ M ? F() : (g(""), P());
29190
29192
  },
29191
- drawerTitle: ee,
29192
- runtimeInfo: S,
29193
- scrollViewportRef: A,
29194
- drawerDraggable: D,
29195
- drawerResizableWidth: k,
29196
- drawerResizableHeight: O
29193
+ drawerTitle: te,
29194
+ runtimeInfo: C,
29195
+ scrollViewportRef: j,
29196
+ drawerDraggable: O,
29197
+ drawerResizableWidth: A,
29198
+ drawerResizableHeight: k
29197
29199
  })] });
29198
29200
  }
29199
29201
  //#endregion