PageSourceSearch

https://www.onthemarket.com/assets/0.1.3293/_next/static/chunks/1028-73855b791f1c63a0.js

js onthemarket.com collected 2026-09-24 17:18:50 UTC 44,343 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1028],{1028:(e,t,l)=>{l.d(t,{A:()=>A});var r=l(37876),n=l(14232),a=l(98477),s=l(31777),i=l(88499),o=l(80546),u=l(6266),c=l(3747),d=l(99614),h=l(70306),m=l(58440),p=l(78621),f=l(2149),y=l(39725),g=l(10999),x=l(10912),v=l(87158),b=l(31257),w=l(65887),j=l(96649);let A=e=>{let{shouldStash:t=!1,inputClassName:l,aiStarIconClassName:A,clearIconClassName:S,clearIcon:N,name:$="search",placeholder:k,allowMultilocation:C,isSelectingRef:q,searchType:D,shouldUseTypingPlaceholder:P,renderToPortal:L}=e,{service:R,persistRecentSearches:M,aiTextarea:E}=(0,x.P)(),F=(0,i.A)((0,o.A)(R)),T=(0,s.d4)(e=>e.query.locationId),I=(0,s.d4)(e=>e.query.altLocationIds),z=(0,s.d4)(e=>e.typeahead[R]),B=(0,s.d4)(e=>e.results.useMultilocation),V=(0,s.d4)(e=>e.results.isFetching),_=(0,s.d4)(e=>e.ui.typeaheadLocationListVisibility),H=(0,s.d4)(e=>e.ui.channelSwitcherWidth),O=(0,s.d4)(e=>e.ui[`typeahead${F}Visibility`]),X=(0,s.d4)(e=>e.ui[`typeahead${F}ListVisibility`]),W=(0,s.d4)(f.DM),{lastUpdated:K,list:U,query:Y=""}=z,G=(0,s.wA)(),J=(0,n.useRef)(),Q=(0,n.useRef)(!1),Z=(0,n.useRef)(null),ee="location"===R,et=[T,...I],el=ee&&et.length>4,{placeholder:er}=y.h8;er=k||er;let en=(0,c.A)(I),ea=(0,c.A)(T),es=(0,c.A)(V),ei=(0,c.A)(K),{shouldShowChannelSwitcher:eo}=(0,v.I)(),{handleEditLocationPill:eu}=(0,b.l)(),[ec,ed]=(0,n.useState)(null),eh=(0,n.useCallback)(()=>{(0,a.flushSync)(()=>ed(null)),eu(null)},[eu]),[em,ep]=(0,n.useState)(!1);(0,n.useEffect)(()=>{!O&&(ed(null),ep(!1),E&&ee&&G((0,p.Te)({persistRecentSearches:M,service:R,locationsOnPage:et,searchType:D,useMultilocation:B})))},[O]),(0,n.useEffect)(()=>{ed(null),ep(!1)},[T,I]),(0,n.useEffect)(()=>{E&&M&&ee&&G((0,p.Te)({persistRecentSearches:M,service:R,locationsOnPage:et,searchType:D,useMultilocation:B}))},[D,T,I]),(0,n.useEffect)(()=>{!1===es&&!0===V&&G((0,m.Cy)({key:"value",value:"Loading..."}))},[V]),(0,n.useEffect)(()=>{if(!E&&K&&K!==ei&&void 0!==ei&&(!1===O||!1===X)){if(Y?.length!==1)C&&"location"===R?G((0,h.gs)({visibility:!0,listVisibility:!0,service:R,locationsOnPage:et})):U.length>0&&(Y?.length===0||Y?.length>1)&&G((0,h.gs)({visibility:!0,listVisibility:!0,service:R,locationsOnPage:et}))}},[K]),(0,n.useEffect)(()=>{ea&&ea!==T&&O&&G((0,h.gs)({visibility:!1,service:R}))},[T]),(0,d.A)(()=>{B&&!(0,u.A)(en,I)&&I?.length&&G((0,h.gs)({listVisibility:!1,visibility:O,service:R,locationsOnPage:et}))},[I]);let ef=(0,r.jsx)(w.A,{visibility:O,listVisibility:_,searchInputRef:J,keyboardDismissRef:Q,searchType:D,shouldStash:t,allowMultilocation:C,isSelectingRef:q,pendingRemoval:ec,setPendingRemoval:ed,editInModal:E&&ee&&!W,cancelPillEdit:eh,clearLocationRef:Z,interacted:em,style:eo&&W?{width:`calc(100% + ${H}px`,left:`-${H}px`}:void 0});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.A,{placeholder:er,name:$,tagForDefaultValue:"location-name",searchInputRef:J,keyboardDismissRef:Q,shouldStash:t,aiStarIconClassName:A,clearIconClassName:S,clearIcon:N,pendingRemoval:ec,setPendingRemoval:ed,cancelPillEdit:eh,clearLocationRef:Z,setInteracted:ep,inputClassName:(0,g.XS)([l,V&&"text-dove",!E&&el&&"caret-transparent"]),shouldUseTypingPlaceholder:P}),L?(0,a.createPortal)(ef,L):ef]})}},4400:(e,t,l)=>{l.d(t,{A:()=>h});var r=l(14232);let n=0,a=null,s=null,i=(e,t)=>document.documentElement.style.setProperty(e,`${t}px`),o=()=>{s&&(clearTimeout(s),s=null)},u=()=>{s=null,i("--visual-viewport-offset-top",window.visualViewport.offsetTop)},c=()=>{i("--visual-viewport-height",window.visualViewport.height),o(),window.visualViewport.offsetTop?s=setTimeout(u,150):u()},d=()=>{a||(a=requestAnimationFrame(()=>{a=null,c()}))},h=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];(0,r.useEffect)(()=>{let{visualViewport:t}=window;if(e&&t)return 1===(n+=1)&&(t.addEventListener("resize",d),t.addEventListener("scroll",d),c()),()=>{(n-=1)>0||(t.removeEventListener("resize",d),t.removeEventListener("scroll",d),a&&(cancelAnimationFrame(a),a=null),o(),document.documentElement.style.removeProperty("--visual-viewport-height"),document.documentElement.style.removeProperty("--visual-viewport-offset-top"))}},[e])}},5180:(e,t,l)=>{l.d(t,{A:()=>i});var r=l(37876);l(14232);var n=l(96523),a=l(97994),s=l(10999);let i=e=>{let{children:t,className:l}=e;return(0,r.jsxs)("div",{className:(0,s.XS)(["flex items-center gap-2 px-4 pb-3 text-brand-contrast font-normal",l]),children:[(0,r.jsx)(n.gc,{icon:a.IB3,className:"shrink-0 text-lg text-error"}),(0,r.jsx)("span",{children:t})]})}},9133:(e,t,l)=>{l.d(t,{A:()=>n});var r=l(37876);l(14232);let n=()=>(0,r.jsx)("svg",{width:"0",height:"0",className:"absolute",children:(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"aiMask",x2:"1",y2:"1",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:"#0066FF"}),(0,r.jsx)("stop",{offset:"100%",stopColor:"#EB5C5F"})]})})})},47322:(e,t,l)=>{l.d(t,{A:()=>i,z:()=>s});var r=l(14232);let n=null,a=0,s=()=>{null===n&&(n=window.scrollY,Object.assign(document.body.style,{inset:`-${n}px 0px 0px`,position:"fixed",overflow:"hidden"}))},i=e=>{(0,r.useLayoutEffect)(()=>
1{if(e)return a+=1,s(),()=>{0==(a-=1)&&(()=>{if(null===n)return;let e=n;n=null;let{style:t}=document.body;t.removeProperty("inset"),t.removeProperty("position"),t.removeProperty("overflow"),window.scrollTo({top:e})})()}},[e])}},59152:(e,t,l)=>{l.d(t,{A:()=>r});let r=e=>void 0===e},65571:(e,t,l)=>{l.d(t,{$S:()=>d,AY:()=>k,BR:()=>$,DL:()=>h,K5:()=>A,MG:()=>p,Sg:()=>v,VT:()=>g,Yi:()=>j,_h:()=>f,bW:()=>s,bg:()=>N,dw:()=>w,fC:()=>a,fd:()=>i,fp:()=>m,ft:()=>b,gc:()=>u,hW:()=>y,jS:()=>c,jd:()=>o,lS:()=>n,mJ:()=>C,sj:()=>x,yy:()=>q});var r=l(22119);let n=e=>{let{radius:t,travelType:l,travelDuration:r,minPrice:n,maxPrice:a,minBedrooms:s,maxBedrooms:i,minSize:o,maxSize:u}=e;return+!!t+ +!!l+ +!!r+(+!!n||+!!a)+(+(null!==s)||+!!i)+(+!!o||+!!u)},a=e=>{let{propertyTypesFromQuery:t=[],propertyTypesFromStash:l=[]}=e,n=r._x.map(e=>e.name),a=t.filter(e=>n.includes(e)),s=l.filter(e=>n.includes(e));return a.length+s.filter(e=>"+"===e.charAt(0)).length-s.filter(e=>"-"===e.charAt(0)).length},s=e=>{let{keywordsFromQuery:t,keywordsFromStash:l=[]}=e;return t.length+l.filter(e=>"+"===e.charAt(0)).length-l.filter(e=>"-"===e.charAt(0)).length},i=e=>{let{query:t,shouldStash:l=!1}=e,{underOffer:r,newHomeFlag:n,retirement:a,sharedOwnership:s,accessibleFeatures:i,greenerChoice:o,petFriendly:u,auction:c,student:d,recentlyReduced:h,shared:m,recentlyAdded:p,letAgreed:f,letLength:y,furnished:g,stash:x,matterportVirtualTour:v,virtualTour:b,video:w}=t,{underOffer:j,newHomeFlag:A,retirement:S,sharedOwnership:N,accessibleFeatures:$,greenerChoice:k,petFriendly:C,auction:q,student:D,recentlyReduced:P,shared:L,recentlyAdded:R,letAgreed:M,letLength:E,furnished:F,matterportVirtualTour:T,virtualTour:I,video:z}=x,B=+(!0===r&&void 0===j)+ +((!1===r||null===r)&&!0===j)+ +(null==n||null!==A)+(null===n&&void 0===A?-1:0)+ +(null==a||null!==S)+(null==a&&void 0===S?-1:0)+ +(null==s||null!==N)+(null==s&&void 0===N?-1:0)+ +(null==i||null!==$)+(null==i&&void 0===$?-1:0)+ +(null==o||null!==k)+(null==o&&void 0===k?-1:0)+ +(null==u||null!==C)+(null==u&&void 0===C?-1:0)+ +(null==c||null!==q)+(null==c&&void 0===q?-1:0)+ +(null==d||null!==D)+(null==d&&void 0===D?-1:0)+ +(null==h||null!==P)+(null==h&&void 0===P?-1:0)+ +(null!=m||null!=L)+(null!=m&&null===L?-1:0)+ +(!0===f&&void 0===M)+ +((!1===f||null===f)&&!0===M)+(y||null!=E?1:0)+(y&&null===E?-1:0)+(g||null!=F?1:0)+(g&&null===F?-1:0)+(p||null!=R?1:0)+(p&&null===R?-1:0)+(v||null!=T?1:0)+(v&&null===T?-1:0)+(b||null!=I?1:0)+(b&&null===I?-1:0)+(w||null!=z?1:0)+(w&&null===z?-1:0),V=+(!0===r)+ +(null!==n)+ +(null!==a)+ +(null!==s)+ +(null!==i)+ +(null!==o)+ +(null!==u)+ +(null!==c)+ +(null!==d)+ +(null!==h)+ +(null!=m)+ +(!0===f)+ +!!y+ +!!g+ +!!p+ +(null!==v)+ +(null!==b)+ +(null!==w);return l?B:V},o=[0,.25,.5,1,2,3,4,5,7.5,10,15,20,30,40],u=[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,275,300,325,350,375,400,425,450,475,500,550,600,650,700,750,800,850,900,950,1e3,1100,1200,1300,1400,1500,1600,1700,1800,1900,2e3,2100,2200,2300,2400,2500,2750,3e3,3250,3500,3750,4e3,4250,4500,4750,5e3,5
1500,6e3,6500,7e3,7500,8e3,8500,9e3,9500,1e4,12500,15e3,0],c=[0,25,50,75,100,125,150,175,200,225,250,275,300,325,350,375,400,425,450,475,500,600,650,700,750,800,850,900,950,1e3,1250,1500,1750,2e3,2500,3e3,3500,4e3,4500,5e3,7500,0],d=[0,100,200,300,400,500,600,700,800,900,1e3,1250,1500,1750,2e3,2250,2500,2750,3e3,3250,3500,3750,4e3,4250,4500,4750,5e3,5500,6e3,6500,7e3,7500,8e3,8500,9e3,9500,1e4,12500,15e3,17500,25e3,0],h=[0,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,110,120,130,150,200,250,300,350,400,0],m=[0,100,150,200,250,300,350,400,450,500,600,700,800,900,1e3,1100,1250,1300,1400,1500,1750,2e3,2250,2500,2750,3e3,3500,4e3,4500,5e3,5500,6e3,6500,7e3,8e3,9e3,1e4,12500,15e3,17500,2e4,25e3,3e4,35e3,0],p=[0,1200,1800,2400,3e3,3600,4200,4800,5400,6e3,7200,8400,9600,10800,12e3,13200,15e3,15600,16800,18e3,21e3,24e3,27e3,3e4,33e3,36e3,42e3,48e3,54e3,6e4,66e3,72e3,78e3,84e3,96e3,108e3,12e4,15e4,18e4,21e4,24e4,3e5,36e4,42e4,0],f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,0],y=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,0],g=[0,1e3,2e3,3e3,4e3,5e3,6e3,7e3,8e3,9e3,1e4,15e3,2e4,25e3,3e4,4e4,5e4,6e4,7e4,8e4,9e4,1e5,11e4,12e4,13e4,14e4,0],x=[0,1e3,2e3,3e3,4e3,5e3,6e3,7e3,8e3,9e3,1e4,15e3,2e4,25e3,3e4,4e4,5e4,6e4,7e4,8e4,9e4,1e5,11e4,12e4,13e4,14e4,0],v=[0,10,50,100,250,500,1e3,1500,2500,5e3,7500,1e4,15e3,25e3,5e4,75e3,1e5,2e5,5e5,0],b=[0,10,50,100,250,500,1e3,1500,2500,5e3,7500,1e4,15e3,25e3,5e4,75e3,1e5,2e5,5e5,0],w=[0,.5,1,1.5,2,2.5,3,4,5,7,10,15,20,25,35,50,100,250,500,0],j=[0,.5,1,1.5,2,2.5,3,4,5,7,10,15,20,25,35,50,100,250,500,0],A=10,S=e=>{let{from:t,items:l,gap:r}=e;return[...Array(l).keys()].map(e=>t+e*r)};[...S({from:0,items:25,gap:10}),...S({from:250,items:10,gap:25}),...S({from:500,items:10,gap:50}),...S({from:1e3,items:15,gap:100}),...S({from:2500,items:10,gap:250}),...S({from:5e3,items:10,gap:500}),...S({from:1e4,items:3,gap:2500})];let N=["driving","train","public-transport","walking","cycling"],$=[15,30,45,60],k=[{name:"all",label:"Sales & lettings"},{name:"for-sale",label:"Sales"},{name:"to-rent",label:"Lettings"}],C=[{name:null,label:"All years"},{name:"last-1-year",label:"Last 1 year"},{name:"last-2-years",label:"Last 2 years"},{name:"last-5-years",label:"Last 5 years"},{name:"last-7-years",label:"Last 7 years"}],q=[{name:null,label:"Any"},{name:"freehold",label:"Freehold"},{name:"leasehold",label:"Leasehold"}]},65887:(e,t,l)=>{l.d(t,{A:()=>I});var r=l(37876),n=l(14232),a=l(31777),s=l(94117),i=l(15094),o=l(96523),u=l(97994),c=l(31963),d=l.n(c),h=l(2149),m=l(70306),p=l(78621),f=l(58440),y=l(4400),g=l(10912),x=l(31257),v=l(22119),b=l(39725),w=l(14974),j=l(97685),A=l(53538);let S=e=>{let{setCurrentLocation:t,isLoadingCurrentLocation:l,className:s="absolute top-1/2 -translate-y-1/2",iconWrapperClassName:i,preventBlur:c=!1,children:d}=e,h=(0,a.d4)(e=>e.query.locationId),[m,p]=(0,n.useState)(!1),[f,y]=(0,n.useState)(!1),[g,x]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{x(!0)},[]),!("geolocation"in navigator)||!g)return null;let v=m||l?(0,r.jsx)(A.A,{className:"w-5 h-5"}):(0,r.jsx)(o.gc,{icon:u.agC,className:`w-5 h-5 ${h===f?"text-dove":""}`});return(0,r.jsxs)("button",{onClick:e=>(e.preventDefault(),e.stopPropagation(),void(p(!0),navigator.geolocation.getCurrentPosition(e=>{p(!1);let l=e.coords,r=`${l.latitude},${l.longitude}`;y(r),t(r)},()=>{p(!1),j.Ay.error(e=>(0,r.jsxs)("span",{children:[(0,r.jsx)(o.gc,{icon:u.bnw,className:"float-right",onClick:()=>j.Ay.dismiss(e.id)}),"Sorry, cannot get your location. Please type a location."]}),{position:"top-left",duration:3e3})},{enableHighAccuracy:!1,timeout:1e4,maximumAge:18e4}))),type:"button",className:s,...c&&{onMouseDown:e=>e.preventDefault()},children:[i?(0,r.jsx)("span",{className:i,children:v}):v,d]})};var N=l(30021);let $=e=>{let{text:t,query:l}=e;if(!l)return(0,r.jsx)(r.Fragment,{children:t});let n=t.toLowerCase().indexOf(l.toLowerCase());return -1===n?(0,r.jsx)(r.Fragment,{children:t}):(0,r.jsxs)(r.Fragment,{children:[n>0&&(0,r.jsx)("span",{children:t.substring(0,n)}),(0,r.jsx)("strong",{className:"text-denim",children:t.substring(n,n+l.length)}),t.substring(n+l.length)]})};var k=l(80546);let C=["radius","min-price","max-price","min-bedrooms","max-bedrooms","min-size","max-size","property-types","keywords","search-type","channel","location-id","location-name","location-type","view"],q=e=>{if(!e||0===Object.keys(e).length)return[];let{"min-price":t=null,"max-price":l=null,"min-bedrooms":r=null,"max-bedrooms":n=null,"prop-types":a,keywords:s}=e,i=[],o=(0,v.g6)({minPrice:t,maxPrice:l});o&&i.push(o);let u=(0,v.Ck)({minBedrooms:r,maxBedrooms:n});if(u&&i.push(u),a?.length>0){let e=a.map(e=>v._x.find(t=>
1t.name===e)?.label).filter(Boolean);e.length>0&&i.push(e.join(", "))}return s?.length>0&&i.push(s.join(", ")),Object.entries(e).forEach(e=>{let[t,l]=e;if(C.includes(t))return;let r=(0,v.CO)((0,k.A)(t),l);r&&i.push(r)}),i},D=e=>{let{criteria:t}=e,l=q(t);return l.length?(0,r.jsx)("div",{className:"w-full font-normal !text-slate truncate",children:l.join(" • ")}):null},P=(0,n.memo)(e=>{let{active:t,counter:l,searchInputRef:n,isSelectingRef:a,item:s={},shouldStash:i,isMultilocation:c,editedPill:h,isLocationsMaxReached:m,criteriaText:p,typeaheadQuery:f,handleHover:y,handleItemSelect:x,handleDeleteItem:b}=e,{liClassName:j,liIcons:A,noItemIcon:S,horizontal:k,service:C,manualSearch:P,aiTextarea:L}=(0,g.P)(),{isRecentSearch:R,parent:M,isTextSearchSuggestion:E,textSearchParams:F,textSearchUrl:T,namePrefix:I}=s,{name:z,value:B,locationType:V,query:_,query:H,criteria:O}=(0,w.wF)({item:s,service:C}),{criteria:X}=_||{},W=f||"",K=w.So[V]||w.SM,U=R?(O||X)?.radius:null,Y=U&&U>0?(0,v.HH)(U):null,G=R&&L,J=G?q(O||X):[],Q=E||G,Z="";E&&p?Z=`${p}, `:!E&&J.length>0&&(Z=`${J.join(", ")}, `);let ee=I&&z.startsWith(I)?z.slice(I.length):z,et=`${j} ${L?w.I0.padding:""} ${!0===t?"bg-stone":""}`,el=(0,r.jsx)(o.gc,{icon:K,className:`mx-auto w-4 h-4 fill-current text-denim text-${A}`});E?el=(0,r.jsx)("span",{className:"[&_svg_path]:![fill:url(#aiMask)]",children:(0,r.jsx)(N.A,{faIcon:"ai-star",className:"text-svg-xs min-h-[16px]"})}):R&&(el=(0,r.jsx)(o.gc,{icon:u.fBL,className:`mx-auto w-4 h-4 fill-current text-denim text-${A}`}));let er=async e=>{e.preventDefault(),a&&(a.current=!0),await scheduler.yield(),x({e,id:B,name:z,locationType:V,shouldStash:i,manualSearch:P,isMultilocation:c,...h&&!E&&!R&&{editedPill:h},...R&&{query:H,searchUrl:s.searchUrl},...E&&{isTextSearchSuggestion:E,textSearchParams:F,textSearchUrl:T,queryText:f}}),L&&n?.current?.blur()},en=k?{onMouseDown:e=>er(e)}:{onClick:e=>er(e),...L&&{onMouseDown:e=>e.preventDefault()},onKeyPress:e=>!d()()&&er(e),onMouseOver:e=>!d()()&&y(e,l),onFocus:e=>y(e,l)};return R&&m||c&&(!V||V.match(/road|postcode|station|supermarket|school|university/i))?null:(0,r.jsxs)("li",{className:et,role:"option","aria-selected":t,...en,children:[!S&&(0,r.jsx)("div",{className:"rounded-full bg-stone w-10 h-10 flex items-center justify-center shrink-0",children:el}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 px-2 flex items-center",children:[k&&(0,r.jsx)(o.gc,{icon:u.QLR,className:"cursor-pointer text-xs -ml-1 mr-1"}),Q?(0,r.jsxs)("div",{className:"line-clamp-2 font-normal",children:[Z,I,(0,r.jsxs)("span",{className:"font-bold",children:[ee,!E&&Y&&` ${Y}`]})]}):(0,r.jsxs)("div",{className:"block",children:[(0,r.jsx)($,{text:z,query:W}),!R&&M&&`, ${M}`,Y&&` ${Y}`,(0,r.jsx)(D,{criteria:O||X})]})]}),R&&!M&&(0,r.jsx)("div",{className:"w-5 h-10 flex items-center justify-end shrink-0",children:(0,r.jsx)(o.gc,{icon:u.Jyw,className:`cursor-pointer text-${A}`,onMouseDown:e=>e.preventDefault(),onClick:e=>b({id:B,query:W,e,searchInputRef:n})})}),c&&!R&&(0,r.jsx)("div",{className:"w-5 h-10 flex items-center justify-end shrink-0",...en,children:(0,r.jsx)(o.gc,{icon:u.q_k,className:"cursor-pointer text-xl"})})]})});var L=l(5180);let R=e=>{let{onClose:t,children:l}=e;return(0,n.useEffect)(()=>{let e=e=>{("Escape"===e.key||27===e.keyCode)&&t()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col justify-end",role:"presentation",onMouseDown:e=>e.preventDefault(),children:[(0,r.jsx)("button",{type:"button","aria-label":"Close","data-test":"edit-location-scrim",className:"fixed inset-0 cursor-default bg-black/40",onMouseDown:e=>e.preventDefault(),onClick:t}),(0,r.jsxs)("div",{className:"relative flex max-h-full flex-col overflow-hidden rounded-t-3xl bg-white",role:"dialog","aria-label":"Edit location","data-test":"edit-location-sheet",children:[(0,r.jsx)("div",{className:"flex shrink-0 items-center justify-end border-b border-cadet-blue/30 bg-white px-5 py-3",children:(0,r.jsx)("button",{type:"button","aria-label":"Close","data-test":"edit-location-close",className:"-mr-2 flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-denim hover:bg-black/10",onMouseDown:e=>e.preventDefault(),onClick:t,children:(0,r.jsx)(o.gc,{icon:u.Jyw,className:"text-svg-xs"})})}),l]})]})},M=e=>{let{children:t}=e;return(0,r.jsx)("li",{className:w.I0.label,role:"presentation",children:t})},E=e=>{let{pill:t,onRemove:l}=e,{liClassName:n}=(0,g.P)();return(0,r.jsx)("li",{className:`${n} border-b ${w.I0.padding}`,role:"presentation",children:(0,r.jsxs)("button",{type:"button",className:"flex w-full items-center cursor-pointer text-left",onMouseDown:e=>e.preventDefault(),onClick:l,children:[(0,r.jsx)("span",{className:"relative rounded-full bg-stone w-10 h-10 flex items-center justify-center shrink-0 [&_svg_path]:![fill:url(#aiMask)]",children:(0,r.jsx)(o.gc,{icon:u.yLS,className:"w-4 h-4"})}),(0,r.jsx)("span",{className:"flex-1 min-w-0 px-2 flex items-center font-bold text-denim",children:`Remove ${(0,v.Xz)(t)}`})]})})},F=e=>{let{setCurrentLocation:t}=e,{liClassName:l}=(0,g.P)();return(0,r.jsx)("li",{className:`${l} border-b ${w.I0.padding}`,role:"presentation",children:(0,r.jsx)(S,{setCurrentLocation:t,preventBlur:!0,className:"flex w-full items-center [&_svg_path]:![fill:url(#aiMask)]",iconWrapperClassName:"relative rounded-full bg-stone w-10 h-10 flex items-center justify-center shrink-0",children:(0,r.jsx)("span",{className:"flex-1 min-w-0 px-2 flex items-center font-bold text-denim",children:"Current location"})})})},T=e=>{let{active:t,onActivate:l,name:n,label:a,criteriaParts:s,criteria:i}=e,{liClassName:c,liIcons:h,noItemIcon:m,aiTextarea:p}=(0,g.P)(),f=i?.radius>0?(0,v.HH)(i.radius):null;return(0,r.jsxs)("li",{className:`${c} ${p?w.I0.padding:""} ${t?"bg-stone":""}`,role:"option","aria-selected":t,onMouseOver:()=>{d()()||l()},onFocus:l,children:[!m&&(0,r.jsx)("div",{className:"rounded-full bg-stone w-10 h-10 flex items-center justify-center shrink-0",children:(0,r.jsx)(o.gc,{icon:u.fBL,className:`mx-auto w-4 h-4 fill-current text-denim text-${h}`})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 px-2 flex items-center",children:p?(0,r.jsxs)("div",{className:"line-clamp-2 font-normal",children:[s.length>0&&`${s.join(", ")}, `,(0,r.jsx)("span",{className:"font-bold",children:a}),f&&` ${f}`]}):(0,r.jsxs)("div",{className:"block truncate",children:[n,f&&` ${f}`,(0,r.jsx)(D,{criteria:i})]})}),(0,r.jsx)("div",{className:"w-5 h-10 flex items-center justify-end shrink-0",children:(0,r.jsx)(o.gc,{icon:u.Jyw,className:`curs
1or-pointer text-${h}`,onMouseDown:e=>e.preventDefault()})})]})},I=e=>{let{visibility:t=!1,searchInputRef:l,keyboardDismissRef:o,shouldStash:u,listVisibility:c=!0,allowMultilocation:d,isSelectingRef:v,containerClassName:w,style:j,pendingRemoval:A,setPendingRemoval:S,editInModal:N=!1,cancelPillEdit:$,clearLocationRef:k,interacted:C}=e,{containerClassName:D,ulClassName:I,dontDisplayNoResults:z,service:B,aiTextarea:V}=(0,g.P)(),_=V?"relative w-full bg-white flex-1 min-h-0 lg:flex-initial":w||D,H=(0,a.wA)(),O=(0,a.d4)(e=>e.typeahead[B]),X=(0,a.d4)(e=>e.results.useMultilocation),{list:W,counter:K}=O,U=O?.textSearch?.["criteria-text"],Y=O?.warning,G=O?.warningVisible||W.some(e=>e?.isTextSearchSuggestion)?Y:null,J=(0,a.d4)(e=>e.query.stash),Q=(0,a.d4)(e=>e.query.altLocationIds)||[],Z=(0,a.d4)(e=>e.query.locationId),ee=(0,a.d4)(e=>e.query.locationName),et=(0,a.d4)(e=>e.formData["alt-locations-data"])||[],el=(0,a.d4)(f.yM)&&b.of.typeaheadCurrentLocation,er=(0,a.d4)(e=>e.results.savedSearchParams),en=(0,a.d4)(e=>(0,p.jV)(e,B,V)),ea=[ee,...et.map(e=>e.name)].filter(Boolean).join("; "),es=(0,a.d4)(e=>e.query[B]),ei=O?.query||"",eo=X&&"location"===B&&!V,eu=(0,a.d4)(h.DM),ec=(0,a.d4)(e=>!!e.ui.searchBarHeight);(0,y.A)(t&&!eu&&!V&&ec);let ed=[Z,...Q],eh="location"===B&&ed.length>4,em=+!!en,{handleHover:ep,handleItemSelect:ef,handleDeleteItem:ey,handleRemoveLocation:eg}=(0,x.l)(),ex=W;if("keywords"===B){let e=(0,s.A)(es,J[B].filter(e=>"-"===e.charAt(0)).map(e=>e.slice(1))),t=(0,s.A)(W.map(e=>e.toLowerCase()),e||[]);ex=(0,s.A)(t,J[B].filter(e=>"+"===e.charAt(0)).map(e=>e.slice(1)))}let ev=V?ex.reduce((e,t)=>({hasSuggestion:e.hasSuggestion||!!t?.isTextSearchSuggestion,hasRecent:e.hasRecent||!!t?.isRecentSearch,hasResult:e.hasResult||!!t&&!t.isTextSearchSuggestion&&!t.isRecentSearch}),{hasSuggestion:!1,hasRecent:!1,hasResult:!1}):{hasSuggestion:!1,hasRecent:!1,hasResult:!1},eb=V&&ev.hasSuggestion,ew=V&&(ei?.trim().length??0)>1,ej=V&&!C&&!!ee&&!ev.hasResult&&!ev.hasSuggestion;ej&&(ex=[]);let eA=V&&!eh&&!eb&&!ej&&(en||ev.hasRecent),eS=(0,n.useMemo)(()=>q(er),[er]),eN=V?_:`${_} transform transition duration-150 ease-in-out data-[closed]:opacity-0`,e$=N&&!!A,ek=`overflow-auto overscroll-contain ${I} ${V?`${e$?"min-h-0 flex-1":"h-full lg:h-auto lg:max-h-[55dvh]"} [&>li:last-child]:!pb-6`:""} ${c?"":"hidden "} ${d&&ex.length>0&&!V?"border-b":" "}`,eC=V||eu||!ec?void 0:{height:"calc(var(--visual-viewport-height, 100dvh) - var(--header-height, 0px) - var(--search-bar-height, 0px))"};if(!V&&z&&0===ex.length&&!eh)return null;let eq=(0,r.jsxs)("ul",{className:ek,style:eC,onMouseDown:V?e=>e.preventDefault():void 0,onTouchMove:V&&!eu?()=>{let e=l?.current;e&&document.activeElement===e&&(o&&(o.current=!0),e.blur())}:void 0,onClick:()=>{V&&l?.current?.blur(),H((0,m.gs)({visibility:!1,service:B}))},onKeyPress:()=>{H((0,m.gs)({visibility:!1,service:B}))},role:"listbox",tabIndex:V?void 0:"0","aria-label":"Location suggestions","data-test":"typeahead-list",children:[V&&!eb&&A&&(0,r.jsx)(E,{pill:A,onRemove:e=>{if(e.stopPropagation(),A?.isPrimary&&1===ed.length){$(),k?.current?.(),l?.current?.focus({preventScroll:!0});return}eg(A),S(null),l?.current?.blur()}}),V&&!eb&&!A&&el&&!ev.hasResult&&!ew&&!ej&&(0,r.jsx)(F,{setCurrentLocation:e=>{H((0,f.LF)([{locationId:e},{altLocationIds:["*"]},{polygons:["*"]},{boundingBox:null},{near:!1},{radius:.25}]))}}),eb&&(0,r.jsx)(M,{children:"Recommendations"}),eA&&(0,r.jsx)(M,{children:"Recent searches"}),en&&!eb&&!ej&&(0,r.jsx)(T,{active:0===K,onActivate:()=>{0!==K&&H((0,p.SI)({counter:0,service:B}))},name:ee,label:ea,criteriaParts:eS,criteria:er}),A&&ev.hasResult&&(0,r.jsx)(M,{children:"Did you mean?"}),0===ex.length&&!z&&(0,r.jsx)("li",{className:"px-4 py-3",role:"presentation",children:(0,r.jsx)("span",{children:"No results found"})}),ex.map((e,t)=>{let n=t+em;return(0,r.jsx)(P,{item:e,active:n===K,counter:n,searchInputRef:l,shouldStash:u,isMultilocation:eo,editedPill:A,isLocationsMaxReached:eh,isSelectingRef:v,criteriaText:U,typeaheadQuery:ei,handleHover:ep,handleItemSelect:ef,handleDeleteItem:ey},`typeahead-item${t}`)})]}),eD=(0,r.jsxs)("div",{className:eN,style:V?void 0:j,children:[!V&&eh&&(0,r.jsx)(L.A,{children:"Maximum 5 locations reached"}),V&&G?.message&&(0,r.jsx)(L.A,{className:"!px-5 pt-3",children:G.message}),e$?(0,r.jsx)(R,{onClose:$,children:eq}):eq]});return V?eD:(0,r.jsx)(i.e,{show:t,children:eD})}},87158:(e,t,l)=>{l.d(t,{I:()=>u});var r=l(14232),n=l(31777),a=l(76178),s=l(58440),i=l(59152),o=l(65571);let u=()=>{let e=(0,n.wA)(),t=(0,n.d4)(e=>e.maps.activePins),l=(0,n.d4)(e=>e.results.useMultilocation),u=(0,n.d4)(e=>e.query.stash),c=(0,n.d4)(e=>e.query.searchType),d=(0,n.d4)(e=>e.query.radius),h=(0,n.d4)(e=>e.query.minSize),m=(0,n.d4)(e=>e.query.maxSize),p=(0,n.d4)(e=>e.query.minPrice),f=(0,n.d4)(e=>e.query.maxPrice),y=(0,n.d4)(e=>e.query.minBedrooms),g=(0,n.d4)(e=>e.query.maxBedrooms),x=(0,n.d4)(e=>e.query.propertyTypes),v=(0,n.d4)(e=>e.query.hasCustomPolygons),b=(0,n.d4)(e=>e.query.near),w=(0,n.d4)(e=>e.query.propertyTypePrices),j=(0,n.d4)(e=>e.query.soldIn),A=(0,n.d4)(e=>e.query.tenure),S=(0,n.d4)(e=>e.query.stash.minSize),N=(0,n.d4)(e=>e.query.stash.maxSize),$=(0,n.d4)(e=>e.query.stash.minPrice),k=(0,n.d4)(e=>e.query.stash.maxPrice),C=(0,n.d4)(e=>e.query.stash.propertyTypes),q=(0,n.d4)(e=>e.query.stash.underOffer),D=(0,n.d4)(e=>e.query.stash.letAgreed),P=(0,n.d4)(e=>e.query.stash.characterProperty),L=(0,n.d4)(e=>e.query.stash.newHomeFlag),R=(0,n.d4)(e=>e.query.stash.retirement),M=(0,n.d4)(e=>e.query.stash.sharedOwnership),E=(0,n.d4)(e=>e.query.stash.accessibleFeatures),F=(0,n.d4)(e=>e.query.stash.greenerChoice),T=(0,n.d4)(e=>e.query.stash.petFriendly),I=(0,n.d4)(e=>e.query.stash.auction),z=(0,n.d4)(e=>e.query.stash.student),B=(0,n.d4)(e=>e.query.stash.recentlyReduced),V=(0,n.d4)(e=>e.query.stash.recentlyAdded),_=(0,n.d4)(e=>e.query.stash.shared),H=(0,n.d4)(e=>e.query.stash.letLength),O=(0,n.d4)(e=>e.query.stash.furnished),X=(0,n.d4)(e=>e.query.stash.matterportVirtualTour),W=(0,n.d4)(e=>e.query.stash.virtualTour),K=(0,n.d4)(e=>e.query.stash.video),U=(0,n.d4)(e=>e.query.stash.keywords),Y=(0,n.d4)(e=>e.query.stash.propertyTypePrices),G=(0,n.d4)(e=>e.query.stash.soldIn),J=(0,n.d4)(e=>e.query.stash.tenure),Q=(0,n.d4)(e=>e.agent.name),Z=(0,n.d4)(e=>e.development.developmentSearch),ee=(0,o.fC)({propertyTypesFromQuery:x}
1),et=!!(void 0===S?h:S)||!!(void 0===N?m:N),el=!!(void 0===$?p:$)||!!(void 0===k?f:k),er=Object.keys(u).filter(e=>!e.match(/keywords|propertyTypes|propertyFeatures|altLocationIds|priceFrequency|pricePer|sizeUnit/)),en=Object.keys(u).filter(e=>!e.match(/keywords|propertyTypes|propertyFeatures|altLocationIds|priceFrequency|pricePer|sizeUnit|minPrice|maxPrice/)),ea=er.length,es=en.length,ei=C.length>0,eo=U.length>0,eu=!(0,i.A)(q)||!(0,i.A)(D)||!(0,i.A)(P)||!(0,i.A)(L)||!(0,i.A)(R)||!(0,i.A)(M)||!(0,i.A)(E)||!(0,i.A)(F)||!(0,i.A)(T)||!(0,i.A)(I)||!(0,i.A)(z)||!(0,i.A)(B)||!(0,i.A)(V)||!(0,i.A)(_)||!(0,i.A)(D)||!(0,i.A)(H)||!(0,i.A)(O)||!(0,i.A)(X)||!(0,i.A)(W)||!(0,i.A)(K),ec="for-sale"===c,ed="to-rent"===c,eh=ec||ed;return{hasAnyFilterChanged:ea||ei||eo||eu,hasAnyFilterButPriceChanged:es||ei||eo||eu,hasSizeChanged:void 0!==S||void 0!==N,hasPriceChanged:void 0!==$||void 0!==k,hasAnyPropertyTypeChanged:ei,hasAnyMoreFilterChanged:eu,shouldShowChannelSwitcher:eh&&!Z,shouldDisplayRadius:!!d,shouldDisableRadius:l||v||b,shouldDisplayTravelTime:!1,shouldDisplaySize:et,shouldDisplayPrice:el,shouldDisplayBedrooms:null!==y||null!==g,shouldDisplayPropertyTypes:ee>0,shouldDisplayPropertyTypePrices:!!(void 0===Y?w:Y),shouldDisplaySoldIn:!!(void 0===G?j:G),shouldDisplayTenure:!!(void 0===J?A:J),handleSelection:(0,r.useCallback)(l=>{let{event:r={},queryKeyName:n,singleValue:i,shouldStash:o}=l,{target:u={}}=r,{value:c}=u;r.stopPropagation&&r.stopPropagation();let d=c||null;n.match(/(minPrice|maxPrice|minBedrooms|maxBedrooms|minSize|maxSize)/i)&&null!==d&&(d=parseFloat(c)),n.match(/(radius|underOffer|shared|recentlyAdded|letAgreed|letLength|furnished|matterportVirtualTour|virtualTour|video|propertyTypePrices|soldIn|tenure)/i)&&(d=i),n.match(/(propertyTypes)/i)&&(d=o?i:[i]),t?.length>0&&e((0,a.wc)()),o?e((0,s.Bd)([{[n]:d},{page:1}])):e((0,s.LF)([{[n]:d},{page:1}]))},[t]),handleMultipleSelection:(0,r.useCallback)(l=>{let{listOfParameters:r,shouldStash:n}=l;t?.length>0&&e((0,a.wc)()),n?e((0,s.Bd)(r)):e((0,s.LF)(r))},[t]),isAgentPage:!!Q,isSalesChannel:ec,isRentalChannel:ed,isSalesOrRental:eh}}},96649:(e,t,l)=>{let r;l.d(t,{A:()=>ep});var n=l(37876),a=l(14232),s=l(98477),i=l(31777),o=l(54389),u=l(88499),c=l(80546),d=l(72644),h=l(96523),m=l(97994),p=l(30021),f=l(64005),y=l(58440),g=l(78621),x=l(70306),v=l(76178),b=l(2149),w=l(31257),j=l(87158),A=l(10912),S=l(10999),N=l(22119),$=l(21418);let k={a:[3,1],b:[4,5],c:[4,3],d:[3,3],e:[1,3],f:[3,4],g:[3,5],h:[3,6],i:[1,8],j:[3,7],k:[3,8],l:[3,9],m:[4,7],n:[4,6],o:[1,9],p:[1,10],q:[1,1],r:[1,4],s:[3,2],t:[1,5],u:[1,7],v:[4,4],w:[1,2],x:[4,2],y:[1,6],z:[4,1]},C=new Set("qwertasdfgzxcvb"),q=e=>C.has(e.toLowerCase())?1.05:1,D=(r={},["th","he","in","er","an","re","on","at","en","nd","ti","es","or","te","of","ed","is","it","al","ar","st","to","nt","ng","se","ha","as","ou","io","le","ve","co","me","de","hi","ri","ro","ic","ne","ea","ra","ce","li","ch","ll","be","ma","si","om","ur"].forEach(e=>{let[t,l]=e,n=((e,t)=>{let l=k[e.toLowerCase()],r=k[t.toLowerCase()];if(!l||!r)return 1;let n=l[0]-r[0],a=l[1]-r[1];return Math.sqrt(n*n+a*a)})(t,l),a=q(t)+q(l);r[`${t}->${l}`]=Math.min(60*(.5+.5*n)*a,180)}),r);var P=l(34147),L=l(56086),R=l(4747);let M=["Cornwall","Tenby","Brighton","Whitby","Whitstable"],E=["Edinburgh","Manchester","Leeds","Bristol","Norfolk"],F=["Oxford","Durham","Newcastle","Exeter","Cardiff"],T=["Brabazon","Canary Wharf","Salford Quays","Wembley Park","Nine Elms"],I=["Bath","Stoke-on-Trent","Bradford","Sunderland","Doncaster"],z=["Mayfair","Kensington","Cheshire","Knightsbridge","Weybridge"],B=["the Cotswolds","the Lake District","the Peak District","the Yorkshire Dales","Highlands and Islands"],V=["CF10","SW1A","EH1","M1","N1"],_=["1","2","3","4","5"],H=["2","3","4","5"],O=["London Waterloo","Clapham Junction","Manchester Piccadilly","Glasgow Central","Bristol Temple Meads"],X=["Pet-friendly","Furnished","Chain-free","Spacious","Accessible"],W=["off-street parking","a garage","a patio","a garden","a driveway"],K=["\xa3150,000","\xa3200,000","\xa3250,000","\xa3300,000","\xa3400,000"],U=["\xa31 million","\xa31.5 million","\xa32 million","\xa33 million","\xa35 million"],Y=["\xa31,000","\xa31,500","\xa32,000","\xa32,500","\xa33,000"],G=[()=>`${(0,L.A)(_)} bedroom new build flats in ${(0,L.A)(E)}`,()=>`Detached property in ${(0,L.A)(M)} with a garden and sea views`,()=>`${(0,L.A)(V)}, ${(0,L.A)(H)} bed houses with ${(0,L.A)(W)}`,()=>`Apartments within 1 mile of ${(0,L.A)(O)} station`,()=>`Up to ${(0,L.A)(K)} in ${(0,L.A)(I)}`,()=>`Homes over ${(0,L.A)(U)} in ${(0,L.A)(z)}`,()=>`Character cottages in ${(0,L.A)(B)}`,()=>`Recently reduced ${(0,L.A)(_)} bed homes in ${(0,L.A)(E)}`],J=[()=>`${(0,L.A)(H)} bed shared houses in ${(0,L.A)(F)}`,()=>`Furnished studio flats in ${(0,L.A)(T)}`,()=>`${(0,L.A)(X)} ${(0,L.A)(_)} bed flats in ${(0,L.A)(E)}`,()=>`Homes within 1 mile of ${(0,L.A)(O)} station`,()=>`Up to ${(0,L.A)(Y)} per month in ${(0,L.A)(I)}`,()=>`Sea view apartments in ${(0,L.A)(M)}`],Q=[()=>`Cottages in ${(0,L.A)(B)}`,()=>`${(0,L.A)(H)} bed detached in ${(0,L.A)(E)}`,()=>`Sea view homes in ${(0,L.A)(M)}`,()=>`Studio flats in ${(0,L.A)(T)}`,()=>`${(0,L.A)(_)} bed homes near ${(0,L.A)(O)}`,()=>`Shared houses in ${(0,L.A)(F)}`],Z=(e,t)=>{let l=Q;return e||(l=t?G:J),(0,R.A)(l,6).map(e=>e())};var ee=l(47322),et=l(82580),el=l(9133),er=l(5180);let en=(0,o.Mz)([e=>e.query.locationId,e=>e.query.altLocationIds],(e,t)=>e?[e,...t]:[]),ea=(0,o.Mz)([e=>e.query.altLocationIds,e=>e.query.value,e=>e.query.locationName,e=>e.query.polygons,e=>e.query.near,e=>e.query.locationType,e=>e.query.stash.locationName],(e,t,l,r,n,a,s)=>({altLocationIds:e,valueFromQuery:t,locationName:l,polygons:r,isSearchByBoundsActive:n,locationType:a,locationNameFromStash:s})),es=(0,o.Mz)([e=>e.results],e=>({useMultilocation:e.useMultilocation,isFetching:e.isFetching,useTravelTime:e.useTravelTime})),ei=e=>e.results.criteriaText||"",eo=e=>{let{className:t}=e;return(0,n.jsx)("div",{className:(0,S.XS)(["inline-block absolute leading-3 align-text-top w-auto mr-1 z-10",t]),children:(0,n.jsx)("span",{className:"[&_svg_path]:![fill:url(#aiMask)]",children:(0,n.jsx)(p.A,{faIcon:"ai-star",className:"text-svg-xs min-h-[20px]"})})})},eu=e=>{let{onClick:t}=e;return(0,n.jsx)("button",{type:"button","aria-label":"Close search","data-test":"typeahead-close",onMouseDown:e=>e.preventDefault(),onClick:t,className:"absolute left-5 top-[9px] z-10 flex h-9 w-9 items-center justify-center rounded-full bg-stone text-denim",children:(0,n.jsx)(h.gc,{icon:m.CeG,className:"text-md"})})},ec=e=>{let{icon:t,onClick:l,nextToSearchIcon:r}=e;return(0,n.jsx)("button",{type:"button","aria-label":"Clear search","data-test":"typeahead-clear",onMouseDown:e=>e.preventDefault(),onClick:l,className:(0,S.XS)(["absolute z-10 flex h-9 w-9 items-center justify-center rounded-full bg-stone hover:opacity-80 [&_svg_path]:![fill:url(#aiMask)]",r?"bottom-[9px] right-16 lg:right-[56px]":"right-5 top-[9px] lg:right-3 lg:top-[15px]"]),children:(0,n.jsx)(h.gc,{icon:t,className:"text-md"})})},ed=e=>{let{onClick:t}=e;return(0,n.jsx)("button",{type:"button","aria-label":"Search","data-test":"typeahead-search",onMouseDown:e=>e.preventDefault(),onClick:t,className:"absolute bottom-[9px] right-5 z-10 flex h-9 w-9 items-center justify-center rounded-full bg-[linear-gradient(180deg,#0066FF_0%,#EB5C5F_100%)] text-white hover:opacity-80 lg:right-3",children:(0,n.jsx)(h.gc,{icon:m.$UM,className:"text-md"})})},eh=e=>{let{className:t}=e;return(0,n.jsx)("div",{"data-test":"typeahead-divider",className:(0,S.XS)(["h-px shrink-0 bg-[linear-gradient(90deg,#0066FF_0%,#EB5C5F_100%)] lg:bg-none",t])})},em=e=>{let{pills:t,pendingRemoval:l,onSelect:r}=e;return(0,n.jsx)("div",{className:"flex shrink-0 flex-wrap gap-2 px-5 pb-3 pt-3 lg:py-3",role:"presentation",onMouseDown:e=>e.preventDefault(),children:t.map(e=>(0,n.jsx)(f.a,{as:"button",type:"button",color:l?.id===e.id?"selected-ai":"ai",className:"max-w-full cursor-pointer",onMouseDown:e=>e.preventDefault(),onClick:()=>r(l?.id===e.id?null:e),children:e.name},e.id))})}
1,ep=e=>{let{id:t,searchInputRef:l,keyboardDismissRef:r,name:o="search",inputClassName:p,shouldStash:f,placeholder:k="Location",aiStarIconClassName:C,clearIconClassName:q,clearIcon:L,pendingRemoval:R,setPendingRemoval:M,cancelPillEdit:E,clearLocationRef:F,setInteracted:T}=e,{service:I,prefetch:z,manualSearch:B,shouldUseTypingPlaceholder:V,persistLocationOnBlur:_,openOnFocus:H,aiTextarea:O,showLocationChip:X}=(0,A.P)(),W=V||O,K=(0,i.wA)(),U=(0,i.d4)(b.DM),{handleDisplayTypeahead:Y,handleChange:G,handleKeypress:J,handleClearSearch:Q,handleEditLocationPill:ep,flushQueryCommit:ef}=(0,w.l)(),ey=(0,i.d4)(e=>{let{stash:t,value:l}=e.query,{value:r}=t;switch(I){case"agentName":case"developer":{let t=e.query[I]||"",l=e.query.stash[I];return void 0!==l?l:t}default:return(void 0===r?l:r)||""}}),eg=(0,i.d4)(e=>e.formData["alt-locations-data"]),ex=(0,i.d4)(e=>e.query.locationData),ev=(0,i.d4)(ei),eb=(0,i.d4)(e=>e.maps.activePins),ew=(0,i.d4)(en),{altLocationIds:ej,valueFromQuery:eA,locationName:eS,polygons:eN,isSearchByBoundsActive:e$,locationType:ek,locationNameFromStash:eC}=(0,i.d4)(ea),{useMultilocation:eq,isFetching:eD,useTravelTime:eP}=(0,i.d4)(es),eL="location"===I||"payload"===I,eR=eL&&ew.length>4,eM=(0,$.G)(e=>e.results.isFetching),eE=(0,$.G)(e=>e.ui.doNotRestoreInputValue),eF=(0,i.d4)(e=>e.ui.doNotRestoreInputValue),eT=(0,$.G)(e=>e.query.value),[eI,ez]=(0,a.useState)(ey),[eB,eV]=(0,a.useState)(!1),[e_,eH]=(0,a.useState)(1),[eO,eX]=(0,a.useState)(!1),eW=(0,a.useRef)(!1),eK=(0,a.useRef)(!1),[eU,eY]=(0,a.useState)(!1),eG=(0,a.useRef)(!1),eJ=(0,a.useRef)(!1),{isSalesOrRental:eQ,isSalesChannel:eZ}=(0,j.I)(),e0=(0,i.d4)(b.H6),e1=`typeahead${(0,u.A)((0,c.A)(I))}Visibility`,e5=(0,i.d4)(e=>e.ui[e1]),e4=eB||e5,e3=O&&e4,e2=U||e_>1,e7=e3&&!U;(0,ee.A)(e7);let e6=O&&eL&&(eB||!!R||eU)&&ew.length>0&&!e$&&X&&!eO,e9=e6?[{id:ew[0],name:eS,parent:ex?.parent,isPrimary:!0},...ej.map(e=>{let t=(eg||[]).find(t=>t["seo-id"]===e);return t?{id:e,name:t.name,parent:t.parent,isPrimary:!1}:null}).filter(Boolean)]:[],e8="top-1/2 -translate-y-1/2";e3&&(e8="top-6");let te=e3?`${e8} !ml-[17px]`:`${e8} ${C}`,tt=()=>{let e="";return eN.length>0?e=eS?`${eS} (Drawn area)`:"Drawn area":"point"!==ek||eS?e$?e=`Near ${eS}`:eq?e=[{name:eS,parent:ex?.parent},...eg].map(N.Xz).join("; "):eP?e="":eS?e=(0,N.Xz)({name:eS,parent:ex?.parent}):B&&(e=eC):e="Current location",e&&ev?`${ev}, ${e}`:e},tl=eD?ey:eI;O&&eL&&!e4&&!eD&&(tl=eF?"Loading...":(()=>{let e=tt();if(e||!eS)return e;let t=(0,N.Xz)({name:eS,parent:ex?.parent});return ev?`${ev}, ${t}`:t})());let tr=tl,tn=`cursor-pointer absolute top-1/2 -translate-y-1/2 right-3 ${q??""}`,ta=L||m.Jyw,ts=function(e){let{deletingSpeed:t=10,holdDelay:l=1500,baseDelay:r=10,enabled:n,rotate:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[i,o]=(0,a.useState)(""),[u,c]=(0,a.useState)(!0),d=(0,a.useRef)("typing"),h=(0,a.useRef)(0),m=(0,a.useRef)(0),p=(0,a.useRef)(0),f=(0,a.useRef)(null),y=(0,a.useRef)(e);y.current=e;let g=(0,a.useRef)(0);return((0,a.useEffect)(()=>{if(!n||!s||!y.current.length)return;let e=g.current%y.current.length;o(y.current[e]);let t=setInterval(()=>{g.current=e=(e+1)%y.current.length,o(y.current[e])},l);return()=>clearInterval(t)},[n,s,l,e.length]),(0,a.useEffect)(()=>{let e;if(!n||s)return;let a=n=>{if(null==f.current){f.current=n,e=requestAnimationFrame(a);return}let s=n-f.current;f.current=n,m.current+=s;let i=y.current;if(!i.length){e=requestAnimationFrame(a);return}let u=d.current,x=h.current,v=i[g.current%i.length]||"";if("typing"===u&&x<v.length){let e=v[x-1],t=v[x],l=e?`${e}->${t}`:null,n=l&&D[l]?D[l]:r;m.current>=n&&(h.current=x+1,o(v.slice(0,h.current)),m.current=0)}else"typing"===u&&x>=v.length?(d.current="holding",m.current=0,p.current=0):"holding"===u?(p.current+=s,p.current>=500&&(c(e=>!e),p.current=0),m.current>=l&&(d.current="deleting",m.current=0,p.current=0)):"deleting"===u&&x>0?m.current>=t&&(h.current=x-1,o(v.slice(0,h.current)),m.current=0):"deleting"===u&&0===x&&(g.current=(g.current+1)%i.length,d.current="typing",h.current=0,m.current=0);"holding"!==d.current&&c(!0),e=requestAnimationFrame(a)};return e=requestAnimationFrame(a),()=>{cancelAnimationFrame(e),f.current=null}},[t,l,r,s,n]),s)?i:u?`${i}|`:i}(((e,t)=>{let[l,r]=(0,P.A)("otmSuggestedSearches",{}),n=t?"sales":"rental",[s,i]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=l?.[n];if(e?.mobile?.length&&e?.desktop?.length)return void i(e);let a={mobile:Z(!0,t),desktop:Z(!1,t)};r(e=>({...e,[n]:a})),i(a)},[n]),s?s[e?"mobile":"desktop"]:[]})(e0,eZ),{deletingSpeed:10,holdDelay:2e3,baseDelay:10,enabled:W&&!tr&&!eD,rotate:!0}),ti="";ti=W?ts:k;let to=O&&!e4&&!!tr,tu=e=>{T?.(!0);let t=e.target.value;ez(t),G({value:t,shouldStash:f,manualSearch:B})},tc=()=>{R&&E()},td=async()=>
1{if(tc(),O&&!U&&(0,ee.z)(),eV(!0),eY(!1),O&&eL&&!eJ.current&&(eJ.current=!0,ez(tt())),Y({visibility:!0,prefetch:z,value:eA}),H&&(!U||O)&&!eG.current&&K((0,x.gs)({visibility:!0,service:I})),await scheduler.yield(),O&&eL&&l?.current){let e=l.current,t=e.value.length;e.setSelectionRange(t,t)}switch(I){case"agentName":case"developer":ez(""),K((0,y.Cy)({key:I,value:""}));return}eb?.length>0&&K((0,v.wc)())},th=()=>{l?.current?.blur(),K((0,x.gs)({visibility:!1,service:I}))},tm=async()=>{await scheduler.yield();let e=await J({e:{keyCode:13,preventDefault:()=>{},target:l?.current},shouldStash:f,value:eI,manualSearch:B,editedPill:R});O&&!1!==e&&l?.current?.blur()},tp=(0,a.useRef)(tm);tp.current=tm,(0,a.useEffect)(()=>{let e=l?.current;if(!O||!e)return;let t=e=>{"insertLineBreak"!==e.inputType||eW.current||(e.preventDefault(),tp.current())};return e.addEventListener("beforeinput",t),()=>e.removeEventListener("beforeinput",t)},[O]),(0,a.useLayoutEffect)(()=>{let e=l?.current;if(!O||!e)return;if(!e4){e.style.height="",eH(1);return}let t=()=>{let{lineHeight:t,paddingTop:l,paddingBottom:r}=getComputedStyle(e),n=parseFloat(t),a=parseFloat(l)+parseFloat(r),s=3*n+a,i=e.placeholder;e.placeholder="",e.style.height="auto";let{scrollHeight:o}=e;e.placeholder=i,e.style.height=`${Math.min(o,s)}px`,eH(Math.min(Math.round((o-a)/n),3)),o>s&&(e.scrollTop=Math.round(e.scrollTop/n)*n)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[tr,e4,O]);let tf=()=>{if(!eL||eM.current||eE.current||l?.current&&document.activeElement===l.current)return;let e=tt();(e||O)&&(ez(e),e&&e!==eT.current&&K((0,y.Cy)({key:"value",value:e})))},ty=async e=>{if(r?.current){r.current=!1;return}if(eV(!1),ef(),eK.current){eK.current=!1;return}let t=e?.relatedTarget?.closest?.('[data-component="search-bar"], [role="tablist"]');(!H||U||!t)&&(eX(!1),O&&K((0,g.l0)({service:I})),O&&_&&tf(),O&&U||await (0,et.dY)(150),Y({visibility:!1,value:eA}),_&&tf())},tg=()=>{T?.(!0),ez(""),eX(!0),G({value:"",shouldStash:f,manualSearch:B})};F&&(F.current=tg);let tx=async e=>{if(e.stopPropagation(),await scheduler.yield(),O)return void tg();if(ej.length>0){let e=(0,d.A)(ej);K((0,y.LF)([{locationId:e},{altLocationIds:["*"]}]))}else eq?(K((0,x.S$)({mod:"doNotRestoreInputValue",value:!0})),(0,et.dY)(300).then(()=>K((0,x.S$)({mod:"doNotRestoreInputValue",value:!1})))):Q({searchInputRef:l,shouldStash:f,manualSearch:B})};return(0,a.useEffect)(()=>{eI!==ey&&ez(ey)},[ey]),(0,a.useEffect)(()=>{eX(!1)},[eS]),(0,a.useEffect)(()=>{e5||(eV(!1),eY(!1),eJ.current=!1)},[e5]),(0,a.useEffect)(()=>{if(!e3||U||R)return;let e=e=>{"Escape"!==e.key&&27!==e.keyCode||document.activeElement!==l?.current&&th()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}
1,[e3,U,R]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:(0,S.XS)(["relative flex",e3?"flex-col items-stretch shrink-0 mt-4 px-5 pt-3 lg:mt-0 lg:px-0 lg:pt-5":"w-full flex-grow h-full items-center"]),children:[O&&(0,n.jsx)(el.A,{}),eQ&&O&&(e7?(0,n.jsx)(eu,{onClick:th}):(0,n.jsx)(eo,{className:te})),O?(0,n.jsx)("textarea",{id:t?`search-${t}`:"search",name:o,rows:1,enterKeyHint:"search",className:(0,S.XS)([p,"resize-none w-full !font-normal","!text-md lg:!text-base",e4?"!py-0 !pl-[48px] lg:!pl-[50px] overflow-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&::placeholder]:truncate !bg-transparent":"overflow-hidden content-center whitespace-nowrap",e4&&(e2?"!pr-[108px] lg:!pr-[100px]":"!pr-[44px] lg:!pr-[60px]")]),placeholder:to?"":ti,value:to?"":tr,readOnly:!!R,onChange:tu,onKeyDown:e=>{let t="Enter"===e.key||13===e.keyCode;if(eW.current=t&&e.shiftKey,!eW.current){if("Escape"===e.key||27===e.keyCode){l?.current?.blur(),K((0,x.gs)({visibility:!1,service:I}));return}if(t){e.preventDefault(),tm();return}J({e,shouldStash:f,value:eI,manualSearch:B,editedPill:R})}},onPointerDown:e=>{if(tc(),!O||U||e4)return;e.preventDefault(),(0,ee.z)(),eG.current=!0,(0,s.flushSync)(()=>{eV(!0),K((0,x.gs)({visibility:!0,listVisibility:!1,service:I}))}),l?.current?.focus({preventScroll:!0});let t=()=>{eG.current&&(eG.current=!1,K((0,x.gs)({visibility:!0,service:I})))};document.addEventListener("pointerup",()=>(0,et.dY)(50).then(t),{once:!0}),(0,et.dY)(600).then(t)},onFocus:td,onBlur:ty,ref:l,autoComplete:"off"},`input-${I}`):(0,n.jsx)("input",{id:t?`search-${t}`:"search",name:o,type:"search",enterKeyHint:"search",className:(0,S.XS)([p]),placeholder:eB&&V?"":ti,value:tr,onChange:e=>!eR&&tu(e),onKeyDown:e=>J({e,shouldStash:f,value:eI,manualSearch:B}),onClick:td,onBlur:ty,ref:l,autoComplete:"off"},`input-${I}`),to&&(0,n.jsx)("div",{"aria-hidden":!0,"data-test":"typeahead-value",className:(0,S.XS)([p,"!font-normal","!text-md lg:!text-base",!X&&eQ&&"px-4 pl-11","absolute inset-0 flex items-center pointer-events-none"]),children:(0,n.jsx)("span",{className:"truncate w-full",children:tr})}),O?e4&&(0,n.jsxs)(n.Fragment,{children:[tr?.length>0&&!eD&&(0,n.jsx)(ec,{icon:ta,onClick:tx,nextToSearchIcon:e2}),e2&&(0,n.jsx)(ed,{onClick:tm}),(0,n.jsx)(eh,{className:e2?"mt-7":"mt-4"})]}):tr?.length>0&&!eD&&(0,n.jsx)(h.gc,{icon:ta,className:tn,"data-test":"typeahead-clear",onClick:e=>tx(e)})]}),e6&&(0,n.jsx)(em,{pills:e9,pendingRemoval:R,onSelect:e=>{(0,s.flushSync)(()=>M(e)),ep(e),e&&!U&&(eK.current=!0,eY(!0),l?.current?.blur()),e||l?.current?.focus({preventScroll:!0})}}),e3&&eR&&(0,n.jsx)(er.A,{className:"!px-5",children:"Maximum 5 locations reached"})]})}}}]);

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.