@bigbinary/neeto-integrations-frontend 2.8.0 → 2.9.0
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/Daily.cjs.js +0 -7
- package/dist/Daily.cjs.js.map +1 -1
- package/dist/Daily.js +0 -7
- package/dist/Daily.js.map +1 -1
- package/dist/Twilio.cjs.js +96 -721
- package/dist/Twilio.cjs.js.map +1 -1
- package/dist/Twilio.js +99 -720
- package/dist/Twilio.js.map +1 -1
- package/dist/Zoom.cjs.js +0 -7
- package/dist/Zoom.cjs.js.map +1 -1
- package/dist/Zoom.js +0 -7
- package/dist/Zoom.js.map +1 -1
- package/dist/index.cjs.js +37 -119
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +37 -119
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +0 -2
package/dist/Twilio.cjs.js
CHANGED
|
@@ -2,20 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
|
-
require('@bigbinary/
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var i18next = require('i18next');
|
|
5
|
+
var formik = require('@bigbinary/neetoui/formik');
|
|
6
|
+
var ramda = require('ramda');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
9
8
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
10
|
-
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
11
9
|
var reactQuery = require('react-query');
|
|
12
10
|
var axios = require('axios');
|
|
13
|
-
var
|
|
14
|
-
var neetoui = require('@bigbinary/neetoui');
|
|
15
|
-
var formik = require('@bigbinary/neetoui/formik');
|
|
16
|
-
var reactI18next = require('react-i18next');
|
|
17
|
-
var classnames = require('classnames');
|
|
18
|
-
var ramda = require('ramda');
|
|
11
|
+
var i18next = require('i18next');
|
|
19
12
|
var yup = require('yup');
|
|
20
13
|
|
|
21
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -39,69 +32,10 @@ function _interopNamespace(e) {
|
|
|
39
32
|
}
|
|
40
33
|
|
|
41
34
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
|
-
var DisconnectAlert__default = /*#__PURE__*/_interopDefaultLegacy(DisconnectAlert);
|
|
43
|
-
var WalkthroughModal__default = /*#__PURE__*/_interopDefaultLegacy(WalkthroughModal);
|
|
44
|
-
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
45
35
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
46
|
-
var
|
|
47
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
36
|
+
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
48
37
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
49
38
|
|
|
50
|
-
function _arrayWithHoles(arr) {
|
|
51
|
-
if (Array.isArray(arr)) return arr;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _iterableToArrayLimit(arr, i) {
|
|
55
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
56
|
-
if (null != _i) {
|
|
57
|
-
var _s,
|
|
58
|
-
_e,
|
|
59
|
-
_x,
|
|
60
|
-
_r,
|
|
61
|
-
_arr = [],
|
|
62
|
-
_n = !0,
|
|
63
|
-
_d = !1;
|
|
64
|
-
try {
|
|
65
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
66
|
-
if (Object(_i) !== _i) return;
|
|
67
|
-
_n = !1;
|
|
68
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
69
|
-
} catch (err) {
|
|
70
|
-
_d = !0, _e = err;
|
|
71
|
-
} finally {
|
|
72
|
-
try {
|
|
73
|
-
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
74
|
-
} finally {
|
|
75
|
-
if (_d) throw _e;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return _arr;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _arrayLikeToArray(arr, len) {
|
|
83
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
84
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
85
|
-
return arr2;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
89
|
-
if (!o) return;
|
|
90
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
91
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
92
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
93
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
94
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function _nonIterableRest() {
|
|
98
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function _slicedToArray(arr, i) {
|
|
102
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
39
|
function _typeof(obj) {
|
|
106
40
|
"@babel/helpers - typeof";
|
|
107
41
|
|
|
@@ -143,557 +77,8 @@ function _defineProperty(obj, key, value) {
|
|
|
143
77
|
return obj;
|
|
144
78
|
}
|
|
145
79
|
|
|
146
|
-
var
|
|
147
|
-
var
|
|
148
|
-
var INTEGRATIONS_ENGINE_DAILY_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/daily");
|
|
149
|
-
|
|
150
|
-
var create = function create(payload) {
|
|
151
|
-
return axios__default["default"].post(INTEGRATIONS_ENGINE_DAILY_URL, {
|
|
152
|
-
daily: payload
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
var show = function show() {
|
|
156
|
-
return axios__default["default"].get(INTEGRATIONS_ENGINE_DAILY_URL);
|
|
157
|
-
};
|
|
158
|
-
var destroy = function destroy() {
|
|
159
|
-
return axios__default["default"]["delete"](INTEGRATIONS_ENGINE_DAILY_URL);
|
|
160
|
-
};
|
|
161
|
-
var dailiesApi = {
|
|
162
|
-
create: create,
|
|
163
|
-
show: show,
|
|
164
|
-
destroy: destroy
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
var QUERY_KEYS = {
|
|
168
|
-
TWILIO_SMS_CONFIGURATION: "twilio-sms-configuration",
|
|
169
|
-
TWILIO_PHONE_NUMBERS: "twilio-phone-numbers",
|
|
170
|
-
DAILY_CO_DETAILS: "daily-co-details",
|
|
171
|
-
ZOOM_DETAILS: "zoom-details"
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
175
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
176
|
-
var useCreateDaily = function useCreateDaily() {
|
|
177
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
178
|
-
return reactUtils.useMutationWithInvalidation(dailiesApi.create, _objectSpread$4({
|
|
179
|
-
keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS]
|
|
180
|
-
}, options));
|
|
181
|
-
};
|
|
182
|
-
var useFetchDaily = function useFetchDaily() {
|
|
183
|
-
return reactQuery.useQuery(QUERY_KEYS.DAILY_CO_DETAILS, dailiesApi.show, {
|
|
184
|
-
staleTime: constants.DEFAULT_STALE_TIME
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
var useDestroyDaily = function useDestroyDaily(_ref) {
|
|
188
|
-
var onSuccess = _ref.onSuccess;
|
|
189
|
-
return reactUtils.useMutationWithInvalidation(dailiesApi.destroy, {
|
|
190
|
-
keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS],
|
|
191
|
-
onSuccess: onSuccess
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
function _extends() {
|
|
196
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
197
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
198
|
-
var source = arguments[i];
|
|
199
|
-
for (var key in source) {
|
|
200
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
201
|
-
target[key] = source[key];
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return target;
|
|
206
|
-
};
|
|
207
|
-
return _extends.apply(this, arguments);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
211
|
-
if (source == null) return {};
|
|
212
|
-
var target = {};
|
|
213
|
-
var sourceKeys = Object.keys(source);
|
|
214
|
-
var key, i;
|
|
215
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
216
|
-
key = sourceKeys[i];
|
|
217
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
218
|
-
target[key] = source[key];
|
|
219
|
-
}
|
|
220
|
-
return target;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function _objectWithoutProperties(source, excluded) {
|
|
224
|
-
if (source == null) return {};
|
|
225
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
226
|
-
var key, i;
|
|
227
|
-
if (Object.getOwnPropertySymbols) {
|
|
228
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
229
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
230
|
-
key = sourceSymbolKeys[i];
|
|
231
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
232
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
233
|
-
target[key] = source[key];
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
return target;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
var _excluded = ["className", "children"];
|
|
240
|
-
var ExternalLink = function ExternalLink(_ref) {
|
|
241
|
-
var _ref$className = _ref.className,
|
|
242
|
-
className = _ref$className === void 0 ? "" : _ref$className,
|
|
243
|
-
_ref$children = _ref.children,
|
|
244
|
-
children = _ref$children === void 0 ? null : _ref$children,
|
|
245
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
246
|
-
return /*#__PURE__*/React__default["default"].createElement("a", _extends({
|
|
247
|
-
className: classnames__default["default"](["neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium", className])
|
|
248
|
-
}, props), children);
|
|
249
|
-
};
|
|
250
|
-
var ExternalLink$1 = /*#__PURE__*/React__default["default"].memo(ExternalLink);
|
|
251
|
-
|
|
252
|
-
var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
|
|
253
|
-
apiKey: ""
|
|
254
|
-
};
|
|
255
|
-
var DAILY_CO_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
256
|
-
apiKey: yup__namespace.string().trim().required(i18next.t("neetoIntegrations.errors.required", {
|
|
257
|
-
entity: i18next.t("neetoIntegrations.daily.apiKey")
|
|
258
|
-
}))
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
var Form = function Form(_ref) {
|
|
262
|
-
var helpDocUrl = _ref.helpDocUrl,
|
|
263
|
-
videoUrl = _ref.videoUrl,
|
|
264
|
-
onConnect = _ref.onConnect;
|
|
265
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
266
|
-
t = _useTranslation.t;
|
|
267
|
-
var _useState = React.useState(false),
|
|
268
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
269
|
-
isDemoModalOpen = _useState2[0],
|
|
270
|
-
setIsDemoModalOpen = _useState2[1];
|
|
271
|
-
var _useCreateDaily = useCreateDaily({
|
|
272
|
-
onSuccess: function onSuccess() {
|
|
273
|
-
return onConnect === null || onConnect === void 0 ? void 0 : onConnect();
|
|
274
|
-
}
|
|
275
|
-
}),
|
|
276
|
-
createDaily = _useCreateDaily.mutate,
|
|
277
|
-
isConnecting = _useCreateDaily.isLoading;
|
|
278
|
-
var handleSubmit = function handleSubmit(payload) {
|
|
279
|
-
return createDaily(payload);
|
|
280
|
-
};
|
|
281
|
-
if (isConnecting) {
|
|
282
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
283
|
-
}
|
|
284
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
285
|
-
className: "mx-auto w-full max-w-md"
|
|
286
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Form, {
|
|
287
|
-
formikProps: {
|
|
288
|
-
initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
|
|
289
|
-
validationSchema: DAILY_CO_VALIDATION_SCHEMA,
|
|
290
|
-
onSubmit: handleSubmit
|
|
291
|
-
}
|
|
292
|
-
}, function (_ref2) {
|
|
293
|
-
var dirty = _ref2.dirty;
|
|
294
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
295
|
-
className: "mt-10 w-full space-y-5"
|
|
296
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
297
|
-
className: "block"
|
|
298
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
299
|
-
autoFocus: true,
|
|
300
|
-
required: true,
|
|
301
|
-
label: t("neetoIntegrations.daily.apiKey"),
|
|
302
|
-
name: "apiKey",
|
|
303
|
-
helpText: /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
304
|
-
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
305
|
-
components: {
|
|
306
|
-
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
307
|
-
href: helpDocUrl,
|
|
308
|
-
rel: "noreferrer",
|
|
309
|
-
target: "_blank"
|
|
310
|
-
})
|
|
311
|
-
}
|
|
312
|
-
})
|
|
313
|
-
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
314
|
-
className: "mt-8",
|
|
315
|
-
label: t("neetoIntegrations.daily.walkthroughText"),
|
|
316
|
-
style: "link",
|
|
317
|
-
onClick: function onClick() {
|
|
318
|
-
return setIsDemoModalOpen(true);
|
|
319
|
-
}
|
|
320
|
-
})), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
321
|
-
disabled: isConnecting || !dirty,
|
|
322
|
-
label: t("neetoIntegrations.common.connect"),
|
|
323
|
-
loading: isConnecting,
|
|
324
|
-
type: "submit"
|
|
325
|
-
})));
|
|
326
|
-
}), /*#__PURE__*/React__default["default"].createElement(WalkthroughModal__default["default"], {
|
|
327
|
-
isOpen: isDemoModalOpen,
|
|
328
|
-
videoUrl: videoUrl,
|
|
329
|
-
onClose: function onClose() {
|
|
330
|
-
return setIsDemoModalOpen(false);
|
|
331
|
-
}
|
|
332
|
-
}));
|
|
333
|
-
};
|
|
334
|
-
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
335
|
-
|
|
336
|
-
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
337
|
-
var t = _ref.t,
|
|
338
|
-
title = _ref.title,
|
|
339
|
-
description = _ref.description,
|
|
340
|
-
integration = _ref.integration,
|
|
341
|
-
isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
|
|
342
|
-
setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
|
|
343
|
-
isDisconnecting = _ref.isDisconnecting,
|
|
344
|
-
onDisconnect = _ref.onDisconnect,
|
|
345
|
-
onClose = _ref.onClose;
|
|
346
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
347
|
-
className: "mx-auto w-full max-w-md"
|
|
348
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
349
|
-
className: "mt-10 w-full space-y-4"
|
|
350
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
351
|
-
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
352
|
-
style: "h3",
|
|
353
|
-
weight: "semibold"
|
|
354
|
-
}, title), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
355
|
-
className: "neeto-ui-text-gray-600 break-all",
|
|
356
|
-
style: "body1",
|
|
357
|
-
weight: "normal"
|
|
358
|
-
}, description), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
359
|
-
label: t("neetoIntegrations.common.disconnect"),
|
|
360
|
-
style: "danger",
|
|
361
|
-
onClick: function onClick() {
|
|
362
|
-
return setIsDisconnectAlertOpen(true);
|
|
363
|
-
}
|
|
364
|
-
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
365
|
-
isDisconnecting: isDisconnecting,
|
|
366
|
-
onClose: onClose,
|
|
367
|
-
onDisconnect: onDisconnect,
|
|
368
|
-
isOpen: isDisconnectAlertOpen,
|
|
369
|
-
message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
|
|
370
|
-
title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
|
|
371
|
-
}));
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
var Manage = function Manage(_ref) {
|
|
375
|
-
var onDisconnect = _ref.onDisconnect;
|
|
376
|
-
var _useState = React.useState(false),
|
|
377
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
378
|
-
isDisconnectAlertOpen = _useState2[0],
|
|
379
|
-
setIsDisconnectAlertOpen = _useState2[1];
|
|
380
|
-
var _useFetchDaily = useFetchDaily(),
|
|
381
|
-
_useFetchDaily$data = _useFetchDaily.data,
|
|
382
|
-
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
383
|
-
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
384
|
-
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
385
|
-
isLoading = _useFetchDaily.isLoading;
|
|
386
|
-
var _ref2 = metadata || {},
|
|
387
|
-
_ref2$apiKey = _ref2.apiKey,
|
|
388
|
-
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
389
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
390
|
-
t = _useTranslation.t;
|
|
391
|
-
var _useDestroyDaily = useDestroyDaily({
|
|
392
|
-
onSuccess: function onSuccess() {
|
|
393
|
-
setIsDisconnectAlertOpen(false);
|
|
394
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
395
|
-
}
|
|
396
|
-
}),
|
|
397
|
-
destroyIntegration = _useDestroyDaily.mutate,
|
|
398
|
-
isDisconnecting = _useDestroyDaily.isLoading;
|
|
399
|
-
var handleDisconnect = function handleDisconnect() {
|
|
400
|
-
return destroyIntegration("daily");
|
|
401
|
-
};
|
|
402
|
-
if (isLoading || isDisconnecting) {
|
|
403
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
404
|
-
}
|
|
405
|
-
if (neetoCist.isNotPresent(apiKey)) {
|
|
406
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
407
|
-
}
|
|
408
|
-
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
409
|
-
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
410
|
-
isDisconnecting: isDisconnecting,
|
|
411
|
-
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
412
|
-
description: t("neetoIntegrations.daily.yourApiKey", {
|
|
413
|
-
apiKey: apiKey
|
|
414
|
-
}),
|
|
415
|
-
integration: "daily",
|
|
416
|
-
title: t("neetoIntegrations.daily.connected"),
|
|
417
|
-
onClose: function onClose() {
|
|
418
|
-
return setIsDisconnectAlertOpen(false);
|
|
419
|
-
},
|
|
420
|
-
onDisconnect: handleDisconnect
|
|
421
|
-
});
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
var Daily = function Daily(_ref) {
|
|
425
|
-
var _ref$isOnboarding = _ref.isOnboarding,
|
|
426
|
-
isOnboarding = _ref$isOnboarding === void 0 ? false : _ref$isOnboarding,
|
|
427
|
-
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
428
|
-
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
429
|
-
_ref$videoUrl = _ref.videoUrl,
|
|
430
|
-
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
431
|
-
_ref$onConnect = _ref.onConnect,
|
|
432
|
-
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
433
|
-
_ref$onDisconnect = _ref.onDisconnect,
|
|
434
|
-
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
435
|
-
var _useFetchDaily = useFetchDaily(),
|
|
436
|
-
_useFetchDaily$data = _useFetchDaily.data,
|
|
437
|
-
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
438
|
-
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
439
|
-
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$;
|
|
440
|
-
var _ref2 = metadata || {},
|
|
441
|
-
_ref2$apiKey = _ref2.apiKey,
|
|
442
|
-
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
443
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
444
|
-
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
445
|
-
onDisconnect: onDisconnect
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
return /*#__PURE__*/React__default["default"].createElement(Form$1, {
|
|
449
|
-
onConnect: onConnect,
|
|
450
|
-
helpDocUrl: helpDocUrl,
|
|
451
|
-
videoUrl: videoUrl
|
|
452
|
-
});
|
|
453
|
-
};
|
|
454
|
-
reactUtils.withTitle(Daily, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
455
|
-
|
|
456
|
-
var Stepper = function Stepper(_ref) {
|
|
457
|
-
var _ref$steps = _ref.steps,
|
|
458
|
-
steps = _ref$steps === void 0 ? {} : _ref$steps;
|
|
459
|
-
var isActiveOrCompleted = function isActiveOrCompleted(activeStatus, completedStatus) {
|
|
460
|
-
return activeStatus || completedStatus;
|
|
461
|
-
};
|
|
462
|
-
return /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
463
|
-
className: "flex gap-4"
|
|
464
|
-
}, steps === null || steps === void 0 ? void 0 : steps.map(function (_ref2) {
|
|
465
|
-
var step = _ref2.step,
|
|
466
|
-
label = _ref2.label,
|
|
467
|
-
isActive = _ref2.isActive,
|
|
468
|
-
isCompleted = _ref2.isCompleted;
|
|
469
|
-
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
470
|
-
className: "flex items-center gap-4",
|
|
471
|
-
key: step
|
|
472
|
-
}, step !== "1" && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
473
|
-
className: classnames__default["default"]("w-10 border-b", {
|
|
474
|
-
"neeto-ui-border-gray-800": isActiveOrCompleted(isActive, isCompleted),
|
|
475
|
-
"neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
|
|
476
|
-
})
|
|
477
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
478
|
-
className: "flex items-center gap-2"
|
|
479
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
480
|
-
className: classnames__default["default"]("neeto-ui-rounded-full neeto-ui-gray-600 flex h-6 w-6 items-center justify-center border", {
|
|
481
|
-
"neeto-ui-bg-success-600 neeto-ui-border-success-600 neeto-ui-text-white": isActive,
|
|
482
|
-
"neeto-ui-bg-primary-600 neeto-ui-border-primary-600 neeto-ui-text-white": isCompleted,
|
|
483
|
-
"neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
|
|
484
|
-
})
|
|
485
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
486
|
-
component: "span",
|
|
487
|
-
style: "body2",
|
|
488
|
-
weight: "normal"
|
|
489
|
-
}, step)), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
490
|
-
style: "body2",
|
|
491
|
-
weight: "normal",
|
|
492
|
-
className: classnames__default["default"]({
|
|
493
|
-
"neeto-ui-text-gray-800": isActiveOrCompleted(isActive, isCompleted),
|
|
494
|
-
"neeto-ui-text-gray-600": !isActiveOrCompleted(isActive, isCompleted)
|
|
495
|
-
})
|
|
496
|
-
}, label)));
|
|
497
|
-
}));
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
var Modal = function Modal(_ref) {
|
|
501
|
-
var _ref$isOpen = _ref.isOpen,
|
|
502
|
-
isOpen = _ref$isOpen === void 0 ? neetoCist.noop : _ref$isOpen,
|
|
503
|
-
_ref$onClose = _ref.onClose,
|
|
504
|
-
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
505
|
-
_ref$steps = _ref.steps,
|
|
506
|
-
steps = _ref$steps === void 0 ? {} : _ref$steps,
|
|
507
|
-
children = _ref.children;
|
|
508
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
|
|
509
|
-
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-transform-none w-screen overflow-y-auto",
|
|
510
|
-
isOpen: isOpen,
|
|
511
|
-
size: "fullScreen",
|
|
512
|
-
onClose: onClose
|
|
513
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Header, null, /*#__PURE__*/React__default["default"].createElement(Stepper, {
|
|
514
|
-
steps: steps
|
|
515
|
-
})), /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Body, {
|
|
516
|
-
className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-items-center neeto-ui-flex-grow"
|
|
517
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
518
|
-
className: "neeto-ui-w-full py-10"
|
|
519
|
-
}, children)));
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
var propTypes = {exports: {}};
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
526
|
-
*
|
|
527
|
-
* This source code is licensed under the MIT license found in the
|
|
528
|
-
* LICENSE file in the root directory of this source tree.
|
|
529
|
-
*/
|
|
530
|
-
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
531
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
535
|
-
*
|
|
536
|
-
* This source code is licensed under the MIT license found in the
|
|
537
|
-
* LICENSE file in the root directory of this source tree.
|
|
538
|
-
*/
|
|
539
|
-
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
540
|
-
function emptyFunction() {}
|
|
541
|
-
function emptyFunctionWithReset() {}
|
|
542
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
543
|
-
var factoryWithThrowingShims = function factoryWithThrowingShims() {
|
|
544
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
545
|
-
if (secret === ReactPropTypesSecret) {
|
|
546
|
-
// It is still safe when called from React.
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
550
|
-
err.name = 'Invariant Violation';
|
|
551
|
-
throw err;
|
|
552
|
-
}
|
|
553
|
-
shim.isRequired = shim;
|
|
554
|
-
function getShim() {
|
|
555
|
-
return shim;
|
|
556
|
-
}
|
|
557
|
-
// Important!
|
|
558
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
559
|
-
var ReactPropTypes = {
|
|
560
|
-
array: shim,
|
|
561
|
-
bigint: shim,
|
|
562
|
-
bool: shim,
|
|
563
|
-
func: shim,
|
|
564
|
-
number: shim,
|
|
565
|
-
object: shim,
|
|
566
|
-
string: shim,
|
|
567
|
-
symbol: shim,
|
|
568
|
-
any: shim,
|
|
569
|
-
arrayOf: getShim,
|
|
570
|
-
element: shim,
|
|
571
|
-
elementType: shim,
|
|
572
|
-
instanceOf: getShim,
|
|
573
|
-
node: shim,
|
|
574
|
-
objectOf: getShim,
|
|
575
|
-
oneOf: getShim,
|
|
576
|
-
oneOfType: getShim,
|
|
577
|
-
shape: getShim,
|
|
578
|
-
exact: getShim,
|
|
579
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
580
|
-
resetWarningCache: emptyFunction
|
|
581
|
-
};
|
|
582
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
583
|
-
return ReactPropTypes;
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
588
|
-
*
|
|
589
|
-
* This source code is licensed under the MIT license found in the
|
|
590
|
-
* LICENSE file in the root directory of this source tree.
|
|
591
|
-
*/
|
|
592
|
-
{
|
|
593
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
594
|
-
// http://fb.me/prop-types-in-prod
|
|
595
|
-
propTypes.exports = factoryWithThrowingShims();
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
({
|
|
599
|
-
/**
|
|
600
|
-
* To specify the Icon to be shown
|
|
601
|
-
*/
|
|
602
|
-
Icon: propTypes.exports.PropTypes.node,
|
|
603
|
-
/**
|
|
604
|
-
* To specify the title of the connect component
|
|
605
|
-
*/
|
|
606
|
-
title: propTypes.exports.PropTypes.string,
|
|
607
|
-
/**
|
|
608
|
-
* To specify the description for connect component
|
|
609
|
-
*/
|
|
610
|
-
description: propTypes.exports.PropTypes.string,
|
|
611
|
-
/**
|
|
612
|
-
* To specify the props for the connect button
|
|
613
|
-
*/
|
|
614
|
-
buttonProps: propTypes.exports.PropTypes.object,
|
|
615
|
-
/**
|
|
616
|
-
* Handler function that is triggered when the connect button is clicked.
|
|
617
|
-
*/
|
|
618
|
-
onConnect: propTypes.exports.PropTypes.func
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
({
|
|
622
|
-
/**
|
|
623
|
-
* To specify whether the integration modal should be opened or closed.
|
|
624
|
-
*/
|
|
625
|
-
onClose: propTypes.exports.func,
|
|
626
|
-
/**
|
|
627
|
-
* To specify the walkthrough video link
|
|
628
|
-
*/
|
|
629
|
-
videoUrl: propTypes.exports.string,
|
|
630
|
-
/**
|
|
631
|
-
* To specify the title of the demo component
|
|
632
|
-
*/
|
|
633
|
-
title: propTypes.exports.string,
|
|
634
|
-
/**
|
|
635
|
-
* To specify the subtitle of the demo component
|
|
636
|
-
*/
|
|
637
|
-
subtitle: propTypes.exports.string,
|
|
638
|
-
/**
|
|
639
|
-
* To specify the title of the video in the iframe
|
|
640
|
-
*/
|
|
641
|
-
iframeTitle: propTypes.exports.string
|
|
642
|
-
});
|
|
643
|
-
|
|
644
|
-
({
|
|
645
|
-
/**
|
|
646
|
-
* To specify whether the integration modal should be opened or closed.
|
|
647
|
-
*/
|
|
648
|
-
onClick: propTypes.exports.func,
|
|
649
|
-
/**
|
|
650
|
-
* To show the title of the Finish component
|
|
651
|
-
*/
|
|
652
|
-
title: propTypes.exports.string,
|
|
653
|
-
/**
|
|
654
|
-
* To specify props for primary button
|
|
655
|
-
*/
|
|
656
|
-
buttonProps: propTypes.exports.object,
|
|
657
|
-
/**
|
|
658
|
-
* To specify props for secondary button
|
|
659
|
-
*/
|
|
660
|
-
secondaryButtonProps: propTypes.exports.object
|
|
661
|
-
});
|
|
662
|
-
|
|
663
|
-
var e = [],
|
|
664
|
-
t = [];
|
|
665
|
-
function n(n, r) {
|
|
666
|
-
if (n && "undefined" != typeof document) {
|
|
667
|
-
var a,
|
|
668
|
-
s = !0 === r.prepend ? "prepend" : "append",
|
|
669
|
-
d = !0 === r.singleTag,
|
|
670
|
-
i = "string" == typeof r.container ? document.querySelector(r.container) : document.getElementsByTagName("head")[0];
|
|
671
|
-
if (d) {
|
|
672
|
-
var u = e.indexOf(i);
|
|
673
|
-
-1 === u && (u = e.push(i) - 1, t[u] = {}), a = t[u] && t[u][s] ? t[u][s] : t[u][s] = c();
|
|
674
|
-
} else a = c();
|
|
675
|
-
65279 === n.charCodeAt(0) && (n = n.substring(1)), a.styleSheet ? a.styleSheet.cssText += n : a.appendChild(document.createTextNode(n));
|
|
676
|
-
}
|
|
677
|
-
function c() {
|
|
678
|
-
var e = document.createElement("style");
|
|
679
|
-
if (e.setAttribute("type", "text/css"), r.attributes) for (var t = Object.keys(r.attributes), n = 0; n < t.length; n++) e.setAttribute(t[n], r.attributes[t[n]]);
|
|
680
|
-
var a = "prepend" === s ? "afterbegin" : "beforeend";
|
|
681
|
-
return i.insertAdjacentElement(a, e), e;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
var css = ".intrinsic-container{height:0;overflow:hidden;position:relative}.intrinsic-container-16x9{padding-bottom:56.25%}.intrinsic-container-4x3{padding-bottom:75%}.intrinsic-container iframe{height:100%;left:0;position:absolute;top:0;width:100%}";
|
|
686
|
-
n(css,{});
|
|
687
|
-
|
|
688
|
-
var TWILIO_INTEGRATION_STEPS = [{
|
|
689
|
-
step: "1",
|
|
690
|
-
label: i18next__default["default"].t("neetoIntegrations.steps.configure"),
|
|
691
|
-
isActive: true,
|
|
692
|
-
isCompleted: false
|
|
693
|
-
}];
|
|
694
|
-
|
|
695
|
-
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
696
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
80
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
81
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
697
82
|
var ConfigurationForm = function ConfigurationForm(_ref) {
|
|
698
83
|
var _errors$twilioPhoneNu;
|
|
699
84
|
var phoneNumberOptions = _ref.phoneNumberOptions,
|
|
@@ -742,31 +127,73 @@ var ConfigurationForm = function ConfigurationForm(_ref) {
|
|
|
742
127
|
options: phoneNumberOptions,
|
|
743
128
|
size: "large",
|
|
744
129
|
onChange: function onChange(selected) {
|
|
745
|
-
return setValues(_objectSpread$
|
|
130
|
+
return setValues(_objectSpread$2(_objectSpread$2({}, values), {}, {
|
|
746
131
|
twilioPhoneNumber: selected
|
|
747
132
|
}));
|
|
748
133
|
}
|
|
749
134
|
})));
|
|
750
135
|
};
|
|
751
136
|
|
|
752
|
-
function
|
|
753
|
-
if (Array.isArray(arr)) return
|
|
137
|
+
function _arrayWithHoles(arr) {
|
|
138
|
+
if (Array.isArray(arr)) return arr;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function _iterableToArrayLimit(arr, i) {
|
|
142
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
143
|
+
if (null != _i) {
|
|
144
|
+
var _s,
|
|
145
|
+
_e,
|
|
146
|
+
_x,
|
|
147
|
+
_r,
|
|
148
|
+
_arr = [],
|
|
149
|
+
_n = !0,
|
|
150
|
+
_d = !1;
|
|
151
|
+
try {
|
|
152
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
153
|
+
if (Object(_i) !== _i) return;
|
|
154
|
+
_n = !1;
|
|
155
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
156
|
+
} catch (err) {
|
|
157
|
+
_d = !0, _e = err;
|
|
158
|
+
} finally {
|
|
159
|
+
try {
|
|
160
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
161
|
+
} finally {
|
|
162
|
+
if (_d) throw _e;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return _arr;
|
|
166
|
+
}
|
|
754
167
|
}
|
|
755
168
|
|
|
756
|
-
function
|
|
757
|
-
if (
|
|
169
|
+
function _arrayLikeToArray(arr, len) {
|
|
170
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
171
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
172
|
+
return arr2;
|
|
758
173
|
}
|
|
759
174
|
|
|
760
|
-
function
|
|
761
|
-
|
|
175
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
176
|
+
if (!o) return;
|
|
177
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
178
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
179
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
180
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
181
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
762
182
|
}
|
|
763
183
|
|
|
764
|
-
function
|
|
765
|
-
|
|
184
|
+
function _nonIterableRest() {
|
|
185
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
766
186
|
}
|
|
767
187
|
|
|
768
|
-
function
|
|
769
|
-
|
|
188
|
+
function _slicedToArray(arr, i) {
|
|
189
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
|
|
193
|
+
var TWILIO_CONFIGURATION_BASE_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/twilio/sms_configurations");
|
|
194
|
+
|
|
195
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
196
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
770
197
|
var fetchTwilioSmsConfiguration = function fetchTwilioSmsConfiguration(integrable) {
|
|
771
198
|
return axios__default["default"].get(TWILIO_CONFIGURATION_BASE_URL, {
|
|
772
199
|
params: integrable
|
|
@@ -781,7 +208,7 @@ var getTwilioPhoneNumbers = function getTwilioPhoneNumbers(data) {
|
|
|
781
208
|
});
|
|
782
209
|
};
|
|
783
210
|
var createTwilioConfiguration = function createTwilioConfiguration(payload, integrable) {
|
|
784
|
-
return axios__default["default"].post(TWILIO_CONFIGURATION_BASE_URL, _objectSpread$
|
|
211
|
+
return axios__default["default"].post(TWILIO_CONFIGURATION_BASE_URL, _objectSpread$1(_objectSpread$1({}, payload), integrable));
|
|
785
212
|
};
|
|
786
213
|
var twilioApi = {
|
|
787
214
|
fetchTwilioSmsConfiguration: fetchTwilioSmsConfiguration,
|
|
@@ -790,6 +217,13 @@ var twilioApi = {
|
|
|
790
217
|
createTwilioConfiguration: createTwilioConfiguration
|
|
791
218
|
};
|
|
792
219
|
|
|
220
|
+
var QUERY_KEYS = {
|
|
221
|
+
TWILIO_SMS_CONFIGURATION: "twilio-sms-configuration",
|
|
222
|
+
TWILIO_PHONE_NUMBERS: "twilio-phone-numbers",
|
|
223
|
+
DAILY_CO_DETAILS: "daily-co-details",
|
|
224
|
+
ZOOM_DETAILS: "zoom-details"
|
|
225
|
+
};
|
|
226
|
+
|
|
793
227
|
var useFetchTwilioSmsConfiguration = function useFetchTwilioSmsConfiguration(_ref) {
|
|
794
228
|
var integrable = _ref.integrable;
|
|
795
229
|
return reactQuery.useQuery([QUERY_KEYS.TWILIO_SMS_CONFIGURATION, integrable === null || integrable === void 0 ? void 0 : integrable.integrableId], function () {
|
|
@@ -829,12 +263,8 @@ var useCreateTwilioConfiguration = function useCreateTwilioConfiguration(_ref3)
|
|
|
829
263
|
});
|
|
830
264
|
};
|
|
831
265
|
|
|
832
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
833
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
834
266
|
var useTwilio = function useTwilio(_ref) {
|
|
835
|
-
var _ref$
|
|
836
|
-
setSteps = _ref$setSteps === void 0 ? neetoCist.noop : _ref$setSteps,
|
|
837
|
-
_ref$onConnect = _ref.onConnect,
|
|
267
|
+
var _ref$onConnect = _ref.onConnect,
|
|
838
268
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
839
269
|
_ref$formRef = _ref.formRef,
|
|
840
270
|
formRef = _ref$formRef === void 0 ? null : _ref$formRef,
|
|
@@ -843,7 +273,8 @@ var useTwilio = function useTwilio(_ref) {
|
|
|
843
273
|
var _useFetchTwilioSmsCon = useFetchTwilioSmsConfiguration({
|
|
844
274
|
integrable: integrable
|
|
845
275
|
}),
|
|
846
|
-
|
|
276
|
+
_useFetchTwilioSmsCon2 = _useFetchTwilioSmsCon.data,
|
|
277
|
+
configuration = _useFetchTwilioSmsCon2 === void 0 ? {} : _useFetchTwilioSmsCon2,
|
|
847
278
|
isConfigurationLoading = _useFetchTwilioSmsCon.isLoading;
|
|
848
279
|
var _useStateWithDependen = reactUtils.useStateWithDependency(configuration),
|
|
849
280
|
_useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
|
|
@@ -860,16 +291,6 @@ var useTwilio = function useTwilio(_ref) {
|
|
|
860
291
|
}),
|
|
861
292
|
saveConfiguration = _useCreateTwilioConfi.mutate,
|
|
862
293
|
isSubmitting = _useCreateTwilioConfi.isLoading;
|
|
863
|
-
React.useEffect(function () {
|
|
864
|
-
if (!(configuration !== null && configuration !== void 0 && configuration.twilioPhoneNumber)) return;
|
|
865
|
-
setSteps(function (steps) {
|
|
866
|
-
var stepsClone = _toConsumableArray(steps);
|
|
867
|
-
stepsClone[0] = _objectSpread$1(_objectSpread$1({}, steps[0]), {}, {
|
|
868
|
-
isCompleted: true
|
|
869
|
-
});
|
|
870
|
-
return stepsClone;
|
|
871
|
-
});
|
|
872
|
-
}, [configuration]);
|
|
873
294
|
var handleSubmit = function handleSubmit(values) {
|
|
874
295
|
var _values$twilioPhoneNu;
|
|
875
296
|
var payload = {
|
|
@@ -908,23 +329,18 @@ var buildTwilioConfigurationValidationSchema = function buildTwilioConfiguration
|
|
|
908
329
|
|
|
909
330
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
910
331
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
911
|
-
var
|
|
912
|
-
var _ref$
|
|
913
|
-
|
|
914
|
-
_ref$
|
|
915
|
-
|
|
332
|
+
var Twilio = function Twilio(_ref) {
|
|
333
|
+
var _ref$integrable = _ref.integrable,
|
|
334
|
+
integrable = _ref$integrable === void 0 ? null : _ref$integrable,
|
|
335
|
+
_ref$onClose = _ref.onClose,
|
|
336
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
916
337
|
_ref$onConnect = _ref.onConnect,
|
|
917
|
-
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect
|
|
918
|
-
_ref$isModal = _ref.isModal,
|
|
919
|
-
isModal = _ref$isModal === void 0 ? false : _ref$isModal,
|
|
920
|
-
_ref$integrable = _ref.integrable,
|
|
921
|
-
integrable = _ref$integrable === void 0 ? null : _ref$integrable;
|
|
338
|
+
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect;
|
|
922
339
|
var _useTranslation = reactI18next.useTranslation(),
|
|
923
340
|
t = _useTranslation.t;
|
|
924
341
|
var initialFocusRef = React.useRef();
|
|
925
342
|
var formRef = React.useRef();
|
|
926
343
|
var _useTwilio = useTwilio({
|
|
927
|
-
setSteps: setSteps,
|
|
928
344
|
onConnect: onConnect,
|
|
929
345
|
formRef: formRef,
|
|
930
346
|
integrable: integrable
|
|
@@ -946,43 +362,14 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
|
|
|
946
362
|
var selectedPhoneNumber = neetoCist._findBy({
|
|
947
363
|
label: configuration === null || configuration === void 0 ? void 0 : configuration.twilioPhoneNumber
|
|
948
364
|
}, phoneNumberOptions);
|
|
949
|
-
var wrapInModalBody = function wrapInModalBody(children) {
|
|
950
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Body, null, children);
|
|
951
|
-
};
|
|
952
|
-
var wrapInModalFooter = function wrapInModalFooter(children) {
|
|
953
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Footer, null, children);
|
|
954
|
-
};
|
|
955
365
|
var isLoading = isPhoneNumbersLoading || isConfigurationLoading;
|
|
956
366
|
var isSubmitDisabled = function isSubmitDisabled(values) {
|
|
957
367
|
return ramda.equals(_objectSpread(_objectSpread({}, configuration), {}, {
|
|
958
368
|
twilioPhoneNumber: selectedPhoneNumber
|
|
959
369
|
}), values) || isLoading;
|
|
960
370
|
};
|
|
961
|
-
var renderActionBlock = function renderActionBlock(values) {
|
|
962
|
-
return /*#__PURE__*/React__default["default"].createElement(formik.ActionBlock, {
|
|
963
|
-
cancelButtonProps: {
|
|
964
|
-
onClick: onCancel,
|
|
965
|
-
disabled: false
|
|
966
|
-
},
|
|
967
|
-
className: "space-x-3",
|
|
968
|
-
submitButtonProps: {
|
|
969
|
-
label: phoneNumberOptions ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify"),
|
|
970
|
-
disabled: isSubmitDisabled(values),
|
|
971
|
-
loading: isSubmitting || isPhoneNumbersLoading && !(configuration !== null && configuration !== void 0 && configuration.twilioAuthToken)
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
};
|
|
975
|
-
var renderForm = function renderForm(formikProps) {
|
|
976
|
-
return /*#__PURE__*/React__default["default"].createElement(ConfigurationForm, {
|
|
977
|
-
formikProps: formikProps,
|
|
978
|
-
initialFocusRef: initialFocusRef,
|
|
979
|
-
isUsingOverlay: isModal,
|
|
980
|
-
phoneNumberOptions: phoneNumberOptions,
|
|
981
|
-
selectedPhoneNumber: selectedPhoneNumber
|
|
982
|
-
});
|
|
983
|
-
};
|
|
984
371
|
return /*#__PURE__*/React__default["default"].createElement(formik.Form, {
|
|
985
|
-
className: "mx-auto flex w-full max-w-md flex-col",
|
|
372
|
+
className: "mx-auto flex w-full max-w-md flex-col p-5",
|
|
986
373
|
formikProps: {
|
|
987
374
|
enableReinitialize: true,
|
|
988
375
|
validationSchema: buildTwilioConfigurationValidationSchema(!!phoneNumbers),
|
|
@@ -991,39 +378,27 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
|
|
|
991
378
|
onSubmit: handleSubmit
|
|
992
379
|
}
|
|
993
380
|
}, function (formikProps) {
|
|
994
|
-
return
|
|
381
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ConfigurationForm, {
|
|
382
|
+
formikProps: formikProps,
|
|
383
|
+
initialFocusRef: initialFocusRef,
|
|
384
|
+
phoneNumberOptions: phoneNumberOptions,
|
|
385
|
+
selectedPhoneNumber: selectedPhoneNumber
|
|
386
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
995
387
|
className: "mt-4 flex items-center gap-x-2"
|
|
996
|
-
},
|
|
388
|
+
}, /*#__PURE__*/React__default["default"].createElement(formik.ActionBlock, {
|
|
389
|
+
cancelButtonProps: {
|
|
390
|
+
onClick: onClose,
|
|
391
|
+
disabled: false
|
|
392
|
+
},
|
|
393
|
+
className: "space-x-3",
|
|
394
|
+
submitButtonProps: {
|
|
395
|
+
label: phoneNumberOptions ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify"),
|
|
396
|
+
disabled: isSubmitDisabled(formikProps.values),
|
|
397
|
+
loading: isSubmitting || isPhoneNumbersLoading && !(configuration !== null && configuration !== void 0 && configuration.twilioAuthToken)
|
|
398
|
+
}
|
|
399
|
+
})));
|
|
997
400
|
});
|
|
998
401
|
};
|
|
999
402
|
|
|
1000
|
-
var Twilio = function Twilio(_ref) {
|
|
1001
|
-
var _ref$integrable = _ref.integrable,
|
|
1002
|
-
integrable = _ref$integrable === void 0 ? null : _ref$integrable,
|
|
1003
|
-
_ref$isModal = _ref.isModal,
|
|
1004
|
-
isModal = _ref$isModal === void 0 ? true : _ref$isModal,
|
|
1005
|
-
_ref$isModalOpen = _ref.isModalOpen,
|
|
1006
|
-
isModalOpen = _ref$isModalOpen === void 0 ? true : _ref$isModalOpen,
|
|
1007
|
-
_ref$onClose = _ref.onClose,
|
|
1008
|
-
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
1009
|
-
_ref$onConnect = _ref.onConnect,
|
|
1010
|
-
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect;
|
|
1011
|
-
var _useState = React.useState(TWILIO_INTEGRATION_STEPS),
|
|
1012
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1013
|
-
steps = _useState2[0],
|
|
1014
|
-
setSteps = _useState2[1];
|
|
1015
|
-
return /*#__PURE__*/React__default["default"].createElement(Modal, {
|
|
1016
|
-
isOpen: isModalOpen,
|
|
1017
|
-
steps: steps,
|
|
1018
|
-
onClose: onClose
|
|
1019
|
-
}, /*#__PURE__*/React__default["default"].createElement(TwilioConfiguration, {
|
|
1020
|
-
integrable: integrable,
|
|
1021
|
-
isModal: isModal,
|
|
1022
|
-
setSteps: setSteps,
|
|
1023
|
-
onCancel: onClose,
|
|
1024
|
-
onConnect: onConnect
|
|
1025
|
-
}));
|
|
1026
|
-
};
|
|
1027
|
-
|
|
1028
403
|
module.exports = Twilio;
|
|
1029
404
|
//# sourceMappingURL=Twilio.cjs.js.map
|