@memori.ai/memori-react 2.10.0 → 2.10.2

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.
@@ -20,7 +20,7 @@ import TotemLayout from '../layouts/Totem';
20
20
  import ChatLayout from '../layouts/Chat';
21
21
  import { getTranslation } from '../../helpers/translations';
22
22
  import { setLocalConfig, getLocalConfig } from '../../helpers/configuration';
23
- import { hasTouchscreen, stripDuplicates } from '../../helpers/utils';
23
+ import { hasTouchscreen, stripDuplicates, stripEmojis, } from '../../helpers/utils';
24
24
  import { anonTag } from '../../helpers/constants';
25
25
  import { getErrori18nKey } from '../../helpers/error';
26
26
  import { getGamificationLevel } from '../../helpers/statistics';
@@ -43,16 +43,17 @@ const getMemoriState = (integrationId) => {
43
43
  let dialogState = JSON.parse(engineState);
44
44
  return dialogState;
45
45
  };
46
- const typeMessage = (message, hidden = false) => {
46
+ const typeMessage = (message, waitForPrevious = true, hidden = false) => {
47
47
  const e = new CustomEvent('MemoriTextEntered', {
48
48
  detail: {
49
49
  text: message,
50
+ waitForPrevious,
50
51
  hidden,
51
52
  },
52
53
  });
53
54
  document.dispatchEvent(e);
54
55
  };
55
- const typeMessageHidden = (message) => typeMessage(message, true);
56
+ const typeMessageHidden = (message, waitForPrevious = true) => typeMessage(message, waitForPrevious, true);
56
57
  window.getMemoriState = getMemoriState;
57
58
  window.typeMessage = typeMessage;
58
59
  window.typeMessageHidden = typeMessageHidden;
@@ -76,14 +77,15 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
76
77
  const [instruct, setInstruct] = useState(false);
77
78
  const [clickedStart, setClickedStart] = useState(false);
78
79
  const [gotErrorInOpening, setGotErrorInOpening] = useState(false);
79
- const language = (_d = (_c = (_b = (_a = memoriConfigs === null || memoriConfigs === void 0 ? void 0 : memoriConfigs.find(c => c.memoriConfigID === memori.memoriConfigurationID)) === null || _a === void 0 ? void 0 : _a.culture) === null || _b === void 0 ? void 0 : _b.split('-')) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase();
80
+ const language = ((_c = (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.toUpperCase()) ||
81
+ ((_h = (_g = (_f = (_d = memoriConfigs === null || memoriConfigs === void 0 ? void 0 : memoriConfigs.find(c => c.memoriConfigID === memori.memoriConfigurationID)) === null || _d === void 0 ? void 0 : _d.culture) === null || _f === void 0 ? void 0 : _f.split('-')) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.toUpperCase());
80
82
  const integrationConfig = (integration === null || integration === void 0 ? void 0 : integration.customData)
81
83
  ? JSON.parse(integration.customData)
82
84
  : null;
83
85
  const isMultilanguageEnabled = multilingual !== undefined
84
86
  ? multilingual
85
87
  : !!(integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.multilanguage);
86
- const [userLang, setUserLang] = useState((_m = (_l = (_k = (_j = (_f = memoriLang !== null && memoriLang !== void 0 ? memoriLang : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.lang) !== null && _f !== void 0 ? _f : (_h = (_g = memori === null || memori === void 0 ? void 0 : memori.culture) === null || _g === void 0 ? void 0 : _g.split('-')) === null || _h === void 0 ? void 0 : _h[0]) !== null && _j !== void 0 ? _j : language) !== null && _k !== void 0 ? _k : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.uiLang) !== null && _l !== void 0 ? _l : i18n.language) !== null && _m !== void 0 ? _m : 'IT');
88
+ const [userLang, setUserLang] = useState((_m = (_l = (_k = (_j = memoriLang !== null && memoriLang !== void 0 ? memoriLang : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.lang) !== null && _j !== void 0 ? _j : language) !== null && _k !== void 0 ? _k : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.uiLang) !== null && _l !== void 0 ? _l : i18n.language) !== null && _m !== void 0 ? _m : 'IT');
87
89
  const [loading, setLoading] = useState(false);
88
90
  const [memoriTyping, setMemoriTyping] = useState(false);
89
91
  const selectedLayout = layout || (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.layout) || 'DEFAULT';
@@ -146,6 +148,203 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
146
148
  _setPosition(venue);
147
149
  applyPosition(venue);
148
150
  };
151
+ const [userMessage, setUserMessage] = useState('');
152
+ const onChangeUserMessage = (value) => {
153
+ if (!value || value === '\n' || value.trim() === '') {
154
+ setUserMessage('');
155
+ resetInteractionTimeout();
156
+ return;
157
+ }
158
+ setUserMessage(value);
159
+ clearInteractionTimeout();
160
+ };
161
+ const [listening, setListening] = useState(false);
162
+ const [history, setHistory] = useState([]);
163
+ const pushMessage = (message) => {
164
+ setHistory(history => [...history, { ...message }]);
165
+ };
166
+ const sendMessage = async (text, media, newSessionId, translate = true, translatedText, hidden = false) => {
167
+ var _a, _b;
168
+ const sessionID = newSessionId ||
169
+ sessionId ||
170
+ ((_a = window.getMemoriState()) === null || _a === void 0 ? void 0 : _a.sessionID);
171
+ if (!sessionID || !(text === null || text === void 0 ? void 0 : text.length))
172
+ return;
173
+ if (!hidden)
174
+ pushMessage({
175
+ text: text,
176
+ translatedText,
177
+ fromUser: true,
178
+ media: media !== null && media !== void 0 ? media : [],
179
+ initial: sessionId
180
+ ? !!newSessionId && newSessionId !== sessionId
181
+ : !!newSessionId,
182
+ });
183
+ setMemoriTyping(true);
184
+ let msg = text;
185
+ if (translate &&
186
+ !instruct &&
187
+ isMultilanguageEnabled &&
188
+ userLang.toUpperCase() !== language.toUpperCase()) {
189
+ const translation = await getTranslation(text, language, userLang, baseUrl);
190
+ msg = translation.text;
191
+ }
192
+ const { currentState, ...response } = await postTextEnteredEvent({
193
+ sessionId: sessionID,
194
+ text: msg,
195
+ });
196
+ if (response.resultCode === 0 && currentState) {
197
+ const emission = (_b = currentState.emission) !== null && _b !== void 0 ? _b : currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission;
198
+ if (currentState.state === 'X4' && memori.giverTag) {
199
+ const { currentState, ...resp } = await postTagChangedEvent(sessionID, memori.giverTag);
200
+ if (resp.resultCode === 0) {
201
+ setCurrentDialogState(currentState);
202
+ if (currentState.emission) {
203
+ pushMessage({
204
+ text: currentState.emission,
205
+ media: currentState.media,
206
+ fromUser: false,
207
+ });
208
+ speak(currentState.emission);
209
+ }
210
+ }
211
+ else {
212
+ console.error(response, resp);
213
+ message.error(t(getErrori18nKey(resp.resultCode)));
214
+ }
215
+ }
216
+ else if (currentState.state === 'X2d' && memori.giverTag) {
217
+ const { currentState, ...resp } = await postTextEnteredEvent({
218
+ sessionId: sessionID,
219
+ text: Math.random().toString().substring(2, 8),
220
+ });
221
+ if (resp.resultCode === 0) {
222
+ const { currentState, ...resp } = await postTagChangedEvent(sessionID, memori.giverTag);
223
+ if (resp.resultCode === 0) {
224
+ setCurrentDialogState(currentState);
225
+ if (currentState.emission) {
226
+ pushMessage({
227
+ text: currentState.emission,
228
+ media: currentState.media,
229
+ fromUser: false,
230
+ });
231
+ speak(currentState.emission);
232
+ }
233
+ }
234
+ else {
235
+ console.error(response, resp);
236
+ message.error(t(getErrori18nKey(resp.resultCode)));
237
+ }
238
+ }
239
+ else {
240
+ console.error(response, resp);
241
+ message.error(t(getErrori18nKey(resp.resultCode)));
242
+ }
243
+ }
244
+ else if (userLang.toLowerCase() !== language.toLowerCase() &&
245
+ emission &&
246
+ !instruct &&
247
+ isMultilanguageEnabled) {
248
+ translateDialogState(currentState, userLang).then(ts => {
249
+ if (ts.emission) {
250
+ speak(ts.emission);
251
+ }
252
+ });
253
+ }
254
+ else {
255
+ setCurrentDialogState({
256
+ ...currentState,
257
+ emission,
258
+ });
259
+ if (emission) {
260
+ pushMessage({
261
+ text: emission,
262
+ media: currentState.media,
263
+ fromUser: false,
264
+ generatedByAI: !!currentState.completion,
265
+ });
266
+ speak(emission);
267
+ }
268
+ }
269
+ }
270
+ else if (response.resultCode === 404) {
271
+ setHistory(h => [...h.slice(0, h.length - 1)]);
272
+ reopenSession(false, memoriPwd || memori.secretToken, memoriTokens, instruct && memori.giverTag ? memori.giverTag : undefined, instruct && memori.giverPIN ? memori.giverPIN : undefined, initialContextVars, initialQuestion).then(state => {
273
+ console.info('session timeout');
274
+ if (state === null || state === void 0 ? void 0 : state.sessionID) {
275
+ setTimeout(() => {
276
+ sendMessage(text, media, state === null || state === void 0 ? void 0 : state.sessionID);
277
+ }, 500);
278
+ }
279
+ });
280
+ }
281
+ setMemoriTyping(false);
282
+ };
283
+ const translateDialogState = async (state, userLang) => {
284
+ var _a, _b, _c;
285
+ const emission = (_a = state.emission) !== null && _a !== void 0 ? _a : currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission;
286
+ let translatedState = { ...state };
287
+ let translatedMsg = null;
288
+ if (!emission ||
289
+ instruct ||
290
+ language.toUpperCase() === userLang.toUpperCase() ||
291
+ !isMultilanguageEnabled) {
292
+ translatedState = { ...state, emission };
293
+ if (emission) {
294
+ translatedMsg = {
295
+ text: emission,
296
+ media: state.media,
297
+ fromUser: false,
298
+ };
299
+ }
300
+ }
301
+ else {
302
+ const t = await getTranslation(emission, userLang, language, baseUrl);
303
+ if (state.hints && state.hints.length > 0) {
304
+ const translatedHints = await Promise.all(((_b = state.hints) !== null && _b !== void 0 ? _b : []).map(async (hint) => {
305
+ var _a;
306
+ const tHint = await getTranslation(hint, userLang, language, baseUrl);
307
+ return {
308
+ text: (_a = tHint === null || tHint === void 0 ? void 0 : tHint.text) !== null && _a !== void 0 ? _a : hint,
309
+ originalText: hint,
310
+ };
311
+ }));
312
+ translatedState = {
313
+ ...state,
314
+ emission: t.text,
315
+ translatedHints,
316
+ };
317
+ }
318
+ else {
319
+ translatedState = {
320
+ ...state,
321
+ emission: t.text,
322
+ hints: (_c = state.hints) !== null && _c !== void 0 ? _c : (state.state === 'G1' ? currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.hints : []),
323
+ };
324
+ }
325
+ if (t.text.length > 0)
326
+ translatedMsg = {
327
+ text: t.text,
328
+ media: state.media,
329
+ fromUser: false,
330
+ generatedByAI: !!state.completion,
331
+ };
332
+ }
333
+ setCurrentDialogState(translatedState);
334
+ if (translatedMsg) {
335
+ pushMessage(translatedMsg);
336
+ }
337
+ return translatedState;
338
+ };
339
+ const minAge = memori.ageRestriction
340
+ ? memori.ageRestriction
341
+ : memori.nsfw
342
+ ? 18
343
+ : memori.enableCompletions
344
+ ? 14
345
+ : 0;
346
+ const [birthDate, setBirthDate] = useState();
347
+ const [showAgeVerification, setShowAgeVerification] = useState(false);
149
348
  const [sessionId, setSessionId] = useState(initialSessionID);
150
349
  const [currentDialogState, _setCurrentDialogState] = useState();
151
350
  const setCurrentDialogState = (state) => {
@@ -394,201 +593,6 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
394
593
  restoreGiverTag();
395
594
  };
396
595
  }, []);
397
- const [userMessage, setUserMessage] = useState('');
398
- const onChangeUserMessage = (value) => {
399
- if (!value || value === '\n' || value.trim() === '') {
400
- setUserMessage('');
401
- resetInteractionTimeout();
402
- return;
403
- }
404
- setUserMessage(value);
405
- clearInteractionTimeout();
406
- };
407
- const [listening, setListening] = useState(false);
408
- const [history, setHistory] = useState([]);
409
- const pushMessage = (message) => {
410
- setHistory(history => [...history, { ...message }]);
411
- };
412
- const sendMessage = useCallback(async (text, media, newSessionId, translate = true, translatedText, hidden = false) => {
413
- var _a, _b, _c, _d, _f;
414
- const sessionID = newSessionId || sessionId;
415
- if (!sessionID || !(text === null || text === void 0 ? void 0 : text.length))
416
- return;
417
- if (!hidden)
418
- pushMessage({
419
- text: text,
420
- translatedText,
421
- fromUser: true,
422
- media: media !== null && media !== void 0 ? media : [],
423
- initial: !!newSessionId,
424
- });
425
- setMemoriTyping(true);
426
- const language = (_d = (_c = (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : i18n.language) !== null && _d !== void 0 ? _d : 'IT';
427
- let msg = text;
428
- if (translate &&
429
- !instruct &&
430
- isMultilanguageEnabled &&
431
- userLang.toUpperCase() !== language.toUpperCase()) {
432
- const translation = await getTranslation(text, language, userLang, baseUrl);
433
- msg = translation.text;
434
- }
435
- const { currentState, ...response } = await postTextEnteredEvent({
436
- sessionId: sessionID,
437
- text: msg,
438
- });
439
- if (response.resultCode === 0 && currentState) {
440
- const emission = (_f = currentState.emission) !== null && _f !== void 0 ? _f : currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission;
441
- if (currentState.state === 'X4' && memori.giverTag) {
442
- const { currentState, ...resp } = await postTagChangedEvent(sessionID, memori.giverTag);
443
- if (resp.resultCode === 0) {
444
- setCurrentDialogState(currentState);
445
- if (currentState.emission) {
446
- pushMessage({
447
- text: currentState.emission,
448
- media: currentState.media,
449
- fromUser: false,
450
- });
451
- speak(currentState.emission);
452
- }
453
- }
454
- else {
455
- console.error(response, resp);
456
- message.error(t(getErrori18nKey(resp.resultCode)));
457
- }
458
- }
459
- else if (currentState.state === 'X2d' && memori.giverTag) {
460
- const { currentState, ...resp } = await postTextEnteredEvent({
461
- sessionId: sessionID,
462
- text: Math.random().toString().substring(2, 8),
463
- });
464
- if (resp.resultCode === 0) {
465
- const { currentState, ...resp } = await postTagChangedEvent(sessionID, memori.giverTag);
466
- if (resp.resultCode === 0) {
467
- setCurrentDialogState(currentState);
468
- if (currentState.emission) {
469
- pushMessage({
470
- text: currentState.emission,
471
- media: currentState.media,
472
- fromUser: false,
473
- });
474
- speak(currentState.emission);
475
- }
476
- }
477
- else {
478
- console.error(response, resp);
479
- message.error(t(getErrori18nKey(resp.resultCode)));
480
- }
481
- }
482
- else {
483
- console.error(response, resp);
484
- message.error(t(getErrori18nKey(resp.resultCode)));
485
- }
486
- }
487
- else if (userLang.toLowerCase() !== language.toLowerCase() &&
488
- emission &&
489
- !instruct &&
490
- isMultilanguageEnabled) {
491
- translateDialogState(currentState, userLang).then(ts => {
492
- if (ts.emission) {
493
- speak(ts.emission);
494
- }
495
- });
496
- }
497
- else {
498
- setCurrentDialogState({
499
- ...currentState,
500
- emission,
501
- });
502
- if (emission) {
503
- pushMessage({
504
- text: emission,
505
- media: currentState.media,
506
- fromUser: false,
507
- generatedByAI: !!currentState.completion,
508
- });
509
- speak(emission);
510
- }
511
- }
512
- }
513
- else if (response.resultCode === 404) {
514
- setHistory(h => [...h.slice(0, h.length - 1)]);
515
- reopenSession(false, memoriPwd || memori.secretToken, memoriTokens, instruct && memori.giverTag ? memori.giverTag : undefined, instruct && memori.giverPIN ? memori.giverPIN : undefined, initialContextVars, initialQuestion).then(state => {
516
- console.info('session timeout');
517
- if (state === null || state === void 0 ? void 0 : state.sessionID) {
518
- setTimeout(() => {
519
- sendMessage(text, media, state === null || state === void 0 ? void 0 : state.sessionID);
520
- }, 500);
521
- }
522
- });
523
- }
524
- setMemoriTyping(false);
525
- }, [sessionId]);
526
- const translateDialogState = async (state, userLang) => {
527
- var _a, _b, _c, _d, _f, _g, _h;
528
- const language = (_d = (_c = (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : i18n.language) !== null && _d !== void 0 ? _d : 'IT';
529
- const emission = (_f = state.emission) !== null && _f !== void 0 ? _f : currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission;
530
- let translatedState = { ...state };
531
- let translatedMsg = null;
532
- if (!emission ||
533
- instruct ||
534
- language.toUpperCase() === userLang.toUpperCase() ||
535
- !isMultilanguageEnabled) {
536
- translatedState = { ...state, emission };
537
- if (emission) {
538
- translatedMsg = {
539
- text: emission,
540
- media: state.media,
541
- fromUser: false,
542
- };
543
- }
544
- }
545
- else {
546
- const t = await getTranslation(emission, userLang, language, baseUrl);
547
- if (state.hints && state.hints.length > 0) {
548
- const translatedHints = await Promise.all(((_g = state.hints) !== null && _g !== void 0 ? _g : []).map(async (hint) => {
549
- var _a;
550
- const tHint = await getTranslation(hint, userLang, language, baseUrl);
551
- return {
552
- text: (_a = tHint === null || tHint === void 0 ? void 0 : tHint.text) !== null && _a !== void 0 ? _a : hint,
553
- originalText: hint,
554
- };
555
- }));
556
- translatedState = {
557
- ...state,
558
- emission: t.text,
559
- translatedHints,
560
- };
561
- }
562
- else {
563
- translatedState = {
564
- ...state,
565
- emission: t.text,
566
- hints: (_h = state.hints) !== null && _h !== void 0 ? _h : (state.state === 'G1' ? currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.hints : []),
567
- };
568
- }
569
- if (t.text.length > 0)
570
- translatedMsg = {
571
- text: t.text,
572
- media: state.media,
573
- fromUser: false,
574
- generatedByAI: !!state.completion,
575
- };
576
- }
577
- setCurrentDialogState(translatedState);
578
- if (translatedMsg) {
579
- pushMessage(translatedMsg);
580
- }
581
- return translatedState;
582
- };
583
- const minAge = memori.ageRestriction
584
- ? memori.ageRestriction
585
- : memori.nsfw
586
- ? 18
587
- : memori.enableCompletions
588
- ? 14
589
- : 0;
590
- const [birthDate, setBirthDate] = useState();
591
- const [showAgeVerification, setShowAgeVerification] = useState(false);
592
596
  const [userInteractionTimeout, setUserInteractionTimeout] = useState();
593
597
  const timeoutRef = useRef();
594
598
  const clearInteractionTimeout = () => {
@@ -926,7 +930,7 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
926
930
  source.disconnect();
927
931
  onEndSpeakStartListen();
928
932
  };
929
- speechSynthesizer.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${getCultureCodeByLanguage(userLang)}"><voice name="${getTTSVoice(userLang)}"><s>${replaceTextWithPhonemes(escapeHTML(text), userLang.toLowerCase())}</s></voice></speak>`, result => {
933
+ speechSynthesizer.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${getCultureCodeByLanguage(userLang)}"><voice name="${getTTSVoice(userLang)}"><s>${replaceTextWithPhonemes(escapeHTML(stripEmojis(text)), userLang.toLowerCase())}</s></voice></speak>`, result => {
930
934
  if (result) {
931
935
  setIsPlayingAudio(true);
932
936
  memoriSpeaking = true;
@@ -1340,25 +1344,29 @@ const MemoriWidget = ({ memori, memoriConfigs, memoriLang, multilingual, integra
1340
1344
  };
1341
1345
  const memoriTextEnteredHandler = useCallback((e) => {
1342
1346
  var _a;
1343
- const { text, hidden } = e.detail;
1347
+ const { text, waitForPrevious, hidden } = e.detail;
1344
1348
  const sessionID = sessionId || ((_a = window.getMemoriState()) === null || _a === void 0 ? void 0 : _a.sessionID);
1345
1349
  if (text) {
1346
- if (!speakerMuted && (memoriSpeaking || memoriTyping)) {
1350
+ if (waitForPrevious &&
1351
+ !speakerMuted &&
1352
+ (memoriSpeaking || memoriTyping)) {
1347
1353
  setTimeout(() => {
1348
1354
  memoriTextEnteredHandler(e);
1349
1355
  }, 1000);
1350
1356
  }
1351
1357
  else {
1352
- sendMessage(text, undefined, sessionID, undefined, undefined, hidden);
1358
+ stopListening();
1359
+ stopAudio();
1360
+ sendMessage(text, undefined, undefined, undefined, undefined, hidden);
1353
1361
  }
1354
1362
  }
1355
- }, [sessionId, isPlayingAudio, memoriTyping]);
1363
+ }, [sessionId, isPlayingAudio, memoriTyping, userLang]);
1356
1364
  useEffect(() => {
1357
1365
  document.addEventListener('MemoriTextEntered', memoriTextEnteredHandler);
1358
1366
  return () => {
1359
1367
  document.removeEventListener('MemoriTextEntered', memoriTextEnteredHandler);
1360
1368
  };
1361
- }, []);
1369
+ }, [sessionId, userLang]);
1362
1370
  const onClickStart = useCallback(async (session) => {
1363
1371
  const sessionID = (session === null || session === void 0 ? void 0 : session.sessionID) || sessionId;
1364
1372
  const dialogState = (session === null || session === void 0 ? void 0 : session.dialogState) || currentDialogState;