beem-component 2.1.25 → 2.1.27

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.
@@ -7,6 +7,9 @@ exports.default = exports.RepliedTextWrapper = exports.MessageState = exports.Bm
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _icons = require("@material-ui/icons");
9
9
  var _FilePresent = _interopRequireDefault(require("@mui/icons-material/FilePresent"));
10
+ var _PhoneCallbackOutlined = _interopRequireDefault(require("@mui/icons-material/PhoneCallbackOutlined"));
11
+ var _PhoneOutlined = _interopRequireDefault(require("@mui/icons-material/PhoneOutlined"));
12
+ var _PhoneMissed = _interopRequireDefault(require("@mui/icons-material/PhoneMissed"));
10
13
  var _Download = _interopRequireDefault(require("@mui/icons-material/Download"));
11
14
  var _styledComponents = _interopRequireDefault(require("styled-components"));
12
15
  var _reactAvatar = _interopRequireDefault(require("react-avatar"));
@@ -20,10 +23,9 @@ var _sessionDetails = require("./sessionDetails");
20
23
  var _sessionTimeline = require("./sessionTimeline");
21
24
  var _colors = require("../../colors");
22
25
  var _FeedPostComments = require("./FeedPostComments");
23
- var _CallLog = require("./CallLog");
24
26
  const _excluded = ["state", "file", "src", "fileName", "onDownload", "extension", "link"],
25
27
  _excluded2 = ["state", "src", "extensions", "fileName"],
26
- _excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName", "callLog", "metadata", "isInteractive", "type", "extension"];
28
+ _excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName", "metadata", "isInteractive", "type", "extension"];
27
29
  /* eslint-disable react/no-array-index-key */
28
30
  /* eslint-disable no-nested-ternary */
29
31
  /* eslint-disable react/display-name */
@@ -33,6 +35,42 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
33
35
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
34
36
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
35
37
  _reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.js");
38
+ const formatDuration = totalSeconds => {
39
+ const hours = Math.floor(totalSeconds / 3600);
40
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
41
+ const seconds = totalSeconds % 60;
42
+ if (hours > 0) {
43
+ return "".concat(String(hours).padStart(2, '0'), ":") + "".concat(String(minutes).padStart(2, '0'), ":") + "".concat(String(seconds).padStart(2, '0'));
44
+ }
45
+ return "".concat(String(minutes).padStart(2, '0'), ":") + "".concat(String(seconds).padStart(2, '0'));
46
+ };
47
+ const formatCallDuration = totalSeconds => {
48
+ // eslint-disable-next-line no-param-reassign
49
+ if (!totalSeconds || totalSeconds < 0) totalSeconds = 0;
50
+ const hours = Math.floor(totalSeconds / 3600);
51
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
52
+ const seconds = totalSeconds % 60;
53
+ let result = '';
54
+ if (hours > 0) result += "".concat(hours, " hr ");
55
+ result += "".concat(minutes, " min ").concat(seconds, " sec");
56
+ return result.trim();
57
+ };
58
+ const useCallDuration = (running, callStartedAt) => {
59
+ const [seconds, setSeconds] = (0, _react.useState)(0);
60
+ (0, _react.useEffect)(() => {
61
+ if (!running || !callStartedAt) return;
62
+ const startTime = new Date(callStartedAt).getTime();
63
+ const updateSeconds = () => {
64
+ const now = Date.now();
65
+ const elapsed = Math.max(Math.floor((now - startTime) / 1000), 0);
66
+ setSeconds(elapsed);
67
+ };
68
+ updateSeconds();
69
+ const intervalId = setInterval(updateSeconds, 1000);
70
+ return () => clearInterval(intervalId);
71
+ }, [running, callStartedAt]);
72
+ return formatDuration(seconds);
73
+ };
36
74
  const BmChat = _styledComponents.default.div.withConfig({
37
75
  displayName: "chatBody__BmChat"
38
76
  })(["display:flex;flex-direction:column;height:100%;", ""], '' /* border: 0.071rem solid ${BmGrey400}; */);
@@ -189,23 +227,73 @@ const CartContent = _styledComponents.default.div.withConfig({
189
227
  }
190
228
  return "".concat(_colors.BmPrimaryWhite);
191
229
  });
