@opencx/widget-react 4.0.56 → 4.0.57

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.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as d, Fragment as J } from "react/jsx-runtime";
2
2
  import * as me from "@radix-ui/react-popover";
3
3
  import * as ee from "react";
4
- import L, { memo as rr, forwardRef as yt, useState as E, cloneElement as kt, createContext as or, useEffect as se, useContext as nr, useRef as B, useCallback as G, useMemo as Ct, createElement as ct } from "react";
5
- import { useWidget as O, useConfig as z, useSessions as U, useMessages as A, useWidgetRouter as H, useDocumentDir as ke, useWidgetTrigger as Z, useModes as zt, useCsat as Nt, useUploadFiles as sr, useIsAwaitingBotReply as St, useContact as _t, WidgetProvider as ar, WidgetTriggerProvider as ir } from "@opencx/widget-react-headless";
4
+ import L, { memo as rr, forwardRef as yt, useState as R, cloneElement as kt, createContext as or, useEffect as se, useContext as nr, useRef as B, useCallback as G, useMemo as Ct, createElement as ct } from "react";
5
+ import { useWidget as O, useConfig as N, useSessions as U, useMessages as A, useWidgetRouter as H, useDocumentDir as ke, useWidgetTrigger as Z, useModes as zt, useCsat as Nt, useUploadFiles as sr, useIsAwaitingBotReply as St, useContact as _t, WidgetProvider as ar, WidgetTriggerProvider as ir } from "@opencx/widget-react-headless";
6
6
  import { X as lr, ZoomOut as cr, ZoomIn as dr, RotateCcw as pr, FileText as It, FileSpreadsheet as Tt, CircleDashedIcon as mr, XIcon as Ce, SquareXIcon as hr, SquareCheckBigIcon as gr, SquareCheckIcon as ur, ShrinkIcon as wr, Minimize2Icon as fr, MinimizeIcon as xr, Maximize2Icon as vr, MaximizeIcon as br, ExpandIcon as yr, CircleXIcon as kr, CircleCheckBigIcon as Cr, CircleCheckIcon as Mt, CheckCheckIcon as zr, CheckIcon as Nr, ChevronLeftIcon as Sr, LoaderIcon as _r, ArrowUpIcon as Dt, PaperclipIcon as dt, CircleDashed as Ir, AlertCircle as Tr, Loader2 as Mr, FileAudio2Icon as Dr, FileVideo2Icon as Er, FileIcon as Rr, UserRoundIcon as Pr, ChevronRightIcon as jr, SendHorizontal as Or, ChevronDownIcon as Ar } from "lucide-react";
7
7
  import { clsx as Fr } from "clsx";
8
8
  import { twMerge as Hr } from "tailwind-merge";
