ahs-cti 1.0.1-beta.2 → 1.0.1-beta.21
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/agentDetailReport-XUNWPSQW.mjs +10 -0
- package/dist/agentDetailReport-XUNWPSQW.mjs.map +1 -0
- package/dist/agentPerformanceReport-4WNLHIFT.mjs +597 -0
- package/dist/agentPerformanceReport-4WNLHIFT.mjs.map +1 -0
- package/dist/{callHistory-A5CBDPZR.mjs → callHistory-3CMW24B6.mjs} +27 -34
- package/dist/callHistory-3CMW24B6.mjs.map +1 -0
- package/dist/campaigns-FR7EIRXI.mjs +2664 -0
- package/dist/campaigns-FR7EIRXI.mjs.map +1 -0
- package/dist/cdrReport-6OBRKAYS.mjs +965 -0
- package/dist/cdrReport-6OBRKAYS.mjs.map +1 -0
- package/dist/chunk-AEDSLIHI.mjs +49 -0
- package/dist/chunk-AEDSLIHI.mjs.map +1 -0
- package/dist/chunk-FVNDPJUU.mjs +95 -0
- package/dist/chunk-FVNDPJUU.mjs.map +1 -0
- package/dist/chunk-I4CJTHZR.mjs +138 -0
- package/dist/chunk-I4CJTHZR.mjs.map +1 -0
- package/dist/chunk-RZZQ42MG.mjs +115 -0
- package/dist/chunk-RZZQ42MG.mjs.map +1 -0
- package/dist/chunk-U2DJ5WRK.mjs +1219 -0
- package/dist/chunk-U2DJ5WRK.mjs.map +1 -0
- package/dist/{chunk-FFYJ4LWU.mjs → chunk-YREOEULC.mjs} +127 -12
- package/dist/chunk-YREOEULC.mjs.map +1 -0
- package/dist/index.d.mts +630 -527
- package/dist/index.d.ts +631 -528
- package/dist/index.js +7409 -602
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +406 -512
- package/dist/index.mjs.map +1 -1
- package/dist/loginReport-MHNHB5F6.mjs +969 -0
- package/dist/loginReport-MHNHB5F6.mjs.map +1 -0
- package/package.json +16 -1
- package/dist/callHistory-A5CBDPZR.mjs.map +0 -1
- package/dist/chunk-FFYJ4LWU.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useGetCallerData
|
|
3
|
+
} from "./chunk-AEDSLIHI.mjs";
|
|
4
|
+
import {
|
|
5
|
+
SDKAccessDenied,
|
|
6
|
+
SDKPermissionGuard,
|
|
7
|
+
useSDKPermissions
|
|
8
|
+
} from "./chunk-I4CJTHZR.mjs";
|
|
1
9
|
import {
|
|
2
10
|
END_POINT,
|
|
3
11
|
SDKProvider,
|
|
@@ -11,7 +19,7 @@ import {
|
|
|
11
19
|
axios_default,
|
|
12
20
|
sdkStateManager,
|
|
13
21
|
useToast
|
|
14
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YREOEULC.mjs";
|
|
15
23
|
|
|
16
24
|
// call-control-sdk/lib/hooks/eventsTracker.ts
|
|
17
25
|
var EventTrackerSDK = class {
|
|
@@ -42,6 +50,7 @@ var EventTrackerSDK = class {
|
|
|
42
50
|
return this.ticketId;
|
|
43
51
|
}
|
|
44
52
|
async createTicket() {
|
|
53
|
+
var _a;
|
|
45
54
|
if (!this.config) {
|
|
46
55
|
throw new Error("EventTracker not initialized");
|
|
47
56
|
}
|
|
@@ -53,7 +62,7 @@ var EventTrackerSDK = class {
|
|
|
53
62
|
"Content-Type": "application/json"
|
|
54
63
|
},
|
|
55
64
|
body: JSON.stringify({
|
|
56
|
-
userId: this.config.agentId,
|
|
65
|
+
userId: String((_a = this.config.agentId) != null ? _a : ""),
|
|
57
66
|
// sessionId: this.config.sessionId,
|
|
58
67
|
password: this.config.password
|
|
59
68
|
})
|
|
@@ -139,29 +148,26 @@ var useEndCall = () => {
|
|
|
139
148
|
const [error, setError] = useState2(null);
|
|
140
149
|
const [data, setData] = useState2(null);
|
|
141
150
|
const handleEndCall = useCallback2(
|
|
142
|
-
async (data2) => {
|
|
143
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
151
|
+
async (data2 = {}) => {
|
|
152
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
144
153
|
const state = getSession(STORAGE_KEY);
|
|
145
154
|
setLoading(true);
|
|
146
155
|
const payload = {
|
|
147
|
-
|
|
148
|
-
agent_id: (
|
|
149
|
-
set_followUp: (
|
|
150
|
-
callback_date: (
|
|
151
|
-
callback_hrs:
|
|
152
|
-
callback_mins:
|
|
153
|
-
mobile_number: (
|
|
154
|
-
list_comments: "",
|
|
155
|
-
call_reference_id: (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
call_id: (_c = (_b = data2 == null ? void 0 : data2.call_id) != null ? _b : (_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.call_id) != null ? _c : "",
|
|
157
|
+
agent_id: (_e = (_d = data2 == null ? void 0 : data2.agent_id) != null ? _d : state == null ? void 0 : state.agentId) != null ? _e : "",
|
|
158
|
+
set_followUp: (_f = data2 == null ? void 0 : data2.set_followUp) != null ? _f : "N",
|
|
159
|
+
callback_date: (_g = data2 == null ? void 0 : data2.callback_date) != null ? _g : "",
|
|
160
|
+
callback_hrs: (_h = data2 == null ? void 0 : data2.callback_hrs) != null ? _h : 0,
|
|
161
|
+
callback_mins: (_i = data2 == null ? void 0 : data2.callback_mins) != null ? _i : 0,
|
|
162
|
+
mobile_number: (_l = (_k = data2 == null ? void 0 : data2.mobile_number) != null ? _k : (_j = state == null ? void 0 : state.callData) == null ? void 0 : _j.phone_number) != null ? _l : "",
|
|
163
|
+
list_comments: (_m = data2 == null ? void 0 : data2.list_comments) != null ? _m : "",
|
|
164
|
+
call_reference_id: (_p = (_o = data2 == null ? void 0 : data2.call_reference_id) != null ? _o : (_n = state == null ? void 0 : state.callData) == null ? void 0 : _n.call_id) != null ? _p : "",
|
|
165
|
+
is_mark_as_break: (_q = data2 == null ? void 0 : data2.is_mark_as_break) != null ? _q : false,
|
|
166
|
+
disposition: (_r = data2 == null ? void 0 : data2.disposition) != null ? _r : "RES",
|
|
167
|
+
line_number: (_s = data2 == null ? void 0 : data2.line_number) != null ? _s : 0,
|
|
168
|
+
reason: (_t = data2 == null ? void 0 : data2.reason) != null ? _t : "normal"
|
|
159
169
|
};
|
|
160
|
-
return axios_default.post(END_POINT.END_CALL, payload
|
|
161
|
-
params: {
|
|
162
|
-
isBreak: (_k = data2 == null ? void 0 : data2.isBreak) != null ? _k : false
|
|
163
|
-
}
|
|
164
|
-
}).then((res) => {
|
|
170
|
+
return axios_default.post(END_POINT.END_CALL, payload).then((res) => {
|
|
165
171
|
sdkStateManager.resetConferenceLines();
|
|
166
172
|
sdkStateManager.endCall();
|
|
167
173
|
setData(res == null ? void 0 : res.data);
|
|
@@ -198,19 +204,40 @@ var useClickToCall = () => {
|
|
|
198
204
|
const [error, setError] = useState3(null);
|
|
199
205
|
const [data, setData] = useState3(null);
|
|
200
206
|
const handleStartCall = useCallback3(async (data2) => {
|
|
201
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
207
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
202
208
|
const state = getSession2(STORAGE_KEY);
|
|
203
209
|
const status = (_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.status;
|
|
204
210
|
setLoading(true);
|
|
205
|
-
if (status === "IDLE" || status === "ONCALL") {
|
|
211
|
+
if (status === "IDLE" || status === "ONCALL" || status === "WRAPUP") {
|
|
212
|
+
const liveState = sdkStateManager.getState();
|
|
213
|
+
const isWrapupCall = status === "WRAPUP";
|
|
214
|
+
let parentCallUuid = "";
|
|
215
|
+
if (data2 == null ? void 0 : data2.parentCallUuid) {
|
|
216
|
+
parentCallUuid = data2.parentCallUuid;
|
|
217
|
+
} else if ((_b = liveState.sdkConfig) == null ? void 0 : _b.disableAlternateDialing) {
|
|
218
|
+
if (isWrapupCall) {
|
|
219
|
+
if (liveState.rootCallUuid) {
|
|
220
|
+
parentCallUuid = liveState.rootCallUuid;
|
|
221
|
+
} else if ((_c = state == null ? void 0 : state.callData) == null ? void 0 : _c.call_id) {
|
|
222
|
+
parentCallUuid = state.callData.call_id;
|
|
223
|
+
sdkStateManager.setRootCallUuid(parentCallUuid);
|
|
224
|
+
}
|
|
225
|
+
} else if (liveState.rootCallUuid) {
|
|
226
|
+
sdkStateManager.setRootCallUuid(null);
|
|
227
|
+
}
|
|
228
|
+
} else if (liveState.rootCallUuid) {
|
|
229
|
+
sdkStateManager.setRootCallUuid(null);
|
|
230
|
+
}
|
|
206
231
|
const payload = {
|
|
207
232
|
phone_number: data2 == null ? void 0 : data2.mobileNumber,
|
|
208
|
-
user: (
|
|
209
|
-
auto_answer: (
|
|
210
|
-
|
|
211
|
-
reference_id: (
|
|
212
|
-
call_source: (
|
|
213
|
-
caseId: (
|
|
233
|
+
user: (_e = (_d = data2 == null ? void 0 : data2.user) != null ? _d : state == null ? void 0 : state.agentId) != null ? _e : "",
|
|
234
|
+
auto_answer: (_f = data2 == null ? void 0 : data2.auto_answer) != null ? _f : false,
|
|
235
|
+
call_id: (_i = (_h = (_g = state == null ? void 0 : state.callData) == null ? void 0 : _g.call_id) != null ? _h : data2 == null ? void 0 : data2.call_id) != null ? _i : "",
|
|
236
|
+
reference_id: (_j = data2 == null ? void 0 : data2.reference_id) != null ? _j : "",
|
|
237
|
+
call_source: (_k = data2 == null ? void 0 : data2.call_source) != null ? _k : "",
|
|
238
|
+
caseId: (_l = data2 == null ? void 0 : data2.caseId) != null ? _l : "",
|
|
239
|
+
isWrapup: (_m = data2 == null ? void 0 : data2.isWrapup) != null ? _m : false,
|
|
240
|
+
parentCallUuid: (_p = (_o = (_n = data2 == null ? void 0 : data2.parentCallUuid) != null ? _n : data2.parentCallUuid) != null ? _o : parentCallUuid) != null ? _p : ""
|
|
214
241
|
};
|
|
215
242
|
return axios_default.post(END_POINT.CLICK_TO_CALL, payload).then((res) => {
|
|
216
243
|
sdkStateManager.resetConferenceLines();
|
|
@@ -240,44 +267,11 @@ var useClickToCall = () => {
|
|
|
240
267
|
};
|
|
241
268
|
};
|
|
242
269
|
|
|
243
|
-
// call-control-sdk/lib/hooks/useGetCallerData.ts
|
|
244
|
-
import { useState as useState4, useEffect } from "react";
|
|
245
|
-
var useGetCallerData = () => {
|
|
246
|
-
const { process_id, process_name, status, phone_number, agent_id, convox_id, call_details } = sdkStateManager.getState().callData;
|
|
247
|
-
const initialCallData = {
|
|
248
|
-
phone_number,
|
|
249
|
-
status,
|
|
250
|
-
callReferenceId: convox_id,
|
|
251
|
-
agent_id,
|
|
252
|
-
process_id,
|
|
253
|
-
process_name,
|
|
254
|
-
call_details
|
|
255
|
-
};
|
|
256
|
-
const [callData, setCallData] = useState4(initialCallData);
|
|
257
|
-
useEffect(() => {
|
|
258
|
-
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
259
|
-
const { process_id: process_id2, process_name: process_name2, status: status2, phone_number: phone_number2, agent_id: agent_id2, convox_id: convox_id2, call_details: call_details2 } = sdkStateManager.getState().callData;
|
|
260
|
-
const currentCallData = {
|
|
261
|
-
phone_number: phone_number2,
|
|
262
|
-
status: status2,
|
|
263
|
-
callReferenceId: convox_id2,
|
|
264
|
-
agent_id: agent_id2,
|
|
265
|
-
process_id: process_id2,
|
|
266
|
-
process_name: process_name2,
|
|
267
|
-
call_details: call_details2
|
|
268
|
-
};
|
|
269
|
-
setCallData(currentCallData);
|
|
270
|
-
});
|
|
271
|
-
return unsubscribe;
|
|
272
|
-
}, []);
|
|
273
|
-
return callData;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
270
|
// call-control-sdk/lib/hooks/useGetAuthorizationToken.ts
|
|
277
|
-
import { useState as
|
|
271
|
+
import { useState as useState4, useEffect } from "react";
|
|
278
272
|
var useGetAuthorizationToken = () => {
|
|
279
|
-
const [token, setToken] =
|
|
280
|
-
|
|
273
|
+
const [token, setToken] = useState4(sdkStateManager.getSdkAuthToken());
|
|
274
|
+
useEffect(() => {
|
|
281
275
|
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
282
276
|
setToken(sdkStateManager.getSdkAuthToken());
|
|
283
277
|
});
|
|
@@ -287,10 +281,10 @@ var useGetAuthorizationToken = () => {
|
|
|
287
281
|
};
|
|
288
282
|
|
|
289
283
|
// call-control-sdk/lib/hooks/useSDKState.ts
|
|
290
|
-
import { useState as
|
|
284
|
+
import { useState as useState5, useEffect as useEffect2 } from "react";
|
|
291
285
|
function useSDKState() {
|
|
292
|
-
const [state, setState] =
|
|
293
|
-
|
|
286
|
+
const [state, setState] = useState5(sdkStateManager.getState());
|
|
287
|
+
useEffect2(() => {
|
|
294
288
|
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
295
289
|
setState(sdkStateManager.getState());
|
|
296
290
|
});
|
|
@@ -300,13 +294,13 @@ function useSDKState() {
|
|
|
300
294
|
}
|
|
301
295
|
|
|
302
296
|
// call-control-sdk/lib/hooks/useCallMonitoring.ts
|
|
303
|
-
import { useCallback as useCallback4, useState as
|
|
297
|
+
import { useCallback as useCallback4, useState as useState6 } from "react";
|
|
304
298
|
var useCallMonitoring = () => {
|
|
305
|
-
const [loading, setLoading] =
|
|
306
|
-
const [success, setSuccess] =
|
|
307
|
-
const [isError, setIsError] =
|
|
308
|
-
const [error, setError] =
|
|
309
|
-
const [data, setData] =
|
|
299
|
+
const [loading, setLoading] = useState6(false);
|
|
300
|
+
const [success, setSuccess] = useState6(false);
|
|
301
|
+
const [isError, setIsError] = useState6(false);
|
|
302
|
+
const [error, setError] = useState6(null);
|
|
303
|
+
const [data, setData] = useState6(null);
|
|
310
304
|
const resetState = () => {
|
|
311
305
|
setSuccess(false);
|
|
312
306
|
setIsError(false);
|
|
@@ -376,27 +370,25 @@ var useCallMonitoring = () => {
|
|
|
376
370
|
import { memo, useCallback as useCallback7 } from "react";
|
|
377
371
|
|
|
378
372
|
// call-control-sdk/lib/components/callControls.tsx
|
|
379
|
-
import
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
MoreVert
|
|
399
|
-
} from "@mui/icons-material";
|
|
373
|
+
import CallEnd2 from "@mui/icons-material/CallEnd";
|
|
374
|
+
import Close2 from "@mui/icons-material/Close";
|
|
375
|
+
import DragIndicator from "@mui/icons-material/DragIndicator";
|
|
376
|
+
import Group from "@mui/icons-material/Group";
|
|
377
|
+
import KeyboardArrowDown from "@mui/icons-material/KeyboardArrowDown";
|
|
378
|
+
import Layers from "@mui/icons-material/Layers";
|
|
379
|
+
import Mic from "@mui/icons-material/Mic";
|
|
380
|
+
import MicOff from "@mui/icons-material/MicOff";
|
|
381
|
+
import Pause2 from "@mui/icons-material/Pause";
|
|
382
|
+
import Pending from "@mui/icons-material/Pending";
|
|
383
|
+
import Phone from "@mui/icons-material/Phone";
|
|
384
|
+
import PlayArrow2 from "@mui/icons-material/PlayArrow";
|
|
385
|
+
import SupportAgent2 from "@mui/icons-material/SupportAgent";
|
|
386
|
+
import TransferWithinAStation2 from "@mui/icons-material/TransferWithinAStation";
|
|
387
|
+
import Upcoming2 from "@mui/icons-material/Upcoming";
|
|
388
|
+
import WifiCalling3 from "@mui/icons-material/WifiCalling3";
|
|
389
|
+
import SendRounded from "@mui/icons-material/SendRounded";
|
|
390
|
+
import SmsSharp from "@mui/icons-material/SmsSharp";
|
|
391
|
+
import MoreVert from "@mui/icons-material/MoreVert";
|
|
400
392
|
import {
|
|
401
393
|
Box as Box2,
|
|
402
394
|
Button as Button2,
|
|
@@ -412,25 +404,23 @@ import {
|
|
|
412
404
|
Typography as Typography2,
|
|
413
405
|
useTheme as useTheme3
|
|
414
406
|
} from "@mui/material";
|
|
415
|
-
import { useEffect as
|
|
407
|
+
import { useEffect as useEffect4, useRef as useRef2, useState as useState9 } from "react";
|
|
416
408
|
|
|
417
409
|
// call-control-sdk/lib/components/dialog.tsx
|
|
418
|
-
import
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
Upcoming
|
|
433
|
-
} from "@mui/icons-material";
|
|
410
|
+
import Airlines from "@mui/icons-material/Airlines";
|
|
411
|
+
import Call from "@mui/icons-material/Call";
|
|
412
|
+
import CallEnd from "@mui/icons-material/CallEnd";
|
|
413
|
+
import CallSplit from "@mui/icons-material/CallSplit";
|
|
414
|
+
import Close from "@mui/icons-material/Close";
|
|
415
|
+
import MemoryOutlined from "@mui/icons-material/MemoryOutlined";
|
|
416
|
+
import Pause from "@mui/icons-material/Pause";
|
|
417
|
+
import PhoneDisabled from "@mui/icons-material/PhoneDisabled";
|
|
418
|
+
import PlayArrow from "@mui/icons-material/PlayArrow";
|
|
419
|
+
import RecordVoiceOver from "@mui/icons-material/RecordVoiceOver";
|
|
420
|
+
import Roofing from "@mui/icons-material/Roofing";
|
|
421
|
+
import SupportAgent from "@mui/icons-material/SupportAgent";
|
|
422
|
+
import TransferWithinAStation from "@mui/icons-material/TransferWithinAStation";
|
|
423
|
+
import Upcoming from "@mui/icons-material/Upcoming";
|
|
434
424
|
import {
|
|
435
425
|
Box,
|
|
436
426
|
Button,
|
|
@@ -453,7 +443,7 @@ import {
|
|
|
453
443
|
CircularProgress,
|
|
454
444
|
Checkbox
|
|
455
445
|
} from "@mui/material";
|
|
456
|
-
import { useEffect as
|
|
446
|
+
import { useEffect as useEffect3, useMemo, useState as useState7 } from "react";
|
|
457
447
|
|
|
458
448
|
// call-control-sdk/lib/services/request.ts
|
|
459
449
|
import { useCallback as useCallback5, useReducer } from "react";
|
|
@@ -669,10 +659,10 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
669
659
|
enabled: ((_b = state.sdkConfig) == null ? void 0 : _b.enabled) || {},
|
|
670
660
|
outlined: ((_c = state.sdkConfig) == null ? void 0 : _c.outlined) || {}
|
|
671
661
|
});
|
|
672
|
-
const [conferenceCallStart, setConferenceCallStart] =
|
|
673
|
-
const [conferenceCallMerge, setConferenceCallMerge] =
|
|
674
|
-
const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] =
|
|
675
|
-
const [conferenceCallEnd, setConferenceCallEnd] =
|
|
662
|
+
const [conferenceCallStart, setConferenceCallStart] = useState7(false);
|
|
663
|
+
const [conferenceCallMerge, setConferenceCallMerge] = useState7(false);
|
|
664
|
+
const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] = useState7(false);
|
|
665
|
+
const [conferenceCallEnd, setConferenceCallEnd] = useState7(false);
|
|
676
666
|
const isSameAsActiveCall = (each == null ? void 0 : each.phone) === ((_d = state.callData) == null ? void 0 : _d.phone_number) && !!(each == null ? void 0 : each.phone);
|
|
677
667
|
const isDuplicateInConference = !!(each == null ? void 0 : each.phone) && (each == null ? void 0 : each.line) !== 1 && ((_e = state.conferenceLine) == null ? void 0 : _e.some(
|
|
678
668
|
(line) => line.line < each.line && line.phone === (each == null ? void 0 : each.phone) && !!line.phone
|
|
@@ -683,7 +673,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
683
673
|
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
684
674
|
};
|
|
685
675
|
const onConferenceCallStart = (line, data) => {
|
|
686
|
-
var _a2, _b2, _c2, _d2, _e2
|
|
676
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
687
677
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
688
678
|
if (line_used.phone === ((_a2 = state.callData) == null ? void 0 : _a2.phone_number)) {
|
|
689
679
|
showToast("Cannot conference with the active call number", "error");
|
|
@@ -708,8 +698,8 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
708
698
|
// thirdparty_no: line_used.phone,
|
|
709
699
|
target: line_used.phone,
|
|
710
700
|
line_number: Number(line_used.line),
|
|
711
|
-
userid: (
|
|
712
|
-
process: (
|
|
701
|
+
userid: (_c2 = state.agentId) != null ? _c2 : "",
|
|
702
|
+
process: (_e2 = (_d2 = state.callData) == null ? void 0 : _d2.process_name) != null ? _e2 : ""
|
|
713
703
|
};
|
|
714
704
|
axios_default.post(END_POINT.CONFERENCE_CALL, payload).then((res) => {
|
|
715
705
|
var _a3;
|
|
@@ -723,7 +713,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
723
713
|
});
|
|
724
714
|
};
|
|
725
715
|
const onMergeConferenceCall = (line, data) => {
|
|
726
|
-
var _a2, _b2, _c2, _d2, _e2
|
|
716
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
727
717
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
728
718
|
setConferenceCallMerge(true);
|
|
729
719
|
const payload = {
|
|
@@ -731,9 +721,9 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
731
721
|
operation: `CONFERENCE`,
|
|
732
722
|
line_used: String(line_used.line),
|
|
733
723
|
thirdparty_no: line_used.phone,
|
|
734
|
-
userid: (
|
|
735
|
-
process: (
|
|
736
|
-
|
|
724
|
+
userid: (_a2 = state.agentId) != null ? _a2 : "",
|
|
725
|
+
process: (_c2 = (_b2 = state.callData) == null ? void 0 : _b2.process_name) != null ? _c2 : "",
|
|
726
|
+
call_id: (_e2 = (_d2 = state.callData) == null ? void 0 : _d2.call_id) != null ? _e2 : ""
|
|
737
727
|
};
|
|
738
728
|
axios_default.post(END_POINT.CONFERENCE_MERGE_CALL, payload).then((res) => {
|
|
739
729
|
var _a3, _b3, _c3;
|
|
@@ -753,16 +743,16 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
753
743
|
});
|
|
754
744
|
};
|
|
755
745
|
const onHoldOrUnHoldConferenceCall = (line, data, type) => {
|
|
756
|
-
var _a2, _b2, _c2, _d2, _e2
|
|
746
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
757
747
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
758
748
|
setConferenceCallHoldOrUnHold(true);
|
|
759
749
|
const payload = {
|
|
760
750
|
action: type === "HOLDUSER" ? "HOLD" : "UNHOLD",
|
|
761
751
|
operation: type,
|
|
762
752
|
hold_channel_no: type === "HOLDUSER" ? `hold${line_used.line}` : `unhold${line_used.line}`,
|
|
763
|
-
userid: (
|
|
764
|
-
process: (
|
|
765
|
-
|
|
753
|
+
userid: (_a2 = state.agentId) != null ? _a2 : "",
|
|
754
|
+
process: (_c2 = (_b2 = state.callData) == null ? void 0 : _b2.process_name) != null ? _c2 : "",
|
|
755
|
+
call_uuid: (_e2 = (_d2 = state.callData) == null ? void 0 : _d2.call_id) != null ? _e2 : "",
|
|
766
756
|
line_number: Number(line_used.line)
|
|
767
757
|
};
|
|
768
758
|
axios_default.post(END_POINT.CONFERENCE_CALL_HOLD_OR_UN_HOLD, payload).then((res) => {
|
|
@@ -785,7 +775,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
785
775
|
}
|
|
786
776
|
setConferenceCallEnd(true);
|
|
787
777
|
const payload = {
|
|
788
|
-
|
|
778
|
+
call_id: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.call_id) != null ? _b2 : "",
|
|
789
779
|
agent_id: (_c2 = state.agentId) != null ? _c2 : "",
|
|
790
780
|
mobile_number: (_d2 = line_used.phone) != null ? _d2 : "",
|
|
791
781
|
line_number: Number(line_used.line),
|
|
@@ -805,18 +795,23 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
805
795
|
const [holdOrUnHold] = usePostRequest();
|
|
806
796
|
const [muteOrUnMute] = usePostRequest();
|
|
807
797
|
const handleHoldToggle = () => {
|
|
808
|
-
var _a2;
|
|
798
|
+
var _a2, _b2, _c2, _d2;
|
|
809
799
|
const payload = {
|
|
810
800
|
action: ((_a2 = state.callData) == null ? void 0 : _a2.hold) === 1 ? "UNHOLD" /* UNHOLD */ : "HOLD" /* HOLD */,
|
|
811
|
-
|
|
801
|
+
user_id: String((_b2 = state.agentId) != null ? _b2 : ""),
|
|
802
|
+
call_uuid: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.call_id) != null ? _d2 : "",
|
|
803
|
+
line_number: 0
|
|
812
804
|
};
|
|
813
805
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
814
806
|
};
|
|
815
807
|
const handleMuteToggle = () => {
|
|
816
|
-
var _a2;
|
|
808
|
+
var _a2, _b2, _c2, _d2;
|
|
817
809
|
const payload = {
|
|
818
810
|
action: ((_a2 = state.callData) == null ? void 0 : _a2.mute) === 1 ? "UNMUTE" /* UNMUTE */ : "MUTE" /* MUTE */,
|
|
819
|
-
|
|
811
|
+
direction: "both",
|
|
812
|
+
user_id: String((_b2 = state.agentId) != null ? _b2 : ""),
|
|
813
|
+
call_uuid: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.call_id) != null ? _d2 : "",
|
|
814
|
+
line_number: 0
|
|
820
815
|
};
|
|
821
816
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
822
817
|
};
|
|
@@ -1081,26 +1076,26 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1081
1076
|
);
|
|
1082
1077
|
};
|
|
1083
1078
|
function ConferenceDialog() {
|
|
1084
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1079
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1085
1080
|
const state = useSDKState();
|
|
1086
1081
|
const { showToast } = useToast();
|
|
1087
|
-
const [conferenceCallEndAll, setConferenceCallEndAll] =
|
|
1082
|
+
const [conferenceCallEndAll, setConferenceCallEndAll] = useState7(false);
|
|
1088
1083
|
const handleClose = () => {
|
|
1089
1084
|
sdkStateManager.setOpenConferenceDialog(false);
|
|
1090
1085
|
};
|
|
1091
1086
|
const onEndAllConferenceCalls = () => {
|
|
1092
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
1087
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n;
|
|
1093
1088
|
setConferenceCallEndAll(true);
|
|
1094
1089
|
const payload = {
|
|
1095
1090
|
action: "EXTERNAL_CONFERENCE",
|
|
1096
1091
|
operation: "ENDCONFERENCE",
|
|
1097
|
-
userid: (
|
|
1098
|
-
process: (
|
|
1099
|
-
processid: (
|
|
1100
|
-
process_name: (
|
|
1101
|
-
callreferenceid: (
|
|
1102
|
-
|
|
1103
|
-
mobile_number: (
|
|
1092
|
+
userid: (_a2 = state.agentId) != null ? _a2 : "",
|
|
1093
|
+
process: (_c2 = (_b2 = state.callData) == null ? void 0 : _b2.process_name) != null ? _c2 : "",
|
|
1094
|
+
processid: (_f2 = (_e2 = (_d2 = state.process) == null ? void 0 : _d2.process_id) == null ? void 0 : _e2.toString()) != null ? _f2 : "",
|
|
1095
|
+
process_name: (_h2 = (_g2 = state.process) == null ? void 0 : _g2.process_name) != null ? _h2 : "",
|
|
1096
|
+
callreferenceid: (_j2 = (_i2 = state.callData) == null ? void 0 : _i2.call_id) != null ? _j2 : "",
|
|
1097
|
+
call_id: (_l2 = (_k2 = state.callData) == null ? void 0 : _k2.call_id) != null ? _l2 : "",
|
|
1098
|
+
mobile_number: (_n = (_m2 = state.callData) == null ? void 0 : _m2.phone_number) != null ? _n : ""
|
|
1104
1099
|
};
|
|
1105
1100
|
axios_default.post(END_POINT.CONFERENCE_CALL_END_ALL, payload).then((res) => {
|
|
1106
1101
|
var _a3;
|
|
@@ -1116,16 +1111,16 @@ function ConferenceDialog() {
|
|
|
1116
1111
|
});
|
|
1117
1112
|
};
|
|
1118
1113
|
const handleTransferConferenceCall = () => {
|
|
1119
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2,
|
|
1114
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n;
|
|
1120
1115
|
const payload = {
|
|
1121
1116
|
action: "TRANSFERAPI",
|
|
1122
|
-
userid: (
|
|
1123
|
-
process: (
|
|
1124
|
-
processid: (
|
|
1125
|
-
process_name: (
|
|
1126
|
-
callreferenceid: (
|
|
1127
|
-
|
|
1128
|
-
mobile_number: (
|
|
1117
|
+
userid: (_a2 = state.agentId) != null ? _a2 : "",
|
|
1118
|
+
process: (_c2 = (_b2 = state.callData) == null ? void 0 : _b2.process_name) != null ? _c2 : "",
|
|
1119
|
+
processid: (_f2 = (_e2 = (_d2 = state.process) == null ? void 0 : _d2.process_id) == null ? void 0 : _e2.toString()) != null ? _f2 : "",
|
|
1120
|
+
process_name: (_h2 = (_g2 = state.process) == null ? void 0 : _g2.process_name) != null ? _h2 : "",
|
|
1121
|
+
callreferenceid: (_j2 = (_i2 = state.callData) == null ? void 0 : _i2.call_id) != null ? _j2 : "",
|
|
1122
|
+
call_id: (_l2 = (_k2 = state.callData) == null ? void 0 : _k2.call_id) != null ? _l2 : "",
|
|
1123
|
+
mobile_number: (_n = (_m2 = state.callData) == null ? void 0 : _m2.phone_number) != null ? _n : ""
|
|
1129
1124
|
};
|
|
1130
1125
|
axios_default.post(END_POINT.CONFERENCE_CALL_TRANSFER, payload).then((res) => {
|
|
1131
1126
|
var _a3;
|
|
@@ -1216,14 +1211,14 @@ function ConferenceDialog() {
|
|
|
1216
1211
|
)
|
|
1217
1212
|
}
|
|
1218
1213
|
),
|
|
1219
|
-
/* @__PURE__ */ jsx(Box, { textAlign: "center", m: 2, children: /* @__PURE__ */ jsxs(
|
|
1214
|
+
/* @__PURE__ */ jsx(Box, { sx: { textAlign: "center", m: 2 }, children: /* @__PURE__ */ jsx(Tooltip, { title: ((_h = state.sdkConfig) == null ? void 0 : _h.disableEndConference) ? "End Conference feature is disabled" : "", children: /* @__PURE__ */ jsx(Box, { component: "span", children: /* @__PURE__ */ jsxs(
|
|
1220
1215
|
Button,
|
|
1221
1216
|
{
|
|
1222
1217
|
variant: "outlined",
|
|
1223
1218
|
color: "error",
|
|
1224
1219
|
size: "large",
|
|
1225
1220
|
onClick: onEndAllConferenceCalls,
|
|
1226
|
-
disabled: conferenceCallEndAll || conferenceLineCount <= 0,
|
|
1221
|
+
disabled: conferenceCallEndAll || conferenceLineCount <= 0 || ((_i = state.sdkConfig) == null ? void 0 : _i.disableEndConference),
|
|
1227
1222
|
sx: { px: 2, borderRadius: "20px", textTransform: "capitalize" },
|
|
1228
1223
|
children: [
|
|
1229
1224
|
conferenceCallEndAll ? /* @__PURE__ */ jsx(
|
|
@@ -1236,9 +1231,10 @@ function ConferenceDialog() {
|
|
|
1236
1231
|
) : /* @__PURE__ */ jsx(
|
|
1237
1232
|
IconButton,
|
|
1238
1233
|
{
|
|
1234
|
+
disabled: !!((_j = state.sdkConfig) == null ? void 0 : _j.disableEndConference),
|
|
1239
1235
|
sx: {
|
|
1240
|
-
bgcolor: "error.main",
|
|
1241
|
-
"&:hover": { bgcolor: "error.dark" },
|
|
1236
|
+
bgcolor: ((_k = state.sdkConfig) == null ? void 0 : _k.disableEndConference) ? "action.disabledBackground" : "error.main",
|
|
1237
|
+
"&:hover": { bgcolor: ((_l = state.sdkConfig) == null ? void 0 : _l.disableEndConference) ? "action.disabledBackground" : "error.dark" },
|
|
1242
1238
|
marginRight: "8px",
|
|
1243
1239
|
width: "28px",
|
|
1244
1240
|
height: "28px",
|
|
@@ -1253,13 +1249,13 @@ function ConferenceDialog() {
|
|
|
1253
1249
|
justifyContent: "center",
|
|
1254
1250
|
borderRadius: "50%"
|
|
1255
1251
|
},
|
|
1256
|
-
children: /* @__PURE__ */ jsx(PhoneDisabled, { sx: { color: "white", fontSize: "16px", fontWeight: "600" } })
|
|
1252
|
+
children: /* @__PURE__ */ jsx(PhoneDisabled, { sx: { color: ((_m = state.sdkConfig) == null ? void 0 : _m.disableEndConference) ? "action.disabled" : "white", fontSize: "16px", fontWeight: "600" } })
|
|
1257
1253
|
}
|
|
1258
1254
|
),
|
|
1259
1255
|
"End Conference"
|
|
1260
1256
|
]
|
|
1261
1257
|
}
|
|
1262
|
-
) })
|
|
1258
|
+
) }) }) })
|
|
1263
1259
|
] })
|
|
1264
1260
|
}
|
|
1265
1261
|
) });
|
|
@@ -1267,7 +1263,7 @@ function ConferenceDialog() {
|
|
|
1267
1263
|
function CallTransferDialog({ open }) {
|
|
1268
1264
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
1269
1265
|
const state = useSDKState();
|
|
1270
|
-
const [mobileNumber, setMobileNumber] =
|
|
1266
|
+
const [mobileNumber, setMobileNumber] = useState7("");
|
|
1271
1267
|
const [transferCall, { isLoading: isTransferLoading }] = usePostRequest({
|
|
1272
1268
|
onSuccess: () => {
|
|
1273
1269
|
sdkStateManager.setOpenCallTransferDialog(false);
|
|
@@ -1285,9 +1281,9 @@ function CallTransferDialog({ open }) {
|
|
|
1285
1281
|
sdkStateManager.setConsultInfo(null);
|
|
1286
1282
|
}
|
|
1287
1283
|
});
|
|
1288
|
-
const [currentselecteTab, setCurrentselecteTab] =
|
|
1289
|
-
const [transferMenuAnchor, setTransferMenuAnchor] =
|
|
1290
|
-
const [pendingTransferData, setPendingTransferData] =
|
|
1284
|
+
const [currentselecteTab, setCurrentselecteTab] = useState7("queues");
|
|
1285
|
+
const [transferMenuAnchor, setTransferMenuAnchor] = useState7(null);
|
|
1286
|
+
const [pendingTransferData, setPendingTransferData] = useState7(null);
|
|
1291
1287
|
const blindEnabled = !((_a = state.sdkConfig) == null ? void 0 : _a.disableBlindTransfer);
|
|
1292
1288
|
const attendedEnabled = !((_b = state.sdkConfig) == null ? void 0 : _b.disableAttendedTransfer);
|
|
1293
1289
|
const enabledTransferModeCount = (blindEnabled ? 1 : 0) + (attendedEnabled ? 1 : 0);
|
|
@@ -1305,39 +1301,39 @@ function CallTransferDialog({ open }) {
|
|
|
1305
1301
|
sdkStateManager.setOpenCallTransferDialog(false);
|
|
1306
1302
|
};
|
|
1307
1303
|
const handleTransferCall = (data, type, mode = "DEFAULT") => {
|
|
1308
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z, _A, _B, _C, _D, _E
|
|
1304
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z, _A, _B, _C, _D, _E;
|
|
1309
1305
|
if (type === "PROCESS") {
|
|
1310
1306
|
const payload = {
|
|
1311
1307
|
mobile_number: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.phone_number) != null ? _b2 : "",
|
|
1312
|
-
userid:
|
|
1308
|
+
userid: state.agentId,
|
|
1313
1309
|
type: "PROCESS",
|
|
1314
|
-
transfer_to: (
|
|
1315
|
-
callreferenceid: (
|
|
1316
|
-
processid: String((
|
|
1317
|
-
process_name: (
|
|
1310
|
+
transfer_to: (_c2 = data == null ? void 0 : data.process_name) != null ? _c2 : "",
|
|
1311
|
+
callreferenceid: (_e2 = (_d2 = state.callData) == null ? void 0 : _d2.call_id) != null ? _e2 : "",
|
|
1312
|
+
processid: String((_g2 = (_f2 = state.callData) == null ? void 0 : _f2.process_id) != null ? _g2 : ""),
|
|
1313
|
+
process_name: (_i2 = (_h2 = state.callData) == null ? void 0 : _h2.process_name) != null ? _i2 : ""
|
|
1318
1314
|
};
|
|
1319
1315
|
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1320
1316
|
} else if (type === "QUEUE") {
|
|
1321
1317
|
const payload = {
|
|
1322
|
-
mobile_number: (
|
|
1323
|
-
userid:
|
|
1318
|
+
mobile_number: (_k2 = (_j2 = state.callData) == null ? void 0 : _j2.phone_number) != null ? _k2 : "",
|
|
1319
|
+
userid: state.agentId,
|
|
1324
1320
|
type: "QUEUE",
|
|
1325
|
-
transfer_to: (
|
|
1326
|
-
callreferenceid: (
|
|
1327
|
-
processid: String((
|
|
1328
|
-
process_name: (
|
|
1321
|
+
transfer_to: (_l2 = data == null ? void 0 : data.queue_name) != null ? _l2 : "",
|
|
1322
|
+
callreferenceid: (_n2 = (_m2 = state.callData) == null ? void 0 : _m2.call_id) != null ? _n2 : "",
|
|
1323
|
+
processid: String((_p2 = (_o2 = state.callData) == null ? void 0 : _o2.process_id) != null ? _p2 : ""),
|
|
1324
|
+
process_name: (_r2 = (_q2 = state.callData) == null ? void 0 : _q2.process_name) != null ? _r2 : ""
|
|
1329
1325
|
};
|
|
1330
1326
|
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1331
1327
|
} else if (type === "AGENT") {
|
|
1332
1328
|
const payload = {
|
|
1333
|
-
mobile_number: (
|
|
1334
|
-
userid:
|
|
1329
|
+
mobile_number: (_t2 = (_s2 = state.callData) == null ? void 0 : _s2.phone_number) != null ? _t2 : "",
|
|
1330
|
+
userid: state.agentId,
|
|
1335
1331
|
type: "AGENT",
|
|
1336
1332
|
transfer_type: mode === "CONSULT" ? "ATTENDED" : "BLIND",
|
|
1337
|
-
transfer_to: (
|
|
1338
|
-
callreferenceid: (
|
|
1339
|
-
processid: String((
|
|
1340
|
-
process_name: (
|
|
1333
|
+
transfer_to: (_v2 = (_u2 = data == null ? void 0 : data.user_id) == null ? void 0 : _u2.toString()) != null ? _v2 : "",
|
|
1334
|
+
callreferenceid: (_x2 = (_w2 = state.callData) == null ? void 0 : _w2.call_id) != null ? _x2 : "",
|
|
1335
|
+
processid: String((_z = (_y2 = state.callData) == null ? void 0 : _y2.process_id) != null ? _z : ""),
|
|
1336
|
+
process_name: (_B = (_A = state.callData) == null ? void 0 : _A.process_name) != null ? _B : ""
|
|
1341
1337
|
};
|
|
1342
1338
|
if (mode === "CONSULT") {
|
|
1343
1339
|
initiateConsultCall(END_POINT.TRANSFER_CALL, payload);
|
|
@@ -1346,13 +1342,13 @@ function CallTransferDialog({ open }) {
|
|
|
1346
1342
|
}
|
|
1347
1343
|
} else if (type === "OTHER") {
|
|
1348
1344
|
const payload = {
|
|
1349
|
-
action: mode === "CONSULT" ? "ATTENDED" : "BLIND_TRANSFER",
|
|
1345
|
+
// action: mode === "CONSULT" ? "ATTENDED" : "BLIND_TRANSFER",
|
|
1350
1346
|
transfer_type: mode === "CONSULT" ? "ATTENDED" : "BLIND",
|
|
1351
1347
|
type: "OTHER",
|
|
1352
|
-
transfer_to: (
|
|
1353
|
-
userid:
|
|
1354
|
-
callreferenceid: (
|
|
1355
|
-
blind_transfer_no:
|
|
1348
|
+
transfer_to: (_C = data == null ? void 0 : data.mobile_number) != null ? _C : "",
|
|
1349
|
+
userid: state.agentId,
|
|
1350
|
+
callreferenceid: (_E = (_D = state.callData) == null ? void 0 : _D.call_id) != null ? _E : ""
|
|
1351
|
+
// blind_transfer_no: data?.mobile_number ?? "",
|
|
1356
1352
|
};
|
|
1357
1353
|
if (mode === "CONSULT") {
|
|
1358
1354
|
initiateConsultCall(END_POINT.TRANSFER_CALL, payload);
|
|
@@ -1369,7 +1365,7 @@ function CallTransferDialog({ open }) {
|
|
|
1369
1365
|
setTransferMenuAnchor(e.currentTarget);
|
|
1370
1366
|
}
|
|
1371
1367
|
};
|
|
1372
|
-
|
|
1368
|
+
useEffect3(() => {
|
|
1373
1369
|
getIdelAgentsList(END_POINT.AGENTS_LIST, { status: "IDLE", active: true });
|
|
1374
1370
|
getProcessAndQueuesList(END_POINT.TRANSFER_TO_DETAILS, { status: "ACTIVE", active: true });
|
|
1375
1371
|
getHospitalsServicesList(END_POINT.HOSPITALS_SERVICES);
|
|
@@ -1565,9 +1561,9 @@ function CallTransferDialog({ open }) {
|
|
|
1565
1561
|
display: "flex",
|
|
1566
1562
|
alignItems: "center",
|
|
1567
1563
|
justifyContent: "center",
|
|
1568
|
-
flexDirection: "column"
|
|
1564
|
+
flexDirection: "column",
|
|
1565
|
+
p: 2
|
|
1569
1566
|
},
|
|
1570
|
-
p: 2,
|
|
1571
1567
|
children: [
|
|
1572
1568
|
/* @__PURE__ */ jsx(Upcoming, { color: "primary" }),
|
|
1573
1569
|
/* @__PURE__ */ jsx(
|
|
@@ -1680,9 +1676,9 @@ function CallTransferDialog({ open }) {
|
|
|
1680
1676
|
display: "flex",
|
|
1681
1677
|
alignItems: "center",
|
|
1682
1678
|
justifyContent: "center",
|
|
1683
|
-
flexDirection: "column"
|
|
1679
|
+
flexDirection: "column",
|
|
1680
|
+
p: 2
|
|
1684
1681
|
},
|
|
1685
|
-
p: 2,
|
|
1686
1682
|
children: [
|
|
1687
1683
|
/* @__PURE__ */ jsx(Upcoming, { color: "primary" }),
|
|
1688
1684
|
/* @__PURE__ */ jsx(
|
|
@@ -1774,9 +1770,9 @@ function CallTransferDialog({ open }) {
|
|
|
1774
1770
|
display: "flex",
|
|
1775
1771
|
alignItems: "center",
|
|
1776
1772
|
justifyContent: "center",
|
|
1777
|
-
flexDirection: "column"
|
|
1773
|
+
flexDirection: "column",
|
|
1774
|
+
p: 2
|
|
1778
1775
|
},
|
|
1779
|
-
p: 2,
|
|
1780
1776
|
children: [
|
|
1781
1777
|
/* @__PURE__ */ jsx(Upcoming, { color: "primary" }),
|
|
1782
1778
|
/* @__PURE__ */ jsx(
|
|
@@ -2012,7 +2008,7 @@ function CallTransferDialog({ open }) {
|
|
|
2012
2008
|
function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
2013
2009
|
var _a, _b, _c, _d, _e;
|
|
2014
2010
|
const [getDispositions, data] = useGetRequest();
|
|
2015
|
-
const [formData, setFormData] =
|
|
2011
|
+
const [formData, setFormData] = useState7({
|
|
2016
2012
|
disposition: { label: "", value: "", id: 0 },
|
|
2017
2013
|
followUp: { label: "No", value: "N" },
|
|
2018
2014
|
callbackDate: "",
|
|
@@ -2043,7 +2039,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2043
2039
|
handleReset();
|
|
2044
2040
|
setOpen(false);
|
|
2045
2041
|
};
|
|
2046
|
-
|
|
2042
|
+
useEffect3(() => {
|
|
2047
2043
|
getDispositions(END_POINT.DISPOSITIONS);
|
|
2048
2044
|
}, []);
|
|
2049
2045
|
const dispositionsOptions = useMemo(() => {
|
|
@@ -2060,10 +2056,11 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2060
2056
|
open,
|
|
2061
2057
|
"aria-labelledby": "alert-dialog-title",
|
|
2062
2058
|
"aria-describedby": "alert-dialog-description",
|
|
2063
|
-
maxWidth: "
|
|
2059
|
+
maxWidth: "sm",
|
|
2060
|
+
fullWidth: true,
|
|
2064
2061
|
slotProps: { paper: { sx: { minWidth: 600 } } },
|
|
2065
2062
|
sx: {
|
|
2066
|
-
minWidth: "
|
|
2063
|
+
minWidth: "650px"
|
|
2067
2064
|
},
|
|
2068
2065
|
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
2069
2066
|
/* @__PURE__ */ jsx(
|
|
@@ -2080,7 +2077,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2080
2077
|
Typography,
|
|
2081
2078
|
{
|
|
2082
2079
|
variant: "body1",
|
|
2083
|
-
m: 1,
|
|
2080
|
+
sx: { m: 1 },
|
|
2084
2081
|
children: [
|
|
2085
2082
|
" ",
|
|
2086
2083
|
"Call Disposition"
|
|
@@ -2102,8 +2099,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2102
2099
|
/* @__PURE__ */ jsxs(
|
|
2103
2100
|
Box,
|
|
2104
2101
|
{
|
|
2105
|
-
display: "flex",
|
|
2106
|
-
gap: 2,
|
|
2102
|
+
sx: { display: "flex", gap: 2 },
|
|
2107
2103
|
children: [
|
|
2108
2104
|
/* @__PURE__ */ jsx(
|
|
2109
2105
|
Autocomplete,
|
|
@@ -2147,9 +2143,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2147
2143
|
/* @__PURE__ */ jsxs(
|
|
2148
2144
|
Box,
|
|
2149
2145
|
{
|
|
2150
|
-
display: "flex",
|
|
2151
|
-
gap: 2,
|
|
2152
|
-
mt: 2,
|
|
2146
|
+
sx: { display: "flex", gap: 2, mt: 2 },
|
|
2153
2147
|
children: [
|
|
2154
2148
|
/* @__PURE__ */ jsxs(
|
|
2155
2149
|
Box,
|
|
@@ -2218,9 +2212,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2218
2212
|
((_e = (_d = formData == null ? void 0 : formData.followUp) == null ? void 0 : _d.label) == null ? void 0 : _e.toLowerCase()) === "yes" && /* @__PURE__ */ jsxs(
|
|
2219
2213
|
Box,
|
|
2220
2214
|
{
|
|
2221
|
-
display: "flex",
|
|
2222
|
-
gap: 2,
|
|
2223
|
-
mt: 2,
|
|
2215
|
+
sx: { display: "flex", gap: 2, mt: 2 },
|
|
2224
2216
|
children: [
|
|
2225
2217
|
/* @__PURE__ */ jsx(
|
|
2226
2218
|
Autocomplete,
|
|
@@ -2259,7 +2251,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2259
2251
|
]
|
|
2260
2252
|
}
|
|
2261
2253
|
),
|
|
2262
|
-
/* @__PURE__ */ jsx(Box, { mt: 2, children: /* @__PURE__ */ jsx(
|
|
2254
|
+
/* @__PURE__ */ jsx(Box, { sx: { mt: 2 }, children: /* @__PURE__ */ jsx(
|
|
2263
2255
|
TextField,
|
|
2264
2256
|
{
|
|
2265
2257
|
size: "small",
|
|
@@ -2278,8 +2270,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2278
2270
|
/* @__PURE__ */ jsxs(
|
|
2279
2271
|
Box,
|
|
2280
2272
|
{
|
|
2281
|
-
textAlign: "right",
|
|
2282
|
-
m: 2,
|
|
2273
|
+
sx: { textAlign: "right", m: 2 },
|
|
2283
2274
|
children: [
|
|
2284
2275
|
/* @__PURE__ */ jsx(
|
|
2285
2276
|
Button,
|
|
@@ -2330,7 +2321,7 @@ function ProcessorListDialog({
|
|
|
2330
2321
|
open,
|
|
2331
2322
|
"aria-labelledby": "alert-dialog-title",
|
|
2332
2323
|
"aria-describedby": "alert-dialog-description",
|
|
2333
|
-
maxWidth:
|
|
2324
|
+
maxWidth: false,
|
|
2334
2325
|
slotProps: { paper: { sx: { minWidth: 500 } } },
|
|
2335
2326
|
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
2336
2327
|
/* @__PURE__ */ jsxs(
|
|
@@ -2439,9 +2430,9 @@ function CallHistoryDialog({ open, setOpen }) {
|
|
|
2439
2430
|
borderRadius: "10px",
|
|
2440
2431
|
textAlign: "center",
|
|
2441
2432
|
fontSize: "16px",
|
|
2442
|
-
fontWeight: "bold"
|
|
2433
|
+
fontWeight: "bold",
|
|
2434
|
+
p: 6
|
|
2443
2435
|
},
|
|
2444
|
-
p: 6,
|
|
2445
2436
|
children: "Coming Soon..."
|
|
2446
2437
|
}
|
|
2447
2438
|
)
|
|
@@ -2451,10 +2442,10 @@ function CallHistoryDialog({ open, setOpen }) {
|
|
|
2451
2442
|
}
|
|
2452
2443
|
|
|
2453
2444
|
// call-control-sdk/lib/hooks/useDraggable.ts
|
|
2454
|
-
import { useCallback as useCallback6, useRef, useState as
|
|
2445
|
+
import { useCallback as useCallback6, useRef, useState as useState8 } from "react";
|
|
2455
2446
|
function useDraggable(initialPosition, onPositionChange) {
|
|
2456
|
-
const [position, setPosition] =
|
|
2457
|
-
const [isDragging, setIsDragging] =
|
|
2447
|
+
const [position, setPosition] = useState8(initialPosition);
|
|
2448
|
+
const [isDragging, setIsDragging] = useState8(false);
|
|
2458
2449
|
const dragRef = useRef();
|
|
2459
2450
|
const dragStart = useRef({ x: 0, y: 0 });
|
|
2460
2451
|
const elementStart = useRef({ x: 0, y: 0 });
|
|
@@ -2705,7 +2696,7 @@ var formatDuration = (seconds) => {
|
|
|
2705
2696
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2706
2697
|
};
|
|
2707
2698
|
function CallControls({ onDataChange }) {
|
|
2708
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb;
|
|
2699
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb;
|
|
2709
2700
|
const theme = useTheme3();
|
|
2710
2701
|
const state = useSDKState();
|
|
2711
2702
|
const { showToast } = useToast();
|
|
@@ -2728,22 +2719,22 @@ function CallControls({ onDataChange }) {
|
|
|
2728
2719
|
const maxReconnectAttempts = 60;
|
|
2729
2720
|
const baseReconnectDelay = 2e3;
|
|
2730
2721
|
const maxReconnectDelay = 3e4;
|
|
2731
|
-
const [anchorEl, setAnchorEl] =
|
|
2732
|
-
const [statusAnchorEl, setStatusAnchorEl] =
|
|
2733
|
-
const [dialerAnchorEl, setDialerAnchorEl] =
|
|
2734
|
-
const [ambulanceAnchorEl, setAmbulanceAnchorEl] =
|
|
2735
|
-
const [moreOptionsAnchorEl, setMoreOptionsAnchorEl] =
|
|
2736
|
-
const [showIframe, setShowIframe] =
|
|
2737
|
-
const [openCallDisposition, setOpenCallDisposition] =
|
|
2738
|
-
const [openProcessorDialog, setOpenProcessorDialog] =
|
|
2739
|
-
const [openCallHistoryDialog, setOpenCallHistoryDialog] =
|
|
2740
|
-
const [processList, setProcessList] =
|
|
2741
|
-
const [breaksList, setBreaksList] =
|
|
2742
|
-
const [phoneNumber, setPhoneNumber] =
|
|
2743
|
-
const [callDuration, setCallDuration] =
|
|
2744
|
-
const [callWrapuptime, setCallWrapuptime] =
|
|
2745
|
-
const [holdDuration, setHoldDuration] =
|
|
2746
|
-
const [muteDuration, setMuteDuration] =
|
|
2722
|
+
const [anchorEl, setAnchorEl] = useState9(null);
|
|
2723
|
+
const [statusAnchorEl, setStatusAnchorEl] = useState9(null);
|
|
2724
|
+
const [dialerAnchorEl, setDialerAnchorEl] = useState9(null);
|
|
2725
|
+
const [ambulanceAnchorEl, setAmbulanceAnchorEl] = useState9(null);
|
|
2726
|
+
const [moreOptionsAnchorEl, setMoreOptionsAnchorEl] = useState9(null);
|
|
2727
|
+
const [showIframe, setShowIframe] = useState9(true);
|
|
2728
|
+
const [openCallDisposition, setOpenCallDisposition] = useState9(false);
|
|
2729
|
+
const [openProcessorDialog, setOpenProcessorDialog] = useState9(false);
|
|
2730
|
+
const [openCallHistoryDialog, setOpenCallHistoryDialog] = useState9(false);
|
|
2731
|
+
const [processList, setProcessList] = useState9(null);
|
|
2732
|
+
const [breaksList, setBreaksList] = useState9(null);
|
|
2733
|
+
const [phoneNumber, setPhoneNumber] = useState9("");
|
|
2734
|
+
const [callDuration, setCallDuration] = useState9(0);
|
|
2735
|
+
const [callWrapuptime, setCallWrapuptime] = useState9(null);
|
|
2736
|
+
const [holdDuration, setHoldDuration] = useState9(0);
|
|
2737
|
+
const [muteDuration, setMuteDuration] = useState9(0);
|
|
2747
2738
|
const { position, isDragging, dragRef, handleMouseDown, handleTouchStart } = useDraggable(
|
|
2748
2739
|
state.controlPanelPosition,
|
|
2749
2740
|
(newPosition) => sdkStateManager.setControlPanelPosition(newPosition)
|
|
@@ -2809,14 +2800,15 @@ function CallControls({ onDataChange }) {
|
|
|
2809
2800
|
setStatusAnchorEl(null);
|
|
2810
2801
|
};
|
|
2811
2802
|
const handleAgentReady = () => {
|
|
2803
|
+
var _a2;
|
|
2812
2804
|
const payload = {
|
|
2813
2805
|
action: "READYAGENT",
|
|
2814
|
-
userId: state.agentId
|
|
2806
|
+
userId: String((_a2 = state.agentId) != null ? _a2 : "")
|
|
2815
2807
|
};
|
|
2816
2808
|
readyAgentStatus(END_POINT.READY_AGENT, payload);
|
|
2817
2809
|
};
|
|
2818
2810
|
const handleUpdateAgentStatus = (status) => {
|
|
2819
|
-
var _a2, _b2;
|
|
2811
|
+
var _a2, _b2, _c2;
|
|
2820
2812
|
setStatusAnchorEl(null);
|
|
2821
2813
|
const currentStatus = (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase();
|
|
2822
2814
|
if (["ONCALL" /* ONCALL */, "RINGING" /* RINGING */, "DIALING" /* DIALING */, "WRAPUP" /* WRAPUP */].includes(currentStatus)) {
|
|
@@ -2826,50 +2818,75 @@ function CallControls({ onDataChange }) {
|
|
|
2826
2818
|
const payload = {
|
|
2827
2819
|
action: "AGENTBREAK",
|
|
2828
2820
|
break_type: status,
|
|
2829
|
-
userId: state.agentId
|
|
2821
|
+
userId: String((_c2 = state.agentId) != null ? _c2 : "")
|
|
2830
2822
|
};
|
|
2831
2823
|
updateAgentStatus(END_POINT.UPDATE_AGENT_BREAK, payload).then(() => {
|
|
2832
2824
|
sdkStateManager.setAgentStatus(status);
|
|
2833
2825
|
});
|
|
2834
2826
|
};
|
|
2835
2827
|
const handleStartCall = (number) => {
|
|
2828
|
+
var _a2, _b2, _c2, _d2;
|
|
2836
2829
|
if (number.length !== 10) {
|
|
2837
2830
|
showToast("Invalid phone number", "error");
|
|
2838
2831
|
} else if (!/^\d+$/.test(number)) {
|
|
2839
2832
|
showToast("Invalid phone number", "error");
|
|
2840
2833
|
} else {
|
|
2834
|
+
const currentStatus = ((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) != null ? _b2 : "").toUpperCase();
|
|
2835
|
+
const isWrapupCall = currentStatus === "WRAPUP" /* WRAPUP */;
|
|
2836
|
+
let parentCallUuid = "";
|
|
2837
|
+
if (!((_c2 = state.sdkConfig) == null ? void 0 : _c2.disableAlternateDialing)) {
|
|
2838
|
+
if (isWrapupCall) {
|
|
2839
|
+
if (state.rootCallUuid) {
|
|
2840
|
+
parentCallUuid = state.rootCallUuid;
|
|
2841
|
+
} else if ((_d2 = state.callData) == null ? void 0 : _d2.call_id) {
|
|
2842
|
+
parentCallUuid = state.callData.call_id;
|
|
2843
|
+
sdkStateManager.setRootCallUuid(parentCallUuid);
|
|
2844
|
+
}
|
|
2845
|
+
} else if (state.rootCallUuid) {
|
|
2846
|
+
sdkStateManager.setRootCallUuid(null);
|
|
2847
|
+
}
|
|
2848
|
+
} else if (state.rootCallUuid) {
|
|
2849
|
+
sdkStateManager.setRootCallUuid(null);
|
|
2850
|
+
}
|
|
2841
2851
|
const payload = {
|
|
2842
2852
|
phone_number: number,
|
|
2843
2853
|
user: state.agentId,
|
|
2844
2854
|
auto_answer: false,
|
|
2845
|
-
|
|
2855
|
+
call_id: "",
|
|
2846
2856
|
reference_id: "",
|
|
2847
2857
|
call_source: "",
|
|
2848
|
-
caseId: ""
|
|
2858
|
+
caseId: "",
|
|
2859
|
+
isWrapup: isWrapupCall,
|
|
2860
|
+
parentCallUuid
|
|
2849
2861
|
};
|
|
2850
2862
|
clickToCall2(END_POINT.CLICK_TO_CALL, payload);
|
|
2851
2863
|
}
|
|
2852
2864
|
};
|
|
2853
2865
|
const handleHoldToggle = () => {
|
|
2854
|
-
var _a2;
|
|
2866
|
+
var _a2, _b2, _c2, _d2;
|
|
2855
2867
|
const payload = {
|
|
2856
2868
|
action: ((_a2 = state.callData) == null ? void 0 : _a2.hold) === 1 ? "UNHOLD" /* UNHOLD */ : "HOLD" /* HOLD */,
|
|
2857
|
-
|
|
2869
|
+
user_id: String((_b2 = state.agentId) != null ? _b2 : ""),
|
|
2870
|
+
call_uuid: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.call_id) != null ? _d2 : "",
|
|
2871
|
+
line_number: 0
|
|
2858
2872
|
};
|
|
2859
2873
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
2860
2874
|
};
|
|
2861
2875
|
const handleMuteToggle = () => {
|
|
2862
|
-
var _a2;
|
|
2876
|
+
var _a2, _b2, _c2, _d2;
|
|
2863
2877
|
const payload = {
|
|
2864
2878
|
action: ((_a2 = state.callData) == null ? void 0 : _a2.mute) === 1 ? "UNMUTE" /* UNMUTE */ : "MUTE" /* MUTE */,
|
|
2865
|
-
|
|
2879
|
+
direction: "both",
|
|
2880
|
+
user_id: String((_b2 = state.agentId) != null ? _b2 : ""),
|
|
2881
|
+
call_uuid: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.call_id) != null ? _d2 : "",
|
|
2882
|
+
line_number: 0
|
|
2866
2883
|
};
|
|
2867
2884
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
2868
2885
|
};
|
|
2869
2886
|
const handleEndCall = (data) => {
|
|
2870
2887
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2;
|
|
2871
2888
|
const payload = {
|
|
2872
|
-
|
|
2889
|
+
call_id: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.call_id) != null ? _b2 : "",
|
|
2873
2890
|
agent_id: (_c2 = state.agentId) != null ? _c2 : "",
|
|
2874
2891
|
set_followUp: (_e2 = (_d2 = data == null ? void 0 : data.followUp) == null ? void 0 : _d2.value) != null ? _e2 : "",
|
|
2875
2892
|
callback_date: (_f2 = data == null ? void 0 : data.callbackDate) != null ? _f2 : "",
|
|
@@ -2877,19 +2894,16 @@ function CallControls({ onDataChange }) {
|
|
|
2877
2894
|
callback_mins: Number(data == null ? void 0 : data.callbackMins) || 0,
|
|
2878
2895
|
mobile_number: (_h2 = (_g2 = state.callData) == null ? void 0 : _g2.phone_number) != null ? _h2 : "",
|
|
2879
2896
|
list_comments: (_i2 = data == null ? void 0 : data.notes) != null ? _i2 : "",
|
|
2880
|
-
call_reference_id: (_k2 = (_j2 = state.callData) == null ? void 0 : _j2.
|
|
2881
|
-
|
|
2897
|
+
call_reference_id: (_k2 = (_j2 = state.callData) == null ? void 0 : _j2.call_id) != null ? _k2 : "",
|
|
2898
|
+
is_mark_as_break: (_l2 = data == null ? void 0 : data.selected_break) != null ? _l2 : false,
|
|
2899
|
+
disposition: (_n2 = (_m2 = data == null ? void 0 : data.disposition) == null ? void 0 : _m2.value) != null ? _n2 : "",
|
|
2882
2900
|
line_number: 0,
|
|
2883
2901
|
reason: "normal"
|
|
2884
2902
|
};
|
|
2885
2903
|
setPhoneNumber("");
|
|
2886
|
-
endCall2(END_POINT.END_CALL, payload
|
|
2887
|
-
params: {
|
|
2888
|
-
isBreak: (_n2 = data == null ? void 0 : data.selected_break) != null ? _n2 : false
|
|
2889
|
-
}
|
|
2890
|
-
});
|
|
2904
|
+
endCall2(END_POINT.END_CALL, payload);
|
|
2891
2905
|
};
|
|
2892
|
-
|
|
2906
|
+
useEffect4(() => {
|
|
2893
2907
|
const handleBeforeUnload = (e) => {
|
|
2894
2908
|
e.preventDefault();
|
|
2895
2909
|
};
|
|
@@ -2898,14 +2912,14 @@ function CallControls({ onDataChange }) {
|
|
|
2898
2912
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
2899
2913
|
};
|
|
2900
2914
|
}, []);
|
|
2901
|
-
|
|
2915
|
+
useEffect4(() => {
|
|
2902
2916
|
const mic = createMicController();
|
|
2903
2917
|
micRef.current = mic;
|
|
2904
2918
|
mic.start().catch((err) => {
|
|
2905
2919
|
console.error("Failed to start mic:", err);
|
|
2906
2920
|
});
|
|
2907
2921
|
const handleKeyDown = (event) => {
|
|
2908
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
2922
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2;
|
|
2909
2923
|
const fullState = getSession3(STORAGE_KEY);
|
|
2910
2924
|
const key = (_a2 = event.key) == null ? void 0 : _a2.toLowerCase();
|
|
2911
2925
|
if (!event.altKey || ((_b2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _b2.status) !== "ONCALL" /* ONCALL */) {
|
|
@@ -2916,32 +2930,42 @@ function CallControls({ onDataChange }) {
|
|
|
2916
2930
|
(_d2 = micRef.current) == null ? void 0 : _d2.mute();
|
|
2917
2931
|
const payload = {
|
|
2918
2932
|
action: "MUTE" /* MUTE */,
|
|
2919
|
-
|
|
2933
|
+
direction: "both",
|
|
2934
|
+
user_id: String((_e2 = fullState.agentId) != null ? _e2 : ""),
|
|
2935
|
+
call_uuid: (_g2 = (_f2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _f2.call_id) != null ? _g2 : "",
|
|
2936
|
+
line_number: 0
|
|
2920
2937
|
};
|
|
2921
2938
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
2922
2939
|
}
|
|
2923
|
-
if (key === "u" && String((
|
|
2940
|
+
if (key === "u" && String((_h2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _h2.mute) === "1") {
|
|
2924
2941
|
event.preventDefault();
|
|
2925
2942
|
const payload = {
|
|
2926
2943
|
action: "UNMUTE" /* UNMUTE */,
|
|
2927
|
-
|
|
2944
|
+
direction: "both",
|
|
2945
|
+
user_id: String((_i2 = fullState.agentId) != null ? _i2 : ""),
|
|
2946
|
+
call_uuid: (_k2 = (_j2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _j2.call_id) != null ? _k2 : "",
|
|
2947
|
+
line_number: 0
|
|
2928
2948
|
};
|
|
2929
2949
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
2930
|
-
(
|
|
2950
|
+
(_l2 = micRef.current) == null ? void 0 : _l2.unmute();
|
|
2931
2951
|
}
|
|
2932
|
-
if (key === "h" && String((
|
|
2952
|
+
if (key === "h" && String((_m2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _m2.hold) === "0") {
|
|
2933
2953
|
event.preventDefault();
|
|
2934
2954
|
const payload = {
|
|
2935
2955
|
action: "HOLD" /* HOLD */,
|
|
2936
|
-
|
|
2956
|
+
user_id: String((_n2 = fullState.agentId) != null ? _n2 : ""),
|
|
2957
|
+
call_uuid: (_p2 = (_o2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _o2.call_id) != null ? _p2 : "",
|
|
2958
|
+
line_number: 0
|
|
2937
2959
|
};
|
|
2938
2960
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
2939
2961
|
}
|
|
2940
|
-
if (key === "r" && String((
|
|
2962
|
+
if (key === "r" && String((_q2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _q2.hold) === "1") {
|
|
2941
2963
|
event.preventDefault();
|
|
2942
2964
|
const payload = {
|
|
2943
2965
|
action: "UNHOLD" /* UNHOLD */,
|
|
2944
|
-
|
|
2966
|
+
user_id: String((_r2 = fullState.agentId) != null ? _r2 : ""),
|
|
2967
|
+
call_uuid: (_t2 = (_s2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _s2.call_id) != null ? _t2 : "",
|
|
2968
|
+
line_number: 0
|
|
2945
2969
|
};
|
|
2946
2970
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
2947
2971
|
}
|
|
@@ -2951,7 +2975,7 @@ function CallControls({ onDataChange }) {
|
|
|
2951
2975
|
window.removeEventListener("keydown", handleKeyDown);
|
|
2952
2976
|
};
|
|
2953
2977
|
}, []);
|
|
2954
|
-
|
|
2978
|
+
useEffect4(() => {
|
|
2955
2979
|
let interval;
|
|
2956
2980
|
let wrapUpinterval;
|
|
2957
2981
|
if (state.callData.status && state.callData.status === "ONCALL" /* ONCALL */) {
|
|
@@ -2986,7 +3010,7 @@ function CallControls({ onDataChange }) {
|
|
|
2986
3010
|
if (wrapUpinterval) clearInterval(wrapUpinterval);
|
|
2987
3011
|
};
|
|
2988
3012
|
}, [state.callData.status]);
|
|
2989
|
-
|
|
3013
|
+
useEffect4(() => {
|
|
2990
3014
|
var _a2, _b2, _c2;
|
|
2991
3015
|
let holdInterval;
|
|
2992
3016
|
const isOnCall = ((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */;
|
|
@@ -3008,7 +3032,7 @@ function CallControls({ onDataChange }) {
|
|
|
3008
3032
|
if (holdInterval) clearInterval(holdInterval);
|
|
3009
3033
|
};
|
|
3010
3034
|
}, [(_d = state.callData) == null ? void 0 : _d.hold, (_e = state.callData) == null ? void 0 : _e.status]);
|
|
3011
|
-
|
|
3035
|
+
useEffect4(() => {
|
|
3012
3036
|
var _a2, _b2, _c2, _d2;
|
|
3013
3037
|
let muteInterval;
|
|
3014
3038
|
const isOnCall = ((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */;
|
|
@@ -3031,7 +3055,7 @@ function CallControls({ onDataChange }) {
|
|
|
3031
3055
|
if (muteInterval) clearInterval(muteInterval);
|
|
3032
3056
|
};
|
|
3033
3057
|
}, [(_f = state.callData) == null ? void 0 : _f.mute, (_g = state.callData) == null ? void 0 : _g.status]);
|
|
3034
|
-
|
|
3058
|
+
useEffect4(() => {
|
|
3035
3059
|
createAudioElement().then((audio) => {
|
|
3036
3060
|
audioRef.current = audio;
|
|
3037
3061
|
}).catch((error) => {
|
|
@@ -3047,22 +3071,25 @@ function CallControls({ onDataChange }) {
|
|
|
3047
3071
|
cleanupAudioResources();
|
|
3048
3072
|
};
|
|
3049
3073
|
}, []);
|
|
3050
|
-
|
|
3074
|
+
useEffect4(() => {
|
|
3075
|
+
var _a2, _b2;
|
|
3051
3076
|
if (onDataChange && state.callData) {
|
|
3052
|
-
const { process_id, process_name, status, phone_number, agent_id,
|
|
3077
|
+
const { process_id, process_name, status, phone_number, agent_id, call_id, call_details } = state.callData;
|
|
3053
3078
|
const callData = {
|
|
3054
3079
|
phone_number,
|
|
3055
3080
|
status,
|
|
3056
|
-
callReferenceId:
|
|
3081
|
+
callReferenceId: call_id,
|
|
3057
3082
|
agent_id,
|
|
3058
3083
|
process_id,
|
|
3059
3084
|
process_name,
|
|
3060
|
-
call_details
|
|
3085
|
+
call_details,
|
|
3086
|
+
auto_wrapup_time: (_b2 = (_a2 = state.backendCallControls) == null ? void 0 : _a2.auto_wrapup_time) != null ? _b2 : null,
|
|
3087
|
+
socket_info: state.callData
|
|
3061
3088
|
};
|
|
3062
3089
|
onDataChange(callData);
|
|
3063
3090
|
}
|
|
3064
3091
|
}, [state.callData, onDataChange]);
|
|
3065
|
-
|
|
3092
|
+
useEffect4(() => {
|
|
3066
3093
|
if (state.agentId) {
|
|
3067
3094
|
axios_default.get(END_POINT.BREAKS_LIST).then((res) => {
|
|
3068
3095
|
var _a2, _b2, _c2, _d2;
|
|
@@ -3106,7 +3133,7 @@ function CallControls({ onDataChange }) {
|
|
|
3106
3133
|
}, 3e4);
|
|
3107
3134
|
};
|
|
3108
3135
|
webSocketRef.current.onmessage = (event) => {
|
|
3109
|
-
var _a3, _b3, _c2, _d2, _e2, _f2;
|
|
3136
|
+
var _a3, _b3, _c2, _d2, _e2, _f2, _g2;
|
|
3110
3137
|
try {
|
|
3111
3138
|
const data = JSON.parse(event.data);
|
|
3112
3139
|
if (data.type === "pong") {
|
|
@@ -3120,17 +3147,18 @@ function CallControls({ onDataChange }) {
|
|
|
3120
3147
|
type: data == null ? void 0 : data.type,
|
|
3121
3148
|
event_time: data == null ? void 0 : data.event_time,
|
|
3122
3149
|
phone_number: data == null ? void 0 : data.phone_number,
|
|
3123
|
-
|
|
3150
|
+
call_id: data == null ? void 0 : data.call_id,
|
|
3124
3151
|
process_id: data == null ? void 0 : data.process_id,
|
|
3125
3152
|
process_name: data == null ? void 0 : data.process_name,
|
|
3126
3153
|
hold: data == null ? void 0 : data.hold,
|
|
3127
3154
|
mute: data == null ? void 0 : data.mute,
|
|
3128
3155
|
mode: data == null ? void 0 : data.mode,
|
|
3129
|
-
queue_name: data == null ? void 0 : data.queue_name
|
|
3156
|
+
queue_name: data == null ? void 0 : data.queue_name,
|
|
3157
|
+
auto_wrapup_time: (_a3 = data == null ? void 0 : data.auto_wrapup_time) != null ? _a3 : null
|
|
3130
3158
|
}, (data == null ? void 0 : data.call_details) !== void 0 && { call_details: data.call_details });
|
|
3131
3159
|
sdkStateManager.updateCallData(callData);
|
|
3132
3160
|
sdkStateManager.updateConferenceData([...confrence]);
|
|
3133
|
-
sdkStateManager.setConsultInfo((
|
|
3161
|
+
sdkStateManager.setConsultInfo((_b3 = data.consult_info) != null ? _b3 : null);
|
|
3134
3162
|
const conferenceStatus = data == null ? void 0 : data.conferencestatus;
|
|
3135
3163
|
if (conferenceStatus) {
|
|
3136
3164
|
const hasAnsweredSecondaryLine = Object.keys(conferenceStatus).some((key) => {
|
|
@@ -3160,7 +3188,7 @@ function CallControls({ onDataChange }) {
|
|
|
3160
3188
|
}
|
|
3161
3189
|
if (["RINGING" /* RINGING */, "DIALING" /* DIALING */].includes(data.status)) {
|
|
3162
3190
|
setShowIframe(true);
|
|
3163
|
-
setCallWrapuptime((
|
|
3191
|
+
setCallWrapuptime((_d2 = (_c2 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _c2.auto_wrapup_time) != null ? _d2 : null);
|
|
3164
3192
|
sdkStateManager.updateConferenceData([
|
|
3165
3193
|
{
|
|
3166
3194
|
line: 1,
|
|
@@ -3213,7 +3241,7 @@ function CallControls({ onDataChange }) {
|
|
|
3213
3241
|
isMergeCall: false
|
|
3214
3242
|
}
|
|
3215
3243
|
]);
|
|
3216
|
-
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current && ((
|
|
3244
|
+
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current && ((_e2 = state == null ? void 0 : state.sdkConfig) == null ? void 0 : _e2.enableRingtone)) {
|
|
3217
3245
|
audioRef.current.play().catch((error) => {
|
|
3218
3246
|
console.error("Failed to play ringtone:", error);
|
|
3219
3247
|
});
|
|
@@ -3237,8 +3265,8 @@ function CallControls({ onDataChange }) {
|
|
|
3237
3265
|
}
|
|
3238
3266
|
} else if (((data == null ? void 0 : data.mute) === 1 || (data == null ? void 0 : data.hold) === 1) && data.status === "ONCALL" /* ONCALL */) {
|
|
3239
3267
|
} else if (data.status === "BREAK" /* BREAK */) {
|
|
3240
|
-
const breakTime = (
|
|
3241
|
-
const eventTime = (
|
|
3268
|
+
const breakTime = (_f2 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _f2.break_time;
|
|
3269
|
+
const eventTime = (_g2 = data == null ? void 0 : data.event_time) != null ? _g2 : null;
|
|
3242
3270
|
if (eventTime !== lastEventTimeRef.current) {
|
|
3243
3271
|
hasFlashedRef.current = false;
|
|
3244
3272
|
lastEventTimeRef.current = eventTime;
|
|
@@ -3300,7 +3328,7 @@ function CallControls({ onDataChange }) {
|
|
|
3300
3328
|
}
|
|
3301
3329
|
}
|
|
3302
3330
|
};
|
|
3303
|
-
|
|
3331
|
+
useEffect4(() => {
|
|
3304
3332
|
if (state.agentId) {
|
|
3305
3333
|
connectWebSocket();
|
|
3306
3334
|
}
|
|
@@ -3406,22 +3434,20 @@ function CallControls({ onDataChange }) {
|
|
|
3406
3434
|
variant: "outlined",
|
|
3407
3435
|
startIcon: /* @__PURE__ */ jsx2(WifiCalling3, {}),
|
|
3408
3436
|
onClick: (e) => {
|
|
3409
|
-
var _a2, _b2, _c2;
|
|
3437
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
3410
3438
|
if (![
|
|
3411
3439
|
"BREAK" /* BREAK */,
|
|
3412
3440
|
"ONCALL" /* ONCALL */,
|
|
3413
|
-
"RINGING" /* RINGING
|
|
3414
|
-
|
|
3415
|
-
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disabledDialButton)) {
|
|
3441
|
+
"RINGING" /* RINGING */
|
|
3442
|
+
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disabledDialButton) && !(((_e2 = (_d2 = state.callData) == null ? void 0 : _d2.status) == null ? void 0 : _e2.toUpperCase()) === "WRAPUP" /* WRAPUP */ && ((_f2 = state.sdkConfig) == null ? void 0 : _f2.disableAlternateDialing))) {
|
|
3416
3443
|
handleOpenDialer(e);
|
|
3417
3444
|
}
|
|
3418
3445
|
},
|
|
3419
3446
|
disabled: [
|
|
3420
3447
|
"BREAK" /* BREAK */,
|
|
3421
3448
|
"ONCALL" /* ONCALL */,
|
|
3422
|
-
"RINGING" /* RINGING
|
|
3423
|
-
|
|
3424
|
-
].includes((_A = state.callData.status) == null ? void 0 : _A.toUpperCase()) || ((_B = state.sdkConfig) == null ? void 0 : _B.disabledDialButton),
|
|
3449
|
+
"RINGING" /* RINGING */
|
|
3450
|
+
].includes((_A = state.callData.status) == null ? void 0 : _A.toUpperCase()) || ((_B = state.sdkConfig) == null ? void 0 : _B.disabledDialButton) || ((_C = state.callData.status) == null ? void 0 : _C.toUpperCase()) === "WRAPUP" /* WRAPUP */ && !!((_D = state.sdkConfig) == null ? void 0 : _D.disableAlternateDialing),
|
|
3425
3451
|
sx: {
|
|
3426
3452
|
justifyContent: "flex-start",
|
|
3427
3453
|
width: "100%",
|
|
@@ -3429,15 +3455,13 @@ function CallControls({ onDataChange }) {
|
|
|
3429
3455
|
color: [
|
|
3430
3456
|
"BREAK" /* BREAK */,
|
|
3431
3457
|
"ONCALL" /* ONCALL */,
|
|
3432
|
-
"RINGING" /* RINGING
|
|
3433
|
-
|
|
3434
|
-
].includes((_C = state.callData.status) == null ? void 0 : _C.toUpperCase()) || ((_D = state.sdkConfig) == null ? void 0 : _D.disabledDialButton) ? "action.selected" : "success.main",
|
|
3458
|
+
"RINGING" /* RINGING */
|
|
3459
|
+
].includes((_E = state.callData.status) == null ? void 0 : _E.toUpperCase()) || ((_F = state.sdkConfig) == null ? void 0 : _F.disabledDialButton) || ((_G = state.callData.status) == null ? void 0 : _G.toUpperCase()) === "WRAPUP" /* WRAPUP */ && !!((_H = state.sdkConfig) == null ? void 0 : _H.disableAlternateDialing) ? "action.selected" : "success.main",
|
|
3435
3460
|
borderColor: [
|
|
3436
3461
|
"BREAK" /* BREAK */,
|
|
3437
3462
|
"ONCALL" /* ONCALL */,
|
|
3438
|
-
"RINGING" /* RINGING
|
|
3439
|
-
|
|
3440
|
-
].includes((_E = state.callData.status) == null ? void 0 : _E.toUpperCase()) || ((_F = state.sdkConfig) == null ? void 0 : _F.disabledDialButton) ? "action.selected" : "success.main"
|
|
3463
|
+
"RINGING" /* RINGING */
|
|
3464
|
+
].includes((_I = state.callData.status) == null ? void 0 : _I.toUpperCase()) || ((_J = state.sdkConfig) == null ? void 0 : _J.disabledDialButton) || ((_K = state.callData.status) == null ? void 0 : _K.toUpperCase()) === "WRAPUP" /* WRAPUP */ && !!((_L = state.sdkConfig) == null ? void 0 : _L.disableAlternateDialing) ? "action.selected" : "success.main"
|
|
3441
3465
|
},
|
|
3442
3466
|
children: "Dial"
|
|
3443
3467
|
}
|
|
@@ -3446,22 +3470,20 @@ function CallControls({ onDataChange }) {
|
|
|
3446
3470
|
{
|
|
3447
3471
|
size: "small",
|
|
3448
3472
|
onClick: (e) => {
|
|
3449
|
-
var _a2, _b2, _c2;
|
|
3473
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
3450
3474
|
if (![
|
|
3451
3475
|
"BREAK" /* BREAK */,
|
|
3452
3476
|
"ONCALL" /* ONCALL */,
|
|
3453
|
-
"RINGING" /* RINGING
|
|
3454
|
-
|
|
3455
|
-
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disabledDialButton)) {
|
|
3477
|
+
"RINGING" /* RINGING */
|
|
3478
|
+
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disabledDialButton) && !(((_e2 = (_d2 = state.callData) == null ? void 0 : _d2.status) == null ? void 0 : _e2.toUpperCase()) === "WRAPUP" /* WRAPUP */ && ((_f2 = state.sdkConfig) == null ? void 0 : _f2.disableAlternateDialing))) {
|
|
3456
3479
|
handleOpenDialer(e);
|
|
3457
3480
|
}
|
|
3458
3481
|
},
|
|
3459
3482
|
disabled: [
|
|
3460
3483
|
"BREAK" /* BREAK */,
|
|
3461
3484
|
"ONCALL" /* ONCALL */,
|
|
3462
|
-
"RINGING" /* RINGING
|
|
3463
|
-
|
|
3464
|
-
].includes((_G = state.callData.status) == null ? void 0 : _G.toUpperCase()) || ((_H = state.sdkConfig) == null ? void 0 : _H.disabledDialButton),
|
|
3485
|
+
"RINGING" /* RINGING */
|
|
3486
|
+
].includes((_M = state.callData.status) == null ? void 0 : _M.toUpperCase()) || ((_N = state.sdkConfig) == null ? void 0 : _N.disabledDialButton) || ((_O = state.callData.status) == null ? void 0 : _O.toUpperCase()) === "WRAPUP" /* WRAPUP */ && !!((_P = state.sdkConfig) == null ? void 0 : _P.disableAlternateDialing),
|
|
3465
3487
|
children: /* @__PURE__ */ jsx2(
|
|
3466
3488
|
WifiCalling3,
|
|
3467
3489
|
{
|
|
@@ -3469,9 +3491,8 @@ function CallControls({ onDataChange }) {
|
|
|
3469
3491
|
color: [
|
|
3470
3492
|
"BREAK" /* BREAK */,
|
|
3471
3493
|
"ONCALL" /* ONCALL */,
|
|
3472
|
-
"RINGING" /* RINGING
|
|
3473
|
-
|
|
3474
|
-
].includes((_I = state.callData.status) == null ? void 0 : _I.toUpperCase()) || ((_J = state.sdkConfig) == null ? void 0 : _J.disabledDialButton) ? "action.selected" : "success.main"
|
|
3494
|
+
"RINGING" /* RINGING */
|
|
3495
|
+
].includes((_Q = state.callData.status) == null ? void 0 : _Q.toUpperCase()) || ((_R = state.sdkConfig) == null ? void 0 : _R.disabledDialButton) || ((_S = state.callData.status) == null ? void 0 : _S.toUpperCase()) === "WRAPUP" /* WRAPUP */ && !!((_T = state.sdkConfig) == null ? void 0 : _T.disableAlternateDialing) ? "action.selected" : "success.main"
|
|
3475
3496
|
}
|
|
3476
3497
|
}
|
|
3477
3498
|
)
|
|
@@ -3590,7 +3611,7 @@ function CallControls({ onDataChange }) {
|
|
|
3590
3611
|
width: "60px",
|
|
3591
3612
|
textAlign: "center"
|
|
3592
3613
|
},
|
|
3593
|
-
children: (
|
|
3614
|
+
children: (_W = (_V = (_U = state.callData) == null ? void 0 : _U.status) == null ? void 0 : _V.toUpperCase()) != null ? _W : "N/A"
|
|
3594
3615
|
}
|
|
3595
3616
|
),
|
|
3596
3617
|
onClick: handleOpenAgentStatus,
|
|
@@ -3617,7 +3638,7 @@ function CallControls({ onDataChange }) {
|
|
|
3617
3638
|
Button2,
|
|
3618
3639
|
{
|
|
3619
3640
|
variant: ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
3620
|
-
(
|
|
3641
|
+
(_Y = (_X = state.callData) == null ? void 0 : _X.status) == null ? void 0 : _Y.toUpperCase()
|
|
3621
3642
|
) ? "outlined" : "contained",
|
|
3622
3643
|
startIcon: isVertical ? /* @__PURE__ */ jsx2(SupportAgent2, {}) : void 0,
|
|
3623
3644
|
onClick: (e) => {
|
|
@@ -3631,21 +3652,21 @@ function CallControls({ onDataChange }) {
|
|
|
3631
3652
|
},
|
|
3632
3653
|
classes: {
|
|
3633
3654
|
root: ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
3634
|
-
(
|
|
3655
|
+
(__ = (_Z = state.callData) == null ? void 0 : _Z.status) == null ? void 0 : __.toUpperCase()
|
|
3635
3656
|
) ? "outlined" : "enabled"
|
|
3636
3657
|
},
|
|
3637
3658
|
sx: __spreadValues(__spreadValues({}, ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
3638
|
-
(
|
|
3659
|
+
(_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()
|
|
3639
3660
|
) ? outlined : enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3640
3661
|
disabled: agentReadyLoading,
|
|
3641
3662
|
children: isVertical ? "Agent Ready" : /* @__PURE__ */ jsx2(SupportAgent2, {})
|
|
3642
3663
|
}
|
|
3643
3664
|
) }),
|
|
3644
|
-
/* @__PURE__ */ jsx2(Tooltip2, { title: ((
|
|
3665
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_ba = state.sdkConfig) == null ? void 0 : _ba.disableHoldButton) ? "Hold feature is disabled" : ((_ca = state.callData) == null ? void 0 : _ca.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
3645
3666
|
Button2,
|
|
3646
3667
|
{
|
|
3647
|
-
variant: ((
|
|
3648
|
-
startIcon: isVertical ? holdOrUnHoldLoading ? void 0 : ((
|
|
3668
|
+
variant: ((_da = state.callData) == null ? void 0 : _da.hold) === 1 && ((_fa = (_ea = state.callData) == null ? void 0 : _ea.status) == null ? void 0 : _fa.toUpperCase()) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
3669
|
+
startIcon: isVertical ? holdOrUnHoldLoading ? void 0 : ((_ga = state.callData) == null ? void 0 : _ga.hold) === 1 ? /* @__PURE__ */ jsx2(PlayArrow2, {}) : /* @__PURE__ */ jsx2(Pause2, {}) : void 0,
|
|
3649
3670
|
onClick: (e) => {
|
|
3650
3671
|
var _a2;
|
|
3651
3672
|
e.stopPropagation();
|
|
@@ -3653,22 +3674,22 @@ function CallControls({ onDataChange }) {
|
|
|
3653
3674
|
handleHoldToggle();
|
|
3654
3675
|
}
|
|
3655
3676
|
},
|
|
3656
|
-
sx: ((
|
|
3657
|
-
disabled: ((
|
|
3677
|
+
sx: ((_ha = state.callData) == null ? void 0 : _ha.hold) === 1 && ((_ja = (_ia = state.callData) == null ? void 0 : _ia.status) == null ? void 0 : _ja.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_la = (_ka = state.callData) == null ? void 0 : _ka.status) == null ? void 0 : _la.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_ma = state.sdkConfig) == null ? void 0 : _ma.disableHoldButton) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3678
|
+
disabled: ((_oa = (_na = state.callData) == null ? void 0 : _na.status) == null ? void 0 : _oa.toUpperCase()) !== "ONCALL" /* ONCALL */ && ((_pa = state.callData) == null ? void 0 : _pa.hold) !== 1 || holdOrUnHoldLoading || ((_qa = state.sdkConfig) == null ? void 0 : _qa.disableHoldButton),
|
|
3658
3679
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ jsx2(
|
|
3659
3680
|
CircularProgress2,
|
|
3660
3681
|
{
|
|
3661
3682
|
size: "20px",
|
|
3662
3683
|
sx: { color: theme.palette.primary.main }
|
|
3663
3684
|
}
|
|
3664
|
-
) : isVertical ? ((
|
|
3685
|
+
) : isVertical ? ((_ra = state.callData) == null ? void 0 : _ra.hold) === 1 ? "Resume" : "Hold" : ((_sa = state.callData) == null ? void 0 : _sa.hold) === 1 ? /* @__PURE__ */ jsx2(PlayArrow2, {}) : /* @__PURE__ */ jsx2(Pause2, {})
|
|
3665
3686
|
}
|
|
3666
3687
|
) }) }),
|
|
3667
|
-
/* @__PURE__ */ jsx2(Tooltip2, { title: ((
|
|
3688
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_ta = state.sdkConfig) == null ? void 0 : _ta.disableMuteButton) ? "Mute feature is disabled" : ((_ua = state.callData) == null ? void 0 : _ua.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
3668
3689
|
Button2,
|
|
3669
3690
|
{
|
|
3670
|
-
variant: ((
|
|
3671
|
-
startIcon: isVertical ? muteOrUnMuteLoading ? void 0 : ((
|
|
3691
|
+
variant: ((_va = state.callData) == null ? void 0 : _va.mute) === 1 && ((_xa = (_wa = state.callData) == null ? void 0 : _wa.status) == null ? void 0 : _xa.toUpperCase()) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
3692
|
+
startIcon: isVertical ? muteOrUnMuteLoading ? void 0 : ((_ya = state.callData) == null ? void 0 : _ya.mute) === 1 ? /* @__PURE__ */ jsx2(MicOff, {}) : /* @__PURE__ */ jsx2(Mic, {}) : void 0,
|
|
3672
3693
|
onClick: (e) => {
|
|
3673
3694
|
var _a2;
|
|
3674
3695
|
e.stopPropagation();
|
|
@@ -3676,18 +3697,18 @@ function CallControls({ onDataChange }) {
|
|
|
3676
3697
|
handleMuteToggle();
|
|
3677
3698
|
}
|
|
3678
3699
|
},
|
|
3679
|
-
sx: ((
|
|
3680
|
-
disabled: ((
|
|
3700
|
+
sx: ((_za = state.sdkConfig) == null ? void 0 : _za.disableMuteButton) || ((_Aa = state.callData) == null ? void 0 : _Aa.hold) === 1 ? __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_Ba = state.callData) == null ? void 0 : _Ba.mute) === 1 && ((_Da = (_Ca = state.callData) == null ? void 0 : _Ca.status) == null ? void 0 : _Da.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_Fa = (_Ea = state.callData) == null ? void 0 : _Ea.status) == null ? void 0 : _Fa.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3701
|
+
disabled: ((_Ha = (_Ga = state.callData) == null ? void 0 : _Ga.status) == null ? void 0 : _Ha.toUpperCase()) !== "ONCALL" /* ONCALL */ && ((_Ia = state.callData) == null ? void 0 : _Ia.mute) !== 1 || muteOrUnMuteLoading || ((_Ja = state.callData) == null ? void 0 : _Ja.hold) === 1 || ((_Ka = state.sdkConfig) == null ? void 0 : _Ka.disableMuteButton),
|
|
3681
3702
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ jsx2(
|
|
3682
3703
|
CircularProgress2,
|
|
3683
3704
|
{
|
|
3684
3705
|
size: "20px",
|
|
3685
3706
|
sx: { color: theme.palette.primary.main }
|
|
3686
3707
|
}
|
|
3687
|
-
) : isVertical ? ((
|
|
3708
|
+
) : isVertical ? ((_La = state.callData) == null ? void 0 : _La.mute) === 1 ? "Unmute" : "Mute" : ((_Ma = state.callData) == null ? void 0 : _Ma.mute) === 1 ? /* @__PURE__ */ jsx2(MicOff, {}) : /* @__PURE__ */ jsx2(Mic, {})
|
|
3688
3709
|
}
|
|
3689
3710
|
) }) }),
|
|
3690
|
-
/* @__PURE__ */ jsx2(Tooltip2, { title: ((
|
|
3711
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_Na = state.sdkConfig) == null ? void 0 : _Na.disableCallTransferButton) ? "Transfer Call feature is disabled" : "Transfer Call", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
3691
3712
|
Button2,
|
|
3692
3713
|
{
|
|
3693
3714
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
@@ -3699,12 +3720,12 @@ function CallControls({ onDataChange }) {
|
|
|
3699
3720
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3700
3721
|
}
|
|
3701
3722
|
},
|
|
3702
|
-
sx: state.openCallTransferDialog ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((
|
|
3703
|
-
disabled: ((
|
|
3723
|
+
sx: state.openCallTransferDialog ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_Pa = (_Oa = state.callData) == null ? void 0 : _Oa.status) == null ? void 0 : _Pa.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_Qa = state.sdkConfig) == null ? void 0 : _Qa.disableCallTransferButton) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3724
|
+
disabled: ((_Sa = (_Ra = state.callData) == null ? void 0 : _Ra.status) == null ? void 0 : _Sa.toUpperCase()) !== "ONCALL" /* ONCALL */ || ((_Ta = state.sdkConfig) == null ? void 0 : _Ta.disableCallTransferButton),
|
|
3704
3725
|
children: isVertical ? "Transfer" : /* @__PURE__ */ jsx2(TransferWithinAStation2, {})
|
|
3705
3726
|
}
|
|
3706
3727
|
) }) }),
|
|
3707
|
-
/* @__PURE__ */ jsx2(Tooltip2, { title: ((
|
|
3728
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_Ua = state.sdkConfig) == null ? void 0 : _Ua.disableConferenceButton) ? "Conference Call feature is disabled" : "Conference Call", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
3708
3729
|
Button2,
|
|
3709
3730
|
{
|
|
3710
3731
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
@@ -3716,12 +3737,12 @@ function CallControls({ onDataChange }) {
|
|
|
3716
3737
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3717
3738
|
}
|
|
3718
3739
|
},
|
|
3719
|
-
sx: state.openConferenceDialog ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((
|
|
3720
|
-
disabled: ((
|
|
3740
|
+
sx: state.openConferenceDialog ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_Wa = (_Va = state.callData) == null ? void 0 : _Va.status) == null ? void 0 : _Wa.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_Xa = state.sdkConfig) == null ? void 0 : _Xa.disableConferenceButton) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3741
|
+
disabled: ((_Za = (_Ya = state.callData) == null ? void 0 : _Ya.status) == null ? void 0 : _Za.toUpperCase()) !== "ONCALL" /* ONCALL */ || ((__a = state.sdkConfig) == null ? void 0 : __a.disableConferenceButton),
|
|
3721
3742
|
children: isVertical ? "Conference" : /* @__PURE__ */ jsx2(Group, {})
|
|
3722
3743
|
}
|
|
3723
3744
|
) }) }),
|
|
3724
|
-
((
|
|
3745
|
+
((_$a = state.sdkConfig) == null ? void 0 : _$a.enableSmsServices) && /* @__PURE__ */ jsx2(Tooltip2, { title: "Send SMS", children: /* @__PURE__ */ jsx2(
|
|
3725
3746
|
Button2,
|
|
3726
3747
|
{
|
|
3727
3748
|
variant: Boolean(ambulanceAnchorEl) ? "contained" : "outlined",
|
|
@@ -3736,15 +3757,15 @@ function CallControls({ onDataChange }) {
|
|
|
3736
3757
|
}
|
|
3737
3758
|
},
|
|
3738
3759
|
sx: Boolean(ambulanceAnchorEl) ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ["ONCALL" /* ONCALL */, "WRAPUP" /* WRAPUP */].includes(
|
|
3739
|
-
(
|
|
3760
|
+
(_bb = (_ab = state.callData) == null ? void 0 : _ab.status) == null ? void 0 : _bb.toUpperCase()
|
|
3740
3761
|
) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3741
3762
|
disabled: !["ONCALL" /* ONCALL */, "WRAPUP" /* WRAPUP */].includes(
|
|
3742
|
-
(
|
|
3763
|
+
(_db = (_cb = state.callData) == null ? void 0 : _cb.status) == null ? void 0 : _db.toUpperCase()
|
|
3743
3764
|
),
|
|
3744
3765
|
children: isVertical ? "Send SMS" : /* @__PURE__ */ jsx2(SmsSharp, {})
|
|
3745
3766
|
}
|
|
3746
3767
|
) }),
|
|
3747
|
-
/* @__PURE__ */ jsx2(Tooltip2, { title: ((
|
|
3768
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_eb = state.sdkConfig) == null ? void 0 : _eb.disableEndCallButton) ? "End Call feature is disabled" : "End Call", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
3748
3769
|
Button2,
|
|
3749
3770
|
{
|
|
3750
3771
|
variant: [
|
|
@@ -3752,7 +3773,7 @@ function CallControls({ onDataChange }) {
|
|
|
3752
3773
|
"RINGING" /* RINGING */,
|
|
3753
3774
|
"DIALING" /* DIALING */,
|
|
3754
3775
|
"WRAPUP" /* WRAPUP */
|
|
3755
|
-
].includes((
|
|
3776
|
+
].includes((_gb = (_fb = state.callData) == null ? void 0 : _fb.status) == null ? void 0 : _gb.toUpperCase()) && !((_hb = state.sdkConfig) == null ? void 0 : _hb.disableEndCallButton) ? "contained" : "outlined",
|
|
3756
3777
|
startIcon: isVertical && !endCallLoading ? /* @__PURE__ */ jsx2(CallEnd2, {}) : void 0,
|
|
3757
3778
|
onClick: (e) => {
|
|
3758
3779
|
var _a2, _b2, _c2;
|
|
@@ -3771,7 +3792,7 @@ function CallControls({ onDataChange }) {
|
|
|
3771
3792
|
"RINGING" /* RINGING */,
|
|
3772
3793
|
"DIALING" /* DIALING */,
|
|
3773
3794
|
"WRAPUP" /* WRAPUP */
|
|
3774
|
-
].includes((
|
|
3795
|
+
].includes((_jb = (_ib = state.callData) == null ? void 0 : _ib.status) == null ? void 0 : _jb.toUpperCase()) && !((_kb = state.sdkConfig) == null ? void 0 : _kb.disableEndCallButton) ? __spreadValues(__spreadProps(__spreadValues({}, enabled), {
|
|
3775
3796
|
borderRight: "1px",
|
|
3776
3797
|
backgroundColor: "error.main",
|
|
3777
3798
|
minWidth: "60px !important",
|
|
@@ -3795,11 +3816,11 @@ function CallControls({ onDataChange }) {
|
|
|
3795
3816
|
"RINGING" /* RINGING */,
|
|
3796
3817
|
"DIALING" /* DIALING */,
|
|
3797
3818
|
"WRAPUP" /* WRAPUP */
|
|
3798
|
-
].includes((
|
|
3819
|
+
].includes((_mb = (_lb = state.callData) == null ? void 0 : _lb.status) == null ? void 0 : _mb.toUpperCase()) || endCallLoading || ((_nb = state.sdkConfig) == null ? void 0 : _nb.disableEndCallButton),
|
|
3799
3820
|
children: endCallLoading ? /* @__PURE__ */ jsx2(CircularProgress2, { size: "20px", color: "error" }) : isVertical ? "End Call" : /* @__PURE__ */ jsx2(CallEnd2, {})
|
|
3800
3821
|
}
|
|
3801
3822
|
) }) }),
|
|
3802
|
-
!((
|
|
3823
|
+
!((_ob = state.sdkConfig) == null ? void 0 : _ob.disabledMoreOptionsButton) && processList && (processList == null ? void 0 : processList.length) > 1 && /* @__PURE__ */ jsx2(Tooltip2, { title: "Switch Process", children: /* @__PURE__ */ jsx2(
|
|
3803
3824
|
Button2,
|
|
3804
3825
|
{
|
|
3805
3826
|
variant: Boolean(moreOptionsAnchorEl) ? "contained" : "outlined",
|
|
@@ -3815,7 +3836,7 @@ function CallControls({ onDataChange }) {
|
|
|
3815
3836
|
},
|
|
3816
3837
|
sx: Boolean(moreOptionsAnchorEl) ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3817
3838
|
disabled: !["BREAK" /* BREAK */, "IDLE" /* IDLE */].includes(
|
|
3818
|
-
(
|
|
3839
|
+
(_qb = (_pb = state.callData) == null ? void 0 : _pb.status) == null ? void 0 : _qb.toUpperCase()
|
|
3819
3840
|
),
|
|
3820
3841
|
children: isVertical ? "Switch Process" : /* @__PURE__ */ jsx2(MoreVert, {})
|
|
3821
3842
|
}
|
|
@@ -3848,7 +3869,7 @@ function CallControls({ onDataChange }) {
|
|
|
3848
3869
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3849
3870
|
duration: theme.transitions.duration.short
|
|
3850
3871
|
}),
|
|
3851
|
-
visibility: showIframe && !((
|
|
3872
|
+
visibility: showIframe && !((_rb = state.sdkConfig) == null ? void 0 : _rb.disableSoftPhone) ? "visible" : "hidden",
|
|
3852
3873
|
userSelect: "none"
|
|
3853
3874
|
},
|
|
3854
3875
|
children: [
|
|
@@ -3875,7 +3896,7 @@ function CallControls({ onDataChange }) {
|
|
|
3875
3896
|
}
|
|
3876
3897
|
),
|
|
3877
3898
|
" ",
|
|
3878
|
-
/* @__PURE__ */ jsx2(Typography2, { variant: "subtitle1", fontWeight: 600, textAlign: "center", children: "ahs-cti" }),
|
|
3899
|
+
/* @__PURE__ */ jsx2(Typography2, { variant: "subtitle1", fontWeight: 600, sx: { textAlign: "center" }, children: "ahs-cti" }),
|
|
3879
3900
|
/* @__PURE__ */ jsx2(IconButton2, { onClick: () => setShowIframe(false), children: /* @__PURE__ */ jsx2(Close2, {}) })
|
|
3880
3901
|
]
|
|
3881
3902
|
}
|
|
@@ -3883,7 +3904,7 @@ function CallControls({ onDataChange }) {
|
|
|
3883
3904
|
/* @__PURE__ */ jsx2(Box2, { children: /* @__PURE__ */ jsx2(
|
|
3884
3905
|
"iframe",
|
|
3885
3906
|
{
|
|
3886
|
-
src: `${(
|
|
3907
|
+
src: `${(_sb = state.urlConfig) == null ? void 0 : _sb.iframeURL}/static/phone/index.html?user_id=${(_tb = state.urlConfig) == null ? void 0 : _tb.id}&api_url=${(_ub = state.urlConfig) == null ? void 0 : _ub.iframeAPIURL}&token=${(_vb = state.authorization) == null ? void 0 : _vb.accessToken}`,
|
|
3887
3908
|
height: 380,
|
|
3888
3909
|
width: 420,
|
|
3889
3910
|
allow: "camera; microphone; autoplay",
|
|
@@ -4225,159 +4246,36 @@ CallControlPanel.displayName = "CallControlPanel";
|
|
|
4225
4246
|
|
|
4226
4247
|
// call-control-sdk/lib/pages/sdkPages.tsx
|
|
4227
4248
|
import React3 from "react";
|
|
4228
|
-
|
|
4229
|
-
// call-control-sdk/lib/hooks/useSDKPermissions.ts
|
|
4230
|
-
import { useState as useState11, useEffect as useEffect6, useCallback as useCallback8 } from "react";
|
|
4231
|
-
function useSDKPermissions() {
|
|
4232
|
-
var _a, _b;
|
|
4233
|
-
const [state, setState] = useState11(() => sdkStateManager.getState());
|
|
4234
|
-
useEffect6(() => {
|
|
4235
|
-
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
4236
|
-
setState(sdkStateManager.getState());
|
|
4237
|
-
});
|
|
4238
|
-
return unsubscribe;
|
|
4239
|
-
}, []);
|
|
4240
|
-
const hasPermission = useCallback8(
|
|
4241
|
-
(permission) => sdkStateManager.hasPermission(permission),
|
|
4242
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4243
|
-
[state.userPermissions]
|
|
4244
|
-
);
|
|
4245
|
-
const hasAnyPermission = useCallback8(
|
|
4246
|
-
(permissions) => sdkStateManager.hasAnyPermission(permissions),
|
|
4247
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4248
|
-
[state.userPermissions]
|
|
4249
|
-
);
|
|
4250
|
-
const hasAllPermissions = useCallback8(
|
|
4251
|
-
(permissions) => sdkStateManager.hasAllPermissions(permissions),
|
|
4252
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4253
|
-
[state.userPermissions]
|
|
4254
|
-
);
|
|
4255
|
-
const hasMenuFeature = useCallback8(
|
|
4256
|
-
(code) => sdkStateManager.hasMenuFeature(code),
|
|
4257
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4258
|
-
[state.menuEntitlements]
|
|
4259
|
-
);
|
|
4260
|
-
return {
|
|
4261
|
-
permissions: (_a = state.userPermissions) != null ? _a : [],
|
|
4262
|
-
menuEntitlements: (_b = state.menuEntitlements) != null ? _b : [],
|
|
4263
|
-
isLoaded: state.isPermissionsLoaded,
|
|
4264
|
-
hasPermission,
|
|
4265
|
-
hasAnyPermission,
|
|
4266
|
-
hasAllPermissions,
|
|
4267
|
-
hasMenuFeature
|
|
4268
|
-
};
|
|
4269
|
-
}
|
|
4270
|
-
|
|
4271
|
-
// call-control-sdk/lib/components/SDKAccessDenied.tsx
|
|
4272
|
-
import { Box as Box3, Typography as Typography3 } from "@mui/material";
|
|
4273
|
-
import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
|
|
4274
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4275
|
-
var SDKAccessDenied = ({
|
|
4276
|
-
message = "You don't have permission to view this page."
|
|
4277
|
-
}) => /* @__PURE__ */ jsxs3(
|
|
4278
|
-
Box3,
|
|
4279
|
-
{
|
|
4280
|
-
display: "flex",
|
|
4281
|
-
flexDirection: "column",
|
|
4282
|
-
alignItems: "center",
|
|
4283
|
-
justifyContent: "center",
|
|
4284
|
-
minHeight: 300,
|
|
4285
|
-
gap: 2,
|
|
4286
|
-
p: 4,
|
|
4287
|
-
children: [
|
|
4288
|
-
/* @__PURE__ */ jsx4(LockOutlinedIcon, { sx: { fontSize: 56, color: "text.disabled" } }),
|
|
4289
|
-
/* @__PURE__ */ jsx4(Typography3, { variant: "h6", fontWeight: 600, color: "text.secondary", children: "Access Denied" }),
|
|
4290
|
-
/* @__PURE__ */ jsx4(Typography3, { variant: "body2", color: "text.disabled", textAlign: "center", children: message })
|
|
4291
|
-
]
|
|
4292
|
-
}
|
|
4293
|
-
);
|
|
4294
|
-
|
|
4295
|
-
// call-control-sdk/lib/components/SDKPermissionGuard.tsx
|
|
4296
|
-
import { Fragment as Fragment3, jsx as jsx5 } from "react/jsx-runtime";
|
|
4297
|
-
var SDKPermissionGuard = ({
|
|
4298
|
-
children,
|
|
4299
|
-
permission,
|
|
4300
|
-
permissions,
|
|
4301
|
-
requireAll = false,
|
|
4302
|
-
menuFeature,
|
|
4303
|
-
requireAllMenus = false,
|
|
4304
|
-
fallback,
|
|
4305
|
-
showFallback = true,
|
|
4306
|
-
onDenied
|
|
4307
|
-
}) => {
|
|
4308
|
-
const { isLoaded, hasPermission, hasAnyPermission, hasAllPermissions, hasMenuFeature } = useSDKPermissions();
|
|
4309
|
-
if (!isLoaded) return null;
|
|
4310
|
-
const isAllowed = checkAccess({
|
|
4311
|
-
permission,
|
|
4312
|
-
permissions,
|
|
4313
|
-
requireAll,
|
|
4314
|
-
menuFeature,
|
|
4315
|
-
requireAllMenus,
|
|
4316
|
-
hasPermission,
|
|
4317
|
-
hasAnyPermission,
|
|
4318
|
-
hasAllPermissions,
|
|
4319
|
-
hasMenuFeature
|
|
4320
|
-
});
|
|
4321
|
-
if (!isAllowed) {
|
|
4322
|
-
onDenied == null ? void 0 : onDenied();
|
|
4323
|
-
if (fallback !== void 0) return /* @__PURE__ */ jsx5(Fragment3, { children: fallback });
|
|
4324
|
-
if (showFallback) return /* @__PURE__ */ jsx5(SDKAccessDenied, {});
|
|
4325
|
-
return null;
|
|
4326
|
-
}
|
|
4327
|
-
return /* @__PURE__ */ jsx5(Fragment3, { children });
|
|
4328
|
-
};
|
|
4329
|
-
function checkAccess({
|
|
4330
|
-
permission,
|
|
4331
|
-
permissions,
|
|
4332
|
-
requireAll,
|
|
4333
|
-
menuFeature,
|
|
4334
|
-
requireAllMenus,
|
|
4335
|
-
hasPermission,
|
|
4336
|
-
hasAnyPermission,
|
|
4337
|
-
hasAllPermissions,
|
|
4338
|
-
hasMenuFeature
|
|
4339
|
-
}) {
|
|
4340
|
-
const menuCodes = menuFeature ? Array.isArray(menuFeature) ? menuFeature : [menuFeature] : [];
|
|
4341
|
-
const hasNoGuards = !permission && (!permissions || permissions.length === 0) && menuCodes.length === 0;
|
|
4342
|
-
if (hasNoGuards) return true;
|
|
4343
|
-
if (menuCodes.length > 0) {
|
|
4344
|
-
const menuGranted = requireAllMenus ? menuCodes.every((c) => hasMenuFeature(c)) : menuCodes.some((c) => hasMenuFeature(c));
|
|
4345
|
-
if (!menuGranted) return false;
|
|
4346
|
-
}
|
|
4347
|
-
if (permission && !hasPermission(permission)) return false;
|
|
4348
|
-
if (permissions && permissions.length > 0) {
|
|
4349
|
-
const granted = requireAll ? hasAllPermissions(permissions) : hasAnyPermission(permissions);
|
|
4350
|
-
if (!granted) return false;
|
|
4351
|
-
}
|
|
4352
|
-
return true;
|
|
4353
|
-
}
|
|
4354
|
-
|
|
4355
|
-
// call-control-sdk/lib/pages/sdkPages.tsx
|
|
4356
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
4249
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
4357
4250
|
function withGuard(menuCodes, loader) {
|
|
4358
4251
|
return React3.lazy(async () => {
|
|
4359
4252
|
const mod = await loader();
|
|
4360
4253
|
const Page = mod.default;
|
|
4361
|
-
const Guarded = (props) => /* @__PURE__ */
|
|
4254
|
+
const Guarded = (props) => /* @__PURE__ */ jsx4(SDKPermissionGuard, { menuFeature: menuCodes, children: /* @__PURE__ */ jsx4(Page, __spreadValues({}, props)) });
|
|
4362
4255
|
return { default: Guarded };
|
|
4363
4256
|
});
|
|
4364
4257
|
}
|
|
4365
4258
|
var SDKPages = {
|
|
4366
|
-
CallHistory: withGuard(SDK_MENU_CODES.CALL_HISTORY, () => import("./callHistory-
|
|
4259
|
+
CallHistory: withGuard(SDK_MENU_CODES.CALL_HISTORY, () => import("./callHistory-3CMW24B6.mjs")),
|
|
4260
|
+
Campaigns: withGuard(SDK_MENU_CODES.CAMPAIGNS, () => import("./campaigns-FR7EIRXI.mjs")),
|
|
4261
|
+
LoginReport: withGuard(SDK_MENU_CODES.LOGIN_REPORT, () => import("./loginReport-MHNHB5F6.mjs")),
|
|
4262
|
+
CdrReports: withGuard(SDK_MENU_CODES.CDR_REPORT, () => import("./cdrReport-6OBRKAYS.mjs")),
|
|
4263
|
+
AgentPerformanceReport: withGuard(SDK_MENU_CODES.AGENT_PERFORMANCE_REPORT, () => import("./agentPerformanceReport-4WNLHIFT.mjs")),
|
|
4264
|
+
AgentDetailReport: withGuard(SDK_MENU_CODES.AGENT_DETAIL_REPORT, () => import("./agentDetailReport-XUNWPSQW.mjs"))
|
|
4367
4265
|
};
|
|
4368
4266
|
|
|
4369
4267
|
// call-control-sdk/lib/hooks/useClickToConference.ts
|
|
4370
|
-
import { useCallback as
|
|
4268
|
+
import { useCallback as useCallback8, useEffect as useEffect5, useRef as useRef3, useState as useState10 } from "react";
|
|
4371
4269
|
import { getSession as getSession4 } from "@react-solutions/vault";
|
|
4372
4270
|
var useClickToConference = () => {
|
|
4373
|
-
const [loading, setLoading] =
|
|
4374
|
-
const [success, setSuccess] =
|
|
4375
|
-
const [isError, setIsError] =
|
|
4376
|
-
const [error, setError] =
|
|
4377
|
-
const [data, setData] =
|
|
4271
|
+
const [loading, setLoading] = useState10(false);
|
|
4272
|
+
const [success, setSuccess] = useState10(false);
|
|
4273
|
+
const [isError, setIsError] = useState10(false);
|
|
4274
|
+
const [error, setError] = useState10(null);
|
|
4275
|
+
const [data, setData] = useState10(null);
|
|
4378
4276
|
const pendingLineRef = useRef3(null);
|
|
4379
4277
|
const prevConferenceRef = useRef3([]);
|
|
4380
|
-
|
|
4278
|
+
useEffect5(() => {
|
|
4381
4279
|
if (pendingLineRef.current === null) return;
|
|
4382
4280
|
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
4383
4281
|
var _a;
|
|
@@ -4395,9 +4293,9 @@ var useClickToConference = () => {
|
|
|
4395
4293
|
});
|
|
4396
4294
|
return unsubscribe;
|
|
4397
4295
|
}, [loading]);
|
|
4398
|
-
const handleStartConferenceCall =
|
|
4296
|
+
const handleStartConferenceCall = useCallback8(
|
|
4399
4297
|
async (payload) => {
|
|
4400
|
-
var _a, _b, _c, _d, _e, _f
|
|
4298
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4401
4299
|
const state = getSession4(STORAGE_KEY);
|
|
4402
4300
|
if (((_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.status) !== "ONCALL") {
|
|
4403
4301
|
const msg = "Conference call requires an active call (ONCALL status)";
|
|
@@ -4419,8 +4317,8 @@ var useClickToConference = () => {
|
|
|
4419
4317
|
operation: `CALL${availableLine.line}`,
|
|
4420
4318
|
target: payload.mobileNumber,
|
|
4421
4319
|
line_number: Number(availableLine.line),
|
|
4422
|
-
userid:
|
|
4423
|
-
process: (
|
|
4320
|
+
userid: state.agentId,
|
|
4321
|
+
process: (_f = (_e = state.callData) == null ? void 0 : _e.process_name) != null ? _f : ""
|
|
4424
4322
|
};
|
|
4425
4323
|
setLoading(true);
|
|
4426
4324
|
setIsError(false);
|
|
@@ -4454,21 +4352,20 @@ var useClickToConference = () => {
|
|
|
4454
4352
|
};
|
|
4455
4353
|
|
|
4456
4354
|
// call-control-sdk/lib/angular-services/index.ts
|
|
4457
|
-
import {
|
|
4355
|
+
import { removeSession as removeSession2 } from "@react-solutions/vault";
|
|
4458
4356
|
function clickToCall(payload) {
|
|
4459
4357
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4460
|
-
const state =
|
|
4461
|
-
if (((_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.status) !== "IDLE" && ((_b = state == null ? void 0 : state.callData) == null ? void 0 : _b.status) !== "ONCALL") {
|
|
4462
|
-
return Promise.reject(new Error("Agent is not ready"));
|
|
4463
|
-
}
|
|
4358
|
+
const state = sdkStateManager.getState();
|
|
4464
4359
|
const body = {
|
|
4465
4360
|
phone_number: payload.mobileNumber,
|
|
4466
|
-
user: (
|
|
4467
|
-
auto_answer: (
|
|
4468
|
-
|
|
4469
|
-
reference_id: (
|
|
4470
|
-
call_source: (
|
|
4471
|
-
caseId: (
|
|
4361
|
+
user: (_b = (_a = payload.user) != null ? _a : state == null ? void 0 : state.agentId) != null ? _b : "",
|
|
4362
|
+
auto_answer: (_c = payload.auto_answer) != null ? _c : false,
|
|
4363
|
+
call_id: (_f = (_e = payload.call_id) != null ? _e : (_d = state == null ? void 0 : state.callData) == null ? void 0 : _d.call_id) != null ? _f : "",
|
|
4364
|
+
reference_id: (_g = payload.reference_id) != null ? _g : "",
|
|
4365
|
+
call_source: (_h = payload.call_source) != null ? _h : "",
|
|
4366
|
+
caseId: (_i = payload.caseId) != null ? _i : "",
|
|
4367
|
+
isWrapup: (_j = payload.isWrapup) != null ? _j : false,
|
|
4368
|
+
parentCallUuid: (_k = payload.parentCallUuid) != null ? _k : ""
|
|
4472
4369
|
};
|
|
4473
4370
|
return axios_default.post(END_POINT.CLICK_TO_CALL, body).then((res) => {
|
|
4474
4371
|
try {
|
|
@@ -4482,12 +4379,9 @@ function clickToCall(payload) {
|
|
|
4482
4379
|
});
|
|
4483
4380
|
}
|
|
4484
4381
|
function clickToConference(payload) {
|
|
4485
|
-
var _a, _b, _c, _d, _e
|
|
4486
|
-
const state =
|
|
4487
|
-
|
|
4488
|
-
return Promise.reject(new Error("Conference call requires an active call (ONCALL status)"));
|
|
4489
|
-
}
|
|
4490
|
-
const availableLine = payload.lineNumber != null ? (_b = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _b.find((l) => l.line === payload.lineNumber) : (_d = (_c = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _c.filter((l) => l.line !== 1)) == null ? void 0 : _d.find((l) => l.status === "IDLE" && !(l == null ? void 0 : l.isCallStart));
|
|
4382
|
+
var _a, _b, _c, _d, _e;
|
|
4383
|
+
const state = sdkStateManager.getState();
|
|
4384
|
+
const availableLine = payload.lineNumber != null ? (_a = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a.find((l) => l.line === payload.lineNumber) : (_c = (_b = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _b.filter((l) => l.line !== 1)) == null ? void 0 : _c.find((l) => l.status === "IDLE" && !(l == null ? void 0 : l.isCallStart));
|
|
4491
4385
|
if (!availableLine) {
|
|
4492
4386
|
return Promise.reject(new Error("No available conference line found"));
|
|
4493
4387
|
}
|
|
@@ -4496,8 +4390,8 @@ function clickToConference(payload) {
|
|
|
4496
4390
|
operation: `CALL${availableLine.line}`,
|
|
4497
4391
|
target: payload.mobileNumber,
|
|
4498
4392
|
line_number: Number(availableLine.line),
|
|
4499
|
-
userid:
|
|
4500
|
-
process: (
|
|
4393
|
+
userid: state.agentId,
|
|
4394
|
+
process: (_e = (_d = state.callData) == null ? void 0 : _d.process_name) != null ? _e : ""
|
|
4501
4395
|
};
|
|
4502
4396
|
return axios_default.post(END_POINT.CONFERENCE_CALL, body).then((res) => {
|
|
4503
4397
|
try {
|
|
@@ -4511,25 +4405,24 @@ function clickToConference(payload) {
|
|
|
4511
4405
|
});
|
|
4512
4406
|
}
|
|
4513
4407
|
async function endCall(options = {}) {
|
|
4514
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4515
|
-
const state =
|
|
4408
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
4409
|
+
const state = sdkStateManager.getState();
|
|
4516
4410
|
const body = {
|
|
4517
|
-
|
|
4518
|
-
agent_id: (
|
|
4519
|
-
set_followUp: (
|
|
4520
|
-
callback_date: (
|
|
4521
|
-
callback_hrs:
|
|
4522
|
-
callback_mins:
|
|
4523
|
-
mobile_number: (
|
|
4524
|
-
list_comments: "",
|
|
4525
|
-
call_reference_id: (
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4411
|
+
call_id: (_c = (_b = options.call_id) != null ? _b : (_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.call_id) != null ? _c : "",
|
|
4412
|
+
agent_id: (_e = (_d = options.agent_id) != null ? _d : state == null ? void 0 : state.agentId) != null ? _e : "",
|
|
4413
|
+
set_followUp: (_f = options.set_followUp) != null ? _f : "N",
|
|
4414
|
+
callback_date: (_g = options.callback_date) != null ? _g : "",
|
|
4415
|
+
callback_hrs: (_h = options.callback_hrs) != null ? _h : 0,
|
|
4416
|
+
callback_mins: (_i = options.callback_mins) != null ? _i : 0,
|
|
4417
|
+
mobile_number: (_l = (_k = options.mobile_number) != null ? _k : (_j = state == null ? void 0 : state.callData) == null ? void 0 : _j.phone_number) != null ? _l : "",
|
|
4418
|
+
list_comments: (_m = options.list_comments) != null ? _m : "",
|
|
4419
|
+
call_reference_id: (_p = (_o = options.call_reference_id) != null ? _o : (_n = state == null ? void 0 : state.callData) == null ? void 0 : _n.call_id) != null ? _p : "",
|
|
4420
|
+
is_mark_as_break: (_q = options.is_mark_as_break) != null ? _q : false,
|
|
4421
|
+
disposition: (_r = options.disposition) != null ? _r : "RES",
|
|
4422
|
+
line_number: (_s = options.line_number) != null ? _s : 0,
|
|
4423
|
+
reason: (_t = options.reason) != null ? _t : "normal"
|
|
4529
4424
|
};
|
|
4530
|
-
const res = await axios_default.post(END_POINT.END_CALL, body
|
|
4531
|
-
params: { isBreak: (_k = options.isBreak) != null ? _k : false }
|
|
4532
|
-
});
|
|
4425
|
+
const res = await axios_default.post(END_POINT.END_CALL, body);
|
|
4533
4426
|
sdkStateManager.resetConferenceLines();
|
|
4534
4427
|
sdkStateManager.endCall();
|
|
4535
4428
|
return res.data;
|
|
@@ -4609,7 +4502,8 @@ async function initSDK({
|
|
|
4609
4502
|
agentId.trim(),
|
|
4610
4503
|
urlConfig,
|
|
4611
4504
|
res,
|
|
4612
|
-
callcontrolConfig
|
|
4505
|
+
callcontrolConfig,
|
|
4506
|
+
initResult.callControls
|
|
4613
4507
|
);
|
|
4614
4508
|
} catch (error) {
|
|
4615
4509
|
sdkStateManager.setInitCheck();
|