@microsoft/omnichannel-chat-widget 1.0.2 → 1.0.3-main.1acfc60

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 (103) hide show
  1. package/lib/cjs/common/Constants.js +54 -1
  2. package/lib/cjs/common/storage/default/defaultCacheManager.js +7 -6
  3. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +9 -7
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +7 -1
  5. package/lib/cjs/common/utils.js +27 -5
  6. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +1 -10
  7. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -6
  8. package/lib/cjs/components/footerstateful/FooterStateful.js +1 -1
  9. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -1
  10. package/lib/cjs/components/headerstateful/HeaderStateful.js +14 -13
  11. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +1 -0
  12. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +1 -0
  13. package/lib/cjs/components/livechatwidget/common/Deferred.js +2 -3
  14. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +11 -3
  15. package/lib/cjs/components/livechatwidget/common/endChat.js +197 -99
  16. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +41 -21
  17. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +11 -8
  18. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +139 -0
  19. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -255
  20. package/lib/cjs/components/livechatwidget/common/startChat.js +85 -69
  21. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +162 -100
  22. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +2 -2
  23. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +18 -8
  24. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -2
  25. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -4
  26. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -1
  27. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +1 -0
  28. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -1
  29. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +1 -0
  30. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +62 -0
  31. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -6
  32. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +25 -12
  33. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +7 -1
  34. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -0
  35. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +16 -13
  36. package/lib/cjs/contexts/createReducer.js +13 -23
  37. package/lib/cjs/controller/componentController.js +2 -1
  38. package/lib/cjs/index.js +20 -0
  39. package/lib/esm/common/Constants.js +49 -0
  40. package/lib/esm/common/storage/default/defaultCacheManager.js +5 -4
  41. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +9 -7
  42. package/lib/esm/common/telemetry/TelemetryConstants.js +7 -1
  43. package/lib/esm/common/utils.js +25 -4
  44. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -13
  45. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -6
  46. package/lib/esm/components/footerstateful/FooterStateful.js +1 -1
  47. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -1
  48. package/lib/esm/components/headerstateful/HeaderStateful.js +14 -13
  49. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +1 -0
  50. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +1 -0
  51. package/lib/esm/components/livechatwidget/common/Deferred.js +2 -3
  52. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +11 -3
  53. package/lib/esm/components/livechatwidget/common/endChat.js +196 -99
  54. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +41 -21
  55. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +11 -8
  56. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +130 -0
  57. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -255
  58. package/lib/esm/components/livechatwidget/common/startChat.js +86 -70
  59. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +164 -102
  60. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +2 -2
  61. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +18 -8
  62. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -2
  63. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -4
  64. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -1
  65. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +1 -0
  66. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -1
  67. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +1 -0
  68. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +54 -0
  69. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -6
  70. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +25 -12
  71. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +7 -1
  72. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -0
  73. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -15
  74. package/lib/esm/contexts/createReducer.js +13 -23
  75. package/lib/esm/controller/componentController.js +2 -1
  76. package/lib/esm/index.js +4 -1
  77. package/lib/types/common/Constants.d.ts +21 -0
  78. package/lib/types/common/interfaces/IContextDataStore.d.ts +3 -3
  79. package/lib/types/common/storage/default/defaultCacheManager.d.ts +2 -1
  80. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -1
  81. package/lib/types/common/telemetry/TelemetryConstants.d.ts +7 -1
  82. package/lib/types/common/utils.d.ts +3 -2
  83. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +6 -0
  84. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +2 -1
  85. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
  86. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
  87. package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +9 -0
  88. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -6
  89. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
  90. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +4 -0
  91. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +1 -0
  92. package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -0
  93. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +8 -7
  94. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
  95. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +2 -1
  96. package/lib/types/index.d.ts +3 -0
  97. package/package.json +2 -1
  98. package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +0 -36
  99. package/lib/cjs/contexts/common/ConversationEndEntity.js +0 -12
  100. package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +0 -30
  101. package/lib/esm/contexts/common/ConversationEndEntity.js +0 -5
  102. package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +0 -6
  103. package/lib/types/contexts/common/ConversationEndEntity.d.ts +0 -4
@@ -23,27 +23,34 @@ _defineProperty(Constants, "false", "false");
23
23
  _defineProperty(Constants, "maximumUnreadMessageCount", 99);
24
24
  _defineProperty(Constants, "userParticipantTypeTag", "User");
