ahs-cti 0.0.2-beta.9 → 0.0.2

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.
Files changed (58) hide show
  1. package/README.md +425 -294
  2. package/dist/agentDetailReport-XSBMOUMW.mjs +12 -0
  3. package/dist/agentDetailReport-XSBMOUMW.mjs.map +1 -0
  4. package/dist/agentPerformanceReport-UT6QZWYD.mjs +533 -0
  5. package/dist/agentPerformanceReport-UT6QZWYD.mjs.map +1 -0
  6. package/dist/auditReport-R67BYA4Z.mjs +15 -0
  7. package/dist/auditReport-R67BYA4Z.mjs.map +1 -0
  8. package/dist/callHistory-PHGY224F.mjs +805 -0
  9. package/dist/callHistory-PHGY224F.mjs.map +1 -0
  10. package/dist/campaigns-JSMYHHDF.mjs +3049 -0
  11. package/dist/campaigns-JSMYHHDF.mjs.map +1 -0
  12. package/dist/caroQualityAuditDashboard-7X44HRZL.mjs +66 -0
  13. package/dist/caroQualityAuditDashboard-7X44HRZL.mjs.map +1 -0
  14. package/dist/caroVoiceAI-OZAB7LK4.mjs +21 -0
  15. package/dist/caroVoiceAI-OZAB7LK4.mjs.map +1 -0
  16. package/dist/cdrReport-44LN5VUX.mjs +819 -0
  17. package/dist/cdrReport-44LN5VUX.mjs.map +1 -0
  18. package/dist/chunk-6ICPXSN6.mjs +61 -0
  19. package/dist/chunk-6ICPXSN6.mjs.map +1 -0
  20. package/dist/chunk-CXULBAK6.mjs +493 -0
  21. package/dist/chunk-CXULBAK6.mjs.map +1 -0
  22. package/dist/chunk-FVXHNBYV.mjs +82 -0
  23. package/dist/chunk-FVXHNBYV.mjs.map +1 -0
  24. package/dist/chunk-G6KDIN5W.mjs +749 -0
  25. package/dist/chunk-G6KDIN5W.mjs.map +1 -0
  26. package/dist/chunk-GGACEO3I.mjs +180 -0
  27. package/dist/chunk-GGACEO3I.mjs.map +1 -0
  28. package/dist/chunk-HBR2JS4C.mjs +95 -0
  29. package/dist/chunk-HBR2JS4C.mjs.map +1 -0
  30. package/dist/chunk-HRM6S6J2.mjs +61 -0
  31. package/dist/chunk-HRM6S6J2.mjs.map +1 -0
  32. package/dist/chunk-JOZ4YQMR.mjs +116 -0
  33. package/dist/chunk-JOZ4YQMR.mjs.map +1 -0
  34. package/dist/chunk-O2XGWZLT.mjs +1060 -0
  35. package/dist/chunk-O2XGWZLT.mjs.map +1 -0
  36. package/dist/chunk-RZZQ42MG.mjs +115 -0
  37. package/dist/chunk-RZZQ42MG.mjs.map +1 -0
  38. package/dist/chunk-UZF5Q3GR.mjs +678 -0
  39. package/dist/chunk-UZF5Q3GR.mjs.map +1 -0
  40. package/dist/chunk-VQCHBU2Q.mjs +27 -0
  41. package/dist/chunk-VQCHBU2Q.mjs.map +1 -0
  42. package/dist/chunk-WWWM33FY.mjs +57 -0
  43. package/dist/chunk-WWWM33FY.mjs.map +1 -0
  44. package/dist/index.d.mts +795 -112
  45. package/dist/index.d.ts +796 -112
  46. package/dist/index.js +13838 -2251
  47. package/dist/index.js.map +1 -1
  48. package/dist/index.mjs +2335 -2250
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/liveStatus-AHKS4XLW.mjs +1077 -0
  51. package/dist/liveStatus-AHKS4XLW.mjs.map +1 -0
  52. package/dist/loginReport-7GBMZP55.mjs +828 -0
  53. package/dist/loginReport-7GBMZP55.mjs.map +1 -0
  54. package/dist/managementDashboard-TYON77NW.mjs +529 -0
  55. package/dist/managementDashboard-TYON77NW.mjs.map +1 -0
  56. package/dist/qualityAuditDashboard-AGJH5VVN.mjs +66 -0
  57. package/dist/qualityAuditDashboard-AGJH5VVN.mjs.map +1 -0
  58. package/package.json +16 -6
