call-control-sdk 6.4.9 → 6.4.10-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
21
 
22
22
  // call-control-sdk/lib/services/endPoint.ts
23
- var IP = "cti.aighospitals.com";
23
+ var IP = "uat-cti.aighospitals.com";
24
24
  var BASE_URL = `https://${IP}:8095`;
25
25
  var WS_BASE_URL = `wss://${IP}:8095`;
26
26
  var VERSION = {
@@ -1435,7 +1435,7 @@ var styles_default = useStyles;
1435
1435
  // call-control-sdk/lib/components/dialog.tsx
1436
1436
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1437
1437
  var ConferenceTableRow = ({ each }) => {
1438
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
1438
+ var _a2, _b, _c, _d, _e;
1439
1439
  const state = useSDKState();
1440
1440
  const { showToast } = useToast();
1441
1441
  const { disabled, enabled, outlined } = styles_default({
@@ -1488,8 +1488,14 @@ var ConferenceTableRow = ({ each }) => {
1488
1488
  process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : ""
1489
1489
  };
1490
1490
  axios_default.post(END_POINT.CONFERENCE_CALL, payload).then((res) => {
1491
- var _a4;
1492
- showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
1491
+ var _a4, _b3, _c3;
1492
+ if (((_a4 = state.callData) == null ? void 0 : _a4.hold) === 1) {
1493
+ handleHoldToggle();
1494
+ }
1495
+ if (((_b3 = state.callData) == null ? void 0 : _b3.mute) === 1) {
1496
+ handleMuteToggle();
1497
+ }
1498
+ showToast((_c3 = res.data) == null ? void 0 : _c3.message, "success");
1493
1499
  sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
1494
1500
  }).catch((err) => {
1495
1501
  var _a4, _b3, _c3, _d3;
@@ -1547,7 +1553,7 @@ var ConferenceTableRow = ({ each }) => {
1547
1553
  setConferenceCallEnd(false);
1548
1554
  });
1549
1555
  };
1550
- const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
1556
+ const [holdOrUnHold] = usePostRequest({
1551
1557
  onSuccess: () => {
1552
1558
  sdkStateManager.setHolding(!state.isHolding);
1553
1559
  },
@@ -1555,7 +1561,7 @@ var ConferenceTableRow = ({ each }) => {
1555
1561
  console.log("\u274C Hold operation error:", error);
1556
1562
  }
1557
1563
  });
1558
- const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
1564
+ const [muteOrUnMute] = usePostRequest({
1559
1565
  onSuccess: () => {
1560
1566
  sdkStateManager.setMuted(!state.isMuted);
1561
1567
  },
@@ -1606,7 +1612,7 @@ var ConferenceTableRow = ({ each }) => {
1606
1612
  {
1607
1613
  sx: {
1608
1614
  padding: "6px",
1609
- width: "100px"
1615
+ width: "150px"
1610
1616
  },
1611
1617
  children: /* @__PURE__ */ jsx2(
1612
1618
  Typography,
@@ -1615,7 +1621,7 @@ var ConferenceTableRow = ({ each }) => {
1615
1621
  sx: {
1616
1622
  px: 1,
1617
1623
  borderRadius: "10px",
1618
- flex: 1
1624
+ width: "150px"
1619
1625
  },
1620
1626
  children: (_e = each == null ? void 0 : each.status) != null ? _e : ""
1621
1627
  }
@@ -1663,17 +1669,20 @@ var ConferenceTableRow = ({ each }) => {
1663
1669
  gap: "10px"
1664
1670
  },
1665
1671
  children: [
1666
- (each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ jsx2(Tooltip, { title: ((_f = state.callData) == null ? void 0 : _f.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ jsx2(
1672
+ (each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ jsx2(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Resume", children: /* @__PURE__ */ jsx2(
1667
1673
  Button,
1668
1674
  {
1669
- variant: ((_g = state.callData) == null ? void 0 : _g.hold) === 1 && ((_i = (_h = state.callData) == null ? void 0 : _h.status) == null ? void 0 : _i.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
1670
- onClick: (e) => {
1671
- e.stopPropagation();
1672
- handleHoldToggle();
1675
+ variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
1676
+ sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
1677
+ onClick: () => {
1678
+ if (each.status === "HOLD") {
1679
+ onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
1680
+ } else {
1681
+ onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
1682
+ }
1673
1683
  },
1674
- sx: ((_j = state.callData) == null ? void 0 : _j.hold) === 1 && ((_l = (_k = state.callData) == null ? void 0 : _k.status) == null ? void 0 : _l.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_n = (_m = state.callData) == null ? void 0 : _m.status) == null ? void 0 : _n.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
1675
- disabled: ((_p = (_o = state.callData) == null ? void 0 : _o.status) == null ? void 0 : _p.toUpperCase()) !== "ONCALL" && ((_q = state.callData) == null ? void 0 : _q.hold) !== 1 || holdOrUnHoldLoading,
1676
- children: ((_r = state.callData) == null ? void 0 : _r.hold) === 1 ? /* @__PURE__ */ jsxs2(
1684
+ disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || conferenceCallHoldOrUnHold,
1685
+ children: each.status === "HOLD" ? /* @__PURE__ */ jsxs2(
1677
1686
  Box,
1678
1687
  {
1679
1688
  sx: {
@@ -1690,12 +1699,12 @@ var ConferenceTableRow = ({ each }) => {
1690
1699
  variant: "body2",
1691
1700
  sx: {
1692
1701
  fontSize: "12px",
1693
- color: ((_s = state.callData) == null ? void 0 : _s.hold) === 1 ? "#fff" : "initial"
1702
+ color: each.status === "HOLD" ? "#fff" : "initial"
1694
1703
  },
1695
1704
  children: "Unhold"
1696
1705
  }
1697
1706
  ),
1698
- holdOrUnHoldLoading ? /* @__PURE__ */ jsx2(
1707
+ conferenceCallHoldOrUnHold ? /* @__PURE__ */ jsx2(
1699
1708
  CircularProgress,
1700
1709
  {
1701
1710
  size: "16px",
@@ -1722,13 +1731,13 @@ var ConferenceTableRow = ({ each }) => {
1722
1731
  {
1723
1732
  variant: "body2",
1724
1733
  sx: {
1725
- color: ((_t = state.callData) == null ? void 0 : _t.hold) === 1 ? "#fff" : "#000",
1734
+ color: each.status === "HOLD" ? "#fff" : "#000",
1726
1735
  fontSize: "12px"
1727
1736
  },
1728
1737
  children: "Hold"
1729
1738
  }
1730
1739
  ),
1731
- holdOrUnHoldLoading ? /* @__PURE__ */ jsx2(
1740
+ conferenceCallHoldOrUnHold ? /* @__PURE__ */ jsx2(
1732
1741
  CircularProgress,
1733
1742
  {
1734
1743
  size: "16px",
@@ -1793,7 +1802,7 @@ var ConferenceTableRow = ({ each }) => {
1793
1802
  children: conferenceCallMerge ? /* @__PURE__ */ jsx2(CircularProgress, { size: "20px" }) : /* @__PURE__ */ jsx2(CallSplit, {})
1794
1803
  }
1795
1804
  ) }),
1796
- (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx2(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ jsx2(
1805
+ (each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx2(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Resume", children: /* @__PURE__ */ jsx2(
1797
1806
  Button,
1798
1807
  {
1799
1808
  variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",