Version Description
- Changed: updated query filters for WP 6.0
- Fixed: adjusted infowindow sizing for sub-pixel rendering
Download this release
Release Info
Developer | chrisvrichardson |
Plugin | MapPress Easy Google Maps |
Version | 2.76.6 |
Comparing to | |
See all releases |
Code changes from version 2.76.5 to 2.76.6
- build/index_mappress.js +1 -1
- languages/mappress-google-maps-for-wordpress.pot +2 -2
- mappress.php +2 -2
- readme.txt +5 -1
build/index_mappress.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var e={117:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappAutocomplete:()=>m});var n=i(326);const s=wp.element.createElement,{Fragment:o,useCallback:a,useEffect:l,useLayoutEffect:p,useMemo:r,useRef:c,useState:u}=wp.element;function m(e){e={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...e};const t=c(null),i=c(null),[o,a]=u({isOpen:!1,value:""});function p(e){a((t=>({...t,...e})))}(0,n.useClickOutside)(t,(()=>{o.isOpen&&p({isOpen:!1})})),l((()=>{e.focus&&i.current&&i.current.focus()}),[i.current]),l((()=>{o.map&&setMapTypeId(e.mapTypeId)}),[e.mapTypeId,o.map]);const r=(0,n.useDebounce)((t=>{e.onFetch&&e.onFetch(t)}),e.delay);function m(){let t;p({isOpen:!1}),e.suggestions&&(t=null==o.selected?e.suggestions[0]:e.suggestions[o.selected]),e.onSelect({suggestion:t,value:h})}const h=o.selected>=0&&e.suggestions&&e.suggestions[o.selected]?e.suggestions[o.selected].value:o.value;return s("div",{className:"mapp-autocomplete",ref:t},s("div",{className:"mapp-autocomplete-wrapper"},s("input",{className:e.className,onChange:e=>{!function(e){p({value:e,selected:null}),r(e)}(e.target.value)},onKeyDownCapture:t=>function(t){switch(t.stopPropagation(),t.code){case"Backspace":p({isOpen:o.value.length>1});break;case"Enter":m();break;case"Escape":p({isOpen:!1});break;case"ArrowUp":if(t.preventDefault(),e.suggestions&&0!=o.selected){const t=null==o.selected?e.suggestions.length-1:o.selected-1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"ArrowDown":if(e.suggestions&&o.selected<e.suggestions.length-1){const t=null==o.selected?0:o.selected+1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:p({isOpen:!0})}}(t),placeholder:e.placeholder,ref:i,title:e.title,type:"text",value:h}),o.isOpen&&s("div",{className:"mapp-autocomplete-list"},_.map(e.suggestions,((t,i)=>{const n="mapp-autocomplete-item"+(o.selected==i?" mapp-selected":"");return s("div",{className:n,key:i,onClick:()=>function(t,i){p({isOpen:!1,selected:i}),e.onSelect({suggestion:t})}(t,i)},t.value)})))),e.buttonLabel&&s("div",{className:"mapp-submit-button",onClick:()=>m()},e.buttonLabel))}},715:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappDirections:()=>r});const n=wp.element.createElement,{Fragment:s,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(e){e={from:null,onClose:null,to:null,...e};const[t,i]=p({from:e.from?e.from:"",to:e.to?e.to:""});function s(e){i((t=>({...t,...e})))}function a(){e.onClose&&e.onClose()}function l(){const e=t.from.trim(),i=t.to.trim();let n=mappl10n.options.directionsServer;n="https://maps.google.com"==n?"https://www.google.com":n,-1==n.toLowerCase().indexOf("http")&&(n="https://"+n),n+="/maps/dir/?api=1&origin="+encodeURIComponent(e)+"&destination="+encodeURIComponent(i),window.open(n),a()}function r(e){13==e?l():27==e&&a()}return o((()=>{"google"==mappl10n.options.directions&&l()}),[]),"google"==mappl10n.options.directions?null:n("div",{className:"mapp-directions-component"},n("div",{className:"mapp-close",onClick:()=>a()}),n("div",null,n("input",{className:"mapp-dir-from",onChange:e=>s({from:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"1",placeholder:__("My location"),value:t.from}),n("div",{className:"mapp-dir-arrows",onClick:()=>{s({from:t.to,to:t.from})}})),n("div",null,n("input",{className:"mapp-dir-to",onChange:e=>s({to:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"2",value:t.to})),n("div",{className:"mapp-dir-toolbar"},n("div",{className:"mapp-submit-button",onClick:()=>l()},__("Get Directions"))))}},817:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappFilters:()=>u});var n=i(939),s=i(326);const o=wp.element.createElement,{Fragment:a,useEffect:l,useLayoutEffect:p,useRef:r,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf,u=e=>{e={onFilterChange:null,otype:"post",poiCount:0,...e};const t=(0,s.useDebounce)(e.onFilterChange,500),i=r(null),[a,p]=c({filters:null,formData:{},isBusy:!0,isOpen:!1});function u(e){p((t=>({...t,...e})))}function m(e,i){let n=a.formData[e.key]?a.formData[e.key].values:null;if("checkbox"==e.format){var s;const e=null===(s=n)||void 0===s?void 0:s.indexOf(i);e>-1?n.splice(e,1):(n=n||[],n.push(i))}else n=i?[i]:[];let o={...a.formData};n.length?o[e.key]={key:e.key,values:n,meta_key:e.meta_key,meta_values:e.meta_values}:delete o[e.key],u({formData:o}),t(o)}function h(){u({formData:{}}),t()}function g(e){u({isOpen:e=void 0!==e?e:!a.isOpen})}function d(e){return o("div",{className:"mapp-filter",key:e.key},o("div",{className:"mapp-filter-label"},e.label),o("div",{className:"mapp-filter-values"},function(e){e.key;const t=[...e.values];let i=a.formData[e.key]?a.formData[e.key].values:"";switch(e.format){case"input":return o("input",{type:"text",value:i?i[0]:"",onChange:t=>m(e,t.target.value)});case"checkbox":return _.map(t,(t=>o("label",{key:t.value},o("input",{checked:null==i?void 0:i.includes(t.value),key:t.value,onChange:t=>m(e,t.target.value),type:e.format,value:t.value}),t.iconid&&o("img",{className:"mapp-icon",src:n.mappLib.getIconUrl(t.iconid)}),t.label)));case"radio":return"radio"==e.format&&t.unshift({value:"",label:__("All")}),_.map(t,(t=>o("label",{key:t.value},o("input",{checked:i==t.value||""==t.value&&!i,key:t.value,onChange:t=>m(e,t.target.value),type:e.format,value:t.value}),t.iconid&&o("img",{className:"mapp-icon",src:n.mappLib.getIconUrl(t.iconid)}),t.label)));case"select":return t.unshift({value:"",label:""}),o("select",{value:i[0],onChange:t=>m(e,t.target.value)},_.map(t,(e=>o("option",{key:e.value,value:e.value},e.label))))}}(e)))}return(0,s.useClickOutside)(i,(()=>{a.isOpen&&g(!1)})),l((()=>{u({isBusy:!0}),n.mappLib.ajax({data:{action:"mapp_filters_get",nonce:mappl10n.options.nonce,otype:e.otype},callback:e=>{u({isBusy:!1}),e&&"OK"==e.status?u({filters:e.data}):console.error("MapPress: unable to fetch filter data")}})}),[]),o("div",{className:"mapp-filters-component",ref:i},function(){const e="mapp-button mapp-filters-toggle mapp-button-caret"+(a.isBusy?" mapp-button-disabled":"");return o("div",{className:e,onClick:()=>{a.isBusy||g()}},__("Filter"))}(),a.isOpen&&null!==a.filters&&o("div",{className:"mapp-filters-wrapper"},o("div",{className:"mapp-filters-list"},_.map(a.filters,(e=>d(e)))),function(){let t=e.poiCount>1?__("%d Results"):__("%d Result");return t=sprintf(t,e.poiCount),o("div",{className:"mapp-filters-toolbar"},o("div",{className:"mapp-link-button",onClick:h},__("Reset")),o("div",{className:"mapp-filters-count"},t),o("div",{className:"mapp-submit-button",onClick:()=>g(!1)},__("Done")))}()))}},10:(e,t,i)=>{"use strict";i.r(t),i.d(t,{useGeocoding:()=>c});wp.element.createElement;const{Fragment:n,useCallback:s,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,r={google:function(){this.token=null;const e=document.createElement("div");this.placesService=new google.maps.places.PlacesService(e),this.autocompleteService=new google.maps.places.AutocompleteService}};r.google.prototype={getDetails:function(e){let{suggestion:t,callback:i}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var n={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(n,(function(e,t){if("OK"==t&&e&&e.geometry){if(e.geometry.location&&(e.geometry.location=e.geometry.location.toJSON()),e.geometry.viewport){var n=e.geometry.viewport.toJSON();e.geometry.viewport={sw:{lat:n.south,lng:n.west},ne:{lat:n.north,lng:n.east}}}i(e)}else i(null)}))},getFirstPrediction:function(e){let{map:t,value:i,callback:n}=e;this.getPredictions({map:t,value:i,callback:e=>{e&&Array.isArray(e)?this.getDetails({suggestion:e[0],callback:e=>n(e)}):n(null)}})},getPredictions:function(e){let{map:t,value:i,includeBusinesses:n,callback:s}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var o=t?t.getBounds():null;"leaflet"==mappl10n.options.engine&&(o=new google.maps.LatLngBounds(new google.maps.LatLng(o.getSouthWest().lat,o.getSouthWest().lng),new google.maps.LatLng(o.getNorthEast().lat,o.getNorthEast().lng)));var a={input:i,bounds:o=o||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:n?null:["geocode"]};this.autocompleteService.getPlacePredictions(a,(function(e,t){"OK"==t&&e&&e.length?(e=(e=e.map((e=>(e.value=e.description,e)))).filter((e=>e.place_id)),s(e)):(t==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):t==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),s(null))}))}},r.mapbox=function(){},r.mapbox.prototype={getDetails:function(e){let{suggestion:t,callback:i}=e,n=t.place_name,s=n.indexOf(","),o=n.indexOf(",",s+1);s>0&&(n=parseInt(n.substr(0,s))?n.substr(0,o).replace(",",""):n.substr(0,s));let a=t.bbox&&4==t.bbox.length?{sw:{lat:t.bbox[1],lng:t.bbox[0]},ne:{lat:t.bbox[3],lng:t.bbox[2]}}:null;i({formatted_address:t.place_name,name:n,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:a}})},getFirstPrediction:function(e){let{map:t,value:i,callback:n}=e;this.getPredictions({map:t,value:i,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>n(e)}):n(null)}})},getPredictions:function(e){let{map:t,value:i,callback:n}=e;var s="https://api.mapbox.com/geocoding/v5/mapbox.places/"+i+".json?access_token="+mappl10n.options.mapbox;s=mappl10n.options.country?s+"&country="+mappl10n.options.country.toLowerCase():s,s=mappl10n.options.language?s+"&language="+mappl10n.options.language.toLowerCase():s;var o=t?t.getCenter():null;o&&(s+="&proximity="+o.lng+","+o.lat),mappl10n.options.searchBox&&(s+="&bbox="+mappl10n.options.searchBox),fetch(s).then((e=>e.json())).then((e=>{e&&e.features&&e.features.length>0?(e.features=e.features.map((e=>(e.value=e.label=e.place_name,e))),n(e.features)):n(null)}))}},r.nominatim=function(){},r.nominatim.prototype={getDetails:function(e){let{suggestion:t,callback:i}=e,n=t.display_name,s=n.indexOf(","),o=n.indexOf(",",s+1);s>0&&(n=parseInt(n.substr(0,s))?n.substr(0,o).replace(",",""):n.substr(0,s));let a=t.boundingbox&&4==t.boundingbox.length?{sw:{lat:t.boundingbox[0],lng:t.boundingbox[2]},ne:{lat:t.boundingbox[1],lng:t.boundingbox[3]}}:null;i({formatted_address:t.display_name,name:n,geometry:{location:{lat:t.lat,lng:t.lon},viewport:a}})},getFirstPrediction:function(e){let{map:t,value:i,callback:n}=e;this.getPredictions({map:t,value:i,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>n(e)}):n(null)}})},getPredictions:function(e){let{map:t,value:i,callback:n}=e;var s="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(i);if(s=mappl10n.options.country?s+"&countrycodes="+mappl10n.options.country.toLowerCase():s,s=mappl10n.options.language?s+"&accept-language="+mappl10n.options.language.toLowerCase():s,mappl10n.options.searchBox)s+="&viewbox="+mappl10n.options.searchBox,s+="&bounded=1";else{var o=t?t.getMap().getBounds():null;if(o){let e=o.getSouthWest(),t=o.getNorthEast();s+="&viewbox="+e.lng+","+e.lat+","+t.lng+","+t.lat}}fetch(s).then((e=>e.json())).then((e=>{e&&e.length?(e=e.map((e=>(e.value=e.display_name,e))),n(e)):n(null)}))}};const c=e=>{let{includeBusinesses:t}=e;function i(){let e="";return e="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new r[e]}function n(e,t){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){var i={lat:t.coords.latitude,lng:t.coords.longitude};e({name:i.lat+", "+i.lng,geometry:{location:i}})}),(function(i){if(!t){var n=i&&i.message?" : "+i.message:"";alert(mappl10n.no_geolocate+n)}e(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(e){let{map:s,suggestion:o,value:a,callback:l}=e;const p=i();a="string"==typeof a?a.trim():a,o||a?function(e){let{map:t,value:i,callback:s}=e;if(!i)return void s(null);if("string"!=typeof i){const e=i.lat&&i.lng?{geometry:{location:{lat:i.lat,lng:i.lng}}}:null;return void s(e)}if("http"==i.substring(0,4))return void s(i);if("user"==i)return void n((function(e){s(e)}));const o=i.split(",");if(2==o.length){const e=parseFloat(o[0]),t=parseFloat(o[1]);if(!isNaN(e)&&!isNaN(t))return void s({name:e+", "+t,geometry:{location:{lat:e,lng:t}}})}s(null)}({map:s,value:a,callback:e=>{e?l(e):o?p.getDetails({suggestion:o,callback:l}):p.getFirstPrediction({map:s,value:a,includeBusinesses:t,callback:l})}}):l(null)},geolocate:n,getPredictions:function(e){let{map:t,value:n,callback:s}=e;i().getPredictions({map:t,value:n,callback:s})}}}},326:(e,t,i)=>{"use strict";i.r(t),i.d(t,{useDebounce:()=>c,useClickOutside:()=>u});wp.element.createElement;const{Fragment:n,useCallback:s,useEffect:o,useLayoutEffect:a,useMemo:l,useRef:p,useState:r}=wp.element;function c(e,t){const i=React.useRef(e);return React.useLayoutEffect((()=>{i.current=e})),React.useMemo((()=>_.debounce((function(){return i.current(...arguments)}),t)),[t])}function u(e,t){const i=i=>{e.current&&!e.current.contains(i.target)&&t()};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}},939:(e,t,i)=>{"use strict";i.r(t),i.d(t,{mappLib:()=>c});wp.element.createElement;const{Fragment:n,useCallback:s,useEffect:o,useLayoutEffect:a,useMemo:l,useRef:p,useState:r}=wp.element,c={ajax:function(e){const t={callback:null,data:null,dataType:"json",silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(t,i,n){"json"==e.dataType&&e.url==mappl10n.options.ajaxurl&&"OK"!=t.status&&c.alert(t.status),"json"==e.dataType&&t.output?c.alert("AJAX Invalid Output\r\n"+t.output):e.callback&&e.callback(t,n)},error:function(t,i,n){"cancel"!=i&&(void 0!==n&&""!=n&&c.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+n+"\r\nResponseText="+t.responseText),e.callback&&e.callback(null))}};return e={...t,...e},jQuery.ajax(e)},alert:function(e){mappl10n.options.admin||mappl10n.options.debug?alert(e):window.console&&console.error(e)},getIcon:function(e){{const t=this.getIconUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:t,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:t}}},getIconUrl:function(e){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"},nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;const t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let i="",n=e;for(;n--;)i+=t[64*Math.random()|0];return i},template:function(e,t){if(c.templates=c.templates?c.templates:{},!c.templates[e]){var i=document.getElementById("mapp-tmpl-"+e).innerHTML;if(!i)return"";c.templates[e]=_.template(i,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return c.templates[e](t)}};"leaflet"==mappl10n.options.engine&&"undefined"!=typeof L&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6})},602:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappMenuControl:()=>c});var n=i(326);const s=wp.element.createElement,{Fragment:o,useEffect:a,useLayoutEffect:l,useRef:p,useState:r}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function c(e){e={layer:null,map:null,onCenter:null,...e};const[t,i]=r({activeLayer:e.layer?e.layer:null,layers:null,isOpen:!1}),l=p(null);function c(e){i((t=>({...t,...e})))}function u(){c({isOpen:!t.isOpen})}return(0,n.useClickOutside)(l,(()=>{t.isOpen&&u()})),a((()=>{if("google"==mappl10n.options.engine){c({layers:{traffic:{googleLayer:new google.maps.TrafficLayer,label:__("Traffic")},bicycling:{googleLayer:new google.maps.BicyclingLayer,label:__("Bicycling")},transit:{googleLayer:new google.maps.TransitLayer,label:__("Transit")}}})}}),[]),s("div",{ref:l},s("div",{className:"mapp-menu-toggle",onClick:()=>u()}),t.isOpen&&function(){const i=_.map(t.layers,((i,n)=>{const o=t.activeLayer==n?"mapp-menu-item mapp-active":"mapp-menu-item";return s("div",{className:o,key:n,onClick:()=>function(i){t.activeLayer&&t.layers[t.activeLayer].googleLayer.setMap(null),i!=t.activeLayer&&t.layers[i].googleLayer.setMap(e.map.getMap()),c({activeLayer:i==t.activeLayer?null:i,isOpen:!1})}(n)},i.label)}));return s("div",{className:"mapp-menu-component",style:{display:"flex"}},s("div",{className:"mapp-menu-item",onClick:()=>(c({isOpen:!1}),void e.onCenter())},__("Center map")),"google"==mappl10n.options.engine&&s(o,null,s("div",{className:"mapp-menu-separator"}),i),s("div",{className:"mapp-menu-footer"},s("a",{className:"mapp-menu-help-link",href:"https://mappresspro.com/mappress-documentation",target:"_blank"},s("span",null,__("Help")))))}())}},27:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPaginate:()=>r});const n=wp.element.createElement,{Fragment:s,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,{sprintf}=wp.i18n;function r(e){function t(t,i){const n=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(n);break;case"next":e.page<n&&e.onChange(e.page+1);break;case"prev":e.page>1&&e.onChange(e.page-1)}}return function(){const i=Math.ceil(e.count/e.pageSize),s=e.isBusy||e.page<=1,o=e.isBusy||e.page>=i,a=s?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",l=o?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",p=(r="%d of %d",wp.i18n.__(r,"mappress-google-maps-for-wordpress"));var r;return n("div",{className:"mapp-paginate"},n("div",{className:a,onClick:()=>{s||t("first")}},"«"),n("div",{className:a,onClick:()=>{s||t("prev")}},"‹"),n("div",{className:"mapp-paginate-count"},sprintf(p,e.page,i)),n("div",{className:l,onClick:()=>{o||t("next")}},"›"),n("div",{className:l,onClick:()=>{o||t("last")}},"»"))}()}},818:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPlaces:()=>m});var n=i(117),s=i(10);const o=wp.element.createElement,{Fragment:a,useCallback:l,useEffect:p,useLayoutEffect:r,useRef:c,useState:u}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function m(e){e={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...e};const{geocode:t,getPredictions:i}=(0,s.useGeocoding)({map:e.map,includeBusinesses:e.includeBusinesses}),[a,l]=u({suggestions:[]});return o(n.MappAutocomplete,{buttonLabel:e.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:e.focus,onFetch:function(t){i({map:e.map,value:t,callback:e=>{var t;t={suggestions:e},l((e=>({...e,...t})))}})},onSelect:function(i){let{suggestion:n,value:s}=i;t({map:e.map,suggestion:n,value:s,callback:t=>{t&&e.onSearch(t)}})},placeholder:__("Search"),suggestions:a.suggestions,title:__("Enter an address, place, KML file URL, or lat,lng")})}},50:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPoiContent:()=>u});var n=i(939);const s=wp.element.createElement,{Fragment:o,useEffect:a,useLayoutEffect:l,useMemo:p,useRef:r,useState:c}=wp.element;wp.i18n.sprintf;function u(e){e={context:null,feature:null,onDirectionsClick:null,poi:null,template:null,thumbs:null,...e};const[t,i]=c({imageNumber:0});function a(e){i((t=>({...t,...e})))}return s(o,null,function(){const i="list"!=e.context&&mappl10n.options.thumbWidth&&mappl10n.options.thumbHeight?{width:mappl10n.options.thumbWidth+"px",height:mappl10n.options.thumbHeight+"px"}:null,n=e.thumbs&&e.poi.images&&e.poi.images.length&&e.poi.images[t.imageNumber]?e.poi.images[t.imageNumber]:null;if(!n)return null;const o=function(e){switch(e.type){case"avatar":return s("div",{className:"mapp-avatar",dangerouslySetInnerHTML:{__html:e.html}});case"embed":return s("div",{className:"mapp-embed",dangerouslySetInnerHTML:{__html:e.html}});default:if("image"==e.type||!e.type)return s("img",{src:e.url})}}(n);return s("div",{className:"mapp-thumbnail",style:i},t.imageNumber>=1&&s("div",{className:"mapp-gallery-previous",onClick:e=>function(e){t.imageNumber>0&&(a({imageNumber:t.imageNumber-1}),e.stopPropagation())}(e)}),o,t.imageNumber<e.poi.images.length-1&&s("div",{className:"mapp-gallery-next",onClick:i=>function(i){t.imageNumber<e.poi.images.length-1&&(a({imageNumber:t.imageNumber+1}),i.stopPropagation())}(i)}))}(),s("div",{className:"mapp-info"},function(){let t={...e.poi};t.icon=n.mappLib.getIconUrl(e.poi.iconid),e.feature&&(t.body=e.feature.description,t.title=e.feature.name);const i=n.mappLib.template(e.template,{poi:t});return s("div",{className:"mapp-template",dangerouslySetInnerHTML:{__html:i}})}(),function(){if(mappl10n.options.directionsPopup&&("map-popup"==e.template||"mashup-popup"==e.template))return s("div",{className:"mapp-dir",onClick:()=>e.onDirectionsClick()},(t="Get Directions",wp.i18n.__(t,"mappress-google-maps-for-wordpress")));var t}()))}},615:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPoiList:()=>h});var n=i(939),s=i(27),o=i(50);const a=wp.element.createElement,{Fragment:l,useEffect:p,useLayoutEffect:r,useMemo:c,useRef:u,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf;const h=wp.element.memo((function(e){e={bounds:null,className:null,hoveredPoi:null,isEditable:!1,isPaged:!1,onClick:null,onDragDrop:null,onHover:null,onPage:null,openPoi:null,page:1,pois:null,template:null,...e};const[t,i]=m({dragging:null,dragover:null,pageSize:mappl10n.options.poiListPageSize?parseInt(mappl10n.options.poiListPageSize):20});function p(e){i((t=>({...t,...e})))}function r(i){let s,r="mapp-item";return e.openPoi!=i.id&&e.hoveredPoi!=i.id||(r+=" mapp-selected"),r+=t.dragover==i.id?" mapp-dragover":"",s=e.isEditable?a(l,null,a("img",{className:"mapp-icon",src:n.mappLib.getIconUrl(i.iconid)}),a("div",{className:"mapp-title"},i.title)):a(o.MappPoiContent,{context:"list",poi:i,template:e.template,thumbs:mappl10n.options.thumbsList}),a("div",{className:r,dangerouslySetInnerHTML:null,draggable:e.isEditable,key:i.id,onClick:()=>e.onClick(i.id),onDragOver:e=>e.preventDefault(),onDragStart:e=>p({dragging:i.id}),onDragEnter:e=>p({dragover:i.id}),onDragEnd:e=>p({dragging:null,dragover:null}),onDrop:n=>{return s=i.id,void(e.onDragDrop&&e.onDragDrop({from:t.dragging,to:s}));var s},onMouseEnter:t=>{e.onHover(i.id)},onMouseLeave:t=>{e.onHover(null)}},s)}return a("div",{className:e.className},e.isPaged&&function(){let t=1!=e.pois.length?__("%d Results"):__("%d Result");return t=sprintf(t,e.pois.length),a("div",{className:"mapp-list-header"},a("div",{className:"mapp-list-count"},t))}(),function(){const i=t.pageSize*(e.page-1),n=i+t.pageSize;return a("div",{className:"mapp-items"},_.map(e.pois,((e,t)=>{if(t>=i&&t<=n)return r(e)})))}(),e.isPaged&&(e.pois.length<=t.pageSize?null:a("div",{className:"mapp-list-footer"},a(s.MappPaginate,{count:e.pois.length,onChange:t=>e.onPage(t),page:e.page,pageSize:t.pageSize}))))}))},892:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPopupModal:()=>u});var n=i(939);const s=wp.element.createElement,o=wp.element.createPortal,{Fragment:a,useEffect:l,useLayoutEffect:p,useRef:r,useState:c}=wp.element;function u(e){e={onClose:null,poi:null,...e};const[t,i]=c({isBusy:!1,html:null});function a(e){i((t=>({...t,...e})))}const p=React.createRef();function r(t){27==t.keyCode&&e.onClose()}return l((()=>(document.body.classList.add("mapp-modal-noscroll"),()=>document.body.classList.remove("mapp-modal-noscroll"))),[]),l((()=>{e.poi.postid&&(a({isBusy:!0}),n.mappLib.ajax({data:{action:"mapp_get_post",postid:e.poi.postid,nonce:mappl10n.options.nonce},dataType:"HTML",type:"GET",success:e=>{a({isBusy:!1,html:e})}}))}),[e.poi.postid]),l((()=>{p.current&&p.current.focus(),console.log("focus"+document.activeElement)}),[p.current]),o(s("div",{className:"mapp-modal"},s("div",{className:"mapp-modal-backdrop",onClick:e.onClose,onKeyDown:r},s("div",{className:"mapp-modal-close",onClick:e.onClose},"×")),s("div",{className:"mapp-modal-content-wrapper",ref:p,onKeyDown:r,tabIndex:0},s("div",{className:"mapp-modal-content"},t.isBusy&&s("div",{className:"mapp-modal-spinner"}),!t.isBusy&&s("div",{dangerouslySetInnerHTML:{__html:t.html}}),s("div",{className:"mapp-modal-close",onClick:e.onClose},"X")))),document.body)}},854:(e,t,i)=>{"use strict";i.r(t);var n=i(715),s=i(817),o=i(939),a=i(602),l=i(818),p=i(50),r=i(615),c=i(892),u=i(10);window.mapp=window.mapp||{};const m=wp.element.createElement,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");wp.i18n._n;var h;h=jQuery,mapp.Map=function(e,t){this.defaults={alignment:null,center:null,classname:null,embed:null,height:null,initialOpenInfo:null,isEditable:null,layers:null,layout:null,lines:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,onDrawingEvent:null,onPoiClose:null,onPoiOpen:null,onSearch:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,postid:null,query:null,search:null,sel:null,title:null,width:null,zoom:null},this.drawingManager=null,this.filters=null,this.hovered=null,this.isFullscreen=!1,this.iw=null,this.mapdata=e,this.opened=null,this.pagination={count:0,page:1},this.polyline=null,this.settings=t||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.pois_=[],this.user_=null,this.xhr_,_.extend(this,this.defaults,this.mapdata,this.settings),this.poiList=void 0!==this.poiList&&null!=this.poiList?this.poiList:mappl10n.options.poiList,this.layout=this.layout?this.layout:mappl10n.options.layout,this.postid=this.postid?this.postid:mappl10n.options.postid},mapp.Map.prototype={display:function(){const{geocode:e}=(0,u.useGeocoding)({withBusinesses:this.isEditable});if(this.render(),!this.div||!this.div.layout)return;if(this.sanity(),this.query?this.templates={item:"mashup-item",popup:"mashup-popup"}:this.templates={item:"map-item",popup:"map-popup"},"leaflet"==mappl10n.options.engine?this.mapOpts=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null},this.mapOpts):this.mapOpts=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!this.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM}},this.mapOpts),this.mapOpts.minZoom=isNaN(parseInt(this.mapOpts.minZoom))?0:parseInt(this.mapOpts.minZoom),!this.div||!this.div.canvas)return;"leaflet"==mappl10n.options.engine?(this.map_=new L.Map(this.div.canvas.get(0),this.mapOpts),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_)):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),this.map_.setOptions(this.mapOpts),this.addLayers()),this.addGeolocateControl(),this.addMenu(),this.addPopup(),this.isFilterable()&&this.renderFilters(),this.setMapTypeId(this.mapTypeId),this.clustering(),this.addDrawingManager();const t=h(".mapp-search-container",this.div.layout);t.length&&wp.element.render(m(l.MappPlaces,{buttonLabel:this.isEditable?__("Add to map"):m("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:this.isEditable,includeBusinesses:this.isEditable,map:this,onSearch:e=>{this.onSearch?this.onSearch(e):this.doSearch(e)}}),t.get(0)),this.addUserLocation(),this.addEvents("click dragstart zoom_changed zoomstart",(e=>{"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||this.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(e=>{const t=h(e.currentTarget),i=t.attr("data-mapp-action"),n=t.attr("data-mapp-"+i);e.preventDefault(),this.onAction(i,n,t)})),new ResizeObserver(((e,t)=>{this.toggleView("mini"),this.resize()})).observe(this.div.layout.get(0)),e({map:null,value:this.center,callback:e=>{this.center=e&&e.geometry&&e.geometry.location?{lat:e.geometry.location.lat,lng:e.geometry.location.lng}:null,this.setPois(this.pois),this.initCenter()}})},initCenter:function(){setTimeout((()=>{this.recenter(),this.renderList(),this.isSearchable&&!this.isEditable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():mapp.event.addListenerOnce(this.map_,"idle",(()=>this.initOpen()))}),100)},initOpen:function(){const e=this.pois_.length?this.pois_[0]:null,t=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;e&&t&&!this.isEditable&&this.poiOpen(e)},addDrawingManager:function(){if(this.isEditable&&"google"==mappl10n.options.engine&&google.maps.drawing){const e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};this.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),this.drawingManager.setMap(this.map_),mapp.event.addListener(this.drawingManager,"overlaycomplete",(e=>{this.drawingManager.setDrawingMode(null),this.poiHover(null),this.onDrawingEvent&&this.onDrawingEvent(e)}))}},addEvents:function(e,t){e=e.split(" ");for(var i=0;i<e.length;i++)mapp.event.addListener(this.map_,e[i],t)},addGeolocateControl:function(){if(!mappl10n.options.ssl)return;const e=h(".mapp-geolocate-control-wrapper",this.div.layout).get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e):(L.Control.Geolocate=L.Control.extend({onAdd:t=>e,onRemove:()=>{}}),new L.Control.Geolocate({position:"bottomright"}).addTo(this.map_))},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var e=h.makeArray(this.layers),t=0;t<e.length;t++){var i=e[t].trim(),n=i.split(".").pop();this.layers_[i]?this.toggleLayer(i):"kml"==n||"kmz"==n?this.layers_[i]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:i}):"json"==n&&(this.layers_[i]=new google.maps.Data({map:this.map_}).loadGeoJson(i))}},addMenu:function(){this.isEditable||"leaflet"==mappl10n.options.engine||wp.element.render(m(a.MappMenuControl,{map:this,onCenter:()=>{this.poiClose(),this.recenter()}}),this.div.menu.get(0))},addPopup:function(){var e=this.isEditable?"mapp-iw-edit":"mapp-iw";this.isEditable||(e+=" mapp-"+this.templates.popup),this.div.iw=h('<div class="'+e+'">').appendTo(this.div.canvas),this.iw=new mapp.Infobox(this.map_,{className:this.isEditable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(()=>{this.poiClose()}))},addSearchMove:function(){},addUserLocation:function(){const{geolocate:e}=(0,u.useGeocoding)({withBusinesses:this.isEditable});mappl10n.options.userLocation&&mappl10n.options.ssl&&e((e=>{if(e&&e.geometry&&e.geometry.location){const t=e.geometry.location,i=o.mappLib.getIcon("geolocation");"leaflet"==mappl10n.options.engine?this.user_=L.marker([t.lat,t.lng],{icon:i}).addTo(this.map_):(this.user_=new mapp.Marker({icon:i,position:new google.maps.LatLng(t.lat,t.lng)}),this.user_.setMap(this.map_))}}),!0)},clusterGetLatLng:function(e){if(this.clusterer){if("leaflet"==mappl10n.options.engine){var t=this.clusterer.getVisibleParent(e.overlay);return t?t.getLatLng():null}for(var i=this.clusterer.getClusters(),n=0;n<i.length;n++){var s=i[n].markers_;if(s.length>1)for(var o=0;o<s.length;o++)if(s[o]==e.overlay)return i[n].center_}}},clustering:function(){if(mappl10n.options.clustering&&!this.isEditable){let e=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==e.disableClusteringAtZoom&&""==e.disableClusteringAtZoom&&(e.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup(e):(e=_.extend(e,{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"}),this.clusterer=new MarkerClusterer(this.map_,[],e))}},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){var e=[];for(let t=0;t<this.pois_.length;t++)this.pois_[t].type||e.push(this.pois_[t].overlay);"leaflet"==mappl10n.options.engine?(this.clusterer.addLayers(e),this.map_.addLayer(this.clusterer)):this.clusterer.addMarkers(e)}},fetchPois:function(e){var t=new Date;this.poiClose();var i={action:"mapp_query",debug:mappl10n.options.debug,filters:this.filters,query:this.query,url:{href:window.location.href,search:window.location.search}};this.xhr_&&this.xhr_.abort("cancel"),this.spinner(!0),this.pagination.page=1,this.xhr_=o.mappLib.ajax({data:i,callback:(i,n)=>{this.spinner(!1),i&&"OK"==i.status&&(this.setPois(i.data.pois),this.renderList(),mappl10n.options.debug&&console.log("Results: "+i.data.pois.length+" ("+n.responseText.length/1e3+"K) AJAX: "+(new Date-t)+(i.data.timing?i.data.timing:"")),e&&e())}})},fitBounds:function(e){return this.map_.fitBounds(e)},getBounds:function(){try{return this.map_.getBounds()}catch(e){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(e){return null}},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(e){return null}},isFilterable:function(){return mappl10n.options.pro&&mappl10n.options.filters&&mappl10n.options.filters.length>0&&!this.isEditable&&this.query},isSearchable:function(){return!!this.isEditable},onAction:function(e,t,i){switch(e){case"geolocate":const{geolocate:e}=(0,u.useGeocoding)({withBusinesses:this.isEditable});e((e=>{e&&e.geometry&&e.geometry.location&&this.setView(e.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1);break;case"sidebar-toggle":this.toggleSidebar();break;case"view-map":this.toggleSidebar(!1);break;case"view-list":this.toggleSidebar(!0);break;default:return!0}},doSearch:function(e){if(e&&e.geometry){var t=e.geometry.location?e.geometry.location:null,i=e.geometry.viewport?e.geometry.viewport:null;if("leaflet"==mappl10n.options.engine)var n=new L.LatLng(t.lat,t.lng),s=i?new L.LatLngBounds(new L.LatLng(i.sw.lat,i.sw.lng),new L.LatLng(i.ne.lat,i.ne.lng)):n.toBounds(1e3*mappl10n.options.radius);else{var o=new google.maps.Circle({center:t,radius:1e3*mappl10n.options.radius});s=i?new google.maps.LatLngBounds(new google.maps.LatLng(i.sw.lat,i.sw.lng),new google.maps.LatLng(i.ne.lat,i.ne.lng)).union(o.getBounds()):o.getBounds()}s&&this.fitBounds(s),this.setView(t)}},poiClose:function(){this.opened&&this.poiHighlight(this.opened,!1),this.opened=null,wp.element.unmountComponentAtNode(this.div.iw.get(0)),this.iw.close(),this.renderDirections({isOpen:!1}),this.renderList(),this.onPoiClose&&this.onPoiClose()},poiHighlight:function(e,t){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.isEditable||(t?e.highlight(!0):e.highlight(!1))},poiHover:function(e){e&&this.opened==e||(this.hovered&&this.hovered!=this.opened&&(this.poiHighlight(this.hovered,!1),this.hovered=null),e&&(this.hovered=e,this.poiHighlight(this.hovered,!0),mappl10n.options.tooltips&&!this.isEditable?(this.poiClose(),this.poiOpen(e,null,"popup")):this.poiHighlight(e,!0)),this.renderList())},poiInsert:function(e){this.pois_.unshift(e),e.setMap(this),this.renderList()},poiOpen:function(e,t){if(this.poiClose(),this.query&&e.postid&&e.url&&!this.isEditable&&!mappl10n.options.tooltips)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":const t=document.createElement("div");return document.body.appendChild(t),wp.element.render(m(c.MappPopupModal,{onClose:()=>{wp.element.unmountComponentAtNode(t),t.remove()},poi:e}),t)}this.div.layout.hasClass("mapp-view-mini")&&this.toggleSidebar(!1),this.popupOpen(e,t,"popup"),this.poiHighlight(e,!0),this.onPoiOpen&&this.onPoiOpen(e)},poiRemove:function(e){var t=h.inArray(e,this.pois_);-1!=t&&(this.pois_[t].setMap(null),this.pois_.splice(t,1),this.renderList())},popupClose:function(){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.isEditable||(this.iw.close(),this.renderDirections({isOpen:!1}),h(this).triggerHandler("mapp.close"))},popupOpen:function(e,t){let i=null;this.popupClose(),t&&t.featureData?i=t.featureData:t&&t.propagatedFrom&&t.propagatedFrom.feature&&t.propagatedFrom.feature.properties&&(i=t.propagatedFrom.feature.properties),this.isEditable||(wp.element.render(m(p.MappPoiContent,{feature:i,onDirectionsClick:()=>this.renderDirections({isOpen:!0,from:null,to:e}),poi:e,template:this.templates.popup,thumbs:mappl10n.options.thumbsPopup}),this.div.iw.get(0)),e.images&&e.images.length&&this.div.iw.addClass(" mapp-thumb-"+mappl10n.options.thumbsPopup));var n=this.clusterGetLatLng(e),s=n||e.getPosition(t);this.iw.open({position:s,anchorPoint:e.getAnchorPoint(t)}),this.opened=e},recenter:function(){var e=this.center&&this.center.hasOwnProperty("lat")&&this.center.hasOwnProperty("lng")?this.center:null,t=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null;if(e&&!t&&this.query)return void this.doSearch({geometry:{location:{lat:e.lat,lng:e.lng}}});if(e)return void this.setView(e,t||1);if(0==this.pois_.length)return void this.setView({lat:0,lng:0},t||1);if(1==this.pois_.length)return void this.pois_[0].center(t);let i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var n=0;n<this.pois_.length;n++){var s=this.pois_[n].getBounds(),o=this.pois_[n].getPosition();i=s?"leaflet"==mappl10n.options.engine?i.extend(s):i.union(s):i.extend(o)}t?this.setView(i.getCenter().toJSON(),t):this.fitBounds(i)},render:function(){let e=this.name?this.name+"-layout":"",t="mapp-layout",i=this.layout&&window.parent==window?this.layout:"left";if(t+="left"==i?" mapp-list-left":" mapp-inline",t+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",t+=this.classname?" "+this.classname:"",!document.body.classList.contains("block-editor-page")){let e=this.alignment?this.alignment:mappl10n.options.alignment;if(e){let i=" align"+e+" mapp-align-"+e;window.parent==window?t+=i:h(window.frameElement).parent().parent().addClass(i)}}var n=o.mappLib.template("map",{map:this,layout:i});if(this.sel){if(this.div.layout=h(this.sel),this.div.layout.html(n),this.div.layout.addClass(t),this.div.layout.attr("id",e),!this.div.layout.length)return console.log("MapPress: Missing map name or container for map: "+this.name)}else{let i=h('<div id="'+e+'" class="'+t+'">');i.html(n);let s=h("#"+this.name+"-layout");if(!s.length)return console.log("MapPress: Missing map name or container for map: "+this.name);s.replaceWith(i),this.div.layout=i}h.each(["canvas","content","controls","directions","filters","header","list","menu","search","sidebar","wrapper"],((e,t)=>{this.div[t]=h(".mapp-"+t,this.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderDirections:function(e){let{isOpen:t,from:i,to:s}=e;if(this.toggleView("directions",t),t){const e=s?s.getAddress():"",t=i?i.getAddress():"";wp.element.render(m(n.MappDirections,{from:t,to:e,onClose:()=>{wp.element.unmountComponentAtNode(this.div.directions.get(0)),this.toggleView("directions",!1)}}),this.div.directions.get(0))}else this.div.directions.length&&wp.element.unmountComponentAtNode(this.div.directions.get(0))},renderFilters:function(){this.div.filters&&this.div.filters.length&&wp.element.render(m(s.MappFilters,{onFilterChange:e=>{this.filters=e,this.fetchPois()},poiCount:this.pagination.count}),this.div.filters.get(0))},renderList:function(){let e=[];if(!this.poiList)return;if(this.isEditable)e=this.pois_;else{let t=this.getBounds();t&&_.map(this.pois_,((i,n)=>{t.contains(i.getPosition())&&e.push(i)}))}this.pagination.count!=e.length&&(this.pagination.count=e.length,this.renderFilters());let t="mapp-list-component";!this.isEditable&&mappl10n.options.thumbsList&&(t+=" mapp-thumb-"+mappl10n.options.thumbsList);const i=e=>this.pois_.find((t=>t.id==e)),n=(e,t)=>{let i=_.findIndex(this.pois_,(t=>t.id==e)),n=_.findIndex(this.pois_,(e=>e.id==t));this.pois_.splice(n,0,this.pois_.splice(i,1)[0])};wp.element.render(m(r.MappPoiList,{bounds:this.getBounds(),className:t,hoveredPoi:this.hovered?this.hovered.id:null,isEditable:this.isEditable,isPaged:!!this.query,map:this,onClick:e=>this.poiOpen(i(e)),onDragDrop:e=>{let{from:t,to:i}=e;return n(t,i)},onHover:e=>this.poiHover(i(e)),onPage:e=>{this.pagination.page=e,this.renderList()},onSort:e=>{this.pois_=e,this.renderList()},openPoi:this.opened?this.opened.id:null,page:this.pagination.page,pois:e,template:this.isEditable?null:this.templates.item}),this.div.list.get(0))},resetPois:function(){for(var e=0;e<this.pois_.length;e++)this.pois_[e].setMap(null);this.pois_=[],this.clustersReset()},resize:function(){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){const e="<a href='"+mappl10n.options.adminurl+"/admin.php?page=mappress'>"+__("MapPress Settings")+"</a>",t="<a href ='http://mappresspro.com/mappress-faq' target='_blank'>"+__("MapPress FAQ")+"</a>",i="<a href='http://mappresspro.com/chris-contact', target='_blank'>"+__("contact support")+"</a>",n="<br/>"+sprintf(__("Please see the %s for help, or %s and provide this error message."),t,i),s=sprintf("<div class='mapp-errors-toolbar'><div class='mapp-errors-apikey'>%s</a></div>",__("Get an API Key"));this.div.layout.on("click",".mapp-errors-apikey",(()=>{window.open("https://mappresspro.com/how-to-get-a-google-maps-api-key")}));let o=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:__("Leaflet library not loaded"),text:__("A theme or plugin is preventing the Leaflet library from loading.")+n},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:__("Google Maps API not loaded"),text:__("A theme or plugin is preventing Google Maps from loading.")+n},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:__("Google Maps API key required"),text:sprintf(__("Please enter a Google Maps API key in the %s, or switch to Leaflet maps."),e)+s},{condition:h('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1,title:__("Google Maps API loaded multiple times"),text:__("A theme or plugin has loaded Google Maps twice")+n},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")+n}];_.map(o,(e=>{if(e.condition){mappl10n.options.admin&&this.sanityOutput({title:e.title,text:e.text?e.text:""});let t=jQuery("<span>"+e.text.replace("<br/>","\n")+"</span>").text();console.error(__("Map error")+": "+e.title+" - "+t)}}))},sanityOutput(e){if(!h(".mapp-errors-overlay",this.div.content).length){let e="<div class='mapp-errors-overlay'></div><div class='mapp-errors'><div class='mapp-errors-header'>"+__("Oops! Something went wrong.")+"</div><div class='mapp-errors-list'></div></div>";this.div.content.prepend(e)}h(".mapp-errors-list",this.div.content).append("<div class='mapp-errors-title'>"+e.title+"</div><div class='mapp-errors-text'>"+e.text+"</div>")},set:function(e){for(let i in e){var t=e[i];switch(i){case"mapTypeId":this.mapTypeId=t,this.setMapTypeId(t);break;case"poiList":this.poiList=null==t?mappl10n.options.poiList:t,this.toggleSidebar(mappl10n.options.poiListOpen),this.toggleView("mini");break;case"search":this.search=t;break;case"style":this.setStyle(t);break;case"title":this.title=t;break;default:this[i]=t}}},setMapTypeId:function(e){const t=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),i=_.find(t,(t=>t.id==e));!mappl10n.options.style||"roadmap"!=e&&"streets"!=e&&i||(e=mappl10n.options.style);let n=_.find(t,(t=>t.id==e));n=n||t[0],this.setStyle(n)},setPois:function(e){if(this.resetPois(),e)for(var t=0;t<e.length;t++){var i=new mapp.Poi(e[t]);this.pois_.push(i),i.setMap(this)}this.clustersSet(),this.setLines()},setSize:function(e){var t=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];let i={},n={};if(e&&e.hasOwnProperty("width")&&(i={width:e.width?e.width:t.width}),e&&e.hasOwnProperty("height")){let i=e.height?e.height:t.height;n="string"==typeof i&&i.includes("%")?{"padding-bottom":i,height:"auto"}:{"padding-bottom":0,height:i}}window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?(h(window.frameElement).parent().parent().css(i),h(window.frameElement).parent().css(n)):this.embed?(i={height:"100%"},n={"padding-bottom":0,height:"100%"}):(this.div.layout.css(i),this.div.wrapper.css(n)),this.resize()},setStyle:function(e){if("leaflet"==mappl10n.options.engine){let t={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">© Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[e.provider],i=h.extend({},t,e);L.tileLayer(t.url,i).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==e.type?e.id:"roadmap"),e.json){let t=null;try{t=JSON.parse(e.json)}catch(e){console.log("Invalid JSON in map style")}this.map_.setOptions({styles:t||null})}else this.map_.setOptions({styles:null})},setLines:function(){if(this.polyline&&("leaflet"==mappl10n.options.engine?this.polyline.remove():this.polyline.setMap(null),this.polyline=null),this.isEditable||!this.lines&&!mappl10n.options.lines||this.pois_.length<2)return;const e={...mappl10n.options.lineOpts},t=[];if(_.map(this.pois_,(e=>{t.push(e.getPosition())})),"leaflet"==mappl10n.options.engine)this.polyline=new L.Polyline(t,e).addTo(this.map_);else{const i={strokeColor:e.color,strokeWeight:e.weight,strokeOpacity:e.opacity};e.icons&&(_.map(e.icons,(e=>{e.icon.path=parseInt(e.icon.path)})),e.icons[0].repeat="50px"),this.polyline=new google.maps.Polyline({map:this.map_,path:t,...e,...i}),e.animate&&e.icons&&e.icons.length&&this.setLinesAnimation()}},setLinesAnimation:function(){let e=0;const t=this.polyline.get("icons");t[0].repeat.replace("%","").replace("px",""),window.setInterval((()=>{e+=1,t[0].offset=e+(t[0].repeat.indexOf("%")>=0?"%":"px"),this.polyline.set("icons",t)}),20)},setView:function(e,t,i){"leaflet"==mappl10n.options.engine?(null==t&&(t=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(e,t,i)):(e=e&&!e.toJSON?{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}:e,t=t?parseInt(t):null,e&&this.map_.setCenter(e),t&&this.map_.setZoom(t))},spinner:function(e){this.div.layout.toggleClass("mapp-busy",e)},toggleLayer:function(e,t){t=void 0!==t?t:null==this.layers_[e].getMap(),h.each(["traffic","bicycling","transit"],((e,t)=>{this.layers_[t].setMap(null)})),t&&this.layers_[e].setMap(this.map_)},toggleSidebar:function(e){this.div.layout.toggleClass("mapp-sidebar-open",e),this.isSidebarOpen=e,setTimeout((()=>this.resize()),100)},togglePois:function(e){e=!!e;for(var t=0;t<this.pois_.length;t++)this.pois_[t].setVisible(e)},toggleView:function(e,t){if("mini"==e){let e=this.div.layout.hasClass("mapp-view-mini"),t=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",t),void(t!=e&&this.toggleSidebar(!t))}t=void 0===t?!this.div.layout.hasClass("mapp-view-"+e):t,this.div.layout.toggleClass("mapp-view-"+e,t),"list"==e&&t&&this.renderList(),"directions"==e&&this.resize()},toJSON:function(){this.pois=[];for(var e=0;e<this.pois_.length;e++)this.pois.push(this.pois_[e].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,postid:this.postid,search:this.search,title:this.title,width:this.width,zoom:this.zoom}}}},689:()=>{var e;window.mapp=window.mapp||{},e=jQuery,mapp.Infobox=function(t,i){this.map=t,this.anchorPoint=null,this.fudge=30,this.isOpen=!1,this.mapDiv="leaflet"==mappl10n.options.engine?t.getContainer():t.getDiv(),this.node=null,this.opts=_.extend({clip:!0,pan:!0},i),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null,this.wrapper=e('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib-content"><div class="mapp-ib" tabindex="0"></div><div class="mapp-ib-tip"></div></div></div>'),i&&i.className&&this.wrapper.addClass(i.className),this.node=e(".mapp-ib-content",this.wrapper),"leaflet"==mappl10n.options.engine?mapp.event.addListener(this.map,"move",(e=>{this.isOpen&&this.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=()=>{this.isOpen&&this.draw()}),this.node.get(0).addEventListener("load",(()=>{"leaflet"==mappl10n.options.engine?this.open({position:this.position,anchorPoint:this.anchorPoint}):mapp.event.addListenerOnce(this.map,"panend",(e=>{this.open({position:this.position,anchorPoint:this.anchorPoint})}))}),{capture:!0});var n="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(n),"leaflet"==mappl10n.options.engine&&t.on("load",(()=>{L.DomEvent.disableClickPropagation(this.wrapper.get(0))}))},mapp.Infobox.prototype={close:function(){this.isOpen=!1,this.wrapper&&this.wrapper.removeClass("mapp-open")},draw:function(){if(document.fullscreenElement||this.map.isFullscreen)return;if(!this.position)return;let e,t,i;if(e=this.node.outerWidth(),t=this.node.outerHeight(),"leaflet"==mappl10n.options.engine)i=this.map.latLngToContainerPoint(this.position);else{const e=this.overlayView.getProjection();if(!e)return;i=e.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:i.x-e/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-i.y-this.anchorPoint.y})},getContent:function(){return e(".mapp-ib",this.node).get(0)},open:function(e){this.position=e.position,this.anchorPoint=e.anchorPoint?e.anchorPoint:{x:0,y:0},this.wrapper.addClass("mapp-open"),this.wrapper.css({left:0,bottom:0,width:"auto",height:"auto"});const t=this.wrapper.get(0).offsetWidth,i=this.wrapper.get(0).offsetHeight;this.wrapper.css({width:t,height:i}),"leaflet"==mappl10n.options.engine&&this.map.stop(),this.isOpen=!0,this.draw(),this.pan()},pan:function(){const t=this.node.outerWidth(),i=this.node.outerHeight(),n=e(this.mapDiv).width(),s=e(this.mapDiv).height();if("leaflet"==mappl10n.options.engine)var o=this.map.latLngToContainerPoint(this.position);else{var a=this.overlayView.getProjection();o=a?a.fromLatLngToContainerPixel(this.position):null}if(!o)return;var l={x:o.x,y:o.y};o.x+t/2+this.anchorPoint.x>n-this.fudge?l.x=Math.max(n-t/2-this.anchorPoint.x-this.fudge,n/2-this.anchorPoint.x):o.x-t/2+this.anchorPoint.x<this.fudge&&(l.x=Math.min(t/2+this.anchorPoint.x+this.fudge,n/2-this.anchorPoint.x)),o.y+this.anchorPoint.y-i<this.fudge&&(l.y=i-this.anchorPoint.y+this.fudge),l.y>=s&&(l.y=s-this.fudge);const p={x:o.x-l.x,y:o.y-l.y};p.x<=-1||p.x>=1||p.y<=-1||p.y>=1?"leaflet"==mappl10n.options.engine?this.map.panBy([p.x,p.y]):(mapp.event.addListenerOnce(this.map,"idle",(e=>{mapp.event.trigger(this.map,"panend")})),this.map.panBy(p.x,p.y)):mapp.event.trigger(this.map,"panend")},setContent:function(t){e(".mapp-ib",this.node).empty().append(t)}}},628:()=>{var e;window.mapp=window.mapp||{},e=jQuery,mapp.lib={template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var n=mappl10n.options.templates?mappl10n.options.template[t]:e("#mapp-tmpl-"+t).html();if(!n)return"";mapp.lib.templates[t]=_.template(n,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return mapp.lib.templates[t](i)}},jQuery,mapp.event={addListener:function(e,t,i){t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?e.on(t[n],i):google.maps.event.addListener(e,t[n],i)},addListenerOnce:function(e,t,i){t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?e.once(t[n],i):google.maps.event.addListenerOnce(e,t[n],i)},clearInstanceListeners:function(e){"leaflet"==mappl10n.options.engine?e.off():google.maps.event.clearInstanceListeners(e)},clearListeners:function(e,t){t=t.split(" ");for(var i=0;i<t.length;i++)"leaflet"==mappl10n.options.engine?e.off(t[i]):google.maps.event.clearListeners(e,t[i])},trigger:function(e,t,i){"leaflet"==mappl10n.options.engine?e.fire(t,i):google.maps.event.trigger(e,t,i)}}},692:()=>{window.mapp=window.mapp||{},jQuery,mapp.load=function(){if("undefined"!=typeof mapp&&mapp.data)for(;mapp.data.length;){var e=mapp.data.pop();window[e.name]=new mapp.Map(e),window[e.name].display()}},mapp.load()},436:()=>{var e;window.mapp=window.mapp||{},e=jQuery,mapp.Marker=function(e){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(e),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove()},mapp.Marker.prototype={draw:function(){if(!this.div||!this.icon)return;let t=this.overlayView.getProjection();if(t){let i=t.fromLatLngToDivPixel(this.position),n=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};e(this.div).css({left:i.x-n.width/2,top:i.y-n.height})}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(e){let t="on"+e.type[0].toUpperCase()+e.type.slice(1);this[t]&&this[t](e)},onAdd:function(){let t=this.overlayView.getPanes();t&&(this.div=e('<div class="mapp-marker">'),this.div.appendTo(t.overlayMouseTarget),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div.get(0)),this.div.get(0).addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&mapp.event.trigger(this,"click"),this.dragging=null})),this.div.get(0).addEventListener("mouseenter",this),this.div.get(0).addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(e){mapp.event.trigger(this,"mouseover")},onMouseleave:function(e){mapp.event.trigger(this,"mouseout")},onPointerdown:function(e){const t=this.map.getDiv().getBoundingClientRect(),i=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:e.clientX,y:e.clientY},offset:{x:i.x-(e.clientX-t.left),y:i.y-(e.clientY-t.top)}},this.toggleDragEvents(!0)},onPointermove:function(e){if(Math.abs(e.clientX-this.dragging.startPixel.x)+Math.abs(e.clientY-this.dragging.startPixel.y)<3)return;const t=this.map.getDiv().getBoundingClientRect();let i={x:e.clientX-t.left+this.dragging.offset.x,y:e.clientY-t.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(i)),this.draw(),this.dragging.moved=!0,mapp.event.trigger(this,"dragstart")},onPointercancel:function(e){this.onPointerup(e)},onPointerup:function(e){this.dragging&&this.dragging.moved&&mapp.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(e,t){let i="set"+e[0].toUpperCase()+e.slice(1);this[i]&&this[i](t)},setDraggable:function(e){this.draggable=e,this.map&&(this.div.get(0).removeEventListener("pointerdown",this,{passive:!0}),e&&this.div.get(0).addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(e){if(void 0!==e&&(this.icon=e),this.icon&&this.div){let e='<img draggable="false" src="'+this.icon.url+'">';this.div.html(e);let t=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:t.width,height:t.height}),this.setZIndex(),this.draw()}},setMap:function(e){this.map=e,this.overlayView.setMap(e)},setPosition:function(e){this.position=e},setValues:function(e){for(const t in e)this.set(t,e[t])},setVisible:function(e){this.visible=e,this.div&&this.div.css("visibility",e?"visible":"hidden")},setZIndex:function(e){this.zIndex=void 0!==e?e:this.zIndex,this.div&&this.div.css("z-index",e)},toggleDragEvents(e){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),e&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},548:(e,t,i)=>{"use strict";i.r(t);var n=i(939);window.mapp=window.mapp||{};var s;s=jQuery,mapp.Poi=function(e){if(this.defaults={address:null,body:null,html:null,iconid:null,id:null,images:null,kml:null,map:null,overlay:null,postid:null,poly:null,props:null,title:"",url:null,type:null,viewport:null},s.extend(this,this.defaults,e),this.id=n.mappLib.nanoid(),e&&e.correctedAddress&&(this.address=e.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),!e.overlay)switch(this.type){case"polygon":this.overlay=new google.maps.Polygon({paths:e.poly.paths}),this.setColors(e.poly);break;case"polyline":this.overlay=new google.maps.Polyline({path:e.poly.path}),this.setColors(e.poly);break;case"circle":var t=new google.maps.LatLng(e.point.lat,e.point.lng);this.overlay=new google.maps.Circle({center:t,radius:parseFloat(e.poly.radius)}),this.setColors(e.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:mapp.poi.viewportToBounds(this.viewport)}),this.setColors(e.poly);break;case"kml":var i=e.kml&&e.kml.url?e.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(i):new google.maps.KmlLayer({url:i,preserveViewport:!0,suppressInfoWindows:!0});break;default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([e.point.lat,e.point.lng]):this.overlay=new mapp.Marker({position:new google.maps.LatLng(e.point.lat,e.point.lng)}),this.set({iconid:e.iconid})}},mapp.Poi.prototype={addEvents:function(){mapp.event.clearInstanceListeners(this.overlay),mapp.event.addListener(this.overlay,"click",(e=>{this.open(e)})),mapp.event.addListener(this.overlay,"mouseover",(e=>{this.map.poiHover(this)})),mapp.event.addListener(this.overlay,"mouseout",(e=>{this.map.poiHover(null)})),"kml"==this.type&&this.addKmlEvents(),this.map.isEditable&&(this.addPolyEditEvents(!0),this.map.isEditable&&mapp.event.addListener(this.overlay,"dragstart",(()=>{this.viewport=null,this.addPolyEditEvents(!1)})),mapp.event.addListener(this.overlay,"dragend",(()=>{this.updateFromOverlay(),this.addPolyEditEvents(!0)})))},addKmlEvents:function(){"leaflet"==mappl10n.options.engine?(mapp.event.addListenerOnce(this.overlay,"ready",(()=>{this.updateFromOverlay()})),mapp.event.addListenerOnce(this.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+this.kml.url)}))):(mapp.event.addListener(this.overlay,"defaultviewport_changed",(()=>{this.updateFromOverlay()})),mapp.event.addListener(this.overlay,"status_changed",(()=>{"OK"!=this.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+this.kml.url)})))},addPolyEditEvents(e){this.isPoly()&&"google"==mappl10n.options.engine&&("rectangle"==this.type&&(mapp.event.clearListeners(this.overlay,"bounds_changed"),e&&mapp.event.addListener(this.overlay,"bounds_changed",(()=>{this.updateFromOverlay()}))),"circle"==this.type&&(mapp.event.clearListeners(this.overlay,"center_changed radius_changed"),e&&mapp.event.addListener(this.overlay,"center_changed radius_changed",(()=>{this.updateFromOverlay()}))),"polygon"!=this.type&&"polyline"!=this.type||(mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),e&&(mapp.event.addListener(this.overlay,"rightclick",(e=>{null!=e.vertex&&this.overlay.getPath().getLength()>2&&(this.overlay.getPath().removeAt(e.vertex),this.updateFromOverlay())})),mapp.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(()=>{this.updateFromOverlay()})))))},center:function(e){var t=this.getBounds();if("number"!=typeof e)if(t){var i=t.getNorthEast().toJSON().lng-t.getSouthWest().toJSON().lng;i<0&&(i+=360),e=Math.round(Math.log(360*this.map.div.canvas.width()/i/256)/Math.LN2),this.map.setView(this.getPosition(),e,{animate:!1})}else this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));else this.map.setView(this.getPosition(),e)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(e){switch(this.isPoly()?"poly":this.type){case"kml":return e&&e.pixelOffset?{x:e.pixelOffset.width,y:e.pixelOffset.height}:{x:0,y:0};case"poly":return{x:0,y:0};default:return mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32}}},getBounds:function(){var e;switch(this.type){case"polyline":e=new google.maps.LatLngBounds,this.overlay.getPath().forEach((function(t){e.extend(t)}));break;case"polygon":e=new google.maps.LatLngBounds,this.overlay.getPaths().forEach((function(t){t.forEach((function(t){e.extend(t)}))}));break;case"rectangle":case"circle":e=this.overlay.getBounds();break;case"kml":e=(e="leaflet"==mappl10n.options.engine?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport())||mapp.poi.viewportToBounds(this.viewport);break;default:return mapp.poi.viewportToBounds(this.viewport)}return e},getColors:function(){var e={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})void 0!==this.overlay[t]&&(e[t]=this.overlay[t]);return e},getPosition:function(e){if(this.point)return"leaflet"==mappl10n.options.engine?L.latLng(this.point):new google.maps.LatLng(this.point.lat,this.point.lng);if("kml"==this.type&&e&&e.latLng)return e.latLng;const t=this.getBounds();return"leaflet"==mappl10n.options.engine?t&&t.isValid()?t.getCenter():new L.latLng(0,0):t?t.getCenter():new google.maps.LatLng(0,0)},highlight:function(e){if(!this.type){var t="leaflet"==mappl10n.options.engine?s(this.overlay._icon):this.overlay.getDiv();if(t){switch(this.map&&this.map.isEditable?"circle":mappl10n.options.highlight){case"circle":t.toggleClass("mapp-marker-circle",e);break;case"icon":var i=e?n.mappLib.getIcon(mappl10n.options.highlightIcon):n.mappLib.getIcon(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==i.options.iconUrl)return;this.overlay.setIcon(i);break;case"scale":t.addClass("mapp-marker"),t.toggleClass("mapp-marker-scale",e)}this.setZIndex(e?1e4:0)}}},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},open:function(e){this.map.poiOpen(this,e)},set:function(e){for(var t in e){var i=e[t];"iconid"===t?this.type||(this.iconid=i,this.overlay.setIcon(n.mappLib.getIcon(i))):this[t]=i}},setColors:function(e){var t={};for(var i in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})e&&void 0!==e[i]&&(t[i]=e[i]);this.overlay.setOptions(t)},setEditable:function(e){"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=e:this.overlay.setDraggable(e),this.isPoly()&&this.overlay.setEditable(e))},setMap:function(e){this.map=e,null!=e?(this.setEditable(this.map.isEditable),this.addEvents(),!this.type&&this.map.clusterer||("leaflet"==mappl10n.options.engine?this.overlay.addTo(e.getMap()):this.overlay.setMap(e.getMap()))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setVisible:function(e){void 0!==this.overlay.setVisible&&this.overlay.setVisible(e)},setZIndex:function(e){"leaflet"==mappl10n.options.engine?this.type||this.overlay.setZIndexOffset(e):this.overlay.set("zIndex",e)},toJSON:function(){var e={address:this.address,body:this.body,iconid:this.iconid,images:this.images,point:this.point,title:this.title,type:this.type,viewport:this.viewport};return"kml"==this.type?e.kml=this.kml:this.isPoly()&&(e.poly=this.poly),e},updateFromOverlay(){_.extend(this,mapp.poi.parseOverlay(this.type,this.overlay))}},mapp.poi={boundsToViewport:function(e){return e?{sw:e.getSouthWest().toJSON(),ne:e.getNorthEast().toJSON()}:null},boundsCenterPoint:function(e){return e&&e.isValid()?e.getCenter().toJSON():{lat:0,lng:0}},pointToLatLng:function(e){return e?"leaflet"==mappl10n.options.engine?L.latLng(this.point):new google.maps.LatLng(e.lat,e.lng):null},viewportToBounds:function(e){return e&&e.sw&&e.ne?"leaflet"==mappl10n.options.engine?new L.LatLngBounds(L.latLng(e.sw.lat,e.sw.lng),L.latLng(e.ne.lat,e.ne.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(e.sw.lat,e.sw.lng),new google.maps.LatLng(e.ne.lat,e.ne.lng)):null},parseOverlay:function(e,t){if("google"==mappl10n.options.engine){if("kml"==e){const e=t.getDefaultViewport();return{point:e?e.getCenter().toJSON():null,viewport:e?mapp.poi.boundsToViewport(e):null}}const i=t instanceof google.maps.Polyline?{strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,stokeWeight:t.strokeWeight}:{fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight};if("circle"==e)return{point:t.getCenter().toJSON(),poly:{radius:t.getRadius(),...i}};if("rectangle"==e)return{viewport:mapp.poi.boundsToViewport(t.getBounds()),poly:{...i}};if("polyline"==e){const e=[];return t.getPath().forEach((function(t){e.push(t.toJSON())})),{poly:{path:e,...i}}}if("polygon"==e){const e={fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight},i=[];return t.getPaths().forEach((function(e){var t=[];e.forEach((function(e){t.push(e.toJSON())})),i.push(t)})),{poly:{paths:i,...e}}}if(!e)return{point:t.getPosition().toJSON()}}else{if("kml"==e){const e=t.getBounds();return{point:e&&e.isValid()?e.getCenter().toJSON():null,viewport:e&&e.isValid()?mapp.poi.boundsToViewport(e):null}}if(!e)return{point:"leaflet"==mappl10n.options.engine?t.getLatLng().toJSON():t.getPosition().toJSON()}}}}}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(117),i(715),i(817),i(10),i(326),i(939),i(602),i(27),i(818),i(50),i(615),i(892),i(628),i(854),i(689),i(436),i(548),i(692)})();
|
1 |
+
(()=>{var e={117:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappAutocomplete:()=>m});var n=i(326);const s=wp.element.createElement,{Fragment:o,useCallback:a,useEffect:l,useLayoutEffect:p,useMemo:r,useRef:c,useState:u}=wp.element;function m(e){e={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...e};const t=c(null),i=c(null),[o,a]=u({isOpen:!1,value:""});function p(e){a((t=>({...t,...e})))}(0,n.useClickOutside)(t,(()=>{o.isOpen&&p({isOpen:!1})})),l((()=>{e.focus&&i.current&&i.current.focus()}),[i.current]),l((()=>{o.map&&setMapTypeId(e.mapTypeId)}),[e.mapTypeId,o.map]);const r=(0,n.useDebounce)((t=>{e.onFetch&&e.onFetch(t)}),e.delay);function m(){let t;p({isOpen:!1}),e.suggestions&&(t=null==o.selected?e.suggestions[0]:e.suggestions[o.selected]),e.onSelect({suggestion:t,value:h})}const h=o.selected>=0&&e.suggestions&&e.suggestions[o.selected]?e.suggestions[o.selected].value:o.value;return s("div",{className:"mapp-autocomplete",ref:t},s("div",{className:"mapp-autocomplete-wrapper"},s("input",{className:e.className,onChange:e=>{!function(e){p({value:e,selected:null}),r(e)}(e.target.value)},onKeyDownCapture:t=>function(t){switch(t.stopPropagation(),t.code){case"Backspace":p({isOpen:o.value.length>1});break;case"Enter":m();break;case"Escape":p({isOpen:!1});break;case"ArrowUp":if(t.preventDefault(),e.suggestions&&0!=o.selected){const t=null==o.selected?e.suggestions.length-1:o.selected-1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"ArrowDown":if(e.suggestions&&o.selected<e.suggestions.length-1){const t=null==o.selected?0:o.selected+1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:p({isOpen:!0})}}(t),placeholder:e.placeholder,ref:i,title:e.title,type:"text",value:h}),o.isOpen&&s("div",{className:"mapp-autocomplete-list"},_.map(e.suggestions,((t,i)=>{const n="mapp-autocomplete-item"+(o.selected==i?" mapp-selected":"");return s("div",{className:n,key:i,onClick:()=>function(t,i){p({isOpen:!1,selected:i}),e.onSelect({suggestion:t})}(t,i)},t.value)})))),e.buttonLabel&&s("div",{className:"mapp-submit-button",onClick:()=>m()},e.buttonLabel))}},715:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappDirections:()=>r});const n=wp.element.createElement,{Fragment:s,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(e){e={from:null,onClose:null,to:null,...e};const[t,i]=p({from:e.from?e.from:"",to:e.to?e.to:""});function s(e){i((t=>({...t,...e})))}function a(){e.onClose&&e.onClose()}function l(){const e=t.from.trim(),i=t.to.trim();let n=mappl10n.options.directionsServer;n="https://maps.google.com"==n?"https://www.google.com":n,-1==n.toLowerCase().indexOf("http")&&(n="https://"+n),n+="/maps/dir/?api=1&origin="+encodeURIComponent(e)+"&destination="+encodeURIComponent(i),window.open(n),a()}function r(e){13==e?l():27==e&&a()}return o((()=>{"google"==mappl10n.options.directions&&l()}),[]),"google"==mappl10n.options.directions?null:n("div",{className:"mapp-directions-component"},n("div",{className:"mapp-close",onClick:()=>a()}),n("div",null,n("input",{className:"mapp-dir-from",onChange:e=>s({from:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"1",placeholder:__("My location"),value:t.from}),n("div",{className:"mapp-dir-arrows",onClick:()=>{s({from:t.to,to:t.from})}})),n("div",null,n("input",{className:"mapp-dir-to",onChange:e=>s({to:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"2",value:t.to})),n("div",{className:"mapp-dir-toolbar"},n("div",{className:"mapp-submit-button",onClick:()=>l()},__("Get Directions"))))}},817:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappFilters:()=>u});var n=i(939),s=i(326);const o=wp.element.createElement,{Fragment:a,useEffect:l,useLayoutEffect:p,useRef:r,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf,u=e=>{e={onFilterChange:null,otype:"post",poiCount:0,...e};const t=(0,s.useDebounce)(e.onFilterChange,500),i=r(null),[a,p]=c({filters:null,formData:{},isBusy:!0,isOpen:!1});function u(e){p((t=>({...t,...e})))}function m(e,i){let n=a.formData[e.key]?a.formData[e.key].values:null;if("checkbox"==e.format){var s;const e=null===(s=n)||void 0===s?void 0:s.indexOf(i);e>-1?n.splice(e,1):(n=n||[],n.push(i))}else n=i?[i]:[];let o={...a.formData};n.length?o[e.key]={key:e.key,values:n,meta_key:e.meta_key,meta_values:e.meta_values}:delete o[e.key],u({formData:o}),t(o)}function h(){u({formData:{}}),t()}function g(e){u({isOpen:e=void 0!==e?e:!a.isOpen})}function d(e){return o("div",{className:"mapp-filter",key:e.key},o("div",{className:"mapp-filter-label"},e.label),o("div",{className:"mapp-filter-values"},function(e){e.key;const t=[...e.values];let i=a.formData[e.key]?a.formData[e.key].values:"";switch(e.format){case"input":return o("input",{type:"text",value:i?i[0]:"",onChange:t=>m(e,t.target.value)});case"checkbox":return _.map(t,(t=>o("label",{key:t.value},o("input",{checked:null==i?void 0:i.includes(t.value),key:t.value,onChange:t=>m(e,t.target.value),type:e.format,value:t.value}),t.iconid&&o("img",{className:"mapp-icon",src:n.mappLib.getIconUrl(t.iconid)}),t.label)));case"radio":return"radio"==e.format&&t.unshift({value:"",label:__("All")}),_.map(t,(t=>o("label",{key:t.value},o("input",{checked:i==t.value||""==t.value&&!i,key:t.value,onChange:t=>m(e,t.target.value),type:e.format,value:t.value}),t.iconid&&o("img",{className:"mapp-icon",src:n.mappLib.getIconUrl(t.iconid)}),t.label)));case"select":return t.unshift({value:"",label:""}),o("select",{value:i[0],onChange:t=>m(e,t.target.value)},_.map(t,(e=>o("option",{key:e.value,value:e.value},e.label))))}}(e)))}return(0,s.useClickOutside)(i,(()=>{a.isOpen&&g(!1)})),l((()=>{u({isBusy:!0}),n.mappLib.ajax({data:{action:"mapp_filters_get",nonce:mappl10n.options.nonce,otype:e.otype},callback:e=>{u({isBusy:!1}),e&&"OK"==e.status?u({filters:e.data}):console.error("MapPress: unable to fetch filter data")}})}),[]),o("div",{className:"mapp-filters-component",ref:i},function(){const e="mapp-button mapp-filters-toggle mapp-button-caret"+(a.isBusy?" mapp-button-disabled":"");return o("div",{className:e,onClick:()=>{a.isBusy||g()}},__("Filter"))}(),a.isOpen&&null!==a.filters&&o("div",{className:"mapp-filters-wrapper"},o("div",{className:"mapp-filters-list"},_.map(a.filters,(e=>d(e)))),function(){let t=e.poiCount>1?__("%d Results"):__("%d Result");return t=sprintf(t,e.poiCount),o("div",{className:"mapp-filters-toolbar"},o("div",{className:"mapp-link-button",onClick:h},__("Reset")),o("div",{className:"mapp-filters-count"},t),o("div",{className:"mapp-submit-button",onClick:()=>g(!1)},__("Done")))}()))}},10:(e,t,i)=>{"use strict";i.r(t),i.d(t,{useGeocoding:()=>c});wp.element.createElement;const{Fragment:n,useCallback:s,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,r={google:function(){this.token=null;const e=document.createElement("div");this.placesService=new google.maps.places.PlacesService(e),this.autocompleteService=new google.maps.places.AutocompleteService}};r.google.prototype={getDetails:function(e){let{suggestion:t,callback:i}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var n={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(n,(function(e,t){if("OK"==t&&e&&e.geometry){if(e.geometry.location&&(e.geometry.location=e.geometry.location.toJSON()),e.geometry.viewport){var n=e.geometry.viewport.toJSON();e.geometry.viewport={sw:{lat:n.south,lng:n.west},ne:{lat:n.north,lng:n.east}}}i(e)}else i(null)}))},getFirstPrediction:function(e){let{map:t,value:i,callback:n}=e;this.getPredictions({map:t,value:i,callback:e=>{e&&Array.isArray(e)?this.getDetails({suggestion:e[0],callback:e=>n(e)}):n(null)}})},getPredictions:function(e){let{map:t,value:i,includeBusinesses:n,callback:s}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var o=t?t.getBounds():null;"leaflet"==mappl10n.options.engine&&(o=new google.maps.LatLngBounds(new google.maps.LatLng(o.getSouthWest().lat,o.getSouthWest().lng),new google.maps.LatLng(o.getNorthEast().lat,o.getNorthEast().lng)));var a={input:i,bounds:o=o||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:n?null:["geocode"]};this.autocompleteService.getPlacePredictions(a,(function(e,t){"OK"==t&&e&&e.length?(e=(e=e.map((e=>(e.value=e.description,e)))).filter((e=>e.place_id)),s(e)):(t==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):t==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),s(null))}))}},r.mapbox=function(){},r.mapbox.prototype={getDetails:function(e){let{suggestion:t,callback:i}=e,n=t.place_name,s=n.indexOf(","),o=n.indexOf(",",s+1);s>0&&(n=parseInt(n.substr(0,s))?n.substr(0,o).replace(",",""):n.substr(0,s));let a=t.bbox&&4==t.bbox.length?{sw:{lat:t.bbox[1],lng:t.bbox[0]},ne:{lat:t.bbox[3],lng:t.bbox[2]}}:null;i({formatted_address:t.place_name,name:n,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:a}})},getFirstPrediction:function(e){let{map:t,value:i,callback:n}=e;this.getPredictions({map:t,value:i,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>n(e)}):n(null)}})},getPredictions:function(e){let{map:t,value:i,callback:n}=e;var s="https://api.mapbox.com/geocoding/v5/mapbox.places/"+i+".json?access_token="+mappl10n.options.mapbox;s=mappl10n.options.country?s+"&country="+mappl10n.options.country.toLowerCase():s,s=mappl10n.options.language?s+"&language="+mappl10n.options.language.toLowerCase():s;var o=t?t.getCenter():null;o&&(s+="&proximity="+o.lng+","+o.lat),mappl10n.options.searchBox&&(s+="&bbox="+mappl10n.options.searchBox),fetch(s).then((e=>e.json())).then((e=>{e&&e.features&&e.features.length>0?(e.features=e.features.map((e=>(e.value=e.label=e.place_name,e))),n(e.features)):n(null)}))}},r.nominatim=function(){},r.nominatim.prototype={getDetails:function(e){let{suggestion:t,callback:i}=e,n=t.display_name,s=n.indexOf(","),o=n.indexOf(",",s+1);s>0&&(n=parseInt(n.substr(0,s))?n.substr(0,o).replace(",",""):n.substr(0,s));let a=t.boundingbox&&4==t.boundingbox.length?{sw:{lat:t.boundingbox[0],lng:t.boundingbox[2]},ne:{lat:t.boundingbox[1],lng:t.boundingbox[3]}}:null;i({formatted_address:t.display_name,name:n,geometry:{location:{lat:t.lat,lng:t.lon},viewport:a}})},getFirstPrediction:function(e){let{map:t,value:i,callback:n}=e;this.getPredictions({map:t,value:i,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>n(e)}):n(null)}})},getPredictions:function(e){let{map:t,value:i,callback:n}=e;var s="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(i);if(s=mappl10n.options.country?s+"&countrycodes="+mappl10n.options.country.toLowerCase():s,s=mappl10n.options.language?s+"&accept-language="+mappl10n.options.language.toLowerCase():s,mappl10n.options.searchBox)s+="&viewbox="+mappl10n.options.searchBox,s+="&bounded=1";else{var o=t?t.getMap().getBounds():null;if(o){let e=o.getSouthWest(),t=o.getNorthEast();s+="&viewbox="+e.lng+","+e.lat+","+t.lng+","+t.lat}}fetch(s).then((e=>e.json())).then((e=>{e&&e.length?(e=e.map((e=>(e.value=e.display_name,e))),n(e)):n(null)}))}};const c=e=>{let{includeBusinesses:t}=e;function i(){let e="";return e="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new r[e]}function n(e,t){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){var i={lat:t.coords.latitude,lng:t.coords.longitude};e({name:i.lat+", "+i.lng,geometry:{location:i}})}),(function(i){if(!t){var n=i&&i.message?" : "+i.message:"";alert(mappl10n.no_geolocate+n)}e(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(e){let{map:s,suggestion:o,value:a,callback:l}=e;const p=i();a="string"==typeof a?a.trim():a,o||a?function(e){let{map:t,value:i,callback:s}=e;if(!i)return void s(null);if("string"!=typeof i){const e=i.lat&&i.lng?{geometry:{location:{lat:i.lat,lng:i.lng}}}:null;return void s(e)}if("http"==i.substring(0,4))return void s(i);if("user"==i)return void n((function(e){s(e)}));const o=i.split(",");if(2==o.length){const e=parseFloat(o[0]),t=parseFloat(o[1]);if(!isNaN(e)&&!isNaN(t))return void s({name:e+", "+t,geometry:{location:{lat:e,lng:t}}})}s(null)}({map:s,value:a,callback:e=>{e?l(e):o?p.getDetails({suggestion:o,callback:l}):p.getFirstPrediction({map:s,value:a,includeBusinesses:t,callback:l})}}):l(null)},geolocate:n,getPredictions:function(e){let{map:t,value:n,callback:s}=e;i().getPredictions({map:t,value:n,callback:s})}}}},326:(e,t,i)=>{"use strict";i.r(t),i.d(t,{useDebounce:()=>c,useClickOutside:()=>u});wp.element.createElement;const{Fragment:n,useCallback:s,useEffect:o,useLayoutEffect:a,useMemo:l,useRef:p,useState:r}=wp.element;function c(e,t){const i=React.useRef(e);return React.useLayoutEffect((()=>{i.current=e})),React.useMemo((()=>_.debounce((function(){return i.current(...arguments)}),t)),[t])}function u(e,t){const i=i=>{e.current&&!e.current.contains(i.target)&&t()};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}},939:(e,t,i)=>{"use strict";i.r(t),i.d(t,{mappLib:()=>c});wp.element.createElement;const{Fragment:n,useCallback:s,useEffect:o,useLayoutEffect:a,useMemo:l,useRef:p,useState:r}=wp.element,c={ajax:function(e){const t={callback:null,data:null,dataType:"json",silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(t,i,n){"json"==e.dataType&&e.url==mappl10n.options.ajaxurl&&"OK"!=t.status&&c.alert(t.status),"json"==e.dataType&&t.output?c.alert("AJAX Invalid Output\r\n"+t.output):e.callback&&e.callback(t,n)},error:function(t,i,n){"cancel"!=i&&(void 0!==n&&""!=n&&c.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+n+"\r\nResponseText="+t.responseText),e.callback&&e.callback(null))}};return e={...t,...e},jQuery.ajax(e)},alert:function(e){mappl10n.options.admin||mappl10n.options.debug?alert(e):window.console&&console.error(e)},getIcon:function(e){{const t=this.getIconUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:t,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:t}}},getIconUrl:function(e){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"},nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;const t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let i="",n=e;for(;n--;)i+=t[64*Math.random()|0];return i},template:function(e,t){if(c.templates=c.templates?c.templates:{},!c.templates[e]){var i=document.getElementById("mapp-tmpl-"+e).innerHTML;if(!i)return"";c.templates[e]=_.template(i,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return c.templates[e](t)}};"leaflet"==mappl10n.options.engine&&"undefined"!=typeof L&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6})},602:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappMenuControl:()=>c});var n=i(326);const s=wp.element.createElement,{Fragment:o,useEffect:a,useLayoutEffect:l,useRef:p,useState:r}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function c(e){e={layer:null,map:null,onCenter:null,...e};const[t,i]=r({activeLayer:e.layer?e.layer:null,layers:null,isOpen:!1}),l=p(null);function c(e){i((t=>({...t,...e})))}function u(){c({isOpen:!t.isOpen})}return(0,n.useClickOutside)(l,(()=>{t.isOpen&&u()})),a((()=>{if("google"==mappl10n.options.engine){c({layers:{traffic:{googleLayer:new google.maps.TrafficLayer,label:__("Traffic")},bicycling:{googleLayer:new google.maps.BicyclingLayer,label:__("Bicycling")},transit:{googleLayer:new google.maps.TransitLayer,label:__("Transit")}}})}}),[]),s("div",{ref:l},s("div",{className:"mapp-menu-toggle",onClick:()=>u()}),t.isOpen&&function(){const i=_.map(t.layers,((i,n)=>{const o=t.activeLayer==n?"mapp-menu-item mapp-active":"mapp-menu-item";return s("div",{className:o,key:n,onClick:()=>function(i){t.activeLayer&&t.layers[t.activeLayer].googleLayer.setMap(null),i!=t.activeLayer&&t.layers[i].googleLayer.setMap(e.map.getMap()),c({activeLayer:i==t.activeLayer?null:i,isOpen:!1})}(n)},i.label)}));return s("div",{className:"mapp-menu-component",style:{display:"flex"}},s("div",{className:"mapp-menu-item",onClick:()=>(c({isOpen:!1}),void e.onCenter())},__("Center map")),"google"==mappl10n.options.engine&&s(o,null,s("div",{className:"mapp-menu-separator"}),i),s("div",{className:"mapp-menu-footer"},s("a",{className:"mapp-menu-help-link",href:"https://mappresspro.com/mappress-documentation",target:"_blank"},s("span",null,__("Help")))))}())}},27:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPaginate:()=>r});const n=wp.element.createElement,{Fragment:s,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,{sprintf}=wp.i18n;function r(e){function t(t,i){const n=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(n);break;case"next":e.page<n&&e.onChange(e.page+1);break;case"prev":e.page>1&&e.onChange(e.page-1)}}return function(){const i=Math.ceil(e.count/e.pageSize),s=e.isBusy||e.page<=1,o=e.isBusy||e.page>=i,a=s?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",l=o?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",p=(r="%d of %d",wp.i18n.__(r,"mappress-google-maps-for-wordpress"));var r;return n("div",{className:"mapp-paginate"},n("div",{className:a,onClick:()=>{s||t("first")}},"«"),n("div",{className:a,onClick:()=>{s||t("prev")}},"‹"),n("div",{className:"mapp-paginate-count"},sprintf(p,e.page,i)),n("div",{className:l,onClick:()=>{o||t("next")}},"›"),n("div",{className:l,onClick:()=>{o||t("last")}},"»"))}()}},818:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPlaces:()=>m});var n=i(117),s=i(10);const o=wp.element.createElement,{Fragment:a,useCallback:l,useEffect:p,useLayoutEffect:r,useRef:c,useState:u}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function m(e){e={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...e};const{geocode:t,getPredictions:i}=(0,s.useGeocoding)({map:e.map,includeBusinesses:e.includeBusinesses}),[a,l]=u({suggestions:[]});return o(n.MappAutocomplete,{buttonLabel:e.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:e.focus,onFetch:function(t){i({map:e.map,value:t,callback:e=>{var t;t={suggestions:e},l((e=>({...e,...t})))}})},onSelect:function(i){let{suggestion:n,value:s}=i;t({map:e.map,suggestion:n,value:s,callback:t=>{t&&e.onSearch(t)}})},placeholder:__("Search"),suggestions:a.suggestions,title:__("Enter an address, place, KML file URL, or lat,lng")})}},50:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPoiContent:()=>u});var n=i(939);const s=wp.element.createElement,{Fragment:o,useEffect:a,useLayoutEffect:l,useMemo:p,useRef:r,useState:c}=wp.element;wp.i18n.sprintf;function u(e){e={context:null,feature:null,onDirectionsClick:null,poi:null,template:null,thumbs:null,...e};const[t,i]=c({imageNumber:0});function a(e){i((t=>({...t,...e})))}return s(o,null,function(){const i="list"!=e.context&&mappl10n.options.thumbWidth&&mappl10n.options.thumbHeight?{width:mappl10n.options.thumbWidth+"px",height:mappl10n.options.thumbHeight+"px"}:null,n=e.thumbs&&e.poi.images&&e.poi.images.length&&e.poi.images[t.imageNumber]?e.poi.images[t.imageNumber]:null;if(!n)return null;const o=function(e){switch(e.type){case"avatar":return s("div",{className:"mapp-avatar",dangerouslySetInnerHTML:{__html:e.html}});case"embed":return s("div",{className:"mapp-embed",dangerouslySetInnerHTML:{__html:e.html}});default:if("image"==e.type||!e.type)return s("img",{src:e.url})}}(n);return s("div",{className:"mapp-thumbnail",style:i},t.imageNumber>=1&&s("div",{className:"mapp-gallery-previous",onClick:e=>function(e){t.imageNumber>0&&(a({imageNumber:t.imageNumber-1}),e.stopPropagation())}(e)}),o,t.imageNumber<e.poi.images.length-1&&s("div",{className:"mapp-gallery-next",onClick:i=>function(i){t.imageNumber<e.poi.images.length-1&&(a({imageNumber:t.imageNumber+1}),i.stopPropagation())}(i)}))}(),s("div",{className:"mapp-info"},function(){let t={...e.poi};t.icon=n.mappLib.getIconUrl(e.poi.iconid),e.feature&&(t.body=e.feature.description,t.title=e.feature.name);const i=n.mappLib.template(e.template,{poi:t});return s("div",{className:"mapp-template",dangerouslySetInnerHTML:{__html:i}})}(),function(){if(mappl10n.options.directionsPopup&&("map-popup"==e.template||"mashup-popup"==e.template))return s("div",{className:"mapp-dir",onClick:()=>e.onDirectionsClick()},(t="Get Directions",wp.i18n.__(t,"mappress-google-maps-for-wordpress")));var t}()))}},615:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPoiList:()=>h});var n=i(939),s=i(27),o=i(50);const a=wp.element.createElement,{Fragment:l,useEffect:p,useLayoutEffect:r,useMemo:c,useRef:u,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf;const h=wp.element.memo((function(e){e={bounds:null,className:null,hoveredPoi:null,isEditable:!1,isPaged:!1,onClick:null,onDragDrop:null,onHover:null,onPage:null,openPoi:null,page:1,pois:null,template:null,...e};const[t,i]=m({dragging:null,dragover:null,pageSize:mappl10n.options.poiListPageSize?parseInt(mappl10n.options.poiListPageSize):20});function p(e){i((t=>({...t,...e})))}function r(i){let s,r="mapp-item";return e.openPoi!=i.id&&e.hoveredPoi!=i.id||(r+=" mapp-selected"),r+=t.dragover==i.id?" mapp-dragover":"",s=e.isEditable?a(l,null,a("img",{className:"mapp-icon",src:n.mappLib.getIconUrl(i.iconid)}),a("div",{className:"mapp-title"},i.title)):a(o.MappPoiContent,{context:"list",poi:i,template:e.template,thumbs:mappl10n.options.thumbsList}),a("div",{className:r,dangerouslySetInnerHTML:null,draggable:e.isEditable,key:i.id,onClick:()=>e.onClick(i.id),onDragOver:e=>e.preventDefault(),onDragStart:e=>p({dragging:i.id}),onDragEnter:e=>p({dragover:i.id}),onDragEnd:e=>p({dragging:null,dragover:null}),onDrop:n=>{return s=i.id,void(e.onDragDrop&&e.onDragDrop({from:t.dragging,to:s}));var s},onMouseEnter:t=>{e.onHover(i.id)},onMouseLeave:t=>{e.onHover(null)}},s)}return a("div",{className:e.className},e.isPaged&&function(){let t=1!=e.pois.length?__("%d Results"):__("%d Result");return t=sprintf(t,e.pois.length),a("div",{className:"mapp-list-header"},a("div",{className:"mapp-list-count"},t))}(),function(){const i=t.pageSize*(e.page-1),n=i+t.pageSize;return a("div",{className:"mapp-items"},_.map(e.pois,((e,t)=>{if(t>=i&&t<=n)return r(e)})))}(),e.isPaged&&(e.pois.length<=t.pageSize?null:a("div",{className:"mapp-list-footer"},a(s.MappPaginate,{count:e.pois.length,onChange:t=>e.onPage(t),page:e.page,pageSize:t.pageSize}))))}))},892:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MappPopupModal:()=>u});var n=i(939);const s=wp.element.createElement,o=wp.element.createPortal,{Fragment:a,useEffect:l,useLayoutEffect:p,useRef:r,useState:c}=wp.element;function u(e){e={onClose:null,poi:null,...e};const[t,i]=c({isBusy:!1,html:null});function a(e){i((t=>({...t,...e})))}const p=React.createRef();function r(t){27==t.keyCode&&e.onClose()}return l((()=>(document.body.classList.add("mapp-modal-noscroll"),()=>document.body.classList.remove("mapp-modal-noscroll"))),[]),l((()=>{e.poi.postid&&(a({isBusy:!0}),n.mappLib.ajax({data:{action:"mapp_get_post",postid:e.poi.postid,nonce:mappl10n.options.nonce},dataType:"HTML",type:"GET",success:e=>{a({isBusy:!1,html:e})}}))}),[e.poi.postid]),l((()=>{p.current&&p.current.focus(),console.log("focus"+document.activeElement)}),[p.current]),o(s("div",{className:"mapp-modal"},s("div",{className:"mapp-modal-backdrop",onClick:e.onClose,onKeyDown:r},s("div",{className:"mapp-modal-close",onClick:e.onClose},"×")),s("div",{className:"mapp-modal-content-wrapper",ref:p,onKeyDown:r,tabIndex:0},s("div",{className:"mapp-modal-content"},t.isBusy&&s("div",{className:"mapp-modal-spinner"}),!t.isBusy&&s("div",{dangerouslySetInnerHTML:{__html:t.html}}),s("div",{className:"mapp-modal-close",onClick:e.onClose},"X")))),document.body)}},854:(e,t,i)=>{"use strict";i.r(t);var n=i(715),s=i(817),o=i(939),a=i(602),l=i(818),p=i(50),r=i(615),c=i(892),u=i(10);window.mapp=window.mapp||{};const m=wp.element.createElement,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");wp.i18n._n;var h;h=jQuery,mapp.Map=function(e,t){this.defaults={alignment:null,center:null,classname:null,embed:null,height:null,initialOpenInfo:null,isEditable:null,layers:null,layout:null,lines:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,onDrawingEvent:null,onPoiClose:null,onPoiOpen:null,onSearch:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,postid:null,query:null,search:null,sel:null,title:null,width:null,zoom:null},this.drawingManager=null,this.filters=null,this.hovered=null,this.isFullscreen=!1,this.iw=null,this.mapdata=e,this.opened=null,this.pagination={count:0,page:1},this.polyline=null,this.settings=t||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.pois_=[],this.user_=null,this.xhr_,_.extend(this,this.defaults,this.mapdata,this.settings),this.poiList=void 0!==this.poiList&&null!=this.poiList?this.poiList:mappl10n.options.poiList,this.layout=this.layout?this.layout:mappl10n.options.layout,this.postid=this.postid?this.postid:mappl10n.options.postid},mapp.Map.prototype={display:function(){const{geocode:e}=(0,u.useGeocoding)({withBusinesses:this.isEditable});if(this.render(),!this.div||!this.div.layout)return;if(this.sanity(),this.query?this.templates={item:"mashup-item",popup:"mashup-popup"}:this.templates={item:"map-item",popup:"map-popup"},"leaflet"==mappl10n.options.engine?this.mapOpts=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null},this.mapOpts):this.mapOpts=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!this.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM}},this.mapOpts),this.mapOpts.minZoom=isNaN(parseInt(this.mapOpts.minZoom))?0:parseInt(this.mapOpts.minZoom),!this.div||!this.div.canvas)return;"leaflet"==mappl10n.options.engine?(this.map_=new L.Map(this.div.canvas.get(0),this.mapOpts),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_)):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),this.map_.setOptions(this.mapOpts),this.addLayers()),this.addGeolocateControl(),this.addMenu(),this.addPopup(),this.isFilterable()&&this.renderFilters(),this.setMapTypeId(this.mapTypeId),this.clustering(),this.addDrawingManager();const t=h(".mapp-search-container",this.div.layout);t.length&&wp.element.render(m(l.MappPlaces,{buttonLabel:this.isEditable?__("Add to map"):m("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:this.isEditable,includeBusinesses:this.isEditable,map:this,onSearch:e=>{this.onSearch?this.onSearch(e):this.doSearch(e)}}),t.get(0)),this.addUserLocation(),this.addEvents("click dragstart zoom_changed zoomstart",(e=>{"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||this.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(e=>{const t=h(e.currentTarget),i=t.attr("data-mapp-action"),n=t.attr("data-mapp-"+i);e.preventDefault(),this.onAction(i,n,t)})),new ResizeObserver(((e,t)=>{this.toggleView("mini"),this.resize()})).observe(this.div.layout.get(0)),e({map:null,value:this.center,callback:e=>{this.center=e&&e.geometry&&e.geometry.location?{lat:e.geometry.location.lat,lng:e.geometry.location.lng}:null,this.setPois(this.pois),this.initCenter()}})},initCenter:function(){setTimeout((()=>{this.recenter(),this.renderList(),this.isSearchable&&!this.isEditable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():mapp.event.addListenerOnce(this.map_,"idle",(()=>this.initOpen()))}),100)},initOpen:function(){const e=this.pois_.length?this.pois_[0]:null,t=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;e&&t&&!this.isEditable&&this.poiOpen(e)},addDrawingManager:function(){if(this.isEditable&&"google"==mappl10n.options.engine&&google.maps.drawing){const e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};this.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),this.drawingManager.setMap(this.map_),mapp.event.addListener(this.drawingManager,"overlaycomplete",(e=>{this.drawingManager.setDrawingMode(null),this.poiHover(null),this.onDrawingEvent&&this.onDrawingEvent(e)}))}},addEvents:function(e,t){e=e.split(" ");for(var i=0;i<e.length;i++)mapp.event.addListener(this.map_,e[i],t)},addGeolocateControl:function(){if(!mappl10n.options.ssl)return;const e=h(".mapp-geolocate-control-wrapper",this.div.layout).get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e):(L.Control.Geolocate=L.Control.extend({onAdd:t=>e,onRemove:()=>{}}),new L.Control.Geolocate({position:"bottomright"}).addTo(this.map_))},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var e=h.makeArray(this.layers),t=0;t<e.length;t++){var i=e[t].trim(),n=i.split(".").pop();this.layers_[i]?this.toggleLayer(i):"kml"==n||"kmz"==n?this.layers_[i]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:i}):"json"==n&&(this.layers_[i]=new google.maps.Data({map:this.map_}).loadGeoJson(i))}},addMenu:function(){this.isEditable||"leaflet"==mappl10n.options.engine||wp.element.render(m(a.MappMenuControl,{map:this,onCenter:()=>{this.poiClose(),this.recenter()}}),this.div.menu.get(0))},addPopup:function(){var e=this.isEditable?"mapp-iw-edit":"mapp-iw";this.isEditable||(e+=" mapp-"+this.templates.popup),this.div.iw=h('<div class="'+e+'">').appendTo(this.div.canvas),this.iw=new mapp.Infobox(this.map_,{className:this.isEditable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(()=>{this.poiClose()}))},addSearchMove:function(){},addUserLocation:function(){const{geolocate:e}=(0,u.useGeocoding)({withBusinesses:this.isEditable});mappl10n.options.userLocation&&mappl10n.options.ssl&&e((e=>{if(e&&e.geometry&&e.geometry.location){const t=e.geometry.location,i=o.mappLib.getIcon("geolocation");"leaflet"==mappl10n.options.engine?this.user_=L.marker([t.lat,t.lng],{icon:i}).addTo(this.map_):(this.user_=new mapp.Marker({icon:i,position:new google.maps.LatLng(t.lat,t.lng)}),this.user_.setMap(this.map_))}}),!0)},clusterGetLatLng:function(e){if(this.clusterer){if("leaflet"==mappl10n.options.engine){var t=this.clusterer.getVisibleParent(e.overlay);return t?t.getLatLng():null}for(var i=this.clusterer.getClusters(),n=0;n<i.length;n++){var s=i[n].markers_;if(s.length>1)for(var o=0;o<s.length;o++)if(s[o]==e.overlay)return i[n].center_}}},clustering:function(){if(mappl10n.options.clustering&&!this.isEditable){let e=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==e.disableClusteringAtZoom&&""==e.disableClusteringAtZoom&&(e.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup(e):(e=_.extend(e,{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"}),this.clusterer=new MarkerClusterer(this.map_,[],e))}},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){var e=[];for(let t=0;t<this.pois_.length;t++)this.pois_[t].type||e.push(this.pois_[t].overlay);"leaflet"==mappl10n.options.engine?(this.clusterer.addLayers(e),this.map_.addLayer(this.clusterer)):this.clusterer.addMarkers(e)}},fetchPois:function(e){var t=new Date;this.poiClose();var i={action:"mapp_query",debug:mappl10n.options.debug,filters:this.filters,query:this.query,url:{href:window.location.href,search:window.location.search}};this.xhr_&&this.xhr_.abort("cancel"),this.spinner(!0),this.pagination.page=1,this.xhr_=o.mappLib.ajax({data:i,callback:(i,n)=>{this.spinner(!1),i&&"OK"==i.status&&(this.setPois(i.data.pois),this.renderList(),mappl10n.options.debug&&console.log("Results: "+i.data.pois.length+" ("+n.responseText.length/1e3+"K) AJAX: "+(new Date-t)+(i.data.timing?i.data.timing:"")),e&&e())}})},fitBounds:function(e){return this.map_.fitBounds(e)},getBounds:function(){try{return this.map_.getBounds()}catch(e){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(e){return null}},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(e){return null}},isFilterable:function(){return mappl10n.options.pro&&mappl10n.options.filters&&mappl10n.options.filters.length>0&&!this.isEditable&&this.query},isSearchable:function(){return!!this.isEditable},onAction:function(e,t,i){switch(e){case"geolocate":const{geolocate:e}=(0,u.useGeocoding)({withBusinesses:this.isEditable});e((e=>{e&&e.geometry&&e.geometry.location&&this.setView(e.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1);break;case"sidebar-toggle":this.toggleSidebar();break;case"view-map":this.toggleSidebar(!1);break;case"view-list":this.toggleSidebar(!0);break;default:return!0}},doSearch:function(e){if(e&&e.geometry){var t=e.geometry.location?e.geometry.location:null,i=e.geometry.viewport?e.geometry.viewport:null;if("leaflet"==mappl10n.options.engine)var n=new L.LatLng(t.lat,t.lng),s=i?new L.LatLngBounds(new L.LatLng(i.sw.lat,i.sw.lng),new L.LatLng(i.ne.lat,i.ne.lng)):n.toBounds(1e3*mappl10n.options.radius);else{var o=new google.maps.Circle({center:t,radius:1e3*mappl10n.options.radius});s=i?new google.maps.LatLngBounds(new google.maps.LatLng(i.sw.lat,i.sw.lng),new google.maps.LatLng(i.ne.lat,i.ne.lng)).union(o.getBounds()):o.getBounds()}s&&this.fitBounds(s),this.setView(t)}},poiClose:function(){this.opened&&this.poiHighlight(this.opened,!1),this.opened=null,wp.element.unmountComponentAtNode(this.div.iw.get(0)),this.iw.close(),this.renderDirections({isOpen:!1}),this.renderList(),this.onPoiClose&&this.onPoiClose()},poiHighlight:function(e,t){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.isEditable||(t?e.highlight(!0):e.highlight(!1))},poiHover:function(e){e&&this.opened==e||(this.hovered&&this.hovered!=this.opened&&(this.poiHighlight(this.hovered,!1),this.hovered=null),e&&(this.hovered=e,this.poiHighlight(this.hovered,!0),mappl10n.options.tooltips&&!this.isEditable?(this.poiClose(),this.poiOpen(e,null,"popup")):this.poiHighlight(e,!0)),this.renderList())},poiInsert:function(e){this.pois_.unshift(e),e.setMap(this),this.renderList()},poiOpen:function(e,t){if(this.poiClose(),this.query&&e.postid&&e.url&&!this.isEditable&&!mappl10n.options.tooltips)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":const t=document.createElement("div");return document.body.appendChild(t),wp.element.render(m(c.MappPopupModal,{onClose:()=>{wp.element.unmountComponentAtNode(t),t.remove()},poi:e}),t)}this.div.layout.hasClass("mapp-view-mini")&&this.toggleSidebar(!1),this.popupOpen(e,t,"popup"),this.poiHighlight(e,!0),this.onPoiOpen&&this.onPoiOpen(e)},poiRemove:function(e){var t=h.inArray(e,this.pois_);-1!=t&&(this.pois_[t].setMap(null),this.pois_.splice(t,1),this.renderList())},popupClose:function(){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.isEditable||(this.iw.close(),this.renderDirections({isOpen:!1}),h(this).triggerHandler("mapp.close"))},popupOpen:function(e,t){let i=null;this.popupClose(),t&&t.featureData?i=t.featureData:t&&t.propagatedFrom&&t.propagatedFrom.feature&&t.propagatedFrom.feature.properties&&(i=t.propagatedFrom.feature.properties),this.isEditable||(wp.element.render(m(p.MappPoiContent,{feature:i,onDirectionsClick:()=>this.renderDirections({isOpen:!0,from:null,to:e}),poi:e,template:this.templates.popup,thumbs:mappl10n.options.thumbsPopup}),this.div.iw.get(0)),e.images&&e.images.length&&this.div.iw.addClass(" mapp-thumb-"+mappl10n.options.thumbsPopup));var n=this.clusterGetLatLng(e),s=n||e.getPosition(t);this.iw.open({position:s,anchorPoint:e.getAnchorPoint(t)}),this.opened=e},recenter:function(){var e=this.center&&this.center.hasOwnProperty("lat")&&this.center.hasOwnProperty("lng")?this.center:null,t=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null;if(e&&!t&&this.query)return void this.doSearch({geometry:{location:{lat:e.lat,lng:e.lng}}});if(e)return void this.setView(e,t||1);if(0==this.pois_.length)return void this.setView({lat:0,lng:0},t||1);if(1==this.pois_.length)return void this.pois_[0].center(t);let i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var n=0;n<this.pois_.length;n++){var s=this.pois_[n].getBounds(),o=this.pois_[n].getPosition();i=s?"leaflet"==mappl10n.options.engine?i.extend(s):i.union(s):i.extend(o)}t?this.setView(i.getCenter().toJSON(),t):this.fitBounds(i)},render:function(){let e=this.name?this.name+"-layout":"",t="mapp-layout",i=this.layout&&window.parent==window?this.layout:"left";if(t+="left"==i?" mapp-list-left":" mapp-inline",t+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",t+=this.classname?" "+this.classname:"",!document.body.classList.contains("block-editor-page")){let e=this.alignment?this.alignment:mappl10n.options.alignment;if(e){let i=" align"+e+" mapp-align-"+e;window.parent==window?t+=i:h(window.frameElement).parent().parent().addClass(i)}}var n=o.mappLib.template("map",{map:this,layout:i});if(this.sel){if(this.div.layout=h(this.sel),this.div.layout.html(n),this.div.layout.addClass(t),this.div.layout.attr("id",e),!this.div.layout.length)return console.log("MapPress: Missing map name or container for map: "+this.name)}else{let i=h('<div id="'+e+'" class="'+t+'">');i.html(n);let s=h("#"+this.name+"-layout");if(!s.length)return console.log("MapPress: Missing map name or container for map: "+this.name);s.replaceWith(i),this.div.layout=i}h.each(["canvas","content","controls","directions","filters","header","list","menu","search","sidebar","wrapper"],((e,t)=>{this.div[t]=h(".mapp-"+t,this.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderDirections:function(e){let{isOpen:t,from:i,to:s}=e;if(this.toggleView("directions",t),t){const e=s?s.getAddress():"",t=i?i.getAddress():"";wp.element.render(m(n.MappDirections,{from:t,to:e,onClose:()=>{wp.element.unmountComponentAtNode(this.div.directions.get(0)),this.toggleView("directions",!1)}}),this.div.directions.get(0))}else this.div.directions.length&&wp.element.unmountComponentAtNode(this.div.directions.get(0))},renderFilters:function(){this.div.filters&&this.div.filters.length&&wp.element.render(m(s.MappFilters,{onFilterChange:e=>{this.filters=e,this.fetchPois()},poiCount:this.pagination.count}),this.div.filters.get(0))},renderList:function(){let e=[];if(!this.poiList)return;if(this.isEditable)e=this.pois_;else{let t=this.getBounds();t&&_.map(this.pois_,((i,n)=>{t.contains(i.getPosition())&&e.push(i)}))}this.pagination.count!=e.length&&(this.pagination.count=e.length,this.renderFilters());let t="mapp-list-component";!this.isEditable&&mappl10n.options.thumbsList&&(t+=" mapp-thumb-"+mappl10n.options.thumbsList);const i=e=>this.pois_.find((t=>t.id==e)),n=(e,t)=>{let i=_.findIndex(this.pois_,(t=>t.id==e)),n=_.findIndex(this.pois_,(e=>e.id==t));this.pois_.splice(n,0,this.pois_.splice(i,1)[0])};wp.element.render(m(r.MappPoiList,{bounds:this.getBounds(),className:t,hoveredPoi:this.hovered?this.hovered.id:null,isEditable:this.isEditable,isPaged:!!this.query,map:this,onClick:e=>this.poiOpen(i(e)),onDragDrop:e=>{let{from:t,to:i}=e;return n(t,i)},onHover:e=>this.poiHover(i(e)),onPage:e=>{this.pagination.page=e,this.renderList()},onSort:e=>{this.pois_=e,this.renderList()},openPoi:this.opened?this.opened.id:null,page:this.pagination.page,pois:e,template:this.isEditable?null:this.templates.item}),this.div.list.get(0))},resetPois:function(){for(var e=0;e<this.pois_.length;e++)this.pois_[e].setMap(null);this.pois_=[],this.clustersReset()},resize:function(){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){const e="<a href='"+mappl10n.options.adminurl+"/admin.php?page=mappress'>"+__("MapPress Settings")+"</a>",t="<a href ='http://mappresspro.com/mappress-faq' target='_blank'>"+__("MapPress FAQ")+"</a>",i="<a href='http://mappresspro.com/chris-contact', target='_blank'>"+__("contact support")+"</a>",n="<br/>"+sprintf(__("Please see the %s for help, or %s and provide this error message."),t,i),s=sprintf("<div class='mapp-errors-toolbar'><div class='mapp-errors-apikey'>%s</a></div>",__("Get an API Key"));this.div.layout.on("click",".mapp-errors-apikey",(()=>{window.open("https://mappresspro.com/how-to-get-a-google-maps-api-key")}));let o=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:__("Leaflet library not loaded"),text:__("A theme or plugin is preventing the Leaflet library from loading.")+n},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:__("Google Maps API not loaded"),text:__("A theme or plugin is preventing Google Maps from loading.")+n},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:__("Google Maps API key required"),text:sprintf(__("Please enter a Google Maps API key in the %s, or switch to Leaflet maps."),e)+s},{condition:h('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1,title:__("Google Maps API loaded multiple times"),text:__("A theme or plugin has loaded Google Maps twice")+n},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")+n}];_.map(o,(e=>{if(e.condition){mappl10n.options.admin&&this.sanityOutput({title:e.title,text:e.text?e.text:""});let t=jQuery("<span>"+e.text.replace("<br/>","\n")+"</span>").text();console.error(__("Map error")+": "+e.title+" - "+t)}}))},sanityOutput(e){if(!h(".mapp-errors-overlay",this.div.content).length){let e="<div class='mapp-errors-overlay'></div><div class='mapp-errors'><div class='mapp-errors-header'>"+__("Oops! Something went wrong.")+"</div><div class='mapp-errors-list'></div></div>";this.div.content.prepend(e)}h(".mapp-errors-list",this.div.content).append("<div class='mapp-errors-title'>"+e.title+"</div><div class='mapp-errors-text'>"+e.text+"</div>")},set:function(e){for(let i in e){var t=e[i];switch(i){case"mapTypeId":this.mapTypeId=t,this.setMapTypeId(t);break;case"poiList":this.poiList=null==t?mappl10n.options.poiList:t,this.toggleSidebar(mappl10n.options.poiListOpen),this.toggleView("mini");break;case"search":this.search=t;break;case"style":this.setStyle(t);break;case"title":this.title=t;break;default:this[i]=t}}},setMapTypeId:function(e){const t=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),i=_.find(t,(t=>t.id==e));!mappl10n.options.style||"roadmap"!=e&&"streets"!=e&&i||(e=mappl10n.options.style);let n=_.find(t,(t=>t.id==e));n=n||t[0],this.setStyle(n)},setPois:function(e){if(this.resetPois(),e)for(var t=0;t<e.length;t++){var i=new mapp.Poi(e[t]);this.pois_.push(i),i.setMap(this)}this.clustersSet(),this.setLines()},setSize:function(e){var t=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];let i={},n={};if(e&&e.hasOwnProperty("width")&&(i={width:e.width?e.width:t.width}),e&&e.hasOwnProperty("height")){let i=e.height?e.height:t.height;n="string"==typeof i&&i.includes("%")?{"padding-bottom":i,height:"auto"}:{"padding-bottom":0,height:i}}window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?(h(window.frameElement).parent().parent().css(i),h(window.frameElement).parent().css(n)):this.embed?(i={height:"100%"},n={"padding-bottom":0,height:"100%"}):(this.div.layout.css(i),this.div.wrapper.css(n)),this.resize()},setStyle:function(e){if("leaflet"==mappl10n.options.engine){let t={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">© Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[e.provider],i=h.extend({},t,e);L.tileLayer(t.url,i).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==e.type?e.id:"roadmap"),e.json){let t=null;try{t=JSON.parse(e.json)}catch(e){console.log("Invalid JSON in map style")}this.map_.setOptions({styles:t||null})}else this.map_.setOptions({styles:null})},setLines:function(){if(this.polyline&&("leaflet"==mappl10n.options.engine?this.polyline.remove():this.polyline.setMap(null),this.polyline=null),this.isEditable||!this.lines&&!mappl10n.options.lines||this.pois_.length<2)return;const e={...mappl10n.options.lineOpts},t=[];if(_.map(this.pois_,(e=>{t.push(e.getPosition())})),"leaflet"==mappl10n.options.engine)this.polyline=new L.Polyline(t,e).addTo(this.map_);else{const i={strokeColor:e.color,strokeWeight:e.weight,strokeOpacity:e.opacity};e.icons&&(_.map(e.icons,(e=>{e.icon.path=parseInt(e.icon.path)})),e.icons[0].repeat="50px"),this.polyline=new google.maps.Polyline({map:this.map_,path:t,...e,...i}),e.animate&&e.icons&&e.icons.length&&this.setLinesAnimation()}},setLinesAnimation:function(){let e=0;const t=this.polyline.get("icons");t[0].repeat.replace("%","").replace("px",""),window.setInterval((()=>{e+=1,t[0].offset=e+(t[0].repeat.indexOf("%")>=0?"%":"px"),this.polyline.set("icons",t)}),20)},setView:function(e,t,i){"leaflet"==mappl10n.options.engine?(null==t&&(t=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(e,t,i)):(e=e&&!e.toJSON?{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}:e,t=t?parseInt(t):null,e&&this.map_.setCenter(e),t&&this.map_.setZoom(t))},spinner:function(e){this.div.layout.toggleClass("mapp-busy",e)},toggleLayer:function(e,t){t=void 0!==t?t:null==this.layers_[e].getMap(),h.each(["traffic","bicycling","transit"],((e,t)=>{this.layers_[t].setMap(null)})),t&&this.layers_[e].setMap(this.map_)},toggleSidebar:function(e){this.div.layout.toggleClass("mapp-sidebar-open",e),this.isSidebarOpen=e,setTimeout((()=>this.resize()),100)},togglePois:function(e){e=!!e;for(var t=0;t<this.pois_.length;t++)this.pois_[t].setVisible(e)},toggleView:function(e,t){if("mini"==e){let e=this.div.layout.hasClass("mapp-view-mini"),t=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",t),void(t!=e&&this.toggleSidebar(!t))}t=void 0===t?!this.div.layout.hasClass("mapp-view-"+e):t,this.div.layout.toggleClass("mapp-view-"+e,t),"list"==e&&t&&this.renderList(),"directions"==e&&this.resize()},toJSON:function(){this.pois=[];for(var e=0;e<this.pois_.length;e++)this.pois.push(this.pois_[e].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,postid:this.postid,search:this.search,title:this.title,width:this.width,zoom:this.zoom}}}},689:()=>{var e;window.mapp=window.mapp||{},e=jQuery,mapp.Infobox=function(t,i){this.map=t,this.anchorPoint=null,this.fudge=30,this.isOpen=!1,this.mapDiv="leaflet"==mappl10n.options.engine?t.getContainer():t.getDiv(),this.node=null,this.opts=_.extend({clip:!0,pan:!0},i),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null,this.wrapper=e('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib-content"><div class="mapp-ib" tabindex="0"></div><div class="mapp-ib-tip"></div></div></div>'),i&&i.className&&this.wrapper.addClass(i.className),this.node=e(".mapp-ib-content",this.wrapper),"leaflet"==mappl10n.options.engine?mapp.event.addListener(this.map,"move",(e=>{this.isOpen&&this.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=()=>{this.isOpen&&this.draw()}),this.node.get(0).addEventListener("load",(()=>{"leaflet"==mappl10n.options.engine?this.open({position:this.position,anchorPoint:this.anchorPoint}):mapp.event.addListenerOnce(this.map,"panend",(e=>{this.open({position:this.position,anchorPoint:this.anchorPoint})}))}),{capture:!0});var n="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(n),"leaflet"==mappl10n.options.engine&&t.on("load",(()=>{L.DomEvent.disableClickPropagation(this.wrapper.get(0))}))},mapp.Infobox.prototype={close:function(){this.isOpen=!1,this.wrapper&&this.wrapper.removeClass("mapp-open")},draw:function(){if(document.fullscreenElement||this.map.isFullscreen)return;if(!this.position)return;let e,t,i;if(e=this.node.outerWidth(),t=this.node.outerHeight(),"leaflet"==mappl10n.options.engine)i=this.map.latLngToContainerPoint(this.position);else{const e=this.overlayView.getProjection();if(!e)return;i=e.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:i.x-e/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-i.y-this.anchorPoint.y})},getContent:function(){return e(".mapp-ib",this.node).get(0)},open:function(e){this.position=e.position,this.anchorPoint=e.anchorPoint?e.anchorPoint:{x:0,y:0},this.wrapper.addClass("mapp-open"),this.wrapper.css({left:0,bottom:0,width:"auto",height:"auto"});const{width:t,height:i}=this.wrapper.get(0).getBoundingClientRect();this.wrapper.css({width:t,height:i}),"leaflet"==mappl10n.options.engine&&this.map.stop(),this.isOpen=!0,this.draw(),this.pan()},pan:function(){const t=this.node.outerWidth(),i=this.node.outerHeight(),n=e(this.mapDiv).width(),s=e(this.mapDiv).height();if("leaflet"==mappl10n.options.engine)var o=this.map.latLngToContainerPoint(this.position);else{var a=this.overlayView.getProjection();o=a?a.fromLatLngToContainerPixel(this.position):null}if(!o)return;var l={x:o.x,y:o.y};o.x+t/2+this.anchorPoint.x>n-this.fudge?l.x=Math.max(n-t/2-this.anchorPoint.x-this.fudge,n/2-this.anchorPoint.x):o.x-t/2+this.anchorPoint.x<this.fudge&&(l.x=Math.min(t/2+this.anchorPoint.x+this.fudge,n/2-this.anchorPoint.x)),o.y+this.anchorPoint.y-i<this.fudge&&(l.y=i-this.anchorPoint.y+this.fudge),l.y>=s&&(l.y=s-this.fudge);const p={x:o.x-l.x,y:o.y-l.y};p.x<=-1||p.x>=1||p.y<=-1||p.y>=1?"leaflet"==mappl10n.options.engine?this.map.panBy([p.x,p.y]):(mapp.event.addListenerOnce(this.map,"idle",(e=>{mapp.event.trigger(this.map,"panend")})),this.map.panBy(p.x,p.y)):mapp.event.trigger(this.map,"panend")},setContent:function(t){e(".mapp-ib",this.node).empty().append(t)}}},628:()=>{var e;window.mapp=window.mapp||{},e=jQuery,mapp.lib={template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var n=mappl10n.options.templates?mappl10n.options.template[t]:e("#mapp-tmpl-"+t).html();if(!n)return"";mapp.lib.templates[t]=_.template(n,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return mapp.lib.templates[t](i)}},jQuery,mapp.event={addListener:function(e,t,i){t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?e.on(t[n],i):google.maps.event.addListener(e,t[n],i)},addListenerOnce:function(e,t,i){t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?e.once(t[n],i):google.maps.event.addListenerOnce(e,t[n],i)},clearInstanceListeners:function(e){"leaflet"==mappl10n.options.engine?e.off():google.maps.event.clearInstanceListeners(e)},clearListeners:function(e,t){t=t.split(" ");for(var i=0;i<t.length;i++)"leaflet"==mappl10n.options.engine?e.off(t[i]):google.maps.event.clearListeners(e,t[i])},trigger:function(e,t,i){"leaflet"==mappl10n.options.engine?e.fire(t,i):google.maps.event.trigger(e,t,i)}}},692:()=>{window.mapp=window.mapp||{},jQuery,mapp.load=function(){if("undefined"!=typeof mapp&&mapp.data)for(;mapp.data.length;){var e=mapp.data.pop();window[e.name]=new mapp.Map(e),window[e.name].display()}},mapp.load()},436:()=>{var e;window.mapp=window.mapp||{},e=jQuery,mapp.Marker=function(e){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(e),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove()},mapp.Marker.prototype={draw:function(){if(!this.div||!this.icon)return;let t=this.overlayView.getProjection();if(t){let i=t.fromLatLngToDivPixel(this.position),n=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};e(this.div).css({left:i.x-n.width/2,top:i.y-n.height})}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(e){let t="on"+e.type[0].toUpperCase()+e.type.slice(1);this[t]&&this[t](e)},onAdd:function(){let t=this.overlayView.getPanes();t&&(this.div=e('<div class="mapp-marker">'),this.div.appendTo(t.overlayMouseTarget),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div.get(0)),this.div.get(0).addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&mapp.event.trigger(this,"click"),this.dragging=null})),this.div.get(0).addEventListener("mouseenter",this),this.div.get(0).addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(e){mapp.event.trigger(this,"mouseover")},onMouseleave:function(e){mapp.event.trigger(this,"mouseout")},onPointerdown:function(e){const t=this.map.getDiv().getBoundingClientRect(),i=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:e.clientX,y:e.clientY},offset:{x:i.x-(e.clientX-t.left),y:i.y-(e.clientY-t.top)}},this.toggleDragEvents(!0)},onPointermove:function(e){if(Math.abs(e.clientX-this.dragging.startPixel.x)+Math.abs(e.clientY-this.dragging.startPixel.y)<3)return;const t=this.map.getDiv().getBoundingClientRect();let i={x:e.clientX-t.left+this.dragging.offset.x,y:e.clientY-t.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(i)),this.draw(),this.dragging.moved=!0,mapp.event.trigger(this,"dragstart")},onPointercancel:function(e){this.onPointerup(e)},onPointerup:function(e){this.dragging&&this.dragging.moved&&mapp.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(e,t){let i="set"+e[0].toUpperCase()+e.slice(1);this[i]&&this[i](t)},setDraggable:function(e){this.draggable=e,this.map&&(this.div.get(0).removeEventListener("pointerdown",this,{passive:!0}),e&&this.div.get(0).addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(e){if(void 0!==e&&(this.icon=e),this.icon&&this.div){let e='<img draggable="false" src="'+this.icon.url+'">';this.div.html(e);let t=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:t.width,height:t.height}),this.setZIndex(),this.draw()}},setMap:function(e){this.map=e,this.overlayView.setMap(e)},setPosition:function(e){this.position=e},setValues:function(e){for(const t in e)this.set(t,e[t])},setVisible:function(e){this.visible=e,this.div&&this.div.css("visibility",e?"visible":"hidden")},setZIndex:function(e){this.zIndex=void 0!==e?e:this.zIndex,this.div&&this.div.css("z-index",e)},toggleDragEvents(e){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),e&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},548:(e,t,i)=>{"use strict";i.r(t);var n=i(939);window.mapp=window.mapp||{};var s;s=jQuery,mapp.Poi=function(e){if(this.defaults={address:null,body:null,html:null,iconid:null,id:null,images:null,kml:null,map:null,overlay:null,postid:null,poly:null,props:null,title:"",url:null,type:null,viewport:null},s.extend(this,this.defaults,e),this.id=n.mappLib.nanoid(),e&&e.correctedAddress&&(this.address=e.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),!e.overlay)switch(this.type){case"polygon":this.overlay=new google.maps.Polygon({paths:e.poly.paths}),this.setColors(e.poly);break;case"polyline":this.overlay=new google.maps.Polyline({path:e.poly.path}),this.setColors(e.poly);break;case"circle":var t=new google.maps.LatLng(e.point.lat,e.point.lng);this.overlay=new google.maps.Circle({center:t,radius:parseFloat(e.poly.radius)}),this.setColors(e.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:mapp.poi.viewportToBounds(this.viewport)}),this.setColors(e.poly);break;case"kml":var i=e.kml&&e.kml.url?e.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(i):new google.maps.KmlLayer({url:i,preserveViewport:!0,suppressInfoWindows:!0});break;default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([e.point.lat,e.point.lng]):this.overlay=new mapp.Marker({position:new google.maps.LatLng(e.point.lat,e.point.lng)}),this.set({iconid:e.iconid})}},mapp.Poi.prototype={addEvents:function(){mapp.event.clearInstanceListeners(this.overlay),mapp.event.addListener(this.overlay,"click",(e=>{this.open(e)})),mapp.event.addListener(this.overlay,"mouseover",(e=>{this.map.poiHover(this)})),mapp.event.addListener(this.overlay,"mouseout",(e=>{this.map.poiHover(null)})),"kml"==this.type&&this.addKmlEvents(),this.map.isEditable&&(this.addPolyEditEvents(!0),this.map.isEditable&&mapp.event.addListener(this.overlay,"dragstart",(()=>{this.viewport=null,this.addPolyEditEvents(!1)})),mapp.event.addListener(this.overlay,"dragend",(()=>{this.updateFromOverlay(),this.addPolyEditEvents(!0)})))},addKmlEvents:function(){"leaflet"==mappl10n.options.engine?(mapp.event.addListenerOnce(this.overlay,"ready",(()=>{this.updateFromOverlay()})),mapp.event.addListenerOnce(this.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+this.kml.url)}))):(mapp.event.addListener(this.overlay,"defaultviewport_changed",(()=>{this.updateFromOverlay()})),mapp.event.addListener(this.overlay,"status_changed",(()=>{"OK"!=this.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+this.kml.url)})))},addPolyEditEvents(e){this.isPoly()&&"google"==mappl10n.options.engine&&("rectangle"==this.type&&(mapp.event.clearListeners(this.overlay,"bounds_changed"),e&&mapp.event.addListener(this.overlay,"bounds_changed",(()=>{this.updateFromOverlay()}))),"circle"==this.type&&(mapp.event.clearListeners(this.overlay,"center_changed radius_changed"),e&&mapp.event.addListener(this.overlay,"center_changed radius_changed",(()=>{this.updateFromOverlay()}))),"polygon"!=this.type&&"polyline"!=this.type||(mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),e&&(mapp.event.addListener(this.overlay,"rightclick",(e=>{null!=e.vertex&&this.overlay.getPath().getLength()>2&&(this.overlay.getPath().removeAt(e.vertex),this.updateFromOverlay())})),mapp.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(()=>{this.updateFromOverlay()})))))},center:function(e){var t=this.getBounds();if("number"!=typeof e)if(t){var i=t.getNorthEast().toJSON().lng-t.getSouthWest().toJSON().lng;i<0&&(i+=360),e=Math.round(Math.log(360*this.map.div.canvas.width()/i/256)/Math.LN2),this.map.setView(this.getPosition(),e,{animate:!1})}else this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));else this.map.setView(this.getPosition(),e)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(e){switch(this.isPoly()?"poly":this.type){case"kml":return e&&e.pixelOffset?{x:e.pixelOffset.width,y:e.pixelOffset.height}:{x:0,y:0};case"poly":return{x:0,y:0};default:return mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32}}},getBounds:function(){var e;switch(this.type){case"polyline":e=new google.maps.LatLngBounds,this.overlay.getPath().forEach((function(t){e.extend(t)}));break;case"polygon":e=new google.maps.LatLngBounds,this.overlay.getPaths().forEach((function(t){t.forEach((function(t){e.extend(t)}))}));break;case"rectangle":case"circle":e=this.overlay.getBounds();break;case"kml":e=(e="leaflet"==mappl10n.options.engine?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport())||mapp.poi.viewportToBounds(this.viewport);break;default:return mapp.poi.viewportToBounds(this.viewport)}return e},getColors:function(){var e={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})void 0!==this.overlay[t]&&(e[t]=this.overlay[t]);return e},getPosition:function(e){if(this.point)return"leaflet"==mappl10n.options.engine?L.latLng(this.point):new google.maps.LatLng(this.point.lat,this.point.lng);if("kml"==this.type&&e&&e.latLng)return e.latLng;const t=this.getBounds();return"leaflet"==mappl10n.options.engine?t&&t.isValid()?t.getCenter():new L.latLng(0,0):t?t.getCenter():new google.maps.LatLng(0,0)},highlight:function(e){if(!this.type){var t="leaflet"==mappl10n.options.engine?s(this.overlay._icon):this.overlay.getDiv();if(t){switch(this.map&&this.map.isEditable?"circle":mappl10n.options.highlight){case"circle":t.toggleClass("mapp-marker-circle",e);break;case"icon":var i=e?n.mappLib.getIcon(mappl10n.options.highlightIcon):n.mappLib.getIcon(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==i.options.iconUrl)return;this.overlay.setIcon(i);break;case"scale":t.addClass("mapp-marker"),t.toggleClass("mapp-marker-scale",e)}this.setZIndex(e?1e4:0)}}},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},open:function(e){this.map.poiOpen(this,e)},set:function(e){for(var t in e){var i=e[t];"iconid"===t?this.type||(this.iconid=i,this.overlay.setIcon(n.mappLib.getIcon(i))):this[t]=i}},setColors:function(e){var t={};for(var i in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})e&&void 0!==e[i]&&(t[i]=e[i]);this.overlay.setOptions(t)},setEditable:function(e){"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=e:this.overlay.setDraggable(e),this.isPoly()&&this.overlay.setEditable(e))},setMap:function(e){this.map=e,null!=e?(this.setEditable(this.map.isEditable),this.addEvents(),!this.type&&this.map.clusterer||("leaflet"==mappl10n.options.engine?this.overlay.addTo(e.getMap()):this.overlay.setMap(e.getMap()))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setVisible:function(e){void 0!==this.overlay.setVisible&&this.overlay.setVisible(e)},setZIndex:function(e){"leaflet"==mappl10n.options.engine?this.type||this.overlay.setZIndexOffset(e):this.overlay.set("zIndex",e)},toJSON:function(){var e={address:this.address,body:this.body,iconid:this.iconid,images:this.images,point:this.point,title:this.title,type:this.type,viewport:this.viewport};return"kml"==this.type?e.kml=this.kml:this.isPoly()&&(e.poly=this.poly),e},updateFromOverlay(){_.extend(this,mapp.poi.parseOverlay(this.type,this.overlay))}},mapp.poi={boundsToViewport:function(e){return e?{sw:e.getSouthWest().toJSON(),ne:e.getNorthEast().toJSON()}:null},boundsCenterPoint:function(e){return e&&e.isValid()?e.getCenter().toJSON():{lat:0,lng:0}},pointToLatLng:function(e){return e?"leaflet"==mappl10n.options.engine?L.latLng(this.point):new google.maps.LatLng(e.lat,e.lng):null},viewportToBounds:function(e){return e&&e.sw&&e.ne?"leaflet"==mappl10n.options.engine?new L.LatLngBounds(L.latLng(e.sw.lat,e.sw.lng),L.latLng(e.ne.lat,e.ne.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(e.sw.lat,e.sw.lng),new google.maps.LatLng(e.ne.lat,e.ne.lng)):null},parseOverlay:function(e,t){if("google"==mappl10n.options.engine){if("kml"==e){const e=t.getDefaultViewport();return{point:e?e.getCenter().toJSON():null,viewport:e?mapp.poi.boundsToViewport(e):null}}const i=t instanceof google.maps.Polyline?{strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,stokeWeight:t.strokeWeight}:{fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight};if("circle"==e)return{point:t.getCenter().toJSON(),poly:{radius:t.getRadius(),...i}};if("rectangle"==e)return{viewport:mapp.poi.boundsToViewport(t.getBounds()),poly:{...i}};if("polyline"==e){const e=[];return t.getPath().forEach((function(t){e.push(t.toJSON())})),{poly:{path:e,...i}}}if("polygon"==e){const e={fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight},i=[];return t.getPaths().forEach((function(e){var t=[];e.forEach((function(e){t.push(e.toJSON())})),i.push(t)})),{poly:{paths:i,...e}}}if(!e)return{point:t.getPosition().toJSON()}}else{if("kml"==e){const e=t.getBounds();return{point:e&&e.isValid()?e.getCenter().toJSON():null,viewport:e&&e.isValid()?mapp.poi.boundsToViewport(e):null}}if(!e)return{point:"leaflet"==mappl10n.options.engine?t.getLatLng().toJSON():t.getPosition().toJSON()}}}}}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(117),i(715),i(817),i(10),i(326),i(939),i(602),i(27),i(818),i(50),i(615),i(892),i(628),i(854),i(689),i(436),i(548),i(692)})();
|
languages/mappress-google-maps-for-wordpress.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: MapPress Maps for WordPress 2.76.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-05-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
|
2 |
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: MapPress Maps for WordPress 2.76.6\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-05-07T04:03:16+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
|
mappress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
|
|
4 |
Plugin URI: https://www.mappresspro.com
|
5 |
Author URI: https://www.mappresspro.com
|
6 |
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
-
Version: 2.76.
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Scott DeJonge for his wonderful icons
|
@@ -37,7 +37,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
|
|
37 |
}
|
38 |
|
39 |
class Mappress {
|
40 |
-
const VERSION = '2.76.
|
41 |
|
42 |
static
|
43 |
$baseurl,
|
4 |
Plugin URI: https://www.mappresspro.com
|
5 |
Author URI: https://www.mappresspro.com
|
6 |
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
+
Version: 2.76.6
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Scott DeJonge for his wonderful icons
|
37 |
}
|
38 |
|
39 |
class Mappress {
|
40 |
+
const VERSION = '2.76.6';
|
41 |
|
42 |
static
|
43 |
$baseurl,
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: maps, google maps, map, map markers, google map, leaflet maps, leaflet map
|
|
5 |
Requires at least: 5.3
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.9
|
8 |
-
Stable tag: 2.76.
|
9 |
|
10 |
== Description ==
|
11 |
MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
|
@@ -89,6 +89,10 @@ Please see the plugin documentation pages:
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
92 |
= 2.76.5 =
|
93 |
* Fixed: adjust webpack configuration to pick up missing translations
|
94 |
|
5 |
Requires at least: 5.3
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.9
|
8 |
+
Stable tag: 2.76.6
|
9 |
|
10 |
== Description ==
|
11 |
MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
= 2.76.6 =
|
93 |
+
* Changed: updated query filters for WP 6.0
|
94 |
+
* Fixed: adjusted infowindow sizing for sub-pixel rendering
|
95 |
+
|
96 |
= 2.76.5 =
|
97 |
* Fixed: adjust webpack configuration to pick up missing translations
|
98 |
|