PageSourceSearch

https://tudienav.com/_nuxt/DZ2Z8xKG.js

js tudienav.com collected 2026-10-02 01:47:22 UTC 1,042 bytes, 1 lines download raw bytes

1import{g as w,h as g,q as d}from"./tzJnjie6.js";function y(a={}){const h=a.lang??"en-US",f=a.rate??.75,i=d(!1),s=d(null);let o=[];function c(){o=window.speechSynthesis.getVoices()}function p(){if(!o.length)return null;const n=e=>/^en/i.test(e.lang),t=e=>/google/i.test(e.name);return o.find(e=>n(e)&&t(e))||o.find(e=>t(e))||o.find(e=>n(e))||null}function v(n){if(!i.value||!n?.trim())return;const t=window.speechSynthesis;if(s.value===n){l();return}t.cancel();const e=new SpeechSynthesisUtterance(n);e.lang=h,e.rate=f;const u=p();u&&(e.voice=u),e.onstart=()=>{s.value=n};const r=()=>{s.value===n&&(s.value=null)};e.onend=r,e.onerror=r,s.value=n,t.speak(e)}function l(){i.value&&(window.speechSynthesis.cancel(),s.value=null)}return w(()=>{typeof window<"u"&&"speechSynthesis"in window&&(i.value=!0,c(),window.speechSynthesis.addEventListener("voiceschanged",c))}),g(()=>{i.value&&(window.speechSynthesis.cancel(),window.speechSynthesis.removeEventListener("voiceschanged",c))}),{isSupported:i,speakingText:s,speak:v,cancel:l}}export{y as u};

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.