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                        \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                        \n                        gmp-advanced-marker,\n                        .gmp-advanced-marker {\n                            outline: none !important;\n                            border: none !important;\n                            box-shadow: none !important;\n                        }\n                        \n                        \n                        \n                        \n                        \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";const e="email",t="phone",n="name",l={[e]:["email","e-mail","mail","email address"],[t]:["phone","tel","mobile","cell","telephone","phone number"],[n]:["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 r(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function a(e){const t=r(e),n=t.lastIndexOf("@");if(-1===n)return t;const l=t.slice(n+1);return["gmail.com","googlemail.com"].includes(l)?`${t.slice(0,n).replace(/\./g,"")}@${l}`:t}function i(e){const t=r(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function s(e){const t=e.filter(e=>{let{type:t}=e;return t===n}).map(e=>{let{value:t}=e;return r(t)}).filter(Boolean);if(!t.length)return;const[l,...a]=1===t.length?t[0].split(" "):t;return{first_name:l,...a?.length>0?{last_name:a.join(" ")}:{}}}function u(t){return t.find(t=>{let{type:n}=t;return n===e})?.value}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}globalThis.document.addEventListener("wpcf7mailsent",m=>{const c=globalThis._googlesitekit?.gtagUserData,f=c?function(m){if(!(m&&m instanceof HTMLFormElement))return;const c=new FormData(m);return function(e){const t=[["address",s(e)],["email",u(e)],["phone_number",o(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Array.from(c.entries()).map(s=>{let[u,o]=s;const c=m.querySelector(`[name='${u}']`),f=c?.type;return"hidden"===f||"submit"===f?null:function(s){let{type:u,name:o,value:m,label:c}=s||{};switch(u=r(u),o=r(o),m=r(m),c=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(c),u){case"email":return{type:e,value:a(m)};case"tel":return{type:t,value:i(m)}}return function(e){if(!e)return!1;const t=a(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(m)||l[e].includes(o)||l[e].includes(c)?{type:e,value:a(m)}:l[t].includes(o)||l[t].includes(c)?{type:t,value:i(m)}:l[n].includes(o)||l[n].includes(c)?{type:n,value:r(m)}: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=i(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),l=e.trim().startsWith("+");return!(!n&&!l)}(m)?{type:t,value:i(m)}:null}({type:f,label:c?.id?m.querySelector(`label[for='${c?.id}']`)?.textContent:void 0,name:u,value:o})}).filter(Boolean))}(m.target):null;globalThis._googlesitekit?.gtagEvent?.("contact",{event_category:m.detail.contactFormId,event_label:m.detail.unitTag,...f?{user_data:f}:{}})})})();
(()=>{"use strict";const e="email",t="phone",n="name",r={[e]:["email","e-mail","mail","email address"],[t]:["phone","tel","mobile","cell","telephone","phone number"],[n]:["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 l(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function a(e){const t=l(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);return["gmail.com","googlemail.com"].includes(r)?`${t.slice(0,n).replace(/\./g,"")}@${r}`:t}function i(e){const t=l(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function s(e){const t=e.filter(e=>{let{type:t}=e;return t===n}).map(e=>{let{value:t}=e;return l(t)}).filter(Boolean);if(!t.length)return;const[r,...a]=1===t.length?t[0].split(" "):t;return{first_name:r,...a?.length>0?{last_name:a.join(" ")}:{}}}function u(t){return t.find(t=>{let{type:n}=t;return n===e})?.value}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}var m;(m=globalThis.jQuery)&&m(globalThis.document.body).on("wpformsAjaxSubmitSuccess",m=>{const c=globalThis._googlesitekit?.gtagUserData,f=c?function(m){if(!(m&&m instanceof HTMLFormElement))return;const c=new FormData(m);return function(e){const t=[["address",s(e)],["email",u(e)],["phone_number",o(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Array.from(c.entries()).map(s=>{let[u,o]=s,c=m.querySelector(`[name='${u}']`);"hidden"===c?.type&&"hidden"!==c?.previousSibling?.type&&(c=c.previousSibling);const f=c?.type;return"hidden"===f||"submit"===f?null:function(s){let{type:u,name:o,value:m,label:c}=s||{};switch(u=l(u),o=l(o),m=l(m),c=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(c),u){case"email":return{type:e,value:a(m)};case"tel":return{type:t,value:i(m)}}return function(e){if(!e)return!1;const t=a(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(m)||r[e].includes(o)||r[e].includes(c)?{type:e,value:a(m)}:r[t].includes(o)||r[t].includes(c)?{type:t,value:i(m)}:r[n].includes(o)||r[n].includes(c)?{type:n,value:l(m)}: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=i(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),r=e.trim().startsWith("+");return!(!n&&!r)}(m)?{type:t,value:i(m)}:null}({type:f,label:c?.id?m.querySelector(`label[for='${c?.id}']`)?.textContent:void 0,name:u,value:o})}).filter(Boolean))}(m.target):null;globalThis._googlesitekit?.gtagEvent?.("submit_lead_form",f?{user_data:f}:void 0)})})();
"use strict";var wp;(wp||={}).hooks=(()=>{var v=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var w=(e,n)=>{for(var s in n)v(e,s,{get:n[s],enumerable:!0})},D=(e,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of g(n))!I.call(e,t)&&t!==s&&v(e,t,{get:()=>n[t],enumerable:!(r=S(n,t))||r.enumerable});return e};var T=e=>D(v({},"__esModule",{value:!0}),e);var le={};w(le,{actions:()=>ae,addAction:()=>J,addFilter:()=>K,applyFilters:()=>N,applyFiltersAsync:()=>ee,createHooks:()=>F,currentAction:()=>te,currentFilter:()=>re,defaultHooks:()=>b,didAction:()=>ie,didFilter:()=>se,doAction:()=>X,doActionAsync:()=>Y,doingAction:()=>ne,doingFilter:()=>oe,filters:()=>ce,hasAction:()=>P,hasFilter:()=>Q,removeAction:()=>L,removeAllActions:()=>U,removeAllFilters:()=>W,removeFilter:()=>M});function z(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}var m=z;function E(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}var f=E;function Z(e,n){return function(r,t,a,i=10){let c=e[n];if(!f(r)||!m(t))return;if(typeof a!="function"){console.error("The hook callback must be a function.");return}if(typeof i!="number"){console.error("If specified, the hook priority must be a number.");return}let l={callback:a,priority:i,namespace:t};if(c[r]){let o=c[r].handlers,d;for(d=o.length;d>0&&!(i>=o[d-1].priority);d--);d===o.length?o[d]=l:o.splice(d,0,l),c.__current.forEach(h=>{h.name===r&&h.currentIndex>=d&&h.currentIndex++})}else c[r]={handlers:[l],runs:0};r!=="hookAdded"&&e.doAction("hookAdded",r,t,a,i)}}var H=Z;function C(e,n,s=!1){return function(t,a){let i=e[n];if(!f(t)||!s&&!m(a))return;if(!i[t])return 0;let c=0;if(s)c=i[t].handlers.length,i[t]={runs:i[t].runs,handlers:[]};else{let l=i[t].handlers;for(let o=l.length-1;o>=0;o--)l[o].namespace===a&&(l.splice(o,1),c++,i.__current.forEach(d=>{d.name===t&&d.currentIndex>=o&&d.currentIndex--}))}return t!=="hookRemoved"&&e.doAction("hookRemoved",t,a),c}}var p=C;function O(e,n){return function(r,t){let a=e[n];return typeof t<"u"?r in a&&a[r].handlers.some(i=>i.namespace===t):r in a}}var _=O;function j(e,n,s,r){return function(a,...i){let c=e[n];c[a]||(c[a]={handlers:[],runs:0}),c[a].runs++;let l=c[a].handlers;if(!l||!l.length)return s?i[0]:void 0;let o={name:a,currentIndex:0};async function d(){try{c.__current.add(o);let u=s?i[0]:void 0;for(;o.currentIndex<l.length;)u=await l[o.currentIndex].callback.apply(null,i),s&&(i[0]=u),o.currentIndex++;return s?u:void 0}finally{c.__current.delete(o)}}function h(){try{c.__current.add(o);let u=s?i[0]:void 0;for(;o.currentIndex<l.length;)u=l[o.currentIndex].callback.apply(null,i),s&&(i[0]=u),o.currentIndex++;return s?u:void 0}finally{c.__current.delete(o)}}return(r?d:h)()}}var A=j;function $(e,n){return function(){let r=e[n];return Array.from(r.__current).at(-1)?.name??null}}var y=$;function V(e,n){return function(r){let t=e[n];return typeof r>"u"?t.__current.size>0:Array.from(t.__current).some(a=>a.name===r)}}var k=V;function q(e,n){return function(r){let t=e[n];if(f(r))return t[r]&&t[r].runs?t[r].runs:0}}var x=q;var B=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=H(this,"actions"),this.addFilter=H(this,"filters"),this.removeAction=p(this,"actions"),this.removeFilter=p(this,"filters"),this.hasAction=_(this,"actions"),this.hasFilter=_(this,"filters"),this.removeAllActions=p(this,"actions",!0),this.removeAllFilters=p(this,"filters",!0),this.doAction=A(this,"actions",!1,!1),this.doActionAsync=A(this,"actions",!1,!0),this.applyFilters=A(this,"filters",!0,!1),this.applyFiltersAsync=A(this,"filters",!0,!0),this.currentAction=y(this,"actions"),this.currentFilter=y(this,"filters"),this.doingAction=k(this,"actions"),this.doingFilter=k(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};function G(){return new B}var F=G;var b=F(),{addAction:J,addFilter:K,removeAction:L,removeFilter:M,hasAction:P,hasFilter:Q,removeAllActions:U,removeAllFilters:W,doAction:X,doActionAsync:Y,applyFilters:N,applyFiltersAsync:ee,currentAction:te,currentFilter:re,doingAction:ne,doingFilter:oe,didAction:ie,didFilter:se,actions:ae,filters:ce}=b;return T(le);})();
"use strict";var wp;(wp||={}).i18n=(()=>{var nt=Object.create;var L=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var ft=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),ot=(t,r)=>{for(var e in r)L(t,e,{get:r[e],enumerable:!0})},O=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of it(r))!lt.call(t,u)&&u!==e&&L(t,u,{get:()=>r[u],enumerable:!(n=at(r,u))||n.enumerable});return t};var st=(t,r,e)=>(e=t!=null?nt(ut(t)):{},O(r||!t||!t.__esModule?L(e,"default",{value:t,enumerable:!0}):e,t)),pt=t=>O(L({},"__esModule",{value:!0}),t);var $=ft((It,M)=>{M.exports=window.wp.hooks});var yt={};ot(yt,{__:()=>Z,_n:()=>G,_nx:()=>B,_x:()=>q,createI18n:()=>R,defaultI18n:()=>H,getLocaleData:()=>j,hasTranslation:()=>Q,isRTL:()=>J,resetLocaleData:()=>U,setLocaleData:()=>z,sprintf:()=>P,subscribe:()=>X});var ct=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function T(t,...r){var e=0;return Array.isArray(r[0])&&(r=r[0]),t.replace(ct,function(){var n,u,l,o,f;return n=arguments[3],u=arguments[5],l=arguments[7],o=arguments[9],o==="%"?"%":(l==="*"&&(l=r[e],e++),u===void 0?(n===void 0&&(n=e+1),e++,f=r[n-1]):r[0]&&typeof r[0]=="object"&&r[0].hasOwnProperty(u)&&(f=r[0][u]),o==="f"?f=parseFloat(f)||0:o==="d"&&(f=parseInt(f)||0),l!==void 0&&(o==="f"?f=f.toFixed(l):o==="s"&&(f=f.substr(0,l))),f??"")})}function P(t,...r){return T(t,...r)}var D,I,h,N;D={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};I=["(","?"];h={")":["("],":":["?","?:"]};N=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function b(t){for(var r=[],e=[],n,u,l,o;n=t.match(N);){for(u=n[0],l=t.substr(0,n.index).trim(),l&&r.push(l);o=e.pop();){if(h[u]){if(h[u][0]===o){u=h[u][1]||u;break}}else if(I.indexOf(o)>=0||D[o]<D[u]){e.push(o);break}r.push(o)}h[u]||e.push(u),t=t.substr(n.index+u.length)}return t=t.trim(),t&&r.push(t),r.concat(e.reverse())}var dt={"!":function(t){return!t},"*":function(t,r){return t*r},"/":function(t,r){return t/r},"%":function(t,r){return t%r},"+":function(t,r){return t+r},"-":function(t,r){return t-r},"<":function(t,r){return t<r},"<=":function(t,r){return t<=r},">":function(t,r){return t>r},">=":function(t,r){return t>=r},"==":function(t,r){return t===r},"!=":function(t,r){return t!==r},"&&":function(t,r){return t&&r},"||":function(t,r){return t||r},"?:":function(t,r,e){if(t)throw r;return e}};function g(t,r){var e=[],n,u,l,o,f,_;for(n=0;n<t.length;n++){if(f=t[n],o=dt[f],o){for(u=o.length,l=Array(u);u--;)l[u]=e.pop();try{_=o.apply(null,l)}catch(v){return v}}else r.hasOwnProperty(f)?_=r[f]:_=+f;e.push(_)}return e[0]}function A(t){var r=b(t);return function(e){return g(r,e)}}function E(t){var r=A(t);return function(e){return+r({n:e})}}var S={contextDelimiter:"",onMissingKey:null};function _t(t){var r,e,n;for(r=t.split(";"),e=0;e<r.length;e++)if(n=r[e].trim(),n.indexOf("plural=")===0)return n.substr(7)}function x(t,r){var e;this.data=t,this.pluralForms={},this.options={};for(e in S)this.options[e]=r!==void 0&&e in r?r[e]:S[e]}x.prototype.getPluralForm=function(t,r){var e=this.pluralForms[t],n,u,l;return e||(n=this.data[t][""],l=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof l!="function"&&(u=_t(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),l=E(u)),e=this.pluralForms[t]=l),e(r)};x.prototype.dcnpgettext=function(t,r,e,n,u){var l,o,f;return u===void 0?l=0:l=this.getPluralForm(t,u),o=e,r&&(o=r+this.options.contextDelimiter+e),f=this.data[t][o],f&&f[l]?f[l]:(this.options.onMissingKey&&this.options.onMissingKey(e,t),l===0?e:n)};var K={"":{plural_forms(t){return t===1?0:1}}},vt=/^i18n\.(n?gettext|has_translation)(_|$)/,R=(t,r,e)=>{let n=new x({}),u=new Set,l=()=>{u.forEach(a=>a())},o=a=>(u.add(a),()=>u.delete(a)),f=(a="default")=>n.data[a],_=(a,i="default")=>{n.data[i]={...n.data[i],...a},n.data[i][""]={...K[""],...n.data[i]?.[""]},delete n.pluralForms[i]},v=(a,i)=>{_(a,i),l()},V=(a,i="default")=>{n.data[i]={...n.data[i],...a,"":{...K[""],...n.data[i]?.[""],...a?.[""]}},delete n.pluralForms[i],l()},W=(a,i)=>{n.data={},n.pluralForms={},v(a,i)},m=(a="default",i,s,c,d)=>(n.data[a]||_(void 0,a),n.dcnpgettext(a,i,s,c,d)),y=a=>a||"default",Y=(a,i)=>{let s=m(i,void 0,a);return e?(s=e.applyFilters("i18n.gettext",s,a,i),e.applyFilters("i18n.gettext_"+y(i),s,a,i)):s},w=(a,i,s)=>{let c=m(s,i,a);return e?(c=e.applyFilters("i18n.gettext_with_context",c,a,i,s),e.applyFilters("i18n.gettext_with_context_"+y(s),c,a,i,s)):c},k=(a,i,s,c)=>{let d=m(c,void 0,a,i,s);return e?(d=e.applyFilters("i18n.ngettext",d,a,i,s,c),e.applyFilters("i18n.ngettext_"+y(c),d,a,i,s,c)):d},tt=(a,i,s,c,d)=>{let F=m(d,c,a,i,s);return e?(F=e.applyFilters("i18n.ngettext_with_context",F,a,i,s,c,d),e.applyFilters("i18n.ngettext_with_context_"+y(d),F,a,i,s,c,d)):F},rt=()=>w("ltr","text direction")==="rtl",et=(a,i,s)=>{let c=i?i+""+a:a,d=!!n.data?.[s??"default"]?.[c];return e&&(d=e.applyFilters("i18n.has_translation",d,a,i,s),d=e.applyFilters("i18n.has_translation_"+y(s),d,a,i,s)),d};if(t&&v(t,r),e){let a=i=>{vt.test(i)&&l()};e.addAction("hookAdded","core/i18n",a),e.addAction("hookRemoved","core/i18n",a)}return{getLocaleData:f,setLocaleData:v,addLocaleData:V,resetLocaleData:W,subscribe:o,__:Y,_x:w,_n:k,_nx:tt,isRTL:rt,hasTranslation:et}};var C=st($(),1),p=R(void 0,void 0,C.defaultHooks),H=p,j=p.getLocaleData.bind(p),z=p.setLocaleData.bind(p),U=p.resetLocaleData.bind(p),X=p.subscribe.bind(p),Z=p.__.bind(p),q=p._x.bind(p),G=p._n.bind(p),B=p._nx.bind(p),J=p.isRTL.bind(p),Q=p.hasTranslation.bind(p);return pt(yt);})();
wp.i18n.setLocaleData({ 'text direction\u0004ltr': [ 'ltr' ] });
(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){if(this.formData={},this.tree={},!(t instanceof FormData))return this;this.formData=t;const e=()=>{const t=new Map;return t.largestIndex=0,t.set=function(e,i){""===e?e=t.largestIndex++:/^[0-9]+$/.test(e)&&(e=parseInt(e),t.largestIndex<=e&&(t.largestIndex=e+1)),Map.prototype.set.call(t,e,i)},t};this.tree=e();const i=/^(?<name>[a-z][-a-z0-9_:]*)(?<array>(?:\[(?:[a-z][-a-z0-9_:]*|[0-9]*)\])*)/i;for(const[t,s]of this.formData){const o=t.match(i);if(o)if(""===o.groups.array)this.tree.set(o.groups.name,s);else{const t=[...o.groups.array.matchAll(/\[([a-z][-a-z0-9_:]*|[0-9]*)\]/gi)].map((([t,e])=>e));t.unshift(o.groups.name);const i=t.pop();t.reduce(((t,i)=>{if(/^[0-9]+$/.test(i)&&(i=parseInt(i)),t.get(i)instanceof Map)return t.get(i);const s=e();return t.set(i,s),s}),this.tree).set(i,s)}}}t.r(e),t.d(e,{all:()=>D,any:()=>M,date:()=>m,dayofweek:()=>u,email:()=>r,enum:()=>h,file:()=>d,maxdate:()=>z,maxfilesize:()=>j,maxitems:()=>v,maxlength:()=>x,maxnumber:()=>y,mindate:()=>A,minfilesize:()=>$,minitems:()=>w,minlength:()=>g,minnumber:()=>b,number:()=>c,required:()=>n,requiredfile:()=>a,stepnumber:()=>I,tel:()=>l,time:()=>f,url:()=>p}),i.prototype.entries=function(){return this.tree.entries()},i.prototype.get=function(t){return this.tree.get(t)},i.prototype.getAll=function(t){if(!this.has(t))return[];const e=t=>{const i=[];if(t instanceof Map)for(const[s,o]of t)i.push(...e(o));else""!==t&&i.push(t);return i};return e(this.get(t))},i.prototype.has=function(t){return this.tree.has(t)},i.prototype.keys=function(){return this.tree.keys()},i.prototype.values=function(){return this.tree.values()};const s=i;function o({rule:t,field:e,error:i,...s}){this.rule=t,this.field=e,this.error=i,this.properties=s}const n=function(t){if(0===t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).length)throw new o(this)},a=function(t){if(0===t.getAll(this.field).length)throw new o(this)},r=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{if(t.length<6)return!1;if(-1===t.indexOf("@",1))return!1;if(t.indexOf("@")!==t.lastIndexOf("@"))return!1;const[e,i]=t.split("@",2);if(!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/.test(e))return!1;if(/\.{2,}/.test(i))return!1;if(/(?:^[ \t\n\r\0\x0B.]|[ \t\n\r\0\x0B.]$)/.test(i))return!1;const s=i.split(".");if(s.length<2)return!1;for(const t of s){if(/(?:^[ \t\n\r\0\x0B-]|[ \t\n\r\0\x0B-]$)/.test(t))return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return!0})))throw new o(this)},p=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));if(!e.every((t=>{try{return(t=>-1!==["http","https","ftp","ftps","mailto","news","irc","irc6","ircs","gopher","nntp","feed","telnet","mms","rtsp","sms","svn","tel","fax","xmpp","webcal","urn"].indexOf(t))(new URL(t).protocol.replace(/:$/,""))}catch{return!1}})))throw new o(this)},l=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>(((t=(t=t.replace(/[#*].*$/,"")).replaceAll(/[()/.*#\s-]+/g,"")).startsWith("+")||t.startsWith("00"))&&(t=`+${t.replace(/^[+0]+/,"")}`),!!/^[+]?[0-9]+$/.test(t)&&5<t.length&&t.length<16))))throw new o(this)},c=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!!/^[-]?[0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)||!!/^[-]?(?:[0-9]+)?[.][0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t))))throw new o(this)},m=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{if(!/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t))return!1;const e=new Date(t);return!Number.isNaN(e.valueOf())})))throw new o(this)},f=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{const e=t.match(/^([0-9]{2})\:([0-9]{2})(?:\:([0-9]{2}))?$/);if(!e)return!1;const i=parseInt(e[1]),s=parseInt(e[2]),o=e[3]?parseInt(e[3]):0;return 0<=i&&i<=23&&0<=s&&s<=59&&0<=o&&o<=59})))throw new o(this)},d=function(t){if(!t.getAll(this.field).every((t=>t instanceof File&&this.accept?.some((e=>/^\.[a-z0-9]+$/i.test(e)?t.name.toLowerCase().endsWith(e.toLowerCase()):(t=>{const e=[],i=t.match(/^(?<toplevel>[a-z]+)\/(?<sub>[*]|[a-z0-9.+-]+)$/i);if(i){const t=i.groups.toplevel.toLowerCase(),s=i.groups.sub.toLowerCase();for(const[o,n]of(()=>{const t=new Map;return t.set("jpg|jpeg|jpe","image/jpeg"),t.set("gif","image/gif"),t.set("png","image/png"),t.set("bmp","image/bmp"),t.set("tiff|tif","image/tiff"),t.set("webp","image/webp"),t.set("ico","image/x-icon"),t.set("heic","image/heic"),t.set("asf|asx","video/x-ms-asf"),t.set("wmv","video/x-ms-wmv"),t.set("wmx","video/x-ms-wmx"),t.set("wm","video/x-ms-wm"),t.set("avi","video/avi"),t.set("divx","video/divx"),t.set("flv","video/x-flv"),t.set("mov|qt","video/quicktime"),t.set("mpeg|mpg|mpe","video/mpeg"),t.set("mp4|m4v","video/mp4"),t.set("ogv","video/ogg"),t.set("webm","video/webm"),t.set("mkv","video/x-matroska"),t.set("3gp|3gpp","video/3gpp"),t.set("3g2|3gp2","video/3gpp2"),t.set("txt|asc|c|cc|h|srt","text/plain"),t.set("csv","text/csv"),t.set("tsv","text/tab-separated-values"),t.set("ics","text/calendar"),t.set("rtx","text/richtext"),t.set("css","text/css"),t.set("htm|html","text/html"),t.set("vtt","text/vtt"),t.set("dfxp","application/ttaf+xml"),t.set("mp3|m4a|m4b","audio/mpeg"),t.set("aac","audio/aac"),t.set("ra|ram","audio/x-realaudio"),t.set("wav","audio/wav"),t.set("ogg|oga","audio/ogg"),t.set("flac","audio/flac"),t.set("mid|midi","audio/midi"),t.set("wma","audio/x-ms-wma"),t.set("wax","audio/x-ms-wax"),t.set("mka","audio/x-matroska"),t.set("rtf","application/rtf"),t.set("js","application/javascript"),t.set("pdf","application/pdf"),t.set("swf","application/x-shockwave-flash"),t.set("class","application/java"),t.set("tar","application/x-tar"),t.set("zip","application/zip"),t.set("gz|gzip","application/x-gzip"),t.set("rar","application/rar"),t.set("7z","application/x-7z-compressed"),t.set("exe","application/x-msdownload"),t.set("psd","application/octet-stream"),t.set("xcf","application/octet-stream"),t.set("doc","application/msword"),t.set("pot|pps|ppt","application/vnd.ms-powerpoint"),t.set("wri","application/vnd.ms-write"),t.set("xla|xls|xlt|xlw","application/vnd.ms-excel"),t.set("mdb","application/vnd.ms-access"),t.set("mpp","application/vnd.ms-project"),t.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set("docm","application/vnd.ms-word.document.macroEnabled.12"),t.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),t.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),t.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),t.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),t.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),t.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),t.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),t.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set("potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),t.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),t.set("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12"),t.set("onetoc|onetoc2|onetmp|onepkg","application/onenote"),t.set("oxps","application/oxps"),t.set("xps","application/vnd.ms-xpsdocument"),t.set("odt","application/vnd.oasis.opendocument.text"),t.set("odp","application/vnd.oasis.opendocument.presentation"),t.set("ods","application/vnd.oasis.opendocument.spreadsheet"),t.set("odg","application/vnd.oasis.opendocument.graphics"),t.set("odc","application/vnd.oasis.opendocument.chart"),t.set("odb","application/vnd.oasis.opendocument.database"),t.set("odf","application/vnd.oasis.opendocument.formula"),t.set("wp|wpd","application/wordperfect"),t.set("key","application/vnd.apple.keynote"),t.set("numbers","application/vnd.apple.numbers"),t.set("pages","application/vnd.apple.pages"),t})())("*"===s&&n.startsWith(t+"/")||n===i[0])&&e.push(...o.split("|"))}return e})(e).some((e=>(e="."+e.trim(),t.name.toLowerCase().endsWith(e.toLowerCase())))))))))throw new o(this)},h=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>this.accept?.some((e=>t===String(e))))))throw new o(this)},u=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{const e=0===(i=new Date(t).getDay())?7:i;var i;return this.accept?.some((t=>e===parseInt(t)))})))throw new o(this)},w=function(t){if(t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).length<parseInt(this.threshold))throw new o(this)},v=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));if(parseInt(this.threshold)<e.length)throw new o(this)},g=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),0!==i&&i<parseInt(this.threshold))throw new o(this)},x=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),parseInt(this.threshold)<i)throw new o(this)},b=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(parseFloat(t)<parseFloat(this.threshold)))))throw new o(this)},y=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(parseFloat(this.threshold)<parseFloat(t)))))throw new o(this)},A=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&t<this.threshold))))throw new o(this)},z=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&this.threshold<t))))throw new o(this)},$=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),i<parseInt(this.threshold))throw new o(this)},j=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),parseInt(this.threshold)<i)throw new o(this)},I=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)),i=parseFloat(this.base),s=parseFloat(this.interval);if(!(0<s))return!0;if(!e.every((t=>{const e=(parseFloat(t)-i)%s;return"0.000000"===Math.abs(e).toFixed(6)||"0.000000"===Math.abs(e-s).toFixed(6)})))throw new o(this)},O=({ruleObj:t,options:i})=>{const{rule:s,...o}=t;return"function"==typeof e[s]&&("function"!=typeof e[s].matches||e[s].matches(o,i))},E=({ruleObj:t,formDataTree:i,options:s})=>{const{rule:o}=t;e[o].call(t,i,s)},k=[],F=t=>[...k].reduce(((t,e)=>i=>e(i,t)),t),D=function(t,e={}){const i=(this.rules??[]).filter((t=>O({ruleObj:t,options:e}))),s=F(E);if(!i.every((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;if(void 0!==t.error)throw t;return!1}return!0})))throw new o(this)},M=function(t,e={}){const i=(this.rules??[]).filter((t=>O({ruleObj:t,options:e}))),s=F(E);if(!i.some((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;return!1}return!0})))throw new o(this)};var L;window.swv={validators:e,validate:(t,e,i={})=>{const n=(t.rules??[]).filter((t=>O({ruleObj:t,options:i})));if(!n.length)return new Map;const a=F(E),r=new s(e),p=n.reduce(((t,e)=>{try{a({ruleObj:e,formDataTree:r,options:i})}catch(e){if(!(e instanceof o))throw e;if(void 0!==e.field&&!t.has(e.field)&&void 0!==e.error)return t.set(e.field,e)}return t}),new Map);for(const t of r.keys())p.has(t)||p.set(t,{validInputs:r.getAll(t)});return p},use:t=>{k.push(t)},...null!==(L=window.swv)&&void 0!==L?L:{}}})();
wp.i18n.setLocaleData({ 'text direction\u0004ltr': [ 'ltr' ] });
var wpcf7={
"api": {
"root": "https:\/\/nextspace.co\/wp-json\/",
"namespace": "contact-form-7\/v1"
}};
(()=>{"use strict";const e=window.wp.i18n,t=e=>Math.abs(parseInt(e,10)),a=(e,t,a)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");if(e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t){e.classList.remove(r);const t={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,prevStatus:r};a(e,"statuschanged",t)}return t},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return c.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let n,r,{url:c,path:o,endpoint:s,headers:i,body:l,data:p,...d}=e;"string"==typeof s&&(n=a.replace(/^\/|\/$/g,""),r=s.replace(/^\//,""),o=r?n+"/"+r:n),"string"==typeof o&&(-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),c=t+o),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const f={code:"fetch_error",message:"You are probably offline."},u={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(c||o||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw u}));throw u}))),(()=>{throw f}))}))(e)},c=[];function o(e,t={}){const{target:a,scope:r=e,...c}=t;if(void 0===e.wpcf7?.schema)return;const o={...e.wpcf7.schema};if(void 0!==a){if(!e.contains(a))return;if(!a.closest(".wpcf7-form-control-wrap[data-name]"))return;if(a.closest(".novalidate"))return}const p=r.querySelectorAll(".wpcf7-form-control-wrap"),d=Array.from(p).reduce(((e,t)=>(t.closest(".novalidate")||t.querySelectorAll(":where(input, textarea, select):enabled").forEach((t=>{if(t.name)switch(t.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":t.checked&&e.append(t.name,t.value);break;case"select-multiple":for(const a of t.selectedOptions)e.append(t.name,a.value);break;case"file":for(const a of t.files)e.append(t.name,a);break;default:e.append(t.name,t.value)}})),e)),new FormData),f=e.getAttribute("data-status");Promise.resolve(n(e,"validating")).then((n=>{if(void 0!==swv){const n=swv.validate(o,d,t);for(const t of p){if(void 0===t.dataset.name)continue;const c=t.dataset.name;if(n.has(c)){const{error:t,validInputs:a}=n.get(c);i(e,c),void 0!==t&&s(e,c,t,{scope:r}),l(e,c,null!=a?a:[])}if(t.contains(a))break}}})).finally((()=>{n(e,f)}))}r.use=e=>{c.unshift(e)};const s=(e,t,a,n)=>{const{scope:r=e,...c}=null!=n?n:{},o=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),s=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",o),s&&s.id?t.insertAdjacentHTML("beforeend",`<a href="#${s.id}">${a}</a>`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),r.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{const t=document.createElement("span");t.classList.add("wpcf7-not-valid-tip"),t.setAttribute("aria-hidden","true"),t.insertAdjacentText("beforeend",a),e.appendChild(t),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",o),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{t.setAttribute("style","display: none")})),t.addEventListener("click",(e=>{t.setAttribute("style","display: none")})))}))}))},i=(e,t)=>{const a=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${a}`)?.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{e.querySelector(".wpcf7-not-valid-tip")?.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))},l=(e,t,a)=>{e.querySelectorAll(`[data-reflection-of="${t}"]`).forEach((e=>{if("output"===e.tagName.toLowerCase()){const t=e;0===a.length&&a.push(t.dataset.default),a.slice(0,1).forEach((e=>{e instanceof File&&(e=e.name),t.textContent=e}))}else e.querySelectorAll("output").forEach((e=>{e.hasAttribute("data-default")?0===a.length?e.removeAttribute("hidden"):e.setAttribute("hidden","hidden"):e.remove()})),a.forEach((a=>{a instanceof File&&(a=a.name);const n=document.createElement("output");n.setAttribute("name",t),n.textContent=a,e.appendChild(n)}))}))};function p(e,t={}){if(wpcf7.blocked)return d(e),void n(e,"submitting");const c=new FormData(e);t.submitter&&t.submitter.name&&c.append(t.submitter.name,t.submitter.value);const o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(c,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:c};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:c,wpcf7:{endpoint:"feedback",form:e,detail:o}}).then((t=>{const r=n(e,t.status);return o.status=t.status,o.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(r)?a(e,r,o):["sent","failed"].includes(r)&&a(e,`mail${r}`,o),a(e,"submit",o),t})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{s(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:r}=e.wpcf7;d(t),a(t,"beforesubmit",r),n(t,"submitting")}return t(e)}));const d=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&i(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function f(e){const t=new FormData(e),c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:t};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:c}}).then((t=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,n(e,"mail_sent")):n(e,"init"),c.apiResponse=t,a(e,"reset",c)})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:t,detail:a}=e.wpcf7;d(t),n(t,"resetting")}return t(e)}));const u=(e,t)=>{for(const a in t){const n=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",n)}));const r=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);r&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=r[1]}))}},m=(e,t)=>{for(const a in t){const n=t[a][0],r=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=r}))}};function w(e){const a=new FormData(e);e.wpcf7={id:t(a.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:t(a.get("_wpcf7_container_post")),parent:e.closest(".wpcf7"),get schema(){return wpcf7.schemas.get(this.id)}},wpcf7.schemas.set(e.wpcf7.id,void 0),e.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(e),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!n.checked,e.addEventListener("change",(e=>{a.disabled=!n.checked,e.target===n&&n.checked&&a.focus()}))}))})(e),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(e),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(e),(e=>{const a=(e,a)=>{const n=t(e.getAttribute("data-starting-value")),r=t(e.getAttribute("data-maximum-value")),c=t(e.getAttribute("data-minimum-value")),o=e.classList.contains("down")?n-a.value.trim().length:a.value.trim().length;e.setAttribute("data-current-value",o),e.innerText=o,r&&r<a.value.length?e.classList.add("too-long"):e.classList.remove("too-long"),c&&a.value.length<c?e.classList.add("too-short"):e.classList.remove("too-short")},n=t=>{t={init:!1,...t},e.querySelectorAll(".wpcf7-character-count").forEach((n=>{const r=n.getAttribute("data-target-name"),c=e.querySelector(`[name="${r}"]`);c&&(c.value=c.defaultValue,a(n,c),t.init&&c.addEventListener("keyup",(e=>{a(n,c)})))}))};n({init:!0}),e.addEventListener("wpcf7reset",(e=>{n()}))})(e),window.addEventListener("load",(t=>{wpcf7.cached&&e.reset()})),e.addEventListener("reset",(t=>{wpcf7.reset(e)})),e.addEventListener("submit",(t=>{wpcf7.submit(e,{submitter:t.submitter}),t.preventDefault()})),e.addEventListener("wpcf7submit",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("wpcf7reset",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("change",(t=>{t.target.closest(".wpcf7-form-control")&&wpcf7.validate(e,{target:t.target})})),e.addEventListener("wpcf7statuschanged",(t=>{const a=t.detail.status;e.querySelectorAll(".active-on-any").forEach((e=>{e.removeAttribute("inert"),e.classList.remove("active-on-any")})),e.querySelectorAll(`.inert-on-${a}`).forEach((e=>{e.setAttribute("inert","inert"),e.classList.add("active-on-any")}))}))}document.addEventListener("DOMContentLoaded",(t=>{var a;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)if("function"==typeof window.fetch)if("function"==typeof window.FormData)if("function"==typeof NodeList.prototype.forEach)if("function"==typeof String.prototype.replaceAll){wpcf7={init:w,submit:p,reset:f,validate:o,schemas:new Map,...null!==(a=wpcf7)&&void 0!==a?a:{}},document.querySelectorAll("form .wpcf7[data-wpcf7-id]").forEach((t=>{const a=document.createElement("p");a.setAttribute("class","wpcf7-form-in-wrong-place");const n=document.createElement("strong");n.append((0,e.__)("Error:","contact-form-7"));const r=(0,e.__)("This contact form is placed in the wrong place.","contact-form-7");a.append(n," ",r),t.replaceWith(a)})),document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e),e.closest(".wpcf7").classList.replace("no-js","js")}));for(const e of wpcf7.schemas.keys())r({endpoint:`contact-forms/${e}/feedback/schema`,method:"GET"}).then((t=>{wpcf7.schemas.set(e,t)}))}else console.error("Your browser does not support String.replaceAll().");else console.error("Your browser does not support NodeList.forEach().");else console.error("Your browser does not support window.FormData().");else console.error("Your browser does not support window.fetch().");else console.error("wpcf7.api is not defined.");else console.error("wpcf7 is not defined.")}))})();
var wpcf7={
"api": {
"root": "https:\/\/nextspace.co\/wp-json\/",
"namespace": "contact-form-7\/v1"
}};
var ccs2t,cchddt,cf7sgCustomSelect2Templates=ccs2t=cf7sgCustomSelect2Templates||{},cf7sgCustomHybridddTemplates=cchddt=cf7sgCustomHybridddTemplates||{};!function(t){"use strict";var e=[],a=[],i={};t.fn.cf7sgWarning=function(e,a){var i=t(this);if(!i.is(":input"))return i;n(a)&&(a=0);var s=t('<span class="cf7sg-validation-warning">'+e+'<span class="confirm-button">ok</span></span>');i.after(s),a>0&&s.delay(a).fadeOut("slow",function(){i.remove()})},t(document).ready(function(){t("form.wpcf7-form").on("click",".confirm-button",function(e){var a=t(e.target);a.is(".cf7sg-validation-warning .confirm-button")&&a.parent().remove()}).each(function(){var e=t(this),a=e.closest("div.cf7-smart-grid").attr("id");e.attr("id","wpcf7-"+a)});var e=t("div.cf7-smart-grid.has-table form.wpcf7-form");e.length&&(t(".container.cf7-sg-table",e).each(function(){var a=t(this),i=a.closest("div.cf7-smart-grid").attr("id"),s=[],n=t(".row.cf7-sg-table",a),l="Add Row",c=a.next(".container.cf7-sg-table-footer");if(a[0].hasAttribute("id")){var o=t('<input class="cf7sg-tracker-field" value="1" type="hidden">').attr("name",a.attr("id"));a.prepend(o)}switch(!0){case a[0].hasAttribute("data-button"):l=a.data("button");break;case n[0].hasAttribute("data-button"):l=n.data("button")}for(let d in n.find(":input").each(function(){let e=t(this),a=e.attr("name").replace("[]","");!(a.length>0)||(e.addClass("cf7sg-"+a+" cf7sgrow-field"),r(cf7sg[i],["prefill",a])||e.is(".cf7-sg-tabs-panel :input")||(s[a]=cf7sg[i].prefill[a],delete cf7sg[i].prefill[a]))}),c.length>0?(c.detach(),a.after(c),c.after('<div class="cf7-sg-table-button"><a href="javascript:void(0);" class="ui-button">'+l+"</a></div>")):a.after('<div class="cf7-sg-table-button"><a href="javascript:void(0);" class="ui-button">'+l+"</a></div>"),n.attr("data-row","0"),(n=n.clone().addClass("cf7-sg-cloned-table-row")).attr("data-row","-1"),a.append(n.hide()),t(":input",n).each(function(){var e=t(this).prop("disabled",!0),a="_cf7sgcloned_"+e.attr("name");e.attr("name",a)}),n.append('<span class="row-control"><span class="dashicons dashicons-no-alt"></span></span>'),e.on("cf7SmartGridReady",function(t){a.trigger({type:"sgTableReady","table-id":a.attr("id")})}),s){if("[object Object]"!==String(s[d])){cf7sg.debug&&console.log(`ERROR: Prefill table field ${d} value should be array`);return}let f=0,g="";for(let p in s[d])g=f>0?`${d}_row-${f}`:d,a.children(".row.cf7-sg-table").not(".cf7-sg-cloned-table-row").length<f+1&&a.cf7sgCloneRow(!1,null),t(`:input[name=${g}]`,a).prefillCF7Field(s[d][p],i),f++}}),e.click(".container",function(e){var a=t(e.target);if(a.is("div.cf7-sg-table-button a")){if((a=a.parent()).hasClass("disabled"))return;var i=a.prev(".container");i.is(".cf7-sg-table-footer")&&(i=i.prev(".container")),i.cf7sgCloneRow(!0,e.target)}else a.is(".cf7-sg-table .row-control .dashicons")&&a.closest(".container").cf7sgRemoveRow()})),(e=t("div.cf7-smart-grid.has-validation form.wpcf7-form")).length&&(t('input[type="number"][class*="sgv-"]',e).each(function(){var e=t(this),a=e.attr("name"),i=e.closest("div.cf7-smart-grid").attr("id"),s=e.attr("value");r(cf7sg[i],["prefill",a])||(e.prefillCF7Field(cf7sg[i].prefill[a],i),s=cf7sg[i].prefill[a],delete cf7sg[i].prefill[a]),e.data("current",s)}),e.change('input[type="number"]',function(e){if(t(e.target).is('input[type="number"]')){var a=t(e.target),i=a.data("current"),s=!1;switch(!0){case 0==a.val()&&a.is(".sgv-no-zero"):a.after('<span class="cf7sg-validation-warning">Value cannot be zero</span>'),a.val(i),s=!0;break;case 0>a.val()&&a.is(".sgv-no-negative"):a.after('<span class="cf7sg-validation-warning">Value cannot be negative</span>'),a.val(i),s=!0;break;case""==a.val()&&a.hasClass("sgv-not-empty"):a.after('<span class="cf7sg-validation-warning">Value cannot be empty</span>'),a.val(i),s=!0}s&&a.next("span.cf7sg-validation-warning").delay(3e3).fadeOut("slow").remove()}}));var e=t("div.cf7-smart-grid.has-accordion form.wpcf7-form");e.length>0&&(e.filter("div.has-toggles form.wpcf7-form").each(function(){var e=t(this),a=t(".cf7sg-collapsible.with-toggle",e),i="",s=t('input[name="_cf7sg_toggles"]',e),n=!1,c={};s.length>0&&(i=s.val().length>0?JSON.parse(s.val()):{},n=!0),t.fn.trackToggle=function(e){if(!n)return!1;var a=t(this),r=a.attr("id");if(!a.is(".with-toggle"))return!1;if(e){var l=t(".cf7sg-collapsible-title",a).clone(),c=l.children(".toggle").data("on");l.children(".toggle").remove(),i[r]=l.text().trim()+"|"+c}else i.hasOwnProperty(r)&&delete i[r];void 0!==r&&s.length>0&&s.val(JSON.stringify(i))},e.on("click",".cf7sg-collapsible.with-toggle",function(a){var i,s=t(a.target);if(s.is("span.cf7sg-title.toggled")||s.is(".toggle-on")||s.is(".toggle-off")||s.is(".toggle"))i=s.closest(".cf7sg-collapsible-title");else{if(!s.parent().is(".cf7sg-collapsible.with-toggle"))return;i=s}if(t(".toggle",i).is(".disabled"))return!1;var r=i.closest(".container.cf7sg-collapsible"),n=r.attr("id"),l=i.parent().removeClass("collapsed").data("group");l&&t('.cf7sg-collapsible.with-toggle[data-group="'+l+'"]',e).each(function(){var e=t(this),a=t(".toggle",e);if(n===e.attr("id")){c[l]&&a.toggleClass("disabled",!0);return}0===e.accordion("option","active")&&(e.addClass("collapsed"),a.toggleClass("disabled",!1).data("toggles").toggle(!1),e.accordion("option","active",!1),t(".row.ui-accordion-content :input",e).prop("disabled",!0),e.trackToggle(!1))});var o=i.children(".toggle").data("toggles");if(void 0===o&&cf7sg.debug&&(console.log("undefined toggleSwitch, header parent:"),console.log(i),console.log("e.target:"),console.log(a.target)),i.hasClass("ui-state-active")){o.toggle(!0);var d=t(".row.ui-accordion-content :input",i.parent()).not(".cf7-sg-cloned-table-row :input").not(".collapsed :input").prop("disabled",!1);e.is(".has-nice-select form")&&d.filter(".wpcf7-form-control.nice-select:enabled").niceSelect(),r.trackToggle(!0)}else o.toggle(!1),t(".row.ui-accordion-content :input",i.parent()).each(function(){var e=this.value;t(this).val(e.trim()).prop("disabled",!0)}),r.trackToggle(!1)}),a.each(function(){var a=t(this),i=a.attr("id");void 0===i&&(i=l(6),a.attr("id",i));var s=a.data("open"),n=a.data("group"),o=!1;n&&void 0===c[n]&&(c[n]=!1),void 0===s?s=!1:!0===s&&(s=0,o=!0);var d=0==e.closest("div.cf7_2_post").length&&!o,f=a.closest("div.cf7-smart-grid").attr("id");t(":input",a.children(".row")).each(function(){var e=t(this),a=e.attr("name").replace("[]","");r(cf7sg[f],["prefill","_cf7sg_toggles",i])||(e.prefillCF7Field(cf7sg[f].prefill[a],f),s=0,o=!0,delete cf7sg[f].prefill[a]),d&&e.prop("disabled",!0)}),o||a.addClass("collapsed"),a.children(".cf7sg-collapsible-title").children(".toggle").setupToggle(o,n),o&&(a.trackToggle(!0),n&&(c[n]=!0)),t("#"+i).accordion({collapsible:!0,icons:!1,active:s,header:"> div.cf7sg-collapsible-title",heightStyle:"content",activate:function(e,a){t(this).trigger("sgContentIncrease")},beforeActivate:function(e,a){if(t(".toggle",a.oldHeader).is(".disabled"))return!1},create:function(e){t(this).trigger({type:"sgCollapsibleRowsReady","section-id":i})}})}),a.on("sgContentIncrease",function(){t(this).accordion("refresh")})}),e.each(function(){var e=t(this),a=t(".cf7sg-collapsible",e).not(".cf7sg-collapsible.with-toggle").not(".cf7sg-accordion-rows > .cf7sg-collapsible").not(".cf7sg-slider-section >.cf7sg-collapsible");(a=a.add(t(".cf7sg-accordion-rows",e))).each(function(){var e=t(this),a=e.attr("id");void 0===a&&(a=l(6),e.attr("id",a));var i=e.data("open"),s=!1;void 0===i?i=!1:!0===i&&(i=0,s=!0);var r={heightStyle:"content",create:function(e){t(this).trigger({type:"sgCollapsibleRowsReady","section-id":a})}};e.is(".cf7sg-accordion-rows")?(e.children(".cf7sg-collapsible").children(".cf7sg-collapsible-title").addClass("accordion"),Object.assign(r,{header:"div.cf7sg-collapsible-title.accordion",animate:!1})):Object.assign(r,{collapsible:!0,active:i,header:"> div.cf7sg-collapsible-title",activate:function(e,a){t(this).trigger("sgContentIncrease")}}),t("#"+a).accordion(r),e.on("sgContentIncrease",function(){t(this).accordion("refresh")})})})),(e=t("div.cf7-smart-grid.has-tabs form.wpcf7-form")).length&&(i={},e.click("ul.ui-tabs-nav li",function(e){var a=t(e.target),i=a.closest(".cf7-sg-tabs");a.is(".cf7sg-close-tab")?i.cf7sgRemoveTab():a.is(".cf7sg-add-tab")&&i.cf7sgCloneTab(!0,!0)}),t(".cf7-sg-tabs",e).each(function(){var e=t(this),a=e.closest("div.cf7-smart-grid").attr("id"),s=e.children(".cf7-sg-tabs-list"),n=[],l=[];if(1==s.children("li").length){s.after('<ul class="cf7sg-add-tab ui-tabs-nav"><li class="ui-state-default ui-corner-top"><a class="cf7sg-add-tab ui-tabs-anchor"><span class="cf7sg-add-tab dashicons dashicons-plus"></span></a></li></ul>');var c=e.children(".cf7-sg-tabs-panel").first(),o=t('<input class="cf7sg-tracker-field" value="1" type="hidden">').attr("name",c.attr("id"));e.prepend(o),c.find(":input").each(function(){var e=t(this),i=e.attr("name").replace("[]",""),s=!1;r(cf7sg[a],["prefill",i])||(s=!0),e.is(".cf7-sg-table :input")?(e.addClass("cf7sgtab-field"),s&&(l[i]=cf7sg[a].prefill[i],delete cf7sg[a].prefill[i])):i.length>0&&(e.addClass("cf7sg-"+i+" cf7sgtab-field"),s&&(n[i]=cf7sg[a].prefill[i],delete cf7sg[a].prefill[i]))});var d=t("<div>").append(c.clone());t(":input",d).prop("disabled",!0),i[c.attr("id")]=d.html()}e.tabs({create:function(e){let i=t(this),r="",c=0,o=0;for(let d in n){if("[object Object]"!==String(n[d])){cf7sg.debug&&console.log(`ERROR: Prefill tab field ${d} value should be array`);return}for(let f in c=0,n[d])r=c>0?`${d}_tab-${c}`:d,s.children("li").length<c+1&&i.cf7sgCloneTab(!0,!1),t(`:input[name=${r}]`).prefillCF7Field(n[d][f],a),c++}for(let g in l){if("[object Object]"!==String(l[g])){cf7sg.debug&&console.log(`ERROR: Prefill tabbed table field ${g} value should be 2D array`);return}let p=null;for(let u in c=0,l[g]){if("[object Object]"!==String(l[g][u])){cf7sg.debug&&console.log(`ERROR: Prefill tabbed table field ${g} value should be 2D array`);return}for(let h in r=c>0?`${g}_tab-${c}`:g,s.children("li").length<c+1&&(i=i.cf7sgCloneTab(!0,!1)),p=t(`:input[name=${r}]`,i).closest(".container.cf7-sg-table"),o=0,l[g][u])r=o>0?`${r}_row-${o}`:r,p.children(".row.cf7-sg-table").not(".cf7-sg-cloned-table-row").length<o+1&&p.cf7sgCloneRow(!1,null),t(`:input[name=${r}]`,p).prefillCF7Field(l[g][u][h],a),o++;c++}}i.trigger("sgTabsReady")}})})),t("div.cf7-smart-grid").each(function(){var e=t(this),a=e.attr("id");r(cf7sg[a],["prefill"])||Object.keys(cf7sg[a].prefill).forEach(function(i){var s=t('[data-name="'+i+'"] :input',e);0==s.length&&(s=t(':input[name="'+i+'"]',e)),s.prefillCF7Field(cf7sg[a].prefill[i],a)})}),(e=t("div.cf7-smart-grid.has-nice-select form.wpcf7-form")).length>0&&(e.filter("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this),a=e.closest("div.cf7_2_post").attr("id");a.length>0&&e.on(a,function(e){t(".cf7sg-dynamic-dropdown.ui-select:enabled",$this).each(function(){t(this).niceSelect()}),t(".wpcf7-form-control.nice-select:enabled",$this).each(function(){t(this).niceSelect()}),t(this).trigger("sgNiceSelect")})}),e.not("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this);t(".cf7sg-dynamic-dropdown.ui-select:enabled",e).each(function(){t(this).niceSelect()}),t(".wpcf7-form-control.nice-select:enabled",e).each(function(){t(this).niceSelect()}),e.on("cf7SmartGridReady",function(t){e.trigger("sgNiceSelect")})})),(e=t("div.cf7-smart-grid.has-select2 form.wpcf7-form")).length>0&&(e.filter("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this),a=e.closest("div.cf7_2_post").attr("id");a.length>0&&e.on(a,function(e){var a=t(this);t("select.wpcf7-form-control.select2:enabled",a).each(function(){var e=t(this);e.select2(e.cf7sgSelect2Options())}),a.trigger("sgSelect2")})}),e.not("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this);t("select.wpcf7-form-control.select2:enabled",e).each(function(){var e=t(this);e.select2(e.cf7sgSelect2Options())}),e.on("cf7SmartGridReady",function(t){e.trigger("sgSelect2")})})),(e=t("div.cf7-smart-grid.has-hybriddd form.wpcf7-form")).length>0&&(e.filter("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this),a=e.closest("div.cf7_2_post").attr("id");a.length>0&&e.on(a,function(a){t(".cf7sg-dynamic_checkbox",e).each(function(){new HybridDropdown(this,t(this).cf7sgHybridddOptions())})})}),e.not("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this);t(".cf7sg-dynamic_checkbox",e).each(function(){new HybridDropdown(this,t(this).cf7sgHybridddOptions())})}));var a=document.createElement("input");a.setAttribute("type","date");var s="date"==a.type;function l(t){t||(t=5);for(var e="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",i=0;i<t;i++)e+=a.charAt(Math.floor(Math.random()*a.length));return e}(e=t("div.cf7-smart-grid.has-date form.wpcf7-form")).length>0&&(e.filter("div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this),a=e.closest("div.cf7_2_post").attr("id");a.length>0&&e.on(a,function(e){t("input.wpcf7-date:enabled",t(this)).each(function(){var e=t(this),a=e.attr("id");void 0===a&&(a=l(6),e.attr("id",a)),s||e.setupDatePicker()}),t("input.wpcf7-text.datepicker:enabled",t(this)).each(function(){var e=t(this),a=e.attr("id");void 0===a&&(a=l(6),e.attr("id",a)),e.setupDatePicker()})})}),e.not("div.cf7_2_post form.wpcf7-form").each(function(){t("input.wpcf7-text.datepicker:enabled",t(this)).each(function(){var e=t(this),a=e.attr("id");void 0===a&&(a=l(6),e.attr("id",a)),e.setupDatePicker()}),t("input.wpcf7-date:enabled",t(this)).each(function(){var e=t(this),a=e.attr("id");void 0===a&&(a=l(6),e.attr("id",a)),s||e.setupDatePicker()})})),(e=t("div.cf7-smart-grid.has-slider form.wpcf7-form")).each(function(){var e=t(this).closest(".cf7-smart-grid").attr("id");t(".cf7sg-slider-section").each(function(){var a,i=t(this).wrapInner('<div class="glider"></div>'),s=t(".glider",i),r=i.closest(".container").next(".cf7sg-slider-controls"),n=t('<span class="slider-control slider-prev"></span>'),l=t('<span class="slider-control slider-next"></span>'),c=!1,o=null,d={arrows:{prev:".slider-prev",next:".slider-next"}};if(r.length>0){n=t(".slider-prev",r),l=t(".slider-next",r);let f=document.createElement("style");f.setAttribute("id",e+"-slider-controls"),f.type="text/css",f.innerText="#"+e+" .cf7sg-slider-controls > .cf7sg-submit-controls {max-width: calc(100% - "+(n.outerWidth()+10)+"px)}",document.head.appendChild(f),(o=t(".cf7sg-submit-controls",r)).length>0&&(c=!0,o.hide())}else if(void 0!==i.data("prev")&&(i.data("prev").length>0?n.text(i.data("prev")).addClass("ui-button"):n.addClass("dashicons dashicons-arrow-left-alt")),void 0!==i.data("next")&&(i.data("next").length>0?l.text(i.data("next")).addClass("ui-button"):l.addClass("dashicons dashicons-arrow-right-alt")),i.append(n).append(l),i.data("submit").length>0){c=!0,o=t('<span><input type="submit" value="'+i.data("submit")+'" class="slider-control wpcf7-form-control wpcf7-submit"></span>'),l.after(o);let g=(o.outerHeight()-16)/2;o.hide().append('<span style="margin:'+g+'px 5px;" class="ajax-loader"></span>')}if(n.hide(),i.data("dots")){n.before('<span class="slider-dots"></span>'),d.dots=".slider-dots";let p=i.data("dots");!0!==p&&(d.labelDots=p.split(","));let u=t("form.wpcf7-form input[type=submit]:not(.cf7_2_post_save)").get(0);if(u){u=window.getComputedStyle(u);let h=document.createElement("style");h.setAttribute("id","cf7sg-slider-dots"),h.type="text/css",h.innerText=".glider-dot:hover, .glider-dot:focus, .glider-dot.active{background:"+u["background-color"]+";color:"+u.color+"}",document.body.appendChild(h)}}s.on("glider-loaded",function(t){i.trigger({type:"sgSliderReady",total:s.find(".glider-slide").length})}).on("glider-slide-visible",function(s){let r=!0;switch(n.show(),l.show(),c&&o.hide(),s.detail.slide){case 0:n.hide(),r=!1;break;case a.slides.length-1:l.hide(),c&&o.show()}r&&cf7sg[e].slider_auto_scroll&&t(window).scrollTop(i.offset().top-35),t(s.target).find(".glider-slide.active").trigger({type:"sgSlideChange",current:s.detail.slide,last:t(s.target).find(".glider-slide").length-1})}),a=new Glider(s[0],d),i.on("sgRowAdded sgRowDeleted",function(t){a.refresh(!0)})})}),t.fn.sgCurrentSlide=function(){var e=t(this);return!!e.is(".cf7sg-slider-section")&&parseInt(e.find(".glider-slide.active").data("gslide"))},t.fn.sgChangeSlide=function(e){var a=t(this);if(!a.is(".cf7sg-slider-section"))return a;var i=Glider(t(".glider",a)[0]),s=a.sgCurrentSlide();return n(e)?s<i.slides.length&&i.scrollItem(s+1):e<0?s>0&&i.scrollItem(s-1):(e=parseInt(e))>=0&&e<=i.slides.length&&i.scrollItem(e),a},t("div.cf7-smart-grid.has-toggles div.cf7_2_post form.wpcf7-form").each(function(){var e=t(this),a=e.closest("div.cf7-smart-grid").attr("id"),i=e.closest("div.cf7_2_post").attr("id");i.length>0&&e.on(i,function(e){t(".cf7sg-collapsible.with-toggle",t(this)).each(function(){var e=t(this),i=e.attr("id");r(cf7sg[a],["toggles",i])?t(".row.ui-accordion-content :input",e).prop("disabled",!0):e.children(".cf7sg-collapsible-title").trigger("click")})})}),t("div.cf7-smart-grid form.wpcf7-form").addClass("cf7sg-ready").trigger("cf7SmartGridReady"),t("div.cf7-smart-grid").on("wpcf7:invalid wpcf7invalid wpcf7mailsent",".wpcf7",function(e){var a,i=t(e.target);switch(e.type){case"wpcf7mailsent":if(!n(cf7sg[e.delegateTarget.id])&&cf7sg[e.delegateTarget.id].redirect.length>0){var s=t(".cf7_2_post_draft",i);(0==s.length||"false"===s.val())&&window.location.replace(cf7sg[e.delegateTarget.id].redirect)}break;case"wpcf7invalid":case"wpcf7:invalid":if(void 0!==(a=e.detail).apiResponse)for(var r in a=a.apiResponse.invalid_fields){for(var l=t(a[r].into),c=l.parents(".cf7sg-collapsible:not(.glider-slide)"),o=0;o<c.length;o++)t(c[o]).attr("data-cf7sg","error"),t(c[o]).is(".cf7sg-accordion-rows .cf7sg-collapsible")?t(c[o]).closest(".cf7sg-accordion-rows").accordion("option","active",o):c.accordion("option","active",0);if((c=l.closest(".cf7-sg-tabs-panel")).length>0){for(var d=c.attr("id"),f=t(".cf7-sg-tabs-list",c=c.closest(".cf7-sg-tabs")).children(),g=0;g<f.length;g++)if(d==t(f[g]).attr("aria-controls")){t(f[g]).attr("data-cf7sg","error"),c.tabs("option","active",g);break}}if((c=l.closest(".cf7sg-slider-section")).length>0){var p=l.closest(".glider-slide");p.attr("data-cf7sg","error"),Glider(t(".glider",c)[0]).scrollItem(p.data("gslide")),c.data("dots")&&t('.slider-dots button[data-index="'+p.data("gslide")+'"]',c).attr("data-cf7sg","error")}}}}).submit(function(e){var a=t(e.target);t('.cf7-sg-tabs-list li[data-cf7sg="error"]',a).attr("data-cf7sg",""),t('.cf7sg-collapsible[data-cf7sg="error"]',a).attr("data-cf7sg",""),t('.slider-dots button[data-cf7sg="error"]',a).attr("data-cf7sg","")}),t("select.select2").closest("form").on("reset",function(e){t("select.select2",t(this)).val(null).trigger("change")}),t("div.cf7-smart-grid.has-grid .wpcf7-submit").each(function(){var e=t(this),a=e.closest("div.cf7-smart-grid").attr("id");void 0!==cf7sg[a].submit_disabled&&e.after('<span class="cf7sg-popup display-none">'+cf7sg[a].submit_disabled+"</span>").parent().addClass("cf7sg-popup-box")}),t("div.cf7-smart-grid.has-table").on("sgRowAdded",".container.cf7-sg-table",function(e){var a,i,s=t(this),r=s.closest("div.cf7-smart-grid").attr("id");if(void 0!==(a=s.data("max"))&&!1!=a&&--a==e.row){var i=s.data("max-row-msg");i='<span class="max-limit wpcf7-not-valid-tip">'+(i=n(i)?cf7sg[r].max_table_rows:i)+"</span>",s.siblings(".cf7-sg-table-button").addClass("disabled").prepend(i)}}),t("div.cf7-smart-grid.has-table").on("sgRowDeleted",".container.cf7-sg-table",function(e){var a,i=t(this);void 0!==(a=i.data("max"))&&!1!=a&&i.siblings(".cf7-sg-table-button").removeClass("disabled").children(".max-limit").remove()}),t("form.wpcf7-form").each(function(){let t=this;t.querySelectorAll(".wpcf7-response-output").forEach(t=>{t.classList.remove("wpcf7-response-output"),t.classList.add("cf7sg-response-output"),t.innerHTML='<div class="wpcf7-response-output"></div>'}),this.addEventListener("wpcf7submit",function(e){e.detail.apiResponse&&e.detail.apiResponse.message&&t.querySelectorAll(".cf7sg-response-output").forEach(t=>{let a=e.detail.apiResponse.message;if(void 0!==e.detail.apiResponse.cf7sgResponse){if(void 0!==(a=e.detail.apiResponse.cf7sgResponse).redirect)return location=a.redirect,!1;void 0!==a[e.detail.apiResponse.status]&&(a=a[e.detail.apiResponse.status])}else a=e.detail.apiResponse.message;t.innerHTML=`${a}<div class="wpcf7-response-output"></div>`})})})});var s=function(e){if(!e.id)return e.text;var a=t(e.element);return t('<a href="'+a.data("permalink")+'">'+e.text+"</a>")};function r(t,e){if(n(e)&&(e=[]),n(t))return!0;for(var a=t,i=0;i<e.length;i++){if(n(a[e[i]]))return!0;a=a[e[i]]}return!1}function n(t){return null==t||("number"==typeof t?isNaN(t):!Boolean(t))}t.fn.prefillCF7Field=function(e,a){var i=t(this);if(!i.is(":input"))return!1;t(this);var s=i.attr("name"),r=i[0],l=r.type;if(n(r))return cf7sg.debug&&console.log("CF7SG ERROR: Unable to retrieve form element "+s),i;switch(i.length>0&&(l=i[0].type),l){case"select-multiple":case"select":Array.isArray(e)||(e=[e]),e.forEach(function(t){r.querySelector('option[value="'+t+'"]').selected=!0});break;case"checkbox":case"radio":r=r.closest(".wpcf7-form-control-wrap"),Array.isArray(e)||(e=[e]),e.forEach(function(t){r.querySelector('input[value="'+t+'"]').checked=!0});break;default:r.value=e}return i},t.fn.cf7sgSelect2Options=function(){var e=t(this),a={tags:e.is(".tags")},i=e.attr("name").replace("[]","");return e.is(".cf7sg-permalinks")&&(a.templateSelection=s,a.templateResult=s),cf7sgCustomSelect2Templates[i]&&(a=Object.assign(a,cf7sgCustomSelect2Templates[i])),a},t.fn.cf7sgHybridddOptions=function(t={}){if(!this.is(".cf7sg-dynamic_checkbox"))return!1;let e=this.closest("div.cf7-smart-grid").attr("id"),a={},i=this.data("field-name");return this.is(".cf7sg-hybriddd")?a.optionLabel=function(t){let e="",a="";if(Array.isArray(t)){e=t[0];for(let i=1;i<t.length;i++)a+=` ${t[i]}`}else e=t;return`<span${a}>${e}</span>`}:this.is(".cf7sg-imagehdd")&&(a.optionLabel=function(t){let e="",a="",i="";if(Array.isArray(t)){e=t[0];for(let s=1;s<t.length;s++)t[s].indexOf("data-thumbnail")>-1?i=t[s].replace("data-thumbnail","src"):a+=` ${t[s]}`}return`<div${a}><img ${i} alt="${e}" /><p>${e}</p></div>`}),cf7sgCustomHybridddTemplates[i]&&(a=Object.assign(a,cf7sgCustomHybridddTemplates[i])),r(cf7sg[e],["prefill",i])||("object"==typeof cf7sg[e].prefill[i]?a.selectedValues=Object.values(cf7sg[e].prefill[i]):a.selectedValues=[cf7sg[e].prefill[i]]),a},t.fn.activateCF7sgCollapsibleSection=function(e){null===e&&(e=!0);var a,i=t(this);if(!i.is(".cf7sg-collapsible"))return!1;switch(a=i.children(".cf7sg-collapsible-title"),!0){case e&&!a.is(".ui-state-active"):case!e&&a.is(".ui-state-active"):a.trigger("click")}return i},t.fn.getCF7field=function(e,a){null===a&&(a={});var i=t(this);if(void 0===e||0==e.length)return cf7sg.debug&&console.log("CF7 Smart-grid ERROR: getCF7field() requires valid field name."),!1;if(!i.is(".wpcf7-form"))return cf7sg.debug&&console.log("CF7 Smart-grid ERROR: getCF7field() using unknown form"),!1;var s=void 0!==a.tab,r=void 0!==a.row,n=[];switch(!0){case s&&a.tab>0&&r&&a.row>0:n=t(':input[name="'+e+"_tab-"+a.tab+"_row-"+a.row+'"]',i);break;case s&&r:n=t(':input[name="'+e+'"]',i);break;case s&&a.tab>0&&r:n=t(':input[name="'+e+"_tab-"+a.tab+'"]',i);break;case s&&a.tab>0:n=t(':input[name*="'+e+"_tab-"+a.tab+'"], :input[name*="'+e+"_tab-"+a.tab+'_row-"]',i);break;case s:n=t(':input[name*="'+e+'_row-"], :input[name="'+e+'"]',i);break;case r&&a.row>0&&s:n=t(':input[name="'+e+"_row-"+a.row+'"]',i);break;case r&&a.row>0:n=t(':input[name="'+e+"_row-"+a.row+'"]',i).add(t(':input[name*="'+e+'_tab-"]',i).filter(':input[name$="_row-'+a.row+'"]'));break;case r:n=t(':input[name="'+e+'"], :input[name$="'+e+'_tab-"]',i);break;default:n=t(':input[name*="'+e+'"]',i)}return n.not(".cf7-sg-cloned-table-row :input")},t.fn.setupDatePicker=function(){var e=t(this);if(!e.is(".wpcf7-date:enabled")&&!e.is(".wpcf7-text.datepicker:enabled"))return e;var a="",i="",s=e.attr("min");void 0===s?s=null:a=(s=new Date(s)).getFullYear();var r=e.attr("max");return void 0===r?r=null:i=(r=new Date(r)).getFullYear(),e.datepicker("destroy"),e.datepicker({defaultDate:e.val(),dateFormat:"yy-mm-dd",minDate:s,maxDate:r,changeMonth:!0,changeYear:!0}),a>0&&i>0?e.datepicker("option","yearRange",a+":"+i):a>0?e.datepicker("option","yearRange",a+":c+20"):i>0&&e.datepicker("option","yearRange","c-20:"+i),e},t.fn.toggleCF7sgTableRowAddition=function(e){null===e&&(e=!1);var a=t(this);return!!a.is(".container.cf7-sg-table")&&(e?a.next(".cf7-sg-table-button").show():a.next(".cf7-sg-table-button").hide(),a)},t.fn.toggleCF7sgTableRowDeletion=function(e){null===e&&(e=!1);var a=t(this);return!!a.is(".container.cf7-sg-table")&&(e?t(".row.cf7-sg-table:nth-last-child(2) .row-control",a).removeClass("display-none"):t(".row.cf7-sg-table:nth-last-child(2) .row-control",a).addClass("display-none"),a)},t.fn.cf7sgCountRows=function(){var e=t(this);return!!e.is(".container.cf7-sg-table")&&e.children(".row").not(".cf7-sg-cloned-table-row").length},t.fn.cf7sgRemoveRow=function(){var e=t(this);if(!e.is(".container.cf7-sg-table"))return!1;var a=e.children(".row").not(".cf7-sg-cloned-table-row");if(a.length>1){a.last().remove(),e.trigger("sgRowDeleted");var i=e.children(".cf7sg-tracker-field");i.length&&i.val(a.length-1)}return e},t.fn.cf7sgCloneRow=function(e,a){void 0===e&&(e=!0);var i=t(this),s="";if(i.is(".cf7-sg-table-footer")&&(s=i,i=i.closest(".container.cf7-sg-table")),!i.is(".container.cf7-sg-table"))return i;var r=i.children(".row.cf7-sg-table").length-1,n=t(".cf7-sg-cloned-table-row",i),l=n.clone(),c=i.closest("div.cf7-smart-grid").attr("id");l.removeClass("cf7-sg-cloned-table-row").attr("data-row",r),cf7sg[c].table_labels&&t(".field > label",l).remove(),s.length>0?s.before(l.show()):n.before(l.show()),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var a=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>a.length)&&(e=a.length),e-=t.length;var i=a.indexOf(t,e);return-1!==i&&i===e}),t(":input",l).each(function(){var a=t(this),i=a.attr("id"),s=a.closest("span.wpcf7-form-control-wrap"),n=a.is('[type="radio"]')||a.is('[type="checkbox"]');!i&&n&&(i=s.attr("id")),a.prop("disabled",!1);var l=a.attr("name").replace("_cf7sgcloned_",""),c="";if(l.endsWith("[]")&&(l=l.replace("[]",""),c="[]"),a.attr("name",l+"_row-"+r+c),s.removeClass(l).addClass(l+"_row-"+r),s.data("name")&&s.attr("data-name",l+"_row-"+r),i){if(n)s.attr("id",i+"_row-"+r);else{a.attr("id",i+"_row-"+r);var o=s.siblings("label");o.attr("for")===i&&o.attr("for",i+"_row-"+r)}}a.is("select.ui-select")&&e&&a.niceSelect(),a.is("select.nice-select")&&e&&a.niceSelect(),a.is("select.select2")&&e&&(a.select2(a.cf7sgSelect2Options()),a.trigger("sgSelect2"))}),t(".cf7sg-dynamic_checkbox",l).each(function(){new HybridDropdown(this,t(this).cf7sgHybridddOptions())}),i.trigger("sgContentIncrease"),i.trigger({type:"sgRowAdded",row:r,button:a});var o=i.children(".cf7sg-tracker-field");return o.length&&o.val(r+1),i},t.fn.toggleCF7sgTabAddition=function(e){null===e&&(e=!1);var a=t(this);return!!a.is("div.cf7-sg-tabs")&&(e?t(".cf7sg-add-tab",a).show():t(".cf7sg-add-tab",a).hide(),a)},t.fn.toggleCF7sgTabDeletion=function(e){null===e&&(e=!1);var a=t(this);return!!a.is("div.cf7-sg-tabs")&&(e?t(".cf7-sg-tabs-list li:last-child .cf7sg-close-tab",a).removeClass("display-none").show():t(".cf7-sg-tabs-list li:last-child .cf7sg-close-tab",a).addClass("display-none").hide(),a)},t.fn.cf7sgCountTabs=function(){var e=t(this);return!!e.is("div.cf7-sg-tabs")&&e.find(".cf7-sg-tabs-list").children("li").length},t.fn.cf7sgRemoveTab=function(){var e=t(this);if(!e.is("div.cf7-sg-tabs"))return!1;var a=e.find(".cf7-sg-tabs-list").children("li");if(a.length>1){var i=a.last().find("a").attr("href");e.find("div"+i).remove(),a.last().remove().is(".ui-state-active")&&e.tabs({active:a.length-2}),e.trigger("sgTabRemoved");var s=a.eq(a.length-2).find(".cf7sg-close-tab:not(.display-none)");s.length>0&&s.show();var r=e.children(".cf7sg-tracker-field");r.length&&r.val(e.children(".cf7-sg-tabs-panel").length)}return e},t.fn.cf7sgCloneTab=function(e,a){null===a&&(a=!1);var s=t(this);if(void 0===e&&(e=!0),!s.is("div.cf7-sg-tabs"))return!1;var r=s.children(".cf7-sg-tabs-list"),n=r.children("li").length+1,l=s.children(".cf7-sg-tabs-panel").first().attr("id"),c=l+"-"+n,o=r.children("li").first().clone();o.find("a").attr("href","#"+c).text(o.text()+" ("+n+")"),o.append('<span class="cf7sg-close-tab dashicons dashicons-no-alt"></span>'),o.removeClass("ui-tabs-active ui-state-active"),r.find("li .cf7sg-close-tab").hide(),r.append(o);var d=t(i[l]);d.attr("id",c),t(":input",d).each(function(){var a=t(this),i=a.attr("id"),s=a.closest("span.wpcf7-form-control-wrap"),r=a.is(".cf7-sg-cloned-table-row :input"),l=a.attr("name"),c="";if(r||a.prop("disabled",!1),l.endsWith("[]")&&(l=l.replace("[]",""),c="[]"),a.attr("name",l+"_tab-"+(n-1)+c),s.removeClass(l).addClass(l+"_tab-"+(n-1)),s.data("name")&&s.attr("data-name",l+"_tab-"+(n-1)),i){a.attr("id",i+"_tab-"+(n-1));var o=s.siblings("label");o.attr("for")===i&&o.attr("for",i+"_tab-"+(n-1))}!r&&a.is("select.ui-select")&&e&&a.niceSelect(),!r&&a.is("select.nice-select")&&e&&a.niceSelect(),!r&&a.is("select.select2")&&e&&(a.select2(a.cf7sgSelect2Options()),a.trigger("sgSelect2"))}),t(".cf7sg-dynamic_checkbox",d).not(".cf7-sg-cloned-table-row *").each(function(){new HybridDropdown(this,t(this).cf7sgHybridddOptions())}),s.append(d),d.find("ul.ui-tabs-nav li a").each(function(){var e=t(this);c=e.attr("href"),e.attr("href",c+"-"+n),e.closest("ul.ui-tabs-nav").siblings("div"+c).attr("id",c.substring(1)+"-"+n)}),t(".cf7-sg-tabs",d).each(function(){t(this).tabs()}),t(".cf7sg-collapsible.with-toggle",d).each(function(){var a=t(this),i=a.attr("id");a.attr("id",i+"_tab-"+(n-1));var s=a.data("group");s&&(s=s+"_tab-"+(n-1),a.attr("data-group",s));var r=a.data("open"),l=!1;void 0===r?r=!1:!0===r&&(r=0,l=!0),t(".toggle",a).setupToggle(l,s),l&&a.trackToggle(!0),!l&&e&&(t(".row.ui-accordion-content :input",a).prop("disabled",!0),a.addClass("collapsed")),t(".cf7sg-collapsible",d).accordion({collapsible:!0,icons:!1,active:r,header:"> div.cf7sg-collapsible-title",heightStyle:"content",activate:function(e,a){t(this).trigger("sgContentIncrease")},beforeActivate:function(e,a){if(t(".toggle",a.oldHeader).is(".disabled"))return!1},create:function(e){t(this).trigger({type:"sgCollapsibleRowsReady","section-id":i,"tab-index":n-1})}})}),s.tabs("refresh"),a&&s.tabs("option","active",-1),d.trigger({type:"sgTabAdded","tab-index":n-1}),t(".cf7-sg-table.container",d).each(function(){var e=t(this),a=e.attr("id");e.attr("id",a+"_tab-"+(n-1)),e.trigger({type:"sgTableReady","table-id":a,"tab-index":n-1})});var f=s.children(".cf7sg-tracker-field");return f.length>0&&f.val(s.children(".cf7-sg-tabs-panel").length),s},t.fn.setupToggle=function(e,a){var i=t(this);if(void 0===e&&(e=!1),!i.is(".toggle"))return i;if(i.length>0){var s=i.data("on");0==s.length&&(s="Yes");var r=i.data("off");0==s.length&&(r="No"),i.toggles({drag:!1,text:{on:s,off:r},on:e}),a&&e&&i.toggleClass("disabled",!0)}return i},t("div.cf7-smart-grid.has-update form.wpcf7-form").on("cf7SmartGridReady",function(){var i=t(this);t.ajax({type:"POST",url:cf7sg.url,dataType:"json",data:{action:"save_grid_fields",nonce:t('input[name="_wpnonce"]',i).val(),tabs_fields:JSON.stringify(e),table_fields:JSON.stringify(a),id:t('input[name="_wpcf7"]',i).val()}}).fail(function(t,e){console.log("CF7 Smart Grid ERROR sending grid fields to server: "+e)})})}(jQuery);