@cimulate/copilot-widget 1.44.1 → 1.44.2
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/CHANGELOG.md +4 -0
- package/dist/messaging.es.js +118 -105
- package/dist/messaging.umd.js +9 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
`@cimulate/copilot-widget` follows [Semantic Versioning](https://semver.org/). Each entry is a released `package.json` version (deployed on merge to `master`), newest first.
|
|
4
4
|
|
|
5
|
+
## 1.44.2 — 2026-09-30
|
|
6
|
+
|
|
7
|
+
- Agentforce message groups now include a `chatbot` or `human-agent` class from the sender role, so a storefront can style a bot reply differently from a human agent reply.
|
|
8
|
+
|
|
5
9
|
## 1.44.1 — 2026-09-29
|
|
6
10
|
|
|
7
11
|
- Messaging mode now snaps instantly to the latest message on open, navigation, new tab, and history restore in both `autoScroll` modes. Resolves an intermittent animated crawl on widget open. Additionaly, scrolling animation will honor `prefers-reduced-motion` OS setting.
|
package/dist/messaging.es.js
CHANGED
|
@@ -5781,23 +5781,23 @@ et.getAdapter = vp.getAdapter;
|
|
|
5781
5781
|
et.HttpStatusCode = uu;
|
|
5782
5782
|
et.default = et;
|
|
5783
5783
|
const {
|
|
5784
|
-
Axios:
|
|
5785
|
-
AxiosError:
|
|
5786
|
-
CanceledError:
|
|
5787
|
-
isCancel:
|
|
5788
|
-
CancelToken:
|
|
5789
|
-
VERSION:
|
|
5790
|
-
all:
|
|
5791
|
-
Cancel:
|
|
5792
|
-
isAxiosError:
|
|
5793
|
-
spread:
|
|
5794
|
-
toFormData:
|
|
5795
|
-
AxiosHeaders:
|
|
5796
|
-
HttpStatusCode:
|
|
5797
|
-
formToJSON:
|
|
5798
|
-
getAdapter:
|
|
5799
|
-
mergeConfig:
|
|
5800
|
-
create:
|
|
5784
|
+
Axios: a4,
|
|
5785
|
+
AxiosError: u4,
|
|
5786
|
+
CanceledError: c4,
|
|
5787
|
+
isCancel: l4,
|
|
5788
|
+
CancelToken: d4,
|
|
5789
|
+
VERSION: f4,
|
|
5790
|
+
all: h4,
|
|
5791
|
+
Cancel: p4,
|
|
5792
|
+
isAxiosError: m4,
|
|
5793
|
+
spread: g4,
|
|
5794
|
+
toFormData: E4,
|
|
5795
|
+
AxiosHeaders: T4,
|
|
5796
|
+
HttpStatusCode: b4,
|
|
5797
|
+
formToJSON: y4,
|
|
5798
|
+
getAdapter: _4,
|
|
5799
|
+
mergeConfig: S4,
|
|
5800
|
+
create: A4
|
|
5801
5801
|
} = et;
|
|
5802
5802
|
class yy {
|
|
5803
5803
|
constructor(t, n, r, i = !1, s, o) {
|
|
@@ -26772,7 +26772,7 @@ di()([
|
|
|
26772
26772
|
"portalled",
|
|
26773
26773
|
"positioning"
|
|
26774
26774
|
]);
|
|
26775
|
-
const [
|
|
26775
|
+
const [N4, na] = Or({
|
|
26776
26776
|
name: "EnvironmentContext",
|
|
26777
26777
|
hookName: "useEnvironmentContext",
|
|
26778
26778
|
providerName: "<EnvironmentProvider />",
|
|
@@ -26782,7 +26782,7 @@ const [A4, na] = Or({
|
|
|
26782
26782
|
getDocument: () => document,
|
|
26783
26783
|
getWindow: () => window
|
|
26784
26784
|
}
|
|
26785
|
-
}), [
|
|
26785
|
+
}), [O4, ll] = Or({
|
|
26786
26786
|
name: "LocaleContext",
|
|
26787
26787
|
hookName: "useLocaleContext",
|
|
26788
26788
|
providerName: "<LocaleProvider />",
|
|
@@ -32979,42 +32979,54 @@ const lD = ({
|
|
|
32979
32979
|
)
|
|
32980
32980
|
}
|
|
32981
32981
|
);
|
|
32982
|
-
}
|
|
32982
|
+
};
|
|
32983
|
+
function dD(e) {
|
|
32984
|
+
switch (e == null ? void 0 : e.toLowerCase()) {
|
|
32985
|
+
case "chatbot":
|
|
32986
|
+
return "chatbot";
|
|
32987
|
+
case "agent":
|
|
32988
|
+
return "human-agent";
|
|
32989
|
+
default:
|
|
32990
|
+
return null;
|
|
32991
|
+
}
|
|
32992
|
+
}
|
|
32993
|
+
const fD = ({
|
|
32983
32994
|
message: e,
|
|
32984
32995
|
globalClassName: t,
|
|
32985
32996
|
openLinksInNewTab: n,
|
|
32986
32997
|
isWidgetStandalone: r
|
|
32987
32998
|
}) => {
|
|
32999
|
+
var a;
|
|
32988
33000
|
const { logger: i } = Le(), s = $e(() => {
|
|
32989
33001
|
if (typeof e.content != "string") return null;
|
|
32990
|
-
const
|
|
32991
|
-
if (
|
|
32992
|
-
const
|
|
32993
|
-
return
|
|
33002
|
+
const u = Zi(e.content);
|
|
33003
|
+
if (u) return u;
|
|
33004
|
+
const c = Co(e.content);
|
|
33005
|
+
return c ? { response: [c] } : null;
|
|
32994
33006
|
}, [e.content]), o = $e(() => {
|
|
32995
|
-
var
|
|
32996
|
-
const
|
|
33007
|
+
var l;
|
|
33008
|
+
const u = "Oops, I had trouble with your request.";
|
|
32997
33009
|
if (typeof e.content != "string")
|
|
32998
33010
|
return i == null || i.warn(
|
|
32999
33011
|
"Message content is not richtext format. Showing fallback text.",
|
|
33000
33012
|
e.content
|
|
33001
|
-
),
|
|
33002
|
-
const
|
|
33013
|
+
), u;
|
|
33014
|
+
const c = e.content.trim();
|
|
33003
33015
|
try {
|
|
33004
|
-
const
|
|
33005
|
-
if (typeof
|
|
33016
|
+
const d = JSON.parse(c);
|
|
33017
|
+
if (typeof d == "object" && d !== null)
|
|
33006
33018
|
return i == null || i.debug(
|
|
33007
33019
|
"Detected JSON object instead of array of responses in message content",
|
|
33008
33020
|
e.content
|
|
33009
|
-
), (
|
|
33010
|
-
} catch (
|
|
33011
|
-
if (
|
|
33021
|
+
), (l = Ec(d)) != null ? l : u;
|
|
33022
|
+
} catch (d) {
|
|
33023
|
+
if (c.startsWith("{") || c.startsWith("["))
|
|
33012
33024
|
return i == null || i.warn(
|
|
33013
33025
|
"Failed to parse JSON-like message content. Showing fallback text.",
|
|
33014
33026
|
e.content
|
|
33015
|
-
),
|
|
33027
|
+
), u;
|
|
33016
33028
|
}
|
|
33017
|
-
return e.content ||
|
|
33029
|
+
return e.content || u;
|
|
33018
33030
|
}, [i, e.content]);
|
|
33019
33031
|
switch (e.role) {
|
|
33020
33032
|
case "user":
|
|
@@ -33033,6 +33045,7 @@ const lD = ({
|
|
|
33033
33045
|
className: w(
|
|
33034
33046
|
t,
|
|
33035
33047
|
`${y}-message-group`,
|
|
33048
|
+
dD((a = e.sender) == null ? void 0 : a.role),
|
|
33036
33049
|
r ? "standalone" : "embedded"
|
|
33037
33050
|
),
|
|
33038
33051
|
children: /* @__PURE__ */ E("div", { className: `${y}-message-group-child`, children: s ? /* @__PURE__ */ E(IE, { globalClassName: t, children: /* @__PURE__ */ E(
|
|
@@ -33068,7 +33081,7 @@ const lD = ({
|
|
|
33068
33081
|
}
|
|
33069
33082
|
);
|
|
33070
33083
|
}
|
|
33071
|
-
},
|
|
33084
|
+
}, hD = ({
|
|
33072
33085
|
message: e,
|
|
33073
33086
|
onRetry: t,
|
|
33074
33087
|
globalClassName: n,
|
|
@@ -33098,7 +33111,7 @@ const lD = ({
|
|
|
33098
33111
|
)
|
|
33099
33112
|
]
|
|
33100
33113
|
}
|
|
33101
|
-
),
|
|
33114
|
+
), pD = ({ globalClassName: e, onClick: t }) => /* @__PURE__ */ E("div", { className: w(e, `${y}-jump-to-latest`), children: /* @__PURE__ */ E(
|
|
33102
33115
|
"button",
|
|
33103
33116
|
{
|
|
33104
33117
|
type: "button",
|
|
@@ -33119,10 +33132,10 @@ const lD = ({
|
|
|
33119
33132
|
}
|
|
33120
33133
|
)
|
|
33121
33134
|
}
|
|
33122
|
-
) }),
|
|
33123
|
-
const t = e == null ? void 0 : e.closest(`.${
|
|
33135
|
+
) }), mD = `${y}-message-container`, gD = 24, ED = 100, vs = (e) => {
|
|
33136
|
+
const t = e == null ? void 0 : e.closest(`.${mD}`);
|
|
33124
33137
|
return t instanceof HTMLElement ? t : null;
|
|
33125
|
-
}, Ch = (e) => e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
33138
|
+
}, Ch = (e) => e.scrollHeight - e.scrollTop - e.clientHeight <= gD, TD = () => typeof window != "undefined" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, bD = (e, t) => !(e != null && e.anchorMessageId) || !t.some((n) => n.id === e.anchorMessageId) ? null : e, yD = ({
|
|
33126
33139
|
autoScroll: e,
|
|
33127
33140
|
messages: t,
|
|
33128
33141
|
streamingBlocks: n,
|
|
@@ -33135,7 +33148,7 @@ const lD = ({
|
|
|
33135
33148
|
const a = ee(null), u = ee(null), c = ee(!0), l = ee(!1), d = ee(null), p = ee(!1), h = ee((P = (V = t[t.length - 1]) == null ? void 0 : V.id) != null ? P : null), m = ee(null), b = ee(!1), T = ee(t);
|
|
33136
33149
|
if (T.current = t, !b.current) {
|
|
33137
33150
|
b.current = !0;
|
|
33138
|
-
const k = o ?
|
|
33151
|
+
const k = o ? bD(o.current, t) : null;
|
|
33139
33152
|
k && (c.current = k.shouldStickToBottom, p.current = k.hasSentLiveMessage, k.shouldStickToBottom || (m.current = k.scrollTop));
|
|
33140
33153
|
}
|
|
33141
33154
|
const g = ee(e);
|
|
@@ -33148,7 +33161,7 @@ const lD = ({
|
|
|
33148
33161
|
var q;
|
|
33149
33162
|
const U = (q = u.current) != null ? q : vs(a.current);
|
|
33150
33163
|
if (!U) return;
|
|
33151
|
-
const j = k === "smooth" &&
|
|
33164
|
+
const j = k === "smooth" && TD() ? "auto" : k;
|
|
33152
33165
|
c.current = !0, j === "smooth" && (l.current = !0), U.scrollTo({ top: U.scrollHeight, behavior: j });
|
|
33153
33166
|
}, []), M = he(() => {
|
|
33154
33167
|
const k = u.current;
|
|
@@ -33195,7 +33208,7 @@ const lD = ({
|
|
|
33195
33208
|
$();
|
|
33196
33209
|
return;
|
|
33197
33210
|
}
|
|
33198
|
-
U(), d.current = setTimeout(j,
|
|
33211
|
+
U(), d.current = setTimeout(j, ED);
|
|
33199
33212
|
}, te = () => {
|
|
33200
33213
|
U(), l.current = !1;
|
|
33201
33214
|
};
|
|
@@ -33248,7 +33261,7 @@ const lD = ({
|
|
|
33248
33261
|
O,
|
|
33249
33262
|
$
|
|
33250
33263
|
]), { endRef: a, showJumpToLatest: R, scrollToLatest: O };
|
|
33251
|
-
},
|
|
33264
|
+
}, _D = 4e3, Ph = (e) => (typeof e == "string" ? e : "").replace(/<[^>]*>/g, " ").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/[`*_~#>|]+/g, " ").replace(/\s+/g, " ").trim().slice(0, _D), xi = "Assistant response available", SD = (e) => {
|
|
33252
33265
|
if (typeof e != "object" || e === null) return "";
|
|
33253
33266
|
const t = e;
|
|
33254
33267
|
if (t.type !== "product_carousel" || typeof t.data != "object" || t.data === null)
|
|
@@ -33264,12 +33277,12 @@ const lD = ({
|
|
|
33264
33277
|
if (r.length === 0) return i;
|
|
33265
33278
|
const s = n.length === 1 ? "Product title" : "Product titles", o = `${i} ${s}: ${r.join("; ")}`;
|
|
33266
33279
|
return /[.!?]$/.test(o) ? o : `${o}.`;
|
|
33267
|
-
},
|
|
33280
|
+
}, AD = (e) => {
|
|
33268
33281
|
var s, o;
|
|
33269
33282
|
if (typeof e != "string") return xi;
|
|
33270
33283
|
const t = Zi(e), n = t ? null : Co(e), r = (s = t == null ? void 0 : t.response) != null ? s : n ? [n] : null;
|
|
33271
33284
|
if (r)
|
|
33272
|
-
return r.map((u) => u.type === "markdown" ? Ph(u.data.content) :
|
|
33285
|
+
return r.map((u) => u.type === "markdown" ? Ph(u.data.content) : SD(u)).filter(Boolean).join(" ").trim() || xi;
|
|
33273
33286
|
const i = e.trim();
|
|
33274
33287
|
try {
|
|
33275
33288
|
const a = JSON.parse(i);
|
|
@@ -33279,7 +33292,7 @@ const lD = ({
|
|
|
33279
33292
|
if (i.startsWith("{") || i.startsWith("[")) return xi;
|
|
33280
33293
|
}
|
|
33281
33294
|
return Ph(e) || xi;
|
|
33282
|
-
},
|
|
33295
|
+
}, ND = ({
|
|
33283
33296
|
message: e,
|
|
33284
33297
|
announcementKey: t
|
|
33285
33298
|
}) => {
|
|
@@ -33291,16 +33304,16 @@ const lD = ({
|
|
|
33291
33304
|
clearTimeout(i), clearTimeout(s);
|
|
33292
33305
|
};
|
|
33293
33306
|
}, [e, t]), /* @__PURE__ */ E("span", { className: `${y}-visually-hidden`, role: "status", "aria-atomic": "true", children: n });
|
|
33294
|
-
},
|
|
33307
|
+
}, OD = () => {
|
|
33295
33308
|
const { messages: e } = it(), t = [...e].reverse().find((n) => n.role === "agent" && !n.restored);
|
|
33296
33309
|
return /* @__PURE__ */ E(
|
|
33297
|
-
|
|
33310
|
+
ND,
|
|
33298
33311
|
{
|
|
33299
|
-
message: t ?
|
|
33312
|
+
message: t ? AD(t.content) : "",
|
|
33300
33313
|
announcementKey: t == null ? void 0 : t.id
|
|
33301
33314
|
}
|
|
33302
33315
|
);
|
|
33303
|
-
},
|
|
33316
|
+
}, ID = "You are offline or we couldn't reach the assistant. Check connection and try again.", Pl = ({
|
|
33304
33317
|
isWidgetStandalone: e,
|
|
33305
33318
|
isOpen: t,
|
|
33306
33319
|
scrollSnapshotRef: n
|
|
@@ -33317,7 +33330,7 @@ const lD = ({
|
|
|
33317
33330
|
sendError: m,
|
|
33318
33331
|
retryLastMessage: b,
|
|
33319
33332
|
retryConnection: T
|
|
33320
|
-
} = it(), { endRef: g, showJumpToLatest: _, scrollToLatest: S } =
|
|
33333
|
+
} = it(), { endRef: g, showJumpToLatest: _, scrollToLatest: S } = yD({
|
|
33321
33334
|
autoScroll: o,
|
|
33322
33335
|
messages: a,
|
|
33323
33336
|
streamingBlocks: u,
|
|
@@ -33328,7 +33341,7 @@ const lD = ({
|
|
|
33328
33341
|
}), R = a.length > 0, L = u.some(Iy), O = a[a.length - 1], M = O ? Bp(O.content, "suggestions") : !1, $ = R && (l || c) && !L && !M, V = p === "reconnecting" && !$, P = p === "error";
|
|
33329
33342
|
let H = null;
|
|
33330
33343
|
P ? H = {
|
|
33331
|
-
message: h != null ? h :
|
|
33344
|
+
message: h != null ? h : ID,
|
|
33332
33345
|
kind: "connection",
|
|
33333
33346
|
onRetry: T
|
|
33334
33347
|
} : m && (H = { message: m.message, kind: "send", onRetry: b });
|
|
@@ -33339,7 +33352,7 @@ const lD = ({
|
|
|
33339
33352
|
kind: U
|
|
33340
33353
|
}));
|
|
33341
33354
|
}, [k, U, s]), /* @__PURE__ */ X(Vn, { children: [
|
|
33342
|
-
/* @__PURE__ */ E(
|
|
33355
|
+
/* @__PURE__ */ E(OD, {}),
|
|
33343
33356
|
l && !R && /* @__PURE__ */ E(
|
|
33344
33357
|
ak,
|
|
33345
33358
|
{
|
|
@@ -33348,7 +33361,7 @@ const lD = ({
|
|
|
33348
33361
|
}
|
|
33349
33362
|
),
|
|
33350
33363
|
a.map((te) => /* @__PURE__ */ E(
|
|
33351
|
-
|
|
33364
|
+
fD,
|
|
33352
33365
|
{
|
|
33353
33366
|
message: te,
|
|
33354
33367
|
globalClassName: r,
|
|
@@ -33358,7 +33371,7 @@ const lD = ({
|
|
|
33358
33371
|
te.id
|
|
33359
33372
|
)),
|
|
33360
33373
|
H && /* @__PURE__ */ E(
|
|
33361
|
-
|
|
33374
|
+
hD,
|
|
33362
33375
|
{
|
|
33363
33376
|
message: H.message,
|
|
33364
33377
|
onRetry: H.onRetry,
|
|
@@ -33410,10 +33423,10 @@ const lD = ({
|
|
|
33410
33423
|
loadingText: "Reconnecting..."
|
|
33411
33424
|
}
|
|
33412
33425
|
),
|
|
33413
|
-
_ && /* @__PURE__ */ E(
|
|
33426
|
+
_ && /* @__PURE__ */ E(pD, { globalClassName: r, onClick: () => S() }),
|
|
33414
33427
|
/* @__PURE__ */ E("div", { ref: g, "aria-hidden": "true" })
|
|
33415
33428
|
] });
|
|
33416
|
-
},
|
|
33429
|
+
}, wD = () => /* @__PURE__ */ X(
|
|
33417
33430
|
"svg",
|
|
33418
33431
|
{
|
|
33419
33432
|
"aria-hidden": "true",
|
|
@@ -33435,7 +33448,7 @@ const lD = ({
|
|
|
33435
33448
|
)
|
|
33436
33449
|
]
|
|
33437
33450
|
}
|
|
33438
|
-
),
|
|
33451
|
+
), xD = () => /* @__PURE__ */ E(
|
|
33439
33452
|
"svg",
|
|
33440
33453
|
{
|
|
33441
33454
|
"aria-hidden": "true",
|
|
@@ -33453,14 +33466,14 @@ const lD = ({
|
|
|
33453
33466
|
}
|
|
33454
33467
|
)
|
|
33455
33468
|
}
|
|
33456
|
-
),
|
|
33469
|
+
), CD = (e, t) => e === 0 ? [] : e < 0 ? t : t.slice(-e), vl = ({
|
|
33457
33470
|
progressStepsLimit: e,
|
|
33458
33471
|
steps: t,
|
|
33459
33472
|
globalClassName: n
|
|
33460
33473
|
}) => {
|
|
33461
33474
|
const { progressStepsLimit: r } = Le(), i = e != null ? e : r, { overrides: s, isInitialized: o } = Xn(), a = wr();
|
|
33462
33475
|
if (t.length === 0 || i === 0) return null;
|
|
33463
|
-
const u =
|
|
33476
|
+
const u = CD(i, t), c = o ? s.ProgressSteps : void 0;
|
|
33464
33477
|
return c ? /* @__PURE__ */ E(Kn, { tagName: c, props: {
|
|
33465
33478
|
name: "ProgressSteps",
|
|
33466
33479
|
payload: { steps: u },
|
|
@@ -33482,7 +33495,7 @@ const lD = ({
|
|
|
33482
33495
|
`${y}-progress-step-icon`,
|
|
33483
33496
|
p ? "done" : "active"
|
|
33484
33497
|
),
|
|
33485
|
-
children: p ? /* @__PURE__ */ E(
|
|
33498
|
+
children: p ? /* @__PURE__ */ E(wD, {}) : /* @__PURE__ */ E(xD, {})
|
|
33486
33499
|
}
|
|
33487
33500
|
)
|
|
33488
33501
|
]
|
|
@@ -33490,7 +33503,7 @@ const lD = ({
|
|
|
33490
33503
|
`${d}-${l}`
|
|
33491
33504
|
);
|
|
33492
33505
|
}) }) }) });
|
|
33493
|
-
},
|
|
33506
|
+
}, PD = () => {
|
|
33494
33507
|
const { globalClassName: e, themeVariables: t, messageAlignment: n, enableDownloadTranscript: r } = Le(), { isAgentTyping: i, resetConversation: s, endConversation: o, progressSteps: a, downloadTranscript: u } = it(), c = sa(), l = Ol(), d = i, p = (h) => h.file ? l(h) : c(h.text);
|
|
33495
33508
|
return /* @__PURE__ */ X(
|
|
33496
33509
|
"div",
|
|
@@ -33544,7 +33557,7 @@ const lD = ({
|
|
|
33544
33557
|
}, wE = (e) => {
|
|
33545
33558
|
var u;
|
|
33546
33559
|
const { children: t, disabled: n } = e, [r, i] = Se((u = e.container) == null ? void 0 : u.current), s = UE(
|
|
33547
|
-
|
|
33560
|
+
RD,
|
|
33548
33561
|
() => !1,
|
|
33549
33562
|
() => !0
|
|
33550
33563
|
), { getRootNode: o } = na();
|
|
@@ -33554,13 +33567,13 @@ const lD = ({
|
|
|
33554
33567
|
return (c = e.container) == null ? void 0 : c.current;
|
|
33555
33568
|
});
|
|
33556
33569
|
}, [e.container]), s || n) return /* @__PURE__ */ E(Vn, { children: t });
|
|
33557
|
-
const a = r != null ? r :
|
|
33570
|
+
const a = r != null ? r : vD(o);
|
|
33558
33571
|
return /* @__PURE__ */ E(Vn, { children: Dh.map(t, (c) => Wu(c, a)) });
|
|
33559
|
-
},
|
|
33572
|
+
}, vD = (e) => {
|
|
33560
33573
|
const t = e == null ? void 0 : e(), n = t.getRootNode();
|
|
33561
33574
|
return yr(n) ? n : bn(t).body;
|
|
33562
|
-
},
|
|
33563
|
-
},
|
|
33575
|
+
}, RD = () => () => {
|
|
33576
|
+
}, kD = ({ scrollSnapshotRef: e }) => {
|
|
33564
33577
|
const { globalClassName: t, themeVariables: n, messageAlignment: r } = Le(), { mode: i, status: s, dialogPosition: o, isDialogFullHeight: a, dialogWidth: u } = En(), {
|
|
33565
33578
|
loading: c,
|
|
33566
33579
|
isAgentTyping: l,
|
|
@@ -33643,7 +33656,7 @@ const lD = ({
|
|
|
33643
33656
|
) })
|
|
33644
33657
|
}
|
|
33645
33658
|
) : null;
|
|
33646
|
-
},
|
|
33659
|
+
}, LD = ({ scrollSnapshotRef: e }) => {
|
|
33647
33660
|
const { globalClassName: t, themeVariables: n, messageAlignment: r } = Le(), { mode: i, status: s, isModalFullscreen: o } = En(), {
|
|
33648
33661
|
loading: a,
|
|
33649
33662
|
isAgentTyping: u,
|
|
@@ -33747,12 +33760,12 @@ const lD = ({
|
|
|
33747
33760
|
) })
|
|
33748
33761
|
}
|
|
33749
33762
|
) : null;
|
|
33750
|
-
},
|
|
33763
|
+
}, DD = () => {
|
|
33751
33764
|
const e = En(), t = ee(null), {
|
|
33752
33765
|
status: { type: n, isMinimized: r }
|
|
33753
33766
|
} = e || { status: {} };
|
|
33754
|
-
return r ? /* @__PURE__ */ E(bS, {}) : n === "dialog" ? /* @__PURE__ */ E(
|
|
33755
|
-
},
|
|
33767
|
+
return r ? /* @__PURE__ */ E(bS, {}) : n === "dialog" ? /* @__PURE__ */ E(kD, { scrollSnapshotRef: t }) : n === "modal" ? /* @__PURE__ */ E(LD, { scrollSnapshotRef: t }) : /* @__PURE__ */ E(PD, {});
|
|
33768
|
+
}, MD = () => {
|
|
33756
33769
|
const { setIsOpen: e, setIsInline: t, setElementId: n, setEntryType: r, setParams: i } = XR();
|
|
33757
33770
|
Oe(() => {
|
|
33758
33771
|
const s = (o) => {
|
|
@@ -33766,7 +33779,7 @@ const lD = ({
|
|
|
33766
33779
|
}, vh = (e, t, n) => {
|
|
33767
33780
|
n !== void 0 ? e(t, n) : e(t);
|
|
33768
33781
|
};
|
|
33769
|
-
function
|
|
33782
|
+
function BD({
|
|
33770
33783
|
isReady: e,
|
|
33771
33784
|
hasError: t,
|
|
33772
33785
|
transmit: n
|
|
@@ -33790,7 +33803,7 @@ function MD({
|
|
|
33790
33803
|
const xE = {
|
|
33791
33804
|
copilot: "Ask Copilot",
|
|
33792
33805
|
messaging: "Ask a question"
|
|
33793
|
-
},
|
|
33806
|
+
}, FD = ({
|
|
33794
33807
|
onSubmit: e,
|
|
33795
33808
|
disabled: t = !1
|
|
33796
33809
|
}) => {
|
|
@@ -33832,7 +33845,7 @@ const xE = {
|
|
|
33832
33845
|
]
|
|
33833
33846
|
}
|
|
33834
33847
|
);
|
|
33835
|
-
},
|
|
33848
|
+
}, UD = () => {
|
|
33836
33849
|
const { globalClassName: e, mode: t } = Le(), { placeholder: n } = ra(), r = n || xE[t];
|
|
33837
33850
|
return /* @__PURE__ */ X("div", { className: w(e, `${y}-prompts-header`), children: [
|
|
33838
33851
|
/* @__PURE__ */ E(
|
|
@@ -33866,17 +33879,17 @@ const xE = {
|
|
|
33866
33879
|
]
|
|
33867
33880
|
}
|
|
33868
33881
|
);
|
|
33869
|
-
},
|
|
33882
|
+
}, HD = "Ask me something else", $D = ({
|
|
33870
33883
|
label: e,
|
|
33871
33884
|
disabled: t = !1
|
|
33872
33885
|
}) => /* @__PURE__ */ E(
|
|
33873
33886
|
CE,
|
|
33874
33887
|
{
|
|
33875
|
-
label: e ||
|
|
33888
|
+
label: e || HD,
|
|
33876
33889
|
disabled: t,
|
|
33877
33890
|
onClick: () => wn(!0)
|
|
33878
33891
|
}
|
|
33879
|
-
),
|
|
33892
|
+
), zD = ({
|
|
33880
33893
|
onPromptClick: e,
|
|
33881
33894
|
disabled: t = !1
|
|
33882
33895
|
}) => {
|
|
@@ -33896,10 +33909,10 @@ const xE = {
|
|
|
33896
33909
|
},
|
|
33897
33910
|
a
|
|
33898
33911
|
)),
|
|
33899
|
-
!s && /* @__PURE__ */ E(
|
|
33912
|
+
!s && /* @__PURE__ */ E($D, { label: i, disabled: t })
|
|
33900
33913
|
] });
|
|
33901
|
-
},
|
|
33902
|
-
const { globalClassName: e, themeVariables: t, enablePageContext: n } = Le(), { isOpen: r, elementId: i, promptsDisplay: s } = ra(), { isConnected: o, sessionExpired: a, sendMessage: u, connectionStatus: c } = it(), { productId: l } = Al(), d = s !== "buttons", p = s !== "input", [h, m] = Se(null), b = c === "error", T = c === "connecting", g = zp(o, a), _ =
|
|
33914
|
+
}, VD = () => {
|
|
33915
|
+
const { globalClassName: e, themeVariables: t, enablePageContext: n } = Le(), { isOpen: r, elementId: i, promptsDisplay: s } = ra(), { isConnected: o, sessionExpired: a, sendMessage: u, connectionStatus: c } = it(), { productId: l } = Al(), d = s !== "buttons", p = s !== "input", [h, m] = Se(null), b = c === "error", T = c === "connecting", g = zp(o, a), _ = BD({
|
|
33903
33916
|
isReady: g,
|
|
33904
33917
|
hasError: b,
|
|
33905
33918
|
transmit: u
|
|
@@ -33931,9 +33944,9 @@ const xE = {
|
|
|
33931
33944
|
className: w(e, `${y}-prompts-extension-container`),
|
|
33932
33945
|
style: t,
|
|
33933
33946
|
children: [
|
|
33934
|
-
d && /* @__PURE__ */ E(
|
|
33935
|
-
!d && /* @__PURE__ */ E(
|
|
33936
|
-
p && /* @__PURE__ */ E(
|
|
33947
|
+
d && /* @__PURE__ */ E(FD, { onSubmit: S, disabled: b }),
|
|
33948
|
+
!d && /* @__PURE__ */ E(UD, {}),
|
|
33949
|
+
p && /* @__PURE__ */ E(zD, { onPromptClick: S, disabled: b }),
|
|
33937
33950
|
!b && T && /* @__PURE__ */ E("p", { className: w(e, `${y}-prompts-connecting-message`), children: "Connecting to agent..." }),
|
|
33938
33951
|
b && /* @__PURE__ */ E("p", { className: w(e, `${y}-prompts-error-message`), children: "Oops, an error occurred with our agent." })
|
|
33939
33952
|
]
|
|
@@ -33941,16 +33954,16 @@ const xE = {
|
|
|
33941
33954
|
),
|
|
33942
33955
|
h
|
|
33943
33956
|
);
|
|
33944
|
-
},
|
|
33945
|
-
/* @__PURE__ */ E(
|
|
33946
|
-
/* @__PURE__ */ E(
|
|
33957
|
+
}, qD = () => (MD(), /* @__PURE__ */ E(VD, {})), YD = (e) => /* @__PURE__ */ X(iS, Y(x({}, e), { children: [
|
|
33958
|
+
/* @__PURE__ */ E(DD, {}),
|
|
33959
|
+
/* @__PURE__ */ E(qD, {})
|
|
33947
33960
|
] }));
|
|
33948
|
-
function
|
|
33961
|
+
function GD(e, t) {
|
|
33949
33962
|
return le(this, null, function* () {
|
|
33950
33963
|
return qp().sendMessage(e, t);
|
|
33951
33964
|
});
|
|
33952
33965
|
}
|
|
33953
|
-
const
|
|
33966
|
+
const I4 = {
|
|
33954
33967
|
components: {
|
|
33955
33968
|
setEntryType: sc,
|
|
33956
33969
|
toggleWidgetOpen: wn,
|
|
@@ -33964,7 +33977,7 @@ const O4 = {
|
|
|
33964
33977
|
session: {
|
|
33965
33978
|
resetConversation: jR,
|
|
33966
33979
|
endConversation: WR,
|
|
33967
|
-
sendMessage:
|
|
33980
|
+
sendMessage: GD
|
|
33968
33981
|
},
|
|
33969
33982
|
pageContext: {
|
|
33970
33983
|
set: w_,
|
|
@@ -33977,7 +33990,7 @@ const O4 = {
|
|
|
33977
33990
|
const i = HE(e);
|
|
33978
33991
|
Rh.set(e, i), i.render(
|
|
33979
33992
|
/* @__PURE__ */ E(
|
|
33980
|
-
|
|
33993
|
+
YD,
|
|
33981
33994
|
Y(x({}, t), {
|
|
33982
33995
|
overridesUrl: n,
|
|
33983
33996
|
inlineOverrides: r,
|
|
@@ -33985,7 +33998,7 @@ const O4 = {
|
|
|
33985
33998
|
})
|
|
33986
33999
|
)
|
|
33987
34000
|
);
|
|
33988
|
-
},
|
|
34001
|
+
}, jD = (s) => {
|
|
33989
34002
|
var o = s, {
|
|
33990
34003
|
elementId: e,
|
|
33991
34004
|
timeout: t = 5e3,
|
|
@@ -34014,7 +34027,7 @@ const O4 = {
|
|
|
34014
34027
|
`Element with id: ${e} not found within ${t} milliseconds, stopping observation`
|
|
34015
34028
|
);
|
|
34016
34029
|
}, t), c;
|
|
34017
|
-
},
|
|
34030
|
+
}, w4 = (s) => {
|
|
34018
34031
|
var o = s, {
|
|
34019
34032
|
timeout: e,
|
|
34020
34033
|
elementId: t,
|
|
@@ -34040,17 +34053,17 @@ const O4 = {
|
|
|
34040
34053
|
}
|
|
34041
34054
|
const a = document.getElementById(t);
|
|
34042
34055
|
if (!a) {
|
|
34043
|
-
We(!0, "warn", "Container element not found for id:", t), We(!0, "warn", "Beginning observation for element"),
|
|
34056
|
+
We(!0, "warn", "Container element not found for id:", t), We(!0, "warn", "Beginning observation for element"), jD(x({ elementId: t, timeout: e, overridesUrl: n, inlineOverrides: r }, i));
|
|
34044
34057
|
return;
|
|
34045
34058
|
}
|
|
34046
34059
|
PE(a, i, n, r);
|
|
34047
34060
|
};
|
|
34048
|
-
function
|
|
34061
|
+
function x4() {
|
|
34049
34062
|
return le(this, null, function* () {
|
|
34050
34063
|
return qp().getAuthLinkKey();
|
|
34051
34064
|
});
|
|
34052
34065
|
}
|
|
34053
|
-
class
|
|
34066
|
+
class C4 extends HTMLElement {
|
|
34054
34067
|
constructor() {
|
|
34055
34068
|
super(...arguments);
|
|
34056
34069
|
_e(this, "_props", null);
|
|
@@ -34080,20 +34093,20 @@ class x4 extends HTMLElement {
|
|
|
34080
34093
|
}
|
|
34081
34094
|
}
|
|
34082
34095
|
export {
|
|
34083
|
-
|
|
34096
|
+
YD as AgentForceWidget,
|
|
34084
34097
|
iS as AgentforceWidgetProvider,
|
|
34085
34098
|
G1 as CIMULATE_WIDGET_READY_EVENT,
|
|
34086
|
-
|
|
34087
|
-
|
|
34088
|
-
|
|
34099
|
+
kD as MessagingDialog,
|
|
34100
|
+
PD as MessagingEmbed,
|
|
34101
|
+
LD as MessagingModal,
|
|
34089
34102
|
B_ as MessagingProvider,
|
|
34090
|
-
|
|
34103
|
+
C4 as OverrideElement,
|
|
34091
34104
|
x_ as clearPageContext,
|
|
34092
|
-
|
|
34093
|
-
|
|
34105
|
+
I4 as eventHandlers,
|
|
34106
|
+
x4 as getAuthLinkKey,
|
|
34094
34107
|
Yp as getPageContext,
|
|
34095
|
-
|
|
34096
|
-
|
|
34108
|
+
w4 as injectMessagingWidget,
|
|
34109
|
+
GD as sendMessage,
|
|
34097
34110
|
w_ as setPageContext,
|
|
34098
34111
|
it as useMessaging
|
|
34099
34112
|
};
|