@davi-ai/retorik-framework 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2156,8 +2156,7 @@ const $df401eb9a10f9e0e$var$createSpeechStore = (setRetorikEvent, getListStatus,
2156
2156
  setMode: (value)=>{
2157
2157
  set({
2158
2158
  mode: value
2159
- }) // displaySubtitles: state.subtitlesInConfiguration }))
2160
- ;
2159
+ });
2161
2160
  setLastListActivity(undefined);
2162
2161
  value !== (0, $7WHA7.Mode).text && setUserTyping(false);
2163
2162
  !get().disableSound && get().actions.setMuted(value === (0, $7WHA7.Mode).text);
@@ -2461,8 +2460,6 @@ $parcel$export(module.exports, "default", () => $1d4f8108de9ab73a$export$2e2bcd8
2461
2460
 
2462
2461
 
2463
2462
 
2464
- var $jgaO0 = parcelRequire("jgaO0");
2465
-
2466
2463
  var $7WHA7 = parcelRequire("7WHA7");
2467
2464
 
2468
2465
  var $kRNZo = parcelRequire("kRNZo");
@@ -2501,7 +2498,7 @@ let $1d4f8108de9ab73a$var$timer = null;
2501
2498
  $1d4f8108de9ab73a$var$timer = setTimeout(()=>{
2502
2499
  return true;
2503
2500
  }, 1000);
2504
- const $1d4f8108de9ab73a$var$createSpeechStore = (modeRef)=>{
2501
+ const $1d4f8108de9ab73a$var$createSpeechStore = ()=>{
2505
2502
  return (0, $dWhh5$zustand.createStore)((set, get)=>{
2506
2503
  return {
2507
2504
  ...$1d4f8108de9ab73a$var$initialState,
@@ -2573,7 +2570,7 @@ const $1d4f8108de9ab73a$var$createSpeechStore = (modeRef)=>{
2573
2570
  setSubtitlesInConfiguration: (value)=>{
2574
2571
  set({
2575
2572
  subtitlesInConfiguration: value,
2576
- displaySubtitles: value && modeRef.current === (0, $7WHA7.Mode).vocal
2573
+ displaySubtitles: value
2577
2574
  });
2578
2575
  },
2579
2576
  setDisplaySubtitles: (value)=>{
@@ -2678,14 +2675,7 @@ const $1d4f8108de9ab73a$export$bd22554f31e5f96f = (selector)=>{
2678
2675
  return (0, $dWhh5$zustand.useStore)(store, selector);
2679
2676
  };
2680
2677
  const $1d4f8108de9ab73a$var$RetorikProvider = ({ children: children })=>{
2681
- const mode = (0, $jgaO0.useSpeechStore)((state)=>state.mode);
2682
- const modeRef = (0, $dWhh5$react.useRef)((0, $7WHA7.Mode).text);
2683
- const [store] = (0, $dWhh5$react.useState)(()=>$1d4f8108de9ab73a$var$createSpeechStore(modeRef));
2684
- (0, $dWhh5$react.useEffect)(()=>{
2685
- modeRef.current = mode;
2686
- }, [
2687
- mode
2688
- ]);
2678
+ const [store] = (0, $dWhh5$react.useState)(()=>$1d4f8108de9ab73a$var$createSpeechStore());
2689
2679
  return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)($1d4f8108de9ab73a$var$RetorikContext.Provider, {
2690
2680
  value: store,
2691
2681
  children: children
@@ -4402,7 +4392,7 @@ var $c8770452d727244a$export$2e2bcd8739ae039 = $c8770452d727244a$var$activityMid
4402
4392
  });
4403
4393
 
4404
4394
  parcelRegister("93cl9", function(module, exports) {
4405
- module.exports = JSON.parse("{\"name\":\"@davi-ai/retorik-framework\",\"version\":\"3.2.1\",\"description\":\"Retorik Framework package\",\"author\":\"DAVI\",\"license\":\"MIT\",\"repository\":\"none\",\"main\":\"dist/index.js\",\"module\":\"dist/index.modern.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.tsx\",\"standalone\":\"standalone/index.js\",\"targets\":{\"standalone\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"standalone\"},\"module\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"dist\"}},\"engines\":{\"node\":\">=10\"},\"scripts\":{\"build\":\"parcel build\",\"start\":\"parcel watch\",\"test\":\"jest --env=jsdom --reporters=jest-junit\",\"test-console\":\"jest --env=jsdom\",\"test-update-snapshots\":\"jest --env=jsdom --updateSnapshot\",\"test-coverage-console\":\"jest --env=jsdom --reporters=jest-junit --coverage\",\"test-coverage\":\"jest --env=jsdom --reporters=jest-junit --coverage --coverageReporters=cobertura\",\"report\":\"npx parcel build src/index.tsx --reporter @parcel/reporter-bundle-analyzer\",\"credentials\":\"vsts-npm-auth -config .npmrc\"},\"peerDependencies\":{\"react\":\"18.3.1\",\"react-dom\":\"18.3.1\"},\"devDependencies\":{\"@babel/core\":\"^7.19.1\",\"@babel/plugin-proposal-decorators\":\"^7.24.7\",\"@babel/plugin-proposal-private-property-in-object\":\"^7.21.11\",\"@babel/preset-env\":\"^7.25.4\",\"@babel/preset-react\":\"^7.24.7\",\"@babel/preset-typescript\":\"^7.24.7\",\"@babel/runtime\":\"^7.23.8\",\"@parcel/packager-ts\":\"^2.13.2\",\"@parcel/reporter-bundle-analyzer\":\"^2.13.2\",\"@parcel/reporter-sourcemap-visualiser\":\"^2.13.2\",\"@parcel/transformer-inline-string\":\"^2.13.2\",\"@parcel/transformer-typescript-types\":\"^2.13.2\",\"@parcel/validator-eslint\":\"^2.13.2\",\"@parcel/validator-typescript\":\"^2.13.2\",\"@testing-library/dom\":\"^10.4.0\",\"@testing-library/jest-dom\":\"6.5.0\",\"@testing-library/react\":\"16.0.1\",\"@testing-library/react-hooks\":\"8.0.1\",\"@testing-library/user-event\":\"14.5.2\",\"@types/jest\":\"^27.5.1\",\"@types/leaflet\":\"^1.8.0\",\"@types/node\":\"^12.12.38\",\"@types/react\":\"18.3.12\",\"@types/react-dom\":\"18.3.1\",\"@types/testing-library__jest-dom\":\"^5.14.5\",\"@types/testing-library__react\":\"latest\",\"@typescript-eslint/eslint-plugin\":\"^8.19.0\",\"@typescript-eslint/parser\":\"^8.19.0\",\"autoprefixer\":\"^10.4.7\",\"babel-eslint\":\"^10.0.3\",\"babel-jest\":\"^29.7.0\",\"babel-loader\":\"^8.2.5\",\"buffer\":\"^5.7.1\",\"canvas\":\"^2.9.0\",\"cross-env\":\"^7.0.2\",\"crypto-browserify\":\"^3.12.0\",\"eslint\":\"^9.16.0\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-config-standard\":\"^17.1.0\",\"eslint-config-standard-react\":\"^13.0.0\",\"eslint-plugin-import\":\"^2.31.0\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-prettier\":\"^5.2.1\",\"eslint-plugin-promise\":\"^7.2.1\",\"eslint-plugin-react\":\"^7.37.2\",\"https-browserify\":\"^1.0.0\",\"jest\":\"^29.7.0\",\"jest-environment-jsdom\":\"^29.7.0\",\"jest-junit\":\"16.0.0\",\"npm-run-all\":\"^4.1.5\",\"parcel\":\"^2.13.2\",\"postcss\":\"^8.4.14\",\"postcss-url\":\"^10.1.3\",\"prettier\":\"^2.0.4\",\"process\":\"^0.11.10\",\"punycode\":\"^1.4.1\",\"querystring-es3\":\"^0.2.1\",\"react\":\"^18\",\"react-docgen-typescript-plugin\":\"^1.0.5\",\"react-dom\":\"18.3.1\",\"react-test-renderer\":\"^18.3.1\",\"resize-observer-polyfill\":\"^1.5.1\",\"stream-browserify\":\"^3.0.0\",\"stream-http\":\"^3.2.0\",\"string_decoder\":\"^1.3.0\",\"tailwindcss\":\"^3.1.0\",\"typescript\":\"5.3.2\",\"url\":\"^0.11.0\",\"util\":\"^0.12.4\"},\"files\":[\"dist\"],\"dependencies\":{\"@davi-ai/body-engine-sprite\":\"3.0.0\",\"@davi-ai/react-bodyengine-three\":\"1.0.6\",\"@davi-ai/retorik-weather\":\"2.0.0\",\"@davi-ai/speechmarkdown-davi-js\":\"2.0.1\",\"@davi-ai/web-speech-cognitive-services-davi\":\"2.0.10\",\"@lottiefiles/react-lottie-player\":\"^3.4.1\",\"@opentelemetry/api\":\"^1.9.0\",\"@opentelemetry/exporter-trace-otlp-http\":\"^0.200.0\",\"@opentelemetry/instrumentation\":\"^0.200.0\",\"@opentelemetry/instrumentation-document-load\":\"^0.45.0\",\"@opentelemetry/instrumentation-fetch\":\"^0.200.0\",\"@opentelemetry/resources\":\"^2.0.0\",\"@opentelemetry/sdk-trace-web\":\"^2.0.0\",\"@opentelemetry/semantic-conventions\":\"^1.32.0\",\"@react-spring/types\":\"^9.7.3\",\"@react-spring/web\":\"^9.7.3\",\"@swc/helpers\":\"^0.5.0\",\"@types/geojson\":\"^7946.0.10\",\"@types/jsdom\":\"^16.2.14\",\"@use-gesture/react\":\"^10.2.15\",\"adaptivecards\":\"3.0.1\",\"botframework-directlinejs\":\"^0.15.5\",\"classnames\":\"^2.3.1\",\"detect-gpu\":\"^5.0.70\",\"leaflet\":\"^1.9.2\",\"markdown-it\":\"14.1.0\",\"pdfjs-dist\":\"3.11.174\",\"postcss-copy\":\"^7.1.0\",\"qrcode\":\"^1.5.1\",\"react-device-detect\":\"^2.2.3\",\"react-error-boundary\":\"^4.0.10\",\"react-leaflet\":\"^4.1.0\",\"react-pdf\":\"7.7.1\",\"react-shadow\":\"^20.5.0\",\"swiper\":\"^8.4.5\",\"zustand\":\"^5.0.3\"},\"overrides\":{\"@davi-ai/web-speech-cognitive-services-davi\":\"$@davi-ai/web-speech-cognitive-services-davi\",\"zustand\":\"$zustand\"},\"@parcel/resolver-default\":{\"packageExports\":true}}");
4395
+ module.exports = JSON.parse("{\"name\":\"@davi-ai/retorik-framework\",\"version\":\"3.2.3\",\"description\":\"Retorik Framework package\",\"author\":\"DAVI\",\"license\":\"MIT\",\"repository\":\"none\",\"main\":\"dist/index.js\",\"module\":\"dist/index.modern.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.tsx\",\"standalone\":\"standalone/index.js\",\"targets\":{\"standalone\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"standalone\"},\"module\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"dist\"}},\"engines\":{\"node\":\">=10\"},\"scripts\":{\"build\":\"parcel build\",\"start\":\"parcel watch\",\"test\":\"jest --env=jsdom --reporters=jest-junit\",\"test-console\":\"jest --env=jsdom\",\"test-update-snapshots\":\"jest --env=jsdom --updateSnapshot\",\"test-coverage-console\":\"jest --env=jsdom --reporters=jest-junit --coverage\",\"test-coverage\":\"jest --env=jsdom --reporters=jest-junit --coverage --coverageReporters=cobertura\",\"report\":\"npx parcel build src/index.tsx --reporter @parcel/reporter-bundle-analyzer\",\"credentials\":\"vsts-npm-auth -config .npmrc\"},\"peerDependencies\":{\"react\":\"18.3.1\",\"react-dom\":\"18.3.1\"},\"devDependencies\":{\"@babel/core\":\"^7.19.1\",\"@babel/plugin-proposal-decorators\":\"^7.24.7\",\"@babel/plugin-proposal-private-property-in-object\":\"^7.21.11\",\"@babel/preset-env\":\"^7.25.4\",\"@babel/preset-react\":\"^7.24.7\",\"@babel/preset-typescript\":\"^7.24.7\",\"@babel/runtime\":\"^7.23.8\",\"@parcel/packager-ts\":\"^2.13.2\",\"@parcel/reporter-bundle-analyzer\":\"^2.13.2\",\"@parcel/reporter-sourcemap-visualiser\":\"^2.13.2\",\"@parcel/transformer-inline-string\":\"^2.13.2\",\"@parcel/transformer-typescript-types\":\"^2.13.2\",\"@parcel/validator-eslint\":\"^2.13.2\",\"@parcel/validator-typescript\":\"^2.13.2\",\"@testing-library/dom\":\"^10.4.0\",\"@testing-library/jest-dom\":\"6.5.0\",\"@testing-library/react\":\"16.0.1\",\"@testing-library/react-hooks\":\"8.0.1\",\"@testing-library/user-event\":\"14.5.2\",\"@types/jest\":\"^27.5.1\",\"@types/leaflet\":\"^1.8.0\",\"@types/node\":\"^12.12.38\",\"@types/react\":\"18.3.12\",\"@types/react-dom\":\"18.3.1\",\"@types/testing-library__jest-dom\":\"^5.14.5\",\"@types/testing-library__react\":\"latest\",\"@typescript-eslint/eslint-plugin\":\"^8.19.0\",\"@typescript-eslint/parser\":\"^8.19.0\",\"autoprefixer\":\"^10.4.7\",\"babel-eslint\":\"^10.0.3\",\"babel-jest\":\"^29.7.0\",\"babel-loader\":\"^8.2.5\",\"buffer\":\"^5.7.1\",\"canvas\":\"^2.9.0\",\"cross-env\":\"^7.0.2\",\"crypto-browserify\":\"^3.12.0\",\"eslint\":\"^9.16.0\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-config-standard\":\"^17.1.0\",\"eslint-config-standard-react\":\"^13.0.0\",\"eslint-plugin-import\":\"^2.31.0\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-prettier\":\"^5.2.1\",\"eslint-plugin-promise\":\"^7.2.1\",\"eslint-plugin-react\":\"^7.37.2\",\"https-browserify\":\"^1.0.0\",\"jest\":\"^29.7.0\",\"jest-environment-jsdom\":\"^29.7.0\",\"jest-junit\":\"16.0.0\",\"npm-run-all\":\"^4.1.5\",\"parcel\":\"^2.13.2\",\"postcss\":\"^8.4.14\",\"postcss-url\":\"^10.1.3\",\"prettier\":\"^2.0.4\",\"process\":\"^0.11.10\",\"punycode\":\"^1.4.1\",\"querystring-es3\":\"^0.2.1\",\"react\":\"^18\",\"react-docgen-typescript-plugin\":\"^1.0.5\",\"react-dom\":\"18.3.1\",\"react-test-renderer\":\"^18.3.1\",\"resize-observer-polyfill\":\"^1.5.1\",\"stream-browserify\":\"^3.0.0\",\"stream-http\":\"^3.2.0\",\"string_decoder\":\"^1.3.0\",\"tailwindcss\":\"^3.1.0\",\"typescript\":\"5.3.2\",\"url\":\"^0.11.0\",\"util\":\"^0.12.4\"},\"files\":[\"dist\"],\"dependencies\":{\"@davi-ai/body-engine-sprite\":\"3.0.0\",\"@davi-ai/react-bodyengine-three\":\"1.0.6\",\"@davi-ai/retorik-weather\":\"2.0.0\",\"@davi-ai/speechmarkdown-davi-js\":\"2.0.1\",\"@davi-ai/web-speech-cognitive-services-davi\":\"2.0.10\",\"@lottiefiles/react-lottie-player\":\"^3.4.1\",\"@opentelemetry/api\":\"^1.9.0\",\"@opentelemetry/exporter-trace-otlp-http\":\"^0.200.0\",\"@opentelemetry/instrumentation\":\"^0.200.0\",\"@opentelemetry/instrumentation-document-load\":\"^0.45.0\",\"@opentelemetry/instrumentation-fetch\":\"^0.200.0\",\"@opentelemetry/resources\":\"^2.0.0\",\"@opentelemetry/sdk-trace-web\":\"^2.0.0\",\"@opentelemetry/semantic-conventions\":\"^1.32.0\",\"@react-spring/types\":\"^9.7.3\",\"@react-spring/web\":\"^9.7.3\",\"@swc/helpers\":\"^0.5.0\",\"@types/geojson\":\"^7946.0.10\",\"@types/jsdom\":\"^16.2.14\",\"@use-gesture/react\":\"^10.2.15\",\"adaptivecards\":\"3.0.1\",\"botframework-directlinejs\":\"^0.15.5\",\"classnames\":\"^2.3.1\",\"detect-gpu\":\"^5.0.70\",\"leaflet\":\"^1.9.2\",\"markdown-it\":\"14.1.0\",\"pdfjs-dist\":\"3.11.174\",\"postcss-copy\":\"^7.1.0\",\"qrcode\":\"^1.5.1\",\"react-device-detect\":\"^2.2.3\",\"react-error-boundary\":\"^4.0.10\",\"react-leaflet\":\"^4.1.0\",\"react-pdf\":\"7.7.1\",\"react-shadow\":\"^20.5.0\",\"swiper\":\"^8.4.5\",\"zustand\":\"^5.0.3\"},\"overrides\":{\"@davi-ai/web-speech-cognitive-services-davi\":\"$@davi-ai/web-speech-cognitive-services-davi\",\"zustand\":\"$zustand\"},\"@parcel/resolver-default\":{\"packageExports\":true}}");
4406
4396
 
4407
4397
  });
4408
4398
 
@@ -14336,7 +14326,7 @@ const $c0f9a707e7db7f07$var$Attachments = ({ activity: activity, display: displa
14336
14326
  return attachments.length > 1 ? (0, $7WHA7.Displays).carousel : (0, $7WHA7.Displays).normal;
14337
14327
  case 'grid':
14338
14328
  // Grid display is not available in mobile mode
14339
- return isMobile ? attachments.length > 1 ? (0, $7WHA7.Displays).carouselgrid : (0, $7WHA7.Displays).normal : (0, $7WHA7.Displays).grid;
14329
+ return isMobile ? (0, $7WHA7.Displays).carouselgrid : (0, $7WHA7.Displays).grid;
14340
14330
  }
14341
14331
  // If we have no attachment layout but attachment(s), we use none display by default is there are several attachments
14342
14332
  return attachments.length > 1 ? (0, $7WHA7.Displays).none : (0, $7WHA7.Displays).normal;
@@ -14533,7 +14523,7 @@ const $31d1ee7383d825e1$var$CarouselContainer = ({ title: title, attachments: at
14533
14523
  const carouselRef = (0, $dWhh5$react.useRef)(null);
14534
14524
  (0, $dWhh5$react.useLayoutEffect)(()=>{
14535
14525
  setHeight(0);
14536
- if (attachments.length && (attachments === null || attachments === void 0 ? void 0 : attachments.length) > 1) {
14526
+ if (attachments.length) {
14537
14527
  timerRef.current && clearTimeout(timerRef.current);
14538
14528
  timerRef.current = setTimeout(()=>{
14539
14529
  carouselRef.current && setHeight(carouselRef.current.clientHeight);
@@ -14702,7 +14692,7 @@ const $872024d5c381e99a$var$Carousel = /*#__PURE__*/ (0, ($parcel$interopDefault
14702
14692
  transform: 'translateX(100%)'
14703
14693
  },
14704
14694
  to: {
14705
- transform: 'translateX(0%)'
14695
+ transform: `translateX(${nbCards === 1 ? '25%' : '0%'})`
14706
14696
  },
14707
14697
  config: {
14708
14698
  duration: $872024d5c381e99a$var$springEnterDuration,
@@ -14710,7 +14700,8 @@ const $872024d5c381e99a$var$Carousel = /*#__PURE__*/ (0, ($parcel$interopDefault
14710
14700
  }
14711
14701
  });
14712
14702
  }, [
14713
- draft
14703
+ draft,
14704
+ nbCards
14714
14705
  ]);
14715
14706
  (0, $dWhh5$react.useEffect)(()=>{
14716
14707
  handleClick(forcedCurrentCard || 0);
@@ -14968,7 +14959,7 @@ const $872024d5c381e99a$var$Carousel = /*#__PURE__*/ (0, ($parcel$interopDefault
14968
14959
  })
14969
14960
  })
14970
14961
  }),
14971
- !draft && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
14962
+ !draft && nbCards > 1 && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
14972
14963
  className: "rf-w-full rf-py-3 rf-flex rf-flex-row rf-justify-center rf-gap-1",
14973
14964
  children: (0, ($parcel$interopDefault($dWhh5$react))).Children.map(children, (_child, key)=>{
14974
14965
  return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("button", {
@@ -24645,7 +24636,7 @@ const $a2a195f52aaf1332$var$DisplayStandard = ({ currentQuestionId: currentQuest
24645
24636
  if (key <= currentDisplayDataIndex || ended) {
24646
24637
  var _data_activity_attachments;
24647
24638
  if (data.type === (0, $7WHA7.DisplayDataTypes).attachment) return ((_data_activity_attachments = data.activity.attachments) === null || _data_activity_attachments === void 0 ? void 0 : _data_activity_attachments.length) && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
24648
- className: `${forceMobileView ? 'rf-m-auto' : 'rf-w-full'} ${data.activity.attachments.length <= 1 && 'mobile:rf-px-4'} rf-flex rf-flex-col vertical:rf-items-center rf-gap-2`,
24639
+ className: `${forceMobileView ? 'rf-m-auto' : 'rf-w-full'} ${data.activity.attachments.filter((att)=>att.contentType.includes('card')).length === 1 && 'mobile:rf-px-4'} rf-flex rf-flex-col vertical:rf-items-center rf-gap-2`,
24649
24640
  children: /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $eXl5q.default), {
24650
24641
  activity: data.activity,
24651
24642
  triggerScroll: triggerScroll
@@ -27479,7 +27470,8 @@ const $fe06f31a645aa3a1$var$SynthesisPonyfillManager = ({ isRetorikNews: isRetor
27479
27470
  const locale = (0, $6Q0mk.useLocaleStore)((state)=>state.locale);
27480
27471
  const agentData = (0, $6EkQS.useRetorikStore)((state)=>state.agentData);
27481
27472
  const setVoice = (0, $jgaO0.useSpeechStore)((state)=>state.actions.setVoice);
27482
- const [ponyfill, setPonyfill] = (0, $dWhh5$react.useState)(undefined);
27473
+ const [ponyfillCreated, setPonyfillCreated] = (0, $dWhh5$react.useState)(false);
27474
+ const ponyfillRef = (0, $dWhh5$react.useRef)(undefined);
27483
27475
  const refreshTimerRef = (0, $dWhh5$react.useRef)(null);
27484
27476
  /**
27485
27477
  * Async function to retrieve a new token and assign it to the speechConfig inside ponyfill.speechSynthesis
@@ -27488,10 +27480,10 @@ const $fe06f31a645aa3a1$var$SynthesisPonyfillManager = ({ isRetorikNews: isRetor
27488
27480
  */ const refreshTokenInNineMinutes = async (region, key)=>{
27489
27481
  // A token is valid during 10 minutes, let's refresh it after 9 minutes
27490
27482
  refreshTimerRef.current = setTimeout(async ()=>{
27491
- var _ponyfill_speechSynthesis;
27483
+ var _ponyfillRef_current_speechSynthesis, _ponyfillRef_current;
27492
27484
  const token = await (0, $f2ae26d736ec24dc$export$a2ce4fdd6972d6a7)(region, key);
27493
- if (token && (ponyfill === null || ponyfill === void 0 ? void 0 : (_ponyfill_speechSynthesis = ponyfill.speechSynthesis) === null || _ponyfill_speechSynthesis === void 0 ? void 0 : _ponyfill_speechSynthesis.speechConfig)) {
27494
- ponyfill.speechSynthesis.speechConfig.authorizationToken = token;
27485
+ if (token && ((_ponyfillRef_current = ponyfillRef.current) === null || _ponyfillRef_current === void 0 ? void 0 : (_ponyfillRef_current_speechSynthesis = _ponyfillRef_current.speechSynthesis) === null || _ponyfillRef_current_speechSynthesis === void 0 ? void 0 : _ponyfillRef_current_speechSynthesis.speechConfig)) {
27486
+ ponyfillRef.current.speechSynthesis.speechConfig.authorizationToken = token;
27495
27487
  refreshTokenInNineMinutes(region, key);
27496
27488
  }
27497
27489
  }, 540000) // 9 minutes
@@ -27504,14 +27496,15 @@ const $fe06f31a645aa3a1$var$SynthesisPonyfillManager = ({ isRetorikNews: isRetor
27504
27496
  */ const fetchTokenAndCreatePonyfill = async (region, key)=>{
27505
27497
  const token = await (0, $f2ae26d736ec24dc$export$a2ce4fdd6972d6a7)(region, key);
27506
27498
  if (token) {
27507
- setPonyfill((0, $dWhh5$daviaiwebspeechcognitiveservicesdavi.createSpeechSynthesisPonyfill)({
27499
+ ponyfillRef.current = (0, $dWhh5$daviaiwebspeechcognitiveservicesdavi.createSpeechSynthesisPonyfill)({
27508
27500
  credentials: {
27509
27501
  region: ponyfillCredentials === null || ponyfillCredentials === void 0 ? void 0 : ponyfillCredentials.region,
27510
27502
  authorizationToken: token
27511
27503
  }
27512
- }));
27504
+ });
27513
27505
  // Launch token refresh after ponyfill creation
27514
27506
  refreshTokenInNineMinutes(region, key);
27507
+ setPonyfillCreated(true);
27515
27508
  }
27516
27509
  };
27517
27510
  (0, $dWhh5$react.useEffect)(()=>{
@@ -27519,23 +27512,25 @@ const $fe06f31a645aa3a1$var$SynthesisPonyfillManager = ({ isRetorikNews: isRetor
27519
27512
  const data = {
27520
27513
  credentials: ponyfillCredentials
27521
27514
  };
27522
- setPonyfill((0, $dWhh5$daviaiwebspeechcognitiveservicesdavi.createSpeechSynthesisPonyfill)(data));
27515
+ ponyfillRef.current = (0, $dWhh5$daviaiwebspeechcognitiveservicesdavi.createSpeechSynthesisPonyfill)(data);
27516
+ setPonyfillCreated(true);
27523
27517
  } else if ((ponyfillCredentials === null || ponyfillCredentials === void 0 ? void 0 : ponyfillCredentials.subscriptionKey) && ponyfillCredentials.region) fetchTokenAndCreatePonyfill(ponyfillCredentials.region, ponyfillCredentials.subscriptionKey);
27524
27518
  }, [
27525
27519
  ponyfillCredentials
27526
27520
  ]);
27527
27521
  const onVoicesChanged = ()=>{
27528
- const voices = ponyfill === null || ponyfill === void 0 ? void 0 : ponyfill.speechSynthesis.getVoices();
27522
+ var _ponyfillRef_current;
27523
+ const voices = (_ponyfillRef_current = ponyfillRef.current) === null || _ponyfillRef_current === void 0 ? void 0 : _ponyfillRef_current.speechSynthesis.getVoices();
27529
27524
  if (voices && Array.isArray(voices) && voices.length) setVoice((0, $5679d80e89b3df01$export$4bf371fc4fa74a28)(voices, locale, customVoice, agentData));
27530
27525
  };
27531
27526
  (0, $dWhh5$react.useEffect)(()=>{
27532
- if (ponyfill) {
27533
- const voices = ponyfill.speechSynthesis.getVoices();
27527
+ if (ponyfillRef.current) {
27528
+ const voices = ponyfillRef.current.speechSynthesis.getVoices();
27534
27529
  if (voices && Array.isArray(voices) && voices.length) setVoice((0, $5679d80e89b3df01$export$4bf371fc4fa74a28)(voices, locale, customVoice, agentData));
27535
- else ponyfill.speechSynthesis.onvoiceschanged = onVoicesChanged;
27530
+ else ponyfillRef.current.speechSynthesis.onvoiceschanged = onVoicesChanged;
27536
27531
  }
27537
27532
  }, [
27538
- ponyfill,
27533
+ ponyfillCreated,
27539
27534
  customVoice,
27540
27535
  agentData,
27541
27536
  locale
@@ -27545,8 +27540,8 @@ const $fe06f31a645aa3a1$var$SynthesisPonyfillManager = ({ isRetorikNews: isRetor
27545
27540
  refreshTimerRef.current && clearTimeout(refreshTimerRef.current);
27546
27541
  };
27547
27542
  }, []);
27548
- return ponyfill ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $ad561f5c61e38c20$export$2e2bcd8739ae039), {
27549
- ponyfill: ponyfill,
27543
+ return ponyfillCreated && ponyfillRef.current ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $ad561f5c61e38c20$export$2e2bcd8739ae039), {
27544
+ ponyfill: ponyfillRef.current,
27550
27545
  isRetorikNews: isRetorikNews
27551
27546
  }) : /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {});
27552
27547
  };
@@ -28339,7 +28334,6 @@ const $bbc725a084d1069a$var$RetorikContainer = ({ config: config, viewsConfig: v
28339
28334
  mode,
28340
28335
  isMobile,
28341
28336
  displayAgent,
28342
- displayAgent,
28343
28337
  displayAgentInNews,
28344
28338
  isNews,
28345
28339
  visibility
@@ -28375,7 +28369,7 @@ const $bbc725a084d1069a$var$RetorikContainer = ({ config: config, viewsConfig: v
28375
28369
  height: height,
28376
28370
  parent: parent,
28377
28371
  children: [
28378
- processedAgentData && displayAgent && (processedAgentData.useBodyEngineThree || isAgentVisible) && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $8f73b7a6f73661a7$export$2e2bcd8739ae039), {
28372
+ processedAgentData && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $8f73b7a6f73661a7$export$2e2bcd8739ae039), {
28379
28373
  centered: chatbotData.fullWidthInDesktopMode && !isNews,
28380
28374
  chatbotData: currentLayout === (0, $7WHA7.ContainerParent).agent ? chatbotData : chatbotDataWidget,
28381
28375
  showSubtitles: !isNews,