@microsoft/omnichannel-chat-widget 0.1.0-main.0c0fd47 → 0.1.0-main.0d1c6e4

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.
Files changed (102) hide show
  1. package/README.md +7 -34
  2. package/lib/cjs/common/Constants.js +12 -3
  3. package/lib/cjs/common/storage/default/defaultCacheManager.js +2 -2
  4. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
  5. package/lib/cjs/common/telemetry/TelemetryConstants.js +35 -4
  6. package/lib/cjs/common/telemetry/TelemetryHelper.js +2 -1
  7. package/lib/cjs/common/utils.js +23 -2
  8. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -19
  9. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
  10. package/lib/cjs/components/headerstateful/HeaderStateful.js +5 -2
  11. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
  12. package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +36 -0
  13. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
  14. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -10
  15. package/lib/cjs/components/livechatwidget/common/endChat.js +43 -63
  16. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +11 -49
  17. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +5 -5
  18. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -2
  19. package/lib/cjs/components/livechatwidget/common/startChat.js +70 -59
  20. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +81 -43
  21. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
  22. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
  23. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  24. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  25. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
  26. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
  27. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  28. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
  29. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
  30. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
  31. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  32. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +7 -3
  33. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +75 -11
  34. package/lib/cjs/contexts/common/ConversationEndEntity.js +12 -0
  35. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +10 -7
  36. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
  37. package/lib/cjs/contexts/createReducer.js +28 -2
  38. package/lib/cjs/hooks/useDebounce.js +28 -0
  39. package/lib/cjs/hooks/useWindowDimensions.js +30 -0
  40. package/lib/cjs/plugins/newMessageEventHandler.js +14 -0
  41. package/lib/esm/common/Constants.js +10 -2
  42. package/lib/esm/common/storage/default/defaultCacheManager.js +2 -2
  43. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
  44. package/lib/esm/common/telemetry/TelemetryConstants.js +35 -4
  45. package/lib/esm/common/telemetry/TelemetryHelper.js +2 -1
  46. package/lib/esm/common/utils.js +20 -0
  47. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -19
  48. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
  49. package/lib/esm/components/headerstateful/HeaderStateful.js +5 -2
  50. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
  51. package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +30 -0
  52. package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
  53. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -10
  54. package/lib/esm/components/livechatwidget/common/endChat.js +45 -65
  55. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -51
  56. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +6 -5
  57. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -3
  58. package/lib/esm/components/livechatwidget/common/startChat.js +70 -59
  59. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +82 -44
  60. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
  61. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
  62. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  63. package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  64. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
  65. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
  66. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  67. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
  68. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
  69. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
  70. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  71. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +5 -3
  72. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +75 -11
  73. package/lib/esm/contexts/common/ConversationEndEntity.js +5 -0
  74. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +10 -7
  75. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
  76. package/lib/esm/contexts/createReducer.js +28 -2
  77. package/lib/esm/hooks/useDebounce.js +22 -0
  78. package/lib/esm/hooks/useWindowDimensions.js +23 -0
  79. package/lib/esm/plugins/newMessageEventHandler.js +14 -0
  80. package/lib/types/common/Constants.d.ts +9 -0
  81. package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
  82. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
  83. package/lib/types/common/telemetry/TelemetryConstants.d.ts +31 -6
  84. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -0
  85. package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
  86. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
  87. package/lib/types/common/utils.d.ts +1 -0
  88. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +0 -7
  89. package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
  90. package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +6 -0
  91. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
  92. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +6 -1
  93. package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -3
  94. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +2 -0
  95. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
  96. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +1 -1
  97. package/lib/types/contexts/common/ConversationEndEntity.d.ts +4 -0
  98. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +5 -1
  99. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +10 -7
  100. package/lib/types/hooks/useDebounce.d.ts +3 -0
  101. package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
  102. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  export const defaultGeneralPreChatSurveyPaneStyleProps = {
2
2
  borderStyle: "solid",
3
3
  borderRadius: "inherit",
4
- borderWidth: "3px",
4
+ borderWidth: "0px",
5
5
  backgroundColor: "#FFFFFF",
6
6
  borderColor: "#F1F1F1",
7
7
  overflowY: "auto",
@@ -6,6 +6,7 @@ const FileAttachmentIconMap = {
6
6
  "aac": AudioIcon,
7
7
  "aiff": AudioIcon,
8
8
  "alac": AudioIcon,
9
+ "amr": AudioIcon,
9
10
  "avchd": VideoIcon,
10
11
  "avi": VideoIcon,
11
12
  "bmp": ImageIcon,
@@ -44,6 +45,7 @@ const FileAttachmentIconMap = {
44
45
  "vsdx": VisioIcon,
45
46
  "wav": AudioIcon,
46
47
  "webm": VideoIcon,
48
+ "webp": ImageIcon,
47
49
  "wma": AudioIcon,
48
50
  "wmv": VideoIcon,
49
51
  "xls": ExcelIcon,
@@ -51,9 +51,7 @@ export const activityStatusMiddleware = () => next => args => {
51
51
  style: {
52
52
  padding: "2px"
53
53
  }
54
- }, sendState === SendStatus.Sending && /*#__PURE__*/React.createElement(SendingTimestamp, {
55
- args: args
56
- }), sendState === SendStatus.SendFailed && /*#__PURE__*/React.createElement(NotDeliveredTimestamp, {
54
+ }, sendState === SendStatus.Sending && /*#__PURE__*/React.createElement(SendingTimestamp, null), sendState === SendStatus.SendFailed && /*#__PURE__*/React.createElement(NotDeliveredTimestamp, {
57
55
  args: args
58
56
  }), sendState === SendStatus.Sent && /*#__PURE__*/React.createElement(DeliveredTimestamp, {
59
57
  args: args,
@@ -229,7 +229,8 @@ const createAttachmentMiddleware = enableInlinePlaying => {
229
229
  renderer: next
230
230
  });
231
231
  }
232
- if (fileExtension === "txt") {
232
+ const isUnknownImageObject = contentType.toLowerCase().includes("image") && !imageExtension;
233
+ if (fileExtension === "txt" || isUnknownImageObject) {
233
234
  return /*#__PURE__*/React.createElement(Attachment, {
234
235
  iconData: iconData,
235
236
  textCard: patchAttachment(card, {
@@ -1,3 +1,3 @@
1
1
  export const defaultSystemMessageBoxStyles = {
2
- maxWidth: "75%"
2
+ maxWidth: "90%"
3
3
  };
@@ -1,3 +1,3 @@
1
1
  export const defaultUserMessageBoxStyles = {
2
- maxWidth: "75%"
2
+ maxWidth: "90%"
3
3
  };
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useEffect, useRef } from "react";
2
- import { HtmlAttributeNames } from "../../../../../../common/Constants";
3
2
  import { KeyCodes } from "../../../../../../common/KeyCodes";
4
3
  import { Stack } from "@fluentui/react";
5
4
  import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
@@ -50,9 +49,8 @@ export const NotDeliveredTimestamp = _ref => {
50
49
  timestampWebChatNodes[1].innerText = getTimestampHourMinute(timestamp);
51
50
  }
52
51
  }, [timestampRef]);
53
- const onRetryClick = useCallback(async event => {
52
+ const onRetryClick = useCallback(async () => {
54
53
  var _activity$channelData;
55
- removeNotDeliveredTimestamp(event);
56
54
  activity.previousClientActivityID = (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : _activity$channelData.clientActivityID;
57
55
  await postActivity(activity);
58
56
  focus("sendBox");
@@ -60,19 +58,9 @@ export const NotDeliveredTimestamp = _ref => {
60
58
  const onRetryKeyEnter = event => {
61
59
  if (event.code === KeyCodes.ENTER) {
62
60
  event.preventDefault();
63
- onRetryClick(event);
61
+ onRetryClick();
64
62
  }
65
63
  };
66
- const removeNotDeliveredTimestamp = event => {
67
- let parent = event.target.parentElement;
68
- while (parent.tagName !== HtmlAttributeNames.listItem) {
69
- parent = parent.parentElement;
70
- if (parent.tagName === HtmlAttributeNames.unorderedList) {
71
- return;
72
- }
73
- }
74
- parent.parentNode.removeChild(parent);
75
- };
76
64
  return /*#__PURE__*/React.createElement(Stack, {
77
65
  style: contentStyles,
78
66
  dir: dir,
@@ -2,29 +2,20 @@ import React from "react";
2
2
  import { Stack } from "@fluentui/react";
3
3
  import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
4
4
  import { defaultTimestampContentStyles } from "../defaultStyles/defaultTimestampContentStyles";
5
- import { getTimestampHourMinute } from "../../../../../../common/utils";
6
5
  import { useChatContextStore } from "../../../../../..";
7
6
 
8
7
  /* eslint @typescript-eslint/no-explicit-any: "off" */
9
- export const SendingTimestamp = _ref => {
8
+ export const SendingTimestamp = () => {
10
9
  var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
11
- let {
12
- args
13
- } = _ref;
14
10
  const [state] = useChatContextStore();
15
11
  const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
16
12
  const contentStyles = {
17
13
  ...defaultTimestampContentStyles,
18
14
  ...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
19
15
  };
20
- const {
21
- activity: {
22
- timestamp
23
- }
24
- } = args;
25
16
  return /*#__PURE__*/React.createElement(Stack, {
26
17
  style: contentStyles,
27
18
  dir: dir,
28
19
  horizontal: true
29
- }, /*#__PURE__*/React.createElement("span", null, " ", getTimestampHourMinute(timestamp)), /*#__PURE__*/React.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/React.createElement("span", null, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_SENDING) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_SENDING, " "));
20
+ }, /*#__PURE__*/React.createElement("span", null, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_SENDING) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_SENDING, " "));
30
21
  };
@@ -1,16 +1,17 @@
1
1
  /******
2
2
  * TypingIndicatorMiddleware
3
- *
3
+ *
4
4
  * This middleware changes the component that shows who's actively typing. It uses the default Microsoft LiveChatWidget styles.
5
5
  ******/
6
6
 
7
- import React from "react";
7
+ import React, { useCallback } from "react";
8
8
  import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
9
9
  import { defaultMiddlewareLocalizedTexts } from "../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
10
10
  import { defaultTypingIndicatorBubbleStyles } from "./defaultStyles/defaultTypingIndicatorBubbleStyles";
11
11
  import { defaultTypingIndicatorContainerStyles } from "./defaultStyles/defaultTypingIndicatorContainerStyles";
12
12
  import { defaultTypingIndicatorMessageStyles } from "./defaultStyles/defaultTypingIndicatorMessageStyles";
13
13
  import { useChatContextStore } from "../../../../..";
14
+ import { debounceLeading } from "../../../../../common/utils";
14
15
  import useChatSDKStore from "../../../../../hooks/useChatSDKStore";
15
16
 
16
17
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -23,6 +24,7 @@ const TypingIndicator = _ref => {
23
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
25
  const chatSDK = useChatSDKStore();
25
26
  const [state] = useChatContextStore();
27
+ const debounceTyping = useCallback(debounceLeading(() => chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.sendTypingEvent()), []);
26
28
  if (!activeTyping || Object.keys(activeTyping).length === 0 || ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.LiveChatVersion) === 1 && !visible) {
27
29
  return null;
28
30
  }
@@ -32,7 +34,7 @@ const TypingIndicator = _ref => {
32
34
  var _state$domainStates$l2;
33
35
  //visible is set to false if the current user is typing, in which case, we just send typing indicator to OC
34
36
  if (((_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.LiveChatVersion) === 2 && !visible) {
35
- chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.sendTypingEvent();
37
+ debounceTyping();
36
38
  return null;
37
39
  }
38
40
  activeTyping.splice(i, 1);
@@ -4,26 +4,30 @@
4
4
  * Checks if the attachment being uploaded satisfies Omnichannel's requirement on file extensions and file size.
5
5
  ******/
6
6
 
7
+ import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
7
8
  import { NotificationHandler } from "../../notification/NotificationHandler";
8
9
  import { NotificationScenarios } from "../../enums/NotificationScenarios";
9
10
  import { WebChatActionType } from "../../enums/WebChatActionType";
11
+ import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
12
+ import { AMSConstants } from "../../../../../common/Constants";
10
13
  const MBtoBRatio = 1000000;
11
14
 
12
15
  /*
13
16
  * If an attachment is invalid, delete this attachment from the attachments list
14
17
  * If the result attachment list is empty, return a dummy action
15
18
  */
16
- const validateAttachment = (action, allowedFileExtensions, maxUploadFileSize, localizedTexts) => {
19
+ const validateAttachment = (action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts) => {
17
20
  var _action$payload, _action$payload$activ, _action$payload2, _action$payload2$acti, _action$payload2$acti2, _action$payload3, _action$payload3$acti, _action$payload3$acti2;
18
21
  const attachments = action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$activ = _action$payload.activity) === null || _action$payload$activ === void 0 ? void 0 : _action$payload$activ.attachments;
19
22
  const attachmentSizes = action === null || action === void 0 ? void 0 : (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : (_action$payload2$acti = _action$payload2.activity) === null || _action$payload2$acti === void 0 ? void 0 : (_action$payload2$acti2 = _action$payload2$acti.channelData) === null || _action$payload2$acti2 === void 0 ? void 0 : _action$payload2$acti2.attachmentSizes;
20
23
  if (attachments) {
21
24
  for (let i = 0; i < attachments.length; i++) {
25
+ const maxUploadFileSize = getMaxUploadFileSize(maxFileSizeSupportedByDynamics, attachments[i].contentType);
22
26
  const fileExtensionValid = validateFileExtension(attachments[i], allowedFileExtensions);
23
27
  const fileSizeValid = validateFileSize(attachmentSizes[i], maxUploadFileSize);
24
28
  const fileIsEmpty = parseInt(attachmentSizes[i]) == 0;
25
29
  if (!fileExtensionValid || !fileSizeValid || fileIsEmpty) {
26
- NotificationHandler.notifyError(NotificationScenarios.AttachmentError, buildErrorMessage(attachments[i].name, fileExtensionValid, fileSizeValid, fileIsEmpty, maxUploadFileSize, localizedTexts));
30
+ NotificationHandler.notifyError(NotificationScenarios.AttachmentError, buildErrorMessage(attachments[i].name, fileExtensionValid, fileSizeValid, fileIsEmpty, maxUploadFileSize.toString(), maxFileSizeSupportedByDynamics, localizedTexts));
27
31
  attachments.splice(i, 1);
28
32
  attachmentSizes.splice(i, 1);
29
33
  i--;
@@ -55,58 +59,118 @@ const validateFileExtension = (attachment, allowedFileExtensions) => {
55
59
  return allExtensions.indexOf(fileExtension) > -1;
56
60
  };
57
61
  const validateFileSize = (attachmentSize, maxUploadFileSize) => {
58
- return (maxUploadFileSize && parseInt(maxUploadFileSize) * MBtoBRatio) > parseInt(attachmentSize);
62
+ return maxUploadFileSize * MBtoBRatio > parseInt(attachmentSize);
59
63
  };
60
- const buildErrorMessage = (fileName, supportedFileExtension, supportedFileSize, fileIsEmpty, maxUploadFileSize, localizedTexts) => {
64
+ const getMaxUploadFileSize = (maxFileSizeSupportedByDynamicsStr, contentType) => {
65
+ const maxFileSizeSupportedByDynamics = maxFileSizeSupportedByDynamicsStr && parseInt(maxFileSizeSupportedByDynamicsStr) ? parseInt(maxFileSizeSupportedByDynamicsStr) : AMSConstants.maxSupportedFileSize;
66
+ const amsAttachmentSizeLimit = isImage(contentType) ? AMSConstants.maxSupportedImageSize : AMSConstants.maxSupportedFileSize;
67
+ // Takes the smallest max file size configure betteween AMS and Dynamics Config
68
+ return maxFileSizeSupportedByDynamics < amsAttachmentSizeLimit ? maxFileSizeSupportedByDynamics : amsAttachmentSizeLimit;
69
+ };
70
+ const isImage = contentType => {
71
+ return AMSConstants.supportedImagesMimeTypes.includes(contentType);
72
+ };
73
+ const buildErrorMessage = (fileName, supportedFileExtension, supportedFileSize, fileIsEmpty, maxUploadFileSize, maxFileSizeSupportedByDynamics, localizedTexts) => {
61
74
  let errorMessage = "";
62
75
  if (!fileName || !maxUploadFileSize) {
76
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
77
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
78
+ Description: "Attachment validation failed",
79
+ ExceptionDetails: {
80
+ ErrorDetails: "File provided is null"
81
+ }
82
+ });
63
83
  return localizedTexts.MIDDLEWARE_BANNER_FILE_NULL_ERROR ?? "";
64
84
  }
65
85
  if (!supportedFileExtension && !supportedFileSize) {
66
- errorMessage = getFileSizeAndFileExtensionErrorMessage(fileName, maxUploadFileSize, localizedTexts);
86
+ errorMessage = getFileSizeAndFileExtensionErrorMessage(fileName, maxUploadFileSize, maxFileSizeSupportedByDynamics, localizedTexts);
67
87
  } else if (!supportedFileSize) {
68
- errorMessage = getFileSizeErrorMessage(maxUploadFileSize, localizedTexts);
88
+ errorMessage = getFileSizeErrorMessage(maxUploadFileSize, maxFileSizeSupportedByDynamics, localizedTexts);
69
89
  } else if (!supportedFileExtension) {
70
90
  errorMessage = getFileExtensionErrorMessage(fileName, localizedTexts);
71
91
  } else if (fileIsEmpty) {
92
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
93
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
94
+ Description: "Attachment validation failed",
95
+ ExceptionDetails: {
96
+ ErrorDetails: "File provided is empty"
97
+ }
98
+ });
72
99
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_IS_EMPTY_ERROR ?? "";
73
100
  } else {
101
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
102
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
103
+ Description: "Attachment validation failed",
104
+ ExceptionDetails: {
105
+ ErrorDetails: `Unexpected error: supportedFileExtension=${supportedFileExtension} supportedFileSize=${supportedFileSize} fileIsEmpty=${!fileIsEmpty}`
106
+ }
107
+ });
74
108
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_ERROR_MESSAGE ?? "";
75
109
  }
76
110
  return errorMessage;
77
111
  };
78
- const getFileSizeAndFileExtensionErrorMessage = (fileName, maxUploadFileSize, localizedTexts) => {
112
+ const getFileSizeAndFileExtensionErrorMessage = (fileName, maxUploadFileSize, maxFileSizeSupportedByDynamics, localizedTexts) => {
79
113
  const index = fileName.lastIndexOf(".");
80
- let errorMessage;
114
+ let errorMessage, exceptionDetails;
81
115
  if (index < 0) {
82
116
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_SIZE_WITHOUT_EXTENSION_ERROR;
117
+ exceptionDetails = `File exceeded the allowed limit of ${maxUploadFileSize} MB and File provided without file extension`;
83
118
  } else {
84
119
  var _errorMessage;
85
120
  const fileExtension = fileName.substring(index);
86
121
  errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_SIZE_EXTENSION_ERROR;
122
+ exceptionDetails = `File exceeds the allowed limit of ${maxUploadFileSize} MB and ${fileExtension} files are not supported`;
87
123
  if ((_errorMessage = errorMessage) !== null && _errorMessage !== void 0 && _errorMessage.includes("{1}")) {
88
124
  errorMessage = errorMessage.replace("{1}", fileExtension);
89
125
  }
90
126
  }
127
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
128
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
129
+ Description: "Attachment validation failed",
130
+ ExceptionDetails: {
131
+ ErrorDetails: `${exceptionDetails} Dynamics file size limit=${maxFileSizeSupportedByDynamics} AMS image size limit=${AMSConstants.maxSupportedImageSize} AMS file size limit=${AMSConstants.maxSupportedFileSize}`
132
+ }
133
+ });
91
134
  return errorMessage ? errorMessage.includes("{0}") ? errorMessage.replace("{0}", maxUploadFileSize) : errorMessage : "";
92
135
  };
93
136
  const getFileExtensionErrorMessage = (fileName, localizedTexts) => {
94
137
  const index = fileName.lastIndexOf(".");
95
138
  if (index < 0) {
139
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
140
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
141
+ Description: "Attachment validation failed",
142
+ ExceptionDetails: {
143
+ ErrorDetails: "File provided without file extension"
144
+ }
145
+ });
96
146
  return localizedTexts.MIDDLEWARE_BANNER_FILE_WITHOUT_EXTENSION ?? "";
97
147
  } else {
98
148
  const fileExtension = fileName.substring(index);
149
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
150
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
151
+ Description: "Attachment validation failed",
152
+ ExceptionDetails: {
153
+ ErrorDetails: `${fileExtension} files extension is not supported.`
154
+ }
155
+ });
99
156
  const errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_EXTENSION_ERROR;
100
157
  return errorMessage ? errorMessage.includes("{0}") ? errorMessage.replace("{0}", fileExtension) : errorMessage : "";
101
158
  }
102
159
  };
103
- const getFileSizeErrorMessage = (maxUploadFileSize, localizedTexts) => {
160
+ const getFileSizeErrorMessage = (maxUploadFileSize, maxFileSizeSupportedByDynamics, localizedTexts) => {
161
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
162
+ Event: TelemetryEvent.AttachmentUploadValidatorMiddlewareFailed,
163
+ Description: "Attachment validation failed",
164
+ ExceptionDetails: {
165
+ ErrorDetails: `File exceeds the allowed limit of ${maxUploadFileSize}MB. Dynamics file size limit=${maxFileSizeSupportedByDynamics} AMS image size limit=${AMSConstants.maxSupportedImageSize} AMS file size limit=${AMSConstants.maxSupportedFileSize}`
166
+ }
167
+ });
104
168
  const errorMessage = localizedTexts.MIDDLEWARE_BANNER_FILE_SIZE_ERROR;
105
169
  return errorMessage ? errorMessage.includes("{0}") ? errorMessage.replace("{0}", maxUploadFileSize) : errorMessage : "";
106
170
  };
107
171
 
108
172
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
109
- const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxUploadFileSize, localizedTexts) => _ref => {
173
+ const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts) => _ref => {
110
174
  let {
111
175
  dispatch
112
176
  } = _ref;
@@ -117,7 +181,7 @@ const createAttachmentUploadValidatorMiddleware = (allowedFileExtensions, maxUpl
117
181
  payload
118
182
  } = action;
119
183
  if (payload !== null && payload !== void 0 && (_payload$activity = payload.activity) !== null && _payload$activity !== void 0 && _payload$activity.attachments && payload !== null && payload !== void 0 && (_payload$activity2 = payload.activity) !== null && _payload$activity2 !== void 0 && (_payload$activity2$ch = _payload$activity2.channelData) !== null && _payload$activity2$ch !== void 0 && _payload$activity2$ch.attachmentSizes && (payload === null || payload === void 0 ? void 0 : (_payload$activity3 = payload.activity) === null || _payload$activity3 === void 0 ? void 0 : (_payload$activity3$at = _payload$activity3.attachments) === null || _payload$activity3$at === void 0 ? void 0 : _payload$activity3$at.length) === (payload === null || payload === void 0 ? void 0 : (_payload$activity4 = payload.activity) === null || _payload$activity4 === void 0 ? void 0 : (_payload$activity4$ch = _payload$activity4.channelData) === null || _payload$activity4$ch === void 0 ? void 0 : (_payload$activity4$ch2 = _payload$activity4$ch.attachmentSizes) === null || _payload$activity4$ch2 === void 0 ? void 0 : _payload$activity4$ch2.length)) {
120
- return next(validateAttachment(action, allowedFileExtensions, maxUploadFileSize, localizedTexts));
184
+ return next(validateAttachment(action, allowedFileExtensions, maxFileSizeSupportedByDynamics, localizedTexts));
121
185
  }
122
186
  }
123
187
  return next(action);
@@ -0,0 +1,5 @@
1
+ export let ConversationEndEntity;
2
+ (function (ConversationEndEntity) {
3
+ ConversationEndEntity[ConversationEndEntity["Customer"] = 0] = "Customer";
4
+ ConversationEndEntity[ConversationEndEntity["Agent"] = 1] = "Agent";
5
+ })(ConversationEndEntity || (ConversationEndEntity = {}));
@@ -29,11 +29,14 @@ export let LiveChatWidgetActionType;
29
29
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 26] = "SET_RECONNECT_ID";
30
30
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 27] = "SET_UNREAD_MESSAGE_COUNT";
31
31
  LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 28] = "SET_FOCUS_CHAT_BUTTON";
32
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 29] = "SET_CONVERSATION_ENDED_BY_AGENT";
33
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 30] = "SET_WIDGET_STATE";
34
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 31] = "SET_LIVE_CHAT_CONTEXT";
35
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 32] = "SET_BOT_OAUTH_SIGNIN_ID";
36
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 33] = "SET_WIDGET_SIZE";
37
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 34] = "SET_WIDGET_INSTANCE_ID";
38
- LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 35] = "SET_LIVE_CHAT_CONFIG";
32
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED"] = 29] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
33
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 30] = "SET_CONVERSATION_ENDED_BY";
34
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 31] = "SET_WIDGET_STATE";
35
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 32] = "SET_LIVE_CHAT_CONTEXT";
36
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 33] = "SET_BOT_OAUTH_SIGNIN_ID";
37
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 34] = "SET_WIDGET_SIZE";
38
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 35] = "SET_WIDGET_INSTANCE_ID";
39
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 36] = "SET_LIVE_CHAT_CONFIG";
40
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 37] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
41
+ LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 38] = "SET_SHOULD_USE_BOT_SURVEY";
39
42
  })(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
@@ -2,10 +2,12 @@ import { ConversationState } from "./ConversationState";
2
2
  import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
3
3
  import { getWidgetCacheId, isNullOrUndefined } from "../../common/utils";
4
4
  import { defaultClientDataStoreProvider } from "../../common/storage/default/defaultClientDataStoreProvider";
5
+ import { Constants } from "../../common/Constants";
5
6
  export const getLiveChatWidgetContextInitialState = props => {
6
- var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$webChatContain;
7
+ var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$controlProps2, _props$webChatContain;
7
8
  const widgetCacheId = getWidgetCacheId(props === null || props === void 0 ? void 0 : (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId, props === null || props === void 0 ? void 0 : (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
8
- const initialState = defaultClientDataStoreProvider().getData(widgetCacheId, "localStorage");
9
+ const cacheTtlInMins = (props === null || props === void 0 ? void 0 : (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.cacheTtlInMins) ?? Constants.CacheTtlInMinutes;
10
+ const initialState = defaultClientDataStoreProvider(cacheTtlInMins).getData(widgetCacheId, "localStorage");
9
11
  if (!isNullOrUndefined(initialState)) {
10
12
  return JSON.parse(initialState);
11
13
  }
@@ -43,7 +45,10 @@ export const getLiveChatWidgetContextInitialState = props => {
43
45
  },
44
46
  e2vvEnabled: false,
45
47
  unreadMessageCount: 0,
46
- conversationEndedByAgent: false
48
+ conversationEndedByAgentEventReceived: false,
49
+ conversationEndedBy: undefined,
50
+ postChatWorkflowInProgress: false,
51
+ shouldUseBotSurvey: false
47
52
  },
48
53
  uiStates: {
49
54
  showConfirmationPane: false,
@@ -258,12 +258,20 @@ export const createReducer = () => {
258
258
  return {
259
259
  ...action.payload
260
260
  };
261
- case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT:
261
+ case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED:
262
262
  return {
263
263
  ...state,
264
264
  appStates: {
265
265
  ...state.appStates,
266
- conversationEndedByAgent: action.payload
266
+ conversationEndedByAgentEventReceived: action.payload
267
+ }
268
+ };
269
+ case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY:
270
+ return {
271
+ ...state,
272
+ appStates: {
273
+ ...state.appStates,
274
+ conversationEndedBy: action.payload
267
275
  }
268
276
  };
269
277
  case LiveChatWidgetActionType.SET_WIDGET_SIZE:
@@ -293,6 +301,24 @@ export const createReducer = () => {
293
301
  liveChatConfig: action.payload
294
302
  }
295
303
  };
304
+ case LiveChatWidgetActionType.SET_POST_CHAT_WORKFLOW_IN_PROGRESS:
305
+ return {
306
+ ...state,
307
+ appStates: {
308
+ ...state.appStates,
309
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
310
+ postChatWorkflowInProgress: action.payload
311
+ }
312
+ };
313
+ case LiveChatWidgetActionType.SET_SHOULD_USE_BOT_SURVEY:
314
+ return {
315
+ ...state,
316
+ appStates: {
317
+ ...state.appStates,
318
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
319
+ shouldUseBotSurvey: action.payload
320
+ }
321
+ };
296
322
  default:
297
323
  return state;
298
324
  }
@@ -0,0 +1,22 @@
1
+ import { useRef, useEffect } from "react";
2
+ export default function useDebounce(func) {
3
+ let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
4
+ const timer = useRef();
5
+ useEffect(() => {
6
+ return () => {
7
+ if (!timer.current) return;
8
+ clearTimeout(timer.current);
9
+ };
10
+ }, []);
11
+ const debouncedFunction = function () {
12
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
13
+ args[_key] = arguments[_key];
14
+ }
15
+ const newTimer = setTimeout(() => {
16
+ func(...args);
17
+ }, delay);
18
+ clearTimeout(timer.current);
19
+ timer.current = newTimer;
20
+ };
21
+ return debouncedFunction;
22
+ }
@@ -0,0 +1,23 @@
1
+ import { useState, useEffect } from "react";
2
+ import useDebounce from "./useDebounce";
3
+ function getWindowDimensions() {
4
+ const {
5
+ innerWidth: width,
6
+ innerHeight: height
7
+ } = window;
8
+ return {
9
+ width,
10
+ height
11
+ };
12
+ }
13
+ export default function useWindowDimensions() {
14
+ let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200;
15
+ const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());
16
+ const handleResize = () => setWindowDimensions(getWindowDimensions());
17
+ const debouncedHandleResize = useDebounce(handleResize, delay);
18
+ useEffect(() => {
19
+ window.addEventListener("resize", debouncedHandleResize);
20
+ return () => window.removeEventListener("resize", debouncedHandleResize);
21
+ }, []);
22
+ return windowDimensions;
23
+ }
@@ -9,6 +9,7 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
9
9
  const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
10
10
  raiseMessageEvent(activity, isHistoryMessage);
11
11
  };
12
+ let isHistoryMessageReceivedEventRasied = false;
12
13
  const raiseMessageEvent = (activity, isHistoryMessage) => {
13
14
  if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
14
15
  var _text, _text2, _activity$channelData4, _activity$from;
@@ -39,6 +40,10 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
39
40
  if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.systemMessageTag)) {
40
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
42
  payload.messageType = Constants.systemMessageTag;
43
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
44
+ Event: TelemetryEvent.SystemMessageReceived,
45
+ Description: "System message received"
46
+ });
42
47
  } else {
43
48
  var _activity$channelData7, _activity$channelData8, _activity$channelData9;
44
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -63,6 +68,15 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
63
68
  Description: "New message received",
64
69
  Data: payload
65
70
  });
