@eloquentai/chat-sdk 0.19.0-dev → 0.19.2-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as
|
2
|
-
import { version as ql, createContext as Jo, useContext as Xo, useState as z, useEffect as
|
1
|
+
import * as ce from "react";
|
2
|
+
import { version as ql, createContext as Jo, useContext as Xo, useState as z, useEffect as ae, useMemo as Et, useRef as Pe, useCallback as $e } from "react";
|
3
3
|
import { jsx as m, jsxs as D, Fragment as xt } from "react/jsx-runtime";
|
4
4
|
import { ChevronDown as Xa, X as Qa, Copy as Gl, ThumbsUp as Vl, ThumbsDown as Kl, FileSearch as Yl, CheckCircle as Jl, Info as Xl, XCircle as Ql, AlertTriangle as Zl, ArrowUp as ed, RefreshCcw as td } from "lucide-react";
|
5
5
|
import { clsx as nd } from "clsx";
|
@@ -11,11 +11,11 @@ import * as Ae from "@radix-ui/react-dialog";
|
|
11
11
|
import { useRive as sd, Layout as id, Alignment as ad, Fit as cd, useStateMachineInput as ud } from "@rive-app/react-canvas";
|
12
12
|
import * as Ut from "@radix-ui/react-avatar";
|
13
13
|
import { createPortal as fo } from "react-dom";
|
14
|
-
import { z as
|
14
|
+
import { z as he } from "zod";
|
15
15
|
import ld from "react-dom/client";
|
16
16
|
try {
|
17
17
|
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
|
18
|
-
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "
|
18
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "a063cbcc-1165-4ccb-a8df-a20a5c3379f7", e._sentryDebugIdIdentifier = "sentry-dbid-a063cbcc-1165-4ccb-a8df-a20a5c3379f7");
|
19
19
|
} catch {
|
20
20
|
}
|
21
21
|
const U = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, st = "9.30.0", $ = globalThis;
|
@@ -5381,19 +5381,19 @@ function vt(e, t) {
|
|
5381
5381
|
});
|
5382
5382
|
if (!Z)
|
5383
5383
|
return console.warn(e, "not serialized"), null;
|
5384
|
-
let
|
5385
|
-
r.hasNode(e) ?
|
5386
|
-
const P = Object.assign(Z, { id:
|
5387
|
-
if (r.add(e, P),
|
5384
|
+
let ie;
|
5385
|
+
r.hasNode(e) ? ie = r.getId(e) : Yg(Z, v) || !L && Z.type === re.Text && !Z.isStyle && !Z.textContent.replace(/^\s+|\s+$/gm, "").length ? ie = an : ie = bs();
|
5386
|
+
const P = Object.assign(Z, { id: ie });
|
5387
|
+
if (r.add(e, P), ie === an)
|
5388
5388
|
return null;
|
5389
5389
|
w && w(e);
|
5390
|
-
let
|
5390
|
+
let ue = !f;
|
5391
5391
|
if (P.type === re.Element) {
|
5392
|
-
|
5392
|
+
ue = ue && !P.needBlock, delete P.needBlock;
|
5393
5393
|
const J = e.shadowRoot;
|
5394
5394
|
J && Zt(J) && (P.isShadowHost = !0);
|
5395
5395
|
}
|
5396
|
-
if ((P.type === re.Document || P.type === re.Element) &&
|
5396
|
+
if ((P.type === re.Document || P.type === re.Element) && ue) {
|
5397
5397
|
v.headWhitespace && P.type === re.Element && P.tagName === "head" && (L = !1);
|
5398
5398
|
const J = {
|
5399
5399
|
doc: n,
|
@@ -5841,7 +5841,7 @@ function Ar(...e) {
|
|
5841
5841
|
function ry(...e) {
|
5842
5842
|
return ws("clearTimeout")(...e);
|
5843
5843
|
}
|
5844
|
-
var M = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(M || {}), O = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e[e.CustomElement = 16] = "CustomElement", e))(O || {}),
|
5844
|
+
var M = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(M || {}), O = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e[e.CustomElement = 16] = "CustomElement", e))(O || {}), de = /* @__PURE__ */ ((e) => (e[e.MouseUp = 0] = "MouseUp", e[e.MouseDown = 1] = "MouseDown", e[e.Click = 2] = "Click", e[e.ContextMenu = 3] = "ContextMenu", e[e.DblClick = 4] = "DblClick", e[e.Focus = 5] = "Focus", e[e.Blur = 6] = "Blur", e[e.TouchStart = 7] = "TouchStart", e[e.TouchMove_Departed = 8] = "TouchMove_Departed", e[e.TouchEnd = 9] = "TouchEnd", e[e.TouchCancel = 10] = "TouchCancel", e))(de || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Mouse = 0] = "Mouse", e[e.Pen = 1] = "Pen", e[e.Touch = 2] = "Touch", e))(Ue || {}), yt = /* @__PURE__ */ ((e) => (e[e.Play = 0] = "Play", e[e.Pause = 1] = "Pause", e[e.Seeked = 2] = "Seeked", e[e.VolumeChange = 3] = "VolumeChange", e[e.RateChange = 4] = "RateChange", e))(yt || {});
|
5845
5845
|
function vs(e) {
|
5846
5846
|
try {
|
5847
5847
|
return e.contentDocument;
|
@@ -6378,37 +6378,37 @@ function dy({
|
|
6378
6378
|
p = Ue.Pen;
|
6379
6379
|
break;
|
6380
6380
|
}
|
6381
|
-
p === Ue.Touch ?
|
6381
|
+
p === Ue.Touch ? de[d] === de.MouseDown ? g = "TouchStart" : de[d] === de.MouseUp && (g = "TouchEnd") : Ue.Pen;
|
6382
6382
|
} else Mo(f) && (p = Ue.Touch);
|
6383
|
-
p !== null ? (u = p, (g.startsWith("Touch") && p === Ue.Touch || g.startsWith("Mouse") && p === Ue.Mouse) && (p = null)) :
|
6383
|
+
p !== null ? (u = p, (g.startsWith("Touch") && p === Ue.Touch || g.startsWith("Mouse") && p === Ue.Mouse) && (p = null)) : de[d] === de.Click && (p = u, u = null);
|
6384
6384
|
const y = Mo(f) ? f.changedTouches[0] : f;
|
6385
6385
|
if (!y)
|
6386
6386
|
return;
|
6387
6387
|
const b = n.getId(h), { clientX: v, clientY: x } = y;
|
6388
6388
|
B(e)({
|
6389
|
-
type:
|
6389
|
+
type: de[g],
|
6390
6390
|
id: b,
|
6391
6391
|
x: v,
|
6392
6392
|
y: x,
|
6393
6393
|
...p !== null && { pointerType: p }
|
6394
6394
|
});
|
6395
6395
|
};
|
6396
|
-
return Object.keys(
|
6396
|
+
return Object.keys(de).filter(
|
6397
6397
|
(d) => Number.isNaN(Number(d)) && !d.endsWith("_Departed") && c[d] !== !1
|
6398
6398
|
).forEach((d) => {
|
6399
6399
|
let f = At(d);
|
6400
6400
|
const h = l(d);
|
6401
6401
|
if (window.PointerEvent)
|
6402
|
-
switch (
|
6403
|
-
case
|
6404
|
-
case
|
6402
|
+
switch (de[d]) {
|
6403
|
+
case de.MouseDown:
|
6404
|
+
case de.MouseUp:
|
6405
6405
|
f = f.replace(
|
6406
6406
|
"mouse",
|
6407
6407
|
"pointer"
|
6408
6408
|
);
|
6409
6409
|
break;
|
6410
|
-
case
|
6411
|
-
case
|
6410
|
+
case de.TouchStart:
|
6411
|
+
case de.TouchEnd:
|
6412
6412
|
return;
|
6413
6413
|
}
|
6414
6414
|
a.push(pe(f, h, t));
|
@@ -6508,7 +6508,7 @@ function py({
|
|
6508
6508
|
return;
|
6509
6509
|
const V = ys(C);
|
6510
6510
|
let L = lr(j, T, V), Z = !1;
|
6511
|
-
const
|
6511
|
+
const ie = Nr({
|
6512
6512
|
maskInputOptions: a,
|
6513
6513
|
tagName: T,
|
6514
6514
|
type: V
|
@@ -6518,7 +6518,7 @@ function py({
|
|
6518
6518
|
p,
|
6519
6519
|
h,
|
6520
6520
|
g,
|
6521
|
-
|
6521
|
+
ie
|
6522
6522
|
);
|
6523
6523
|
(V === "radio" || V === "checkbox") && (Z = C.checked), L = sn({
|
6524
6524
|
isMasked: P,
|
@@ -6529,8 +6529,8 @@ function py({
|
|
6529
6529
|
C,
|
6530
6530
|
d ? { text: L, isChecked: Z, userTriggered: S } : { text: L, isChecked: Z }
|
6531
6531
|
);
|
6532
|
-
const
|
6533
|
-
V === "radio" &&
|
6532
|
+
const ue = C.name;
|
6533
|
+
V === "radio" && ue && Z && t.querySelectorAll(`input[type="radio"][name="${ue}"]`).forEach((J) => {
|
6534
6534
|
if (J !== C) {
|
6535
6535
|
const ge = sn({
|
6536
6536
|
// share mask behavior of `target`
|
@@ -7462,9 +7462,9 @@ function ze(e = {}) {
|
|
7462
7462
|
recordCrossOriginIframes: V = !1,
|
7463
7463
|
recordAfter: L = e.recordAfter === "DOMContentLoaded" ? e.recordAfter : "load",
|
7464
7464
|
userTriggeredOnInput: Z = !1,
|
7465
|
-
collectFonts:
|
7465
|
+
collectFonts: ie = !1,
|
7466
7466
|
inlineImages: P = !1,
|
7467
|
-
plugins:
|
7467
|
+
plugins: ue,
|
7468
7468
|
keepIframeSrcFn: J = () => !1,
|
7469
7469
|
ignoreCSSAttributes: ge = /* @__PURE__ */ new Set([]),
|
7470
7470
|
errorHandler: Se,
|
@@ -7521,23 +7521,23 @@ function ze(e = {}) {
|
|
7521
7521
|
Qg();
|
7522
7522
|
let zt, pt = 0;
|
7523
7523
|
const jt = (W) => {
|
7524
|
-
for (const Ce of
|
7524
|
+
for (const Ce of ue || [])
|
7525
7525
|
Ce.eventProcessor && (W = Ce.eventProcessor(W));
|
7526
7526
|
return w && // Disable packing events which will be emitted to parent frames.
|
7527
7527
|
!G && (W = w(W)), W;
|
7528
7528
|
};
|
7529
7529
|
X = (W, Ce) => {
|
7530
7530
|
const F = W;
|
7531
|
-
if (F.timestamp = fr(), St[0]?.isFrozen() && F.type !== M.FullSnapshot && !(F.type === M.IncrementalSnapshot && F.data.source === O.Mutation) && St.forEach((
|
7531
|
+
if (F.timestamp = fr(), St[0]?.isFrozen() && F.type !== M.FullSnapshot && !(F.type === M.IncrementalSnapshot && F.data.source === O.Mutation) && St.forEach((le) => le.unfreeze()), ht)
|
7532
7532
|
t?.(jt(F), Ce);
|
7533
7533
|
else if (G) {
|
7534
|
-
const
|
7534
|
+
const le = {
|
7535
7535
|
type: "rrweb",
|
7536
7536
|
event: jt(F),
|
7537
7537
|
origin: window.location.origin,
|
7538
7538
|
isCheckout: Ce
|
7539
7539
|
};
|
7540
|
-
window.parent.postMessage(
|
7540
|
+
window.parent.postMessage(le, "*");
|
7541
7541
|
}
|
7542
7542
|
if (F.type === M.FullSnapshot)
|
7543
7543
|
zt = F, pt = 0;
|
@@ -7545,8 +7545,8 @@ function ze(e = {}) {
|
|
7545
7545
|
if (F.data.source === O.Mutation && F.data.isAttachIframe)
|
7546
7546
|
return;
|
7547
7547
|
pt++;
|
7548
|
-
const
|
7549
|
-
(
|
7548
|
+
const le = r && pt >= r, q = n && zt && F.timestamp - zt.timestamp > n;
|
7549
|
+
(le || q) && zr(!0);
|
7550
7550
|
}
|
7551
7551
|
};
|
7552
7552
|
const En = (W) => {
|
@@ -7585,7 +7585,7 @@ function ze(e = {}) {
|
|
7585
7585
|
recordCrossOriginIframes: V,
|
7586
7586
|
wrappedEmit: X
|
7587
7587
|
});
|
7588
|
-
for (const W of
|
7588
|
+
for (const W of ue || [])
|
7589
7589
|
W.getMirror && W.getMirror({
|
7590
7590
|
nodeMirror: Te,
|
7591
7591
|
crossOriginIframeMirror: tt.crossOriginIframeMirror,
|
@@ -7678,11 +7678,11 @@ function ze(e = {}) {
|
|
7678
7678
|
onSerialize: (F) => {
|
7679
7679
|
wu(F, Te) && tt.addIframe(F), vu(F, Te) && et.trackLinkElement(F), Do(F) && xn.addShadowRoot(F.shadowRoot, document);
|
7680
7680
|
},
|
7681
|
-
onIframeLoad: (F,
|
7682
|
-
tt.attachIframe(F,
|
7681
|
+
onIframeLoad: (F, le) => {
|
7682
|
+
tt.attachIframe(F, le), F.contentWindow && Wr.addWindow(F.contentWindow), xn.observeAttachShadow(F);
|
7683
7683
|
},
|
7684
|
-
onStylesheetLoad: (F,
|
7685
|
-
et.attachLinkElement(F,
|
7684
|
+
onStylesheetLoad: (F, le) => {
|
7685
|
+
et.attachLinkElement(F, le);
|
7686
7686
|
},
|
7687
7687
|
keepIframeSrcFn: J
|
7688
7688
|
});
|
@@ -7701,7 +7701,7 @@ function ze(e = {}) {
|
|
7701
7701
|
};
|
7702
7702
|
pr = zr;
|
7703
7703
|
try {
|
7704
|
-
const W = [], Ce = (
|
7704
|
+
const W = [], Ce = (le) => B(vy)(
|
7705
7705
|
{
|
7706
7706
|
onMutation: Ht,
|
7707
7707
|
mutationCb: En,
|
@@ -7796,8 +7796,8 @@ function ze(e = {}) {
|
|
7796
7796
|
recordCanvas: j,
|
7797
7797
|
inlineImages: P,
|
7798
7798
|
userTriggeredOnInput: Z,
|
7799
|
-
collectFonts:
|
7800
|
-
doc:
|
7799
|
+
collectFonts: ie,
|
7800
|
+
doc: le,
|
7801
7801
|
maskAttributeFn: v,
|
7802
7802
|
maskInputFn: x,
|
7803
7803
|
maskTextFn: E,
|
@@ -7813,7 +7813,7 @@ function ze(e = {}) {
|
|
7813
7813
|
processedNodeManager: Hr,
|
7814
7814
|
canvasManager: Wr,
|
7815
7815
|
ignoreCSSAttributes: ge,
|
7816
|
-
plugins:
|
7816
|
+
plugins: ue?.filter((q) => q.observer)?.map((q) => ({
|
7817
7817
|
observer: q.observer,
|
7818
7818
|
options: q.options,
|
7819
7819
|
callback: (jr) => X({
|
@@ -7827,9 +7827,9 @@ function ze(e = {}) {
|
|
7827
7827
|
},
|
7828
7828
|
{}
|
7829
7829
|
);
|
7830
|
-
tt.addLoadListener((
|
7830
|
+
tt.addLoadListener((le) => {
|
7831
7831
|
try {
|
7832
|
-
W.push(Ce(
|
7832
|
+
W.push(Ce(le.contentDocument));
|
7833
7833
|
} catch (q) {
|
7834
7834
|
console.warn(q);
|
7835
7835
|
}
|
@@ -7856,7 +7856,7 @@ function ze(e = {}) {
|
|
7856
7856
|
window
|
7857
7857
|
)
|
7858
7858
|
)), () => {
|
7859
|
-
W.forEach((
|
7859
|
+
W.forEach((le) => le()), Hr.destroy(), pr = void 0, uy();
|
7860
7860
|
};
|
7861
7861
|
} catch (W) {
|
7862
7862
|
console.warn(W);
|
@@ -8073,7 +8073,7 @@ function zy(e, t) {
|
|
8073
8073
|
const { source: n } = t.data;
|
8074
8074
|
if (Uy.has(n) && e.registerMutation(t.timestamp), n === O.Scroll && e.registerScroll(t.timestamp), qy(t)) {
|
8075
8075
|
const { type: r, id: o } = t.data, s = ze.mirror.getNode(o);
|
8076
|
-
s instanceof HTMLElement && r ===
|
8076
|
+
s instanceof HTMLElement && r === de.Click && e.registerClick(s);
|
8077
8077
|
}
|
8078
8078
|
} catch {
|
8079
8079
|
}
|
@@ -10428,7 +10428,7 @@ class F_ {
|
|
10428
10428
|
onError: Z
|
10429
10429
|
} = {}) {
|
10430
10430
|
this.name = "Replay";
|
10431
|
-
const
|
10431
|
+
const ie = D_({
|
10432
10432
|
mask: _,
|
10433
10433
|
unmask: I,
|
10434
10434
|
block: C,
|
@@ -10441,15 +10441,15 @@ class F_ {
|
|
10441
10441
|
maskInputOptions: { password: !0 },
|
10442
10442
|
maskTextFn: j,
|
10443
10443
|
maskInputFn: j,
|
10444
|
-
maskAttributeFn: (P,
|
10444
|
+
maskAttributeFn: (P, ue, J) => L_({
|
10445
10445
|
maskAttributes: w,
|
10446
10446
|
maskAllText: u,
|
10447
|
-
privacyOptions:
|
10447
|
+
privacyOptions: ie,
|
10448
10448
|
key: P,
|
10449
|
-
value:
|
10449
|
+
value: ue,
|
10450
10450
|
el: J
|
10451
10451
|
}),
|
10452
|
-
...
|
10452
|
+
...ie,
|
10453
10453
|
// Our defaults
|
10454
10454
|
slimDOMOptions: "all",
|
10455
10455
|
inlineStylesheet: !0,
|
@@ -10610,7 +10610,7 @@ function $_(e) {
|
|
10610
10610
|
}
|
10611
10611
|
{
|
10612
10612
|
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
10613
|
-
e.SENTRY_RELEASE = { id: "
|
10613
|
+
e.SENTRY_RELEASE = { id: "a9860e5b8b81cf1d8df0e83930ddcdaaad3be140" };
|
10614
10614
|
}
|
10615
10615
|
const H_ = "development";
|
10616
10616
|
$_({
|
@@ -10701,7 +10701,7 @@ function j_({
|
|
10701
10701
|
}
|
10702
10702
|
) });
|
10703
10703
|
}
|
10704
|
-
const Ns =
|
10704
|
+
const Ns = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10705
10705
|
"div",
|
10706
10706
|
{
|
10707
10707
|
ref: n,
|
@@ -10713,7 +10713,7 @@ const Ns = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10713
10713
|
}
|
10714
10714
|
));
|
10715
10715
|
Ns.displayName = "Card";
|
10716
|
-
const Os =
|
10716
|
+
const Os = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10717
10717
|
"div",
|
10718
10718
|
{
|
10719
10719
|
ref: n,
|
@@ -10722,7 +10722,7 @@ const Os = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10722
10722
|
}
|
10723
10723
|
));
|
10724
10724
|
Os.displayName = "CardHeader";
|
10725
|
-
const q_ =
|
10725
|
+
const q_ = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10726
10726
|
"div",
|
10727
10727
|
{
|
10728
10728
|
ref: n,
|
@@ -10734,7 +10734,7 @@ const q_ = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10734
10734
|
}
|
10735
10735
|
));
|
10736
10736
|
q_.displayName = "CardTitle";
|
10737
|
-
const G_ =
|
10737
|
+
const G_ = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10738
10738
|
"div",
|
10739
10739
|
{
|
10740
10740
|
ref: n,
|
@@ -10743,9 +10743,9 @@ const G_ = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10743
10743
|
}
|
10744
10744
|
));
|
10745
10745
|
G_.displayName = "CardDescription";
|
10746
|
-
const As =
|
10746
|
+
const As = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
|
10747
10747
|
As.displayName = "CardContent";
|
10748
|
-
const Ms =
|
10748
|
+
const Ms = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10749
10749
|
"div",
|
10750
10750
|
{
|
10751
10751
|
ref: n,
|
@@ -10774,7 +10774,7 @@ const Yu = () => {
|
|
10774
10774
|
if (!e)
|
10775
10775
|
throw new Error("useTheme must be used within a ThemeProvider");
|
10776
10776
|
return e;
|
10777
|
-
}, Ju =
|
10777
|
+
}, Ju = ce.forwardRef(({ className: e, children: t, onViewportScroll: n, ...r }, o) => /* @__PURE__ */ D(
|
10778
10778
|
ot.Root,
|
10779
10779
|
{
|
10780
10780
|
ref: o,
|
@@ -10795,7 +10795,7 @@ const Yu = () => {
|
|
10795
10795
|
}
|
10796
10796
|
));
|
10797
10797
|
Ju.displayName = ot.Root.displayName;
|
10798
|
-
const Xu =
|
10798
|
+
const Xu = ce.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ m(
|
10799
10799
|
ot.ScrollAreaScrollbar,
|
10800
10800
|
{
|
10801
10801
|
ref: r,
|
@@ -10811,7 +10811,7 @@ const Xu = ue.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r
|
|
10811
10811
|
}
|
10812
10812
|
));
|
10813
10813
|
Xu.displayName = ot.ScrollAreaScrollbar.displayName;
|
10814
|
-
const K_ = Ae.Root, Y_ = Ae.Portal, Qu =
|
10814
|
+
const K_ = Ae.Root, Y_ = Ae.Portal, Qu = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10815
10815
|
Ae.Overlay,
|
10816
10816
|
{
|
10817
10817
|
ref: n,
|
@@ -10823,7 +10823,7 @@ const K_ = Ae.Root, Y_ = Ae.Portal, Qu = ue.forwardRef(({ className: e, ...t },
|
|
10823
10823
|
}
|
10824
10824
|
));
|
10825
10825
|
Qu.displayName = Ae.Overlay.displayName;
|
10826
|
-
const Zu =
|
10826
|
+
const Zu = ce.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ D(Y_, { children: [
|
10827
10827
|
/* @__PURE__ */ m(Qu, {}),
|
10828
10828
|
/* @__PURE__ */ D(
|
10829
10829
|
Ae.Content,
|
@@ -10845,7 +10845,7 @@ const Zu = ue.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE_
|
|
10845
10845
|
)
|
10846
10846
|
] }));
|
10847
10847
|
Zu.displayName = Ae.Content.displayName;
|
10848
|
-
const el =
|
10848
|
+
const el = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10849
10849
|
Ae.Title,
|
10850
10850
|
{
|
10851
10851
|
ref: n,
|
@@ -10857,7 +10857,7 @@ const el = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10857
10857
|
}
|
10858
10858
|
));
|
10859
10859
|
el.displayName = Ae.Title.displayName;
|
10860
|
-
const tl =
|
10860
|
+
const tl = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10861
10861
|
Ae.Description,
|
10862
10862
|
{
|
10863
10863
|
ref: n,
|
@@ -10868,7 +10868,7 @@ const tl = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10868
10868
|
tl.displayName = Ae.Description.displayName;
|
10869
10869
|
function J_(e, t = 50, n = !0) {
|
10870
10870
|
const [r, o] = z("");
|
10871
|
-
return
|
10871
|
+
return ae(() => {
|
10872
10872
|
if (!n) return;
|
10873
10873
|
let s = 0;
|
10874
10874
|
const c = ((u, l) => {
|
@@ -10885,7 +10885,7 @@ function J_(e, t = 50, n = !0) {
|
|
10885
10885
|
const ua = ["Reviewing...", "Thinking...", "Validating..."];
|
10886
10886
|
function X_() {
|
10887
10887
|
const [e, t] = z(0);
|
10888
|
-
return
|
10888
|
+
return ae(() => {
|
10889
10889
|
const n = setInterval(() => {
|
10890
10890
|
t((r) => (r + 1) % ua.length);
|
10891
10891
|
}, 3e3);
|
@@ -10918,13 +10918,13 @@ function nl({ isWaiting: e = !1, ...t }) {
|
|
10918
10918
|
alignment: ad.TopCenter
|
10919
10919
|
})
|
10920
10920
|
}), c = ud(i, "State Machine 1", "waiting");
|
10921
|
-
return
|
10921
|
+
return ae(() => {
|
10922
10922
|
if (c)
|
10923
10923
|
try {
|
10924
10924
|
c.value = e;
|
10925
10925
|
} catch {
|
10926
10926
|
}
|
10927
|
-
}, [i, c, e]),
|
10927
|
+
}, [i, c, e]), ae(() => {
|
10928
10928
|
i && r?.();
|
10929
10929
|
}, [i]), /* @__PURE__ */ m(
|
10930
10930
|
"div",
|
@@ -11232,9 +11232,9 @@ function aw() {
|
|
11232
11232
|
});
|
11233
11233
|
}
|
11234
11234
|
};
|
11235
|
-
return
|
11235
|
+
return ae(() => {
|
11236
11236
|
n.current ? (u("instant"), n.current = !1) : s || u();
|
11237
|
-
}, [e.messages, s]),
|
11237
|
+
}, [e.messages, s]), ae(() => {
|
11238
11238
|
const l = t.current?.querySelector(
|
11239
11239
|
"div.chat-interface-body"
|
11240
11240
|
);
|
@@ -11292,7 +11292,7 @@ function aw() {
|
|
11292
11292
|
)
|
11293
11293
|
] });
|
11294
11294
|
}
|
11295
|
-
const ol =
|
11295
|
+
const ol = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11296
11296
|
"textarea",
|
11297
11297
|
{
|
11298
11298
|
className: A(
|
@@ -11496,7 +11496,7 @@ function fw() {
|
|
11496
11496
|
] })
|
11497
11497
|
] });
|
11498
11498
|
}
|
11499
|
-
const il =
|
11499
|
+
const il = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11500
11500
|
Ut.Root,
|
11501
11501
|
{
|
11502
11502
|
ref: n,
|
@@ -11508,7 +11508,7 @@ const il = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
11508
11508
|
}
|
11509
11509
|
));
|
11510
11510
|
il.displayName = Ut.Root.displayName;
|
11511
|
-
const hw =
|
11511
|
+
const hw = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11512
11512
|
Ut.Image,
|
11513
11513
|
{
|
11514
11514
|
ref: n,
|
@@ -11517,7 +11517,7 @@ const hw = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
11517
11517
|
}
|
11518
11518
|
));
|
11519
11519
|
hw.displayName = Ut.Image.displayName;
|
11520
|
-
const pw =
|
11520
|
+
const pw = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11521
11521
|
Ut.Fallback,
|
11522
11522
|
{
|
11523
11523
|
ref: n,
|
@@ -11620,7 +11620,13 @@ function cl({
|
|
11620
11620
|
] }, "chat-interface-sekelton");
|
11621
11621
|
}
|
11622
11622
|
function gw(e) {
|
11623
|
-
const t = { cleanChatButton: !0, ...e }, {
|
11623
|
+
const t = { cleanChatButton: !0, ...e }, {
|
11624
|
+
isOpen: n = !1,
|
11625
|
+
isMobile: r,
|
11626
|
+
onCleanChat: o,
|
11627
|
+
onClose: s,
|
11628
|
+
theme: i
|
11629
|
+
} = t, c = Qo(n, 10), [a, u] = z(!1), l = al({
|
11624
11630
|
isOpen: c,
|
11625
11631
|
isMobile: r
|
11626
11632
|
}), d = () => a ? /* @__PURE__ */ D(Ns, { className: l, children: [
|
@@ -12099,8 +12105,8 @@ const dl = (e) => {
|
|
12099
12105
|
region: b
|
12100
12106
|
}
|
12101
12107
|
});
|
12102
|
-
const { InAppMessaging: Z, Push:
|
12103
|
-
if (Z?.AWSPinpoint ||
|
12108
|
+
const { InAppMessaging: Z, Push: ie } = j ?? {};
|
12109
|
+
if (Z?.AWSPinpoint || ie?.AWSPinpoint) {
|
12104
12110
|
if (Z?.AWSPinpoint) {
|
12105
12111
|
const { appId: G, region: ke } = Z.AWSPinpoint;
|
12106
12112
|
L.Notifications = {
|
@@ -12112,8 +12118,8 @@ const dl = (e) => {
|
|
12112
12118
|
}
|
12113
12119
|
};
|
12114
12120
|
}
|
12115
|
-
if (
|
12116
|
-
const { appId: G, region: ke } =
|
12121
|
+
if (ie?.AWSPinpoint) {
|
12122
|
+
const { appId: G, region: ke } = ie.AWSPinpoint;
|
12117
12123
|
L.Notifications = {
|
12118
12124
|
...L.Notifications,
|
12119
12125
|
PushNotification: {
|
@@ -12142,7 +12148,7 @@ const dl = (e) => {
|
|
12142
12148
|
status: a && a.toLowerCase(),
|
12143
12149
|
totpEnabled: u?.includes("TOTP") ?? !1,
|
12144
12150
|
smsEnabled: u?.includes("SMS") ?? !1
|
12145
|
-
} : void 0,
|
12151
|
+
} : void 0, ue = l ? {
|
12146
12152
|
minLength: l.passwordPolicyMinLength,
|
12147
12153
|
requireLowercase: l.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE") ?? !1,
|
12148
12154
|
requireUppercase: l.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE") ?? !1,
|
@@ -12165,7 +12171,7 @@ const dl = (e) => {
|
|
12165
12171
|
userPoolClientId: w,
|
12166
12172
|
userPoolId: _,
|
12167
12173
|
mfa: P,
|
12168
|
-
passwordFormat:
|
12174
|
+
passwordFormat: ue,
|
12169
12175
|
loginWith: {
|
12170
12176
|
username: !(Se || Ht),
|
12171
12177
|
email: Se,
|
@@ -12980,7 +12986,7 @@ const Mv = {}, Dv = (e, t) => Mv[e]?.[t]?.additionalDetails, Lv = "aws-amplify",
|
|
12980
12986
|
}
|
12981
12987
|
return n;
|
12982
12988
|
}, Fv = (e) => Uv(e).map(([r, o]) => r && o ? `${r}/${o}` : r).join(" ");
|
12983
|
-
function
|
12989
|
+
function se(e) {
|
12984
12990
|
return typeof e == "function";
|
12985
12991
|
}
|
12986
12992
|
function Bv(e) {
|
@@ -13032,7 +13038,7 @@ var $s = function() {
|
|
13032
13038
|
else
|
13033
13039
|
i.remove(this);
|
13034
13040
|
var l = this.initialTeardown;
|
13035
|
-
if (
|
13041
|
+
if (se(l))
|
13036
13042
|
try {
|
13037
13043
|
l();
|
13038
13044
|
} catch (g) {
|
@@ -13095,10 +13101,10 @@ var $s = function() {
|
|
13095
13101
|
}();
|
13096
13102
|
$s.EMPTY;
|
13097
13103
|
function bl(e) {
|
13098
|
-
return e instanceof $s || e && "closed" in e &&
|
13104
|
+
return e instanceof $s || e && "closed" in e && se(e.remove) && se(e.add) && se(e.unsubscribe);
|
13099
13105
|
}
|
13100
13106
|
function Ma(e) {
|
13101
|
-
|
13107
|
+
se(e) ? e() : e.unsubscribe();
|
13102
13108
|
}
|
13103
13109
|
var $v = {
|
13104
13110
|
Promise: void 0
|
@@ -13189,7 +13195,7 @@ var Hs = function(e) {
|
|
13189
13195
|
Us(t, e);
|
13190
13196
|
function t(n, r, o) {
|
13191
13197
|
var s = e.call(this) || this, i;
|
13192
|
-
return
|
13198
|
+
return se(n) || !n ? i = {
|
13193
13199
|
next: n ?? void 0,
|
13194
13200
|
error: r ?? void 0,
|
13195
13201
|
complete: o ?? void 0
|
@@ -13286,13 +13292,13 @@ function La(e) {
|
|
13286
13292
|
return (t = e ?? $v.Promise) !== null && t !== void 0 ? t : Promise;
|
13287
13293
|
}
|
13288
13294
|
function Kv(e) {
|
13289
|
-
return e &&
|
13295
|
+
return e && se(e.next) && se(e.error) && se(e.complete);
|
13290
13296
|
}
|
13291
13297
|
function Yv(e) {
|
13292
13298
|
return e && e instanceof Hs || Kv(e) && bl(e);
|
13293
13299
|
}
|
13294
13300
|
function Jv(e) {
|
13295
|
-
return
|
13301
|
+
return se(e?.lift);
|
13296
13302
|
}
|
13297
13303
|
function Br(e) {
|
13298
13304
|
return function(t) {
|
@@ -13349,13 +13355,13 @@ var Xv = function(e) {
|
|
13349
13355
|
return e && typeof e.length == "number" && typeof e != "function";
|
13350
13356
|
};
|
13351
13357
|
function vl(e) {
|
13352
|
-
return
|
13358
|
+
return se(e?.then);
|
13353
13359
|
}
|
13354
13360
|
function Sl(e) {
|
13355
|
-
return
|
13361
|
+
return se(e[Ws]);
|
13356
13362
|
}
|
13357
13363
|
function El(e) {
|
13358
|
-
return Symbol.asyncIterator &&
|
13364
|
+
return Symbol.asyncIterator && se(e?.[Symbol.asyncIterator]);
|
13359
13365
|
}
|
13360
13366
|
function xl(e) {
|
13361
13367
|
return new TypeError("You provided " + (e !== null && typeof e == "object" ? "an invalid object" : "'" + e + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
@@ -13365,7 +13371,7 @@ function Qv() {
|
|
13365
13371
|
}
|
13366
13372
|
var Il = Qv();
|
13367
13373
|
function kl(e) {
|
13368
|
-
return
|
13374
|
+
return se(e?.[Il]);
|
13369
13375
|
}
|
13370
13376
|
function Cl(e) {
|
13371
13377
|
return Zw(this, arguments, function() {
|
@@ -13399,7 +13405,7 @@ function Cl(e) {
|
|
13399
13405
|
});
|
13400
13406
|
}
|
13401
13407
|
function Tl(e) {
|
13402
|
-
return
|
13408
|
+
return se(e?.getReader);
|
13403
13409
|
}
|
13404
13410
|
function js(e) {
|
13405
13411
|
if (e instanceof ve)
|
@@ -13423,7 +13429,7 @@ function js(e) {
|
|
13423
13429
|
function Zv(e) {
|
13424
13430
|
return new ve(function(t) {
|
13425
13431
|
var n = e[Ws]();
|
13426
|
-
if (
|
13432
|
+
if (se(n.subscribe))
|
13427
13433
|
return n.subscribe(t);
|
13428
13434
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
13429
13435
|
});
|
@@ -13574,7 +13580,7 @@ function cS(e, t) {
|
|
13574
13580
|
i ? n.complete() : n.next(s);
|
13575
13581
|
}, 0, !0);
|
13576
13582
|
}), function() {
|
13577
|
-
return
|
13583
|
+
return se(r?.return) && r.return();
|
13578
13584
|
};
|
13579
13585
|
});
|
13580
13586
|
}
|
@@ -14118,10 +14124,10 @@ var Be;
|
|
14118
14124
|
(function(e) {
|
14119
14125
|
e[e.PENDING = 0] = "PENDING", e[e.CONNECTED = 1] = "CONNECTED", e[e.FAILED = 2] = "FAILED";
|
14120
14126
|
})(Be || (Be = {}));
|
14121
|
-
var
|
14127
|
+
var fe;
|
14122
14128
|
(function(e) {
|
14123
14129
|
e[e.CLOSED = 0] = "CLOSED", e[e.READY = 1] = "READY", e[e.CONNECTING = 2] = "CONNECTING";
|
14124
|
-
})(
|
14130
|
+
})(fe || (fe = {}));
|
14125
14131
|
const l0 = {
|
14126
14132
|
accept: "application/json, text/javascript",
|
14127
14133
|
"content-encoding": "amz-1.0",
|
@@ -14348,7 +14354,7 @@ const ja = "wss://", _0 = /^https:\/\/\w{26}\.appsync-api\.\w{2}(?:(?:-\w{2,})+)
|
|
14348
14354
|
};
|
14349
14355
|
class R0 {
|
14350
14356
|
constructor(t) {
|
14351
|
-
this.subscriptionObserverMap = /* @__PURE__ */ new Map(), this.allowNoSubscriptions = !1, this.socketStatus =
|
14357
|
+
this.subscriptionObserverMap = /* @__PURE__ */ new Map(), this.allowNoSubscriptions = !1, this.socketStatus = fe.CLOSED, this.keepAliveTimestamp = Date.now(), this.promiseArray = [], this.connectionStateMonitor = new y0(), this.reconnectionMonitor = new b0(), this._establishConnection = async (n, r) => {
|
14352
14358
|
this.logger.debug(`Establishing WebSocket connection to ${n}`);
|
14353
14359
|
try {
|
14354
14360
|
await this._openConnection(n, r), await this._initiateHandshake();
|
@@ -14364,7 +14370,7 @@ class R0 {
|
|
14364
14370
|
* Mark the socket closed and release all active listeners
|
14365
14371
|
*/
|
14366
14372
|
close() {
|
14367
|
-
return this.socketStatus =
|
14373
|
+
return this.socketStatus = fe.CLOSED, this.connectionStateMonitor.record(xe.CONNECTION_FAILED), this.connectionStateMonitorSubscription.unsubscribe(), this.reconnectionMonitor.close(), new Promise((t, n) => {
|
14368
14374
|
this.awsRealTimeSocket ? (this.awsRealTimeSocket.onclose = (r) => {
|
14369
14375
|
this._closeSocket(), this.subscriptionObserverMap = /* @__PURE__ */ new Map(), this.awsRealTimeSocket = void 0, t();
|
14370
14376
|
}, this.awsRealTimeSocket.onerror = (r) => {
|
@@ -14407,10 +14413,10 @@ class R0 {
|
|
14407
14413
|
});
|
14408
14414
|
}
|
14409
14415
|
async connect(t) {
|
14410
|
-
this.socketStatus !==
|
14416
|
+
this.socketStatus !== fe.READY && await this._connectWebSocket(t);
|
14411
14417
|
}
|
14412
14418
|
async publish(t, n) {
|
14413
|
-
if (this.socketStatus !==
|
14419
|
+
if (this.socketStatus !== fe.READY)
|
14414
14420
|
throw new Error("Subscription has not been initialized");
|
14415
14421
|
return this._publishMessage(t, n);
|
14416
14422
|
}
|
@@ -14562,7 +14568,7 @@ class R0 {
|
|
14562
14568
|
}
|
14563
14569
|
_sendUnsubscriptionMessage(t) {
|
14564
14570
|
try {
|
14565
|
-
if (this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.socketStatus ===
|
14571
|
+
if (this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.socketStatus === fe.READY) {
|
14566
14572
|
const n = this._unsubscribeMessage(t), r = JSON.stringify(n);
|
14567
14573
|
this.awsRealTimeSocket.send(r);
|
14568
14574
|
}
|
@@ -14576,7 +14582,7 @@ class R0 {
|
|
14576
14582
|
_closeSocketIfRequired() {
|
14577
14583
|
if (!(this.subscriptionObserverMap.size > 0)) {
|
14578
14584
|
if (!this.awsRealTimeSocket) {
|
14579
|
-
this.socketStatus =
|
14585
|
+
this.socketStatus = fe.CLOSED;
|
14580
14586
|
return;
|
14581
14587
|
}
|
14582
14588
|
if (this.connectionStateMonitor.record(xe.CLOSING_CONNECTION), this.awsRealTimeSocket.bufferedAmount > 0)
|
@@ -14584,7 +14590,7 @@ class R0 {
|
|
14584
14590
|
else {
|
14585
14591
|
this.logger.debug("closing WebSocket...");
|
14586
14592
|
const t = this.awsRealTimeSocket;
|
14587
|
-
t.onclose = null, t.onerror = null, t.close(1e3), this.awsRealTimeSocket = void 0, this.socketStatus =
|
14593
|
+
t.onclose = null, t.onerror = null, t.close(1e3), this.awsRealTimeSocket = void 0, this.socketStatus = fe.CLOSED, this._closeSocket();
|
14588
14594
|
}
|
14589
14595
|
}
|
14590
14596
|
}
|
@@ -14646,7 +14652,7 @@ class R0 {
|
|
14646
14652
|
}
|
14647
14653
|
}
|
14648
14654
|
_errorDisconnect(t) {
|
14649
|
-
this.logger.debug(`Disconnect error: ${t}`), this.awsRealTimeSocket && (this._closeSocket(), this.awsRealTimeSocket.close()), this.socketStatus =
|
14655
|
+
this.logger.debug(`Disconnect error: ${t}`), this.awsRealTimeSocket && (this._closeSocket(), this.awsRealTimeSocket.close()), this.socketStatus = fe.CLOSED;
|
14650
14656
|
}
|
14651
14657
|
_closeSocket() {
|
14652
14658
|
this.keepAliveHeartbeatIntervalId && (clearInterval(this.keepAliveHeartbeatIntervalId), this.keepAliveHeartbeatIntervalId = void 0), this.connectionStateMonitor.record(xe.CLOSED);
|
@@ -14666,11 +14672,11 @@ class R0 {
|
|
14666
14672
|
}
|
14667
14673
|
}
|
14668
14674
|
_initializeWebSocketConnection({ appSyncGraphqlEndpoint: t, authenticationType: n, apiKey: r, region: o, additionalCustomHeaders: s }) {
|
14669
|
-
if (this.socketStatus !==
|
14675
|
+
if (this.socketStatus !== fe.READY)
|
14670
14676
|
return new Promise(async (i, c) => {
|
14671
|
-
if (this.promiseArray.push({ res: i, rej: c }), this.socketStatus ===
|
14677
|
+
if (this.promiseArray.push({ res: i, rej: c }), this.socketStatus === fe.CLOSED)
|
14672
14678
|
try {
|
14673
|
-
this.socketStatus =
|
14679
|
+
this.socketStatus = fe.CONNECTING;
|
14674
14680
|
const u = await Wl({
|
14675
14681
|
authenticationType: n,
|
14676
14682
|
payload: "{}",
|
@@ -14685,11 +14691,11 @@ class R0 {
|
|
14685
14691
|
})}`, h = I0(s), p = k0(t, h);
|
14686
14692
|
await this._establishRetryableConnection(p, f), this.promiseArray.forEach(({ res: g }) => {
|
14687
14693
|
this.logger.debug("Notifying connection successful"), g();
|
14688
|
-
}), this.socketStatus =
|
14694
|
+
}), this.socketStatus = fe.READY, this.promiseArray = [];
|
14689
14695
|
} catch (a) {
|
14690
14696
|
this.logger.debug("Connection exited with", a), this.promiseArray.forEach(({ rej: u }) => {
|
14691
14697
|
u(a);
|
14692
|
-
}), this.promiseArray = [], this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.awsRealTimeSocket.close(3001), this.awsRealTimeSocket = void 0, this.socketStatus =
|
14698
|
+
}), this.promiseArray = [], this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.awsRealTimeSocket.close(3001), this.awsRealTimeSocket = void 0, this.socketStatus = fe.CLOSED;
|
14693
14699
|
}
|
14694
14700
|
});
|
14695
14701
|
}
|
@@ -14900,28 +14906,25 @@ async function D0(e, t) {
|
|
14900
14906
|
}
|
14901
14907
|
};
|
14902
14908
|
}
|
14903
|
-
const L0 =
|
14904
|
-
message_id:
|
14905
|
-
|
14906
|
-
|
14907
|
-
|
14908
|
-
|
14909
|
-
|
14910
|
-
|
14911
|
-
|
14912
|
-
content: se.string()
|
14909
|
+
const L0 = he.object({
|
14910
|
+
message_id: he.string(),
|
14911
|
+
agent_id: he.string(),
|
14912
|
+
user_id: he.string(),
|
14913
|
+
chat_id: he.string(),
|
14914
|
+
created_at: he.string(),
|
14915
|
+
data: he.object({
|
14916
|
+
type: he.string(),
|
14917
|
+
content: he.string()
|
14913
14918
|
})
|
14914
14919
|
});
|
14915
|
-
|
14916
|
-
message_id:
|
14920
|
+
he.object({
|
14921
|
+
message_id: he.string(),
|
14917
14922
|
// message_id from api schema
|
14918
|
-
|
14919
|
-
|
14920
|
-
response: se.object({
|
14921
|
-
id: se.string(),
|
14923
|
+
response: he.object({
|
14924
|
+
id: he.string(),
|
14922
14925
|
// message_id from api schema
|
14923
|
-
type:
|
14924
|
-
content:
|
14926
|
+
type: he.string(),
|
14927
|
+
content: he.string()
|
14925
14928
|
})
|
14926
14929
|
});
|
14927
14930
|
function P0({
|
@@ -14930,11 +14933,11 @@ function P0({
|
|
14930
14933
|
chatSettings: n
|
14931
14934
|
}) {
|
14932
14935
|
const r = `/default/chat/${e}`, [o, s] = z(!1), i = n?.app_sync_url, c = n?.app_sync_region, a = n?.app_sync_api_key;
|
14933
|
-
|
14936
|
+
ae(() => {
|
14934
14937
|
(i || c || a) && (qs.configure(
|
14935
14938
|
rw(i, a, c)
|
14936
14939
|
), s(!0));
|
14937
|
-
}, [i, a, c]),
|
14940
|
+
}, [i, a, c]), ae(() => {
|
14938
14941
|
if (!o || !e) return;
|
14939
14942
|
let u = null;
|
14940
14943
|
return (async () => {
|
@@ -14952,7 +14955,6 @@ function P0({
|
|
14952
14955
|
console.log("Received response:", h);
|
14953
14956
|
const p = typeof h.data == "string" ? JSON.parse(h.data) : h.data, g = {
|
14954
14957
|
message_id: h.message_id,
|
14955
|
-
message_number: h.message_number,
|
14956
14958
|
response: {
|
14957
14959
|
id: h.message_id,
|
14958
14960
|
type: p.type,
|
@@ -15045,7 +15047,7 @@ function U0({
|
|
15045
15047
|
text: b.content,
|
15046
15048
|
userId: n || t,
|
15047
15049
|
deviceId: r
|
15048
|
-
})).
|
15050
|
+
})).chat_id, a({ id: x }));
|
15049
15051
|
} catch (x) {
|
15050
15052
|
throw clearTimeout(h.current), h.current = null, i(
|
15051
15053
|
(E) => E.filter((_) => Array.isArray(_) ? !0 : !_.isThinking)
|
@@ -15154,7 +15156,7 @@ function B0(e, t, n) {
|
|
15154
15156
|
}
|
15155
15157
|
function $0(e) {
|
15156
15158
|
const { appId: t, initialUserId: n } = e, { getSavedConversationData: r } = Ls({ appId: t }), [o, s] = z(!1), [i, c] = z(""), [a, u] = z(""), [l, d] = z(null);
|
15157
|
-
return
|
15159
|
+
return ae(() => {
|
15158
15160
|
const f = r();
|
15159
15161
|
f?.userId ? f?.externalId !== n ? (c(f.userId), d(n)) : (c(f?.userId), d(f.externalId)) : n ? (c(n), d(n)) : c(crypto.randomUUID()), u(f?.deviceId || crypto.randomUUID()), s(!0);
|
15160
15162
|
}, [r, n]), {
|
@@ -15183,7 +15185,7 @@ function H0({
|
|
15183
15185
|
appId: e
|
15184
15186
|
})
|
15185
15187
|
), [d, f] = z(null), [h, p] = z(null), [g, y] = z([]), [b, v] = z(!1), E = B0(`sdk-boot-${e}`, () => l.boot()).fetch;
|
15186
|
-
return
|
15188
|
+
return ae(() => {
|
15187
15189
|
if (i())
|
15188
15190
|
c();
|
15189
15191
|
else {
|
@@ -15196,7 +15198,7 @@ function H0({
|
|
15196
15198
|
id: _
|
15197
15199
|
}), I && I.length > 0 && y(I));
|
15198
15200
|
}
|
15199
|
-
}, [a, i, c]),
|
15201
|
+
}, [a, i, c]), ae(() => {
|
15200
15202
|
if (!s) return;
|
15201
15203
|
(async () => {
|
15202
15204
|
const [w, I] = await z_(E());
|
@@ -15230,12 +15232,12 @@ function W0(e) {
|
|
15230
15232
|
const [t, n] = z(!1), [r, o] = z(
|
15231
15233
|
null
|
15232
15234
|
), s = e ?? t;
|
15233
|
-
return
|
15235
|
+
return ae(() => {
|
15234
15236
|
const i = () => {
|
15235
15237
|
n(window.innerWidth <= 640);
|
15236
15238
|
};
|
15237
15239
|
return i(), window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
15238
|
-
}, []),
|
15240
|
+
}, []), ae(() => {
|
15239
15241
|
const i = document.createElement("div");
|
15240
15242
|
return i.className = "eloquent-ai-chat-portal", i.style.position = "relative", i.style.zIndex = "30", document.body.appendChild(i), o(i), () => {
|
15241
15243
|
i.parentElement && i.parentElement.removeChild(i);
|
@@ -15277,11 +15279,11 @@ function z0({
|
|
15277
15279
|
setCurrentConversation: I,
|
15278
15280
|
setChatOpen: v
|
15279
15281
|
});
|
15280
|
-
return
|
15282
|
+
return ae(() => {
|
15281
15283
|
p.length > 0 && _(p);
|
15282
|
-
}, [p]),
|
15284
|
+
}, [p]), ae(() => {
|
15283
15285
|
h && I(h);
|
15284
|
-
}, [h]),
|
15286
|
+
}, [h]), ae(() => {
|
15285
15287
|
w && u && d?.identifyUser({
|
15286
15288
|
userId: a,
|
15287
15289
|
externalId: u,
|