230
+ const CallContainer = _styledComponents.default.div.withConfig({
231
+ displayName: "chatBody__CallContainer"
232
+ })(["display:flex;flex-direction:row;gap:0.6rem;align-items:center;justify-content:center;color:", ";"], _ref11 => {
233
+ let {
234
+ state
235
+ } = _ref11;
236
+ if (state) {
237
+ if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
238
+ if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
239
+ }
240
+ return "".concat(_colors.BmPrimaryWhite);
241
+ });
242
+ const CallInfoContainer = _styledComponents.default.div.withConfig({
243
+ displayName: "chatBody__CallInfoContainer"
244
+ })(["display:flex;padding-right:1.5rem;flex-direction:column;gap:0.3rem;align-items:center;justify-content:center;color:", ";& >:last-child{color:", ";}"], _ref12 => {
245
+ let {
246
+ state
247
+ } = _ref12;
248
+ if (state) {
249
+ if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
250
+ if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
251
+ }
252
+ return "".concat(_colors.BmPrimaryWhite);
253
+ }, _ref13 => {
254
+ let {
255
+ state
256
+ } = _ref13;
257
+ return state === 'inbound' ? '#A6A29F' : '#cde3ddff';
258
+ });
259
+ const IconContainer = _styledComponents.default.div.withConfig({
260
+ displayName: "chatBody__IconContainer"
261
+ })(["display:flex;align-items:center;justify-content:center;width:max-content;height:max-content;padding:0.8rem;border:", ";border-radius:50%;background-color:", ";"], _ref14 => {
262
+ let {
263
+ state
264
+ } = _ref14;
265
+ if (state) {
266
+ if (state === 'inbound') return "1px solid #F3F4F6";
267
+ if (state === 'outbound') return "1px solid #5CC1C8";
268
+ }
269
+ return "".concat(_colors.BmPrimaryWhite);
270
+ }, _ref15 => {
271
+ let {
272
+ state
273
+ } = _ref15;
274
+ if (state) {
275
+ if (state === 'inbound') return "#F3F4F6";
276
+ if (state === 'outbound') return "#5CC1C8";
277
+ }
278
+ return "".concat(_colors.BmPrimaryWhite);
279
+ });
192
280
  const MessagesSubDetails = _styledComponents.default.div.withConfig({
193
281
  displayName: "chatBody__MessagesSubDetails"
194
- })(["display:flex;flex-direction:row;align-items:center;> *:not(:last-child){margin-right:0.5rem;}margin-left:", ";margin-top:0.5rem;"], _ref11 => {
282
+ })(["display:flex;flex-direction:row;align-items:center;> *:not(:last-child){margin-right:0.5rem;}margin-left:", ";margin-top:0.5rem;"], _ref16 => {
195
283
  let {
196
284
  state
197
- } = _ref11;
285
+ } = _ref16;
198
286
  if (state) {
199
287
  if (state === 'inbound') return '0px';
200
288
  if (state === 'outbound') return 'auto';
201
289
  }
202
290
  return "".concat(_colors.BmPrimaryWhite);
203
291
  });
