MapPress Easy Google Maps - Version 2.72.2

Version Description

  • Changed: allow DOM events to bubble out of the map container
Download this release

Release Info

Developer chrisvrichardson
Plugin Icon 128x128 MapPress Easy Google Maps
Version 2.72.2
Comparing to
See all releases

Code changes from version 2.72.1 to 2.72.2

build/index_mappress.js CHANGED
@@ -1 +1 @@
1
- (()=>{var t={854:()=>{var t=window.mapp||{};const __=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress");var i;i=jQuery,t.Map=function(t,e){this.defaults={alignment:null,center:null,classname:null,editable:null,embed:null,height:null,initialOpenInfo:null,layers:null,layout:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,postid:null,query:null,search:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.hovered=null,this.isFullscreen=!1,this.iw=null,this.mapdata=t,this.opened=null,this.places=null,this.selected=null,this.settings=e||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.modal_=null,this.pagination_={count:0,page:1},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},t.Map.prototype={display:function(){this.render(),this.div&&this.div.layout&&(this.sanity(),this.editable?this.templates={loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?this.templates={loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:this.templates={loop:"map-loop",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&&("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.setMapTypeId(this.mapTypeId),this.clustering(),"postmodal"==mappl10n.options.mashupClick&&(this.modal_=new t.lib.Modal),this.places=new t.Places(i(".mapp-places",this.div.search),{map:this}),this.addUserLocation(),this.editable&&this.places.sel.focus(),i(this.places).on("search.mapp",((t,e)=>{this.onSearch(e)})),this.addEvents("click dragstart zoom_changed zoomstart",(t=>{"leaflet"==mappl10n.options.engine&&"click"==t.type&&t.originalEvent&&!t.originalEvent.target.matches(".mapp-canvas")||this.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(t=>{const e=i(t.currentTarget),o=e.attr("data-mapp-action"),n=e.attr("data-mapp-"+o);t.preventDefault(),this.onAction(o,n,e)})),this.div.list.on("click","[data-mapp-action]",(t=>{const e=i(t.currentTarget),o=e.attr("data-mapp-action"),n=e.attr("data-mapp-"+o);t.preventDefault(),t.stopPropagation(),this.onAction(o,n,e)})),this.div.filters.on("change",(()=>{this.fetchPois()})),i(window).on("resize",(()=>{document.fullscreenElement?this.isFullscreen=!0:(this.isFullscreen?this.isFullscreen=!1:this.poiClose(),this.toggleView("mini"),this.resize())})),t.event.addListener(this.map_,"maptypeid_changed baselayerchange",(()=>{this.set({dirty:!0})})),this.places.parse(this.center,(t=>{this.center=t&&t.geometry&&t.geometry.location?{lat:t.geometry.location.lat,lng:t.geometry.location.lng}:null,this.setPois(this.pois),this.initCenter()})),this.div.list.on("mouseenter","[data-mapp-poi]",(t=>{var e=i(t.currentTarget).attr("data-mapp-poi");this.poiHover(this.pois_[e])})),this.div.list.on("mouseleave","[data-mapp-poi]",(t=>{this.poiHover(null)}))))},initCenter:function(){setTimeout((()=>{this.recenter(),this.renderList(),this.isSearchable&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():t.event.addListenerOnce(this.map_,"idle",(()=>this.initOpen()))}),100)},initOpen:function(){const t=this.pois_.length?this.pois_[0]:null,e=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;t&&e&&!this.editable&&t.open()},addEvents:function(e,i){e=e.split(" ");for(var o=0;o<e.length;o++)t.event.addListener(this.map_,e[o],i)},addGeolocateControl:function(){if(!mappl10n.options.ssl)return;const t=i(".mapp-geolocate-control-wrapper").get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(t):(L.Control.Geolocate=L.Control.extend({onAdd:e=>t,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 t=i.makeArray(this.layers),e=0;e<t.length;e++){var o=t[e].trim(),n=o.split(".").pop();this.layers_[o]?this.toggleLayer(o):"kml"==n||"kmz"==n?this.layers_[o]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:o}):"json"==n&&(this.layers_[o]=new google.maps.Data({map:this.map_}).loadGeoJson(o))}},addMenu:function(){i("body").on("click",(t=>{var e=i(t.target),o=e.attr("data-mapp-action");e==this.div.filters||"filters-toggle"==o||e.closest(this.div.filters).length||this.toggleView("filters",!1),e==this.div.menu||"menu-toggle"==o||e.closest(this.div.menu).length||this.toggleView("menu",!1)}))},addPopup:function(){var e=this.editable?"mapp-iw-edit":"mapp-iw";this.editable||(e+=" mapp-"+this.templates.popup),this.div.iw=i('<div class="'+e+'">').appendTo(this.div.canvas),this.iw=new t.Infobox(this.map_,{className:this.editable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(()=>{this.poiClose()}))},addSearchMove:function(){},addUserLocation:function(){mappl10n.options.userLocation&&mappl10n.options.ssl&&this.places.geolocate((e=>{if(e&&e.geometry&&e.geometry.location){const i=e.geometry.location,o=t.Icons.get("geolocation");"leaflet"==mappl10n.options.engine?this.user_=L.marker([i.lat,i.lng],{icon:o}).addTo(this.map_):(this.user_=new t.Marker({icon:o,position:new google.maps.LatLng(i.lat,i.lng)}),this.user_.setMap(this.map_))}}),!0)},clusterGetLatLng:function(t){if(this.clusterer){if("leaflet"==mappl10n.options.engine){var e=this.clusterer.getVisibleParent(t.overlay);return e?e.getLatLng():null}for(var i=this.clusterer.getClusters(),o=0;o<i.length;o++){var n=i[o].markers_;if(n.length>1)for(var s=0;s<n.length;s++)if(n[s]==t.overlay)return i[o].center_}}},clustering:function(){if(mappl10n.options.clustering&&!this.editable){let t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup(t):(t=_.extend(t,{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"}),this.clusterer=new MarkerClusterer(this.map_,[],t))}},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){var t=[];for(let e=0;e<this.pois_.length;e++)this.pois_[e].type||t.push(this.pois_[e].overlay);"leaflet"==mappl10n.options.engine?(this.clusterer.addLayers(t),this.map_.addLayer(this.clusterer)):this.clusterer.addMarkers(t)}},directionsOpen:function(e,i){var o=e?e.getAddress():"",n=i?i.getAddress():"";e?this.popupOpen(e):i&&this.popupOpen(i),this.dir_||(this.dir_=new t.Directions(this.div.directions,this)),this.dir_.open(o,n)},fetchPois:function(e){var o=new Date;this.poiClose();var n={action:"mapp_query",filters:i(":input",this.div.filters).serialize(),list:!!this.div.list.length,query:this.query,url:{href:window.location.href,search:window.location.search},debug:mappl10n.options.debug};this.xhr_&&this.xhr_.abort("cancel"),this.spinner(!0),this.xhr_=t.lib.ajax({data:n,callback:(i,n)=>{this.spinner(!1),i&&"OK"==i.status&&(this.setPois(i.data.pois),this.renderList(),mappl10n.options.debug&&t.lib.log("Results: "+i.data.pois.length+" ("+n.responseText.length/1e3+"K) AJAX: "+(new Date-o)+(i.data.timing?i.data.timing:"")),e&&e())}})},fitBounds:function(t){return this.map_.fitBounds(t)},getBounds:function(){try{return this.map_.getBounds()}catch(t){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(t){return null}},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(t){return null}},isFilterable:function(){return mappl10n.options.pro&&mappl10n.options.filters&&mappl10n.options.filters.length>0&&!this.editable&&this.query},isSearchable:function(){return!!this.editable},onAction:function(t,o,n){switch(t){case"center":this.toggleView("menu",!1),this.poiClose(),this.recenter();break;case"dir":this.directionsOpen(null,this.opened);break;case"dir-from":this.directionsOpen(this.opened,null);break;case"filters-reset":this.div.filters.find(":input").each((()=>{"checkbox"==this.type||"radio"==this.type?i(e.currentTarget).prop("checked",!1):i(e.currentTarget).val("")})),this.fetchPois();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((t=>{t&&t.geometry&&t.geometry.location&&this.setView(t.geometry.location,parseInt(mappl10n.options.poiZoom))}));break;case"layer":this.toggleLayer(o),this.toggleView("menu",!1);break;case"list-toggle":this.togglePoiListOpen();break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=n.attr("data-mapp-poi");this.poiOpen(this.pois_[s]);break;case"page":var a=parseInt(n.attr("data-mapp-page"));this.pagination_.page=a,this.renderList();break;case"view-map":this.togglePoiListOpen(!1);break;case"view-list":this.togglePoiListOpen(!0);break;default:return!0}},onSearch:function(t){if(t&&t.geometry){var e=t.geometry.location?t.geometry.location:null,i=t.geometry.viewport?t.geometry.viewport:null;if("leaflet"==mappl10n.options.engine)var o=new L.LatLng(e.lat,e.lng),n=i?new L.LatLngBounds(new L.LatLng(i.sw.lat,i.sw.lng),new L.LatLng(i.ne.lat,i.ne.lng)):o.toBounds(1e3*mappl10n.options.radius);else{var s=new google.maps.Circle({center:e,radius:1e3*mappl10n.options.radius});n=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(s.getBounds()):s.getBounds()}n&&this.fitBounds(n),this.setView(e)}},poiClose:function(){this.poiHighlight(null),this.selected=null,this.opened=null,this.hovered=null,this.iw.close(),this.dir_&&this.dir_.close(),i(this).triggerHandler("mapp.close")},poiHighlight:function(t){if("icon"!=mappl10n.options.highlight||"leaflet"!=mappl10n.options.engine||!this.editable){if(i("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),this.hovered&&this.hovered.highlight(!1),t){var e=i.inArray(t,this.pois_);i('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"),t.highlight(!0)}this.selected&&(e=i.inArray(this.selected,this.pois_),i('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"))}},poiHover:function(t){t&&this.opened==t||(mappl10n.options.tooltips||(this.poiHighlight(null),this.hovered=null),t&&(this.poiHighlight(t),this.hovered=t,mappl10n.options.tooltips&&!this.editable&&this.popupOpen(t,null,"popup")))},poiInsert:function(t){this.pois_.unshift(t),t.setMap(this),this.renderList(),this.set({dirty:!0})},poiOpen:function(t,e){if(this.poiClose(),this.selected=t,this.poiHighlight(t),this.query&&t.postid&&t.url&&!this.editable)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(t.url);case"postnew":return void window.open(t.url);case"postmodal":return this.modal_.open(),this.modal_.setContent('<div class="mapp-modal-spinner">'),void t.fetchPost((()=>this.modal_.setContent(t.html)))}this.div.layout.hasClass("mapp-view-mini")&&this.togglePoiListOpen(!1),this.popupOpen(t,e,"popup"),i(this).triggerHandler("mapp.open",t)},poiRemove:function(t){var e=i.inArray(t,this.pois_);-1!=e&&(this.pois_[e].setMap(null),this.pois_.splice(e,1),this.renderList()),this.set({dirty:!0})},popupClose:function(){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.editable||(this.iw.close(),this.dir_&&this.dir_.close(),this.opened=null,i(this).triggerHandler("mapp.close"))},popupOpen:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"popup",o=null;this.popupClose(),e&&e.featureData?o=e.featureData:e&&e.propagatedFrom&&e.propagatedFrom.feature&&e.propagatedFrom.feature.properties&&(o=e.propagatedFrom.feature.properties),this.div.iw.html(t.render(i,o)),this.div.iw.toggleClass(" mapp-thumb-"+mappl10n.options.thumbsPopup,!!t.thumbnail);var n=this.clusterGetLatLng(t),s=n||t.getPosition(e);this.iw.open({position:s,anchorPoint:t.getAnchorPoint(e)}),this.opened=t},recenter:function(){var t=this.center&&this.center.hasOwnProperty("lat")&&this.center.hasOwnProperty("lng")?this.center:null,e=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null;if(t&&!e&&this.query)return void this.onSearch({geometry:{location:{lat:t.lat,lng:t.lng}}});if(t)return void this.setView(t,e||1);if(0==this.pois_.length)return void this.setView({lat:0,lng:0},e||1);if(1==this.pois_.length)return void this.pois_[0].center(e);let i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var o=0;o<this.pois_.length;o++){var n=this.pois_[o].getBounds(),s=this.pois_[o].getPosition();i=n?"leaflet"==mappl10n.options.engine?i.extend(n):i.union(n):i.extend(s)}e?this.setView(i.getCenter().toJSON(),e):this.fitBounds(i)},render:function(){let e=this.name?this.name+"-layout":"",o="mapp-layout",n=this.layout?this.layout:"left";if(o+="left"==n?" mapp-list-left":" mapp-inline",o+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",o+=this.classname?" "+this.classname:"",!document.body.classList.contains("block-editor-page")){let t=this.alignment?this.alignment:mappl10n.options.alignment;if(t){let e=" align"+t+" mapp-align-"+t;window.parent==window?o+=e:i(window.frameElement).parent().parent().addClass(e)}}var s=t.lib.template("map",{map:this,layout:n});if(this.sel){if(this.sel.html(s),this.sel.addClass(o),this.sel.attr("id",e),this.div.layout=this.sel,!this.div.layout.length)return t.lib.log("MapPress: Missing map name or container for map: "+this.name)}else{let n=i('<div id="'+e+'" class="'+o+'">');n.html(s);let a=i("#"+this.name+"-layout");if(!a.length)return t.lib.log("MapPress: Missing map name or container for map: "+this.name);a.replaceWith(n),this.div.layout=n}i.each(["canvas","content","controls","spinner","directions","filters","list","menu","wrapper","search"],((t,e)=>{this.div[e]=i(".mapp-"+e,this.div.layout)})),this.poiList&&"inline"==n&&(this.div.list=i('<div class="mapp-inline mapp-list"></div>'),window.parent==window?this.div.layout.append(this.div.list):i(window.frameElement.parentElement).after(this.div.list)),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderList:function(){var e=this.getBounds(),i=0;if(this.editable)return void this.div.layout.trigger("mapp.render");if(!this.poiList)return;let o=parseInt(mappl10n.options.poiListPageSize);o=isNaN(o)?20:o;const n=o*(this.pagination_.page-1),s=n+o;if(!this.editable)for(var a=0;a<this.pois_.length;a++){let t=this.pois_[a];t.visible=!1,this.isSearchable()?e&&e.contains(t.getPosition())&&(t.visible=!0,i++):(t.visible=!0,i++),t.visible=i>=n&&i<=s&&t.visible}this.pagination_.count=i,this.div.list.html(t.lib.template(this.templates.loop,{map:this,pois:this.pois_,pageSize:o,pagination:this.pagination_})),mappl10n.options.thumbsList&&this.div.list.addClass(" mapp-thumb-"+mappl10n.options.thumbsList)},renderMenu:function(){for(var t in this.layers_)i('[data-mapp-layer="'+t+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[t].getMap())},resetPois:function(){for(var t=0;t<this.pois_.length;t++)this.pois_[t].setMap(null);this.pois_=[],this.clustersReset()},resize:function(){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():t.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){const t="<a href='"+mappl10n.options.adminurl+"/admin.php?page=mappress'>"+__("MapPress Settings")+"</a>",e=jQuery&&jQuery.ui?jQuery.ui.version:"0.0",o="<a href ='http://mappresspro.com/mappress-faq' target='_blank'>"+__("MapPress FAQ")+"</a>",n="<a href='http://mappresspro.com/chris-contact', target='_blank'>"+__("contact support")+"</a>",s="<br/>"+sprintf(__("Please see the %s for help, or %s and provide this error message."),o,n),a=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 l=[{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.")+s},{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.")+s},{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."),t)+a},{condition:i('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")+s},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")+s},{condition:e<"1.12",title:sprintf(__("Obsolete jQuery version: %s, must be >= 1.12"),e),text:__("A theme or plugin is loading an obsolete version of jQuery.")+s}];if(_.map(l,(t=>{if(t.condition){mappl10n.options.admin&&this.sanityOutput({title:t.title,text:t.text?t.text:""});let e=jQuery("<span>"+t.text.replace("<br/>","\n")+"</span>").text();console.error(__("Map error")+": "+t.title+" - "+e)}})),"google"==mappl10n.options.engine){const t=console.error;console.error=e=>{(e.includes("Google Maps JavaScript API")||e.includes("You have exceeded your request quota")||e.includes("You have exceeded your daily quota"))&&mappl10n.options.admin&&(e=e.replace(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi,((t,e,i)=>{let o=i;return o.match("^https?://")||(o="http://"+o),e+'<a href="'+o+'" target="_blank">'+i+"</a>"})),this.sanityOutput({title:__("Google Maps Error"),text:e})),t(e)}}},sanityOutput(t){if(!i(".mapp-errors-overlay",this.div.content).length){let t="<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(t)}i(".mapp-errors-list",this.div.content).append("<div class='mapp-errors-title'>"+t.title+"</div><div class='mapp-errors-text'>"+t.text+"</div>")},set:function(t){for(let i in t){var e=t[i];switch(i){case"dirty":this.dirty=e;break;case"mapTypeId":this.mapTypeId=e,this.setMapTypeId(e);break;case"poiList":this.poiList=null==e?mappl10n.options.poiList:e,this.togglePoiListOpen(mappl10n.options.poiListOpen),this.toggleView("mini");break;case"search":this.search=e;break;case"style":this.setStyle(e);break;case"title":this.title=e;break;default:this[i]=e}}},setMapTypeId:function(t){const e=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),i=_.findWhere(e,{id:t});!mappl10n.options.style||"roadmap"!=t&&"streets"!=t&&i||(t=mappl10n.options.style),style=_.findWhere(e,{id:t}),style=style||e[0],this.setStyle(style)},setPois:function(e){if(this.resetPois(),e)for(var i=0;i<e.length;i++){var o=new t.Poi(e[i]);this.pois_.push(o),o.id=this.pois_.length-1,o.setMap(this)}this.clustersSet()},setSize:function(t){var e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];let o={},n={};if(t&&t.hasOwnProperty("width")&&(o={width:t.width?t.width:e.width}),t&&t.hasOwnProperty("height")){let i=t.height?t.height:e.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")?(i(window.frameElement).parent().parent().css(o),i(window.frameElement).parent().css(n)):this.embed?(o={height:"100%"},n={"padding-bottom":0,height:"100%"}):(this.div.layout.css(o),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">&copy; Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">&copy; 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],o=i.extend({},t,e);L.tileLayer(t.url,o).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==e.type?e.id:"roadmap"),e.json){let i=null;try{i=JSON.parse(e.json)}catch(e){t.lib.log("Invalid JSON in map style")}this.map_.setOptions({styles:i||null})}else this.map_.setOptions({styles:null})},setView:function(t,e,i){"leaflet"==mappl10n.options.engine?(null==e&&(e=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(t,e,i)):(t=t&&!t.toJSON?{lat:parseFloat(t.lat),lng:parseFloat(t.lng)}:t,e=e?parseInt(e):null,t&&this.map_.setCenter(t),e&&this.map_.setZoom(e))},sortPois:function(t){var e=Array();this.set({dirty:!0});for(var i=0;i<t.length;i++){var o=parseInt(t[i]);if(isNaN(o))return!1;e.push(this.pois_[o])}if(e.length!=this.pois_.length)return!1;this.pois_=e,this.renderList()},spinner:function(t){t?(this.div.spinner.html('<span class="mapp-spinner-icon"></span>'),this.div.spinner.addClass("mapp-active")):this.div.spinner.removeClass("mapp-active")},toggleLayer:function(t,e){e=void 0!==e?e:null==this.layers_[t].getMap(),i.each(["traffic","bicycling","transit"],((t,e)=>{this.layers_[e].setMap(null)})),e&&this.layers_[t].setMap(this.map_)},togglePoiListOpen:function(t){this.div.layout.toggleClass("mapp-list-open",t),setTimeout((()=>this.resize()),100)},togglePois:function(t){t=!!t;for(var e=0;e<this.pois_.length;e++)this.pois_[e].setVisible(t)},toggleView:function(t,e){if("mini"==t){let t=this.div.layout.hasClass("mapp-view-mini"),e=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",e),void(e!=t&&this.togglePoiListOpen(!e))}e=void 0===e?!this.div.layout.hasClass("mapp-view-"+t):e,this.div.layout.toggleClass("mapp-view-"+t,e),"list"==t&&e&&this.renderList(),"menu"==t&&e&&this.renderMenu(),"directions"==t&&this.resize()},toJSON:function(){this.pois=[];for(var t=0;t<this.pois_.length;t++)this.pois.push(this.pois_[t].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}}}},397:()=>{var t,e=window.mapp||{};t=jQuery,e.Directions=function(e,i){this.sel=t(e),this.map=i;var o=this;this.sel.on("keydown",(function(t){13==t.which?(o.getDirections(),t.preventDefault()):27==t.which&&o.close()})),this.sel.on("click","[data-mapp-action]",(function(e){var i=t(this).attr("data-mapp-action"),n=t(".mapp-dir-daddr",o.sel).val(),s=t(".mapp-dir-saddr",o.sel).val();switch(e.preventDefault(),i){case"dir-cancel":o.close();break;case"dir-get":o.getDirections();break;case"dir-swap":t(".mapp-dir-saddr",o.sel).val(n),t(".mapp-dir-daddr",o.sel).val(s)}})),this.open=function(e,i){"google"!=mappl10n.options.directions?(this.map.toggleView("directions",!0),t(".mapp-dir-saddr",this.sel).val(e),t(".mapp-dir-daddr",this.sel).val(i)):this.openGoogle(e,i)},this.close=function(){this.map.toggleView("directions",!1)},this.getDirections=function(){var e=t(".mapp-dir-saddr",this.sel).val().trim(),i=t(".mapp-dir-daddr",this.sel).val().trim();this.map.poiClose(),this.openGoogle(e,i)},this.openGoogle=function(t,e){var i=mappl10n.options.directionsServer;-1==(i="https://maps.google.com"==i?"https://www.google.com":i).toLowerCase().indexOf("http")&&(i="https://"+i),i+="/maps/dir/?api=1&origin="+encodeURIComponent(t)+"&destination="+encodeURIComponent(e),window.open(i)}}},442:(t,e,i)=>{"use strict";i.r(e);var o,n=i(991),s=i(574),a=window.mapp||{};a.geocoders={},o=jQuery,a.geocoders.algolia=function(t){this.map=t},a.geocoders.algolia.prototype={getDetails:function(t,e){e({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(t,e){var i="https://places-dsn.algolia.net/1/places/query?query="+encodeURIComponent(t)+"&hitsPerPage=5";i=mappl10n.options.country?i+"&countries="+mappl10n.options.country.toLowerCase():i,i=mappl10n.options.language?i+"&language="+mappl10n.options.language.toLowerCase():i+"&language=en";var a=this.map.getMap().getCenter();a&&(i+="&aroundLatLng="+a.lat+","+a.lng),o.getJSON(i,(function(i){if(i&&i.hits&&i.hits.length>0){var o=i.hits.map((function(e,o){return(0,n.Z)({formatInputValue:s.Z,hit:e,hitIndex:o,query:t,rawAnswer:i})}));e(o)}else e(null)}))}},function(t){a.geocoders.google=function(e){this.map=e,this.token=null;var i=t('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,i.remove()},a.geocoders.google.prototype={getDetails:function(t,e){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var i={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(i,(function(t,i){if("OK"==i&&t&&t.geometry){if(t.geometry.location&&(t.geometry.location=t.geometry.location.toJSON()),t.geometry.viewport){var o=t.geometry.viewport.toJSON();t.geometry.viewport={sw:{lat:o.south,lng:o.west},ne:{lat:o.north,lng:o.east}}}e(t)}else e(null)}))},getFirstPrediction:function(e,i){this.getPredictions(e,(e=>{e&&t.isArray(e)?this.getDetails(e[0],(t=>i(t))):i(null)}))},getPredictions:function(t,e){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=this.map.getMap().getBounds();"leaflet"==mappl10n.options.engine&&(i=new google.maps.LatLngBounds(new google.maps.LatLng(i.getSouthWest().lat,i.getSouthWest().lng),new google.maps.LatLng(i.getNorthEast().lat,i.getNorthEast().lng)));var o={input:t,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:this.map.editable?null:["geocode"]};this.autocompleteService.getPlacePredictions(o,(function(t,i){"OK"==i&&t&&t.length?(t=(t=t.map((t=>(t.value=t.description,t)))).filter((t=>t.place_id)),e(t)):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),e(null))}))}}}(jQuery),function(t){a.geocoders.mapbox=function(t){this.map=t},a.geocoders.mapbox.prototype={getDetails:function(t,e){let i=t.place_name,o=i.indexOf(","),n=i.indexOf(",",o+1);o>0&&(i=parseInt(i.substr(0,o))?i.substr(0,n).replace(",",""):i.substr(0,o));let s=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;e({formatted_address:t.place_name,name:i,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:s}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(e,i){var o="https://api.mapbox.com/geocoding/v5/mapbox.places/"+e+".json?access_token="+mappl10n.options.mapbox;o=mappl10n.options.country?o+"&country="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&language="+mappl10n.options.language.toLowerCase():o;var n=this.map.getMap().getCenter();n&&(o+="&proximity="+n.lng+","+n.lat),mappl10n.options.searchBox&&(o+="&bbox="+mappl10n.options.searchBox),t.getJSON(o,(t=>{t&&t.features&&t.features.length>0?(t.features=t.features.map((t=>(t.value=t.label=t.place_name,t))),i(t.features)):i(null)}))}}}(jQuery),function(t){a.geocoders.nominatim=function(t){this.map=t},a.geocoders.nominatim.prototype={getDetails:function(t,e){let i=t.display_name,o=i.indexOf(","),n=i.indexOf(",",o+1);o>0&&(i=parseInt(i.substr(0,o))?i.substr(0,n).replace(",",""):i.substr(0,o));let s=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;e({formatted_address:t.display_name,name:i,geometry:{location:{lat:t.lat,lng:t.lon},viewport:s}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(e,i){var o="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(e);if(o=mappl10n.options.country?o+"&countrycodes="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&accept-language="+mappl10n.options.language.toLowerCase():o,mappl10n.options.searchBox)o+="&viewbox="+mappl10n.options.searchBox,o+="&bounded=1";else{var n=this.map.getMap().getBounds();if(n){let t=n.getSouthWest(),e=n.getNorthEast();o+="&viewbox="+t.lng+","+t.lat+","+e.lng+","+e.lat}}t.getJSON(o,(function(t){t&&t.length?(t=t.map((t=>(t.value=t.display_name,t))),i(t)):i(null)}))}}}(jQuery)},282:()=>{var t=window.mapp||{};t.Icons={},t.Icons.get=function(e){var i=t.Icons.getUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:i,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:i}},t.Icons.getUrl=function(t){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"}},689:()=>{var t,e=window.mapp||{};t=jQuery,e.Infobox=function(i,o){this.map=i,this.anchorPoint=null,this.fudge=30,this.isOpen=!1,this.mapDiv="leaflet"==mappl10n.options.engine?i.getContainer():i.getDiv(),this.node=null,this.opts=_.extend({clip:!0,pan:!0,popout:!1},o),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null;var n=this;if(this.wrapper=t('<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>'),this.wrapper.addClass(o.className),this.node=t(".mapp-ib-content",this.wrapper),"leaflet"==mappl10n.options.engine?e.event.addListener(this.map,"move",(function(t){n.isOpen&&n.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=function(){n.isOpen&&n.draw()}),this.node.get(0).addEventListener("load",(()=>{this.open({position:this.position,anchorPoint:this.anchorPoint})}),{capture:!0}),this.opts.popout)var s="body";else s="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(s),"leaflet"==mappl10n.options.engine&&i.on("load",(()=>{L.DomEvent.disableClickPropagation(this.wrapper.get(0))}))},e.Infobox.prototype={clipToWindow:function(){var t=p.y,e=p.x-w/2+this.anchorPoint.x,i=this.mapDiv.getBoundingClientRect(),o=i.x+window.scrollX;t+=i.y+window.scrollY,e+=o;var n=this.opts.clip?divw:document.body.clientWidth;e+w>n&&(e=n-w),e<0&&(e=0),this.wrapper.css({left:e}),h=this.node.outerHeight(),t=p.y-h+this.anchorPoint.y,this.node.removeClass("mapp-ib-flip"),this.opts.clip&&!this.opts.pan&&t<0&&t<divh-(p.y+h)&&(t=p.y,this.node.addClass("mapp-ib-flip"))},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 t,e,i;if(t=this.node.outerWidth(),e=this.node.outerHeight(),"leaflet"==mappl10n.options.engine)i=this.map.latLngToContainerPoint(this.position);else{const t=this.overlayView.getProjection();if(!t)return;i=t.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:i.x-t/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-i.y-this.anchorPoint.y})},getContent:function(){return t(".mapp-ib",this.node)},open:function(e){this.position=e.position,this.anchorPoint=e.anchorPoint?e.anchorPoint:{x:0,y:0},this.opts.popout&&this.node.css({maxWidth:.8*this.mapDiv.clientWidth-this.fudge,maxHeight:this.mapDiv.clientHeight+this.anchorPoint.y-2*this.fudge}),this.wrapper.addClass("mapp-open"),this.draw();const i={w:t(this.mapDiv).width(),h:t(this.mapDiv).height()},o={w:this.node.outerWidth(),h:this.node.outerHeight()};this.opts.popout?this.clipToWindow():"leaflet"==mappl10n.options.engine?this.panLeaflet(i,o):this.panGoogle(o),this.isOpen=!0},panGoogle:function(t){var e=this.overlayView.getProjection(),i=e?e.fromLatLngToDivPixel(this.position):null;if(i){var o=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x-t.w/2-this.fudge,i.y+this.fudge)),n=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x+t.w/2+this.fudge,i.y-t.h+this.anchorPoint.y-this.fudge)),s=new google.maps.LatLngBounds(o,n);this.map.panToBounds(s)}},panLeaflet:function(t,e){var i=this.map.latLngToContainerPoint(this.position),o=(this.node.outerWidth(),this.node.outerHeight(),{x:i.x,y:i.y});i.x+e.w/2+this.anchorPoint.x>t.w-this.fudge?o.x=Math.max(t.w-e.w/2-this.anchorPoint.x-this.fudge,t.w/2-this.anchorPoint.x):i.x-e.w/2+this.anchorPoint.x<this.fudge&&(o.x=Math.min(e.w/2+this.anchorPoint.x+this.fudge,t.w/2-this.anchorPoint.x)),i.y+this.anchorPoint.y-e.h<this.fudge&&(o.y=e.h-this.anchorPoint.y+this.fudge),o.y>=t.h&&(o.y=t.h-this.fudge),this.map.panBy([i.x-o.x,i.y-o.y])},setContent:function(e){t(".mapp-ib",this.node).empty().append(e)}}},628:()=>{var t,e=window.mapp||{};t=jQuery,e.lib={ajax:function(e){var i=this,o={callback:null,data:null,dataType:"json",silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(t,o,n){"json"==e.dataType&&e.url==mappl10n.options.ajaxurl&&"OK"!=t.status&&i.alert(t.status),"json"==e.dataType&&t.output?i.alert("AJAX Invalid Output\r\n"+t.output):e.callback&&e.callback(t,n)},error:function(t,o,n){"cancel"!=o&&(void 0!==n&&""!=n&&i.alert("AJAX ERROR\r\nTextStatus="+o+"\r\nError="+n+"\r\nResponseText="+t.responseText),e.callback&&e.callback(null))}};return e=t.extend(o,e),t.ajax(e)},alert:function(t){mappl10n.options.admin||mappl10n.options.debug?alert(t):window.console&&console.error(t)},jqVersionCheck:function(e){if(void 0===t||void 0===e)return!1;e=e.split("."),v=t.fn.jquery.split(".");for(var i=0;i<e.length;i++){var o=parseInt(e[i]),n=void 0!==v[i]?parseInt(v[i]):0;if(n!=o)return n>o}return!0},log:function(t){window.console&&console.error(t)},scrollTo:function(t,e,i){if(t&&e&&t.length&&e.length){var o=t.height(),n=e.outerHeight(!0),s=t.scrollTop(),a=s+e.position().top,l=a+n;a=a-o/2-n/2,i&&(a-=i.outerHeight(!0)),(a<s||l>s+o)&&t.scrollTop(a)}},template:function(i,o){if(e.lib.templates=e.lib.templates?e.lib.templates:{},!e.lib.templates[i]){var n=mappl10n.options.templates?mappl10n.options.template[i]:t("#mapp-tmpl-"+i).html();if(!n)return"";e.lib.templates[i]=_.template(n.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return e.lib.templates[i](o)},uniqid:function(){return void 0===e.lib.uniqidCounter?e.lib.uniqidCounter=0:e.lib.uniqidCounter++,e.lib.uniqidCounter}},e.lib.jqVersionCheck("1.7")||e.lib.alert("jQuery version is too old: "+t.fn.jquery),t("body").on("tabsactivate tabsshow",(function(e,i){var o=i.newPanel?i.newPanel:i.panel;o&&t(".mapp-layout",o).each((function(){var e=t(this).find(".mapp-canvas").attr("id"),i=window[e];i.resize(),i.recenter()}))})),jQuery,"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}),e.event={addListener:function(t,e,i){e=e.split(" ");for(var o=0;o<e.length;o++)"leaflet"==mappl10n.options.engine?t.on(e[o],i):google.maps.event.addListener(t,e[o],i)},addListenerOnce:function(t,e,i){e=e.split(" ");for(var o=0;o<e.length;o++)"leaflet"==mappl10n.options.engine?t.once(e[o],i):google.maps.event.addListenerOnce(t,e[o],i)},clearInstanceListeners:function(t){"leaflet"==mappl10n.options.engine?t.off():google.maps.event.clearInstanceListeners(t)},clearListeners:function(t,e){e=e.split(" ");for(var i=0;i<e.length;i++)"leaflet"==mappl10n.options.engine?t.off(e[i]):google.maps.event.clearListeners(t,e[i])},trigger:function(t,e,i){"leaflet"==mappl10n.options.engine?t.fire(e,i):google.maps.event.trigger(t,e,i)}},function(t){e.lib.Modal=function(){this.el=null;var e=this;this.el=t('<div class="mapp-modal" tabindex="0">').append('<div class="mapp-modal-backdrop">').append('<div class="mapp-modal-content" tabindex="1">'),this.el.hide(),this.el.on("click",".mapp-modal-backdrop",(function(){e.close()})),this.el.on("click",".mapp-modal-close",(function(){e.close()})),this.el.on("keydown",(function(t){27==t.which&&e.close()}))},e.lib.Modal.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.el.hide(),t("body").removeClass("mapp-modal-noscroll"))},focus:function(){t(".mapp-modal-focus",this.el).attr("tabindex",0),t(".mapp-modal-focus",this.el).focus()},open:function(){if(!this.el.parent().length){const e=t("body",window.parent.document);this.el.appendTo(e)}this.el.show(),t("body").addClass("mapp-modal-noscroll"),this.focus()},setContent:function(e){t(".mapp-modal-content",this.el).empty(),t(".mapp-modal-content",this.el).append('<div class="mapp-modal-close">&times;').append(e),this.focus()}}}(jQuery)},692:()=>{var t=window.mapp||{};jQuery,t.load=function(){if(void 0!==t&&t.data)for(;t.data.length;){var e=t.data.pop();window[e.name]=new t.Map(e),window[e.name].display()}},t.load()},436:()=>{var t,e=window.mapp||{};t=jQuery,e.Marker=function(t){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(t),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove()},e.Marker.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let i=e.fromLatLngToDivPixel(this.position),o=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};t(this.div).css({left:i.x-o.width/2,top:i.y-o.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(t){let e="on"+t.type[0].toUpperCase()+t.type.slice(1);this[e]&&this[e](t)},onAdd:function(){let i=this.overlayView.getPanes();i&&(this.div=t('<div class="mapp-marker">'),this.div.appendTo(i.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)&&e.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(t){e.event.trigger(this,"mouseover")},onMouseleave:function(t){e.event.trigger(this,"mouseout")},onPointerdown:function(t){const e=this.map.getDiv().getBoundingClientRect(),i=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:t.clientX,y:t.clientY},offset:{x:i.x-(t.clientX-e.left),y:i.y-(t.clientY-e.top)}},this.toggleDragEvents(!0)},onPointermove:function(t){if(Math.abs(t.clientX-this.dragging.startPixel.x)+Math.abs(t.clientY-this.dragging.startPixel.y)<3)return;const i=this.map.getDiv().getBoundingClientRect();let o={x:t.clientX-i.left+this.dragging.offset.x,y:t.clientY-i.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(o)),this.draw(),this.dragging.moved=!0,e.event.trigger(this,"dragstart")},onPointercancel:function(t){this.onPointerup(t)},onPointerup:function(t){this.dragging&&this.dragging.moved&&e.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(t,e){let i="set"+t[0].toUpperCase()+t.slice(1);this[i]&&this[i](e)},setDraggable:function(t){this.draggable=t,this.map&&(this.div.get(0).removeEventListener("pointerdown",this,{passive:!0}),t&&this.div.get(0).addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(t){if(void 0!==t&&(this.icon=t),this.icon&&this.div){let t='<img draggable="false" src="'+this.icon.url+'">';this.div.html(t);let e=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:e.width,height:e.height}),this.setZIndex(),this.draw()}},setMap:function(t){this.map=t,this.overlayView.setMap(t)},setPosition:function(t){this.position=t},setValues:function(t){for(const e in t)this.set(e,t[e])},setVisible:function(t){this.visible=t,this.div&&this.div.css("visibility",t?"visible":"hidden")},setZIndex:function(t){this.zIndex=void 0!==t?t:this.zIndex,this.div&&this.div.css("z-index",t)},toggleDragEvents(t){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),t&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},510:()=>{var t,e=window.mapp||{};t=jQuery,e.Places=function(i,o){var n=this;this.sel=t(i),this.opts=t.extend({map:null},o);let s="";s="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"algolia",this.geocoder=new e.geocoders[s](this.opts.map),this.sel.on("keydown",(function(e){13==e.which&&(e.preventDefault(),e.stopImmediatePropagation(),n.sel.autocomplete("close"),n.parse(n.sel.val(),(function(e){e&&t(n).triggerHandler("search.mapp",e)})))})),t(".mapp-search-button",this.sel.parent()).on("click",(function(){n.parse(n.sel.val(),(function(e){e&&(n.sel.autocomplete("close"),t(n).triggerHandler("search.mapp",e))}))})),this.initAutocomplete()},e.Places.prototype={parse:function(t,e){var i="";if(t&&(i="string"==typeof(i=t&&t.name?t.name:t)?i.trim():i),i)if("string"!=typeof i||"http"!=i.substring(0,4))if("user"!=i)if(t&&t.geometry)e(t);else{var o=this.parseLatLng(t);o?e(o):this.geocoder.getFirstPrediction(t,(function(t){e(t)}))}else this.geolocate((function(t){e(t)}));else e(i);else e(null)},parseLatLng:function(t){var e;if(t.hasOwnProperty("lat")&&t.hasOwnProperty("lng"))e=t;else{var i=t&&t.name?t.name:t,o=(i="string"==typeof i?i.trim():i).split(",");if(2==o.length){var n=parseFloat(o[0]),s=parseFloat(o[1]);isNaN(n)||isNaN(s)||(e={lat:n,lng:s})}}return e?{name:e.lat+", "+e.lng,geometry:{location:e}}:null},geolocate:function(t,e){var i=this;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){var o={lat:e.coords.latitude,lng:e.coords.longitude};t({name:o.lat+", "+o.lng,geometry:{location:o}}),i.sel.val("")}),(function(i){if(!e){var o=i&&i.message?" : "+i.message:"";alert(mappl10n.no_geolocate+o)}t(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)},initAutocomplete:function(){var e=this;this.sel&&this.sel.length&&(this.sel.on("autocompleteselect",(function(i,o){e.geocoder.getDetails(o.item,(function(i){e.parse(i,(function(i){i&&t(e).triggerHandler("search.mapp",i)}))}))})),this.sel.autocomplete({appendTo:this.sel.parent(),autoFocus:!0,minLength:1,delay:"nominatim"===mappl10n.options.geocoder?500:0,source:(t,i)=>{e.geocoder.getPredictions(t.term,(function(t){i(t)}))}}))}}},548:()=>{var t,e=window.mapp||{};t=jQuery,e.Poi=function(i){if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},t.extend(this,this.defaults,i),i&&i.correctedAddress&&(this.address=i.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),i.viewport&&i.viewport.sw&&i.viewport.ne&&i.viewport.sw.lat){var o=i.viewport.sw,n=i.viewport.ne;"leaflet"==mappl10n.options.engine?this.viewport=new L.LatLngBounds(L.latLng(o.lat,o.lng),L.latLng(n.lat,n.lng)):this.viewport=new google.maps.LatLngBounds(new google.maps.LatLng(o.lat,o.lng),new google.maps.LatLng(n.lat,n.lng))}var s=[],a=[];if(!i.overlay)switch(this.type){case"polygon":if(i.poly&&i.poly.paths)for(var l=0;l<i.poly.paths.length;l++){s=[];for(var r=0;r<i.poly.paths[l].length;r++)s.push(new google.maps.LatLng(i.poly.paths[l][r].lat,i.poly.paths[l][r].lng));a.push(new google.maps.MVCArray(s))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(a)}),this.setColors(i.poly);break;case"polyline":if(i.poly&&i.poly.path)for(l=0;l<i.poly.path.length;l++)s.push(new google.maps.LatLng(i.poly.path[l].lat,i.poly.path[l].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(s)}),this.setColors(i.poly);break;case"circle":var p=new google.maps.LatLng(i.point.lat,i.point.lng);this.overlay=new google.maps.Circle({center:p,radius:parseFloat(i.poly.radius)}),this.setColors(i.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport}),this.setColors(i.poly);break;case"kml":var h=i.kml&&i.kml.url?i.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(h):new google.maps.KmlLayer({url:h,preserveViewport:!0,suppressInfoWindows:!0});break;default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([i.point.lat,i.point.lng]):this.overlay=new e.Marker({position:new google.maps.LatLng(i.point.lat,i.point.lng)})}i.type||this.set({iconid:i.iconid})},e.Poi.prototype={center:function(t){var e=this.getBounds();if("number"!=typeof t)if(e){var i=e.getNorthEast().toJSON().lng-e.getSouthWest().toJSON().lng;i<0&&(i+=360),t=Math.round(Math.log(360*this.map.div.canvas.width()/i/256)/Math.LN2),this.map.setView(this.getPosition(),t,{animate:!1})}else this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));else this.map.setView(this.getPosition(),t)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(t){switch(this.isPoly()?"poly":this.type){case"kml":return t&&t.pixelOffset?{x:t.pixelOffset.width,y:t.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 t;switch(this.type){case"polyline":t=new google.maps.LatLngBounds,this.overlay.getPath().forEach((function(e){t.extend(e)}));break;case"polygon":t=new google.maps.LatLngBounds,this.overlay.getPaths().forEach((function(e){e.forEach((function(e){t.extend(e)}))}));break;case"rectangle":case"circle":t=this.overlay.getBounds();break;case"kml":t=(t="leaflet"==mappl10n.options.engine?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport())||this.viewport;break;default:return this.viewport}return t},getColors:function(){var t={};for(var e in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})void 0!==this.overlay[e]&&(t[e]=this.overlay[e]);return t},getPosition:function(t){if(!this.type)return"leaflet"==mappl10n.options.engine?this.overlay.getLatLng():this.overlay.getPosition();if("kml"==this.type&&t&&t.latLng)return t.latLng;var e=this.getBounds();return e?e.getCenter():"leaflet"==mappl10n.options.engine?new L.latLng(0,0):new google.maps.LatLng(0,0)},getTemplateColors:function(){var t=this.getColors();return"polyline"==this.type?{color:t.strokeColor,opacity:100*t.strokeOpacity,weight:t.strokeWeight}:{color:t.fillColor,opacity:100*t.fillOpacity,weight:t.strokeWeight}},highlight:function(i){if(!this.type){var o="leaflet"==mappl10n.options.engine?t(this.overlay._icon):this.overlay.getDiv();if(o){switch(this.editable?"circle":mappl10n.options.highlight){case"circle":o.toggleClass("mapp-marker-circle",i);break;case"icon":var n=i?e.Icons.get(mappl10n.options.highlightIcon):e.Icons.get(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==n.options.iconUrl)return;this.overlay.setIcon(n);break;case"scale":o.addClass("mapp-marker"),o.toggleClass("mapp-marker-scale",i)}this.setZIndex(i?1e4:0)}}},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},open:function(t){this.map.poiOpen(this,t)},fetchPost:function(t){this.html?t():e.lib.ajax({type:"GET",data:{action:"mapp_get_post",postid:this.postid,nonce:mappl10n.options.nonce},dataType:"html",callback:e=>{this.html=e,t()}})},render:function(t,i){var o={};return o=_.extend(o,this,{icon:e.Icons.getUrl(this.iconid)}),i&&(o.body=i.description,o.title=i.name),o.thumbnail=mappl10n.options.thumbsPopup&&"popup"==t||mappl10n.options.thumbsList&&"item"==t?o.thumbnail:null,e.lib.template(this.map.templates[t],{poi:o,colors:this.getTemplateColors()})},set:function(t){for(var i in t){var o=t[i];switch(i){case"dirty":this.map.set({dirty:o});break;case"iconid":this.type||(this.iconid=o,this.overlay.setIcon(e.Icons.get(o)));break;default:this[i]=o}}this.map&&"undefined"!=typeof dirty&&this.map.set({dirty})},setColors:function(t){var e={};for(var i in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})t&&void 0!==t[i]&&(e[i]=t[i]);this.overlay.setOptions(e)},setEditable:function(t){var i=this;"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=t:this.overlay.setDraggable(t),this.isPoly()&&this.overlay.setEditable(t),e.event.clearListeners(this.overlay,"rightclick"),e.event.clearListeners(this.overlay,"dragstart"),t&&(e.event.addListener(this.overlay,"dragstart",(function(){i.viewport=null,i.map.poiClose()})),e.event.addListener(this.overlay,"dragend",(function(){i.map.set({dirty:!0})})),"polygon"!=this.type&&"polyline"!=this.type||"leaflet"!=mappl10n.options.engine&&(e.event.addListener(this.overlay,"rightclick",(function(t){null!=t.vertex&&i.overlay.getPath().getLength()>2&&i.overlay.getPath().removeAt(t.vertex)})),e.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),e.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(function(){i.map.set({dirty:!0})})))))},setMap:function(t){var i=this;this.map=t,e.event.clearInstanceListeners(this.overlay),null!=t?("kml"==this.type&&("leaflet"==mappl10n.options.engine?(e.event.addListenerOnce(this.overlay,"ready",(function(){i.viewport=i.overlay.getBounds()})),e.event.addListenerOnce(this.overlay,"error",(function(){alert(mappl10n.kml_error)}))):(e.event.addListener(this.overlay,"defaultviewport_changed",(function(){i.viewport=i.overlay.getDefaultViewport()})),e.event.addListener(this.overlay,"status_changed",(function(){var t=i.overlay.getStatus();"OK"!=t&&alert(mappl10n.kml_error+":"+t)})))),this.setEditable(this.map.editable),!this.type&&this.map.clusterer||("leaflet"==mappl10n.options.engine?this.overlay.addTo(t.getMap()):this.overlay.setMap(t.getMap())),e.event.addListener(this.overlay,"click",(function(t){i.open(t)})),e.event.addListener(this.overlay,"mouseover",(function(t){i.map.poiHover(i)})),e.event.addListener(this.overlay,"mouseout",(function(t){i.map.poiHover(null)}))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setTemplateColors:function(t){let{color:e,opacity:i,weight:o}=t;i=i?i/100:void 0;var n="polyline"==this.type?{strokeColor:e,strokeOpacity:i,strokeWeight:o}:{fillColor:e,fillOpacity:i,strokeColor:e,strokeWeight:o,strokeOpacity:1};this.setColors(n)},setVisible:function(t){void 0!==this.overlay.setVisible&&this.overlay.setVisible(t)},setZIndex:function(t){"leaflet"==mappl10n.options.engine?this.type||this.overlay.setZIndexOffset(t):this.overlay.set("zIndex",t)},toJSON:function(){var t={address:this.address,body:this.body,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},e=this.getPosition();t.point=e.toJSON();var i=this.viewport?this.viewport:this.getBounds();if(i){var o=i.toJSON();t.viewport={sw:{lat:o.south,lng:o.west},ne:{lat:o.north,lng:o.east}}}if("kml"==this.type&&(t.kml=this.kml),this.isPoly())switch(t.poly=this.getColors(),this.type){case"circle":t.poly.radius=this.overlay.getRadius();break;case"polyline":t.poly.path=[],this.overlay.getPath().forEach((function(e){t.poly.path.push(e.toJSON())}));break;case"polygon":t.poly.paths=[],this.overlay.getPaths().forEach((function(e){var i=[];e.forEach((function(t){i.push(t.toJSON())})),t.poly.paths.push(i)}));break;case"rectangle":var n=this.overlay.getBounds();t.viewport={sw:n.getSouthWest().toJSON(),ne:n.getNorthEast().toJSON()}}return t}}},675:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=0;e<t.length;e++){var i=t[e].match(/country\/(.*)?/);if(i)return i[1]}return}},892:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e={country:"country",city:"city","amenity/bus_station":"busStop","amenity/townhall":"townhall","railway/station":"trainStation","aeroway/aerodrome":"airport","aeroway/terminal":"airport","aeroway/gate":"airport"};for(var i in e)if(-1!==t.indexOf(i))return e[i];return"address"}},991:(t,e,i)=>{"use strict";e.Z=function(t){var e=t.formatInputValue,i=t.hit,s=t.hitIndex,a=t.query,r=t.rawAnswer;try{var h=i.locale_names[0],c=i.country,d=i.administrative&&i.administrative[0]!==h?i.administrative[0]:void 0,g=i.city&&i.city[0]!==h?i.city[0]:void 0,u=i.suburb&&i.suburb[0]!==h?i.suburb[0]:void 0,m=i.county&&i.county[0]!==h?i.county[0]:void 0,v=i.postcode&&i.postcode.length?function(t,e){for(var i=e[0].value,o=[],n=1;n<e.length;++n)"none"!==e[n].matchLevel&&o.push({index:n,words:e[n].matchedWords});if(0===o.length)return{postcode:t[0],highlightedPostcode:i};return o.sort((function(t,e){return t.words>e.words?-1:t.words<e.words?1:t.index-e.index})),{postcode:t[o[0].index],highlightedPostcode:e[o[0].index].value}}(i.postcode,i._highlightResult.postcode):{postcode:void 0,highlightedPostcode:void 0},f=v.postcode,y=v.highlightedPostcode,w={name:p(i._highlightResult.locale_names),city:g?p(i._highlightResult.city):void 0,administrative:d?p(i._highlightResult.administrative):void 0,country:c?i._highlightResult.country.value:void 0,suburb:u?p(i._highlightResult.suburb):void 0,county:m?p(i._highlightResult.county):void 0,postcode:y},b={name:h,administrative:d,county:m,city:g,suburb:u,country:c,countryCode:(0,o.default)(i._tags),type:(0,n.default)(i._tags),latlng:{lat:i._geoloc.lat,lng:i._geoloc.lng},postcode:f,postcodes:i.postcode&&i.postcode.length?i.postcode:void 0},L=e(b);return l(l({},b),{},{highlight:w,hit:i,hitIndex:s,query:a,rawAnswer:r,value:L})}catch(t){return console.error("Could not parse object",i),console.error(t),{value:"Could not parse object"}}};var o=s(i(675)),n=s(i(892));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?a(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function p(t){for(var e=t[0].value,i=[],o=1;o<t.length;++o)"none"!==t[o].matchLevel&&i.push({index:o,words:t[o].matchedWords});return 0===i.length?e:(i.sort((function(t,e){return t.words>e.words?-1:t.words<e.words?1:t.index-e.index})),0===i[0].index?"".concat(e," (").concat(t[i[1].index].value,")"):"".concat(t[i[0].index].value," (").concat(e,")"))}},574:(t,e)=>{"use strict";e.Z=function(t){var e=t.administrative,i=t.city,o=t.country,n=t.name,s=t.type;return"".concat(n).concat("country"!==s&&void 0!==o?",":"","\n ").concat(i?"".concat(i,","):"","\n ").concat(e?"".concat(e,","):"","\n ").concat(o||"").replace(/\s*\n\s*/g," ").trim()}}},i={};function o(e){var n=i[e];if(void 0!==n)return n.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,o),s.exports}o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(628),o(854),o(397),o(442),o(282),o(689),o(436),o(510),o(548),o(692)})();
1
+ (()=>{var t={854:()=>{var t=window.mapp||{};const __=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress");var i;i=jQuery,t.Map=function(t,e){this.defaults={alignment:null,center:null,classname:null,editable:null,embed:null,height:null,initialOpenInfo:null,layers:null,layout:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,postid:null,query:null,search:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.hovered=null,this.isFullscreen=!1,this.iw=null,this.mapdata=t,this.opened=null,this.places=null,this.selected=null,this.settings=e||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.modal_=null,this.pagination_={count:0,page:1},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},t.Map.prototype={display:function(){this.render(),this.div&&this.div.layout&&(this.sanity(),this.editable?this.templates={loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?this.templates={loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:this.templates={loop:"map-loop",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&&("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.setMapTypeId(this.mapTypeId),this.clustering(),"postmodal"==mappl10n.options.mashupClick&&(this.modal_=new t.lib.Modal),this.places=new t.Places(i(".mapp-places",this.div.search),{map:this}),this.addUserLocation(),this.editable&&this.places.sel.focus(),i(this.places).on("search.mapp",((t,e)=>{this.onSearch(e)})),this.addEvents("click dragstart zoom_changed zoomstart",(t=>{"leaflet"==mappl10n.options.engine&&"click"==t.type&&t.originalEvent&&!t.originalEvent.target.matches(".mapp-canvas")||this.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(t=>{if(i.contains(this.div.list.get(0),t.target))return;const e=i(t.currentTarget),o=e.attr("data-mapp-action"),n=e.attr("data-mapp-"+o);t.preventDefault(),this.onAction(o,n,e)})),this.div.list.on("click","[data-mapp-action]",(t=>{const e=i(t.currentTarget),o=e.attr("data-mapp-action"),n=e.attr("data-mapp-"+o);this.onAction(o,n,e)})),this.div.filters.on("change",(()=>{this.fetchPois()})),i(window).on("resize",(()=>{document.fullscreenElement?this.isFullscreen=!0:(this.isFullscreen?this.isFullscreen=!1:this.poiClose(),this.toggleView("mini"),this.resize())})),t.event.addListener(this.map_,"maptypeid_changed baselayerchange",(()=>{this.set({dirty:!0})})),this.places.parse(this.center,(t=>{this.center=t&&t.geometry&&t.geometry.location?{lat:t.geometry.location.lat,lng:t.geometry.location.lng}:null,this.setPois(this.pois),this.initCenter()})),this.div.list.on("mouseenter","[data-mapp-poi]",(t=>{var e=i(t.currentTarget).attr("data-mapp-poi");this.poiHover(this.pois_[e])})),this.div.list.on("mouseleave","[data-mapp-poi]",(t=>{this.poiHover(null)}))))},initCenter:function(){setTimeout((()=>{this.recenter(),this.renderList(),this.isSearchable&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():t.event.addListenerOnce(this.map_,"idle",(()=>this.initOpen()))}),100)},initOpen:function(){const t=this.pois_.length?this.pois_[0]:null,e=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;t&&e&&!this.editable&&t.open()},addEvents:function(e,i){e=e.split(" ");for(var o=0;o<e.length;o++)t.event.addListener(this.map_,e[o],i)},addGeolocateControl:function(){if(!mappl10n.options.ssl)return;const t=i(".mapp-geolocate-control-wrapper").get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(t):(L.Control.Geolocate=L.Control.extend({onAdd:e=>t,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 t=i.makeArray(this.layers),e=0;e<t.length;e++){var o=t[e].trim(),n=o.split(".").pop();this.layers_[o]?this.toggleLayer(o):"kml"==n||"kmz"==n?this.layers_[o]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:o}):"json"==n&&(this.layers_[o]=new google.maps.Data({map:this.map_}).loadGeoJson(o))}},addMenu:function(){i("body").on("click",(t=>{var e=i(t.target),o=e.attr("data-mapp-action");e==this.div.filters||"filters-toggle"==o||e.closest(this.div.filters).length||this.toggleView("filters",!1),e==this.div.menu||"menu-toggle"==o||e.closest(this.div.menu).length||this.toggleView("menu",!1)}))},addPopup:function(){var e=this.editable?"mapp-iw-edit":"mapp-iw";this.editable||(e+=" mapp-"+this.templates.popup),this.div.iw=i('<div class="'+e+'">').appendTo(this.div.canvas),this.iw=new t.Infobox(this.map_,{className:this.editable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(()=>{this.poiClose()}))},addSearchMove:function(){},addUserLocation:function(){mappl10n.options.userLocation&&mappl10n.options.ssl&&this.places.geolocate((e=>{if(e&&e.geometry&&e.geometry.location){const i=e.geometry.location,o=t.Icons.get("geolocation");"leaflet"==mappl10n.options.engine?this.user_=L.marker([i.lat,i.lng],{icon:o}).addTo(this.map_):(this.user_=new t.Marker({icon:o,position:new google.maps.LatLng(i.lat,i.lng)}),this.user_.setMap(this.map_))}}),!0)},clusterGetLatLng:function(t){if(this.clusterer){if("leaflet"==mappl10n.options.engine){var e=this.clusterer.getVisibleParent(t.overlay);return e?e.getLatLng():null}for(var i=this.clusterer.getClusters(),o=0;o<i.length;o++){var n=i[o].markers_;if(n.length>1)for(var s=0;s<n.length;s++)if(n[s]==t.overlay)return i[o].center_}}},clustering:function(){if(mappl10n.options.clustering&&!this.editable){let t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup(t):(t=_.extend(t,{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"}),this.clusterer=new MarkerClusterer(this.map_,[],t))}},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){var t=[];for(let e=0;e<this.pois_.length;e++)this.pois_[e].type||t.push(this.pois_[e].overlay);"leaflet"==mappl10n.options.engine?(this.clusterer.addLayers(t),this.map_.addLayer(this.clusterer)):this.clusterer.addMarkers(t)}},directionsOpen:function(e,i){var o=e?e.getAddress():"",n=i?i.getAddress():"";e?this.popupOpen(e):i&&this.popupOpen(i),this.dir_||(this.dir_=new t.Directions(this.div.directions,this)),this.dir_.open(o,n)},fetchPois:function(e){var o=new Date;this.poiClose();var n={action:"mapp_query",filters:i(":input",this.div.filters).serialize(),list:!!this.div.list.length,query:this.query,url:{href:window.location.href,search:window.location.search},debug:mappl10n.options.debug};this.xhr_&&this.xhr_.abort("cancel"),this.spinner(!0),this.xhr_=t.lib.ajax({data:n,callback:(i,n)=>{this.spinner(!1),i&&"OK"==i.status&&(this.setPois(i.data.pois),this.renderList(),mappl10n.options.debug&&t.lib.log("Results: "+i.data.pois.length+" ("+n.responseText.length/1e3+"K) AJAX: "+(new Date-o)+(i.data.timing?i.data.timing:"")),e&&e())}})},fitBounds:function(t){return this.map_.fitBounds(t)},getBounds:function(){try{return this.map_.getBounds()}catch(t){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(t){return null}},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(t){return null}},isFilterable:function(){return mappl10n.options.pro&&mappl10n.options.filters&&mappl10n.options.filters.length>0&&!this.editable&&this.query},isSearchable:function(){return!!this.editable},onAction:function(t,o,n){switch(t){case"center":this.toggleView("menu",!1),this.poiClose(),this.recenter();break;case"dir":this.directionsOpen(null,this.opened);break;case"dir-from":this.directionsOpen(this.opened,null);break;case"filters-reset":this.div.filters.find(":input").each((()=>{"checkbox"==this.type||"radio"==this.type?i(e.currentTarget).prop("checked",!1):i(e.currentTarget).val("")})),this.fetchPois();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((t=>{t&&t.geometry&&t.geometry.location&&this.setView(t.geometry.location,parseInt(mappl10n.options.poiZoom))}));break;case"layer":this.toggleLayer(o),this.toggleView("menu",!1);break;case"list-toggle":this.togglePoiListOpen();break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=n.attr("data-mapp-poi");this.poiOpen(this.pois_[s]);break;case"page":var a=parseInt(n.attr("data-mapp-page"));this.pagination_.page=a,this.renderList();break;case"view-map":this.togglePoiListOpen(!1);break;case"view-list":this.togglePoiListOpen(!0);break;default:return!0}},onSearch:function(t){if(t&&t.geometry){var e=t.geometry.location?t.geometry.location:null,i=t.geometry.viewport?t.geometry.viewport:null;if("leaflet"==mappl10n.options.engine)var o=new L.LatLng(e.lat,e.lng),n=i?new L.LatLngBounds(new L.LatLng(i.sw.lat,i.sw.lng),new L.LatLng(i.ne.lat,i.ne.lng)):o.toBounds(1e3*mappl10n.options.radius);else{var s=new google.maps.Circle({center:e,radius:1e3*mappl10n.options.radius});n=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(s.getBounds()):s.getBounds()}n&&this.fitBounds(n),this.setView(e)}},poiClose:function(){this.poiHighlight(null),this.selected=null,this.opened=null,this.hovered=null,this.iw.close(),this.dir_&&this.dir_.close(),i(this).triggerHandler("mapp.close")},poiHighlight:function(t){if("icon"!=mappl10n.options.highlight||"leaflet"!=mappl10n.options.engine||!this.editable){if(i("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),this.hovered&&this.hovered.highlight(!1),t){var e=i.inArray(t,this.pois_);i('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"),t.highlight(!0)}this.selected&&(e=i.inArray(this.selected,this.pois_),i('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"))}},poiHover:function(t){t&&this.opened==t||(mappl10n.options.tooltips||(this.poiHighlight(null),this.hovered=null),t&&(this.poiHighlight(t),this.hovered=t,mappl10n.options.tooltips&&!this.editable&&this.popupOpen(t,null,"popup")))},poiInsert:function(t){this.pois_.unshift(t),t.setMap(this),this.renderList(),this.set({dirty:!0})},poiOpen:function(t,e){if(this.poiClose(),this.selected=t,this.poiHighlight(t),this.query&&t.postid&&t.url&&!this.editable)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(t.url);case"postnew":return void window.open(t.url);case"postmodal":return this.modal_.open(),this.modal_.setContent('<div class="mapp-modal-spinner">'),void t.fetchPost((()=>this.modal_.setContent(t.html)))}this.div.layout.hasClass("mapp-view-mini")&&this.togglePoiListOpen(!1),this.popupOpen(t,e,"popup"),i(this).triggerHandler("mapp.open",t)},poiRemove:function(t){var e=i.inArray(t,this.pois_);-1!=e&&(this.pois_[e].setMap(null),this.pois_.splice(e,1),this.renderList()),this.set({dirty:!0})},popupClose:function(){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.editable||(this.iw.close(),this.dir_&&this.dir_.close(),this.opened=null,i(this).triggerHandler("mapp.close"))},popupOpen:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"popup",o=null;this.popupClose(),e&&e.featureData?o=e.featureData:e&&e.propagatedFrom&&e.propagatedFrom.feature&&e.propagatedFrom.feature.properties&&(o=e.propagatedFrom.feature.properties),this.div.iw.html(t.render(i,o)),this.div.iw.toggleClass(" mapp-thumb-"+mappl10n.options.thumbsPopup,!!t.thumbnail);var n=this.clusterGetLatLng(t),s=n||t.getPosition(e);this.iw.open({position:s,anchorPoint:t.getAnchorPoint(e)}),this.opened=t},recenter:function(){var t=this.center&&this.center.hasOwnProperty("lat")&&this.center.hasOwnProperty("lng")?this.center:null,e=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null;if(t&&!e&&this.query)return void this.onSearch({geometry:{location:{lat:t.lat,lng:t.lng}}});if(t)return void this.setView(t,e||1);if(0==this.pois_.length)return void this.setView({lat:0,lng:0},e||1);if(1==this.pois_.length)return void this.pois_[0].center(e);let i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var o=0;o<this.pois_.length;o++){var n=this.pois_[o].getBounds(),s=this.pois_[o].getPosition();i=n?"leaflet"==mappl10n.options.engine?i.extend(n):i.union(n):i.extend(s)}e?this.setView(i.getCenter().toJSON(),e):this.fitBounds(i)},render:function(){let e=this.name?this.name+"-layout":"",o="mapp-layout",n=this.layout?this.layout:"left";if(o+="left"==n?" mapp-list-left":" mapp-inline",o+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",o+=this.classname?" "+this.classname:"",!document.body.classList.contains("block-editor-page")){let t=this.alignment?this.alignment:mappl10n.options.alignment;if(t){let e=" align"+t+" mapp-align-"+t;window.parent==window?o+=e:i(window.frameElement).parent().parent().addClass(e)}}var s=t.lib.template("map",{map:this,layout:n});if(this.sel){if(this.sel.html(s),this.sel.addClass(o),this.sel.attr("id",e),this.div.layout=this.sel,!this.div.layout.length)return t.lib.log("MapPress: Missing map name or container for map: "+this.name)}else{let n=i('<div id="'+e+'" class="'+o+'">');n.html(s);let a=i("#"+this.name+"-layout");if(!a.length)return t.lib.log("MapPress: Missing map name or container for map: "+this.name);a.replaceWith(n),this.div.layout=n}i.each(["canvas","content","controls","spinner","directions","filters","list","menu","wrapper","search"],((t,e)=>{this.div[e]=i(".mapp-"+e,this.div.layout)})),this.poiList&&"inline"==n&&(this.div.list=i('<div class="mapp-inline mapp-list"></div>'),window.parent==window?this.div.layout.append(this.div.list):i(window.frameElement.parentElement).after(this.div.list)),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderList:function(){var e=this.getBounds(),i=0;if(this.editable)return void this.div.layout.trigger("mapp.render");if(!this.poiList)return;let o=parseInt(mappl10n.options.poiListPageSize);o=isNaN(o)?20:o;const n=o*(this.pagination_.page-1),s=n+o;if(!this.editable)for(var a=0;a<this.pois_.length;a++){let t=this.pois_[a];t.visible=!1,this.isSearchable()?e&&e.contains(t.getPosition())&&(t.visible=!0,i++):(t.visible=!0,i++),t.visible=i>=n&&i<=s&&t.visible}this.pagination_.count=i,this.div.list.html(t.lib.template(this.templates.loop,{map:this,pois:this.pois_,pageSize:o,pagination:this.pagination_})),mappl10n.options.thumbsList&&this.div.list.addClass(" mapp-thumb-"+mappl10n.options.thumbsList)},renderMenu:function(){for(var t in this.layers_)i('[data-mapp-layer="'+t+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[t].getMap())},resetPois:function(){for(var t=0;t<this.pois_.length;t++)this.pois_[t].setMap(null);this.pois_=[],this.clustersReset()},resize:function(){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():t.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){const t="<a href='"+mappl10n.options.adminurl+"/admin.php?page=mappress'>"+__("MapPress Settings")+"</a>",e=jQuery&&jQuery.ui?jQuery.ui.version:"0.0",o="<a href ='http://mappresspro.com/mappress-faq' target='_blank'>"+__("MapPress FAQ")+"</a>",n="<a href='http://mappresspro.com/chris-contact', target='_blank'>"+__("contact support")+"</a>",s="<br/>"+sprintf(__("Please see the %s for help, or %s and provide this error message."),o,n),a=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 l=[{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.")+s},{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.")+s},{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."),t)+a},{condition:i('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")+s},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")+s},{condition:e<"1.12",title:sprintf(__("Obsolete jQuery version: %s, must be >= 1.12"),e),text:__("A theme or plugin is loading an obsolete version of jQuery.")+s}];if(_.map(l,(t=>{if(t.condition){mappl10n.options.admin&&this.sanityOutput({title:t.title,text:t.text?t.text:""});let e=jQuery("<span>"+t.text.replace("<br/>","\n")+"</span>").text();console.error(__("Map error")+": "+t.title+" - "+e)}})),"google"==mappl10n.options.engine){const t=console.error;console.error=e=>{(e.includes("Google Maps JavaScript API")||e.includes("You have exceeded your request quota")||e.includes("You have exceeded your daily quota"))&&mappl10n.options.admin&&(e=e.replace(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi,((t,e,i)=>{let o=i;return o.match("^https?://")||(o="http://"+o),e+'<a href="'+o+'" target="_blank">'+i+"</a>"})),this.sanityOutput({title:__("Google Maps Error"),text:e})),t(e)}}},sanityOutput(t){if(!i(".mapp-errors-overlay",this.div.content).length){let t="<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(t)}i(".mapp-errors-list",this.div.content).append("<div class='mapp-errors-title'>"+t.title+"</div><div class='mapp-errors-text'>"+t.text+"</div>")},set:function(t){for(let i in t){var e=t[i];switch(i){case"dirty":this.dirty=e;break;case"mapTypeId":this.mapTypeId=e,this.setMapTypeId(e);break;case"poiList":this.poiList=null==e?mappl10n.options.poiList:e,this.togglePoiListOpen(mappl10n.options.poiListOpen),this.toggleView("mini");break;case"search":this.search=e;break;case"style":this.setStyle(e);break;case"title":this.title=e;break;default:this[i]=e}}},setMapTypeId:function(t){const e=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),i=_.findWhere(e,{id:t});!mappl10n.options.style||"roadmap"!=t&&"streets"!=t&&i||(t=mappl10n.options.style),style=_.findWhere(e,{id:t}),style=style||e[0],this.setStyle(style)},setPois:function(e){if(this.resetPois(),e)for(var i=0;i<e.length;i++){var o=new t.Poi(e[i]);this.pois_.push(o),o.id=this.pois_.length-1,o.setMap(this)}this.clustersSet()},setSize:function(t){var e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];let o={},n={};if(t&&t.hasOwnProperty("width")&&(o={width:t.width?t.width:e.width}),t&&t.hasOwnProperty("height")){let i=t.height?t.height:e.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")?(i(window.frameElement).parent().parent().css(o),i(window.frameElement).parent().css(n)):this.embed?(o={height:"100%"},n={"padding-bottom":0,height:"100%"}):(this.div.layout.css(o),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">&copy; Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">&copy; 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],o=i.extend({},t,e);L.tileLayer(t.url,o).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==e.type?e.id:"roadmap"),e.json){let i=null;try{i=JSON.parse(e.json)}catch(e){t.lib.log("Invalid JSON in map style")}this.map_.setOptions({styles:i||null})}else this.map_.setOptions({styles:null})},setView:function(t,e,i){"leaflet"==mappl10n.options.engine?(null==e&&(e=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(t,e,i)):(t=t&&!t.toJSON?{lat:parseFloat(t.lat),lng:parseFloat(t.lng)}:t,e=e?parseInt(e):null,t&&this.map_.setCenter(t),e&&this.map_.setZoom(e))},sortPois:function(t){var e=Array();this.set({dirty:!0});for(var i=0;i<t.length;i++){var o=parseInt(t[i]);if(isNaN(o))return!1;e.push(this.pois_[o])}if(e.length!=this.pois_.length)return!1;this.pois_=e,this.renderList()},spinner:function(t){t?(this.div.spinner.html('<span class="mapp-spinner-icon"></span>'),this.div.spinner.addClass("mapp-active")):this.div.spinner.removeClass("mapp-active")},toggleLayer:function(t,e){e=void 0!==e?e:null==this.layers_[t].getMap(),i.each(["traffic","bicycling","transit"],((t,e)=>{this.layers_[e].setMap(null)})),e&&this.layers_[t].setMap(this.map_)},togglePoiListOpen:function(t){this.div.layout.toggleClass("mapp-list-open",t),setTimeout((()=>this.resize()),100)},togglePois:function(t){t=!!t;for(var e=0;e<this.pois_.length;e++)this.pois_[e].setVisible(t)},toggleView:function(t,e){if("mini"==t){let t=this.div.layout.hasClass("mapp-view-mini"),e=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",e),void(e!=t&&this.togglePoiListOpen(!e))}e=void 0===e?!this.div.layout.hasClass("mapp-view-"+t):e,this.div.layout.toggleClass("mapp-view-"+t,e),"list"==t&&e&&this.renderList(),"menu"==t&&e&&this.renderMenu(),"directions"==t&&this.resize()},toJSON:function(){this.pois=[];for(var t=0;t<this.pois_.length;t++)this.pois.push(this.pois_[t].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}}}},397:()=>{var t,e=window.mapp||{};t=jQuery,e.Directions=function(e,i){this.sel=t(e),this.map=i;var o=this;this.sel.on("keydown",(function(t){13==t.which?(o.getDirections(),t.preventDefault()):27==t.which&&o.close()})),this.sel.on("click","[data-mapp-action]",(function(e){var i=t(this).attr("data-mapp-action"),n=t(".mapp-dir-daddr",o.sel).val(),s=t(".mapp-dir-saddr",o.sel).val();switch(e.preventDefault(),i){case"dir-cancel":o.close();break;case"dir-get":o.getDirections();break;case"dir-swap":t(".mapp-dir-saddr",o.sel).val(n),t(".mapp-dir-daddr",o.sel).val(s)}})),this.open=function(e,i){"google"!=mappl10n.options.directions?(this.map.toggleView("directions",!0),t(".mapp-dir-saddr",this.sel).val(e),t(".mapp-dir-daddr",this.sel).val(i)):this.openGoogle(e,i)},this.close=function(){this.map.toggleView("directions",!1)},this.getDirections=function(){var e=t(".mapp-dir-saddr",this.sel).val().trim(),i=t(".mapp-dir-daddr",this.sel).val().trim();this.map.poiClose(),this.openGoogle(e,i)},this.openGoogle=function(t,e){var i=mappl10n.options.directionsServer;-1==(i="https://maps.google.com"==i?"https://www.google.com":i).toLowerCase().indexOf("http")&&(i="https://"+i),i+="/maps/dir/?api=1&origin="+encodeURIComponent(t)+"&destination="+encodeURIComponent(e),window.open(i)}}},442:(t,e,i)=>{"use strict";i.r(e);var o,n=i(991),s=i(574),a=window.mapp||{};a.geocoders={},o=jQuery,a.geocoders.algolia=function(t){this.map=t},a.geocoders.algolia.prototype={getDetails:function(t,e){e({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(t,e){var i="https://places-dsn.algolia.net/1/places/query?query="+encodeURIComponent(t)+"&hitsPerPage=5";i=mappl10n.options.country?i+"&countries="+mappl10n.options.country.toLowerCase():i,i=mappl10n.options.language?i+"&language="+mappl10n.options.language.toLowerCase():i+"&language=en";var a=this.map.getMap().getCenter();a&&(i+="&aroundLatLng="+a.lat+","+a.lng),o.getJSON(i,(function(i){if(i&&i.hits&&i.hits.length>0){var o=i.hits.map((function(e,o){return(0,n.Z)({formatInputValue:s.Z,hit:e,hitIndex:o,query:t,rawAnswer:i})}));e(o)}else e(null)}))}},function(t){a.geocoders.google=function(e){this.map=e,this.token=null;var i=t('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,i.remove()},a.geocoders.google.prototype={getDetails:function(t,e){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var i={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(i,(function(t,i){if("OK"==i&&t&&t.geometry){if(t.geometry.location&&(t.geometry.location=t.geometry.location.toJSON()),t.geometry.viewport){var o=t.geometry.viewport.toJSON();t.geometry.viewport={sw:{lat:o.south,lng:o.west},ne:{lat:o.north,lng:o.east}}}e(t)}else e(null)}))},getFirstPrediction:function(e,i){this.getPredictions(e,(e=>{e&&t.isArray(e)?this.getDetails(e[0],(t=>i(t))):i(null)}))},getPredictions:function(t,e){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=this.map.getMap().getBounds();"leaflet"==mappl10n.options.engine&&(i=new google.maps.LatLngBounds(new google.maps.LatLng(i.getSouthWest().lat,i.getSouthWest().lng),new google.maps.LatLng(i.getNorthEast().lat,i.getNorthEast().lng)));var o={input:t,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:this.map.editable?null:["geocode"]};this.autocompleteService.getPlacePredictions(o,(function(t,i){"OK"==i&&t&&t.length?(t=(t=t.map((t=>(t.value=t.description,t)))).filter((t=>t.place_id)),e(t)):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),e(null))}))}}}(jQuery),function(t){a.geocoders.mapbox=function(t){this.map=t},a.geocoders.mapbox.prototype={getDetails:function(t,e){let i=t.place_name,o=i.indexOf(","),n=i.indexOf(",",o+1);o>0&&(i=parseInt(i.substr(0,o))?i.substr(0,n).replace(",",""):i.substr(0,o));let s=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;e({formatted_address:t.place_name,name:i,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:s}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(e,i){var o="https://api.mapbox.com/geocoding/v5/mapbox.places/"+e+".json?access_token="+mappl10n.options.mapbox;o=mappl10n.options.country?o+"&country="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&language="+mappl10n.options.language.toLowerCase():o;var n=this.map.getMap().getCenter();n&&(o+="&proximity="+n.lng+","+n.lat),mappl10n.options.searchBox&&(o+="&bbox="+mappl10n.options.searchBox),t.getJSON(o,(t=>{t&&t.features&&t.features.length>0?(t.features=t.features.map((t=>(t.value=t.label=t.place_name,t))),i(t.features)):i(null)}))}}}(jQuery),function(t){a.geocoders.nominatim=function(t){this.map=t},a.geocoders.nominatim.prototype={getDetails:function(t,e){let i=t.display_name,o=i.indexOf(","),n=i.indexOf(",",o+1);o>0&&(i=parseInt(i.substr(0,o))?i.substr(0,n).replace(",",""):i.substr(0,o));let s=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;e({formatted_address:t.display_name,name:i,geometry:{location:{lat:t.lat,lng:t.lon},viewport:s}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(e,i){var o="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(e);if(o=mappl10n.options.country?o+"&countrycodes="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&accept-language="+mappl10n.options.language.toLowerCase():o,mappl10n.options.searchBox)o+="&viewbox="+mappl10n.options.searchBox,o+="&bounded=1";else{var n=this.map.getMap().getBounds();if(n){let t=n.getSouthWest(),e=n.getNorthEast();o+="&viewbox="+t.lng+","+t.lat+","+e.lng+","+e.lat}}t.getJSON(o,(function(t){t&&t.length?(t=t.map((t=>(t.value=t.display_name,t))),i(t)):i(null)}))}}}(jQuery)},282:()=>{var t=window.mapp||{};t.Icons={},t.Icons.get=function(e){var i=t.Icons.getUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:i,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:i}},t.Icons.getUrl=function(t){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"}},689:()=>{var t,e=window.mapp||{};t=jQuery,e.Infobox=function(i,o){this.map=i,this.anchorPoint=null,this.fudge=30,this.isOpen=!1,this.mapDiv="leaflet"==mappl10n.options.engine?i.getContainer():i.getDiv(),this.node=null,this.opts=_.extend({clip:!0,pan:!0,popout:!1},o),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null;var n=this;if(this.wrapper=t('<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>'),this.wrapper.addClass(o.className),this.node=t(".mapp-ib-content",this.wrapper),"leaflet"==mappl10n.options.engine?e.event.addListener(this.map,"move",(function(t){n.isOpen&&n.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=function(){n.isOpen&&n.draw()}),this.node.get(0).addEventListener("load",(()=>{this.open({position:this.position,anchorPoint:this.anchorPoint})}),{capture:!0}),this.opts.popout)var s="body";else s="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(s),"leaflet"==mappl10n.options.engine&&i.on("load",(()=>{L.DomEvent.disableClickPropagation(this.wrapper.get(0))}))},e.Infobox.prototype={clipToWindow:function(){var t=p.y,e=p.x-w/2+this.anchorPoint.x,i=this.mapDiv.getBoundingClientRect(),o=i.x+window.scrollX;t+=i.y+window.scrollY,e+=o;var n=this.opts.clip?divw:document.body.clientWidth;e+w>n&&(e=n-w),e<0&&(e=0),this.wrapper.css({left:e}),h=this.node.outerHeight(),t=p.y-h+this.anchorPoint.y,this.node.removeClass("mapp-ib-flip"),this.opts.clip&&!this.opts.pan&&t<0&&t<divh-(p.y+h)&&(t=p.y,this.node.addClass("mapp-ib-flip"))},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 t,e,i;if(t=this.node.outerWidth(),e=this.node.outerHeight(),"leaflet"==mappl10n.options.engine)i=this.map.latLngToContainerPoint(this.position);else{const t=this.overlayView.getProjection();if(!t)return;i=t.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:i.x-t/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-i.y-this.anchorPoint.y})},getContent:function(){return t(".mapp-ib",this.node)},open:function(e){this.position=e.position,this.anchorPoint=e.anchorPoint?e.anchorPoint:{x:0,y:0},this.opts.popout&&this.node.css({maxWidth:.8*this.mapDiv.clientWidth-this.fudge,maxHeight:this.mapDiv.clientHeight+this.anchorPoint.y-2*this.fudge}),this.wrapper.addClass("mapp-open"),this.draw();const i={w:t(this.mapDiv).width(),h:t(this.mapDiv).height()},o={w:this.node.outerWidth(),h:this.node.outerHeight()};this.opts.popout?this.clipToWindow():"leaflet"==mappl10n.options.engine?this.panLeaflet(i,o):this.panGoogle(o),this.isOpen=!0},panGoogle:function(t){var e=this.overlayView.getProjection(),i=e?e.fromLatLngToDivPixel(this.position):null;if(i){var o=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x-t.w/2-this.fudge,i.y+this.fudge)),n=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x+t.w/2+this.fudge,i.y-t.h+this.anchorPoint.y-this.fudge)),s=new google.maps.LatLngBounds(o,n);this.map.panToBounds(s)}},panLeaflet:function(t,e){var i=this.map.latLngToContainerPoint(this.position),o=(this.node.outerWidth(),this.node.outerHeight(),{x:i.x,y:i.y});i.x+e.w/2+this.anchorPoint.x>t.w-this.fudge?o.x=Math.max(t.w-e.w/2-this.anchorPoint.x-this.fudge,t.w/2-this.anchorPoint.x):i.x-e.w/2+this.anchorPoint.x<this.fudge&&(o.x=Math.min(e.w/2+this.anchorPoint.x+this.fudge,t.w/2-this.anchorPoint.x)),i.y+this.anchorPoint.y-e.h<this.fudge&&(o.y=e.h-this.anchorPoint.y+this.fudge),o.y>=t.h&&(o.y=t.h-this.fudge),this.map.panBy([i.x-o.x,i.y-o.y])},setContent:function(e){t(".mapp-ib",this.node).empty().append(e)}}},628:()=>{var t,e=window.mapp||{};t=jQuery,e.lib={ajax:function(e){var i=this,o={callback:null,data:null,dataType:"json",silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(t,o,n){"json"==e.dataType&&e.url==mappl10n.options.ajaxurl&&"OK"!=t.status&&i.alert(t.status),"json"==e.dataType&&t.output?i.alert("AJAX Invalid Output\r\n"+t.output):e.callback&&e.callback(t,n)},error:function(t,o,n){"cancel"!=o&&(void 0!==n&&""!=n&&i.alert("AJAX ERROR\r\nTextStatus="+o+"\r\nError="+n+"\r\nResponseText="+t.responseText),e.callback&&e.callback(null))}};return e=t.extend(o,e),t.ajax(e)},alert:function(t){mappl10n.options.admin||mappl10n.options.debug?alert(t):window.console&&console.error(t)},jqVersionCheck:function(e){if(void 0===t||void 0===e)return!1;e=e.split("."),v=t.fn.jquery.split(".");for(var i=0;i<e.length;i++){var o=parseInt(e[i]),n=void 0!==v[i]?parseInt(v[i]):0;if(n!=o)return n>o}return!0},log:function(t){window.console&&console.error(t)},scrollTo:function(t,e,i){if(t&&e&&t.length&&e.length){var o=t.height(),n=e.outerHeight(!0),s=t.scrollTop(),a=s+e.position().top,l=a+n;a=a-o/2-n/2,i&&(a-=i.outerHeight(!0)),(a<s||l>s+o)&&t.scrollTop(a)}},template:function(i,o){if(e.lib.templates=e.lib.templates?e.lib.templates:{},!e.lib.templates[i]){var n=mappl10n.options.templates?mappl10n.options.template[i]:t("#mapp-tmpl-"+i).html();if(!n)return"";e.lib.templates[i]=_.template(n.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return e.lib.templates[i](o)},uniqid:function(){return void 0===e.lib.uniqidCounter?e.lib.uniqidCounter=0:e.lib.uniqidCounter++,e.lib.uniqidCounter}},e.lib.jqVersionCheck("1.7")||e.lib.alert("jQuery version is too old: "+t.fn.jquery),t("body").on("tabsactivate tabsshow",(function(e,i){var o=i.newPanel?i.newPanel:i.panel;o&&t(".mapp-layout",o).each((function(){var e=t(this).find(".mapp-canvas").attr("id"),i=window[e];i.resize(),i.recenter()}))})),jQuery,"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}),e.event={addListener:function(t,e,i){e=e.split(" ");for(var o=0;o<e.length;o++)"leaflet"==mappl10n.options.engine?t.on(e[o],i):google.maps.event.addListener(t,e[o],i)},addListenerOnce:function(t,e,i){e=e.split(" ");for(var o=0;o<e.length;o++)"leaflet"==mappl10n.options.engine?t.once(e[o],i):google.maps.event.addListenerOnce(t,e[o],i)},clearInstanceListeners:function(t){"leaflet"==mappl10n.options.engine?t.off():google.maps.event.clearInstanceListeners(t)},clearListeners:function(t,e){e=e.split(" ");for(var i=0;i<e.length;i++)"leaflet"==mappl10n.options.engine?t.off(e[i]):google.maps.event.clearListeners(t,e[i])},trigger:function(t,e,i){"leaflet"==mappl10n.options.engine?t.fire(e,i):google.maps.event.trigger(t,e,i)}},function(t){e.lib.Modal=function(){this.el=null;var e=this;this.el=t('<div class="mapp-modal" tabindex="0">').append('<div class="mapp-modal-backdrop">').append('<div class="mapp-modal-content" tabindex="1">'),this.el.hide(),this.el.on("click",".mapp-modal-backdrop",(function(){e.close()})),this.el.on("click",".mapp-modal-close",(function(){e.close()})),this.el.on("keydown",(function(t){27==t.which&&e.close()}))},e.lib.Modal.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.el.hide(),t("body").removeClass("mapp-modal-noscroll"))},focus:function(){t(".mapp-modal-focus",this.el).attr("tabindex",0),t(".mapp-modal-focus",this.el).focus()},open:function(){if(!this.el.parent().length){const e=t("body",window.parent.document);this.el.appendTo(e)}this.el.show(),t("body").addClass("mapp-modal-noscroll"),this.focus()},setContent:function(e){t(".mapp-modal-content",this.el).empty(),t(".mapp-modal-content",this.el).append('<div class="mapp-modal-close">&times;').append(e),this.focus()}}}(jQuery)},692:()=>{var t=window.mapp||{};jQuery,t.load=function(){if(void 0!==t&&t.data)for(;t.data.length;){var e=t.data.pop();window[e.name]=new t.Map(e),window[e.name].display()}},t.load()},436:()=>{var t,e=window.mapp||{};t=jQuery,e.Marker=function(t){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(t),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove()},e.Marker.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let i=e.fromLatLngToDivPixel(this.position),o=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};t(this.div).css({left:i.x-o.width/2,top:i.y-o.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(t){let e="on"+t.type[0].toUpperCase()+t.type.slice(1);this[e]&&this[e](t)},onAdd:function(){let i=this.overlayView.getPanes();i&&(this.div=t('<div class="mapp-marker">'),this.div.appendTo(i.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)&&e.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(t){e.event.trigger(this,"mouseover")},onMouseleave:function(t){e.event.trigger(this,"mouseout")},onPointerdown:function(t){const e=this.map.getDiv().getBoundingClientRect(),i=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:t.clientX,y:t.clientY},offset:{x:i.x-(t.clientX-e.left),y:i.y-(t.clientY-e.top)}},this.toggleDragEvents(!0)},onPointermove:function(t){if(Math.abs(t.clientX-this.dragging.startPixel.x)+Math.abs(t.clientY-this.dragging.startPixel.y)<3)return;const i=this.map.getDiv().getBoundingClientRect();let o={x:t.clientX-i.left+this.dragging.offset.x,y:t.clientY-i.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(o)),this.draw(),this.dragging.moved=!0,e.event.trigger(this,"dragstart")},onPointercancel:function(t){this.onPointerup(t)},onPointerup:function(t){this.dragging&&this.dragging.moved&&e.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(t,e){let i="set"+t[0].toUpperCase()+t.slice(1);this[i]&&this[i](e)},setDraggable:function(t){this.draggable=t,this.map&&(this.div.get(0).removeEventListener("pointerdown",this,{passive:!0}),t&&this.div.get(0).addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(t){if(void 0!==t&&(this.icon=t),this.icon&&this.div){let t='<img draggable="false" src="'+this.icon.url+'">';this.div.html(t);let e=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:e.width,height:e.height}),this.setZIndex(),this.draw()}},setMap:function(t){this.map=t,this.overlayView.setMap(t)},setPosition:function(t){this.position=t},setValues:function(t){for(const e in t)this.set(e,t[e])},setVisible:function(t){this.visible=t,this.div&&this.div.css("visibility",t?"visible":"hidden")},setZIndex:function(t){this.zIndex=void 0!==t?t:this.zIndex,this.div&&this.div.css("z-index",t)},toggleDragEvents(t){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),t&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},510:()=>{var t,e=window.mapp||{};t=jQuery,e.Places=function(i,o){var n=this;this.sel=t(i),this.opts=t.extend({map:null},o);let s="";s="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"algolia",this.geocoder=new e.geocoders[s](this.opts.map),this.sel.on("keydown",(function(e){13==e.which&&(e.preventDefault(),e.stopImmediatePropagation(),n.sel.autocomplete("close"),n.parse(n.sel.val(),(function(e){e&&t(n).triggerHandler("search.mapp",e)})))})),t(".mapp-search-button",this.sel.parent()).on("click",(function(){n.parse(n.sel.val(),(function(e){e&&(n.sel.autocomplete("close"),t(n).triggerHandler("search.mapp",e))}))})),this.initAutocomplete()},e.Places.prototype={parse:function(t,e){var i="";if(t&&(i="string"==typeof(i=t&&t.name?t.name:t)?i.trim():i),i)if("string"!=typeof i||"http"!=i.substring(0,4))if("user"!=i)if(t&&t.geometry)e(t);else{var o=this.parseLatLng(t);o?e(o):this.geocoder.getFirstPrediction(t,(function(t){e(t)}))}else this.geolocate((function(t){e(t)}));else e(i);else e(null)},parseLatLng:function(t){var e;if(t.hasOwnProperty("lat")&&t.hasOwnProperty("lng"))e=t;else{var i=t&&t.name?t.name:t,o=(i="string"==typeof i?i.trim():i).split(",");if(2==o.length){var n=parseFloat(o[0]),s=parseFloat(o[1]);isNaN(n)||isNaN(s)||(e={lat:n,lng:s})}}return e?{name:e.lat+", "+e.lng,geometry:{location:e}}:null},geolocate:function(t,e){var i=this;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){var o={lat:e.coords.latitude,lng:e.coords.longitude};t({name:o.lat+", "+o.lng,geometry:{location:o}}),i.sel.val("")}),(function(i){if(!e){var o=i&&i.message?" : "+i.message:"";alert(mappl10n.no_geolocate+o)}t(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)},initAutocomplete:function(){var e=this;this.sel&&this.sel.length&&(this.sel.on("autocompleteselect",(function(i,o){e.geocoder.getDetails(o.item,(function(i){e.parse(i,(function(i){i&&t(e).triggerHandler("search.mapp",i)}))}))})),this.sel.autocomplete({appendTo:this.sel.parent(),autoFocus:!0,minLength:1,delay:"nominatim"===mappl10n.options.geocoder?500:0,source:(t,i)=>{e.geocoder.getPredictions(t.term,(function(t){i(t)}))}}))}}},548:()=>{var t,e=window.mapp||{};t=jQuery,e.Poi=function(i){if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},t.extend(this,this.defaults,i),i&&i.correctedAddress&&(this.address=i.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),i.viewport&&i.viewport.sw&&i.viewport.ne&&i.viewport.sw.lat){var o=i.viewport.sw,n=i.viewport.ne;"leaflet"==mappl10n.options.engine?this.viewport=new L.LatLngBounds(L.latLng(o.lat,o.lng),L.latLng(n.lat,n.lng)):this.viewport=new google.maps.LatLngBounds(new google.maps.LatLng(o.lat,o.lng),new google.maps.LatLng(n.lat,n.lng))}var s=[],a=[];if(!i.overlay)switch(this.type){case"polygon":if(i.poly&&i.poly.paths)for(var l=0;l<i.poly.paths.length;l++){s=[];for(var r=0;r<i.poly.paths[l].length;r++)s.push(new google.maps.LatLng(i.poly.paths[l][r].lat,i.poly.paths[l][r].lng));a.push(new google.maps.MVCArray(s))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(a)}),this.setColors(i.poly);break;case"polyline":if(i.poly&&i.poly.path)for(l=0;l<i.poly.path.length;l++)s.push(new google.maps.LatLng(i.poly.path[l].lat,i.poly.path[l].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(s)}),this.setColors(i.poly);break;case"circle":var p=new google.maps.LatLng(i.point.lat,i.point.lng);this.overlay=new google.maps.Circle({center:p,radius:parseFloat(i.poly.radius)}),this.setColors(i.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport}),this.setColors(i.poly);break;case"kml":var h=i.kml&&i.kml.url?i.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(h):new google.maps.KmlLayer({url:h,preserveViewport:!0,suppressInfoWindows:!0});break;default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([i.point.lat,i.point.lng]):this.overlay=new e.Marker({position:new google.maps.LatLng(i.point.lat,i.point.lng)})}i.type||this.set({iconid:i.iconid})},e.Poi.prototype={center:function(t){var e=this.getBounds();if("number"!=typeof t)if(e){var i=e.getNorthEast().toJSON().lng-e.getSouthWest().toJSON().lng;i<0&&(i+=360),t=Math.round(Math.log(360*this.map.div.canvas.width()/i/256)/Math.LN2),this.map.setView(this.getPosition(),t,{animate:!1})}else this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));else this.map.setView(this.getPosition(),t)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(t){switch(this.isPoly()?"poly":this.type){case"kml":return t&&t.pixelOffset?{x:t.pixelOffset.width,y:t.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 t;switch(this.type){case"polyline":t=new google.maps.LatLngBounds,this.overlay.getPath().forEach((function(e){t.extend(e)}));break;case"polygon":t=new google.maps.LatLngBounds,this.overlay.getPaths().forEach((function(e){e.forEach((function(e){t.extend(e)}))}));break;case"rectangle":case"circle":t=this.overlay.getBounds();break;case"kml":t=(t="leaflet"==mappl10n.options.engine?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport())||this.viewport;break;default:return this.viewport}return t},getColors:function(){var t={};for(var e in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})void 0!==this.overlay[e]&&(t[e]=this.overlay[e]);return t},getPosition:function(t){if(!this.type)return"leaflet"==mappl10n.options.engine?this.overlay.getLatLng():this.overlay.getPosition();if("kml"==this.type&&t&&t.latLng)return t.latLng;var e=this.getBounds();return e?e.getCenter():"leaflet"==mappl10n.options.engine?new L.latLng(0,0):new google.maps.LatLng(0,0)},getTemplateColors:function(){var t=this.getColors();return"polyline"==this.type?{color:t.strokeColor,opacity:100*t.strokeOpacity,weight:t.strokeWeight}:{color:t.fillColor,opacity:100*t.fillOpacity,weight:t.strokeWeight}},highlight:function(i){if(!this.type){var o="leaflet"==mappl10n.options.engine?t(this.overlay._icon):this.overlay.getDiv();if(o){switch(this.editable?"circle":mappl10n.options.highlight){case"circle":o.toggleClass("mapp-marker-circle",i);break;case"icon":var n=i?e.Icons.get(mappl10n.options.highlightIcon):e.Icons.get(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==n.options.iconUrl)return;this.overlay.setIcon(n);break;case"scale":o.addClass("mapp-marker"),o.toggleClass("mapp-marker-scale",i)}this.setZIndex(i?1e4:0)}}},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},open:function(t){this.map.poiOpen(this,t)},fetchPost:function(t){this.html?t():e.lib.ajax({type:"GET",data:{action:"mapp_get_post",postid:this.postid,nonce:mappl10n.options.nonce},dataType:"html",callback:e=>{this.html=e,t()}})},render:function(t,i){var o={};return o=_.extend(o,this,{icon:e.Icons.getUrl(this.iconid)}),i&&(o.body=i.description,o.title=i.name),o.thumbnail=mappl10n.options.thumbsPopup&&"popup"==t||mappl10n.options.thumbsList&&"item"==t?o.thumbnail:null,e.lib.template(this.map.templates[t],{poi:o,colors:this.getTemplateColors()})},set:function(t){for(var i in t){var o=t[i];switch(i){case"dirty":this.map.set({dirty:o});break;case"iconid":this.type||(this.iconid=o,this.overlay.setIcon(e.Icons.get(o)));break;default:this[i]=o}}this.map&&"undefined"!=typeof dirty&&this.map.set({dirty})},setColors:function(t){var e={};for(var i in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})t&&void 0!==t[i]&&(e[i]=t[i]);this.overlay.setOptions(e)},setEditable:function(t){var i=this;"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=t:this.overlay.setDraggable(t),this.isPoly()&&this.overlay.setEditable(t),e.event.clearListeners(this.overlay,"rightclick"),e.event.clearListeners(this.overlay,"dragstart"),t&&(e.event.addListener(this.overlay,"dragstart",(function(){i.viewport=null,i.map.poiClose()})),e.event.addListener(this.overlay,"dragend",(function(){i.map.set({dirty:!0})})),"polygon"!=this.type&&"polyline"!=this.type||"leaflet"!=mappl10n.options.engine&&(e.event.addListener(this.overlay,"rightclick",(function(t){null!=t.vertex&&i.overlay.getPath().getLength()>2&&i.overlay.getPath().removeAt(t.vertex)})),e.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),e.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(function(){i.map.set({dirty:!0})})))))},setMap:function(t){var i=this;this.map=t,e.event.clearInstanceListeners(this.overlay),null!=t?("kml"==this.type&&("leaflet"==mappl10n.options.engine?(e.event.addListenerOnce(this.overlay,"ready",(function(){i.viewport=i.overlay.getBounds()})),e.event.addListenerOnce(this.overlay,"error",(function(){alert(mappl10n.kml_error)}))):(e.event.addListener(this.overlay,"defaultviewport_changed",(function(){i.viewport=i.overlay.getDefaultViewport()})),e.event.addListener(this.overlay,"status_changed",(function(){var t=i.overlay.getStatus();"OK"!=t&&alert(mappl10n.kml_error+":"+t)})))),this.setEditable(this.map.editable),!this.type&&this.map.clusterer||("leaflet"==mappl10n.options.engine?this.overlay.addTo(t.getMap()):this.overlay.setMap(t.getMap())),e.event.addListener(this.overlay,"click",(function(t){i.open(t)})),e.event.addListener(this.overlay,"mouseover",(function(t){i.map.poiHover(i)})),e.event.addListener(this.overlay,"mouseout",(function(t){i.map.poiHover(null)}))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setTemplateColors:function(t){let{color:e,opacity:i,weight:o}=t;i=i?i/100:void 0;var n="polyline"==this.type?{strokeColor:e,strokeOpacity:i,strokeWeight:o}:{fillColor:e,fillOpacity:i,strokeColor:e,strokeWeight:o,strokeOpacity:1};this.setColors(n)},setVisible:function(t){void 0!==this.overlay.setVisible&&this.overlay.setVisible(t)},setZIndex:function(t){"leaflet"==mappl10n.options.engine?this.type||this.overlay.setZIndexOffset(t):this.overlay.set("zIndex",t)},toJSON:function(){var t={address:this.address,body:this.body,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},e=this.getPosition();t.point=e.toJSON();var i=this.viewport?this.viewport:this.getBounds();if(i){var o=i.toJSON();t.viewport={sw:{lat:o.south,lng:o.west},ne:{lat:o.north,lng:o.east}}}if("kml"==this.type&&(t.kml=this.kml),this.isPoly())switch(t.poly=this.getColors(),this.type){case"circle":t.poly.radius=this.overlay.getRadius();break;case"polyline":t.poly.path=[],this.overlay.getPath().forEach((function(e){t.poly.path.push(e.toJSON())}));break;case"polygon":t.poly.paths=[],this.overlay.getPaths().forEach((function(e){var i=[];e.forEach((function(t){i.push(t.toJSON())})),t.poly.paths.push(i)}));break;case"rectangle":var n=this.overlay.getBounds();t.viewport={sw:n.getSouthWest().toJSON(),ne:n.getNorthEast().toJSON()}}return t}}},675:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=0;e<t.length;e++){var i=t[e].match(/country\/(.*)?/);if(i)return i[1]}return}},892:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e={country:"country",city:"city","amenity/bus_station":"busStop","amenity/townhall":"townhall","railway/station":"trainStation","aeroway/aerodrome":"airport","aeroway/terminal":"airport","aeroway/gate":"airport"};for(var i in e)if(-1!==t.indexOf(i))return e[i];return"address"}},991:(t,e,i)=>{"use strict";e.Z=function(t){var e=t.formatInputValue,i=t.hit,s=t.hitIndex,a=t.query,r=t.rawAnswer;try{var h=i.locale_names[0],c=i.country,d=i.administrative&&i.administrative[0]!==h?i.administrative[0]:void 0,g=i.city&&i.city[0]!==h?i.city[0]:void 0,u=i.suburb&&i.suburb[0]!==h?i.suburb[0]:void 0,m=i.county&&i.county[0]!==h?i.county[0]:void 0,v=i.postcode&&i.postcode.length?function(t,e){for(var i=e[0].value,o=[],n=1;n<e.length;++n)"none"!==e[n].matchLevel&&o.push({index:n,words:e[n].matchedWords});if(0===o.length)return{postcode:t[0],highlightedPostcode:i};return o.sort((function(t,e){return t.words>e.words?-1:t.words<e.words?1:t.index-e.index})),{postcode:t[o[0].index],highlightedPostcode:e[o[0].index].value}}(i.postcode,i._highlightResult.postcode):{postcode:void 0,highlightedPostcode:void 0},f=v.postcode,y=v.highlightedPostcode,w={name:p(i._highlightResult.locale_names),city:g?p(i._highlightResult.city):void 0,administrative:d?p(i._highlightResult.administrative):void 0,country:c?i._highlightResult.country.value:void 0,suburb:u?p(i._highlightResult.suburb):void 0,county:m?p(i._highlightResult.county):void 0,postcode:y},b={name:h,administrative:d,county:m,city:g,suburb:u,country:c,countryCode:(0,o.default)(i._tags),type:(0,n.default)(i._tags),latlng:{lat:i._geoloc.lat,lng:i._geoloc.lng},postcode:f,postcodes:i.postcode&&i.postcode.length?i.postcode:void 0},L=e(b);return l(l({},b),{},{highlight:w,hit:i,hitIndex:s,query:a,rawAnswer:r,value:L})}catch(t){return console.error("Could not parse object",i),console.error(t),{value:"Could not parse object"}}};var o=s(i(675)),n=s(i(892));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?a(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function p(t){for(var e=t[0].value,i=[],o=1;o<t.length;++o)"none"!==t[o].matchLevel&&i.push({index:o,words:t[o].matchedWords});return 0===i.length?e:(i.sort((function(t,e){return t.words>e.words?-1:t.words<e.words?1:t.index-e.index})),0===i[0].index?"".concat(e," (").concat(t[i[1].index].value,")"):"".concat(t[i[0].index].value," (").concat(e,")"))}},574:(t,e)=>{"use strict";e.Z=function(t){var e=t.administrative,i=t.city,o=t.country,n=t.name,s=t.type;return"".concat(n).concat("country"!==s&&void 0!==o?",":"","\n ").concat(i?"".concat(i,","):"","\n ").concat(e?"".concat(e,","):"","\n ").concat(o||"").replace(/\s*\n\s*/g," ").trim()}}},i={};function o(e){var n=i[e];if(void 0!==n)return n.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,o),s.exports}o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(628),o(854),o(397),o(442),o(282),o(689),o(436),o(510),o(548),o(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.72.1\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: 2021-12-02T04:04:52+00:00\n"
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.72.2\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: 2021-12-02T23:48:32+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.72.1
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
@@ -36,7 +36,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
36
  }
37
 
38
  class Mappress {
39
- const VERSION = '2.72.1';
40
 
41
  static
42
  $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.72.2
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
36
  }
37
 
38
  class Mappress {
39
+ const VERSION = '2.72.2';
40
 
41
  static
42
  $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.72.1
9
 
10
  == Description ==
11
  MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
@@ -89,6 +89,9 @@ Please see the plugin documentation pages:
89
 
90
  == Changelog ==
91
 
 
 
 
92
  = 2.72.1 =
93
  * Fixed: POI drag and drop sorting not working in editor
94
  * Fixed: shortcodes in AJAX calls now include scripts with map/mashup output
5
  Requires at least: 5.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.9
8
+ Stable tag: 2.72.2
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.72.2 =
93
+ * Changed: allow DOM events to bubble out of the map container
94
+
95
  = 2.72.1 =
96
  * Fixed: POI drag and drop sorting not working in editor
97
  * Fixed: shortcodes in AJAX calls now include scripts with map/mashup output