call-control-sdk 6.5.5-uat.5 → 6.5.5-uat.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -44,6 +44,7 @@ var END_POINT = {
44
44
  CONFERENCE_CALL_MUTE_OT_UN_MUTE: `${BASE_URL}${VERSION.v1}/cti/calls/conference/mute?provider=convox`,
45
45
  CONFERENCE_CALL_END: `${BASE_URL}${VERSION.v1}/cti/calls/conference/hangup?provider=convox`,
46
46
  CONFERENCE_CALL_END_ALL: `${BASE_URL}${VERSION.v1}/cti/calls/conference/hangup/all?provider=convox`,
47
+ CONFERENCE_CALL_TRANSFER: `${BASE_URL}${VERSION.v1}/cti/calls/conference/transfer?provider=convox`,
47
48
  TRANSFER_CALL: `${BASE_URL}${VERSION.v1}/cti/calls/transfer?provider=convox`,
48
49
  AGENTS_LIST: `${BASE_URL}${VERSION.v1}/cti/users`,
49
50
  PROCESS_LIST: `${BASE_URL}${VERSION.v1}/cti/processes-list`,
@@ -171,7 +172,6 @@ var SDKStateManager = class {
171
172
  const stored = getItem(this.STORAGE_KEY);
172
173
  if (stored) {
173
174
  const parsedState = stored;
174
- console.log("loading from storage", parsedState);
175
175
  this.state = __spreadProps(__spreadValues({}, this.state), {
176
176
  agentId: parsedState.agentId || "",
177
177
  authorization: parsedState.authorization || void 0,
@@ -605,6 +605,23 @@ var axios_default = axiosInstance;
605
605
 
606
606
  // call-control-sdk/lib/hooks/useLogout.ts
607
607
  import { getItem as getItem2, removeItem as removeItem2 } from "@react-solutions/vault";
608
+
609
+ // call-control-sdk/lib/services/usbLight.ts
610
+ var USB_LIGHT_BASE_URL = `http://localhost:5000`;
611
+ var USB_LIGHT_ON = (color) => {
612
+ return `${USB_LIGHT_BASE_URL}/light/${color}/on`;
613
+ };
614
+ var USB_LIGHT_FLASH = (color, number) => {
615
+ return `${USB_LIGHT_BASE_URL}/light/${color}/flash${number}`;
616
+ };
617
+ var USB_LIGHT_ALL_OFF = () => {
618
+ return `${USB_LIGHT_BASE_URL}/all/off`;
619
+ };
620
+ var USB_LIGHT_REQUEST = (url, init) => {
621
+ return fetch(url, init);
622
+ };
623
+
624
+ // call-control-sdk/lib/hooks/useLogout.ts
608
625
  var useLogout = () => {
609
626
  const [loading, setLoading] = useState(false);
610
627
  const [success, setSuccess] = useState(false);
@@ -612,6 +629,7 @@ var useLogout = () => {
612
629
  const [error, setError] = useState(null);
613
630
  const [data, setData] = useState(null);
614
631
  const handleLogout = useCallback(async () => {
632
+ USB_LIGHT_REQUEST(USB_LIGHT_ALL_OFF());
615
633
  const state = getItem2(STORAGE_KEY);
616
634
  setLoading(true);
617
635
  const payload = {
@@ -838,7 +856,7 @@ import {
838
856
  Phone,
839
857
  PlayArrow as PlayArrow2,
840
858
  SupportAgent as SupportAgent2,
841
- TransferWithinAStation,
859
+ TransferWithinAStation as TransferWithinAStation2,
842
860
  Upcoming as Upcoming2,
843
861
  WifiCalling3,
844
862
  SendRounded,
@@ -875,6 +893,7 @@ import {
875
893
  PlayArrow,
876
894
  Roofing,
877
895
  SupportAgent,
896
+ TransferWithinAStation,
878
897
  Upcoming
879
898
  } from "@mui/icons-material";
880
899
  import {
@@ -1352,7 +1371,15 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
1352
1371
  placeholder: "Phone Number",
1353
1372
  fullWidth: true,
1354
1373
  value: (each == null ? void 0 : each.phone) || "",
1355
- disabled: (each == null ? void 0 : each.line) === 1 || ["ONCALL" /* ONCALL */, "DISCONNECTED" /* DISCONNECTED */, "CONFERENCE" /* CONFERENCE */, "HOLD" /* HOLD */, "MUTE" /* MUTE */, "DIALING" /* DIALING */, "RINGING" /* RINGING */].includes((_f = each == null ? void 0 : each.status) != null ? _f : "") || isLineDialing,
1374
+ disabled: (each == null ? void 0 : each.line) === 1 || [
1375
+ "ONCALL" /* ONCALL */,
1376
+ "DISCONNECTED" /* DISCONNECTED */,
1377
+ "CONFERENCE" /* CONFERENCE */,
1378
+ "HOLD" /* HOLD */,
1379
+ "MUTE" /* MUTE */,
1380
+ "DIALING" /* DIALING */,
1381
+ "RINGING" /* RINGING */
1382
+ ].includes((_f = each == null ? void 0 : each.status) != null ? _f : "") || isLineDialing,
1356
1383
  onChange: (e) => {
1357
1384
  onConferenceLineUpdate(each, { phone: e.target.value });
1358
1385
  }
@@ -1610,8 +1637,26 @@ function ConferenceDialog() {
1610
1637
  setConferenceCallEndAll(false);
1611
1638
  });
1612
1639
  };
1640
+ const handleTransferConferenceCall = () => {
1641
+ var _a3, _b2, _c, _d;
1642
+ const payload = {
1643
+ action: "TRANSFERAPI",
1644
+ userid: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b2 : "",
1645
+ process_name: (_d = (_c = state.callData) == null ? void 0 : _c.process_name) != null ? _d : ""
1646
+ };
1647
+ axios_default.post(END_POINT.CONFERENCE_CALL_TRANSFER, payload).then((res) => {
1648
+ var _a4;
1649
+ showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
1650
+ handleClose();
1651
+ }).catch((err) => {
1652
+ var _a4, _b3, _c2, _d2;
1653
+ const message = ((_b3 = (_a4 = err.response) == null ? void 0 : _a4.data) == null ? void 0 : _b3.detail) || ((_d2 = (_c2 = err.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || err.message || "An unknown error occurred";
1654
+ showToast(message, "error");
1655
+ }).finally(() => {
1656
+ setConferenceCallEndAll(false);
1657
+ });
1658
+ };
1613
1659
  const isLineDialing = (_a2 = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a2.some((item) => (item == null ? void 0 : item.status) === "DIALING" /* DIALING */);
1614
- console.log("dataaaaa", state == null ? void 0 : state.conferenceLine, isLineDialing);
1615
1660
  return /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(
1616
1661
  Dialog,
1617
1662
  {
@@ -1627,14 +1672,45 @@ function ConferenceDialog() {
1627
1672
  display: "flex",
1628
1673
  justifyContent: "space-between",
1629
1674
  alignItems: "center",
1630
- padding: "10px 16px"
1675
+ padding: "0px 16px",
1676
+ paddingBottom: "6px",
1677
+ boxShadow: "1px 1px 2px #e7e5e5ff",
1678
+ margin: "10px 0px"
1631
1679
  },
1632
1680
  children: [
1633
- /* @__PURE__ */ jsxs2(Typography, { variant: "body1", children: [
1634
- (_b = state == null ? void 0 : state.agentId) != null ? _b : "",
1635
- " conference"
1636
- ] }),
1637
- /* @__PURE__ */ jsx2(IconButton, { onClick: handleClose, children: /* @__PURE__ */ jsx2(Close, {}) })
1681
+ /* @__PURE__ */ jsxs2(
1682
+ Typography,
1683
+ {
1684
+ variant: "body1",
1685
+ color: "primary.main",
1686
+ sx: { textTransform: "uppercase", fontWeight: "bold", fontSize: "14px" },
1687
+ children: [
1688
+ (_b = state == null ? void 0 : state.agentId) != null ? _b : "",
1689
+ " conference"
1690
+ ]
1691
+ }
1692
+ ),
1693
+ /* @__PURE__ */ jsxs2(Box, { children: [
1694
+ /* @__PURE__ */ jsx2(
1695
+ Button,
1696
+ {
1697
+ color: "primary",
1698
+ variant: "outlined",
1699
+ onClick: handleTransferConferenceCall,
1700
+ disabled: conferenceCallEndAll,
1701
+ startIcon: /* @__PURE__ */ jsx2(TransferWithinAStation, {}),
1702
+ children: "Exit Conference"
1703
+ }
1704
+ ),
1705
+ /* @__PURE__ */ jsx2(
1706
+ IconButton,
1707
+ {
1708
+ onClick: handleClose,
1709
+ color: "primary",
1710
+ children: /* @__PURE__ */ jsx2(Close, { sx: { color: "primary.main" } })
1711
+ }
1712
+ )
1713
+ ] })
1638
1714
  ]
1639
1715
  }
1640
1716
  ),
@@ -1707,7 +1783,13 @@ function ConferenceDialog() {
1707
1783
  ]
1708
1784
  }
1709
1785
  ) }),
1710
- /* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(ConferenceTableRow, { each, isLineDialing })) })
1786
+ /* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(
1787
+ ConferenceTableRow,
1788
+ {
1789
+ each,
1790
+ isLineDialing
1791
+ }
1792
+ )) })
1711
1793
  ]
1712
1794
  }
1713
1795
  )
@@ -1799,7 +1881,10 @@ function CallTransferDialog({ open }) {
1799
1881
  const [getIdelAgentsList, { data: idleAgentsList, isLoading: isIdleAgentsListLoading }] = usePostRequest({
1800
1882
  disabledSuccessToast: true
1801
1883
  });
1802
- const [getHospitalsServicesList, { data: hospitalsServicesList, isLoading: isHospitalsServicesListLoading }] = useGetRequest({
1884
+ const [
1885
+ getHospitalsServicesList,
1886
+ { data: hospitalsServicesList, isLoading: isHospitalsServicesListLoading }
1887
+ ] = useGetRequest({
1803
1888
  disabledSuccessToast: true
1804
1889
  });
1805
1890
  const [
@@ -1853,7 +1938,6 @@ function CallTransferDialog({ open }) {
1853
1938
  callreferenceid: (_K = (_J = state.callData) == null ? void 0 : _J.convox_id) != null ? _K : "",
1854
1939
  blind_transfer_no: (_L = data == null ? void 0 : data.mobile_number) != null ? _L : ""
1855
1940
  };
1856
- console.log("payload", payload);
1857
1941
  blindTransferCall(END_POINT.BLIEND_TRANSFER, payload);
1858
1942
  }
1859
1943
  };
@@ -1962,274 +2046,230 @@ function CallTransferDialog({ open }) {
1962
2046
  ]
1963
2047
  }
1964
2048
  ),
1965
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "process" && /* @__PURE__ */ jsx2(Box, { sx: { display: "grid", gridTemplateColumns: ((_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) && ((_c = (_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) == null ? void 0 : _c.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: ((_d = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d.process) && ((_f = (_e = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _e.process) == null ? void 0 : _f.length) > 0 ? (_h = (_g = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _g.process) == null ? void 0 : _h.map((process, index) => /* @__PURE__ */ jsxs2(
2049
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "process" && /* @__PURE__ */ jsx2(
1966
2050
  Box,
1967
2051
  {
1968
2052
  sx: {
1969
- p: 1,
1970
- display: "flex",
1971
- alignItems: "center",
2053
+ display: "grid",
2054
+ gridTemplateColumns: ((_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) && ((_c = (_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) == null ? void 0 : _c.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
2055
+ gap: 1,
2056
+ padding: "10px",
2057
+ flexWrap: "wrap",
1972
2058
  boxShadow: "1px 1px 4px #d3d3d3ff",
1973
- padding: "6px",
1974
- borderRadius: "10px",
1975
- "&:hover": { bgcolor: "action.selected" }
1976
- },
1977
- children: [
1978
- /* @__PURE__ */ jsxs2(
1979
- Typography,
1980
- {
1981
- variant: "body1",
1982
- sx: {
1983
- mx: 1,
1984
- width: "200px",
1985
- maxWidth: "250px",
1986
- display: "flex",
1987
- alignItems: "center"
1988
- },
1989
- children: [
1990
- /* @__PURE__ */ jsx2(MemoryOutlined, { sx: { marginRight: "4px" } }),
1991
- process.process_name
1992
- ]
1993
- }
1994
- ),
1995
- /* @__PURE__ */ jsx2(
1996
- IconButton,
1997
- {
1998
- color: "success",
1999
- sx: {
2000
- bgcolor: "action.hover",
2001
- "&:hover": { bgcolor: "action.selected" }
2002
- },
2003
- onClick: () => {
2004
- handleTransferCall(process, "PROCESS");
2005
- },
2006
- children: /* @__PURE__ */ jsx2(Call, {})
2007
- }
2008
- )
2009
- ]
2010
- },
2011
- index
2012
- )) : /* @__PURE__ */ jsxs2(
2013
- Box,
2014
- {
2015
- sx: {
2016
- display: "flex",
2017
- alignItems: "center",
2018
- justifyContent: "center",
2019
- flexDirection: "column"
2059
+ borderRadius: "10px"
2020
2060
  },
2021
- p: 2,
2022
- children: [
2023
- /* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
2024
- /* @__PURE__ */ jsx2(
2025
- Typography,
2026
- {
2027
- variant: "body1",
2028
- sx: {
2029
- fontSize: "16px",
2030
- letterSpacing: "0.02em",
2031
- textTransform: "capitalize",
2032
- display: "flex",
2033
- alignItems: "center",
2034
- justifyContent: "center",
2035
- width: "100%",
2036
- margin: "10px 0px",
2037
- color: "primary.main",
2038
- height: "20px"
2039
- },
2040
- children: "No Process Found"
2041
- }
2042
- )
2043
- ]
2044
- }
2045
- ) }),
2046
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "queues" && /* @__PURE__ */ jsx2(Box, { sx: { display: "grid", gridTemplateColumns: ((_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.queue) && ((_k = (_j = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _j.queue) == null ? void 0 : _k.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: ((_l = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _l.queue) && ((_n = (_m = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _m.queue) == null ? void 0 : _n.length) > 0 ? (_p = (_o = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _o.queue) == null ? void 0 : _p.map((queue, index) => {
2047
- var _a3, _b2, _c2, _d2, _e2, _f2;
2048
- return /* @__PURE__ */ jsxs2(
2049
- Box,
2050
- {
2051
- sx: {
2052
- p: 1,
2053
- display: "flex",
2054
- alignItems: "center",
2055
- boxShadow: "1px 1px 4px #d3d3d3ff",
2056
- padding: "6px",
2057
- borderRadius: "10px",
2058
- "&:hover": { bgcolor: "action.selected" }
2061
+ children: ((_d = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d.process) && ((_f = (_e = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _e.process) == null ? void 0 : _f.length) > 0 ? (_h = (_g = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _g.process) == null ? void 0 : _h.map((process, index) => /* @__PURE__ */ jsxs2(
2062
+ Box,
2063
+ {
2064
+ sx: {
2065
+ p: 1,
2066
+ display: "flex",
2067
+ alignItems: "center",
2068
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2069
+ padding: "6px",
2070
+ borderRadius: "10px",
2071
+ "&:hover": { bgcolor: "action.selected" }
2072
+ },
2073
+ children: [
2074
+ /* @__PURE__ */ jsxs2(
2075
+ Typography,
2076
+ {
2077
+ variant: "body1",
2078
+ sx: {
2079
+ mx: 1,
2080
+ width: "200px",
2081
+ maxWidth: "250px",
2082
+ display: "flex",
2083
+ alignItems: "center"
2084
+ },
2085
+ children: [
2086
+ /* @__PURE__ */ jsx2(MemoryOutlined, { sx: { marginRight: "4px" } }),
2087
+ process.process_name
2088
+ ]
2089
+ }
2090
+ ),
2091
+ /* @__PURE__ */ jsx2(
2092
+ IconButton,
2093
+ {
2094
+ color: "success",
2095
+ sx: {
2096
+ bgcolor: "action.hover",
2097
+ "&:hover": { bgcolor: "action.selected" }
2098
+ },
2099
+ onClick: () => {
2100
+ handleTransferCall(process, "PROCESS");
2101
+ },
2102
+ children: /* @__PURE__ */ jsx2(Call, {})
2103
+ }
2104
+ )
2105
+ ]
2059
2106
  },
2060
- children: [
2061
- /* @__PURE__ */ jsxs2(
2062
- Typography,
2063
- {
2064
- variant: "body1",
2065
- sx: {
2066
- mx: 1,
2067
- width: "200px",
2068
- maxWidth: "250px",
2069
- display: "flex",
2070
- alignItems: "center"
2071
- },
2072
- children: [
2073
- /* @__PURE__ */ jsx2(Airlines, { sx: { marginRight: "4px" } }),
2074
- queue.queue_name,
2075
- ((_c2 = (_b2 = (_a3 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a3.process) == null ? void 0 : _b2.find(
2076
- (process) => process.process_id === queue.process_id
2077
- )) == null ? void 0 : _c2.process_name) ? /* @__PURE__ */ jsx2(
2078
- Typography,
2079
- {
2080
- variant: "body1",
2081
- sx: {
2082
- fontSize: "12px",
2083
- fontWeight: "600",
2084
- letterSpacing: "0.02em",
2085
- textTransform: "capitalize",
2086
- color: "gray"
2087
- },
2088
- children: "(" + ((_f2 = (_e2 = (_d2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d2.process) == null ? void 0 : _e2.find(
2089
- (process) => process.process_id === queue.process_id
2090
- )) == null ? void 0 : _f2.process_name) + ")"
2091
- }
2092
- ) : ""
2093
- ]
2094
- }
2095
- ),
2096
- /* @__PURE__ */ jsx2(
2097
- IconButton,
2098
- {
2099
- color: "success",
2100
- sx: {
2101
- bgcolor: "action.hover",
2102
- "&:hover": { bgcolor: "action.selected" }
2103
- },
2104
- onClick: () => {
2105
- handleTransferCall(queue, "QUEUE");
2106
- },
2107
- children: /* @__PURE__ */ jsx2(Call, {})
2108
- }
2109
- )
2110
- ]
2111
- },
2112
- index
2113
- );
2114
- }) : /* @__PURE__ */ jsxs2(
2115
- Box,
2116
- {
2117
- sx: {
2118
- display: "flex",
2119
- alignItems: "center",
2120
- justifyContent: "center",
2121
- flexDirection: "column"
2122
- },
2123
- p: 2,
2124
- children: [
2125
- /* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
2126
- /* @__PURE__ */ jsx2(
2127
- Typography,
2128
- {
2129
- variant: "body1",
2130
- sx: {
2131
- fontSize: "16px",
2132
- letterSpacing: "0.02em",
2133
- textTransform: "capitalize",
2134
- display: "flex",
2135
- alignItems: "center",
2136
- justifyContent: "center",
2137
- width: "100%",
2138
- margin: "10px 0px",
2139
- color: "primary.main",
2140
- height: "20px"
2141
- },
2142
- children: "No Queues Found"
2143
- }
2144
- )
2145
- ]
2107
+ index
2108
+ )) : /* @__PURE__ */ jsxs2(
2109
+ Box,
2110
+ {
2111
+ sx: {
2112
+ display: "flex",
2113
+ alignItems: "center",
2114
+ justifyContent: "center",
2115
+ flexDirection: "column"
2116
+ },
2117
+ p: 2,
2118
+ children: [
2119
+ /* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
2120
+ /* @__PURE__ */ jsx2(
2121
+ Typography,
2122
+ {
2123
+ variant: "body1",
2124
+ sx: {
2125
+ fontSize: "16px",
2126
+ letterSpacing: "0.02em",
2127
+ textTransform: "capitalize",
2128
+ display: "flex",
2129
+ alignItems: "center",
2130
+ justifyContent: "center",
2131
+ width: "100%",
2132
+ margin: "10px 0px",
2133
+ color: "primary.main",
2134
+ height: "20px"
2135
+ },
2136
+ children: "No Process Found"
2137
+ }
2138
+ )
2139
+ ]
2140
+ }
2141
+ )
2146
2142
  }
2147
- ) }),
2148
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "agents" && /* @__PURE__ */ jsx2(Box, { sx: { display: "grid", gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_q = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _q.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_r = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _r.length) > 0 ? (_s = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _s.map((agent, index) => /* @__PURE__ */ jsxs2(
2143
+ ),
2144
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "queues" && /* @__PURE__ */ jsx2(
2149
2145
  Box,
2150
2146
  {
2151
2147
  sx: {
2152
- p: 1,
2153
- display: "flex",
2154
- alignItems: "center",
2148
+ display: "grid",
2149
+ gridTemplateColumns: ((_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.queue) && ((_k = (_j = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _j.queue) == null ? void 0 : _k.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
2150
+ gap: 1,
2151
+ padding: "10px",
2152
+ flexWrap: "wrap",
2155
2153
  boxShadow: "1px 1px 4px #d3d3d3ff",
2156
- padding: "6px",
2157
- borderRadius: "10px",
2158
- "&:hover": { bgcolor: "action.selected" }
2154
+ borderRadius: "10px"
2159
2155
  },
2160
- children: [
2161
- /* @__PURE__ */ jsxs2(
2162
- Typography,
2156
+ children: ((_l = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _l.queue) && ((_n = (_m = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _m.queue) == null ? void 0 : _n.length) > 0 ? (_p = (_o = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _o.queue) == null ? void 0 : _p.map((queue, index) => {
2157
+ var _a3, _b2, _c2, _d2, _e2, _f2;
2158
+ return /* @__PURE__ */ jsxs2(
2159
+ Box,
2163
2160
  {
2164
- variant: "body1",
2165
2161
  sx: {
2166
- mx: 1,
2167
- width: "200px",
2168
- maxWidth: "250px",
2162
+ p: 1,
2169
2163
  display: "flex",
2170
- alignItems: "center"
2164
+ alignItems: "center",
2165
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2166
+ padding: "6px",
2167
+ borderRadius: "10px",
2168
+ "&:hover": { bgcolor: "action.selected" }
2171
2169
  },
2172
2170
  children: [
2173
- /* @__PURE__ */ jsx2(SupportAgent, { sx: { marginRight: "4px" } }),
2174
- agent.name
2171
+ /* @__PURE__ */ jsxs2(
2172
+ Typography,
2173
+ {
2174
+ variant: "body1",
2175
+ sx: {
2176
+ mx: 1,
2177
+ width: "200px",
2178
+ maxWidth: "250px",
2179
+ display: "flex",
2180
+ alignItems: "center"
2181
+ },
2182
+ children: [
2183
+ /* @__PURE__ */ jsx2(Airlines, { sx: { marginRight: "4px" } }),
2184
+ queue.queue_name,
2185
+ ((_c2 = (_b2 = (_a3 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a3.process) == null ? void 0 : _b2.find(
2186
+ (process) => process.process_id === queue.process_id
2187
+ )) == null ? void 0 : _c2.process_name) ? /* @__PURE__ */ jsx2(
2188
+ Typography,
2189
+ {
2190
+ variant: "body1",
2191
+ sx: {
2192
+ fontSize: "12px",
2193
+ fontWeight: "600",
2194
+ letterSpacing: "0.02em",
2195
+ textTransform: "capitalize",
2196
+ color: "gray"
2197
+ },
2198
+ children: "(" + ((_f2 = (_e2 = (_d2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d2.process) == null ? void 0 : _e2.find(
2199
+ (process) => process.process_id === queue.process_id
2200
+ )) == null ? void 0 : _f2.process_name) + ")"
2201
+ }
2202
+ ) : ""
2203
+ ]
2204
+ }
2205
+ ),
2206
+ /* @__PURE__ */ jsx2(
2207
+ IconButton,
2208
+ {
2209
+ color: "success",
2210
+ sx: {
2211
+ bgcolor: "action.hover",
2212
+ "&:hover": { bgcolor: "action.selected" }
2213
+ },
2214
+ onClick: () => {
2215
+ handleTransferCall(queue, "QUEUE");
2216
+ },
2217
+ children: /* @__PURE__ */ jsx2(Call, {})
2218
+ }
2219
+ )
2175
2220
  ]
2176
- }
2177
- ),
2178
- /* @__PURE__ */ jsx2(
2179
- IconButton,
2180
- {
2181
- color: "success",
2182
- sx: {
2183
- bgcolor: "action.hover",
2184
- "&:hover": { bgcolor: "action.selected" }
2185
- },
2186
- onClick: () => {
2187
- handleTransferCall(agent, "AGENT");
2188
- },
2189
- children: /* @__PURE__ */ jsx2(Call, {})
2190
- }
2191
- )
2192
- ]
2193
- },
2194
- index
2195
- )) : /* @__PURE__ */ jsxs2(
2221
+ },
2222
+ index
2223
+ );
2224
+ }) : /* @__PURE__ */ jsxs2(
2225
+ Box,
2226
+ {
2227
+ sx: {
2228
+ display: "flex",
2229
+ alignItems: "center",
2230
+ justifyContent: "center",
2231
+ flexDirection: "column"
2232
+ },
2233
+ p: 2,
2234
+ children: [
2235
+ /* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
2236
+ /* @__PURE__ */ jsx2(
2237
+ Typography,
2238
+ {
2239
+ variant: "body1",
2240
+ sx: {
2241
+ fontSize: "16px",
2242
+ letterSpacing: "0.02em",
2243
+ textTransform: "capitalize",
2244
+ display: "flex",
2245
+ alignItems: "center",
2246
+ justifyContent: "center",
2247
+ width: "100%",
2248
+ margin: "10px 0px",
2249
+ color: "primary.main",
2250
+ height: "20px"
2251
+ },
2252
+ children: "No Queues Found"
2253
+ }
2254
+ )
2255
+ ]
2256
+ }
2257
+ )
2258
+ }
2259
+ ),
2260
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "agents" && /* @__PURE__ */ jsx2(
2196
2261
  Box,
2197
2262
  {
2198
2263
  sx: {
2199
- display: "flex",
2200
- alignItems: "center",
2201
- justifyContent: "center",
2202
- flexDirection: "column"
2264
+ display: "grid",
2265
+ gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_q = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _q.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
2266
+ gap: 1,
2267
+ padding: "10px",
2268
+ flexWrap: "wrap",
2269
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2270
+ borderRadius: "10px"
2203
2271
  },
2204
- p: 2,
2205
- children: [
2206
- /* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
2207
- /* @__PURE__ */ jsx2(
2208
- Typography,
2209
- {
2210
- variant: "body1",
2211
- sx: {
2212
- fontSize: "16px",
2213
- letterSpacing: "0.02em",
2214
- textTransform: "capitalize",
2215
- display: "flex",
2216
- alignItems: "center",
2217
- justifyContent: "center",
2218
- width: "100%",
2219
- margin: "10px 0px",
2220
- color: "primary.main",
2221
- height: "20px"
2222
- },
2223
- children: "No Agents Found"
2224
- }
2225
- )
2226
- ]
2227
- }
2228
- ) }),
2229
- !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "others" && /* @__PURE__ */ jsxs2(Box, { sx: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: [
2230
- (hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_t = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _t.length) > 0 && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.map((service, index) => {
2231
- var _a3, _b2, _c2;
2232
- return /* @__PURE__ */ jsxs2(
2272
+ children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_r = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _r.length) > 0 ? (_s = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _s.map((agent, index) => /* @__PURE__ */ jsxs2(
2233
2273
  Box,
2234
2274
  {
2235
2275
  sx: {
@@ -2254,25 +2294,12 @@ function CallTransferDialog({ open }) {
2254
2294
  alignItems: "center"
2255
2295
  },
2256
2296
  children: [
2257
- /* @__PURE__ */ jsx2(Roofing, { sx: { marginRight: "4px" } }),
2258
- /* @__PURE__ */ jsx2(Tooltip, { title: `${(_a3 = service == null ? void 0 : service.description) != null ? _a3 : ""}`, children: /* @__PURE__ */ jsxs2(Box, { sx: { color: "text.secondary" }, children: [
2259
- service.name,
2260
- /* @__PURE__ */ jsx2(Box, { sx: {
2261
- fontSize: "9px",
2262
- fontWeight: "600",
2263
- letterSpacing: "0.02em",
2264
- textTransform: "capitalize",
2265
- color: "gray",
2266
- textOverflow: "ellipsis",
2267
- whiteSpace: "nowrap",
2268
- overflow: "hidden",
2269
- maxWidth: "160px"
2270
- }, children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : "" })
2271
- ] }) })
2297
+ /* @__PURE__ */ jsx2(SupportAgent, { sx: { marginRight: "4px" } }),
2298
+ agent.name
2272
2299
  ]
2273
2300
  }
2274
2301
  ),
2275
- /* @__PURE__ */ jsx2(Tooltip, { title: (_c2 = service == null ? void 0 : service.phone_number) != null ? _c2 : "", children: /* @__PURE__ */ jsx2(
2302
+ /* @__PURE__ */ jsx2(
2276
2303
  IconButton,
2277
2304
  {
2278
2305
  color: "success",
@@ -2281,89 +2308,220 @@ function CallTransferDialog({ open }) {
2281
2308
  "&:hover": { bgcolor: "action.selected" }
2282
2309
  },
2283
2310
  onClick: () => {
2284
- var _a4;
2285
- handleTransferCall({
2286
- mobile_number: (_a4 = service == null ? void 0 : service.phone_number) != null ? _a4 : ""
2287
- }, "OTHER");
2311
+ handleTransferCall(agent, "AGENT");
2288
2312
  },
2289
2313
  children: /* @__PURE__ */ jsx2(Call, {})
2290
2314
  }
2291
- ) })
2315
+ )
2292
2316
  ]
2293
2317
  },
2294
2318
  index
2295
- );
2296
- })),
2297
- /* @__PURE__ */ jsxs2(
2298
- Box,
2299
- {
2300
- sx: {
2301
- p: 1,
2302
- display: "flex",
2303
- alignItems: "center",
2304
- boxShadow: "1px 1px 4px #d3d3d3ff",
2305
- padding: "6px",
2306
- borderRadius: "10px"
2307
- },
2308
- children: [
2309
- /* @__PURE__ */ jsx2(
2310
- Typography,
2319
+ )) : /* @__PURE__ */ jsxs2(
2320
+ Box,
2321
+ {
2322
+ sx: {
2323
+ display: "flex",
2324
+ alignItems: "center",
2325
+ justifyContent: "center",
2326
+ flexDirection: "column"
2327
+ },
2328
+ p: 2,
2329
+ children: [
2330
+ /* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
2331
+ /* @__PURE__ */ jsx2(
2332
+ Typography,
2333
+ {
2334
+ variant: "body1",
2335
+ sx: {
2336
+ fontSize: "16px",
2337
+ letterSpacing: "0.02em",
2338
+ textTransform: "capitalize",
2339
+ display: "flex",
2340
+ alignItems: "center",
2341
+ justifyContent: "center",
2342
+ width: "100%",
2343
+ margin: "10px 0px",
2344
+ color: "primary.main",
2345
+ height: "20px"
2346
+ },
2347
+ children: "No Agents Found"
2348
+ }
2349
+ )
2350
+ ]
2351
+ }
2352
+ )
2353
+ }
2354
+ ),
2355
+ !isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "others" && /* @__PURE__ */ jsxs2(
2356
+ Box,
2357
+ {
2358
+ sx: {
2359
+ display: "grid",
2360
+ gridTemplateColumns: "repeat(2, 1fr)",
2361
+ gap: 1,
2362
+ padding: "10px",
2363
+ flexWrap: "wrap",
2364
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2365
+ borderRadius: "10px"
2366
+ },
2367
+ children: [
2368
+ (hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_t = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _t.length) > 0 && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.map((service, index) => {
2369
+ var _a3, _b2, _c2;
2370
+ return /* @__PURE__ */ jsxs2(
2371
+ Box,
2311
2372
  {
2312
- variant: "body1",
2313
2373
  sx: {
2314
- mx: 1,
2315
- width: "200px",
2316
- maxWidth: "250px",
2374
+ p: 1,
2317
2375
  display: "flex",
2318
- alignItems: "center"
2376
+ alignItems: "center",
2377
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2378
+ padding: "6px",
2379
+ borderRadius: "10px",
2380
+ "&:hover": { bgcolor: "action.selected" }
2319
2381
  },
2320
- children: /* @__PURE__ */ jsx2(
2321
- TextField,
2382
+ children: [
2383
+ /* @__PURE__ */ jsxs2(
2384
+ Typography,
2385
+ {
2386
+ variant: "body1",
2387
+ sx: {
2388
+ mx: 1,
2389
+ width: "200px",
2390
+ maxWidth: "250px",
2391
+ display: "flex",
2392
+ alignItems: "center"
2393
+ },
2394
+ children: [
2395
+ /* @__PURE__ */ jsx2(Roofing, { sx: { marginRight: "4px" } }),
2396
+ /* @__PURE__ */ jsx2(Tooltip, { title: `${(_a3 = service == null ? void 0 : service.description) != null ? _a3 : ""}`, children: /* @__PURE__ */ jsxs2(Box, { sx: { color: "text.secondary" }, children: [
2397
+ service.name,
2398
+ /* @__PURE__ */ jsx2(
2399
+ Box,
2400
+ {
2401
+ sx: {
2402
+ fontSize: "9px",
2403
+ fontWeight: "600",
2404
+ letterSpacing: "0.02em",
2405
+ textTransform: "capitalize",
2406
+ color: "gray",
2407
+ textOverflow: "ellipsis",
2408
+ whiteSpace: "nowrap",
2409
+ overflow: "hidden",
2410
+ maxWidth: "160px"
2411
+ },
2412
+ children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : ""
2413
+ }
2414
+ )
2415
+ ] }) })
2416
+ ]
2417
+ }
2418
+ ),
2419
+ /* @__PURE__ */ jsx2(Tooltip, { title: (_c2 = service == null ? void 0 : service.phone_number) != null ? _c2 : "", children: /* @__PURE__ */ jsx2(
2420
+ IconButton,
2421
+ {
2422
+ color: "success",
2423
+ sx: {
2424
+ bgcolor: "action.hover",
2425
+ "&:hover": { bgcolor: "action.selected" }
2426
+ },
2427
+ onClick: () => {
2428
+ var _a4;
2429
+ handleTransferCall(
2430
+ {
2431
+ mobile_number: (_a4 = service == null ? void 0 : service.phone_number) != null ? _a4 : ""
2432
+ },
2433
+ "OTHER"
2434
+ );
2435
+ },
2436
+ children: /* @__PURE__ */ jsx2(Call, {})
2437
+ }
2438
+ ) })
2439
+ ]
2440
+ },
2441
+ index
2442
+ );
2443
+ })),
2444
+ /* @__PURE__ */ jsxs2(
2445
+ Box,
2446
+ {
2447
+ sx: {
2448
+ p: 1,
2449
+ display: "flex",
2450
+ alignItems: "center",
2451
+ boxShadow: "1px 1px 4px #d3d3d3ff",
2452
+ padding: "6px",
2453
+ borderRadius: "10px"
2454
+ },
2455
+ children: [
2456
+ /* @__PURE__ */ jsx2(
2457
+ Typography,
2322
2458
  {
2323
- size: "small",
2324
- name: "others",
2325
- label: "Mobile number",
2326
- variant: "outlined",
2327
- type: "tel",
2328
- value: mobileNumber,
2329
- onChange: (e) => {
2330
- const v = e.target.value;
2331
- if (/^\d*$/.test(v)) {
2332
- setMobileNumber(v);
2333
- }
2459
+ variant: "body1",
2460
+ sx: {
2461
+ mx: 1,
2462
+ width: "200px",
2463
+ maxWidth: "250px",
2464
+ display: "flex",
2465
+ alignItems: "center"
2334
2466
  },
2335
- slotProps: {
2336
- htmlInput: {
2337
- inputMode: "numeric",
2338
- maxLength: 11
2467
+ children: /* @__PURE__ */ jsx2(
2468
+ TextField,
2469
+ {
2470
+ size: "small",
2471
+ name: "others",
2472
+ label: "Mobile number",
2473
+ variant: "outlined",
2474
+ type: "tel",
2475
+ value: mobileNumber,
2476
+ onChange: (e) => {
2477
+ const v = e.target.value;
2478
+ if (/^\d*$/.test(v)) {
2479
+ setMobileNumber(v);
2480
+ }
2481
+ },
2482
+ slotProps: {
2483
+ htmlInput: {
2484
+ inputMode: "numeric",
2485
+ maxLength: 11
2486
+ }
2487
+ },
2488
+ placeholder: "Enter mobile number",
2489
+ autoComplete: "off"
2339
2490
  }
2340
- },
2341
- placeholder: "Enter mobile number",
2342
- autoComplete: "off"
2491
+ )
2492
+ }
2493
+ ),
2494
+ /* @__PURE__ */ jsx2(
2495
+ Tooltip,
2496
+ {
2497
+ title: mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number",
2498
+ children: /* @__PURE__ */ jsx2(
2499
+ IconButton,
2500
+ {
2501
+ color: "success",
2502
+ sx: {
2503
+ bgcolor: "action.hover",
2504
+ "&:hover": { bgcolor: "action.selected" }
2505
+ },
2506
+ onClick: () => {
2507
+ handleTransferCall(
2508
+ {
2509
+ mobile_number: mobileNumber != null ? mobileNumber : ""
2510
+ },
2511
+ "OTHER"
2512
+ );
2513
+ },
2514
+ children: /* @__PURE__ */ jsx2(Call, {})
2515
+ }
2516
+ )
2343
2517
  }
2344
2518
  )
2345
- }
2346
- ),
2347
- /* @__PURE__ */ jsx2(Tooltip, { title: mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number", children: /* @__PURE__ */ jsx2(
2348
- IconButton,
2349
- {
2350
- color: "success",
2351
- sx: {
2352
- bgcolor: "action.hover",
2353
- "&:hover": { bgcolor: "action.selected" }
2354
- },
2355
- onClick: () => {
2356
- handleTransferCall({
2357
- mobile_number: mobileNumber != null ? mobileNumber : ""
2358
- }, "OTHER");
2359
- },
2360
- children: /* @__PURE__ */ jsx2(Call, {})
2361
- }
2362
- ) })
2363
- ]
2364
- }
2365
- )
2366
- ] })
2519
+ ]
2520
+ }
2521
+ )
2522
+ ]
2523
+ }
2524
+ )
2367
2525
  ]
2368
2526
  }
2369
2527
  )
@@ -2507,29 +2665,36 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
2507
2665
  gap: 2,
2508
2666
  mt: 2,
2509
2667
  children: [
2510
- /* @__PURE__ */ jsxs2(Box, { sx: {
2511
- flex: "1",
2512
- border: "1px solid #bdbdbd",
2513
- borderRadius: "5px"
2514
- }, children: [
2515
- /* @__PURE__ */ jsx2(
2516
- Checkbox,
2517
- {
2518
- name: "selected_break",
2519
- sx: {
2520
- padding: "6px"
2521
- },
2522
- checked: formData.selected_break,
2523
- onChange: (event) => {
2524
- handleChange("selected_break", event.target.checked);
2525
- },
2526
- slotProps: {
2527
- input: { "aria-label": "controlled" }
2528
- }
2529
- }
2530
- ),
2531
- " Mark as break"
2532
- ] }),
2668
+ /* @__PURE__ */ jsxs2(
2669
+ Box,
2670
+ {
2671
+ sx: {
2672
+ flex: "1",
2673
+ border: "1px solid #bdbdbd",
2674
+ borderRadius: "5px"
2675
+ },
2676
+ children: [
2677
+ /* @__PURE__ */ jsx2(
2678
+ Checkbox,
2679
+ {
2680
+ name: "selected_break",
2681
+ sx: {
2682
+ padding: "6px"
2683
+ },
2684
+ checked: formData.selected_break,
2685
+ onChange: (event) => {
2686
+ handleChange("selected_break", event.target.checked);
2687
+ },
2688
+ slotProps: {
2689
+ input: { "aria-label": "controlled" }
2690
+ }
2691
+ }
2692
+ ),
2693
+ " ",
2694
+ "Mark as break"
2695
+ ]
2696
+ }
2697
+ ),
2533
2698
  ((_c = (_b = formData == null ? void 0 : formData.followUp) == null ? void 0 : _b.label) == null ? void 0 : _c.toLowerCase()) === "yes" ? /* @__PURE__ */ jsx2(
2534
2699
  TextField,
2535
2700
  {
@@ -2946,6 +3111,8 @@ function CallControls({ onDataChange }) {
2946
3111
  const reconnectTimeoutRef = useRef2(null);
2947
3112
  const pingIntervalRef = useRef2(null);
2948
3113
  const reconnectAttemptsRef = useRef2(0);
3114
+ const hasFlashedRef = useRef2(false);
3115
+ const lastEventTimeRef = useRef2(null);
2949
3116
  const maxReconnectAttempts = 60;
2950
3117
  const baseReconnectDelay = 2e3;
2951
3118
  const maxReconnectDelay = 3e4;
@@ -3272,7 +3439,7 @@ function CallControls({ onDataChange }) {
3272
3439
  }, 3e4);
3273
3440
  };
3274
3441
  webSocketRef.current.onmessage = (event) => {
3275
- var _a3, _b2;
3442
+ var _a3, _b2, _c2, _d2;
3276
3443
  try {
3277
3444
  const data = JSON.parse(event.data);
3278
3445
  if (data.type === "pong") {
@@ -3352,13 +3519,40 @@ function CallControls({ onDataChange }) {
3352
3519
  }
3353
3520
  ]);
3354
3521
  }
3355
- if (data.status === "ONCALL" /* ONCALL */) {
3522
+ if (data.status === "IDLE" /* IDLE */) {
3523
+ USB_LIGHT_REQUEST(USB_LIGHT_ON("green"));
3524
+ } else if ((data == null ? void 0 : data.mute) !== 1 && (data == null ? void 0 : data.hold) !== 1 && data.status === "ONCALL" /* ONCALL */) {
3525
+ USB_LIGHT_REQUEST(USB_LIGHT_ON("red"));
3356
3526
  sdkStateManager.startCall();
3357
3527
  if (!showIframe) {
3358
3528
  setShowIframe(true);
3359
3529
  }
3360
- }
3361
- if (data.status === "WRAPUP" /* WRAPUP */) {
3530
+ } else if (((data == null ? void 0 : data.mute) === 1 || (data == null ? void 0 : data.hold) === 1) && data.status === "ONCALL" /* ONCALL */) {
3531
+ USB_LIGHT_REQUEST(USB_LIGHT_FLASH("red", 1));
3532
+ } else if (data.status === "BREAK" /* BREAK */) {
3533
+ const breakTime = (_c2 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _c2.break_time;
3534
+ const eventTime = (_d2 = data == null ? void 0 : data.event_time) != null ? _d2 : null;
3535
+ if (eventTime !== lastEventTimeRef.current) {
3536
+ hasFlashedRef.current = false;
3537
+ lastEventTimeRef.current = eventTime;
3538
+ }
3539
+ let isOverLimit = false;
3540
+ if (breakTime && eventTime) {
3541
+ const differenceInMinutes = ((/* @__PURE__ */ new Date()).getTime() - new Date(eventTime).getTime()) / 6e4;
3542
+ if (Number(differenceInMinutes.toFixed(0)) >= Number(breakTime)) {
3543
+ isOverLimit = true;
3544
+ }
3545
+ }
3546
+ if (isOverLimit) {
3547
+ if (!hasFlashedRef.current) {
3548
+ USB_LIGHT_REQUEST(USB_LIGHT_FLASH("yellow", 1));
3549
+ hasFlashedRef.current = true;
3550
+ }
3551
+ } else {
3552
+ USB_LIGHT_REQUEST(USB_LIGHT_ON("yellow"));
3553
+ }
3554
+ } else if (data.status === "WRAPUP" /* WRAPUP */) {
3555
+ USB_LIGHT_REQUEST(USB_LIGHT_FLASH("green", 1));
3362
3556
  sdkStateManager.endCall();
3363
3557
  }
3364
3558
  } catch (e) {
@@ -3685,7 +3879,7 @@ function CallControls({ onDataChange }) {
3685
3879
  },
3686
3880
  sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
3687
3881
  disabled: ((_ca = (_ba = state.callData) == null ? void 0 : _ba.status) == null ? void 0 : _ca.toUpperCase()) !== "ONCALL" /* ONCALL */,
3688
- children: /* @__PURE__ */ jsx3(TransferWithinAStation, {})
3882
+ children: /* @__PURE__ */ jsx3(TransferWithinAStation2, {})
3689
3883
  }
3690
3884
  ) }),
3691
3885
  !((_da = state.sdkConfig) == null ? void 0 : _da.disableConferenceButton) && /* @__PURE__ */ jsx3(Tooltip2, { title: "Conference Call", children: /* @__PURE__ */ jsx3(