204
- const handleState = _ref12 => {
292
+ const handleState = _ref17 => {
205
293
  let {
206
294
  session,
207
295
  agentName
208
- } = _ref12;
296
+ } = _ref17;
209
297
  if (session === 'bot') {
210
298
  return /*#__PURE__*/_react.default.createElement(_avatars.default, {
211
299
  size: "small",
@@ -239,29 +327,29 @@ const FileNameContainer = _styledComponents.default.div.withConfig({
239
327
  // Start of File Attachment
240
328
  const FileAttachmentWrapper = _styledComponents.default.div.withConfig({
241
329
  displayName: "chatBody__FileAttachmentWrapper"
242
- })(["display:flex;cursor:pointer;flex-direction:row;align-items:center;padding:1rem;background:", ";color:", ";border-radius:", ";border:", ";> *{&:last-child{margin-left:auto;}:not(:last-child){margin-right:0.5rem;}}&&& > *{align-items:center;color:", ";}", " ", ""], _ref13 => {
330
+ })(["display:flex;cursor:pointer;flex-direction:row;align-items:center;padding:1rem;background:", ";color:", ";border-radius:", ";border:", ";> *{&:last-child{margin-left:auto;}:not(:last-child){margin-right:0.5rem;}}&&& > *{align-items:center;color:", ";}", " ", ""], _ref18 => {
243
331
  let {
244
332
  state
245
- } = _ref13;
333
+ } = _ref18;
246
334
  if (state) {
247
335
  if (state === 'inbound') return "#F9FAFB";
248
336
  if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
249
337
  }
250
338
  return "".concat(_colors.BmPrimaryWhite);
251
- }, _ref14 => {
339
+ }, _ref19 => {
252
340
  let {
253
341
  state
254
- } = _ref14;
342
+ } = _ref19;
255
343
  if (state) {
256
344
  if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
257
345
  if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
258
346
  }
259
347
  return "".concat(_colors.BmPrimaryWhite);
260
- }, _ref15 => {
348
+ }, _ref20 => {
261
349
  let {
262
350
  state,
263
351
  src
264
- } = _ref15;
352
+ } = _ref20;
265
353
  if (state) {
266
354
  if (state === 'inbound') {
267
355
  if (src) {
@@ -277,25 +365,25 @@ const FileAttachmentWrapper = _styledComponents.default.div.withConfig({
277
365
  }
278
366
  }
279
367
  return "".concat(_colors.BmPrimaryWhite);
280
- }, _ref16 => {
368
+ }, _ref21 => {
281
369
  let {
282
370
  state
283
- } = _ref16;
371
+ } = _ref21;
284
372
  if (state) {
285
373
  if (state === 'inbound') return "0.071rem solid ".concat(_colors.BmGrey200, ";");
286
374
  }
287
375
  return '';
288
- }, _ref17 => {
376
+ }, _ref22 => {
289
377
  let {
290
378
  state
291
- } = _ref17;
379
+ } = _ref22;
292
380
  if (state) {
293
381
  if (state === 'inbound') return "".concat(_colors.BmPrimaryBlue);
294
382
  if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
295
383
  }
296
384
  return "".concat(_colors.BmPrimaryWhite);
297
385
  }, '' /* max-width: 100%; */, '' /* max-height: 100%; */);
298
- const BmFileAttachment = _ref18 => {
386
+ const BmFileAttachment = _ref23 => {
299
387
  let {
300
388
  state,
301
389
  file,
@@ -304,8 +392,8 @@ const BmFileAttachment = _ref18 => {
304
392
  onDownload,
305
393
  extension,
306
394
  link
307
- } = _ref18,
308
- rest = _objectWithoutProperties(_ref18, _excluded);
395
+ } = _ref23,
396
+ rest = _objectWithoutProperties(_ref23, _excluded);
309
397
  return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
310
398
  state: state,
311
399
  src: src
@@ -324,10 +412,10 @@ const BmFileAttachment = _ref18 => {
324
412
  // Start of Component for Images
325
413
  const BmImageWrapper = exports.BmImageWrapper = _styledComponents.default.div.withConfig({
326
414
  displayName: "chatBody__BmImageWrapper"
327
- })(["display:flex;flex-direction:column;color:", ";"], _ref19 => {
415
+ })(["display:flex;flex-direction:column;color:", ";"], _ref24 => {
328
416
  let {
329
417
  state
330
- } = _ref19;
418
+ } = _ref24;
331
419
  if (state) {
332
420
  if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
333
421
  if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
@@ -336,24 +424,24 @@ const BmImageWrapper = exports.BmImageWrapper = _styledComponents.default.div.wi
336
424
  });
337
425
  const BmImage = exports.BmImage = _styledComponents.default.img.withConfig({
338
426
  displayName: "chatBody__BmImage"
339
- })(["", " width:100%;object-fit:cover;flex-grow:1;border-radius:", ";"], '' /* Fix width */, _ref20 => {
427
+ })(["", " width:100%;object-fit:cover;flex-grow:1;border-radius:", ";"], '' /* Fix width */, _ref25 => {
340
428
  let {
341
429
  state
342
- } = _ref20;
430
+ } = _ref25;
343
431
  if (state) {
344
432
  if (state === 'inbound') return '.5714rem .5714rem 0rem 0rem';
345
433
  if (state === 'outbound') return '.5714rem .5714rem 0rem 0rem';
346
434
  }
347
435
  return "".concat(_colors.BmPrimaryWhite);
348
436
  });
349
- const BmImageChat = _ref21 => {
437
+ const BmImageChat = _ref26 => {
350
438
  let {
351
439
  state,
352
440
  src,
353
441
  extensions,
354
442
  fileName
355
- } = _ref21,
356
- rest = _objectWithoutProperties(_ref21, _excluded2);
443
+ } = _ref26,
444
+ rest = _objectWithoutProperties(_ref26, _excluded2);
357
445
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BmImageWrapper, _extends({
358
446
  state: state
359
447
  }, rest), /*#__PURE__*/_react.default.createElement(BmImage, {
@@ -376,26 +464,26 @@ const MessageState = exports.MessageState = _styledComponents.default.div.withCo
376
464
 
377
465
  const RepliedTextWrapper = exports.RepliedTextWrapper = _styledComponents.default.div.withConfig({
378
466
  displayName: "chatBody__RepliedTextWrapper"
379
- })(["display:flex;flex-direction:column;justify-content:center;padding:1.14286rem 1.14286rem 1.14286rem 0.35714rem;gap:1rem;border-radius:0.25rem 0.25rem 0.25rem 0.25rem;border:1px solid ", ";background:", ";color:", ";"], _colors.BmGrey200, _ref22 => {
467
+ })(["display:flex;flex-direction:column;justify-content:center;padding:1.14286rem 1.14286rem 1.14286rem 0.35714rem;gap:1rem;border-radius:0.25rem 0.25rem 0.25rem 0.25rem;border:1px solid ", ";background:", ";color:", ";"], _colors.BmGrey200, _ref27 => {
380
468
  let {
381
469
  state
382
- } = _ref22;
470
+ } = _ref27;
383
471
  if (state) {
384
472
  if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
385
473
  if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
386
474
  }
387
475
  return "".concat(_colors.BmPrimaryWhite);
388
- }, _ref23 => {
476
+ }, _ref28 => {
389
477
  let {
390
478
  state
391
- } = _ref23;
479
+ } = _ref28;
392
480
  if (state) {
393
481
  if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
394
482
  if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
395
483
  }
396
484
  return "".concat(_colors.BmPrimaryWhite);
397
485
  });
398
- const QuickReplyRender = _ref24 => {
486
+ const QuickReplyRender = _ref29 => {
399
487
  let {
400
488
  content,
401
489
  options,
@@ -408,7 +496,7 @@ const QuickReplyRender = _ref24 => {
408
496
  action,
409
497
  header,
410
498
  footer
411
- } = _ref24;
499
+ } = _ref29;
412
500
  const MEDIA_TYPES = ['document', 'image', 'video'];
413
501
  const renderers = {
414
502
  dotgo_v3: () => {
@@ -447,7 +535,7 @@ const QuickReplyRender = _ref24 => {
447
535
  isImg: true
448
536
  }, /*#__PURE__*/_react.default.createElement(ConnectorRenderer, null));
449
537
  };
450
- const ImageRender = _ref25 => {
538
+ const ImageRender = _ref30 => {
451
539
  let {
452
540
  type,
453
541
  state,
@@ -456,7 +544,7 @@ const ImageRender = _ref25 => {
456
544
  connector,
457
545
  caption,
458
546
  originalUrl
459
- } = _ref25;
547
+ } = _ref30;
460
548
  const renderers = {
461
549
  dotgo_v3: () => {
462
550
  var _caption$text;
@@ -482,14 +570,68 @@ const ImageRender = _ref25 => {
482
570
  isImg: true
483
571
  }, /*#__PURE__*/_react.default.createElement(ConnectorRenderer, null));
484
572
  };
485
- const ProductDetailRender = _ref26 => {
573
+ const CallRender = _ref31 => {
574
+ let {
575
+ type,
576
+ state,
577
+ isInteractive,
578
+ connector,
579
+ message,
580
+ status,
581
+ call_started_at
582
+ } = _ref31;
583
+ const duration = useCallDuration(status === 'in_progress', call_started_at);
584
+ const renderers = {
585
+ yeastar: () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, status === 'in_progress' && /*#__PURE__*/_react.default.createElement(CallContainer, {
586
+ state: state
587
+ }, /*#__PURE__*/_react.default.createElement(IconContainer, {
588
+ state: state
589
+ }, state === 'inbound' ? /*#__PURE__*/_react.default.createElement(_PhoneCallbackOutlined.default, {
590
+ sx: {
591
+ color: '#4A5565'
592
+ }
593
+ }) : /*#__PURE__*/_react.default.createElement(_PhoneOutlined.default, null)), /*#__PURE__*/_react.default.createElement(CallInfoContainer, {
594
+ state: state
595
+ }, /*#__PURE__*/_react.default.createElement("h4", null, /*#__PURE__*/_react.default.createElement("strong", null, "Voice Call")), /*#__PURE__*/_react.default.createElement("p", null, duration))), status === 'answered' && /*#__PURE__*/_react.default.createElement(CallContainer, {
596
+ state: state
597
+ }, /*#__PURE__*/_react.default.createElement(IconContainer, {
598
+ state: state
599
+ }, state === 'inbound' ? /*#__PURE__*/_react.default.createElement(_PhoneCallbackOutlined.default, {
600
+ sx: {
601
+ color: '#4A5565'
602
+ }
603
+ }) : /*#__PURE__*/_react.default.createElement(_PhoneOutlined.default, null)), /*#__PURE__*/_react.default.createElement(CallInfoContainer, {
604
+ state: state
605
+ }, /*#__PURE__*/_react.default.createElement("h4", null, /*#__PURE__*/_react.default.createElement("strong", null, "Voice Call")), /*#__PURE__*/_react.default.createElement("p", null, formatCallDuration(message.talk_duration)))), status === 'no answer' && /*#__PURE__*/_react.default.createElement(CallContainer, {
606
+ state: state
607
+ }, /*#__PURE__*/_react.default.createElement(IconContainer, {
608
+ state: state
609
+ }, /*#__PURE__*/_react.default.createElement(_PhoneMissed.default, {
610
+ sx: {
611
+ color: '#e64d4dff'
612
+ }
613
+ })), /*#__PURE__*/_react.default.createElement(CallInfoContainer, {
614
+ state: state
615
+ }, /*#__PURE__*/_react.default.createElement("h4", null, /*#__PURE__*/_react.default.createElement("strong", null, "Voice Call")), /*#__PURE__*/_react.default.createElement("p", null, "No answer"))))
616
+ };
617
+ const FallbackRenderer = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, status));
618
+ const ConnectorRenderer = renderers[connector] || FallbackRenderer;
619
+ return /*#__PURE__*/_react.default.createElement(Messages, {
620
+ type: type,
621
+ state: state,
622
+ isInteractive: isInteractive,
623
+ connector: connector,
624
+ isImg: true
625
+ }, /*#__PURE__*/_react.default.createElement(ConnectorRenderer, null));
626
+ };
627
+ const ProductDetailRender = _ref32 => {
486
628
  let {
487
629
  type,
488
630
  state,
489
631
  header,
490
632
  body,
491
633
  isInteractive
492
- } = _ref26;
634
+ } = _ref32;
493
635
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
494
636
  type: type,
495
637
  state: state,
@@ -498,7 +640,7 @@ const ProductDetailRender = _ref26 => {
498
640
  state: state
499
641
  }, /*#__PURE__*/_react.default.createElement(_ShoppingCartOutlined.default, null), "Catalog")));
500
642
  };
501
- const ListReplyRender = _ref27 => {
643
+ const ListReplyRender = _ref33 => {
502
644
  let {
503
645
  title,
504
646
  body,
@@ -510,7 +652,7 @@ const ListReplyRender = _ref27 => {
510
652
  header,
511
653
  action,
512
654
  footer
513
- } = _ref27;
655
+ } = _ref33;
514
656
  const renderers = {
515
657
  dotgo_v3: () => {
516
658
  var _header$header$type3, _body$text2;
@@ -534,7 +676,7 @@ const ListReplyRender = _ref27 => {
534
676
  isInteractive: isInteractive
535
677
  }, /*#__PURE__*/_react.default.createElement(ConnectorRenderer, null)));
536
678
  };
537
- const OrderRender = _ref28 => {
679
+ const OrderRender = _ref34 => {
538
680
  let {
539
681
  amount,
540
682
  type,
@@ -543,14 +685,14 @@ const OrderRender = _ref28 => {
543
685
  product_items,
544
686
  connector,
545
687
  isInteractive
546
- } = _ref28;
688
+ } = _ref34;
547
689
  const renderers = {
548
- dotgo_v3: _ref29 => {
690
+ dotgo_v3: _ref35 => {
549
691
  let {
550
692
  displayItems,
551
693
  sumQuantities,
552
694
  setDisplayItems
553
- } = _ref29;
695
+ } = _ref35;
554
696
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(OrderBody, {
555
697
  state: state
556
698
  }, /*#__PURE__*/_react.default.createElement(CartContent, {
@@ -580,12 +722,12 @@ const OrderRender = _ref28 => {
580
722
  }, /*#__PURE__*/_react.default.createElement("p", null, displayItems ? 'HIDE' : 'SHOW', " CART ITEMS")));
581
723
  }
582
724
  };
583
- const FallbackRenderer = _ref30 => {
725
+ const FallbackRenderer = _ref36 => {
584
726
  let {
585
727
  sumQuantities,
586
728
  displayItems,
587
729
  setDisplayItems
588
- } = _ref30;
730
+ } = _ref36;
589
731
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(OrderBody, {
590
732
  state: state
591
733
  }, /*#__PURE__*/_react.default.createElement(CartContent, {
@@ -632,7 +774,7 @@ const OrderRender = _ref28 => {
632
774
  items: items
633
775
  })));
634
776
  };
635
- BmChat.Details = _ref31 => {
777
+ BmChat.Details = _ref37 => {
636
778
  var _children$message, _children$message2;
637
779
  let {
638
780
  children,
@@ -647,21 +789,13 @@ BmChat.Details = _ref31 => {
647
789
  sessionTimeline,
648
790
  feedPostComments,
649
791
  agentName,
650
- callLog,
651
792
  metadata,
652
793
  isInteractive,
653
794
  type,
654
795
  extension
655
- } = _ref31,
656
- rest = _objectWithoutProperties(_ref31, _excluded3);
657
- console.log({
658
- type
659
- });
660
- console.log(children);
661
- console.log(metadata);
662
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type === 'call' && /*#__PURE__*/_react.default.createElement(_CallLog.CallPill, {
663
- message: children.message
664
- }), /*#__PURE__*/_react.default.createElement(Details, _extends({
796
+ } = _ref37,
797
+ rest = _objectWithoutProperties(_ref37, _excluded3);
798
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Details, _extends({
665
799
  state: state
666
800
  }, rest), /*#__PURE__*/_react.default.createElement(MessageState, null, state === 'inbound' && session && handleState({
667
801
  state,
@@ -729,6 +863,10 @@ BmChat.Details = _ref31 => {
729
863
  type: type,
730
864
  state: state,
731
865
  connector: children === null || children === void 0 ? void 0 : children.connector
866
+ })), children.message.type === 'call' && /*#__PURE__*/_react.default.createElement(CallRender, _extends({}, children.message, {
867
+ type: type,
868
+ state: state,
869
+ connector: children === null || children === void 0 ? void 0 : children.connector
732
870
  }))) : type === 'pdf' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
733
871
  file: {
734
872
  url: "".concat(file)
@@ -737,11 +875,7 @@ BmChat.Details = _ref31 => {
737
875
  pageNumber: 1,
738
876
  height: "250",
739
877
  width: "200"
740
- }))) :
741
- // : type === 'call' ? (
742
- // <CallPill message={children.message} />
743
- // )
744
- type !== 'call' && /*#__PURE__*/_react.default.createElement(Messages, {
878
+ }))) : /*#__PURE__*/_react.default.createElement(Messages, {
745
879
  state: state
746
880
  }, children))), file && /*#__PURE__*/_react.default.createElement(BmFileAttachment, _extends({
747
881
  extension: extension,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "2.1.25",
3
+ "version": "2.1.27",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {