@sawport/react-sdk 1.4.0-beta.2 → 1.4.0-beta.3
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 +122 -32
- package/dist/index.standalone.js +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/react-sdk.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -69099,9 +69099,15 @@ Http.interceptors.request.use((config) => {
|
|
|
69099
69099
|
Http.interceptors.response.use(
|
|
69100
69100
|
(response) => response,
|
|
69101
69101
|
(error) => {
|
|
69102
|
-
var _a2, _b;
|
|
69102
|
+
var _a2, _b, _c;
|
|
69103
69103
|
if (error.response && error.response.status === 401) ;
|
|
69104
|
-
else if (((_a2 = error.response) == null ? void 0 : _a2.status) ===
|
|
69104
|
+
else if (((_a2 = error.response) == null ? void 0 : _a2.status) === 403) {
|
|
69105
|
+
const errorData = error.response.data;
|
|
69106
|
+
if ((errorData == null ? void 0 : errorData.error) === "FEATURE_DISABLED") {
|
|
69107
|
+
console.warn("Feature disabled for tenant:", errorData == null ? void 0 : errorData.message);
|
|
69108
|
+
t.emit("feature-disabled", errorData);
|
|
69109
|
+
}
|
|
69110
|
+
} else if (((_b = error.response) == null ? void 0 : _b.status) === 500 || ((_c = error.response) == null ? void 0 : _c.status) === 405) {
|
|
69105
69111
|
console.log(error.response.data);
|
|
69106
69112
|
}
|
|
69107
69113
|
return Promise.reject(error);
|
|
@@ -69126,11 +69132,17 @@ chatHttp.interceptors.request.use((config) => {
|
|
|
69126
69132
|
chatHttp.interceptors.response.use(
|
|
69127
69133
|
(response) => response,
|
|
69128
69134
|
(error) => {
|
|
69129
|
-
var _a2, _b;
|
|
69135
|
+
var _a2, _b, _c;
|
|
69130
69136
|
if (error.response && error.response.status === 401) {
|
|
69131
69137
|
setChatSessionToken(void 0);
|
|
69132
69138
|
t.emit(eventNames.CHAT_SESSION_EXPIRED);
|
|
69133
|
-
} else if (((_a2 = error.response) == null ? void 0 : _a2.status) ===
|
|
69139
|
+
} else if (((_a2 = error.response) == null ? void 0 : _a2.status) === 403) {
|
|
69140
|
+
const errorData = error.response.data;
|
|
69141
|
+
if ((errorData == null ? void 0 : errorData.error) === "FEATURE_DISABLED") {
|
|
69142
|
+
console.warn("Feature disabled for tenant:", errorData == null ? void 0 : errorData.message);
|
|
69143
|
+
t.emit("feature-disabled", errorData);
|
|
69144
|
+
}
|
|
69145
|
+
} else if (((_b = error.response) == null ? void 0 : _b.status) === 500 || ((_c = error.response) == null ? void 0 : _c.status) === 405) {
|
|
69134
69146
|
console.log(error.response.data);
|
|
69135
69147
|
}
|
|
69136
69148
|
return Promise.reject(error);
|
|
@@ -104560,6 +104572,42 @@ function generateMinuteIntervals(interval) {
|
|
|
104560
104572
|
}
|
|
104561
104573
|
return intervals;
|
|
104562
104574
|
}
|
|
104575
|
+
const useFeatureStore = create()(
|
|
104576
|
+
persist(
|
|
104577
|
+
immer(
|
|
104578
|
+
devtools(
|
|
104579
|
+
(set2, get2) => ({
|
|
104580
|
+
features: [],
|
|
104581
|
+
quotas: {},
|
|
104582
|
+
isLoaded: false,
|
|
104583
|
+
setFeatures: (features = [], quotas = {}) => set2((state) => {
|
|
104584
|
+
state.features = Array.isArray(features) ? features : [];
|
|
104585
|
+
state.quotas = quotas || {};
|
|
104586
|
+
state.isLoaded = true;
|
|
104587
|
+
}),
|
|
104588
|
+
hasFeature: (featureToken) => {
|
|
104589
|
+
const { features, isLoaded } = get2();
|
|
104590
|
+
if (!isLoaded) {
|
|
104591
|
+
return true;
|
|
104592
|
+
}
|
|
104593
|
+
return features.includes(featureToken);
|
|
104594
|
+
},
|
|
104595
|
+
getQuota: (key) => {
|
|
104596
|
+
const { quotas } = get2();
|
|
104597
|
+
return quotas == null ? void 0 : quotas[key];
|
|
104598
|
+
}
|
|
104599
|
+
}),
|
|
104600
|
+
{ name: "@features" }
|
|
104601
|
+
)
|
|
104602
|
+
),
|
|
104603
|
+
{
|
|
104604
|
+
name: "@features",
|
|
104605
|
+
storage: createJSONStorage(() => localStorage)
|
|
104606
|
+
}
|
|
104607
|
+
)
|
|
104608
|
+
);
|
|
104609
|
+
const hasFeature = (featureToken) => useFeatureStore.getState().hasFeature(featureToken);
|
|
104610
|
+
const setCompanyFeatures = (features, quotas) => useFeatureStore.getState().setFeatures(features, quotas);
|
|
104563
104611
|
const getWaitConnectors = async (data2) => api("wait-connectors", data2);
|
|
104564
104612
|
const getLongestWaitTime = async (data2) => api("waits/longest", data2);
|
|
104565
104613
|
const updateWait = async (id2, data2) => api(`waits/${id2}`, data2, "put");
|
|
@@ -104639,6 +104687,7 @@ const useChatStore = create()(
|
|
|
104639
104687
|
chatInit: false,
|
|
104640
104688
|
chatClose: true,
|
|
104641
104689
|
agent: void 0,
|
|
104690
|
+
popupVisible: false,
|
|
104642
104691
|
scheduleReminderCanceled: false,
|
|
104643
104692
|
companyClosed,
|
|
104644
104693
|
dataRef: null,
|
|
@@ -104656,6 +104705,7 @@ const useChatStore = create()(
|
|
|
104656
104705
|
chatInit: false,
|
|
104657
104706
|
chatClose: false,
|
|
104658
104707
|
agent: void 0,
|
|
104708
|
+
popupVisible: false,
|
|
104659
104709
|
scheduleReminderCanceled: false,
|
|
104660
104710
|
companyClosed,
|
|
104661
104711
|
dataRef: null,
|
|
@@ -104680,11 +104730,14 @@ const useChatStore = create()(
|
|
|
104680
104730
|
} else {
|
|
104681
104731
|
updateWait((_c = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _c.id, { status: "ended" });
|
|
104682
104732
|
}
|
|
104683
|
-
set2({ chatClose, scheduleReminderCanceled: false });
|
|
104733
|
+
set2({ chatClose, popupVisible: false, scheduleReminderCanceled: false });
|
|
104684
104734
|
}
|
|
104685
104735
|
},
|
|
104686
104736
|
setIsWidgetLaunched: (isWidgetLaunched) => set2({ isWidgetLaunched }),
|
|
104687
|
-
setLanguagePreference: (language) =>
|
|
104737
|
+
setLanguagePreference: (language) => {
|
|
104738
|
+
const { chatInit } = get2();
|
|
104739
|
+
set2({ languagePreference: language, languageLocked: chatInit });
|
|
104740
|
+
},
|
|
104688
104741
|
unlockLanguagePreference: () => set2({ languageLocked: false })
|
|
104689
104742
|
}),
|
|
104690
104743
|
{ name: "@chat" }
|
|
@@ -105239,7 +105292,7 @@ const Offline = memo(
|
|
|
105239
105292
|
]
|
|
105240
105293
|
}
|
|
105241
105294
|
),
|
|
105242
|
-
/* @__PURE__ */ jsx(
|
|
105295
|
+
hasFeature("calendar_scheduling") && /* @__PURE__ */ jsx(
|
|
105243
105296
|
Button,
|
|
105244
105297
|
{
|
|
105245
105298
|
disabled: isRecording,
|
|
@@ -108235,11 +108288,11 @@ function WidgetInitForm({
|
|
|
108235
108288
|
style: { height: "48px", fontWeight: 600, position: "relative" },
|
|
108236
108289
|
children: [
|
|
108237
108290
|
state.isLoading && /* @__PURE__ */ jsx(Spin, { style: { position: "absolute", left: "calc(50% - 80px)" } }),
|
|
108238
|
-
/* @__PURE__ */ jsx("span", { children: "Start Banking" })
|
|
108291
|
+
/* @__PURE__ */ jsx("span", { children: hasFeature("video_banking") ? "Start Banking" : "Start Chat" })
|
|
108239
108292
|
]
|
|
108240
108293
|
}
|
|
108241
108294
|
),
|
|
108242
|
-
/* @__PURE__ */ jsx(
|
|
108295
|
+
hasFeature("calendar_scheduling") && /* @__PURE__ */ jsx(
|
|
108243
108296
|
Button,
|
|
108244
108297
|
{
|
|
108245
108298
|
style: { borderColor: widgetColor, height: "48px", fontWeight: 500 },
|
|
@@ -109041,7 +109094,7 @@ function ChatWidgetScreen({ welcome_message, company, isOngoingChat }) {
|
|
|
109041
109094
|
});
|
|
109042
109095
|
}, [socket2.connected]);
|
|
109043
109096
|
const endChat = async () => setChatClose(true);
|
|
109044
|
-
const verificationVisible = !((_f = (_e = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _e.conversation) == null ? void 0 : _f.hasVerifiedFace) && ((_g = company == null ? void 0 : company.options) == null ? void 0 : _g.facialRecognitionEnabled);
|
|
109097
|
+
const verificationVisible = !((_f = (_e = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _e.conversation) == null ? void 0 : _f.hasVerifiedFace) && ((_g = company == null ? void 0 : company.options) == null ? void 0 : _g.facialRecognitionEnabled) && hasFeature("facial_verification");
|
|
109045
109098
|
Message.useChatSessionExpiredListener(() => {
|
|
109046
109099
|
y.info("Chat session expired", { autoClose: 2e3 });
|
|
109047
109100
|
endChat();
|
|
@@ -109080,8 +109133,9 @@ function ChatWidgetScreen({ welcome_message, company, isOngoingChat }) {
|
|
|
109080
109133
|
] });
|
|
109081
109134
|
}
|
|
109082
109135
|
const ChatInput = memo(function({ company }) {
|
|
109083
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
109136
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i2, _j;
|
|
109084
109137
|
const {
|
|
109138
|
+
agent,
|
|
109085
109139
|
dataRef,
|
|
109086
109140
|
scheduleReminderCanceled,
|
|
109087
109141
|
popupVisible,
|
|
@@ -109102,6 +109156,12 @@ const ChatInput = memo(function({ company }) {
|
|
|
109102
109156
|
};
|
|
109103
109157
|
const agentConnected = ((_a2 = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _a2.status) === "connected";
|
|
109104
109158
|
const agentDetails = transferredAgent || ((_f = (_e = (_b = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _b.connectors) == null ? void 0 : _e[((_d = (_c = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _c.connectors) == null ? void 0 : _d.length) - 1]) == null ? void 0 : _f.agent);
|
|
109159
|
+
const hasAgentConnected = agentConnected || Boolean(
|
|
109160
|
+
(agent == null ? void 0 : agent.id) || (transferredAgent == null ? void 0 : transferredAgent.id) || ((_h = (_g = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _g.connectors) == null ? void 0 : _h.some((item) => {
|
|
109161
|
+
var _a3;
|
|
109162
|
+
return (_a3 = item == null ? void 0 : item.agent) == null ? void 0 : _a3.id;
|
|
109163
|
+
}))
|
|
109164
|
+
);
|
|
109105
109165
|
const handleOk = () => {
|
|
109106
109166
|
setPopupVisible(false);
|
|
109107
109167
|
quickStopChat({ companyClosed: true, offlineMode: true });
|
|
@@ -109196,15 +109256,16 @@ const ChatInput = memo(function({ company }) {
|
|
|
109196
109256
|
[`agent.connected.${(_a3 = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _a3.id}`]: ({ waitList }) => {
|
|
109197
109257
|
const audio = new Audio(connectedSound);
|
|
109198
109258
|
audio.play();
|
|
109259
|
+
setPopupVisible(false);
|
|
109199
109260
|
setWait(waitList);
|
|
109200
109261
|
},
|
|
109201
109262
|
[`WaitList.transferred.${((_b2 = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _b2.conversation.id) || ((_c2 = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _c2.conversation)}`]: ({
|
|
109202
|
-
agent
|
|
109263
|
+
agent: agent2
|
|
109203
109264
|
}) => {
|
|
109204
109265
|
setEvent((state) => {
|
|
109205
|
-
state.transferredAgent =
|
|
109266
|
+
state.transferredAgent = agent2;
|
|
109206
109267
|
});
|
|
109207
|
-
t.emit("agent-joined", { ...
|
|
109268
|
+
t.emit("agent-joined", { ...agent2.user, agent: agent2 });
|
|
109208
109269
|
},
|
|
109209
109270
|
[`typing.${(dataRef == null ? void 0 : dataRef.wait.conversation.id) || (dataRef == null ? void 0 : dataRef.wait.conversation)}`]: () => {
|
|
109210
109271
|
const timeOut = setTimeout(() => {
|
|
@@ -109221,26 +109282,28 @@ const ChatInput = memo(function({ company }) {
|
|
|
109221
109282
|
}
|
|
109222
109283
|
};
|
|
109223
109284
|
},
|
|
109224
|
-
[t, (dataRef == null ? void 0 : dataRef.wait.conversation.id) || (dataRef == null ? void 0 : dataRef.wait.conversation), (
|
|
109285
|
+
[t, (dataRef == null ? void 0 : dataRef.wait.conversation.id) || (dataRef == null ? void 0 : dataRef.wait.conversation), (_i2 = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _i2.id]
|
|
109225
109286
|
);
|
|
109226
109287
|
useEffect(() => {
|
|
109227
109288
|
var _a3;
|
|
109228
109289
|
let popupTimeoutId = null;
|
|
109290
|
+
if (hasAgentConnected) {
|
|
109291
|
+
setPopupVisible(false);
|
|
109292
|
+
return () => void 0;
|
|
109293
|
+
}
|
|
109229
109294
|
if (!scheduleReminderCanceled && ((_a3 = company == null ? void 0 : company.options) == null ? void 0 : _a3.schedulePopUpTime)) {
|
|
109230
|
-
if (!
|
|
109295
|
+
if (!hasAgentConnected) {
|
|
109231
109296
|
popupTimeoutId = setTimeout(() => {
|
|
109232
|
-
if (!
|
|
109297
|
+
if (!hasAgentConnected) {
|
|
109233
109298
|
setPopupVisible(true);
|
|
109234
109299
|
}
|
|
109235
109300
|
}, company.options.schedulePopUpTime);
|
|
109236
|
-
} else {
|
|
109237
|
-
setPopupVisible(false);
|
|
109238
109301
|
}
|
|
109239
109302
|
}
|
|
109240
109303
|
return () => {
|
|
109241
109304
|
if (popupTimeoutId) clearTimeout(popupTimeoutId);
|
|
109242
109305
|
};
|
|
109243
|
-
}, [
|
|
109306
|
+
}, [(_j = company == null ? void 0 : company.options) == null ? void 0 : _j.schedulePopUpTime, hasAgentConnected, scheduleReminderCanceled, setPopupVisible]);
|
|
109244
109307
|
const [, colors] = useToken();
|
|
109245
109308
|
useSocketListeners({ listeners });
|
|
109246
109309
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -109317,7 +109380,7 @@ const ChatInput = memo(function({ company }) {
|
|
|
109317
109380
|
placement: "left",
|
|
109318
109381
|
title: "Wait time too long?",
|
|
109319
109382
|
description: "Schedule a call with an agent.",
|
|
109320
|
-
open: popupVisible,
|
|
109383
|
+
open: popupVisible && !hasAgentConnected,
|
|
109321
109384
|
onConfirm: handleOk,
|
|
109322
109385
|
onCancel: handleCancel
|
|
109323
109386
|
}
|
|
@@ -110428,7 +110491,7 @@ __publicField(_Language, "loadGoogleTranslate", lodashExports.once(({ language =
|
|
|
110428
110491
|
}));
|
|
110429
110492
|
let Language = _Language;
|
|
110430
110493
|
const LanguageModal = ({ open: open2, onClose }) => {
|
|
110431
|
-
const { dataRef,
|
|
110494
|
+
const { dataRef, languagePreference, setLanguagePreference, languageLocked } = useChatStore();
|
|
110432
110495
|
const [searchQuery, setSearchQuery] = useState$1("");
|
|
110433
110496
|
const [selectedLanguage, setSelectedLanguage] = useState$1("en");
|
|
110434
110497
|
const selectionLocked = languageLocked;
|
|
@@ -123912,7 +123975,7 @@ const Controls = ({
|
|
|
123912
123975
|
!!toggleAudio && /* @__PURE__ */ jsx(ActionBtn, { onClick: () => toggleAudio(!audioOn), children: !audioOn ? /* @__PURE__ */ jsx(SvgMicOffCircle, { fill: "#fff", width: 20, height: 20 }) : /* @__PURE__ */ jsx(SvgMic, { width: 20, height: 20 }) }),
|
|
123913
123976
|
!!toggleVideo && /* @__PURE__ */ jsx(ActionBtn, { onClick: () => toggleVideo(!videoOn), children: !videoOn ? /* @__PURE__ */ jsx(SvgVideoOff, { fill: "#fff", width: 20, height: 20 }) : /* @__PURE__ */ jsx(SvgVideoAlt, { width: 20, height: 20 }) }),
|
|
123914
123977
|
/* @__PURE__ */ jsx(ActionBtn, { onClick: () => setInviteModalOpen(true), children: /* @__PURE__ */ jsx(RefIcon$1, { style: { fontSize: 20, color: "#fff" } }) }),
|
|
123915
|
-
!isMobile2 && !!(startScreenSharing || stopScreenSharing) && /* @__PURE__ */ jsx(ActionBtn, { onClick: screenShared ? stopScreenSharing : startScreenSharing, children: screenShared ? /* @__PURE__ */ jsx(SvgStopScreen, { width: 20, height: 20 }) : /* @__PURE__ */ jsx(SvgDesktop, { width: 20, height: 20 }) }),
|
|
123978
|
+
!isMobile2 && hasFeature("screen_sharing") && !!(startScreenSharing || stopScreenSharing) && /* @__PURE__ */ jsx(ActionBtn, { onClick: screenShared ? stopScreenSharing : startScreenSharing, children: screenShared ? /* @__PURE__ */ jsx(SvgStopScreen, { width: 20, height: 20 }) : /* @__PURE__ */ jsx(SvgDesktop, { width: 20, height: 20 }) }),
|
|
123916
123979
|
endCall && /* @__PURE__ */ jsx(ActionBtn, { onClick: endCall, style: { backgroundColor: "#dc2626" }, children: /* @__PURE__ */ jsx(SvgPhoneMissed, { width: 20, height: 20 }) })
|
|
123917
123980
|
]
|
|
123918
123981
|
}
|
|
@@ -124423,7 +124486,12 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
124423
124486
|
user: { id: String(userId || "") },
|
|
124424
124487
|
token: sessionToken,
|
|
124425
124488
|
socketUrl,
|
|
124426
|
-
autoInitialize: false
|
|
124489
|
+
autoInitialize: false,
|
|
124490
|
+
permissions: {
|
|
124491
|
+
screenSharing: hasFeature("screen_sharing"),
|
|
124492
|
+
videoBanking: hasFeature("video_banking"),
|
|
124493
|
+
callRecording: hasFeature("call_recording")
|
|
124494
|
+
}
|
|
124427
124495
|
}),
|
|
124428
124496
|
[conversation_id, userId, sessionToken, socketUrl]
|
|
124429
124497
|
);
|
|
@@ -124506,6 +124574,10 @@ const VideoCall = ({ userId, conversation_id, brandColor }) => {
|
|
|
124506
124574
|
console.warn("Cannot start screen share: not connected to call");
|
|
124507
124575
|
return;
|
|
124508
124576
|
}
|
|
124577
|
+
if (!hasFeature("screen_sharing")) {
|
|
124578
|
+
y.error("Screen sharing is not enabled for this session", { autoClose: 3e3 });
|
|
124579
|
+
return;
|
|
124580
|
+
}
|
|
124509
124581
|
try {
|
|
124510
124582
|
await startScreenShare();
|
|
124511
124583
|
} catch (error2) {
|
|
@@ -124644,8 +124716,6 @@ const WidgetInitOnlineHeader = ({
|
|
|
124644
124716
|
},
|
|
124645
124717
|
{
|
|
124646
124718
|
key: "4",
|
|
124647
|
-
disabled: true,
|
|
124648
|
-
title: "Language selection is locked during chat",
|
|
124649
124719
|
label: /* @__PURE__ */ jsxs("span", { className: "w-full h-full text-gray-700", children: [
|
|
124650
124720
|
/* @__PURE__ */ jsx(RefIcon$8, {}),
|
|
124651
124721
|
" Language Preference"
|
|
@@ -124653,8 +124723,8 @@ const WidgetInitOnlineHeader = ({
|
|
|
124653
124723
|
},
|
|
124654
124724
|
{
|
|
124655
124725
|
key: "3",
|
|
124656
|
-
disabled: !((_a2 = company == null ? void 0 : company.options) == null ? void 0 : _a2.facialRecognitionEnabled),
|
|
124657
|
-
title: !((_b = company == null ? void 0 : company.options) == null ? void 0 : _b.facialRecognitionEnabled) ? "Facial Recognition is disabled" : "",
|
|
124726
|
+
disabled: !((_a2 = company == null ? void 0 : company.options) == null ? void 0 : _a2.facialRecognitionEnabled) || !hasFeature("facial_verification"),
|
|
124727
|
+
title: !((_b = company == null ? void 0 : company.options) == null ? void 0 : _b.facialRecognitionEnabled) || !hasFeature("facial_verification") ? "Facial Recognition is disabled" : "",
|
|
124658
124728
|
label: /* @__PURE__ */ jsxs("span", { className: "w-full h-full text-blue-500", children: [
|
|
124659
124729
|
/* @__PURE__ */ jsx(Icon, { component: SvgStars }),
|
|
124660
124730
|
" Facial Recognition"
|
|
@@ -130182,6 +130252,11 @@ function UnwrapWidget({
|
|
|
130182
130252
|
[company_id]
|
|
130183
130253
|
);
|
|
130184
130254
|
const { hex_code, tooltip_message } = company;
|
|
130255
|
+
useEffect(() => {
|
|
130256
|
+
if (company && (company.features || company.id)) {
|
|
130257
|
+
setCompanyFeatures(company.features || [], company.quotas || {});
|
|
130258
|
+
}
|
|
130259
|
+
}, [company == null ? void 0 : company.features, company == null ? void 0 : company.quotas, company == null ? void 0 : company.id]);
|
|
130185
130260
|
const companyIsClosed = useMemo$2(() => {
|
|
130186
130261
|
if (!isLoadingCompany && (company == null ? void 0 : company.name)) {
|
|
130187
130262
|
return !isWidgetOnline(company.work_hours || defaultWorkHours, company.timezone ?? "UTC");
|
|
@@ -130382,7 +130457,7 @@ const WidgetFormDisplay = memo(
|
|
|
130382
130457
|
(isScheduling2) => useChatStore.setState({ isScheduling: isScheduling2 }),
|
|
130383
130458
|
[]
|
|
130384
130459
|
);
|
|
130385
|
-
const verificationVisible = !((_e = (_d = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _d.conversation) == null ? void 0 : _e.hasVerifiedFace) && ((_f = company == null ? void 0 : company.options) == null ? void 0 : _f.facialRecognitionEnabled);
|
|
130460
|
+
const verificationVisible = !((_e = (_d = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _d.conversation) == null ? void 0 : _e.hasVerifiedFace) && ((_f = company == null ? void 0 : company.options) == null ? void 0 : _f.facialRecognitionEnabled) && hasFeature("facial_verification");
|
|
130386
130461
|
return /* @__PURE__ */ jsxs(
|
|
130387
130462
|
"div",
|
|
130388
130463
|
{
|
|
@@ -130415,7 +130490,7 @@ const WidgetFormDisplay = memo(
|
|
|
130415
130490
|
}
|
|
130416
130491
|
) })
|
|
130417
130492
|
] }),
|
|
130418
|
-
/* @__PURE__ */ jsx("div", { className: "flex-grow min-h-0 overflow-y-auto justify-center items-center py-1 px-3 ", children: isLoadingCustomer || isLoadingCustomer === void 0 ? /* @__PURE__ */ jsx(Spin, { size: "large", className: "flex self-center m-5 mx-auto my-auto p-44" }) : isScheduling ? /* @__PURE__ */ jsx(Schedules, { customer, setIsScheduling, hexcode: hex_code }) : companyClosed ? /* @__PURE__ */ jsx(
|
|
130493
|
+
/* @__PURE__ */ jsx("div", { className: "flex-grow min-h-0 overflow-y-auto justify-center items-center py-1 px-3 ", children: isLoadingCustomer || isLoadingCustomer === void 0 ? /* @__PURE__ */ jsx(Spin, { size: "large", className: "flex self-center m-5 mx-auto my-auto p-44" }) : isScheduling && hasFeature("calendar_scheduling") ? /* @__PURE__ */ jsx(Schedules, { customer, setIsScheduling, hexcode: hex_code }) : companyClosed ? /* @__PURE__ */ jsx(
|
|
130419
130494
|
Offline,
|
|
130420
130495
|
{
|
|
130421
130496
|
companyUser,
|
|
@@ -130431,7 +130506,22 @@ const WidgetFormDisplay = memo(
|
|
|
130431
130506
|
options: (company == null ? void 0 : company.options) || {},
|
|
130432
130507
|
offlineMode
|
|
130433
130508
|
}
|
|
130434
|
-
) : chatInit && chatClose ? /* @__PURE__ */ jsx(Feedback$1, { agent, hexcode: company == null ? void 0 : company.hex_code }) : /* @__PURE__ */
|
|
130509
|
+
) : chatInit && chatClose ? hasFeature("feedback_survey") ? /* @__PURE__ */ jsx(Feedback$1, { agent, hexcode: company == null ? void 0 : company.hex_code }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center p-6 text-center my-auto", children: [
|
|
130510
|
+
/* @__PURE__ */ jsx("div", { className: "text-green-500 text-4xl mb-4 font-bold", children: "✓" }),
|
|
130511
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-2", children: "Session Completed" }),
|
|
130512
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm mb-4", children: "Thank you for calling. Your session has ended." }),
|
|
130513
|
+
/* @__PURE__ */ jsx(
|
|
130514
|
+
Button,
|
|
130515
|
+
{
|
|
130516
|
+
type: "primary",
|
|
130517
|
+
onClick: () => {
|
|
130518
|
+
useChatStore.getState().reset();
|
|
130519
|
+
},
|
|
130520
|
+
style: { backgroundColor: company == null ? void 0 : company.hex_code },
|
|
130521
|
+
children: "Close"
|
|
130522
|
+
}
|
|
130523
|
+
)
|
|
130524
|
+
] }) : /* @__PURE__ */ jsx(
|
|
130435
130525
|
ChatMode,
|
|
130436
130526
|
{
|
|
130437
130527
|
chatInit,
|
|
@@ -130499,7 +130589,7 @@ const ChatScreen = memo(({ company, isOngoingChat }) => {
|
|
|
130499
130589
|
var _a2, _b, _c;
|
|
130500
130590
|
const { dataRef, setHasVerifiedFace } = useChatStore();
|
|
130501
130591
|
const hasVerifiedFace = (_b = (_a2 = dataRef == null ? void 0 : dataRef.wait) == null ? void 0 : _a2.conversation) == null ? void 0 : _b.hasVerifiedFace;
|
|
130502
|
-
const facialRecognitionEnabled = (_c = company == null ? void 0 : company.options) == null ? void 0 : _c.facialRecognitionEnabled;
|
|
130592
|
+
const facialRecognitionEnabled = ((_c = company == null ? void 0 : company.options) == null ? void 0 : _c.facialRecognitionEnabled) && hasFeature("facial_verification");
|
|
130503
130593
|
const onProceed = async () => {
|
|
130504
130594
|
var _a3, _b2;
|
|
130505
130595
|
try {
|