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.
- package/dist/agent-widget.js +45 -43
- package/dist/agent-widget.js.map +1 -1
- package/dist/bstp-agent-widget.css +1 -1
- package/package.json +1 -1
- package/src/lib/index.d.ts +1 -0
package/dist/agent-widget.js
CHANGED
|
@@ -15691,15 +15691,15 @@ var ub = ({ ...e }) => {
|
|
|
15691
15691
|
};
|
|
15692
15692
|
ub.Body = cb, ub.Footer = lb;
|
|
15693
15693
|
var db = {
|
|
15694
|
-
root: "
|
|
15695
|
-
inner: "
|
|
15696
|
-
content: "
|
|
15697
|
-
header: "
|
|
15698
|
-
headerMeta: "
|
|
15699
|
-
statusDot: "
|
|
15700
|
-
topSubHeader: "
|
|
15701
|
-
body: "
|
|
15702
|
-
title: "
|
|
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
|
|
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", `${
|
|
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,
|
|
23765
|
+
}, [e, j]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
|
|
23766
23766
|
opened: e,
|
|
23767
23767
|
onClose: t,
|
|
23768
|
-
size:
|
|
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:
|
|
23803
|
+
style: { background: M ? "#22c55e" : "#ef4444" }
|
|
23803
23804
|
}), /* @__PURE__ */ E(Xd, {
|
|
23804
23805
|
size: "10",
|
|
23805
23806
|
c: "dimmed",
|
|
23806
|
-
children: [
|
|
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:
|
|
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
|
-
}),
|
|
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:
|
|
29152
|
-
}),
|
|
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]),
|
|
29156
|
-
n(), await
|
|
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
|
|
29160
|
+
onClick: () => void I(),
|
|
29160
29161
|
zIndex: i,
|
|
29161
|
-
position:
|
|
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
|
-
|
|
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
|
-
|
|
29178
|
-
|
|
29179
|
-
|
|
29180
|
-
|
|
29181
|
-
|
|
29182
|
-
|
|
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
|
-
|
|
29186
|
+
M && F(), ee(), b(h);
|
|
29185
29187
|
},
|
|
29186
|
-
isListening:
|
|
29187
|
-
isVoiceSupported:
|
|
29188
|
+
isListening: M,
|
|
29189
|
+
isVoiceSupported: N,
|
|
29188
29190
|
onToggleVoice: () => {
|
|
29189
|
-
|
|
29191
|
+
M ? F() : (g(""), P());
|
|
29190
29192
|
},
|
|
29191
|
-
drawerTitle:
|
|
29192
|
-
runtimeInfo:
|
|
29193
|
-
scrollViewportRef:
|
|
29194
|
-
drawerDraggable:
|
|
29195
|
-
drawerResizableWidth:
|
|
29196
|
-
drawerResizableHeight:
|
|
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
|