71
+ } else {
72
+ if (!isHistoryMessageReceivedEventRasied) {
73
+ isHistoryMessageReceivedEventRasied = true;
74
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
75
+ Event: TelemetryEvent.HistoryMessageReceived,
76
+ Description: "History message received",
77
+ Data: payload
78
+ });
79
+ }
66
80
  }
67
81
  }
68
82
  }
@@ -17,6 +17,8 @@ export declare class Constants {
17
17
  static readonly true = "true";
18
18
  static readonly false = "false";
19
19
  static readonly maximumUnreadMessageCount = 99;
20
+ static readonly userParticipantTypeTag = "User";
21
+ static readonly botParticipantTypeTag = "Bot";
20
22
  static readonly channelIdKey = "ChannelId-";
21
23
  static readonly ChannelId = "lcw";
22
24
  static readonly CustomerTag = "FromCustomer";
@@ -78,6 +80,7 @@ export declare class Constants {
78
80
  static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
79
81
  static readonly PostChatLoadingDurationInMs = 2000;
80
82
  static readonly BrowserUnloadConfirmationMessage = "Do you want to leave chat?";
83
+ static readonly CacheTtlInMinutes = 15;
81
84
  }
82
85
  export declare const Regex: {
83
86
  new (): {};
@@ -125,6 +128,7 @@ export declare class HtmlAttributeNames {
125
128
  static readonly adaptiveCardClassName = "ac-adaptiveCard";
126
129
  static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
127
130
  static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
131
+ static readonly adaptiveCardActionSetClassName = "ac-actionSet";
128
132
  }
129
133
  export declare class WebChatMiddlewareConstants {
130
134
  static readonly nextVisibleActivity = "nextVisibleActivity";
@@ -132,6 +136,11 @@ export declare class WebChatMiddlewareConstants {
132
136
  static readonly maxTextLength = 6000;
133
137
  static readonly adaptiveCard = "AdaptiveCard";
134
138
  }
139
+ export declare class AMSConstants {
140
+ static readonly supportedImagesMimeTypes: string[];
141
+ static readonly maxSupportedImageSize = 20;
142
+ static readonly maxSupportedFileSize = 300;
143
+ }
135
144
  export declare class MimeTypes {
136
145
  static readonly UnknownFileType = "application/octet-stream";
137
146
  }
@@ -1,4 +1,4 @@
1
1
  export declare class defaultCacheManager {
2
2
  static InternalCache: any;
3
3
  }
4
- export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string) => void;
4
+ export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string, ttlInMins: number) => void;
@@ -1,2 +1,2 @@
1
1
  import { IContextDataStore } from "../../interfaces/IContextDataStore";
2
- export declare const defaultClientDataStoreProvider: () => IContextDataStore;
2
+ export declare const defaultClientDataStoreProvider: (cacheTtlinMins?: number) => IContextDataStore;