PageSourceSearch

https://domdhi.com/assets/tts-provider-aX8KnGCy.js

js domdhi.com collected 2026-10-02 01:28:16 UTC 3,074 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/voice-3EGITEF5.js","assets/text-utils--3CW0i-p.js"])))=>i.map(i=>d[i]);
2import{H as e,V as t,W as n}from"./chunk-6CSD65Y2-D6zLy3dp.js";import{t as r}from"./jsx-runtime-BGLTrfZy.js";import{t as i}from"./utils-UvpNVb9C.js";var a=n(e(),1);function o(){let[e,n]=(0,a.useState)({isPlaying:!1,isPaused:!1,isLoading:!1,error:null}),[r,i]=(0,a.useState)(1),[o,s]=(0,a.useState)(!1),c=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=!1,r;return t(async()=>{let{voiceRegistry:e}=await import(`./voice-3EGITEF5.js`);return{voiceRegistry:e}},__vite__mapDeps([0,1])).then(({voiceRegistry:t})=>{if(e)return;let i=t.getTTS();i&&i.isAvailable()&&(c.current=i,s(!0),n(i.getState()),r=i.onStateChange(e=>{n(e)}))}),()=>{e=!0,r?.(),c.current?.stop()}},[]),{speak:(0,a.useCallback)(e=>{c.current?.speak(e,{rate:r})},[r]),pause:(0,a.useCallback)(()=>{c.current?.pause()},[]),resume:(0,a.useCallback)(()=>{c.current?.resume()},[]),stop:(0,a.useCallback)(()=>{c.current?.stop()},[]),isPlaying:e.isPlaying,isPaused:e.isPaused,isLoading:e.isLoading,error:e.error,isAvailable:o,rate:r,setRate:i}}var s=r(),c=[.75,1,1.25,1.5,2];function l({isPlaying:e,isPaused:t,currentText:n,rate:r,onPause:a,onResume:o,onStop:l,onSetRate:u}){if(!(e||t))return null;let d=n.length>80?n.slice(0,80)+`...`:n;return(0,s.jsx)(`div`,{className:i(`fixed bottom-0 left-0 right-0 z-40`,`bg-black border-t-2 border-[#9D4EDD]`,`px-4 py-2.5`,`animate-in slide-in-from-bottom duration-200`),role:`region`,"aria-label":`Text-to-speech player`,"aria-live":`polite`,children:(0,s.jsxs)(`div`,{className:`max-w-7xl mx-auto flex items-center gap-4`,children:[(0,s.jsx)(`button`,{type:`button`,onClick:t?o:a,className:`shrink-0 font-mono text-sm text-[#9D4EDD] hover:text-white transition-colors`,"aria-label":t?`Resume playback`:`Pause playback`,children:t?`▶`:`⏸`}),(0,s.jsx)(`button`,{type:`button`,onClick:l,className:`shrink-0 font-mono text-sm text-gray-500 hover:text-white transition-colors`,"aria-label":`Stop playback`,children:`■`}),(0,s.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,s.jsx)(`p`,{className:`font-mono text-xs text-gray-400 truncate uppercase tracking-wider`,children:d})}),(0,s.jsx)(`div`,{className:`shrink-0 flex items-center gap-1`,children:c.map(e=>(0,s.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:i(`px-1.5 py-0.5 font-mono text-[10px] tracking-wider transition-colors`,r===e?`text-[#9D4EDD] border border-[#9D4EDD]`:`text-gray-600 hover:text-gray-400`),"aria-label":`Set speed to ${e}x`,children:[e,`X`]},e))})]})})}var u=(0,a.createContext)(null);function d({children:e}){let t=o(),[n,r]=(0,a.useState)(``),i=(0,a.useCallback)(e=>{r(e),t.speak(e)},[t.speak]),c=(0,a.useCallback)(()=>{t.stop(),r(``)},[t.stop]),d={...t,speak:i,stop:c,currentText:n};return(0,s.jsxs)(u.Provider,{value:d,children:[e,(0,s.jsx)(l,{isPlaying:t.isPlaying,isPaused:t.isPaused,currentText:n,rate:t.rate,onPause:t.pause,onResume:t.resume,onStop:c,onSetRate:t.setRate})]})}function f(){return(0,a.useContext)(u)}export{f as n,d as t};

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.