1"use strict";(self.webpackChunkstudio_tools=self.webpackChunkstudio_tools||[]).push([[978],{10978:(t,e,s)=>{s.r(e),s.d(e,{default:()=>m});var n=s(72791),i=s(57689),a=s(6088),l=s(47301),c=s(38694),r=s(91798),o=s(62780),x=s(70709),d=s(8990),u=s(78012),h=s(80184);function m(){return(0,h.jsx)(c.Z,{children:(0,h.jsx)(p,{})})}function p(){const{tx:t,language:e}=(0,o.N)(),s=(0,i.s0)(),[c,m]=(0,n.useState)(!1),[p,g]=(0,n.useState)(!1),[f,b]=(0,n.useState)(""),[j,w]=(0,n.useState)(""),N=(0,n.useRef)(!1),k=(0,n.useCallback)((async t=>{w(t),d.N.addUserMessage(t),g(!0);try{const s=await(0,u.mF)({text:t,language:e});d.N.addAssistantMessage(s),d.N.recordHistory(t,s);const n=s.results[0],i=n?"".concat(s.answer," ").concat("he"===e?"\u05d4\u05d4\u05de\u05dc\u05e6\u05d4 \u05d4\u05e8\u05d0\u05e9\u05d5\u05e0\u05d4:":"Top pick:"," ").concat(n.title).concat(n.price?" \u2014 ".concat(n.price):""):s.answer;b(i),await y.speak(i)}catch{const t="he"===e?"\u05dc\u05d0 \u05d4\u05e6\u05dc\u05d7\u05ea\u05d9 \u05db\u05e8\u05d2\u05e2. \u05e0\u05e0\u05e1\u05d4 \u05e9\u05d5\u05d1?":"Couldn't do that now. Try again?";b(t),y.speak(t)}finally{g(!1),N.current&&setTimeout((()=>y.startListening()),600)}}),[e]),y=(0,x.i)({language:e,onFinal:k}),S=()=>{c?(N.current=!1,m(!1),y.stopListening(),y.stopSpeaking()):(N.current=!0,m(!0),y.startListening())},v=y.isListening?"listening":p||"idle"!==y.ttsState?"thinking":"idle";return(0,h.jsxs)("div",{className:"flex h-full flex-col bg-[#1A1A1A] text-white",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between px-5 py-4",children:[(0,h.jsx)("span",{className:"text-lg font-extrabold",children:t.drivingTitle}),(0,h.jsx)("button",{type:"button",onClick:()=>s(l._.reddy.root),className:"flex h-9 w-9 items-center justify-center rounded-full bg-white/10",children:(0,h.jsx)(a.Z,{size:18})})]}),(0,h.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center px-6 text-center",children:[(0,h.jsx)("div",{className:"scale-125",children:(0,h.jsx)(r.Z,{state:v,label:c?y.isListening?t.buttonListening:t.buttonThinking:t.buttonIdle,onPress:S})}),(0,h.jsx)("p",{className:"mt-10 text-base text-white/70",children:t.drivingHint}),j&&!y.isListening&&(0,h.jsxs)("p",{className:"mt-6 text-sm text-white/60",children:["\u201c",j,"\u201d"]}),y.isListening&&(0,h.jsx)("p",{className:"mt-6 min-h-[28px] text-xl font-bold text-white",children:y.interim}),f&&(0,h.jsx)("p",{className:"mt-4 max-w-[300px] text-[15px] font-medium text-white",children:f}),!y.isSttSupported&&(0,h.jsx)("p",{className:"mt-6 text-xs text-white/40",children:t.micUnsupported})]}),c&&(0,h.jsx)("button",{type:"button",onClick:S,className:"mx-6 mb-8 rounded-full bg-white/10 py-3 text-sm font-semibold",children:t.drivingStop})]})}}}]); 2//# sourceMappingURL=978.abc642b5.chunk.js.map
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.