@@ -0,0 +1,1060 @@
1
+ import {
2
+ __publicField,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "./chunk-VQCHBU2Q.mjs";
6
+
7
+ // call-control-sdk/lib/permissions/sdk-constants.ts
8
+ var SDK_WILDCARD = "*";
9
+ var SDK_MENU_CODES = {
10
+ WILDCARD: SDK_WILDCARD,
11
+ CALL_HISTORY: "call_history",
12
+ CAMPAIGNS: "dialer_auto",
13
+ LOGIN_REPORT: "login_report",
14
+ CDR_REPORT: "cdr_report",
15
+ AGENT_PERFORMANCE_REPORT: "agent_performance",
16
+ AGENT_DETAIL_REPORT: "agent_detail",
17
+ LIVE_STATUS: "live_status",
18
+ MANAGEMENT_DASHBOARD: "management_dashboard",
19
+ CARO_VOICE_AI: "caro_voice_ai",
20
+ QUALITY_AUDIT_DASHBOARD: "management_dashboard",
21
+ CARO_QUALITY_AUDIT_DASHBOARD: "management_dashboard"
22
+ };
23
+ var SDK_PERMISSIONS = {
24
+ WILDCARD: SDK_WILDCARD,
25
+ // main object key constants
26
+ CALLS: "calls",
27
+ CALL_TRANSFER: "call_transfer",
28
+ CALL_CONFERENCE: "call_conference",
29
+ // in each object has items list of objects
30
+ CALL_INBOUND: "call_inbound",
31
+ CALL_OUTBOUND: "call_outbound",
32
+ CONFERENCE: "call_conference",
33
+ TRANSFER_BLIND: "call_transfer_blind",
34
+ TRANSFER_ATTENDED: "call_transfer_attended",
35
+ TRANSFER_WARM: "call_transfer_warm",
36
+ // Campaigns
37
+ CAMPAIGNS_CREATE: "campaigns:create",
38
+ CAMPAIGNS_READ: "campaigns:read",
39
+ CAMPAIGNS_UPDATE: "campaigns:update",
40
+ CAMPAIGNS_DELETE: "campaigns:delete",
41
+ CAMPAIGNS_MANAGE: "campaigns:manage",
42
+ CAMPAIGNS_CONTROL: "campaigns:control",
43
+ CAMPAIGNS_LEADS_CREATE: "leads:create",
44
+ CAMPAIGNS_LEADS_READ: "leads:read",
45
+ CAMPAIGNS_LEADS_DELETE: "leads:delete",
46
+ CAMPAIGNS_LEADS_IMPORT: "leads:import",
47
+ // Reports — Agent Login
48
+ REPORTS_AGENT_LOGIN_READ: "reports:agent_login:read",
49
+ REPORTS_AGENT_LOGIN_EXPORT: "reports:agent_login:export",
50
+ REPORTS_AGENT_LOGIN_MANAGE: "reports:agent_login:manage",
51
+ // CDR Report
52
+ REPORTS_CDR_READ: "reports:cdr:read",
53
+ REPORTS_CDR_EXPORT: "reports:cdr:export",
54
+ REPORTS_CDR_MANAGE: "reports:cdr:manage",
55
+ // Reports — Agent Performance / Detail
56
+ REPORTS_AGENT_PERFORMANCE_READ: "reports:agent_performance:read",
57
+ REPORTS_AGENT_PERFORMANCE_EXPORT: "reports:agent_performance:export",
58
+ REPORTS_AGENT_PERFORMANCE_MANAGE: "reports:agent_performance:manage",
59
+ // Supervisor Monitoring
60
+ SUPERVISOR_MONITOR_LISTEN: "supervisor:monitor:listen",
61
+ SUPERVISOR_MONITOR_WHISPER: "supervisor:monitor:whisper",
62
+ SUPERVISOR_MONITOR_BARGE: "supervisor:monitor:barge"
63
+ };
64
+
65
+ // call-control-sdk/lib/hooks/sdk-state.ts
66
+ import { getSession, removeSession, setSession } from "@react-solutions/vault";
67
+
68
+ // call-control-sdk/lib/utils/storage.ts
69
+ var STORAGE_KEY = "call-control-sdk-state";
70
+
71
+ // call-control-sdk/lib/hooks/sdk-state.ts
72
+ var SDKStateManager = class {
73
+ constructor() {
74
+ __publicField(this, "state");
75
+ __publicField(this, "listeners", []);
76
+ __publicField(this, "STORAGE_KEY", STORAGE_KEY);
77
+ __publicField(this, "apiKey");
78
+ __publicField(this, "tenantId");
79
+ this.state = this.getInitialState();
80
+ this.loadFromStorage();
81
+ }
82
+ getInitialState() {
83
+ var _a2, _b;
84
+ return {
85
+ authorization: void 0,
86
+ process: null,
87
+ agentId: "",
88
+ openConferenceDialog: false,
89
+ openCallTransferDialog: false,
90
+ isInitialized: false,
91
+ sdkConfig: {
92
+ disableEndCallButton: false,
93
+ disableEndConference: false,
94
+ disabledDialButton: false,
95
+ disabledMoreOptionsButton: false,
96
+ enableSmsServices: false,
97
+ enableQueueName: false,
98
+ disableCallTransferButton: false,
99
+ disableBlindTransfer: false,
100
+ disableAttendedTransfer: false,
101
+ disableWarmTransfer: false,
102
+ isDraggable: true,
103
+ disableSoftPhone: false,
104
+ disableConferenceButton: false,
105
+ disableHoldButton: false,
106
+ disableMuteButton: false,
107
+ disableAlternateDialing: true,
108
+ disabled: {},
109
+ enabled: {},
110
+ outlined: {}
111
+ },
112
+ urlConfig: {
113
+ baseURL: "",
114
+ iframeURL: "",
115
+ iframeAPIURL: "",
116
+ webSocketURL: "",
117
+ coreBaseURL: "",
118
+ id: "",
119
+ password: ""
120
+ },
121
+ callStartTime: null,
122
+ controlPanelPosition: { x: 10, y: 10 },
123
+ iframePosition: {
124
+ x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460,
125
+ y: ((_b = window.screen) == null ? void 0 : _b.height) - 580
126
+ },
127
+ callData: {
128
+ agent_id: -1,
129
+ queue_name: "",
130
+ hold: 0,
131
+ mute: 0,
132
+ status: "",
133
+ type: "",
134
+ event_time: "",
135
+ phone_number: ""
136
+ },
137
+ conferenceLine: [
138
+ {
139
+ line: 1,
140
+ status: "IDLE",
141
+ type: "",
142
+ phone: "",
143
+ isMute: false,
144
+ isHold: false,
145
+ isCallStart: false,
146
+ isMergeCall: false
147
+ },
148
+ {
149
+ line: 2,
150
+ status: "IDLE",
151
+ type: "",
152
+ phone: "",
153
+ isMute: false,
154
+ isHold: false,
155
+ isCallStart: false,
156
+ isMergeCall: false
157
+ },
158
+ {
159
+ line: 3,
160
+ status: "IDLE",
161
+ type: "",
162
+ phone: "",
163
+ isMute: false,
164
+ isHold: false,
165
+ isCallStart: false,
166
+ isMergeCall: false
167
+ },
168
+ {
169
+ line: 4,
170
+ status: "IDLE",
171
+ type: "",
172
+ phone: "",
173
+ isMute: false,
174
+ isHold: false,
175
+ isCallStart: false,
176
+ isMergeCall: false
177
+ },
178
+ {
179
+ line: 5,
180
+ status: "IDLE",
181
+ type: "",
182
+ phone: "",
183
+ isMute: false,
184
+ isHold: false,
185
+ isCallStart: false,
186
+ isMergeCall: false
187
+ }
188
+ ],
189
+ hold: 0,
190
+ mute: 0,
191
+ agentStatus: "",
192
+ sdk: null,
193
+ isPermissionsLoaded: false,
194
+ userPermissions: null,
195
+ menuEntitlements: null,
196
+ consultInfo: null,
197
+ rootCallUuid: null,
198
+ backendCallControls: null,
199
+ transferLeadData: void 0
200
+ };
201
+ }
202
+ loadFromStorage() {
203
+ var _a2, _b, _c, _d;
204
+ try {
205
+ const stored = getSession(this.STORAGE_KEY);
206
+ if (stored) {
207
+ const parsedState = stored;
208
+ this.state = __spreadProps(__spreadValues({}, this.state), {
209
+ agentId: parsedState.agentId || "",
210
+ authorization: parsedState.authorization || void 0,
211
+ process: parsedState.process || null,
212
+ openConferenceDialog: (parsedState == null ? void 0 : parsedState.openConferenceDialog) || false,
213
+ openCallTransferDialog: (parsedState == null ? void 0 : parsedState.openCallTransferDialog) || false,
214
+ isInitialized: parsedState.isInitialized || false,
215
+ sdkConfig: parsedState.sdkConfig || {
216
+ disableEndCallButton: false,
217
+ disableEndConference: false,
218
+ disabledMoreOptionsButton: false,
219
+ enableSmsServices: false,
220
+ enableQueueName: false,
221
+ disabledDialButton: false,
222
+ disableCallTransferButton: false,
223
+ disableBlindTransfer: false,
224
+ disableAttendedTransfer: false,
225
+ disableWarmTransfer: false,
226
+ isDraggable: true,
227
+ disableSoftPhone: false,
228
+ disableConferenceButton: false,
229
+ disableHoldButton: false,
230
+ disableMuteButton: false,
231
+ disableAlternateDialing: true,
232
+ disabled: {},
233
+ enabled: {},
234
+ outlined: {}
235
+ },
236
+ urlConfig: parsedState.urlConfig || {
237
+ id: "",
238
+ baseURL: "",
239
+ iframeURL: "",
240
+ iframeAPIURL: "",
241
+ webSocketURL: "",
242
+ coreBaseURL: "",
243
+ password: ""
244
+ },
245
+ callStartTime: parsedState.callStartTime || null,
246
+ controlPanelPosition: parsedState.controlPanelPosition || {
247
+ x: 10,
248
+ y: 10
249
+ },
250
+ iframePosition: parsedState.iframePosition || {
251
+ x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460,
252
+ y: ((_b = window.screen) == null ? void 0 : _b.height) - 580
253
+ },
254
+ callData: parsedState.callData || {
255
+ mobileNumber: "",
256
+ callReferenceId: "",
257
+ agent_id: "",
258
+ status: "",
259
+ type: "",
260
+ event_time: "",
261
+ phone_number: ""
262
+ },
263
+ conferenceLine: parsedState.conferenceLine && Array.isArray(parsedState.conferenceLine) && parsedState.conferenceLine.length > 0 ? parsedState.conferenceLine : this.state.conferenceLine,
264
+ agentStatus: parsedState.agentStatus,
265
+ sdk: parsedState.sdk || null,
266
+ isPermissionsLoaded: parsedState.isPermissionsLoaded || false,
267
+ userPermissions: parsedState.userPermissions || null,
268
+ menuEntitlements: parsedState.menuEntitlements || null,
269
+ rootCallUuid: (_c = parsedState.rootCallUuid) != null ? _c : null,
270
+ transferLeadData: (_d = parsedState.transferLeadData) != null ? _d : void 0
271
+ });
272
+ }
273
+ } catch (error) {
274
+ console.warn("Failed to load SDK state:", error);
275
+ }
276
+ }
277
+ saveToStorage() {
278
+ try {
279
+ const persistentState = {
280
+ agentId: this.state.agentId,
281
+ authorization: this.state.authorization,
282
+ process: this.state.process,
283
+ isInitialized: this.state.isInitialized,
284
+ openConferenceDialog: this.state.openConferenceDialog,
285
+ openCallTransferDialog: this.state.openCallTransferDialog,
286
+ sdkConfig: this.state.sdkConfig,
287
+ urlConfig: this.state.urlConfig,
288
+ callStartTime: this.state.callStartTime,
289
+ controlPanelPosition: this.state.controlPanelPosition,
290
+ iframePosition: this.state.iframePosition,
291
+ callData: this.state.callData,
292
+ conferenceLine: this.state.conferenceLine,
293
+ agentStatus: this.state.agentStatus,
294
+ sdk: this.state.sdk,
295
+ isPermissionsLoaded: this.state.isPermissionsLoaded,
296
+ userPermissions: this.state.userPermissions,
297
+ menuEntitlements: this.state.menuEntitlements,
298
+ rootCallUuid: this.state.rootCallUuid,
299
+ transferLeadData: this.state.transferLeadData
300
+ };
301
+ setSession(this.STORAGE_KEY, persistentState);
302
+ } catch (error) {
303
+ console.warn("Failed to save SDK state:", error);
304
+ }
305
+ }
306
+ notifyListeners() {
307
+ this.listeners.forEach((listener) => listener());
308
+ }
309
+ validateCredentials(apiKey, tenantId) {
310
+ if (!apiKey || typeof apiKey !== "string" || apiKey.trim().length === 0) {
311
+ throw new Error("API key not available");
312
+ }
313
+ if (!tenantId || typeof tenantId !== "string" || tenantId.trim().length === 0) {
314
+ throw new Error("Tenant ID not available");
315
+ }
316
+ this.apiKey = apiKey.trim();
317
+ this.tenantId = tenantId.trim();
318
+ }
319
+ initialize(apiKey, tenantId, agentId, urlConfig, initResult, sdkConfig, rawBackendCallControls) {
320
+ var _a2;
321
+ this.validateCredentials(apiKey, tenantId);
322
+ if (!agentId || typeof agentId !== "string" || agentId.trim().length === 0) {
323
+ throw new Error("Agent ID not available");
324
+ } else {
325
+ this.state.agentId = agentId;
326
+ this.state.openConferenceDialog = false;
327
+ this.state.openCallTransferDialog = false;
328
+ this.state.authorization = initResult;
329
+ this.state.backendCallControls = rawBackendCallControls != null ? rawBackendCallControls : null;
330
+ this.state.sdkConfig = __spreadValues(__spreadValues({
331
+ disableEndCallButton: false,
332
+ disableEndConference: false,
333
+ disabledDialButton: false,
334
+ disabledMoreOptionsButton: false,
335
+ enableQueueName: false,
336
+ disableCallTransferButton: false,
337
+ disableBlindTransfer: false,
338
+ disableAttendedTransfer: false,
339
+ disableWarmTransfer: false,
340
+ isDraggable: true,
341
+ disableSoftPhone: false,
342
+ disableConferenceButton: false,
343
+ disableHoldButton: false,
344
+ disableMuteButton: false,
345
+ disableAlternateDialing: true,
346
+ disabled: {},
347
+ enabled: {},
348
+ outlined: {}
349
+ }, sdkConfig), initResult == null ? void 0 : initResult.callControls);
350
+ this.state.urlConfig = {
351
+ baseURL: (urlConfig == null ? void 0 : urlConfig.baseURL) || "",
352
+ iframeURL: (urlConfig == null ? void 0 : urlConfig.iframeURL) || "",
353
+ iframeAPIURL: (urlConfig == null ? void 0 : urlConfig.iframeAPIURL) || "",
354
+ webSocketURL: (urlConfig == null ? void 0 : urlConfig.webSocketURL) || "",
355
+ coreBaseURL: (urlConfig == null ? void 0 : urlConfig.coreBaseURL) || "",
356
+ id: ((_a2 = initResult == null ? void 0 : initResult.userInfo) == null ? void 0 : _a2.id) ? String(initResult.userInfo.id) : "",
357
+ password: (urlConfig == null ? void 0 : urlConfig.password) || ""
358
+ };
359
+ this.state.isInitialized = true;
360
+ this.saveToStorage();
361
+ this.notifyListeners();
362
+ }
363
+ }
364
+ getState() {
365
+ return __spreadValues({}, this.state);
366
+ }
367
+ getCredentials() {
368
+ return { apiKey: this.apiKey, tenantId: this.tenantId };
369
+ }
370
+ getSdkAuthToken() {
371
+ var _a2;
372
+ return (_a2 = this.state.authorization) == null ? void 0 : _a2.accessToken;
373
+ }
374
+ subscribe(listener) {
375
+ this.listeners.push(listener);
376
+ return () => {
377
+ const index = this.listeners.indexOf(listener);
378
+ if (index > -1) {
379
+ this.listeners.splice(index, 1);
380
+ }
381
+ };
382
+ }
383
+ setTransferLeadData(data) {
384
+ this.state.transferLeadData = data;
385
+ this.saveToStorage();
386
+ this.notifyListeners();
387
+ }
388
+ getTransferLeadData() {
389
+ return this.state.transferLeadData;
390
+ }
391
+ clearTransferLeadData() {
392
+ this.state.transferLeadData = void 0;
393
+ this.saveToStorage();
394
+ this.notifyListeners();
395
+ }
396
+ // public setHolding(isHolding: boolean): void {
397
+ // this.state.isHolding = isHolding;
398
+ // this.saveToStorage();
399
+ // this.notifyListeners();
400
+ // }
401
+ // public setMuted(isMuted: boolean): void {
402
+ // this.state.isMuted = isMuted;
403
+ // this.saveToStorage();
404
+ // this.notifyListeners();
405
+ // }
406
+ setProcess(process) {
407
+ this.state.process = process;
408
+ this.saveToStorage();
409
+ this.notifyListeners();
410
+ }
411
+ setControlPanelPosition(position) {
412
+ this.state.controlPanelPosition = position;
413
+ this.saveToStorage();
414
+ this.notifyListeners();
415
+ }
416
+ setIframePosition(position) {
417
+ this.state.iframePosition = position;
418
+ this.saveToStorage();
419
+ this.notifyListeners();
420
+ }
421
+ startCall() {
422
+ this.state.callStartTime = Date.now();
423
+ this.saveToStorage();
424
+ this.notifyListeners();
425
+ }
426
+ endCall() {
427
+ this.state.callStartTime = null;
428
+ this.saveToStorage();
429
+ this.notifyListeners();
430
+ }
431
+ setInitCheck() {
432
+ this.state.isInitialized = false;
433
+ this.saveToStorage();
434
+ this.notifyListeners();
435
+ }
436
+ setOpenConferenceDialog(open) {
437
+ this.state.openConferenceDialog = open;
438
+ this.saveToStorage();
439
+ this.notifyListeners();
440
+ }
441
+ setOpenCallTransferDialog(open) {
442
+ this.state.openCallTransferDialog = open;
443
+ this.saveToStorage();
444
+ this.notifyListeners();
445
+ }
446
+ setConsultInfo(info) {
447
+ this.state.consultInfo = info;
448
+ this.notifyListeners();
449
+ }
450
+ setRootCallUuid(uuid) {
451
+ this.state.rootCallUuid = uuid;
452
+ this.saveToStorage();
453
+ this.notifyListeners();
454
+ }
455
+ setAgentStatus(status) {
456
+ this.state.agentStatus = status;
457
+ this.saveToStorage();
458
+ this.notifyListeners();
459
+ }
460
+ updateCallData(data) {
461
+ this.state.callData = __spreadValues(__spreadValues({}, this.state.callData), data);
462
+ this.saveToStorage();
463
+ this.notifyListeners();
464
+ }
465
+ updateConferenceData(data) {
466
+ this.state.conferenceLine = [...data];
467
+ this.saveToStorage();
468
+ this.notifyListeners();
469
+ }
470
+ setConferenceLine(line) {
471
+ var _a2;
472
+ if (!this.state.conferenceLine || !Array.isArray(this.state.conferenceLine)) {
473
+ this.state.conferenceLine = this.getInitialState().conferenceLine;
474
+ }
475
+ const conferenceLineData = (_a2 = this.state.conferenceLine) == null ? void 0 : _a2.map(
476
+ (each) => {
477
+ if (each.line === line.line) {
478
+ return line;
479
+ }
480
+ return each;
481
+ }
482
+ );
483
+ this.state.conferenceLine = conferenceLineData;
484
+ this.saveToStorage();
485
+ this.notifyListeners();
486
+ }
487
+ resetConferenceLines() {
488
+ this.state.conferenceLine = [
489
+ {
490
+ line: 1,
491
+ status: "IDLE",
492
+ type: "",
493
+ phone: "",
494
+ isMute: false,
495
+ isHold: false,
496
+ isCallStart: false,
497
+ isMergeCall: false
498
+ },
499
+ {
500
+ line: 2,
501
+ status: "IDLE",
502
+ type: "",
503
+ phone: "",
504
+ isMute: false,
505
+ isHold: false,
506
+ isCallStart: false,
507
+ isMergeCall: false
508
+ },
509
+ {
510
+ line: 3,
511
+ status: "IDLE",
512
+ type: "",
513
+ phone: "",
514
+ isMute: false,
515
+ isHold: false,
516
+ isCallStart: false,
517
+ isMergeCall: false
518
+ },
519
+ {
520
+ line: 4,
521
+ status: "IDLE",
522
+ type: "",
523
+ phone: "",
524
+ isMute: false,
525
+ isHold: false,
526
+ isCallStart: false,
527
+ isMergeCall: false
528
+ },
529
+ {
530
+ line: 5,
531
+ status: "IDLE",
532
+ type: "",
533
+ phone: "",
534
+ isMute: false,
535
+ isHold: false,
536
+ isCallStart: false,
537
+ isMergeCall: false
538
+ }
539
+ ];
540
+ this.saveToStorage();
541
+ this.notifyListeners();
542
+ }
543
+ clearStorageAndReset() {
544
+ try {
545
+ removeSession(this.STORAGE_KEY);
546
+ this.state = this.getInitialState();
547
+ this.notifyListeners();
548
+ } catch (error) {
549
+ console.warn("Failed to clear:", error);
550
+ }
551
+ }
552
+ getConferenceLines() {
553
+ return this.state.conferenceLine || [];
554
+ }
555
+ /**
556
+ * Update SDK config with permission-based controls.
557
+ * Merges the provided controls with existing config.
558
+ */
559
+ updateSDKConfigFromPermissions(permissionControls) {
560
+ this.state.sdkConfig = __spreadValues(__spreadValues({}, this.state.sdkConfig), permissionControls);
561
+ this.saveToStorage();
562
+ this.notifyListeners();
563
+ }
564
+ /**
565
+ * Revert call consult controls back to the base permission-derived values.
566
+ * Called when a CALL_STATE event arrives without call_consult_controls.
567
+ */
568
+ resetConsultControls() {
569
+ const base = this.getControlsConfig();
570
+ this.state.sdkConfig = __spreadProps(__spreadValues({}, this.state.sdkConfig), {
571
+ disableEndCallButton: base.disableEndCallButton,
572
+ disableCallTransferButton: base.disableCallTransferButton,
573
+ disableConferenceButton: base.disableConferenceButton,
574
+ disableHoldButton: base.disableHoldButton,
575
+ disableMuteButton: base.disableMuteButton
576
+ });
577
+ this.saveToStorage();
578
+ this.notifyListeners();
579
+ }
580
+ // ============ Entitlement Logic (Ported from SDKPermissionManager) ============
581
+ /**
582
+ * Set user information (entitlements) from login response
583
+ */
584
+ setSDKPermissions(userInfo) {
585
+ var _a2, _b;
586
+ if (!userInfo) return;
587
+ const sdk = (_a2 = userInfo.entitlements) == null ? void 0 : _a2.sdk;
588
+ const sdkPermissions = Array.isArray(userInfo.permissions) ? userInfo.permissions : null;
589
+ const sdkMenus = Array.isArray((_b = userInfo.entitlements) == null ? void 0 : _b.menus) ? userInfo.entitlements.menus : null;
590
+ this.state.sdk = sdk;
591
+ this.state.userPermissions = sdkPermissions;
592
+ this.state.menuEntitlements = sdkMenus;
593
+ this.state.isPermissionsLoaded = true;
594
+ const permissionControls = this.getControlsConfig();
595
+ this.updateSDKConfigFromPermissions(permissionControls);
596
+ this.saveToStorage();
597
+ this.notifyListeners();
598
+ }
599
+ /**
600
+ * Check if a bit is enabled in entitlements
601
+ */
602
+ isBitEnabled(category, bitCode) {
603
+ var _a2;
604
+ const sdk = this.state.sdk;
605
+ if (!sdk) return false;
606
+ const categoryEntitlement = sdk[category];
607
+ if (!categoryEntitlement) return false;
608
+ if (!categoryEntitlement.enabled) return false;
609
+ if (!bitCode) return true;
610
+ const bit = (_a2 = categoryEntitlement.items) == null ? void 0 : _a2.find(
611
+ (item) => item.code === bitCode
612
+ );
613
+ return bit ? bit.enabled : false;
614
+ }
615
+ /** Check if the user has a specific flat permission (e.g. "calls:inbound") */
616
+ hasPermission(permission) {
617
+ const perms = this.state.userPermissions;
618
+ if (!perms) return false;
619
+ return perms.includes("*") || perms.includes(permission);
620
+ }
621
+ /** Check if any of the provided permissions is granted */
622
+ hasAnyPermission(permissions) {
623
+ return permissions.some((p) => this.hasPermission(p));
624
+ }
625
+ /** Check if all of the provided permissions are granted */
626
+ hasAllPermissions(permissions) {
627
+ return permissions.every((p) => this.hasPermission(p));
628
+ }
629
+ /** Check if a menu entitlement is enabled (e.g. "campaign"). Supports "*" wildcard. */
630
+ hasMenuFeature(code) {
631
+ const menus = this.state.menuEntitlements;
632
+ if (!menus) return false;
633
+ if (menus.some((m) => m.code === "*" && m.enabled)) return true;
634
+ const entry = menus.find((m) => m.code === code);
635
+ return entry ? entry.enabled : false;
636
+ }
637
+ /**
638
+ * Get SDK controls configuration derived exclusively from structured entitlements.
639
+ */
640
+ getControlsConfig() {
641
+ var _a2;
642
+ const { sdk, isPermissionsLoaded } = this.state;
643
+ if (!isPermissionsLoaded || !sdk) {
644
+ return {
645
+ disabledDialButton: true,
646
+ disableEndCallButton: true,
647
+ disableCallTransferButton: true,
648
+ disableBlindTransfer: true,
649
+ disableAttendedTransfer: true,
650
+ disableWarmTransfer: true,
651
+ disableConferenceButton: true,
652
+ disableHoldButton: true,
653
+ disableMuteButton: true,
654
+ disabledMoreOptionsButton: true
655
+ };
656
+ }
657
+ const isDialAllowed = this.isBitEnabled(
658
+ "calls",
659
+ SDK_PERMISSIONS.CALL_OUTBOUND
660
+ );
661
+ const isInboundAllowed = this.isBitEnabled(
662
+ "calls",
663
+ SDK_PERMISSIONS.CALL_INBOUND
664
+ );
665
+ const isAnyCallAllowed = isDialAllowed || isInboundAllowed;
666
+ const backendDisabledEndCall = !!((_a2 = this.state.backendCallControls) == null ? void 0 : _a2.disableEndCallButton);
667
+ const isHoldAllowed = isAnyCallAllowed;
668
+ const isMuteAllowed = isAnyCallAllowed;
669
+ const isEndCallAllowed = isAnyCallAllowed && !backendDisabledEndCall;
670
+ const isConferenceAllowed = this.isBitEnabled("call_conference", "");
671
+ const isTransferEnabled = this.isBitEnabled("call_transfer", "");
672
+ const isBlindAllowed = this.isBitEnabled(
673
+ "call_transfer",
674
+ SDK_PERMISSIONS.TRANSFER_BLIND
675
+ );
676
+ const isAttendedAllowed = this.isBitEnabled(
677
+ "call_transfer",
678
+ SDK_PERMISSIONS.TRANSFER_ATTENDED
679
+ );
680
+ const isWarmAllowed = this.isBitEnabled(
681
+ "call_transfer",
682
+ SDK_PERMISSIONS.TRANSFER_WARM
683
+ );
684
+ return {
685
+ disabledDialButton: !isDialAllowed,
686
+ disableEndCallButton: !isEndCallAllowed,
687
+ disableCallTransferButton: !isTransferEnabled,
688
+ disableBlindTransfer: !isBlindAllowed,
689
+ disableAttendedTransfer: !isAttendedAllowed,
690
+ disableWarmTransfer: !isWarmAllowed,
691
+ disableConferenceButton: !isConferenceAllowed,
692
+ disableHoldButton: !isHoldAllowed,
693
+ disableMuteButton: !isMuteAllowed,
694
+ disabledMoreOptionsButton: false
695
+ };
696
+ }
697
+ };
698
+ var sdkStateManager = new SDKStateManager();
699
+
700
+ // call-control-sdk/lib/services/axios.ts
701
+ import axios from "axios";
702
+ var _a;
703
+ var DEFAULT_TOKEN = (_a = sdkStateManager.getSdkAuthToken()) != null ? _a : "";
704
+ var REQUEST_TIMEOUT = 6e4;
705
+ function getAuthToken() {
706
+ var _a2;
707
+ return (_a2 = sdkStateManager.getSdkAuthToken()) != null ? _a2 : "";
708
+ }
709
+ function createAxiosInstance() {
710
+ var _a2, _b, _c, _d;
711
+ const instance = axios.create({
712
+ // baseURL: sdkStateManager.getState()?.urlConfig?.baseURL,
713
+ headers: {
714
+ "Content-Type": "application/json",
715
+ Accept: "application/json",
716
+ "x-tenant-id": (_b = (_a2 = sdkStateManager.getCredentials()) == null ? void 0 : _a2.tenantId) != null ? _b : "",
717
+ "x-api-key": (_d = (_c = sdkStateManager.getCredentials()) == null ? void 0 : _c.apiKey) != null ? _d : "",
718
+ Authorization: DEFAULT_TOKEN ? DEFAULT_TOKEN.startsWith("Bearer ") ? DEFAULT_TOKEN : `Bearer ${DEFAULT_TOKEN}` : ""
719
+ },
720
+ timeout: REQUEST_TIMEOUT,
721
+ withCredentials: false
722
+ });
723
+ instance.interceptors.request.use(
724
+ (config) => {
725
+ const token = getAuthToken();
726
+ if (token && config.headers) {
727
+ const authToken = token.startsWith("Bearer ") ? token : `Bearer ${token}`;
728
+ config.headers.Authorization = authToken;
729
+ }
730
+ console.log("API Request:", {
731
+ url: config.url,
732
+ method: config.method,
733
+ hasToken: !!token,
734
+ tokenStartsWithBearer: token == null ? void 0 : token.startsWith("Bearer "),
735
+ headers: {
736
+ Authorization: config.headers.Authorization,
737
+ "x-tenant-id": config.headers["x-tenant-id"],
738
+ "x-api-key": config.headers["x-api-key"]
739
+ }
740
+ });
741
+ config.metadata = { startTime: (/* @__PURE__ */ new Date()).getTime() };
742
+ return config;
743
+ },
744
+ (error) => {
745
+ console.error("Request interceptor error:", error);
746
+ return Promise.reject(error);
747
+ }
748
+ );
749
+ instance.interceptors.response.use(
750
+ (response) => {
751
+ return response;
752
+ },
753
+ async (error) => {
754
+ var _a3;
755
+ const originalRequest = error.config;
756
+ if (((_a3 = error.response) == null ? void 0 : _a3.status) === 401 && !originalRequest._retry) {
757
+ sdkStateManager.setInitCheck();
758
+ console.warn("Unauthorized request, attempting retry...");
759
+ }
760
+ if (!error.response) {
761
+ console.error("Network error:", error.message);
762
+ error.message = "Network error: Please check your internet connection";
763
+ }
764
+ if (error.response && error.response.status >= 500) {
765
+ console.error("Server error:", error.response.status, error.response.data);
766
+ error.message = "Server error: Please try again later";
767
+ }
768
+ return Promise.reject(error);
769
+ }
770
+ );
771
+ return instance;
772
+ }
773
+ var axiosInstance = createAxiosInstance();
774
+ var inFlightGets = /* @__PURE__ */ new Map();
775
+ var _rawGet = axiosInstance.get.bind(axiosInstance);
776
+ axiosInstance.get = (url, config) => {
777
+ var _a2;
778
+ if ((config == null ? void 0 : config.responseType) && config.responseType !== "json") {
779
+ return _rawGet(url, config);
780
+ }
781
+ const key = `${url}|${JSON.stringify((_a2 = config == null ? void 0 : config.params) != null ? _a2 : {})}`;
782
+ const existing = inFlightGets.get(key);
783
+ if (existing) return existing;
784
+ const req = _rawGet(url, config).finally(() => inFlightGets.delete(key));
785
+ inFlightGets.set(key, req);
786
+ return req;
787
+ };
788
+ var deepFindArray = (body, preferredKeys = [], depth = 0) => {
789
+ if (Array.isArray(body)) return body;
790
+ if (!body || typeof body !== "object" || depth > 4) return [];
791
+ for (const k of preferredKeys) {
792
+ if (Array.isArray(body[k])) return body[k];
793
+ }
794
+ for (const k of Object.keys(body)) {
795
+ if (Array.isArray(body[k])) return body[k];
796
+ }
797
+ for (const k of Object.keys(body)) {
798
+ const v = body[k];
799
+ if (v && typeof v === "object") {
800
+ const found = deepFindArray(v, preferredKeys, depth + 1);
801
+ if (found.length) return found;
802
+ }
803
+ }
804
+ return [];
805
+ };
806
+ var deepFindTotal = (body, depth = 0) => {
807
+ if (!body || typeof body !== "object" || depth > 4) return -1;
808
+ for (const key of ["total", "totalCount", "totalRecords", "count"]) {
809
+ if (typeof body[key] === "number") return body[key];
810
+ }
811
+ for (const k of Object.keys(body)) {
812
+ const v = body[k];
813
+ if (v && typeof v === "object" && !Array.isArray(v)) {
814
+ const found = deepFindTotal(v, depth + 1);
815
+ if (found >= 0) return found;
816
+ }
817
+ }
818
+ return -1;
819
+ };
820
+ var axios_default = axiosInstance;
821
+
822
+ // call-control-sdk/lib/services/endPoint.ts
823
+ var getBaseURL = () => {
824
+ var _a2, _b, _c;
825
+ return ((_c = (_b = (_a2 = sdkStateManager) == null ? void 0 : _a2.getState()) == null ? void 0 : _b.urlConfig) == null ? void 0 : _c.baseURL) || "";
826
+ };
827
+ var getCoreURL = () => {
828
+ var _a2, _b, _c;
829
+ return ((_c = (_b = (_a2 = sdkStateManager) == null ? void 0 : _a2.getState()) == null ? void 0 : _b.urlConfig) == null ? void 0 : _c.coreBaseURL) || "";
830
+ };
831
+ var BASE_URL = getBaseURL();
832
+ var CORE_URL = getCoreURL();
833
+ var VERSION = {
834
+ v1: "/api/v1"
835
+ };
836
+ var END_POINT = {
837
+ get LOGIN() {
838
+ return `${getBaseURL()}${VERSION.v1}/cti/login?provider=convox`;
839
+ },
840
+ get READY_AGENT() {
841
+ return `${getCoreURL()}${VERSION.v1}/agents/ready`;
842
+ },
843
+ get UPDATE_AGENT_BREAK() {
844
+ return `${getCoreURL()}${VERSION.v1}/agents/status`;
845
+ },
846
+ get CLICK_TO_CALL() {
847
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/dial`;
848
+ },
849
+ get HOLD_CALL() {
850
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/hold`;
851
+ },
852
+ get MUTE_CALL() {
853
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/mute`;
854
+ },
855
+ get UNMUTE_CALL() {
856
+ return `${getCoreURL()}${VERSION.v1}/cti/mute`;
857
+ },
858
+ get END_CALL() {
859
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/hangup`;
860
+ },
861
+ get LOGOUT() {
862
+ return `${getBaseURL()}${VERSION.v1}/cti/logout?provider=convox`;
863
+ },
864
+ get CONFERENCE_CALL() {
865
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/conference/add`;
866
+ },
867
+ get CONFERENCE_MERGE_CALL() {
868
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/conference/merge`;
869
+ },
870
+ get CONFERENCE_CALL_HOLD_OR_UN_HOLD() {
871
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/hold`;
872
+ },
873
+ get CONFERENCE_CALL_MUTE_OT_UN_MUTE() {
874
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/mute`;
875
+ },
876
+ get CONFERENCE_CALL_END() {
877
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/hangup`;
878
+ },
879
+ get CONFERENCE_CALL_END_ALL() {
880
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/hangup`;
881
+ },
882
+ get CONFERENCE_CALL_TRANSFER() {
883
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/conference/transfer`;
884
+ },
885
+ get TRANSFER_CALL() {
886
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/transfer-call`;
887
+ },
888
+ get TRANSFER_COMPLETE() {
889
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/transfer/complete`;
890
+ },
891
+ get TRANSFER_CANCEL() {
892
+ return `${getCoreURL()}${VERSION.v1}/cti/calls/transfer/cancel`;
893
+ },
894
+ get AGENTS_LIST() {
895
+ return `${getBaseURL()}${VERSION.v1}/cti/users`;
896
+ },
897
+ get PROCESS_LIST() {
898
+ return `${getBaseURL()}${VERSION.v1}/cti/processes-list`;
899
+ },
900
+ get BREAKS_LIST() {
901
+ return `${getBaseURL()}${VERSION.v1}/cti/breaks`;
902
+ },
903
+ get TRANSFER_TO_DETAILS() {
904
+ return `${getBaseURL()}${VERSION.v1}/cti/transfer-to-details?provider=convox`;
905
+ },
906
+ get SEND_NOTIFICATIONS() {
907
+ return `${getBaseURL()}${VERSION.v1}/cti/notifications/send`;
908
+ },
909
+ get CALL_HISTORY() {
910
+ return `${getBaseURL()}${VERSION.v1}/dashboard/call-history`;
911
+ },
912
+ get SENTIMENTAL_ANALYSIS() {
913
+ return `${getBaseURL()}${VERSION.v1}/users/get_sentiment_analysis`;
914
+ },
915
+ get DISPOSITIONS() {
916
+ return `${getBaseURL()}${VERSION.v1}/cti/calls/dispositions`;
917
+ },
918
+ get HOSPITALS_SERVICES() {
919
+ return `${getBaseURL()}${VERSION.v1}/cti/hospital/services`;
920
+ },
921
+ get BLIEND_TRANSFER() {
922
+ return `${getBaseURL()}${VERSION.v1}/cti/calls/blind_transfer?provider=convox`;
923
+ },
924
+ get AUTH_LOGOUT() {
925
+ return `${getBaseURL()}${VERSION.v1}/auth/logout`;
926
+ },
927
+ // Permissions
928
+ get USER_PERMISSIONS() {
929
+ return `${getBaseURL()}${VERSION.v1}/rbac/users/me/permissions`;
930
+ },
931
+ // Supervisor Call Monitoring (Listen / Whisper / Barge via ChanSpy)
932
+ get SUPERVISOR_CALL_LISTEN() {
933
+ return `${getBaseURL()}${VERSION.v1}/cti/supervisor/listen`;
934
+ },
935
+ get SUPERVISOR_CALL_LEAVE() {
936
+ return `${getBaseURL()}${VERSION.v1}/cti/supervisor/leave`;
937
+ },
938
+ get SUPERVISOR_CALL_CHANGE_MODE() {
939
+ return `${getBaseURL()}${VERSION.v1}/cti/supervisor/mode`;
940
+ },
941
+ // Call History pages
942
+ get CALLS_HISTORY() {
943
+ return `${getBaseURL()}${VERSION.v1}/calls/history`;
944
+ },
945
+ get MISSED_CALLS() {
946
+ return `${getBaseURL()}${VERSION.v1}/supervisor/missed-calls`;
947
+ },
948
+ RECORDING_BY_CALL: (call_uuid) => `${getBaseURL()}${VERSION.v1}/recordings/call/${call_uuid}`,
949
+ TRANSCRIPT_BY_CALL: (call_uuid) => `${getBaseURL()}${VERSION.v1}/calls/${call_uuid}/transcript`,
950
+ CALL_DATA_BY_CALL: (call_uuid) => `${getBaseURL()}${VERSION.v1}/cti/calls/${call_uuid}/call-data`,
951
+ CALLSAGE_SENTIMENT: (call_id) => `${getBaseURL()}${VERSION.v1}/callsage?call_id=${encodeURIComponent(call_id)}&type=sentiment`,
952
+ CALLSAGE_AUDIT: (call_id) => `${getBaseURL()}${VERSION.v1}/callsage?call_id=${encodeURIComponent(call_id)}&type=audit`,
953
+ // Campaigns
954
+ get CAMPAIGNS_GET_ALL() {
955
+ return `${getBaseURL()}${VERSION.v1}/dialer/campaigns`;
956
+ },
957
+ get CAMPAIGNS_CREATE() {
958
+ return `${getBaseURL()}${VERSION.v1}/dialer/campaigns`;
959
+ },
960
+ CAMPAIGNS_GET_BY_ID: (id) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${id}`,
961
+ CAMPAIGNS_UPDATE: (id) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${id}`,
962
+ CAMPAIGNS_ACTIVATE: (id) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${id}/activate`,
963
+ CAMPAIGNS_PAUSE: (id) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${id}/pause`,
964
+ CAMPAIGNS_ARCHIVE: (id) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${id}/archive`,
965
+ CAMPAIGNS_LEADS: (campaignId) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${campaignId}/leads`,
966
+ CAMPAIGNS_DELETE_LEAD: (campaignId, leadId) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${campaignId}/leads/${leadId}`,
967
+ CAMPAIGNS_DIAL_PREVIEW: (campaignId, leadId) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${campaignId}/leads/${leadId}/dial-preview`,
968
+ CAMPAIGNS_LEADS_UPLOAD_EXCEL: (campaignId) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${campaignId}/leads/upload/excel`,
969
+ CAMPAIGNS_LEADS_TEMPLATE_EXCEL: (campaignId) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${campaignId}/leads/template/excel`,
970
+ CAMPAIGNS_LEADS_EXPORT_EXCEL: (campaignId) => `${getBaseURL()}${VERSION.v1}/dialer/campaigns/${campaignId}/leads/export/excel`,
971
+ // Login Report
972
+ get LOGIN_REPORT() {
973
+ return `${getBaseURL()}${VERSION.v1}/reports/login-report`;
974
+ },
975
+ get LOGIN_REPORT_AGENTS() {
976
+ return `${getBaseURL()}${VERSION.v1}/reports/login-report/agents`;
977
+ },
978
+ LOGIN_REPORT_AGENT_SESSIONS: (agentId) => `${getBaseURL()}${VERSION.v1}/reports/login-report/agents/${agentId}/sessions`,
979
+ LOGIN_REPORT_AGENT_SESSIONS_EXPORT_EXCEL: (agentId) => `${getBaseURL()}${VERSION.v1}/reports/login-report/agents/${agentId}/sessions/export/excel`,
980
+ get LOGIN_REPORT_EXPORT_EXCEL() {
981
+ return `${getBaseURL()}${VERSION.v1}/reports/login-report/export/excel`;
982
+ },
983
+ // CDR Report
984
+ get CDR_REPORT() {
985
+ return `${getBaseURL()}${VERSION.v1}/reports/cdr-report`;
986
+ },
987
+ get CDR_REPORT_RECORDS() {
988
+ return `${getBaseURL()}${VERSION.v1}/reports/cdr-report/records`;
989
+ },
990
+ get CDR_REPORT_EXPORT_EXCEL() {
991
+ return `${getBaseURL()}${VERSION.v1}/reports/cdr-report/export/excel`;
992
+ },
993
+ // Audit Report — POST multipart/form-data (audio file + call metadata)
994
+ get AUDIT_REPORT() {
995
+ return `${getBaseURL()}${VERSION.v1}/reports/audit-report`;
996
+ },
997
+ // CDR Report filter sources (match what main app's CdrReport calls)
998
+ get USERS_LIST() {
999
+ return `${getBaseURL()}${VERSION.v1}/users/`;
1000
+ },
1001
+ get MASTER_QUEUES() {
1002
+ return `${getBaseURL()}${VERSION.v1}/master/queue`;
1003
+ },
1004
+ // Reports
1005
+ get AGENT_PERFORMANCE_REPORT() {
1006
+ return `${getBaseURL()}${VERSION.v1}/reports/agent-performance-report`;
1007
+ },
1008
+ get AGENT_PERFORMANCE_REPORT_AGENTS() {
1009
+ return `${getBaseURL()}${VERSION.v1}/reports/agent-performance-report/agents`;
1010
+ },
1011
+ get AGENT_PERFORMANCE_REPORT_EXPORT_EXCEL() {
1012
+ return `${getBaseURL()}${VERSION.v1}/reports/agent-performance-report/export/excel`;
1013
+ },
1014
+ AGENT_DETAIL_REPORT: (agentId) => `${getBaseURL()}${VERSION.v1}/reports/agent-detail-report/${agentId}`,
1015
+ // get CDR_REPORT() { return `${getBaseURL()}${VERSION.v1}/reports/cdr-report`; },
1016
+ // Queues (used by Campaigns → Queue Linking)
1017
+ get QUEUES_GET_ALL() {
1018
+ return `${getBaseURL()}${VERSION.v1}/master/queue`;
1019
+ },
1020
+ get QUEUES_CREATE() {
1021
+ return `${getBaseURL()}${VERSION.v1}/master/queue`;
1022
+ },
1023
+ // Processes
1024
+ get MASTER_PROCESS() {
1025
+ return `${getBaseURL()}${VERSION.v1}/master/process`;
1026
+ },
1027
+ // Management Dashboard
1028
+ get MANAGEMENT_DASHBOARD() {
1029
+ return `${getBaseURL()}${VERSION.v1}/reports/management-dashboard`;
1030
+ },
1031
+ // Supervisor Dashboard (Live Status)
1032
+ get DASHBOARD_TOP_STATS() {
1033
+ return `${getBaseURL()}${VERSION.v1}/supervisor/dashboard/top-stats`;
1034
+ },
1035
+ get DASHBOARD_AGENTS() {
1036
+ return `${getBaseURL()}${VERSION.v1}/supervisor/dashboard/agents`;
1037
+ },
1038
+ get DASHBOARD_QUEUES() {
1039
+ return `${getBaseURL()}${VERSION.v1}/supervisor/dashboard/queues`;
1040
+ },
1041
+ get DASHBOARD_ALERTS() {
1042
+ return `${getBaseURL()}${VERSION.v1}/supervisor/dashboard/alerts`;
1043
+ },
1044
+ get DASHBOARD_QUEUE_PULSE() {
1045
+ return `${getBaseURL()}${VERSION.v1}/supervisor/dashboard/queue-pulse`;
1046
+ }
1047
+ };
1048
+
1049
+ export {
1050
+ STORAGE_KEY,
1051
+ SDK_WILDCARD,
1052
+ SDK_MENU_CODES,
1053
+ SDK_PERMISSIONS,
1054
+ sdkStateManager,
1055
+ END_POINT,
1056
+ deepFindArray,
1057
+ deepFindTotal,
1058
+ axios_default
1059
+ };
1060
+ //# sourceMappingURL=chunk-O2XGWZLT.mjs.map