25
25
  _defineProperty(Constants, "botParticipantTypeTag", "Bot");
26
+ // channelDataMiddleware
26
27
  _defineProperty(Constants, "channelIdKey", "ChannelId-");
27
28
  _defineProperty(Constants, "ChannelId", "lcw");
28
29
  _defineProperty(Constants, "CustomerTag", "FromCustomer");
30
+ // gifUploadMiddleware
29
31
  _defineProperty(Constants, "GifContentType", "image/gif");
32
+ // htmlPlayerMiddleware
30
33
  _defineProperty(Constants, "video", "video");
31
34
  _defineProperty(Constants, "audio", "audio");
32
35
  _defineProperty(Constants, "controlsList", "controlsList");
33
36
  _defineProperty(Constants, "nodownload", "nodownload");
37
+ // htmlTextMiddleware
34
38
  _defineProperty(Constants, "activity", "activity");
35
39
  _defineProperty(Constants, "payload", "payload");
36
40
  _defineProperty(Constants, "text", "text");
37
41
  _defineProperty(Constants, "blank", "_blank");
42
+ // activityMiddleware
38
43
  _defineProperty(Constants, "visitorIdPrefix", "8:");
39
44
  _defineProperty(Constants, "left", "left");
40
45
  _defineProperty(Constants, "queuePositionMessageTag", "queueposition");
41
46
  _defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
42
47
  _defineProperty(Constants, "message", "message");
43
48
  _defineProperty(Constants, "hiddenTag", "Hidden");
49
+ // messageTimestampMiddleware
44
50
  _defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
45
51
  _defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
46
52
  _defineProperty(Constants, "publicMessageTag", "public");
53
+ //attachmentMiddleware
47
54
  _defineProperty(Constants, "supportedAdaptiveCardContentTypes", ["application/vnd.microsoft.card.adaptive", "application/vnd.microsoft.card.audio", "application/vnd.microsoft.card.hero", "application/vnd.microsoft.card.receipt", "application/vnd.microsoft.card.thumbnail", "application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"]);
48
55
  _defineProperty(Constants, "maxUploadFileSize", "500000");
49
56
  _defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp|webp)$/i);
@@ -51,6 +58,7 @@ _defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|amr|flac|mp2|m
51
58
  _defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
52
59
  _defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
53
60
  _defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
61
+ // calling container event names
54
62
  _defineProperty(Constants, "CallAdded", "callAdded");
55
63
  _defineProperty(Constants, "LocalVideoStreamAdded", "localVideoStreamAdded");
56
64
  _defineProperty(Constants, "LocalVideoStreamRemoved", "localVideoStreamRemoved");
@@ -65,12 +73,18 @@ _defineProperty(Constants, "VoiceVideoNotLoaded", "voiceVideoNotLoaded");
65
73
  _defineProperty(Constants, "VoiceVideoLoadingException", "voiceVideoLoadingOnException");
66
74
  _defineProperty(Constants, "VoiceVideoAcceptCallException", "voiceVideoAcceptCallOnException");
67
75
  _defineProperty(Constants, "VoiceVideoAcceptCallWithVideoException", "voiceVideoAcceptCallWithVideoException");
76
+ // download transcript
68
77
  _defineProperty(Constants, "defaultDownloadTranscriptError", "Download transcript failed.");
78
+ // proactive chat
69
79
  _defineProperty(Constants, "ProactiveChatInviteTimeoutInMs", 60000);
80
+ // 1 minute
81
+ // prechat survey
70
82
  _defineProperty(Constants, "InputSubmit", "InputSubmit");
83
+ // reconnect chat
71
84
  _defineProperty(Constants, "ReconnectIdAttributeName", "oc.reconnectid");
72
85
  _defineProperty(Constants, "LiveChatWidget", "LiveChatWidgetNew");
73
86
  _defineProperty(Constants, "GuidPattern", "xx-x-4m-ym-xxx");
87
+ // Markdown plugin
74
88
  _defineProperty(Constants, "Default", "default");
75
89
  _defineProperty(Constants, "Zero", "zero");
76
90
  _defineProperty(Constants, "Title", "title");
@@ -78,13 +92,18 @@ _defineProperty(Constants, "Target", "target");
78
92
  _defineProperty(Constants, "Blank", "_blank");
79
93
  _defineProperty(Constants, "TargetRelationship", "rel");
80
94
  _defineProperty(Constants, "TargetRelationshipAttributes", "noopener noreferrer");
