var markerClusterer=function(t){"use strict";function e(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s}class s{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}}class r{constructor(t){let{markers:e,position:s}=t;this.markers=e,s&&(s instanceof google.maps.LatLng?this._position=s:this._position=new google.maps.LatLng(s))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(s.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter((t=>s.getVisible(t))).length}push(t){this.markers.push(t)}delete(){this.marker&&(s.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const o=(t,e,r,o)=>{const n=i(t.getBounds(),e,o);return r.filter((t=>n.contains(s.getPosition(t))))},i=(t,e,s)=>{const{northEast:r,southWest:o}=h(t,e),i=l({northEast:r,southWest:o},s);return c(i,e)},n=(t,e,s)=>{const r=i(t,e,s),o=r.getNorthEast(),n=r.getSouthWest();return[n.lng(),n.lat(),o.lng(),o.lat()]},a=(t,e)=>{const s=(e.lat-t.lat)*Math.PI/180,r=(e.lng-t.lng)*Math.PI/180,o=Math.sin(s/2),i=Math.sin(r/2),n=o*o+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*i*i;return 6371*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))},h=(t,e)=>({northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}),l=(t,e)=>{let{northEast:s,southWest:r}=t;return s.x+=e,s.y-=e,r.x-=e,r.y+=e,{northEast:s,southWest:r}},c=(t,e)=>{let{northEast:s,southWest:r}=t;const o=e.fromDivPixelToLatLng(r),i=e.fromDivPixelToLatLng(s);return new google.maps.LatLngBounds(o,i)};class u{constructor(t){let{maxZoom:e=16}=t;this.maxZoom=e}noop(t){let{markers:e}=t;return m(e)}}class p extends u{constructor(t){var{viewportPadding:s=60}=t;super(e(t,["viewportPadding"])),this.viewportPadding=60,this.viewportPadding=s}calculate(t){let{markers:e,map:s,mapCanvasProjection:r}=t;return s.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:o(s,r,e,this.viewportPadding),map:s,mapCanvasProjection:r})}}}const m=t=>t.map((t=>new r({position:s.getPosition(t),markers:[t]})));function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var g=function t(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var r,o,i;if(Array.isArray(e)){if((r=e.length)!=s.length)return!1;for(o=r;0!=o--;)if(!t(e[o],s[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if((r=(i=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,i[o]))return!1;for(o=r;0!=o--;){var n=i[o];if(!t(e[n],s[n]))return!1}return!0}return e!=e&&s!=s},f=d(g);const k=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class w{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const o=k[15&s];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(t,2,1),[n]=new Uint32Array(t,4,1);return new w(n,i,o,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=k.indexOf(this.ArrayType),i=2*t*this.ArrayType.BYTES_PER_ELEMENT,n=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-n%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+i+n+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return y(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:n}=this,a=[0,o.length-1,0],h=[];for(;a.length;){const l=a.pop()||0,c=a.pop()||0,u=a.pop()||0;if(c-u<=n){for(let n=u;n<=c;n++){const a=i[2*n],l=i[2*n+1];a>=t&&a<=s&&l>=e&&l<=r&&h.push(o[n])}continue}const p=u+c>>1,m=i[2*p],d=i[2*p+1];m>=t&&m<=s&&d>=e&&d<=r&&h.push(o[p]),(0===l?t<=m:e<=d)&&(a.push(u),a.push(p-1),a.push(1-l)),(0===l?s>=m:r>=d)&&(a.push(p+1),a.push(c),a.push(1-l))}return h}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:i}=this,n=[0,r.length-1,0],a=[],h=s*s;for(;n.length;){const l=n.pop()||0,c=n.pop()||0,u=n.pop()||0;if(c-u<=i){for(let s=u;s<=c;s++)C(o[2*s],o[2*s+1],t,e)<=h&&a.push(r[s]);continue}const p=u+c>>1,m=o[2*p],d=o[2*p+1];C(m,d,t,e)<=h&&a.push(r[p]),(0===l?t-s<=m:e-s<=d)&&(n.push(u),n.push(p-1),n.push(1-l)),(0===l?t+s>=m:e+s>=d)&&(n.push(p+1),n.push(c),n.push(1-l))}return a}}function y(t,e,s,r,o,i){if(o-r<=s)return;const n=r+o>>1;M(t,e,n,r,o,i),y(t,e,s,r,n-1,1-i),y(t,e,s,n+1,o,1-i)}function M(t,e,s,r,o,i){for(;o>r;){if(o-r>600){const n=o-r+1,a=s-r+1,h=Math.log(n),l=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*l*(n-l)/n)*(a-n/2<0?-1:1);M(t,e,s,Math.max(r,Math.floor(s-a*l/n+c)),Math.min(o,Math.floor(s+(n-a)*l/n+c)),i)}const n=e[2*s+i];let a=r,h=o;for(v(t,e,r,s),e[2*o+i]>n&&v(t,e,r,o);a<h;){for(v(t,e,a,h),a++,h--;e[2*a+i]<n;)a++;for(;e[2*h+i]>n;)h--}e[2*r+i]===n?v(t,e,r,h):(h++,v(t,e,h,o)),h<=s&&(r=h+1),s<=h&&(o=h-1)}}function v(t,e,s,r){x(t,s,r),x(e,2*s,2*r),x(e,2*s+1,2*r+1)}function x(t,e,s){const r=t[e];t[e]=t[s],t[s]=r}function C(t,e,s,r){const o=t-s,i=e-r;return o*o+i*i}const P={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},_=Math.fround||(E=new Float32Array(1),t=>(E[0]=+t,E[0]));var E;const A=3,b=5,L=6;class O{constructor(t){this.options=Object.assign(Object.create(P),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;const i=[];for(let e=0;e<t.length;e++){const s=t[e];if(!s.geometry)continue;const[r,o]=s.geometry.coordinates,n=_(T(r)),a=_(j(o));i.push(n,a,1/0,e,-1,1),this.options.reduce&&i.push(0)}let n=this.trees[r+1]=this._createTree(i);e&&console.timeEnd(o);for(let t=r;t>=s;t--){const s=+Date.now();n=this.trees[t]=this._createTree(this._cluster(n,t)),e&&console.log("z%d: %d clusters in %dms",t,n.numItems,+Date.now()-s)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let o=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,o=180;else if(s>o){const t=this.getClusters([s,r,180,i],e),n=this.getClusters([-180,r,o,i],e);return t.concat(n)}const n=this.trees[this._limitZoom(e)],a=n.range(T(s),j(i),T(o),j(r)),h=n.data,l=[];for(const t of a){const e=this.stride*t;l.push(h[e+b]>1?Z(h,e,this.clusterProps):this.points[h[e+A]])}return l}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(r);const i=o.data;if(e*this.stride>=i.length)throw new Error(r);const n=this.options.radius/(this.options.extent*Math.pow(2,s-1)),a=i[e*this.stride],h=i[e*this.stride+1],l=o.within(a,h,n),c=[];for(const e of l){const s=e*this.stride;i[s+4]===t&&c.push(i[s+b]>1?Z(i,s,this.clusterProps):this.points[i[s+A]])}if(0===c.length)throw new Error(r);return c}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:i,radius:n}=this.options,a=n/i,h=(s-a)/o,l=(s+1+a)/o,c={features:[]};return this._addTileFeatures(r.range((e-a)/o,h,(e+1+a)/o,l),r.data,e,s,o,c),0===e&&this._addTileFeatures(r.range(1-a/o,h,1,l),r.data,o,s,o,c),e===o-1&&this._addTileFeatures(r.range(0,h,a/o,l),r.data,-1,s,o,c),c.features.length?c:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,1!==s.length)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,o){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?o+i.point_count<=r?o+=i.point_count:o=this._appendLeaves(t,i.cluster_id,s,r,o):o<r?o++:t.push(e),t.length===s)break}return o}_createTree(t){const e=new w(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,o,i){for(const n of t){const t=n*this.stride,a=e[t+b]>1;let h,l,c;if(a)h=I(e,t,this.clusterProps),l=e[t],c=e[t+1];else{const s=this.points[e[t+A]];h=s.properties;const[r,o]=s.geometry.coordinates;l=T(r),c=j(o)}const u={type:1,geometry:[[Math.round(this.options.extent*(l*o-s)),Math.round(this.options.extent*(c*o-r))]],tags:h};let p;p=a||this.options.generateId?e[t+A]:this.points[e[t+A]].id,void 0!==p&&(u.id=p),i.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:o,minPoints:i}=this.options,n=s/(r*Math.pow(2,e)),a=t.data,h=[],l=this.stride;for(let s=0;s<a.length;s+=l){if(a[s+2]<=e)continue;a[s+2]=e;const r=a[s],c=a[s+1],u=t.within(a[s],a[s+1],n),p=a[s+b];let m=p;for(const t of u){const s=t*l;a[s+2]>e&&(m+=a[s+b])}if(m>p&&m>=i){let t,i=r*p,n=c*p,d=-1;const g=((s/l|0)<<5)+(e+1)+this.points.length;for(const r of u){const h=r*l;if(a[h+2]<=e)continue;a[h+2]=e;const c=a[h+b];i+=a[h]*c,n+=a[h+1]*c,a[h+4]=g,o&&(t||(t=this._map(a,s,!0),d=this.clusterProps.length,this.clusterProps.push(t)),o(t,this._map(a,h)))}a[s+4]=g,h.push(i/m,n/m,1/0,g,-1,m),o&&h.push(d)}else{for(let t=0;t<l;t++)h.push(a[s+t]);if(m>1)for(const t of u){const s=t*l;if(!(a[s+2]<=e)){a[s+2]=e;for(let t=0;t<l;t++)h.push(a[s+t])}}}}return h}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+b]>1){const r=this.clusterProps[t[e+L]];return s?Object.assign({},r):r}const r=this.points[t[e+A]].properties,o=this.options.map(r);return s&&o===r?Object.assign({},o):o}}function Z(t,e,s){return{type:"Feature",id:t[e+A],properties:I(t,e,s),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),S(t[e+1])]}};var r}function I(t,e,s){const r=t[e+b],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,i=t[e+L],n=-1===i?{}:Object.assign({},s[i]);return Object.assign(n,{cluster:!0,cluster_id:t[e+A],point_count:r,point_count_abbreviated:o})}function T(t){return t/360+.5}function j(t){const e=Math.sin(t*Math.PI/180),s=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return s<0?0:s>1?1:s}function S(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}class z extends u{constructor(t){var{maxZoom:s,radius:r=60}=t,o=e(t,["maxZoom","radius"]);super({maxZoom:s}),this.state={zoom:-1},this.superCluster=new O(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(t){let e=!1;const r={zoom:t.map.getZoom()};if(!f(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const r=this.markers.map((t=>{const e=s.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(r)}return e||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(e=!f(this.state,r)),this.state=r,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster(t){let{map:e}=t;return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map((t=>this.transformCluster(t)))}transformCluster(t){let{geometry:{coordinates:[e,o]},properties:i}=t;if(i.cluster)return new r({markers:this.superCluster.getLeaves(i.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:o,lng:e}});const n=i.marker;return new r({markers:[n],position:s.getPosition(n)})}}class U{constructor(t,e){this.markers={sum:t.length};const s=e.map((t=>t.count)),r=s.reduce(((t,e)=>t+e),0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class B{render(t,e,r){let{count:o,position:i}=t;const n=`<svg fill="${o>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${o}</text>\n</svg>`,a=`Cluster of ${o} markers`,h=Number(google.maps.Marker.MAX_ZINDEX)+o;if(s.isAdvancedMarkerAvailable(r)){const t=(new DOMParser).parseFromString(n,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const e={map:r,position:i,zIndex:h,title:a,content:t};return new google.maps.marker.AdvancedMarkerElement(e)}const l={position:i,zIndex:h,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(n)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(l)}}class D{constructor(){!function(t,e){for(let s in e.prototype)t.prototype[s]=e.prototype[s]}(D,google.maps.OverlayView)}}var N;t.MarkerClustererEvents=void 0,(N=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",N.CLUSTERING_END="clusteringend",N.CLUSTER_CLICK="click";const F=(t,e,s)=>{s.fitBounds(e.bounds)};return t.AbstractAlgorithm=u,t.AbstractViewportAlgorithm=p,t.Cluster=r,t.ClusterStats=U,t.DefaultRenderer=B,t.GridAlgorithm=class extends p{constructor(t){var{maxDistance:s=4e4,gridSize:r=40}=t;super(e(t,["maxDistance","gridSize"])),this.clusters=[],this.state={zoom:-1},this.maxDistance=s,this.gridSize=r}calculate(t){let{markers:e,map:s,mapCanvasProjection:r}=t;const i={zoom:s.getZoom()};let n=!1;return this.state.zoom>=this.maxZoom&&i.zoom>=this.maxZoom||(n=!f(this.state,i)),this.state=i,s.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:n}:{clusters:this.cluster({markers:o(s,r,e,this.viewportPadding),map:s,mapCanvasProjection:r})}}cluster(t){let{markers:e,map:s,mapCanvasProjection:r}=t;return this.clusters=[],e.forEach((t=>{this.addToClosestCluster(t,s,r)})),this.clusters}addToClosestCluster(t,e,o){let n=this.maxDistance,h=null;for(let e=0;e<this.clusters.length;e++){const r=this.clusters[e],o=a(r.bounds.getCenter().toJSON(),s.getPosition(t).toJSON());o<n&&(n=o,h=r)}if(h&&i(h.bounds,o,this.gridSize).contains(s.getPosition(t)))h.push(t);else{const e=new r({markers:[t]});this.clusters.push(e)}}},t.MarkerClusterer=class extends D{constructor(t){let{map:e,markers:s=[],algorithmOptions:r={},algorithm:o=new z(r),renderer:i=new B,onClusterClick:n=F}=t;super(),this.markers=[...s],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=n,e&&this.setMap(e)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach((t=>{this.addMarker(t,!0)})),e||this.render()}removeMarker(t,e){const r=this.markers.indexOf(t);return-1!==r&&(s.setMap(t,null),this.markers.splice(r,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach((t=>{s=this.removeMarker(t,!0)||s})),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);const{clusters:r,changed:o}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(o||null==o){const t=new Set;for(const e of r)1==e.markers.length&&t.add(e.markers[0]);const e=[];for(const r of this.clusters)null!=r.marker&&(1==r.markers.length?t.has(r.marker)||s.setMap(r.marker,null):e.push(r.marker));this.clusters=r,this.renderClusters(),requestAnimationFrame((()=>e.forEach((t=>s.setMap(t,null)))))}google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach((t=>s.setMap(t,null))),this.clusters.forEach((t=>t.delete())),this.clusters=[]}renderClusters(){const e=new U(this.markers,this.clusters),r=this.getMap();this.clusters.forEach((o=>{1===o.markers.length?o.marker=o.markers[0]:(o.marker=this.renderer.render(o,e,r),o.markers.forEach((t=>s.setMap(t,null))),this.onClusterClick&&o.marker.addListener("click",(e=>{google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTER_CLICK,o),this.onClusterClick(e,o,r)}))),s.setMap(o.marker,r)}))}},t.MarkerUtils=s,t.NoopAlgorithm=class extends u{constructor(t){super(e(t,[]))}calculate(t){let{markers:e,map:s,mapCanvasProjection:r}=t;return{clusters:this.cluster({markers:e,map:s,mapCanvasProjection:r}),changed:!1}}cluster(t){return this.noop(t)}},t.SuperClusterAlgorithm=z,t.SuperClusterViewportAlgorithm=class extends p{constructor(t){var{maxZoom:s,radius:r=60,viewportPadding:o=60}=t,i=e(t,["maxZoom","radius","viewportPadding"]);super({maxZoom:s,viewportPadding:o}),this.superCluster=new O(Object.assign({maxZoom:this.maxZoom,radius:r},i)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(t){const e={zoom:Math.round(t.map.getZoom()),view:n(t.map.getBounds(),t.mapCanvasProjection,this.viewportPadding)};let r=!f(this.state,e);if(!f(t.markers,this.markers)){r=!0,this.markers=[...t.markers];const e=this.markers.map((t=>{const e=s.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(e)}return r&&(this.clusters=this.cluster(t),this.state=e),{clusters:this.clusters,changed:r}}cluster(t){let{map:e,mapCanvasProjection:s}=t;const r={zoom:Math.round(e.getZoom()),view:n(e.getBounds(),s,this.viewportPadding)};return this.superCluster.getClusters(r.view,r.zoom).map((t=>this.transformCluster(t)))}transformCluster(t){let{geometry:{coordinates:[e,o]},properties:i}=t;if(i.cluster)return new r({markers:this.superCluster.getLeaves(i.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:o,lng:e}});const n=i.marker;return new r({markers:[n],position:s.getPosition(n)})}},t.defaultOnClusterClickHandler=F,t.distanceBetweenPoints=a,t.extendBoundsToPaddedViewport=i,t.extendPixelBounds=l,t.filterMarkersToPaddedViewport=o,t.getPaddedViewport=n,t.noop=m,t.pixelBoundsToLatLngBounds=c,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
!function(e){"use strict";var t=window.houzez||{};t.Maps=function(){let o,n,a=new Array,r=null,i=new Array,l=new Array,s="",p=1,c=12,d="",m="",u=0,g="no",h="",f="roadmap",y="",v="",z="",w="",_=0,b=0,k=0,I=12,x=18,C=0,M=!1,E=!1,T=!1,L=0,P=null;"undefined"!=typeof houzez_vars&&(y=houzez_vars.admin_url+"admin-ajax.php",v=houzez_vars.user_id,z=houzez_vars.not_found,w=houzez_vars.thousands_separator,_=parseInt(houzez_vars.is_halfmap),C=parseInt(houzez_vars.houzez_default_radius),L=parseInt(houzez_vars.auto_load_map_listings));const S=()=>!!window.matchMedia("(max-width: 991px)").matches||(!0===navigator.userAgentData?.mobile||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)),A=function(e){const t=document.getElementById("listing-mapzoomin");t&&t.addEventListener("click",function(){var t=parseInt(e.getZoom(),10);++t>20&&(t=20),e.setZoom(t),X()})},j=function(e){const t=document.getElementById("listing-mapzoomout");t&&t.addEventListener("click",function(){var t=parseInt(e.getZoom(),10);--t<0&&(t=0),e.setZoom(t),X()})},O=function(e){return"roadmap"===e?o.setMapTypeId(google.maps.MapTypeId.ROADMAP):"satellite"===e?o.setMapTypeId(google.maps.MapTypeId.SATELLITE):"hybrid"===e?o.setMapTypeId(google.maps.MapTypeId.HYBRID):"terrain"===e&&o.setMapTypeId(google.maps.MapTypeId.TERRAIN),!1},B=function(){google.maps.event.addListener(o,"tilesloaded",function(){jQuery(".houzez-map-loading").hide()})},D=function(){0!=p&&null!=r&&r.clearMarkers()},N=function(){for(var e=0;e<i.length;e++)i[e].setMap(null);i=[]},F=function(){const e=new google.maps.LatLngBounds;for(let t=0;t<i.length;t++)i[t].position&&e.extend(i[t].position);o.fitBounds(e),google.maps.event.addListenerOnce(o,"bounds_changed",function(){const e=I;o.getZoom()>e&&o.setZoom(e)})},R=function(t,o){if(1!==L)return;P&&(clearTimeout(P),P=null);const n=e("#houzez-map-message"),a=n.find(".map-info-message");if(t<o){const e=houzez_vars.map_show_some.replace("%s",t).replace("%s",o),r=houzez_vars.zoom_in_show_more;a.html(e+"<br>"+r),n.addClass("show")}else{const e=houzez_vars.map_show_all.replace("%s",o);a.html(e),n.addClass("show")}P=setTimeout(function(){n.removeClass("show")},3e3)},Z=function(){e(".houzezMapType").on("click",function(t){t.preventDefault();var o=e(this).data("maptype");O(o)}),document.getElementById("listing-mapzoomin")&&A(o),document.getElementById("listing-mapzoomout")&&j(o),e("#houzez-gmap-next").on("click",function(){!function(){if(u++,u>i.length&&(u=1),i[u-1]){const e=i[u-1].propertyId;e&&U(e)}}()}),e("#houzez-gmap-prev").on("click",function(){!function(){if(u--,u<1&&(u=i.length),i[u-1]){const e=i[u-1].propertyId;e&&U(e)}}()})},H=async function(e,t,o=!1){let d=null,u=null;d=t.getCenter(),u=t.getZoom(),a=function(){for(;l.length>0;){l.pop().close()}};var h=function(e,t,o){t.addListener("gmp-click",function(){a(),o.open({anchor:t,map:e}),l.push(o);var n=o.getContent().getElementsByClassName("listing-thumbnail");for(let e=0;e<n.length;e++)n[e].dataset.src&&(n[e].src=n[e].dataset.src)})};const f={"&amp;":"&","&quot;":'"',"&#039;":"'","&#8217;":"’","&#038;":"&","&lt;":"<","&gt;":">","&#8216;":"‘","&#8230;":"…","&#8221;":"”","&#8211;":"â€“","&#8212;":"â€”"},y={};for(var v=0;v<e.length;v++){const t=parseFloat(e[v].latitude),o=parseFloat(e[v].longitude);if(!e[v].latitude||!e[v].longitude||isNaN(t)||isNaN(o)||t<-90||t>90||o<-180||o>180)continue;const n=`${t.toFixed(6)}_${o.toFixed(6)}`;y[n]||(y[n]={lat:t,lng:o,properties:[]}),y[n].properties.push(e[v])}for(const e in y){const o=y[e],a=new google.maps.LatLng(o.lat,o.lng),r=o.properties;let l;n.extend(a);let s="";const p=r[0],c=p.property_id.toString();let d=p.marker_color;if(r.length>1?s=`${r.length} properties at this location`:p.title&&(s=p.title.replace(/\&[\w\d\#]{2,5}\;/g,function(e){return f[e]})),"yes"==g){const e=document.createElement("div");e.className="gm-marker map-marker-label",e.dataset.id=p.property_id,e.style.position="relative",d&&(e.style.backgroundColor=d,e.style.borderColor=d,e.style.color="#ffffff");const o=document.createElement("div");if(o.className="gm-marker-price",o.innerHTML=p.pricePin,e.appendChild(o),r.length>1){const t=document.createElement("div");t.style.position="absolute",t.style.top="-8px",t.style.right="-8px",t.style.backgroundColor="#333333",t.style.color="#ffffff",t.style.borderRadius="50%",t.style.width="18px",t.style.height="18px",t.style.fontSize="10px",t.style.fontWeight="bold",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.border="2px solid #ffffff",t.style.boxShadow="0 2px 4px rgba(0,0,0,0.2)",t.style.zIndex="1",t.textContent=r.length,e.appendChild(t)}l=new google.maps.marker.AdvancedMarkerElement({map:t,position:a,content:e,title:s}),l.propertyId=c}else{let e=p.marker;window.devicePixelRatio>1.5&&p.retinaMarker&&(e=p.retinaMarker);const o=document.createElement("div");o.style.position="relative";const n=document.createElement("img");if(n.src=e,n.style.width="44px",n.style.height="56px",o.appendChild(n),o.style.outline="none",o.style.border="none",o.style.boxShadow="none",o.addEventListener("focus",e=>{e.target.style.outline="none",e.target.style.border="none",e.target.style.boxShadow="none"}),r.length>1){const e=document.createElement("div");e.style.position="absolute",e.style.top="-5px",e.style.right="-5px",e.style.backgroundColor="#333333",e.style.color="#ffffff",e.style.borderRadius="50%",e.style.width="20px",e.style.height="20px",e.style.fontSize="11px",e.style.fontWeight="bold",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.border="2px solid #ffffff",e.style.boxShadow="0 2px 4px rgba(0,0,0,0.2)",e.textContent=r.length,o.appendChild(e)}l=new google.maps.marker.AdvancedMarkerElement({map:t,position:a,content:o,title:s}),l.propertyId=c}r.length>1&&(l.groupedProperties=r);var z=document.createElement("div");z.className="property-info-window";var w="";if(1===r.length){const e=r[0];e.thumbnail?w+='<div class="info-window-image">'+e.featured_label+'<a target="'+e.link_target+'" href="'+e.url+'"><img class="img-fluid listing-thumbnail" src="'+m+'" data-src="'+e.thumbnail+'" alt="'+e.title+'"/></a></div>':w+='<div class="info-window-image">'+e.featured_label+'<a target="'+e.link_target+'" href="'+e.url+'"><img class="img-fluid listing-thumbnail" src="'+m+'" alt="'+e.title+'"/></a></div>',w+='<div class="info-content" style="padding:10px;">',e.price&&(w+='<div class="info-window-price">'+e.price+"</div>"),w+=e.meta,e.property_type&&(w+='<div class="info-window-property-type">'+e.property_type+"</div>"),w+=e.address,w+="</div>"}else{w+='<div class="info-window-multiple-properties" style="position: relative;">',w+='<div style="max-height: 240px; overflow-y: auto; padding: 10px; scrollbar-width: thin; scrollbar-color: #ccc #f5f5f5;" class="info-window-scrollable">';for(let e=0;e<r.length;e++){const t=r[e],o=e===r.length-1;w+='<div class="info-window-property-item" data-property-id="'+t.property_id+'" style="'+(o?"":"border-bottom: 1px solid #eee; ")+'padding: 10px 0; display: flex; gap: 10px;">',w+='<div style="flex-shrink: 0;">',t.thumbnail?w+='<a target="'+t.link_target+'" href="'+t.url+'"><img class="listing-thumbnail" src="'+m+'" data-src="'+t.thumbnail+'" alt="'+t.title+'" style="width: 80px; height: 60px; object-fit: cover; border-radius: 4px;"/></a>':w+='<a target="'+t.link_target+'" href="'+t.url+'"><img class="listing-thumbnail" src="'+m+'" alt="'+t.title+'" style="width: 80px; height: 60px; object-fit: cover; border-radius: 4px;"/></a>',w+="</div>",w+='<div style="flex: 1; min-width: 0;">',w+='<h5 style="margin: 0 0 5px 0; font-size: 14px; font-weight: 600;"><a target="'+t.link_target+'" href="'+t.url+'" style="color: #333; text-decoration: none;">'+(t.title||"Property "+(e+1))+"</a></h5>",t.price&&(w+='<div style="font-weight: 600; font-size: 14px; margin-bottom: 3px;">'+t.price+"</div>"),t.property_type&&(w+='<div style="font-size: 12px; color: #666;">'+t.property_type+"</div>"),w+="</div>",w+="</div>"}w+="</div>",w+="</div>"}if(z.innerHTML=w,r.length>1){const e=document.createElement("style");e.textContent="\n                        .info-window-scrollable::-webkit-scrollbar {\n                            width: 6px;\n                        }\n                        .info-window-scrollable::-webkit-scrollbar-track {\n                            background: #f5f5f5;\n                            border-radius: 3px;\n                        }\n                        .info-window-scrollable::-webkit-scrollbar-thumb {\n                            background: #ccc;\n                            border-radius: 3px;\n                        }\n                        .info-window-scrollable::-webkit-scrollbar-thumb:hover {\n                            background: #999;\n                        }\n                    ",z.appendChild(e)}if(!document.getElementById("houzez-marker-styles")){const e=document.createElement("style");e.id="houzez-marker-styles",e.textContent='\n                        /* Remove blue border/outline from Google Maps markers */\n                        .gm-style .gm-style-iw-c,\n                        .gm-style .gm-style-iw-d,\n                        .gm-style-iw,\n                        .gm-style-iw-c,\n                        .gmp-marker-view,\n                        [role="button"]:focus,\n                        [role="button"]:active {\n                            outline: none !important;\n                            border: none !important;\n                            box-shadow: none !important;\n                        }\n                        \n                        /* Remove focus styles from advanced markers */\n                        gmp-advanced-marker,\n                        .gmp-advanced-marker {\n                            outline: none !important;\n                            border: none !important;\n                            box-shadow: none !important;\n                        }\n                        \n                        /* Remove focus styles from marker content */\n                        \n                        \n                        /* Ensure property highlighting works */\n                        .info-window-property-item.property-highlighted {\n                            background-color: #f0f8ff !important;\n                        }\n                    ',document.head.appendChild(e)}h(t,l,new google.maps.InfoWindow({content:z,maxWidth:350})),i.push(l)}if(o||F(),0!=p)try{r&&("function"==typeof r.clearMarkers?r.clearMarkers():"function"==typeof r.clear&&r.clear()),void 0!==window.markerClusterer&&(r=new window.markerClusterer.MarkerClusterer({map:t,markers:i,algorithm:new window.markerClusterer.GridAlgorithm({maxZoom:parseInt(c),gridSize:60}),renderer:{render:({count:e,position:t})=>{const o=document.createElement("div");return o.className="houzez-cluster-marker",o.style.backgroundImage=`url(${s})`,o.style.width="48px",o.style.height="48px",o.style.backgroundSize="contain",o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.color="#ffffff",o.style.fontWeight="bold",o.textContent=e,new google.maps.marker.AdvancedMarkerElement({position:t,content:o})}},onClusterClick:(e,t,o)=>{const n=new google.maps.LatLngBounds;t.markers.forEach(e=>{n.extend(e.position)});const a=o.getZoom();o.fitBounds(n),t.markers.length>1&&google.maps.event.addListenerOnce(o,"bounds_changed",()=>{const e=Math.min(a+1,16);o.getZoom()>e&&o.setZoom(e)})}}))}catch(e){}},U=function(e){if(!e)return;let t=e;"string"==typeof t&&0===t.indexOf("hz-")&&(t=t.replace("hz-","")),a();const o=((e,t)=>{if(!t||!e||0===e.length)return null;const o=t.toString();for(let t=0;t<e.length;t++){const n=e[t];if(n.propertyId===o)return{marker:n,index:t};if(n.groupedProperties)for(let e=0;e<n.groupedProperties.length;e++)if(n.groupedProperties[e].property_id.toString()===o)return{marker:n,index:t,propertyIndex:e}}return null})(i,t);if(o){const e=o.marker;return e.content?e.content.click():e.click(),void 0!==o.propertyIndex&&setTimeout(()=>{W(t)},100),!0}return!1},W=function(e){const t=document.querySelector('.info-window-property-item[data-property-id="'+e+'"]');if(t){J(),t.style.transition="background-color 0.3s ease",t.classList.add("property-highlighted"),t.style.setProperty("background-color","#f0f8ff","important");const e=t.closest(".info-window-scrollable");if(e){const o=t.offsetTop;e.clientHeight,t.offsetHeight;if(0===o)e.scrollTop=0;else{const t=o-10;e.scrollTop=Math.max(0,t)}}}},J=function(){document.querySelectorAll(".property-highlighted").forEach(e=>{e.style.backgroundColor="",e.classList.remove("property-highlighted")})},q=function(){S()||e("#half-map-listing-area .hz-map-trigger").each(function(){var t=e(this).data("hz-id");"string"==typeof t?0===t.indexOf("hz-")&&(t=t.replace("hz-","")):t=e(this).data("hz-id").toString().replace(/[^\d.]/g,"");const n=t;e(this).on("mouseenter",function(){o&&U(n)}),e(this).on("mouseleave",function(){J(),a()})})},V=function(t,n){var a=e("#houzez_ajax_container"),r=e("#half-map-listing-area .page-title span"),i=e("#ajax_sort_properties").val(),l=e(".listing-view").data("layout"),s=e(".listing-view").data("css"),p=e(".listing-view").data("view");const c=n.serialize(),d={action:"houzez_half_map_listings",paged:t,sortby:i,item_layout:l,layout_css:s,layout_view:p};d.is_pagination_request=E;let m=c+"&"+e.param(d);return e.ajax({type:"GET",dataType:"json",url:y,data:m,beforeSend:function(){e(".houzez-map-loading").show(),a.empty().append('<div id="houzez-map-loading" class="houzez-map-loading"><div class="mapPlaceholder"><div class="loader-ripple spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div></div>')},success:function(t){if(""!=t.query&&e('input[name="search_args"]').val(t.query),""!=t.search_uri&&e('input[name="search_URI"]').val(t.search_uri),e(".map-notfound").remove(),e(".search-no-results-found").remove(),e(".houzez-map-loading").hide(),t.total_results>0){if(!0===t.getProperties){let e=o.getCenter(),n=o.getZoom();D(),N(),H(t.properties,o,T),T&&e&&n&&(o.setCenter(e),o.setZoom(n)),R(t.properties.length,t.total_results)}a.empty().html(t.propHtml),r.empty().html(t.total_results),ee(),houzez_listing_lightbox(),houzez_grid_image_gallery(),houzez_grid_call_to_action(),compare_for_ajax(),S()||q(),e('[data-bs-toggle="tooltip"]').tooltip()}else{D(),N();let n=o.getCenter(),i=o.getZoom();T&&n&&i&&(o.setCenter(n),o.setZoom(i)),A(o),j(o),e("#houzez-properties-map").append('<div class="map-notfound">'+z+"</div>"),a.empty().html(t.propHtml),r.empty().html(t.total_results)}return!1},complete:function(){E=!1,T=!1,M=!1,e(".location-trigger").find(".icon-location-target").removeClass("icon-spin")},error:function(e,t,o){}}),!1},$=function(){if(e("#houzez-properties-map").length>0){let t=e("#radius-range-slider"),o=e("#desktop-search-form");t.on("change",t=>{e('input[name="use_radius"]').prop("checked",!0),e('input[name="ne_lat"]').val(""),e('input[name="ne_lng"]').val(""),e('input[name="sw_lat"]').val(""),e('input[name="sw_lng"]').val(""),e('input[name="zoom"]').val(""),K(null,o)})}},G=function(){if(e("#houzez-properties-map").length>0){let t=e("#fromSlider_price_range_halfmap"),o=e("#toSlider_price_range_halfmap"),n=e("#desktop-search-form");t.on("change",e=>{K(null,n)}),o.on("change",e=>{K(null,n)})}},Q=function(){if(e("#houzez-properties-map").length>0){let t=e("#fromSlider_price_range_mobile"),o=e("#toSlider_price_range_mobile"),n=e("#mobile-search-form");t.on("change",e=>{K(null,n)}),o.on("change",e=>{K(null,n)})}},Y=function(t){var o=t||e("form.houzez-search-filters-js").first();o.length&&o.addClass("loading");var n=o.attr("action");if(null==n)return!0;var a,r=o.find(":input").filter(function(t,o){if(!e(o).prop("disabled")&&""!=e(o).val()&&"search_geolocation"!=e(o).attr("name")&&"search_URI"!=e(o).attr("name")&&"search_args"!=e(o).attr("name")&&"houzez_save_search_ajax"!=e(o).attr("name"))return!0}).serialize();n=null==n?"":(n.indexOf("?"),n+"?"+r),a=n,window.history.pushState({houzezTheme:!0},"",a)},K=function(t=null,o=null,n=0){if(M)return;let a=o;!a&&t&&(a=t.parents("form")),a&&a.length&&(M=!0,e(".hz-halfmap-paged").val(n),Y(a),V(n,a))},X=()=>{if(!L)return;T=!0;let t=e("#desktop-search-form");e("#mobile-search-form.hz-mobile-overlay-search-js").length>0&&(t=e("#mobile-search-form"));const n=o.getBounds();if(n){const a=n.getNorthEast(),r=n.getSouthWest(),i=o.getZoom();e('input[name="ne_lat"]').val(a.lat()),e('input[name="ne_lng"]').val(a.lng()),e('input[name="sw_lat"]').val(r.lat()),e('input[name="sw_lng"]').val(r.lng()),e('input[name="zoom"]').val(i),e('input[name="use_radius"]').prop("checked",!1),K(null,t)}},ee=function(){return e(".houzez_ajax_pagination a").on("click",function(t){t.preventDefault(),L&&(E=!0);let o=e(this).data("houzepagi"),n=e("#desktop-search-form");e("#mobile-search-form.apply-mobile-pagination").length>0&&(n=e("#mobile-search-form")),K(null,n,o)}),!1},te=async function(){if(e("#houzez-properties-map").length>0){let a,r,i=e("#houzez-properties-map"),l=i.data("map"),u=i.data("options");const y=new URLSearchParams(window.location.search);let v=y.get("lat"),z=y.get("lng");if(v&&z||(v=e('input[name="lat"]').val(),z=e('input[name="lng"]').val()),!l)return;try{a="object"==typeof l?l:JSON.parse(l),"object"==typeof u?r=u:u&&(r=JSON.parse(u))}catch(e){return}if(r){s=r.clusterIcon,p=r.map_cluster_enable,c=r.clusterer_zoom,d=r.closeIcon,m=r.infoWindowPlac,g=r.markerPricePins,f=r.map_type,h=r.googlemap_style,b=parseFloat(r.default_lat),k=parseFloat(r.default_lng),I=parseFloat(r.default_zoom),x=parseFloat(r.max_zoom),v&&z&&!isNaN(parseFloat(v))&&!isNaN(parseFloat(z))&&(b=parseFloat(v),k=parseFloat(z)),r.center_lat&&r.center_lng&&(b=parseFloat(r.center_lat),k=parseFloat(r.center_lng));var t={zoom:I,maxZoom:x,disableDefaultUI:!0,scrollwheel:!1,center:new google.maps.LatLng(b,k),mapId:r.mapId}}if(t=function(e){switch(f){case"hybrid":e.mapTypeId=google.maps.MapTypeId.HYBRID;break;case"terrain":e.mapTypeId=google.maps.MapTypeId.TERRAIN;break;case"satellite":e.mapTypeId=google.maps.MapTypeId.SATELLITE;break;default:e.mapTypeId=google.maps.MapTypeId.ROADMAP}return e}(t),o=new google.maps.Map(document.getElementById("houzez-properties-map"),t),n=new google.maps.LatLngBounds,B(),a.properties&&a.properties.length>0){await H(a.properties,o),S()||q();let t=e("#total-results").data("total-results");t>0&&R(a.properties.length,t)}else{t={center:new google.maps.LatLng(b,k),zoom:I,maxZoom:x,disableDefaultUI:!0,scrollwheel:!1,mapId:r.mapId};o=new google.maps.Map(document.getElementById("houzez-properties-map"),t),jQuery(".houzez-map-loading").hide()}Z(),L&&_&&(()=>{let e=!1,t=0;google.maps.event.clearListeners(o,"idle"),google.maps.event.clearListeners(o,"dragend"),google.maps.event.clearListeners(o,"dragstart"),google.maps.event.clearListeners(o,"zoom_changed"),google.maps.event.addListener(o,"dragstart",function(){e=!0}),google.maps.event.addListener(o,"dragend",function(){!M&&e?(X(),t=Date.now(),e=!1):e=!1})})()}};return{init:async function(){"object"==typeof google&&"object"==typeof google.maps&&(te(),ee(),e("#ajax_sort_properties").on("change",function(){let t=e("#desktop-search-form");e(this).hasClass("mobile-sortby")&&(t=e("#mobile-search-form")),K(null,t)}),e("select.houzez_search_ajax, input.houzez_search_ajax").on("change",function(){var t=e(this).closest("form");K(null,t)}),e(".half-map-wrap").length>0&&e(".btn-apply, .half-map-search-js-btn, #auto_complete_ajax").on("click",function(t){t.preventDefault();let o=e(this).closest("form");K(null,o)}),e("#houzez-btn-map-view").on("click",function(t){t.preventDefault(),e("#half-map-listing-area, .listing-wrap").hide(),e("#map-view-wrap").show(),e("#mobile-search-form").addClass("hz-mobile-overlay-search-js"),google.maps.event.trigger(o,"resize"),F()}),e("#houzez-btn-listing-view").on("click",function(o){o.preventDefault(),e("#map-view-wrap").hide(),e("#half-map-listing-area, .listing-wrap").show(),e("#mobile-search-form").removeClass("hz-mobile-overlay-search-js"),e(".hz-item-gallery-js").removeClass("houzez-gallery-loaded"),window.setTimeout(function(){t.Core&&"function"==typeof t.Core.reinitializeAjaxFunctions&&t.Core.reinitializeAjaxFunctions()},100)}),function(){if(e(".hz-map-field-js").length>0){var t=houzez_vars.geo_country_limit,o=houzez_vars.geocomplete_country,n=function(e){this.$container=e};n.prototype={init:function(){this.initDomElements(),this.autocomplete()},initDomElements:function(){this.addressField=this.$container.data("address-field")},autocomplete:function(){var n=this,a=this.addressField;if(null!==a){var r=document.getElementById(a),i=new google.maps.places.Autocomplete(r,{types:["geocode","establishment"]});0!=t&&""!=o&&("UAE"==o&&(o="AE"),i.setComponentRestrictions({country:[o]})),google.maps.event.addListener(i,"place_changed",function(){var t=i.getPlace(),o=new google.maps.LatLng(t.geometry.location.lat(),t.geometry.location.lng());n.updateCoordinate(o),_&&(r=e(r),K(r))})}},updateCoordinate:function(t){e('input[name="lat"]').val(t.lat()),e('input[name="lng"]').val(t.lng()),e('input[name="ne_lat"]').val(""),e('input[name="ne_lng"]').val(""),e('input[name="sw_lat"]').val(""),e('input[name="sw_lng"]').val(""),e('input[name="zoom"]').val(""),e('input[name="use_radius"]').prop("checked",!0)}};var a=function(){var t=e(this);new n(t).init()};e(".hz-map-field-js").each(a),e(".location-trigger").on("click",function(t){t.preventDefault();let o=e(this),n=o.parents(".location-search").find("input.search_location_js");o.find(".icon-location-target").addClass("icon-spin"),navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){let a=new google.maps.Geocoder,r=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);a.geocode({location:r},function(a,r){r===google.maps.GeocoderStatus.OK&&a[0]?n.val(a[0].formatted_address):n.val(houzez_vars.current_location),e('input[name="lat"]').val(t.coords.latitude),e('input[name="lng"]').val(t.coords.longitude),e('input[name="ne_lat"]').val(""),e('input[name="ne_lng"]').val(""),e('input[name="sw_lat"]').val(""),e('input[name="sw_lng"]').val(""),e('input[name="zoom"]').val(""),e('input[name="use_radius"]').prop("checked",!0),_?K(o):o.find(".icon-location-target").removeClass("icon-spin")})})})}}()),G(),Q(),$(),e("#houzez-gmap-full").on("click",function(){var t=e(this);t.hasClass("active")?(t.removeClass("active"),t.parents(".map-wrap").removeClass("houzez-fullscreen-map")):(t.parents(".map-wrap").addClass("houzez-fullscreen-map"),t.addClass("active"))})},addMarkers:H,clearClusterer:D,reloadMarkers:N,mapBounds:F,halfMapAjax:V,setUrl:Y,searchOnChange:K,changeMapType:O,initInfoboxTrigger:q,removeMapLoader:B,createMapCircle:(e,t,{strokeColor:o="#4f5962",strokeOpacity:n=.8,strokeWeight:a=2,fillColor:r="#4f5962",fillOpacity:i=.35,radius:l=300,...s}={})=>{const p={strokeColor:o,strokeOpacity:n,strokeWeight:a,fillColor:r,fillOpacity:i,radius:l,...s,map:e,center:t};return new google.maps.Circle(p)},createStandardMarker:async(e,t,o,{propertyId:n=(t&&t.property_id?t.property_id.toString():null),...a}={})=>{if(!t)return null;let r=t.marker;window.devicePixelRatio>1.5&&t.retinaMarker&&(r=t.retinaMarker);let i="";if(t.title){const e={"&amp;":"&","&quot;":'"',"&#039;":"'","&#8217;":"’","&#038;":"&","&lt;":"<","&gt;":">","&#8216;":"‘","&#8230;":"…","&#8221;":"”","&#8211;":"â€“","&#8212;":"â€”"};i=t.title.replace(/\&[\w\d\#]{2,5}\;/g,t=>e[t])}const l=document.createElement("div");l.style.position="relative";const s=document.createElement("img");s.src=r,s.style.width="44px",s.style.height="56px",l.appendChild(s);const p=new google.maps.marker.AdvancedMarkerElement({map:e,position:o,content:l,title:i,...a});return p.propertyId=n,p},createPricePin:async(e,t,o)=>{if(!t)return null;const n=document.createElement("div");n.className="gm-marker map-marker-label",n.dataset.id=t.property_id;const a=document.createElement("div");a.className="gm-marker-price",a.innerHTML=t.pricePin,n.appendChild(a);const r=new google.maps.marker.AdvancedMarkerElement({map:e,position:o,content:n});return r.propertyId=t.property_id.toString(),r},triggerPriceRangeSearch:G,triggerPriceRangeSearchMobile:Q,triggerDistanceRangeSearch:$}}(),t.SingleAgentMap=function(){let t=null;return{init:async()=>{if(e("#houzez-agent-sidebar-map").length<=0)return;const o=e("#houzez-agent-sidebar-map").data("lat"),n=e("#houzez-agent-sidebar-map").data("lng");if(""!=o&&""!=n){const e=new google.maps.LatLng(o,n),a={center:e,zoom:15,disableDefaultUI:!0,scrollwheel:!1,mapId:"HOUZEZ_MAP_ID"};t=new google.maps.Map(document.getElementById("houzez-agent-sidebar-map"),a);const r=new google.maps.marker.PinElement({background:"#1DABE3",borderColor:"#FFFFFF",glyphColor:"#FFFFFF"});new google.maps.marker.AdvancedMarkerElement({map:t,position:e,content:r.element})}}}}(),t.SinglePropertyOverviewMap=function(){let o,n=null;return{init:async()=>{if(e("#houzez-overview-listing-map").length<=0)return;let a,r,i;const l=e("#houzez-overview-listing-map");let s=l.data("map"),p=l.data("options");if(!s)return;let c=15,d="",m=!1,u="marker",g="no",h="HOUZEZ_MAP_ID";if(p)try{a="object"==typeof p?p:JSON.parse(p)}catch(e){}try{"object"==typeof s||(s=JSON.parse(s))}catch(e){return}if(!s.latitude||!s.longitude)return;if(a&&(i=a.closeIcon,r=a.infoWindowPlac,g=a.markerPricePins,u=a.map_pin_type,d=a.googlemap_style,h=a.mapId||"HOUZEZ_MAP_ID","circle"==u&&(m=!0),a.single_map_zoom>0&&(c=parseInt(a.single_map_zoom)),d))try{"string"==typeof d&&(d=JSON.parse(d))}catch(e){d=""}const f=new google.maps.LatLng(s.latitude,s.longitude),y={center:f,zoom:parseInt(c),disableDefaultUI:!1,scrollwheel:!1,mapTypeId:google.maps.MapTypeId.ROADMAP,mapId:h};if(o=new google.maps.Map(document.getElementById("houzez-overview-listing-map"),y),m)t.Maps.createMapCircle(o,f);else{const{AdvancedMarkerElement:e}=google.maps.marker;if("yes"===g&&s.pricePin){const t=document.createElement("div");t.className="gm-marker map-marker-label",t.dataset.id=s.property_id||s.post_id,s.marker_color&&(t.style.backgroundColor=s.marker_color,t.style.borderColor=s.marker_color,t.style.color="#ffffff");const a=document.createElement("div");a.className="gm-marker-price",a.innerHTML=s.pricePin,t.appendChild(a),n=new e({map:o,position:f,content:t,title:s.title||""})}else{let t=s.marker;window.devicePixelRatio>1.5&&s.retinaMarker&&(t=s.retinaMarker);const a=document.createElement("div");a.style.position="relative";const r=document.createElement("img");r.src=t,r.style.width="44px",r.style.height="56px",a.appendChild(r),n=new e({map:o,position:f,content:a,title:s.title||""})}}}}}(),t.SinglePropertyMap=function(){let o=null,n=null,a=0,r=null;const i=({map:e,zoomInBtnId:t,zoomOutBtnId:o,mapTypeSelector:n})=>{},l=async({map:e,propertyData:o,position:n,showCircle:a=!1,markerPricePins:r="no"})=>{if(e&&n)if(a)t.Maps.createMapCircle(e,n);else{const{AdvancedMarkerElement:t}=google.maps.marker;let a;if("yes"===r&&o.pricePin){const r=document.createElement("div");r.className="gm-marker map-marker-label",r.dataset.id=o.property_id,o.marker_color&&(r.style.backgroundColor=o.marker_color,r.style.borderColor=o.marker_color,r.style.color="#ffffff");const i=document.createElement("div");i.className="gm-marker-price",i.innerHTML=o.pricePin,r.appendChild(i),a=new t({map:e,position:n,content:r,title:o.title})}else{let r=o.marker;window.devicePixelRatio>1.5&&o.retinaMarker&&(r=o.retinaMarker);const i=document.createElement("div");i.style.position="relative";const l=document.createElement("img");l.src=r,l.style.width="44px",l.style.height="56px",i.appendChild(l),a=new t({map:e,position:n,content:i,title:o.title})}a&&a.addListener("gmp-click",()=>{})}},s=({map:t,position:o,streetViewTabSelector:r,streetViewContainerId:i})=>{if(!t||!o)return;const l=e(r);0!==l.length&&l.on("shown.bs.tab",()=>{a++;const e=document.getElementById(i);if(!e)return;const t={position:o,pov:{heading:34,pitch:10}};a<=1?n=new google.maps.StreetViewPanorama(e,t):n&&n.setPosition(o)})},p=()=>{["houzez-single-listing-map","houzez-single-listing-map-address","houzez-single-listing-map-elementor"].forEach(t=>{const n=document.getElementById(t);if(n)try{const e=n.getAttribute("data-map"),a=n.getAttribute("data-options");if(!e)return;const p="object"==typeof e?e:JSON.parse(e);(async({mapContainerId:e="houzez-single-listing-map",streetViewContainerId:t="pills-street-view",zoomInBtnId:n="listing-mapzoomin",zoomOutBtnId:a="listing-mapzoomout",mapTypeSelector:p=".houzezMapType",streetViewTabSelector:c='a[href="#pills-street-view"]',propertyData:d=null,mapOptions:m={}}={})=>{const u=document.getElementById(e);if(!u)return;if(!d)try{const e=u.getAttribute("data-map");e&&(d="object"==typeof e?e:JSON.parse(e))}catch(e){return}if(0===Object.keys(m).length)try{const e=u.getAttribute("data-options");e&&(m="object"==typeof e?e:JSON.parse(e))}catch(e){}if(!d||!d.latitude||!d.longitude)return;r=new google.maps.LatLng(d.latitude,d.longitude);const g={center:r,zoom:parseInt(m.single_map_zoom)||15,disableDefaultUI:!1,scrollwheel:!1,mapId:m.mapId};switch(m.mapType){case"hybrid":g.mapTypeId=google.maps.MapTypeId.HYBRID;break;case"terrain":g.mapTypeId=google.maps.MapTypeId.TERRAIN;break;case"satellite":g.mapTypeId=google.maps.MapTypeId.SATELLITE;break;default:g.mapTypeId=google.maps.MapTypeId.ROADMAP}o=new google.maps.Map(u,g),i({map:o,zoomInBtnId:n,zoomOutBtnId:a,mapTypeSelector:p}),await l({map:o,propertyData:d,position:r,showCircle:"circle"===m.map_pin_type,markerPricePins:m.markerPricePins}),s({map:o,position:r,streetViewTabSelector:c,streetViewContainerId:t})})({mapContainerId:t,propertyData:p,mapOptions:a?"object"==typeof a?a:JSON.parse(a):{}}).catch(e=>{})}catch(t){e(".houzez-map-loading").hide()}})};return{init:p,loadMapFromDOM:p}}(),window.houzez=t}(jQuery);
(()=>{"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e){if(Array.isArray(e))return e}const l="email",a="phone",u="name",c={[l]:["email","e-mail","mail","email address"],[a]:["phone","tel","mobile","cell","telephone","phone number"],[u]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function f(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function s(e){const t=f(e),r=t.lastIndexOf("@");if(-1===r)return t;const n=t.slice(r+1);if(["gmail.com","googlemail.com"].includes(n)){const e=t.slice(0,r).replace(/\./g,"");return"".concat(e,"@").concat(n)}return t}function m(e){const t=f(e),r=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(r):r}function y(l){const a=l.filter(e=>e.type===u).map(e=>f(e.value)).filter(Boolean);if(!a.length)return;const c=o(y=1===a.length?a[0].split(" "):a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(y)||n(y)||r(),s=c[0],m=i(c).slice(1);var y;return function(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){t(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}({first_name:s},(null==m?void 0:m.length)>0?{last_name:m.join(" ")}:{})}function p(e){var t;return null===(t=e.find(e=>e.type===l))||void 0===t?void 0:t.value}function v(e){var t;return null===(t=e.find(e=>e.type===a))||void 0===t?void 0:t.value}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}globalThis.document.addEventListener("wpcf7mailsent",e=>{var t,i,h;const O=(null===(t=globalThis._googlesitekit)||void 0===t?void 0:t.gtagUserData)?function(e){if(!(e&&e instanceof HTMLFormElement))return;const t=new FormData(e);return function(e){const t=[["address",y(e)],["email",p(e)],["phone_number",v(e)]].filter(e=>{return(t=e,i=2,o(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(t,i)||n(t,i)||r())[1];var t,i});if(0!==t.length)return Object.fromEntries(t)}(Array.from(t.entries()).map(t=>{var r;let n=(p=2,function(e){if(Array.isArray(e))return e}(y=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,l,a=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(y,p)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(y,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=n[0],o=n[1];var y,p;const v=e.querySelector("[name='".concat(i,"']")),d=null==v?void 0:v.type;return"hidden"===d||"submit"===d?null:function(e){let t=e||{},r=t.type,n=t.name,i=t.value,o=t.label;switch(r=f(r),n=f(n),i=f(i),o=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(o),r){case"email":return{type:l,value:s(i)};case"tel":return{type:a,value:m(i)}}return function(e){if(!e)return!1;const t=s(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(i)||c[l].includes(n)||c[l].includes(o)?{type:l,value:s(i)}:c[a].includes(n)||c[a].includes(o)?{type:a,value:m(i)}:c[u].includes(n)||c[u].includes(o)?{type:u,value:f(i)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=m(e);if(!/^\+?\d{7,}$/.test(t))return!1;const r=/[\s\-()+.]/.test(e),n=e.trim().startsWith("+");return!(!r&&!n)}(i)?{type:a,value:m(i)}:null}({type:d,label:null!=v&&v.id?null===(r=e.querySelector("label[for='".concat(null==v?void 0:v.id,"']")))||void 0===r?void 0:r.textContent:void 0,name:i,value:o})}).filter(Boolean))}(e.target):null;null===(i=globalThis._googlesitekit)||void 0===i||null===(h=i.gtagEvent)||void 0===h||h.call(i,"contact",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){g(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({event_category:e.detail.contactFormId,event_label:e.detail.unitTag},O?{user_data:O}:{}))})})();
(()=>{"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e){if(Array.isArray(e))return e}const o="email",a="phone",u="name",c={[o]:["email","e-mail","mail","email address"],[a]:["phone","tel","mobile","cell","telephone","phone number"],[u]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function s(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function f(e){const t=s(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);if(["gmail.com","googlemail.com"].includes(r)){const e=t.slice(0,n).replace(/\./g,"");return"".concat(e,"@").concat(r)}return t}function m(e){const t=s(e),n=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(n):n}function y(o){const a=o.filter(e=>e.type===u).map(e=>s(e.value)).filter(Boolean);if(!a.length)return;const c=i(y=1===a.length?a[0].split(" "):a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(y)||r(y)||n(),f=c[0],m=l(c).slice(1);var y;return function(n){for(var r=1;r<arguments.length;r++){var l=null!=arguments[r]?arguments[r]:{};r%2?e(Object(l),!0).forEach(function(e){t(n,e,l[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(l)):e(Object(l)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(l,e))})}return n}({first_name:f},(null==m?void 0:m.length)>0?{last_name:m.join(" ")}:{})}function v(e){var t;return null===(t=e.find(e=>e.type===o))||void 0===t?void 0:t.value}function d(e){var t;return null===(t=e.find(e=>e.type===a))||void 0===t?void 0:t.value}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var b;(b=globalThis.jQuery)&&b(globalThis.document.body).on("wpformsAjaxSubmitSuccess",e=>{var t,l,b;const g=(null===(t=globalThis._googlesitekit)||void 0===t?void 0:t.gtagUserData)?function(e){if(!(e&&e instanceof HTMLFormElement))return;const t=new FormData(e);return function(e){const t=[["address",y(e)],["email",v(e)],["phone_number",d(e)]].filter(e=>{return(t=e,l=2,i(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i,o,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw l}}return a}}(t,l)||r(t,l)||n())[1];var t,l});if(0!==t.length)return Object.fromEntries(t)}(Array.from(t.entries()).map(t=>{var n,r,l,i,y,v;let d=(O=2,function(e){if(Array.isArray(e))return e}(j=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,i,o,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,l=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw l}}return a}}(j,O)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(j,O)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=d[0],g=d[1],h=e.querySelector("[name='".concat(b,"']"));var j,O;"hidden"===(null===(n=h)||void 0===n?void 0:n.type)&&"hidden"!==(null===(r=h)||void 0===r||null===(r=r.previousSibling)||void 0===r?void 0:r.type)&&(h=h.previousSibling);const S=null===(l=h)||void 0===l?void 0:l.type;return"hidden"===S||"submit"===S?null:function(e){let t=e||{},n=t.type,r=t.name,l=t.value,i=t.label;switch(n=s(n),r=s(r),l=s(l),i=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(i),n){case"email":return{type:o,value:f(l)};case"tel":return{type:a,value:m(l)}}return function(e){if(!e)return!1;const t=f(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(l)||c[o].includes(r)||c[o].includes(i)?{type:o,value:f(l)}:c[a].includes(r)||c[a].includes(i)?{type:a,value:m(l)}:c[u].includes(r)||c[u].includes(i)?{type:u,value:s(l)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=m(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),r=e.trim().startsWith("+");return!(!n&&!r)}(l)?{type:a,value:m(l)}:null}({type:S,label:null!==(i=h)&&void 0!==i&&i.id?null===(y=e.querySelector("label[for='".concat(null===(v=h)||void 0===v?void 0:v.id,"']")))||void 0===y?void 0:y.textContent:void 0,name:b,value:g})}).filter(Boolean))}(e.target):null;null===(l=globalThis._googlesitekit)||void 0===l||null===(b=l.gtagEvent)||void 0===b||b.call(l,"submit_lead_form",g?{user_data:g}:void 0)})})();