1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7150],{96172:function(e,n,t){t.r(n),t.d(n,{default:function(){return LmButtonSpeechText}});var r=t(85893),o=t(89041),i=t(67294),c=t(95827),u=t(37106);function LmButtonSpeechText(e){let{content:n}=e,{locale:t}=(0,u.b)(),a=(0,i.useRef)(null),{speak:s,cancel:l,speaking:d,supported:f,voices:v}=(0,c.h5)(),{full_page:h,...p}=n,y=Array.isArray(p.trigger)?p.trigger[0]:void 0;return f?(0,r.jsx)("div",{ref:a,children:(0,r.jsx)(o.b,{content:{id:n._uid,_uid:n._uid,component:"button",label:"Click to speech",...y||{},...d?{trailing_icon:{name:"account-voice"}}:{}},onClick:()=>{var e,n;if(d){l();return}let r=v.find(e=>e.lang.startsWith(t||"de")),o=h?document.querySelectorAll(".enable__speech")||[]:(null===(n=a.current)||void 0===n?void 0:null===(e=n.closest(".lm-section"))||void 0===e?void 0:e.querySelectorAll(".enable__speech"))||[],i=[];o.forEach(e=>{i.push(e.innerText)}),s({text:i.join("\n"),voice:r})}})}):(0,r.jsx)("div",{children:"not supported.."})}},95827:function(e,n,t){t(60219);var r=t(94989);Object.defineProperty(n,"h5",{enumerable:!0,get:function(){return(r&&r.__esModule?r:{default:r}).default}})},60219:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0});var _slicedToArray=function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,n){var t=[],r=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(t.push(c.value),!n||t.length!==n);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return t}(e,n);throw TypeError("Invalid attempt to destructure non-iterable instance")},r=t(67294),useEventCallback=function(e,n){var t=(0,r.useRef)(function(){throw Error("Cannot call an event handler while rendering.")});return(0,r.useEffect)(function(){t.current=e},[e].concat(function(e){if(!Array.isArray(e))return Array.from(e);for(var n=0,t=Array(e.length);n<e.length;n++)t[n]=e[n];return t}(n))),(0,r.useCallback)(function(e){return(0,t.current)(e)},[t])};n.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onEnd,t=void 0===n?function(){}:n,o=e.onResult,i=void 0===o?function(){}:o,c=e.onError,u=void 0===c?function(){}:c,a=(0,r.useRef)(null),s=_slicedToArray((0,r.useState)(!1),2),l=s[0],d=s[1],f=_slicedToArray((0,r.useState)(!1),2),v=f[0],h=f[1],processResult=function(e){i(Array.from(e.results).map(function(e){return e[0]}).map(function(e){return e.transcript}).join(""))},handleError=function(e){"not-allowed"===e.error&&(a.current.onend=function(){},d(!1)),u(e)},p=useEventCallback(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l&&v){var n=e.lang,t=e.interimResults,r=e.continuous,o=e.maxAlternatives,i=e.grammars;d(!0),a.current.lang=void 0===n?"":n,a.current.interimResults=void 0===t||t,a.current.onresult=processResult,a.current.onerror=handleError,a.current.continuous=void 0!==r&&r,a.current.maxAlternatives=void 0===o?1:o,i&&(a.current.grammars=i),a.current.onend=function(){return a.current.start()},a.current.start()}},[l,v,a]),y=useEventCallback(function(){l&&v&&(a.current.onresult=function(){},a.current.onend=function(){},a.current.onerror=function(){},d(!1),a.current.stop(),t())},[l,v,a,t]);return(0,r.useEffect)(function(){"undefined"!=typeof window&&(window.SpeechRecognition=window.SpeechRecognition||window.webkitSpeechRecognition,window.SpeechRecognition&&(h(!0),a.current=new window.SpeechRecognition))},[]),{listen:p,listening:l,stop:y,supported:v}}},94989:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0});var _slicedToArray=function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,n){var t=[],r=!0,o=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(t.push(c.value),!n||t.length!==n);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return t}(e,n);throw TypeError("Invalid attempt to destructure non-iterable instance")},r=t(67294);n.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onEnd,t=void 0===n?function(){}:n,o=_slicedToArray((0,r.useState)([]),2),i=o[0],c=o[1],u=_slicedToArray((0,r.useState)(!1),2),a=u[0],s=u[1],l=_slicedToArray((0,r.useState)(!1),2),d=l[0],f=l[1],processVoices=function(e){c(e)},getVoices=function(){var e=window.speechSynthesis.getVoices();if(e.length>0){processVoices(e);return}window.speechSynthesis.onvoiceschanged=function(n){processVoices(e=n.target.getVoices())}},handleEnd=function(){s(!1),t()};return(0,r.useEffect)(function(){"undefined"!=typeof window&&window.speechSynthesis&&(f
1(!0),getVoices())},[]),{supported:d,speak:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.voice,t=e.text,r=e.rate,o=e.pitch,i=e.volume;if(d){s(!0);var c=new window.SpeechSynthesisUtterance;c.text=void 0===t?"":t,c.voice=void 0===n?null:n,c.onend=handleEnd,c.rate=void 0===r?1:r,c.pitch=void 0===o?1:o,c.volume=void 0===i?1:i,window.speechSynthesis.speak(c)}},speaking:a,cancel:function(){d&&(s(!1),window.speechSynthesis.cancel())},voices:i}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.