@sawport/react-sdk 0.1.0-alpha.23 → 0.1.0-alpha.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6247,10 +6247,10 @@ function mapToCssModules(className, cssModule) {
6247
6247
  return cssModule[c2] || c2;
6248
6248
  }).join(" ");
6249
6249
  }
6250
- function omit(obj, omitKeys2) {
6250
+ function omit(obj, omitKeys) {
6251
6251
  var result = {};
6252
6252
  Object.keys(obj).forEach(function(key2) {
6253
- if (omitKeys2.indexOf(key2) === -1) {
6253
+ if (omitKeys.indexOf(key2) === -1) {
6254
6254
  result[key2] = obj[key2];
6255
6255
  }
6256
6256
  });
@@ -17452,7 +17452,7 @@ var reactTransitionGroup = {
17452
17452
  CSSTransition: _CSSTransition.default
17453
17453
  };
17454
17454
  var _excluded$b = ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"];
17455
- function ownKeys$8(object2, enumerableOnly) {
17455
+ function ownKeys$7(object2, enumerableOnly) {
17456
17456
  var keys5 = Object.keys(object2);
17457
17457
  if (Object.getOwnPropertySymbols) {
17458
17458
  var symbols = Object.getOwnPropertySymbols(object2);
@@ -17465,24 +17465,24 @@ function ownKeys$8(object2, enumerableOnly) {
17465
17465
  }
17466
17466
  return keys5;
17467
17467
  }
17468
- function _objectSpread$6(target) {
17468
+ function _objectSpread$5(target) {
17469
17469
  for (var i2 = 1; i2 < arguments.length; i2++) {
17470
17470
  var source = arguments[i2] != null ? arguments[i2] : {};
17471
17471
  if (i2 % 2) {
17472
- ownKeys$8(Object(source), true).forEach(function(key2) {
17472
+ ownKeys$7(Object(source), true).forEach(function(key2) {
17473
17473
  _defineProperty(target, key2, source[key2]);
17474
17474
  });
17475
17475
  } else if (Object.getOwnPropertyDescriptors) {
17476
17476
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
17477
17477
  } else {
17478
- ownKeys$8(Object(source)).forEach(function(key2) {
17478
+ ownKeys$7(Object(source)).forEach(function(key2) {
17479
17479
  Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
17480
17480
  });
17481
17481
  }
17482
17482
  }
17483
17483
  return target;
17484
17484
  }
17485
- var propTypes$e = _objectSpread$6(_objectSpread$6({}, reactTransitionGroup.Transition.propTypes), {}, {
17485
+ var propTypes$e = _objectSpread$5(_objectSpread$5({}, reactTransitionGroup.Transition.propTypes), {}, {
17486
17486
  children: propTypes$i.exports.oneOfType([propTypes$i.exports.arrayOf(propTypes$i.exports.node), propTypes$i.exports.node]),
17487
17487
  tag: tagPropType,
17488
17488
  baseClass: propTypes$i.exports.string,
@@ -17491,7 +17491,7 @@ var propTypes$e = _objectSpread$6(_objectSpread$6({}, reactTransitionGroup.Trans
17491
17491
  cssModule: propTypes$i.exports.object,
17492
17492
  innerRef: propTypes$i.exports.oneOfType([propTypes$i.exports.object, propTypes$i.exports.string, propTypes$i.exports.func])
17493
17493
  });
17494
- var defaultProps$e = _objectSpread$6(_objectSpread$6({}, reactTransitionGroup.Transition.defaultProps), {}, {
17494
+ var defaultProps$e = _objectSpread$5(_objectSpread$5({}, reactTransitionGroup.Transition.defaultProps), {}, {
17495
17495
  tag: "div",
17496
17496
  baseClass: "fade",
17497
17497
  baseClassActive: "show",
@@ -17552,7 +17552,7 @@ Badge.propTypes = propTypes$d;
17552
17552
  Badge.defaultProps = defaultProps$d;
17553
17553
  const Badge$1 = Badge;
17554
17554
  var _excluded$9 = ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "popperClassName", "tag", "container", "modifiers", "positionFixed", "boundariesElement", "onClosed", "fade", "transition", "placement"];
17555
- function ownKeys$7(object2, enumerableOnly) {
17555
+ function ownKeys$6(object2, enumerableOnly) {
17556
17556
  var keys5 = Object.keys(object2);
17557
17557
  if (Object.getOwnPropertySymbols) {
17558
17558
  var symbols = Object.getOwnPropertySymbols(object2);
@@ -17565,17 +17565,17 @@ function ownKeys$7(object2, enumerableOnly) {
17565
17565
  }
17566
17566
  return keys5;
17567
17567
  }
17568
- function _objectSpread$5(target) {
17568
+ function _objectSpread$4(target) {
17569
17569
  for (var i2 = 1; i2 < arguments.length; i2++) {
17570
17570
  var source = arguments[i2] != null ? arguments[i2] : {};
17571
17571
  if (i2 % 2) {
17572
- ownKeys$7(Object(source), true).forEach(function(key2) {
17572
+ ownKeys$6(Object(source), true).forEach(function(key2) {
17573
17573
  _defineProperty(target, key2, source[key2]);
17574
17574
  });
17575
17575
  } else if (Object.getOwnPropertyDescriptors) {
17576
17576
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
17577
17577
  } else {
17578
- ownKeys$7(Object(source)).forEach(function(key2) {
17578
+ ownKeys$6(Object(source)).forEach(function(key2) {
17579
17579
  Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
17580
17580
  });
17581
17581
  }
@@ -17618,7 +17618,7 @@ var defaultProps$c = {
17618
17618
  modifiers: {},
17619
17619
  onClosed: noop$3,
17620
17620
  fade: true,
17621
- transition: _objectSpread$5({}, Fade.defaultProps)
17621
+ transition: _objectSpread$4({}, Fade.defaultProps)
17622
17622
  };
17623
17623
  var PopperContent = /* @__PURE__ */ function(_React$Component) {
17624
17624
  _inheritsLoose$1(PopperContent2, _React$Component);
@@ -17676,7 +17676,7 @@ var PopperContent = /* @__PURE__ */ function(_React$Component) {
17676
17676
  var fade = _this$props.fade, transition = _this$props.transition, placement = _this$props.placement, attrs = _objectWithoutPropertiesLoose$1(_this$props, _excluded$9);
17677
17677
  var arrowClassName = mapToCssModules(classNames("arrow", _arrowClassName), cssModule);
17678
17678
  var popperClassName = mapToCssModules(classNames(_popperClassName, placementPrefix ? placementPrefix + "-auto" : ""), this.props.cssModule);
17679
- var extendedModifiers = _objectSpread$5({
17679
+ var extendedModifiers = _objectSpread$4({
17680
17680
  offset: {
17681
17681
  offset: offset2
17682
17682
  },
@@ -17688,7 +17688,7 @@ var PopperContent = /* @__PURE__ */ function(_React$Component) {
17688
17688
  boundariesElement
17689
17689
  }
17690
17690
  }, modifiers2);
17691
- var popperTransition = _objectSpread$5(_objectSpread$5(_objectSpread$5({}, Fade.defaultProps), transition), {}, {
17691
+ var popperTransition = _objectSpread$4(_objectSpread$4(_objectSpread$4({}, Fade.defaultProps), transition), {}, {
17692
17692
  baseClass: fade ? transition.baseClass : "",
17693
17693
  timeout: fade ? transition.timeout : 0
17694
17694
  });
@@ -18088,7 +18088,7 @@ var Portal = /* @__PURE__ */ function(_React$Component) {
18088
18088
  }(React$1.Component);
18089
18089
  Portal.propTypes = propTypes$a;
18090
18090
  const Portal$1 = Portal;
18091
- function ownKeys$6(object2, enumerableOnly) {
18091
+ function ownKeys$5(object2, enumerableOnly) {
18092
18092
  var keys5 = Object.keys(object2);
18093
18093
  if (Object.getOwnPropertySymbols) {
18094
18094
  var symbols = Object.getOwnPropertySymbols(object2);
@@ -18101,17 +18101,17 @@ function ownKeys$6(object2, enumerableOnly) {
18101
18101
  }
18102
18102
  return keys5;
18103
18103
  }
18104
- function _objectSpread$4(target) {
18104
+ function _objectSpread$3(target) {
18105
18105
  for (var i2 = 1; i2 < arguments.length; i2++) {
18106
18106
  var source = arguments[i2] != null ? arguments[i2] : {};
18107
18107
  if (i2 % 2) {
18108
- ownKeys$6(Object(source), true).forEach(function(key2) {
18108
+ ownKeys$5(Object(source), true).forEach(function(key2) {
18109
18109
  _defineProperty(target, key2, source[key2]);
18110
18110
  });
18111
18111
  } else if (Object.getOwnPropertyDescriptors) {
18112
18112
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
18113
18113
  } else {
18114
- ownKeys$6(Object(source)).forEach(function(key2) {
18114
+ ownKeys$5(Object(source)).forEach(function(key2) {
18115
18115
  Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
18116
18116
  });
18117
18117
  }
@@ -18457,11 +18457,11 @@ var Modal = /* @__PURE__ */ function(_React$Component) {
18457
18457
  tabIndex: "-1"
18458
18458
  };
18459
18459
  var hasTransition = this.props.fade;
18460
- var modalTransition = _objectSpread$4(_objectSpread$4(_objectSpread$4({}, Fade.defaultProps), this.props.modalTransition), {}, {
18460
+ var modalTransition = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, Fade.defaultProps), this.props.modalTransition), {}, {
18461
18461
  baseClass: hasTransition ? this.props.modalTransition.baseClass : "",
18462
18462
  timeout: hasTransition ? this.props.modalTransition.timeout : 0
18463
18463
  });
18464
- var backdropTransition = _objectSpread$4(_objectSpread$4(_objectSpread$4({}, Fade.defaultProps), this.props.backdropTransition), {}, {
18464
+ var backdropTransition = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, Fade.defaultProps), this.props.backdropTransition), {}, {
18465
18465
  baseClass: hasTransition ? this.props.backdropTransition.baseClass : "",
18466
18466
  timeout: hasTransition ? this.props.backdropTransition.timeout : 0
18467
18467
  });
@@ -18820,7 +18820,7 @@ Label.propTypes = propTypes$2;
18820
18820
  Label.defaultProps = defaultProps$2;
18821
18821
  const Label$1 = Label;
18822
18822
  var _excluded$1 = ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"];
18823
- function ownKeys$5(object2, enumerableOnly) {
18823
+ function ownKeys$4(object2, enumerableOnly) {
18824
18824
  var keys5 = Object.keys(object2);
18825
18825
  if (Object.getOwnPropertySymbols) {
18826
18826
  var symbols = Object.getOwnPropertySymbols(object2);
@@ -18833,17 +18833,17 @@ function ownKeys$5(object2, enumerableOnly) {
18833
18833
  }
18834
18834
  return keys5;
18835
18835
  }
18836
- function _objectSpread$3(target) {
18836
+ function _objectSpread$2(target) {
18837
18837
  for (var i2 = 1; i2 < arguments.length; i2++) {
18838
18838
  var source = arguments[i2] != null ? arguments[i2] : {};
18839
18839
  if (i2 % 2) {
18840
- ownKeys$5(Object(source), true).forEach(function(key2) {
18840
+ ownKeys$4(Object(source), true).forEach(function(key2) {
18841
18841
  _defineProperty(target, key2, source[key2]);
18842
18842
  });
18843
18843
  } else if (Object.getOwnPropertyDescriptors) {
18844
18844
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
18845
18845
  } else {
18846
- ownKeys$5(Object(source)).forEach(function(key2) {
18846
+ ownKeys$4(Object(source)).forEach(function(key2) {
18847
18847
  Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
18848
18848
  });
18849
18849
  }
@@ -18870,7 +18870,7 @@ var defaultProps$1 = {
18870
18870
  tag: "div",
18871
18871
  closeAriaLabel: "Close",
18872
18872
  fade: true,
18873
- transition: _objectSpread$3(_objectSpread$3({}, Fade.defaultProps), {}, {
18873
+ transition: _objectSpread$2(_objectSpread$2({}, Fade.defaultProps), {}, {
18874
18874
  unmountOnExit: true
18875
18875
  })
18876
18876
  };
@@ -18880,7 +18880,7 @@ function Alert(props) {
18880
18880
  "alert-dismissible": toggle2
18881
18881
  }), cssModule);
18882
18882
  var closeClasses = mapToCssModules(classNames("close", closeClassName), cssModule);
18883
- var alertTransition = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, Fade.defaultProps), transition), {}, {
18883
+ var alertTransition = _objectSpread$2(_objectSpread$2(_objectSpread$2({}, Fade.defaultProps), transition), {}, {
18884
18884
  baseClass: fade ? transition.baseClass : "",
18885
18885
  timeout: fade ? transition.timeout : 0
18886
18886
  });
@@ -18906,66 +18906,6 @@ function Alert(props) {
18906
18906
  }
18907
18907
  Alert.propTypes = propTypes$1;
18908
18908
  Alert.defaultProps = defaultProps$1;
18909
- function ownKeys$4(object2, enumerableOnly) {
18910
- var keys5 = Object.keys(object2);
18911
- if (Object.getOwnPropertySymbols) {
18912
- var symbols = Object.getOwnPropertySymbols(object2);
18913
- if (enumerableOnly) {
18914
- symbols = symbols.filter(function(sym) {
18915
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
18916
- });
18917
- }
18918
- keys5.push.apply(keys5, symbols);
18919
- }
18920
- return keys5;
18921
- }
18922
- function _objectSpread$2(target) {
18923
- for (var i2 = 1; i2 < arguments.length; i2++) {
18924
- var source = arguments[i2] != null ? arguments[i2] : {};
18925
- if (i2 % 2) {
18926
- ownKeys$4(Object(source), true).forEach(function(key2) {
18927
- _defineProperty(target, key2, source[key2]);
18928
- });
18929
- } else if (Object.getOwnPropertyDescriptors) {
18930
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
18931
- } else {
18932
- ownKeys$4(Object(source)).forEach(function(key2) {
18933
- Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2));
18934
- });
18935
- }
18936
- }
18937
- return target;
18938
- }
18939
- var omitKeys = ["defaultOpen"];
18940
- var UncontrolledTooltip = /* @__PURE__ */ function(_Component) {
18941
- _inheritsLoose$1(UncontrolledTooltip2, _Component);
18942
- function UncontrolledTooltip2(props) {
18943
- var _this;
18944
- _this = _Component.call(this, props) || this;
18945
- _this.state = {
18946
- isOpen: props.defaultOpen || false
18947
- };
18948
- _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
18949
- return _this;
18950
- }
18951
- var _proto = UncontrolledTooltip2.prototype;
18952
- _proto.toggle = function toggle2() {
18953
- this.setState({
18954
- isOpen: !this.state.isOpen
18955
- });
18956
- };
18957
- _proto.render = function render() {
18958
- return /* @__PURE__ */ jsx(Tooltip$1, {
18959
- isOpen: this.state.isOpen,
18960
- toggle: this.toggle,
18961
- ...omit(this.props, omitKeys)
18962
- });
18963
- };
18964
- return UncontrolledTooltip2;
18965
- }(react.exports.Component);
18966
- UncontrolledTooltip.propTypes = _objectSpread$2({
18967
- defaultOpen: propTypes$i.exports.bool
18968
- }, Tooltip$1.propTypes);
18969
18909
  var _excluded = ["className", "cssModule", "type", "size", "color", "children", "tag"];
18970
18910
  var propTypes = {
18971
18911
  tag: tagPropType,
@@ -31763,14 +31703,16 @@ function WidgetInitForm({
31763
31703
  longitude,
31764
31704
  latitude,
31765
31705
  location: location2,
31766
- country_code
31706
+ country_code,
31707
+ continent
31767
31708
  }, setState] = useState({
31768
31709
  ipAddress: void 0,
31769
31710
  country: "",
31770
31711
  longitude: void 0,
31771
31712
  latitude: void 0,
31772
31713
  location: "",
31773
- country_code: ""
31714
+ country_code: "",
31715
+ continent: ""
31774
31716
  });
31775
31717
  const [mobile, setMobile] = useState("");
31776
31718
  const validSchema = react.exports.useMemo(() => {
@@ -31785,7 +31727,8 @@ function WidgetInitForm({
31785
31727
  };
31786
31728
  const fieldKeys = ["account", "bvn"];
31787
31729
  fieldKeys.map((key2) => {
31788
- if (fields[key2].show) {
31730
+ var _a;
31731
+ if ((_a = fields == null ? void 0 : fields[key2]) == null ? void 0 : _a.show) {
31789
31732
  shape[key2] = possibleShape[key2];
31790
31733
  }
31791
31734
  });
@@ -31799,15 +31742,18 @@ function WidgetInitForm({
31799
31742
  country_name,
31800
31743
  longitude: longitude2,
31801
31744
  latitude: latitude2,
31802
- country_code: country_code2
31745
+ country_code: country_code2,
31746
+ timezone: timezone2
31803
31747
  } = data2.data;
31748
+ const timezoneStringSplit = timezone2.split("/");
31804
31749
  setState({
31805
31750
  ipAddress: ip,
31806
31751
  country: country_name,
31807
31752
  longitude: longitude2,
31808
31753
  latitude: latitude2,
31809
31754
  location: region,
31810
- country_code: country_code2
31755
+ country_code: country_code2,
31756
+ continent: timezoneStringSplit[0]
31811
31757
  });
31812
31758
  const requestObject = {
31813
31759
  ip_address: ip,
@@ -31848,7 +31794,8 @@ function WidgetInitForm({
31848
31794
  latitude,
31849
31795
  longitude,
31850
31796
  location: location2,
31851
- source_url
31797
+ source_url,
31798
+ continent
31852
31799
  }, "post"), {
31853
31800
  onError: (err) => {
31854
31801
  toast.error("Error occured, try again", {
@@ -31860,6 +31807,7 @@ function WidgetInitForm({
31860
31807
  ...data2
31861
31808
  }) => {
31862
31809
  if (status) {
31810
+ console.log("customer", data2);
31863
31811
  dataRef.current = data2;
31864
31812
  setParentState({
31865
31813
  chatInit: true
@@ -31936,7 +31884,7 @@ function WidgetInitForm({
31936
31884
  children: formik.errors.email
31937
31885
  })]
31938
31886
  }), Object.keys(fields || {}).map((key2) => {
31939
- if (fields[key2].show === true) {
31887
+ if (fields[key2].show === true || fields[key2].show === void 0) {
31940
31888
  if (key2 === "mobile") {
31941
31889
  return /* @__PURE__ */ jsxs(FormGroup$1, {
31942
31890
  children: [/* @__PURE__ */ jsx(Label$1, {
@@ -41708,6 +41656,15 @@ const SvgEllipse = (props) => /* @__PURE__ */ react.exports.createElement("svg",
41708
41656
  }), /* @__PURE__ */ react.exports.createElement("path", {
41709
41657
  d: "M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"
41710
41658
  }));
41659
+ const SvgBackArrow = (props) => /* @__PURE__ */ react.exports.createElement("svg", {
41660
+ id: "Layer_1",
41661
+ "data-name": "Layer 1",
41662
+ xmlns: "http://www.w3.org/2000/svg",
41663
+ viewBox: "0 0 122.88 108.06",
41664
+ ...props
41665
+ }, /* @__PURE__ */ react.exports.createElement("title", null, "back-arrow"), /* @__PURE__ */ react.exports.createElement("path", {
41666
+ d: "M63.94,24.28a14.28,14.28,0,0,0-20.36-20L4.1,44.42a14.27,14.27,0,0,0,0,20l38.69,39.35a14.27,14.27,0,0,0,20.35-20L48.06,68.41l60.66-.29a14.27,14.27,0,1,0-.23-28.54l-59.85.28,15.3-15.58Z"
41667
+ }));
41711
41668
  const calendars = (params) => api("/calendars", params);
41712
41669
  const viewCalendar = (id2, params) => api("/calendars/" + id2, params);
41713
41670
  const updateCalendar = (id2, params) => api("/calendars/" + id2, params, "put");
@@ -41785,15 +41742,27 @@ const Offline = react.exports.memo(({
41785
41742
  fromDay
41786
41743
  }) => {
41787
41744
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
41788
- const [ipAddress, setIpAddress] = react.exports.useState("");
41789
- const [country, setCountry] = react.exports.useState("");
41790
- const [longitude, setLongitude] = react.exports.useState("");
41791
- const [latitude, setLatitude] = react.exports.useState("");
41792
- const [location2, setLocation] = react.exports.useState("");
41793
- const [country_code, setCountryCode] = react.exports.useState("");
41794
- const [mobile, setMobile] = react.exports.useState("");
41795
- const [isLoading, setIsloading] = react.exports.useState(false);
41796
- const [scheduled, setScheduled] = react.exports.useState();
41745
+ const [{
41746
+ ipAddress,
41747
+ country,
41748
+ longitude,
41749
+ latitude,
41750
+ location: location2,
41751
+ country_code,
41752
+ mobile,
41753
+ isLoading,
41754
+ scheduled
41755
+ }, setState] = useState({
41756
+ ipAddress: "",
41757
+ country: "",
41758
+ longitude: "",
41759
+ latitude: "",
41760
+ location: "",
41761
+ country_code: "",
41762
+ mobile: "",
41763
+ isLoading: false,
41764
+ scheduled: false
41765
+ });
41797
41766
  const saved = react.exports.useRef();
41798
41767
  const offlineSchema = create$1().shape({
41799
41768
  full_name: create$4().required("Your full name is required"),
@@ -41822,12 +41791,14 @@ const Offline = react.exports.memo(({
41822
41791
  latitude: latitude2,
41823
41792
  country_code: country_code2
41824
41793
  } = data2.data;
41825
- setCountry(country_name);
41826
- setLongitude(longitude2);
41827
- setLatitude(latitude2);
41828
- setLocation(region);
41829
- setIpAddress(ip);
41830
- setCountryCode(country_code2);
41794
+ setState({
41795
+ country: country_name,
41796
+ longitude: longitude2,
41797
+ latitude: latitude2,
41798
+ location: region,
41799
+ ipAddress: ip,
41800
+ country_code: country_code2
41801
+ });
41831
41802
  }).catch((error) => toast.error("Error occured, try again", {
41832
41803
  autoClose: 2e3
41833
41804
  }));
@@ -41850,7 +41821,9 @@ const Offline = react.exports.memo(({
41850
41821
  reason: reason2
41851
41822
  };
41852
41823
  if (calendar2) {
41853
- setIsloading(true);
41824
+ setState({
41825
+ isLoading: true
41826
+ });
41854
41827
  await updateCalendar(calendar2 == null ? void 0 : calendar2.id, {
41855
41828
  company,
41856
41829
  full_name,
@@ -41865,9 +41838,13 @@ const Offline = react.exports.memo(({
41865
41838
  location: location2,
41866
41839
  ip_address: ipAddress
41867
41840
  });
41868
- setIsloading(false);
41841
+ setState({
41842
+ isLoading: false
41843
+ });
41869
41844
  } else {
41870
- setIsloading(true);
41845
+ setState({
41846
+ isLoading: true
41847
+ });
41871
41848
  await schedule({
41872
41849
  company,
41873
41850
  full_name,
@@ -41884,8 +41861,10 @@ const Offline = react.exports.memo(({
41884
41861
  });
41885
41862
  }
41886
41863
  resetForm({});
41887
- setScheduled(true);
41888
- setIsloading(false);
41864
+ setState({
41865
+ isLoading: false,
41866
+ scheduled: true
41867
+ });
41889
41868
  } catch (error) {
41890
41869
  toast.error("Error occured, try again", {
41891
41870
  autoClose: 2e3
@@ -41915,6 +41894,20 @@ const Offline = react.exports.memo(({
41915
41894
  validationSchema: offlineSchema,
41916
41895
  onSubmit: scheduleCall
41917
41896
  });
41897
+ const done = () => {
41898
+ var _a2, _b2, _c2, _d2, _e2, _f2;
41899
+ setState({
41900
+ full_name: (((_a2 = calendar2 == null ? void 0 : calendar2.customer) == null ? void 0 : _a2.first_name) || "") + " " + (((_b2 = calendar2 == null ? void 0 : calendar2.customer) == null ? void 0 : _b2.last_name) || "") || "",
41901
+ email: companyUser == null ? void 0 : companyUser.email,
41902
+ mobile: ((_d2 = (_c2 = calendar2 == null ? void 0 : calendar2.customer) == null ? void 0 : _c2.credentials) == null ? void 0 : _d2.mobile) || (companyUser == null ? void 0 : companyUser.mobile),
41903
+ account: ((_f2 = (_e2 = calendar2 == null ? void 0 : calendar2.customer) == null ? void 0 : _e2.credentials) == null ? void 0 : _f2.account) || (companyUser == null ? void 0 : companyUser.account),
41904
+ date: (calendar2 == null ? void 0 : calendar2.scheduledAt) ? hooks(calendar2 == null ? void 0 : calendar2.scheduledAt).format("yyyy-MM-DD") : "",
41905
+ time: (calendar2 == null ? void 0 : calendar2.scheduledAt) ? hooks(calendar2 == null ? void 0 : calendar2.scheduledAt).format("HH:mm") : "",
41906
+ reason: (calendar2 == null ? void 0 : calendar2.reason) || "",
41907
+ isLoading: false,
41908
+ scheduled: false
41909
+ });
41910
+ };
41918
41911
  return /* @__PURE__ */ jsx("div", {
41919
41912
  className: `signin-page offline pt-1 px-1 m-auto mt-5`,
41920
41913
  styles: {
@@ -41925,7 +41918,8 @@ const Offline = react.exports.memo(({
41925
41918
  date: (_g = saved.current) == null ? void 0 : _g.date,
41926
41919
  time: (_h = saved.current) == null ? void 0 : _h.time,
41927
41920
  reason: (_i = saved.current) == null ? void 0 : _i.reason,
41928
- hexcode
41921
+ hexcode,
41922
+ done
41929
41923
  }) : /* @__PURE__ */ jsxs(Form$1, {
41930
41924
  onSubmit: handleSubmit,
41931
41925
  children: [/* @__PURE__ */ jsx(ScheduleInput, {
@@ -41964,7 +41958,9 @@ const Offline = react.exports.memo(({
41964
41958
  required: true
41965
41959
  },
41966
41960
  enableSearch: true,
41967
- onChange: setMobile
41961
+ onChange: (mobile2) => setState({
41962
+ mobile: mobile2
41963
+ })
41968
41964
  })]
41969
41965
  }), /* @__PURE__ */ jsx(ScheduleInput, {
41970
41966
  style: {
@@ -42265,7 +42261,8 @@ const Done = react.exports.memo(({
42265
42261
  date: date2,
42266
42262
  reason: reason2,
42267
42263
  name,
42268
- hexcode
42264
+ hexcode,
42265
+ done
42269
42266
  }) => {
42270
42267
  const event = {
42271
42268
  title: `${name} Video Call`,
@@ -42278,8 +42275,14 @@ const Done = react.exports.memo(({
42278
42275
  style: {
42279
42276
  color: `${hexcode}`
42280
42277
  },
42281
- children: [/* @__PURE__ */ jsx(SvgCheckedCircle, {
42282
- className: "my-4"
42278
+ children: [/* @__PURE__ */ jsx(SvgBackArrow, {
42279
+ role: "button",
42280
+ width: 20,
42281
+ height: 20,
42282
+ className: "m-2 align-self-start",
42283
+ onClick: done
42284
+ }), /* @__PURE__ */ jsx(SvgCheckedCircle, {
42285
+ className: "mb-4"
42283
42286
  }), /* @__PURE__ */ jsx("h1", {
42284
42287
  className: "text-alt font-weight-bold",
42285
42288
  children: "Thank You"
@@ -46291,6 +46294,7 @@ const Message = react.exports.memo(function({
46291
46294
  })]
46292
46295
  }, msg.id);
46293
46296
  });
46297
+ const ChatWidgetScreen$1 = react.exports.memo(ChatWidgetScreen);
46294
46298
  const viewCompany = (id2, params) => api("companies/" + id2, params);
46295
46299
  const iceServers = [
46296
46300
  {
@@ -46595,10 +46599,10 @@ function useVideoCalling({ userId, conversation_id }) {
46595
46599
  const candidate = ({ candidate: candidate2 }) => {
46596
46600
  candidate2 && ref.current.peerConnection.addIceCandidate(new RTCIceCandidate(candidate2));
46597
46601
  };
46598
- async function onToken(response) {
46602
+ const onToken = async (response) => {
46599
46603
  initPeer({ response });
46600
46604
  sendOffer({ response });
46601
- }
46605
+ };
46602
46606
  return {
46603
46607
  "incoming-call": incoming,
46604
46608
  "outgoing-answered": answered,
@@ -47163,6 +47167,7 @@ function UnwrapWidget({
47163
47167
  }
47164
47168
  }, [companyUser]);
47165
47169
  const [isWidgetLaunched, setIsWidgetLaunched] = useState(false);
47170
+ const [showTip, setShowTip] = useState(false);
47166
47171
  const company_id = projectId || config.projectId;
47167
47172
  const {
47168
47173
  state: {
@@ -47190,14 +47195,21 @@ function UnwrapWidget({
47190
47195
  }
47191
47196
  }, [isLoadingCompany, company == null ? void 0 : company.name]);
47192
47197
  react.exports.useEffect(() => {
47193
- const element = document.getElementById("welcomeMessage");
47194
- if (element) {
47195
- element.click();
47198
+ if (!isLoadingCompany) {
47199
+ const timeout = setTimeout(() => setShowTip(true), 100);
47200
+ const timeout1 = setTimeout(() => setShowTip(false), 30 * 1e3);
47201
+ return () => {
47202
+ clearTimeout(timeout);
47203
+ clearTimeout(timeout1);
47204
+ };
47196
47205
  }
47197
- }, [document.getElementById("welcomeMessage")]);
47206
+ }, [isLoadingCompany]);
47207
+ if (isLoadingCompany || isLoadingCompany === void 0) {
47208
+ return null;
47209
+ }
47198
47210
  return /* @__PURE__ */ jsxs("div", {
47199
47211
  className: `widget-cover mb-2 ${isWidgetLaunched ? "widget-cover-container" : ""}`,
47200
- children: [isLoadingCompany || isLoadingCompany === void 0 ? /* @__PURE__ */ jsx(Spinner$2, {}) : /* @__PURE__ */ jsx(WidgetFormDisplay, {
47212
+ children: [/* @__PURE__ */ jsx(WidgetFormDisplay, {
47201
47213
  companyIsClosed,
47202
47214
  company_id,
47203
47215
  company,
@@ -47205,9 +47217,9 @@ function UnwrapWidget({
47205
47217
  setIsWidgetLaunched,
47206
47218
  isWidgetLaunched
47207
47219
  }), /* @__PURE__ */ jsxs("div", {
47208
- children: [/* @__PURE__ */ jsx(UncontrolledTooltip, {
47220
+ children: [/* @__PURE__ */ jsx(Tooltip$1, {
47209
47221
  placement: "right",
47210
- trigger: "click",
47222
+ isOpen: showTip,
47211
47223
  target: "welcomeMessage",
47212
47224
  style: {
47213
47225
  backgroundColor: `${hex_code}`
@@ -47216,7 +47228,10 @@ function UnwrapWidget({
47216
47228
  }), /* @__PURE__ */ jsx("div", {
47217
47229
  id: "welcomeMessage",
47218
47230
  className: `widget-launcher-container mx-5 mb-5 mt-2 ${isWidgetLaunched ? "" : "animate"}`,
47219
- onClick: () => setIsWidgetLaunched(!isWidgetLaunched),
47231
+ onClick: () => {
47232
+ setShowTip(false);
47233
+ setIsWidgetLaunched(!isWidgetLaunched);
47234
+ },
47220
47235
  style: {
47221
47236
  backgroundColor: `${hex_code}`
47222
47237
  },
@@ -47318,7 +47333,6 @@ const WidgetFormDisplay = react.exports.memo(({
47318
47333
  }, [socket2.connected, chatInit, customer == null ? void 0 : customer.id]);
47319
47334
  const quickStopChat = react.exports.useCallback(() => {
47320
47335
  var _a2, _b2, _c2, _d2;
47321
- dataRef.current = null;
47322
47336
  setState({
47323
47337
  chatInit: false,
47324
47338
  chatClose: true,
@@ -47329,6 +47343,7 @@ const WidgetFormDisplay = react.exports.memo(({
47329
47343
  waitId: (_d2 = (_c2 = dataRef.current) == null ? void 0 : _c2.wait) == null ? void 0 : _d2.id,
47330
47344
  customer
47331
47345
  });
47346
+ dataRef.current = null;
47332
47347
  }, [companyIsClosed, (_b = dataRef.current) == null ? void 0 : _b.wait, (_c = agent == null ? void 0 : agent.user) == null ? void 0 : _c.id, customer]);
47333
47348
  const setChatClose = (chatClose2) => {
47334
47349
  var _a2, _b2, _c2;
@@ -47336,7 +47351,7 @@ const WidgetFormDisplay = react.exports.memo(({
47336
47351
  socket2.emit("chat.ended", {
47337
47352
  to: (_a2 = agent == null ? void 0 : agent.user) == null ? void 0 : _a2.id,
47338
47353
  waitId: (_c2 = (_b2 = dataRef.current) == null ? void 0 : _b2.wait) == null ? void 0 : _c2.id,
47339
- agent
47354
+ customer
47340
47355
  });
47341
47356
  setState({
47342
47357
  chatClose: chatClose2
@@ -47422,7 +47437,7 @@ const WidgetFormDisplay = react.exports.memo(({
47422
47437
  setIsScheduling,
47423
47438
  fields: company == null ? void 0 : company.fields,
47424
47439
  widgetColor: company == null ? void 0 : company.hex_code
47425
- }) : /* @__PURE__ */ jsx(ChatWidgetScreen, {
47440
+ }) : /* @__PURE__ */ jsx(ChatWidgetScreen$1, {
47426
47441
  welcome_message: company == null ? void 0 : company.welcome_message,
47427
47442
  dataRef,
47428
47443
  setChatClose,