@access-ci/ui 0.20.4 → 0.20.5
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/{access-ci-ui-react-BtB9wMf5.js → access-ci-ui-react-ibZp2x_y.js} +3 -3
- package/dist/access-ci-ui-react.js +1 -1
- package/dist/access-ci-ui-react.umd.cjs +2 -2
- package/dist/access-ci-ui.bundle.js +37 -37
- package/dist/access-ci-ui.js +1 -1
- package/dist/access-ci-ui.umd.cjs +41 -41
- package/dist/{access-qa-bot-B5bdzcpP.js → access-qa-bot-BJE68LFO.js} +321 -319
- package/dist/{access-qa-bot-DD6xn0ii.js → access-qa-bot-BwnK_3hy.js} +4 -2
- package/dist/{icon-BzhlFlqK.js → icon-C4K-9kaa.js} +1 -1
- package/dist/{index-BJubWi7g.js → index-9LtJtDDs.js} +3 -3
- package/dist/{resource-group-detail-DwFSj2fT.js → resource-group-detail-kcWWbn7a.js} +1 -1
- package/dist/{resource-group-detail-uIzXwshu.js → resource-group-detail-wTD-XlN-.js} +2 -2
- package/dist/{resource-home-D2JoGg_B.js → resource-home-JK_ikpij.js} +1 -1
- package/dist/{resource-home-dFN7d7Zu.js → resource-home-TM8grPTp.js} +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as oa, g as Il, a as x, j as M, T as V, b as Tl } from "./index-
|
|
1
|
+
import { r as oa, g as Il, a as x, j as M, T as V, b as Tl } from "./index-9LtJtDDs.js";
|
|
2
2
|
var bn = {}, Mn = {};
|
|
3
3
|
var Vs;
|
|
4
4
|
function Ql() {
|
|
@@ -141,7 +141,7 @@ function Ql() {
|
|
|
141
141
|
}
|
|
142
142
|
return u;
|
|
143
143
|
}
|
|
144
|
-
var D = /([A-Z])/g, y = /^ms-/,
|
|
144
|
+
var D = /([A-Z])/g, y = /^ms-/, k = Array.isArray;
|
|
145
145
|
function I(u, g) {
|
|
146
146
|
return { insertionMode: u, selectedValue: g };
|
|
147
147
|
}
|
|
@@ -320,7 +320,7 @@ function Ql() {
|
|
|
320
320
|
Q(u, P, R, Xe);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
if (q != null) if (b = pe !== null ? "" + pe : U(ne),
|
|
323
|
+
if (q != null) if (b = pe !== null ? "" + pe : U(ne), k(q)) {
|
|
324
324
|
for (P = 0; P < q.length; P++)
|
|
325
325
|
if ("" + q[P] === b) {
|
|
326
326
|
u.push(' selected=""');
|
|
@@ -353,7 +353,7 @@ function Ql() {
|
|
|
353
353
|
}
|
|
354
354
|
if (R === null && q !== null && (R = q), u.push(">"), ke != null) {
|
|
355
355
|
if (R != null) throw Error(t(92));
|
|
356
|
-
if (
|
|
356
|
+
if (k(ke) && 1 < ke.length) throw Error(t(93));
|
|
357
357
|
R = "" + ke;
|
|
358
358
|
}
|
|
359
359
|
return typeof R == "string" && R[0] === `
|
|
@@ -548,7 +548,7 @@ function Ql() {
|
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function S(u, g) {
|
|
552
552
|
return g = g === void 0 ? "" : g, { bootstrapChunks: [], startInlineScript: "<script>", placeholderPrefix: g + "P:", segmentPrefix: g + "S:", boundaryPrefix: g + "B:", idPrefix: g, nextSuspenseID: 0, sentCompleteSegmentFunction: !1, sentCompleteBoundaryFunction: !1, sentClientRenderFunction: !1, generateStaticMarkup: u };
|
|
553
553
|
}
|
|
554
554
|
function ce(u, g, b, P) {
|
|
@@ -950,7 +950,7 @@ function Ql() {
|
|
|
950
950
|
b = P(b._payload), bt(u, g, b);
|
|
951
951
|
return;
|
|
952
952
|
}
|
|
953
|
-
if (
|
|
953
|
+
if (k(b)) {
|
|
954
954
|
Dr(u, g, b);
|
|
955
955
|
return;
|
|
956
956
|
}
|
|
@@ -1194,7 +1194,7 @@ function Ql() {
|
|
|
1194
1194
|
}, destroy: function(me) {
|
|
1195
1195
|
j = !0, R = me;
|
|
1196
1196
|
} }, pe = !1;
|
|
1197
|
-
if (u = it(u,
|
|
1197
|
+
if (u = it(u, S(b, g ? g.identifierPrefix : void 0), { insertionMode: 1, selectedValue: null }, 1 / 0, Qr, void 0, function() {
|
|
1198
1198
|
pe = !0;
|
|
1199
1199
|
}), Ir(u), Tr(u, P), u.status === 1) u.status = 2, ne.destroy(u.fatalError);
|
|
1200
1200
|
else if (u.status !== 2 && u.destination === null) {
|
|
@@ -1260,26 +1260,26 @@ function Ml() {
|
|
|
1260
1260
|
function y(d, h, w, C, F, N, G) {
|
|
1261
1261
|
this.acceptsBooleans = h === 2 || h === 3 || h === 4, this.attributeName = C, this.attributeNamespace = F, this.mustUseProperty = w, this.propertyName = d, this.type = h, this.sanitizeURL = N, this.removeEmptyString = G;
|
|
1262
1262
|
}
|
|
1263
|
-
var
|
|
1263
|
+
var k = {};
|
|
1264
1264
|
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(d) {
|
|
1265
|
-
|
|
1265
|
+
k[d] = new y(d, 0, !1, d, null, !1, !1);
|
|
1266
1266
|
}), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(d) {
|
|
1267
1267
|
var h = d[0];
|
|
1268
|
-
|
|
1268
|
+
k[h] = new y(h, 1, !1, d[1], null, !1, !1);
|
|
1269
1269
|
}), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(d) {
|
|
1270
|
-
|
|
1270
|
+
k[d] = new y(d, 2, !1, d.toLowerCase(), null, !1, !1);
|
|
1271
1271
|
}), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(d) {
|
|
1272
|
-
|
|
1272
|
+
k[d] = new y(d, 2, !1, d, null, !1, !1);
|
|
1273
1273
|
}), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(d) {
|
|
1274
|
-
|
|
1274
|
+
k[d] = new y(d, 3, !1, d.toLowerCase(), null, !1, !1);
|
|
1275
1275
|
}), ["checked", "multiple", "muted", "selected"].forEach(function(d) {
|
|
1276
|
-
|
|
1276
|
+
k[d] = new y(d, 3, !0, d, null, !1, !1);
|
|
1277
1277
|
}), ["capture", "download"].forEach(function(d) {
|
|
1278
|
-
|
|
1278
|
+
k[d] = new y(d, 4, !1, d, null, !1, !1);
|
|
1279
1279
|
}), ["cols", "rows", "size", "span"].forEach(function(d) {
|
|
1280
|
-
|
|
1280
|
+
k[d] = new y(d, 6, !1, d, null, !1, !1);
|
|
1281
1281
|
}), ["rowSpan", "start"].forEach(function(d) {
|
|
1282
|
-
|
|
1282
|
+
k[d] = new y(d, 5, !1, d.toLowerCase(), null, !1, !1);
|
|
1283
1283
|
});
|
|
1284
1284
|
var I = /[\-:]([a-z])/g;
|
|
1285
1285
|
function E(d) {
|
|
@@ -1290,17 +1290,17 @@ function Ml() {
|
|
|
1290
1290
|
I,
|
|
1291
1291
|
E
|
|
1292
1292
|
);
|
|
1293
|
-
|
|
1293
|
+
k[h] = new y(h, 1, !1, d, null, !1, !1);
|
|
1294
1294
|
}), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(d) {
|
|
1295
1295
|
var h = d.replace(I, E);
|
|
1296
|
-
|
|
1296
|
+
k[h] = new y(h, 1, !1, d, "http://www.w3.org/1999/xlink", !1, !1);
|
|
1297
1297
|
}), ["xml:base", "xml:lang", "xml:space"].forEach(function(d) {
|
|
1298
1298
|
var h = d.replace(I, E);
|
|
1299
|
-
|
|
1299
|
+
k[h] = new y(h, 1, !1, d, "http://www.w3.org/XML/1998/namespace", !1, !1);
|
|
1300
1300
|
}), ["tabIndex", "crossOrigin"].forEach(function(d) {
|
|
1301
|
-
|
|
1302
|
-
}),
|
|
1303
|
-
|
|
1301
|
+
k[d] = new y(d, 1, !1, d.toLowerCase(), null, !1, !1);
|
|
1302
|
+
}), k.xlinkHref = new y("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(d) {
|
|
1303
|
+
k[d] = new y(d, 1, !1, d.toLowerCase(), null, !0, !0);
|
|
1304
1304
|
});
|
|
1305
1305
|
var T = {
|
|
1306
1306
|
animationIterationCount: !0,
|
|
@@ -1396,34 +1396,34 @@ function Ml() {
|
|
|
1396
1396
|
if (F !== void 0) for (C = 0; C < F.length; C++) N.push(te, l(O(F[C])), J);
|
|
1397
1397
|
return { bootstrapChunks: N, startInlineScript: h, placeholderPrefix: A(d + "P:"), segmentPrefix: A(d + "S:"), boundaryPrefix: d + "B:", idPrefix: d, nextSuspenseID: 0, sentCompleteSegmentFunction: !1, sentCompleteBoundaryFunction: !1, sentClientRenderFunction: !1 };
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function S(d, h) {
|
|
1400
1400
|
return { insertionMode: d, selectedValue: h };
|
|
1401
1401
|
}
|
|
1402
1402
|
function ce(d) {
|
|
1403
|
-
return
|
|
1403
|
+
return S(d === "http://www.w3.org/2000/svg" ? 2 : d === "http://www.w3.org/1998/Math/MathML" ? 3 : 0, null);
|
|
1404
1404
|
}
|
|
1405
1405
|
function B(d, h, w) {
|
|
1406
1406
|
switch (h) {
|
|
1407
1407
|
case "select":
|
|
1408
|
-
return
|
|
1408
|
+
return S(1, w.value != null ? w.value : w.defaultValue);
|
|
1409
1409
|
case "svg":
|
|
1410
|
-
return
|
|
1410
|
+
return S(2, null);
|
|
1411
1411
|
case "math":
|
|
1412
|
-
return
|
|
1412
|
+
return S(3, null);
|
|
1413
1413
|
case "foreignObject":
|
|
1414
|
-
return
|
|
1414
|
+
return S(1, null);
|
|
1415
1415
|
case "table":
|
|
1416
|
-
return
|
|
1416
|
+
return S(4, null);
|
|
1417
1417
|
case "thead":
|
|
1418
1418
|
case "tbody":
|
|
1419
1419
|
case "tfoot":
|
|
1420
|
-
return
|
|
1420
|
+
return S(5, null);
|
|
1421
1421
|
case "colgroup":
|
|
1422
|
-
return
|
|
1422
|
+
return S(7, null);
|
|
1423
1423
|
case "tr":
|
|
1424
|
-
return
|
|
1424
|
+
return S(6, null);
|
|
1425
1425
|
}
|
|
1426
|
-
return 4 <= d.insertionMode || d.insertionMode === 0 ?
|
|
1426
|
+
return 4 <= d.insertionMode || d.insertionMode === 0 ? S(1, null) : d;
|
|
1427
1427
|
}
|
|
1428
1428
|
var ae = A("<!-- -->");
|
|
1429
1429
|
function fe(d, h, w, C) {
|
|
@@ -1463,7 +1463,7 @@ function Ml() {
|
|
|
1463
1463
|
return;
|
|
1464
1464
|
}
|
|
1465
1465
|
if (!(2 < w.length) || w[0] !== "o" && w[0] !== "O" || w[1] !== "n" && w[1] !== "N") {
|
|
1466
|
-
if (h =
|
|
1466
|
+
if (h = k.hasOwnProperty(w) ? k[w] : null, h !== null) {
|
|
1467
1467
|
switch (typeof C) {
|
|
1468
1468
|
case "function":
|
|
1469
1469
|
case "symbol":
|
|
@@ -2503,8 +2503,8 @@ const et = { AUDIO_BUTTON: "audio-button", NOTIFICATION_BUTTON: "notification-bu
|
|
|
2503
2503
|
}, n];
|
|
2504
2504
|
}, ua = x.createContext({}), at = () => x.useContext(ua), Xl = ({ children: e, settings: t }) => {
|
|
2505
2505
|
var r, n, o, s, i, a;
|
|
2506
|
-
const [l, A, c] = Qt(!1), [p, f, m] = Qt(((r = t?.chatWindow) == null ? void 0 : r.defaultOpen) ?? !1), [v, D, y] = Qt(((n = t?.audio) == null ? void 0 : n.defaultToggledOn) ?? !1), [
|
|
2507
|
-
return M.jsx(ua.Provider, { value: { isBotTyping: l, setSyncedIsBotTyping: A, syncedIsBotTypingRef: c, isChatWindowOpen: p, setSyncedIsChatWindowOpen: f, syncedIsChatWindowOpenRef: m, audioToggledOn: v, setSyncedAudioToggledOn: D, syncedAudioToggledOnRef: y, voiceToggledOn:
|
|
2506
|
+
const [l, A, c] = Qt(!1), [p, f, m] = Qt(((r = t?.chatWindow) == null ? void 0 : r.defaultOpen) ?? !1), [v, D, y] = Qt(((n = t?.audio) == null ? void 0 : n.defaultToggledOn) ?? !1), [k, I, E] = Qt(((o = t?.voice) == null ? void 0 : o.defaultToggledOn) ?? !1), [T, _, Q] = Qt(((s = t?.notification) == null ? void 0 : s.defaultToggledOn) ?? !0), [O, U] = x.useState(!1), [W, H] = x.useState(!1), [K, L, X] = Qt(!1), [te, J, re] = Qt(!0), [Y, Z, S] = Qt(!1), [ce, B] = x.useState(!1), [ae, fe] = x.useState(!1), [de, be] = x.useState(0), [Oe, Ie] = x.useState(0), [nt, Re] = x.useState(!1), [je, Je] = x.useState(((i = window.visualViewport) == null ? void 0 : i.height) ?? window.innerHeight), [ie, oe] = x.useState(((a = window.visualViewport) == null ? void 0 : a.width) ?? window.innerWidth);
|
|
2507
|
+
return M.jsx(ua.Provider, { value: { isBotTyping: l, setSyncedIsBotTyping: A, syncedIsBotTypingRef: c, isChatWindowOpen: p, setSyncedIsChatWindowOpen: f, syncedIsChatWindowOpenRef: m, audioToggledOn: v, setSyncedAudioToggledOn: D, syncedAudioToggledOnRef: y, voiceToggledOn: k, setSyncedVoiceToggledOn: I, syncedVoiceToggledOnRef: E, notificationsToggledOn: T, setSyncedNotificationsToggledOn: _, syncedNotificationsToggledOnRef: Q, isLoadingChatHistory: O, setIsLoadingChatHistory: U, hasChatHistoryLoaded: W, setHasChatHistoryLoaded: H, isScrolling: K, setSyncedIsScrolling: L, syncedIsScrollingRef: X, textAreaDisabled: te, setSyncedTextAreaDisabled: J, syncedTextAreaDisabledRef: re, textAreaSensitiveMode: Y, setSyncedTextAreaSensitiveMode: Z, syncedTextAreaSensitiveModeRef: S, hasInteractedPage: ce, setHasInteractedPage: B, hasFlowStarted: ae, setHasFlowStarted: fe, unreadCount: de, setUnreadCount: be, inputLength: Oe, setInputLength: Ie, blockAllowsAttachment: nt, setBlockAllowsAttachment: Re, viewportHeight: je, setViewportHeight: Je, viewportWidth: ie, setViewportWidth: oe }, children: e });
|
|
2508
2508
|
};
|
|
2509
2509
|
var le = ((e) => (e.START_SPEAK_AUDIO = "rcb-start-speak-audio", e.TOGGLE_AUDIO = "rcb-toggle-audio", e.TOGGLE_NOTIFICATIONS = "rcb-toggle-notifications", e.TOGGLE_VOICE = "rcb-toggle-voice", e.TOGGLE_CHAT_WINDOW = "rcb-toggle-chat-window", e.PRE_INJECT_MESSAGE = "rcb-pre-inject-message", e.POST_INJECT_MESSAGE = "rcb-post-inject-message", e.START_SIMULATE_STREAM_MESSAGE = "rcb-start-simulate-stream-message", e.STOP_SIMULATE_STREAM_MESSAGE = "rcb-stop-simulate-stream-message", e.START_STREAM_MESSAGE = "rcb-start-stream-message", e.CHUNK_STREAM_MESSAGE = "rcb-chunk-stream-message", e.STOP_STREAM_MESSAGE = "rcb-stop-stream-message", e.REMOVE_MESSAGE = "rcb-remove-message", e.SAVE_CHAT_HISTORY = "rcb-save-chat-history", e.LOAD_CHAT_HISTORY = "rcb-load-chat-history", e.CHANGE_PATH = "rcb-change-path", e.SHOW_TOAST = "rcb-show-toast", e.DISMISS_TOAST = "rcb-dismiss-toast", e.USER_SUBMIT_TEXT = "rcb-user-submit-text", e.USER_UPLOAD_FILE = "rcb-user-upload-file", e.TEXT_AREA_CHANGE_VALUE = "rcb-text-area-change-value", e.PRE_LOAD_CHATBOT = "rcb-pre-load-chatbot", e.POST_LOAD_CHATBOT = "rcb-post-load-chatbot", e.PRE_PROCESS_BLOCK = "rcb-pre-process-block", e.POST_PROCESS_BLOCK = "rcb-post-process-block", e))(le || {});
|
|
2510
2510
|
const Jl = { [le.START_SPEAK_AUDIO]: !0, [le.TOGGLE_AUDIO]: !0, [le.TOGGLE_VOICE]: !0, [le.TOGGLE_NOTIFICATIONS]: !0, [le.TOGGLE_CHAT_WINDOW]: !0, [le.PRE_INJECT_MESSAGE]: !0, [le.POST_INJECT_MESSAGE]: !1, [le.PRE_LOAD_CHATBOT]: !0, [le.POST_LOAD_CHATBOT]: !1, [le.START_SIMULATE_STREAM_MESSAGE]: !0, [le.STOP_SIMULATE_STREAM_MESSAGE]: !1, [le.START_STREAM_MESSAGE]: !0, [le.CHUNK_STREAM_MESSAGE]: !0, [le.STOP_STREAM_MESSAGE]: !0, [le.REMOVE_MESSAGE]: !0, [le.SAVE_CHAT_HISTORY]: !0, [le.LOAD_CHAT_HISTORY]: !0, [le.CHANGE_PATH]: !0, [le.SHOW_TOAST]: !0, [le.DISMISS_TOAST]: !0, [le.USER_SUBMIT_TEXT]: !0, [le.USER_UPLOAD_FILE]: !0, [le.TEXT_AREA_CHANGE_VALUE]: !0, [le.PRE_PROCESS_BLOCK]: !0, [le.POST_PROCESS_BLOCK]: !0 }, Ko = async (e, t, r) => {
|
|
@@ -2530,7 +2530,7 @@ const Jl = { [le.START_SPEAK_AUDIO]: !0, [le.TOGGLE_AUDIO]: !0, [le.TOGGLE_VOICE
|
|
|
2530
2530
|
E !== p.current && ((T = e.event) != null && T.rcbToggleChatWindow && (await m(le.TOGGLE_CHAT_WINDOW, { currState: p.current, newState: !p.current })).defaultPrevented || r((_) => (_ || a(0), !_)));
|
|
2531
2531
|
}, [p]), y = x.useCallback(async (E) => {
|
|
2532
2532
|
E !== c.current && l((T) => !T);
|
|
2533
|
-
}, [c]),
|
|
2533
|
+
}, [c]), k = x.useCallback((E, T, _, Q) => (E /= Q / 2) < 1 ? _ / 2 * E * E + T : -_ / 2 * (--E * (E - 2) - 1) + T, []), I = x.useCallback((E = 0) => {
|
|
2534
2534
|
if (!f.current) return;
|
|
2535
2535
|
const T = f.current.scrollHeight - f.current.clientHeight;
|
|
2536
2536
|
if (E <= 0) return f.current.scrollTop = T, void A(!1);
|
|
@@ -2539,7 +2539,7 @@ const Jl = { [le.START_SPEAK_AUDIO]: !0, [le.TOGGLE_AUDIO]: !0, [le.TOGGLE_VOICE
|
|
|
2539
2539
|
const U = () => {
|
|
2540
2540
|
if (!f.current) return;
|
|
2541
2541
|
O += 20;
|
|
2542
|
-
const W =
|
|
2542
|
+
const W = k(O, _, Q, E);
|
|
2543
2543
|
f.current.scrollTop = W, O < E ? requestAnimationFrame(U) : A(!1);
|
|
2544
2544
|
};
|
|
2545
2545
|
U();
|
|
@@ -2585,7 +2585,7 @@ const Jl = { [le.START_SPEAK_AUDIO]: !0, [le.TOGGLE_AUDIO]: !0, [le.TOGGLE_VOICE
|
|
|
2585
2585
|
}), a && ((r = n.chatWindow) == null ? void 0 : r.showTypingIndicator) && M.jsx(rA, {}), M.jsx($l, {})] });
|
|
2586
2586
|
}, sA = ({ checkboxes: e, checkedItems: t, path: r }) => {
|
|
2587
2587
|
var n, o, s, i, a, l, A, c, p, f, m;
|
|
2588
|
-
const { settings: v } = De(), { styles: D } = He(), { paths: y } = xr(), { handleSubmitText:
|
|
2588
|
+
const { settings: v } = De(), { styles: D } = He(), { paths: y } = xr(), { handleSubmitText: k } = Xn(), [I, E] = x.useState(/* @__PURE__ */ new Set()), [T, _] = x.useState(!1), Q = { cursor: T ? `url("${(n = v.general) == null ? void 0 : n.actionDisabledIcon}"), auto` : "pointer", color: (o = v.general) == null ? void 0 : o.primaryColor, borderColor: (s = v.general) == null ? void 0 : s.primaryColor, ...D.botCheckboxRowStyle }, O = { cursor: T || I.size < e.min ? `url("${(i = v.general) == null ? void 0 : i.actionDisabledIcon}"), auto` : "pointer", color: (a = v.general) == null ? void 0 : a.primaryColor, borderColor: (l = v.general) == null ? void 0 : l.primaryColor, ...D.botCheckboxNextStyle }, U = { cursor: T ? `url("${(A = v.general) == null ? void 0 : A.actionDisabledIcon}"), auto` : "pointer", color: "transparent", ...D.botCheckMarkStyle }, W = { cursor: T ? `url("${(c = v.general) == null ? void 0 : c.actionDisabledIcon}"), auto` : "pointer", color: "#fff", borderColor: (p = v.general) == null ? void 0 : p.primaryColor, backgroundColor: (f = v.general) == null ? void 0 : f.primaryColor, ...D.botCheckMarkSelectedStyle };
|
|
2589
2589
|
return x.useEffect(() => {
|
|
2590
2590
|
y.length > 0 && y[y.length - 1] !== r && _(!e.reusable);
|
|
2591
2591
|
}, [y]), M.jsxs("div", { className: "rcb-checkbox-container " + ((m = v.botBubble) != null && m.showAvatar ? "rcb-checkbox-offset" : ""), children: [e.items.map((H) => M.jsx("div", { onMouseDown: (K) => {
|
|
@@ -2605,7 +2605,7 @@ const Jl = { [le.START_SPEAK_AUDIO]: !0, [le.TOGGLE_AUDIO]: !0, [le.TOGGLE_VOICE
|
|
|
2605
2605
|
if (H.preventDefault(), T || I.size < e.min) return;
|
|
2606
2606
|
const L = Array.from(t).join(", ");
|
|
2607
2607
|
let X;
|
|
2608
|
-
_(!e.reusable), X = e.sendOutput != null ? e.sendOutput : ((K = v.chatInput) == null ? void 0 : K.sendCheckboxOutput) ?? !0,
|
|
2608
|
+
_(!e.reusable), X = e.sendOutput != null ? e.sendOutput : ((K = v.chatInput) == null ? void 0 : K.sendCheckboxOutput) ?? !0, k(L, X);
|
|
2609
2609
|
} })] });
|
|
2610
2610
|
}, iA = async (e, t) => {
|
|
2611
2611
|
const r = e.checkboxes;
|
|
@@ -2628,12 +2628,12 @@ const Jl = { [le.START_SPEAK_AUDIO]: !0, [le.TOGGLE_AUDIO]: !0, [le.TOGGLE_VOICE
|
|
|
2628
2628
|
o instanceof Promise && (o = await o), typeof o == "string" && o.trim() !== "" && (r ? await t.simulateStreamMessage(o) : await t.injectMessage(o));
|
|
2629
2629
|
}, AA = ({ options: e, path: t }) => {
|
|
2630
2630
|
var r, n, o, s, i, a;
|
|
2631
|
-
const { settings: l } = De(), { styles: A } = He(), { paths: c } = xr(), { handleSubmitText: p } = Xn(), [f, m] = x.useState([]), [v, D] = x.useState(!1), y = { cursor: v ? `url("${(r = l.general) == null ? void 0 : r.actionDisabledIcon}"), auto` : "pointer", color: (n = l.general) == null ? void 0 : n.primaryColor, borderColor: (o = l.general) == null ? void 0 : o.primaryColor, backgroundColor: "#fff", ...A.botOptionStyle },
|
|
2631
|
+
const { settings: l } = De(), { styles: A } = He(), { paths: c } = xr(), { handleSubmitText: p } = Xn(), [f, m] = x.useState([]), [v, D] = x.useState(!1), y = { cursor: v ? `url("${(r = l.general) == null ? void 0 : r.actionDisabledIcon}"), auto` : "pointer", color: (n = l.general) == null ? void 0 : n.primaryColor, borderColor: (o = l.general) == null ? void 0 : o.primaryColor, backgroundColor: "#fff", ...A.botOptionStyle }, k = { color: "#fff", borderColor: (s = l.general) == null ? void 0 : s.primaryColor, backgroundColor: (i = l.general) == null ? void 0 : i.primaryColor, ...A.botOptionHoveredStyle };
|
|
2632
2632
|
return x.useEffect(() => {
|
|
2633
2633
|
c.length > 0 && c[c.length - 1] !== t && D(!e.reusable);
|
|
2634
2634
|
}, [c]), M.jsx("div", { className: "rcb-options-container " + ((a = l.botBubble) != null && a.showAvatar ? "rcb-options-offset" : ""), children: e.items.map((I, E) => {
|
|
2635
2635
|
const T = f[E] && !v;
|
|
2636
|
-
return M.jsx("div", { className: "rcb-options", style: T ?
|
|
2636
|
+
return M.jsx("div", { className: "rcb-options", style: T ? k : y, onMouseEnter: () => ((_) => {
|
|
2637
2637
|
m((Q) => {
|
|
2638
2638
|
const O = [...Q];
|
|
2639
2639
|
return O[_] = !0, O;
|
|
@@ -2747,8 +2747,8 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2747
2747
|
if (p === "style") {
|
|
2748
2748
|
const f = c.value.split(";").filter((v) => v.trim() !== ""), m = {};
|
|
2749
2749
|
f.forEach((v) => {
|
|
2750
|
-
const [D, y] = v.split(":").map((I) => I.trim()),
|
|
2751
|
-
m[
|
|
2750
|
+
const [D, y] = v.split(":").map((I) => I.trim()), k = D.replace(/-([a-z])/g, (I, E) => E.toUpperCase());
|
|
2751
|
+
m[k] = y;
|
|
2752
2752
|
}), A[p] = m;
|
|
2753
2753
|
} else a !== "audio" && a !== "video" || p !== "controls" || c.value !== "" ? A[p] = c.value : A[p] = "true";
|
|
2754
2754
|
return A;
|
|
@@ -2782,13 +2782,13 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2782
2782
|
const D = (m = e.notification) == null ? void 0 : m.sound;
|
|
2783
2783
|
l.current = new AudioContext();
|
|
2784
2784
|
const y = l.current.createGain();
|
|
2785
|
-
let
|
|
2785
|
+
let k;
|
|
2786
2786
|
if (y.gain.value = ((v = e.notification) == null ? void 0 : v.volume) ?? 0.2, A.current = y, D != null && D.startsWith("data:audio")) {
|
|
2787
2787
|
const I = atob(D.split(",")[1]), E = new ArrayBuffer(I.length), T = new Uint8Array(E);
|
|
2788
2788
|
for (let _ = 0; _ < I.length; _++) T[_] = I.charCodeAt(_);
|
|
2789
|
-
|
|
2790
|
-
} else
|
|
2791
|
-
a.current = await l.current.decodeAudioData(
|
|
2789
|
+
k = E;
|
|
2790
|
+
} else k = await (await fetch(D)).arrayBuffer();
|
|
2791
|
+
a.current = await l.current.decodeAudioData(k);
|
|
2792
2792
|
}, [e.notification]), f = x.useCallback(() => {
|
|
2793
2793
|
var m;
|
|
2794
2794
|
if ((m = e.notification) != null && m.disabled || !i.current || !n || !l.current || !a.current) return;
|
|
@@ -2833,7 +2833,7 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2833
2833
|
return { audioToggledOn: t, speakAudio: i, toggleAudio: s };
|
|
2834
2834
|
}, Ln = () => {
|
|
2835
2835
|
var e, t, r;
|
|
2836
|
-
const { settings: n } = De(), { messages: o, setSyncedMessages: s, syncedMessagesRef: i } = fs(), { setSyncedIsBotTyping: a, setUnreadCount: l, syncedIsScrollingRef: A, syncedIsChatWindowOpenRef: c } = at(), { streamMessageMap: p, chatBodyRef: f, paramsInputRef: m } = ot(), { scrollToBottom: v, getIsChatBotVisible: D } = _t(), { dispatchRcbEvent: y } = Jt(), { speakAudio:
|
|
2836
|
+
const { settings: n } = De(), { messages: o, setSyncedMessages: s, syncedMessagesRef: i } = fs(), { setSyncedIsBotTyping: a, setUnreadCount: l, syncedIsScrollingRef: A, syncedIsChatWindowOpenRef: c } = at(), { streamMessageMap: p, chatBodyRef: f, paramsInputRef: m } = ot(), { scrollToBottom: v, getIsChatBotVisible: D } = _t(), { dispatchRcbEvent: y } = Jt(), { speakAudio: k } = wa(), { playNotificationSound: I } = ps(), E = x.useCallback(async (L) => {
|
|
2837
2837
|
var X, te;
|
|
2838
2838
|
if ((X = n.event) != null && X.rcbSaveChatHistory) {
|
|
2839
2839
|
const J = await y(le.SAVE_CHAT_HISTORY, { messages: L });
|
|
@@ -2844,8 +2844,8 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2844
2844
|
if (ma || !Sn) return;
|
|
2845
2845
|
const re = [];
|
|
2846
2846
|
for (let Z = J.length - 1; Z >= 0; Z--) {
|
|
2847
|
-
const
|
|
2848
|
-
if (
|
|
2847
|
+
const S = J[Z];
|
|
2848
|
+
if (S.sender.toUpperCase() !== "SYSTEM" && (S.content !== "" && re.unshift(S), re.length === to)) break;
|
|
2849
2849
|
}
|
|
2850
2850
|
let Y = re.map(gA);
|
|
2851
2851
|
if (!ga && Y.length < to) {
|
|
@@ -2863,7 +2863,7 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2863
2863
|
const Z = Y.sender.toUpperCase();
|
|
2864
2864
|
Z === "USER" && (re = !1), (te = n.general) != null && te.embedded && D() && (re = !1), (c.current && !A.current || X) && (re = !1), re && I(), !X && (Z !== "USER" && (J = n.chatWindow) != null && J.autoJumpToBottom || Z === "USER" || !A.current) && setTimeout(() => v(), 1);
|
|
2865
2865
|
}, [n, f, c, A, I, v, D]), _ = x.useCallback(async (L, X = "BOT", te = null) => {
|
|
2866
|
-
var J, re, Y, Z,
|
|
2866
|
+
var J, re, Y, Z, S;
|
|
2867
2867
|
if (typeof L != "string") throw new Error("Content must be of type string to simulate stream.");
|
|
2868
2868
|
X = X.toUpperCase();
|
|
2869
2869
|
let ce = xn(L, X);
|
|
@@ -2881,7 +2881,7 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2881
2881
|
te && (fe = te(fe));
|
|
2882
2882
|
let de = 0;
|
|
2883
2883
|
const be = fe.length;
|
|
2884
|
-
ce.sender.toUpperCase() === "BOT" && (c.current || (Z = n.general) != null && Z.embedded) && typeof ce.content == "string" && ce.content.trim() !== "" &&
|
|
2884
|
+
ce.sender.toUpperCase() === "BOT" && (c.current || (Z = n.general) != null && Z.embedded) && typeof ce.content == "string" && ce.content.trim() !== "" && k(ce.content);
|
|
2885
2885
|
const Oe = new Promise((Ie) => {
|
|
2886
2886
|
const nt = setInterval(() => {
|
|
2887
2887
|
if (de >= be) return clearInterval(nt), void Ie();
|
|
@@ -2896,8 +2896,8 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2896
2896
|
});
|
|
2897
2897
|
}, B);
|
|
2898
2898
|
});
|
|
2899
|
-
return (A.current || !c.current) && l((Ie) => Ie + 1), await Oe, E(i.current), (
|
|
2900
|
-
}, [n, y, T, i, m, a, l, c,
|
|
2899
|
+
return (A.current || !c.current) && l((Ie) => Ie + 1), await Oe, E(i.current), (S = n.event) != null && S.rcbStopSimulateStreamMessage && await y(le.STOP_SIMULATE_STREAM_MESSAGE, { message: ce }), X === "USER" && (m.current = L), ce;
|
|
2900
|
+
}, [n, y, T, i, m, a, l, c, k]), Q = x.useCallback(async (L, X = "BOT") => {
|
|
2901
2901
|
var te, J, re;
|
|
2902
2902
|
X = X.toUpperCase();
|
|
2903
2903
|
let Y = xn(L, X);
|
|
@@ -2906,8 +2906,8 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2906
2906
|
if (Z.defaultPrevented) return null;
|
|
2907
2907
|
Y = Z.data.message;
|
|
2908
2908
|
}
|
|
2909
|
-
return Y.sender.toUpperCase() === "BOT" && (c.current || (J = n.general) != null && J.embedded) && typeof Y.content == "string" && Y.content.trim() !== "" &&
|
|
2910
|
-
}, [n, y, T, m, i, c,
|
|
2909
|
+
return Y.sender.toUpperCase() === "BOT" && (c.current || (J = n.general) != null && J.embedded) && typeof Y.content == "string" && Y.content.trim() !== "" && k(Y.content), (A.current || !c.current) && l((Z) => Z + 1), (re = n.event) != null && re.rcbPostInjectMessage && await y(le.POST_INJECT_MESSAGE, { message: Y }), s((Z) => [...Z, Y]), T(i.current), X === "USER" && typeof L == "string" && (m.current = L), Y;
|
|
2910
|
+
}, [n, y, T, m, i, c, k, l]), O = x.useCallback(async (L) => {
|
|
2911
2911
|
var X;
|
|
2912
2912
|
let te = i.current.find((Y) => Y.id === L), J = null, re = !1;
|
|
2913
2913
|
return te || (J = vr(), te = J.find((Y) => Y.id === L), te && (re = !0)), !te || (X = n.event) != null && X.rcbRemoveMessage && (await y(le.REMOVE_MESSAGE, { message: te })).defaultPrevented ? null : re ? (J && Xo(J.filter((Y) => Y.id !== L)), te) : (s((Y) => Y.filter((Z) => Z.id !== L)), T(i.current), l((Y) => Math.max(Y - 1, 0)), te);
|
|
@@ -2935,12 +2935,12 @@ const vr = () => uo, Xo = (e) => {
|
|
|
2935
2935
|
}, [T, i]), K = x.useCallback((L, X, te = 0) => {
|
|
2936
2936
|
var J;
|
|
2937
2937
|
const re = i.current, Y = L ? L.toUpperCase() : null, Z = [];
|
|
2938
|
-
let
|
|
2938
|
+
let S = te;
|
|
2939
2939
|
for (let ce = re.length - 1; ce >= 0; ce--) {
|
|
2940
2940
|
const B = re[ce];
|
|
2941
2941
|
if (!Y || ((J = B?.sender) == null ? void 0 : J.toUpperCase()) === Y) {
|
|
2942
|
-
if (
|
|
2943
|
-
|
|
2942
|
+
if (S > 0) {
|
|
2943
|
+
S--;
|
|
2944
2944
|
continue;
|
|
2945
2945
|
}
|
|
2946
2946
|
if (Z.push(B), X !== void 0 && Z.length === X) break;
|
|
@@ -2971,8 +2971,8 @@ const hs = () => {
|
|
|
2971
2971
|
clearTimeout(nn), nn = null, clearTimeout(no);
|
|
2972
2972
|
const D = f.results[f.results.length - 1][0].transcript;
|
|
2973
2973
|
if (s.current) {
|
|
2974
|
-
const y = (m = e.chatInput) == null ? void 0 : m.characterLimit,
|
|
2975
|
-
y != null && y >= 0 &&
|
|
2974
|
+
const y = (m = e.chatInput) == null ? void 0 : m.characterLimit, k = s.current.value + D;
|
|
2975
|
+
y != null && y >= 0 && k.length > y ? n(k.slice(0, y)) : n(k), o(s.current.value.length);
|
|
2976
2976
|
}
|
|
2977
2977
|
c && (nn = setTimeout(async () => await Io(t, s), c)), (v = e.voice) != null && v.autoSendDisabled || (no = setTimeout(r, p));
|
|
2978
2978
|
}, A.onend = () => {
|
|
@@ -3026,7 +3026,7 @@ const hs = () => {
|
|
|
3026
3026
|
var U, W, H;
|
|
3027
3027
|
(U = t.general) != null && U.embedded ? v() && ((W = c.current) == null || W.focus()) : Q !== "start" && ((H = c.current) == null || H.focus());
|
|
3028
3028
|
}, 100);
|
|
3029
|
-
}, [c, (e = t.general) == null ? void 0 : e.embedded, p, v]),
|
|
3029
|
+
}, [c, (e = t.general) == null ? void 0 : e.embedded, p, v]), k = x.useCallback(() => {
|
|
3030
3030
|
c.current && c.current.focus();
|
|
3031
3031
|
}, []), I = x.useCallback(() => {
|
|
3032
3032
|
c.current && c.current.blur();
|
|
@@ -3035,7 +3035,7 @@ const hs = () => {
|
|
|
3035
3035
|
}, [l]), _ = x.useCallback((Q) => {
|
|
3036
3036
|
Q !== A.current && a((O) => !O);
|
|
3037
3037
|
}, [A]);
|
|
3038
|
-
return { textAreaDisabled: o, setSyncedTextAreaDisabled: s, textAreaSensitiveMode: i, setSyncedTextAreaSensitiveMode: a, inputLength: r, setInputLength: n, getTextAreaValue: E, setTextAreaValue: D, updateTextAreaFocus: y, focusTextArea:
|
|
3038
|
+
return { textAreaDisabled: o, setSyncedTextAreaDisabled: s, textAreaSensitiveMode: i, setSyncedTextAreaSensitiveMode: a, inputLength: r, setInputLength: n, getTextAreaValue: E, setTextAreaValue: D, updateTextAreaFocus: y, focusTextArea: k, blurTextArea: I, toggleTextAreaDisabled: T, toggleTextAreaSensitiveMode: _ };
|
|
3039
3039
|
}, ba = x.createContext({ toasts: [], setSyncedToasts: () => {
|
|
3040
3040
|
}, syncedToastsRef: { current: [] } }), Ea = () => x.useContext(ba), SA = ({ children: e }) => {
|
|
3041
3041
|
const [t, r, n] = Qt([]);
|
|
@@ -3049,11 +3049,11 @@ const hs = () => {
|
|
|
3049
3049
|
v = so();
|
|
3050
3050
|
let y = { id: v, content: l, timeout: A };
|
|
3051
3051
|
if ((f = e.event) != null && f.rcbShowToast) {
|
|
3052
|
-
const
|
|
3053
|
-
if (
|
|
3054
|
-
y =
|
|
3052
|
+
const k = await o(le.SHOW_TOAST, { toast: y });
|
|
3053
|
+
if (k.defaultPrevented) return null;
|
|
3054
|
+
y = k.data.toast;
|
|
3055
3055
|
}
|
|
3056
|
-
return r((
|
|
3056
|
+
return r((k) => [...k.slice(1), y]), v;
|
|
3057
3057
|
}
|
|
3058
3058
|
v = so();
|
|
3059
3059
|
let D = { id: v, content: l, timeout: A };
|
|
@@ -3074,7 +3074,7 @@ const hs = () => {
|
|
|
3074
3074
|
return { showToast: s, dismissToast: i, toasts: t, replaceToasts: a };
|
|
3075
3075
|
}, fo = () => {
|
|
3076
3076
|
var e, t, r, n, o;
|
|
3077
|
-
const { settings: s } = De(), { paths: i, setSyncedPaths: a, syncedPathsRef: l } = xr(), { flowRef: A, streamMessageMap: c, paramsInputRef: p, keepVoiceOnRef: f, timeoutIdRef: m } = ot(), { setSyncedIsBotTyping: v, setSyncedTextAreaDisabled: D, setSyncedTextAreaSensitiveMode: y, blockAllowsAttachment:
|
|
3077
|
+
const { settings: s } = De(), { paths: i, setSyncedPaths: a, syncedPathsRef: l } = xr(), { flowRef: A, streamMessageMap: c, paramsInputRef: p, keepVoiceOnRef: f, timeoutIdRef: m } = ot(), { setSyncedIsBotTyping: v, setSyncedTextAreaDisabled: D, setSyncedTextAreaSensitiveMode: y, blockAllowsAttachment: k, setBlockAllowsAttachment: I } = at(), { dispatchRcbEvent: E } = Jt(), { endStreamMessage: T, injectMessage: _, removeMessage: Q, simulateStreamMessage: O, streamMessage: U } = Ln(), { showToast: W, dismissToast: H } = Kn(), { toggleChatWindow: K } = _t(), { updateTextAreaFocus: L, setTextAreaValue: X } = Fn(), { syncVoice: te } = ms(), J = x.useCallback(async (B) => {
|
|
3078
3078
|
var ae;
|
|
3079
3079
|
if ((ae = s.event) != null && ae.rcbPostProcessBlock) {
|
|
3080
3080
|
const fe = await E(le.POST_PROCESS_BLOCK, { block: B });
|
|
@@ -3093,7 +3093,7 @@ const hs = () => {
|
|
|
3093
3093
|
Ie = Re.data.block;
|
|
3094
3094
|
}
|
|
3095
3095
|
v(!0), (de = s.chatInput) != null && de.blockSpam && D(!0), y(!1);
|
|
3096
|
-
const nt = { prevPath: ae, currPath: B, goToPath:
|
|
3096
|
+
const nt = { prevPath: ae, currPath: B, goToPath: S, setTextAreaValue: X, userInput: p.current, endStreamMessage: T, injectMessage: _, removeMessage: Q, simulateStreamMessage: O, streamMessage: U, toggleChatWindow: K, showToast: W, dismissToast: H };
|
|
3097
3097
|
await (async (Re, je, Je, ie, oe, Ee, we) => {
|
|
3098
3098
|
if (!Re) throw new Error("Block is not valid.");
|
|
3099
3099
|
for (const Ne of Object.keys(Re)) switch (Ne) {
|
|
@@ -3119,7 +3119,7 @@ const hs = () => {
|
|
|
3119
3119
|
await dA(Re, je, ie, we);
|
|
3120
3120
|
}
|
|
3121
3121
|
})(Ie, nt, ((be = s.botBubble) == null ? void 0 : be.simulateStream) ?? !1, m, D, y, J), v(!1), "chatDisabled" in Ie || D((Oe = s.chatInput) == null ? void 0 : Oe.disabled), "isSensitive" in Ie || y(!1), I(typeof Ie.file == "function"), L(B), te(f.current && !Ie.chatDisabled), B !== ae && c.current.clear();
|
|
3122
|
-
}, [A, L, te, (t = s.botBubble) == null ? void 0 : t.simulateStream, (r = s.chatInput) == null ? void 0 : r.disabled, p, T, _, Q, O, U, K, W, H, f, c]), Y = x.useCallback(() => l.current.length > 0 ? l.current.at(-1) ?? null : null, []), Z = x.useCallback(() => l.current.length > 1 ? l.current.at(-2) ?? null : null, []),
|
|
3122
|
+
}, [A, L, te, (t = s.botBubble) == null ? void 0 : t.simulateStream, (r = s.chatInput) == null ? void 0 : r.disabled, p, T, _, Q, O, U, K, W, H, f, c]), Y = x.useCallback(() => l.current.length > 0 ? l.current.at(-1) ?? null : null, []), Z = x.useCallback(() => l.current.length > 1 ? l.current.at(-2) ?? null : null, []), S = x.useCallback(async (B) => {
|
|
3123
3123
|
var ae;
|
|
3124
3124
|
const fe = Y(), de = Z();
|
|
3125
3125
|
return ((ae = s.event) == null || !ae.rcbChangePath || !(await E(le.CHANGE_PATH, { currPath: fe, prevPath: de, nextPath: B })).defaultPrevented) && (a((be) => [...be, B]), await re(B, fe), !0);
|
|
@@ -3127,10 +3127,10 @@ const hs = () => {
|
|
|
3127
3127
|
const ae = typeof B == "function" ? B(l.current) : B;
|
|
3128
3128
|
a(ae);
|
|
3129
3129
|
}, [l]);
|
|
3130
|
-
return { getCurrPath: Y, getPrevPath: Z, goToPath:
|
|
3130
|
+
return { getCurrPath: Y, getPrevPath: Z, goToPath: S, blockAllowsAttachment: k, setBlockAllowsAttachment: I, paths: i, replacePaths: ce, firePostProcessBlockEvent: J };
|
|
3131
3131
|
}, Xn = () => {
|
|
3132
3132
|
var e, t, r, n;
|
|
3133
|
-
const { settings: o } = De(), { endStreamMessage: s, injectMessage: i, removeMessage: a, simulateStreamMessage: l, streamMessage: A } = Ln(), { syncedPathsRef: c } = xr(), { getCurrPath: p, getPrevPath: f, goToPath: m, firePostProcessBlockEvent: v } = fo(), { setSyncedTextAreaSensitiveMode: D, setSyncedTextAreaDisabled: y, setSyncedIsBotTyping:
|
|
3133
|
+
const { settings: o } = De(), { endStreamMessage: s, injectMessage: i, removeMessage: a, simulateStreamMessage: l, streamMessage: A } = Ln(), { syncedPathsRef: c } = xr(), { getCurrPath: p, getPrevPath: f, goToPath: m, firePostProcessBlockEvent: v } = fo(), { setSyncedTextAreaSensitiveMode: D, setSyncedTextAreaDisabled: y, setSyncedIsBotTyping: k, setBlockAllowsAttachment: I, setInputLength: E, syncedVoiceToggledOnRef: T, syncedTextAreaSensitiveModeRef: _ } = at(), { flowRef: Q, inputRef: O, keepVoiceOnRef: U, paramsInputRef: W, timeoutIdRef: H } = ot(), { showToast: K, dismissToast: L } = Kn(), { dispatchRcbEvent: X } = Jt(), { syncVoice: te } = ms(), { setTextAreaValue: J } = Fn(), { toggleChatWindow: re } = _t(), Y = x.useCallback(async (S) => {
|
|
3134
3134
|
var ce, B, ae, fe, de, be;
|
|
3135
3135
|
const Oe = p();
|
|
3136
3136
|
if (Oe && Q.current[Oe]) {
|
|
@@ -3138,27 +3138,27 @@ const hs = () => {
|
|
|
3138
3138
|
if ((ce = o?.sensitiveInput) != null && ce.hideInUserBubble) return;
|
|
3139
3139
|
if ((B = o?.sensitiveInput) != null && B.maskInUserBubble) return void ((ae = o.userBubble) != null && ae.simulateStream ? await l("*".repeat(((fe = o.sensitiveInput) == null ? void 0 : fe.asterisksCount) ?? 10), "USER") : await i("*".repeat(((de = o.sensitiveInput) == null ? void 0 : de.asterisksCount) ?? 10), "USER"));
|
|
3140
3140
|
}
|
|
3141
|
-
(be = o.userBubble) != null && be.simulateStream ? await l(
|
|
3141
|
+
(be = o.userBubble) != null && be.simulateStream ? await l(S, "USER") : await i(S, "USER");
|
|
3142
3142
|
}
|
|
3143
|
-
}, [Q, p, o, i, l, _]), Z = x.useCallback(async (
|
|
3143
|
+
}, [Q, p, o, i, l, _]), Z = x.useCallback(async (S, ce = !0) => {
|
|
3144
3144
|
var B, ae;
|
|
3145
|
-
if ((
|
|
3146
|
-
ce && await Y(
|
|
3145
|
+
if ((S = S.trim()) === "") return;
|
|
3146
|
+
ce && await Y(S), H.current && clearTimeout(H.current), O.current && (J(""), E(0));
|
|
3147
3147
|
const fe = p();
|
|
3148
3148
|
if (!fe) return;
|
|
3149
3149
|
let de = Q.current[fe];
|
|
3150
3150
|
const be = await v(de);
|
|
3151
3151
|
be && ((B = o.chatInput) != null && B.blockSpam && y(!0), U.current = T.current, te(!1), setTimeout(() => {
|
|
3152
|
-
|
|
3152
|
+
k(!0);
|
|
3153
3153
|
}, 400), D(!1), setTimeout(async () => {
|
|
3154
3154
|
var Oe;
|
|
3155
3155
|
const Ie = { prevPath: f(), currPath: p(), goToPath: m, setTextAreaValue: J, userInput: W.current, injectMessage: i, simulateStreamMessage: l, streamMessage: A, removeMessage: a, endStreamMessage: s, toggleChatWindow: re, showToast: K, dismissToast: L }, nt = c.current.length;
|
|
3156
|
-
await ha(be, Ie), c.current.length === nt && (y("chatDisabled" in de ? !!de.chatDisabled : !((Oe = o.chatInput) == null || !Oe.disabled)), pa(de, Ie, D), I(typeof de.file == "function"), te(U.current),
|
|
3156
|
+
await ha(be, Ie), c.current.length === nt && (y("chatDisabled" in de ? !!de.chatDisabled : !((Oe = o.chatInput) == null || !Oe.disabled)), pa(de, Ie, D), I(typeof de.file == "function"), te(U.current), k(!1));
|
|
3157
3157
|
}, (ae = o.chatInput) == null ? void 0 : ae.botDelay));
|
|
3158
3158
|
}, [H, (e = o.chatInput) == null ? void 0 : e.blockSpam, (t = o.chatInput) == null ? void 0 : t.botDelay, (r = o.chatInput) == null ? void 0 : r.disabled, U, T, te, Y, f, p, m, i, l, A, a, s, re, K, L, Q]);
|
|
3159
|
-
return { handleSubmitText: x.useCallback(async (
|
|
3159
|
+
return { handleSubmitText: x.useCallback(async (S, ce = !0) => {
|
|
3160
3160
|
var B, ae;
|
|
3161
|
-
|
|
3161
|
+
S = S ?? ((B = O.current) == null ? void 0 : B.value), !((ae = o.event) != null && ae.rcbUserSubmitText && (await X(le.USER_SUBMIT_TEXT, { inputText: S, sendInChat: ce })).defaultPrevented || !p()) && Z(S, ce);
|
|
3162
3162
|
}, [X, p, Z, O, (n = o.event) == null ? void 0 : n.rcbUserSubmitText]) };
|
|
3163
3163
|
}, po = () => {
|
|
3164
3164
|
var e;
|
|
@@ -3172,9 +3172,9 @@ const hs = () => {
|
|
|
3172
3172
|
}, [(e = t.device) == null ? void 0 : e.applyMobileOptimizations]);
|
|
3173
3173
|
}, CA = ({ buttons: e }) => {
|
|
3174
3174
|
var t, r, n, o, s, i, a, l, A, c, p;
|
|
3175
|
-
const f = po(), { settings: m } = De(), { styles: v } = He(), { textAreaDisabled: D, textAreaSensitiveMode: y, inputLength:
|
|
3175
|
+
const f = po(), { settings: m } = De(), { styles: v } = He(), { textAreaDisabled: D, textAreaSensitiveMode: y, inputLength: k, hasFlowStarted: I, setHasFlowStarted: E, setInputLength: T } = at(), { inputRef: _ } = ot(), [Q, O] = x.useState(!1), [U, W] = x.useState(!1), { handleSubmitText: H } = Xn(), { setTextAreaValue: K } = Fn(), L = { boxSizing: f ? "content-box" : "border-box", ...v.chatInputAreaStyle }, X = { outline: D ? "" : "none", boxShadow: D ? "" : `0 0 5px ${(t = m.general) == null ? void 0 : t.primaryColor}`, boxSizing: f ? "content-box" : "border-box", ...v.chatInputAreaStyle, ...v.chatInputAreaFocusedStyle }, te = { cursor: `url("${(r = m.general) == null ? void 0 : r.actionDisabledIcon}"), auto`, caretColor: "transparent", boxSizing: f ? "content-box" : "border-box", ...v.chatInputAreaStyle, ...v.chatInputAreaDisabledStyle }, J = { color: "#989898", ...v.characterLimitStyle }, re = { color: "#ff0000", ...v.characterLimitReachedStyle }, Y = D ? (n = m.chatInput) == null ? void 0 : n.disabledPlaceholderText : (o = m.chatInput) == null ? void 0 : o.enabledPlaceholderText, Z = () => {
|
|
3176
3176
|
D || O(!0);
|
|
3177
|
-
},
|
|
3177
|
+
}, S = () => {
|
|
3178
3178
|
O(!1);
|
|
3179
3179
|
}, ce = () => {
|
|
3180
3180
|
W(!0);
|
|
@@ -3192,7 +3192,7 @@ const hs = () => {
|
|
|
3192
3192
|
return M.jsxs("div", { "aria-label": ((s = m.ariaLabel) == null ? void 0 : s.inputTextArea) ?? "input text area", role: "textbox", onMouseDown: (de) => {
|
|
3193
3193
|
var be;
|
|
3194
3194
|
de.stopPropagation(), !I && ((be = m.general) == null ? void 0 : be.flowStartTrigger) === "ON_CHATBOT_INTERACT" && E(!0);
|
|
3195
|
-
}, style: { ...v.chatInputContainerStyle }, className: "rcb-chat-input", children: [y && (i = m.sensitiveInput) != null && i.maskInTextArea ? M.jsx("input", { ref: _, type: "password", className: "rcb-chat-input-textarea", style: D ? te : Q ? X : L, placeholder: Y, onChange: fe, onKeyDown: ae, onFocus: Z, onBlur:
|
|
3195
|
+
}, style: { ...v.chatInputContainerStyle }, className: "rcb-chat-input", children: [y && (i = m.sensitiveInput) != null && i.maskInTextArea ? M.jsx("input", { ref: _, type: "password", className: "rcb-chat-input-textarea", style: D ? te : Q ? X : L, placeholder: Y, onChange: fe, onKeyDown: ae, onFocus: Z, onBlur: S, onCompositionStart: ce, onCompositionEnd: B }) : M.jsx("textarea", { ref: _, style: D ? te : Q ? X : L, rows: 1, className: "rcb-chat-input-textarea", placeholder: Y, onChange: fe, onKeyDown: ae, onFocus: Z, onBlur: S, onCompositionStart: ce, onCompositionEnd: B }), M.jsxs(M.Fragment, { children: [e?.map((de, be) => M.jsx(x.Fragment, { children: de }, be)), ((a = m.chatInput) == null ? void 0 : a.showCharacterCount) && ((l = m.chatInput) == null ? void 0 : l.characterLimit) != null && ((A = m.chatInput) == null ? void 0 : A.characterLimit) > 0 && M.jsxs("div", { className: "rcb-chat-input-char-counter", style: k >= ((c = m.chatInput) == null ? void 0 : c.characterLimit) ? re : J, children: [k, "/", (p = m.chatInput) == null ? void 0 : p.characterLimit] })] })] });
|
|
3196
3196
|
}, PA = ({ buttons: e }) => {
|
|
3197
3197
|
var t;
|
|
3198
3198
|
const { settings: r } = De(), { styles: n } = He();
|
|
@@ -3206,19 +3206,19 @@ const hs = () => {
|
|
|
3206
3206
|
}, onMouseLeave: () => {
|
|
3207
3207
|
m(!1);
|
|
3208
3208
|
}, onClick: () => p(!0), children: [(() => {
|
|
3209
|
-
var
|
|
3210
|
-
const I = (
|
|
3209
|
+
var k;
|
|
3210
|
+
const I = (k = a.chatButton) == null ? void 0 : k.icon;
|
|
3211
3211
|
return I && typeof I != "string" ? I && M.jsx("span", { className: "rcb-toggle-icon", children: M.jsx(I, { style: y }) }) : M.jsx("span", { className: "rcb-toggle-icon", style: y });
|
|
3212
3212
|
})(), !((s = a.notification) != null && s.disabled) && ((i = a.notification) == null ? void 0 : i.showCount) && M.jsx("span", { style: { ...l.notificationBadgeStyle }, className: "rcb-badge", children: A })] }) });
|
|
3213
3213
|
}, BA = () => {
|
|
3214
3214
|
var e, t, r, n, o, s;
|
|
3215
|
-
const i = po(), { settings: a } = De(), { styles: l } = He(), { chatBodyRef: A } = ot(), { isChatWindowOpen: c, toggleChatWindow: p } = _t(), [f, m] = x.useState(!1), [v, D] = x.useState(!1), [y,
|
|
3215
|
+
const i = po(), { settings: a } = De(), { styles: l } = He(), { chatBodyRef: A } = ot(), { isChatWindowOpen: c, toggleChatWindow: p } = _t(), [f, m] = x.useState(!1), [v, D] = x.useState(!1), [y, k] = x.useState(0);
|
|
3216
3216
|
x.useEffect(() => {
|
|
3217
3217
|
var T, _, Q;
|
|
3218
3218
|
const O = (T = a.tooltip) == null ? void 0 : T.mode;
|
|
3219
3219
|
if (O === "ALWAYS") if (i) {
|
|
3220
3220
|
let U;
|
|
3221
|
-
U = c ? (((_ = A.current) == null ? void 0 : _.offsetWidth) ?? 375) - (typeof ((Q = l.chatButtonStyle) == null ? void 0 : Q.width) == "number" ? l.chatButtonStyle.width : 75) : 0,
|
|
3221
|
+
U = c ? (((_ = A.current) == null ? void 0 : _.offsetWidth) ?? 375) - (typeof ((Q = l.chatButtonStyle) == null ? void 0 : Q.width) == "number" ? l.chatButtonStyle.width : 75) : 0, k(U), m(!0);
|
|
3222
3222
|
} else m(!c);
|
|
3223
3223
|
else O === "NEVER" ? m(!1) : O === "START" ? v ? m(!1) : (D(!0), m(!0)) : O === "CLOSE" && m(!c);
|
|
3224
3224
|
}, [c, i, v, (e = l.chatButtonStyle) == null ? void 0 : e.width, (t = a.tooltip) == null ? void 0 : t.mode]);
|
|
@@ -3264,13 +3264,13 @@ const hs = () => {
|
|
|
3264
3264
|
}
|
|
3265
3265
|
}, QA = () => {
|
|
3266
3266
|
var e, t, r, n, o, s;
|
|
3267
|
-
const { settings: i } = De(), { styles: a } = He(), { injectMessage: l, simulateStreamMessage: A, streamMessage: c, removeMessage: p, endStreamMessage: f } = Ln(), { getCurrPath: m, getPrevPath: v, goToPath: D, blockAllowsAttachment: y } = fo(), { flowRef:
|
|
3267
|
+
const { settings: i } = De(), { styles: a } = He(), { injectMessage: l, simulateStreamMessage: A, streamMessage: c, removeMessage: p, endStreamMessage: f } = Ln(), { getCurrPath: m, getPrevPath: v, goToPath: D, blockAllowsAttachment: y } = fo(), { flowRef: k, inputRef: I } = ot(), E = k.current, { showToast: T, dismissToast: _ } = Kn(), { dispatchRcbEvent: Q } = Jt(), { toggleChatWindow: O } = _t(), { setTextAreaValue: U } = Fn(), { handleSubmitText: W } = Xn(), H = { cursor: `url("${(e = i.general) == null ? void 0 : e.actionDisabledIcon}"), auto`, ...a.fileAttachmentButtonStyle, ...a.fileAttachmentButtonDisabledStyle }, K = { backgroundImage: `url(${(t = i.fileAttachment) == null ? void 0 : t.icon})`, fill: "#a6a6a6", ...a.fileAttachmentIconStyle }, L = { backgroundImage: `url(${(r = i.fileAttachment) == null ? void 0 : r.icon})`, fill: "#a6a6a6", ...a.fileAttachmentIconStyle, ...a.fileAttachmentIconDisabledStyle };
|
|
3268
3268
|
return M.jsxs("label", { "aria-label": ((n = i.ariaLabel) == null ? void 0 : n.fileAttachmentButton) ?? "upload file", role: "button", className: y ? "rcb-attach-button-enabled" : "rcb-attach-button-disabled", style: y ? { ...a.fileAttachmentButtonStyle } : H, children: [M.jsx("input", { className: "rcb-attach-input", role: "file", type: "file", onChange: async (X) => {
|
|
3269
3269
|
var te, J, re, Y;
|
|
3270
3270
|
const Z = X.target.files;
|
|
3271
3271
|
if (!Z) return;
|
|
3272
|
-
const
|
|
3273
|
-
if (X.target.value = "", (te = i.event) != null && te.rcbUserUploadFile && (await Q(le.USER_UPLOAD_FILE, { files:
|
|
3272
|
+
const S = Array.from(Z);
|
|
3273
|
+
if (X.target.value = "", (te = i.event) != null && te.rcbUserUploadFile && (await Q(le.USER_UPLOAD_FILE, { files: S })).defaultPrevented) return;
|
|
3274
3274
|
const ce = m();
|
|
3275
3275
|
if (!ce) return;
|
|
3276
3276
|
const B = E[ce];
|
|
@@ -3278,12 +3278,12 @@ const hs = () => {
|
|
|
3278
3278
|
const ae = B.file;
|
|
3279
3279
|
if (ae != null) {
|
|
3280
3280
|
const fe = [];
|
|
3281
|
-
for (let de = 0; de <
|
|
3282
|
-
if (fe.push(
|
|
3283
|
-
const be = await ka(
|
|
3284
|
-
!be.fileType || !be.fileUrl || await l(M.jsx(xa, { file:
|
|
3281
|
+
for (let de = 0; de < S.length; de++) {
|
|
3282
|
+
if (fe.push(S[de].name), (J = i.fileAttachment) == null || !J.showMediaDisplay) continue;
|
|
3283
|
+
const be = await ka(S[de]);
|
|
3284
|
+
!be.fileType || !be.fileUrl || await l(M.jsx(xa, { file: S[de], fileType: be.fileType, fileUrl: be.fileUrl }), "USER");
|
|
3285
3285
|
}
|
|
3286
|
-
await W("📄 " + fe.join(", "), (re = i.fileAttachment) == null ? void 0 : re.sendFileName), await ae({ userInput: (Y = I.current) == null ? void 0 : Y.value, prevPath: v(), currPath: m(), goToPath: D, setTextAreaValue: U, injectMessage: l, simulateStreamMessage: A, streamMessage: c, removeMessage: p, endStreamMessage: f, toggleChatWindow: O, showToast: T, dismissToast: _, files:
|
|
3286
|
+
await W("📄 " + fe.join(", "), (re = i.fileAttachment) == null ? void 0 : re.sendFileName), await ae({ userInput: (Y = I.current) == null ? void 0 : Y.value, prevPath: v(), currPath: m(), goToPath: D, setTextAreaValue: U, injectMessage: l, simulateStreamMessage: A, streamMessage: c, removeMessage: p, endStreamMessage: f, toggleChatWindow: O, showToast: T, dismissToast: _, files: S });
|
|
3287
3287
|
}
|
|
3288
3288
|
}, multiple: (o = i.fileAttachment) == null ? void 0 : o.multiple, accept: (s = i.fileAttachment) == null ? void 0 : s.accept, disabled: !y }), (() => {
|
|
3289
3289
|
var X, te;
|
|
@@ -3292,7 +3292,7 @@ const hs = () => {
|
|
|
3292
3292
|
})()] });
|
|
3293
3293
|
}, MA = () => {
|
|
3294
3294
|
var e, t, r, n, o, s;
|
|
3295
|
-
const { settings: i } = De(), { styles: a } = He(), { syncedTextAreaDisabledRef: l } = at(), { inputRef: A } = ot(), { textAreaDisabled: c, setTextAreaValue: p } = Fn(), f = x.useRef(null), m = x.useRef(null), [v, D] = x.useState(!1), y = { cursor: `url("${(e = i.general) == null ? void 0 : e.actionDisabledIcon}"), auto`, ...a.emojiButtonStyle, ...a.emojiButtonDisabledStyle },
|
|
3295
|
+
const { settings: i } = De(), { styles: a } = He(), { syncedTextAreaDisabledRef: l } = at(), { inputRef: A } = ot(), { textAreaDisabled: c, setTextAreaValue: p } = Fn(), f = x.useRef(null), m = x.useRef(null), [v, D] = x.useState(!1), y = { cursor: `url("${(e = i.general) == null ? void 0 : e.actionDisabledIcon}"), auto`, ...a.emojiButtonStyle, ...a.emojiButtonDisabledStyle }, k = { backgroundImage: `url(${(t = i.emoji) == null ? void 0 : t.icon})`, fill: "#a6a6a6", ...a.emojiIconStyle }, I = { backgroundImage: `url(${(r = i.emoji) == null ? void 0 : r.icon})`, fill: "#a6a6a6", ...a.emojiIconStyle, ...a.emojiIconDisabledStyle };
|
|
3296
3296
|
return x.useEffect(() => {
|
|
3297
3297
|
const E = (_) => {
|
|
3298
3298
|
const Q = _.composedPath();
|
|
@@ -3313,7 +3313,7 @@ const hs = () => {
|
|
|
3313
3313
|
}, children: (() => {
|
|
3314
3314
|
var E, T;
|
|
3315
3315
|
const _ = c ? (E = i.emoji) == null ? void 0 : E.iconDisabled : (T = i.emoji) == null ? void 0 : T.icon;
|
|
3316
|
-
return _ && typeof _ != "string" ? _ && M.jsx("span", { className: c ? "rcb-emoji-icon-disabled" : "rcb-emoji-icon-enabled", children: M.jsx(_, { style: c ? I :
|
|
3316
|
+
return _ && typeof _ != "string" ? _ && M.jsx("span", { className: c ? "rcb-emoji-icon-disabled" : "rcb-emoji-icon-enabled", children: M.jsx(_, { style: c ? I : k }) }) : M.jsx("span", { className: c ? "rcb-emoji-icon-disabled" : "rcb-emoji-icon-enabled", style: c ? I : k });
|
|
3317
3317
|
})() }), v && M.jsx("div", { className: "rcb-emoji-button-popup", ref: f, children: (s = (o = i.emoji) == null ? void 0 : o.list) == null ? void 0 : s.map((E, T) => M.jsx("span", { className: "rcb-emoji", onMouseDown: (_) => ((Q, O) => {
|
|
3318
3318
|
Q.preventDefault(), A.current && (p(A.current.value + O), setTimeout(() => {
|
|
3319
3319
|
const U = A.current;
|
|
@@ -3369,7 +3369,7 @@ const hs = () => {
|
|
|
3369
3369
|
(K = T.voice) != null && K.sendAsAudio ? kA(Q, W) : xA(T, _, Q, O, U, H);
|
|
3370
3370
|
})(n, l, I, c, A, m, i) : gs();
|
|
3371
3371
|
}, [a]);
|
|
3372
|
-
const y = { backgroundImage: `url(${(e = n.voice) == null ? void 0 : e.icon})`, fill: "#9aa0a6", ...o.voiceIconStyle },
|
|
3372
|
+
const y = { backgroundImage: `url(${(e = n.voice) == null ? void 0 : e.icon})`, fill: "#9aa0a6", ...o.voiceIconStyle }, k = { backgroundImage: `url(${(t = n.voice) == null ? void 0 : t.iconDisabled})`, fill: "#9aa0a6", ...o.voiceIconStyle, ...o.voiceIconDisabledStyle }, I = () => {
|
|
3373
3373
|
D((T) => !T);
|
|
3374
3374
|
}, E = async () => {
|
|
3375
3375
|
const T = new Blob(m.current, { type: "audio/wav" }), _ = new File([T], "voice-input.wav", { type: "audio/wav" }), Q = await ka(_);
|
|
@@ -3380,11 +3380,11 @@ const hs = () => {
|
|
|
3380
3380
|
}, style: a && !p ? { ...o.voiceButtonStyle } : { ...o.voiceButtonStyle, ...o.voiceButtonDisabledStyle }, className: a && !p ? "rcb-voice-button-enabled" : "rcb-voice-button-disabled", children: (() => {
|
|
3381
3381
|
var T, _;
|
|
3382
3382
|
const Q = a ? (T = n.voice) == null ? void 0 : T.icon : (_ = n.voice) == null ? void 0 : _.iconDisabled;
|
|
3383
|
-
return Q && typeof Q != "string" ? Q && M.jsx("span", { className: "rcb-voice-icon " + (a && !p ? "on" : ""), children: M.jsx(Q, { style: a && !p ? y :
|
|
3383
|
+
return Q && typeof Q != "string" ? Q && M.jsx("span", { className: "rcb-voice-icon " + (a && !p ? "on" : ""), children: M.jsx(Q, { style: a && !p ? y : k }) }) : M.jsx("span", { className: "rcb-voice-icon" + (a && !p ? "-on" : ""), "data-testid": "rcb-voice-icon", style: a && !p ? y : k });
|
|
3384
3384
|
})() });
|
|
3385
3385
|
}, LA = () => {
|
|
3386
3386
|
var e, t, r, n, o, s, i, a;
|
|
3387
|
-
const { settings: l } = De(), { styles: A } = He(), { textAreaDisabled: c } = at(), [p, f] = x.useState(!1), { handleSubmitText: m } = Xn(), v = { backgroundColor: (e = l.general) == null ? void 0 : e.primaryColor, ...A.sendButtonStyle }, D = { cursor: `url("${(t = l.general) == null ? void 0 : t.actionDisabledIcon}"), auto`, backgroundColor: (r = l.general) == null ? void 0 : r.primaryColor, ...A.sendButtonStyle, ...A.sendButtonDisabledStyle }, y = { backgroundColor: (n = l.general) == null ? void 0 : n.secondaryColor, ...A.sendButtonStyle, ...A.sendButtonHoveredStyle },
|
|
3387
|
+
const { settings: l } = De(), { styles: A } = He(), { textAreaDisabled: c } = at(), [p, f] = x.useState(!1), { handleSubmitText: m } = Xn(), v = { backgroundColor: (e = l.general) == null ? void 0 : e.primaryColor, ...A.sendButtonStyle }, D = { cursor: `url("${(t = l.general) == null ? void 0 : t.actionDisabledIcon}"), auto`, backgroundColor: (r = l.general) == null ? void 0 : r.primaryColor, ...A.sendButtonStyle, ...A.sendButtonDisabledStyle }, y = { backgroundColor: (n = l.general) == null ? void 0 : n.secondaryColor, ...A.sendButtonStyle, ...A.sendButtonHoveredStyle }, k = { backgroundImage: `url(${(o = l.chatInput) == null ? void 0 : o.sendButtonIcon})`, fill: "#fff", ...A.sendIconStyle }, I = { backgroundImage: `url(${(s = l.chatInput) == null ? void 0 : s.sendButtonIcon})`, fill: "#fff", ...A.sendIconStyle, ...A.sendIconDisabledStyle }, E = { backgroundImage: `url(${(i = l.chatInput) == null ? void 0 : i.sendButtonIcon})`, fill: "#fff", ...A.sendIconStyle, ...A.sendIconHoveredStyle };
|
|
3388
3388
|
return M.jsx("div", { "aria-label": ((a = l.ariaLabel) == null ? void 0 : a.sendButton) ?? "send message", role: "button", onMouseEnter: () => {
|
|
3389
3389
|
f(!0);
|
|
3390
3390
|
}, onMouseLeave: () => {
|
|
@@ -3394,7 +3394,7 @@ const hs = () => {
|
|
|
3394
3394
|
}, style: c ? D : p ? y : v, className: "rcb-send-button", children: (() => {
|
|
3395
3395
|
var T;
|
|
3396
3396
|
const _ = (T = l.chatInput) == null ? void 0 : T.sendButtonIcon;
|
|
3397
|
-
return _ && typeof _ != "string" ? _ && M.jsx("span", { className: "rcb-send-icon", "data-testid": "rcb-send-icon", children: M.jsx(_, { style: c ? I : p ? E :
|
|
3397
|
+
return _ && typeof _ != "string" ? _ && M.jsx("span", { className: "rcb-send-icon", "data-testid": "rcb-send-icon", children: M.jsx(_, { style: c ? I : p ? E : k }) }) : M.jsx("span", { className: "rcb-send-icon", "data-testid": "rcb-send-icon", style: c ? I : p ? E : k });
|
|
3398
3398
|
})() });
|
|
3399
3399
|
}, FA = (e, t) => {
|
|
3400
3400
|
var r, n, o, s, i, a, l, A, c;
|
|
@@ -3404,8 +3404,8 @@ const hs = () => {
|
|
|
3404
3404
|
if (f[D]) return f[D];
|
|
3405
3405
|
const y = t[D];
|
|
3406
3406
|
if (typeof y == "function") {
|
|
3407
|
-
const
|
|
3408
|
-
return f[D] =
|
|
3407
|
+
const k = y();
|
|
3408
|
+
return f[D] = k, k;
|
|
3409
3409
|
}
|
|
3410
3410
|
return null;
|
|
3411
3411
|
}
|
|
@@ -3424,12 +3424,12 @@ const hs = () => {
|
|
|
3424
3424
|
if (!m || (p = e.event) != null && p.rcbLoadChatHistory && (await A(le.LOAD_CHAT_HISTORY, {})).defaultPrevented) return;
|
|
3425
3425
|
s(!0);
|
|
3426
3426
|
const v = ((f = l.current) == null ? void 0 : f.scrollHeight) ?? 0;
|
|
3427
|
-
((D, y,
|
|
3427
|
+
((D, y, k, I, E, T, _, Q, O) => {
|
|
3428
3428
|
var U;
|
|
3429
|
-
if (ga = !0,
|
|
3429
|
+
if (ga = !0, k != null) try {
|
|
3430
3430
|
const W = xn(M.jsx(hA, {}), "SYSTEM"), H = E.current.slice(1);
|
|
3431
3431
|
I([W, ...H]);
|
|
3432
|
-
const K =
|
|
3432
|
+
const K = k.map((L) => {
|
|
3433
3433
|
if (L.type === "object") {
|
|
3434
3434
|
const X = va(L.content, D, y);
|
|
3435
3435
|
return { ...L, content: X };
|
|
@@ -3464,22 +3464,22 @@ const hs = () => {
|
|
|
3464
3464
|
}, className: "rcb-view-history-button", role: "button", tabIndex: 0, children: M.jsx("p", { children: (r = n.chatHistory) == null ? void 0 : r.viewChatHistoryButtonText }) }) });
|
|
3465
3465
|
}, UA = () => {
|
|
3466
3466
|
var e, t, r, n;
|
|
3467
|
-
const o = po(), { settings: s } = De(), { replaceMessages: i } = Ln(), { isBotTyping: a, isChatWindowOpen: l, setUnreadCount: A, setSyncedIsChatWindowOpen: c, setSyncedTextAreaDisabled: p, setSyncedAudioToggledOn: f, setSyncedVoiceToggledOn: m, setSyncedIsScrolling: v, syncedIsScrollingRef: D, syncedIsChatWindowOpenRef: y } = at(), { chatBodyRef:
|
|
3467
|
+
const o = po(), { settings: s } = De(), { replaceMessages: i } = Ln(), { isBotTyping: a, isChatWindowOpen: l, setUnreadCount: A, setSyncedIsChatWindowOpen: c, setSyncedTextAreaDisabled: p, setSyncedAudioToggledOn: f, setSyncedVoiceToggledOn: m, setSyncedIsScrolling: v, syncedIsScrollingRef: D, syncedIsChatWindowOpenRef: y } = at(), { chatBodyRef: k } = ot(), { viewportHeight: I, setViewportHeight: E, setViewportWidth: T, scrollToBottom: _ } = _t(), { setUpNotifications: Q } = ps(), { handleFirstInteraction: O } = (() => {
|
|
3468
3468
|
var K;
|
|
3469
3469
|
const { settings: L } = De(), { hasInteractedPage: X, setHasInteractedPage: te, hasFlowStarted: J, setHasFlowStarted: re } = at(), Y = x.useCallback(() => {
|
|
3470
3470
|
var Z;
|
|
3471
3471
|
if (te(!0), !J && ((Z = L.general) == null ? void 0 : Z.flowStartTrigger) === "ON_PAGE_INTERACT" && re(!0), !window.SpeechSynthesisUtterance) return void console.info("Speech Synthesis API is not supported in this environment.");
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3472
|
+
const S = new window.SpeechSynthesisUtterance();
|
|
3473
|
+
S.text = "", S.onend = () => {
|
|
3474
3474
|
window.removeEventListener("click", Y), window.removeEventListener("keydown", Y), window.removeEventListener("touchstart", Y);
|
|
3475
|
-
}, window.speechSynthesis.speak(
|
|
3475
|
+
}, window.speechSynthesis.speak(S);
|
|
3476
3476
|
}, [J, (K = L.general) == null ? void 0 : K.flowStartTrigger]);
|
|
3477
3477
|
return { hasInteractedPage: X, handleFirstInteraction: Y };
|
|
3478
3478
|
})(), { showChatHistory: U } = ys(), W = x.useRef(0), H = x.useRef(!1);
|
|
3479
3479
|
x.useEffect(() => (window.addEventListener("click", O), window.addEventListener("keydown", O), window.addEventListener("touchstart", O), () => {
|
|
3480
3480
|
window.removeEventListener("click", O), window.removeEventListener("keydown", O), window.removeEventListener("touchstart", O);
|
|
3481
3481
|
}), []), x.useEffect(() => {
|
|
3482
|
-
const K =
|
|
3482
|
+
const K = k.current;
|
|
3483
3483
|
if (!K) return;
|
|
3484
3484
|
const L = () => {
|
|
3485
3485
|
H.current || (H.current = !0, requestAnimationFrame(() => {
|
|
@@ -3502,7 +3502,7 @@ const hs = () => {
|
|
|
3502
3502
|
var K;
|
|
3503
3503
|
(K = s.notification) != null && K.disabled || Q();
|
|
3504
3504
|
}, [(e = s.notification) == null ? void 0 : e.disabled]), x.useEffect(() => {
|
|
3505
|
-
!D.current &&
|
|
3505
|
+
!D.current && k != null && k.current && _();
|
|
3506
3506
|
}, [a]), x.useEffect(() => {
|
|
3507
3507
|
var K, L;
|
|
3508
3508
|
if ((K = s.chatHistory) != null && K.disabled) Sn && Sn.removeItem(io);
|
|
@@ -3531,17 +3531,17 @@ const hs = () => {
|
|
|
3531
3531
|
if (o) return;
|
|
3532
3532
|
l && (E((K = window.visualViewport) == null ? void 0 : K.height), T((L = window.visualViewport) == null ? void 0 : L.width));
|
|
3533
3533
|
const J = () => window.scrollTo({ top: 0, left: 0, behavior: "auto" }), re = () => W.current = window.scrollY, Y = () => {
|
|
3534
|
-
var
|
|
3535
|
-
E((
|
|
3534
|
+
var S, ce;
|
|
3535
|
+
E((S = window.visualViewport) == null ? void 0 : S.height), T((ce = window.visualViewport) == null ? void 0 : ce.width);
|
|
3536
3536
|
}, Z = () => {
|
|
3537
|
-
var
|
|
3538
|
-
window.removeEventListener("scroll", J), window.removeEventListener("scroll", re), (
|
|
3537
|
+
var S;
|
|
3538
|
+
window.removeEventListener("scroll", J), window.removeEventListener("scroll", re), (S = window.visualViewport) == null || S.removeEventListener("resize", Y);
|
|
3539
3539
|
};
|
|
3540
3540
|
return l ? (Z(), document.body.style.position = "fixed", window.addEventListener("scroll", J), (X = window.visualViewport) == null || X.addEventListener("resize", Y)) : (document.body.style.position = "static", Z(), window.scrollTo({ top: W.current, left: 0, behavior: "auto" }), window.addEventListener("scroll", re), (te = window.visualViewport) == null || te.removeEventListener("resize", Y)), Z;
|
|
3541
3541
|
}, [l, o]);
|
|
3542
3542
|
}, zA = "https://cdn.jsdelivr.net/gh/react-chatbotify/community-themes/themes", qA = "2592000", ei = "RCB_THEME_CACHE_DATA", ti = async (e, t) => {
|
|
3543
|
-
const { id: r, version: n, baseUrl: o = zA, cacheDuration: s = qA } = t, i = n || await (async (
|
|
3544
|
-
const E = `${I}/${
|
|
3543
|
+
const { id: r, version: n, baseUrl: o = zA, cacheDuration: s = qA } = t, i = n || await (async (k, I) => {
|
|
3544
|
+
const E = `${I}/${k}/meta.json`;
|
|
3545
3545
|
try {
|
|
3546
3546
|
const T = await fetch(E);
|
|
3547
3547
|
return T.ok ? (await T.json()).version : (console.error(`Failed to fetch meta.json from ${E}`), null);
|
|
@@ -3550,19 +3550,19 @@ const hs = () => {
|
|
|
3550
3550
|
}
|
|
3551
3551
|
})(r, o);
|
|
3552
3552
|
if (!i) return console.error(`Unable to find version for theme: ${r}`), { settings: {}, inlineStyles: {}, cssStylesText: "" };
|
|
3553
|
-
const a = ((
|
|
3554
|
-
const T = localStorage.getItem(`${ei}_${
|
|
3553
|
+
const a = ((k, I, E) => {
|
|
3554
|
+
const T = localStorage.getItem(`${ei}_${k}_${I}`);
|
|
3555
3555
|
if (!T) return null;
|
|
3556
3556
|
try {
|
|
3557
3557
|
const _ = JSON.parse(T), Q = (/* @__PURE__ */ new Date()).getTime(), O = Math.floor(Q / 1e3);
|
|
3558
3558
|
return _.cacheDate + E >= O ? _ : null;
|
|
3559
3559
|
} catch (_) {
|
|
3560
|
-
return console.error(`Unable to fetch cache for ${
|
|
3560
|
+
return console.error(`Unable to fetch cache for ${k}`, _), null;
|
|
3561
3561
|
}
|
|
3562
3562
|
})(r, i, s);
|
|
3563
3563
|
if (a) {
|
|
3564
|
-
const
|
|
3565
|
-
return { settings: a.settings, inlineStyles: a.inlineStyles, cssStylesText:
|
|
3564
|
+
const k = ni(e, a.cssStylesText);
|
|
3565
|
+
return { settings: a.settings, inlineStyles: a.inlineStyles, cssStylesText: k };
|
|
3566
3566
|
}
|
|
3567
3567
|
const l = `${o}/${r}/${i}/styles.css`, A = `${o}/${r}/${i}/settings.json`, c = `${o}/${r}/${i}/styles.json`;
|
|
3568
3568
|
let p = "";
|
|
@@ -3573,9 +3573,9 @@ const hs = () => {
|
|
|
3573
3573
|
m.ok ? v = await m.json() : console.info(`Could not fetch settings.json from ${A}`);
|
|
3574
3574
|
const D = await fetch(c);
|
|
3575
3575
|
let y = {};
|
|
3576
|
-
return D.ok ? y = await D.json() : console.info(`Could not fetch styles.json from ${c}`), ((
|
|
3576
|
+
return D.ok ? y = await D.json() : console.info(`Could not fetch styles.json from ${c}`), ((k, I, E, T, _) => {
|
|
3577
3577
|
const Q = (/* @__PURE__ */ new Date()).getTime(), O = { settings: E, inlineStyles: T, cssStylesText: _, cacheDate: Math.floor(Q / 1e3) };
|
|
3578
|
-
localStorage.setItem(`${ei}_${
|
|
3578
|
+
localStorage.setItem(`${ei}_${k}_${I}`, JSON.stringify(O));
|
|
3579
3579
|
})(r, i, v, y, p), { settings: v, inlineStyles: y, cssStylesText: ni(e, p) };
|
|
3580
3580
|
}, ni = (e, t) => t.split(new RegExp("(?<=})")).map((r) => {
|
|
3581
3581
|
const n = r.trim();
|
|
@@ -3659,7 +3659,7 @@ const hs = () => {
|
|
|
3659
3659
|
var I;
|
|
3660
3660
|
(a || ((I = s.general) == null ? void 0 : I.flowStartTrigger) === "ON_LOAD") && m("start");
|
|
3661
3661
|
}, [a, (r = s.general) == null ? void 0 : r.flowStartTrigger]);
|
|
3662
|
-
const
|
|
3662
|
+
const k = x.useMemo(() => {
|
|
3663
3663
|
var I;
|
|
3664
3664
|
const E = "rcb-chatbot-global ";
|
|
3665
3665
|
return (I = s.general) != null && I.embedded ? E + "rcb-window-embedded" : f ? E + "rcb-window-open" : E + "rcb-window-close";
|
|
@@ -3670,7 +3670,7 @@ const hs = () => {
|
|
|
3670
3670
|
})() && M.jsxs("div", { onMouseDown: (I) => {
|
|
3671
3671
|
var E, T;
|
|
3672
3672
|
!a && ((E = s.general) == null ? void 0 : E.flowStartTrigger) === "ON_CHATBOT_INTERACT" && l(!0), o ? (T = A.current) == null || T.blur() : I?.preventDefault();
|
|
3673
|
-
}, className:
|
|
3673
|
+
}, className: k, children: [M.jsx(BA, {}), M.jsx(DA, {}), f && !o && !((n = s.general) != null && n.embedded) && M.jsxs(M.Fragment, { children: [M.jsx("style", { children: `
|
|
3674
3674
|
html {
|
|
3675
3675
|
overflow: hidden !important;
|
|
3676
3676
|
touch-action: none !important;
|
|
@@ -3689,10 +3689,10 @@ const hs = () => {
|
|
|
3689
3689
|
const r = x.useRef(""), n = x.useRef({}), [o, s, i] = Qt({}), [a, l, A] = Qt({}), [c, p] = x.useState(!1);
|
|
3690
3690
|
return x.useEffect(() => {
|
|
3691
3691
|
p(!0);
|
|
3692
|
-
}, []), c ? M.jsx("div", { style: { fontFamily: (t = o.general) == null ? void 0 : t.fontFamily }, children: M.jsx(Pa.Provider, { value: { loadConfig: async (f, m, v, D, y,
|
|
3692
|
+
}, []), c ? M.jsx("div", { style: { fontFamily: (t = o.general) == null ? void 0 : t.fontFamily }, children: M.jsx(Pa.Provider, { value: { loadConfig: async (f, m, v, D, y, k) => {
|
|
3693
3693
|
r.current = f, n.current = m;
|
|
3694
3694
|
const I = await GA(f, v, D, y);
|
|
3695
|
-
|
|
3695
|
+
k.current && (k.current.textContent = I.cssStylesText), s(I.settings), l(I.inlineStyles);
|
|
3696
3696
|
} }, children: M.jsx(Wl, { settings: o, setSyncedSettings: s, syncedSettingsRef: i, children: M.jsx(Vl, { styles: a, setSyncedStyles: l, syncedStylesRef: A, children: M.jsx(SA, { children: M.jsx(Kl, { botIdRef: r, flowRef: n, children: M.jsx(Zl, { children: M.jsx(Xl, { settings: o, children: M.jsx(eA, { children: e }) }) }) }) }) }) }) }) }) : null;
|
|
3697
3697
|
}, VA = ({ id: e, flow: t, settings: r, styles: n, themes: o, plugins: s, setConfigLoaded: i, styleRootRef: a }) => {
|
|
3698
3698
|
const l = x.useMemo(() => e, []), A = Da(), { flowRef: c } = ot();
|
|
@@ -3727,9 +3727,9 @@ const hs = () => {
|
|
|
3727
3727
|
window.open(t);
|
|
3728
3728
|
}, 1e3), "repeat";
|
|
3729
3729
|
} }, repeat: { transition: { duration: 3e3 }, path: "prompt_again" } }, KA = ({ id: e, flow: t, settings: r, styles: n, themes: o, plugins: s, slots: i }) => {
|
|
3730
|
-
const a = x.useMemo(() => e || "rcb-" + so(), []), l = t && Object.keys(t).length !== 0 ? t : YA, A = r || {}, c = n || {}, p = s || [], [f, m] = x.useState(!1), v = Da(), D = x.useRef(null), [y,
|
|
3730
|
+
const a = x.useMemo(() => e || "rcb-" + so(), []), l = t && Object.keys(t).length !== 0 ? t : YA, A = r || {}, c = n || {}, p = s || [], [f, m] = x.useState(!1), v = Da(), D = x.useRef(null), [y, k] = x.useState(o || []);
|
|
3731
3731
|
x.useEffect(() => {
|
|
3732
|
-
o &&
|
|
3732
|
+
o && k(o);
|
|
3733
3733
|
}, [o]);
|
|
3734
3734
|
const I = () => M.jsxs(M.Fragment, { children: [M.jsx(VA, { styleRootRef: D, id: a, flow: l, settings: A, styles: c, themes: y, plugins: p, setConfigLoaded: m }), f && M.jsx(WA, { plugins: s, slots: i })] });
|
|
3735
3735
|
return M.jsxs(v == null ? Ba : M.Fragment, { children: [M.jsx("style", { ref: D }), M.jsx("div", { id: a, children: I() })] });
|
|
@@ -3869,8 +3869,8 @@ let _a = class {
|
|
|
3869
3869
|
if (n[a.inverseName] || !this.isTagAllowed(l) || !this.canRenderChild(t, A)) return;
|
|
3870
3870
|
let c = "";
|
|
3871
3871
|
for (; o && (i = a.match(o)); ) {
|
|
3872
|
-
const { index: p, length: f, match: m, valid: v, void: D, ...y } = i,
|
|
3873
|
-
p > 0 && (c += o.slice(0, p)), v ? (c += D ? `{{{${
|
|
3872
|
+
const { index: p, length: f, match: m, valid: v, void: D, ...y } = i, k = a.propName + String(s);
|
|
3873
|
+
p > 0 && (c += o.slice(0, p)), v ? (c += D ? `{{{${k}/}}}` : `{{{${k}}}}${m}{{{/${k}}}}`, this.keyIndex += 1, s += 1, r[k] = { children: m, matcher: a, props: { ...n, ...y, key: this.keyIndex } }) : c += m, a.greedy ? (o = c + o.slice(p + f), c = "") : o = o.slice(p + (f || m.length));
|
|
3874
3874
|
}
|
|
3875
3875
|
a.greedy || (o = c + o);
|
|
3876
3876
|
}), s === 0 ? e : this.replaceTokens(o, r);
|
|
@@ -3995,11 +3995,11 @@ function Ac(e) {
|
|
|
3995
3995
|
return f || (f = i), p ? V.createElement(V.Fragment, null, f) : V.createElement(Ma, { attributes: r, className: n, tagName: c }, f);
|
|
3996
3996
|
}
|
|
3997
3997
|
function cc(e) {
|
|
3998
|
-
const { attributes: t, className: r, content: n = "", disableFilters: o = !1, disableMatchers: s = !1, emptyContent: i = null, filters: a = [], matchers: l = [], onAfterParse: A = null, onBeforeParse: c = null, tagName: p = "span", noWrap: f = !1, ...m } = e, v = s ? [] : l, D = o ? [] : a, y = c ? [c] : [],
|
|
3998
|
+
const { attributes: t, className: r, content: n = "", disableFilters: o = !1, disableMatchers: s = !1, emptyContent: i = null, filters: a = [], matchers: l = [], onAfterParse: A = null, onBeforeParse: c = null, tagName: p = "span", noWrap: f = !1, ...m } = e, v = s ? [] : l, D = o ? [] : a, y = c ? [c] : [], k = A ? [A] : [];
|
|
3999
3999
|
v.forEach((_) => {
|
|
4000
|
-
_.onBeforeParse && y.push(_.onBeforeParse.bind(_)), _.onAfterParse &&
|
|
4000
|
+
_.onBeforeParse && y.push(_.onBeforeParse.bind(_)), _.onAfterParse && k.push(_.onAfterParse.bind(_));
|
|
4001
4001
|
});
|
|
4002
|
-
const I = y.reduce((_, Q) => Q(_, e), n ?? ""), E = new _a(I, m, v, D), T =
|
|
4002
|
+
const I = y.reduce((_, Q) => Q(_, e), n ?? ""), E = new _a(I, m, v, D), T = k.reduce((_, Q) => Q(_, e), E.parse());
|
|
4003
4003
|
return V.createElement(Ac, { attributes: t, className: r, containerTagName: e.containerTagName, emptyContent: i, noWrap: f, parsedContent: T.length === 0 ? void 0 : T, tagName: p });
|
|
4004
4004
|
}
|
|
4005
4005
|
const uc = ({ children: e }) => M.jsx("div", { style: { whiteSpace: "normal" }, children: M.jsx(cc, { content: typeof e == "string" ? e : "" }) }), dc = { autoConfig: !0 }, ii = (e, t, r) => {
|
|
@@ -4150,7 +4150,7 @@ var Mo, ui, di, zn = {}, Bc = (function() {
|
|
|
4150
4150
|
`);
|
|
4151
4151
|
D = ~K ? W.length - K : D + W.length;
|
|
4152
4152
|
}
|
|
4153
|
-
function
|
|
4153
|
+
function k() {
|
|
4154
4154
|
var W = { line: v, column: D };
|
|
4155
4155
|
return function(H) {
|
|
4156
4156
|
return H.position = new I(W), _(), H;
|
|
@@ -4179,7 +4179,7 @@ var Mo, ui, di, zn = {}, Bc = (function() {
|
|
|
4179
4179
|
return W;
|
|
4180
4180
|
}
|
|
4181
4181
|
function O() {
|
|
4182
|
-
var W =
|
|
4182
|
+
var W = k();
|
|
4183
4183
|
if (f.charAt(0) == "/" && f.charAt(1) == "*") {
|
|
4184
4184
|
for (var H = 2; c != f.charAt(H) && (f.charAt(H) != "*" || f.charAt(H + 1) != "/"); ) ++H;
|
|
4185
4185
|
if (H += 2, c === f.charAt(H - 1)) return E("End of comment missing");
|
|
@@ -4188,7 +4188,7 @@ var Mo, ui, di, zn = {}, Bc = (function() {
|
|
|
4188
4188
|
}
|
|
4189
4189
|
}
|
|
4190
4190
|
function U() {
|
|
4191
|
-
var W =
|
|
4191
|
+
var W = k(), H = T(s);
|
|
4192
4192
|
if (H) {
|
|
4193
4193
|
if (O(), !T(i)) return E("property missing ':'");
|
|
4194
4194
|
var K = T(a), L = W({ type: "declaration", property: p(H[0].replace(r, c)), value: K ? p(K[0].replace(r, c)) : c });
|
|
@@ -4279,8 +4279,8 @@ function Va(e, t, r) {
|
|
|
4279
4279
|
for (D in f.properties) if (D !== "children" && bs.call(f.properties, D)) {
|
|
4280
4280
|
const y = Nc(p, D, f.properties[D]);
|
|
4281
4281
|
if (y) {
|
|
4282
|
-
const [
|
|
4283
|
-
p.tableCellAlignToStyle &&
|
|
4282
|
+
const [k, I] = y;
|
|
4283
|
+
p.tableCellAlignToStyle && k === "align" && typeof I == "string" && Oc.has(f.tagName) ? v = I : m[k] = I;
|
|
4284
4284
|
}
|
|
4285
4285
|
}
|
|
4286
4286
|
return v && ((m.style || (m.style = {}))[p.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = v), m;
|
|
@@ -4308,15 +4308,15 @@ function Va(e, t, r) {
|
|
|
4308
4308
|
D.type;
|
|
4309
4309
|
const y = D.expression;
|
|
4310
4310
|
y.type;
|
|
4311
|
-
const
|
|
4312
|
-
|
|
4311
|
+
const k = y.properties[0];
|
|
4312
|
+
k.type, Object.assign(m, p.evaluater.evaluateExpression(k.argument));
|
|
4313
4313
|
} else pr(p, f.position);
|
|
4314
4314
|
else {
|
|
4315
4315
|
const D = v.name;
|
|
4316
4316
|
let y;
|
|
4317
4317
|
if (v.value && typeof v.value == "object") if (v.value.data && v.value.data.estree && p.evaluater) {
|
|
4318
|
-
const
|
|
4319
|
-
|
|
4318
|
+
const k = v.value.data.estree.body[0];
|
|
4319
|
+
k.type, y = p.evaluater.evaluateExpression(k.expression);
|
|
4320
4320
|
} else pr(p, f.position);
|
|
4321
4321
|
else y = v.value === null || v.value;
|
|
4322
4322
|
m[D] = y;
|
|
@@ -4594,7 +4594,7 @@ const Kc = { tokenize: function(e) {
|
|
|
4594
4594
|
_ = t.events[Q][1].end;
|
|
4595
4595
|
break;
|
|
4596
4596
|
}
|
|
4597
|
-
|
|
4597
|
+
k(i);
|
|
4598
4598
|
let O = T;
|
|
4599
4599
|
for (; O < t.events.length; ) t.events[O][1].end = { ..._ }, O++;
|
|
4600
4600
|
return An(t.events, Q + 1, 0, t.events.slice(T)), t.events.length = O, A(E);
|
|
@@ -4610,7 +4610,7 @@ const Kc = { tokenize: function(e) {
|
|
|
4610
4610
|
return t.containerState = {}, e.check(bi, c, p)(E);
|
|
4611
4611
|
}
|
|
4612
4612
|
function c(E) {
|
|
4613
|
-
return n && I(),
|
|
4613
|
+
return n && I(), k(i), f(E);
|
|
4614
4614
|
}
|
|
4615
4615
|
function p(E) {
|
|
4616
4616
|
return t.parser.lazy[t.now().line] = i !== r.length, s = t.now().offset, v(E);
|
|
@@ -4622,10 +4622,10 @@ const Kc = { tokenize: function(e) {
|
|
|
4622
4622
|
return i++, r.push([t.currentConstruct, t.containerState]), f(E);
|
|
4623
4623
|
}
|
|
4624
4624
|
function v(E) {
|
|
4625
|
-
return E === null ? (n && I(),
|
|
4625
|
+
return E === null ? (n && I(), k(0), void e.consume(E)) : (n = n || t.parser.flow(t.now()), e.enter("chunkFlow", { _tokenizer: n, contentType: "flow", previous: o }), D(E));
|
|
4626
4626
|
}
|
|
4627
4627
|
function D(E) {
|
|
4628
|
-
return E === null ? (y(e.exit("chunkFlow"), !0),
|
|
4628
|
+
return E === null ? (y(e.exit("chunkFlow"), !0), k(0), void e.consume(E)) : ye(E) ? (e.consume(E), y(e.exit("chunkFlow")), i = 0, t.interrupt = void 0, a) : (e.consume(E), D);
|
|
4629
4629
|
}
|
|
4630
4630
|
function y(E, T) {
|
|
4631
4631
|
const _ = t.sliceStream(E);
|
|
@@ -4641,11 +4641,11 @@ const Kc = { tokenize: function(e) {
|
|
|
4641
4641
|
}
|
|
4642
4642
|
U = !0;
|
|
4643
4643
|
}
|
|
4644
|
-
for (
|
|
4644
|
+
for (k(i), Q = O; Q < t.events.length; ) t.events[Q][1].end = { ...W }, Q++;
|
|
4645
4645
|
An(t.events, H + 1, 0, t.events.slice(O)), t.events.length = Q;
|
|
4646
4646
|
}
|
|
4647
4647
|
}
|
|
4648
|
-
function
|
|
4648
|
+
function k(E) {
|
|
4649
4649
|
let T = r.length;
|
|
4650
4650
|
for (; T-- > E; ) {
|
|
4651
4651
|
const _ = r[T];
|
|
@@ -4847,10 +4847,10 @@ const Jc = { name: "autolink", tokenize: function(e, t, r) {
|
|
|
4847
4847
|
return i > 0 && Fe(E) ? We(e, y, "linePrefix", i + 1)(E) : y(E);
|
|
4848
4848
|
}
|
|
4849
4849
|
function y(E) {
|
|
4850
|
-
return E === null || ye(E) ? e.check(ki, m, I)(E) : (e.enter("codeFlowValue"),
|
|
4850
|
+
return E === null || ye(E) ? e.check(ki, m, I)(E) : (e.enter("codeFlowValue"), k(E));
|
|
4851
4851
|
}
|
|
4852
|
-
function
|
|
4853
|
-
return E === null || ye(E) ? (e.exit("codeFlowValue"), y(E)) : (e.consume(E),
|
|
4852
|
+
function k(E) {
|
|
4853
|
+
return E === null || ye(E) ? (e.exit("codeFlowValue"), y(E)) : (e.consume(E), k);
|
|
4854
4854
|
}
|
|
4855
4855
|
function I(E) {
|
|
4856
4856
|
return e.exit("codeFenced"), t(E);
|
|
@@ -4995,8 +4995,8 @@ function tu(e, t) {
|
|
|
4995
4995
|
}
|
|
4996
4996
|
for (m = r; ++f < a.length; ) a[f][0] === "exit" && a[f - 1][0] === "enter" && a[f][1].type === a[f - 1][1].type && a[f][1].start.line !== a[f][1].end.line && (D = f + 1, y.push(D), m._tokenizer = void 0, m.previous = void 0, m = m.next);
|
|
4997
4997
|
for (i.events = [], m ? (m._tokenizer = void 0, m.previous = void 0) : y.pop(), f = y.length; f--; ) {
|
|
4998
|
-
const
|
|
4999
|
-
l.push([I, I +
|
|
4998
|
+
const k = a.slice(y[f], y[f + 1]), I = s.pop();
|
|
4999
|
+
l.push([I, I + k.length - 1]), e.splice(I, 2, k);
|
|
5000
5000
|
}
|
|
5001
5001
|
for (l.reverse(), f = -1; ++f < l.length; ) A[v + l[f][0]] = v + l[f][1], v += l[f][1] - l[f][0] - 1;
|
|
5002
5002
|
return A;
|
|
@@ -5188,7 +5188,7 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5188
5188
|
function v(B) {
|
|
5189
5189
|
if (B === null || B === 47 || B === 62 || St(B)) {
|
|
5190
5190
|
const ae = B === 47, fe = i.toLowerCase();
|
|
5191
|
-
return ae || s || !Ci.includes(fe) ? lu.includes(i.toLowerCase()) ? (o = 6, ae ? (e.consume(B), D) : n.interrupt ? t(B) : H(B)) : (o = 7, n.interrupt && !n.parser.lazy[n.now().line] ? r(B) : s ? y(B) :
|
|
5191
|
+
return ae || s || !Ci.includes(fe) ? lu.includes(i.toLowerCase()) ? (o = 6, ae ? (e.consume(B), D) : n.interrupt ? t(B) : H(B)) : (o = 7, n.interrupt && !n.parser.lazy[n.now().line] ? r(B) : s ? y(B) : k(B)) : (o = 1, n.interrupt ? t(B) : H(B));
|
|
5192
5192
|
}
|
|
5193
5193
|
return B === 45 || Mt(B) ? (e.consume(B), i += String.fromCharCode(B), v) : r(B);
|
|
5194
5194
|
}
|
|
@@ -5198,14 +5198,14 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5198
5198
|
function y(B) {
|
|
5199
5199
|
return Fe(B) ? (e.consume(B), y) : U(B);
|
|
5200
5200
|
}
|
|
5201
|
-
function
|
|
5202
|
-
return B === 47 ? (e.consume(B), U) : B === 58 || B === 95 || an(B) ? (e.consume(B), I) : Fe(B) ? (e.consume(B),
|
|
5201
|
+
function k(B) {
|
|
5202
|
+
return B === 47 ? (e.consume(B), U) : B === 58 || B === 95 || an(B) ? (e.consume(B), I) : Fe(B) ? (e.consume(B), k) : U(B);
|
|
5203
5203
|
}
|
|
5204
5204
|
function I(B) {
|
|
5205
5205
|
return B === 45 || B === 46 || B === 58 || B === 95 || Mt(B) ? (e.consume(B), I) : E(B);
|
|
5206
5206
|
}
|
|
5207
5207
|
function E(B) {
|
|
5208
|
-
return B === 61 ? (e.consume(B), T) : Fe(B) ? (e.consume(B), E) :
|
|
5208
|
+
return B === 61 ? (e.consume(B), T) : Fe(B) ? (e.consume(B), E) : k(B);
|
|
5209
5209
|
}
|
|
5210
5210
|
function T(B) {
|
|
5211
5211
|
return B === null || B === 60 || B === 61 || B === 62 || B === 96 ? r(B) : B === 34 || B === 39 ? (e.consume(B), l = B, _) : Fe(B) ? (e.consume(B), T) : Q(B);
|
|
@@ -5217,7 +5217,7 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5217
5217
|
return B === null || B === 34 || B === 39 || B === 47 || B === 60 || B === 61 || B === 62 || B === 96 || St(B) ? E(B) : (e.consume(B), Q);
|
|
5218
5218
|
}
|
|
5219
5219
|
function O(B) {
|
|
5220
|
-
return B === 47 || B === 62 || Fe(B) ?
|
|
5220
|
+
return B === 47 || B === 62 || Fe(B) ? k(B) : r(B);
|
|
5221
5221
|
}
|
|
5222
5222
|
function U(B) {
|
|
5223
5223
|
return B === 62 ? (e.consume(B), W) : r(B);
|
|
@@ -5226,7 +5226,7 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5226
5226
|
return B === null || ye(B) ? H(B) : Fe(B) ? (e.consume(B), W) : r(B);
|
|
5227
5227
|
}
|
|
5228
5228
|
function H(B) {
|
|
5229
|
-
return B === 45 && o === 2 ? (e.consume(B), te) : B === 60 && o === 1 ? (e.consume(B), J) : B === 62 && o === 4 ? (e.consume(B),
|
|
5229
|
+
return B === 45 && o === 2 ? (e.consume(B), te) : B === 60 && o === 1 ? (e.consume(B), J) : B === 62 && o === 4 ? (e.consume(B), S) : B === 63 && o === 3 ? (e.consume(B), Z) : B === 93 && o === 5 ? (e.consume(B), Y) : !ye(B) || o !== 6 && o !== 7 ? B === null || ye(B) ? (e.exit("htmlFlowData"), K(B)) : (e.consume(B), H) : (e.exit("htmlFlowData"), e.check(cu, ce, K)(B));
|
|
5230
5230
|
}
|
|
5231
5231
|
function K(B) {
|
|
5232
5232
|
return e.check(uu, L, ce)(B);
|
|
@@ -5246,7 +5246,7 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5246
5246
|
function re(B) {
|
|
5247
5247
|
if (B === 62) {
|
|
5248
5248
|
const ae = i.toLowerCase();
|
|
5249
|
-
return Ci.includes(ae) ? (e.consume(B),
|
|
5249
|
+
return Ci.includes(ae) ? (e.consume(B), S) : H(B);
|
|
5250
5250
|
}
|
|
5251
5251
|
return an(B) && i.length < 8 ? (e.consume(B), i += String.fromCharCode(B), re) : H(B);
|
|
5252
5252
|
}
|
|
@@ -5254,10 +5254,10 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5254
5254
|
return B === 93 ? (e.consume(B), Z) : H(B);
|
|
5255
5255
|
}
|
|
5256
5256
|
function Z(B) {
|
|
5257
|
-
return B === 62 ? (e.consume(B),
|
|
5257
|
+
return B === 62 ? (e.consume(B), S) : B === 45 && o === 2 ? (e.consume(B), Z) : H(B);
|
|
5258
5258
|
}
|
|
5259
|
-
function
|
|
5260
|
-
return B === null || ye(B) ? (e.exit("htmlFlowData"), ce(B)) : (e.consume(B),
|
|
5259
|
+
function S(B) {
|
|
5260
|
+
return B === null || ye(B) ? (e.exit("htmlFlowData"), ce(B)) : (e.consume(B), S);
|
|
5261
5261
|
}
|
|
5262
5262
|
function ce(B) {
|
|
5263
5263
|
return e.exit("htmlFlow"), t(B);
|
|
@@ -5277,92 +5277,92 @@ const ou = { name: "definition", tokenize: function(e, t, r) {
|
|
|
5277
5277
|
} }, du = { name: "htmlText", tokenize: function(e, t, r) {
|
|
5278
5278
|
const n = this;
|
|
5279
5279
|
let o, s, i;
|
|
5280
|
-
return function(
|
|
5281
|
-
return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(
|
|
5280
|
+
return function(S) {
|
|
5281
|
+
return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(S), a;
|
|
5282
5282
|
};
|
|
5283
|
-
function a(
|
|
5284
|
-
return
|
|
5283
|
+
function a(S) {
|
|
5284
|
+
return S === 33 ? (e.consume(S), l) : S === 47 ? (e.consume(S), T) : S === 63 ? (e.consume(S), I) : an(S) ? (e.consume(S), O) : r(S);
|
|
5285
5285
|
}
|
|
5286
|
-
function l(
|
|
5287
|
-
return
|
|
5286
|
+
function l(S) {
|
|
5287
|
+
return S === 45 ? (e.consume(S), A) : S === 91 ? (e.consume(S), s = 0, m) : an(S) ? (e.consume(S), k) : r(S);
|
|
5288
5288
|
}
|
|
5289
|
-
function A(
|
|
5290
|
-
return
|
|
5289
|
+
function A(S) {
|
|
5290
|
+
return S === 45 ? (e.consume(S), f) : r(S);
|
|
5291
5291
|
}
|
|
5292
|
-
function c(
|
|
5293
|
-
return
|
|
5292
|
+
function c(S) {
|
|
5293
|
+
return S === null ? r(S) : S === 45 ? (e.consume(S), p) : ye(S) ? (i = c, re(S)) : (e.consume(S), c);
|
|
5294
5294
|
}
|
|
5295
|
-
function p(
|
|
5296
|
-
return
|
|
5295
|
+
function p(S) {
|
|
5296
|
+
return S === 45 ? (e.consume(S), f) : c(S);
|
|
5297
5297
|
}
|
|
5298
|
-
function f(
|
|
5299
|
-
return
|
|
5298
|
+
function f(S) {
|
|
5299
|
+
return S === 62 ? J(S) : S === 45 ? p(S) : c(S);
|
|
5300
5300
|
}
|
|
5301
|
-
function m(
|
|
5302
|
-
return
|
|
5301
|
+
function m(S) {
|
|
5302
|
+
return S === "CDATA[".charCodeAt(s++) ? (e.consume(S), s === 6 ? v : m) : r(S);
|
|
5303
5303
|
}
|
|
5304
|
-
function v(
|
|
5305
|
-
return
|
|
5304
|
+
function v(S) {
|
|
5305
|
+
return S === null ? r(S) : S === 93 ? (e.consume(S), D) : ye(S) ? (i = v, re(S)) : (e.consume(S), v);
|
|
5306
5306
|
}
|
|
5307
|
-
function D(
|
|
5308
|
-
return
|
|
5307
|
+
function D(S) {
|
|
5308
|
+
return S === 93 ? (e.consume(S), y) : v(S);
|
|
5309
5309
|
}
|
|
5310
|
-
function y(
|
|
5311
|
-
return
|
|
5310
|
+
function y(S) {
|
|
5311
|
+
return S === 62 ? J(S) : S === 93 ? (e.consume(S), y) : v(S);
|
|
5312
5312
|
}
|
|
5313
|
-
function S
|
|
5314
|
-
return
|
|
5313
|
+
function k(S) {
|
|
5314
|
+
return S === null || S === 62 ? J(S) : ye(S) ? (i = k, re(S)) : (e.consume(S), k);
|
|
5315
5315
|
}
|
|
5316
|
-
function I(
|
|
5317
|
-
return
|
|
5316
|
+
function I(S) {
|
|
5317
|
+
return S === null ? r(S) : S === 63 ? (e.consume(S), E) : ye(S) ? (i = I, re(S)) : (e.consume(S), I);
|
|
5318
5318
|
}
|
|
5319
|
-
function E(
|
|
5320
|
-
return
|
|
5319
|
+
function E(S) {
|
|
5320
|
+
return S === 62 ? J(S) : I(S);
|
|
5321
5321
|
}
|
|
5322
|
-
function T(
|
|
5323
|
-
return an(
|
|
5322
|
+
function T(S) {
|
|
5323
|
+
return an(S) ? (e.consume(S), _) : r(S);
|
|
5324
5324
|
}
|
|
5325
|
-
function _(
|
|
5326
|
-
return
|
|
5325
|
+
function _(S) {
|
|
5326
|
+
return S === 45 || Mt(S) ? (e.consume(S), _) : Q(S);
|
|
5327
5327
|
}
|
|
5328
|
-
function Q(
|
|
5329
|
-
return ye(
|
|
5328
|
+
function Q(S) {
|
|
5329
|
+
return ye(S) ? (i = Q, re(S)) : Fe(S) ? (e.consume(S), Q) : J(S);
|
|
5330
5330
|
}
|
|
5331
|
-
function O(
|
|
5332
|
-
return
|
|
5331
|
+
function O(S) {
|
|
5332
|
+
return S === 45 || Mt(S) ? (e.consume(S), O) : S === 47 || S === 62 || St(S) ? U(S) : r(S);
|
|
5333
5333
|
}
|
|
5334
|
-
function U(
|
|
5335
|
-
return
|
|
5334
|
+
function U(S) {
|
|
5335
|
+
return S === 47 ? (e.consume(S), J) : S === 58 || S === 95 || an(S) ? (e.consume(S), W) : ye(S) ? (i = U, re(S)) : Fe(S) ? (e.consume(S), U) : J(S);
|
|
5336
5336
|
}
|
|
5337
|
-
function W(
|
|
5338
|
-
return
|
|
5337
|
+
function W(S) {
|
|
5338
|
+
return S === 45 || S === 46 || S === 58 || S === 95 || Mt(S) ? (e.consume(S), W) : H(S);
|
|
5339
5339
|
}
|
|
5340
|
-
function H(
|
|
5341
|
-
return
|
|
5340
|
+
function H(S) {
|
|
5341
|
+
return S === 61 ? (e.consume(S), K) : ye(S) ? (i = H, re(S)) : Fe(S) ? (e.consume(S), H) : U(S);
|
|
5342
5342
|
}
|
|
5343
|
-
function K(
|
|
5344
|
-
return
|
|
5343
|
+
function K(S) {
|
|
5344
|
+
return S === null || S === 60 || S === 61 || S === 62 || S === 96 ? r(S) : S === 34 || S === 39 ? (e.consume(S), o = S, L) : ye(S) ? (i = K, re(S)) : Fe(S) ? (e.consume(S), K) : (e.consume(S), X);
|
|
5345
5345
|
}
|
|
5346
|
-
function L(
|
|
5347
|
-
return
|
|
5346
|
+
function L(S) {
|
|
5347
|
+
return S === o ? (e.consume(S), o = void 0, te) : S === null ? r(S) : ye(S) ? (i = L, re(S)) : (e.consume(S), L);
|
|
5348
5348
|
}
|
|
5349
|
-
function X(
|
|
5350
|
-
return
|
|
5349
|
+
function X(S) {
|
|
5350
|
+
return S === null || S === 34 || S === 39 || S === 60 || S === 61 || S === 96 ? r(S) : S === 47 || S === 62 || St(S) ? U(S) : (e.consume(S), X);
|
|
5351
5351
|
}
|
|
5352
|
-
function te(
|
|
5353
|
-
return
|
|
5352
|
+
function te(S) {
|
|
5353
|
+
return S === 47 || S === 62 || St(S) ? U(S) : r(S);
|
|
5354
5354
|
}
|
|
5355
|
-
function J(
|
|
5356
|
-
return
|
|
5355
|
+
function J(S) {
|
|
5356
|
+
return S === 62 ? (e.consume(S), e.exit("htmlTextData"), e.exit("htmlText"), t) : r(S);
|
|
5357
5357
|
}
|
|
5358
|
-
function re(
|
|
5359
|
-
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(
|
|
5358
|
+
function re(S) {
|
|
5359
|
+
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(S), e.exit("lineEnding"), Y;
|
|
5360
5360
|
}
|
|
5361
|
-
function Y(
|
|
5362
|
-
return Fe(
|
|
5361
|
+
function Y(S) {
|
|
5362
|
+
return Fe(S) ? We(e, Z, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(S) : Z(S);
|
|
5363
5363
|
}
|
|
5364
|
-
function Z(
|
|
5365
|
-
return e.enter("htmlTextData"), i(
|
|
5364
|
+
function Z(S) {
|
|
5365
|
+
return e.enter("htmlTextData"), i(S);
|
|
5366
5366
|
}
|
|
5367
5367
|
} }, ks = { name: "labelEnd", resolveAll: function(e) {
|
|
5368
5368
|
let t = -1;
|
|
@@ -5645,7 +5645,7 @@ function Mu(e, t, r) {
|
|
|
5645
5645
|
const l = { attempt: D(function(I, E) {
|
|
5646
5646
|
y(I, E.from);
|
|
5647
5647
|
}), check: D(v), consume: function(I) {
|
|
5648
|
-
ye(I) ? (n.line++, n.column = 1, n.offset += I === -3 ? 2 : 1,
|
|
5648
|
+
ye(I) ? (n.line++, n.column = 1, n.offset += I === -3 ? 2 : 1, k()) : I !== -1 && (n.column++, n.offset++), n._bufferIndex < 0 ? n._index++ : (n._bufferIndex++, n._bufferIndex === i[n._index].length && (n._bufferIndex = -1, n._index++)), A.previous = I;
|
|
5649
5649
|
}, enter: function(I, E) {
|
|
5650
5650
|
const T = E || {};
|
|
5651
5651
|
return T.type = I, T.start = f(), A.events.push(["enter", T, A]), a.push(T), T;
|
|
@@ -5653,7 +5653,7 @@ function Mu(e, t, r) {
|
|
|
5653
5653
|
const E = a.pop();
|
|
5654
5654
|
return E.end = f(), A.events.push(["exit", E, A]), E;
|
|
5655
5655
|
}, interrupt: D(v, { interrupt: !0 }) }, A = { code: null, containerState: {}, defineSkip: function(I) {
|
|
5656
|
-
o[I.line] = I.column,
|
|
5656
|
+
o[I.line] = I.column, k();
|
|
5657
5657
|
}, events: [], now: f, parser: e, previous: null, sliceSerialize: function(I, E) {
|
|
5658
5658
|
return (function(T, _) {
|
|
5659
5659
|
let Q = -1;
|
|
@@ -5732,8 +5732,8 @@ function Mu(e, t, r) {
|
|
|
5732
5732
|
return Array.isArray(T) ? K(T) : "tokenize" in T ? K([T]) : /* @__PURE__ */ (function(J) {
|
|
5733
5733
|
return re;
|
|
5734
5734
|
function re(Y) {
|
|
5735
|
-
const Z = Y !== null && J[Y],
|
|
5736
|
-
return K([...Array.isArray(Z) ? Z : Z ? [Z] : [], ...Array.isArray(
|
|
5735
|
+
const Z = Y !== null && J[Y], S = Y !== null && J.null;
|
|
5736
|
+
return K([...Array.isArray(Z) ? Z : Z ? [Z] : [], ...Array.isArray(S) ? S : S ? [S] : []])(Y);
|
|
5737
5737
|
}
|
|
5738
5738
|
})(T);
|
|
5739
5739
|
function K(J) {
|
|
@@ -5742,10 +5742,10 @@ function Mu(e, t, r) {
|
|
|
5742
5742
|
function L(J) {
|
|
5743
5743
|
return function(re) {
|
|
5744
5744
|
return H = (function() {
|
|
5745
|
-
const Y = f(), Z = A.previous,
|
|
5745
|
+
const Y = f(), Z = A.previous, S = A.currentConstruct, ce = A.events.length, B = Array.from(a);
|
|
5746
5746
|
return { from: ce, restore: ae };
|
|
5747
5747
|
function ae() {
|
|
5748
|
-
n = Y, A.previous = Z, A.currentConstruct =
|
|
5748
|
+
n = Y, A.previous = Z, A.currentConstruct = S, A.events.length = ce, a = B, k();
|
|
5749
5749
|
}
|
|
5750
5750
|
})(), W = J, J.partial || (A.currentConstruct = J), J.name && A.parser.constructs.disable.null.includes(J.name) ? te() : J.tokenize.call(E ? Object.assign(Object.create(A), E) : A, l, X, te)(re);
|
|
5751
5751
|
};
|
|
@@ -5761,7 +5761,7 @@ function Mu(e, t, r) {
|
|
|
5761
5761
|
function y(I, E) {
|
|
5762
5762
|
I.resolveAll && !s.includes(I) && s.push(I), I.resolve && An(A.events, E, A.events.length - E, I.resolve(A.events.slice(E), A)), I.resolveTo && (A.events = I.resolveTo(A.events, A));
|
|
5763
5763
|
}
|
|
5764
|
-
function
|
|
5764
|
+
function k() {
|
|
5765
5765
|
n.line in o && n.column < 2 && (n.column = o[n.line], n.offset += o[n.line] - 1);
|
|
5766
5766
|
}
|
|
5767
5767
|
}
|
|
@@ -5777,7 +5777,7 @@ function Ou(e, t, r) {
|
|
|
5777
5777
|
const sl = {}.hasOwnProperty;
|
|
5778
5778
|
function Ru(e, t, r) {
|
|
5779
5779
|
return typeof t != "string" && (r = t, t = void 0), (function(n) {
|
|
5780
|
-
const o = { transforms: [], canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"], enter: { autolink: l(_e), autolinkProtocol: L, autolinkEmail: L, atxHeading: l(Le), blockQuote: l(oe), characterEscape: L, characterReference: L, codeFenced: l(Ee), codeFencedFenceInfo: A, codeFencedFenceMeta: A, codeIndented: l(Ee, A), codeText: l(we, A), codeTextData: L, data: L, codeFlowValue: L, definition: l(Ne), definitionDestinationString: A, definitionLabelString: A, definitionTitleString: A, emphasis: l(Qe), hardBreakEscape: l(Ue), hardBreakTrailing: l(Ue), htmlFlow: l(Ze, A), htmlFlowData: L, htmlText: l(Ze, A), htmlTextData: L, image: l(zt), label: A, link: l(_e), listItem: l(qt), listItemValue: D, listOrdered: l(xe, v), listUnordered: l(xe), paragraph: l(ht), reference: Oe, referenceString: A, resourceDestinationString: A, resourceTitleString: A, setextHeading: l(Le), strong: l(Gt), thematicBreak: l(lt) }, exit: { atxHeading: p(), atxHeadingSequence: U, autolink: p(), autolinkEmail: ie, autolinkProtocol: Je, blockQuote: p(), characterEscapeValue: X, characterReferenceMarkerHexadecimal: nt, characterReferenceMarkerNumeric: nt, characterReferenceValue: Re, characterReference: je, codeFenced: p(E), codeFencedFence: I, codeFencedFenceInfo: y, codeFencedFenceMeta:
|
|
5780
|
+
const o = { transforms: [], canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"], enter: { autolink: l(_e), autolinkProtocol: L, autolinkEmail: L, atxHeading: l(Le), blockQuote: l(oe), characterEscape: L, characterReference: L, codeFenced: l(Ee), codeFencedFenceInfo: A, codeFencedFenceMeta: A, codeIndented: l(Ee, A), codeText: l(we, A), codeTextData: L, data: L, codeFlowValue: L, definition: l(Ne), definitionDestinationString: A, definitionLabelString: A, definitionTitleString: A, emphasis: l(Qe), hardBreakEscape: l(Ue), hardBreakTrailing: l(Ue), htmlFlow: l(Ze, A), htmlFlowData: L, htmlText: l(Ze, A), htmlTextData: L, image: l(zt), label: A, link: l(_e), listItem: l(qt), listItemValue: D, listOrdered: l(xe, v), listUnordered: l(xe), paragraph: l(ht), reference: Oe, referenceString: A, resourceDestinationString: A, resourceTitleString: A, setextHeading: l(Le), strong: l(Gt), thematicBreak: l(lt) }, exit: { atxHeading: p(), atxHeadingSequence: U, autolink: p(), autolinkEmail: ie, autolinkProtocol: Je, blockQuote: p(), characterEscapeValue: X, characterReferenceMarkerHexadecimal: nt, characterReferenceMarkerNumeric: nt, characterReferenceValue: Re, characterReference: je, codeFenced: p(E), codeFencedFence: I, codeFencedFenceInfo: y, codeFencedFenceMeta: k, codeFlowValue: X, codeIndented: p(T), codeText: p(Z), codeTextData: X, data: X, definition: p(), definitionDestinationString: O, definitionLabelString: _, definitionTitleString: Q, emphasis: p(), hardBreakEscape: p(J), hardBreakTrailing: p(J), htmlFlow: p(re), htmlFlowData: X, htmlText: p(Y), htmlTextData: X, image: p(ce), label: ae, labelText: B, lineEnding: te, link: p(S), listItem: p(), listOrdered: p(), listUnordered: p(), paragraph: p(), referenceString: Ie, resourceDestinationString: fe, resourceTitleString: de, resource: be, setextHeading: p(K), setextHeadingLineSequence: H, setextHeadingText: W, strong: p(), thematicBreak: p() } };
|
|
5781
5781
|
il(o, (n || {}).mdastExtensions || []);
|
|
5782
5782
|
const s = {};
|
|
5783
5783
|
return i;
|
|
@@ -5877,7 +5877,7 @@ function Ru(e, t, r) {
|
|
|
5877
5877
|
const z = this.resume();
|
|
5878
5878
|
this.stack[this.stack.length - 1].lang = z;
|
|
5879
5879
|
}
|
|
5880
|
-
function
|
|
5880
|
+
function k() {
|
|
5881
5881
|
const z = this.resume();
|
|
5882
5882
|
this.stack[this.stack.length - 1].meta = z;
|
|
5883
5883
|
}
|
|
@@ -5950,7 +5950,7 @@ function Ru(e, t, r) {
|
|
|
5950
5950
|
const z = this.resume();
|
|
5951
5951
|
this.stack[this.stack.length - 1].value = z;
|
|
5952
5952
|
}
|
|
5953
|
-
function
|
|
5953
|
+
function S() {
|
|
5954
5954
|
const z = this.stack[this.stack.length - 1];
|
|
5955
5955
|
if (this.data.inReference) {
|
|
5956
5956
|
const Ae = this.data.referenceType || "shortcut";
|
|
@@ -6452,7 +6452,7 @@ const Mi = typeof self == "object" ? self : globalThis, _i = (e) => (/* @__PURE_
|
|
|
6452
6452
|
}
|
|
6453
6453
|
case 5: {
|
|
6454
6454
|
const v = [], D = l([p, v], c);
|
|
6455
|
-
for (const [y,
|
|
6455
|
+
for (const [y, k] of c) (o || !Kr(ur(y)) && !Kr(ur(k))) && v.push([A(y), A(k)]);
|
|
6456
6456
|
return D;
|
|
6457
6457
|
}
|
|
6458
6458
|
case 6: {
|
|
@@ -6529,13 +6529,13 @@ function Vu(e, t, r, n) {
|
|
|
6529
6529
|
return f;
|
|
6530
6530
|
function f() {
|
|
6531
6531
|
let m, v, D, y = Ri;
|
|
6532
|
-
if ((!t || s(l, A, c[c.length - 1] || void 0)) && (y = (function(
|
|
6533
|
-
return Array.isArray(
|
|
6532
|
+
if ((!t || s(l, A, c[c.length - 1] || void 0)) && (y = (function(k) {
|
|
6533
|
+
return Array.isArray(k) ? k : typeof k == "number" ? [Wu, k] : k == null ? Ri : [k];
|
|
6534
6534
|
})(r(l, c)), y[0] === Ni)) return y;
|
|
6535
6535
|
if ("children" in l && l.children) {
|
|
6536
|
-
const
|
|
6537
|
-
if (
|
|
6538
|
-
const I =
|
|
6536
|
+
const k = l;
|
|
6537
|
+
if (k.children && y[0] !== "skip") for (v = (n ? k.children.length : -1) + i, D = c.concat(k); v > -1 && v < k.children.length; ) {
|
|
6538
|
+
const I = k.children[v];
|
|
6539
6539
|
if (m = a(I, v, D)(), m[0] === Ni) return m;
|
|
6540
6540
|
v = typeof m[1] == "number" ? m[1] : v + i;
|
|
6541
6541
|
}
|
|
@@ -6628,9 +6628,9 @@ function Fi(e, t) {
|
|
|
6628
6628
|
for (; ++v < i.footnoteOrder.length; ) {
|
|
6629
6629
|
const D = i.footnoteById.get(i.footnoteOrder[v]);
|
|
6630
6630
|
if (!D) continue;
|
|
6631
|
-
const y = i.all(D),
|
|
6631
|
+
const y = i.all(D), k = String(D.identifier).toUpperCase(), I = Wn(k.toLowerCase());
|
|
6632
6632
|
let E = 0;
|
|
6633
|
-
const T = [], _ = i.footnoteCounts.get(
|
|
6633
|
+
const T = [], _ = i.footnoteCounts.get(k);
|
|
6634
6634
|
for (; _ !== void 0 && ++E <= _; ) {
|
|
6635
6635
|
T.length > 0 && T.push({ type: "text", value: " " });
|
|
6636
6636
|
let U = typeof l == "string" ? l : l(v, E);
|
|
@@ -6683,8 +6683,8 @@ var Fo, Hi, td = (function() {
|
|
|
6683
6683
|
return l[A];
|
|
6684
6684
|
};
|
|
6685
6685
|
return Fo = function l() {
|
|
6686
|
-
var A, c, p, f, m, v, D = arguments[0], y = 1,
|
|
6687
|
-
for (typeof D == "boolean" && (I = D, D = arguments[1] || {}, y = 2), (D == null || typeof D != "object" && typeof D != "function") && (D = {}); y <
|
|
6686
|
+
var A, c, p, f, m, v, D = arguments[0], y = 1, k = arguments.length, I = !1;
|
|
6687
|
+
for (typeof D == "boolean" && (I = D, D = arguments[1] || {}, y = 2), (D == null || typeof D != "object" && typeof D != "function") && (D = {}); y < k; ++y) if ((A = arguments[y]) != null) for (c in A) p = a(D, c), D !== (f = a(A, c)) && (I && f && (s(f) || (m = o(f))) ? (m ? (m = !1, v = p && o(p) ? p : []) : v = p && s(p) ? p : {}, i(D, { name: c, newValue: l(I, v, f) })) : typeof f < "u" && i(D, { name: c, newValue: f }));
|
|
6688
6688
|
return D;
|
|
6689
6689
|
}, Fo;
|
|
6690
6690
|
})();
|
|
@@ -6709,19 +6709,19 @@ function nd() {
|
|
|
6709
6709
|
let f;
|
|
6710
6710
|
return m;
|
|
6711
6711
|
function m(...y) {
|
|
6712
|
-
const
|
|
6712
|
+
const k = c.length > y.length;
|
|
6713
6713
|
let I;
|
|
6714
|
-
|
|
6714
|
+
k && y.push(v);
|
|
6715
6715
|
try {
|
|
6716
6716
|
I = c.apply(this, y);
|
|
6717
6717
|
} catch (E) {
|
|
6718
|
-
if (
|
|
6718
|
+
if (k && f) throw E;
|
|
6719
6719
|
return v(E);
|
|
6720
6720
|
}
|
|
6721
|
-
|
|
6721
|
+
k || (I && I.then && typeof I.then == "function" ? I.then(D, v) : I instanceof Error ? v(I) : D(I));
|
|
6722
6722
|
}
|
|
6723
|
-
function v(y, ...
|
|
6724
|
-
f || (f = !0, p(y, ...
|
|
6723
|
+
function v(y, ...k) {
|
|
6724
|
+
f || (f = !0, p(y, ...k));
|
|
6725
6725
|
}
|
|
6726
6726
|
function D(y) {
|
|
6727
6727
|
v(null, y);
|
|
@@ -7080,21 +7080,21 @@ const Gi = [], Wi = { allowDangerousHtml: !0 }, ld = /^(https?|ircs?|mailto|xmpp
|
|
|
7080
7080
|
function cd(e) {
|
|
7081
7081
|
const t = e.allowedElements, r = e.allowElement, n = e.children || "", o = e.className, s = e.components, i = e.disallowedElements, a = e.rehypePlugins || Gi, l = e.remarkPlugins || Gi, A = e.remarkRehypeOptions ? { ...e.remarkRehypeOptions, ...Wi } : Wi, c = e.skipHtml, p = e.unwrapDisallowed, f = e.urlTransform || ud, m = ad().use(Lu).use(l).use(ed, A).use(a), v = new Al();
|
|
7082
7082
|
typeof n == "string" && (v.value = n);
|
|
7083
|
-
for (const
|
|
7083
|
+
for (const k of Ad) Object.hasOwn(e, k.from) && (k.from, k.to && k.to, k.id);
|
|
7084
7084
|
const D = m.parse(v);
|
|
7085
7085
|
let y = m.runSync(D, v);
|
|
7086
|
-
return o && (y = { type: "element", tagName: "div", properties: { className: o }, children: y.type === "root" ? y.children : [y] }), ll(y, function(
|
|
7087
|
-
if (
|
|
7088
|
-
if (
|
|
7086
|
+
return o && (y = { type: "element", tagName: "div", properties: { className: o }, children: y.type === "root" ? y.children : [y] }), ll(y, function(k, I, E) {
|
|
7087
|
+
if (k.type === "raw" && E && typeof I == "number") return c ? E.children.splice(I, 1) : E.children[I] = { type: "text", value: k.value }, I;
|
|
7088
|
+
if (k.type === "element") {
|
|
7089
7089
|
let T;
|
|
7090
|
-
for (T in Ro) if (Object.hasOwn(Ro, T) && Object.hasOwn(
|
|
7091
|
-
const _ =
|
|
7092
|
-
(Q === null || Q.includes(
|
|
7090
|
+
for (T in Ro) if (Object.hasOwn(Ro, T) && Object.hasOwn(k.properties, T)) {
|
|
7091
|
+
const _ = k.properties[T], Q = Ro[T];
|
|
7092
|
+
(Q === null || Q.includes(k.tagName)) && (k.properties[T] = f(String(_ || ""), T, k));
|
|
7093
7093
|
}
|
|
7094
7094
|
}
|
|
7095
|
-
if (
|
|
7096
|
-
let T = t ? !t.includes(
|
|
7097
|
-
if (!T && r && typeof I == "number" && (T = !r(
|
|
7095
|
+
if (k.type === "element") {
|
|
7096
|
+
let T = t ? !t.includes(k.tagName) : !!i && i.includes(k.tagName);
|
|
7097
|
+
if (!T && r && typeof I == "number" && (T = !r(k, I, E)), T && E && typeof I == "number") return p && k.children ? E.children.splice(I, 1, ...k.children) : E.children.splice(I, 1), I;
|
|
7098
7098
|
}
|
|
7099
7099
|
}), Rc(y, { Fragment: M.Fragment, components: s, ignoreInvalidStyle: !0, jsx: M.jsx, jsxs: M.jsxs, passKeys: !0, passNode: !0 });
|
|
7100
7100
|
}
|
|
@@ -7119,10 +7119,10 @@ const dd = ({ children: e }) => M.jsx("div", { style: { whiteSpace: "normal" },
|
|
|
7119
7119
|
var f;
|
|
7120
7120
|
const m = (f = p.data.message) == null ? void 0 : f.sender.toUpperCase();
|
|
7121
7121
|
((v, D, y) => {
|
|
7122
|
-
var
|
|
7122
|
+
var k;
|
|
7123
7123
|
if (typeof v.data.message.content != "string" || !v.detail.currPath) return !1;
|
|
7124
7124
|
const I = D[v.detail.currPath];
|
|
7125
|
-
return !!I && (((
|
|
7125
|
+
return !!I && (((k = I.renderMarkdown) == null ? void 0 : k.map((E) => E.toUpperCase()).includes(y)) ?? !1);
|
|
7126
7126
|
})(p, r(), m) && (p.data.message.contentWrapper = l, p.data.message.tags || (p.data.message.tags = []), p.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"));
|
|
7127
7127
|
};
|
|
7128
7128
|
Ut(le.PRE_INJECT_MESSAGE, A), Ut(le.CHUNK_STREAM_MESSAGE, A), Ut(le.START_STREAM_MESSAGE, A), Ut(le.START_SIMULATE_STREAM_MESSAGE, A);
|
|
@@ -7149,10 +7149,10 @@ const dd = ({ children: e }) => M.jsx("div", { style: { whiteSpace: "normal" },
|
|
|
7149
7149
|
const v = m(f.data.inputText);
|
|
7150
7150
|
if (v != null && v.success || p.preventDefault(), !v.promptContent) return;
|
|
7151
7151
|
a === 0 && (A.current = structuredClone(n));
|
|
7152
|
-
const D = ((y,
|
|
7152
|
+
const D = ((y, k) => {
|
|
7153
7153
|
const I = y.promptType ?? "info";
|
|
7154
7154
|
let E = {};
|
|
7155
|
-
return
|
|
7155
|
+
return k.advancedStyles && (E = k.advancedStyles[I]), k.promptBaseColors && (E.toastPromptStyle = { color: k.promptBaseColors[I], borderColor: k.promptBaseColors[I] }), k.promptHoveredColors && (E.toastPromptHoveredStyle = { color: k.promptHoveredColors[I], borderColor: k.promptHoveredColors[I] }), k.textAreaHighlightColors && (y.highlightTextArea ?? !0) && (E.chatInputAreaStyle = { boxShadow: `${k.textAreaHighlightColors[I]} 0px 0px 5px` }), E;
|
|
7156
7156
|
})(v, i);
|
|
7157
7157
|
o(D), t(v.promptContent, v.promptDuration ?? 3e3), l((y) => y + 1);
|
|
7158
7158
|
}), Ut(le.USER_UPLOAD_FILE, (p) => {
|
|
@@ -7161,9 +7161,9 @@ const dd = ({ children: e }) => M.jsx("div", { style: { whiteSpace: "normal" },
|
|
|
7161
7161
|
if (!D) return console.error("No file uploaded."), void p.preventDefault();
|
|
7162
7162
|
const y = Vi(v, r(), "validateFileInput");
|
|
7163
7163
|
if (!y) return void console.error("Validator not found for file input.");
|
|
7164
|
-
const
|
|
7165
|
-
if (!
|
|
7166
|
-
console.log("Validation successful:",
|
|
7164
|
+
const k = y(D);
|
|
7165
|
+
if (!k.success) return console.error("Validation failed:", k), k.promptContent && t(k.promptContent, k.promptDuration ?? 3e3), void p.preventDefault();
|
|
7166
|
+
console.log("Validation successful:", k);
|
|
7167
7167
|
}), Ut(le.DISMISS_TOAST, () => {
|
|
7168
7168
|
l((p) => p - 1);
|
|
7169
7169
|
}), x.useEffect(() => {
|
|
@@ -7322,17 +7322,17 @@ const vd = "background: #1a5b6e; color: white; padding: 2px 6px; border-radius:
|
|
|
7322
7322
|
const [e, t] = x.useState(!1), [r, n] = x.useState([]), [o, s] = x.useState(null), [i, a] = x.useState(0), l = x.useRef(null), A = x.useRef(null), { replaceMessages: c } = kr(), { toggleTextAreaDisabled: p } = Ta(), { setSessionId: f, getSessionId: m } = Cs();
|
|
7323
7323
|
x.useEffect(() => {
|
|
7324
7324
|
var D, y;
|
|
7325
|
-
const
|
|
7325
|
+
const k = (E) => {
|
|
7326
7326
|
l.current && !l.current.contains(E.target) && A.current && !A.current.contains(E.target) && t(!1);
|
|
7327
7327
|
}, I = (y = (D = l.current) === null || D === void 0 ? void 0 : D.getRootNode()) !== null && y !== void 0 ? y : document;
|
|
7328
|
-
return e && I.addEventListener("mousedown",
|
|
7329
|
-
I.removeEventListener("mousedown",
|
|
7328
|
+
return e && I.addEventListener("mousedown", k), () => {
|
|
7329
|
+
I.removeEventListener("mousedown", k);
|
|
7330
7330
|
};
|
|
7331
7331
|
}, [e]);
|
|
7332
7332
|
const v = (D) => {
|
|
7333
7333
|
var y;
|
|
7334
|
-
const
|
|
7335
|
-
if (sn("RESTORE requested", { targetSession: D.slice(-12), currentSession:
|
|
7334
|
+
const k = m();
|
|
7335
|
+
if (sn("RESTORE requested", { targetSession: D.slice(-12), currentSession: k?.slice(-12) }), D === k) return sn("RESTORE skipped - already on this session"), void t(!1);
|
|
7336
7336
|
const I = ((_) => {
|
|
7337
7337
|
var Q;
|
|
7338
7338
|
return ((Q = wr()[_]) === null || Q === void 0 ? void 0 : Q.messages) || [];
|
|
@@ -7356,14 +7356,14 @@ const vd = "background: #1a5b6e; color: white; padding: 2px 6px; border-radius:
|
|
|
7356
7356
|
if (!e && (n((() => {
|
|
7357
7357
|
const D = wr();
|
|
7358
7358
|
return Object.entries(D).map((y) => {
|
|
7359
|
-
let [
|
|
7360
|
-
return Object.assign({ sessionId:
|
|
7361
|
-
}).sort((y,
|
|
7359
|
+
let [k, I] = y;
|
|
7360
|
+
return Object.assign({ sessionId: k }, I);
|
|
7361
|
+
}).sort((y, k) => new Date(k.startedAt).getTime() - new Date(y.startedAt).getTime());
|
|
7362
7362
|
})()), A.current)) {
|
|
7363
7363
|
const D = A.current.closest(".rcb-chat-window");
|
|
7364
7364
|
if (D) {
|
|
7365
|
-
const y = D.getBoundingClientRect(),
|
|
7366
|
-
s(y.width + 3), a(y.right -
|
|
7365
|
+
const y = D.getBoundingClientRect(), k = A.current.getBoundingClientRect();
|
|
7366
|
+
s(y.width + 3), a(y.right - k.right - 18 + 4);
|
|
7367
7367
|
}
|
|
7368
7368
|
}
|
|
7369
7369
|
t(!e);
|
|
@@ -7372,8 +7372,8 @@ const vd = "background: #1a5b6e; color: white; padding: 2px 6px; border-radius:
|
|
|
7372
7372
|
}, onMouseLeave: (y) => {
|
|
7373
7373
|
y.currentTarget.style.backgroundColor = "transparent";
|
|
7374
7374
|
} }, V.createElement("span", { style: { fontSize: "14px", color: "#333", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, D.preview || "New conversation"), V.createElement("span", { style: { fontSize: "12px", color: "#888" } }, ((y) => {
|
|
7375
|
-
const
|
|
7376
|
-
return E === 0 ?
|
|
7375
|
+
const k = new Date(y), I = (/* @__PURE__ */ new Date()).getTime() - k.getTime(), E = Math.floor(I / 864e5);
|
|
7376
|
+
return E === 0 ? k.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : E === 1 ? "Yesterday" : E < 7 ? k.toLocaleDateString([], { weekday: "short" }) : k.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
7377
7377
|
})(D.startedAt))))));
|
|
7378
7378
|
}, yl = (e) => {
|
|
7379
7379
|
var { width: t = 24, height: r = 24, color: n = "currentColor", children: o } = e, s = sa(e, ["width", "height", "color", "children"]);
|
|
@@ -7432,21 +7432,21 @@ const Md = () => {
|
|
|
7432
7432
|
const v = [...f];
|
|
7433
7433
|
return m && v.push(m), void ((D, y) => {
|
|
7434
7434
|
D.preventDefault();
|
|
7435
|
-
let
|
|
7435
|
+
let k = -1;
|
|
7436
7436
|
for (let E = 0; E < y.length; E++) if (y[E] === document.activeElement || y[E].contains(document.activeElement)) {
|
|
7437
|
-
|
|
7437
|
+
k = E;
|
|
7438
7438
|
break;
|
|
7439
7439
|
}
|
|
7440
|
-
|
|
7441
|
-
let I =
|
|
7440
|
+
k === -1 && (k = 0);
|
|
7441
|
+
let I = k;
|
|
7442
7442
|
switch (D.key) {
|
|
7443
7443
|
case "ArrowDown":
|
|
7444
7444
|
case "ArrowRight":
|
|
7445
|
-
I =
|
|
7445
|
+
I = k < y.length - 1 ? k + 1 : 0;
|
|
7446
7446
|
break;
|
|
7447
7447
|
case "ArrowUp":
|
|
7448
7448
|
case "ArrowLeft":
|
|
7449
|
-
I =
|
|
7449
|
+
I = k > 0 ? k - 1 : y.length - 1;
|
|
7450
7450
|
break;
|
|
7451
7451
|
case "Home":
|
|
7452
7452
|
I = 0;
|
|
@@ -7456,7 +7456,7 @@ const Md = () => {
|
|
|
7456
7456
|
break;
|
|
7457
7457
|
case "Enter":
|
|
7458
7458
|
case " ": {
|
|
7459
|
-
const E = y[
|
|
7459
|
+
const E = y[k], T = new MouseEvent("mousedown", { bubbles: !0, cancelable: !0, view: window });
|
|
7460
7460
|
return void E.dispatchEvent(T);
|
|
7461
7461
|
}
|
|
7462
7462
|
default:
|
|
@@ -7548,10 +7548,10 @@ const Md = () => {
|
|
|
7548
7548
|
const m = Array.from(f.querySelectorAll(".rcb-checkbox-row-container")).filter((v) => v.offsetParent !== null && v.style.display !== "none");
|
|
7549
7549
|
if (m.length > 0) {
|
|
7550
7550
|
const v = f.querySelector(".rcb-checkbox-next-button"), D = [...m];
|
|
7551
|
-
if (v && v.offsetParent !== null && D.push(v), D.forEach((y,
|
|
7552
|
-
y.setAttribute("tabindex",
|
|
7551
|
+
if (v && v.offsetParent !== null && D.push(v), D.forEach((y, k) => {
|
|
7552
|
+
y.setAttribute("tabindex", k === 0 ? "0" : "-1"), k === 0 ? y.classList.add("keyboard-focused") : y.classList.remove("keyboard-focused");
|
|
7553
7553
|
}), m.length > 1) {
|
|
7554
|
-
f.querySelectorAll(".keyboard-nav-hint").forEach((
|
|
7554
|
+
f.querySelectorAll(".keyboard-nav-hint").forEach((k) => k.remove());
|
|
7555
7555
|
const y = document.createElement("div");
|
|
7556
7556
|
y.className = "keyboard-nav-hint", y.textContent = "Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option", y.style.cssText = "font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;", f.insertBefore(y, f.firstChild);
|
|
7557
7557
|
}
|
|
@@ -7640,7 +7640,7 @@ const fr = (e) => {
|
|
|
7640
7640
|
}), t;
|
|
7641
7641
|
}, Od = (e) => {
|
|
7642
7642
|
let { siteKey: t, onVerify: r, onError: n, loginUrl: o } = e;
|
|
7643
|
-
const s = x.useRef(null), i = x.useRef(null), a = x.useRef(!1), l = x.useRef(null), A = x.useRef(null), [c, p] = x.useState(!1), [f, m] = x.useState(0), v = x.useRef("widget_error"), D = x.useRef(null), y = o && o !== "/login",
|
|
7643
|
+
const s = x.useRef(null), i = x.useRef(null), a = x.useRef(!1), l = x.useRef(null), A = x.useRef(null), [c, p] = x.useState(!1), [f, m] = x.useState(0), v = x.useRef("widget_error"), D = x.useRef(null), y = o && o !== "/login", k = x.useCallback(() => {
|
|
7644
7644
|
const T = window.turnstile;
|
|
7645
7645
|
if (l.current && T != null && T.remove) {
|
|
7646
7646
|
try {
|
|
@@ -7651,11 +7651,11 @@ const fr = (e) => {
|
|
|
7651
7651
|
}
|
|
7652
7652
|
}, []), I = x.useCallback(() => {
|
|
7653
7653
|
var T;
|
|
7654
|
-
|
|
7655
|
-
}, [n,
|
|
7654
|
+
k(), c ? n?.(v.current, (T = D.current) !== null && T !== void 0 ? T : void 0) : n?.("user_cancelled");
|
|
7655
|
+
}, [n, k, c]);
|
|
7656
7656
|
x.useEffect(() => () => {
|
|
7657
|
-
|
|
7658
|
-
}, [
|
|
7657
|
+
k();
|
|
7658
|
+
}, [k]), x.useEffect(() => {
|
|
7659
7659
|
var T;
|
|
7660
7660
|
return A.current = document.activeElement, (T = i.current) === null || T === void 0 || T.focus(), () => {
|
|
7661
7661
|
A.current && typeof A.current.focus == "function" && A.current.focus();
|
|
@@ -7677,15 +7677,15 @@ const fr = (e) => {
|
|
|
7677
7677
|
if (!T || !s.current) return ct("Turnstile API not available after script load"), v.current = "api_unavailable", void p(!0);
|
|
7678
7678
|
l.current = T.render(s.current, { sitekey: t, callback: (_) => {
|
|
7679
7679
|
yr("Visible challenge completed"), r(_);
|
|
7680
|
-
}, "error-callback": (_) => (ct("Turnstile challenge failed:", _), D.current = _, v.current = "widget_error",
|
|
7681
|
-
ct("Turnstile token expired"), v.current = "token_expired",
|
|
7680
|
+
}, "error-callback": (_) => (ct("Turnstile challenge failed:", _), D.current = _, v.current = "widget_error", k(), p(!0), !0), "expired-callback": () => {
|
|
7681
|
+
ct("Turnstile token expired"), v.current = "token_expired", k(), p(!0);
|
|
7682
7682
|
} });
|
|
7683
7683
|
}).catch((T) => {
|
|
7684
7684
|
ct("Failed to load Turnstile script:", T), v.current = "script_load_failed", p(!0);
|
|
7685
7685
|
}));
|
|
7686
7686
|
}, [t, r, c]);
|
|
7687
7687
|
const E = V.createElement(V.Fragment, null, V.createElement("div", { "aria-hidden": "true", style: { position: "fixed", inset: 0, background: "rgba(0, 0, 0, 0.5)", zIndex: 999998 } }), V.createElement("div", { ref: i, role: "dialog", "aria-modal": "true", "aria-labelledby": "qa-bot-turnstile-label", tabIndex: -1, style: { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)", zIndex: 999999, background: "white", padding: "24px", borderRadius: "8px", boxShadow: "0 4px 20px rgba(0, 0, 0, 0.3)", maxWidth: "90vw", fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif' } }, V.createElement("span", { id: "qa-bot-turnstile-label", className: "sr-only", style: { position: "absolute", width: "1px", height: "1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap" } }, "Verification challenge"), c ? V.createElement("div", { style: { fontSize: "14px", lineHeight: "1.5", color: "#333" } }, f === 0 ? V.createElement("p", { style: { margin: "0 0 16px 0" } }, "Verification failed. You can try again", y && V.createElement(V.Fragment, null, ", or", " ", V.createElement("a", { href: o, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--primaryColor, #107180)", fontWeight: "bold" } }, "log in"), " ", "to skip verification"), ".") : V.createElement(V.Fragment, null, V.createElement("p", { style: { margin: "0 0 8px 0" } }, "Verification is still not working. This can be caused by browser extensions (ad blockers, privacy tools) or VPN connections."), V.createElement("p", { style: { margin: "0 0 16px 0" } }, "Try disabling extensions, using a private/incognito window,", y && V.createElement(V.Fragment, null, " ", V.createElement("a", { href: o, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--primaryColor, #107180)", fontWeight: "bold" } }, "logging in"), ","), " ", "or using a different browser.")), V.createElement("div", { style: { display: "flex", gap: "8px" } }, V.createElement("button", { type: "button", onClick: () => {
|
|
7688
|
-
|
|
7688
|
+
k(), a.current = !1, m((T) => T + 1), p(!1);
|
|
7689
7689
|
}, style: { padding: "8px 16px", background: "var(--primaryColor, #107180)", color: "white", border: "none", borderRadius: "4px", cursor: "pointer", fontSize: "14px" } }, "Try again"), V.createElement("button", { type: "button", onClick: I, style: { padding: "8px 16px", background: "#f0f0f0", color: "#333", border: "1px solid #ccc", borderRadius: "4px", cursor: "pointer", fontSize: "14px" } }, "Close"))) : V.createElement(V.Fragment, null, V.createElement("div", { ref: s, style: { borderRadius: "8px", overflow: "hidden" } }), V.createElement("button", { type: "button", onClick: I, style: { marginTop: "16px", padding: "8px 16px", background: "#f0f0f0", color: "#333", border: "1px solid #ccc", borderRadius: "4px", cursor: "pointer", fontSize: "14px" } }, "Cancel"))));
|
|
7690
7690
|
return Tl.createPortal(E, document.body);
|
|
7691
7691
|
};
|
|
@@ -7702,21 +7702,23 @@ function Rd(e) {
|
|
|
7702
7702
|
var s, i;
|
|
7703
7703
|
const [a, l] = V.useState(null), [A, c] = V.useState(0), p = t(), f = (s = Nl) !== null && s !== void 0 ? s : {}, m = f.VITE_FORCE_TURNSTILE_WIDGET === "true", v = (i = p.siteKey) !== null && i !== void 0 ? i : m ? f.VITE_TURNSTILE_SITE_KEY : null;
|
|
7704
7704
|
return v && (m || a !== v) ? V.createElement(Od, { key: A, siteKey: v, loginUrl: o, onVerify: async (D) => {
|
|
7705
|
-
|
|
7705
|
+
const y = v;
|
|
7706
|
+
p.token = D, n?.({ type: "chatbot_turnstile_completed" }), await r(D) === "needs_another_challenge" ? c((k) => k + 1) : l(y);
|
|
7706
7707
|
}, onError: (D, y) => {
|
|
7707
|
-
var
|
|
7708
|
-
|
|
7708
|
+
var k;
|
|
7709
|
+
const I = (k = p.pendingQuery) === null || k === void 0 ? void 0 : k.queryId, E = v;
|
|
7710
|
+
p.token = null, p.pendingQuery = null, p.needsChallenge = !1, p.siteKey = null, l(E), n?.({ type: "chatbot_turnstile_error", queryId: I, failureReason: D, cloudflareErrorCode: y });
|
|
7709
7711
|
} }) : null;
|
|
7710
7712
|
}
|
|
7711
7713
|
const Nd = "#1a5b6e", Ld = "#107180", Fd = "Arial, sans-serif", $i = "Q&A Bot", jd = "/chat-icon.svg", Hd = "Type your question here...", Ud = "Select an option to continue", zd = !1, qd = "Ask me a question!", ea = "/login", Gd = { general: { showHeader: !0, showFooter: !0 }, tooltip: { mode: "CLOSE" }, chatInput: { disabled: !1, characterLimit: 5e3, showCharacterCount: !1, allowNewline: !0, blockSpam: !1 }, chatWindow: { defaultOpen: !1, showScrollbar: !1 }, botBubble: { simulateStream: !0, streamSpeed: 10, showAvatar: !1 }, userBubble: { showAvatar: !1 }, notification: { disabled: !0, showCount: !1 }, audio: { disabled: !0 }, emoji: { disabled: !0 }, fileAttachment: { disabled: !0 } }, Ps = x.forwardRef((e, t) => {
|
|
7712
7714
|
var r, n, o;
|
|
7713
|
-
const { apiKey: s, qaEndpoint: i, ratingEndpoint: a, capabilitiesEndpoint: l, agentRatingEndpoint: A, welcomeMessage: c, open: p, onOpenChange: f, isLoggedIn: m, allowAnonAccess: v = !1, actingUser: D, primaryColor: y, secondaryColor:
|
|
7715
|
+
const { apiKey: s, qaEndpoint: i, ratingEndpoint: a, capabilitiesEndpoint: l, agentRatingEndpoint: A, welcomeMessage: c, open: p, onOpenChange: f, isLoggedIn: m, allowAnonAccess: v = !1, actingUser: D, primaryColor: y, secondaryColor: k, botName: I, logo: E, placeholder: T, errorMessage: _, embedded: Q, footerText: O, footerLink: U, tooltipText: W, loginUrl: H, turnstileSiteKey: K, backendId: L, resourceContext: X, customFlow: te, onAnalyticsEvent: J } = e, re = x.useRef(`bot_${Math.random().toString(36).substr(2, 9)}`);
|
|
7714
7716
|
x.useEffect(() => {
|
|
7715
7717
|
Sd();
|
|
7716
7718
|
}, []);
|
|
7717
7719
|
const Y = x.useRef(null);
|
|
7718
7720
|
Y.current === null && (Y.current = Xi(), $r("CREATED", Y.current));
|
|
7719
|
-
const Z = x.useRef(!1),
|
|
7721
|
+
const Z = x.useRef(!1), S = x.useRef({ getSessionId: () => Y.current, isResetting: () => Z.current }), ce = x.useRef(null), B = (function(ie, oe) {
|
|
7720
7722
|
const [Ee, we] = x.useState(null), [Ne, Qe] = x.useState("idle"), Le = x.useRef(null), Ue = x.useRef(null), Ze = x.useRef(!0), zt = x.useCallback(() => {
|
|
7721
7723
|
const _e = window.turnstile;
|
|
7722
7724
|
if (Ue.current && _e != null && _e.remove) {
|
|
@@ -7769,12 +7771,12 @@ const Nd = "#1a5b6e", Ld = "#107180", Fd = "Arial, sans-serif", $i = "Q&A Bot",
|
|
|
7769
7771
|
}, [Oe]);
|
|
7770
7772
|
const Ie = x.useMemo(() => {
|
|
7771
7773
|
const ie = Object.assign({}, Gd);
|
|
7772
|
-
ie.general = Object.assign(Object.assign({}, ie.general), { primaryColor: y || Nd, secondaryColor:
|
|
7774
|
+
ie.general = Object.assign(Object.assign({}, ie.general), { primaryColor: y || Nd, secondaryColor: k || Ld, fontFamily: Fd, embedded: be });
|
|
7773
7775
|
const oe = fe === !1 ? [V.createElement(Yi, { key: "login-button", loginUrl: H || ea, isHeaderButton: !0 })] : [V.createElement(Id, { key: "history-button" }), V.createElement(md, { key: "user-icon" })];
|
|
7774
7776
|
ie.header = { title: V.createElement("span", { style: { fontSize: 14, fontWeight: 500 } }, I || $i), showAvatar: !0, avatar: E || jd, buttons: [...oe, et.CLOSE_CHAT_BUTTON] }, ie.chatInput = Object.assign(Object.assign({}, ie.chatInput), { disabled: !1, enabledPlaceholderText: T || Hd, disabledPlaceholderText: _ || Ud }), ie.tooltip = Object.assign(Object.assign({}, ie.tooltip), { text: W || qd });
|
|
7775
7777
|
const Ee = O ? U ? V.createElement("a", { href: U, target: "_blank", rel: "noopener noreferrer", key: "footer-link" }, O) : V.createElement("span", { key: "footer-text" }, O) : null;
|
|
7776
7778
|
return ie.footer = { text: Ee ?? void 0, buttons: [V.createElement(Qd, { key: "new-chat-button" })] }, ie.chatWindow = Object.assign(Object.assign({}, ie.chatWindow), { defaultOpen: !!be }), ie.event = { rcbPreInjectMessage: !0, rcbPostInjectMessage: !0, rcbUserSubmitText: !0, rcbChangePath: !0, rcbToggleChatWindow: !0 }, ie;
|
|
7777
|
-
}, [y,
|
|
7779
|
+
}, [y, k, I, E, T, _, be, W, fe, H, O, U]), nt = x.useRef(null), Re = (function(ie) {
|
|
7778
7780
|
let oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7779
7781
|
return x.useMemo(() => {
|
|
7780
7782
|
const Ee = (we, Ne) => {
|
|
@@ -7987,7 +7989,7 @@ ${Ot}` : Te;
|
|
|
7987
7989
|
return ct("Error resubmitting after Turnstile:", ze), se.token = null, se.pendingQuery = null, se.needsChallenge = !1, se.siteKey = null, await Ce?.("I had trouble processing your question after verification. Please try again."), "error";
|
|
7988
7990
|
}
|
|
7989
7991
|
}, trackEvent: xe, loginUrl: _e }), path: "qa_loop" } };
|
|
7990
|
-
})({ endpoint: i, ratingEndpoint: a, agentRatingEndpoint: A, apiKey: s, sessionId:
|
|
7992
|
+
})({ endpoint: i, ratingEndpoint: a, agentRatingEndpoint: A, apiKey: s, sessionId: S.current.getSessionId, isResetting: S.current.isResetting, isLoggedIn: fe, allowAnonAccess: v, loginUrl: H || ea, trackEvent: Oe, getTurnstileToken: () => ae.current, resetTurnstileToken: () => B.reset(), backendId: L, resourceContext: X });
|
|
7991
7993
|
return Object.assign(Object.assign({ start: { message: c, renderMarkdown: ["BOT"], transition: { duration: 0 }, path: "qa_loop" } }, ie), te || {});
|
|
7992
7994
|
}, [s, i, a, A, c, fe, v, H, te, D, Oe, X, L]), Je = x.useMemo(() => {
|
|
7993
7995
|
return [() => pc(oe), pd(), () => hd(ie)];
|
|
@@ -8081,7 +8083,7 @@ const Wd = () => {
|
|
|
8081
8083
|
const [i, a] = x.useState(!1), [l, A] = x.useState([]), [c, p] = x.useState(null), f = x.useRef(null), { captureScreenshot: m, isCapturing: v, isScreenCaptureAvailable: D } = Wd(), y = (Q) => {
|
|
8082
8084
|
const O = document.createElement("div");
|
|
8083
8085
|
O.setAttribute("aria-live", "assertive"), O.setAttribute("aria-atomic", "true"), O.className = "sr-only", O.textContent = Q, document.body.appendChild(O), setTimeout(() => document.body.removeChild(O), 1e3);
|
|
8084
|
-
},
|
|
8086
|
+
}, k = (Q) => {
|
|
8085
8087
|
if (!Q || Q.length === 0) return void pl("FileUploadComponent: No valid files provided to handleFiles");
|
|
8086
8088
|
let O;
|
|
8087
8089
|
try {
|
|
@@ -8111,7 +8113,7 @@ const Wd = () => {
|
|
|
8111
8113
|
Q.preventDefault(), (async () => {
|
|
8112
8114
|
try {
|
|
8113
8115
|
const O = await m();
|
|
8114
|
-
|
|
8116
|
+
k([O]), y("Screenshot captured successfully");
|
|
8115
8117
|
} catch {
|
|
8116
8118
|
y("Error capturing screenshot. Please try again.");
|
|
8117
8119
|
}
|
|
@@ -8120,7 +8122,7 @@ const Wd = () => {
|
|
|
8120
8122
|
var O;
|
|
8121
8123
|
Q.preventDefault(), Q.stopPropagation(), a(!1);
|
|
8122
8124
|
try {
|
|
8123
|
-
!((O = Q.dataTransfer) === null || O === void 0) && O.files && Q.dataTransfer.files.length > 0 &&
|
|
8125
|
+
!((O = Q.dataTransfer) === null || O === void 0) && O.files && Q.dataTransfer.files.length > 0 && k(Q.dataTransfer.files);
|
|
8124
8126
|
} catch (U) {
|
|
8125
8127
|
ct("FileUploadComponent: Error in handleDrop:", U), y("Error processing dropped files. Please try again.");
|
|
8126
8128
|
}
|
|
@@ -8129,7 +8131,7 @@ const Wd = () => {
|
|
|
8129
8131
|
}, style: { padding: "20px", border: "2px dashed #ccc", borderRadius: "8px", backgroundColor: i ? "#f0f8ff" : "#fafafa", transition: "all 0.3s ease" } }, V.createElement("input", { ref: f, type: "file", className: "file-input", onChange: (Q) => {
|
|
8130
8132
|
var O;
|
|
8131
8133
|
try {
|
|
8132
|
-
!((O = Q.target) === null || O === void 0) && O.files && Q.target.files.length > 0 &&
|
|
8134
|
+
!((O = Q.target) === null || O === void 0) && O.files && Q.target.files.length > 0 && k(Q.target.files);
|
|
8133
8135
|
} catch (U) {
|
|
8134
8136
|
ct("FileUploadComponent: Error in handleFileSelect:", U), y("Error processing selected files. Please try again.");
|
|
8135
8137
|
}
|
|
@@ -10088,7 +10090,7 @@ const bf = x.forwardRef(
|
|
|
10088
10090
|
welcome: D,
|
|
10089
10091
|
// Endpoint overrides
|
|
10090
10092
|
qaEndpoint: y,
|
|
10091
|
-
ratingEndpoint:
|
|
10093
|
+
ratingEndpoint: k,
|
|
10092
10094
|
agentEndpoint: I,
|
|
10093
10095
|
backendId: E,
|
|
10094
10096
|
// Resource scoping
|
|
@@ -10120,7 +10122,7 @@ const bf = x.forwardRef(
|
|
|
10120
10122
|
(de = (fe = U.current) == null ? void 0 : fe.addMessage) == null || de.call(fe, ae);
|
|
10121
10123
|
}
|
|
10122
10124
|
}));
|
|
10123
|
-
const Y = D || L?.welcome_message || On.WELCOME_MESSAGE, Z = x.useMemo(() => yf(), []),
|
|
10125
|
+
const Y = D || L?.welcome_message || On.WELCOME_MESSAGE, Z = x.useMemo(() => yf(), []), S = x.useCallback((ae) => {
|
|
10124
10126
|
_ && _({
|
|
10125
10127
|
...ae,
|
|
10126
10128
|
type: ae.type,
|
|
@@ -10138,21 +10140,21 @@ const bf = x.forwardRef(
|
|
|
10138
10140
|
const ae = $d({
|
|
10139
10141
|
welcome: Y,
|
|
10140
10142
|
setTicketForm: K,
|
|
10141
|
-
trackEvent:
|
|
10143
|
+
trackEvent: S
|
|
10142
10144
|
}), fe = cf({
|
|
10143
10145
|
ticketForm: {},
|
|
10144
10146
|
setTicketForm: K,
|
|
10145
10147
|
userInfo: te,
|
|
10146
|
-
trackEvent:
|
|
10148
|
+
trackEvent: S
|
|
10147
10149
|
}), de = df({
|
|
10148
10150
|
ticketForm: {},
|
|
10149
10151
|
setTicketForm: K,
|
|
10150
10152
|
userInfo: te,
|
|
10151
|
-
trackEvent:
|
|
10153
|
+
trackEvent: S
|
|
10152
10154
|
}), be = mf({
|
|
10153
10155
|
sessionId: Z,
|
|
10154
10156
|
apiKey: r,
|
|
10155
|
-
trackEvent:
|
|
10157
|
+
trackEvent: S
|
|
10156
10158
|
}), Oe = {
|
|
10157
10159
|
...ae,
|
|
10158
10160
|
...fe,
|
|
@@ -10160,7 +10162,7 @@ const bf = x.forwardRef(
|
|
|
10160
10162
|
...be
|
|
10161
10163
|
};
|
|
10162
10164
|
return Jd(Oe, { disableOnOptions: !0 });
|
|
10163
|
-
}, [Y, te, Z, r, n,
|
|
10165
|
+
}, [Y, te, Z, r, n, S, L]);
|
|
10164
10166
|
return L ? /* @__PURE__ */ M.jsx("div", { ref: W, children: /* @__PURE__ */ M.jsx(
|
|
10165
10167
|
Ps,
|
|
10166
10168
|
{
|
|
@@ -10171,7 +10173,7 @@ const bf = x.forwardRef(
|
|
|
10171
10173
|
onAnalyticsEvent: ce,
|
|
10172
10174
|
apiKey: r,
|
|
10173
10175
|
qaEndpoint: y || jt.QA_ENDPOINT,
|
|
10174
|
-
ratingEndpoint:
|
|
10176
|
+
ratingEndpoint: k || jt.RATING_ENDPOINT,
|
|
10175
10177
|
backendId: O,
|
|
10176
10178
|
botName: On.BOT_NAME,
|
|
10177
10179
|
logo: On.LOGO,
|