1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="63583864-5c75-4288-9ec3-d7ccfda7139f")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,648504,e=>{"use strict";var t=e.i(750400);let n="realtime_chat_history",a=()=>{try{let e=t.safeLocalStorage.getItem(n);return JSON.parse(e||"[]").sort((e,t)=>e.createdAtMs-t.createdAtMs)}catch{return[]}};e.s(["TEXT_HISTORY_LOCALSTORAGE_KEY",0,"message_history","clearVoiceChatHistory",0,()=>{t.safeLocalStorage.removeItem(n)},"getVoiceChatHistory",0,a,"saveChatHistoryItem",0,e=>{let r=a();r.some(t=>t.itemId===e.itemId)?r=r.map(t=>t.itemId===e.itemId?e:t):r.push(e),t.safeLocalStorage.setItem(n,JSON.stringify(r))}])},74637,e=>{"use strict";var t=e.i(27917),n=e.i(672229),a=e.i(710112),r=e.i(537800),i=e.i(441577),s=e.i(28164);function l({locale:e,questions:o,isLoading:c=!1}){let{t:u}=(0,r.default)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{"data-testid":"chat-bot-banner",className:"axe-chat-bot-banner mt-5 mb-6 border-t border-b border-foreground-grey4 py-5 md:mt-6 md:py-6 print:hidden",children:[(0,t.jsx)(a.default,{unitName:"chatbot_entry",unitLocation:"inline",unitVariation:"chatbot_entry_article",componentId:null,childComponentId:o}),(0,t.jsx)("h2",{className:"mb-5 text-5 leading-heading md:mb-6 md:text-7",children:u("ai-chat-banner-title")}),(0,t.jsx)(s.default,{questions:o,isLoading:c,locale:e}),(0,t.jsx)("p",{className:"text-3",children:(0,t.jsx)(i.Trans,{i18nKey:"ai-chat-banner-footer",t:u})})]}),(0,t.jsx)(n.default,{locale:e})]})}var o=e.i(586697),c=e.i(68860);function u(e){return(0,t.jsx)("script",{[c.GLOBAL_CONTEXT_ATTR]:"",type:"application/json",children:JSON.stringify(e).replace(/</g,"\\u003C")})}var d=e.i(488020),m=e.i(268330),f=e.i(233994),h=e.i(9732);let p="3axszMcviY1yWi91VTTkMA";function b({locale:e,questions:n}){return(0,t.jsx)(l,{locale:e,questions:(0,h.use)(n)})}e.s(["default",0,function(){let{t:e}=(0,r.default)(),{locale:n}=(0,d.default)(),a=(0,f.usePathname)(),i=(0,m.useAssistantChatBotFlag)(),s=(0,m.useNotFoundAssistantQuestions)(),c=String(a).replace(/\/en|\/es-mx/,"");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.SnowplowContext,{contentReference:{type:"entry",role:"page",id:p},version:"v3"}),(0,t.jsx)(u,{siteSection:"homepage",pageTitle:"404",pageName:"404",slugEn:c,slugEs:c,contentTypeId:"Page",contentId:null,contentfulId:p}),(0,t.jsxs)("div",{className:"container grid grid-cols-12 items-center gap-4 py-5 md:gap-5 lg:py-6",style:{minHeight:"90dvh"},children:[(0,t.jsx)("div",{className:"col-span-12 lg:col-span-10 lg:col-start-2",children:(0,t.jsxs)("h1",{className:"text-center text-7 md:text-9",children:[(0,t.jsxs)("span",{className:"text-foreground-scarlet",children:[e("oops")," "]}),e("not-found-heading")]})}),i&&(0,t.jsxs)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4",children:[(0,t.jsx)("p",{className:"pb-4 text-center text-5",children:e("error-page-subtitle")}),s?(0,t.jsx)(h.Suspense,{fallback:(0,t.jsx)(l,{locale:n,questions:[],isLoading:!0}),children:(0,t.jsx)(b,{locale:n,questions:s})}):(0,t.jsx)(l,{locale:n,questions:[]})]})]})]})}],74637)},88656,e=>{"use strict";var t,n=e.i(27917),a=e.i(161239),r=e.i(441266),i=e.i(917084),s=e.i(304929),l=e.i(72963),o=e.i(779066),c=e.i(872055),u=e.i(712631);function d({children:e}){return(0,n.jsx)("div",{"data-testid":"toast-message-popup",className:"border-shadow fixed right-2 bottom-7 z-100 rounded-2 border-1 border-white bg-darkblue p-3 text-cream","aria-live":"assertive","aria-atomic":"true",children:e})}var m=e.i(537800),f=e.i(724964),h=e.i(950813),p=e.i(248710),b=e.i(9732),g=e.i(275334);function x({autoFit:e,autoSelect:t,...a}){let r=(0,b.useRef)(null);return(0,b.useEffect)(()=>{e&&r.current&&(r.current.style.height="auto",r.current.style.height=`${r.current.scrollHeight+1}px`)},[a.value,e]),(0,b.useEffect)(()=>{t&&setTimeout(()=>{r.current?.select()},100)},[t]),(0,n.jsx)("textarea",{...a,ref:r})}function v(){return(v=Object.assign.bind()).apply(null,arguments)}let y=function(e){return b.createElement("svg",v({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 50 50","aria-hidden":"true",focusable:"false"},e),t||(t=b.createElement("rect",{width:12,height:12,fill:"currentColor",rx:2,transform:"scale(4.1667)"})))},w=(0,p.default)(()=>e.A(453505),{loadableGenerated:{modules:[735718]}});e.s(["default",0,function(e){let{onMessageSubmit:t,isRetrieving:p,isSubmitting:v,stopGeneration:_,setInputValue:j,inputValue:S,isVoiceEnabled:N,isRTCEnabled:E,openVoiceChat:T,messagesLength:k,customFormClasses:C="",customLabelClasses:A="",unitLocation:I="inline",isChatPanel:L=!1}=e,{t:O}=(0,m.default)(),R=(0,i.useStatsigClient)(),P=(0,b.useRef)(null),B=(0,b.useRef)(null),[M,U]=(0,b.useState)(O("ai-chat-window-placeholder")),[q,G]=(0,b.useState)(g.default.offscreen),[$,F]=(0,b.useState)(!1),{handleRecordAudio:V,isRecording:W,isTranscribing:D,transcribedText:K,setTranscribedText:H,canvasRef:Y,stopRecording:J,cancelRecording:z,timestamp:X,showToastMessage:Q,toastMessage:Z}=(0,h.default)({unitLocation:I}),[ee,et]=(0,b.useState)(),en=p||v,ea=(0,b.useMemo)(()=>E?en?"stop":S.trim().length>0?"submit":E&&T?"voice":"submit":"vercel",[S,en,E,T]);(0,b.useEffect)(()=>{let e=P.current;if(void 0===window.ResizeObserver||!e)return;let t=new ResizeObserver(([e])=>{et(e.contentRect.width-200)});return t.observe(e),()=>t.disconnect()},[P]),(0,b.useEffect)(()=>{K&&j(K)},[K,j]),(0,b.useEffect)(()=>{D||W?U(""):0===k?U(O("ai-chat-window-placeholder")):U(O("ai-chat-window-placeholder-follow-up"))},[D,W,k]);let er=async()=>{H(null),j(""),await V()};return(0,b.useEffect)(()=>{W?G(g.default.onscreen):G(g.default.offscreen)},[W]),(0,b.useEffect)(()=>
2{if("false"===f.safeSessionStorage.getItem("showVoiceModePopover"))return;F(!0);let e=setTimeout(()=>{F(!1),f.safeSessionStorage.setItem("showVoiceModePopover","false")},5e3);return()=>clearTimeout(e)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("form",{ref:P,className:C,onSubmit:e=>{e.preventDefault(),en||((0,r.default)({unitName:"conversation",unitLocation:I,componentId:null,submittedObject:"written_query",eventType:"click"}),R?.logEvent("submit","",{unit_name:"conversation",unit_location:I??"",submitted_object:"written_query"}),t(),P.current?.querySelector("textarea")?.focus())},children:(0,n.jsxs)("label",{htmlFor:"chatinput",className:`${g.default.inputContainer} block border pr-2 pl-4 ${L?"rounded-2 border-foreground-grey3 bg-background-high-grey2 py-1 rb:border-rb-grey3 rb:bg-rb-grey2":"rounded-1 border-foreground-grey4 bg-background-low-white py-3 rb:border-rb-grey4"} ${A}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[W||D?null:(0,n.jsx)(x,{className:`bg-background-transparent grow border-0 ${L?"text-3 text-foreground-slate rb:text-rb-slate":"text-4 text-foreground-darkblue"}`,placeholder:M,maxLength:4e3,onChange:e=>j(e.target.value),value:S,rows:1,autoFit:!0,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),P.current?.requestSubmit(B.current))},"data-testid":"chatbot-input",id:"chatinput",autoSelect:!!K}),D&&N?(0,n.jsx)("div",{className:"grow",children:(0,n.jsx)(l.default,{className:"h-5 w-5"})}):null,W&&N||W&&L?(0,n.jsxs)("button",{type:"button",className:"Btn-link flex h-5 w-5 items-center justify-center","aria-label":O("ai-chat-audio-cancel"),"data-testid":"chatbot-cancel-recording",onClick:z,children:[(0,n.jsx)(s.default,{className:"w-4"}),(0,n.jsx)(a.default,{className:g.default.popover,children:O("ai-chat-audio-cancel")})]}):null,(0,n.jsxs)("div",{className:`${q} flex items-center justify-end`,children:[(0,n.jsx)("canvas",{ref:Y,className:"ml-1 bg-transparent",height:"40px",width:ee}),(0,n.jsx)("div",{className:"w-6 pl-2 text-foreground-slate rb:text-rb-slate",children:X})]}),(0,n.jsxs)("div",{className:"ml-auto flex items-center",children:[(0,n.jsx)("button",{type:"button",className:`Btn-link flex h-[42px] w-[42px] items-center justify-center text-foreground-slate rb:text-rb-slate ${L?"target":"mr-3"}`,"aria-label":W?O("ai-chat-audio-stop"):O("ai-chat-audio-speak"),"data-testid":W?"chatbot-stop-recording":"chatbot-record-audio",onClick:W?J:er,"aria-live":"polite",children:W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.default,{className:"w-4 text-foreground-midblueShade rb:text-rb-navy"}),(0,n.jsx)(a.default,{className:g.default.popover,children:O("ai-chat-audio-stop")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.default,{className:"w-4"}),(0,n.jsx)(a.default,{className:g.default.dictationPopover,children:O("ai-chat-audio-speak")})]})}),"voice"===ea?(0,n.jsxs)("button",{type:"button",onClick:()=>T?.(),onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),onFocus:()=>F(!0),onBlur:()=>F(!1),className:"Btn-link flex h-[42px] w-[42px] items-center justify-center rounded-full bg-midblueShade rb:bg-rb-navy","aria-label":O("ai-chat-voice-mode-label"),"data-testid":"chatbot-voice-mode",children:[(0,n.jsx)(w,{}),$&&(0,n.jsx)(a.default,{className:g.default.voiceModePopover,children:O("ai-chat-voice-mode-label")})]}):"stop"===ea?(0,n.jsxs)("button",{type:"button",className:"Btn-link flex h-[42px] w-[42px] items-center justify-center rounded-full bg-ochreTint text-midblueShade rb:bg-rb-cream rb:text-rb-navy","aria-label":O("ai-chat-stop-generation-label"),"data-testid":"chatbot-stop-generation",onClick:e=>{e.preventDefault(),_(),(0,r.default)({unitName:"conversation",unitLocation:I,unitVariation:"stop_chatbot_response",componentId:null,eventType:"click"})},children:[(0,n.jsx)(y,{className:"w-3"}),(0,n.jsx)(a.default,{className:g.default.popover,children:O("ai-chat-stop-generation-label")})]}):"vercel"===ea?(0,n.jsxs)("button",{ref:B,type:"submit",className:`${g.default.submitButton} Btn-link flex h-5 ${L?"target -mr-2 justify-self-end":"w-6"} items-center justify-center text-midblueShade rb:text-rb-navy`,"aria-disabled":!S.length||en,"aria-label":O("ai-chat-window-submit-label"),"data-testid":"chatbot-submit",children:[(0,n.jsx)(u.default,{className:"w-4"}),(0,n.jsx)(a.default,{className:g.default.popover,children:O("ai-chat-window-submit-label")})]}):(0,n.jsxs)("button",{ref:B,type:"submit",className:`${g.default.submitButton} Btn-link flex h-[42px] w-[42px] items-center justify-center rounded-full bg-ochreTint text-midblueShade rb:bg-rb-cream rb:text-rb-navy`,"aria-disabled":!S.length||en,"aria-label":O("ai-chat-window-submit-label"),"data-testid":"chatbot-submit",children:[(0,n.jsx)(u.default,{className:"w-4"}),(0,n.jsx)(a.default,{className:g.default.popover,children:O("ai-chat-window-submit-label")})]})]})]}),S.length>=3200&&(0,n.jsx)("div",{className:"text-2 text-foreground-slate rb:text-rb-slate",children:`${S.length}/4000`})]})}),Q?(0,n.jsx)(d,{children:Z}):null]})}],88656)},275334,e=>{e.v({dictationPopover:"ChatInput-module-scss-module__E3l4oG__dictationPopover",inputContainer:"ChatInput-module-scss-module__E3l4oG__inputContainer",offscreen:"ChatInput-module-scss-module__E3l4oG__offscreen",onscreen:"ChatInput-module-scss-module__E3l4oG__onscreen",popover:"ChatInput-module-scss-module__E3l4oG__popover",submitButton:"ChatInput-module-scss-module__E3l4oG__submitButton",voiceModePopover:"ChatInput-module-scss-module__E3l4oG__voiceModePopover",voiceModeSvg:"ChatInput-module-scss-module__E3l4oG__voiceModeSvg"})},453505,e=>{e.v(t=>Promise.all(["static/immutable/chunks/1x5pzk8kli9u6.js","static/immutable/chunks/2txpcxh4f4_pd.js"].map(t=>e.l(t))).then(()=>t(735718)))},811698,e=>{e.v(t=>Promise.all(["static/immutable/chunks/3u-su72nq9zqr.css","static/immutable/chunks/2j2io2q0rjux7.css","static/immutable/chunks/2r8mn93fr_0ek.js","static/immutable/chunks/1c7lui-71-88d.js","static/immutable/chunks/2-06-rdc6x29c.js","static/immutable/chunks/3h-w6oi9td12d.js"].map(t=>e.l(t))).then(()=>t(770314)))},672229,e=>{"use strict";var t=e.i(27917),n=e.i(556782),a=e.i(724543),r=e.i(461665),i=e.i(248710),s=e.i(9732);let l=(0,i.default)(()=>
2e.A(811698),{loadableGenerated:{modules:[770314]},ssr:!1}),o=(0,n.createMetrics)("assistant_legacy_history_sync"),c=()=>()=>{},u=()=>!0,d=()=>!1;e.s(["default",0,function({locale:e}){let{state:n}=(0,r.useStore)(),[i,m]=(0,s.useState)(!1),f=(0,s.useSyncExternalStore)(c,u,d),h=(0,s.useMemo)(()=>f&&(0,a.hasUnsyncedLegacyHistory)(),[f]);return((0,s.useEffect)(()=>{f&&o.count("check",{unsynced:h})},[f,h]),n.chatPanel.open&&!i&&m(!0),i||h)?(0,t.jsx)(l,{locale:e}):null}])},62031,e=>{e.v({popover:"PopoverBase-module-scss-module__cw-qWa__popover"})},161239,e=>{"use strict";var t=e.i(27917),n=e.i(62031);e.s(["default",0,function({className:e="",children:a,hideFromScreenReader:r=!1}){return(0,t.jsx)("div",{role:r?void 0:"alert","aria-hidden":r||void 0,className:`${n.default.popover} absolute rounded-2 bg-background-high-darkblue px-2 py-2 text-1 text-cream rb:bg-rb-navy rb:text-rb-cream ${e}`,children:a})}])},28164,e=>{"use strict";var t=e.i(27917),n=e.i(88656),a=e.i(169147);let r=function({width:e="w-full",height:n="h-4",className:r}){return(0,t.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-1 bg-grey3 motion-reduce:animate-none",e,n,r)})};function i({questionCount:e=3}){let n=["w-[78%]","w-[86%]","w-[70%]"];return(0,t.jsx)(t.Fragment,{children:Array.from({length:e},(e,a)=>{let i=n[a%n.length];return(0,t.jsx)("li",{children:(0,t.jsx)(r,{width:i,height:"px-4 py-2 text-2 md:text-4 h-5 md:h-6",className:"rounded-full"})},`question-skeleton-${a}`)})})}var s=e.i(461665),l=e.i(537800),o=e.i(9732),c=e.i(567165),u=e.i(917084),d=e.i(677767);let m=function({children:e,className:n,...a}){return(0,t.jsx)("ul",{className:`m-0 ml-0 flex list-none pl-0 ${n}`,...a,children:e})},f=function({question:e,index:n,unitLocation:a,unitVariation:r,buttonName:i,className:s,showIcon:l=!1,onSelect:o,unitUnifier:m}){let f=(0,u.useStatsigClient)();return(0,t.jsx)("li",{className:"shrink-0",children:(0,t.jsxs)(c.default,{as:"button",type:"button","data-testid":"chat-bot-suggested-question",isEngagementEvent:!1,trackProps:{clickType:"button",linkText:e,unitName:"chatbot_entry",unitLocation:a,isContent:!1,positionInUnit:n+1,componentId:null,unitVariation:r,unitUnifier:m,buttonName:i},onClick:()=>{f&&f.logEvent("click","",{unit_name:"chatbot_entry",unit_location:a,unit_variation:r,unit_unifier:m||"",button_name:i,link_text:e}),o(e)},className:s,children:[l&&(0,t.jsx)(d.default,{className:"mr-2 w-3 shrink-0 text-midblue rb:text-rb-dusty-blue"}),e]})})};function h({questions:e,unitUnifier:n}){let{dispatch:a}=(0,s.useStore)(),r=e=>{a({type:"UPDATE_CHAT_PANEL",payload:{open:!0,message:e}})};return(0,t.jsx)(t.Fragment,{children:e.map((e,a)=>(0,t.jsx)(f,{question:e,index:a,unitLocation:"inline",unitVariation:"chatbot_entry_article",buttonName:"submit_query",unitUnifier:n,className:"inline-flex items-center rounded-full bg-background-high-ochreTint px-4 py-2 text-left text-2 font-semibold text-foreground-midblueShade no-underline ring-foreground-darkblue hover:ring-3 md:text-4 rb:bg-rb-relaxing-yellow rb:text-rb-navy",showIcon:!0,onSelect:r},e))})}function p(){let{dispatch:e}=(0,s.useStore)(),[a,r]=(0,o.useState)("");return(0,t.jsx)(n.default,{isRetrieving:!1,isSubmitting:!1,stopGeneration:()=>{},inputValue:a,setInputValue:r,onMessageSubmit:()=>{a.trim()&&(e({type:"UPDATE_CHAT_PANEL",payload:{open:!0,message:a}}),r(""))},isVoiceEnabled:!1,messagesLength:0,unitLocation:"inline"})}e.s(["default",0,function({questions:e=[],isLoading:n=!1,unitUnifier:a}){let{t:r}=(0,l.default)();return(0,t.jsxs)(m,{className:"flex-col gap-4 md:gap-5","aria-busy":n,"aria-label":n?r("ai-onboarding-suggested-loading"):void 0,children:[n?(0,t.jsx)(i,{}):(0,t.jsx)(h,{questions:e,unitUnifier:a}),(0,t.jsx)("li",{className:"mb-5",children:(0,t.jsx)(p,{})})]})}],28164)},926957,844043,e=>{"use strict";var t=e.i(27917),n=e.i(244758),a=e.i(9732),r=e.i(636164),i=e.i(798582),s=e.i(933485),l=e.i(31282);let o="data-ab-testing",c="iglu:org.understood/ab_testing/jsonschema/1-0-0";e.s(["SNOWPLOW_AB_TESTING_KEY",0,o,"SNOWPLOW_AB_TESTING_SCHEMA_URL",0,c],844043),e.s(["default",0,function({version:e}){let u=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let t=u.current?.closest(`[${o}]`),a=(0,l.parseAttribute)(t??null,o);t&&a&&(0,n.trackSelfDescribingEvent)({event:{schema:c,data:{event_type:"user_bucketed",...a}},context:[(0,i.snowplowContentMetadata)(t),(0,r.snowplowAI)(t),(0,s.snowplowLesson)(t)].filter(e=>null!=e)},[e])},[e]),(0,t.jsx)("span",{hidden:!0,ref:u})}],926957)},586697,e=>{"use strict";var t=e.i(27917),n=e.i(169147),a=e.i(844043),r=e.i(926957),i=e.i(828167),s=e.i(521157),l=e.i(645689),o=e.i(266867);e.s(["SnowplowContext",0,function({as:e,children:c,contentReference:u,contentMetadata:d,ai:m,lesson:f,abTesting:h,className:p,version:b,...g}){let x={[l.SNOWPLOW_CONTENT_REFERENCE_KEY]:u?JSON.stringify(u):void 0,[s.SNOWPLOW_CONTENT_METADATA_KEY]:d?JSON.stringify(d):void 0,[i.SNOWPLOW_AI_KEY]:m?JSON.stringify(m):void 0,[o.SNOWPLOW_LESSON_KEY]:f?JSON.stringify(f):void 0,[a.SNOWPLOW_AB_TESTING_KEY]:h?JSON.stringify(h):void 0},v="v3"===b?"sp-tracking-v3":"sp-tracking-v2";return c?(0,t.jsxs)(e||"div",{className:(0,n.cn)(v,p),...x,...g,children:[!!h&&(0,t.jsx)(r.default,{version:b}),c]}):(0,t.jsx)("span",{hidden:!0,...x,...g,children:!!h&&(0,t.jsx)(r.default,{version:b})})}])},712631,e=>{"use strict";var t,n=e.i(9732);function a(){return(a=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,function(e){return n.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"
2currentColor",viewBox:"0 0 50 50","aria-hidden":"true",focusable:"false"},e),t||(t=n.createElement("path",{d:"M5.36 3.44 47.7 21.56a3.73 3.73 0 0 1 0 6.88L5.36 46.56c-3.26 1.41-6.62-2.17-4.9-5.29L7.19 29.1a2.6 2.6 0 0 1 2.1-1.41l16.86-2.08c.3 0 .58-.28.58-.66 0-.28-.29-.56-.58-.56L9.28 22.3c-.96-.18-1.72-.66-2.1-1.41L.46 8.73c-1.72-3.13 1.64-6.71 4.9-5.3"})))}])},779066,e=>{"use strict";var t,n=e.i(9732);function a(){return(a=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,function(e){return n.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50","aria-hidden":"true",focusable:"false"},e),t||(t=n.createElement("g",{fill:"currentColor",transform:"scale(2.5)"},n.createElement("rect",{width:20,height:20,rx:10}),n.createElement("path",{d:"M6 6h8v8H6z",className:"text-foreground-white"}))))}])},724543,e=>{"use strict";var t=e.i(648504),n=e.i(750400);let a="lgp:synced";e.s(["LGP_SYNCED_LOCALSTORAGE_KEY",0,a,"hasUnsyncedLegacyHistory",0,function(){if("true"===n.safeLocalStorage.getItem(a))return!1;try{let e=JSON.parse(n.safeLocalStorage.getItem(t.TEXT_HISTORY_LOCALSTORAGE_KEY)||"[]");return Array.isArray(e)&&e.length>0}catch{return!1}}])},950813,939052,e=>{"use strict";let t;var n=e.i(441266),a=e.i(537800),r=e.i(9732);function i(e,t,n){for(let a=0;a<n.length;a+=1)e.setUint8(t+a,n.charCodeAt(a))}async function s(e){let t=new OfflineAudioContext(e.numberOfChannels,e.length,e.sampleRate),n=t.createBufferSource();return n.buffer=e,n.connect(t.destination),n.start(),function(e){let{length:t,sampleRate:n,numberOfChannels:a}=e,r=t*a*2,s=new ArrayBuffer(44+r),l=new DataView(s);i(l,0,"RIFF"),l.setUint32(4,36+r,!0),i(l,8,"WAVE"),i(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,a,!0),l.setUint32(24,n,!0),l.setUint32(28,n*a*2,!0),l.setUint16(32,2*a,!0),l.setUint16(34,16,!0),i(l,36,"data"),l.setUint32(40,r,!0);let o=Array.from({length:a},(t,n)=>e.getChannelData(n));for(let e=0;e<t;e+=1)for(let t=0;t<a;t+=1){let n=Math.max(-1,Math.min(1,o[t][e]));l.setInt16(44+(e*a+t)*2,32767*n,!0)}return new Blob([s],{type:"audio/wav"})}(await t.startRendering())}var l=e.i(750400);let o=()=>{let e=l.safeLocalStorage.getItem("lgp:conversation_id");return e||(t??=crypto.randomUUID())};e.s(["getLegacyConversationId",0,()=>l.safeLocalStorage.getItem("conversation_id")||"none","getTraceConversationId",0,o],939052);var c=e.i(114186);e.s(["default",0,function({unitLocation:e="inline"}){let[t,i]=(0,r.useState)(!1),[l,u]=(0,r.useState)(!1),d=(0,r.useRef)(null),m=(0,r.useRef)([]),f=(0,r.useRef)(null),h=(0,r.useRef)(null),[p,b]=(0,r.useState)(null),[g,x]=(0,r.useState)(null),[v,y]=(0,r.useState)(0),[w,_]=(0,r.useState)(!1),[j,S]=(0,r.useState)(!1),[N,E]=(0,r.useState)(""),{t:T}=(0,a.default)();(0,r.useEffect)(()=>{if(j){_(!0);let e=setTimeout(()=>{_(!1),S(!1),E("")},3e3);return()=>clearTimeout(e)}},[j]);let k=async(e,t)=>{if(e){u(!0);try{let n=await fetch("/api/chat/speech_to_text",{method:"POST",body:e,headers:{"x-conversation-id":t}});if(!n.ok)throw Error("Network response was not ok");let a=await n.text();u(!1),b(a)}catch(e){(0,c.reportError)(e,{feature:"[voice]",location:"[voice]",extra:{message:"handleSpeechToText error"}}),E(T("ai-chat-error-message")),S(!0)}finally{u(!1)}}},C=null,A=()=>{(0,n.default)({unitName:"conversation",unitVariation:"stop_voice_input",unitLocation:e,componentId:null,eventType:"click"}),d.current?.stop(),i(!1)},I=async()=>{if((0,n.default)({unitName:"conversation",unitVariation:"start_voice_input",unitLocation:e,componentId:null,eventType:"click"}),t)return void A();try{let e=o(),t=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});i(!0),x(setTimeout(A,12e5));let n=null,a=new MediaRecorder(t);d.current=a,m.current=[],a.onstart=()=>{n=setInterval(()=>{y(e=>e+1)},1e3)},a.ondataavailable=async e=>{m.current.push(e.data)},a.onstop=async()=>{let a,r;if(n&&(clearInterval(n),n=null),y(0),t.getAudioTracks().forEach(e=>e.stop()),g&&clearTimeout(g),C&&cancelAnimationFrame(C),a=h.current,r=a?.getContext("2d"),a&&r&&r.clearRect(0,0,a.width,a.height),!f.current)return;let i=new Blob(m.current,{type:"audio/mp4"}),l=await i.arrayBuffer(),o=await f.current.decodeAudioData(l),c=await s(o);await k(c,e)}
2,f.current=new(window.AudioContext||window.webkitAudioContext);let r=f.current.createMediaStreamSource(t),l=f.current.createAnalyser();l.fftSize=2048;let c=l.frequencyBinCount,u=new Uint8Array(c);r.connect(l),a.start();let p=()=>{if(!h.current)return;let e=h.current,t=e.getContext("2d");if(!t)return;let n=e.width,a=e.height;l.getByteTimeDomainData(u),t.clearRect(0,0,n,a);for(let e=0;e<c;e+=5){let n=(u[e]/128-1)*a*3+3;t.fillStyle=getComputedStyle(document.body).getPropertyValue("--foreground-midblueShade"),t.fillRect(e,a/2-n/2,3,n)}C=requestAnimationFrame(p)};p()}catch(e){E(`${T("ai-chat-audio-permissions-error")}`),(0,c.reportError)(e,{feature:"[voice]",location:"[voice]",extra:{message:"handleRecordAudio error"}}),S(!0),await f.current?.close(),f.current=null,d.current?.stop(),m.current=[],i(!1)}};return{isRecording:t,handleRecordAudio:I,handleSpeechToText:k,canvasRef:h,transcribedText:p,setTranscribedText:b,isTranscribing:l,stopRecording:A,cancelRecording:async()=>{(0,n.default)({unitName:"conversation",unitVariation:"cancel_voice_input",unitLocation:e,componentId:null,eventType:"click"}),await f.current?.close(),f.current=null,d.current?.stop(),m.current=[],i(!1)},timestamp:function(e){if(0===e)return null;let t=String(Math.floor(e/60)).padStart(2,"0"),n=String(e%60).padStart(2,"0");return`${t}:${n}`}(v),showToastMessage:w,toastMessage:N}}],950813)}]); 3 4//# debugId=63583864-5c75-4288-9ec3-d7ccfda7139f
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.