@sawport/react-sdk 0.1.0-alpha.22 → 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 +181 -150
- package/dist/index.umd.js +9 -9
- package/package.json +2 -2
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,
|
|
6250
|
+
function omit(obj, omitKeys) {
|
|
6251
6251
|
var result = {};
|
|
6252
6252
|
Object.keys(obj).forEach(function(key2) {
|
|
6253
|
-
if (
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
-
|
|
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,30 +41742,42 @@ const Offline = react.exports.memo(({
|
|
|
41785
41742
|
fromDay
|
|
41786
41743
|
}) => {
|
|
41787
41744
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
41788
|
-
const [
|
|
41789
|
-
|
|
41790
|
-
|
|
41791
|
-
|
|
41792
|
-
|
|
41793
|
-
|
|
41794
|
-
|
|
41795
|
-
|
|
41796
|
-
|
|
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"),
|
|
41800
41769
|
email: create$4().email().required(),
|
|
41801
41770
|
account: create$3().min(5).required("Your account no. is required"),
|
|
41802
|
-
date: create$2().min(hooks().subtract(1, "day"), "Please choose future date").required("Please specify a date"),
|
|
41803
|
-
|
|
41804
|
-
parent: parent2
|
|
41805
|
-
}) {
|
|
41806
|
-
const timeformat = "hh:mm:ss";
|
|
41807
|
-
const day = hooks(parent2.date).day();
|
|
41771
|
+
date: create$2().min(hooks().subtract(1, "day"), "Please choose future date").required("Please specify a date").test("date", "Selected day is out of Days of Operation", (value2) => {
|
|
41772
|
+
const day = hooks(value2).day();
|
|
41808
41773
|
const startDay = days$1[fromDay];
|
|
41809
41774
|
const endDay = days$1[toDay];
|
|
41775
|
+
return day >= startDay && day <= endDay;
|
|
41776
|
+
}),
|
|
41777
|
+
time: create$4().min(4).required("Please specify a time").test("time", "Selected time is out of Hours of Operation", function(value2) {
|
|
41778
|
+
const timeformat = "hh:mm:ss";
|
|
41810
41779
|
const check2 = hooks(value2, timeformat), beforeTime = hooks(fromTime, timeformat), afterTime = hooks(toTime, timeformat);
|
|
41811
|
-
return
|
|
41780
|
+
return hooks(check2).isBetween(beforeTime, afterTime);
|
|
41812
41781
|
}),
|
|
41813
41782
|
reason: create$4().min(1).required("Reason is required")
|
|
41814
41783
|
});
|
|
@@ -41822,12 +41791,14 @@ const Offline = react.exports.memo(({
|
|
|
41822
41791
|
latitude: latitude2,
|
|
41823
41792
|
country_code: country_code2
|
|
41824
41793
|
} = data2.data;
|
|
41825
|
-
|
|
41826
|
-
|
|
41827
|
-
|
|
41828
|
-
|
|
41829
|
-
|
|
41830
|
-
|
|
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
|
-
|
|
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
|
-
|
|
41841
|
+
setState({
|
|
41842
|
+
isLoading: false
|
|
41843
|
+
});
|
|
41869
41844
|
} else {
|
|
41870
|
-
|
|
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
|
-
|
|
41888
|
-
|
|
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:
|
|
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(
|
|
42282
|
-
|
|
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
|
{
|
|
@@ -46334,11 +46338,14 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
46334
46338
|
const localVideoRef = react.exports.useRef(null);
|
|
46335
46339
|
const remoteVideoRef = react.exports.useRef(null);
|
|
46336
46340
|
const { socket: socket2 } = useSocket();
|
|
46337
|
-
const playSound = react.exports.useCallback(
|
|
46338
|
-
|
|
46339
|
-
|
|
46340
|
-
|
|
46341
|
-
|
|
46341
|
+
const playSound = react.exports.useCallback(
|
|
46342
|
+
(src2, callOn) => {
|
|
46343
|
+
sound.src = src2;
|
|
46344
|
+
callOn && callOn(sound);
|
|
46345
|
+
sound.play();
|
|
46346
|
+
},
|
|
46347
|
+
[sound]
|
|
46348
|
+
);
|
|
46342
46349
|
const pauseSound = react.exports.useCallback(() => sound.pause(), [sound]);
|
|
46343
46350
|
const resumeSound = react.exports.useCallback(() => sound.resume(), [sound]);
|
|
46344
46351
|
const stopSound = react.exports.useCallback(() => {
|
|
@@ -46426,6 +46433,9 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
46426
46433
|
isOutgoing: false,
|
|
46427
46434
|
getCalled: false,
|
|
46428
46435
|
isCalling: false,
|
|
46436
|
+
muted: false,
|
|
46437
|
+
screenShared: false,
|
|
46438
|
+
videoOff: false,
|
|
46429
46439
|
...append
|
|
46430
46440
|
});
|
|
46431
46441
|
stopSound();
|
|
@@ -46589,10 +46599,10 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
46589
46599
|
const candidate = ({ candidate: candidate2 }) => {
|
|
46590
46600
|
candidate2 && ref.current.peerConnection.addIceCandidate(new RTCIceCandidate(candidate2));
|
|
46591
46601
|
};
|
|
46592
|
-
async
|
|
46602
|
+
const onToken = async (response) => {
|
|
46593
46603
|
initPeer({ response });
|
|
46594
46604
|
sendOffer({ response });
|
|
46595
|
-
}
|
|
46605
|
+
};
|
|
46596
46606
|
return {
|
|
46597
46607
|
"incoming-call": incoming,
|
|
46598
46608
|
"outgoing-answered": answered,
|
|
@@ -46603,7 +46613,17 @@ function useVideoCalling({ userId, conversation_id }) {
|
|
|
46603
46613
|
"call-token": onToken
|
|
46604
46614
|
};
|
|
46605
46615
|
}
|
|
46606
|
-
}, [
|
|
46616
|
+
}, [
|
|
46617
|
+
userId,
|
|
46618
|
+
stateRef,
|
|
46619
|
+
answerIncoming,
|
|
46620
|
+
setBandwidth,
|
|
46621
|
+
initMedia,
|
|
46622
|
+
ref,
|
|
46623
|
+
initPeer,
|
|
46624
|
+
sendOffer,
|
|
46625
|
+
playSound
|
|
46626
|
+
]);
|
|
46607
46627
|
useSocketListeners({ listeners: listeners2 });
|
|
46608
46628
|
react.exports.useEffect(() => {
|
|
46609
46629
|
return () => callCleanup();
|
|
@@ -47147,6 +47167,7 @@ function UnwrapWidget({
|
|
|
47147
47167
|
}
|
|
47148
47168
|
}, [companyUser]);
|
|
47149
47169
|
const [isWidgetLaunched, setIsWidgetLaunched] = useState(false);
|
|
47170
|
+
const [showTip, setShowTip] = useState(false);
|
|
47150
47171
|
const company_id = projectId || config.projectId;
|
|
47151
47172
|
const {
|
|
47152
47173
|
state: {
|
|
@@ -47174,14 +47195,21 @@ function UnwrapWidget({
|
|
|
47174
47195
|
}
|
|
47175
47196
|
}, [isLoadingCompany, company == null ? void 0 : company.name]);
|
|
47176
47197
|
react.exports.useEffect(() => {
|
|
47177
|
-
|
|
47178
|
-
|
|
47179
|
-
|
|
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
|
+
};
|
|
47180
47205
|
}
|
|
47181
|
-
}, [
|
|
47206
|
+
}, [isLoadingCompany]);
|
|
47207
|
+
if (isLoadingCompany || isLoadingCompany === void 0) {
|
|
47208
|
+
return null;
|
|
47209
|
+
}
|
|
47182
47210
|
return /* @__PURE__ */ jsxs("div", {
|
|
47183
47211
|
className: `widget-cover mb-2 ${isWidgetLaunched ? "widget-cover-container" : ""}`,
|
|
47184
|
-
children: [
|
|
47212
|
+
children: [/* @__PURE__ */ jsx(WidgetFormDisplay, {
|
|
47185
47213
|
companyIsClosed,
|
|
47186
47214
|
company_id,
|
|
47187
47215
|
company,
|
|
@@ -47189,9 +47217,9 @@ function UnwrapWidget({
|
|
|
47189
47217
|
setIsWidgetLaunched,
|
|
47190
47218
|
isWidgetLaunched
|
|
47191
47219
|
}), /* @__PURE__ */ jsxs("div", {
|
|
47192
|
-
children: [/* @__PURE__ */ jsx(
|
|
47220
|
+
children: [/* @__PURE__ */ jsx(Tooltip$1, {
|
|
47193
47221
|
placement: "right",
|
|
47194
|
-
|
|
47222
|
+
isOpen: showTip,
|
|
47195
47223
|
target: "welcomeMessage",
|
|
47196
47224
|
style: {
|
|
47197
47225
|
backgroundColor: `${hex_code}`
|
|
@@ -47200,7 +47228,10 @@ function UnwrapWidget({
|
|
|
47200
47228
|
}), /* @__PURE__ */ jsx("div", {
|
|
47201
47229
|
id: "welcomeMessage",
|
|
47202
47230
|
className: `widget-launcher-container mx-5 mb-5 mt-2 ${isWidgetLaunched ? "" : "animate"}`,
|
|
47203
|
-
onClick: () =>
|
|
47231
|
+
onClick: () => {
|
|
47232
|
+
setShowTip(false);
|
|
47233
|
+
setIsWidgetLaunched(!isWidgetLaunched);
|
|
47234
|
+
},
|
|
47204
47235
|
style: {
|
|
47205
47236
|
backgroundColor: `${hex_code}`
|
|
47206
47237
|
},
|
|
@@ -47254,7 +47285,7 @@ const WidgetFormDisplay = react.exports.memo(({
|
|
|
47254
47285
|
setIsWidgetLaunched,
|
|
47255
47286
|
isWidgetLaunched
|
|
47256
47287
|
}) => {
|
|
47257
|
-
var _a, _b, _c, _d, _e;
|
|
47288
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47258
47289
|
const {
|
|
47259
47290
|
socket: socket2
|
|
47260
47291
|
} = useSocket();
|
|
@@ -47302,7 +47333,6 @@ const WidgetFormDisplay = react.exports.memo(({
|
|
|
47302
47333
|
}, [socket2.connected, chatInit, customer == null ? void 0 : customer.id]);
|
|
47303
47334
|
const quickStopChat = react.exports.useCallback(() => {
|
|
47304
47335
|
var _a2, _b2, _c2, _d2;
|
|
47305
|
-
dataRef.current = null;
|
|
47306
47336
|
setState({
|
|
47307
47337
|
chatInit: false,
|
|
47308
47338
|
chatClose: true,
|
|
@@ -47311,16 +47341,17 @@ const WidgetFormDisplay = react.exports.memo(({
|
|
|
47311
47341
|
((_a2 = dataRef.current) == null ? void 0 : _a2.wait) && socket2.emit("chat.ended", {
|
|
47312
47342
|
to: (_b2 = agent == null ? void 0 : agent.user) == null ? void 0 : _b2.id,
|
|
47313
47343
|
waitId: (_d2 = (_c2 = dataRef.current) == null ? void 0 : _c2.wait) == null ? void 0 : _d2.id,
|
|
47314
|
-
|
|
47344
|
+
customer
|
|
47315
47345
|
});
|
|
47316
|
-
|
|
47346
|
+
dataRef.current = null;
|
|
47347
|
+
}, [companyIsClosed, (_b = dataRef.current) == null ? void 0 : _b.wait, (_c = agent == null ? void 0 : agent.user) == null ? void 0 : _c.id, customer]);
|
|
47317
47348
|
const setChatClose = (chatClose2) => {
|
|
47318
47349
|
var _a2, _b2, _c2;
|
|
47319
47350
|
t$1.emit("chat-ended");
|
|
47320
47351
|
socket2.emit("chat.ended", {
|
|
47321
47352
|
to: (_a2 = agent == null ? void 0 : agent.user) == null ? void 0 : _a2.id,
|
|
47322
47353
|
waitId: (_c2 = (_b2 = dataRef.current) == null ? void 0 : _b2.wait) == null ? void 0 : _c2.id,
|
|
47323
|
-
|
|
47354
|
+
customer
|
|
47324
47355
|
});
|
|
47325
47356
|
setState({
|
|
47326
47357
|
chatClose: chatClose2
|
|
@@ -47375,7 +47406,7 @@ const WidgetFormDisplay = react.exports.memo(({
|
|
|
47375
47406
|
quickStopChat,
|
|
47376
47407
|
company,
|
|
47377
47408
|
videoRef
|
|
47378
|
-
}), !!((
|
|
47409
|
+
}), !!((_e = (_d = dataRef == null ? void 0 : dataRef.current) == null ? void 0 : _d.wait) == null ? void 0 : _e.createdAt) && !stateRef.current.agent && /* @__PURE__ */ jsx(LongestWaitime, {}), /* @__PURE__ */ jsx("div", {
|
|
47379
47410
|
className: `widget-body-container px-3 ${companyClosed && "widget-body-container-offline"} `,
|
|
47380
47411
|
children: isLoadingCustomer ? /* @__PURE__ */ jsx(Spinner$2, {}) : isScheduling ? /* @__PURE__ */ jsx(Schedules, {
|
|
47381
47412
|
setParentState: setState,
|
|
@@ -47397,7 +47428,7 @@ const WidgetFormDisplay = react.exports.memo(({
|
|
|
47397
47428
|
}) : chatInit && !chatClose ? /* @__PURE__ */ jsx(Feedback$1, {
|
|
47398
47429
|
quickStopChat,
|
|
47399
47430
|
agent,
|
|
47400
|
-
conversation_id: (
|
|
47431
|
+
conversation_id: (_f = dataRef.current) == null ? void 0 : _f.wait.conversation.id
|
|
47401
47432
|
}) : !chatInit ? /* @__PURE__ */ jsx(WidgetInitForm$1, {
|
|
47402
47433
|
company_id,
|
|
47403
47434
|
companyUser,
|
|
@@ -47406,7 +47437,7 @@ const WidgetFormDisplay = react.exports.memo(({
|
|
|
47406
47437
|
setIsScheduling,
|
|
47407
47438
|
fields: company == null ? void 0 : company.fields,
|
|
47408
47439
|
widgetColor: company == null ? void 0 : company.hex_code
|
|
47409
|
-
}) : /* @__PURE__ */ jsx(ChatWidgetScreen, {
|
|
47440
|
+
}) : /* @__PURE__ */ jsx(ChatWidgetScreen$1, {
|
|
47410
47441
|
welcome_message: company == null ? void 0 : company.welcome_message,
|
|
47411
47442
|
dataRef,
|
|
47412
47443
|
setChatClose,
|