95
+ // Markdown icons
81
96
  _defineProperty(Constants, "OpenLinkIconCssClass", "webchat__markdown__external-link-icon");
97
+ // internet connection test
82
98
  _defineProperty(Constants, "internetConnectionTestUrl", "https://ocsdk-prod.azureedge.net/public/connecttest.txt");
83
99
  _defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect Test");
84
100
  _defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
85
101
  _defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
86
102
  _defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
87
103
  _defineProperty(Constants, "CacheTtlInMinutes", 15);
104
+ _defineProperty(Constants, "SessionCacheSuffix", "session");
105
+ _defineProperty(Constants, "PopoutCacheSuffix", "popout");
106
+ // Visibility timeout for conversation details
88
107
  _defineProperty(Constants, "LWICheckOnVisibilityTimeout", 3 * 60 * 1000);
89
108
  export const Regex = (_class = class Regex {}, _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
90
109
  export class HtmlIdNames {}
@@ -130,11 +149,13 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-action
130
149
  export class WebChatMiddlewareConstants {}
131
150
  _defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
132
151
  _defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
152
+ //5 minutes
133
153
  _defineProperty(WebChatMiddlewareConstants, "maxTextLength", 6000);
134
154
  _defineProperty(WebChatMiddlewareConstants, "adaptiveCard", "AdaptiveCard");
135
155
  export class AMSConstants {}
136
156
  _defineProperty(AMSConstants, "supportedImagesMimeTypes", ["image/jpeg", "image/png", "image/gif", "image/heic", "image/webp"]);
137
157
  _defineProperty(AMSConstants, "maxSupportedImageSize", 20);
158
+ // AMS max file limit outside of supported Images MIME Types.
138
159
  _defineProperty(AMSConstants, "maxSupportedFileSize", 300);
139
160
  export class MimeTypes {}
140
161
  _defineProperty(MimeTypes, "UnknownFileType", "application/octet-stream");
@@ -169,6 +190,29 @@ export let LiveWorkItemState;
169
190
  LiveWorkItemState["Waiting"] = "Waiting";
170
191
  LiveWorkItemState["WrapUp"] = "WrapUp";
171
192
  })(LiveWorkItemState || (LiveWorkItemState = {}));
193
+ export let StorageType;
194
+ (function (StorageType) {
195
+ StorageType[StorageType["localStorage"] = 0] = "localStorage";
196
+ StorageType[StorageType["sessionStorage"] = 1] = "sessionStorage";
197
+ })(StorageType || (StorageType = {}));
198
+ export let ParticipantType;
199
+ (function (ParticipantType) {
200
+ ParticipantType["User"] = "User";
201
+ ParticipantType["Bot"] = "Bot";
202
+ })(ParticipantType || (ParticipantType = {}));
203
+ export let ConversationEndEntity;
204
+ (function (ConversationEndEntity) {
205
+ ConversationEndEntity["Customer"] = "Customer";
206
+ ConversationEndEntity["Agent"] = "Agent";
207
+ ConversationEndEntity["Bot"] = "Bot";
208
+ ConversationEndEntity["NotSet"] = "NotSet";
209
+ })(ConversationEndEntity || (ConversationEndEntity = {}));
210
+ export let ConfirmationState;
211
+ (function (ConfirmationState) {
212
+ ConfirmationState["Ok"] = "Ok";
213
+ ConfirmationState["Cancel"] = "Cancel";
214
+ ConfirmationState["NotSet"] = "NotSet";
215
+ })(ConfirmationState || (ConfirmationState = {}));
172
216
  export class TranscriptConstants {}
173
217
  _defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
174
218
  _defineProperty(TranscriptConstants, "TranscriptMessageEmojiMessageType", "http://schema.skype.com/emoji");
@@ -181,11 +225,16 @@ _defineProperty(TranscriptConstants, "InternalMode", "internal");
181
225
  _defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
182
226
  _defineProperty(TranscriptConstants, "AgentFontColor", "white");
183
227
  export class AriaTelemetryConstants {}
228
+ // Aria Endpoint for different environment types.
184
229
  _defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
185
230
  _defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
186
231
  _defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
187
232
  _defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
233
+ // EUDB Collector URL
188
234
  _defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
235
+ // Add MoonCake ARIA Endpoint whenever available
236
+ // Environment types
189
237
  _defineProperty(AriaTelemetryConstants, "Public", "Public");
