PageSourceSearch

https://www.realestate.co.nz/_next/static/chunks/2yj42vko3_y1w.js?dpl=1704071e6ebd02f8f390a87f0dea8dea77a05394

js realestate.co.nz collected 2026-10-03 21:26:46 UTC 36,204 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,808778,(e,t,i)=>{"use strict";let s;Object.defineProperty(i,"__esModule",{value:!0}),i.parse=function(e,t){let i=new u,s=e.length;if(s<2)return i;let r=t?.decode||c,o=0;do{let t=e.indexOf("=",o);if(-1===t)break;let a=e.indexOf(";",o),n=-1===a?s:a;if(t>n){o=e.lastIndexOf(";",t-1)+1;continue}let l=h(e,o,t),u=d(e,t,l),c=e.slice(l,u);if(void 0===i[c]){let s=h(e,t+1,n),o=d(e,n,s),a=r(e.slice(s,o));i[c]=a}o=n+1}while(o<s)return i},i.serialize=function(e,t,i){let s=i?.encode||encodeURIComponent;if(!r.test(e))throw TypeError(`argument name is invalid: ${e}`);let u=s(t);if(!o.test(u))throw TypeError(`argument val is invalid: ${t}`);let h=e+"="+u;if(!i)return h;if(void 0!==i.maxAge){if(!Number.isInteger(i.maxAge))throw TypeError(`option maxAge is invalid: ${i.maxAge}`);h+="; Max-Age="+i.maxAge}if(i.domain){if(!a.test(i.domain))throw TypeError(`option domain is invalid: ${i.domain}`);h+="; Domain="+i.domain}if(i.path){if(!n.test(i.path))throw TypeError(`option path is invalid: ${i.path}`);h+="; Path="+i.path}if(i.expires){var d;if(d=i.expires,"[object Date]"!==l.call(d)||!Number.isFinite(i.expires.valueOf()))throw TypeError(`option expires is invali
1d: ${i.expires}`);h+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(h+="; HttpOnly"),i.secure&&(h+="; Secure"),i.partitioned&&(h+="; Partitioned"),i.priority)switch("string"==typeof i.priority?i.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${i.priority}`)}if(i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${i.sameSite}`)}return h};let r=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,o=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,l=Object.prototype.toString,u=((s=function(){}).prototype=Object.create(null),s);function h(e,t,i){do{let i=e.charCodeAt(t);if(32!==i&&9!==i)return t}while(++t<i)return i}function d(e,t,i){for(;t>i;){let i=e.charCodeAt(--t);if(32!==i&&9!==i)return t+1}return i}function c(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},338189,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getRenderPhase=i.isClientSide=i.decode=i.stringify=void 0,i.stringify=function(e){try{if("string"==typeof e)return e;return JSON.stringify(e)}catch(t){return e}},i.decode=function(e){return e?e.replace(/(%[0-9A-Z]{2}
1)+/g,decodeURIComponent):e},i.isClientSide=function(e){return!(null==e?void 0:e.req)&&!(null==e?void 0:e.res)&&!(e&&"cookies"in e&&(null==e?void 0:e.cookies))},i.getRenderPhase=function(){return"u"<typeof window?"server":"client"}},267456,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0})},316548,(e,t,i)=>{"use strict";var s=e.e&&e.e.__assign||function(){return(s=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),o=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||r(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),i.useCookiesNext=i.useDeleteCookie=i.useGetCookie=i.useSetCookie=i.useHasCookie=i.useGetCookies=i.hasCookie=i.deleteCookie=i.setCookie=i.getCookie=i.getCookies=void 0;var a=e.r(808778),n=e.r(338189),l=e.r(673384),u=function(e){if(!(0,n.isClientSide)(e))throw Error("You are trying to access cookies on the server side. Please, use the server-side import with `cookies-next/server` instead.")},h=function(e){if(u(e),"server"!==(0,n.getRenderPhase)()){for(var t={},i=document.cookie?document.cookie.split("; "):[],s=0,r=i.length;s<r;s++){var o=i[s].split("="),a=o.slice(1).join("=");t[o[0]]=a}return t}};i.getCookies=h;var d=function(e,t){u(t);var i=h(t),s=null==i?void 0:i[e];if(void 0!==s)return(0,n.decode)(s)};i.getCookie=d;var c=function(e,t,i){if(u(i),"server"!==(0,n.getRenderPhase)()){var r=(0,a.serialize)(e,(0,n.stringify)(t),s({path:"/"},i||{}));document.cookie=r}};i.setCookie=c;var g=function(e,t){u(t),c(e,"",s(s({},t),{maxAge:-1}))};i.deleteCookie=g;var m=function(e,t){if(u(t),!e)return!1;var i=h(t);return!!i&&Object.prototype.hasOwnProperty.call(i,e)};i.hasCookie=m;var p=function(e){var t=(0,l.useState)(!1),i=t[0],s=t[1];return(0,l.useEffect)(function(){s(!0)},[]),i?e:function(){}},y=function(){return p(h)};i.useGetCookies=y;var b=function(){return p(d)};i.useGetCookie=b;var f=function(){return p(m)};i.useHasCookie=f;var S=function(){return p(c)};i.useSetCookie=S;var A=function(){return p(g)};i.useDeleteCookie=A,i.useCookiesNext=function(){return{getCookies:y(),getCookie:b(),hasCookie:f(),setCookie:S(),deleteCookie:A()}},o(e.r(267456),i)},443523,e=>{"use strict";var t=e.i(982033),i=e.i(243623),s=e.i(184578),r=e.i(673384),o=e.i(307876),a=e.i(505557),n=e.i(740497),l=e.i(768434),u=e.i(989721),h=e.i(937531),d=e.i(689022);e.s(["default",0,function({ref:e,className:c,useNativeLinkTag:g,query:m,useDefaultGtmEvent:p,transition:y,eventCategory:b,eventLabel:f,subcategory:S,category:A,regions:T,districts:C=[],suburbs:E=[],propertyTypes:$,minBedrooms:O,maxBedrooms:x,minPrice:B,maxPrice:v,includeNearbySuburbs:L,sortBy:w,children:P,searchContext:I,resetPage:R,onClick:k,...N}){let F=(0,s.usePathname)(),{peekSchool:H}=(0,l.default)(),{getLastSavedSubcategories:U}=(0,n.default)(),D=(0,r.useMemo)(()=>U(),[]),_=(0,r.useMemo)(()=>S||(A?D[A]??"sale":"sale"),[S,D,A]),G=(0,r.useMemo)(()=>I||new h.default({category:A??"",subcategory:_,regions:T,districts:C,suburbs:E,propertyTypes:$,minBedrooms:O??0,maxBedrooms:x??0,minPrice:B??0,maxPrice:v??0,includeNearbySuburbs:L??!1,sortBy:w}),[I,A,C,L,_,x,v,O,B,$,T,w,E]),j=d.urlParams(G,H),M=(0,r.useMemo)(()=>j.route,[j]),V=(0,r.useMemo)(()=>j.models,[j]),z=(0,r.useMemo)(()=>m||j.options.queryParams,[m,j]),Q=(0,r.useMemo)(()=>R?{page:void 0}:{},[R]),Y=(0,r.useMemo)(()=>({...u.resetQueryParams,...z,...Q}),[z,Q]),q=(0,r.useMemo)(()=>d.transitionToUrl(G,H),[G,H]),W=(0,r.useMemo)(()=>{let e=A||"unknown";return{event:"dlEvent",eventAction:`/${e}/${_}`,eventCategory:b,eventLabel:f,eventPage:F}},[A,_,b,f,F]),J=(0,r.useCallback)(()=>{p&&(0,i.sendGTMEvent)(W)},[p,W]);return!1===y?(0,t.jsx)(a.default,{ref:e,className:c,link:`/${A||"unknown"}/${_}`,category:W.eventCategory,page:W.eventPage,onClick:k,...N,children:P}):g?(0,t.jsx)("a",{ref:e,className:c,href:q,onClick:()=>{J(),k?.()},...N,children:P}):(0,t.jsx)(o.default,{ref:e,className:c,route:M,models:V,query:Y,onClick:()=>{J(),k?.()},...N,children:P})}])},740497,768434,e=>{"use strict";var t=e.i(316548),i=e.i(673384);let s="lastSubcategories";e.s(["default",0,function(){let e=(0,i.useCallback)(()=>{let e=(0,t.getCookie)(s);return e?JSON.parse(e):{}},[]),r=(0,i.useCallback)(({category:i,subcategory:r})=>{let o={...e(),[i]:r};(0,t.setCookie)(s,JSON.stringify(o),{maxAge:2592e3,secure:!0,sameSite:"strict",httpOnly:!0})},[e]);return{getLastSavedSubcategories:e,update:r,clear:(0,i.useCallback)(()=>{(0,t.setCookie)(s,null,{maxAge:2592e3,secure:!0,sameSite:"strict",httpOnly:!0})},[])}}],740497);var r=e.i(428888),o=e.i(467186);let a=async({schools:e})=>{let t;if(!e?.length)return[];let i=(t=(0,o.generateQueryParams)({params:{filter:{ids:e},page:{responseType:"minimal"}}}),`${r.default.PLATFORM_HOST}/${r.default.SEARCH_API_NAMESPACE}/schools${t}`),s=await fetch(i,{cache:"force-cache"});if(!s.ok)throw Error("Failed to fetch school");let a=(await s.json()).data.map(e=>(({data:e})=>{let{id:t,attributes:i}=e,s=(0,o.camelCase)(i);return{...s,id:t,title:s.organizationName,modelName:"school"}})({data:e}));return await Promise.all(a)};var n=e.i(523838);
1e.s(["default",0,function(){let e=(0,n.useStore)(e=>e.addSchools);return{loadSchools:async t=>{let i=t?.length?await a({schools:t}):[];return e(i),i},peekSchool:(0,n.useStore)(e=>e.peekSchool)}}],768434)},150512,644103,e=>{"use strict";let t=(e,t)=>{let i=new Set,s=[];for(let r of e){let e=r[t];i.has(e)||(i.add(e),s.push(r))}return s};e.s(["default",0,t],644103),e.s(["default",0,class{searchContext;selectedLocation;constructor(e){this.searchContext=e,this.selectedLocation=null,this.selectLowestCommonAncestor()}selectLowestCommonAncestor(){let{suburbs:e,districts:i,regions:s}=this.searchContext;if(e){if(1===e.length){let t=e[0];if(this.treeHasOnlyAncestors(t)){this.selectedLocation=t;return}}else if(e.length>1){let i=t(e,"district");if(1===i.length){let{district:e}=i[0];this.treeHasOnlyAncestors(e)&&(this.selectedLocation=e)}return}if(i){if(1===i.length){let e=i[0];if(this.treeHasOnlyAncestors(e)){this.selectedLocation=e;return}}else if(i.length>1){let e=t(i,"region");if(1===e.length){let{region:t}=e[0];this.treeHasOnlyAncestors(t)&&(this.selectedLocation=t)}return}if(s&&1===s.length){let e=s[0];e.title&&e.slug&&(this.selectedLocation=e)}}}}treeHasOnlyAncestors(e){if(!e)return!1;let t=e?.modelName;return"suburb"===t?this.searchContext.districts.every(t=>t.id===e.district.id)&&this.searchContext.regions.every(t=>t.id===e.region.id):"district"===t?this.searchContext.regions.every(t=>t.id===e.region.id):"region"===t&&this.searchContext.regions.every(t=>t.id===e.id)}get slug(){if(!this.selectedLocation)return"";let{modelName:e}=this.selectedLocation;if("suburb"===e){let e=this.selectedLocation;return`${e.district.region.slug}/${e.district.slug}/${e.slug}`}if("district"===e){let e=this.selectedLocation;
1return`${e.region?.slug}/${e.slug}`}return"region"===e?this.selectedLocation.slug:""}}],150512)},989721,e=>{"use strict";var t=e.i(937531);let i=[{locationQueryIds:{as:"lct",type:"string"}},{propertyTypes:{as:"scat",type:"string"}},{pricingMethod:{as:"pm",type:"string"}},{includeNearbySuburbs:{as:"ins",type:"boolean"}},{nearbySuburbs:{as:"ns",type:"string"}},{geoBoundingBox:{as:"gbb",type:"string"}},{geoBoundaries:{as:"gb",type:"string"}},{minCarparks:{as:"mincp",type:"number"}},{minPrice:{as:"minp",type:"number"}},{maxPrice:{as:"maxp",type:"number"}},{minBedrooms:{as:"minbe",type:"number"}},{maxBedrooms:{as:"maxbe",type:"number"}},{minBathrooms:{as:"minba",type:"number"}},{maxBathrooms:{as:"maxba",type:"number"}},{minLandArea:{as:"minla",type:"number"}},{maxLandArea:{as:"maxla",type:"number"}},{minFloorArea:{as:"minfa",type:"number"}},{maxFloorArea:{as:"maxfa",type:"number"}},{schools:{as:"school",type:"string"}},{openHomeOnly:{as:"ooh",type:"boolean"}},{withAddressOnly:{as:"oad",type:"boolean"}},{minRent:{as:"minpr",type:"number"}},{maxRent:{as:"maxpr",type:"number"}},{petFriendly:{as:"pdf",type:"boolean"}},{furnished:{as:"off",type:"boolean"}},{unfurnished:{as:"uf",type:"boolean"}},{partFurnished:{as:"pf",type:"boolean"}},{mortgageeSale:{as:"ms",type:"boolean"}},{newConstruction:{as:"nc",type:"boolean"}},{coastalWaterfront:{as:"cw",type:"boolean"}},{hasSwimmingPool:{as:"sp",type:"boolean"}},{hasFloorPlans:{as:"fps",type:"boolean"}},{hasVideos:{as:"vid",type:"boolean"}},{has3dWalkthroughs:{as:"3dw",type:"boolean"}},{mapType:{as:"mt",type:"string"}},{keywords:{as:"k",type:"string"}},{addresses:{as:"ad",type:"string"}},{includeSold:{as:"incs",type:"boolean"}},{includeValuation:{as:"incv",type:"boolean"}},{page:{as:"page",type:"number",defaultValue:t.DEFAULT_PAGE}},{perPage:{as:"ql",type:"number",defaultValue:t.DEFAULT_PER_PAGE}},{sortBy:{as:"by",type:"string",defaultValue:t.DEFAULT_SORT_BY}},{filterBy:{as:"fby",type:"string",defaultValue:t.DEFAULT_FILTER_BY}},{view:{as:"view",type:"string",defaultValue:t.VIEWS.LIST}}],s=i.reduce((e,t)=>{let i=Object.values(t)[0],{defaultValue:s}=i,r=i.as;return s?e:{...e,[r]:void 0}},{});e.s(["default",0,i,"reducedQueryParamValues",0,(e,t)=>t.reduce((t,s)=>{let r=i.find(e=>Object.keys(e)[0]===s);if(!r)return t;let o=r[s];return{...t,[o.as]:e[o.as]}},{}),"resetQueryParams",0,s])},937531,645892,895986,172051,e=>{"use strict";var t=e.i(286264);let i={residential:{sale:1e7,rent:5e3},rural:{sale:1e7},commercial:{sale:1e7,lease:5e6},business:{sale:2e7}};var s=e.i(495897);let r={floorAreaMin:[{id:0,title:"Any"},{id:40,title:"40 m²"},{id:75,title:"75 m²"},{id:100,title:"100 m²"},{id:125,title:"125 m²"},{id:150,title:"150 m²"},{id:175,title:"175 m²"},{id:200,title:"200 m²"},{id:250,title:"250 m²"},{id:300,title:"300 m²"},{id:400,title:"400 m²"},{id:500,title:"500 m²"},{id:750,title:"750 m²"},{id:1e3,title:"1,000 m²"},{id:2e3,title:"2,000 m²"},{id:5e3,title:"5,000 m²"},{id:7500,title:"7,500 m²"},{id:1e4,title:"10,000 m²"}],floorAreaMax:[{id:0,title:"Any"},{id:40,title:"40 m²"},{id:75,title:"75 m²"},{id:100,title:"100 m²"},{id:125,title:"125 m²"},{id:150,title:"150 m²"},{id:175,title:"175 m²"},{id:200,title:"200 m²"},{id:250,title:"250 m²"},{id:300,title:"300 m²"},{id:400,title:"400 m²"},{id:500,title:"500 m²"},{id:750,title:"750 m²"},{id:1e3,title:"1,000 m²"},{id:2e3,title:"2,000 m²"},{id:5e3,title:"5,000 m²"},{id:7500,title:"7,500 m²"},{id:1e4,title:"10,000 m²"},{id:0x3b9ac9ff,title:"10,000 m²+"}],landAreaMin:[{id:0,title:"Any"},{id:100,title:"100 m²"},{id:200,title:"200 m²"},{id:300,title:"300 m²"},{id:500,title:"500 m²"},{id:750,title:"750 m²"},{id:1e3,title:"1000 m²"},{id:2e3,title:"2000 m²"},{id:5e3,title:"5000 m²"},{id:1e4,title:"1 HA"},{id:2e4,title:"2 HA"},{id:5e4,title:"5 HA"},{id:1e5,title:"10 HA"},{id:15e4,title:"15 HA"},{id:2e5,title:"20 HA"},{id:25e4,title:"25 HA"},{id:5e5,title:"50 HA"},{id:75e4,title:"75 HA"},{id:1e6,title:"100 HA"},{id:25e5,title:"250 HA"},{id:5e6,title:"500 HA"},{id:75e5,title:"750 HA"},{id:1e7,title:"1,000 HA"},{id:25e6,title:"2,500 HA"},{id:5e7,title:"5,000 HA"},{id:75e6,title:"7,500 HA"},{id:1e8,title:"10,000 HA"}],landAreaMax:[{id:0,title:"Any"},{id:100,title:"100 m²"},{id:200,title:"200 m²"},{id:300,title:"300 m²"},{id:500,title:"500 m²"},{id:750,title:"750 m²"},{id:1e3,title:"1000 m²"},{id:2e3,title:"2000 m²"},{id:5e3,title:"5000 m²"},{id:1e4,title:"1 HA"},{id:2e4,title:"2 HA"},{id:5e4,title:"5 HA"},{id:1e5,title:"10 HA"},{id:15e4,title:"15 HA"},{id:2e5,title:"20 HA"},{id:25e4,title:"25 HA"},{id:5e5,title:"50 HA"},{id:75e4,title:"75 HA"},{id:1e6,title:"100 HA"},{id:25e5,title:"250 HA"},{id:5e6,title:"500 HA"},{id:75e5,title:"750 HA"},{id:1e7,title:"1,000 HA"},{id:25e6,title:"2,500 HA"},{id:5e7,title:"5,000 HA"},{id:75e6,title:"7,500 HA"},{id:1e8,title:"10,000 HA"},{id:0x3b9ac9ff,title:"10k HA+"}]};function o(e,t){let i=e.includes("Area")?e:`${e}Area`;return r[`${i}${t.replace(/^\w/,e=>e.toUpperCase())}`]}function a(e,t,i){let s=o(t,i);return s?s.find(t=>
1t.id===e):null}e.s(["getAreaById",0,a,"getAreas",0,o],645892);let n=(e,t)=>t?.legacy?s.LEGACY_SUBCATEGORY_DISPLAY_NAMES[e]:s.SUBCATEGORY_DISPLAY_NAMES[e];e.s(["default",0,n],895986);var l=e.i(128761),u=e.i(135056);let h=Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3});function d(e,t){return("rental"===t&&(t="rent"),e&&t)?i[e][t]:0}let c=([e],t,i)=>{let s=!!e&&!!t&&!!i&&e>d(t,i),r=s?d(t,i):e,o=h.format(r).toLowerCase();return`$${o}${s?"+":""}`};e.s(["priceFormat",0,c],172051);let g=["lowest-sold-price","highest-sold-price"],m=["lowest-estimate-price","highest-estimate-price"],p=["featured","best-match","latest","oldest","lowest-price","highest-price"],y=["latest-sale","oldest-sale"],b=["all"],f=["all","recently-sold","sold-price-available"],S=p[0],A=b[0],T={MAP:"map",LIST:"list"};class C{constructor(e){Object.keys(e).forEach(t=>{let i=e[t];i&&("subcategory"===t&&"string"==typeof i&&(i=this.normaliseSubCategory(i)),this[t]=i)})}category="";subcategory="";regions=[];districts=[];suburbs=[];schools=[];addresses=[];listings=[];propertyTypes="";pricingMethod="";includeNearbySuburbs=!1;nearbySuburbs=[];geoBoundingBox=null;geoBoundaries=[];minCarparks=void 0;minPrice=void 0;maxPrice=void 0;minBedrooms=void 0;maxBedrooms=void 0;minBathrooms=void 0;maxBathrooms=void 0;minLandArea=void 0;maxLandArea=void 0;minFloorArea=void 0;maxFloorArea=void 0;openHomeOnly=!1;withAddressOnly=!1;mortgageeSale=!1;newConstruction=!1;coastalWaterfront=!1;hasSwimmingPool=!1;hasFloorPlans=!1;hasVideos=!1;has3dWalkthroughs=!1;minRent=void 0;maxRent=void 0;petFriendly=!1;furnished=!1;unfurnished=!1;partFurnished=!1;keywords="";mapType="";view=T.LIST;schoolsTitle="";schoolOrganizationNames=[];page=1;perPage=20;sortBy=S;filterBy=A;allLocationNames="All locations";includeSold=!1;includeValuation=!1;didFilterUpdate=!1;resetValue=e=>Array.isArray(e)?[]:"number"==typeof e?0:"string"==typeof e?"":"boolean"!=typeof e&&null;clearFilter=e=>{this[e]&&(this[e]=this.resetValue(this[e]),this.refreshIncludeNearbySuburb(),this.didFilterUpdate=!0)};clearFilters=e=>{e&&e.forEach(e=>{this.clearFilter(e)})};extractKeys=()=>Object.keys(this).filter(e=>"function"!=typeof this[e]&&e);clearAllFilters=e=>{let t=e??{includeLocation:!1,includeSchools:!1},i=this.extractKeys().filter(e=>{if(["category","subcategory","view"].includes(e))return!1;let i=["regions","districts","suburbs","listings","addresses","includeNearbySuburbs"];return(t.includeSchools&&i.push("schools"),i.includes(e))?t.includeLocation:this[e]||Array.isArray(this[e])&&0===this[e].length});this.clearFilters(i)};clearLocationFilters(e){this.clearFilters(["regions","districts","suburbs","listings","schools","keywords","addresses","includeNearbySuburbs"].filter(t=>t!==e))}clearMapFilters(){this.clearFilters(["geoBoundingBox","geoBoundaries","mapType"])}deleteAllFilters(){this.clearFilters(["minFloorArea","maxFloorArea","minLandArea","maxLandArea","minPrice","maxPrice","minRent","maxRent","propertyTypes","pricingMethod","openHomeOnly","mortgageeSale","withAddressOnly","furnished","petFriendly","unfurnished","partFurnished","newConstruction","geoBoundingBox","geoBoundaries","mapType"])}updatePage({page:e,perPage:t,sortBy:i,filterBy:s}){e&&(this.page=e),t&&(this.perPage=t),i&&(this.sortBy=i),s&&(this.filterBy=s)}resetPage(){this.updatePage({page:1,perPage:20})}updateFilters(e){Object.entries(e).forEach(e=>{let[t,i]=e;this.updateFilter(t,i)})}resetDidFilterUpdate(){this.didFilterUpdate=!1}updateFilter(e,t){let i=this[e];i!==t&&(i||t)&&(this[e]=t,this.refreshIncludeNearbySuburb(),this.didFilterUpdate=!0)}normaliseSubCategory(e){let t=s.CATEGORY_SUBCATEGORY_REDIRECTS[this.category];return t?t[this.subcategory]??e:e}refreshIncludeNearbySuburb(){this.canIncludeNearbySuburbs||(this.includeNearbySuburbs=!1)}toggleView(){this.view=this.view===T.LIST?T.MAP:T.LIST}validateSort(){if(this.sortByOptions.includes(this.sortBy))return;let[e]=this.sortByOptions;this.sortBy=e}validateSoldValuationFlag(){let{includeSold:e,subcategory:t}=this;t!==s.SUBCATEGORIES.SOLD||e?t===s.SUBCATEGORIES.VALUATION?(this.includeSold=!1,this.includeValuation=!0):t!==s.SUBCATEGORIES.SOLD&&t!==s.SUBCATEGORIES.VALUATION&&(this.includeSold=!1,this.includeValuation=!1):this.includeSold=!0}get hasLocationFilter(){let{regions:e,districts:t,suburbs:i,listings:s,schools:r,addresses:o,keywords:a}=this;return!!(e.length||t.length||i.length||s?.length||r.length||o.length||a)}get sortByOptions(){return this.isPropertiesSearch?[...y,...this.includeSold?g:[],...this.includeValuation?m:[]]:p}get isPricingChangeEnabled(){return"res_sale"===this.categoryCode||"rural_sale"===this.categoryCode}get filterByOptions(){return this.isPropertiesSearch?f:[...b,this.isPricingChangeEnabled?"pricing-changes":null].filter(
1Boolean)}get regionOnlyTitles(){return[...new Set(this.regions.map(e=>e.title))].join(", ")}get regionTitles(){let e=this.regions.map(e=>e.title);return this.districts.forEach(t=>{t.region?.title&&e.push(t.region.title)}),this.suburbs.forEach(t=>{t.district?.region?.title&&e.push(t.district.region.title)}),[...new Set(e)].join(", ")}get districtOnlyTitles(){return[...new Set(this.districts.map(e=>e.title))].join(", ")}get districtTitles(){let e=this.districts.map(e=>e.title);return this.suburbs.forEach(t=>{t.district?.title&&e.push(t.district.title)}),[...new Set(e)].join(", ")}get suburbTitles(){return this.suburbs.map(e=>e.title).join(", ")}get regionIds(){let e=this.regions.map(e=>e.id);return this.districts.forEach(t=>{t.region&&e.push(t.region.id)}),this.suburbs.forEach(t=>{if(t.district?.region)return e.push(t.district.region.id)}),e.length>0?[...new Set(e)].join(", "):""}get districtIds(){let e=this.districts.map(e=>e.id);return this.suburbs.forEach(t=>{if(t?.district?.id)return e.push(t.district.id)}),e.length>0?[...new Set(e)].join(", "):""}get suburbIds(){return this.suburbs.map(e=>e.id).join(", ")}get schoolIds(){return this.schools.length>0?this.schools.join(", "):""}get propertyTypeObjects(){return this.propertyTypes?this.propertyTypes.toString().split(",").sort((e,t)=>e.localeCompare(t)).map(e=>(0,l.getSubTypeById)(this.categoryCode,e)).filter(e=>!!e):[]}get propertyTypeTitles(){let{propertyTypeObjects:e}=this;return e?e.map(e=>e.title).filter(e=>!!e).join(", "):null}get propertyIds(){let{propertyTypeObjects:e}=this;return e?e.map(e=>e.id).filter(e=>!!e).join(", "):null}get firstDisplayPropertyTypeTitle(){let{propertyTypeObjects:e}=this;return e?e.map(e=>e.displayTitle||e.title):null}get locationTitles(){let e=[this.regionTitles,this.districtTitles,this.suburbTitles].filter(e=>!!e&&", "!==e);return e?.length>0||(e=["All locations"]),e}get displayPrice(){let e=Number.parseInt(this.minPrice??"",10),t=Number.parseInt(this.maxPrice??"",10),s=1e7;this.category&&this.subcategory&&(s=i[this.category][this.subcategory]);let r=null;return t>0&&!e&&(r=`${t<=s?"Up to ":""}${c([t],this.category,this.subcategory)}`),e>0&&!t&&(r=`${c([e],this.category,this.subcategory)}+`),e>0&&t&&(r=`${c([e],this.category,this.subcategory)} - ${c([t],this.category,this.subcategory)}`),e===t&&(r=`${c([e],this.category,this.subcategory)}`),r}getDisplayRange(e=!1){let t=e?"Bedrooms":"Bathrooms",i=this[`min${t}`],s=this[`max${t}`],r="";return i&&s?(r=`${i} `,i!==s&&(r+=` - ${s} `)):i&&!s?r=`${i}+ `:!i&&s&&(r=`Any - ${s} `),r}getDisplayAreaRange(e=!0){let t=e?"FloorArea":"LandArea",i=this[`min${t}`],s=this[`max${t}`],r="FloorArea"===t?"floor":"land",o="",n=a(i??0,r,"min"),l=n?n.title:"",u=a(s??0,r,"max"),h=u?u.title:"";return i&&s?(o=l,i!==s&&(o=`${l} - ${h}`)):i&&!s?o=`${l}+`:!i&&s&&(o=`Any - ${h}`),o}get categoryCode(){let e="";switch(this.category){case s.CATEGORIES.RESIDENTIAL:e="res_";break;case s.CATEGORIES.BUSINESS:e="biz_";break;case s.CATEGORIES.COMMERCIAL:e="com_";break;case s.CATEGORIES.RURAL:e="rural_";break;default:e=""}switch(this.subcategory){case s.SUBCATEGORIES.RENTAL:e+="rent";break;case s.SUBCATEGORIES.SALE:case s.SUBCATEGORIES.LEASE:case s.SUBCATEGORIES.SOLD:default:e+=this.subcategory}return e}get isBusiness(){return this.category===s.CATEGORIES.BUSINESS}get isRural(){return this.category===s.CATEGORIES.RURAL}get isResidential(){return this.category===s.CATEGORIES.RESIDENTIAL}get searchActionData(){return{event:"searchAction",eventAction:this.categoryCode,eventCategory:"Search",eventLabel:"classic",pageName:`/${this.category}/${this.subcategory}`,categorySearch:this.categoryCode,regionSearch:this.regionTitles||"",districtSearch:this.districtTitles||"",suburbSearch:this.suburbTitles||"",nearbySuburbsSearch:!!this.includeNearbySuburbs||void 0,propertyTypesSearch:this.propertyTypeTitles||void 0,minPrice:this.minPrice??0,maxPrice:this.maxPrice??0x2540be3ff,priceRangeSearch:`${this.minPrice??0} - ${this.maxPrice??0}`,minBedroom:this.minBedrooms??0,maxBedroom:this.maxBedrooms??999,bedroomSearch:`${this.minBedrooms??""} - ${this.maxBedrooms??""}`,minBathroom:this.minBathrooms??0,maxBathroom:this.maxBathrooms??999,bathroomSearch:`${this.minBathrooms??""} - ${this.maxBathrooms??""}`,openHomeSearch:this.openHomeOnly||void 0,keywordSearch:this.keywords?[this.keywords]:[],streetAddressSearch:this.addresses?this.addresses.map(e=>`"${e}"`).join(", "):"",floorAreaSearch:`${this.minFloorArea??""} - ${this.maxFloorArea??""}`,minFloorAreaSearch:this.minFloorArea??0,maxFloorAreaSearch:this.maxFloorArea??0x2540be3ff,landAreaSearch:`${this.minLandArea??""} - ${this.maxLandArea??""}`,minLandAreaSearch:this.minLandArea??0,maxLandAreaSearch:this.maxLandArea??0x2540be3ff,petOnlySearch:!!this.petFriendly,furnishedOnlySearch:!!this.furnished,propertiesWithAddressSearch:!!this.withAddressOnly,sortBySearch:this.sortBy,filterBySearch:this.filterBy,schoolSearch:this.schools.length>=1?this.schoolOrganizationNames.join(", "):void 0,quantityListingsPerPageSearch:20,isNewBuild:this.newConstruction?"Yes":"No"}}get adTargeting(){return{minBedrooms:`${this.minBedrooms??""}`,maxBedrooms:`${this.maxBedrooms??""}`,minBathrooms:`${this.minBathrooms??""}`,maxBathrooms:`${this.maxBathrooms??""}`,minPrice:`${this.minPrice??""}`,maxPrice:`${this.maxPrice??""}`,minLandArea:`${this.minLandArea??""}`,maxLandArea:`${this.maxLandArea??""}`,minFloorArea:`${this.minFloorArea??""}`,maxFloorArea:`${this.maxFloorArea??""}`,keywords:this.keywords??"",regions:this.regionTitles??"",suburbs:this.suburbTitles??"",districts:this.districtTitles??"",propertyTypes:this.propertyTypeTitles??"",schools:this.schools.length>=1?this.schoolOrganizationNames.join(", "):"",features:["newConstruction","hasSwimmingPool","coastalWaterfront","furnished","unfurnished","petFriendly"].filter(e=>this[e]).join(", "),brand:this.categoryCode?this.categoryCode:void 0,openHome:this.openHomeOnly?"true":"false",view:this.view}}get displaySubcategory(){return n(this.subcategory,{legacy:!0})}get displayLocations(){let e=[];return this.suburbs.length>0&&e.push(this.suburbs.map(e=>{let t=Object.values(u.districts).find(t=>
1t.id===e.districtId);return{id:`s${e.id}`,districtTitle:e.district?.title??"",suburbTitle:e.title,regionTitle:e.region?.title??"",title:`${e.title}, ${t?.title??""}`,type:e.locationType}})),this.districts.length>0&&e.push(this.districts.map(e=>{let t=Object.values(u.regions).find(t=>t.id===e.regionId);return{id:`d${e.id}`,districtTitle:e.title,suburbTitle:null,regionTitle:e.region?.title??"",title:`${e.title}, ${t?.title??""}`,type:e.locationType}})),this.regions.length>0&&e.push(this.regions.map(e=>({id:`r${e.id}`,districtTitle:null,suburbTitle:null,regionTitle:e.title,title:`${e.title}, New Zealand`,type:e.locationType}))),0===e.length&&(e=[{id:null,title:"New Zealand",districtTitle:null,suburbTitle:null,regionTitle:null,type:null}]),Array.prototype.concat.apply([],e)}get primarySuburbTitle(){return this.displayLocations[0].suburbTitle}get primaryDistrictTitle(){return this.displayLocations[0].districtTitle}get primaryRegionTitle(){return this.displayLocations[0].regionTitle}get bedroomCountDisplayText(){let e="";return this.minBedrooms&&this.maxBedrooms?e=`${this.minBedrooms} ${this.minBedrooms!==this.maxBedrooms?`- ${this.maxBedrooms} `:""}`:this.minBedrooms&&!this.maxBedrooms?e=`${this.minBedrooms}+ `:!this.minBedrooms&&this.maxBedrooms&&(e=`Up to ${this.maxBedrooms} `),`${""!==e?`${e}Bedroom `:""}`}getDisplayPropertyTypeTitle(e=!1){let t=this.propertyTypes?this.propertyTypes.toString().split(","):[];if(!t.length||1!==t.length){let t=this.metaBrowseType,i=this.newConstruction?"New Builds Homes":"Homes",r=e?i:`${i} and Real Estate`;return this.category!==s.CATEGORIES.RESIDENTIAL?t:r}return`${this.firstDisplayPropertyTypeTitle}`}get headDataTitle(){if(this.subcategory===s.SUBCATEGORIES.SOLD)return this.bedroomCountDisplayText?`${this.bedroomCountDisplayText} ${this.title}`:this.title;let e="New Zealand";this.suburbs.length>0?e=this.primarySuburbTitle:this.districts.length>0?e=this.primaryDistrictTitle:this.regions.length>0?e=this.primaryRegionTitle:this.schools.length>0&&([e]=this.schoolOrganizationNames);let t=this.displayLocations.length>1||this.schools.length>1;return`${e}${t?" and Other Locations":""} ${this.bedroomCountDisplayText}${this.getDisplayPropertyTypeTitle()} for ${this.displaySubcategory}`}get title(){let e=this.displayLocations[0].title,t=this.hasMapSearches?"Map area":this.schoolsTitle||e,i=this.schools.length>1||this.displayLocations.length>1;return this.subcategory===s.SUBCATEGORIES.VALUATION?`Valuation for Homes and Real Estate in ${e}${i?" and Other Locations":""}`:this.subcategory===s.SUBCATEGORIES.SOLD?`Recently Sold Homes and Real Estate in ${e}${i?" and Other Locations":""}`:`${t}${i?" and Other Locations":""} ${this.bedroomCountDisplayText}${this.getDisplayPropertyTypeTitle()} for ${this.displaySubcategory}`}get heading(){let e=this.displayLocations?.[0].title,t=this.hasMapSearches?"the current map view":this.schoolsTitle||e,i=this.schools.length>1||this.displayLocations.length>1;return`${t}${i?" and Other Locations":""}`}get subheading(){return this.subcategory===s.SUBCATEGORIES.VALUATION?"Valuation for Homes and Real Estate":this.subcategory===s.SUBCATEGORIES.SOLD?"Recently Sold Homes and Real Estate":`${this.bedroomCountDisplayText} ${this.getDisplayPropertyTypeTitle()} for ${this.displaySubcategory}`}get metaBrowseType(){switch(this.category){case s.CATEGORIES.BUSINESS:return"Businesses";case s.CATEGORIES.COMMERCIAL:return"Commercial Properties";case s.CATEGORIES.RURAL:return"Rural Farms and Real Estate";case s.CATEGORIES.RESIDENTIAL:default:return"Property"}}get metaDescriptionSuffix(){let e=this.subcategory===s.SUBCATEGORIES.SALE;switch(this.category){case s.CATEGORIES.BUSINESS:case s.CATEGORIES.COMMERCIAL:case s.CATEGORIES.RURAL:return e?" from licensed real estate agents":"";case s.CATEGORIES.RESIDENTIAL:default:return e?", open homes from licensed real estate agents":". Book viewings with real estate agents"}}get metaDescription(){let e=this.metaBrowseType.toLowerCase(),t=this.displaySubcategory.toLowerCase(),i=this.getDisplayPropertyTypeTitle(!0).toLowerCase(),r=this.bedroomCountDisplayText.toLowerCase(),o=` in ${this.displayLocations[0].title}`;null===this.displayLocations[0].type&&this.schools.length>0&&(o=` near ${this.schoolsTitle}`),(this.displayLocations.length>1||this.schools.length>1)&&(o+=" and other locations");let a=`Browse ${e} details, photos, videos${this.metaDescriptionSuffix}.`;return this.subcategory===s.SUBCATEGORIES.SOLD?`${this.title}. ${a}`:`${r}${i} available for ${t}${o}. ${a}`}get savedSearchName(){let e=this.primarySuburbTitle||this.primaryDistrictTitle||this.primaryRegionTitle||this.allLocationNames,i=this.displayLocations.length-1,s=e;return this.hasMapSearches?s="Map area search":i&&(s=`${e} +${(0,t.default)("location",i,!0)}`),s}buildSavedSearchName(e){let i=(this.displayLocations&&1===this.displayLocations.length&&"New Zealand"===this.displayLocations[0].title?this.schools.length-1:this.schools.length)+(this.displayLocations.length-1),s=i>0?` +${(0,t.default)("location",i,!0)}`:"";return`${e}${s}`}
1setSchoolsTitle(e){this.schoolsTitle=e}setSchoolOrganizationNames(e){this.schoolOrganizationNames=e}get priceAndBedSavedSearch(){var e;let t=this.displayPrice,i=this.getDisplayRange(!0);return"string"==typeof(e=i)&&e&&0!==e.trim().length&&(i=`${i}Beds`),[t,i].filter(e=>!!e).join("; ")}makeGtmLocation(e){let t=this[`${e}Titles`],i="string"==typeof t&&t?t?.split(", "):null,s=this[`${e}Ids`];return i&&"string"==typeof s&&s?s.split(", ").map((e,t)=>`${e}; ${i[t]}`):[]}get gtmHeadData(){return{regions:this.makeGtmLocation("region"),districts:this.makeGtmLocation("district"),suburbs:this.makeGtmLocation("suburb"),pageCategory:`/${this.category}/${this.subcategory}`,brand:this.categoryCode,searchType:this.view,saleType:this.subcategory,virtualPageTitle:this.title}}updateSessionStorage(){if(window?.sessionStorage){let{category:e,subcategory:t}=this;window.sessionStorage.setItem("re_category",JSON.stringify(e)),window.sessionStorage.setItem("re_subcategory",JSON.stringify(t))}}toJSON(){return{...this}}get canIncludeNearbySuburbs(){return 1===this.suburbs.length}get hasMapSearches(){return!!this.geoBoundingBox||!!(this.geoBoundaries.length>0)}get hasRemoveBoundaryButton(){return!!this.suburbs?.length||!!this.schools?.length}get isPropertiesSearch(){let e=[s.SUBCATEGORIES.SOLD,s.SUBCATEGORIES.VALUATION];return this.subcategory&&e.includes(this.subcategory)}get selectedFiltersCount(){return this.extractKeys().filter(e=>!["category","subcategory","view","regions","districts","suburbs","listings","schools","schoolsTitle","schoolOrganizationNames","addresses","geoBoundaries","geoBoundingBox","page","perPage","sortBy","includeSold","includeValuation","allLocationNames","filterBy","didFilterUpdate"].includes(e)&&(Array.isArray(this[e])?this[e].length>0:this[e])).length}}e.s(["DEFAULT_FILTER_BY",0,A,"DEFAULT_PAGE",0,1,"DEFAULT_PER_PAGE",0,20,"DEFAULT_SORT_BY",0,S,"VIEWS",0,T,"default",0,C],937531)},689022,235391,e=>{"use strict";var t=e.i(307876),i=e.i(132494),s=e.i(150512),r=e.i(989721);class o{searchContext;peekSchool;slug;slugType;queryParams;params;geoBoundaries;constructor(e,t){this.slugType="",this.geoBoundaries="",this.peekSchool=t,this.searchContext=e,this.slug=this.buildSlug(e),this.queryParams=this.getQueryParams(),this.params=this.getParams()}getParams(){let e=this.getRoute(),{slug:t}=this;return{route:e,slug:t,options:{queryParams:this.queryParams},models:[t]}}getRoute(){let e;switch(this.searchContext.category){case"residential":e="search-results-residential";break;case"commercial":e="search-results-commercial";break;case"rural":e="search-results-rural";break;case"business":e="search-results-business"}return e}getQueryParams(){return r.default.reduce((e,t)=>{let[i]=Object.keys(t),{as:s,defaultValue:r}=t[i],o=this.searchContext[i];if("locationQueryIds"===i)e[s]=this.locationQueryIds;else if("propertyTypes"===i)e[s]=this.propertyTypeQueryIds;else if("schools"===i)e[s]=this.schoolQueryParamIds;else if("addresses"===i)this.addresses&&(e[s]=this.addresses);else if("geoBoundaries"===i){let{geoBoundaries:t}=this;t&&(e[s]=t)}else o&&o!==r&&(e[s]=o);return e},{})}buildSlug(e){let t=`${e.subcategory}`,i=new s.default(e).slug,r=this._getSchoolSlug(),o=this._getPropertyTypeSlug(this.searchContext);return i?(this.slugType="location",t+=`/${i}`,o&&(this.slugType="location-propertyType",t+=`/${o}`),t):r?(this.slugType="school",t=`${t}/${r}`,o&&(this.slugType="school-propertyType",t+=`/${o}`),t):o?(this.slugType="propertyType",`${t}/${o}`):t}_getSchoolSlug(){let{schools:e}=this.searchContext;if(e?.length===1){let t=e[0],i=this.peekSchool(t);return i?.slug??void 0}return null}_getPropertyTypeSlug(e){let{propertyTypeObjects:t}=e;return t&&1===t.length?t[0].slug:null}get locationQueryIds(){let e=[],t=this.searchContext.regions?.map(e=>`r${e.id}`);t?.length&&(e=[...e,...t]);let i=this.searchContext.districts?.map(e=>`d${e.id}`);i?.length&&(e=[...e,...i]);let s=this.searchContext.suburbs?.map(e=>`s${e.id}`);return(s?.length&&(e=[...e,...s]),e.length<=1)?null:e.join(",")}get addresses(){return this.searchContext.addresses?.length?[...this.searchContext.addresses].join("|"):null}get propertyTypeQueryIds(){let e=this.searchContext.propertyTypes||"";return e.toString().split(",").length<=1?null:e}get schoolQueryParamIds(){let{schools:e}=this.searchContext;return e?.length&&("school"!==this.slugType&&"school-propertyType"!==this.slugType||1!==e.length)?e.join(","):null}}var a=e.i(467186);let n=(e,t)=>{if(!t||"object"!=typeof t)return e;let i=Object.entries(t).reduce((e,[t,i])=>(null==i||Array.isArray(i)&&0===i.length||(e[t]=i),e),{}),s=(0,a.generateQueryParams)({params:i});return s?`${e}${s}`:e};e.s(["buildUrl",0,n],235391);let l=(e,i)=>{let{params:s}=new o(e,i);return n((0,t.generateUrl)({route:s.route,models:s.models,query:{}}),s.options.queryParams)};
1e.s(["runMigratedSearchTransition",0,(e,t,s)=>{let r=l(e,t);return(0,i.isServedByThisApp)(r)?!!s&&(s(),!0):(window.location.href=r,!0)},"transitionToUrl",0,l,"urlParams",0,(e,t)=>{let{params:i}=new o(e,t);return i}],689022)}]);
2
3//# sourceMappingURL=0hcycaq3e1vmi.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.