@@ -61,26 +61,26 @@ const Q = {
61
61
  }, Y = rr(
62
62
  yt(
63
63
  ({ children: e, className: o, scale: t = 1.02, off: n = !1 }, s) => {
64
- const [i, a] = E(!1), [l, c] = E({ x: 0, y: 0 });
64
+ const [i, a] = R(!1), [l, c] = R({ x: 0, y: 0 });
65
65
  if (n || /translate/.test(
66
66
  e.props.className || ""
67
67
  )) return e;
68
68
  const v = (x) => {
69
- var D, g;
70
- const { clientX: C, clientY: I } = x, y = x.currentTarget.getBoundingClientRect(), S = C - (y.left + y.width / 2), R = I - (y.top + y.height / 2), j = Math.max(
69
+ var E, g;
70
+ const { clientX: z, clientY: I } = x, y = x.currentTarget.getBoundingClientRect(), k = z - (y.left + y.width / 2), D = I - (y.top + y.height / 2), j = Math.max(
71
71
  -1,
72
- Math.min(1, S / (y.width / 2))
72
+ Math.min(1, k / (y.width / 2))
73
73
  ), w = Math.max(
74
74
  -1,
75
- Math.min(1, R / (y.height / 2))
75
+ Math.min(1, D / (y.height / 2))
76
76
  ), T = j * Q.x, P = w * Q.y;
77
- c({ x: T, y: P }), (g = (D = e.props).onMouseMove) == null || g.call(D, x);
77
+ c({ x: T, y: P }), (g = (E = e.props).onMouseMove) == null || g.call(E, x);
78
78
  }, b = () => {
79
- var x, C;
80
- a(!0), (C = (x = e.props).onMouseEnter) == null || C.call(x);
79
+ var x, z;
80
+ a(!0), (z = (x = e.props).onMouseEnter) == null || z.call(x);
81
81
  }, u = () => {
82
- var x, C;
83
- a(!1), c({ x: 0, y: 0 }), (C = (x = e.props).onMouseLeave) == null || C.call(x);
82
+ var x, z;
83
+ a(!1), c({ x: 0, y: 0 }), (z = (x = e.props).onMouseLeave) == null || z.call(x);
84
84
  }, h = {
85
85
  "--wobble-x": i ? `${l.x}px` : "0px",
86
86
  "--wobble-y": i ? `${l.y}px` : "0px",
@@ -129,7 +129,7 @@ const qr = 10, Vr = (e, o, t) => ({
129
129
  left: Gr,
130
130
  up: Zr,
131
131
  down: Kr
132
- }, k = yt(
132
+ }, C = yt(
133
133
  ({
134
134
  fadeIn: e = "down",
135
135
  distance: o = qr,
@@ -143,7 +143,7 @@ const qr = 10, Vr = (e, o, t) => ({
143
143
  return n && c.exit && typeof c.exit == "object" && !Array.isArray(c.exit) && (c.exit.transition = { duration: 0 }), /* @__PURE__ */ r(re.div, { ref: l, ...a, ...c, children: t });
144
144
  }
145
145
  );
146
- k.displayName = "MotionDiv";
146
+ C.displayName = "MotionDiv";
147
147
  const Jr = Lr(
148
148
  m(
149
149
  "inline-flex shrink-0 items-center justify-center gap-2",
@@ -183,7 +183,7 @@ const Jr = Lr(
183
183
  size: "default"
184
184
  }
185
185
  }
186
- ), N = ee.forwardRef(
186
+ ), S = ee.forwardRef(
187
187
  ({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, i) => /* @__PURE__ */ r(Y, { ref: i, children: /* @__PURE__ */ r(
188
188
  n ? Wr : "button",
189
189
  {
@@ -194,10 +194,10 @@ const Jr = Lr(
194
194
  }
195
195
  ) })
196
196
  );
197
- N.displayName = "Button";
197
+ S.displayName = "Button";
198
198
  const Ot = or(null);
199
199
  function eo({ children: e }) {
200
- const [o, t] = E(!1), [n, s] = E(null), i = (l) => {
200
+ const [o, t] = R(!1), [n, s] = R(null), i = (l) => {
201
201
  s(l), t(!0);
202
202
  }, a = () => {
203
203
  t(!1), setTimeout(() => {
@@ -244,7 +244,7 @@ function to() {
244
244
  );
245
245
  };
246
246
  }, []), /* @__PURE__ */ r(M, { mode: "wait", children: o && t && /* @__PURE__ */ r(
247
- k,
247
+ C,
248
248
  {
249
249
  overrides: {
250
250
  initial: { y: 0 },
@@ -275,7 +275,7 @@ function ze({
275
275
  children: [
276
276
  e,
277
277
  t && /* @__PURE__ */ d(
278
- N,
278
+ S,
279
279
  {
280
280
  size: "fit",
281
281
  className: "rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",
@@ -366,9 +366,9 @@ function $t({
366
366
  src: e,
367
367
  alt: o
368
368
  }) {
369
- const [t, n] = E(1), [s, i] = E({ x: 0, y: 0 }), [a, l] = E(!1), c = B({ x: 0, y: 0 }), p = B({ x: 0, y: 0 }), v = B(null), b = B(null), u = B(!1), h = (w) => Math.min(gt, Math.max(ht, w)), x = G(() => {
369
+ const [t, n] = R(1), [s, i] = R({ x: 0, y: 0 }), [a, l] = R(!1), c = B({ x: 0, y: 0 }), p = B({ x: 0, y: 0 }), v = B(null), b = B(null), u = B(!1), h = (w) => Math.min(gt, Math.max(ht, w)), x = G(() => {
370
370
  n(1), i({ x: 0, y: 0 });
371
- }, []), C = G(() => {
371
+ }, []), z = G(() => {
372
372
  n((w) => h(w + le));
373
373
  }, []), I = G(() => {
374
374
  n((w) => {
@@ -380,8 +380,8 @@ function $t({
380
380
  w.preventDefault(), w.stopPropagation();
381
381
  const T = w.deltaY > 0 ? -le : le;
382
382
  n((P) => {
383
- const D = h(P + T);
384
- return D <= 1 && i({ x: 0, y: 0 }), D;
383
+ const E = h(P + T);
384
+ return E <= 1 && i({ x: 0, y: 0 }), E;
385
385
  });
386
386
  }, []);
387
387
  const y = G(
@@ -389,21 +389,21 @@ function $t({
389
389
  w.preventDefault(), u.current = !1, l(!0), c.current = { x: w.clientX, y: w.clientY }, p.current = { ...s }, w.target.setPointerCapture(w.pointerId);
390
390
  },
391
391
  [s]
392
- ), S = G(
392
+ ), k = G(
393
393
  (w) => {
394
394
  if (!a) return;
395
395
  const T = w.clientX - c.current.x, P = w.clientY - c.current.y;
396
396
  if ((Math.abs(T) > 3 || Math.abs(P) > 3) && (u.current = !0), t <= 1) return;
397
- const D = {
397
+ const E = {
398
398
  x: p.current.x + T / t,
399
399
  y: p.current.y + P / t
400
400
  };
401
401
  i(
402
- oo(D, t, v.current, b.current)
402
+ oo(E, t, v.current, b.current)
403
403
  );
404
404
  },
405
405
  [a, t]
406
- ), R = G(() => {
406
+ ), D = G(() => {
407
407
  const w = u.current;
408
408
  l(!1), !w && n((T) => T > 1 ? (i({ x: 0, y: 0 }), 1) : ro);
409
409
  }, []), j = t > 1;
@@ -422,9 +422,9 @@ function $t({
422
422
  j && "size-full"
423
423
  ),
424
424
  onPointerDown: y,
425
- onPointerMove: S,
426
- onPointerUp: R,
427
- onPointerCancel: R,
425
+ onPointerMove: k,
426
+ onPointerUp: D,
427
+ onPointerCancel: D,
428
428
  style: {
429
429
  cursor: a ? "grabbing" : j ? "grab" : "zoom-in",
430
430
  touchAction: "none"
@@ -453,7 +453,7 @@ function $t({
453
453
  Math.round(t * 100),
454
454
  "%"
455
455
  ] }),
456
- /* @__PURE__ */ r(we, { onClick: C, label: "Zoom in", disabled: t >= gt, children: /* @__PURE__ */ r(dr, { className: "size-3.5" }) }),
456
+ /* @__PURE__ */ r(we, { onClick: z, label: "Zoom in", disabled: t >= gt, children: /* @__PURE__ */ r(dr, { className: "size-3.5" }) }),
457
457
  j && /* @__PURE__ */ d(J, { children: [
458
458
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-white/30 mx-0.5" }),
459
459
  /* @__PURE__ */ r(we, { onClick: x, label: "Reset zoom", children: /* @__PURE__ */ r(pr, { className: "size-3.5" }) })
@@ -610,7 +610,7 @@ function Se({
610
610
  messageType: o,
611
611
  messageId: t
612
612
  }) {
613
- const { anchorTarget: n } = z();
613
+ const { anchorTarget: n } = N();
614
614
  return /* @__PURE__ */ r(
615
615
  Yt,
616
616
  {
@@ -652,7 +652,7 @@ function X() {
652
652
  widgetCtx: { org: e }
653
653
  } = O(), {
654
654
  sessionState: { session: o }
655
- } = U(), t = z(), {
655
+ } = U(), t = N(), {
656
656
  messagesState: { messages: n }
657
657
  } = A(), {
658
658
  routerState: { screen: s }
@@ -779,7 +779,7 @@ function ve({
779
779
  }
780
780
  function ao({ agent: e }) {
781
781
  return /* @__PURE__ */ r(M, { children: /* @__PURE__ */ d(
782
- k,
782
+ C,
783
783
  {
784
784
  ...f("chat/bot_loading/root"),
785
785
  className: "flex flex-row items-end w-full gap-2 animate-pulse",
@@ -823,7 +823,7 @@ function oe({
823
823
  side: t,
824
824
  align: n
825
825
  }) {
826
- const { disableTooltips: s } = z();
826
+ const { disableTooltips: s } = N();
827
827
  return !o || s ? e : /* @__PURE__ */ d(lo, { children: [
828
828
  /* @__PURE__ */ r(co, { asChild: !0, children: e }),
829
829
  /* @__PURE__ */ r(
@@ -855,16 +855,16 @@ const ce = {
855
855
  transitionDuration: "1000ms"
856
856
  };
857
857
  function K() {
858
- var b, u, h, x, C, I, y, S, R, j, w, T, P, D, g, _, ie, Re, Pe, je, Oe, Ae, Fe, He, We, Le, $e, Be, Ye, Ue, Xe, qe, Ve, Ge, Ze, Ke, Qe, Je, et, tt, rt, ot, nt, st, at, it, lt;
859
- const { dir: e } = ke(), { isSmallScreen: o } = $(), { theme: t, inline: n } = z(), s = (q) => n ? "100%" : q, i = (q, ge) => o ? `100dv${q}` : ge, a = (q, ge) => s(i(q, ge)), l = {
858
+ var b, u, h, x, z, I, y, k, D, j, w, T, P, E, g, _, ie, Re, Pe, je, Oe, Ae, Fe, He, We, Le, $e, Be, Ye, Ue, Xe, qe, Ve, Ge, Ze, Ke, Qe, Je, et, tt, rt, ot, nt, st, at, it, lt;
859
+ const { dir: e } = ke(), { isSmallScreen: o } = $(), { theme: t, inline: n } = N(), s = (q) => n ? "100%" : q, i = (q, ge) => o ? `100dv${q}` : ge, a = (q, ge) => s(i(q, ge)), l = {
860
860
  zIndex: ((b = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : b.zIndex) ?? 1e7,
861
861
  offset: {
862
862
  bottom: ((h = (u = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : u.offset) == null ? void 0 : h.bottom) ?? 20,
863
- right: ((C = (x = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : x.offset) == null ? void 0 : C.right) ?? (e === "ltr" ? 20 : "initial"),
863
+ right: ((z = (x = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : x.offset) == null ? void 0 : z.right) ?? (e === "ltr" ? 20 : "initial"),
864
864
  left: ((y = (I = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : I.offset) == null ? void 0 : y.left) ?? (e === "rtl" ? 20 : "initial")
865
865
  },
866
866
  size: {
867
- button: ((R = (S = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : S.size) == null ? void 0 : R.button) ?? 48,
867
+ button: ((D = (k = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : k.size) == null ? void 0 : D.button) ?? 48,
868
868
  icon: ((w = (j = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : j.size) == null ? void 0 : w.icon) ?? 24
869
869
  }
870
870
  }, c = (() => {
@@ -877,7 +877,7 @@ function K() {
877
877
  widgetContentContainer: {
878
878
  borderRadius: o ? "0px" : ((T = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : T.borderRadius) ?? "32px",
879
879
  zIndex: ((P = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : P.zIndex) ?? l.zIndex + 1,
880
- outline: ((D = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : D.outline) ?? "none",
880
+ outline: ((E = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : E.outline) ?? "none",
881
881
  // was: '1px solid'
882
882
  outlineColor: ((g = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : g.outlineColor) ?? "hsl(0 0% 50% / .5)",
883
883
  boxShadow: ((_ = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : _.boxShadow) ?? "0 0px 100px 0px rgb(0 0 0 / 0.25)",
@@ -1053,7 +1053,7 @@ function qt(e) {
1053
1053
  }
1054
1054
  }
1055
1055
  function Vt() {
1056
- const { contentIframeRef: e } = O(), { inline: o } = z();
1056
+ const { contentIframeRef: e } = O(), { inline: o } = N();
1057
1057
  return {
1058
1058
  setWidth: (t) => {
1059
1059
  var n;
@@ -1140,7 +1140,7 @@ function De() {
1140
1140
  widgetCtx: { org: e }
1141
1141
  } = O(), {
1142
1142
  routerState: { screen: o }
1143
- } = H(), { textContent: t } = z();
1143
+ } = H(), { textContent: t } = N();
1144
1144
  return (() => {
1145
1145
  var s, i;
1146
1146
  switch (o) {
@@ -1170,12 +1170,12 @@ function go(e) {
1170
1170
  }
1171
1171
  }
1172
1172
  function uo() {
1173
- const { router: e } = z(), {
1173
+ const { router: e } = N(), {
1174
1174
  routerState: { screen: o },
1175
1175
  toSessionsScreen: t
1176
1176
  } = H();
1177
1177
  return o !== "chat" || e != null && e.chatScreenOnly ? null : /* @__PURE__ */ r(
1178
- N,
1178
+ S,
1179
1179
  {
1180
1180
  variant: "ghost",
1181
1181
  size: "fit",
@@ -1190,7 +1190,7 @@ function wo({
1190
1190
  }) {
1191
1191
  const { setIsOpen: o } = Z(), { isSmallScreen: t } = $(), n = X();
1192
1192
  return t && e.hideOnSmallScreen || !t && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
1193
- N,
1193
+ S,
1194
1194
  {
1195
1195
  variant: "ghost",
1196
1196
  size: "fit",
@@ -1206,7 +1206,7 @@ function wo({
1206
1206
  function be({
1207
1207
  button: e
1208
1208
  }) {
1209
- const [o, t] = E(!1), {
1209
+ const [o, t] = R(!1), {
1210
1210
  routerState: { screen: n }
1211
1211
  } = H(), { isSmallScreen: s } = $(), { theme: i } = K(), { setWidth: a, setHeight: l } = Vt(), c = X();
1212
1212
  if (n !== "chat" && n !== "sessions") return null;
@@ -1236,7 +1236,7 @@ function be({
1236
1236
  }), (u = e.onClicked) == null || u.call(e, c);
1237
1237
  };
1238
1238
  return s && e.hideOnSmallScreen || !s && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
1239
- N,
1239
+ S,
1240
1240
  {
1241
1241
  variant: "ghost",
1242
1242
  size: "fit",
@@ -1256,8 +1256,8 @@ function Gt({
1256
1256
  }) {
1257
1257
  var I, y;
1258
1258
  const { close: o } = he(), { widgetCtx: t } = O(), { setIsOpen: n } = Z(), { resolveSession: s, sessionState: i } = U(), { isSmallScreen: a } = $(), l = X(), c = !i.session, p = ((I = i.session) == null ? void 0 : I.isOpened) === !1, v = e.onResolved || "stay-in-chat", b = e.behaviorBeforeSessionCreation || "disabled", u = e.behaviorIfSessionIsResolved || "disabled", h = !!(i.isResolvingSession || c && b === "disabled" || p && u === "disabled"), x = async () => {
1259
- const { success: S, error: R } = await s();
1260
- if (o(), !S) return console.error(R);
1259
+ const { success: k, error: D } = await s();
1260
+ if (o(), !k) return console.error(D);
1261
1261
  switch (v) {
1262
1262
  case "stay-in-chat":
1263
1263
  return;
@@ -1274,7 +1274,7 @@ function Gt({
1274
1274
  F(v, Gt.name);
1275
1275
  break;
1276
1276
  }
1277
- }, C = () => {
1277
+ }, z = () => {
1278
1278
  if (c)
1279
1279
  switch (b) {
1280
1280
  case "disabled":
@@ -1285,7 +1285,7 @@ function Gt({
1285
1285
  default:
1286
1286
  F(
1287
1287
  b,
1288
- C.name
1288
+ z.name
1289
1289
  );
1290
1290
  }
1291
1291
  if (p)
@@ -1306,7 +1306,7 @@ function Gt({
1306
1306
  default:
1307
1307
  F(
1308
1308
  u,
1309
- C.name
1309
+ z.name
1310
1310
  );
1311
1311
  }
1312
1312
  };
@@ -1314,15 +1314,15 @@ function Gt({
1314
1314
  Ne,
1315
1315
  {
1316
1316
  trigger: /* @__PURE__ */ r(
1317
- N,
1317
+ S,
1318
1318
  {
1319
1319
  variant: "ghost",
1320
1320
  size: "fit",
1321
1321
  className: "rounded-full",
1322
1322
  disabled: h,
1323
1323
  onClick: () => {
1324
- var S;
1325
- return (S = e.onClicked) == null ? void 0 : S.call(e, l);
1324
+ var k;
1325
+ return (k = e.onClicked) == null ? void 0 : k.call(e, l);
1326
1326
  },
1327
1327
  children: /* @__PURE__ */ r(ne, { name: e.icon })
1328
1328
  }
@@ -1332,7 +1332,7 @@ function Gt({
1332
1332
  /* @__PURE__ */ r(Ft, { children: /* @__PURE__ */ r(Lt, { children: e.confirmation.description || "Are you sure you want to close this conversation?" }) }),
1333
1333
  /* @__PURE__ */ d(Ht, { children: [
1334
1334
  /* @__PURE__ */ r(
1335
- N,
1335
+ S,
1336
1336
  {
1337
1337
  variant: "secondary",
1338
1338
  onClick: o,
@@ -1341,10 +1341,13 @@ function Gt({
1341
1341
  }
1342
1342
  ),
1343
1343
  /* @__PURE__ */ r(
1344
- N,
1344
+ S,
1345
1345
  {
1346
1346
  variant: "destructive",
1347
- onClick: x,
1347
+ onClick: () => {
1348
+ var k, D;
1349
+ x(), (D = (k = e.confirmation) == null ? void 0 : k.onConfirmed) == null || D.call(k, l);
1350
+ },
1348
1351
  disabled: i.isResolvingSession,
1349
1352
  children: e.confirmation.confirmButtonText || "Yes"
1350
1353
  }
@@ -1353,14 +1356,14 @@ function Gt({
1353
1356
  ] })
1354
1357
  }
1355
1358
  ) : /* @__PURE__ */ r(
1356
- N,
1359
+ S,
1357
1360
  {
1358
1361
  variant: "ghost",
1359
1362
  size: "fit",
1360
1363
  className: "rounded-full",
1361
1364
  onClick: () => {
1362
- var S;
1363
- p || c ? C() : x(), (S = e.onClicked) == null || S.call(e, l);
1365
+ var k;
1366
+ p || c ? z() : x(), (k = e.onClicked) == null || k.call(e, l);
1364
1367
  },
1365
1368
  disabled: h,
1366
1369
  children: /* @__PURE__ */ r(ne, { name: e.icon })
@@ -1387,7 +1390,7 @@ const fo = {
1387
1390
  function xo() {
1388
1391
  const {
1389
1392
  routerState: { screen: e }
1390
- } = H(), { headerButtons: o } = z(), t = e === "chat" ? o == null ? void 0 : o.chatScreen : e === "sessions" ? o == null ? void 0 : o.sessionsScreen : [];
1393
+ } = H(), { headerButtons: o } = N(), t = e === "chat" ? o == null ? void 0 : o.chatScreen : e === "sessions" ? o == null ? void 0 : o.sessionsScreen : [];
1391
1394
  return !t || t.length === 0 ? /* @__PURE__ */ r(ye, { button: fo }) : /* @__PURE__ */ r(J, { children: t.map((n) => /* @__PURE__ */ r(
1392
1395
  ye,
1393
1396
  {
@@ -1435,7 +1438,7 @@ function vo() {
1435
1438
  };
1436
1439
  }
1437
1440
  function bo() {
1438
- const e = X(), { activeMode: o, Component: t } = zt(), { sendMessage: n } = A(), { createStateCheckpoint: s } = U(), [i, a] = E(!1), l = async (c) => {
1441
+ const e = X(), { activeMode: o, Component: t } = zt(), { sendMessage: n } = A(), { createStateCheckpoint: s } = U(), [i, a] = R(!1), l = async (c) => {
1439
1442
  try {
1440
1443
  a(!0), await n(c);
1441
1444
  } catch (p) {
@@ -1456,7 +1459,7 @@ function bo() {
1456
1459
  );
1457
1460
  }
1458
1461
  function V() {
1459
- const { dir: e } = ke(), o = z();
1462
+ const { dir: e } = ke(), o = N();
1460
1463
  return Ct(() => {
1461
1464
  const t = Br(o.language) ? o.language : "en";
1462
1465
  return {
@@ -1471,7 +1474,7 @@ const W = L.forwardRef(
1471
1474
  (e, o) => {
1472
1475
  var t, n, s;
1473
1476
  return /* @__PURE__ */ r(
1474
- k,
1477
+ C,
1475
1478
  {
1476
1479
  ...e,
1477
1480
  ref: o,
@@ -1520,7 +1523,7 @@ function ko() {
1520
1523
  isCsatSubmitted: s,
1521
1524
  submittedScore: i,
1522
1525
  submittedFeedback: a
1523
- } = Nt(), [l, c] = E(null), [p, v] = E(null), b = (h) => {
1526
+ } = Nt(), [l, c] = R(null), [p, v] = R(null), b = (h) => {
1524
1527
  c((x) => x === h ? null : h);
1525
1528
  }, u = () => {
1526
1529
  l && t({
@@ -1540,7 +1543,7 @@ function ko() {
1540
1543
  s && "gap-0 justify-center"
1541
1544
  ),
1542
1545
  children: yo.map((h) => /* @__PURE__ */ r(
1543
- N,
1546
+ S,
1544
1547
  {
1545
1548
  variant: h.value === l ? "secondary" : "ghost",
1546
1549
  size: "selfless",
@@ -1583,7 +1586,7 @@ function ko() {
1583
1586
  }
1584
1587
  ),
1585
1588
  /* @__PURE__ */ r(
1586
- N,
1589
+ S,
1587
1590
  {
1588
1591
  size: "fit",
1589
1592
  onClick: u,
@@ -1615,7 +1618,7 @@ function Ee({
1615
1618
  i && n({ content: i });
1616
1619
  };
1617
1620
  return /* @__PURE__ */ r(
1618
- N,
1621
+ S,
1619
1622
  {
1620
1623
  ...f("chat/suggested_reply_btn"),
1621
1624
  size: "sm",
@@ -1645,14 +1648,14 @@ function Co() {
1645
1648
  );
1646
1649
  }
1647
1650
  function xt() {
1648
- const { sessionState: e } = U(), { chatFooterItems: o } = z(), t = !!e.session && !e.session.isOpened, n = !t;
1651
+ const { sessionState: e } = U(), { chatFooterItems: o } = N(), t = !!e.session && !e.session.isOpened, n = !t;
1649
1652
  return /* @__PURE__ */ r(M, { mode: "wait", children: o == null ? void 0 : o.map((s, i) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(Se, { children: s.message }) }) }, `${s.message}-${i}`)) });
1650
1653
  }
1651
1654
  function zo({
1652
1655
  file: { status: e, file: o, error: t },
1653
1656
  onCancel: n
1654
1657
  }) {
1655
- const [s, i] = E(
1658
+ const [s, i] = R(
1656
1659
  null
1657
1660
  );
1658
1661
  se(() => {
@@ -1720,18 +1723,18 @@ function zo({
1720
1723
  );
1721
1724
  }
1722
1725
  function No() {
1723
- var D;
1724
- const { isSmallScreen: e } = $(), o = B(null), { sendMessage: t } = A(), { sessionState: n } = U(), { disableSendingWhenAwaitingAIReply: s } = z(), { t: i } = V(), [a, l] = E(""), {
1726
+ var E;
1727
+ const { isSmallScreen: e } = $(), o = B(null), { sendMessage: t } = A(), { sessionState: n } = U(), { disableSendingWhenAwaitingAIReply: s } = N(), { t: i } = V(), [a, l] = R(""), {
1725
1728
  allFiles: c,
1726
1729
  emptyTheFiles: p,
1727
1730
  handleCancelUpload: v,
1728
1731
  appendFiles: b,
1729
1732
  isUploading: u,
1730
1733
  successFiles: h
1731
- } = sr(), x = !!((D = n.session) != null && D.isHandedOff), { isAwaitingBotReply: C } = St(), I = s !== !1 && C, y = (g) => {
1734
+ } = sr(), x = !!((E = n.session) != null && E.isHandedOff), { isAwaitingBotReply: z } = St(), I = s !== !1 && z, y = (g) => {
1732
1735
  b(g);
1733
- }, S = !a.trim() && h.length === 0, R = async () => {
1734
- if (I || S) return;
1736
+ }, k = !a.trim() && h.length === 0, D = async () => {
1737
+ if (I || k) return;
1735
1738
  u && console.info("please wait for the file(s) to upload");
1736
1739
  const g = a.trim();
1737
1740
  t({
@@ -1807,7 +1810,7 @@ function No() {
1807
1810
  {
1808
1811
  ...f("chat/input_box/attachments_container"),
1809
1812
  className: "flex items-center gap-1",
1810
- children: /* @__PURE__ */ r(M, { mode: "popLayout", children: c.map((g) => /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(
1813
+ children: /* @__PURE__ */ r(M, { mode: "popLayout", children: c.map((g) => /* @__PURE__ */ r(C, { snapExit: !0, children: /* @__PURE__ */ r(
1811
1814
  zo,
1812
1815
  {
1813
1816
  onCancel: () => v(g.id),
@@ -1838,7 +1841,7 @@ function No() {
1838
1841
  ),
1839
1842
  onChange: (g) => l(g.target.value),
1840
1843
  onKeyDown: async (g) => {
1841
- g.key === "Enter" && !g.shiftKey && (g.preventDefault(), R());
1844
+ g.key === "Enter" && !g.shiftKey && (g.preventDefault(), D());
1842
1845
  },
1843
1846
  placeholder: i("write_a_message_placeholder")
1844
1847
  }
@@ -1854,7 +1857,7 @@ function No() {
1854
1857
  align: "start",
1855
1858
  content: "attach images, PDFs, or spreadsheets (maximum size 5mb)",
1856
1859
  children: /* @__PURE__ */ r(
1857
- N,
1860
+ S,
1858
1861
  {
1859
1862
  onClick: T,
1860
1863
  size: "fit",
@@ -1862,19 +1865,19 @@ function No() {
1862
1865
  className: m(
1863
1866
  "rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"
1864
1867
  ),
1865
- children: /* @__PURE__ */ r(M, { mode: "wait", children: I ? /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(dt, { className: "size-4 opacity-50" }) }, "paper-clip-disabled") : /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(dt, { className: "size-4" }) }, "paper-clip") })
1868
+ children: /* @__PURE__ */ r(M, { mode: "wait", children: I ? /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(dt, { className: "size-4 opacity-50" }) }, "paper-clip-disabled") : /* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(dt, { className: "size-4" }) }, "paper-clip") })
1866
1869
  }
1867
1870
  )
1868
1871
  }
1869
1872
  ),
1870
1873
  /* @__PURE__ */ r(oe, { content: "send message", side: "top", align: "end", children: /* @__PURE__ */ r(
1871
- N,
1874
+ S,
1872
1875
  {
1873
1876
  size: "fit",
1874
- onClick: R,
1875
- disabled: I || u || S,
1877
+ onClick: D,
1878
+ disabled: I || u || k,
1876
1879
  className: "rounded-full size-8 flex items-center justify-center p-0",
1877
- children: /* @__PURE__ */ r(M, { mode: "wait", children: I || u ? /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(Ir, { className: "size-4 animate-spin animate-iteration-infinite" }) }, "loading") : /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(Dt, { className: "size-4" }) }, "send") })
1880
+ children: /* @__PURE__ */ r(M, { mode: "wait", children: I || u ? /* @__PURE__ */ r(C, { snapExit: !0, children: /* @__PURE__ */ r(Ir, { className: "size-4 animate-spin animate-iteration-infinite" }) }, "loading") : /* @__PURE__ */ r(C, { snapExit: !0, children: /* @__PURE__ */ r(Dt, { className: "size-4" }) }, "send") })
1878
1881
  }
1879
1882
  ) })
1880
1883
  ] })
@@ -1886,8 +1889,8 @@ function No() {
1886
1889
  );
1887
1890
  }
1888
1891
  function vt() {
1889
- const { widgetCtx: e } = O(), { router: o } = z(), { canCreateNewSession: t } = U(), { toSessionsScreen: n } = H(), { t: s } = V();
1890
- return /* @__PURE__ */ r(J, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(N, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(N, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
1892
+ const { widgetCtx: e } = O(), { router: o } = N(), { canCreateNewSession: t } = U(), { toSessionsScreen: n } = H(), { t: s } = V();
1893
+ return /* @__PURE__ */ r(J, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(S, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(S, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
1891
1894
  }
1892
1895
  function So() {
1893
1896
  const { t: e } = V(), { isCsatRequested: o, isCsatSubmitted: t } = Nt();
@@ -1904,7 +1907,7 @@ function So() {
1904
1907
  }
1905
1908
  function _o() {
1906
1909
  var a;
1907
- const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = z(), { sessionState: n } = U(), { messagesState: s } = A(), i = s.messages.length === 0;
1910
+ const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = N(), { sessionState: n } = U(), { messagesState: s } = A(), i = s.messages.length === 0;
1908
1911
  return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(M, { mode: "wait", children: n.session && !((a = n.session) != null && a.isOpened) ? /* @__PURE__ */ d(W, { children: [
1909
1912
  /* @__PURE__ */ r(So, {}),
1910
1913
  /* @__PURE__ */ r(xt, {})
@@ -1969,7 +1972,7 @@ function Qt({
1969
1972
  containerClassName: t
1970
1973
  }) {
1971
1974
  var a, l;
1972
- const { timestamps: n } = z();
1975
+ const { timestamps: n } = N();
1973
1976
  if (!((a = n == null ? void 0 : n.perMessageGroup) != null && a.enabled))
1974
1977
  return null;
1975
1978
  const s = (l = e[e.length - 1]) == null ? void 0 : l.timestamp;
@@ -2163,7 +2166,7 @@ function Oo() {
2163
2166
  initialQuestionsPosition: t,
2164
2167
  initialQuestions: n,
2165
2168
  bot: s
2166
- } = z();
2169
+ } = N();
2167
2170
  return /* @__PURE__ */ r(J, { children: e.length === 0 && o.length > 0 && /* @__PURE__ */ r(
2168
2171
  pe,
2169
2172
  {
@@ -2184,7 +2187,7 @@ function Oo() {
2184
2187
  function Ao() {
2185
2188
  const {
2186
2189
  messagesState: { messages: e }
2187
- } = A(), { chatBannerItems: o } = z();
2190
+ } = A(), { chatBannerItems: o } = N();
2188
2191
  return !(o != null && o.length) || e.length > 0 && o.every((t) => !t.persistent) ? null : /* @__PURE__ */ r("div", { className: "w-full text-center text-xs", children: o.map(
2189
2192
  ({ message: t, persistent: n }, s) => e.length > 0 && !n ? null : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Se, { children: t }) }, `${t}-${s}`)
2190
2193
  ) });
@@ -2192,7 +2195,7 @@ function Ao() {
2192
2195
  function Fo() {
2193
2196
  const {
2194
2197
  messagesState: { messages: e }
2195
- } = A(), o = z(), {
2198
+ } = A(), o = N(), {
2196
2199
  advancedInitialMessages: t = [],
2197
2200
  initialQuestions: n,
2198
2201
  initialQuestionsPosition: s
@@ -2225,7 +2228,7 @@ function Ho() {
2225
2228
  function Wo() {
2226
2229
  const {
2227
2230
  messagesState: { messages: e }
2228
- } = A(), { isAwaitingBotReply: o } = St(), { componentStore: t } = O(), { bot: n, humanAgent: s } = z(), i = Ct(
2231
+ } = A(), { isAwaitingBotReply: o } = St(), { componentStore: t } = O(), { bot: n, humanAgent: s } = N(), i = Ct(
2229
2232
  () => Eo(e),
2230
2233
  [e]
2231
2234
  ), a = t.getComponent(
@@ -2250,14 +2253,14 @@ function Wo() {
2250
2253
  /* @__PURE__ */ r(Oo, {}),
2251
2254
  /* @__PURE__ */ r(Fo, {}),
2252
2255
  i.map((p, v) => {
2253
- var h, x, C, I;
2256
+ var h, x, z, I;
2254
2257
  const b = (h = p == null ? void 0 : p[0]) == null ? void 0 : h.type, u = (x = p[0]) == null ? void 0 : x.id;
2255
2258
  if (!b || !u) return null;
2256
2259
  if (Ro(p))
2257
2260
  return /* @__PURE__ */ r(Do, { messages: p }, u);
2258
2261
  if (Po(p)) {
2259
2262
  const y = v === i.length - 1;
2260
- return o && y ? null : ((C = p[0]) == null || C.agent, /* @__PURE__ */ r(
2263
+ return o && y ? null : ((z = p[0]) == null || z.agent, /* @__PURE__ */ r(
2261
2264
  pe,
2262
2265
  {
2263
2266
  messages: p,
@@ -2324,14 +2327,14 @@ function Lo() {
2324
2327
  children: /* @__PURE__ */ d("div", { className: "size-full justify-between flex flex-col", children: [
2325
2328
  /* @__PURE__ */ r(Zt, {}),
2326
2329
  /* @__PURE__ */ r(M, { mode: "wait", children: e ? /* @__PURE__ */ r(
2327
- k,
2330
+ C,
2328
2331
  {
2329
2332
  className: "flex flex-col items-center justify-center w-full flex-1",
2330
2333
  children: /* @__PURE__ */ r(Kt, {})
2331
2334
  },
2332
2335
  "loading"
2333
2336
  ) : /* @__PURE__ */ d(
2334
- k,
2337
+ C,
2335
2338
  {
2336
2339
  className: "flex items-start h-full flex-1 overflow-auto",
2337
2340
  snapExit: !0,
@@ -2410,7 +2413,7 @@ function Bo({ className: e }) {
2410
2413
  );
2411
2414
  }
2412
2415
  function Jt({ className: e }) {
2413
- const { token: o } = z();
2416
+ const { token: o } = N();
2414
2417
  return /* @__PURE__ */ r(
2415
2418
  "div",
2416
2419
  {
@@ -2449,9 +2452,9 @@ function bt({
2449
2452
  session: e,
2450
2453
  className: o
2451
2454
  }) {
2452
- const { bot: t, humanAgent: n } = z(), { toChatScreen: s } = H(), i = e.assignee.kind === "human" ? (n == null ? void 0 : n.name) || e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", a = e.assignee.kind === "human" ? (n == null ? void 0 : n.avatarUrl) || e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatarUrl) || (t == null ? void 0 : t.avatar) || "";
2455
+ const { bot: t, humanAgent: n } = N(), { toChatScreen: s } = H(), i = e.assignee.kind === "human" ? (n == null ? void 0 : n.name) || e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", a = e.assignee.kind === "human" ? (n == null ? void 0 : n.avatarUrl) || e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatarUrl) || (t == null ? void 0 : t.avatar) || "";
2453
2456
  return /* @__PURE__ */ d(
2454
- N,
2457
+ S,
2455
2458
  {
2456
2459
  variant: "ghost",
2457
2460
  size: "lg",
@@ -2462,13 +2465,13 @@ function bt({
2462
2465
  onClick: () => s(e.id),
2463
2466
  children: [
2464
2467
  /* @__PURE__ */ d("div", { className: "flex-1 flex gap-2 items-center", children: [
2465
- /* @__PURE__ */ r(M, { mode: "wait", children: /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ d(_e, { className: "size-10", children: [
2468
+ /* @__PURE__ */ r(M, { mode: "wait", children: /* @__PURE__ */ r(C, { snapExit: !0, children: /* @__PURE__ */ d(_e, { className: "size-10", children: [
2466
2469
  /* @__PURE__ */ r(Ie, { src: a, alt: "Agent Icon" }),
2467
2470
  /* @__PURE__ */ r(Te, { children: /* @__PURE__ */ r(Pr, { className: "size-4" }) })
2468
2471
  ] }) }) }),
2469
2472
  /* @__PURE__ */ d("div", { className: "flex-1", children: [
2470
- /* @__PURE__ */ r(M, { mode: "wait", children: /* @__PURE__ */ r(k, { snapExit: !0, children: i }, i) }),
2471
- /* @__PURE__ */ r(M, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(
2473
+ /* @__PURE__ */ r(M, { mode: "wait", children: /* @__PURE__ */ r(C, { snapExit: !0, children: i }, i) }),
2474
+ /* @__PURE__ */ r(M, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ r(C, { snapExit: !0, children: /* @__PURE__ */ r(
2472
2475
  Yt,
2473
2476
  {
2474
2477
  remarkPlugins: [Et],
@@ -2476,7 +2479,7 @@ function bt({
2476
2479
  className: "line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",
2477
2480
  children: e.lastMessage
2478
2481
  }
2479
- ) }, e.lastMessage || "content") : /* @__PURE__ */ r(k, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r($o, { className: "h-4 w-full" }) }, "skeleton") })
2482
+ ) }, e.lastMessage || "content") : /* @__PURE__ */ r(C, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r($o, { className: "h-4 w-full" }) }, "skeleton") })
2480
2483
  ] })
2481
2484
  ] }),
2482
2485
  /* @__PURE__ */ r(jr, { className: "size-4 text-muted-foreground shrink-0 rtl:-scale-100" })
@@ -2492,20 +2495,20 @@ function Uo() {
2492
2495
  canCreateNewSession: a
2493
2496
  } = U();
2494
2497
  return /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col overflow-scroll py-2 px-2", children: /* @__PURE__ */ r(M, { mode: "wait", children: n ? /* @__PURE__ */ r(
2495
- k,
2498
+ C,
2496
2499
  {
2497
2500
  className: "flex-1 flex items-center justify-center",
2498
2501
  children: /* @__PURE__ */ r(Kt, {})
2499
2502
  },
2500
2503
  "loading"
2501
2504
  ) : /* @__PURE__ */ r(
2502
- k,
2505
+ C,
2503
2506
  {
2504
2507
  className: "flex-1 flex flex-col gap-2 relative",
2505
2508
  children: t.length ? /* @__PURE__ */ d(J, { children: [
2506
2509
  /* @__PURE__ */ d(M, { children: [
2507
2510
  s.length > 0 && /* @__PURE__ */ r(
2508
- k,
2511
+ C,
2509
2512
  {
2510
2513
  fadeIn: "up",
2511
2514
  delay: 0.2,
@@ -2516,7 +2519,7 @@ function Uo() {
2516
2519
  "open-sessions"
2517
2520
  ),
2518
2521
  i.length > 0 && /* @__PURE__ */ d(
2519
- k,
2522
+ C,
2520
2523
  {
2521
2524
  className: "space-y-2",
2522
2525
  delay: 0.2,
@@ -2537,7 +2540,7 @@ function Uo() {
2537
2540
  )
2538
2541
  ] }),
2539
2542
  a && /* @__PURE__ */ r("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ ct(
2540
- N,
2543
+ S,
2541
2544
  {
2542
2545
  ...f("sessions/new_conversation_btn"),
2543
2546
  size: "lg",
@@ -2550,7 +2553,7 @@ function Uo() {
2550
2553
  ] }) : /* @__PURE__ */ d("div", { className: "flex-1 flex flex-col gap-2 items-center", children: [
2551
2554
  /* @__PURE__ */ r("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ r("p", { className: "text-muted-foreground", children: e("no_conversations_yet") }) }),
2552
2555
  /* @__PURE__ */ ct(
2553
- N,
2556
+ S,
2554
2557
  {
2555
2558
  ...f("sessions/new_conversation_btn"),
2556
2559
  size: "lg",
@@ -2616,7 +2619,7 @@ const de = ee.forwardRef(
2616
2619
  );
2617
2620
  de.displayName = "Input";
2618
2621
  function qo() {
2619
- const { contentIframeRef: e } = O(), { inline: o } = z(), t = B(null);
2622
+ const { contentIframeRef: e } = O(), { inline: o } = N(), t = B(null);
2620
2623
  return se(() => {
2621
2624
  const n = e == null ? void 0 : e.current;
2622
2625
  if (n && t.current) {
@@ -2642,17 +2645,17 @@ const Vo = ue.object({
2642
2645
  email: ue.string().email()
2643
2646
  });
2644
2647
  function Go() {
2645
- var y, S, R, j, w, T, P, D;
2648
+ var y, k, D, j, w, T, P, E;
2646
2649
  const {
2647
2650
  widgetCtx: { org: e }
2648
- } = O(), { setIsOpen: o } = Z(), { createUnverifiedContact: t } = _t(), { isSmallScreen: n } = $(), s = z(), { theme: i } = K(), { t: a } = V(), { observedElementRef: l } = qo();
2651
+ } = O(), { setIsOpen: o } = Z(), { createUnverifiedContact: t } = _t(), { isSmallScreen: n } = $(), s = N(), { theme: i } = K(), { t: a } = V(), { observedElementRef: l } = qo();
2649
2652
  Me({
2650
2653
  height: void 0,
2651
2654
  width: i.screens.welcome.width
2652
2655
  });
2653
- const [c, p] = E(((y = s.prefillUserData) == null ? void 0 : y.name) || ""), [v, b] = E(((S = s.prefillUserData) == null ? void 0 : S.email) || ""), u = (s.extraDataCollectionFields || []).filter(
2656
+ const [c, p] = R(((y = s.prefillUserData) == null ? void 0 : y.name) || ""), [v, b] = R(((k = s.prefillUserData) == null ? void 0 : k.email) || ""), u = (s.extraDataCollectionFields || []).filter(
2654
2657
  (g) => g !== "name" && g !== "email" && !!g
2655
- ), [h, x] = E({}), [C, I] = Xr(
2658
+ ), [h, x] = R({}), [z, I] = Xr(
2656
2659
  async (g) => {
2657
2660
  g.preventDefault();
2658
2661
  const _ = Vo.safeParse({ name: c, email: v });
@@ -2700,8 +2703,8 @@ function Go() {
2700
2703
  "text-primary-foreground"
2701
2704
  ),
2702
2705
  children: [
2703
- n && /* @__PURE__ */ r(k, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(N, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(Ce, { className: "size-4" }) }) }),
2704
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (R = s.assets) != null && R.organizationLogo ? /* @__PURE__ */ r(
2706
+ n && /* @__PURE__ */ r(C, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(S, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(Ce, { className: "size-4" }) }) }),
2707
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (D = s.assets) != null && D.organizationLogo ? /* @__PURE__ */ r(
2705
2708
  "img",
2706
2709
  {
2707
2710
  src: (j = s.assets) == null ? void 0 : j.organizationLogo,
@@ -2711,7 +2714,7 @@ function Go() {
2711
2714
  ) : /* @__PURE__ */ r("h2", { className: "font-bold text-sm", children: e.name }) }),
2712
2715
  /* @__PURE__ */ d("div", { className: "space-y-2", children: [
2713
2716
  /* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((T = (w = s.textContent) == null ? void 0 : w.welcomeScreen) == null ? void 0 : T.title) || a("welcome_screen_title") }),
2714
- /* @__PURE__ */ r("p", { className: "text-sm", children: ((D = (P = s.textContent) == null ? void 0 : P.welcomeScreen) == null ? void 0 : D.description) || a("welcome_screen_description") })
2717
+ /* @__PURE__ */ r("p", { className: "text-sm", children: ((E = (P = s.textContent) == null ? void 0 : P.welcomeScreen) == null ? void 0 : E.description) || a("welcome_screen_description") })
2715
2718
  ] })
2716
2719
  ]
2717
2720
  }
@@ -2761,13 +2764,13 @@ function Go() {
2761
2764
  g
2762
2765
  )),
2763
2766
  /* @__PURE__ */ d(
2764
- N,
2767
+ S,
2765
2768
  {
2766
- disabled: C.loading,
2769
+ disabled: z.loading,
2767
2770
  className: "w-full",
2768
2771
  size: "lg",
2769
2772
  children: [
2770
- C.loading ? a("start_chat_button_loading") : a("start_chat_button"),
2773
+ z.loading ? a("start_chat_button_loading") : a("start_chat_button"),
2771
2774
  /* @__PURE__ */ r(Or, { className: "size-4 rtl:-scale-100" })
2772
2775
  ]
2773
2776
  }
@@ -2791,7 +2794,7 @@ function er() {
2791
2794
  switch (e) {
2792
2795
  case "welcome":
2793
2796
  return /* @__PURE__ */ r(
2794
- k,
2797
+ C,
2795
2798
  {
2796
2799
  fadeIn: "right",
2797
2800
  className: "size-full",
@@ -2802,7 +2805,7 @@ function er() {
2802
2805
  );
2803
2806
  case "sessions":
2804
2807
  return /* @__PURE__ */ r(
2805
- k,
2808
+ C,
2806
2809
  {
2807
2810
  fadeIn: "right",
2808
2811
  className: "size-full",
@@ -2813,7 +2816,7 @@ function er() {
2813
2816
  );
2814
2817
  case "chat":
2815
2818
  return /* @__PURE__ */ r(
2816
- k,
2819
+ C,
2817
2820
  {
2818
2821
  fadeIn: "right",
2819
2822
  className: "size-full",
@@ -2827,7 +2830,7 @@ function er() {
2827
2830
  }
2828
2831
  })() }) });
2829
2832
  }
2830
- const Zo = "4.0.56", Ko = `<!DOCTYPE html>
2833
+ const Zo = "4.0.57", Ko = `<!DOCTYPE html>
2831
2834
  <html>
2832
2835
  <head>
2833
2836
  <style>
@@ -2846,7 +2849,7 @@ html, body {
2846
2849
  </body>
2847
2850
  </html>`;
2848
2851
  function tr() {
2849
- const { isOpen: e } = Z(), { contentIframeRef: o } = O(), { cssOverrides: t, inline: n } = z(), { theme: s, cssVars: i, computed: a } = K(), { dir: l } = V();
2852
+ const { isOpen: e } = Z(), { contentIframeRef: o } = O(), { cssOverrides: t, inline: n } = N(), { theme: s, cssVars: i, computed: a } = K(), { dir: l } = V();
2850
2853
  return /* @__PURE__ */ r(
2851
2854
  re.div,
2852
2855
  {
@@ -3004,7 +3007,7 @@ html, body {
3004
3007
  </html>`;
3005
3008
  function tn() {
3006
3009
  var p, v, b;
3007
- const { isOpen: e, setIsOpen: o } = Z(), { cssOverrides: t, assets: n, customComponents: s, accessibility: i } = z(), { theme: a, cssVars: l } = K(), c = ((p = i == null ? void 0 : i.widgetTriggerButton) == null ? void 0 : p.label) ?? "Chat with us";
3010
+ const { isOpen: e, setIsOpen: o } = Z(), { cssOverrides: t, assets: n, customComponents: s, accessibility: i } = N(), { theme: a, cssVars: l } = K(), c = ((p = i == null ? void 0 : i.widgetTriggerButton) == null ? void 0 : p.label) ?? "Chat with us";
3008
3011
  return s != null && s.widgetTrigger ? s.widgetTrigger({
3009
3012
  react: L,
3010
3013
  isOpen: e,
@@ -3067,7 +3070,7 @@ function tn() {
3067
3070
  "text-primary-foreground"
3068
3071
  ),
3069
3072
  children: /* @__PURE__ */ r(M, { mode: "wait", children: e ? /* @__PURE__ */ r(
3070
- k,
3073
+ C,
3071
3074
  {
3072
3075
  snapExit: !0,
3073
3076
  fadeIn: "up",
@@ -3097,7 +3100,7 @@ function tn() {
3097
3100
  },
3098
3101
  "x-icon"
3099
3102
  ) : /* @__PURE__ */ r(
3100
- k,
3103
+ C,
3101
3104
  {
3102
3105
  snapExit: !0,
3103
3106
  overrides: {