1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,637384,e=>{e.v({"bottom-section":"style-module-scss-module__s1bB8q__bottom-section","circle-annotation":"style-module-scss-module__s1bB8q__circle-annotation",container:"style-module-scss-module__s1bB8q__container",filters:"style-module-scss-module__s1bB8q__filters","loading-map":"style-module-scss-module__s1bB8q__loading-map",pin:"style-module-scss-module__s1bB8q__pin","review-callout":"style-module-scss-module__s1bB8q__review-callout","side-panel":"style-module-scss-module__s1bB8q__side-panel","size-1":"style-module-scss-module__s1bB8q__size-1","size-2":"style-module-scss-module__s1bB8q__size-2","size-3":"style-module-scss-module__s1bB8q__size-3","top-bar":"style-module-scss-module__s1bB8q__top-bar"})},911974,e=>{e.v({component:"style-module-scss-module__p5Tnnq__component","disclaimer-button-wrapper":"style-module-scss-module__p5Tnnq__disclaimer-button-wrapper","empty-state":"style-module-scss-module__p5Tnnq__empty-state","empty-warning":"style-module-scss-module__p5Tnnq__empty-warning","full-screen":"style-module-scss-module__p5Tnnq__full-screen","hide-panel-wrapper":"style-module-scss-module__p5Tnnq__hide-panel-wrapper","input-wrapper":"style-module-scss-module__p5Tnnq__input-wrapper","is-mobile":"style-module-scss-module__p5Tnnq__is-mobile","list-grid":"style-module-scss-module__p5Tnnq__list-grid","listing-count":"style-module-scss-module__p5Tnnq__listing-count","listing-header":"style-module-scss-module__p5Tnnq__listing-header","mobile-listing-filters":"style-module-scss-module__p5Tnnq__mobile-listing-filters","padded-button":"style-module-scss-module__p5Tnnq__padded-button","save-search":"style-module-scss-module__p5Tnnq__save-search",scrollable:"style-module-scss-module__p5Tnnq__scrollable","show-panel-wrapper":"style-module-scss-module__p5Tnnq__show-panel-wrapper",sort:"style-module-scss-module__p5Tnnq__sort","sort-input-wrapper":"style-module-scss-module__p5Tnnq__sort-input-wrapper","sort-order":"style-module-scss-module__p5Tnnq__sort-order"})},337889,e=>{e.v({component:"style-module-scss-module__wZdLJa__component"})},726880,e=>{e.v({active:"style-module-scss-module__1acVXW__active","compass-arrow":"style-module-scss-module__1acVXW__compass-arrow",component:"style-module-scss-module__1acVXW__component","desktop-only":"style-module-scss-module__1acVXW__desktop-only",filter:"style-module-scss-module__1acVXW__filter","large-side-panel":"style-module-scss-module__1acVXW__large-side-panel","list-view":"style-module-scss-module__1acVXW__list-view","loading-location":"style-module-scss-module__1acVXW__loading-location","mobile-only":"style-module-scss-module__1acVXW__mobile-only","not-visible":"style-module-scss-module__1acVXW__not-visible","save-search-icon":"style-module-scss-module__1acVXW__save-search-icon"})},33286,e=>{e.v({active:"style-module-scss-module__tYc2LG__active",component:"style-module-scss-module__tYc2LG__component",nib:"style-module-scss-module__tYc2LG__nib","price-pin":"style-module-scss-module__tYc2LG__price-pin","size-1":"style-module-scss-module__tYc2LG__size-1","size-2":"style-module-scss-module__tYc2LG__size-2","size-3":"style-module-scss-module__tYc2LG__size-3",visited:"style-module-scss-module__tYc2LG__visited"})},723114,e=>{e.v({map:"style-module-scss-module__8y9sGq__map","map-loading":"style-module-scss-module__8y9sGq__map-loading","map-spinner":"style-module-scss-module__8y9sGq__map-spinner","remove-boundary":"style-module-scss-module__8y9sGq__remove-boundary","slide-up":"style-module-scss-module__8y9sGq__slide-up"})},59903,e=>{"use strict";var t=e.i(391398),s=e.i(191788),i=e.i(637384),l=e.i(203828),a=e.i(408534),o=e.i(757965),n=e.i(899648);e.i(453678);var r=e.i(861772),d=e.i(299040);function u(e,t,s,i=1){return{sort:e,include:"clusters,locations",filter:{...t=function(e,t){(e=JSON.parse(JSON.stringify(e))).boundary=t?JSON.stringify(t):null;let{houseDetached:s,houseSemidetached:i,houseAttached:l,condo:a,townhouse:o}=e.homeType;return s||i||l||delete e.additional.house,a||o||delete e.additional.condoOrTownhouse,e}(t,s),slug:"",areaName:""},page:{number:i,size:24}}}e.i(664157);var c=e.i(271179),m=e.i(232780),h=e.i(251472),_=e.i(16539),p=e.i(931682),f=e.i(99969),g=e.i(645764),y=e.i(132021),S=e.i(268876),x=e.i(488332),v=e.i(652282),b=e.i(396666),C=e.i(683128),w=e.i(618079),I=e.i(911974),E=e.i(515848),L=e.i(937052),T=e.i(980604),P=e.i(642654),A=e.i(219736),N=e.i(39548),j=e.i(28082),M=e.i(165483),B=e.i(901015),O=e.i(750781);e.i(96526);var D=e.i(313990),R=e.i(565585),F=e.i(570625),q=e.i(704152),V=e.i(222159),z=e.i(585594),G=e.i(635891),k=e.i(122500);let W=({listings:e,showsSidePanel:i,setShowsSidePanel:l,fullScreenPanel:a,isLoading:o,updateParams:n,getSortedListings:r,paginationData:W,isMobile:U,onSaveSearchButtonClick:H,handleMapListToggleButtonClick:X})=>{let{t:J}=(0,c.useTranslation)(z.Namespaces.SEARCH),{listingParams:Y}=(0,s.useContext)(m.PreferencesContext),{user:K}=(0,R.useUserContext)(),{themeName:Z}=(0,F.useThemeContext)(),{map:Q}
1=(0,s.useContext)(d.MapContext),{openModal:$}=(0,D.useModalContext)(),{mapBoundary:ee,filterBoundaries:et}=(0,s.useContext)(y.OverlayContext),es=(0,s.useRef)(null),ei=(0,b.default)(),el={height:U&&ei<600&&ei>400?(ei-16)*1.1:400,width:U&&ei<600?ei-16:290},ea=U||ei>=B.SIDE_PANEL_BREAKPOINT,{widthOfGrid:eo,numberOfColumns:en}=(0,s.useMemo)(()=>{let e,t=0,s=U?ei-16:ea?B.SIDE_PANEL_WIDTH_ENLARGED:B.SIDE_PANEL_WIDTH_SMALL;a&&!U?(e=8,t=ei<1300?168:288):e=ea?5:10;let i=290+e,l=a&&!U?ei-t:s-t,o=U?1:Math.floor(l/290);return{widthOfGrid:a?(ei-o*i)/2:(s-o*i)/2,numberOfColumns:o}},[a,U,ea,ei]),er=U&&ei<420?8:eo,ed=Math.round(W.totalCount/en)+1,eu=W.totalCount>e.length,ec=e.length>0,em=e.some(e=>(0,j.isUsStateCode)(e.province?.toLowerCase())),[eh,e_]=(0,s.useState)(!1),ep=em&&!eh;(0,s.useEffect)(()=>{if(es?.current){let e=es?.current?._listRef;e&&e.scrollToItem(0)}},[ee]);let ef=()=>{if(!ep)return new Promise(e=>{let t=et.length?et:ee,s=u(Y?.sort,{...Y.filter,zoom:Q.zoom},t);n({...s,page:{number:W.pageNumber+1,size:s.page.size}}),e()})},eg=t=>!eu||t<e.length;(0,s.useEffect)(()=>{if(es.current){es.current.resetloadMoreItemsCache();let e=es?.current?._listRef;e&&e.scrollToItem(0)}},[Y.sort]);let ey=(0,s.useCallback)((e,t)=>0===t?e:en*t+e,[en]),eS=(0,s.useCallback)(({columnIndex:s,rowIndex:i,style:l})=>{l={...l,padding:".5em"};let a=ey(s,i);if(e[a])if(!o)return(0,t.jsx)("div",{style:l,onClick:()=>(0,V.trackEvent)(G.GTM_CLICK_LISTING_CARD),children:(0,t.jsx)(_.default,{listing:e[a],isOnMapSidePanel:!0,onListingCardClick:()=>{}})});else return(0,t.jsx)("div",{style:l,children:(0,t.jsx)(C.default,{})});if(ep&&a===e.length){let s=(0,O.default)([...new Set(e.map(e=>e.providerId))]),a=e.length%2==0,o=ea?el.height*(i+1):el.height*i,n=l.top;return(0,t.jsxs)("div",{style:{...l,width:"auto",height:"auto",padding:0,left:0,top:a?n:o},children:[eu&&(0,t.jsx)("div",{className:I.default["disclaimer-button-wrapper"],children:(0,t.jsx)(L.default,{label:"View more listings",theme:"primary",onClick:()=>e_(!0)})}),s.map(e=>(0,t.jsx)(M.default,{providerId:e,tenantName:Z},e))]})}return null},[e,o,ea,ep,ey,eu,el.height]),ex=()=>l(!i);return i?(0,t.jsxs)("div",{id:"map-side-panel",className:(0,f.buildClassName)(I.default.component,a&&I.default["full-screen"],U&&i&&a&&I.default["is-mobile"]),"data-testid":E.mapPageIds.listingsSidebar,"dynamic-testid":a?E.dynamicTestIds.fullScreenListings:E.dynamicTestIds.sidebarListings,children:[U?(0,t.jsxs)("section",{className:I.default["mobile-listing-filters"],children:[(0,t.jsxs)("div",{className:I.default["listing-header"],children:[(0,w.formatNumberWithSuffix)(W.totalCount,!1)," Homes in Map Area"]}),(0,t.jsxs)("div",{className:I.default["input-wrapper"],children:[(0,t.jsx)(h.default,{value:Y?.sort,className:"sort-order",options:(0,g.getLocalizedSortOptions)(Y.filter.status,J),onValueChange:e=>{Y.setSort(e),K?.id&&Y&&(0,q.captureLastSearch)({userId:K.id,lastSearch:Y,sourceTheme:Z}),r(e)}}),(0,t.jsx)(L.default,{Icon:A.default,theme:L.TERTIARY_THEME,label:"Filters",onClick:()=>$(D.SAVED_SEARCH_FILTERS_MODAL,{filter:Y.filter,onFiltersChanged:Y.setFilter}),testId:E.searchFilterIds.mobileFilterButton,className:I.default["padded-button"]}),(0,t.jsx)(L.default,{Icon:N.default,theme:L.PRIMARY_THEME,label:"Save Search",onClick:H,testId:E.searchFilterIds.saveSearchButtonMapPage,className:I.default["save-search"]})]})]}):(0,t.jsxs)("section",{className:I.default.sort,style:{transform:a&&!U?`translateX(${er}px)`:"translateX(10px)"},children:[(0,t.jsxs)("div",{className:I.default["listing-count"],"data-testid":E.mapPageIds.listingsCount,children:[(0,w.formatNumberWithSuffix)(W.totalCount,!1)," Listings"]}),(0,t.jsx)("div",{className:I.default["sort-input-wrapper"],children:(0,t.jsx)(h.default,{value:Y?.sort,options:(0,g.getLocalizedSortOptions)(Y.filter.status,J),onValueChange:e=>{Y.setSort(e),K?.id&&Y&&(0,q.captureLastSearch)({userId:K.id,lastSearch:Y,sourceTheme:Z}),r(e)}})}),!a&&ea&&(0,t.jsx)("div",{className:I.default["hide-panel-wrapper"],children:(0,t.jsx)(L.default,{label:"Hide Side List",theme:"secondary",Icon:T.default,onClick:ex})})]}),(0,t.jsxs)("section",{className:I.default.scrollable,children:[(0,t.jsx)(x.default,{"data-testid":E.mapPageIds.listingsScrollableList,style:{transform:a&&!U?`translateX(${er}px`:"translateX(8px)",paddingBottom:"1em"},children:({width:e,height:s})=>
1(0,t.jsx)(v.default,{ref:es,isItemLoaded:eg,itemCount:W.totalCount,threshold:10,loadMoreItems:ef,children:({onItemsRendered:i,ref:l})=>(0,t.jsx)(S.FixedSizeGrid,{className:I.default["list-grid"],rowCount:ed,columnCount:en,columnWidth:el.width,rowHeight:el.height,width:a&&!U?ei-er:e-10,height:s-(ea?71:96),ref:l,onItemsRendered:e=>{i({overscanStartIndex:e.overscanRowStartIndex*en,overscanStopIndex:e.overscanRowStopIndex*en,visibleStartIndex:e.visibleRowStartIndex*en,visibleStopIndex:e.visibleRowStopIndex*en})},children:eS})})}),U&&a&&(0,t.jsx)("div",{className:I.default["mobile-nav"],children:(0,t.jsx)(k.default,{handleMapListToggleButtonClick:X})})]}),!o&&!ec&&(0,t.jsxs)("div",{className:I.default["empty-state"],children:[" ",(0,t.jsx)(p.default,{className:I.default["empty-warning"]})," There are no homes that match your criteria. Try moving the map, searching another location or revising your filter options. "]})]}):(0,t.jsx)("div",{className:I.default["show-panel-wrapper"],children:(0,t.jsx)(L.default,{label:"Show Side List",theme:"secondary",RightIcon:P.default,onClick:ex})})};var U=e.i(168489),H=e.i(681912),X=e.i(919643),J=e.i(430463),Y=e.i(976061),K=e.i(699082),Z=e.i(337889);function Q({popupPosition:{latitude:e,longitude:i},showsSidePanel:l}){let{map:a}=(0,s.useContext)(d.MapContext),{popupPosition:o,setIsHoveringPopup:n,clusterPopupData:r,schoolPopupData:u}=(0,s.useContext)(J.PopupContext),c=(0,b.default)(),m="hover-popover",[h,_]=(0,s.useState)(0),[p,f]=(0,s.useState)(0),g=(0,s.useCallback)(()=>{let t=document.getElementById(m),s=c>B.SIDE_PANEL_BREAKPOINT?B.SIDE_PANEL_WIDTH_ENLARGED:B.SIDE_PANEL_WIDTH_SMALL,{x:o,y:n}=a.getHoverPosition(e,i,t,{xOffset:l?s:0,yOffset:100,framePadding:15,frameOffset:15,targetPadding:50});f(o),_(n)},[e,i,a,l,c]),y=(0,s.useMemo)(()=>r&&(0,t.jsx)(Y.default,{listingIds:r.listingIds}),[r]);return(0,s.useEffect)(()=>{e&&i&&g()},[g,e,i]),o?(0,t.jsxs)("div",{onMouseOver:()=>n(!0),onMouseLeave:()=>n(!1),id:m,style:{height:r?110*(r.listingIds.length<4?r.listingIds.length:3):153,top:h,left:p},className:Z.default.component,children:[y,u&&(0,t.jsx)(K.default,{})]}):null}var $=e.i(669899);function ee(){return(0,t.jsxs)("svg",{width:"33",height:"24",viewBox:"-2.5 -.2 25 13",children:[(0,t.jsx)("path",{d:"M2.8 4.4L2.8 4.8C2.8 5.9 2.8 7.1 2.9 8.2 2.9 8.4 2.9 8.5 3 8.6 3.1 8.9 3.1 9.1 2.9 9.3 3.4 9.7 3.4 10.3 3.5 10.8 3.5 10.8 3.5 10.9 3.5 10.9 3.5 11.1 3.6 11.4 3.5 11.5 3.3 11.7 3 11.9 2.7 11.9 2.3 12 1.9 11.8 1.7 11.5 1.6 11.5 1.6 11.4 1.6 11.3 1.7 10.9 1.7 10.5 1.8 10.1 1.9 9.8 2 9.6 2.2 9.3 2 9 2 8.8 2.3 8.5 2.4 8.5 2.3 8.4 2.3 8.3 2.3 7 2.3 5.8 2.3 4.5 2.3 4.3 2.3 4.3 2.1 4.2 1.5 4 0.9 3.9 0.3 3.7 0.2 3.6 0.1 3.5 0 3.4 0.1 3.3 0.2 3.2 0.3 3.2 3.4 2.2 6.5 1.3 9.7 0.5 9.8 0.4 9.9 0.4 10 0.5 13.1 1.3 16.2 2.2 19.3 3.1 19.4 3.2 19.5 3.2 19.6 3.3 19.7 3.4 19.6 3.6 19.4 3.7 18.6 3.9 17.9 4.1 17.1 4.3 14.8 5 12.5 5.7 10.2 6.3 9.9 6.4 9.7 6.4 9.5 6.3 7.3 5.7 5.2 5.1 3.1 4.5 3 4.5 3 4.5 2.8 4.4"}),(0,t.jsx)("path",{d:"M15.1 5.5C15.1 6.5 15.1 7.6 15.1 8.6 15.1 8.8 15 9 14.7 9.1 13.2 9.8 11.6 10.4 10.1 11.1 9.9 11.2 9.7 11.2 9.6 11.1 8 10.4 6.5 9.8 4.9 9.1 4.8 9 4.6 8.8 4.6 8.7 4.6 7.6 4.6 6.6 4.6 5.5 5.5 5.7 6.4 6 7.4 6.3 8.1 6.5 8.8 6.7 9.5 6.9 9.7 6.9 9.9 6.9 10.1 6.9 11.7 6.4 13.2 6 14.8 5.5 14.9 5.5 15 5.5 15.1 5.5"})]})}var et=e.i(726880);let es=({handler:e,children:s,desktopOnly:i,mobileOnly:l,isActive:a,testId:o})=>(0,t.jsx)("span",{onClick:e,className:(0,f.buildClassName)(i&&et.default["desktop-only"],l&&et.default["mobile-only"],a&&et.default.active),"data-testid":o,children:s}),ei=({isSidePanelFullScreen:e})=>{let{map:i}=(0,s.useContext)(d.MapContext),{clusterPopupData:l,schoolPopupData:a}=(0,s.useContext)(J.PopupContext),{schoolParams:o,listingParams:n}=(0,s.useContext)(m.PreferencesContext),{openModal:r}=(0,s.useContext)(D.ModalContext),u=(0,X.useIsMobile)();return i?(0,t.jsxs)("div",{className:(0,f.buildClassName)(et.default.component,(u&&(l||a)||e)&&et.default["not-visible"]),children:[(0,t.jsx)(es,{desktopOnly:!0,handler:()=>i.zoomIn(),testId:E.searchFilterIds.mapZoomIn,children:"+"}),(0,t.jsx)(es,{desktopOnly:!0,handler:()=>i.zoomOut(),children:"-"}),(0,t.jsx)(es,{mobileOnly:!0,handler:()=>r(D.SAVED_SEARCH_FILTERS_MODAL,{filter:n.filter,onFiltersChanged:n.setFilter}),children:(0,t.jsx)(A.default,{className:et.default.filter})}),(0,t.jsx)(es,{handler:()=>r("school-filters"),isActive:o.showSchools,testId:E.searchFilterIds.showSchoolPins,children:(0,t.jsx)(ee,{})}),(0,t.jsx)(es,{handler:()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{let{coords:t}=e;i.changeLocation({lng:t.longitude,lat:t.latitude},14)},()=>{})},children:(0,t.jsx)($.default,{className:et.default["compass-arrow"]})})]}):null};var el=e.i(756307),ea=e.i(409697),eo=e.i(33286);function en({listings:e,price:i,isPrivate:l,hasBeenViewed:a}
1){let o,[n,r]=(0,s.useState)(a),d=i&&!l;return(0,t.jsxs)("div",{className:(0,f.buildClassName)(eo.default.component,(()=>{if(d)return eo.default["price-pin"];{let t=`size-${e.length<3?e.length:3}`;return eo.default[t]}})(),!!i&&!!n&&eo.default.visited),onMouseEnter:()=>{o=setTimeout(()=>{r(!0)},600)},onMouseLeave:()=>{clearTimeout(o)},children:[d?(0,w.formatNumberWithSuffix)(Number(i)):e.length>1?e.length:void 0,d&&(0,t.jsx)("span",{className:eo.default.nib})]})}var er=e.i(957537),ed=e.i(723114),eu=e.i(408126),ec=e.i(190077),em=e.i(478617),eh=e.i(677332),e_=e.i(546933);let ep=(0,U.default)(()=>e.A(192655),{loadableGenerated:{modules:[236650]},loading:()=>(0,t.jsx)(e_.default,{}),ssr:!1}),ef=({clusters:e,schools:i,showsLoading:l,showsSidePanel:a,isSidePanelFullScreen:o})=>{let n,r="search-map",{map:u,hasDrawnMap:c,setHasDrawnMap:h,setCurrentPins:_}=(0,s.useContext)(d.MapContext),{popupPosition:p,setPopupPosition:f,setClusterPopupData:g,setIsHoveringPin:S,setSchoolPopupData:x,schoolPopupData:v}=(0,s.useContext)(J.PopupContext),{setMapBoundary:b,filterBoundaries:C,setFilterBoundaries:w,overlays:I,setOverlays:L}=(0,s.useContext)(y.OverlayContext),{listingParams:T,schoolParams:P,updateSchoolParams:A}=(0,s.useContext)(m.PreferencesContext),{isAuthenticated:N}=(0,s.useContext)(R.UserContext),[j,M]=(0,s.useState)(),B=(0,X.useIsNotMobile)(),[O,D]=(0,s.use
1State)(!1),[F,q]=(0,s.useState)([]);(0,s.useEffect)(()=>{c&&L(u.drawBoundaryPolygons(I,C))},[c,C]),(0,s.useEffect)(()=>{c&&(v?v.school.boundary&&!j&&M(u.makePolygon(u.boundaryFromGeoJsonPolygon(v.school.boundary))):!v&&j&&(u.removeOverlay(j),M(null)))},[v]),(0,s.useEffect)(()=>{if(u&&window.mapkit){let e=!!window.location.search.length,t=(0,el.getFilterParamsFromURLQuery)(window.location.search),s=e?t:T;e&&(T.setFilter({...s.filter,slug:""}),T.setSort(s.sort),window.history.replaceState({...window.history.state,as:"/search",url:"/search"},"","/search"));let i=s.filter.latitude,l=s.filter.longitude,a=Math.floor(s.filter.zoom);u.drawMap({latitude:i,longitude:l,zoom:a},r),(0===u.longitude||0===u.latitude)&&u.changeLocation({lng:l,lat:i},a),u.onZoom(()=>T.setZoom(u.zoom)),u.onPan(()=>{b(u.boundary),T.setLongitude(u.longitude),T.setLatitude(u.latitude)}),h(!0),b(u.boundary)}},[u]),(0,s.useEffect)(()=>{c&&(U(e,"listing-cluster"),V(e))},[e]),(0,s.useEffect)(()=>{c&&i&&(U(i,"school"),z(i))},[i]),(0,s.useEffect)(()=>{let e=em.default.get(eh.SEARCH_PAGE_MOBILE_SLIDE_UP_LISTING_DATA_COOKIE);e?.length&&(q(e),D(!0))},[]);let V=e=>{_(e.map(e=>{let s=e.attributes.position.coordinates[1],i=e.attributes.position.coordinates[0],l=e.attributes["listing-ids"],a=e.attributes["listing-ids"],o=e?.relationships?.listing?.data?.price,n=u.createPin(s,i),r=e?.relationships?.listing?.data?.["is-vow"],d=e?.relationships?.listing?.data?.status!=="available",c=(0,ec.v4)(),m=(0,eu.hasPinBeenViewed)(c);return n.listingIds=l,n.pinElement.type="listing-cluster",(0,H.createRoot)(n.pinElement).render((0,t.jsx)(en,{listings:a,price:o,isPrivate:!N&&(r||d),hasBeenViewed:m})),u.addPin(n,()=>B?k(s,i,n,c,o):W(s,i,n,"listing"),G),n}))},z=e=>{e.map(e=>{let s=e.position.coordinates[1],i=e.position.coordinates[0],l=u.createPin(s,i);
1l.boundary=JSON.parse(JSON.stringify(e.boundary)),l.pinElement.type="school",l.schoolData=e;let a={school:e,latitude:s,longitude:i};(0,H.createRoot)(l.pinElement).render((0,t.jsx)(ea.default,{})),u.addPin(l,()=>W(s,i,a,"school"),()=>S(!1))})},G=()=>{S(!1),clearTimeout(n)},k=function(e,t,s,i,l){n=setTimeout(()=>{W(e,t,s,"listing"),i&&l&&(0,eu.addPinToVisited)(i)},600)},W=(e,t,s,i)=>{S(!0),f({latitude:e,longitude:t}),D(!0),em.default.set(eh.SEARCH_PAGE_MOBILE_SLIDE_UP_LISTING_DATA_COOKIE,s.listingIds),"listing"===i&&(x(null),g(s)),"school"===i&&(g(null),x(s))},U=(e,t)=>{if(c&&u.annotations&&u.annotations?.length>0){let s=u.annotations.filter(s=>{if(s.element?.type===t)return!e.find(e=>e.id===s.data.id)});u.removePins(s)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{id:r,className:ed.default.map,"data-testid":E.searchFilterIds.searchMap,children:[(0,t.jsx)(ei,{isSidePanelFullScreen:o}),B&&(0,t.jsx)(Q,{popupPosition:p,showsSidePanel:a}),l&&(0,t.jsxs)("div",{className:ed.default["map-loading"],children:["Loading ",(0,t.jsx)(er.default,{className:ed.default["map-spinner"]})," "]}),C.length>0&&(0,t.jsx)("div",{className:ed.default["remove-boundary"],onClick:()=>{w([]),P.filterListings&&A({...P,filterListings:!P.filterListings})},children:" Remove Boundaries "})]}),!B&&(0,t.jsx)(ep,{storedListingIds:F,clearStoredListings:()=>{em.default.delete(eh.SEARCH_PAGE_MOBILE_SLIDE_UP_LISTING_DATA_COOKIE),q([])}})]})};var eg=e.i(109516);e.i(362891);var ey=e.i(623320),eS=e.i(62262),ex=e.i(943266),ev=e.i(532181),eb=e.i(902449),eC=e.i(64055),ew=e.i(276567);e.i(571027);var eI=e.i(414124);let eE=({initialData:e})=>{let{listingParams:c,schoolParams:h,addToRecentSearches:_}=(0,m.usePreferencesContext)(),{map:p,hasDrawnMap:f}=(0,d.useMapContext)(),{mapBoundary:g,filterBoundaries:S,setFilterBoundaries:x}=(0,y.useOverlayContext)(),{openModal:v}=(0,D.useModalContext)(),{user:b,isAuthenticated:C,userLocation:w}=(0,R.useUserContext)(),{tenantId:I,themeName:E}=(0,F.useThemeContext)(),L=(0,X.useIsMobile)(),[T,P]=(0,s.useState)([]),[A,N]=(0,s.useState)(e.listings),[j,M]=(0,s.useState)(e.clusters),[B,O]=(0,s.useState)([]),[z,G]=(0,s.useState)(!1),[k,U]=(0,s.useState)(!1),[H,J]=(0,s.useState)(!0),[Y,K]=(0,s.useState)(!0),[Z,Q]=(0,s.use
1State)(!1),[$,ee]=(0,s.useState)(e.meta),[et,es]=(0,s.useState)(c.filter),ei=(0,l.useRouter)(),ea="/search"===ei.route,eo=async(e,t)=>{if(!H){J(!0);let{listings:s,meta:i}=await (0,ev.getClustersAndListings)(e);ee(i),t?N(s):N(e=>[...e,...s]),J(!1)}},{params:en,isLoading:er,updateParams:ed}=function(e,t){let[i,r]=(0,s.useState)(!1),[d,u]=(0,s.useState)(e),c=(0,l.useRouter)();(0,s.useEffect)(()=>{m(d.page.number)},[d.page.number]);let m=e=>{if("/search"!==c.pathname)if("/[...dynamic]"===c.pathname){if((e>1||1==e&&c.query.page&&parseInt(c.query.page[0])>1)&&parseInt(c.query.page?.toString()||"")!=e){let t=window.location.pathname,s=window.location.search,i=(0,n.updateSearchParams)(s,{page:e.toString()});c.push(t+i,t+i)}}else{let t={page:e,size:d.page.size},s=e>1?t:{};c.push({query:s},void 0,{shallow:!0})}},h=async e=>{r(!0),(0,a.default)("body"),await t(e),r(!1)};return{isLoading:i,params:d,updateParams:e=>{e.page||(e={...e,page:{number:1}});let t=(0,o.default)(d,e);u(t),h(t)}}}({filter:{...c.filter},sort:c.sort,...{page:{number:1,size:24}}},eo),eu=async e=>{if(f&&0!==p.longitude){let t=null;(e||S)&&((e=e||S).length>1?t={type:"MultiPolygon",coordinates:e.map(e=>e.coordinates)}:1===e.length&&(t=e[0]));let s=(0,ey.createListingParams)(),i=u(s.sort,{...s.filter,zoom:p.zoom-1},t||g);U(!0),J(!0);let{clusters:l,listings:a,meta:n}=await (0,ev.getClustersAndListings)(i);ee(n),N(a),M(l),U(!1),J(!1);let r=(0,o.default)(s.filter,{boundary:i.filter.boundary,slug:i.filter.slug,latitude:p.latitude,longitude:p.longitude,zoom:p.zoom});s.setFilter(r),es(r)}},ec=()=>(0,eb.getSchools)({page:{number:1,size:50},filter:{...h.filterParams,boundary:JSON.stringify(p.boundary)}}),em=(0,eg.default)(()=>{h.showSchools&&h.filterListings?ec().then(e=>{let t=e.map(e=>e.boundary).filter(e=>e);O(e),x(t),eu(t)}):h.showSchools&&!h.filterListings?ec().then(e=>{O(e),eu()}):eu()},800);(0,s.useEffect)(()=>{S&&eu(S)},[S]),(0,s.useEffect)(()=>{p&&em()},[g,...Object.values(c.filter),...Object.values(c.filter.homeType),...Object.values(c.filter.additional.condoOrTownhouse)]),(0,s.useEffect)(()=>{es(e=>({...e,boundary:g?JSON.stringify(g):null}))},[g]),(0,s.useEffect)(()=>{P((0,ew.getActiveFilters)(c.filter))},[c.filter]),(0,s.useEffect)(()=>{p&&(h.showSchools?h.showSchools&&ec().then(O):(x([]),O([])))},[h.showSchools,h.eqaoRating,h.levelFilter,h.languageFilter,h.typeFilter,h.showUnrated]),(0,s.useEffect)(()=>{(0,V.trackEvent)("UiSearchpView")},[]),(0,s.useEffect)(()=>{f&&p&&p.onZoom(()=>G(!0)),f&&p&&p.onPan(()=>G(!0))},[f]);let eh=(0,eg.default)(()=>{let e=!(0,eC.IsUserInQuebec)(w)&&"qc"===et.areaName.slice(-2).toLowerCase();(0,eC.handleQuebecPopup)({tenantId:I,isQuebec:e,openModal:v,source:"map"})},300);(0,s.useEffect)(()=>{eh()},[w,et,v,E,eh]);let e_=async e=>{let t=S.length>0?S:g;eo(u(e,{...c.filter,zoom:p.zoom},t),!0)},ep=()=>{if((0,V.trackEvent)("UiSrchQfSaveButClk"),C){let e=et.boundary??(p?.boundary?JSON.stringify(p.boundary):null),t=(0,eI.asMapBoundedSearch)({...et,boundary:e});v("create-saved-search",{query:{sort:c.sort,filter:t}})}else v("login-registration")},ex=()=>{z||!c.filter.slug?Q(e=>!e):ei.push(`/${c.filter.slug}-real-estate/filter?${(0,el.formatQueryIntoURLQueryParams)(et)}`)};return(0,t.jsxs)("div",{className:i.default.container,children:[L&&(0,t.jsx)("div",{children:ea&&L&&!Z&&(0,t.jsx)(r.default,{slug:null,viewType:Z?r.MAP_VIEW:r.LIST_VIEW,onClick:L?ex:()=>null,isMobile:L})}),(0,t.jsx)("section",{className:i.default["top-bar"],children:(0,t.jsx)(ew.ListingFilterBar,{activeFilterItems:T,setActiveFilterItems:P,onLocationSearchClick:e=>{(0,eS.handleSearchResult)({searchPrediction:e,listingParams:c,user:b,map:p,addToRecentSearches:_,themeName:E})},filters:c.filter,onValueChange:e=>{let t=(0,o.default)(c.filter,e);c.setFilter(t),es(t),b?.id&&c&&(0,q.captureLastSearch)({userId:b.id,lastSearch:c,sourceTheme:E})},onSaveSearchButtonClick:ep,onMoreButtonClick:()=>{(0,V.trackEvent)("UiSrchQfMoreButClk"),v(D.SAVED_SEARCH_FILTERS_MODAL,{filter:c.filter,onFiltersChanged:c.setFilter})},mapListToggleViewType:Z?r.MAP_VIEW:r.LIST_VIEW,onMapListToggleButtonClick:ex})}),(0,t.jsxs)("section",{className:i.default["bottom-section"],children:[(0,t.jsx)(W,{showsSidePanel:Y,setShowsSidePanel:K,fullScreenPanel:Z,listings:A,isLoading:H||k||er,params:en,paginationData:$,updateParams:ed,getSortedListings:e_,isMobile:L,onSaveSearchButtonClick:ep,handleMapListToggleButtonClick:ex}
1),p?(0,t.jsx)(ef,{schools:B,clusters:j,showsLoading:k&&!Z,showsSidePanel:Y,isSidePanelFullScreen:Z}):(0,t.jsx)("section",{className:i.default["loading-map"]})]})]})};var eL=e.i(360696),eT=e.i(720069),eP=e.i(267544),eA=e.i(793304);class eN{cache;defaultExpirationMs;constructor(e=6e4){this.cache=new Map,this.defaultExpirationMs=e}set(e,t,s){let i=Date.now()+(s||this.defaultExpirationMs);this.cache.set(e,{data:t,expiresAt:i})}get(e){let t=this.cache.get(e);if(t&&Date.now()<t.expiresAt)return t.data;t&&this.cache.delete(e)}isExpired(e){let t=this.cache.get(e);return!t||Date.now()>=t.expiresAt}}class ej{caches;defaultExpirationMs;constructor(e=6e4){this.caches=new Map,this.defaultExpirationMs=e}getOrCreateCache(e){return this.caches.has(e)||this.caches.set(e,new eN(this.defaultExpirationMs)),this.caches.get(e)}set(e,t,s,i){if(e<0||e>17)throw Error("Zoom level must be between 0 and 17.");this.getOrCreateCache(e).set(t,s,i)}get(e,t){if(!this.caches.has(e))return;let s=this.caches.get(e);return void 0!=s?s.get(t):void 0}isExpired(e,t){if(!this.caches.has(e))return!0;let s=this.caches.get(e);return void 0!=s&&s.isExpired(t)}}var eM=e.i(609881),eB=e.i(936836),eO=e.i(483361);class eD{cache=new ej;#e;constructor(e=!1){this.#e=eB.SearchApi.create((0,eM.getGoSearchHost)((0,eM.isServerSide)()),e)}async getClustersWithinBoundary(e,t,s=eA.SortBy.DateDesc,i,l,a=eO.MAP_PAGE_CONSTANTS.DEFAULT_CLUSTER_DATA_SIZE){let{clusters:o}=await this.#e.searchClustersInBoundary(e,t,i,s,l,a);return o}async getListingsWithinBoundary(e,t,s,i=eA.SortBy.DateDesc,l,a,o=eO.MAP_PAGE_CONSTANTS.DEFAULT_CLUSTER_DATA_SIZE){return await this.#e.searchListingsInBoundary(e,t,s,l,i,a,o)}async getPinsWithinBoundary(e,t,s=eA.SortBy.DateDesc,i,l,a=200,o=!1){return await this.#e.searchPinsInBoundary(e,t,i,s,l,a,o)}async getListingsWithinBoundaryV2(e,t,s=eA.SortBy.DateDesc,i,l,a=eO.MAP_PAGE_CONSTANTS.DEFAULT_CLUSTER_DATA_SIZE){return await this.#e.searchListingsInBoundaryV2(e,t,i,s,l,a)}}e.i(301943);var eR=e.i(953498);e.i(741952);var eF=e.i(404920);e.i(818181);var eq=e.i(387517);let eV=(0,U.default)(()=>e.A(151401),{loadableGenerated:{modules:[510577]},ssr:!1}),ez=(0,U.default)(()=>e.A(439455).then(e=>e.SearchPageV2),{loadableGenerated:{modules:[936180]},ssr:!1});function eG({props:e,tenantId:i,useSearchPageV2Chrome:l}){let{features:a}=(0,eP.useFeaturesContext)(),o=(0,s.useMemo)(()=>new eD(a.useLegacySearchFilter),[a.useLegacySearchFilter]);if(l)return(0,t.jsx)(ez,{tenantId:i});{if(a.useNewMapPins)return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(eV,{model:o,tenantId:i})});let{clusters:s,listingsData:l,meta:n}=e,r=l.map(e=>ex.default.fromClientAppListing(e));return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(d.default,{children:(0,t.jsx)(eE,{initialData:{clusters:s,listings:r,meta:n}})})})}}e.s(["__N_SSP",0,!0,"default",0,function({routeName:e,props:s}){let i=(0,eR.getTenantById)(s.tenantId).theme,l=function(e){let t=(0,eR.getTenantById)(e),{features:s}=(0,eP.useFeaturesContext)(),{showVariation:i}=(0,eF.useExperimentVariation)(eq.AllowedExperimentKey.AREA_PAGE_V2_REDESIGN);return!!(s.showHybridAreaMapPage&&t.features.ShowHybridAreaMapPage&&(t.features.UseAreaPageV2||s.useAreaPageV2||i))}(s.tenantId),a={title:s.headTags?.title||i.title,metaDescription:s.headTags?.metaDescription||i.metaDescription,...s.headTags};return(0,t.jsxs)(eL.default,{routeName:e,showFooter:!l&&void 0,showMobileBottomNav:!l&&void 0,renderHeader:l?()=>null:void 0,children:[(0,t.jsx)(eT.default,{data:a}),(0,t.jsx)(J.default,{children:(0,t.jsx)(y.default,{children:(0,t.jsx)(eG,{routeName:e,props:s,tenantId:s.tenantId,useSearchPageV2Chrome:l})})})]})}],59903)},849567,(e,t,s)=>{let i="/search";(window.__NEXT_P=window.__NEXT_P||[]).push([i,()=>e.r(59903)]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push([i])})}]); 2 3//# sourceMappingURL=0kee1e13fukpy.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.