1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,289065,e=>{"use strict";var r=e.i(338778),t=e.i(130527);function n({className:e,style:t}){return(0,r.jsx)("svg",{className:e,style:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.75,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 0 1 6 0v8.25a3 3 0 0 1-3 3Z"})})}function a({className:e}){return(0,r.jsx)("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.75,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 3.75 18 6m0 0 2.25 2.25M18 6l2.25-2.25M18 6l-2.25 2.25m1.5 13.5c-8.284 0-15-6.716-15-15V4.5A2.25 2.25 0 0 1 4.5 2.25h1.372c.516 0 .966.351 1.091.852l1.106 4.423c.11.44-.054.902-.417 1.173l-1.293.97c-.363.271-.527.734-.38 1.21 1.22 3.656 4.02 6.456 7.677 7.677.476.146.938-.018 1.21-.38l.97-1.293c.271-.363.733-.527 1.173-.417l4.423 1.106c.5.125.852.575.852 1.091V19.5a2.25 2.25 0 0 1-2.25 2.25h-.75Z"})})}function o(e,r){let t=e.attach(document.createElement("video"));return t.setAttribute("data-livekit-audio",r),t.autoplay=!0,t.playsInline=!0,t.muted=!1,t.volume=1,t.style.display="none",document.body.appendChild(t),t}function l({fallbackPhone:e}){let[n,a]=(0,t.useState)(!1);return(0,r.jsxs)("div",{className:"text-xs",children:[(0,r.jsx)("button",{type:"button",onClick:()=>a(e=>!e),"aria-expanded":n,className:"underline decoration-dotted underline-offset-2 opacity-70 transition-opacity hover:opacity-100",style:{color:"color-mix(in srgb, var(--brand-foreground) 65%, transparent)"},children:n?"Hide audio help":"Audio issues?"}),n&&(0,r.jsxs)("p",{role:"note",className:"mt-1.5 rounded-md px-2.5 py-2 leading-relaxed",style:{color:"color-mix(in srgb, var(--brand-foreground) 85%, transparent)",backgroundColor:"color-mix(in srgb, var(--brand-accent) 8%, transparent)",border:"1px solid color-mix(in srgb, var(--brand-accent) 25%, transparent)"},children:["If the assistant canât hear you or sounds faint: use headphones or earbuds instead of your speakers (speakers can cause echo), and make sure this site is allowed to use your microphone.",e?(0,r.jsxs)(r.Fragment,{children:[" ","Or call us directly at"," ",(0,r.jsx)("a",{href:`tel:${e.replace(/\D/g,"")}`,className:"font-semibold underline underline-offset-2",style:{color:"var(--brand-accent)"},children:e}),"."]}):null]})]})}function s(){return"u">typeof RTCPeerConnection&&"function"==typeof navigator?.mediaDevices?.getUserMedia}e.s(["WebRTCDemoButton",0,function({demoCode:i,prospectSlug:c,language:d,captureContact:u,businessName:m,label:p,fallbackPhone:h,onConnected:f,onDisconnected:b,onConnectFailed:x,autoStart:g,onRoomChange:y,showMuteControl:v}){!i==!c&&console.warn("[WebRTCDemoButton] expected exactly one of `demoCode` or `prospectSlug`");let[k,w]=(0,t.useState)("idle"),[j,C]=(0,t.useState)(null),[N,S]=(0,t.useState)(""),[T,E]=(0,t.useState)(""),[R,P]=(0,t.useState)(null),[$,D]=(0,t.useState)(null),M=(0,t.useRef)(""),B=(0,t.useRef)(""),[A,L]=(0,t.useState)(180),O=(0,t.useRef)(180),[F,W]=(0,t.useState)(!1),[I,_]=(0,t.useState)(!1),U=(0,t.useRef)(!1),q=(0,t.useRef)(null),[Y,V]=(0,t.useState)([]),z=(0,t.useRef)(null),G=(0,t.useRef)(!1),H=(0,t.useRef)(null),J=(0,t.useRef)(new Set),Z=(0,t.useRef)(null),K=(0,t.useRef)(f),Q=(0,t.useRef)(b),X=(0,t.useRef)(x),ee=(0,t.useRef)(y),er=(0,t.useRef)(!1);(0,t.useEffect)(()=>{K.current=f,Q.current=b,X.current=x,ee.current=y},[f,b,x,y]);let et=(0,t.useCallback)(()=>{if(!ea.current){ea.current=!0;try{X.current?.()}catch{}}},[]),en=(0,t.useCallback)(e=>{try{ee.current?.(e)}catch{}},[]),ea=(0,t.useRef)(!1),eo=(0,t.useCallback)(e=>{if(er.current){er.current=!1,ea.current=!0;try{Q.current?.({intentional:e})}catch{}}},[]);(0,t.useEffect)(()=>()=>{if(!ea.current){ea.current=!0;try{Q.current?.({intentional:!0})}catch{}}H.current&&(clearInterval(H.current),H.current=null);let e=z.current;if(z.current=null,e)try{e.disconnect()}catch{}try{ee.current?.(null)}catch{}
1document.querySelectorAll("[data-livekit-audio]").forEach(e=>e.remove())},[]),(0,t.useEffect)(()=>{Y.length>0&&Z.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[Y]);let el=(0,t.useCallback)(()=>{H.current&&(clearInterval(H.current),H.current=null)},[]),es=(0,t.useCallback)(async()=>{if(!z.current&&"connected"!==k)return;G.current=!0,el(),document.querySelectorAll("[data-livekit-audio]").forEach(e=>e.remove());let e=z.current;e&&(await e.disconnect(),z.current=null),en(null),w("idle"),C(null),L(O.current),W(!1),_(!1),U.current=!1,V([]),J.current.clear(),eo(!0)},[el,k,eo,en]),ei=(0,t.useCallback)(async()=>{if(ea.current=!1,!s()){w("error"),C("Browser calls are not supported in this browser. Please dial the number below."),et();return}w("connecting"),C(null),L(O.current),V([]),J.current.clear(),W(!1);let r=(e,r)=>{try{let t=r instanceof DOMException||r instanceof Error?r.name:"Unknown",n=r instanceof Error?r.message:String(r??"");fetch("/api/livekit/audio-diagnostics",{method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0,body:JSON.stringify({slug:c??null,settings:{errorStage:e,errorName:t,errorMessage:n,userAgent:navigator.userAgent}})}).catch(()=>{})}catch{}};try{try{for(let e of(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks())e.stop()}catch(o){let e=o instanceof DOMException?o.name:"",t=h?` Or dial our demo line: ${h}.`:"",n="error",a="Could not access your microphone. Please check your device settings.";"NotAllowedError"===e||"PermissionDeniedError"===e?(n="denied",a=`Microphone access was denied. Click the lock icon in your browser's address bar â allow microphone for this site, then try again.${t}`):"NotFoundError"===e||"DevicesNotFoundError"===e?(n="error",a=`No microphone detected on this device. Try from a laptop or phone with a built-in mic, or plug in a USB mic.${t}`):"NotReadableError"===e||"TrackStartError"===e?(n="error",a=`Your microphone is in use by another app (Zoom, Teams, OBS, etc.). Close that app and try again.${t}`):"OverconstrainedError"===e||"ConstraintNotSatisfiedError"===e?(n="error",a=`Your microphone doesn't meet our audio requirements. Try a different device.${t}`):"SecurityError"===e&&(n="error",a=`Browser security blocked microphone access (non-HTTPS page or sandboxed iframe).${t}`),w(n),C(a),r("mic_permission",o),et();return}let t=await fetch("/api/livekit/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c?{prospectSlug:c,...d?{language:d}:{},...M.current?{contactName:M.current}:{},...B.current?{contactPhone:B.current}:{}}:{demoCode:i})});if(!t.ok){let e=await t.json().catch(()=>({}));if(400===t.status&&"contactPhone"===e.field){P(e.error??"Please check the phone number."),w("contact");return}if(429===t.status){r("token_rate_limited",Error("429 after rapid retries")),w("error"),C(`Too many attempts in a row â wait one minute, then try once more${h?`, or dial ${h}`:""}.`),et();return}throw Error(e.error??`Token request failed (${t.status})`)}let{token:n,wsUrl:a,maxDurationSeconds:l}=await t.json();O.current="number"==typeof l&&l>0?l:180,L(O.current);let{Room:s,RoomEvent:u,DisconnectReason:m}=await e.A(556707),p=new s({adaptiveStream:!0,dynacast:!0,audioCaptureDefaults:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,channelCount:1}});z.current=p,p.on(u.Disconnected,e=>{var t;el(),z.current=null;let n=G.current;G.current=!1;let a=(t={wasIntentional:n,roomDeletedByServer:e===m.ROOM_DELETED}).wasIntentional||t.roomDeletedByServer?{clean:!0,beacon:!1}:{clean:!1,beacon:!0};if(a.beacon){let t=void 0===e?"unknown":m[e]??String(e);r("mid_call_disconnect",Error(`room disconnected unexpectedly (reason=${t})`))}en(null),w("idle"),C(a.clean?null:`The call dropped â this can happen on an unstable connection. Tap the button to call again${h?`, or dial ${h}`:""}.`),L(O.current),W(!1),_(!1),U.current=!1,V([]),J.current.clear(),eo(a.clean)}),p.on(u.MediaDevicesError,e=>{w("error"),C("Microphone error during call. Please check your device and try again."),r("media_devices",e)}),p.on(u.ActiveSpeakersChanged,e=>{let r=e.some(e=>e.identity!==p.localParticipant.identity);W(r)}),p.on(u.TranscriptionReceived,(e,r)=>{if(!r||r.identity===p.localParticipant.identity)return;let t=[];for(let r of e){if(!(!0===r.final||"number"==typeof r.endTime&&r.endTime>0)||!r.id||J.current.has(r.id))continue;let e=(r.text??"").trim();e&&(J.current.add(r.id),t.push(e))}0!==t.length&&V(e=>{let r=[...e,...t];return r.length>5?r.slice(r.length-5):r})}),p.on(u.TrackSubscribed,(e,r,t)=>{"audio"===e.kind&&o(e,t.identity)}),p.on(u.TrackUnsubscribed,e=>
1{"audio"===e.kind&&e.detach().forEach(e=>e.remove())}),p.on(u.ParticipantConnected,e=>{console.log("[WebRTCDemoButton] participant connected:",e.identity)}),await p.connect(a,n),await p.localParticipant.setMicrophoneEnabled(!0);try{let e=Array.from(p.localParticipant.trackPublications.values()).find(e=>"audio"===e.kind),r=e?.track?.mediaStreamTrack?.getSettings?.();console.log("[WebRTCDemoButton] applied audio settings:",{echoCancellation:r?.echoCancellation,noiseSuppression:r?.noiseSuppression,autoGainControl:r?.autoGainControl,sampleRate:r?.sampleRate,channelCount:r?.channelCount,deviceLabel:e?.track?.mediaStreamTrack?.label,ua:navigator.userAgent}),"1"===new URLSearchParams(window.location.search).get("audiocheck")&&r&&fetch("/api/livekit/audio-diagnostics",{method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0,body:JSON.stringify({roomName:p.name,slug:c??null,settings:{echoCancellation:r.echoCancellation,noiseSuppression:r.noiseSuppression,autoGainControl:r.autoGainControl,channelCount:r.channelCount,sampleRate:r.sampleRate,deviceLabel:e?.track?.mediaStreamTrack?.label,userAgent:navigator.userAgent}})}).catch(()=>{})}catch{}
1q.current=p,en(p),p.remoteParticipants.forEach(e=>{e.audioTrackPublications.forEach(r=>{r.track&&o(r.track,e.identity)})}),w("connected"),er.current=!0;try{K.current?.()}catch{}H.current=setInterval(()=>{L(e=>e<=1?(es(),0):e-1)},1e3)}catch(a){console.error("[WebRTCDemoButton] connect failed:",a),r("connect",a),el(),z.current=null,en(null),w("error");let e=a instanceof Error?a.message:"",t=h?` Or dial ${h}.`:"",n=`Unable to start the call.${t}`;/failed to fetch|networkerror|load failed/i.test(e)?n=`We couldn't reach our server â check your internet connection and try again.${t}`:/pc connection|ice|could not establish/i.test(e)?n=`Your network is blocking the call connection (this happens on some office and antivirus setups). Try another network or a phone.${t}`:/chunk|loading css|dynamically imported/i.test(e)&&(n=`This page needs a refresh â an update rolled out while it was open. Refresh and try again.${t}`),C(n),et()}},[i,c,d,h,es,el,eo,et,en]),ec=(0,t.useRef)(!1);if((0,t.useEffect)(()=>{g&&!ec.current&&(ec.current=!0,u?(P(null),w("contact")):ei())},[g]),!s())return(0,r.jsxs)("p",{className:"text-xs",style:{color:"color-mix(in srgb, var(--brand-foreground) 55%, transparent)"},children:["Browser call not supported in your browser",h?(0,r.jsxs)(r.Fragment,{children:[" ","â dial"," ",(0,r.jsx)("a",{href:`tel:${h.replace(/\D/g,"")}`,className:"font-semibold underline underline-offset-2",style:{color:"var(--brand-accent)"},children:h})," ","instead"]}):null,"."]});let ed=Math.floor(A/60),eu=String(A%60).padStart(2,"0");return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:["idle"===k&&(0,r.jsxs)("button",{type:"button",onClick:()=>{if(u){P(null),w("contact");return}ei()},className:"group inline-flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold motion-safe:transition-[transform,box-shadow] motion-safe:duration-150 hover:-translate-y-px hover:shadow-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 12%, white)",color:"var(--brand-foreground)",border:"1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent)"},"aria-label":`Call ${m} from your browser`,children:[(0,r.jsx)(n,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--brand-accent)"}}),(0,r.jsx)("span",{children:p??"Call from your browser"})]}),"contact"===k&&(0,r.jsxs)("form",{className:"flex flex-col gap-2 rounded-lg p-3",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 6%, white)",border:"1px solid color-mix(in srgb, var(--brand-accent) 30%, transparent)"},noValidate:!0,onSubmit:e=>{e.preventDefault();let r="string"!=typeof N?"":N.replace(/[\u0000-\u001F\u007F-\u009F]/g," ").trim().slice(0,80);if(!r){D("name"),P("Please add your name so we know who weâre speaking with.");return}let t=function(e){let r=(e??"").trim();if(!r)return{ok:!1,reason:"empty",message:"Please enter a phone number."};let t=r.replace(/\D/g,"");if(11===t.length&&t.startsWith("1")&&(t=t.slice(1)),10!==t.length)return{ok:!1,reason:"not_ten_digits",message:"Please enter a 10-digit phone number, including the area code."};let n=t.slice(0,3),a=t.slice(3,6);return"0"===n[0]||"1"===n[0]||/^[2-9]11$/.test(n)?{ok:!1,reason:"bad_area_code",message:"That area code doesn't look right. Please check the number."}:"0"===a[0]||"1"===a[0]?{ok:!1,reason:"bad_exchange",message:"That number doesn't look right. Please check it."}:"555"===a?{ok:!1,reason:"fake_555",message:"Please enter a real phone number we can reach you on."}:{ok:!0,e164:`+1${t}`}}(T);if(!t.ok){D("phone"),P(t.message);return}M.current=r,B.current=t.e164,D(null),P(null),ei()},children:[(0,r.jsxs)("p",{className:"text-xs",style:{color:"color-mix(in srgb, var(--brand-foreground) 70%, transparent)"},children:["To start a call we need your name and a mobile number, so"," ",m," can reach you afterward."]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("label",{className:"sr-only",htmlFor:"wrtc-contact-name",children:"Your name (required)"}),(0,r.jsx)("input",{id:"wrtc-contact-name",type:"text",autoComplete:"name",required:!0,placeholder:"Your name (required)",value:N,maxLength:80,onChange:e=>{S(e.target.value),"name"===$&&(D(null),P(null))},"aria-invalid":"name"===$||void 0,"aria-describedby":"name"===$?"wrtc-contact-error":void 0,className:"min-w-[8.5rem] flex-1 rounded-md px-3 py-2 text-sm",style:{border:"name"===$?"1px solid #b91c1c":"1px solid color-mix(in srgb, var(--brand-foreground) 20%, transparent)",color:"var(--brand-foreground)"}}),(0,r.jsx)("label",{className:"sr-only",htmlFor:"wrtc-contact-phone",children:"Your phone number (required)"}),(0,r.jsx)("input",{id:"wrtc-contact-phone",type:"tel",inputMode:"tel",autoComplete:"tel",required:!0,placeholder:"Phone number (required)",value:T,onChange:e=>{E(e.target.value),"phone"===$&&(D(null),P(null))},"aria-invalid":"phone"===$||void 0,"aria-describedby":"phone"===$?"wrtc-contact-error":void 0,className:"min-w-[8.5rem] flex-1 rounded-md px-3 py-2 text-sm",style:{border:"phone"===$?"1px solid #b91c1c":"1px solid color-mix(in srgb, var(--brand-foreground) 20%, transparent)",color:"var(--brand-foreground)"}}),(0,r.jsxs)("button",{type:"submit",className:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg px-4 py-2 text-sm font-semibold",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 12%, white)",color:"var(--brand-foreground)",border:"1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent)"},children:[(0,r.jsx)(n,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--brand-accent)"}}),(0,r.jsx)("span",{children:"Start the call"})]})]}),R&&(0,r.jsx)("p",{id:"wrtc-contact-error",role:"alert",className:"rounded-md px-2.5 py-2 text-xs font-medium leading-snug",style:{color:"#7f1d1d",backgroundColor:"rgba(185,28,28,0.08)",border:"1px solid rgba(185,28,28,0.4)"},children:R}),(0,r.jsxs)("p",{className:"text-xs",style:{color:"color-mix(in srgb, var(--brand-foreground) 55%, transparent)"},children:["Prefer not to share? Ask us in chat instead",h?(0,r.jsxs)(r.Fragment,{children:[" ","or call us directly at"," ",(0,r.jsx)("a",{href:`tel:${h.replace(/\D/g,"")}`,className:"font-semibold underline underline-offset-2",style:{color:"var(--brand-accent)"},children:h})]}):null,"."]})]}),"connecting"===k&&(0,r.jsxs)("button",{type:"button",disabled:!0,className:"inline-flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold opacity-75 curs
1or-wait",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 12%, white)",color:"var(--brand-foreground)",border:"1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent)"},"aria-live":"polite","aria-label":"Connectingâ¦",children:[(0,r.jsxs)("svg",{className:"h-4 w-4 animate-spin flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsx)("span",{children:"Connectingâ¦"})]}),"connected"===k&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5",children:[(0,r.jsxs)("div",{className:"relative flex-shrink-0","aria-label":F?"agent speaking":"listening",children:[(0,r.jsx)("span",{className:["absolute inset-0 rounded-full opacity-40",F?"motion-safe:animate-ping":""].join(" "),style:{backgroundColor:"var(--brand-accent)"},"aria-hidden":"true"}),(0,r.jsx)("span",{className:"relative block w-3 h-3 rounded-full",style:{backgroundColor:"var(--brand-accent)"},"aria-hidden":"true"})]}),(0,r.jsx)("p",{className:"min-w-0 flex-1 truncate text-sm font-semibold leading-tight",style:{color:"var(--brand-foreground)"},"aria-live":"polite",children:F?"Agent speaking":`Connected to ${m}\u2019s AI`}),(0,r.jsxs)("span",{className:"font-mono text-xs tabular-nums font-semibold","aria-label":`${ed} minutes ${eu} seconds remaining`,style:{color:A<=30?A<=10?"#dc2626":"#d97706":"color-mix(in srgb, var(--brand-foreground) 50%, transparent)"},children:[ed,":",eu]}),v&&(0,r.jsx)("button",{type:"button",onClick:()=>{let e=!I;_(e),U.current=e,q.current?.localParticipant.setMicrophoneEnabled(!e).catch(()=>{})},className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-semibold motion-safe:transition-[opacity] motion-safe:duration-150 hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",style:{backgroundColor:I?"color-mix(in srgb, var(--brand-foreground) 12%, transparent)":"transparent",color:"color-mix(in srgb, var(--brand-foreground) 70%, transparent)",border:"1px solid color-mix(in srgb, var(--brand-foreground) 25%, transparent)"},"aria-pressed":I,"aria-label":I?"Unmute your microphone":"Mute your microphone",children:(0,r.jsx)("span",{children:I?"Unmute":"Mute"})}),(0,r.jsxs)("button",{type:"button",onClick:()=>void es(),className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-semibold text-white motion-safe:transition-[opacity] motion-safe:duration-150 hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600",style:{backgroundColor:"#dc2626"},"aria-label":"End call",children:[(0,r.jsx)(a,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:"End call"})]})]}),(0,r.jsx)("div",{className:"rounded-lg px-3 py-2.5 text-xs leading-relaxed min-h-[3rem] max-h-[8rem] overflow-y-auto space-y-1",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 6%, white)",border:"1px solid color-mix(in srgb, var(--brand-accent) 15%, transparent)",color:"color-mix(in srgb, var(--brand-foreground) 70%, transparent)"},"aria-live":"polite","aria-label":"Live call transcript",children:Y.length>0?(0,r.jsxs)(r.Fragment,{children:[Y.map((e,t)=>(0,r.jsx)("p",{className:t===Y.length-1?"font-medium opacity-100":"opacity-40",children:e},t)),(0,r.jsx)("div",{ref:Z,"aria-hidden":"true"})]}):(0,r.jsxs)("span",{className:"italic opacity-60",children:["Listening â say hello to ",m,"âs AIâ¦"]})}),(0,r.jsx)(l,{fallbackPhone:h})]}),("denied"===k||"error"===k)&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[j&&(0,r.jsx)("p",{className:"text-xs leading-relaxed",role:"alert",style:{color:"color-mix(in srgb, var(--brand-foreground) 60%, transparent)"},children:j}),(0,r.jsxs)("button",{type:"button",onClick:()=>{w("idle"),C(null)},className:"inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2.5 text-xs font-semibold motion-safe:transition-[opacity] motion-safe:duration-150 hover:opacity-80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 12%, white)",color:"var(--brand-foreground)",border:"1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent)"},children:[(0,r.jsx)(n,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:"Ready to call again"})]}),(0,r.jsx)(l,{fallbackPhone:h})]})]})}],289065)},611845,e=>{"use strict";var r=e.i(338778),t=e.i(130527);e.s(["BackToTop",0,function({accent:e="#C8102E",accentDark:n="#A00C24"}){let[a,o]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let e=()=>
1o(window.scrollY>600);return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]),(0,r.jsx)("button",{type:"button",onClick:()=>{let e=!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:e?"auto":"smooth"})},"aria-label":"Back to top",tabIndex:a?0:-1,className:"fixed left-5 bottom-24 z-40 flex h-11 w-11 items-center justify-center rounded-full text-white shadow-lg transition-opacity duration-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 lg:bottom-6",style:{background:`linear-gradient(135deg, ${e}, ${n})`,opacity:+!!a,pointerEvents:a?"auto":"none",outlineColor:e},children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m18 15-6-6-6 6"})})})}])},608835,e=>{"use strict";var r=e.i(338778),t=e.i(837338),n=e.i(684301),a=e.i(408328);e.s(["TalkChoices",0,function({config:e,className:o}){let l=e.theme,s=(0,t.getAiLanguageCtas)(e);return(0,r.jsxs)("div",{className:["flex flex-col gap-2",o].filter(Boolean).join(" "),children:[s.map(t=>e.voiceBrowserCall?(0,r.jsx)(n.AiCallCta,{config:e,cta:t,className:"w-full"},t.lang):(0,r.jsxs)("a",{href:t.href,className:"re-foc flex items-center justify-between gap-3 rounded-xl border px-4 py-3 text-sm font-semibold transition hover:bg-black/[.02]",style:{borderColor:l.sand,color:l.ink},"aria-label":`${t.label} â call ${t.phone}`,children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(a.Icon,{k:"phone",className:"h-4 w-4",style:{color:l.accent}}),t.label]}),(0,r.jsx)("span",{className:"text-xs font-bold tabular-nums",style:{color:l.slate},children:t.phone})]},t.lang)),(0,r.jsxs)("a",{href:`tel:${e.phoneDirect}`,className:"re-foc flex items-center gap-2 rounded-xl border px-4 py-3 text-sm font-semibold transition hover:bg-black/[.02]",style:{borderColor:l.sand,color:l.ink},children:[(0,r.jsx)(a.Icon,{k:"phone",className:"h-4 w-4",style:{color:l.accent}}),"Call the office · ",e.phoneDirect]})]})}])},392148,e=>{"use strict";var r=e.i(338778),t=e.i(130527),n=e.i(408328),a=e.i(608835),o=e.i(303066);e.s(["TalkLauncher",0,function({config:e,hidden:l=!1}){let s=e.theme,[i,c]=(0,t.useState)(!1),d=(0,t.useRef)(null),u=(0,o.useRealtorCall)(),m=u?.dockOpen??!1,[p,h]=(0,t.useState)(m);return(m!==p&&(h(m),m&&c(!1)),(0,t.useEffect)(()=>{if(!i)return;let e=e=>{"Escape"===e.key&&c(!1)},r=e=>{d.current&&!d.current.contains(e.target)&&c(!1)};return document.addEventListener("keydown",e),document.addEventListener("mousedown",r),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",r)}},[i]),l)?null:(0,r.jsxs)("div",{ref:d,className:"fixed left-4 z-[99998] sm:left-5",style:{bottom:"calc(max(20px, calc(env(safe-area-inset-bottom, 0px) + 20px)) + var(--cwa-fab-offset, 0px))"},children:[i&&(0,r.jsxs)("div",{role:"menu","aria-label":"Ways to talk with us","data-testid":"re-talk-launcher-panel",className:"re-card mb-3 w-[19rem] max-w-[calc(100vw-2rem)] p-4",children:[(0,r.jsx)("p",{className:"px-0.5 pb-3 text-xs font-semibold uppercase tracking-wide",style:{color:s.slate},children:"Talk to us â English or Hindi"}),(0,r.jsx)(a.TalkChoices,{config:e})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),"aria-expanded":i,"aria-haspopup":"menu","aria-label":i?"Close talk-to-us menu":"Talk to us â call in English or Hindi","data-testid":"re-talk-launcher-trigger",className:"re-btn-primary re-foc flex h-14 items-center gap-2 rounded-full pl-5 pr-6 text-sm font-bold shadow-lg",children:[(0,r.jsx)(n.Icon,{k:i?"close":"phone",className:"h-5 w-5"}),i?"Close":"Talk to us"]})]})}])},764932,303066,684301,672400,e=>{"use strict";var r=e.i(338778),t=e.i(929811),n=e.i(82570);e.s(["HashAwareNavLink",0,function({href:e,className:a,style:o,children:l}){let s=(0,n.usePathname)();if(null==e)return(0,r.jsx)("span",{className:a,style:o,children:l});let i=e.indexOf("#");if(i>0){let t=e.slice(0,i),n=e=>e.length>1&&e.endsWith("/")?e.slice(0,-1):e;if(n(t)===n(s))return(0,r.jsx)("a",{href:e,className:a,style:o,children:l})}return 0===i?(0,r.jsx)("a",{href:e,className:a,style:o,children:l}):(0,r.jsx)(t.default,{href:e,className:a,style:o,children:l})}],764932);var a=e.i(289065),o=e.i(130527);let l=(0,o.createContext)(null);function s(){return(0,o.useContext)(l)}function i(){return(0,r.jsx)("svg",{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--brand-accent)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.75,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 0 1 6 0v8.25a3 3 0 0 1-3 3Z"})})}e.s(["useRealtorCall",0,s],303066),e.s(["AiCallCta",0,function({config:e,cta:t,className:n}){let o=e.theme,l=s();return l?(0,r.jsx)("div",{className:n,style:{"--brand-accent":o.accent,"--brand-foreground":o.ink},children:(0,r.jsxs)("button",{type:"button",onClick:()=>l.startCall({prospectSlug:e.voiceSlug,language:t.lang,businessName:e.brandName,label:t.label,fallbackPhone:t.phone,captureContact:"customer"===e.voiceBrowserCallMode,accent:o.accent,ink:o.ink}),className:"group inline-flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold motion-safe:transition-[transform,box-shadow] motion-safe:duration-150 hover:-translate-y-
1px hover:shadow-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",style:{backgroundColor:"color-mix(in srgb, var(--brand-accent) 12%, white)",color:"var(--brand-foreground)",border:"1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent)"},"aria-label":`Call ${e.brandName} from your browser`,children:[(0,r.jsx)(i,{}),(0,r.jsx)("span",{children:t.label??"Call from your browser"})]})}):(0,r.jsx)("div",{className:n,style:{"--brand-accent":o.accent,"--brand-foreground":o.ink},children:(0,r.jsx)(a.WebRTCDemoButton,{prospectSlug:e.voiceSlug,language:t.lang,businessName:e.brandName,label:t.label,fallbackPhone:t.phone,captureContact:"customer"===e.voiceBrowserCallMode})})}],684301);var c=e.i(408328);e.s(["NavDropdown",0,function({label:e,items:n,theme:a,variant:l,onScrollTo:s}){let[i,d]=(0,o.useState)(!1),u=(0,o.useRef)(null),m=(0,o.useRef)(null),p=(0,o.useRef)(null),h=()=>{p.current&&clearTimeout(p.current)};(0,o.useEffect)(()=>()=>h(),[]);let f="home"===l,b=f?{borderColor:a.sand,boxShadow:`0 18px 40px -18px ${a.accent}55, 0 4px 12px rgba(33,26,24,.08)`}:{borderColor:a.sand,background:"rgba(251,248,244,0.92)",backdropFilter:"blur(14px) saturate(140%)",WebkitBackdropFilter:"blur(14px) saturate(140%)",boxShadow:`0 18px 40px -18px ${a.accent}55, 0 4px 12px rgba(33,26,24,.08)`},x=f?"re-foc block rounded-lg px-3 py-2.5 text-sm font-medium transition-colors hover:bg-[var(--re-linen)]":"block rounded-lg px-3 py-2.5 text-sm font-medium transition-colors hover:opacity-70";return(0,r.jsxs)("div",{ref:u,...f?{className:"relative"}:{style:{position:"relative"}},onMouseEnter:()=>{h(),d(!0)},onMouseLeave:()=>{h(),p.current=setTimeout(()=>d(!1),120)},onFocus:()=>{h(),d(!0)},onBlur:e=>{u.current?.contains(e.relatedTarget)||d(!1)},onKeyDown:e=>{"Escape"===e.key&&i&&(d(!1),m.current?.focus())},children:[(0,r.jsxs)("button",{ref:m,type:"button","aria-haspopup":"true","aria-expanded":i,onClick:()=>d(e=>!e),className:f?"re-foc inline-flex items-center gap-1 transition-colors hover:text-[var(--re-accent)]":"inline-flex items-center gap-1 transition-opacity hover:opacity-60",children:[e,(0,r.jsx)(c.Icon,{k:"chevron",className:"h-3.5 w-3.5 transition-transform",style:{transform:i?"rotate(180deg)":"none"}})]}),i&&(0,r.jsx)("div",{role:"menu","aria-label":e,className:f?"re-glass absolute left-1/2 top-full z-50 mt-2 w-56 -translate-x-1/2 overflow-hidden rounded-xl border p-1.5 shadow-xl":"absolute left-1/2 top-full z-50 mt-2 w-56 -translate-x-1/2 overflow-hidden rounded-xl border p-1.5",style:b,children:n.map(e=>e.href?(0,r.jsx)(t.default,{href:e.href,role:"menuitem",className:x,style:{color:a.ink},onClick:()=>d(!1),children:e.label},e.label):(0,r.jsx)("button",{type:"button",role:"menuitem",onClick:()=>{d(!1),s?.(e.id)},className:"re-foc block w-full rounded-lg px-3 py-2.5 text-left text-sm font-medium transition-colors hover:bg-[var(--re-linen)]",style:{color:a.ink},children:e.label},e.label))})]})}],672400)},70773,e=>{"use strict";var r=e.i(338778),t=e.i(130527);e.s(["CopyableEmail",0,function({email:e,color:n,accent:a,className:o}){let[l,s]=(0,t.useState)("idle"),i=(0,t.useRef)(null),c=(0,t.useCallback)(async()=>{try{if(!navigator?.clipboard?.writeText)throw Error("no clipboard api");await navigator.clipboard.writeText(e),s("copied")}catch{let e=i.current;if(e&&1){let r=document.createRange();r.selectNodeContents(e);let t=window.getSelection();t?.removeAllRanges(),t?.addRange(r)}s("select")}window.setTimeout(()=>s("idle"),2500)},[e]);return(0,r.jsxs)("span",{className:o,style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("span",{ref:i,className:"font-semibold",style:{color:n},children:e}),(0,r.jsx)("button",{type:"button",onClick:c,"aria-label":`Copy email address ${e}`,className:"re-foc rounded-md border px-2 py-0.5 text-xs font-medium transition-colors",style:{borderColor:a,color:a,background:"transparent"},children:"copied"===l?"Copied":"select"===l?"Selected â press Ctrl+C":"Copy"}),(0,r.jsx)("a",{href:`mailto:${e}`,className:"re-foc text-xs underline",style:{color:a},children:"open in mail app"})]})}])},360632,e=>{"use strict";var r=e.i(338778),t=e.i(130527),n=e.i(70773);function a({config:e}){let o=e.theme,[l,s]=(0,t.useState)(""),[i,c]=(0,t.useState)("idle"),[d,u]=(0,t.useState)(""),[m]=(0,t.useState)(()=>Date.now()),p=(0,t.useCallback)(async r=>{if(r.preventDefault(),l.includes("@")){c("sending");try{let r=await fetch("/api/real-estate/newsletter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e.slug,email:l.trim(),company:d,renderedAt:m})});c(r.ok?"done":"error")}catch{c("error")}}},[e.slug,l,d,m]);return(0,r.jsxs)("div",{className:"w-full max-w-sm",children:[(0,r.jsx)("p",{className:"font-serif text-base font-bold text-white",children:"Market updates, no spam"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-white/60",children:["New listings and the occasional ",e.region," market note. Unsubscribe anytime."]}),"done"===i?(0,r.jsx)("p",{className:"mt-3 text-sm font-medium text-white",children:"â You're on the list â thank you."}):(0,r.jsxs)("form",{onSubmit:p,className:"mt-3 flex gap-2",children:[(0,r.jsxs)("div",{className:"absolute -left-[9999px]","aria-hidden":"true",children:[(0,r.jsx)("label",{htmlFor:"footer-newsletter-company",children:"Company"}),(0,r.jsx)("input",{id:"footer-newsletter-company",name:"company",type:"text",tabIndex:-1,autoComplete:"off",value:d,onChange:e=>u(e.target.value)})]}
1),(0,r.jsx)("input",{type:"email",required:!0,value:l,onChange:e=>s(e.target.value),placeholder:"Your email","aria-label":"Email address",className:"min-w-0 flex-1 rounded-lg border-0 px-3 py-2.5 text-sm outline-none focus:ring-2",style:{background:"#fff",color:o.ink}}),(0,r.jsx)("button",{type:"submit",disabled:"sending"===i,className:"shrink-0 rounded-lg px-4 py-2.5 text-sm font-bold text-white transition disabled:opacity-60",style:{background:`linear-gradient(135deg, ${o.accent}, ${o.accentDark})`},children:"sending"===i?"â¦":"Subscribe"})]}),"error"===i&&(0,r.jsxs)("div",{className:"mt-2 text-xs text-white",children:[(0,r.jsx)("p",{children:"Something went wrong â please try again, or email us directly:"}),(0,r.jsx)(n.CopyableEmail,{className:"mt-1",email:e.email,color:"#fff",accent:"rgba(255,255,255,0.75)"})]})]})}e.s(["FooterNewsletterForm",0,a,"default",0,a])}]);
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.