190
238
  _defineProperty(AriaTelemetryConstants, "EU", "Europe");
239
+ // EUR: crm4; FRA: crm12; GER: crm16; CHE: crm17; NOR: crm19
191
240
  _defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
@@ -2,15 +2,16 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
2
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
4
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
5
- import { getWidgetCacheId } from "../../utils";
6
5
  import { defaultClientDataStoreProvider } from "./defaultClientDataStoreProvider";
7
6
  export class defaultCacheManager {}
7
+
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
10
  _defineProperty(defaultCacheManager, "InternalCache", {});
9
- export const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId, ttlInMins) => {
10
- const widgetCacheId = getWidgetCacheId(orgid, widgetId, widgetInstanceId);
11
+ export const registerBroadcastServiceForStorage = (widgetCacheId, ttlInMins, storageType) => {
11
12
  BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
12
13
  try {
13
- defaultClientDataStoreProvider(ttlInMins).setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
14
+ defaultClientDataStoreProvider(ttlInMins, storageType).setData(widgetCacheId, JSON.stringify(msg.payload));
14
15
  } catch (error) {
15
16
  console.error("Error in setting data to localstorage", error);
16
17
  }
@@ -3,8 +3,10 @@
3
3
  import { LogLevel, TelemetryEvent } from "../../telemetry/TelemetryConstants";
4
4
  import { TelemetryHelper } from "../../telemetry/TelemetryHelper";
5
5
  import { inMemoryDataStore } from "./defaultInMemoryDataStore";
6
+ import { StorageType } from "../../Constants";
6
7
  export const defaultClientDataStoreProvider = function () {
7
8
  let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
9
+ let storageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : StorageType.localStorage;
8
10
  let ttlInMs = 0;
9
11
  const isCookieAllowed = () => {
10
12
  try {
@@ -24,7 +26,7 @@ export const defaultClientDataStoreProvider = function () {
24
26
  }
25
27
  const dataStoreProvider = {
26
28
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- setData: (key, data, type) => {
29
+ setData: (key, data) => {
28
30
  if (isCookieAllowed()) {
29
31
  try {
30
32
  if (key) {
@@ -34,7 +36,7 @@ export const defaultClientDataStoreProvider = function () {
34
36
  expiry: now.getTime() + ttlInMs
35
37
  };
36
38
  const strItem = JSON.stringify(item);
37
- if (type === "localStorage") {
39
+ if (storageType === StorageType.localStorage) {
38
40
  localStorage.setItem(key, strItem);
39
41
  } else {
40
42
  sessionStorage.setItem(key, strItem);
@@ -51,16 +53,16 @@ export const defaultClientDataStoreProvider = function () {
51
53
  const dataToCache = {
52
54
  key: key,
53
55
  data: data,
54
- type: type
56
+ type: storageType == StorageType.localStorage ? "localStorage" : "sessionStorage"
55
57
  };
56
58
  parent.postMessage(dataToCache, "*");
57
59
  }
58
60
  },
59
61
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
- getData: (key, type) => {
62
+ getData: key => {
61
63
  if (isCookieAllowed()) {
62
64
  let item;
63
- if (type === "localStorage") {
65
+ if (storageType === StorageType.localStorage) {
64
66
  item = localStorage.getItem(key);
65
67
  } else {
66
68
  item = sessionStorage.getItem(key);
@@ -85,10 +87,10 @@ export const defaultClientDataStoreProvider = function () {
85
87
  }
86
88
  },
87
89
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
- removeData: (key, type) => {
90
+ removeData: key => {
89
91
  if (isCookieAllowed()) {
90
92
  if (key) {
91
- if (type === "localStorage") {
93
+ if (storageType === StorageType.localStorage) {
92
94
  return localStorage.removeItem(key);
93
95
  } else {
94
96
  return sessionStorage.removeItem(key);
@@ -31,7 +31,6 @@ export let BroadcastEvent;
31
31
  BroadcastEvent["StartProactiveChat"] = "StartProactiveChat";
32
32
  BroadcastEvent["ProactiveChatStartChat"] = "ProactiveChatStartChat";
33
33
  BroadcastEvent["ProactiveChatStartPopoutChat"] = "ProactiveChatStartPopoutChat";
34
- BroadcastEvent["ProactiveChatIsInPopoutMode"] = "ProactiveChatIsInPopoutMode";
35
34
  BroadcastEvent["ResetProactiveChatParams"] = "ResetProactiveChatParams";
36
35
  BroadcastEvent["InvalidAdaptiveCardFormat"] = "InvalidAdaptiveCardFormat";
37
36
  BroadcastEvent["NewMessageSent"] = "NewMessageSent";
@@ -54,6 +53,8 @@ export let BroadcastEvent;
54
53
  BroadcastEvent["SigninCardReceived"] = "SignInCardReceived";
55
54
  BroadcastEvent["BotAuthConfigRequest"] = "BotAuthConfigRequest";
56
55
  BroadcastEvent["BotAuthConfigResponse"] = "BotAuthConfigResponse";
56
+ BroadcastEvent["RemoveWidgetDataFromCache"] = "RemoveWidgetDataFromCache";
57
+ BroadcastEvent["InitiateStartChatInPopoutMode"] = "InitiateStartChatInPopoutMode";
57
58
  BroadcastEvent["HideChatVisibilityChangeEvent"] = "hideChatVisibilityChangeEvent";
58
59
  BroadcastEvent["UpdateSessionDataForTelemetry"] = "UpdateSessionDataForTelemetry";
59
60
  BroadcastEvent["UpdateConversationDataForTelemetry"] = "UpdateConversationDataForTelemetry";
@@ -89,13 +90,18 @@ export let TelemetryEvent;
89
90
  TelemetryEvent["CallingSDKInitFailed"] = "CallingSDKInitFailed";
90
91
  TelemetryEvent["CallingSDKLoadSuccess"] = "CallingSDKLoadSuccess";
91
92
  TelemetryEvent["CallingSDKLoadFailed"] = "CallingSDKLoadFailed";
93
+ TelemetryEvent["GetConversationDetailsCallStarted"] = "GetConversationDetailsCallStarted";
92
94
  TelemetryEvent["GetConversationDetailsCallFailed"] = "GetConversationDetailsCallFailed";
93
95
  TelemetryEvent["EndChatSDKCallFailed"] = "EndChatSDKCallFailed";
96
+ TelemetryEvent["GetChatReconnectContextSDKCallStarted"] = "GetChatReconnectContextSDKCallStarted";
94
97
  TelemetryEvent["GetChatReconnectContextSDKCallFailed"] = "GetChatReconnectContextSDKCallFailed";
95
98
  TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
96
99
  TelemetryEvent["ClientDataStoreProviderFailed"] = "ClientDataStoreProviderFailed";
97
100
  TelemetryEvent["InMemoryDataStoreFailed"] = "InMemoryDataStoreFailed";
98
101
  TelemetryEvent["ChatVisibilityChanged"] = "ChatVisibilityChanged";
102
+ TelemetryEvent["EndChatSucceeded"] = "EndChatSucceeded";
103
+ TelemetryEvent["EndChatFailed"] = "EndChatFailed";
104
+ TelemetryEvent["SetCustomContext"] = "SetCustomContext";
99
105
  TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
100
106
  TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
101
107
  TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
@@ -258,7 +258,11 @@ export const getDomain = hostValue => {
258
258
  }
259
259
  return AriaTelemetryConstants.Public;
260
260
  };
261
- export const getWidgetCacheId = (orgId, widgetId, widgetInstanceId) => {
261
+ export const getWidgetCacheId = function (orgId, widgetId, widgetInstanceId) {
262
+ let popoutChat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
263
+ if (popoutChat) {
264
+ widgetInstanceId = widgetInstanceId + Constants.PopoutCacheSuffix;
265
+ }
262
266
  const widgetCacheId = `${widgetInstanceId}_${orgId}_${widgetId}`;
263
267
  return Md5.init(widgetCacheId);
264
268
  };
@@ -270,13 +274,13 @@ export const getWidgetEndChatEventName = (orgId, widgetId, widgetInstanceId) =>
270
274
  };
271
275
 
272
276
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
273
- export const getStateFromCache = (orgId, widgetId, widgetInstanceId) => {
277
+ export const getStateFromCache = widgetCacheId => {
274
278
  // Getting updated state from cache
275
279
  try {
276
280
  if (DataStoreManager.clientDataStore) {
277
281
  var _DataStoreManager$cli;
278
- const widgetStateEventName = getWidgetCacheId(orgId, widgetId, widgetInstanceId);
279
- const widgetStateFromCache = (_DataStoreManager$cli = DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName, "localStorage");
282
+ const widgetStateEventName = widgetCacheId;
283
+ const widgetStateFromCache = (_DataStoreManager$cli = DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName);
280
284
  const persistedState = widgetStateFromCache ? JSON.parse(widgetStateFromCache) : undefined;
281
285
  return persistedState;
282
286
  } else {
@@ -308,6 +312,23 @@ export const getBroadcastChannelName = (widgetId, widgetInstanceId) => {
308
312
  return widgetInstanceId && !isNullOrEmptyString(widgetInstanceId) ? `${widgetInstanceId}_${widgetId}` : widgetId;
309
313
  };
310
314
 
315
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
316
+ export const getWidgetCacheIdfromProps = function (props) {
317
+ var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$controlProps2;
318
+ let popoutChat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
319
+ const orgId = 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;
320
+ const widgetId = 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;
321
+ let widgetInstanceId = (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "";
322
+ if (props.useSessionStorage) {
323
+ widgetInstanceId = widgetInstanceId + Constants.SessionCacheSuffix;
324
+ }
325
+ if (props !== null && props !== void 0 && (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideStartChatButton || popoutChat === true) {
326
+ popoutChat = true;
327
+ }
328
+ const widgetCacheId = getWidgetCacheId(orgId, widgetId, widgetInstanceId, popoutChat);
329
+ return widgetCacheId;
330
+ };
331
+
311
332
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
312
333
  export const debounceLeading = function (fn) {
313
334
  let ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3000;
@@ -1,6 +1,6 @@
1
- import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
- import React, { useEffect, useRef, useState } from "react";
3
- import { BroadcastService, ChatButton } from "@microsoft/omnichannel-chat-components";
1
+ import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
+ import React, { useEffect, useState } from "react";
3
+ import { ChatButton } from "@microsoft/omnichannel-chat-components";
4
4
  import { Constants } from "../../common/Constants";
5
5
  import { setFocusOnElement } from "../../common/utils";
6
6
  import { ConversationState } from "../../contexts/common/ConversationState";
@@ -19,7 +19,6 @@ export const ChatButtonStateful = props => {
19
19
  } = props;
20
20
  //Setting OutOfOperatingHours Flag
21
21
  const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
22
- const proactiveChatInNewWindow = useRef(state.appStates.proactiveChatStates.proactiveChatInNewWindow);
23
22
  const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeChatButtonStyleProps, outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.styleProps);
24
23
  const controlProps = {
25
24
  id: "oc-lcw-chat-button",
@@ -32,12 +31,7 @@ export const ChatButtonStateful = props => {
32
31
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
33
32
  Event: TelemetryEvent.LCWChatButtonClicked
34
33
  });
35
- if (proactiveChatInNewWindow.current) {
36
- const proactiveChatIsInPopoutModeEvent = {
37
- eventName: BroadcastEvent.ProactiveChatIsInPopoutMode
38
- };
39
- BroadcastService.postMessage(proactiveChatIsInPopoutModeEvent);
40
- } else if (state.appStates.isMinimized) {
34
+ if (state.appStates.isMinimized) {
41
35
  dispatch({
42
36
  type: LiveChatWidgetActionType.SET_MINIMIZED,
43
37
  payload: false
@@ -90,9 +84,6 @@ export const ChatButtonStateful = props => {
90
84
  });
91
85
  }
92
86
  }, []);
93
- useEffect(() => {
94
- proactiveChatInNewWindow.current = state.appStates.proactiveChatStates.proactiveChatInNewWindow;
95
- }, [state.appStates.proactiveChatStates.proactiveChatInNewWindow]);
96
87
  return /*#__PURE__*/React.createElement(ChatButton, {
97
88
  componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
98
89
  controlProps: outOfOperatingHours ? outOfOfficeControlProps : controlProps,
@@ -5,9 +5,8 @@ import { findAllFocusableElement, findParentFocusableElementsWithoutChildContain
5
5
  import { DimLayer } from "../dimlayer/DimLayer";
6
6
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
7
7
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
8
- import useChatAdapterStore from "../../hooks/useChatAdapterStore";
9
8
  import useChatContextStore from "../../hooks/useChatContextStore";
10
- import { ConversationEndEntity } from "../../contexts/common/ConversationEndEntity";
9
+ import { ConfirmationState } from "../../common/Constants";
11
10
 
12
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
12
  export const ConfirmationPaneStateful = props => {
@@ -15,7 +14,6 @@ export const ConfirmationPaneStateful = props => {
15
14
  let elements = [];
16
15
  const [state, dispatch] = useChatContextStore();
17
16
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
18
- const [adapter] = useChatAdapterStore();
19
17
  const controlProps = {
20
18
  id: "oc-lcw-confirmation-pane",
21
19
  dir: state.domainStates.globalDir,
@@ -28,11 +26,11 @@ export const ConfirmationPaneStateful = props => {
28
26
  type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
29
27
  payload: false
30
28
  });
31
- setTabIndices(elements, initialTabIndexMap, true);
32
29
  dispatch({
33
- type: LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY,
34
- payload: ConversationEndEntity.Customer
30
+ type: LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
31
+ payload: ConfirmationState.Ok
35
32
  });
33
+ setTabIndices(elements, initialTabIndexMap, true);
36
34
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
37
35
  Event: TelemetryEvent.ConversationEndedByCustomer,
38
36
  Description: "Conversation is ended by customer."
@@ -47,6 +45,10 @@ export const ConfirmationPaneStateful = props => {
47
45
  type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
48
46
  payload: false
49
47
  });
48
+ dispatch({
49
+ type: LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
50
+ payload: ConfirmationState.Cancel
51
+ });
50
52
  const previousFocusedElementId = state.appStates.previousElementIdOnFocusBeforeModalOpen;
51
53
  if (previousFocusedElementId) {
52
54
  setFocusOnElement("#" + previousFocusedElementId);
@@ -36,7 +36,7 @@ export const FooterStateful = props => {
36
36
  Event: TelemetryEvent.DownloadTranscriptButtonClicked,
37
37
  Description: "Download Transcript button clicked."
38
38
  });
39
- await downloadTranscript(chatSDK, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.renderMarkDown, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.bannerMessageOnError, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.attachmentMessage);
39
+ await downloadTranscript(chatSDK, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.renderMarkDown, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.bannerMessageOnError, downloadTranscriptProps === null || downloadTranscriptProps === void 0 ? void 0 : downloadTranscriptProps.attachmentMessage, state);
40
40
  } catch (ex) {
41
41
  TelemetryHelper.logActionEvent(LogLevel.ERROR, {
42
42
  Event: TelemetryEvent.DownloadTranscriptFailed,
@@ -151,8 +151,15 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
151
151
  };
152
152
 
153
153
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
- export const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage) => {
154
+ export const downloadTranscript = async (chatSDK, renderMarkDown, bannerMessageOnError, attachmentMessage, state) => {
155
+ var _state$domainStates, _state$domainStates2, _state$domainStates2$;
156
+ // Need to keep existing request id for scenarios when trnascript is downloaded after endchat
157
+ const existingRequestId = chatSDK.requestId;
158
+ chatSDK.chatToken = state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.chatToken;
159
+ chatSDK.requestId = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.chatToken) === null || _state$domainStates2$ === void 0 ? void 0 : _state$domainStates2$.requestId;
155
160
  let data = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getLiveChatTranscript());
161
+ // This is used for allowing to start next chat
162
+ chatSDK.requestId = existingRequestId;
156
163
  if (typeof data === Constants.String) {
157
164
  data = JSON.parse(data);
158
165
  }
@@ -7,9 +7,9 @@ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
7
7
  import { defaultOutOfOfficeHeaderStyleProps } from "./common/styleProps/defaultOutOfOfficeHeaderStyleProps";
8
8
  import useChatAdapterStore from "../../hooks/useChatAdapterStore";
9
9
  import useChatContextStore from "../../hooks/useChatContextStore";
10
- import { ConversationEndEntity } from "../../contexts/common/ConversationEndEntity";
10
+ import { ConfirmationState } from "../../common/Constants";
11
11
  export const HeaderStateful = props => {
12
- var _state$domainStates$l, _state$domainStates$l2, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro;
12
+ var _state$domainStates$l, _state$domainStates$l2, _state$domainStates, _headerProps$controlP, _headerProps$controlP2, _headerProps$controlP3, _outOfOfficeHeaderPro, _state$domainStates3;
13
13
  const [state, dispatch] = useChatContextStore();
14
14
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
15
  const [adapter] = useChatAdapterStore();
@@ -21,8 +21,9 @@ export const HeaderStateful = props => {
21
21
  //Setting OutOfOperatingHours Flag
22
22
  const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
23
23
  const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
24
- const conversationState = useRef(state.appStates.conversationState);
25
- const conversationEndedBy = useRef(state.appStates.conversationEndedBy);
24
+
25
+ // For some reason state object is not getting updated values in this component
26
+ const localConfirmationPaneState = useRef(state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.confirmationState);
26
27
  const controlProps = {
27
28
  id: "oc-lcw-header",
28
29
  dir: state.domainStates.globalDir,
@@ -42,7 +43,7 @@ export const HeaderStateful = props => {
42
43
  Event: TelemetryEvent.HeaderCloseButtonClicked,
43
44
  Description: "Header Close button clicked."
44
45
  });
45
- if (conversationState.current === ConversationState.Active || conversationEndedBy.current === ConversationEndEntity.Agent) {
46
+ if (localConfirmationPaneState.current !== ConfirmationState.Ok) {
46
47
  dispatch({
47
48
  type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
48
49
  payload: true
@@ -62,9 +63,9 @@ export const HeaderStateful = props => {
62
63
  }
63
64
  },
64
65
  ...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
65
- hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
66
- hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
67
- hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
66
+ hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
67
+ hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
68
+ hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.startChatFailed || state.appStates.conversationState === ConversationState.PostchatLoading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
68
69
  };
69
70
  const outOfOfficeControlProps = {
70
71
  id: "oc-lcw-header",
@@ -85,11 +86,11 @@ export const HeaderStateful = props => {
85
86
  if (state.appStates.outsideOperatingHours) {
86
87
  setOutOfOperatingHours(true);
87
88
  }
88
- if (state.appStates.conversationState) {
89
- conversationState.current = state.appStates.conversationState;
90
- }
91
- conversationEndedBy.current = state.appStates.conversationEndedBy;
92
- }, [state.appStates]);
89
+ }, []);
90
+ useEffect(() => {
91
+ var _state$domainStates2;
92
+ localConfirmationPaneState.current = state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.confirmationState;
93
+ }, [state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.confirmationState]);
93
94
  return /*#__PURE__*/React.createElement(Header, {
94
95
  componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
95
96
  controlProps: outOfOperatingHours || state.appStates.conversationState === ConversationState.OutOfOffice ? outOfOfficeControlProps : controlProps,
@@ -3,6 +3,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
4
  export class DefaultActivitySubscriber {
5
5
  constructor() {
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
7
  _defineProperty(this, "observer", void 0);
7
8
  }
8
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4,6 +4,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
4
4
  import { ActivityStreamHandler } from "../ActivityStreamHandler";
5
5
  export class PauseActivitySubscriber {
6
6
  constructor() {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
8
  _defineProperty(this, "observer", void 0);
8
9
  }
9
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -10,9 +10,11 @@ export class Deferred {
10
10
  _defineProperty(this, "_reject", () => {
11
11
  return;
12
12
  });
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
14
  _defineProperty(this, "resolve", value => {
14
15
  this._resolve(value);
15
16
  });
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
18
  _defineProperty(this, "reject", value => {
17
19
  this._reject(value);
18
20
  });
@@ -21,9 +23,6 @@ export class Deferred {
21
23
  this._reject = reject;
22
24
  });
23
25
  }
24
-
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
-
27
26
  get promise() {
28
27
  return this._promise;
29
28
  }
@@ -1190,7 +1190,13 @@ export const dummyDefaultProps = {
1190
1190
  borderRadius: "0 0 4px 4px",
1191
1191
  borderWidth: "3px",
1192
1192
  backgroundColor: "#FFFFFF",
1193
- borderColor: "#F1F1F1"
1193
+ borderColor: "#F1F1F1",
1194
+ position: "initial",
1195
+ height: "100%",
1196
+ width: "100%",
1197
+ left: "0%",
1198
+ top: "0%",
1199
+ display: "contents"
1194
1200
  }
1195
1201
  },
1196
1202
  isCustomerVoiceSurveyCompact: undefined
@@ -1785,8 +1791,10 @@ export const dummyDefaultProps = {
1785
1791
  adaptiveCardStyles: {
1786
1792
  background: "white",
1787
1793
  color: "black"
1788
- }
1794
+ },
1795
+ hyperlinkTextOverride: false
1789
1796
  },
1790
1797
  telemetryConfig: undefined,
1791
- getAuthToken: undefined
1798
+ getAuthToken: undefined,
1799
+ initialCustomContext: undefined
1792
1800
  };