MapPress Easy Google Maps - Version 2.63

Version Description

  • Added: new map control and modal for editing custom map styles
  • Added: new templates for map list items - please update custom templates to match
  • Added: filters now support multiple filter taxonomies
  • Added: POI list now has pagination controls
  • Fixed: icon scale of 0 should be blank (auto scale)
Download this release

Release Info

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

Code changes from version 2.62.12 to 2.63

build/index_mappress.js CHANGED
@@ -1 +1 @@
1
- !function(){var t={854:function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e,i=window.mapp||{};e=jQuery,i.Map=function(t,e){this.defaults={alignment:null,center:null,editable:null,embed:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,layout:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,poiList:mappl10n.options.poiList,pois:null,postid:null,query:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.hovered=null,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.pois_=[],this.xhr_,_.extend(this,this.defaults,this.mapdata,this.settings),this.layout=this.layout?this.layout:mappl10n.options.layout,this.postid=this.postid?this.postid:mappl10n.options.postid},i.Map.prototype={display:function(){var t=this;!0===this.sanity()&&(this.render(),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,worldCopyJump:!0,zoomControl:null},this.mapOpts):this.mapOpts=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},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),"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.addStyles(),this.addMenu(),this.addPopup(),this.setMapTypeId(this.mapTypeId),this.clustering(),"postmodal"==mappl10n.options.mashupClick&&(this.modal_=new i.lib.Modal),this.places=new i.Places(e(".mapp-places",this.div.search),{map:t}),this.editable&&this.places.sel.focus(),e(this.places).on("search.mapp",(function(e,i){t.search(i)})),this.addEvents("click dragstart zoom_changed zoomstart",(function(e){"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||t.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(function(i){var o=e(this).attr("data-mapp-action");i.preventDefault(),t.action(o,e(this).attr("data-mapp-"+o),e(this))})),this.div.filters.on("change",(function(){t.ajaxQuery()})),e(window).on("resize",(function(){t.toggleView("mini"),t.poiClose(),t.resize()})),i.event.addListener(t.map_,"maptypeid_changed baselayerchange",(function(){t.set({dirty:!0})})),this.places.parse(this.center,(function(e){e&&e.geometry&&e.geometry.location?t.center={lat:e.geometry.location.lat,lng:e.geometry.location.lng}:t.center=null,t.query?t.ajaxQuery((function(){t.initCenter()})):(t.setPois(t.pois),t.initCenter())})),this.div.list.on("mouseenter","[data-mapp-poi]",(function(i){var o=e(this).attr("data-mapp-poi");t.poiHover(t.pois_[o])})),this.div.list.on("mouseleave","[data-mapp-poi]",(function(e){t.poiHover(null)})))},initCenter:function(){var t=this;this.recenter(),this.renderList(),this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():i.event.addListenerOnce(t.map_,"idle",(function(){t.initOpen()}))},initOpen:function(){var t=this.pois_.length?this.pois_[0]:null,e=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;this.initialOpenDirections?this.directionsOpen(null,t):t&&e&&t.open()},action:function(t,i,o){var n=this;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((function(){"checkbox"==this.type||"radio"==this.type?e(this).prop("checked",!1):e(this).val("")})),this.ajaxQuery();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((function(t){n.search(t)}));break;case"layer":this.toggleLayer(i),this.toggleView("menu",!1);break;case"list-toggle":this.togglePoiListOpen();break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=o.attr("data-mapp-poi");this.poiOpen(this.pois_[s]);break;case"view-map":this.togglePoiListOpen(!1);break;case"view-list":this.togglePoiListOpen(!0);break;default:return!0}},addEvents:function(t,e){t=t.split(" ");for(var o=0;o<t.length;o++)i.event.addListener(this.map_,t[o],e)},addGeolocateControl:function(){if(mappl10n.options.ssl){var t=e(".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:function(e){return t},onRemove:function(){}}),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=e.makeArray(this.layers),i=0;i<t.length;i++){var o=t[i].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(){var t=this;e("body").on("click",(function(i){var o=e(i.target),n=o.attr("data-mapp-action");o==t.div.filters||"filters-toggle"==n||o.closest(t.div.filters).length||t.toggleView("filters",!1),o==t.div.menu||"menu-toggle"==n||o.closest(t.div.menu).length||t.toggleView("menu",!1)}))},addPopup:function(){var t=this,o=this.editable?"mapp-iw-edit":"mapp-iw";this.editable||(o+=" mapp-"+this.templates.popup,o+=mappl10n.options.thumbs?" mapp-thumb-"+mappl10n.options.popupThumbs:""),this.div.iw=e('<div class="'+o+'">').appendTo(this.div.canvas);var n=this.editable?"mapp-ib-popup mapp-ib-edit":"mapp-ib-popup";this.iw=new i.Infobox(this.map_,{className:n,clip:!0,pan:!0}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(function(){t.poiClose()}))},addSearchMove:function(){},addStyles:function(){var o=this;if("leaflet"==mappl10n.options.engine){if(this.mapOpts.mapTypeControl){for(var n=L.control.layers(),s=0;s<mappl10n.options.baseLayers.length;s++){var a=mappl10n.options.baseLayers[s],l=mappl10n.options.providers[a.provider],r=e.extend({},l,a);n.addBaseLayer(L.tileLayer(l.url,r),r.label)}mappl10n.options.baseLayers.length>1&&n.addTo(this.map_)}this.map_.on("baselayerchange",(function(t){o.mapTypeId=t.layer.options.name}))}else{var p=mappl10n.options.styles?mappl10n.options.styles:[],h=mappl10n.options.style,c=["roadmap","satellite","terrain","hybrid"];for(var u in h&&"object"==t(p[h])&&this.map_.setOptions({styles:p[h]}),p)this.map_.mapTypes.set(u,new google.maps.StyledMapType(p[u],{name:u})),c.push(u);this.mapOpts.mapTypeControl&&this.map_.setOptions({mapTypeControl:!0,mapTypeControlOptions:{mapTypeIds:c,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}}),i.event.addListener(this.map_,"maptypeid_changed",(function(){o.mapTypeId=o.map_.getMapTypeId()}))}},ajaxQuery:function(t){},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(){mappl10n.options.clustering&&!this.editable&&("leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup():this.clusterer=new MarkerClusterer(this.map_,[],{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m",maxZoom:21}))},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){for(var t=[],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)}},dialog:function(t,e){var i=this;t?(this.div.dialog.html(t),this.div.dialog.show(),e&&(clearTimeout(this.dialog.fade),this.dialog.fade=setTimeout((function(){i.dialog(null)}),4e3))):this.div.dialog.hide()},directionsOpen:function(t,e){var o=t?t.getAddress():"",n=e?e.getAddress():"";t?this.popupOpen(t):e&&this.popupOpen(e),this.dir_||(this.dir_=new i.Directions(this.div.directions,this)),this.dir_.open(o,n)},fitBounds:function(t,e){return e="leaflet"==mappl10n.options.engine&&e?{paddingTopLeft:[e.left,e.top],paddingBottomRight:[e.right,e.bottom]}:e,this.map_.fitBounds(t,e)},getBounds:function(){try{return this.map_.getBounds()}catch(t){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(t){return null}},getMapTypeId:function(t){return"leaflet"==mappl10n.options.engine?"roadmap":this.map_.getMapTypeId(t)},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(t){return null}},poiClose:function(){this.poiHighlight(null),this.selected=null,this.opened=null,this.hovered=null,this.iw.close(),this.dir_&&this.dir_.close(),e(this).triggerHandler("mapp.close")},poiHighlight:function(t){if("icon"!=mappl10n.options.highlight||"leaflet"!=mappl10n.options.engine||!this.editable){if(e("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),this.hovered&&this.hovered.highlight(!1),t){var i=e.inArray(t,this.pois_);e('[data-mapp-poi="'+i+'"]',this.div.list).addClass("mapp-selected"),t.highlight(!0)}this.selected&&(i=e.inArray(t,this.selected),e('[data-mapp-poi="'+i+'"]',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,i){var o=this;if(this.poiClose(),this.selected=t,this.poiHighlight(t),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((function(){return o.modal_.setContent(t.html)}))}this.div.layout.hasClass("mapp-view-mini")&&this.togglePoiListOpen(!1),this.popupOpen(t,i,"popup"),e(this).triggerHandler("mapp.open",t)},poiRemove:function(t){var i=e.inArray(t,this.pois_);-1!=i&&(this.pois_[i].setMap(null),this.pois_.splice(i,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,e(this).triggerHandler("mapp.close"))},popupOpen:function(t,e){var 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));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)this.search({geometry:{location:{lat:t.lat,lng:t.lng}}});else if(t)this.setView(t,e||1);else if(0!=this.pois_.length)if(1!=this.pois_.length){for(var i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds,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)}else this.pois_[0].center(e);else this.setView({lat:0,lng:0},e||1)},render:function(){var t=this,o=this.name?this.name+"-layout":"",n="mapp-layout",s=this.layout?this.layout:mappl10n.options.layout;if(n+="left"==s?" mapp-list-left":" mapp-inline",n+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",!document.body.classList.contains("block-editor-page")){var a=this.alignment?this.alignment:mappl10n.options.alignment;n+=a?" align"+a:"",n+=a?" mapp-align-"+a:""}n+=this.classname?" "+this.classname:"";var l=i.lib.template("map",{map:this,layout:s});if(this.sel)this.sel.html(l),this.sel.addClass(n),this.sel.attr("id",o),this.div.layout=this.sel;else{var r=e('<div id="'+o+'" class="'+n+'">');r.html(l),e("#"+this.name+"-layout").replaceWith(r),this.div.layout=r}if(!this.div.layout.length)return i.lib.log("MapPress: Missing map name or container for map: "+this.name);e.each(["canvas","controls","dialog","directions","filters","list","menu","wrapper","search"],(function(i,o){t.div[o]=e(".mapp-"+o,t.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderList:function(){var t=this.getBounds(),o=0,n=this;if(!this.editable)for(var s=0;s<this.pois_.length;s++)this.pois_[s].visible=!0,this.query&&t&&!t.contains(this.pois_[s].getPosition())&&(this.pois_[s].visible=!1),o+=this.pois_[s].visible;this.div.list.html(i.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:o})),mappl10n.options.thumbs&&this.div.list.addClass(" mapp-thumb-"+mappl10n.options.listThumbs),this.editable&&(this.div.list.trigger("render"),e(".mapp-items",this.div.list).sortable({axis:"y",cursor:"move",delay:200,update:function(){n.sortPois(e(this).sortable("toArray",{attribute:"data-mapp-poi"}))}}))},renderMenu:function(){for(var t in this.layers_)e('[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():i.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){var t="Please see the MapPress FAQ Troubleshooting section to resolve.";if("leaflet"==mappl10n.options.engine){if("undefined"==typeof L)return i.lib.alert("MAPPRESS: Unable to load Leaflet. "+t),!1}else{if("undefined"==typeof google)return i.lib.alert("MAPPRESS: Google Maps API not loaded. "+t),!1;e(document).ready((function(){e('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&i.lib.alert("MAPPRESS ERROR: Google Maps API key loaded multiple times. "+t)}))}return"undefined"==typeof _?(i.lib.log("MAPPRESS ERROR: plugin conflict, underscore.js not loaded. "+t),!1):!(void 0===jQuery.ui||jQuery.ui.version<"1.12")||(i.lib.log("MAPPRESS WARNING: plugin conflict, Outdated jQuery version: "+jQuery.ui.version+" should be >= 1.12 "+t),!0)},search: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)}},set:function(t){for(var e in t){var i=t[e];switch(e){case"dirty":this.dirty=i;break;case"mapTypeId":this.mapTypeId=i,this.setMapTypeId(i);break;case"poiList":this.poiList=null==i?mappl10n.options.poiList:i,this.div.layout.toggleClass("mapp-has-list",this.poiList),this.togglePoiListOpen(this.poiList),this.toggleView("mini");break;case"title":this.title=i;break;default:this[e]=i}}},setMapTypeId:function(i){if("leaflet"==mappl10n.options.engine){i=!this.editable&&mappl10n.options.style&&"streets"==i?mappl10n.options.style:i,i=_.findIndex(mappl10n.options.baseLayers,{name:i})>=0?i:mappl10n.options.baseLayers[0].name;for(var o=0;o<mappl10n.options.baseLayers.length;o++){var n=mappl10n.options.baseLayers[o],s=mappl10n.options.providers[n.provider];if(n.name==i){var a=e.extend({},s,n);L.tileLayer(a.url,a).addTo(this.map_)}}}else i=-1!=e.inArray(i,["roadmap","satellite","terrain","hybrid"])||"object"==t(mappl10n.options.styles[i])?i:"roadmap",this.map_.setMapTypeId(i)},setPois:function(t){if(this.resetPois(),t)for(var e=0;e<t.length;e++){var o=new i.Poi(t[e]);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];if(this.embed)return this.div.layout.css({height:"100%"}),void this.div.wrapper.css({"padding-bottom":0,height:"100%"});if(t&&t.hasOwnProperty("width")){var i=t.width?t.width:e.width;this.div.layout.css("width",i)}if(t&&t.hasOwnProperty("height")){var o=t.height?t.height:e.height;"string"==typeof o&&o.includes("%")?this.div.wrapper.css({"padding-bottom":o,height:"auto"}):this.div.wrapper.css({"padding-bottom":0,height:o})}this.resize()},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()},toggleLayer:function(t,i){var o=this;i=void 0!==i?i:null==this.layers_[t].getMap(),e.each(["traffic","bicycling","transit"],(function(t,e){o.layers_[e].setMap(null)})),i&&this.layers_[t].setMap(this.map_)},togglePoiListOpen:function(t){var e=this;this.div.layout.toggleClass("mapp-list-open",t),setTimeout((function(){return e.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){var i=this.div.layout.hasClass("mapp-view-mini"),o=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",o),void(o!=i&&this.togglePoiListOpen(!o))}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,title:this.title,width:this.width,zoom:this.zoom}}}},397:function(){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-addr",this.sel).removeClass("mapp-error"),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.toLowerCase().indexOf("http")&&(i="https://"+i),i+="/maps/dir/?api=1&origin="+encodeURIComponent(t)+"&destination="+encodeURIComponent(e),window.open(i)}}},442:function(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:function(t,e){var i=this;this.getPredictions(t,(function(t){t&&t.length?i.getDetails(t[0],(function(t){return 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",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={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){var o=this;this.getPredictions(e,(function(e){e&&t.isArray(e)?o.getDetails(e[0],(function(t){return 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((function(t){return t.value=t.description,t}))).filter((function(t){return 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){var 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));var 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:function(t,e){var i=this;this.getPredictions(t,(function(t){t&&t.length?i.getDetails(t[0],(function(t){return 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,t.getJSON(o,(function(t){t&&t.features&&t.features.length>0?(t.features=t.features.map((function(t){return 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){var 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));var 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:function(t,e){var i=this;this.getPredictions(t,(function(t){t&&t.length?i.getDetails(t[0],(function(t){return e(t)})):e(null)}))},getPredictions:function(e,i){var o="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(e);o=mappl10n.options.country?o+"&countrycodes="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&accept-language="+mappl10n.options.language.toLowerCase():o,t.getJSON(o,(function(t){t&&t.length?(t=t.map((function(t){return t.value=t.display_name,t})),i(t)):i(null)}))}}}(jQuery)},282:function(){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:function(){var t,e=window.mapp||{};t=jQuery,e.Infobox=function(i,o){var n=this;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({popout:!1},o),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null;var s=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){s.isOpen&&s.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=function(){s.isOpen&&s.draw()}),this.node.get(0).addEventListener("load",(function(){n.open({position:n.position,anchorPoint:n.anchorPoint})}),{capture:!0}),this.opts.popout)var a="body";else a="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(a),"leaflet"==mappl10n.options.engine&&i.on("load",(function(){L.DomEvent.disableClickPropagation(n.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(this.position){var t,e;if(t=this.node.outerWidth(),this.node.outerHeight(),"leaflet"==mappl10n.options.engine)e=this.map.latLngToContainerPoint(this.position);else{var i=this.overlayView.getProjection();if(!i)return;e=i.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:e.x-t/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-e.y-this.anchorPoint.y})}},getContent:function(){return t(".mapp-ib",this.node)},open:function(t){this.position=t.position,this.anchorPoint=t.anchorPoint?t.anchorPoint:{x:0,y:0},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(),this.opts.popout?this.clipToWindow():"leaflet"==mappl10n.options.engine?this.panLeaflet():this.panGoogle(),this.isOpen=!0},panGoogle:function(){var t=this.overlayView.getProjection(),e=t?t.fromLatLngToDivPixel(this.position):null;if(e){var i=this.node.outerWidth(),o=this.node.outerHeight(),n=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(e.x-i/2-this.fudge,e.y+this.fudge)),s=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(e.x+i/2+this.fudge,e.y-o+this.anchorPoint.y-this.fudge)),a=new google.maps.LatLngBounds(n,s);this.map.panToBounds(a)}},panLeaflet:function(){var e=this.map.latLngToContainerPoint(this.position),i=t(this.mapDiv).width(),o=t(this.mapDiv).height(),n=this.node.outerWidth(),s=this.node.outerHeight(),a={x:e.x,y:e.y};e.x+n/2+this.anchorPoint.x>i-this.fudge?a.x=Math.max(i-n/2-this.anchorPoint.x-this.fudge,i/2-this.anchorPoint.x):e.x-n/2+this.anchorPoint.x<this.fudge&&(a.x=Math.min(n/2+this.anchorPoint.x+this.fudge,i/2-this.anchorPoint.x)),e.y+this.anchorPoint.y-s<this.fudge&&(a.y=s-this.anchorPoint.y+this.fudge),a.y>=o&&(a.y=o-this.fudge),this.map.panBy([e.x-a.x,e.y-a.y])},setContent:function(e){t(".mapp-ib",this.node).empty().append(e)}}},628:function(){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&&console.log(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){function e(_x){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((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(){this.el.parent().length||this.el.appendTo("body"),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:function(){jQuery,mapp.load=function(){if("undefined"!=typeof mapp&&mapp.data)for(;mapp.data.length;){var t=mapp.data.pop();window[t.name]=new mapp.Map(t),window[t.name].display()}},mapp.load()},436:function(){var t,e=window.mapp||{};t=jQuery,e.Marker=function(t){var e=this;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=function(){return e.draw()},this.overlayView.onAdd=function(){return e.onAdd()},this.overlayView.onRemove=function(){return e.onRemove()}},e.Marker.prototype={draw:function(){if(this.div&&this.icon){var e=this.overlayView.getProjection().fromLatLngToDivPixel(this.position),i=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};t(this.div).css({left:e.x-i.width/2,top:e.y-i.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){var e="on"+t.type[0].toUpperCase()+t.type.slice(1);this[e]&&this[e](t)},onAdd:function(){var i=this,o=this.overlayView.getPanes();this.div=t('<div class="mapp-marker">'),this.div.appendTo(o.overlayMouseTarget),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div.get(0)),this.div.get(0).addEventListener("click",(function(){(!i.dragging||i.dragging&&!i.dragging.moved)&&e.event.trigger(i,"click"),i.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){var 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)){var i=this.map.getDiv().getBoundingClientRect(),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){var 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){var e='<img draggable="false" src="'+this.icon.url+'">';this.div.html(e);var i=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:i.width,height:i.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(var 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:function(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:function(){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);var 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){if(13==e.which){e.preventDefault();var i=n.parseLatLng(n.sel.val());i&&(t(n).triggerHandler("search.mapp",i),n.sel.autocomplete("close"),e.stopImmediatePropagation()),"http"==n.sel.val().substring(0,4)&&(t(n).triggerHandler("search.mapp",n.sel.val()),n.sel.autocomplete("close"),e.stopImmediatePropagation()),!1===mappl10n.options.autocomplete&&(n.sel.autocomplete("option","disabled",!1),n.sel.autocomplete("search"))}else!1===mappl10n.options.autocomplete&&n.sel.autocomplete("option","disabled",!0),n.sel.autocomplete("close")})),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("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(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){var e=this;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(i){var o={lat:i.coords.latitude,lng:i.coords.longitude};t({name:o.lat+", "+o.lng,geometry:{location:o}}),e.sel.val("")}),(function(e){var i=e&&e.message?" : "+e.message:"";alert(mappl10n.no_geolocate+i),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:300,disabled:!1===mappl10n.options.autocomplete,source:function(t,i){e.geocoder.getPredictions(t.term,(function(t){i(t)}))}}))}}},548:function(){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;case"":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){var n=this.editable?"circle":mappl10n.options.highlight;switch(n){case"circle":o.toggleClass("mapp-marker-circle",i);break;case"icon":var s=i?e.Icons.get(mappl10n.options.highlightIcon):e.Icons.get(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==s.options.iconUrl)return;this.overlay.setIcon(s);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){var i=this;this.html?t():e.lib.ajax({type:"GET",data:{action:"mapp_get_post",postid:this.postid,nonce:mappl10n.options.nonce},dataType:"html",callback:function(e){i.html=e,t()}})},render:function(t,i){var o=_.extend(this,{icon:e.Icons.getUrl(this.iconid)});return i&&(o.body=i.description,o.title=i.name),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: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){var e=t.color,i=t.opacity,o=t.weight;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:function(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:function(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:function(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,u=i.administrative&&i.administrative[0]!==h?i.administrative[0]:void 0,d=i.city&&i.city[0]!==h?i.city[0]:void 0,g=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:d?p(i._highlightResult.city):void 0,administrative:u?p(i._highlightResult.administrative):void 0,country:c?i._highlightResult.country.value:void 0,suburb:g?p(i._highlightResult.suburb):void 0,county:m?p(i._highlightResult.county):void 0,postcode:y},b={name:h,administrative:u,county:m,city:d,suburb:g,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:function(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()}}},e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={exports:{}};return t[o](n,n.exports,i),n.exports}i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(628),i(854),i(397),i(442),i(282),i(689),i(436),i(510),i(548),i(692)}();
1
+ (()=>{var t={854:()=>{var t,e=window.mapp||{};t=jQuery,e.Map=function(t,e){this.defaults={alignment:null,center:null,editable:null,embed:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,layout:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,poiList:mappl10n.options.poiList,pois:null,postid:null,query:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.hovered=null,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,pageSize:30},this.pois_=[],this.xhr_,_.extend(this,this.defaults,this.mapdata,this.settings),this.layout=this.layout?this.layout:mappl10n.options.layout,this.postid=this.postid?this.postid:mappl10n.options.postid},e.Map.prototype={display:function(){var i=this;!0===this.sanity()&&(this.render(),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,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),"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 e.lib.Modal),this.places=new e.Places(t(".mapp-places",this.div.search),{map:i}),this.editable&&this.places.sel.focus(),t(this.places).on("search.mapp",(function(t,e){i.search(e)})),this.addEvents("click dragstart zoom_changed zoomstart",(function(t){"leaflet"==mappl10n.options.engine&&"click"==t.type&&t.originalEvent&&!t.originalEvent.target.matches(".mapp-canvas")||i.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(function(e){var o=t(this).attr("data-mapp-action");e.preventDefault(),i.action(o,t(this).attr("data-mapp-"+o),t(this))})),this.div.filters.on("change",(function(){i.ajaxQuery()})),t(window).on("resize",(function(){i.toggleView("mini"),i.poiClose(),i.resize()})),e.event.addListener(i.map_,"maptypeid_changed baselayerchange",(function(){i.set({dirty:!0})})),this.places.parse(this.center,(function(t){t&&t.geometry&&t.geometry.location?i.center={lat:t.geometry.location.lat,lng:t.geometry.location.lng}:i.center=null,i.query?i.ajaxQuery((function(){i.initCenter()})):(i.setPois(i.pois),i.initCenter())})),this.div.list.on("mouseenter","[data-mapp-poi]",(function(e){var o=t(this).attr("data-mapp-poi");i.poiHover(i.pois_[o])})),this.div.list.on("mouseleave","[data-mapp-poi]",(function(t){i.poiHover(null)})))},initCenter:function(){var t=this;this.recenter(),this.renderList(),this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():e.event.addListenerOnce(t.map_,"idle",(function(){t.initOpen()}))},initOpen:function(){var t=this.pois_.length?this.pois_[0]:null,e=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;this.initialOpenDirections?this.directionsOpen(null,t):t&&e&&t.open()},action:function(e,i,o){var n=this;switch(e){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((function(){"checkbox"==this.type||"radio"==this.type?t(this).prop("checked",!1):t(this).val("")})),this.ajaxQuery();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((function(t){n.search(t)}));break;case"layer":this.toggleLayer(i),this.toggleView("menu",!1);break;case"list-toggle":this.togglePoiListOpen();break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=o.attr("data-mapp-poi");this.poiOpen(this.pois_[s]);break;case"page":var a=parseInt(o.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}},addEvents:function(t,i){t=t.split(" ");for(var o=0;o<t.length;o++)e.event.addListener(this.map_,t[o],i)},addGeolocateControl:function(){if(mappl10n.options.ssl){var e=t(".mapp-geolocate-control-wrapper").get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(e):(L.Control.Geolocate=L.Control.extend({onAdd:function(t){return e},onRemove:function(){}}),new L.Control.Geolocate({position:"bottomright"}).addTo(this.map_))}},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var e=t.makeArray(this.layers),i=0;i<e.length;i++){var o=e[i].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(){var e=this;t("body").on("click",(function(i){var o=t(i.target),n=o.attr("data-mapp-action");o==e.div.filters||"filters-toggle"==n||o.closest(e.div.filters).length||e.toggleView("filters",!1),o==e.div.menu||"menu-toggle"==n||o.closest(e.div.menu).length||e.toggleView("menu",!1)}))},addPopup:function(){var i=this,o=this.editable?"mapp-iw-edit":"mapp-iw";this.editable||(o+=" mapp-"+this.templates.popup),this.div.iw=t('<div class="'+o+'">').appendTo(this.div.canvas),this.iw=new e.Infobox(this.map_,{className:this.editable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(function(){i.poiClose()}))},addSearchMove:function(){},ajaxQuery:function(t){},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(){mappl10n.options.clustering&&!this.editable&&("leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup():this.clusterer=new MarkerClusterer(this.map_,[],{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m",maxZoom:21}))},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){for(var t=[],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)}},dialog:function(t,e){var i=this;t?(this.div.dialog.html(t),this.div.dialog.show(),e&&(clearTimeout(this.dialog.fade),this.dialog.fade=setTimeout((function(){i.dialog(null)}),4e3))):this.div.dialog.hide()},directionsOpen:function(t,i){var o=t?t.getAddress():"",n=i?i.getAddress():"";t?this.popupOpen(t):i&&this.popupOpen(i),this.dir_||(this.dir_=new e.Directions(this.div.directions,this)),this.dir_.open(o,n)},fitBounds:function(t,e){return e="leaflet"==mappl10n.options.engine&&e?{paddingTopLeft:[e.left,e.top],paddingBottomRight:[e.right,e.bottom]}:e,this.map_.fitBounds(t,e)},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}},poiClose:function(){this.poiHighlight(null),this.selected=null,this.opened=null,this.hovered=null,this.iw.close(),this.dir_&&this.dir_.close(),t(this).triggerHandler("mapp.close")},poiHighlight:function(e){if("icon"!=mappl10n.options.highlight||"leaflet"!=mappl10n.options.engine||!this.editable){if(t("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),this.hovered&&this.hovered.highlight(!1),e){var i=t.inArray(e,this.pois_);t('[data-mapp-poi="'+i+'"]',this.div.list).addClass("mapp-selected"),e.highlight(!0)}this.selected&&(i=t.inArray(e,this.selected),t('[data-mapp-poi="'+i+'"]',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(e,i){var o=this;if(this.poiClose(),this.selected=e,this.poiHighlight(e),e.postid&&e.url&&!this.editable)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":return this.modal_.open(),this.modal_.setContent('<div class="mapp-modal-spinner">'),void e.fetchPost((function(){return o.modal_.setContent(e.html)}))}this.div.layout.hasClass("mapp-view-mini")&&this.togglePoiListOpen(!1),this.popupOpen(e,i,"popup"),t(this).triggerHandler("mapp.open",e)},poiRemove:function(e){var i=t.inArray(e,this.pois_);-1!=i&&(this.pois_[i].setMap(null),this.pois_.splice(i,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,t(this).triggerHandler("mapp.close"))},popupOpen:function(t,e){var 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)this.search({geometry:{location:{lat:t.lat,lng:t.lng}}});else if(t)this.setView(t,e||1);else if(0!=this.pois_.length)if(1!=this.pois_.length){for(var i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds,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)}else this.pois_[0].center(e);else this.setView({lat:0,lng:0},e||1)},render:function(){var i=this,o=this.name?this.name+"-layout":"",n="mapp-layout",s=this.layout?this.layout:"left";if(n+="left"==s?" mapp-list-left":" mapp-inline",n+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",!document.body.classList.contains("block-editor-page")){var a=this.alignment?this.alignment:mappl10n.options.alignment;n+=a?" align"+a:"",n+=a?" mapp-align-"+a:""}n+=this.classname?" "+this.classname:"";var l=e.lib.template("map",{map:this,layout:s});if(this.sel)this.sel.html(l),this.sel.addClass(n),this.sel.attr("id",o),this.div.layout=this.sel;else{var r=t('<div id="'+o+'" class="'+n+'">');r.html(l),t("#"+this.name+"-layout").replaceWith(r),this.div.layout=r}if(!this.div.layout.length)return e.lib.log("MapPress: Missing map name or container for map: "+this.name);t.each(["canvas","controls","dialog","directions","filters","list","menu","wrapper","search"],(function(e,o){i.div[o]=t(".mapp-"+o,i.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderList:function(){var i=this.getBounds(),o=0,n=this,s=this.pagination_.pageSize*(this.pagination_.page-1),a=s+this.pagination_.pageSize;if(!this.editable)for(var l=0;l<this.pois_.length;l++){var r=this.pois_[l];r.visible=!1,this.query?i&&i.contains(r.getPosition())&&(r.visible=!0,o++):(r.visible=!0,o++),r.visible=o>=s&&o<=a&&r.visible}this.pagination_.count=o,this.div.list.html(e.lib.template(this.templates.loop,{map:this,pois:this.pois_,pagination:this.pagination_})),mappl10n.options.thumbsList&&this.div.list.addClass(" mapp-thumb-"+mappl10n.options.thumbsList),this.editable&&(this.div.list.trigger("render"),t(".mapp-items",this.div.list).sortable({axis:"y",cursor:"move",delay:200,update:function(){n.sortPois(t(this).sortable("toArray",{attribute:"data-mapp-poi"}))}}))},renderMenu:function(){for(var e in this.layers_)t('[data-mapp-layer="'+e+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[e].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():e.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){var i="Please see the MapPress FAQ Troubleshooting section to resolve.";if("leaflet"==mappl10n.options.engine){if("undefined"==typeof L)return e.lib.alert("MAPPRESS: Unable to load Leaflet. "+i),!1}else{if("undefined"==typeof google)return e.lib.alert("MAPPRESS: Google Maps API not loaded. "+i),!1;t(document).ready((function(){t('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&e.lib.alert("MAPPRESS ERROR: Google Maps API key loaded multiple times. "+i)}))}return"undefined"==typeof _?(e.lib.log("MAPPRESS ERROR: plugin conflict, underscore.js not loaded. "+i),!1):!(void 0===jQuery.ui||jQuery.ui.version<"1.12")||(e.lib.log("MAPPRESS WARNING: plugin conflict, Outdated jQuery version: "+jQuery.ui.version+" should be >= 1.12 "+i),!0)},search: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)}},set:function(t){for(var e in t){var i=t[e];switch(e){case"dirty":this.dirty=i;break;case"mapTypeId":this.mapTypeId=i,this.setMapTypeId(i);break;case"poiList":this.poiList=null==i?mappl10n.options.poiList:i,this.div.layout.toggleClass("mapp-has-list",this.poiList),this.togglePoiListOpen(this.poiList),this.toggleView("mini");break;case"style":this.setStyle(i);break;case"title":this.title=i;break;default:this[e]=i}}},setMapTypeId:function(t){var e=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles);!mappl10n.options.style||"roadmap"!=t&&"streets"!=t&&t||(t=mappl10n.options.style),style=_.findWhere(e,{id:t}),style=style||e[0],this.setStyle(style)},setPois:function(t){if(this.resetPois(),t)for(var i=0;i<t.length;i++){var o=new e.Poi(t[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];if(this.embed)return this.div.layout.css({height:"100%"}),void this.div.wrapper.css({"padding-bottom":0,height:"100%"});if(t&&t.hasOwnProperty("width")){var i=t.width?t.width:e.width;this.div.layout.css("width",i)}if(t&&t.hasOwnProperty("height")){var o=t.height?t.height:e.height;"string"==typeof o&&o.includes("%")?this.div.wrapper.css({"padding-bottom":o,height:"auto"}):this.div.wrapper.css({"padding-bottom":0,height:o})}this.resize()},setStyle:function(i){if("leaflet"==mappl10n.options.engine){var o={mapbox:{accessToken:mappl10n.options.mapbox,attribution:"&copy; Mapbox &copy; OpenStreetMap",url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:'Map data (c)<a href="https://openstreetmap.org">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[i.provider],n=t.extend({},o,i);L.tileLayer(o.url,n).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==i.type?i.id:"roadmap"),i.json){var s=null;try{s=JSON.parse(i.json)}catch(t){e.lib.log("Invalid JSON in map style")}this.map_.setOptions({styles:s||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()},toggleLayer:function(e,i){var o=this;i=void 0!==i?i:null==this.layers_[e].getMap(),t.each(["traffic","bicycling","transit"],(function(t,e){o.layers_[e].setMap(null)})),i&&this.layers_[e].setMap(this.map_)},togglePoiListOpen:function(t){var e=this;this.div.layout.toggleClass("mapp-list-open",t),setTimeout((function(){return e.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){var i=this.div.layout.hasClass("mapp-view-mini"),o=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",o),void(o!=i&&this.togglePoiListOpen(!o))}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,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-addr",this.sel).removeClass("mapp-error"),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.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:function(t,e){var i=this;this.getPredictions(t,(function(t){t&&t.length?i.getDetails(t[0],(function(t){return 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",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={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){var o=this;this.getPredictions(e,(function(e){e&&t.isArray(e)?o.getDetails(e[0],(function(t){return 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((function(t){return t.value=t.description,t}))).filter((function(t){return 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){var 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));var 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:function(t,e){var i=this;this.getPredictions(t,(function(t){t&&t.length?i.getDetails(t[0],(function(t){return 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,t.getJSON(o,(function(t){t&&t.features&&t.features.length>0?(t.features=t.features.map((function(t){return 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){var 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));var 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:function(t,e){var i=this;this.getPredictions(t,(function(t){t&&t.length?i.getDetails(t[0],(function(t){return e(t)})):e(null)}))},getPredictions:function(e,i){var o="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(e);o=mappl10n.options.country?o+"&countrycodes="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&accept-language="+mappl10n.options.language.toLowerCase():o,t.getJSON(o,(function(t){t&&t.length?(t=t.map((function(t){return 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"mappress"==t?mappl10n.options.baseurl+"/images/mappress.png":"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){var n=this;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 s=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){s.isOpen&&s.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=function(){s.isOpen&&s.draw()}),this.node.get(0).addEventListener("load",(function(){n.open({position:n.position,anchorPoint:n.anchorPoint})}),{capture:!0}),this.opts.popout)var a="body";else a="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(a),"leaflet"==mappl10n.options.engine&&i.on("load",(function(){L.DomEvent.disableClickPropagation(n.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(this.position){var t,e;if(t=this.node.outerWidth(),this.node.outerHeight(),"leaflet"==mappl10n.options.engine)e=this.map.latLngToContainerPoint(this.position);else{var i=this.overlayView.getProjection();if(!i)return;e=i.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:e.x-t/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-e.y-this.anchorPoint.y})}},getContent:function(){return t(".mapp-ib",this.node)},open:function(t){this.position=t.position,this.anchorPoint=t.anchorPoint?t.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(),this.opts.popout?this.clipToWindow():"leaflet"==mappl10n.options.engine?this.panLeaflet():this.panGoogle(),this.isOpen=!0},panGoogle:function(){var t=this.overlayView.getProjection(),e=t?t.fromLatLngToDivPixel(this.position):null;if(e){var i=this.node.outerWidth(),o=this.node.outerHeight(),n=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(e.x-i/2-this.fudge,e.y+this.fudge)),s=this.overlayView.getProjection().fromDivPixelToLatLng(new google.maps.Point(e.x+i/2+this.fudge,e.y-o+this.anchorPoint.y-this.fudge)),a=new google.maps.LatLngBounds(n,s);this.map.panToBounds(a)}},panLeaflet:function(){var e=this.map.latLngToContainerPoint(this.position),i=t(this.mapDiv).width(),o=t(this.mapDiv).height(),n=this.node.outerWidth(),s=this.node.outerHeight(),a={x:e.x,y:e.y};e.x+n/2+this.anchorPoint.x>i-this.fudge?a.x=Math.max(i-n/2-this.anchorPoint.x-this.fudge,i/2-this.anchorPoint.x):e.x-n/2+this.anchorPoint.x<this.fudge&&(a.x=Math.min(n/2+this.anchorPoint.x+this.fudge,i/2-this.anchorPoint.x)),e.y+this.anchorPoint.y-s<this.fudge&&(a.y=s-this.anchorPoint.y+this.fudge),a.y>=o&&(a.y=o-this.fudge),this.map.panBy([e.x-a.x,e.y-a.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&&console.log(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){function e(_x){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((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(){this.el.parent().length||this.el.appendTo("body"),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:()=>{jQuery,mapp.load=function(){if("undefined"!=typeof mapp&&mapp.data)for(;mapp.data.length;){var t=mapp.data.pop();window[t.name]=new mapp.Map(t),window[t.name].display()}},mapp.load()},436:()=>{var t;t=jQuery,mapp.Marker=function(t){var e=this;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=function(){return e.draw()},this.overlayView.onAdd=function(){return e.onAdd()},this.overlayView.onRemove=function(){return e.onRemove()}},mapp.Marker.prototype={draw:function(){if(this.div&&this.icon){var e=this.overlayView.getProjection().fromLatLngToDivPixel(this.position),i=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};t(this.div).css({left:e.x-i.width/2,top:e.y-i.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){var e="on"+t.type[0].toUpperCase()+t.type.slice(1);this[e]&&this[e](t)},onAdd:function(){var e=this,i=this.overlayView.getPanes();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",(function(){(!e.dragging||e.dragging&&!e.dragging.moved)&&mapp.event.trigger(e,"click"),e.dragging=null})),this.div.get(0).addEventListener("mouseenter",this),this.div.get(0).addEventListener("mouseleave",this),this.setDraggable(this.draggable)},onMouseenter:function(t){mapp.event.trigger(this,"mouseover")},onMouseleave:function(t){mapp.event.trigger(this,"mouseout")},onPointerdown:function(t){var 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)){var e=this.map.getDiv().getBoundingClientRect(),i={x:t.clientX-e.left+this.dragging.offset.x,y:t.clientY-e.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(i)),this.draw(),this.dragging.moved=!0,mapp.event.trigger(this,"dragstart")}},onPointercancel:function(t){this.onPointerup(t)},onPointerup:function(t){this.dragging&&this.dragging.moved&&mapp.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(t,e){var 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){var e='<img draggable="false" src="'+this.icon.url+'">';this.div.html(e);var i=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:i.width,height:i.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(var 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:function(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);var 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){if(13==e.which){e.preventDefault();var i=n.parseLatLng(n.sel.val());i&&(t(n).triggerHandler("search.mapp",i),n.sel.autocomplete("close"),e.stopImmediatePropagation()),"http"==n.sel.val().substring(0,4)&&(t(n).triggerHandler("search.mapp",n.sel.val()),n.sel.autocomplete("close"),e.stopImmediatePropagation()),!1===mappl10n.options.autocomplete&&(n.sel.autocomplete("option","disabled",!1),n.sel.autocomplete("search"))}else!1===mappl10n.options.autocomplete&&n.sel.autocomplete("option","disabled",!0),n.sel.autocomplete("close")})),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("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(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){var e=this;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(i){var o={lat:i.coords.latitude,lng:i.coords.longitude};t({name:o.lat+", "+o.lng,geometry:{location:o}}),e.sel.val("")}),(function(e){var i=e&&e.message?" : "+e.message:"";alert(mappl10n.no_geolocate+i),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:300,disabled:!1===mappl10n.options.autocomplete,source:function(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;case"":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){var n=this.editable?"circle":mappl10n.options.highlight;switch(n){case"circle":o.toggleClass("mapp-marker-circle",i);break;case"icon":var s=i?e.Icons.get(mappl10n.options.highlightIcon):e.Icons.get(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==s.options.iconUrl)return;this.overlay.setIcon(s);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){var i=this;this.html?t():e.lib.ajax({type:"GET",data:{action:"mapp_get_post",postid:this.postid,nonce:mappl10n.options.nonce},dataType:"html",callback:function(e){i.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){var e=t.color,i=t.opacity,o=t.weight;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,u=i.administrative&&i.administrative[0]!==h?i.administrative[0]:void 0,d=i.city&&i.city[0]!==h?i.city[0]:void 0,g=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:d?p(i._highlightResult.city):void 0,administrative:u?p(i._highlightResult.administrative):void 0,country:c?i._highlightResult.country.value:void 0,suburb:g?p(i._highlightResult.suburb):void 0,county:m?p(i._highlightResult.county):void 0,postcode:y},b={name:h,administrative:u,county:m,city:d,suburb:g,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()}}},e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={exports:{}};return t[o](n,n.exports,i),n.exports}i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(628),i(854),i(397),i(442),i(282),i(689),i(436),i(510),i(548),i(692)})();
build/index_mappress_admin.js CHANGED
@@ -1 +1 @@
1
- !function(){var e={215:function(e,t,n){"use strict";n.r(t);var o=n(525),a=n(143);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c,p=window.mapp||{},s=wp.element.createElement;c=jQuery,p.Editor=function(e){this.drawingManager=null,this.map=e,this.poiEditor=null;var t=this;this.initialize=function(){this.map.display(),this.poiEditor=new p.PoiEditor(this.map),this.initDrawingManager(),c(this.map.places).off("search.mapp"),c(this.map.places).on("search.mapp",(function(e,n){t.insert(n)}))},this.insert=function(e){if(e)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),e.geometry){var n=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,o=e.name==n?"":n,a=new p.Poi({address:n,body:o,iconid:this.poiEditor.lastIcon,point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null});this.map.poiInsert(a),a.center()}else e.overlay?(this.map.poiHover(null),"marker"==e.type?(a=new p.Poi({body:"",iconid:null,overlay:null,point:e.overlay.getPosition().toJSON(),title:e.overlay.getPosition().toUrlValue(6),type:null}),e.overlay.setMap(null)):a=new p.Poi({body:"",iconid:null,overlay:e.overlay,title:mappl10n.shape,type:e.type}),this.map.poiInsert(a)):"string"==typeof e&&"http"==e.substring(0,4)&&(a=new p.Poi({iconid:this.poiEditor.lastIcon,kml:{url:e},title:"KML",type:"kml"}),t.map.poiInsert(a),p.event.addListenerOnce(a.overlay,"ready defaultviewport_changed",(function(){a.center()})))},this.initDrawingManager=function(){var e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};"leaflet"==mappl10n.options.engine||google.maps.drawing&&(this.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),this.drawingManager.setMap(this.map.getMap()),p.event.addListener(this.drawingManager,"overlaycomplete",(function(e){t.drawingManager.get("drawingMode")&&t.insert(e)})))},this.initialize.apply(this)},p.PoiEditor=function(e){this.map=e,this.poi=null,this.sel=null,this.lastIcon=null;var t=this;this.initialize=function(){this.sel=c(this.map.iw.getContent()),c(this.map).on("mapp.open",(function(e,n){t.render(n)})),c(this.map).on("mapp.close",(function(){t.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(e){e.preventDefault();var n=c(this).attr("data-mapp-poi");t[n]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(e){var n=c(this).hasClass("mapp-poi-visual");t.mce(n)})),this.sel.on("keydown",(function(e){13==e.which&&"mapp-poi-body"!=e.target.id&&(e.preventDefault(),t.save())}))},this.cancel=function(){this.map.poiClose()},this.initMCE=function(){if("undefined"!=typeof tinyMCE&&void 0!==tinyMCE.init){var e="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var t=window.tinyMCEPreInit.mceInit.content;e=void 0!==t.language?t.language:"en"}var n={mode:"none",height:"100%",convert_urls:!1,language:e,menubar:!1,plugins:"image,paste,textcolor,wordpress,wpeditimage,wplink,wpview",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(n),this.mce(!0)}},this.mce=function(e){var n=e?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(n,!1,"mapp-poi-body"),c(".mapp-poi-visual, .mapp-poi-html",t.sel).removeClass("mapp-active"),e?c(".mapp-poi-visual",t.sel).addClass("mapp-active"):c(".mapp-poi-html",t.sel).addClass("mapp-active")},this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.poiClose(),this.map.poiRemove(this.poi))},this.render=function(e){this.poi=e,this.renderColorPicker(this.poi),this.renderIconPicker(this.poi),this.initMCE()},this.renderColorPicker=function(e){var t=this;document.getElementById("mapp-poi-colorpicker")&&wp.element.render(s(o.MappColorPicker,i(i({},e.getTemplateColors()),{},{isExtended:!0,onChange:function(n){e.set({dirty:!0}),e.setTemplateColors(n),t.map.renderList(),t.renderColorPicker(e)}})),document.getElementById("mapp-poi-colorpicker"))},this.renderIconPicker=function(e){var t=this;document.getElementById("mapp-poi-iconpicker")&&wp.element.render(s(a.MappIconPicker,{iconid:e.iconid,onChange:function(n){e.set({dirty:!0,iconid:n}),t.lastIcon=n,t.map.renderList(),t.renderIconPicker(e)}}),document.getElementById("mapp-poi-iconpicker"))},this.save=function(){"undefined"!=typeof tinyMCE&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save(),this.poi.set({dirty:!0,title:c(".mapp-poi-title").val(),body:c(".mapp-poi-body").val()}),this.map.renderList(),this.map.poiClose()},this.initialize.apply(this)}},713:function(e,t,n){"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.r(t),n.d(t,{default:function(){return y}});var c=wp.element.createElement,p=wp.url.addQueryArgs,s=wp.element,u=s.useCallback,m=s.useEffect,d=s.useState,f=wp.components,h=(f.Button,f.Dropdown),g=f.Spinner,b=f.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function y(e){var t=i(d({isFetching:!1,results:[],search:"",searchTerm:""}),2),n=t[0],o=t[1];function r(e){o((function(t){return a(a({},t),e)}))}m((function(){n.isOpen&&(r({isFetching:!0}),wp.apiFetch({path:p("/wp/v2/search",{search:n.search,per_page:20})}).then((function(e){r({results:e,isFetching:!1})})))}),[n.search,n.isOpen]);var l=u(_.debounce((function(e){r({search:e})}),1e3),[]);function s(t,o){return c("div",{className:"mapp-attach-control"},c("div",{className:"mapp-attach-control-toolbar"},c(b,{autoComplete:"false",value:n.searchTerm,onChange:function(e){r({searchTerm:e}),l(e)},placeholder:__("Search")})),function(){if(n.isFetching)return c(g,null);if(n.results)return n.results.length?c("div",{className:"mapp-attach-items"},n.results.map((function(t){return c("div",{key:t.id,className:"mapp-attach-item",onClick:function(){e.onChange(t.id,t.title)}},c("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),c("div",{className:"mapp-attach-item-type"},t.type))}))):c("div",{},__("No posts found"))}())}return c("div",{onClick:function(e){return e.stopPropagation()}},c(h,{onToggle:function(e){return r({isOpen:e})},renderToggle:function(e){e.isOpen;var t=e.onToggle;return c("a",{href:"#",onClick:t},__("Attach"))},renderContent:function(e){e.isOpen,e.onToggle;return s()}}))}},525:function(e,t,n){"use strict";n.r(t),n.d(t,{MappColorPicker:function(){return y}});var o=n(824);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var p=wp.element.createElement,s=wp.element,u=s.Fragment,m=s.useEffect,d=(s.useLayoutEffect,s.useCallback,s.useRef,s.useState),f=(wp.data.useSelect,wp.compose.withState,wp.components),h=f.Button,g=(f.ColorPalette,f.ColorPicker),b=(f.Dashicon,f.Dropdown,f.ExternalLink,f.Modal),__=(f.Panel,f.PanelBody,f.PanelRow,f.Popover,f.RadioControl,f.Spinner,f.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function y(e){var t=l(d({isCustomOpen:!1,isOpen:!1}),2),n=t[0],a=t[1];function i(e){a((function(t){return r(r({},t),e)}))}function c(t,n){switch(t){case"close":i({isOpen:!1});break;case"open":i({isOpen:!0});break;case"select":e.onChange(n),c("close");break;case"set":e.onChange(n)}}return m((function(){}),[]),p(u,null,p("span",{className:"mapp-colors-toggle",onClick:function(){return c("open",null)},style:{backgroundColor:e.color,border:e.isExtended?"1px solid "+e.color:"1px solid gray",opacity:e.isExtended&&e.opacity?e.opacity/100:1},tabIndex:0}),function(){if(!n.isOpen)return null;var t=_.map([100,90,80,70,60,50,40,30,20,10,0],(function(e){return{label:e+"%",value:e}})),a=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(function(e){return{label:e+"px",value:e}}));return p(b,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:function(e){return c("close")}},p("div",{className:"mapp-colors"},p("div",{className:"mapp-colors-list"},_.map([["yellow","yellowgreen","green","seagreen","blue","cornflowerblue","darkslateblue","purple","firebrick","red","darkorange","orange","saddlebrown"],["lightyellow","greenyellow","lightgreen","darkseagreen","lightblue","skyblue","slateblue","orchid","plum","pink","sandybrown","goldenrod","peru"],["white","lightgray","gray","black"]],(function(t,n){return p("div",{key:n},_.map(t,(function(t){return p("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:function(){i({isCustomOpen:!1}),c("select",{color:t})},style:{backgroundColor:t},title:t})})))}))),n.isCustomOpen&&p(g,{color:e.color,onChangeComplete:function(e){return c("set",{color:e.hex})},disableAlpha:!0}),e.isExtended&&p(o.Select,{label:__("Opacity"),options:t,value:e.opacity?e.opacity:"",onChange:function(e){return c("set",{opacity:e})}}),e.isExtended&&p(o.Select,{label:__("Stroke"),options:a,value:e.weight?e.weight:"",onChange:function(e){return c("set",{weight:e})}}),p("div",{className:"mapp-colors-toolbar"},p(h,{isPrimary:!0,onClick:function(){return c("close")}},__("Done")),p(h,{isLink:!0,onClick:function(){return i({isCustomOpen:!n.isCustomOpen})}},__("Custom color")))))}())}},999:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v}});var o=n(429);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var p=window.mapp||{},s=wp.element.createElement,u=wp.element,m=(u.Fragment,u.useEffect),d=(u.useLayoutEffect,u.useRef),f=u.useState,h=wp.components,g=h.Button,b=(h.Dropdown,h.Modal,h.Panel,h.PanelBody),y=(h.Popover,h.Spinner,h.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n,a=l(f({dragging:null,dragover:null,isFetchingMap:!!e.mapid,isPoiListOpen:!0,isSavingMap:!1,map:null,mapdata:null}),2),i=a[0],c=a[1],u=d(null);function h(e){c((function(t){return r(r({},t),e)}))}function v(e){h({map:i.map})}function w(t,n){switch(t){case"change-settings":i.map.set(n),h({map:i.map});break;case"change-title":i.map.set({dirty:!0,title:n}),h({map:i.map});break;case"close":e.onAction("edit-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(p.store.destroyMap({mapid:e.mapid}),e.onAction("edit-destroy"));break;case"save":p.store.saveMap({mapdata:i.map.toJSON(),success:function(t){i.map.set({dirty:!1}),e.onAction("edit-save",t.mapid)}})}}return m((function(){i.map&&(jQuery(i.map.div.list).off("render",v),jQuery(i.map.div.list).on("render",(function(e){return v()})))}),[i.map]),m((function(){var t=function(t){h({isFetchingMap:t.isFetchingMap,isSavingMap:t.isSavingMap,mapdata:t.maps[e.mapid]})};return p.store.subscribe(t),function(){return p.store.unsubscribe(t)}})),m((function(){e.mapid&&p.store.fetchMap({mapid:e.mapid})}),[e.mapid]),m((function(){if(!i.isFetchingMap){var t={editable:!0,embed:!0,layout:"left",mapOpts:{mapTypeControl:!0,streetViewControl:!1},menu:!1,name:"media-map",poiList:!1,sel:jQuery(u.current)};"map"!=e.context&&"mashup"!=e.context||(t.center=null,t.zoom=null);var n=new p.Map(i.mapdata,t);new p.Editor(n);h({map:n})}}),[i.mapdata]),m((function(){i.map&&setTimeout((function(){return i.map.resize()}),100)}),[i.isPoiListOpen]),s("div",{className:"mapp-edit"},(t=i.map&&!i.isFetchingMap&&i.map.title?i.map.title:"",n=i.map&&!i.isFetchingMap?__("Untitled"):"",s("div",{className:"mapp-gt-modal-header"},s(y,{className:"mapp-edit-title",placeholder:n,value:t,onChange:function(e){return w("change-title",e)}}))),s("div",{className:"mapp-edit-main"},s("div",{className:"mapp-list mapp-edit-list"+(i.isPoiListOpen?" mapp-list-open":"")},function(){if("mce"!=e.context&&"library"!=e.context)return null;if(!i.map)return null;var t=i.map,n=t.center,a=t.height,r=t.poiList,l=t.width,c=t.zoom;return s("div",{className:"mapp-gt-inspector"},s(b,{initialOpen:!1,title:__("Map settings")},s(o.MappSettings,{map:i.map,context:e.context,onAction:w,center:n,height:a,poiList:r,width:l,zoom:c})))}(),function(){if(i.map){var e=function(e,t){var n=i.dragging,o=n<o?t-1:t;i.map.pois_.splice(o,0,i.map.pois_.splice(n,1)[0]),h({map:i.map,dragover:null})};return s("div",{className:"mapp-items"},_.map(i.map.pois_,(function(t,n){return s("div",{className:i.dragover==n?"mapp-item mapp-edit-dragover":"mapp-item",draggable:!0,key:n,onClick:function(){return i.map.poiOpen(i.map.pois_[n])},onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return h({dragging:n})},onDragEnter:function(e){return h({dragover:n})},onDragEnd:function(e){return h({dragging:null,dragover:null})},onDrop:function(t){return e(t,n)}},s("img",{className:"mapp-icon",src:p.Icons.getUrl(t.iconid)}),s("div",{className:"mapp-title"},t.title))})))}}(),s("div",{className:"mapp-list-toggle",onClick:function(){return h({isPoiListOpen:!i.isPoiListOpen})}})),s("div",{className:"mapp-edit-map",key:e.mapid,ref:u,onKeyDown:function(e){return e.stopPropagation()},tabIndex:-1})),s("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:function(e){return e.stopPropagation()}},s(g,{isPrimary:!0,isBusy:i.isSavingMap,onClick:function(){return w("save")}},__("Save")),s(g,{disabled:i.isSavingMap,onClick:function(){return w("close")}},__("Cancel")),s(g,{disabled:!e.mapid||i.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:function(){return w("destroy")}},__("Delete"))))}},143:function(e,t,n){"use strict";n.r(t),n.d(t,{MappIconPicker:function(){return w}});var o=n(525),a=n(824);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var s=wp.element.createElement,u=wp.element,m=u.Fragment,d=u.useEffect,f=(u.useLayoutEffect,u.useCallback,u.useRef,u.useState),h=(wp.data.useSelect,wp.compose.withState,wp.components),g=h.Button,b=(h.ColorPicker,h.DropZone,h.DropZoneProvider,h.FormFileUpload),y=h.Modal,__=(h.Popover,h.Spinner,h.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")}),v={"mapp-icons":{label:"Map icons",glyphs:[{name:"abseiling",codepoint:59392},{name:"accounting",codepoint:59393},{name:"airport",codepoint:59394},{name:"amusement-park",codepoint:59395},{name:"aquarium",codepoint:59396},{name:"archery",codepoint:59397},{name:"art-gallery",codepoint:59398},{name:"assistive-listening-system",codepoint:59399},{name:"atm",codepoint:59400},{name:"audio-description",codepoint:59401},{name:"bakery",codepoint:59402},{name:"bank",codepoint:59403},{name:"bar",codepoint:59404},{name:"baseball",codepoint:59405},{name:"beauty-salon",codepoint:59406},{name:"bicycle-store",codepoint:59407},{name:"bicycling",codepoint:59408},{name:"boat-ramp",codepoint:59409},{name:"boat-tour",codepoint:59410},{name:"boating",codepoint:59411},{name:"book-store",codepoint:59412},{name:"bowling-alley",codepoint:59413},{name:"braille",codepoint:59414},{name:"bus-station",codepoint:59415},{name:"cafe",codepoint:59416},{name:"campground",codepoint:59417},{name:"canoe",codepoint:59418},{name:"car-dealer",codepoint:59419},{name:"car-rental",codepoint:59420},{name:"car-repair",codepoint:59421},{name:"car-wash",codepoint:59422},{name:"casino",codepoint:59423},{name:"cemetery",codepoint:59424},{name:"chairlift",codepoint:59425},{name:"church",codepoint:59426},{name:"skip",codepoint:59427},{name:"city-hall",codepoint:59428},{name:"climbing",codepoint:59429},{name:"closed-captioning",codepoint:59430},{name:"clothing-store",codepoint:59431},{name:"compass",codepoint:59432},{name:"convenience-store",codepoint:59433},{name:"courthouse",codepoint:59434},{name:"cross-country-skiing",codepoint:59435},{name:"crosshairs",codepoint:59436},{name:"dentist",codepoint:59437},{name:"department-store",codepoint:59438},{name:"diving",codepoint:59439},{name:"doctor",codepoint:59440},{name:"electrician",codepoint:59441},{name:"electronics-store",codepoint:59442},{name:"embassy",codepoint:59443},{name:"expand",codepoint:59444},{name:"female",codepoint:59445},{name:"finance",codepoint:59446},{name:"fire-station",codepoint:59447},{name:"fish-cleaning",codepoint:59448},{name:"fishing-pier",codepoint:59449},{name:"fishing",codepoint:59450},{name:"florist",codepoint:59451},{name:"food",codepoint:59452},{name:"fullscreen",codepoint:59453},{name:"funeral-home",codepoint:59454},{name:"furniture-store",codepoint:59455},{name:"gas-station",codepoint:59456},{name:"general-contractor",codepoint:59457},{name:"golf",codepoint:59458},{name:"grocery-or-supermarket",codepoint:59459},{name:"gym",codepoint:59460},{name:"hair-care",codepoint:59461},{name:"hang-gliding",codepoint:59462},{name:"hardware-store",codepoint:59463},{name:"health",codepoint:59464},{name:"hindu-temple",codepoint:59465},{name:"horse-riding",codepoint:59466},{name:"hospital",codepoint:59467},{name:"ice-fishing",codepoint:59468},{name:"ice-skating",codepoint:59469},{name:"inline-skating",codepoint:59470},{name:"insurance-agency",codepoint:59471},{name:"jet-skiing",codepoint:59472},{name:"jewelry-store",codepoint:59473},{name:"kayaking",codepoint:59474},{name:"laundry",codepoint:59475},{name:"lawyer",codepoint:59476},{name:"library",codepoint:59477},{name:"liquor-store",codepoint:59478},{name:"local-government",codepoint:59479},{name:"location-arrow",codepoint:59480},{name:"locksmith",codepoint:59481},{name:"lodging",codepoint:59482},{name:"low-vision-access",codepoint:59483},{name:"male",codepoint:59484},{name:"skip",codepoint:59485},{name:"marina",codepoint:59486},{name:"mosque",codepoint:59487},{name:"motobike-trail",codepoint:59488},{name:"movie-rental",codepoint:59489},{name:"movie-theater",codepoint:59490},{name:"moving-company",codepoint:59491},{name:"museum",codepoint:59492},{name:"natural-feature",codepoint:59493},{name:"night-club",codepoint:59494},{name:"open-captioning",codepoint:59495},{name:"painter",codepoint:59496},{name:"park",codepoint:59497},{name:"parking",codepoint:59498},{name:"pet-store",codepoint:59499},{name:"pharmacy",codepoint:59500},{name:"physiotherapist",codepoint:59501},{name:"place-of-worship",codepoint:59502},{name:"playground",codepoint:59503},{name:"plumber",codepoint:59504},{name:"point-of-interest",codepoint:59505},{name:"police",codepoint:59506},{name:"political",codepoint:59507},{name:"post-box",codepoint:59508},{name:"post-office",codepoint:59509},{name:"skip",codepoint:59510},{name:"skip",codepoint:59511},{name:"rafting",codepoint:59512},{name:"real-estate-agency",codepoint:59513},{name:"restaurant",codepoint:59514},{name:"roofing-contractor",codepoint:59515},{name:"skip",codepoint:59516},{name:"route",codepoint:59517},{name:"rv-park",codepoint:59518},{name:"sailing",codepoint:59519},{name:"school",codepoint:59520},{name:"scuba-diving",codepoint:59521},{name:"search",codepoint:59522},{name:"skip",codepoint:59523},{name:"shopping-mall",codepoint:59524},{name:"sign-language",codepoint:59525},{name:"skateboarding",codepoint:59526},{name:"ski-jumping",codepoint:59527},{name:"skiing",codepoint:59528},{name:"sledding",codepoint:59529},{name:"snow-shoeing",codepoint:59530},{name:"snow",codepoint:59531},{name:"snowboarding",codepoint:59532},{name:"snowmobile",codepoint:59533},{name:"spa",codepoint:59534},{name:"skip",codepoint:59535},{name:"skip",codepoint:59536},{name:"skip",codepoint:59537},{name:"stadium",codepoint:59538},{name:"storage",codepoint:59539},{name:"store",codepoint:59540},{name:"subway-station",codepoint:59541},{name:"surfing",codepoint:59542},{name:"swimming",codepoint:59543},{name:"synagogue",codepoint:59544},{name:"taxi-stand",codepoint:59545},{name:"tennis",codepoint:59546},{name:"toilet",codepoint:59547},{name:"trail-walking",codepoint:59548},{name:"train-station",codepoint:59549},{name:"transit-station",codepoint:59550},{name:"travel-agency",codepoint:59551},{name:"unisex",codepoint:59552},{name:"university",codepoint:59553},{name:"veterinary-care",codepoint:59554},{name:"viewing",codepoint:59555},{name:"volume-control-telephone",codepoint:59556},{name:"walking",codepoint:59557},{name:"waterskiing",codepoint:59558},{name:"whale-watching",codepoint:59559},{name:"wheelchair",codepoint:59560},{name:"wind-surfing",codepoint:59561},{name:"zoo",codepoint:59562}]},"mapp-shapes":{label:"Map shapes",glyphs:[{name:"circle",codepoint:59648,center:[16,16]},{name:"widepin",codepoint:59649,center:[16,14]},{name:"route",codepoint:59650,center:[16,14]},{name:"shield",codepoint:59651,center:[16,14]},{name:"squarepin",codepoint:59653,center:[16,14]},{name:"square",codepoint:59652,center:[16,16]},{name:"squarerounded",codepoint:59654,center:[16,16]},{name:"roundpin",codepoint:59657,center:[16,13]},{name:"pin",codepoint:59655,center:null},{name:"pindot",codepoint:59656,center:null}]}};function w(e){var t,n,r,l=c(f({defaultIcon:mappl10n.options.defaultIcon,filename:null,fillColor:"gray",filter:"",glyph:"",glyphColor:"white",glyphFont:"mapp-icons",isFontLoaded:!1,isOpen:!1,mode:"list",shape:"circle",shapeFont:"mapp-shapes",showNames:!0,strokeColor:"black",strokeWidth:4,urls:{},userIcons:mappl10n.options.userIcons}),2),p=l[0],u=l[1];function h(e){u((function(t){return i(i({},t),e)}))}function w(t,n){switch(t){case"close":h({isOpen:!1});break;case"edit-cancel":h({mode:"list"});break;case"edit-save":!function(e){p.glyphFont;var t=2,n=32*t,o=16*t,a=document.createElement("canvas");a.width=n,a.height=n,a.style.imageRendering="pixelated";var r=a.getContext("2d");r.font=n+"px "+p.shapeFont,r.fillStyle=p.fillColor,r.textBaseline="bottom";var i=_.findWhere(v[p.shapeFont].glyphs,{name:p.shape});r.fillText(String.fromCharCode(i.codepoint),0,n);var l=1,c=l*t;if(r.strokeStyle="white",r.lineWidth=c,r.font=n-l*t+"px "+p.shapeFont,r.strokeText(String.fromCharCode(i.codepoint),l,n-l),i.center){r.imageSmoothingEnabled=!1,r.font=o+"px "+p.glyphFont,r.fillStyle=p.glyphColor;var s=[i.center[0]*t,i.center[1]*t],u=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph});r.fillText(String.fromCharCode(u.codepoint),s[0]-o/2,s[1]+o/2)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(a):a.toBlob((function(e){var t=new FormData;t.append("image0",e,p.filename),k(t)}),"image/png",100)}();break;case"edit-upload":o=n,a=new FormData,_.map(o,(function(e,t){e.type.match("image.*")?a.append("image"+t,e):alert("File "+e.name+" is not an image.")})),k(a);break;case"list-clear":e.onChange&&e.onChange(null),w("close");break;case"list-delete":e.iconid&&confirm(mappl10n.delete_prompt)&&mapp.lib.ajax({type:"POST",data:{action:"mapp_icon_delete",iconids:e.iconid,nonce:mappl10n.options.nonce},callback:function(t){if(t&&"OK"==t.status){var n=mappl10n.options.userIcons.indexOf(e.iconid);n>=0&&void 0!==mappl10n.options.userIcons[n+1]?e.onChange(mappl10n.options.userIcons[n+1]):e.onChange(null),mappl10n.options.userIcons=t.data,h({userIcons:mappl10n.options.userIcons})}else alert("Delete error: "+t.status)}});break;case"list-select":e.onChange&&(n==e.iconid?e.onChange(null):e.onChange(n));break;case"mode":h({mode:n});break;case"open":h({isOpen:!0})}var o,a}function O(t){var n="user"==t?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(n,(function(t){return s("div",{alt:t,className:e.iconid==t?"mapp-icon-wrapper mapp-selected":"mapp-icon-wrapper",key:t,onClick:function(){return w("list-select",t)}},s("img",{className:"mapp-icon",src:mapp.Icons.getUrl(t),title:t}))}))}function k(e){e.append("action","mapp_icon_save"),e.append("nonce",mappl10n.options.nonce),mapp.lib.ajax({type:"POST",contentType:!1,processData:!1,data:e,success:function(e){e&&"OK"==e.status?(mappl10n.options.userIcons=e.data.icons,h({userIcons:mappl10n.options.userIcons}),h({mode:"list"}),w("list-select",e.data.filename)):alert("Upload error: "+e.status)}})}return d((function(){var e=[];_.map(v,(function(t,n){var o=new FontFace(n,"url("+mappl10n.options.baseurl+"/pro/fonts/"+n+".woff?"+mappl10n.options.version+")");document.fonts.add(o),e.push(o.loaded)})),Promise.all(e).then((function(){h({isFontLoaded:!0})}))}),[]),d((function(){h({filename:p.shape+"_"+p.fillColor.replace("#","")+(p.glyph?"_"+p.glyph:"")+".png"})}),[p.shape,p.fillColor,p.glyph]),s(m,null,s("img",{className:"mapp-icon",onClick:function(){return w("open",null)},src:mapp.Icons.getUrl(e.iconid)}),"list"==p.mode&&function(){if(!p.isOpen)return null;var t=e.iconid&&mappl10n.options.userIcons.indexOf(e.iconid)>=0;return s(y,{title:s("div",{className:"mapp-icons-header"},__("Select an icon"),s(g,{isSecondary:!0,onClick:function(){return w("mode","edit")}},__("New icon"))),className:"mapp-icons-modal",onRequestClose:function(){return w("close")}},s("div",{className:"mapp-icons"},s("div",{className:"mapp-icons-list"},s("div",{className:"mapp-icons-user"},O("user")),s("div",{className:"mapp-icons-standard"},O("standard"))),s("div",{className:"mapp-icons-edit-filename"},e.iconid?e.iconid:__("No icon selected")),s("div",{className:"mapp-icons-toolbar"},s("div",null,s(g,{isPrimary:!0,onClick:function(){return w("close")}},__("Select")),s(g,{isSecondary:!0,onClick:function(){return w("list-clear")}},__("Use default icon"))),s(g,{isDestructive:!0,onClick:function(){return w("list-delete")},disabled:!t},__("Delete")))))}(),"edit"==p.mode&&s(y,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:function(){return w("edit-cancel")},shouldCloseOnClickOutside:!1},s("div",{className:"mapp-icons-edit"},s("div",{id:"mapp-edit-debug"}),s("div",{className:"mapp-icons-edit-shape-section"},s("div",{className:"mapp-icons-shape-heading"},__("Shape and color"),s(o.MappColorPicker,{color:p.fillColor,isExtended:!1,onChange:function(e){return h({fillColor:e.color})}})),(t=v[p.shapeFont],n=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph}),r=n?String.fromCharCode(n.codepoint):null,s("div",{className:"mapp-icons-edit-shapes",style:{color:p.fillColor,fontFamily:p.shapeFont}},_.map(t.glyphs,(function(e,t){var o=p.shape==e.name;return s("span",{className:"mapp-icons-edit-shape-wrapper"+(o?" mapp-selected":""),key:e.name,onClick:function(){return h({shape:e.name})},title:e.name},s("span",{className:"mapp-icons-edit-shape"},String.fromCharCode(e.codepoint),e.center&&n&&s("span",{className:"mapp-icons-edit-glyph",style:{left:e.center[0],top:e.center[1],color:p.glyphColor,fontFamily:p.glyphFont}},r)))}))))),s("div",{className:"mapp-icons-edit-glyph-section"},s("div",{className:"mapp-icons-glyph-heading"},__("Glyph"),s("div",null,__("Search"),s(a.Input,{onChange:function(e){return h({filter:e})}}))),function(){p.glyphFont;var e=_.filter(v[p.glyphFont].glyphs,(function(e){return(!p.filter||e.name.includes(p.filter))&&"skip"!=e.name}));return s("div",{className:"mapp-icons-edit-glyph-list",style:{color:p.glyphColor,fontFamily:p.glyphFont}},_.map(e,(function(e,t){return s("div",{className:"mapp-icons-edit-glyph-wrapper"+(p.glyph==e.name?" mapp-selected":""),key:t,onClick:function(){return h({glyph:p.glyph==e.name?null:e.name})}},s("span",{className:"mapp-icons-edit-glyph"},String.fromCharCode(e.codepoint)),s("div",{className:"mapp-icons-edit-glyph-title"},e.name))})))}()),s("div",{className:"mapp-icons-edit-toolbar"},s("div",null,s(g,{isPrimary:!0,onClick:function(){return w("edit-save")}},__("Save")),s(g,{isSecondary:!0,onClick:function(){return w("edit-cancel")}},__("Cancel"))),s(b,{accept:"image/*",icon:"upload",multiple:!0,onChange:function(e){w("edit-upload",e.target.files)}},__("Upload icons"))))))}},800:function(e,t,n){"use strict";n.r(t);var o=n(966);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var p=wp.element.createElement,s=wp.element,u=(s.Fragment,s.useEffect,s.useLayoutEffect,s.useRef,s.useState),m=wp.components;m.Button,m.Dashicon,m.Modal;function d(e){var t=l(u({mapid:null}),2),n=t[0],a=t[1];return p(o.default,{context:"mce",mapid:n.mapid,onAction:function(t,n){switch(t){case"pick-close":o={mapid:null},a((function(e){return r(r({},e),o)})),e.onAction("pick-close",n);break;case"pick-insert":e.onAction("pick-insert",n)}var o}})}window.parent&&(window.mappIframeRender=function(e){wp.element.render(p(d,e),document.getElementById("mapp-iframe-react"))}),function(e){function t(){var t=this;this.contentWindow=null,this.iframe=null;e(".mapp-iframe-button").on("click",(function(e){e.preventDefault(),t.open()}))}t.prototype={load:function(t){var n=this;if(this.iframe)return this.iframe.show(),void t();this.iframe=e('<iframe class="mapp-iframe" allowtransparency="true"></iframe>').appendTo("body"),e("iframe").on("load",(function(){t()})),e.get(mappl10n.options.ajaxurl,{action:"mapp_iframe",nonce:mappl10n.options.nonce},(function(e){n.contentWindow=n.iframe.get(0).contentWindow,n.contentWindow.document.open("text/html","replace"),n.contentWindow.document.write(e),n.contentWindow.document.close()}))},open:function(){var e=this;this.load((function(){e.contentWindow&&e.contentWindow.mappIframeRender&&e.contentWindow.mappIframeRender({onAction:function(t,n){return e.onAction(t,n)}})}))},onAction:function(e,t){switch(e){case"pick-close":this.iframe.hide();break;case"pick-insert":var n='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?alert(mappl10n.need_classic):send_to_editor(n),this.iframe.hide()}}},e(".mapp-iframe-button").length&&new t(this)}(jQuery)},938:function(e,t,n){"use strict";n.r(t);var o=n(966);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var i=wp.element.createElement,l=wp.element,c=(l.Fragment,l.render,l.useEffect),p=(l.useLayoutEffect,l.useRef,l.useState),s=wp.components;s.Button,s.Modal;document.getElementById("mapp-library")&&(mappl10n.options.postid=0,wp.element.render(i((function(e){var t=a(p({mapid:null}),2),n=t[0];return t[1],c((function(){}),[]),i(o.default,{context:"library",mapid:n.mapid,onAction:function(e,t){switch(e){case"pick-shortcode":var n=jQuery("<input>");jQuery("body").append(n),n.val('[mappress mapid="'+t+'"]').select(),document.execCommand("copy"),n.remove(),alert((o="Shortcode copied",wp.i18n.__(o,"mappress-google-maps-for-wordpress")))}var o}})})),document.getElementById("mapp-library")))},816:function(e,t,n){"use strict";n.r(t);var o=n(429),a=n(966);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var s=window.mapp||{},u=wp.element.createElement,m=wp.element,d=m.Fragment,f=m.useEffect,h=(m.useLayoutEffect,m.useRef),g=m.useState,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function b(e){var t=wp.components,n=(t.BaseControl,t.Button),r=(t.ButtonGroup,t.CheckboxControl,t.Dropdown,t.Modal,t.Panel,t.PanelBody),l=(t.PanelRow,t.Placeholder),p=(t.RadioControl,t.SelectControl,t.TextControl,t.ToggleControl,t.Toolbar),m=t.ToolbarButton,b=(t.ToolbarGroup,wp.blockEditor),y=b.BlockControls,v=b.InspectorControls,w=c(g({isOpen:!1,map:null,mapdata:null,pickerMode:"list",pickerMapid:null}),2),O=w[0],k=w[1],C=h(null);function S(e){k((function(t){return i(i({},t),e)}))}function P(t,n){switch(t){case"add":S({isOpen:!0,pickerMapid:null,pickerMode:"edit"}),e.setAttributes({center:void 0,zoom:void 0});break;case"change-settings":e.setAttributes(n);break;case"edit":S({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"edit"});break;case"edit-close":S({isOpen:!1});break;case"pick-destroy":e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),S({isOpen:!1});break;case"pick-close":S({isOpen:!1});break;case"pick-insert":case"pick-duplicate":n!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:n,zoom:void 0}),S({isOpen:!1});break;case"open":S({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"list"})}}function j(){var t=void 0!==t?t:p;return u(y,null,u(t,null,e.attributes.mapid&&u(m,{icon:"edit",label:__("Edit map"),onClick:function(){return P("edit")}}),u(m,{icon:"portfolio",label:__("Map Library"),onClick:function(){return P("open")}})))}function M(){if(O.isOpen)return u(a.default,{mapid:O.pickerMapid,mode:O.pickerMode,onAction:P,type:"post"})}return f((function(){var t=function(t){var n=t.maps[e.attributes.mapid];n&&S({mapdata:n})};return s.store.subscribe(t),function(){return s.store.unsubscribe(t)}})),f((function(){e.attributes.mapid&&s.store.fetchMap({mapid:e.attributes.mapid,failure:function(){return S({mapdata:void 0})}})}),[e.attributes.mapid]),f((function(){var t;e.attributes.mapid&&C.current&&O.mapdata&&((t=new s.Map(O.mapdata,{alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:e.attributes.poiList,sel:jQuery(C.current),width:e.attributes.width,zoom:e.attributes.zoom})).display(),S({map:t}))}),[O.mapdata]),f((function(){"wide"!=e.attributes.align&&"full"!=e.attributes.align||(e.setAttributes({width:"100%"}),O.map&&O.map.setSize({width:"100%"}))}),[e.attributes.align]),e.attributes.preview?u("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):e.attributes.mapid&&void 0!==O.mapdata?u(d,null,j(),function(){if(!O.map)return null;var t=e.attributes,n=t.align,a=t.center,i=t.height,l=t.poiList,c=t.width,p=t.zoom;return u(v,null,u("div",{className:"mapp-gt-inspector"},u(r,{title:__("Map settings")},u(o.MappSettings,{map:O.map,alignment:n,context:"map",onAction:P,center:a,height:i,poiList:l,width:c,zoom:p}))))}(),u("div",{className:"mapp-gt",ref:C}),M()):u(d,null,u(d,null,j(),u(l,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},u(n,{icon:"portfolio",isSecondary:!0,onClick:function(){return P("open")}},__("Map Library")))),M())}wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:"mappress",attributes:{center:{type:"string"},height:{type:"string",default:""},initialOpenDirections:{type:"boolean"},mapid:{type:"string"},mapOpts:{type:"object"},poiList:{type:"boolean"},preview:{type:"boolean",default:!1},width:{type:"string",default:""},zoom:{type:"number"}},supports:{align:["full","wide","center","left","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:function(e){return e.named.center}},height:{type:"string",shortcode:function(e){return e.named.height}},initialOpenDirections:{type:"boolean",shortcode:function(e){return"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections}},mapid:{type:"string",shortcode:function(e){return e.named.mapid}},poiList:{type:"boolean",shortcode:function(e){return"true"==e.named.poiList||"true"==e.named.poilist}},width:{type:"string",shortcode:function(e){return e.named.width}},zoom:{type:"number",shortcode:function(e){return parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(e){var t=e.text,n=wp.shortcode.regexp("mappress");return n.lastIndex=0,n.test(t)},transform:function(e){var t=e.text;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return u(b,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},378:function(e,t,n){"use strict";n.r(t);n(429),n(670),n(308);window.mapp,wp.element.createElement;var o=wp.element,a=(o.Fragment,o.useEffect,o.useLayoutEffect,o.useRef,o.useState,wp.components);a.BaseControl,a.Button,a.ButtonGroup,a.Card,a.CardBody,a.CardFooter,a.CardHeader,a.CheckboxControl,a.ExternalLink,a.HorizontalRule,a.Panel,a.PanelBody,a.PanelRow,a.Placeholder,a.RadioControl,a.SelectControl,a.TabPanel,a.TextControl,a.TextareaControl,a.ToggleControl,a.Toolbar,wp.data.useSelect},498:function(e,t,n){"use strict";n.r(t);var o=n(966);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var p=wp.element.createElement,s=wp.element,u=s.Fragment,m=(s.useEffect,s.useLayoutEffect,s.useRef,s.useState),d=wp.components,f=(d.Button,d.Dashicon),__=(d.Modal,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function h(){var e=l(m({isOpen:!1,mapid:null}),2),t=e[0],n=e[1];function a(e){n((function(t){return r(r({},t),e)}))}function i(e,t){switch(e){case"pick-close":a({isOpen:!1,mapid:null});break;case"pick-insert":a({isOpen:!1});var n='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(n);break;case"open":a({isOpen:!0,mapid:c()})}}function c(){var e=tinyMCE?tinyMCE.get("content"):null,t=e&&e.selection?e.selection.getSel():null;if(!t||void 0===t.anchorOffset||!t.anchorNode||!t.anchorNode.data)return null;for(var n=null,o=t.anchorNode.data,a=-1,r=t.anchorOffset-1;r>=0;r--){var i=o[r];if("["==i){a=r;break}if("]"==i||"<"==i||">"==i)break}return a>=0&&(n=wp.shortcode.next("mappress",o,a))?n.shortcode.attrs.named.mapid:null}return p(u,null,p("button",{className:"button",type:"button",onClick:function(e){e.preventDefault(),i("open")}},p(f,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&p(o.default,{context:"mce",mapid:t.mapid,onAction:i}))}Array.from(document.getElementsByClassName("mapp-mce")).forEach((function(e,t){return wp.element.render(p(h),e)}))},670:function(e,t,n){"use strict";function o(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.r(t),n.d(t,{MappMultiSelect:function(){return v}});var s=wp.element.createElement,u=wp.element,m=(u.Fragment,u.useEffect),d=(u.useLayoutEffect,u.useRef),f=u.useState,h=wp.components,g=h.BaseControl,b=(h.Button,h.CheckboxControl),y=(h.Panel,h.PanelBody,h.PanelRow,h.Spinner,h.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n=d(null),a=d(null),i=l(f({isOpen:!1,filter:"",filteredOptions:[]}),2),c=i[0],p=i[1];function u(e){p((function(t){return r(r({},t),e)}))}function h(t){var n=_.findWhere(e.options,{value:t});return n?n.label:t}function v(){var t;return e.values instanceof Array?t=o(e.values):e.values&&(t=[e.values]),t||[]}function w(t,n){var o=v(),a=o.indexOf(t);(n=void 0!==n?n:-1==a)?o.push(t):o.splice(a,1),e.onChange(o)}function O(){return c.isOpen?s("div",{className:"mapp-select-dropdown-wrapper"},s("div",{className:"mapp-select-dropdown"},!c.isOpen||!e.options||e.options.length<10?null:s("div",{className:"mapp-select-filter",ref:a},s(y,{autoComplete:"off",placeholder:__("Search"),value:c.filter,onChange:function(e){return u({filter:e})}})),s("div",{className:"mapp-select-dropdown-list"},(t=v(),0==c.filteredOptions.length?s("div",{className:"mapp-select-dropdown-item"},__("No results")):c.filteredOptions.map((function(e){return s(b,{className:"mapp-select-dropdown-item",checked:t.includes(e.value),key:e.value,onChange:function(t){return w(e.value,t)},label:e.label})})))))):null;var t}return m((function(){if(e.options)if(c.filter){var t=c.filter.toUpperCase();u({filteredOptions:e.options.filter((function(e){return 0==e.label.toUpperCase().indexOf(t)}))})}else u({filteredOptions:e.options})}),[e.options,c.filter]),m((function(){c.isOpen&&a.current&&(jQuery("input",jQuery(a.current)).focus(),u({filter:""}))}),[c.isOpen]),s(g,{className:"mapp-select",label:e.label},s("div",{ref:n,tabIndex:0,onBlur:function(e){return function(e){event.relatedTarget||document.activeElement,n.current.contains(e.relatedTarget)||u({isOpen:!1})}(e)}},((t=v())instanceof Array&&t.map((function(e){return h(e)})),void 0===e.options?s("div",{className:"mapp-select-input"},s("div",{className:"mapp-select-tokens"}),s("span",{className:"dashicons dashicons-arrow-down-alt2"})):s("div",{className:"mapp-select-input",onClick:function(){return u({isOpen:!c.isOpen})}},s("div",{className:"mapp-select-tokens"},t.map((function(e){return s("span",{className:"mapp-select-token",key:e,onClick:function(t){t.stopPropagation(),w(e,!1)}},h(e))}))),s("span",{className:"dashicons "+(c.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))),O()))}},218:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return C}});var o=n(824),a=n(143);function r(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var m=wp.element.createElement,d=wp.element,f=d.Fragment,h=d.useEffect,g=(d.useLayoutEffect,d.useCallback,d.useRef),b=d.useState,y=wp.data.useSelect,v=wp.components,w=v.Button,O=v.Dashicon,k=v.ExternalLink,__=(v.Modal,v.Panel,v.PanelBody,v.PanelRow,v.Popover,v.RadioControl,v.Spinner,v.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function C(e){var t=p(b(l({},mappress_options_state)),2),n=t[0],i=t[1];function c(e){i((function(t){return l(l({},t),e)}))}h((function(){S.current&&new mapp.Map(n.helpers.demo_map,{sel:jQuery(S.current)}).display()}),[]);var s,u,d,v,C,S=g(null);function P(e){return _.map(e,(function(e,t){return{value:t,label:e}}))}function j(e,t){switch(e){case"license-check":mapp.lib.ajax({type:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:n.license},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"reset":mapp.lib.ajax({type:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"save":var o=l({},n);delete o.helpers,mapp.lib.ajax({type:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:o},callback:function(e){e&&"OK"==e.status&&window.location.reload()}})}}return m("div",{className:"mapp-options"},m("form",{onSubmit:function(e){e.preventDefault(),j("save")}},m(o.Section,{title:__("Sample Map"),className:"mapp-demo-section"},m("div",{className:"mapp-options-demo",ref:S})),m(o.Section,{title:__("Basic Settings")},m(o.Radios,{title:__("Mapping API"),options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:function(e){return c({engine:e,geocoder:"google"==e?"google":""})},checked:n.engine,help:{href:"#toc-picking-a-mapping-api",text:__("Leaflet is free and requires no API key. Google requires an API key and has strict usage limits.")}}),"leaflet"==n.engine&&m(o.Input,{title:__("Mapbox access token"),value:n.mapbox,onChange:function(e){c({mapbox:e}),"mapbox"!=n.geocoder||e||c({geocoder:""})},size:50,placeholder:__("Enter token to use Mapbox features"),help:{href:"https://www.mapbox.com/help/define-access-token/"}}),"google"==n.engine&&m(o.Input,{title:__("Google API key"),name:"apiKey",value:n.apiKey,onChange:function(e){return c({apiKey:e})},size:50,help:{href:"https://mappresspro.com/mappress-faq/#toc-google-maps-api-keys"}}),"leaflet"==n.engine&&(C=[{value:"",label:__("Algolia")},{value:"nominatim",label:"Nominatim"},{value:"mapbox",label:"MapBox",disabled:!n.mapbox}],m(o.Radios,{title:__("Geocoder"),options:C,checked:n.geocoder,onChange:function(e){return c({geocoder:e})},help:{href:"#toc-picking-a-geocoder"}}))),mappl10n.options.pro&&(!n.helpers.is_multisite||n.helpers.is_super_admin||n.helpers.is_main_site)&&m(o.Section,{title:__("License")},m(o.Option,{title:__("MapPress license key")},m(o.Input,{value:n.license,onChange:function(e){return c({license:e})},size:37,placeholder:__("Enter license to enable automatic updates")}),(v=m("a",{className:"mapp-license-status",href:"https://mappresspro.com/account",target:"_blank"},__("Get license")),n.license&&n.helpers.license_status?"active"==n.helpers.license_status?m("span",{className:"mapp-license-status"},m(O,{icon:"yes"}),__("Active")):m(f,null,m(w,{className:"mapp-options-check-license",isSecondary:!0,onClick:function(){return j("license-check")}},__("Check now")),m("div",null,m(O,{icon:"no"}),n.helpers.license_message)):v)),m(o.Checkbox,{title:__("Beta versions"),label:__("Enable updates for beta versions"),checked:n.betas,onChange:function(e){return c({betas:e})}})),m(o.Section,{title:__("Map Settings")},m(o.Checkboxes,{title:__("Post types"),values:n.postTypes,options:P(n.helpers.post_types),onChange:function(e){return c({postTypes:e})}}),m(o.Radios,{title:__("Automatic display"),options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:n.autodisplay,onChange:function(e){return c({autodisplay:e})}}),m(o.Radios,{title:__("Map alignment"),options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:n.alignment,onChange:function(e){return c({alignment:e})}}),m(o.Radios,{title:__("Directions"),checked:n.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:function(e){return c({directions:e})}}),m(o.Checkbox,{title:__("POI list"),checked:n.poiList,label:__("Show a list of POIs with each map"),onChange:function(e){return c({poiList:e})}}),mappl10n.options.pro&&m(o.Radios,{title:__("POI list layout"),checked:n.layout,options:[{value:"left",label:"Left of map"},{value:"inline",label:__("Below map")}],onChange:function(e){return c({layout:e})}}),m(o.Input,{title:__("Mini width"),value:n.mini,onChange:function(e){return c({mini:e})},size:3,label:__("Width (px) to hide the POI list")}),m(o.Checkbox,{title:__("Sort"),checked:n.sort,label:__("Sort POI list by title"),onChange:function(e){return c({sort:e})}})),m(o.Section,{title:__("POI Settings")},m(o.Select,{title:__("Default zoom"),label:__("Default zoom when displaying a single POI"),value:n.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],(function(e){return{value:e,label:e}})),onChange:function(e){return c({poiZoom:e})}}),m(o.Checkbox,{title:__("Hover"),checked:n.tooltips,label:__("Open POIs on hover"),onChange:function(e){return c({tooltips:e})}}),m(o.Checkbox,{title:__("Open first POI"),checked:n.initialOpenInfo,onChange:function(e){return c({initialOpenInfo:e})},label:__("Open first POI")}),m(o.Checkbox,{title:__("Clustering"),checked:n.clustering,label:__("Enable marker clustering"),onChange:function(e){return c({clustering:e})}})),mappl10n.options.pro&&m(o.Section,{title:__("Mashups")},m(o.Checkbox,{title:__("Search"),checked:n.search,label:__("Enable search"),onChange:function(e){return c({search:e})}}),m(o.Select,{title:__("Filter"),value:n.filter,options:P(n.helpers.taxonomies),onChange:function(e){return c({filter:e})},placeholder:""}),m(o.Radios,{title:__("Marker click"),checked:n.mashupClick,options:[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}],onChange:function(e){return c({mashupClick:e})}}),m(o.Radios,{title:__("Popup content"),checked:n.mashupBody,options:[{value:"poi",label:__("POI title + POI body")},{value:"post",label:__("Post title + post excerpt")}],onChange:function(e){return updatestate({mashupBody:mashupBody,val:e})}}),m(o.Checkbox,{title:__("KMLs"),checked:n.mashupKml,label:__("Include KML POIs in mashups"),onChange:function(e){return c({mashupKml:e})}})),mappl10n.options.pro&&m(o.Section,{title:__("Icons")},m(o.Option,{title:__("Default icon")},m(a.MappIconPicker,{iconid:n.defaultIcon,onChange:function(e){mappl10n.options.defaultIcon=e,c({defaultIcon:e})}})),m(o.Option,{title:__("Icon directory")},m("code",null,n.helpers.icon_directory)),m(o.Option,{title:__("Highlight selected POI")},m(o.Radios,{checked:n.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:function(e){return c({highlight:e})}}),"icon"==n.highlight&&m(a.MappIconPicker,{defaultIcon:n.defaultIcon,iconid:n.highlightIcon,onChange:function(e){return c({highlightIcon:e})}})),(d=n.iconScale&&Array.isArray(n.iconScale)?r(n.iconScale):[0,0],m(o.Option,{title:__("Icon scaling")},m(o.Input,{value:d[0]?d[0]:"",onChange:function(e){e<=64&&(d[0]=e,c({iconScale:d}))},type:"number",min:0,max:64}),m("span",null," X "),m(o.Input,{value:d[1]?d[1]:"",onChange:function(e){e<=64&&(d[1]=e,c({iconScale:d}))},type:"number",min:0,max:64}),m("span",null," (px) "))),function(){var e=P(n.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});var t=y((function(e){if("post_type"==n.autoicons.key)return P(n.helpers.post_types);var t=wp.data.select("core").getEntityRecords("taxonomy",n.autoicons.key,{per_page:-1,_fields:"id,name"});return t?t.map((function(e){return{value:e.id,label:e.name}})):null}),[n.autoicons.key]);return m(o.Option,{title:__("Automatic icons")},m(o.Select,{value:n.autoicons?n.autoicons.key:null,options:e,onChange:function(e){var t=n.autoicons?l({},n.autoicons):[];t.key=e,t.values=[],c({autoicons:t})},placeholder:""}),m(o.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:t},{id:"value",label:__("Icon"),type:"icon"}],data:n.autoicons.values,onChange:function(e){var t=n.autoicons?l({},n.autoicons):[];t.values=e,c({autoicons:t})}}))}()),mappl10n.options.pro&&m(o.Section,{title:__("Styled Maps")},"leaflet"==n.engine&&m(o.Option,{title:__("Styled maps")},m("div",null,__("Enter styles from Mapbox Studio"),m(k,{href:"https://www.mapbox.com/mapbox-studio/"})),m(o.MappGrid,{cols:[{id:"key",label:__("Style name"),size:10},{id:"value",label:__("MapBox Share URL")}],data:n.mapboxStyles,onChange:function(e,t){return c({mapboxStyles:e,style:t})},selectionColumn:"key",selectionType:"checkbox",selected:n.style})),"google"==n.engine&&m(o.Option,{title:__("Styled maps")},m("div",null,__("Enter styles from Snazzy Maps"),m(k,{href:"https://snazzymaps.com/explore"})),m(o.MappGrid,{cols:[{id:"key",label:__("Style name"),size:10},{id:"value",label:__("JSON"),type:"textarea"}],data:n.styles,className:"mapp-grid-styles",onChange:function(e,t){return c({styles:e,style:t})},selectionColumn:"key",selectionType:"checkbox",selected:n.style}))),mappl10n.options.pro&&m(o.Section,{title:__("Geocoding")},m(o.Option,{title:__("Geocoding fields")},m(o.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:P(n.helpers.meta_fields)},{id:"value",label:__("Custom field"),type:"select",options:P(n.helpers.meta_keys)}],data:n.metaKeys,onChange:function(e){return c({metaKeys:e})}})),m(o.Checkbox,{title:__("Overwrite"),label:__("Overwrite maps when posts are saved"),checked:n.metaSyncSave,onChange:function(e){c({metaSyncSave:e})}}),(u=__("No errors found"),n.helpers.geocoding_errors&&n.helpers.geocoding_errors.length>0&&(u=_.map(n.helpers.geocoding_errors,(function(e){return m("div",{key:e.ID},m("a",{href:mappl10n.options.editurl+"?post="+e.ID+"&action=edit"},e.post_title),m("span",null," : "+e.error))}))),m(o.Option,{title:__("Geocoding errors")},u)),"google"==n.engine&&m(o.Input,{title:__("Google Server API key"),name:"apiKeyServer",value:n.apiKeyServer,onChange:function(e){return c({apiKeyServer:e})},size:50,help:{text:__("Key secured by IP address for geocoding custom fields (optional)"),href:"https://mappresspro.com/mappress-faq"}})),mappl10n.options.pro&&m(o.Section,{title:__("Templates")},m(o.Option,{title:__("Custom templates")},m(o.MappTemplateEditor)),m(o.Checkbox,{title:__("Mashup thumbnails"),checked:n.thumbs,label:__("Show featured image thumbnails in mashup popups and lists"),onChange:function(e){return c({thumbs:e})}}),m(o.Option,{title:__("Thumbnail size")},m(o.Select,{onChange:function(e){return c({thumbSize:e})},options:P(n.helpers.thumbnail_sizes),value:n.thumbSize}),m("span",null," "+__("or")+" "),m(o.Input,{value:n.thumbWidth,onChange:function(e){return c({thumbWidth:e})},type:"number",min:0,max:9999}),m("span",null," X "),m(o.Input,{value:n.thumbHeight,onChange:function(e){return c({thumbHeight:e})},type:"number",min:0,max:9999}),m("span",null," (px) "))),m(o.Section,{title:__("Localization")},(s="leaflet"==n.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport",m(o.Select,{title:__("Search language"),value:n.language,options:P(n.helpers.languages),onChange:function(e){return c({language:e})},help:{text:__("Language for searches and Google map controls"),href:s}})),m(o.Select,{title:__("Search country"),label:__("Country code for searches"),value:n.country,options:_.map(["","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","VI","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW"],(function(e){return{value:e,label:e}})),onChange:function(e){return c({country:e})},help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}}),m(o.Input,{title:__("Directions server"),value:n.directionsServer,onChange:function(e){return c({directionsServer:directionsServer,val:e})},size:25})),m(o.Section,{title:__("Miscellaneous")},m(o.Option,{title:__("Map sizes")},m(o.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:n.sizes,onChange:function(e,t){return c({sizes:e,size:t})},selectionColumn:"rowid",selected:n.size})),n.helpers.jetpack?null:m(o.Checkbox,{title:__("Scripts"),checked:n.footer,label:__("Output scripts in footer"),onChange:function(e){return c({footer:e})},help:{text:__("Disable footer scripts if maps are output using AJAX")}}),m(o.Checkbox,{title:"WPML",checked:n.wpml,label:__("Copy maps when overwriting a translation"),onChange:function(e){return c({wpml:e})},help:{href:"https://mappresspro.com/mappress-documentation#wpml"}}),"google"==n.engine&&m(o.Checkbox,{title:__("Compatiblity"),checked:n.deregister,label:__("Prevent other plugins/themes from loading the Google Maps API"),onChange:function(e){return c({deregister:e})}})),m("div",{className:"mapp-options-toolbar"},m(w,{className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),m(w,{isSecondary:!0,onClick:function(){return j("reset")}},__("Reset Defaults")))))}document.getElementById("mapp-options-settings")&&wp.element.render(m(C),document.getElementById("mapp-options-settings"))},824:function(e,t,n){"use strict";n.r(t),n.d(t,{Checkbox:function(){return C},Checkboxes:function(){return S},Help:function(){return P},Input:function(){return j},Radios:function(){return I},Select:function(){return N},Textarea:function(){return A},Section:function(){return E},Option:function(){return x},MappGrid:function(){return D},MappTemplateEditor:function(){return T}});var o=n(143);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(null==e)return{};var n,o,a=function(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var m=wp.element.createElement,d=wp.element,f=d.Fragment,h=d.useEffect,g=(d.useLayoutEffect,d.useCallback),b=(d.useRef,d.useState),y=(wp.data.useSelect,wp.components),v=y.Button,w=(y.ColorPicker,y.Dashicon),O=(y.Dropdown,y.ExternalLink,y.Modal),k=(y.Panel,y.PanelBody,y.PanelRow,y.Popover,y.RadioControl,y.Spinner,y.TabPanel),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function C(e){var t=e.title,n=e.label,o=e.onChange,a=e.help,r=u(e,["title","label","onChange","help"]),i=m(f,null,m("label",null,m("input",p({type:"checkbox",onChange:function(e){o&&o(e.target.checked)}},r)),n&&m("span",{className:"mapp-option-label"},n)),a&&m(P,a));return t?m(x,{title:t},i):i}function S(e){var t=m(f,null,_.map(e.options,(function(t,n){var o=e.values?e.values.indexOf(t.value):-1;return m(C,{key:n,label:t.label,value:t.value,checked:o>=0,onChange:function(n){var a=r(e.values);n&&-1==o&&e.onChange(a.concat(t.value)),!n&&o>=0&&(a.splice(o,1),e.onChange(a))}})})),e.help&&m(P,e.help));return e.title?m(x,{title:e.title},t):t}function P(e){var t=null;return e.href&&(t="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),m(f,null,t&&m("a",{className:"mapp-help-link",href:t,target:"_blank"},m(w,{icon:"editor-help"})),e.text&&m("div",{className:"mapp-help-text"},e.text))}function j(e){var t=e.title,n=e.value,o=e.label,a=e.onChange,r=e.help,i=e.type,l=u(e,["title","value","label","onChange","help","type"]);if(!a)return"Missing onChange handler in Input component";var c=m(f,null,m("input",p({value:null!==n?n:"",onChange:function(e){return a(e.target.value.trim())},type:i||"text"},l)),o&&m("span",{className:"mapp-option-label"},o),r&&m(P,r));return t?m(x,{title:t},c):c}var M=function(e){var t=e.onChange,n=e.label,o=u(e,["onChange","label"]);return m("label",null,m("input",p({type:"radio",onChange:function(e){return t(e.target.value)}},o)),n&&m("span",{className:"mapp-option-label"},n))};function I(e){var t=m(f,null,_.map(e.options,(function(t,n){return m(M,{key:n,value:t.value,checked:e.checked==t.value,onChange:function(t){return e.onChange(t)},disabled:t.disabled,label:t.label})})),e.help&&m(P,e.help));return e.title?m(x,{title:e.title},t):t}function N(e){var t=e.title,n=e.value,o=e.label,a=e.onChange,r=e.options,i=e.help,l=e.placeholder,c=u(e,["title","value","label","onChange","options","help","placeholder"]);void 0!==l&&r.unshift({value:"",label:l});var s=m(f,null,m("select",p({value:null!==n?n:"",onChange:function(e){return a(e.target.value)}},c),_.map(r,(function(e,t){return m("option",{key:t,value:e.value},e.label)}))),o&&m("span",{className:"mapp-option-label"},o),i&&m(P,i));return t?m(x,{title:t},s):s}function A(e){var t=e.title,n=e.onChange,o=e.label,a=e.help,r=u(e,["title","onChange","label","help"]),i=m(f,null,m("textarea",p({onChange:function(e){return n(e.target.value)}},r)),o&&m("span",{className:"mapp-option-label"},o),a&&m(P,a));return t?m(x,{title:t},i):i}function E(e){var t=e.className?" "+e.className:"";return m("div",{className:"mapp-option-section"+t},m("h2",null,e.title),e.children)}function x(e){return m("div",{className:"mapp-option"},m("div",{className:"mapp-option-title"},e.title),m("div",{className:"mapp-option-value"},e.children))}function D(e){var t,n,i=a(b({dragging:null,dragover:null}),2),l=i[0],c=i[1];function s(e){c((function(t){return p(p({},t),e)}))}function u(t,n){var o=r(e.data);switch(t){case"add":var a={};_.map(e.cols,(function(e){a[e.id]=""})),o.push(a),e.onChange(o,e.selected);break;case"change":o[n.i][n.id]=n.value,e.onChange(o,e.selected);break;case"delete":var i;o.splice(n,1),i=n==e.selected?null:n<e.selected?e.selected-1:e.selected,e.onChange(o,i);break;case"select":s({selected:n}),e.onChange(o,n);break;case"sort":var c=l.dragging,p=c<p?n-1:n;o.splice(p,0,o.splice(c,1)[0]),e.onChange(o,p),s({dragover:null})}}return h((function(){}),[]),m("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&m("div",{className:"mapp-grid-table"},(t=e.selectionColumn?m("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,n=m("div",{className:"mapp-grid-cell",key:"actions"},""),m("div",{className:"mapp-grid-header"},m("div",{className:"mapp-grid-row"},t,_.map(e.cols,(function(e){return m("div",{className:"mapp-grid-cell",key:e.id},e.label)})),n))),m("div",{className:"mapp-grid-body"},_.map(e.data,(function(t,n){return function(t,n){return m("div",{className:"mapp-grid-row"+(l.dragover==n?" mapp-dragover":""),draggable:!0,key:n,onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return s({dragging:n})},onDragEnter:function(e){return s({dragover:n})},onDragEnd:function(e){return s({dragging:null,dragover:null})},onDrop:function(e){return u("sort",n)}},function(t,n){if(!e.selectionColumn)return null;var o,a;switch("rowid"==e.selectionColumn?o=n:t[e.selectionColumn]?o=t[e.selectionColumn]:a=!0,e.selectionType){case"checkbox":return m("div",{className:"mapp-grid-cell"},m(C,{value:o,checked:e.selected==o,disabled:a,onChange:function(e){u("select",e?o:null)}}));case"radio":default:return m("div",{className:"mapp-grid-cell"},m(M,{checked:e.selected==o,onChange:function(){return u("select",o)}}))}}(t,n),_.map(e.cols,(function(t,a){return m("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:n+"-"+a},function(t,n){switch(n.type){case"icon":return m(o.MappIconPicker,{iconid:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"input":default:return m(j,{key:t+"-"+n.id,size:e.data[t][n.size],value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"select":return m(N,{key:t+"-"+n.id,value:e.data[t][n.id],options:n.options,onChange:function(e){u("change",{i:t,id:n.id,value:e})}});case"textarea":return m(A,{className:"mapp-option-expando",value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}})}}(n,t))})),function(e){return m("div",{className:"mapp-grid-cell",key:"delete"},m(v,{icon:"trash",onClick:function(){return u("delete",e)}}))}(n))}(t,n)})))),m("div",{className:"mapp-grid-toolbar"},m(v,{isSecondary:!0,onClick:function(){return u("add")}},__("Add"))))}function T(e){var t=a(b({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null}),2),n=t[0],o=t[1];function r(e){o((function(t){return p(p({},t),e)}))}var i,l,c=g((function(e){if(null!=e){var t=wp.codeEditor.initialize(e);t.codemirror.setSize("auto","auto"),t.codemirror.setOption("readOnly","editor"!=n.tab),r({codeEditor:t})}}),[]);function s(e,t){switch(e){case"close":r({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&(mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_delete",name:n.template.name,nonce:mappl10n.options.nonce}}),r({isOpen:!1}));break;case"insert":var o=n.codeEditor.codemirror.getDoc(),a=o.getCursor();o.replaceRange("{{{poi."+t+"}}}",a);break;case"open":mapp.lib.ajax({type:"GET",data:{action:"mapp_tpl_get",name:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!0,name:t,tab:"editor",template:e.data.template,tokens:e.data.tokens})}});break;case"save":var i="editor"==n.tab?n.codeEditor.codemirror.getValue():n.template.content;mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_save",content:i,name:n.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!1,template:null,tokens:null})}});break;case"tab-select":if("editor"!=t){var l=p({},n.template);l.content=n.codeEditor.codemirror.getValue(),r({template:l})}r({tab:t})}}return m("div",{className:"mapp-templates"},(l=[{name:"map-popup",label:__("Map popup")},{name:"map-item",label:__("Map list item")},{name:"mashup-popup",label:__("Mashup popup")},{name:"mashup-item",label:__("Mashup list item")}],m("div",{className:"mapp-templates-list"},_.map(l,(function(e,t){return m("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:function(t){t.preventDefault(),s("open",e.name)}},e.label)})))),n.isOpen&&n.template?m(O,{title:(i=n.template.name+" ("+(n.template.exists?__("Custom"):__("New"))+")",m("div",{className:"mapp-templates-name"},i)),className:"mapp-templates-modal",onRequestClose:function(){return s("close")},shouldCloseOnClickOutside:!1},m(k,{className:"mapp-templates-tabs",onSelect:function(e){return s("tab-select",e)},tabs:[{name:"editor",title:__("Editor")},{name:"standard",title:__("Default")}]},(function(e){return t=m("div",{className:"mapp-templates-tokens"},_.map(n.tokens,(function(e,t){return m("code",{onClick:function(){return s("insert",e)},key:t,title:e},e)}))),o=m("div",{className:"mapp-templates-path"},n.template.path),m(f,null,"editor"==n.tab&&o,"editor"==n.tab&&t,m("div",{className:"editor"==n.tab?"mapp-templates-editor":"mapp-templates-standard"},m("textarea",{ref:c,defaultValue:"editor"==n.tab?n.template.content:n.template.standard})));var t,o})),m("div",{className:"mapp-templates-toolbar"},m(v,{isPrimary:!0,onClick:function(){return s("save")}},__("Save")),m(v,{isSecondary:!0,onClick:function(){return s("close")}},__("Cancel")),n.template.exists&&m("a",{onClick:function(e){e.preventDefault(),s("delete")}},__("Delete")))):null)}},966:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var o=n(713),a=n(999),r=wp.element.createElement,i=(wp.data.select,wp.element),l=(i.Fragment,i.useEffect,i.useLayoutEffect,i.useRef,i.useState,wp.components),c=(l.BaseControl,l.Button),sprintf=(l.Dashicon,l.Modal,l.PanelBody,l.RadioControl,l.Spinner,l.TextControl,wp.i18n.sprintf);function p(e){function t(t,n){var o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.onChange(e.page+1);break;case"prev":e.onChange(e.page-1)}}return o=Math.ceil(e.count/e.pageSize),a=e.page<=1,i=e.page>=o,r("div",{className:"mapp-paginate"},r(c,{disabled:a,onClick:function(){return t("first")},isSecondary:!0},"«"),r(c,{disabled:a,onClick:function(){return t("prev")},isSecondary:!0},"‹"),r("div",{className:"mapp-paginate-count"},sprintf((n="%d of %d",wp.i18n.__(n,"mappress-google-maps-for-wordpress")),e.page,o)),r(c,{disabled:i,onClick:function(){return t("next")},isSecondary:!0},"›"),r(c,{disabled:i,onClick:function(){return t("last")},isSecondary:!0},"»"));var n,o,a,i}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var h=window.mapp||{},g=wp.element.createElement,b=wp.data.select,y=wp.element,v=(y.Fragment,y.useEffect),w=(y.useLayoutEffect,y.useRef),O=y.useState,k=wp.components,C=(k.BaseControl,k.Button),S=k.Dashicon,P=k.Modal,j=(k.PanelBody,k.RadioControl),M=k.Spinner,I=k.TextControl,N=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function A(e){var t=d(O({isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:"",type:mappl10n.options.postid?"post":"all"}),2),n=t[0],r=t[1],i=w(null),l=w(null);function c(e){r((function(t){return u(u({},t),e)}))}function s(t,o){switch(t){case"attach":h.store.mutateMap({mapdata:o});break;case"add-new":c({mode:"edit",mapid:null});break;case"change-type":c({type:o});break;case"close":e.onAction("pick-close");break;case"duplicate":h.store.duplicateMap({mapid:o,success:function(e){alert(N("Map copied")),c({mapid:e.mapid}),jQuery(".mapp-pick-items").scrollTop(0)}});break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(h.store.destroyMap({mapid:o}),o==n.mapid&&e.onAction("pick-destroy",o)),i.current.focus();break;case"edit":c({mode:"edit",mapid:o});break;case"edit-close":"edit"==e.mode?e.onAction("pick-close"):c({mode:"list"});break;case"edit-destroy":c({mode:"list",mapid:null}),e.onAction("pick-destroy",o);break;case"edit-save":"edit"==e.mode?e.onAction("pick-close",o):c({mode:"list",mapid:o});break;case"insert":e.onAction("pick-insert",o);break;case"shortcode":e.onAction("pick-shortcode",o);break;case"sort":h.store.setSort({sortBy:o,sortAsc:h.store.state.sortBy!=o||!h.store.state.sortAsc})}}function m(t){var a,r=t.mapid==n.mapid;a=t.map_title?t.map_title:N("Untitled");var i=function(t){var n;return n=(n="map"==e.context||"mashup"==e.context&&t.postid==mappl10n.options.postid?b("core/editor").getEditedPostAttribute("title"):t.post_title)||N("Untitled"),t.postid>0&&t.postid==mappl10n.options.postid&&(n=N("Current post")),t.postid>0?t.postid==mappl10n.options.postid?n:g("a",{href:mappl10n.options.editurl+"?post="+t.postid+"&action=edit",target:"_blank",title:N("Edit post")},n):N("Unattached")}(t),c=[{action:"edit",label:N("Edit")},{action:"insert",label:N("Insert into post")},{action:"duplicate",label:N("Copy")},{action:"shortcode",label:N("Shortcode")},{action:"destroy",label:N("Delete")}];"library"==e.context?c.splice(1,1):c.splice(3,1),c=g("div",{className:"mapp-pick-actions"},c.map((function(e){return g("a",{href:"#",key:e.action,onClick:function(n){n.stopPropagation(),n.preventDefault(),s(e.action,t.mapid)}},e.label)})));var p=null;return p=t.postid>0?g("a",{href:"#",onClick:function(){return s("attach",{mapid:t.mapid,postid:0})}},N("Detach")):"library"==e.context?g(o.default,{onChange:function(e,n){return s("attach",{mapid:t.mapid,postid:e,post_title:n})}},N("Attach")):g("a",{href:"#",onClick:function(){return s("attach",{mapid:t.mapid,postid:mappl10n.options.postid,post_title:null})}},N("Attach")),g("div",{className:"mapp-pick-item"+(r?" mapp-selected":""),key:t.mapid+"|"+t.postid,ref:r?l:null},g("div",{className:"mapp-pick-col-map_title",onClick:function(e){return s("edit",t.mapid)}},g("div",null,a),g("div",null,c)),g("div",{className:"mapp-pick-col-mapid"},t.mapid),g("div",{className:"mapp-pick-col-post_title"},i,g("div",null,p)))}v((function(){var e=function(e){c({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return h.store.subscribe(e),function(){return h.store.unsubscribe(e)}})),v((function(){i.current&&i.current.focus(),h.store.fetchItems()}),[]),v((function(){c({page:1})}),[n.type,n.search]),v((function(){l.current&&h.lib.scrollTo(jQuery(".mapp-pick-items"),jQuery(l.current))}),[n.type,n.items]);var f=_.filter(n.items,(function(t){if("post"==n.type&&t.postid!=mappl10n.options.postid)return!1;if("current"==n.type&&t.mapid!=e.mapid)return!1;var o=n.search.toLowerCase();return!o||(t.mapid.indexOf(o)>=0||(!!(t.post_title&&t.post_title.toLowerCase().indexOf(o)>=0)||!!(t.map_title&&t.map_title.toLowerCase().indexOf(o)>=0)))})),y=g("div",{className:"mapp-list-panel"},g("div",{className:"mapp-gt-modal-header"},g("div",{className:"mapp-gt-modal-header-title"},g("h1",null,N("Select a map")),g(C,{isPrimary:!0,onClick:function(){return s("add-new")}},N("Add New"))),g(C,{onClick:function(){return s("close")},icon:"no-alt"})),function(){var t=[{label:N("Attached to post"),value:"post"},{label:N("All maps"),value:"all"}];e.mapid&&t.unshift({label:N("Current map"),value:"current"});var o="library"==e.context?null:g(j,{className:"mapp-pick-type",options:t,onChange:function(e){return s("change-type",e)},selected:n.type}),a=n.isFetchingItems||n.isAttaching&&"library"!=e.context;return g("div",{className:"mapp-pick-filter"},a&&g(M,null),g(I,{ref:i,className:"mapp-pick-search",tabIndex:1,label:N("Search"),placeholder:N("post title, map title, or map id"),onChange:function(e){return c({search:e})}}),o)}(),function(e){if(e){var t=20*(n.page-1),o=t+20;e=e.slice(t,o)}var a,r="";return r=n.isFetchingItems?null:e.length?_.map(e,m):g("div",{className:"mapp-pick-message"},N("No maps found")),g("div",{className:"mapp-pick-items-section"},g("div",{className:"mapp-pick-items"},(a={map_title:N("Map title"),mapid:N("Map ID"),post_title:N("Attached to")},g("div",{className:"mapp-pick-items-header"},_.map(a,(function(e,t){return g("div",{className:"mapp-pick-col-"+t,onClick:function(){return s("sort",t)},key:t},e,h.store.state.sortBy==t&&g(S,{icon:h.store.state.sortAsc?"arrow-up":"arrow-down"}))})))),r))}(f),function(t){return g("div",{className:"mapp-pick-toolbar"},"library"!=e.context?g(C,{onClick:function(){return s("close")}},N("Cancel")):null,function(e){return e&&e.length?g(p,{count:e?e.length:0,onChange:function(e){return c({page:e})},page:n.page,pageSize:20}):null}(t))}(f)),k=null;if("edit"==n.mode){var A=g("div",{className:"mapp-edit-panel"},g(a.default,{context:e.context,mapid:n.mapid,onAction:s}));k="library"==e.context?g(P,{className:"mapp-gt-modal",isDismissible:!1},A):A}var E="mapp-pick mapp-mode-"+n.mode+" mapp-context-"+e.context;return"library"==e.context?g("div",{className:E},y,k):g(P,{className:"mapp-gt-modal "+E,isDismissible:"list"==n.mode,onRequestClose:function(){return s("close")},shouldCloseOnEsc:"list"==n.mode,shouldCloseOnClickOutside:"list"==n.mode},y,k)}},429:function(e,t,n){"use strict";function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.r(t),n.d(t,{MappSettings:function(){return g}});window.mapp;var r=wp.element.createElement,i=wp.element,l=i.Fragment,c=(i.useEffect,i.useLayoutEffect,i.useRef,i.useState),p=wp.components,s=p.BaseControl,u=p.Button,m=p.ButtonGroup,d=(p.Dashicon,p.Dropdown,p.ExternalLink,p.Panel,p.PanelBody,p.PanelRow),f=(p.RadioControl,p.SelectControl),h=p.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function g(e){var t,n=o(c({}),2);n[0],n[1];function a(e){if(!e||"string"!=typeof e)return e;var t={px:2048,vw:100,vh:100,"%":100},n=parseInt(e),o=2048,a="";for(var r in t)e.includes(r)&&(a=r,o=t[r]);return n>o?o+a:e}function i(t,n){var o=null;switch(t){case"mapTypeId":e.map.set({mapTypeId:n}),o={mapTypeId:n};break;case"poiList":e.map.set({poiList:n}),o={poiList:n};break;case"size":n.hasOwnProperty("height")&&(n.height=a(n.height)),n.hasOwnProperty("width")&&(n.width=a(n.width)),e.map.setSize(n),o=n;break;case"viewport-reset":e.map.center=e.map.zoom=null,e.map.recenter(),o={center:void 0,zoom:void 0};break;case"viewport-set":var r=e.map.getCenter().toJSON();e.map.center=r,e.map.zoom=e.map.getZoom(),o={center:r.lat+","+r.lng,zoom:e.map.getZoom()},"mce"==e.context||"library"==e.context?alert(__("Viewport set")):wp.data.dispatch("core/notices").createNotice("success",__("Viewport set"),{type:"snackbar",isDismissible:!0})}o&&e.onAction("change-settings",o)}return r("div",{className:"mapp-settings"},null,(t=e.map.title?e.map.title:__("Untitled"),r(d,null,"map"==e.context&&r(s,{className:"mapp-settings-title"},t),r(s,{className:"mapp-settings-id",label:__("Map ID")},e.map.mapid))),"mashup"==e.context&&function(){var t=[];if("leaflet"==mappl10n.options.engine)t=mappl10n.options.baseLayers.map((function(e){return{label:e.label,value:e.name}}));else{var n=mappl10n.options.styles?_.keys(mappl10n.options.styles):[];t=["roadmap","satellite","terrain","hybrid"].concat(n).map((function(e){return{label:e.charAt(0).toUpperCase()+e.slice(1),value:e}}))}return t.unshift({label:__("Default"),value:null}),r(f,{className:"mapp-settings-type",help:"",label:__("Map type"),value:e.map.mapTypeId,options:t,onChange:function(e){return i("mapTypeId",e)}})}(),function(){var t=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=mappl10n.options.sizes.map((function(e,t){return{label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1}}));n.unshift({height:"",label:__("Default"),value:0,width:""}),n.push({label:__("Custom"),value:"custom",disabled:!0});for(var o="custom",a=0;a<n.length-1;a++)n[a].width==e.width&&n[a].height==e.height&&(o=a);return r(l,null,r(f,{className:"mapp-settings-dims-select",help:"",label:__("Size"),value:o,options:n,onChange:function(e){return i("size",{width:n[e].width,height:n[e].height})}}),r(d,null,r(h,{className:"mapp-settings-dims-custom",help:__("px, %, vw"),label:__("Width"),onChange:function(e){return i("size",{width:e})},placeholder:t.width,value:e.width?e.width:""}),r(h,{className:"mapp-settings-dims-custom",help:__("px, %, vh"),label:__("Height"),onChange:function(e){return i("size",{height:e})},placeholder:t.height,value:e.height?e.height:""})))}(),(e.center&&(e.center.lat,e.center.lng,__("Zoom"),e.zoom),r(l,null,r(s,{className:"mapp-settings-viewport",label:__("Center/Zoom")},r(m,{label:__("Center/Zoom")},r(u,{onClick:function(){return i("viewport-reset")},isPressed:!e.center,isSmall:!0},__("Automatic")),r(u,{onClick:function(){return i("viewport-set")},isPressed:e.center,isSmall:!0},__("Set")))))))}},787:function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var r=window.mapp||{};r.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"map_title",sortAsc:!0,maps:{},items:[]}},r.Store.prototype={createMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t;this.state.isFetchingMap=!1,this.publish(),n()},destroyMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;r.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(delete l.state.maps[t],l.destroyItem(t),o(t)):i(),l.publish()}})},duplicateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_duplicate",mapid:t,postid:mappl10n.options.postid,nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),o(t)}else i();l.state.isSavingMap=!1,l.publish()}})},fetchMap:function(e){var t=e.mapid,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;if(void 0!==this.state.maps[t])return l.publish(),void o(this.state.maps[t]);this.state.isFetchingMap=!0,l.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[t]=e.data,o(e.data)):i(),l.state.isFetchingMap=!1,l.publish()}})},mutateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;this.state.isSavingMap=!0,this.saveItem(t),this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_mutate",mapdata:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[e.data.mapid]=e.data,o(t)):i(),l.state.isSavingMap=!1,l.publish()}})},saveMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(t),nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),o(t)}else i();l.state.isSavingMap=!1,l.publish()}})},destroyItem:function(e){var t=this.state.items?this.state.items:[],o=_.findIndex(t,{mapid:e});o>-1&&t.splice(o,1),this.state.items=n(t),this.publish()},fetchItems:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t,o=e.failure,a=void 0===o?function(){}:o,i=this;if(this.state.itemsFetched)return n(this.state.items),void i.publish();this.state.isFetchingItems=!0,i.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(i.state.items=e.data,i.sort(),n(i.state.items),i.state.itemsFetched=!0):a(),i.state.isFetchingItems=!1,i.sort(),i.publish()}})},saveItem:function(n){var o=this.state.items?this.state.items:[],a=_.findWhere(o,{mapid:n.mapid});a?(a.mapid=void 0!==n.mapid?n.mapid:a.mapid,a.map_title=void 0!==n.title?n.title:a.map_title,a.postid=void 0!==n.postid?n.postid:a.postid,a.post_title=void 0!==n.post_title?n.post_title:a.post_title,a=function(n){for(var o=1;o<arguments.length;o++){var a=null!=arguments[o]?arguments[o]:{};o%2?e(Object(a),!0).forEach((function(e){t(n,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}))}return n}({},a)):(a={mapid:n.mapid,map_title:n.title,postid:mappl10n.options.postid,post_title:null},o.unshift(a))},setSort:function(e){e.sortBy&&(this.state.sortBy=e.sortBy),void 0!==e.sortAsc&&(this.state.sortAsc=e.sortAsc),this.sort(),this.publish()},sort:function(e,t){var n,o=this,a=(n="untitled",wp.i18n.__(n,"mappress-google-maps-for-wordpress"));this.state.items.sort((function(e,t){return function(e,t,n,o){if(o=o?1:-1,"mapid"==n)return o*(Number(e.mapid)-Number(t.mapid));var r=e[n]?e[n]:a,i=t[n]?t[n]:a,l=o*r.localeCompare(i);return 0==l?Number(e.mapid)-Number(t.mapid):l}(e,t,o.state.sortBy,o.state.sortAsc)}))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(_e){throw _e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){c=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw i}}}}(n(this.subs));try{for(t.s();!(e=t.n()).done;){(0,e.value)(this.state)}}catch(e){t.e(e)}finally{t.f()}}},r.store=new r.Store},308:function(e,t,n){"use strict";e.exports=function(e,t){var o,a,r,i,l,c,p,s,u,m,d,f,h,g=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),b=g.length,y=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},v="undefined"!=typeof window?window:n.g;v.$locutus=v.$locutus||{};var w=v.$locutus;for(w.php=w.php||{},t||(t=v),o=0;o<b&&(u=y((s=g[o].split("="))[0]),m=s.length<2?"":y(s[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));o++){for(;" "===u.charAt(0);)u=u.slice(1);if(u.indexOf("\0")>-1&&(u=u.slice(0,u.indexOf("\0"))),u&&"["!==u.charAt(0)){for(f=[],d=0,a=0;a<u.length;a++)if("["!==u.charAt(a)||d){if("]"===u.charAt(a)&&d&&(f.length||f.push(u.slice(0,d-1)),f.push(u.substr(d,a-d)),d=0,"["!==u.charAt(a+1)))break}else d=a+1;for(f.length||(f=[u]),a=0;a<f[0].length&&(" "!==(p=f[0].charAt(a))&&"."!==p&&"["!==p||(f[0]=f[0].substr(0,a)+"_"+f[0].substr(a+1)),"["!==p);a++);for(c=t,a=0,h=f.length;a<h;a++){if(l=c,(""===(u=f[a].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==a){for(i in r=-1,c)c.hasOwnProperty(i)&&+i>r&&i.match(/^\d+$/g)&&(r=+i);u=r+1}Object(c[u])!==c[u]&&(c[u]={}),c=c[u]}l[u]=m}}}}},t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(787),n(215),n(713),n(525),n(999),n(143),n(800),n(938),n(816),n(378),n(498),n(670),n(218),n(824),n(966),n(429)}();
1
+ (()=>{var e={215:(e,t,n)=>{"use strict";n.r(t);var o=n(525),a=n(143);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s,p=window.mapp||{},c=wp.element.createElement;s=jQuery,p.Editor=function(e){this.drawingManager=null,this.map=e,this.poiEditor=null;var t=this;this.initialize=function(){this.map.display(),this.poiEditor=new p.PoiEditor(this.map),this.initDrawingManager(),s(this.map.places).off("search.mapp"),s(this.map.places).on("search.mapp",(function(e,n){t.insert(n)}))},this.insert=function(e){if(e)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),e.geometry){var n=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,o=e.name==n?"":n,a=new p.Poi({address:n,body:o,iconid:this.poiEditor.lastIcon,point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null});this.map.poiInsert(a),a.center()}else e.overlay?(this.map.poiHover(null),"marker"==e.type?(a=new p.Poi({body:"",iconid:null,overlay:null,point:e.overlay.getPosition().toJSON(),title:e.overlay.getPosition().toUrlValue(6),type:null}),e.overlay.setMap(null)):a=new p.Poi({body:"",iconid:null,overlay:e.overlay,title:mappl10n.shape,type:e.type}),this.map.poiInsert(a)):"string"==typeof e&&"http"==e.substring(0,4)&&(a=new p.Poi({iconid:this.poiEditor.lastIcon,kml:{url:e},title:"KML",type:"kml"}),t.map.poiInsert(a),p.event.addListenerOnce(a.overlay,"ready defaultviewport_changed",(function(){a.center()})))},this.initDrawingManager=function(){var e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};"leaflet"==mappl10n.options.engine||google.maps.drawing&&(this.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),this.drawingManager.setMap(this.map.getMap()),p.event.addListener(this.drawingManager,"overlaycomplete",(function(e){t.drawingManager.get("drawingMode")&&t.insert(e)})))},this.initialize.apply(this)},p.PoiEditor=function(e){this.map=e,this.poi=null,this.sel=null,this.lastIcon=null;var t=this;this.initialize=function(){this.sel=s(this.map.iw.getContent()),s(this.map).on("mapp.open",(function(e,n){t.render(n)})),s(this.map).on("mapp.close",(function(){t.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(e){e.preventDefault();var n=s(this).attr("data-mapp-poi");t[n]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(e){var n=s(this).hasClass("mapp-poi-visual");t.mce(n)})),this.sel.on("keydown",(function(e){13==e.which&&"mapp-poi-body"!=e.target.id&&(e.preventDefault(),t.save())}))},this.cancel=function(){this.map.poiClose()},this.initMCE=function(){if("undefined"!=typeof tinyMCE&&void 0!==tinyMCE.init){var e="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var t=window.tinyMCEPreInit.mceInit.content;e=void 0!==t.language?t.language:"en"}var n={mode:"none",height:"100%",convert_urls:!1,language:e,menubar:!1,plugins:"image,paste,textcolor,wordpress,wpeditimage,wplink,wpview",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(n),this.mce(!0)}},this.mce=function(e){var n=e?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(n,!1,"mapp-poi-body"),s(".mapp-poi-visual, .mapp-poi-html",t.sel).removeClass("mapp-active"),e?s(".mapp-poi-visual",t.sel).addClass("mapp-active"):s(".mapp-poi-html",t.sel).addClass("mapp-active")},this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.poiClose(),this.map.poiRemove(this.poi))},this.render=function(e){this.poi=e,this.renderColorPicker(this.poi),this.renderIconPicker(this.poi),this.initMCE()},this.renderColorPicker=function(e){var t=this;document.getElementById("mapp-poi-colorpicker")&&wp.element.render(c(o.MappColorPicker,i(i({},e.getTemplateColors()),{},{isExtended:!0,onChange:function(n){e.set({dirty:!0}),e.setTemplateColors(n),t.map.renderList(),t.renderColorPicker(e)}})),document.getElementById("mapp-poi-colorpicker"))},this.renderIconPicker=function(e){var t=this;document.getElementById("mapp-poi-iconpicker")&&wp.element.render(c(a.MappIconPicker,{iconid:e.iconid,onChange:function(n){e.set({dirty:!0,iconid:n}),t.lastIcon=n,t.map.renderList(),t.renderIconPicker(e)}}),document.getElementById("mapp-poi-iconpicker"))},this.save=function(){"undefined"!=typeof tinyMCE&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save(),this.poi.set({dirty:!0,title:s(".mapp-poi-title").val(),body:s(".mapp-poi-body").val()}),this.map.renderList(),this.map.poiClose()},this.initialize.apply(this)}},713:(e,t,n)=>{"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.r(t),n.d(t,{default:()=>b});var s=wp.element.createElement,p=wp.url.addQueryArgs,c=wp.element,u=c.useCallback,m=c.useEffect,d=c.useState,f=wp.components,h=(f.Button,f.Dropdown),y=f.Spinner,g=f.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function b(e){var t=i(d({isFetching:!1,results:[],search:"",searchTerm:""}),2),n=t[0],o=t[1];function r(e){o((function(t){return a(a({},t),e)}))}m((function(){n.isOpen&&(r({isFetching:!0}),wp.apiFetch({path:p("/wp/v2/search",{search:n.search,per_page:20})}).then((function(e){r({results:e,isFetching:!1})})))}),[n.search,n.isOpen]);var l=u(_.debounce((function(e){r({search:e})}),1e3),[]);function c(t,o){return s("div",{className:"mapp-attach-control"},s("div",{className:"mapp-attach-control-toolbar"},s(g,{autoComplete:"false",value:n.searchTerm,onChange:function(e){r({searchTerm:e}),l(e)},placeholder:__("Search")})),function(){if(n.isFetching)return s(y,null);if(n.results)return n.results.length?s("div",{className:"mapp-attach-items"},n.results.map((function(t){return s("div",{key:t.id,className:"mapp-attach-item",onClick:function(){e.onChange(t.id,t.title)}},s("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),s("div",{className:"mapp-attach-item-type"},t.type))}))):s("div",{},__("No posts found"))}())}return s("div",{onClick:function(e){return e.stopPropagation()}},s(h,{onToggle:function(e){return r({isOpen:e})},renderToggle:function(e){e.isOpen;var t=e.onToggle;return s("a",{href:"#",onClick:t},__("Attach"))},renderContent:function(e){e.isOpen,e.onToggle;return c()}}))}},525:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappColorPicker:()=>b});var o=n(824);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=c.useEffect,d=(c.useLayoutEffect,c.useCallback,c.useRef,c.useState),f=(wp.data.useSelect,wp.compose.withState,wp.components),h=f.Button,y=(f.ColorPalette,f.ColorPicker),g=(f.Dashicon,f.Dropdown,f.ExternalLink,f.Modal),__=(f.Panel,f.PanelBody,f.PanelRow,f.Popover,f.RadioControl,f.Spinner,f.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function b(e){var t=l(d({isCustomOpen:!1,isOpen:!1}),2),n=t[0],a=t[1];function i(e){a((function(t){return r(r({},t),e)}))}function s(t,n){switch(t){case"close":i({isOpen:!1});break;case"open":i({isOpen:!0});break;case"select":e.onChange(n),s("close");break;case"set":e.onChange(n)}}return m((function(){}),[]),p(u,null,p("span",{className:"mapp-colors-toggle",onClick:function(){return s("open",null)},style:{backgroundColor:e.color,border:e.isExtended?"1px solid "+e.color:"1px solid gray",opacity:e.isExtended&&e.opacity?e.opacity/100:1},tabIndex:0}),function(){if(!n.isOpen)return null;var t=_.map([100,90,80,70,60,50,40,30,20,10,0],(function(e){return{label:e+"%",value:e}})),a=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(function(e){return{label:e+"px",value:e}}));return p(g,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:function(e){return s("close")}},p("div",{className:"mapp-colors"},p("div",{className:"mapp-colors-list"},_.map([["yellow","yellowgreen","green","seagreen","blue","cornflowerblue","darkslateblue","purple","firebrick","red","darkorange","orange","saddlebrown"],["lightyellow","greenyellow","lightgreen","darkseagreen","lightblue","skyblue","slateblue","orchid","plum","pink","sandybrown","goldenrod","peru"],["white","lightgray","gray","black"]],(function(t,n){return p("div",{key:n},_.map(t,(function(t){return p("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:function(){i({isCustomOpen:!1}),s("select",{color:t})},style:{backgroundColor:t},title:t})})))}))),n.isCustomOpen&&p(y,{color:e.color,onChangeComplete:function(e){return s("set",{color:e.hex})},disableAlpha:!0}),e.isExtended&&p(o.Select,{label:__("Opacity"),options:t,value:e.opacity?e.opacity:"",onChange:function(e){return s("set",{opacity:e})}}),e.isExtended&&p(o.Select,{label:__("Stroke"),options:a,value:e.weight?e.weight:"",onChange:function(e){return s("set",{weight:e})}}),p("div",{className:"mapp-colors-toolbar"},p(h,{isPrimary:!0,onClick:function(){return s("close")}},__("Done")),p(h,{onClick:function(){return i({isCustomOpen:!n.isCustomOpen})}},__("Custom color")))))}())}},999:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var o=n(429),a=n(710);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var c=window.mapp||{},u=wp.element.createElement,m=wp.element,d=(m.Fragment,m.useEffect),f=(m.useLayoutEffect,m.useRef),h=m.useState,y=wp.components,g=y.Button,b=(y.Dropdown,y.Modal,y.Panel,y.PanelBody,y.Popover,y.Spinner,y.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n,r=s(h({dragging:null,dragover:null,isFetchingMap:!!e.mapid,isPoiListOpen:!0,isSavingMap:!1,map:null,mapdata:null}),2),l=r[0],p=r[1],m=f(null);function y(e){p((function(t){return i(i({},t),e)}))}function v(e){y({map:l.map})}function w(t,n){switch(t){case"change-settings":l.map.set(n),y({map:l.map});break;case"change-title":l.map.set({dirty:!0,title:n}),y({map:l.map});break;case"close":e.onAction("edit-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(c.store.destroyMap({mapid:e.mapid}),e.onAction("edit-destroy"));break;case"save":c.store.saveMap({mapdata:l.map.toJSON(),success:function(t){l.map.set({dirty:!1}),e.onAction("edit-save",t.mapid)}})}}return d((function(){l.map&&(jQuery(l.map.div.list).off("render",v),jQuery(l.map.div.list).on("render",(function(e){return v()})))}),[l.map]),d((function(){var t=function(t){y({isFetchingMap:t.isFetchingMap,isSavingMap:t.isSavingMap,mapdata:t.maps[e.mapid]})};return c.store.subscribe(t),function(){return c.store.unsubscribe(t)}})),d((function(){e.mapid&&c.store.fetchMap({mapid:e.mapid})}),[e.mapid]),d((function(){if(!l.isFetchingMap){var t={editable:!0,embed:!0,layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!1,sel:jQuery(m.current)};"map"!=e.context&&"mashup"!=e.context||(t.center=null,t.zoom=null);var n=new c.Map(l.mapdata,t);new c.Editor(n);y({map:n})}}),[l.mapdata]),d((function(){l.map&&setTimeout((function(){return l.map.resize()}),100)}),[l.isPoiListOpen]),u("div",{className:"mapp-edit"},(t=l.map&&!l.isFetchingMap&&l.map.title?l.map.title:"",n=l.map&&!l.isFetchingMap?__("Untitled"):"",u("div",{className:"mapp-gt-modal-header"},u(b,{className:"mapp-edit-title",placeholder:n,value:t,onChange:function(e){return w("change-title",e)}}))),u("div",{className:"mapp-edit-main"},u("div",{className:"mapp-list mapp-edit-list"+(l.isPoiListOpen?" mapp-list-open":"")},u("div",{className:"mapp-edit-list-wrapper"},function(){if("mce"!=e.context&&"library"!=e.context)return null;if(!l.map)return null;var t=l.map,n=t.center,a=t.height,r=t.poiList,i=t.width,s=t.zoom;return u("div",{className:"mapp-gt-inspector"},u(o.MappSettings,{map:l.map,context:e.context,onAction:w,center:n,height:a,poiList:r,width:i,zoom:s}))}(),function(){if(l.map){var e=function(e,t){var n=l.dragging,o=n<o?t-1:t;l.map.pois_.splice(o,0,l.map.pois_.splice(n,1)[0]),y({map:l.map,dragover:null})};return u("div",{className:"mapp-items"},_.map(l.map.pois_,(function(t,n){return u("div",{className:l.dragover==n?"mapp-item mapp-edit-dragover":"mapp-item",draggable:!0,key:n,onClick:function(){return l.map.poiOpen(l.map.pois_[n])},onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return y({dragging:n})},onDragEnter:function(e){return y({dragover:n})},onDragEnd:function(e){return y({dragging:null,dragover:null})},onDrop:function(t){return e(t,n)}},u("img",{className:"mapp-icon",src:c.Icons.getUrl(t.iconid)}),u("div",{className:"mapp-title"},t.title))})))}}()),u("div",{className:"mapp-list-toggle",onClick:function(){return y({isPoiListOpen:!l.isPoiListOpen})}})),u("div",{className:"mapp-edit-map",key:e.mapid,ref:m,onKeyDown:function(e){return e.stopPropagation()},tabIndex:-1}),m.current&&l.map?u(a.m,{map:l.map,selected:l.map.mapTypeId,onChange:function(e){return w("change-settings",{mapTypeId:e})}}):null),u("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:function(e){return e.stopPropagation()}},u(g,{isPrimary:!0,isBusy:l.isSavingMap,onClick:function(){return w("save")}},__("Save")),u(g,{disabled:l.isSavingMap,onClick:function(){return w("close")}},__("Cancel")),u(g,{disabled:!e.mapid||l.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:function(){return w("destroy")}},__("Delete"))))}},143:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappIconPicker:()=>w});var o=n(525),a=n(824);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var c=wp.element.createElement,u=wp.element,m=u.Fragment,d=u.useEffect,f=(u.useLayoutEffect,u.useCallback,u.useRef,u.useState),h=(wp.data.useSelect,wp.compose.withState,wp.components),y=h.Button,g=(h.ColorPicker,h.DropZone,h.DropZoneProvider,h.FormFileUpload),b=h.Modal,__=(h.Popover,h.Spinner,h.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")}),v={"fa-regular-400":{label:"Font Awesome Regular",glyphs:[{name:"address-book",codepoint:""}]},"mapp-icons":{label:"Map icons",glyphs:[{name:"abseiling",codepoint:59392},{name:"accounting",codepoint:59393},{name:"airport",codepoint:59394},{name:"amusement-park",codepoint:59395},{name:"aquarium",codepoint:59396},{name:"archery",codepoint:59397},{name:"art-gallery",codepoint:59398},{name:"assistive-listening-system",codepoint:59399},{name:"atm",codepoint:59400},{name:"audio-description",codepoint:59401},{name:"bakery",codepoint:59402},{name:"bank",codepoint:59403},{name:"bar",codepoint:59404},{name:"baseball",codepoint:59405},{name:"beauty-salon",codepoint:59406},{name:"bicycle-store",codepoint:59407},{name:"bicycling",codepoint:59408},{name:"boat-ramp",codepoint:59409},{name:"boat-tour",codepoint:59410},{name:"boating",codepoint:59411},{name:"book-store",codepoint:59412},{name:"bowling-alley",codepoint:59413},{name:"braille",codepoint:59414},{name:"bus-station",codepoint:59415},{name:"cafe",codepoint:59416},{name:"campground",codepoint:59417},{name:"canoe",codepoint:59418},{name:"car-dealer",codepoint:59419},{name:"car-rental",codepoint:59420},{name:"car-repair",codepoint:59421},{name:"car-wash",codepoint:59422},{name:"casino",codepoint:59423},{name:"cemetery",codepoint:59424},{name:"chairlift",codepoint:59425},{name:"church",codepoint:59426},{name:"skip",codepoint:59427},{name:"city-hall",codepoint:59428},{name:"climbing",codepoint:59429},{name:"closed-captioning",codepoint:59430},{name:"clothing-store",codepoint:59431},{name:"compass",codepoint:59432},{name:"convenience-store",codepoint:59433},{name:"courthouse",codepoint:59434},{name:"cross-country-skiing",codepoint:59435},{name:"crosshairs",codepoint:59436},{name:"dentist",codepoint:59437},{name:"department-store",codepoint:59438},{name:"diving",codepoint:59439},{name:"doctor",codepoint:59440},{name:"electrician",codepoint:59441},{name:"electronics-store",codepoint:59442},{name:"embassy",codepoint:59443},{name:"expand",codepoint:59444},{name:"female",codepoint:59445},{name:"finance",codepoint:59446},{name:"fire-station",codepoint:59447},{name:"fish-cleaning",codepoint:59448},{name:"fishing-pier",codepoint:59449},{name:"fishing",codepoint:59450},{name:"florist",codepoint:59451},{name:"food",codepoint:59452},{name:"fullscreen",codepoint:59453},{name:"funeral-home",codepoint:59454},{name:"furniture-store",codepoint:59455},{name:"gas-station",codepoint:59456},{name:"general-contractor",codepoint:59457},{name:"golf",codepoint:59458},{name:"grocery-or-supermarket",codepoint:59459},{name:"gym",codepoint:59460},{name:"hair-care",codepoint:59461},{name:"hang-gliding",codepoint:59462},{name:"hardware-store",codepoint:59463},{name:"health",codepoint:59464},{name:"hindu-temple",codepoint:59465},{name:"horse-riding",codepoint:59466},{name:"hospital",codepoint:59467},{name:"ice-fishing",codepoint:59468},{name:"ice-skating",codepoint:59469},{name:"inline-skating",codepoint:59470},{name:"insurance-agency",codepoint:59471},{name:"jet-skiing",codepoint:59472},{name:"jewelry-store",codepoint:59473},{name:"kayaking",codepoint:59474},{name:"laundry",codepoint:59475},{name:"lawyer",codepoint:59476},{name:"library",codepoint:59477},{name:"liquor-store",codepoint:59478},{name:"local-government",codepoint:59479},{name:"location-arrow",codepoint:59480},{name:"locksmith",codepoint:59481},{name:"lodging",codepoint:59482},{name:"low-vision-access",codepoint:59483},{name:"male",codepoint:59484},{name:"skip",codepoint:59485},{name:"marina",codepoint:59486},{name:"mosque",codepoint:59487},{name:"motobike-trail",codepoint:59488},{name:"movie-rental",codepoint:59489},{name:"movie-theater",codepoint:59490},{name:"moving-company",codepoint:59491},{name:"museum",codepoint:59492},{name:"natural-feature",codepoint:59493},{name:"night-club",codepoint:59494},{name:"open-captioning",codepoint:59495},{name:"painter",codepoint:59496},{name:"park",codepoint:59497},{name:"parking",codepoint:59498},{name:"pet-store",codepoint:59499},{name:"pharmacy",codepoint:59500},{name:"physiotherapist",codepoint:59501},{name:"place-of-worship",codepoint:59502},{name:"playground",codepoint:59503},{name:"plumber",codepoint:59504},{name:"point-of-interest",codepoint:59505},{name:"police",codepoint:59506},{name:"political",codepoint:59507},{name:"post-box",codepoint:59508},{name:"post-office",codepoint:59509},{name:"skip",codepoint:59510},{name:"skip",codepoint:59511},{name:"rafting",codepoint:59512},{name:"real-estate-agency",codepoint:59513},{name:"restaurant",codepoint:59514},{name:"roofing-contractor",codepoint:59515},{name:"skip",codepoint:59516},{name:"route",codepoint:59517},{name:"rv-park",codepoint:59518},{name:"sailing",codepoint:59519},{name:"school",codepoint:59520},{name:"scuba-diving",codepoint:59521},{name:"search",codepoint:59522},{name:"skip",codepoint:59523},{name:"shopping-mall",codepoint:59524},{name:"sign-language",codepoint:59525},{name:"skateboarding",codepoint:59526},{name:"ski-jumping",codepoint:59527},{name:"skiing",codepoint:59528},{name:"sledding",codepoint:59529},{name:"snow-shoeing",codepoint:59530},{name:"snow",codepoint:59531},{name:"snowboarding",codepoint:59532},{name:"snowmobile",codepoint:59533},{name:"spa",codepoint:59534},{name:"skip",codepoint:59535},{name:"skip",codepoint:59536},{name:"skip",codepoint:59537},{name:"stadium",codepoint:59538},{name:"storage",codepoint:59539},{name:"store",codepoint:59540},{name:"subway-station",codepoint:59541},{name:"surfing",codepoint:59542},{name:"swimming",codepoint:59543},{name:"synagogue",codepoint:59544},{name:"taxi-stand",codepoint:59545},{name:"tennis",codepoint:59546},{name:"toilet",codepoint:59547},{name:"trail-walking",codepoint:59548},{name:"train-station",codepoint:59549},{name:"transit-station",codepoint:59550},{name:"travel-agency",codepoint:59551},{name:"unisex",codepoint:59552},{name:"university",codepoint:59553},{name:"veterinary-care",codepoint:59554},{name:"viewing",codepoint:59555},{name:"volume-control-telephone",codepoint:59556},{name:"walking",codepoint:59557},{name:"waterskiing",codepoint:59558},{name:"whale-watching",codepoint:59559},{name:"wheelchair",codepoint:59560},{name:"wind-surfing",codepoint:59561},{name:"zoo",codepoint:59562}]},"mapp-shapes":{label:"Map shapes",glyphs:[{name:"circle",codepoint:59648,center:[16,16]},{name:"widepin",codepoint:59649,center:[16,14]},{name:"route",codepoint:59650,center:[16,14]},{name:"shield",codepoint:59651,center:[16,14]},{name:"squarepin",codepoint:59653,center:[16,14]},{name:"square",codepoint:59652,center:[16,16]},{name:"squarerounded",codepoint:59654,center:[16,16]},{name:"roundpin",codepoint:59657,center:[16,13]},{name:"pin",codepoint:59655,center:null},{name:"pindot",codepoint:59656,center:null}]}};function w(e){var t,n,r,l=s(f({defaultIcon:mappl10n.options.defaultIcon,filename:null,fillColor:"gray",filter:"",glyph:"",glyphColor:"white",glyphFont:"mapp-icons",isFontLoaded:!1,isOpen:!1,mode:"list",shape:"circle",shapeFont:"mapp-shapes",showNames:!0,strokeColor:"black",strokeWidth:4,urls:{},userIcons:mappl10n.options.userIcons}),2),p=l[0],u=l[1];function h(e){u((function(t){return i(i({},t),e)}))}function w(t,n){switch(t){case"close":h({isOpen:!1});break;case"edit-cancel":h({mode:"list"});break;case"edit-save":!function(e){p.glyphFont;var t=2,n=32*t,o=16*t,a=document.createElement("canvas");a.width=n,a.height=n,a.style.imageRendering="pixelated";var r=a.getContext("2d");r.font=n+"px "+p.shapeFont,r.fillStyle=p.fillColor,r.textBaseline="bottom";var i=_.findWhere(v[p.shapeFont].glyphs,{name:p.shape});r.fillText(String.fromCharCode(i.codepoint),0,n);var l=1,s=l*t;if(r.strokeStyle="white",r.lineWidth=s,r.font=n-l*t+"px "+p.shapeFont,r.strokeText(String.fromCharCode(i.codepoint),l,n-l),i.center){r.imageSmoothingEnabled=!1,r.font=o+"px "+p.glyphFont,r.fillStyle=p.glyphColor;var c=[i.center[0]*t,i.center[1]*t],u=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph});r.fillText(String.fromCharCode(u.codepoint),c[0]-o/2,c[1]+o/2)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(a):a.toBlob((function(e){var t=new FormData;t.append("image0",e,p.filename),k(t)}),"image/png",100)}();break;case"edit-upload":o=n,a=new FormData,_.map(o,(function(e,t){e.type.match("image.*")?a.append("image"+t,e):alert("File "+e.name+" is not an image.")})),k(a);break;case"list-clear":e.onChange&&e.onChange(null),w("close");break;case"list-delete":e.iconid&&confirm(mappl10n.delete_prompt)&&mapp.lib.ajax({type:"POST",data:{action:"mapp_icon_delete",iconids:e.iconid,nonce:mappl10n.options.nonce},callback:function(t){if(t&&"OK"==t.status){var n=mappl10n.options.userIcons.indexOf(e.iconid);n>=0&&void 0!==mappl10n.options.userIcons[n+1]?e.onChange(mappl10n.options.userIcons[n+1]):e.onChange(null),mappl10n.options.userIcons=t.data,h({userIcons:mappl10n.options.userIcons})}else alert("Delete error: "+t.status)}});break;case"list-select":e.onChange&&(n==e.iconid?e.onChange(null):e.onChange(n));break;case"mode":h({mode:n});break;case"open":h({isOpen:!0})}var o,a}function O(t){var n="user"==t?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(n,(function(t){return c("div",{alt:t,className:e.iconid==t?"mapp-icon-wrapper mapp-selected":"mapp-icon-wrapper",key:t,onClick:function(){return w("list-select",t)}},c("img",{className:"mapp-icon",src:mapp.Icons.getUrl(t),title:t}))}))}function k(e){e.append("action","mapp_icon_save"),e.append("nonce",mappl10n.options.nonce),mapp.lib.ajax({type:"POST",contentType:!1,processData:!1,data:e,success:function(e){e&&"OK"==e.status?(mappl10n.options.userIcons=e.data.icons,h({userIcons:mappl10n.options.userIcons}),h({mode:"list"}),w("list-select",e.data.filename)):alert("Upload error: "+e.status)}})}return d((function(){var e=[];_.map(v,(function(t,n){var o=new FontFace(n,"url("+mappl10n.options.baseurl+"/pro/fonts/"+n+".woff?"+mappl10n.options.version+")");document.fonts.add(o),e.push(o.loaded)})),Promise.all(e).then((function(){h({isFontLoaded:!0})}))}),[]),d((function(){h({filename:p.shape+"_"+p.fillColor.replace("#","")+(p.glyph?"_"+p.glyph:"")+".png"})}),[p.shape,p.fillColor,p.glyph]),c(m,null,c("img",{className:"mapp-icon",onClick:function(){return w("open",null)},src:mapp.Icons.getUrl(e.iconid)}),"list"==p.mode&&function(){if(!p.isOpen)return null;var t=e.iconid&&mappl10n.options.userIcons.indexOf(e.iconid)>=0;return c(b,{title:c("div",{className:"mapp-icons-header"},__("Select an icon"),c(y,{isSecondary:!0,onClick:function(){return w("mode","edit")}},__("New icon"))),className:"mapp-icons-modal",onRequestClose:function(){return w("close")}},c("div",{className:"mapp-icons"},c("div",{className:"mapp-icons-list"},c("div",{className:"mapp-icons-user"},O("user")),c("div",{className:"mapp-icons-standard"},O("standard"))),c("div",{className:"mapp-icons-edit-filename"},e.iconid?e.iconid:__("No icon selected")),c("div",{className:"mapp-icons-toolbar"},c("div",null,c(y,{isPrimary:!0,onClick:function(){return w("close")}},__("OK")),c(y,{isSecondary:!0,onClick:function(){return w("list-clear")}},__("Use default icon"))),c(y,{isDestructive:!0,onClick:function(){return w("list-delete")},disabled:!t},__("Delete")))))}(),"edit"==p.mode&&c(b,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:function(){return w("edit-cancel")},shouldCloseOnClickOutside:!1},c("div",{className:"mapp-icons-edit"},c("div",{id:"mapp-edit-debug"}),c("div",{className:"mapp-icons-edit-shape-section"},c("div",{className:"mapp-icons-edit-header"},__("Shape")),(t=v[p.shapeFont],n=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph}),r=n?String.fromCharCode(n.codepoint):null,c("div",{className:"mapp-icons-edit-shapes",style:{color:p.fillColor,fontFamily:p.shapeFont}},_.map(t.glyphs,(function(e,t){var o=p.shape==e.name;return c("span",{className:"mapp-icons-edit-shape-wrapper"+(o?" mapp-selected":""),key:e.name,onClick:function(){return h({shape:e.name})},title:e.name},c("span",{className:"mapp-icons-edit-shape"},String.fromCharCode(e.codepoint),e.center&&n&&c("span",{className:"mapp-icons-edit-glyph",style:{left:e.center[0],top:e.center[1],color:p.glyphColor,fontFamily:p.glyphFont}},r)))}))))),c("div",{className:"mapp-icons-edit-color-section"},c("span",{className:"mapp-icons-edit-header"},__("Color")),c(o.MappColorPicker,{color:p.fillColor,isExtended:!1,onChange:function(e){return h({fillColor:e.color})}})),c("div",{className:"mapp-icons-edit-glyph-section"},c("div",{className:"mapp-icons-edit-search"},c("div",{className:"mapp-icons-edit-header"},__("Search")),c(a.Input,{onChange:function(e){return h({filter:e})}})),function(){p.glyphFont;var e=_.filter(v[p.glyphFont].glyphs,(function(e){return(!p.filter||e.name.includes(p.filter))&&"skip"!=e.name}));return c("div",{className:"mapp-icons-edit-glyph-list",style:{color:p.glyphColor,fontFamily:p.glyphFont}},_.map(e,(function(e,t){return c("div",{className:"mapp-icons-edit-glyph-wrapper"+(p.glyph==e.name?" mapp-selected":""),key:t,onClick:function(){return h({glyph:p.glyph==e.name?null:e.name})}},c("span",{className:"mapp-icons-edit-glyph"},String.fromCharCode(e.codepoint)),c("div",{className:"mapp-icons-edit-glyph-title"},e.name))})))}()),c("div",{className:"mapp-icons-edit-toolbar"},c("div",null,c(y,{isPrimary:!0,onClick:function(){return w("edit-save")}},__("Save")),c(y,{isSecondary:!0,onClick:function(){return w("edit-cancel")}},__("Cancel"))),c(g,{accept:"image/*",icon:"upload",multiple:!0,onChange:function(e){w("edit-upload",e.target.files)}},__("Upload icons"))))))}},800:(e,t,n)=>{"use strict";n.r(t);var o=n(477);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var p=wp.element.createElement,c=wp.element,u=(c.Fragment,c.useEffect,c.useLayoutEffect,c.useRef,c.useState),m=wp.components;m.Button,m.Dashicon,m.Modal;function d(e){var t=l(u({mapid:null}),2),n=t[0],a=t[1];return p(o.default,{context:"mce",mapid:n.mapid,onAction:function(t,n){switch(t){case"pick-close":o={mapid:null},a((function(e){return r(r({},e),o)})),e.onAction("pick-close",n);break;case"pick-insert":e.onAction("pick-insert",n)}var o}})}window.parent&&(window.mappIframeRender=function(e){wp.element.render(p(d,e),document.getElementById("mapp-iframe-react"))}),function(e){function t(){var t=this;this.contentWindow=null,this.iframe=null;e(".mapp-iframe-button").on("click",(function(e){e.preventDefault(),t.open()}))}t.prototype={load:function(t){var n=this;if(this.iframe)return this.iframe.show(),void t();this.iframe=e('<iframe class="mapp-iframe" allowtransparency="true"></iframe>').appendTo("body"),e("iframe").on("load",(function(){t()})),e.get(mappl10n.options.ajaxurl,{action:"mapp_iframe",nonce:mappl10n.options.nonce},(function(e){n.contentWindow=n.iframe.get(0).contentWindow,n.contentWindow.document.open("text/html","replace"),n.contentWindow.document.write(e),n.contentWindow.document.close()}))},open:function(){var e=this;this.load((function(){e.contentWindow&&e.contentWindow.mappIframeRender&&e.contentWindow.mappIframeRender({onAction:function(t,n){return e.onAction(t,n)}})}))},onAction:function(e,t){switch(e){case"pick-close":this.iframe.hide();break;case"pick-insert":var n='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?alert(mappl10n.need_classic):send_to_editor(n),this.iframe.hide()}}},e(".mapp-iframe-button").length&&new t(this)}(jQuery)},938:(e,t,n)=>{"use strict";n.r(t);var o=n(477);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var i=wp.element.createElement,l=wp.element,s=(l.Fragment,l.render,l.useEffect),p=(l.useLayoutEffect,l.useRef,l.useState),c=wp.components;c.Button,c.Modal;document.getElementById("mapp-library")&&(mappl10n.options.postid=0,wp.element.render(i((function(e){var t=a(p({mapid:null}),2),n=t[0];return t[1],s((function(){}),[]),i(o.default,{context:"library",mapid:n.mapid,onAction:function(e,t){switch(e){case"pick-shortcode":var n=jQuery("<input>");jQuery("body").append(n),n.val('[mappress mapid="'+t+'"]').select(),document.execCommand("copy"),n.remove(),alert((o="Shortcode copied",wp.i18n.__(o,"mappress-google-maps-for-wordpress")))}var o}})})),document.getElementById("mapp-library")))},816:(e,t,n)=>{"use strict";n.r(t);var o=n(429),a=n(477);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var c=window.mapp||{},u=wp.element.createElement,m=wp.element,d=m.Fragment,f=m.useEffect,h=(m.useLayoutEffect,m.useRef),y=m.useState,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function g(e){var t=wp.components,n=(t.BaseControl,t.Button),r=(t.ButtonGroup,t.CheckboxControl,t.Dropdown,t.Modal,t.Panel,t.PanelBody,t.PanelRow,t.Placeholder),l=(t.RadioControl,t.SelectControl,t.TextControl,t.ToggleControl,t.Toolbar),p=t.ToolbarButton,m=(t.ToolbarGroup,wp.blockEditor),g=m.BlockControls,b=m.InspectorControls,v=s(y({isOpen:!1,map:null,mapdata:null,pickerMode:"list",pickerMapid:null}),2),w=v[0],O=v[1],k=h(null);function C(e){O((function(t){return i(i({},t),e)}))}function S(t,n){switch(t){case"add":C({isOpen:!0,pickerMapid:null,pickerMode:"edit"}),e.setAttributes({center:void 0,zoom:void 0});break;case"change-settings":e.setAttributes(n);break;case"edit":C({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"edit"});break;case"edit-close":C({isOpen:!1});break;case"pick-destroy":e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),C({isOpen:!1});break;case"pick-close":C({isOpen:!1});break;case"pick-insert":case"pick-duplicate":n!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:n,zoom:void 0}),C({isOpen:!1});break;case"open":C({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"list"})}}function P(){var t=void 0!==t?t:l;return u(g,null,u(t,null,e.attributes.mapid&&u(p,{icon:"edit",label:__("Edit map"),onClick:function(){return S("edit")}}),u(p,{icon:"portfolio",label:__("Map Library"),onClick:function(){return S("open")}})))}function j(){if(w.isOpen)return u(a.default,{mapid:w.pickerMapid,mode:w.pickerMode,onAction:S,type:"post"})}return f((function(){var t=function(t){var n=t.maps[e.attributes.mapid];n&&C({mapdata:n})};return c.store.subscribe(t),function(){return c.store.unsubscribe(t)}})),f((function(){e.attributes.mapid&&c.store.fetchMap({mapid:e.attributes.mapid,failure:function(){return C({mapdata:void 0})}})}),[e.attributes.mapid]),f((function(){var t;e.attributes.mapid&&k.current&&w.mapdata&&((t=new c.Map(w.mapdata,{alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:e.attributes.poiList,sel:jQuery(k.current),width:e.attributes.width,zoom:e.attributes.zoom})).display(),C({map:t}))}),[w.mapdata]),f((function(){"wide"!=e.attributes.align&&"full"!=e.attributes.align||(e.setAttributes({width:"100%"}),w.map&&w.map.setSize({width:"100%"}))}),[e.attributes.align]),e.attributes.preview?u("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):e.attributes.mapid&&void 0!==w.mapdata?u(d,null,P(),function(){if(!w.map)return null;var t=e.attributes,n=t.align,a=t.center,r=t.height,i=t.poiList,l=t.width,s=t.zoom;return u(b,null,u("div",{className:"mapp-gt-inspector"},u(o.MappSettings,{map:w.map,alignment:n,context:"map",onAction:S,center:a,height:r,poiList:i,width:l,zoom:s})))}(),u("div",{className:"mapp-gt",ref:k}),j()):u(d,null,u(d,null,P(),u(r,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},u(n,{icon:"portfolio",isSecondary:!0,onClick:function(){return S("open")}},__("Map Library")))),j())}wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:"mappress",attributes:{center:{type:"string"},height:{type:"string",default:""},initialOpenDirections:{type:"boolean"},mapid:{type:"string"},mapOpts:{type:"object"},poiList:{type:"boolean"},preview:{type:"boolean",default:!1},width:{type:"string",default:""},zoom:{type:"number"}},supports:{align:["full","wide","center","left","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:function(e){return e.named.center}},height:{type:"string",shortcode:function(e){return e.named.height}},initialOpenDirections:{type:"boolean",shortcode:function(e){return"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections}},mapid:{type:"string",shortcode:function(e){return e.named.mapid}},poiList:{type:"boolean",shortcode:function(e){return"true"==e.named.poiList||"true"==e.named.poilist}},width:{type:"string",shortcode:function(e){return e.named.width}},zoom:{type:"number",shortcode:function(e){return parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(e){var t=e.text,n=wp.shortcode.regexp("mappress");return n.lastIndex=0,n.test(t)},transform:function(e){var t=e.text;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return u(g,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},378:(e,t,n)=>{"use strict";n.r(t);n(429),n(670),n(308);window.mapp,wp.element.createElement;var o=wp.element,a=(o.Fragment,o.useEffect,o.useLayoutEffect,o.useRef,o.useState,wp.components);a.BaseControl,a.Button,a.ButtonGroup,a.Card,a.CardBody,a.CardFooter,a.CardHeader,a.CheckboxControl,a.ExternalLink,a.HorizontalRule,a.Panel,a.PanelBody,a.PanelRow,a.Placeholder,a.RadioControl,a.SelectControl,a.TabPanel,a.TextControl,a.TextareaControl,a.ToggleControl,a.Toolbar,wp.data.useSelect},498:(e,t,n)=>{"use strict";n.r(t);var o=n(477);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=(c.useEffect,c.useLayoutEffect,c.useRef,c.useState),d=wp.components,f=(d.Button,d.Dashicon),__=(d.Modal,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function h(){var e=l(m({isOpen:!1,mapid:null}),2),t=e[0],n=e[1];function a(e){n((function(t){return r(r({},t),e)}))}function i(e,t){switch(e){case"pick-close":a({isOpen:!1,mapid:null});break;case"pick-insert":a({isOpen:!1});var n='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(n);break;case"open":a({isOpen:!0,mapid:s()})}}function s(){var e=tinyMCE?tinyMCE.get("content"):null,t=e&&e.selection?e.selection.getSel():null;if(!t||void 0===t.anchorOffset||!t.anchorNode||!t.anchorNode.data)return null;for(var n=null,o=t.anchorNode.data,a=-1,r=t.anchorOffset-1;r>=0;r--){var i=o[r];if("["==i){a=r;break}if("]"==i||"<"==i||">"==i)break}return a>=0&&(n=wp.shortcode.next("mappress",o,a))?n.shortcode.attrs.named.mapid:null}return p(u,null,p("button",{className:"button",type:"button",onClick:function(e){e.preventDefault(),i("open")}},p(f,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&p(o.default,{context:"mce",mapid:t.mapid,onAction:i}))}Array.from(document.getElementsByClassName("mapp-mce")).forEach((function(e,t){return wp.element.render(p(h),e)}))},670:(e,t,n)=>{"use strict";function o(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}n.r(t),n.d(t,{MappMultiSelect:()=>v});var c=wp.element.createElement,u=wp.element,m=(u.Fragment,u.useEffect),d=(u.useLayoutEffect,u.useRef),f=u.useState,h=wp.components,y=h.BaseControl,g=(h.Button,h.CheckboxControl),b=(h.Panel,h.PanelBody,h.PanelRow,h.Spinner,h.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n=d(null),a=d(null),i=l(f({isOpen:!1,filter:"",filteredOptions:[]}),2),s=i[0],p=i[1];function u(e){p((function(t){return r(r({},t),e)}))}function h(t){var n=_.findWhere(e.options,{value:t});return n?n.label:t}function v(){var t;return e.values instanceof Array?t=o(e.values):e.values&&(t=[e.values]),t||[]}function w(t,n){var o=v(),a=o.indexOf(t);(n=void 0!==n?n:-1==a)?o.push(t):o.splice(a,1),e.onChange(o)}function O(){return s.isOpen?c("div",{className:"mapp-select-dropdown-wrapper"},c("div",{className:"mapp-select-dropdown"},!s.isOpen||!e.options||e.options.length<10?null:c("div",{className:"mapp-select-filter",ref:a},c(b,{autoComplete:"off",placeholder:__("Search"),value:s.filter,onChange:function(e){return u({filter:e})}})),c("div",{className:"mapp-select-dropdown-list"},(t=v(),0==s.filteredOptions.length?c("div",{className:"mapp-select-dropdown-item"},__("No results")):s.filteredOptions.map((function(e){return c(g,{className:"mapp-select-dropdown-item",checked:t.includes(e.value),key:e.value,onChange:function(t){return w(e.value,t)},label:e.label})})))))):null;var t}return m((function(){if(e.options)if(s.filter){var t=s.filter.toUpperCase();u({filteredOptions:e.options.filter((function(e){return 0==e.label.toUpperCase().indexOf(t)}))})}else u({filteredOptions:e.options})}),[e.options,s.filter]),m((function(){s.isOpen&&a.current&&(jQuery("input",jQuery(a.current)).focus(),u({filter:""}))}),[s.isOpen]),c(y,{className:"mapp-select",label:e.label},c("div",{ref:n,tabIndex:0,onBlur:function(e){return function(e){event.relatedTarget||document.activeElement,n.current.contains(e.relatedTarget)||u({isOpen:!1})}(e)}},((t=v())instanceof Array&&t.map((function(e){return h(e)})),void 0===e.options?c("div",{className:"mapp-select-input"},c("div",{className:"mapp-select-tokens"}),c("span",{className:"dashicons dashicons-arrow-down-alt2"})):c("div",{className:"mapp-select-input",onClick:function(){return u({isOpen:!s.isOpen})}},c("div",{className:"mapp-select-tokens"},t.map((function(e){return c("span",{className:"mapp-select-token",key:e,onClick:function(t){t.stopPropagation(),w(e,!1)}},h(e))}))),c("span",{className:"dashicons "+(s.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))),O()))}},218:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>C});var o=n(824),a=n(143),r=n(710);function i(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var d=wp.element.createElement,f=wp.element,h=f.Fragment,y=f.useEffect,g=(f.useLayoutEffect,f.useCallback,f.useRef),b=f.useState,v=wp.data.useSelect,w=wp.components,O=w.Button,k=w.Dashicon,__=(w.ExternalLink,w.Modal,w.Panel,w.PanelBody,w.PanelRow,w.Popover,w.RadioControl,w.Spinner,w.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function C(e){var t,n,l,p,u,m=c(b(s({},mappress_options_state)),2),f=m[0],w=m[1],C=g(null);function S(e){w((function(t){return s(s({},t),e)}))}function P(e){return _.map(e,(function(e,t){return{value:t,label:e}}))}function j(e){return e.length?(_.map(e,(function(e){for(var t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),e.filter((function(e){for(var t in e)if(0==e[t].length)return!1;return!0}))):[]}function x(e,t){switch(e){case"license-check":mapp.lib.ajax({type:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:f.license},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"reset":mapp.lib.ajax({type:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"save":var n=s({},f);delete n.helpers,n.filters=j(n.filters),n.metaKeys=j(n.metaKeys),n.sizes=j(n.sizes),n.autoicons&&n.autoicons.values&&(n.autoicons.values=j(n.autoicons.values)),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:n},callback:function(e){e&&"OK"==e.status&&window.location.reload()}})}}return y((function(){C.current&&new mapp.Map(f.helpers.demo_map,{sel:jQuery(C.current)}).display()}),[]),y((function(){mappl10n.options.engine!=f.engine&&x("save")}),[f.engine]),d("div",{className:"mapp-options"},d("form",{onSubmit:function(e){e.preventDefault(),x("save")}},d(o.Section,{title:__("Sample Map"),className:"mapp-demo-section"},d("div",{className:"mapp-options-demo",ref:C})),d(o.Section,{title:__("Basic Settings")},d(o.Radios,{title:__("Mapping API"),options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:function(e){S({engine:e,geocoder:"google"==e?"google":""})},checked:f.engine,help:{href:"#toc-picking-a-mapping-api",text:__("Leaflet is free and requires no API key. Google requires an API key and has strict usage limits.")}}),"leaflet"==f.engine&&d(o.Input,{className:"mapp-option-mapbox",title:__("Mapbox access token"),value:f.mapbox,onChange:function(e){S({mapbox:e}),"mapbox"!=f.geocoder||e||S({geocoder:""})},placeholder:__("Enter token to use Mapbox features"),help:{href:"https://www.mapbox.com/help/define-access-token/"}}),"google"==f.engine&&d(o.Input,{title:__("Google API key"),name:"apiKey",value:f.apiKey,onChange:function(e){return S({apiKey:e})},size:50,help:{href:"https://mappresspro.com/mappress-faq/#toc-google-maps-api-keys"}}),"leaflet"==f.engine&&(u=[{value:"",label:__("Algolia")},{value:"nominatim",label:"Nominatim"},{value:"mapbox",label:"MapBox",disabled:!f.mapbox}],d(o.Radios,{title:__("Geocoder"),options:u,checked:f.geocoder,onChange:function(e){return S({geocoder:e})},help:{href:"#toc-picking-a-geocoder"}}))),mappl10n.options.pro&&(!f.helpers.is_multisite||f.helpers.is_super_admin||f.helpers.is_main_site)&&d(o.Section,{title:__("License")},d(o.Option,{title:__("MapPress license key")},d(o.Input,{value:f.license,onChange:function(e){return S({license:e})},size:37,placeholder:__("Enter license to enable automatic updates")}),(p=d("a",{className:"mapp-license-status",href:"https://mappresspro.com/account",target:"_blank"},__("Get license")),f.license&&f.helpers.license_status?"active"==f.helpers.license_status?d("span",{className:"mapp-license-status"},d(k,{icon:"yes"}),__("Active")):d(h,null,d(O,{className:"mapp-options-check-license",isSecondary:!0,onClick:function(){return x("license-check")}},__("Check now")),d("div",null,d(k,{icon:"no"}),f.helpers.license_message)):p)),d(o.Checkbox,{title:__("Beta versions"),label:__("Enable updates for beta versions"),checked:f.betas,onChange:function(e){return S({betas:e})}})),d(o.Section,{title:__("Map Settings")},d(o.Checkboxes,{title:__("Post types"),values:f.postTypes,options:P(f.helpers.post_types),onChange:function(e){return S({postTypes:e})}}),d(o.Radios,{title:__("Automatic display"),options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:f.autodisplay,onChange:function(e){return S({autodisplay:e})}}),d(o.Radios,{title:__("Map alignment"),options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:f.alignment,onChange:function(e){return S({alignment:e})}}),d(o.Radios,{title:__("Directions"),checked:f.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:function(e){return S({directions:e})}}),d(o.Checkbox,{title:__("POI list"),checked:f.poiList,label:__("Show a list of POIs with each map"),onChange:function(e){return S({poiList:e})}}),mappl10n.options.pro&&d(o.Radios,{title:__("POI list layout"),checked:f.layout,options:[{value:"left",label:"Left of map"},{value:"inline",label:__("Below map")}],onChange:function(e){return S({layout:e})}}),d(o.Input,{title:__("Mini width"),value:f.mini,onChange:function(e){return S({mini:e})},size:3,label:__("Width (px) to hide the POI list")}),d(o.Checkbox,{title:__("Sort"),checked:f.sort,label:__("Sort POI list by title"),onChange:function(e){return S({sort:e})}})),d(o.Section,{title:__("POI Settings")},d(o.Select,{title:__("Default zoom"),label:__("Default zoom when displaying a single POI"),value:f.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],(function(e){return{value:e,label:e}})),onChange:function(e){return S({poiZoom:e})}}),d(o.Checkbox,{title:__("Hover"),checked:f.tooltips,label:__("Open POIs on hover"),onChange:function(e){return S({tooltips:e})}}),d(o.Checkbox,{title:__("Open first POI"),checked:f.initialOpenInfo,onChange:function(e){return S({initialOpenInfo:e})},label:__("Open first POI")}),d(o.Checkbox,{title:__("Clustering"),checked:f.clustering,label:__("Enable marker clustering"),onChange:function(e){return S({clustering:e})}})),mappl10n.options.pro&&d(o.Section,{title:__("Mashups")},d(o.Checkbox,{title:__("Search"),checked:f.search,label:__("Enable search"),onChange:function(e){return S({search:e})}}),d(o.Option,{title:__("Filters")},d(o.MappGrid,{cols:[{id:"key",label:__("Taxonomy"),onRender:function(e){var t=P(f.helpers.taxonomies).map((function(t){return t.disabled=t.value!=e.value&&_.findWhere(f.filters,{key:t.value}),t}));return d(o.Select,{value:e.value,options:t,onChange:e.onChange,placeholder:""})}}],data:f.filters,onChange:function(e){S({filters:e})}})),d(o.Radios,{title:__("Marker click"),checked:f.mashupClick,options:[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}],onChange:function(e){return S({mashupClick:e})}}),d(o.Radios,{title:__("Popup content"),checked:f.mashupBody,options:[{value:"poi",label:__("POI title + POI body")},{value:"post",label:__("Post title + post excerpt")}],onChange:function(e){return S({mashupBody:e})}}),d(o.Checkbox,{title:__("KMLs"),checked:f.mashupKml,label:__("Include KML POIs in mashups"),onChange:function(e){return S({mashupKml:e})}})),mappl10n.options.pro&&d(o.Section,{title:__("Icons")},d(o.Option,{title:__("Default icon")},d(a.MappIconPicker,{iconid:f.defaultIcon,onChange:function(e){mappl10n.options.defaultIcon=e,S({defaultIcon:e})}})),d(o.Option,{title:__("Icon directory")},d("code",null,f.helpers.icon_directory)),d(o.Option,{title:__("Highlight selected POI")},d(o.Radios,{checked:f.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:function(e){return S({highlight:e})}}),"icon"==f.highlight&&d(a.MappIconPicker,{defaultIcon:f.defaultIcon,iconid:f.highlightIcon,onChange:function(e){return S({highlightIcon:e})}})),(l=f.iconScale&&Array.isArray(f.iconScale)?i(f.iconScale):[0,0],d(o.Option,{title:__("Icon scaling")},d(o.Input,{value:l[0]?l[0]:"",onChange:function(e){e<=64&&(l[0]=e>0?e:"",S({iconScale:l}))},type:"number",min:0,max:64}),d("span",null," X "),d(o.Input,{value:l[1]?l[1]:"",onChange:function(e){e<=64&&(l[1]=e>0?e:"",S({iconScale:l}))},type:"number",min:0,max:64}),d("span",null," (px) "))),function(){var e=P(f.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});var t=v((function(e){if("post_type"==f.autoicons.key)return P(f.helpers.post_types);var t=wp.data.select("core").getEntityRecords("taxonomy",f.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return t?t.map((function(e){return{value:e.slug,label:e.name}})):[]}),[f.autoicons.key]);return d(o.Option,{title:__("Automatic icons")},d(o.Select,{value:f.autoicons?f.autoicons.key:null,options:e,onChange:function(e){var t=f.autoicons?s({},f.autoicons):[];t.key=e,t.values=[],S({autoicons:t})},placeholder:""}),d(o.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:t},{id:"value",label:__("Icon"),type:"icon"}],data:f.autoicons.values,onChange:function(e){var t=f.autoicons?s({},f.autoicons):[];t.values=e,S({autoicons:t})}}))}()),mappl10n.options.pro&&d(o.Section,{title:__("Styled Maps")},d(o.Option,{title:__("Default style")},d("div",{className:"mapp-option-style"},d(r.m,{selected:f.style,onChange:function(e){return S({style:e})}}),d("div",null,__('Replace the default "roadmap" or "streets" style'))))),mappl10n.options.pro&&d(o.Section,{title:__("Geocoding")},d(o.Option,{title:__("Geocoding fields")},d(o.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:P(f.helpers.meta_fields)},{id:"value",label:__("Custom field"),type:"select",options:P(f.helpers.meta_keys)}],data:f.metaKeys,onChange:function(e){S({metaKeys:e})}})),d(o.Checkbox,{title:__("Overwrite"),label:__("Overwrite maps when posts are saved"),checked:f.metaSyncSave,onChange:function(e){S({metaSyncSave:e})}}),(n=__("No errors found"),f.helpers.geocoding_errors&&f.helpers.geocoding_errors.length>0&&(n=_.map(f.helpers.geocoding_errors,(function(e){return d("div",{key:e.ID},d("a",{href:mappl10n.options.editurl+"?post="+e.ID+"&action=edit"},e.post_title),d("span",null," : "+e.error))}))),d(o.Option,{title:__("Geocoding errors")},n)),"google"==f.engine&&d(o.Input,{title:__("Google Server API key"),name:"apiKeyServer",value:f.apiKeyServer,onChange:function(e){return S({apiKeyServer:e})},size:50,help:{text:__("Key secured by IP address for geocoding custom fields (optional)"),href:"https://mappresspro.com/mappress-faq"}})),mappl10n.options.pro&&d(o.Section,{title:__("Templates")},d(o.Option,{title:__("Custom templates")},d(o.MappTemplateEditor)),d(o.Option,{title:__("Mashup thumbnails")},d(o.Select,{label:__("Popups"),onChange:function(e){return S({thumbsPopup:e})},options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:f.thumbsPopup}),d(o.Select,{label:__("POI lists"),onChange:function(e){return S({thumbsList:e})},options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:f.thumbsList})),d(o.Option,{title:__("Thumbnail size")},d(o.Select,{onChange:function(e){return S({thumbSize:e})},options:P(f.helpers.thumbnail_sizes),value:f.thumbSize}),d("span",null," "+__("or")+" "),d(o.Input,{value:f.thumbWidth,onChange:function(e){return S({thumbWidth:e})},type:"number",min:0,max:9999}),d("span",null," X "),d(o.Input,{value:f.thumbHeight,onChange:function(e){return S({thumbHeight:e})},type:"number",min:0,max:9999}),d("span",null," (px) "))),d(o.Section,{title:__("Localization")},(t="leaflet"==f.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport",d(o.Select,{title:__("Search language"),label:__("Language for searches and Google map controls"),value:f.language,options:P(f.helpers.languages),onChange:function(e){return S({language:e})},help:{href:t}})),d(o.Select,{title:__("Search country"),label:__("Country code for searches"),value:f.country,options:_.map(["","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","VI","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW"],(function(e){return{value:e,label:e}})),onChange:function(e){return S({country:e})},help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}}),d(o.Input,{title:__("Directions server"),value:f.directionsServer,onChange:function(e){return S({directionsServer:e})},size:25})),d(o.Section,{title:__("Miscellaneous")},d(o.Option,{title:__("Map sizes")},d(o.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:f.sizes,onChange:function(e,t){return S({sizes:e,size:t})},selectionColumn:"rowid",selected:f.size})),f.helpers.jetpack?null:d(o.Checkbox,{title:__("Scripts"),checked:f.footer,label:__("Output scripts in footer"),onChange:function(e){return S({footer:e})},help:{text:__("Disable footer scripts if maps are output using AJAX")}}),d(o.Checkbox,{title:"WPML",checked:f.wpml,label:__("Copy maps when overwriting a translation"),onChange:function(e){return S({wpml:e})},help:{href:"https://mappresspro.com/mappress-documentation#wpml"}}),"google"==f.engine&&d(o.Checkbox,{title:__("Compatiblity"),checked:f.deregister,label:__("Prevent other plugins/themes from loading the Google Maps API"),onChange:function(e){return S({deregister:e})}})),d("div",{className:"mapp-options-toolbar"},d(O,{className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),d(O,{isSecondary:!0,onClick:function(){return x("reset")}},__("Reset Defaults")))))}document.getElementById("mapp-options-settings")&&wp.element.render(d(C),document.getElementById("mapp-options-settings"))},824:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Checkbox:()=>C,Checkboxes:()=>S,Help:()=>P,Input:()=>j,Radios:()=>N,Select:()=>I,Textarea:()=>M,Section:()=>E,Option:()=>A,MappGrid:()=>D,MappTemplateEditor:()=>T});var o=n(143);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(null==e)return{};var n,o,a=function(e,t){if(null==e)return{};var n,o,a={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var m=wp.element.createElement,d=wp.element,f=d.Fragment,h=d.useEffect,y=(d.useLayoutEffect,d.useCallback),g=(d.useRef,d.useState),b=(wp.data.useSelect,wp.components),v=b.Button,w=(b.ColorPicker,b.Dashicon),O=(b.Dropdown,b.ExternalLink,b.Modal),k=(b.Panel,b.PanelBody,b.PanelRow,b.Popover,b.RadioControl,b.Spinner,b.TabPanel),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function C(e){var t=e.title,n=e.label,o=e.onChange,a=e.help,r=u(e,["title","label","onChange","help"]),i=m(f,null,m("label",null,m("input",p({type:"checkbox",onChange:function(e){o&&o(e.target.checked)}},r)),n&&m("span",{className:"mapp-option-label"},n)),a&&m(P,a));return t?m(A,{title:t},i):i}function S(e){var t=m(f,null,_.map(e.options,(function(t,n){var o=e.values?e.values.indexOf(t.value):-1;return m(C,{key:n,label:t.label,value:t.value,checked:o>=0,onChange:function(n){var a=r(e.values);n&&-1==o&&e.onChange(a.concat(t.value)),!n&&o>=0&&(a.splice(o,1),e.onChange(a))}})})),e.help&&m(P,e.help));return e.title?m(A,{title:e.title},t):t}function P(e){var t=null;return e.href&&(t="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),m(f,null,t&&m("a",{className:"mapp-help-link",href:t,target:"_blank"},m(w,{icon:"editor-help"})),e.text&&m("div",{className:"mapp-help-text"},e.text))}function j(e){var t=e.title,n=e.value,o=e.label,a=e.onChange,r=e.help,i=e.type,l=u(e,["title","value","label","onChange","help","type"]);if(!a)return"Missing onChange handler in Input component";var s=m(f,null,m("input",p({value:null!==n?n:"",onChange:function(e){return a(e.target.value.trim())},type:i||"text"},l)),o&&m("span",{className:"mapp-option-label"},o),r&&m(P,r));return t?m(A,{title:t},s):s}var x=function(e){var t=e.onChange,n=e.label,o=u(e,["onChange","label"]);return m("label",null,m("input",p({type:"radio",onChange:function(e){return t(e.target.value)}},o)),n&&m("span",{className:"mapp-option-label"},n))};function N(e){var t=m(f,null,_.map(e.options,(function(t,n){return m(x,{key:n,value:t.value,checked:e.checked==t.value,onChange:function(t){return e.onChange(t)},disabled:t.disabled,label:t.label})})),e.help&&m(P,e.help));return e.title?m(A,{title:e.title},t):t}function I(e){var t=e.title,n=e.value,o=e.label,a=e.onChange,i=e.options,l=e.help,s=e.placeholder,c=u(e,["title","value","label","onChange","options","help","placeholder"]),d=r(i);void 0!==s&&d.unshift({value:"",label:s});var h=m(f,null,m("select",p({value:null!==n?n:"",onChange:function(e){return a(e.target.value)}},c),_.map(d,(function(e,t){return m("option",{key:t,value:e.value,disabled:e.disabled},e.label)}))),o&&m("span",{className:"mapp-option-label"},o),l&&m(P,l));return t?m(A,{title:t},h):h}function M(e){var t=e.title,n=e.onChange,o=e.label,a=e.help,r=u(e,["title","onChange","label","help"]),i=m(f,null,m("textarea",p({onChange:function(e){return n(e.target.value)}},r)),o&&m("span",{className:"mapp-option-label"},o),a&&m(P,a));return t?m(A,{title:t},i):i}function E(e){var t=e.className?" "+e.className:"";return m("div",{className:"mapp-option-section"+t},m("h2",null,e.title),e.children)}function A(e){return m("div",{className:"mapp-option"},m("div",{className:"mapp-option-title"},e.title),m("div",{className:"mapp-option-value"},e.children))}function D(e){var t,n,i=a(g({dragging:null,dragover:null}),2),l=i[0],s=i[1];function c(e){s((function(t){return p(p({},t),e)}))}function u(t,n){var o=r(e.data);switch(t){case"add":var a={};_.map(e.cols,(function(e){a[e.id]=""})),o.push(a),e.onChange(o,e.selected);break;case"change":o[n.i][n.id]=n.value,e.onChange(o,e.selected);break;case"delete":var i;o.splice(n,1),i=n==e.selected?null:n<e.selected?e.selected-1:e.selected,e.onChange(o,i);break;case"select":c({selected:n}),e.onChange(o,n);break;case"sort":var s=l.dragging,p=s<p?n-1:n;o.splice(p,0,o.splice(s,1)[0]),e.onChange(o,p),c({dragover:null})}}return h((function(){}),[]),m("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&m("div",{className:"mapp-grid-table"},(t=e.selectionColumn?m("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,n=m("div",{className:"mapp-grid-cell",key:"actions"},""),m("div",{className:"mapp-grid-header"},m("div",{className:"mapp-grid-row"},t,_.map(e.cols,(function(e){return m("div",{className:"mapp-grid-cell",key:e.id},e.label)})),n))),m("div",{className:"mapp-grid-body"},_.map(e.data,(function(t,n){return function(t,n){return m("div",{className:"mapp-grid-row"+(l.dragover==n?" mapp-dragover":""),draggable:!0,key:n,onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return c({dragging:n})},onDragEnter:function(e){return c({dragover:n})},onDragEnd:function(e){return c({dragging:null,dragover:null})},onDrop:function(e){return u("sort",n)}},function(t,n){if(!e.selectionColumn)return null;var o,a;switch("rowid"==e.selectionColumn?o=n:t[e.selectionColumn]?o=t[e.selectionColumn]:a=!0,e.selectionType){case"checkbox":return m("div",{className:"mapp-grid-cell"},m(C,{value:o,checked:e.selected==o,disabled:a,onChange:function(e){u("select",e?o:null)}}));case"radio":default:return m("div",{className:"mapp-grid-cell"},m(x,{checked:e.selected==o,onChange:function(){return u("select",o)}}))}}(t,n),_.map(e.cols,(function(t,a){return m("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:n+"-"+a},function(t,n){if(n.onRender)return n.onRender({id:n.id,value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});switch(n.type){case"icon":return m(o.MappIconPicker,{iconid:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"input":default:return m(j,{size:e.data[t][n.size],value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"select":return m(I,{value:e.data[t][n.id],options:n.options,onChange:function(e){u("change",{i:t,id:n.id,value:e})},placeholder:""})}}(n,t))})),function(e){return m("div",{className:"mapp-grid-cell",key:"delete"},m(v,{icon:"trash",onClick:function(){return u("delete",e)}}))}(n))}(t,n)})))),m("div",{className:"mapp-grid-toolbar"},m(v,{isSecondary:!0,onClick:function(){return u("add")}},__("Add"))))}function T(e){var t=a(g({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null}),2),n=t[0],o=t[1];function r(e){o((function(t){return p(p({},t),e)}))}var i,l,s=y((function(e){if(null!=e){var t=wp.codeEditor.initialize(e);t.codemirror.setSize("auto","auto"),t.codemirror.setOption("readOnly","editor"!=n.tab),r({codeEditor:t})}}),[]);function c(e,t){switch(e){case"close":r({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&(mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_delete",name:n.template.name,nonce:mappl10n.options.nonce}}),r({isOpen:!1}));break;case"insert":var o=n.codeEditor.codemirror.getDoc(),a=o.getCursor();o.replaceRange("{{{poi."+t+"}}}",a);break;case"open":mapp.lib.ajax({type:"GET",data:{action:"mapp_tpl_get",name:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!0,name:t,tab:"editor",template:e.data.template,tokens:e.data.tokens})}});break;case"save":var i="editor"==n.tab?n.codeEditor.codemirror.getValue():n.template.content;mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_save",content:i,name:n.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!1,template:null,tokens:null})}});break;case"tab-select":if("editor"!=t){var l=p({},n.template);l.content=n.codeEditor.codemirror.getValue(),r({template:l})}r({tab:t})}}return m("div",{className:"mapp-templates"},(l=[{name:"map-popup",label:__("Map popup")},{name:"map-item",label:__("Map list item")},{name:"mashup-popup",label:__("Mashup popup")},{name:"mashup-item",label:__("Mashup list item")}],m("div",{className:"mapp-templates-list"},_.map(l,(function(e,t){return m("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:function(t){t.preventDefault(),c("open",e.name)}},e.label)})))),n.isOpen&&n.template?m(O,{title:(i=n.template.name+" ("+(n.template.exists?__("Custom"):__("New"))+")",m("div",{className:"mapp-templates-name"},i)),className:"mapp-templates-modal",onRequestClose:function(){return c("close")},shouldCloseOnClickOutside:!1},m(k,{className:"mapp-templates-tabs",onSelect:function(e){return c("tab-select",e)},tabs:[{name:"editor",title:__("Editor")},{name:"standard",title:__("Default")}]},(function(e){return t=m("div",{className:"mapp-templates-tokens"},_.map(n.tokens,(function(e,t){return m("code",{onClick:function(){return c("insert",e)},key:t,title:e},e)}))),o=m("div",{className:"mapp-templates-path"},n.template.path),m(f,null,"editor"==n.tab&&o,"editor"==n.tab&&t,m("div",{className:"editor"==n.tab?"mapp-templates-editor":"mapp-templates-standard"},m("textarea",{ref:s,defaultValue:"editor"==n.tab?n.template.content:n.template.standard})));var t,o})),m("div",{className:"mapp-templates-toolbar"},m(v,{isPrimary:!0,onClick:function(){return c("save")}},__("Save")),m(v,{isSecondary:!0,onClick:function(){return c("close")}},__("Cancel")),n.template.exists&&m("a",{onClick:function(e){e.preventDefault(),c("delete")}},__("Delete")))):null)}},149:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var o=wp.element.createElement,a=(wp.data.select,wp.element),r=(a.Fragment,a.useEffect,a.useLayoutEffect,a.useRef,a.useState,wp.components),i=(r.BaseControl,r.Button),sprintf=(r.Dashicon,r.Modal,r.PanelBody,r.RadioControl,r.Spinner,r.TextControl,wp.i18n.sprintf);function l(e){function t(t,n){var o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.onChange(e.page+1);break;case"prev":e.onChange(e.page-1)}}return a=Math.ceil(e.count/e.pageSize),r=e.page<=1,l=e.page>=a,o("div",{className:"mapp-paginate"},o(i,{disabled:r,onClick:function(){return t("first")},isSecondary:!0},"«"),o(i,{disabled:r,onClick:function(){return t("prev")},isSecondary:!0},"‹"),o("div",{className:"mapp-paginate-count"},sprintf((n="%d of %d",wp.i18n.__(n,"mappress-google-maps-for-wordpress")),e.page,a)),o(i,{disabled:l,onClick:function(){return t("next")},isSecondary:!0},"›"),o(i,{disabled:l,onClick:function(){return t("last")},isSecondary:!0},"»"));var n,a,r,l}},477:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var o=n(713),a=n(999),r=n(149);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var u=window.mapp||{},m=wp.element.createElement,d=wp.data.select,f=wp.element,h=(f.Fragment,f.useEffect),y=(f.useLayoutEffect,f.useRef),g=f.useState,b=wp.components,v=(b.BaseControl,b.Button),w=b.Dashicon,O=b.Modal,k=(b.PanelBody,b.RadioControl),C=b.Spinner,S=b.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function P(e){var t=p(g({isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:"",type:mappl10n.options.postid?"post":"all"}),2),n=t[0],i=t[1],s=y(null),c=y(null);function f(e){i((function(t){return l(l({},t),e)}))}function b(t,o){switch(t){case"attach":u.store.mutateMap({mapdata:o});break;case"add-new":f({mode:"edit",mapid:null});break;case"change-type":f({type:o});break;case"close":e.onAction("pick-close");break;case"duplicate":u.store.duplicateMap({mapid:o,success:function(e){alert(__("Map copied")),f({mapid:e.mapid}),jQuery(".mapp-pick-items").scrollTop(0)}});break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(u.store.destroyMap({mapid:o}),o==n.mapid&&e.onAction("pick-destroy",o)),s.current.focus();break;case"edit":f({mode:"edit",mapid:o});break;case"edit-close":"edit"==e.mode?e.onAction("pick-close"):f({mode:"list"});break;case"edit-destroy":f({mode:"list",mapid:null}),e.onAction("pick-destroy",o);break;case"edit-save":"edit"==e.mode?e.onAction("pick-close",o):f({mode:"list",mapid:o});break;case"insert":e.onAction("pick-insert",o);break;case"shortcode":e.onAction("pick-shortcode",o);break;case"sort":u.store.setSort({sortBy:o,sortAsc:u.store.state.sortBy!=o||!u.store.state.sortAsc})}}function P(t){var a,r=t.mapid==n.mapid;a=t.map_title?t.map_title:__("Untitled");var i=function(t){var n;return n=(n="map"==e.context||"mashup"==e.context&&t.postid==mappl10n.options.postid?d("core/editor").getEditedPostAttribute("title"):t.post_title)||__("Untitled"),t.postid>0&&t.postid==mappl10n.options.postid&&(n=__("Current post")),t.postid>0?t.postid==mappl10n.options.postid?n:m("a",{href:mappl10n.options.editurl+"?post="+t.postid+"&action=edit",target:"_blank",title:__("Edit post")},n):__("Unattached")}(t),l=[{action:"edit",label:__("Edit")},{action:"insert",label:__("Insert into post")},{action:"duplicate",label:__("Copy")},{action:"shortcode",label:__("Shortcode")},{action:"destroy",label:__("Delete")}];"library"==e.context?l.splice(1,1):l.splice(3,1),l=m("div",{className:"mapp-pick-actions"},l.map((function(e){return m("a",{href:"#",key:e.action,onClick:function(n){n.stopPropagation(),n.preventDefault(),b(e.action,t.mapid)}},e.label)})));var s=null;return s=t.postid>0?m("a",{href:"#",onClick:function(){return b("attach",{mapid:t.mapid,postid:0})}},__("Detach")):"library"==e.context?m(o.default,{onChange:function(e,n){return b("attach",{mapid:t.mapid,postid:e,post_title:n})}},__("Attach")):m("a",{href:"#",onClick:function(){return b("attach",{mapid:t.mapid,postid:mappl10n.options.postid,post_title:null})}},__("Attach")),m("div",{className:"mapp-pick-item"+(r?" mapp-selected":""),key:t.mapid+"|"+t.postid,ref:r?c:null},m("div",{className:"mapp-pick-col-map_title",onClick:function(e){return b("edit",t.mapid)}},m("div",null,a),m("div",null,l)),m("div",{className:"mapp-pick-col-mapid"},t.mapid),m("div",{className:"mapp-pick-col-post_title"},i,m("div",null,s)))}h((function(){var e=function(e){f({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return u.store.subscribe(e),function(){return u.store.unsubscribe(e)}})),h((function(){s.current&&s.current.focus(),u.store.fetchItems()}),[]),h((function(){f({page:1})}),[n.type,n.search]),h((function(){c.current&&u.lib.scrollTo(jQuery(".mapp-pick-items"),jQuery(c.current))}),[n.type,n.items]);var j=_.filter(n.items,(function(t){if("post"==n.type&&t.postid!=mappl10n.options.postid)return!1;if("current"==n.type&&t.mapid!=e.mapid)return!1;var o=n.search.toLowerCase();return!o||(t.mapid.indexOf(o)>=0||(!!(t.post_title&&t.post_title.toLowerCase().indexOf(o)>=0)||!!(t.map_title&&t.map_title.toLowerCase().indexOf(o)>=0)))})),x=m("div",{className:"mapp-list-panel"},m("div",{className:"mapp-gt-modal-header"},m("div",{className:"mapp-gt-modal-header-title"},m("h1",null,__("Select a map")),m(v,{isPrimary:!0,onClick:function(){return b("add-new")}},__("Add New"))),m(v,{onClick:function(){return b("close")},icon:"no-alt"})),function(){var t=[{label:__("Attached to post"),value:"post"},{label:__("All maps"),value:"all"}];e.mapid&&t.unshift({label:__("Current map"),value:"current"});var o="library"==e.context?null:m(k,{className:"mapp-pick-type",options:t,onChange:function(e){return b("change-type",e)},selected:n.type}),a=n.isFetchingItems||n.isAttaching&&"library"!=e.context;return m("div",{className:"mapp-pick-filter"},a&&m(C,null),m(S,{ref:s,className:"mapp-pick-search",tabIndex:1,label:__("Search"),placeholder:__("post title, map title, or map id"),onChange:function(e){return f({search:e})}}),o)}(),function(e){if(e){var t=20*(n.page-1),o=t+20;e=e.slice(t,o)}var a,r="";return r=n.isFetchingItems?null:e.length?_.map(e,P):m("div",{className:"mapp-pick-message"},__("No maps found")),m("div",{className:"mapp-pick-items-section"},m("div",{className:"mapp-pick-items"},(a={map_title:__("Map title"),mapid:__("Map ID"),post_title:__("Attached to")},m("div",{className:"mapp-pick-items-header"},_.map(a,(function(e,t){return m("div",{className:"mapp-pick-col-"+t,onClick:function(){return b("sort",t)},key:t},e,u.store.state.sortBy==t&&m(w,{icon:u.store.state.sortAsc?"arrow-up":"arrow-down"}))})))),r))}(j),function(t){return m("div",{className:"mapp-pick-toolbar"},"library"!=e.context?m(v,{onClick:function(){return b("close")}},__("Cancel")):null,function(e){return e&&e.length?m(r.Z,{count:e?e.length:0,onChange:function(e){return f({page:e})},page:n.page,pageSize:20}):null}(t))}(j)),N=null;if("edit"==n.mode){var I=m("div",{className:"mapp-edit-panel"},m(a.default,{context:e.context,mapid:n.mapid,onAction:b}));N="library"==e.context?m(O,{className:"mapp-gt-modal",isDismissible:!1},I):I}var M="mapp-pick mapp-mode-"+n.mode+" mapp-context-"+e.context;return"library"==e.context?m("div",{className:M},x,N):m(O,{className:"mapp-gt-modal "+M,isDismissible:"list"==n.mode,onRequestClose:function(){return b("close")},shouldCloseOnEsc:"list"==n.mode,shouldCloseOnClickOutside:"list"==n.mode},x,N)}},429:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappSettings:()=>b});var o=n(710);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}window.mapp;var i=wp.element.createElement,l=wp.element,s=l.Fragment,p=(l.useEffect,l.useLayoutEffect,l.useRef,l.useState),c=wp.components,u=c.BaseControl,m=c.Button,d=c.ButtonGroup,f=(c.Dashicon,c.Dropdown,c.Panel,c.PanelBody),h=c.PanelRow,y=(c.RadioControl,c.SelectControl),g=c.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function b(e){var t,n=a(p({}),2);n[0],n[1];function r(e){if(!e||"string"!=typeof e)return e;var t={px:2048,vw:100,vh:100,"%":100},n=parseInt(e),o=2048,a="";for(var r in t)e.includes(r)&&(a=r,o=t[r]);return n>o?o+a:e}function l(t,n){var o=null;switch(t){case"poiList":e.map.set({poiList:n}),o={poiList:n};break;case"size":n.hasOwnProperty("height")&&(n.height=r(n.height)),n.hasOwnProperty("width")&&(n.width=r(n.width)),e.map.setSize(n),o=n;break;case"style-set-maptypeid":e.map&&e.map.set({mapTypeId:n}),o={mapTypeId:n};break;case"viewport-reset":e.map.center=e.map.zoom=null,e.map.recenter(),o={center:void 0,zoom:void 0};break;case"viewport-set":var a=e.map.getCenter().toJSON();e.map.center=a,e.map.zoom=e.map.getZoom(),o={center:a.lat+","+a.lng,zoom:e.map.getZoom()},"mce"==e.context||"library"==e.context?alert(__("Viewport set")):wp.data.dispatch("core/notices").createNotice("success",__("Viewport set"),{type:"snackbar",isDismissible:!0})}o&&e.onAction("change-settings",o)}return i("div",{className:"mapp-settings"},i(f,{title:__("Map settings")},(t=e.map.title?e.map.title:__("Untitled"),i(h,null,"map"==e.context&&i(u,{className:"mapp-settings-title"},t),i(u,{className:"mapp-settings-id",label:__("Map ID")},e.map.mapid))),function(){if("mashup"==e.context)return i(h,{className:"mapp-style-toggle"},__("Style"),i(o.m,{map:e.map,selected:e.map.mapTypeId,onChange:function(e){return l("style-set-maptypeid",e)}}))}(),function(){var t=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=mappl10n.options.sizes.map((function(e,t){return{label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1}}));n.unshift({height:"",label:__("Default"),value:0,width:""}),n.push({label:__("Custom"),value:"custom",disabled:!0});for(var o="custom",a=0;a<n.length-1;a++)n[a].width==e.width&&n[a].height==e.height&&(o=a);return i(s,null,i(y,{className:"mapp-settings-dims-select",help:"",label:__("Size"),value:o,options:n,onChange:function(e){return l("size",{width:n[e].width,height:n[e].height})}}),i(h,null,i(g,{className:"mapp-settings-dims-custom",help:__("px, %, vw"),label:__("Width"),onChange:function(e){return l("size",{width:e})},placeholder:t.width,value:e.width?e.width:""}),i(g,{className:"mapp-settings-dims-custom",help:__("px, %, vh"),label:__("Height"),onChange:function(e){return l("size",{height:e})},placeholder:t.height,value:e.height?e.height:""})))}(),(e.center&&(e.center.lat,e.center.lng,__("Zoom"),e.zoom),i(s,null,i(u,{className:"mapp-settings-viewport",label:__("Center/Zoom")},i(d,{label:__("Center/Zoom")},i(m,{onClick:function(){return l("viewport-reset")},isPressed:!e.center,isSmall:!0},__("Automatic")),i(m,{onClick:function(){return l("viewport-set")},isPressed:e.center,isSmall:!0},__("Set"))))))))}},787:()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var r=window.mapp||{};r.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"map_title",sortAsc:!0,maps:{},items:[]}},r.Store.prototype={createMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t;this.state.isFetchingMap=!1,this.publish(),n()},destroyMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;r.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(delete l.state.maps[t],l.destroyItem(t),o(t)):i(),l.publish()}})},duplicateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_duplicate",mapid:t,postid:mappl10n.options.postid,nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),o(t)}else i();l.state.isSavingMap=!1,l.publish()}})},fetchMap:function(e){var t=e.mapid,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;if(void 0!==this.state.maps[t])return l.publish(),void o(this.state.maps[t]);this.state.isFetchingMap=!0,l.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[t]=e.data,o(e.data)):i(),l.state.isFetchingMap=!1,l.publish()}})},mutateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;this.state.isSavingMap=!0,this.saveItem(t),this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_mutate",mapdata:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[e.data.mapid]=e.data,o(t)):i(),l.state.isSavingMap=!1,l.publish()}})},saveMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,o=void 0===n?function(){}:n,a=e.failure,i=void 0===a?function(){}:a,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(t),nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),o(t)}else i();l.state.isSavingMap=!1,l.publish()}})},destroyItem:function(e){var t=this.state.items?this.state.items:[],o=_.findIndex(t,{mapid:e});o>-1&&t.splice(o,1),this.state.items=n(t),this.publish()},fetchItems:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t,o=e.failure,a=void 0===o?function(){}:o,i=this;if(this.state.itemsFetched)return n(this.state.items),void i.publish();this.state.isFetchingItems=!0,i.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(i.state.items=e.data,i.sort(),n(i.state.items),i.state.itemsFetched=!0):a(),i.state.isFetchingItems=!1,i.sort(),i.publish()}})},saveItem:function(n){var o=this.state.items?this.state.items:[],a=_.findWhere(o,{mapid:n.mapid});a?(a.mapid=void 0!==n.mapid?n.mapid:a.mapid,a.map_title=void 0!==n.title?n.title:a.map_title,a.postid=void 0!==n.postid?n.postid:a.postid,a.post_title=void 0!==n.post_title?n.post_title:a.post_title,a=function(n){for(var o=1;o<arguments.length;o++){var a=null!=arguments[o]?arguments[o]:{};o%2?e(Object(a),!0).forEach((function(e){t(n,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}))}return n}({},a)):(a={mapid:n.mapid,map_title:n.title,postid:mappl10n.options.postid,post_title:null},o.unshift(a))},setSort:function(e){e.sortBy&&(this.state.sortBy=e.sortBy),void 0!==e.sortAsc&&(this.state.sortAsc=e.sortAsc),this.sort(),this.publish()},sort:function(e,t){var n,o=this,a=(n="untitled",wp.i18n.__(n,"mappress-google-maps-for-wordpress"));this.state.items.sort((function(e,t){return function(e,t,n,o){if(o=o?1:-1,"mapid"==n)return o*(Number(e.mapid)-Number(t.mapid));var r=e[n]?e[n]:a,i=t[n]?t[n]:a,l=o*r.localeCompare(i);return 0==l?Number(e.mapid)-Number(t.mapid):l}(e,t,o.state.sortBy,o.state.sortAsc)}))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(_e){throw _e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw i}}}}(n(this.subs));try{for(t.s();!(e=t.n()).done;){(0,e.value)(this.state)}}catch(e){t.e(e)}finally{t.f()}}},r.store=new r.Store},710:(e,t,n)=>{"use strict";n.d(t,{m:()=>w});var o=n(824),a=n(149);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,o=!1,_e=void 0;try{for(var a,r=e[Symbol.iterator]();!(_n=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var c=wp.element.createElement,u=wp.element,m=u.Fragment,d=(u.useEffect,u.useLayoutEffect,u.useRef,u.useState),f=wp.components,h=f.Button,y=(f.Dashicon,f.ExternalLink),g=f.Icon,b=f.Modal,v=(f.Panel,f.PanelBody,f.PanelRow,f.Spinner),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function w(e){var t,n,r,l,p,u,f,w=s(d({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",snazzyPagination:null,snazzySearch:"",snazzyStyles:null,isOpen:!1,isSaving:!0,isSearching:!1,json:"",map:null,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,style:mappl10n.options.style,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles}),2),O=w[0],k=w[1];function C(e){k((function(t){return i(i({},t),e)}))}function S(t){var n=_.findIndex(O.userStyles,{id:t.id});if(n>=0){if(!confirm(__("Style already exists, overwrite?")))return;mappl10n.options.userStyles[n]=t}else mappl10n.options.userStyles.push(t);C({isOpen:!1,mode:"pick",userStyles:mappl10n.options.userStyles,selected:t.id}),e.onChange(t.id),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",setting:"leaflet"==mappl10n.options.engine?"stylesMapbox":"stylesGoogle",value:mappl10n.options.userStyles,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&(mappl10n.options.userStyles=e.data,C({userStyles:e.data}))}})}function P(e){C({isSearching:!0,snazzyStyles:null}),mapp.lib.ajax({type:"GET",data:{sort:"popular",page:e,pageSize:20,text:O.snazzySearch,key:O.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){(C({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles)?C({snazzyStyles:_.map(e.styles,(function(e,t){return e.id=e.id+"",e}))}):alert("Error: unable to fetch styles")}})}function j(e,t){t="large"==t||"small"==t?t:"small",t=800;var n=mappl10n.options.baseurl+"/images/roadmap.png";return"leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(n="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):n=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(n=e.imageUrl),c("img",{src:n,title:e.name})}function x(t,n){switch(t){case"close":C({isOpen:!1});break;case"json-cancel":C({mode:"pick"});break;case"json-change":C({json:n});break;case"json-save":var o=_.findWhere(O.userStyles,{id:e.value});o&&(o.json=JSON.stringify(JSON.parse(O.json)),S(o));break;case"mapbox-cancel":C({mode:"pick"});break;case"mapbox-change-url":var a,r,i=n.trim().toLowerCase().replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/","").split("?")[0].split("/");2==i.length&&(a=i[0],r=i[1]),C({mapboxUrl:n,mapboxUser:a,mapboxId:r});break;case"mapbox-save":O.mapboxName&&O.mapboxUser&&S({id:O.mapboxId,name:O.mapboxName,mapboxid:O.mapboxId,provider:"mapbox",url:O.mapboxUrl,user:O.mapboxUser});break;case"mode":C({mode:n});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?C({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen."));break;case"pick-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"pick-cancel":C({isOpen:!1});break;case"pick-delete":confirm(mappl10n.delete_prompt)&&function(t){var n=_.findIndex(O.userStyles,{id:t});if(n<0)mapp.lib.alert("Invalid delete");else{var o=O.userStyles;o.splice(n,1),mappl10n.options.userStyles=o,C({userStyles:o}),e.selected==t&&e.onChange(null),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",setting:"leaflet"==mappl10n.options.engine?"stylesMapbox":"stylesGoogle",value:o,nonce:mappl10n.options.nonce},callback:function(e){}})}}(n);break;case"pick-edit":e.onChange(n.id),"leaflet"==mappl10n.options.engine?C({mode:"mapbox",mapboxId:n.mapboxid,mapboxName:n.name,mapboxUrl:n.url,mapboxUser:n.user}):C({json:n.json,mode:"json"});break;case"pick-select":e.onChange(n.id),C({isOpen:!1});break;case"snazzy-cancel":C({mode:"pick"});break;case"snazzy-save":var l=n;l&&S({id:l.id,imageUrl:l.imageUrl,json:l.json,name:l.name});break;case"snazzy-search":P()}}function N(e){var t;return t=e.styles&&e.styles.length?_.map(e.styles,(function(t,n){return function(e,t){var n="mapp-style"+(t.selected==e.id?" mapp-selected":""),o=t.onDelete?c(g,{icon:"trash",onClick:function(){return t.onDelete(e.id)}}):null,a=t.onEdit?c("a",{onClick:function(){return t.onEdit(e)}},__("Edit")):null;return c("div",{className:n,key:e.id},c("div",{className:"mapp-style-image",onClick:function(){return t.onSelect(e)}},j(e)),c("div",{className:"mapp-style-details"},c("div",{className:"mapp-style-title"},e.name),c("div",{className:"mapp-style-actions"},a,o)))}(t,e)})):O.isSearching?"":c("div",{className:"mapp-style-list-msg"},__("No results")),c("div",{className:"mapp-style-list-wrapper"},c("div",{className:"mapp-style-list-header"},e.title),c("div",{className:"mapp-style-list"},t))}return c(m,null,(p=O.standardStyles.concat(O.userStyles),u=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,f=(f=_.findWhere(p,{id:u}))||O.standardStyles[0],c(h,{className:"mapp-style-toggle",icon:j(f),iconSize:75,isSecondary:!0,onClick:function(){return x("open",null)},title:f.name})),"edit"==O.mode&&O.isOpen&&renderEdit(),"json"==O.mode&&O.isOpen&&function(){var e,t,n;try{e=JSON.parse(O.json),t=JSON.stringify(e,null,2)}catch(e){n=e.toString(),t=O.json}var o=n?"mapp-style-json mapp-style-error":"mapp-style-json";return c(b,{title:__("Edit style JSON"),className:"mapp-style-modal",onRequestClose:function(){return x("json-cancel")},shouldCloseOnClickOutside:!0},c("div",{className:o},c("textarea",{value:t,spellCheck:!1,onChange:function(e){return x("json-change",e.target.value)}})),c("div",{className:"mapp-style-json-error"},n||""),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{disabled:n,isPrimary:!0,onClick:function(){return x("json-save")}},__("Save")),c(h,{onClick:function(){return x("json-cancel")}},__("Cancel")))))}(),"mapbox"==O.mode&&O.isOpen&&(r=O.mapboxUser&&O.mapboxId?j({user:O.mapboxUser,mapboxid:O.mapboxId,name:O.mapboxName},"large"):null,l=!O.mapboxUser||!O.mapboxId||!O.mapboxName,c(b,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:function(){return x("mapbox-cancel")},shouldCloseOnClickOutside:!0},c("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),c(y,{href:"https://studio.mapbox.com"})),c("form",{className:"mapp-style-mapbox-form",onSubmit:function(e){e.preventDefault()}},c("label",null,c("span",{className:"mapp-style-mapbox-label"},__("MapBox Share URL")),c(o.Help,{href:"#toc-mapbox-studio-styles"}),c(o.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",value:O.mapboxUrl,onChange:function(e){return x("mapbox-change-url",e)}})),c("label",null,c("div",{className:"mapp-style-mapbox-label"},__("Style name")),c(o.Input,{className:"mapp-style-mapbox-name",value:O.mapboxName,onChange:function(e){return C({mapboxName:e})}})),c("div",{className:"mapp-style-mapbox-preview"},r),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{isPrimary:!0,disabled:l,onClick:function(){return x("mapbox-save",O.snazzySelected)},type:"submit"},__("Save")),c(h,{onClick:function(){return x("mapbox-cancel")}},__("Cancel"))))))),"pick"==O.mode&&O.isOpen&&(n="",O.userStyles&&O.userStyles.length&&(n=N({selected:e.selected,onEdit:function(e){return x("pick-edit",e)},onDelete:function(e){return x("pick-delete",e)},onSelect:function(e){return x("pick-select",e)},styles:O.userStyles,title:__("Custom styles")})),c(b,{title:c("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:function(){return x("close")}},c("div",{className:"mapp-style-list-wrapper"},N({onSelect:function(e){return x("pick-select",e)},selected:e.selected,styles:O.standardStyles,title:__("Standard styles")}),n),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{isPrimary:!0,onClick:function(){return x("pick-add")}},__("New style")),c(h,{onClick:function(){return x("pick-cancel")}},__("Cancel")))))),"snazzy"==O.mode&&O.isOpen&&(O.snazzySelected,c(b,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:function(){return x("snazzy-cancel")},shouldCloseOnClickOutside:!0},c("form",{className:"mapp-style-snazzy-form",onSubmit:function(e){x("snazzy-search"),e.preventDefault()}},c(o.Input,{className:"mapp-style-snazzy-search",value:O.search,placeholder:__("Search"),onChange:function(e){return C({snazzySearch:e})}}),O.isSearching&&c(v,null),!O.isSearching&&c(h,{isPrimary:!0,icon:"search",onClick:function(){return x("snazzy-search")}})),N({selected:O.snazzySelected,styles:O.snazzyStyles,onSelect:function(e){return x("snazzy-save",e)}}),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{onClick:function(){return x("snazzy-cancel")}},__("Cancel"))),(t=O.snazzyPagination)&&O.snazzyStyles&&O.snazzyStyles.length?c(a.Z,{count:t.totalItems,onChange:function(e){return P(e)},page:t.currentPage,pageSize:t.pageSize}):null))))}},308:(e,t,n)=>{"use strict";e.exports=function(e,t){var o,a,r,i,l,s,p,c,u,m,d,f,h,y=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),g=y.length,b=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},v="undefined"!=typeof window?window:n.g;v.$locutus=v.$locutus||{};var w=v.$locutus;for(w.php=w.php||{},t||(t=v),o=0;o<g&&(u=b((c=y[o].split("="))[0]),m=c.length<2?"":b(c[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));o++){for(;" "===u.charAt(0);)u=u.slice(1);if(u.indexOf("\0")>-1&&(u=u.slice(0,u.indexOf("\0"))),u&&"["!==u.charAt(0)){for(f=[],d=0,a=0;a<u.length;a++)if("["!==u.charAt(a)||d){if("]"===u.charAt(a)&&d&&(f.length||f.push(u.slice(0,d-1)),f.push(u.substr(d,a-d)),d=0,"["!==u.charAt(a+1)))break}else d=a+1;for(f.length||(f=[u]),a=0;a<f[0].length&&(" "!==(p=f[0].charAt(a))&&"."!==p&&"["!==p||(f[0]=f[0].substr(0,a)+"_"+f[0].substr(a+1)),"["!==p);a++);for(s=t,a=0,h=f.length;a<h;a++){if(l=s,(""===(u=f[a].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==a){for(i in r=-1,s)s.hasOwnProperty(i)&&+i>r&&i.match(/^\d+$/g)&&(r=+i);u=r+1}Object(s[u])!==s[u]&&(s[u]={}),s=s[u]}l[u]=m}}}}},t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(787),n(215),n(713),n(525),n(999),n(143),n(800),n(938),n(816),n(378),n(498),n(670),n(218),n(824),n(477),n(429)})();
css/mappress.css CHANGED
@@ -175,6 +175,8 @@ only screen and (min-device-pixel-ratio: 2) {
175
  .mapp-list-header
176
  .mapp-items
177
  .mapp-item (one for each POI)
 
 
178
  -----------------------------------------------------------------------------------
179
  */
180
 
@@ -235,6 +237,7 @@ only screen and (min-device-pixel-ratio: 2) {
235
  }
236
 
237
  .mapp-list .mapp-items {
 
238
  overflow: auto;
239
  }
240
 
@@ -253,9 +256,9 @@ only screen and (min-device-pixel-ratio: 2) {
253
  flex: 1;
254
  }
255
 
256
- .mapp-list .mapp-item .mapp-title {
257
- overflow: hidden;
258
- vertical-align: middle;
259
  }
260
 
261
  .mapp-list .mapp-item.mapp-selected {
@@ -272,35 +275,83 @@ only screen and (min-device-pixel-ratio: 2) {
272
 
273
  .mapp-list .mapp-item .mapp-icon {
274
  border: none; /* 2011 */
275
- float: left;
276
- margin-right: 5px;
277
  max-width: 32px !important; /* 2012 tries to override */
278
  max-height: 32px;
279
  padding: 0; /* 2011 */
280
  }
281
 
282
- /* Thumbnails in lists. Default is right */
283
- .mapp-list .mapp-item .mapp-thumbnail {
284
- max-width: 40%;
 
 
285
  }
286
 
287
- .mapp-list.mapp-thumb-top .mapp-thumbnail {
288
- max-width: 100%;
289
- padding-bottom: 10px;
 
 
 
 
 
 
 
 
 
 
 
290
  }
291
 
292
- .mapp-list.mapp-thumb-left .mapp-item {
293
- flex-direction: row-reverse;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  }
295
 
 
 
 
 
 
 
 
 
296
  .mapp-list.mapp-thumb-top .mapp-item {
297
- flex-direction: column;
298
  }
299
 
300
- .mapp-list.mapp-thumb-top .mapp-info {
301
- padding-top: 10px;
 
302
  }
303
 
 
 
 
 
 
 
 
 
304
 
305
  /*
306
  -----------------------------------------------------------------------------------
@@ -411,14 +462,15 @@ only screen and (min-device-pixel-ratio: 2) {
411
  */
412
 
413
  .mapp-filters-toggle {
414
- vertical-align: middle; /* Required in firefox */
 
415
  }
416
 
417
  .mapp-filters {
418
  background-color: white;
419
  border-bottom: 1px solid lightgray;
420
  display: none;
421
- max-height: 100%;
422
  position: absolute;
423
  top: 0; left: 0; right: 0;
424
  z-index: 1;
@@ -441,6 +493,7 @@ only screen and (min-device-pixel-ratio: 2) {
441
 
442
  .mapp-filter-label {
443
  font-weight: bold;
 
444
  }
445
 
446
  /* Select filters are displayed inline next to their label */
@@ -488,7 +541,7 @@ only screen and (min-device-pixel-ratio: 2) {
488
  .mapp-ib-tip - triangle tip
489
 
490
  Classses applied to mapp-ib-wrapper:
491
- type .mapp-ib-popup | .mapp-ib-edit | .mapp-open
492
 
493
  Classes applied to mapp-iw:
494
  template name .mapp-map-popup | .mapp-mashup-popup
@@ -498,9 +551,9 @@ only screen and (min-device-pixel-ratio: 2) {
498
  /* Positioning element: width prevents clipping, height must be zero or it'll obscure canvas */
499
  .mapp-ib-wrapper {
500
  display: none;
501
- height: 0px;
 
502
  position: absolute;
503
- width: 9999px;
504
  }
505
 
506
  .mapp-ib-wrapper.mapp-open {
@@ -508,13 +561,9 @@ only screen and (min-device-pixel-ratio: 2) {
508
  }
509
 
510
  .mapp-ib-content {
511
- bottom: 0; left: 0;
512
  display: flex;
513
  flex-direction: column;
514
  line-height: 0; /* Prevent font from distorting tip */
515
- max-height: 300px;
516
- max-width: 400px;
517
- position: absolute;
518
  z-index: 1005; /* Needed for Leaflet, above menu icon, below menu */
519
  }
520
 
@@ -678,26 +727,44 @@ only screen and (min-device-pixel-ratio: 2) {
678
  text-decoration: none !important;
679
  }
680
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
681
  .mapp-iw .mapp-info {
682
  display: flex;
683
  flex: 1;
684
  flex-direction: column;
 
685
  overflow: hidden;
686
- padding: 10px;
687
  }
688
 
689
  .mapp-iw .mapp-title {
690
  font-weight: bold;
 
 
691
  }
692
 
693
  .mapp-iw .mapp-body {
694
  flex: 1;
695
  overflow: auto;
696
  overflow-wrap: break-word;
 
697
  }
698
 
699
  .mapp-iw .mapp-links {
700
- margin-top: 10px;
 
701
  }
702
 
703
  /* Make directions look like a link */
@@ -722,45 +789,32 @@ only screen and (min-device-pixel-ratio: 2) {
722
  -----------------------------------------------------------------------------------
723
  */
724
 
725
- .mapp-iw .mapp-thumbnail {
726
- overflow: hidden;
 
 
727
  }
728
 
729
- .mapp-iw .mapp-thumbnail a {
730
- display: flex;
731
  }
732
 
733
- /* Try to get consistent sizing for featured image */
734
- .mapp-iw .mapp-thumbnail img {
735
- max-width: 100% !important;
736
- object-fit: cover;
 
737
  }
738
 
739
  .mapp-iw.mapp-thumb-left {
740
  flex-direction: row;
741
  }
742
 
743
- .mapp-iw.mapp-thumb-left .mapp-thumbnail {
744
- max-width: 40%;
745
- }
746
-
747
  .mapp-iw.mapp-thumb-right {
748
  flex-direction: row-reverse;
749
  }
750
 
751
- .mapp-iw.mapp-thumb-right .mapp-thumbnail {
752
- max-width: 40%;
753
- }
754
 
755
- .mapp-iw.mapp-thumb-top {
756
- flex-direction: column;
757
- }
758
-
759
- /* Trick to size the .mapp-info section to the featured image. Popups w/o an image will be min-size. */
760
- .mapp-iw.mapp-thumb-top .mapp-info {
761
- min-width: 100%;
762
- width: 0;
763
- }
764
 
765
  /*
766
  -----------------------------------------------------------------------------------
@@ -799,7 +853,7 @@ only screen and (min-device-pixel-ratio: 2) {
799
  .mapp-inline .mapp-list {
800
  border-right: none;
801
  border-top: 1px solid lightgray;
802
- max-height: 250px;
803
  max-width: none;
804
  width: auto;
805
  }
@@ -848,6 +902,10 @@ only screen and (min-device-pixel-ratio: 2) {
848
 
849
  .mapp-footer [data-mapp-action="view-map"] { display: none; }
850
 
 
 
 
 
851
  /* In mini view place the list under the map */
852
  .mapp-view-mini .mapp-main {
853
  flex-direction: column-reverse;
175
  .mapp-list-header
176
  .mapp-items
177
  .mapp-item (one for each POI)
178
+ .mapp-list-footer
179
+ .mapp-paginate
180
  -----------------------------------------------------------------------------------
181
  */
182
 
237
  }
238
 
239
  .mapp-list .mapp-items {
240
+ flex: 1;
241
  overflow: auto;
242
  }
243
 
256
  flex: 1;
257
  }
258
 
259
+ .mapp-list .mapp-title {
260
+ flex: 1;
261
+ padding: 10px;
262
  }
263
 
264
  .mapp-list .mapp-item.mapp-selected {
275
 
276
  .mapp-list .mapp-item .mapp-icon {
277
  border: none; /* 2011 */
 
 
278
  max-width: 32px !important; /* 2012 tries to override */
279
  max-height: 32px;
280
  padding: 0; /* 2011 */
281
  }
282
 
283
+ .mapp-list-footer {
284
+ border-top: 1px solid lightgray;
285
+ display: flex;
286
+ justify-content: center;
287
+ padding: 10px;
288
  }
289
 
290
+
291
+ /*
292
+ -----------------------------------------------------------------------------------
293
+ Pagination
294
+ For: poi list, library picker, and style modal
295
+ -----------------------------------------------------------------------------------
296
+ */
297
+
298
+ .mapp-paginate {}
299
+
300
+ /* Backend buttons are button elements */
301
+ .mapp-paginate button {
302
+ font-size: 16px;
303
+ margin: 0 5px;
304
  }
305
 
306
+ /* Frontend buttons are divs to prevent theme interference w/styling */
307
+ .mapp-paginate-button {
308
+ align-items: center;
309
+ background-color: #eee;
310
+ border: 1px solid lightgray;
311
+ border-radius: 5px;
312
+ display: inline-flex;
313
+ font-size: 16px;
314
+ height: 25px;
315
+ justify-content: center;
316
+ margin: 0 2px;
317
+ width: 20px;
318
+ }
319
+
320
+ .mapp-paginate-button.mapp-disabled {
321
+ color: #aaa;
322
+ }
323
+
324
+ .mapp-paginate-count {
325
+ display: inline-block;
326
+ min-width: 60px;
327
+ text-align: center;
328
  }
329
 
330
+
331
+ /*
332
+ -----------------------------------------------------------------------------------
333
+ Thumbnail styles
334
+ Default is thumbnail on right
335
+ -----------------------------------------------------------------------------------
336
+ */
337
+
338
  .mapp-list.mapp-thumb-top .mapp-item {
339
+ flex-direction: column-reverse;
340
  }
341
 
342
+ .mapp-list.mapp-thumb-top .mapp-thumbnail img {
343
+ height: auto !important;
344
+ width: 100% !important;
345
  }
346
 
347
+ .mapp-list.mapp-thumb-left .mapp-thumbnail img, .mapp-list.mapp-thumb-right .mapp-thumbnail img {
348
+ max-height: 100px;
349
+ max-width: 100px;
350
+ }
351
+
352
+ .mapp-list.mapp-thumb-left .mapp-item, .mapp-list.mapp-thumb-left .mapp-info {
353
+ flex-direction: row-reverse;
354
+ }
355
 
356
  /*
357
  -----------------------------------------------------------------------------------
462
  */
463
 
464
  .mapp-filters-toggle {
465
+ align-items: center;
466
+ display: flex;
467
  }
468
 
469
  .mapp-filters {
470
  background-color: white;
471
  border-bottom: 1px solid lightgray;
472
  display: none;
473
+ max-height: 75%;
474
  position: absolute;
475
  top: 0; left: 0; right: 0;
476
  z-index: 1;
493
 
494
  .mapp-filter-label {
495
  font-weight: bold;
496
+ padding: 10px 0;
497
  }
498
 
499
  /* Select filters are displayed inline next to their label */
541
  .mapp-ib-tip - triangle tip
542
 
543
  Classses applied to mapp-ib-wrapper:
544
+ type / open .mapp-ib-edit | .mapp-open
545
 
546
  Classes applied to mapp-iw:
547
  template name .mapp-map-popup | .mapp-mashup-popup
551
  /* Positioning element: width prevents clipping, height must be zero or it'll obscure canvas */
552
  .mapp-ib-wrapper {
553
  display: none;
554
+ max-height: 60%; /* Based on map size */
555
+ max-width: 60%; /* Based on map size */
556
  position: absolute;
 
557
  }
558
 
559
  .mapp-ib-wrapper.mapp-open {
561
  }
562
 
563
  .mapp-ib-content {
 
564
  display: flex;
565
  flex-direction: column;
566
  line-height: 0; /* Prevent font from distorting tip */
 
 
 
567
  z-index: 1005; /* Needed for Leaflet, above menu icon, below menu */
568
  }
569
 
727
  text-decoration: none !important;
728
  }
729
 
730
+ .mapp-iw .mapp-thumbnail {
731
+ display: flex;
732
+ overflow: hidden;
733
+ }
734
+
735
+ /* Display block removes extra whitespace @ bottom */
736
+ .mapp-iw .mapp-thumbnail img {
737
+ display: block;
738
+ max-height: 100%;
739
+ max-width: 100% !important;
740
+ object-fit: cover;
741
+ }
742
+
743
+
744
  .mapp-iw .mapp-info {
745
  display: flex;
746
  flex: 1;
747
  flex-direction: column;
748
+ min-height: 100px; /* Used when IB is very small and thumbnail is on top */
749
  overflow: hidden;
 
750
  }
751
 
752
  .mapp-iw .mapp-title {
753
  font-weight: bold;
754
+ padding: 10px;
755
+ white-space: nowrap;
756
  }
757
 
758
  .mapp-iw .mapp-body {
759
  flex: 1;
760
  overflow: auto;
761
  overflow-wrap: break-word;
762
+ padding: 0 10px;
763
  }
764
 
765
  .mapp-iw .mapp-links {
766
+ padding: 10px;
767
+ white-space: nowrap;
768
  }
769
 
770
  /* Make directions look like a link */
789
  -----------------------------------------------------------------------------------
790
  */
791
 
792
+ /* Limit info section to width of featured image. */
793
+ .mapp-iw.mapp-thumb-top .mapp-info {
794
+ min-width: 100%;
795
+ width: 0;
796
  }
797
 
798
+ .mapp-iw.mapp-thumb-left .mapp-thumbnail img, .mapp-iw.mapp-thumb-right .mapp-thumbnail img {
799
+ min-height: 100px;
800
  }
801
 
802
+ /* Limit info section to height of featured image. */
803
+ .mapp-iw.mapp-thumb-left .mapp-info, .mapp-iw.mapp-thumb-right .mapp-info {
804
+ min-height: 100%;
805
+ min-width: 150px;
806
+ height: 0;
807
  }
808
 
809
  .mapp-iw.mapp-thumb-left {
810
  flex-direction: row;
811
  }
812
 
 
 
 
 
813
  .mapp-iw.mapp-thumb-right {
814
  flex-direction: row-reverse;
815
  }
816
 
 
 
 
817
 
 
 
 
 
 
 
 
 
 
818
 
819
  /*
820
  -----------------------------------------------------------------------------------
853
  .mapp-inline .mapp-list {
854
  border-right: none;
855
  border-top: 1px solid lightgray;
856
+ max-height: 400px;
857
  max-width: none;
858
  width: auto;
859
  }
902
 
903
  .mapp-footer [data-mapp-action="view-map"] { display: none; }
904
 
905
+ .mapp-view-mini .mapp-filters {
906
+ max-height: none;
907
+ }
908
+
909
  /* In mini view place the list under the map */
910
  .mapp-view-mini .mapp-main {
911
  flex-direction: column-reverse;
css/mappress_admin.css CHANGED
@@ -376,8 +376,13 @@
376
  width: 0;
377
  }
378
 
 
 
 
 
 
379
  .mapp-edit-list.mapp-list-open {
380
- width: 250px;
381
  }
382
 
383
  .mapp-edit-list .mapp-item.mapp-edit-dragover {
@@ -593,10 +598,16 @@ button.mapp-query-refresh {
593
  */
594
 
595
  /* Go for a large dialog, IB will restrict as needed */
 
 
 
 
 
596
  .mapp-ib-wrapper.mapp-ib-edit .mapp-ib-content {
597
  width: 600px;
598
  height: 400px;
599
  }
 
600
  .mapp-ib-wrapper.mapp-ib-edit .mapp-ib {
601
  height: 100%;
602
  }
@@ -902,7 +913,6 @@ button.mapp-query-refresh {
902
  z-index: 1000;
903
  }
904
 
905
-
906
  .mapp-option-section {
907
  background-color: white;
908
  border-bottom: 1px solid lightgray;
@@ -952,6 +962,7 @@ button.mapp-query-refresh {
952
  .mapp-option-label {
953
  margin-left: 5px;
954
  margin-right: 10px;
 
955
  }
956
 
957
  @media only screen and (max-width: 780px) {
@@ -964,21 +975,16 @@ button.mapp-query-refresh {
964
  display: block;
965
  }
966
 
 
 
 
 
967
  }
968
 
969
  .mapp-options label {
970
  margin-right: 20px;
971
  }
972
 
973
- .mapp-options .mapp-help-text {
974
- font-style: italic;
975
- padding-top: 10px;
976
- }
977
-
978
- .mapp-options a.mapp-help-link {
979
- text-decoration: none;
980
- }
981
-
982
  .mapp-options .mapp-license-status {
983
  margin-left: 10px;
984
  }
@@ -1020,6 +1026,32 @@ button.mapp-options-save {
1020
  .mapp-options .mapp-grid-styles .mapp-grid-cell-value textarea { width: 100%; }
1021
  .mapp-options .mapp-grid-styles .mapp-grid-cell-value textarea:focus { min-height: 20em }
1022
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1023
  /*
1024
  -----------------------------------------------------------------------------------
1025
  GT Color picker
@@ -1032,6 +1064,7 @@ button.mapp-options-save {
1032
 
1033
  .mapp-colors {
1034
  overflow: hidden;
 
1035
  width: 320px;
1036
  }
1037
 
@@ -1142,7 +1175,9 @@ button.mapp-options-save {
1142
  display: flex;
1143
  flex-direction: column;
1144
  min-height: 90%;
1145
- min-width: 60vw;
 
 
1146
  }
1147
 
1148
  .mapp-icons-edit-modal h1 {
@@ -1195,7 +1230,32 @@ button.mapp-options-save {
1195
  overflow: auto;
1196
  }
1197
 
1198
- .mapp-icons-edit-preview {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1199
 
1200
  .mapp-icons-edit-shape-wrapper {
1201
  border: 3px solid white;
@@ -1233,7 +1293,6 @@ button.mapp-options-save {
1233
  }
1234
 
1235
  .mapp-icons-edit-glyph-list {
1236
- border: 1px solid lightgray;
1237
  display: flex;
1238
  flex: 1;
1239
  flex-wrap: wrap;
@@ -1246,9 +1305,9 @@ button.mapp-options-save {
1246
  color: black;
1247
  display: flex;
1248
  flex-direction: column;
1249
- height: 120px;
1250
  position: relative;
1251
- width: 130px;
1252
  margin: 1px;
1253
  text-align: center;
1254
  box-sizing: border-box;
@@ -1345,37 +1404,236 @@ button.mapp-icons-edit-set-color {
1345
  width: 32px;
1346
  }
1347
 
1348
- .mapp-icons-shape-heading, .mapp-icons-glyph-heading {
1349
- margin: 10px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
  font-size: 14px;
1351
- font-weight: 600;
 
1352
  }
1353
 
1354
- .mapp-icons-shape-heading {
1355
- display: inline-block;
 
 
 
1356
  }
1357
 
1358
- .mapp-icons-shape-heading .mapp-colors-toggle {
1359
- margin-left: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1360
  }
1361
 
1362
- .mapp-icons-glyph-heading {
1363
  align-items: center;
1364
  display: flex;
1365
- justify-content: space-between;
 
 
 
1366
  }
1367
 
1368
- .mapp-icons-glyph-heading input {
1369
- margin-left: 10px;
1370
  }
1371
 
1372
- .mapp-icons-edit-glyph-section {
1373
- margin-top: 20px;
 
 
 
 
 
 
 
 
 
 
 
1374
  }
1375
 
1376
  /*
1377
  -----------------------------------------------------------------------------------
1378
- GT Template Editor
1379
  -----------------------------------------------------------------------------------
1380
  */
1381
 
@@ -1503,9 +1761,8 @@ a.mapp-templates-item {
1503
 
1504
  .mapp-grid-cell {
1505
  border-bottom: 1px solid lightgray;
1506
- cursor: pointer;
1507
  display: table-cell;
1508
- padding: 5px;
1509
  text-align: center;
1510
  vertical-align: middle;
1511
  }
@@ -1524,28 +1781,6 @@ a.mapp-templates-item {
1524
 
1525
  .mapp-grid-toolbar {}
1526
 
1527
- /*
1528
- -----------------------------------------------------------------------------------
1529
- Pagination
1530
- -----------------------------------------------------------------------------------
1531
- */
1532
-
1533
- .mapp-paginate {
1534
- float: right;
1535
- }
1536
-
1537
- .mapp-paginate button {
1538
- font-size: 16px;
1539
- margin: 0 5px;
1540
- }
1541
-
1542
- .mapp-paginate-count {
1543
- display: inline-block;
1544
- min-width: 60px;
1545
- text-align: center;
1546
- }
1547
-
1548
-
1549
  /*
1550
  -----------------------------------------------------------------------------------
1551
  Misc
376
  width: 0;
377
  }
378
 
379
+ /* Add scrolling without interfering with toggle */
380
+ .mapp-edit-list-wrapper {
381
+ overflow: auto;
382
+ }
383
+
384
  .mapp-edit-list.mapp-list-open {
385
+ width: 280px;
386
  }
387
 
388
  .mapp-edit-list .mapp-item.mapp-edit-dragover {
598
  */
599
 
600
  /* Go for a large dialog, IB will restrict as needed */
601
+ .mapp-ib-wrapper.mapp-ib-edit {
602
+ max-height: 80%;
603
+ max-width: 80%;
604
+ }
605
+
606
  .mapp-ib-wrapper.mapp-ib-edit .mapp-ib-content {
607
  width: 600px;
608
  height: 400px;
609
  }
610
+
611
  .mapp-ib-wrapper.mapp-ib-edit .mapp-ib {
612
  height: 100%;
613
  }
913
  z-index: 1000;
914
  }
915
 
 
916
  .mapp-option-section {
917
  background-color: white;
918
  border-bottom: 1px solid lightgray;
962
  .mapp-option-label {
963
  margin-left: 5px;
964
  margin-right: 10px;
965
+ white-space: nowrap;
966
  }
967
 
968
  @media only screen and (max-width: 780px) {
975
  display: block;
976
  }
977
 
978
+ .mapp-option-value {
979
+ display: block;
980
+ }
981
+
982
  }
983
 
984
  .mapp-options label {
985
  margin-right: 20px;
986
  }
987
 
 
 
 
 
 
 
 
 
 
988
  .mapp-options .mapp-license-status {
989
  margin-left: 10px;
990
  }
1026
  .mapp-options .mapp-grid-styles .mapp-grid-cell-value textarea { width: 100%; }
1027
  .mapp-options .mapp-grid-styles .mapp-grid-cell-value textarea:focus { min-height: 20em }
1028
 
1029
+ .mapp-options .mapp-help-text {
1030
+ font-style: italic;
1031
+ padding-top: 10px;
1032
+ }
1033
+
1034
+ .mapp-options .mapp-help-link {
1035
+ display: inline-block;
1036
+ text-decoration: none;
1037
+ vertical-align: baseline;
1038
+ }
1039
+
1040
+ .mapp-option-mapbox {
1041
+ max-width: 800px;
1042
+ width: 90%;
1043
+ }
1044
+
1045
+ .mapp-option-style {
1046
+ display: flex;
1047
+ align-items: center;
1048
+ }
1049
+
1050
+ .mapp-option-style button {
1051
+ margin-right: 10px;
1052
+ }
1053
+
1054
+
1055
  /*
1056
  -----------------------------------------------------------------------------------
1057
  GT Color picker
1064
 
1065
  .mapp-colors {
1066
  overflow: hidden;
1067
+ padding: 5px 10px;
1068
  width: 320px;
1069
  }
1070
 
1175
  display: flex;
1176
  flex-direction: column;
1177
  min-height: 90%;
1178
+ min-width: 600px;
1179
+ max-width: 1200px;
1180
+ width: 90vw;
1181
  }
1182
 
1183
  .mapp-icons-edit-modal h1 {
1230
  overflow: auto;
1231
  }
1232
 
1233
+ .mapp-icons-edit-header {
1234
+ font-size: 14px;
1235
+ font-weight: 600;
1236
+ }
1237
+
1238
+ .mapp-icons-edit-shape -section { }
1239
+ .mapp-icons-edit-color-section {
1240
+ align-items: center;
1241
+ display: flex;
1242
+ margin: 10px 0;
1243
+ }
1244
+ .mapp-icons-edit-glyph-section {
1245
+ }
1246
+
1247
+ .mapp-icons-edit .mapp-colors-toggle {
1248
+ margin-left: 20px;
1249
+ }
1250
+
1251
+ .mapp-icons-edit-search {
1252
+ align-items: center;
1253
+ display: flex;
1254
+ }
1255
+
1256
+ .mapp-icons-edit-search input {
1257
+ margin-left: 10px;
1258
+ }
1259
 
1260
  .mapp-icons-edit-shape-wrapper {
1261
  border: 3px solid white;
1293
  }
1294
 
1295
  .mapp-icons-edit-glyph-list {
 
1296
  display: flex;
1297
  flex: 1;
1298
  flex-wrap: wrap;
1305
  color: black;
1306
  display: flex;
1307
  flex-direction: column;
1308
+ height: 100px;
1309
  position: relative;
1310
+ width: 100px;
1311
  margin: 1px;
1312
  text-align: center;
1313
  box-sizing: border-box;
1404
  width: 32px;
1405
  }
1406
 
1407
+
1408
+ /*
1409
+ -----------------------------------------------------------------------------------
1410
+ Style Picker
1411
+ -----------------------------------------------------------------------------------
1412
+ */
1413
+
1414
+
1415
+ /* Style control in settings panel */
1416
+ .components-panel__row.mapp-style-toggle {
1417
+ align-items: center !important;
1418
+ }
1419
+
1420
+ /* Style control in map editor */
1421
+ .mapp-edit .mapp-style-toggle {
1422
+ background-color: white;
1423
+ position: absolute;
1424
+ top: 105px; right: 10px;
1425
+ z-index: 1000; /* Keep control above Leaflet map */
1426
+ }
1427
+
1428
+ button.mapp-style-toggle {
1429
+ height: auto;
1430
+ }
1431
+
1432
+ .mapp-style-toggle img {
1433
+ height: 40px;
1434
+ object-fit: cover;
1435
+ width: 40px;
1436
+ }
1437
+
1438
+ .mapp-style-modal {
1439
+ display: flex;
1440
+ flex-direction: column;
1441
+ max-height: 90vh;
1442
+ min-height: 340px;
1443
+ width: 720px;
1444
+ }
1445
+
1446
+ .mapp-style-modal a, .mapp-style-modal a:focus {
1447
+ box-shadow: none;
1448
+ text-decoration: none;
1449
+ }
1450
+
1451
+ .mapp-style-modal-snazzy {
1452
+ height: 90vh;
1453
+ }
1454
+
1455
+ @media screen and (max-width: 750px) {
1456
+ .mapp-style-modal {
1457
+ height: 100vh;
1458
+ max-height: none;
1459
+ max-width: none;
1460
+ width: 100vw;
1461
+ }
1462
+ }
1463
+
1464
+ .mapp-style-modal .components-modal__content {
1465
+ display: flex;
1466
+ flex: 1;
1467
+ flex-direction: column;
1468
+ overflow: hidden;
1469
+ }
1470
+
1471
+ .mapp-style-list-wrapper {
1472
+ flex: 1;
1473
+ margin-top: 10px;
1474
+ overflow: auto;
1475
+ }
1476
+
1477
+ .mapp-style-list {
1478
+ display: flex;
1479
+ flex-wrap: wrap;
1480
+ margin-left: 2px;
1481
+ }
1482
+
1483
+ .mapp-style-list-header {
1484
+ font-weight: bold;
1485
+ margin-bottom: 5px;
1486
+ }
1487
+
1488
+ .mapp-style {
1489
+ border: 1px solid white;
1490
+ border-radius: 3px;
1491
+ box-shadow: #777 0px 1px 3px 0px;
1492
+ cursor: pointer;
1493
+ display: flex;
1494
+ flex-direction: column;
1495
+ margin-bottom: 10px;
1496
+ margin-right: 10px;
1497
+ padding: 3px;
1498
+ width: 90px;
1499
+ }
1500
+
1501
+ .mapp-style.mapp-selected, .mapp-style:hover {
1502
+ border: 1px solid black;
1503
+ }
1504
+
1505
+ .mapp-style-image {
1506
+ height: 90px;
1507
+ width: 100%;
1508
+ }
1509
+
1510
+ .mapp-style-image img {
1511
+ height: 100%;
1512
+ object-fit: cover;
1513
+ width: 100%;
1514
+ }
1515
+
1516
+ .mapp-style-details {
1517
+ display: flex;
1518
+ flex-direction: column;
1519
+ flex: 1;
1520
+ margin-top: 5px;
1521
+ }
1522
+
1523
+ .mapp-style.mapp-selected .mapp-style-details, .mapp-style:hover .mapp-style-details {
1524
+ color: black;
1525
+ }
1526
+
1527
+ .mapp-style-title {
1528
+ flex: 1;
1529
+ overflow: hidden;
1530
+ overflow-wrap: break-word;
1531
+ }
1532
+
1533
+ .mapp-style-actions {
1534
+ display: flex;
1535
+ justify-content: space-between;
1536
+ margin-top: 5px;
1537
+ }
1538
+
1539
+ .mapp-style-json {
1540
+ display: flex;
1541
+ flex: 1;
1542
+ }
1543
+
1544
+ .mapp-style-json-preview {
1545
+ max-width: 400px;
1546
+ width: 50%;
1547
+ }
1548
+
1549
+ .mapp-style-json .mapp-layout {
1550
+ margin: 0;
1551
+ }
1552
+
1553
+ .mapp-style-json textarea {
1554
+ flex: 1;
1555
+ min-width: 300px;
1556
+ }
1557
+
1558
+ .mapp-style-json.mapp-style-error textarea {
1559
+ align-items: center;
1560
+ background-color: pink;
1561
+ }
1562
+
1563
+ .mapp-style-json-error {
1564
+ color: red;
1565
+ padding: 10px;
1566
+ }
1567
+
1568
+ .mapp-style-mapbox-title {
1569
  font-size: 14px;
1570
+ font-weight: 500;
1571
+ margin-bottom: 20px;
1572
  }
1573
 
1574
+ .mapp-style-mapbox-form {
1575
+ display: flex;
1576
+ flex: 1;
1577
+ flex-direction: column;
1578
+ overflow: hidden;
1579
  }
1580
 
1581
+ .mapp-style-mapbox-form label {
1582
+ dispay: block;
1583
+ margin-bottom: 10px;
1584
+ }
1585
+
1586
+ .mapp-style-mapbox-url {
1587
+ margin: 0;
1588
+ width: 100%;
1589
+ }
1590
+
1591
+ .mapp-style-mapbox-form .mapp-help-link {
1592
+ margin-left: 5px;
1593
+ }
1594
+
1595
+ .mapp-style-mapbox-preview {
1596
+ flex: 1;
1597
+ overflow: hidden;
1598
+ }
1599
+
1600
+ .mapp-style-mapbox-preview img {
1601
+ height: 100%;
1602
+ object-fit: cover;
1603
+ width: 100%;
1604
  }
1605
 
1606
+ .mapp-style-mapbox .mapp-style-error {
1607
  align-items: center;
1608
  display: flex;
1609
+ flex: 1;
1610
+ font-weight: bold;
1611
+ justify-content: center;
1612
+ padding: 5px;
1613
  }
1614
 
1615
+ .mapp-style-snazzy-form {
1616
+ display: flex;
1617
  }
1618
 
1619
+ .mapp-style-top-toolbar button {
1620
+ margin-right: 10px;
1621
+ }
1622
+
1623
+ .mapp-style-toolbar {
1624
+ border-top: 1px solid lightgray;
1625
+ display: flex;
1626
+ justify-content: space-between;
1627
+ padding-top: 10px;
1628
+ }
1629
+
1630
+ .mapp-style-toolbar button {
1631
+ margin-right: 5px;
1632
  }
1633
 
1634
  /*
1635
  -----------------------------------------------------------------------------------
1636
+ Template Editor
1637
  -----------------------------------------------------------------------------------
1638
  */
1639
 
1761
 
1762
  .mapp-grid-cell {
1763
  border-bottom: 1px solid lightgray;
 
1764
  display: table-cell;
1765
+ padding: 5px 10px;
1766
  text-align: center;
1767
  vertical-align: middle;
1768
  }
1781
 
1782
  .mapp-grid-toolbar {}
1783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1784
  /*
1785
  -----------------------------------------------------------------------------------
1786
  Misc
images/hybrid.png ADDED
Binary file
images/osm.png ADDED
Binary file
images/roadmap.png ADDED
Binary file
images/satellite.png ADDED
Binary file
images/terrain.png ADDED
Binary file
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.62.12\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-05-12T21:18:04+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
 
@@ -34,7 +34,7 @@ msgid "https://www.mappresspro.com/chris-contact"
34
  msgstr ""
35
 
36
  #: mappress.php:200
37
- #: mappress.php:757
38
  msgid "Settings"
39
  msgstr ""
40
 
@@ -80,6 +80,7 @@ msgstr ""
80
 
81
  #: mappress.php:526
82
  #: mappress.php:530
 
83
  msgid "Learn more"
84
  msgstr ""
85
 
@@ -87,86 +88,99 @@ msgstr ""
87
  msgid "MapPress popup templates have changed! Please update custom templates to the new format. %s."
88
  msgstr ""
89
 
90
- #: mappress.php:573
 
 
 
 
91
  msgid "Are you sure you want to delete?"
92
  msgstr ""
93
 
94
- #: mappress.php:574
95
  msgid "Permanently delete this map from the map library?"
96
  msgstr ""
97
 
98
- #: mappress.php:575
99
  msgid "Error reading KML file"
100
  msgstr ""
101
 
102
- #: mappress.php:576
103
  msgid "URL for KML file"
104
  msgstr ""
105
 
106
- #: mappress.php:577
107
  msgid "Loading"
108
  msgstr ""
109
 
110
- #: mappress.php:578
111
  msgid "Please select an editor to insert into."
112
  msgstr ""
113
 
114
- #: mappress.php:579
115
  msgid "Unable to get your location"
116
  msgstr ""
117
 
118
- #: mappress.php:580
119
  msgid "No results"
120
  msgstr ""
121
 
122
- #: mappress.php:581
123
  msgid "Save changes?"
124
  msgstr ""
125
 
126
- #: mappress.php:582
127
  msgid "Shape"
128
  msgstr ""
129
 
130
- #: mappress.php:612
131
- msgid "Improve this map"
132
- msgstr ""
133
-
134
- #: mappress.php:628
135
- #: mappress.php:646
136
  msgid "Streets"
137
  msgstr ""
138
 
139
- #: mappress.php:629
140
  msgid "Outdoors"
141
  msgstr ""
142
 
143
- #: mappress.php:630
144
  msgid "Light"
145
  msgstr ""
146
 
147
- #: mappress.php:631
148
  msgid "Dark"
149
  msgstr ""
150
 
151
- #: mappress.php:632
 
152
  msgid "Satellite"
153
  msgstr ""
154
 
155
- #: mappress.php:633
156
  msgid "Satellite Streets"
157
  msgstr ""
158
 
159
- #: mappress.php:758
160
- #: mappress_settings.php:370
 
 
 
 
 
 
 
 
 
 
 
 
161
  msgid "What's new"
162
  msgstr ""
163
 
164
- #: mappress.php:1007
165
  msgid "Version"
166
  msgstr ""
167
 
168
  #: mappress_map.php:86
169
- #: mappress_settings.php:365
170
  msgid "MapPress"
171
  msgstr ""
172
 
@@ -186,86 +200,86 @@ msgstr ""
186
  msgid "Post not found"
187
  msgstr ""
188
 
189
- #: mappress_settings.php:164
190
  msgid "Default"
191
  msgstr ""
192
 
193
- #: mappress_settings.php:219
194
  msgid "Easy Google Maps"
195
  msgstr ""
196
 
197
- #: mappress_settings.php:243
198
  msgid "Active"
199
  msgstr ""
200
 
201
- #: mappress_settings.php:246
202
  msgid "Communication error, please try again later: %s"
203
  msgstr ""
204
 
205
- #: mappress_settings.php:248
206
  msgid "License is invalid or expired"
207
  msgstr ""
208
 
209
- #: mappress_settings.php:256
210
  msgid "Address line "
211
  msgstr ""
212
 
213
- #: mappress_settings.php:257
214
  msgid "Latitude"
215
  msgstr ""
216
 
217
- #: mappress_settings.php:257
218
  msgid "Longitude"
219
  msgstr ""
220
 
221
- #: mappress_settings.php:257
222
  #: mappress_template.php:37
223
  msgid "Title"
224
  msgstr ""
225
 
226
- #: mappress_settings.php:257
227
  #: mappress_template.php:34
228
  msgid "Body"
229
  msgstr ""
230
 
231
- #: mappress_settings.php:257
232
  #: mappress_template.php:35
233
  msgid "Icon"
234
  msgstr ""
235
 
236
- #: mappress_settings.php:257
237
  msgid "Zoom"
238
  msgstr ""
239
 
240
- #: mappress_settings.php:346
241
  msgid "OK, you deserve it!"
242
  msgstr ""
243
 
244
- #: mappress_settings.php:347
245
  msgid "Nope, maybe later"
246
  msgstr ""
247
 
248
- #: mappress_settings.php:348
249
  msgid "I need help using the plugin"
250
  msgstr ""
251
 
252
- #: mappress_settings.php:350
253
  msgid "Help Spread the Word"
254
  msgstr ""
255
 
256
- #: mappress_settings.php:351
257
  msgid "Hi, I hope you're enjoying MapPress. Would you mind taking a moment to write a brief review? It would mean a lot to me!"
258
  msgstr ""
259
 
260
- #: mappress_settings.php:369
261
  msgid "Get help"
262
  msgstr ""
263
 
264
- #: mappress_settings.php:372
265
  msgid "Your account"
266
  msgstr ""
267
 
268
- #: mappress_settings.php:374
269
  msgid "Upgrade to MapPress Pro"
270
  msgstr ""
271
 
@@ -405,11 +419,11 @@ msgstr ""
405
  msgid "Get Directions"
406
  msgstr ""
407
 
408
- #: templates/map-filters.php:12
409
  msgid "Done"
410
  msgstr ""
411
 
412
- #: templates/map-filters.php:13
413
  msgid "Reset"
414
  msgstr ""
415
 
@@ -417,6 +431,10 @@ msgstr ""
417
  msgid "Results"
418
  msgstr ""
419
 
 
 
 
 
420
  #: templates/map.php:16
421
  #: templates/map.php:39
422
  msgid "Your Location"
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.63\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-05-28T21:35:18+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
 
34
  msgstr ""
35
 
36
  #: mappress.php:200
37
+ #: mappress.php:761
38
  msgid "Settings"
39
  msgstr ""
40
 
80
 
81
  #: mappress.php:526
82
  #: mappress.php:530
83
+ #: mappress.php:534
84
  msgid "Learn more"
85
  msgstr ""
86
 
88
  msgid "MapPress popup templates have changed! Please update custom templates to the new format. %s."
89
  msgstr ""
90
 
91
+ #: mappress.php:534
92
+ msgid "MapPress templates and filters have changed. Please update custom templates and filters. %s."
93
+ msgstr ""
94
+
95
+ #: mappress.php:599
96
  msgid "Are you sure you want to delete?"
97
  msgstr ""
98
 
99
+ #: mappress.php:600
100
  msgid "Permanently delete this map from the map library?"
101
  msgstr ""
102
 
103
+ #: mappress.php:601
104
  msgid "Error reading KML file"
105
  msgstr ""
106
 
107
+ #: mappress.php:602
108
  msgid "URL for KML file"
109
  msgstr ""
110
 
111
+ #: mappress.php:603
112
  msgid "Loading"
113
  msgstr ""
114
 
115
+ #: mappress.php:604
116
  msgid "Please select an editor to insert into."
117
  msgstr ""
118
 
119
+ #: mappress.php:605
120
  msgid "Unable to get your location"
121
  msgstr ""
122
 
123
+ #: mappress.php:606
124
  msgid "No results"
125
  msgstr ""
126
 
127
+ #: mappress.php:607
128
  msgid "Save changes?"
129
  msgstr ""
130
 
131
+ #: mappress.php:608
132
  msgid "Shape"
133
  msgstr ""
134
 
135
+ #: mappress.php:638
136
+ #: mappress.php:647
 
 
 
 
137
  msgid "Streets"
138
  msgstr ""
139
 
140
+ #: mappress.php:639
141
  msgid "Outdoors"
142
  msgstr ""
143
 
144
+ #: mappress.php:640
145
  msgid "Light"
146
  msgstr ""
147
 
148
+ #: mappress.php:641
149
  msgid "Dark"
150
  msgstr ""
151
 
152
+ #: mappress.php:642
153
+ #: mappress.php:655
154
  msgid "Satellite"
155
  msgstr ""
156
 
157
+ #: mappress.php:643
158
  msgid "Satellite Streets"
159
  msgstr ""
160
 
161
+ #: mappress.php:653
162
+ msgid "Roadmap"
163
+ msgstr ""
164
+
165
+ #: mappress.php:654
166
+ msgid "Terrain"
167
+ msgstr ""
168
+
169
+ #: mappress.php:656
170
+ msgid "Hybrid"
171
+ msgstr ""
172
+
173
+ #: mappress.php:762
174
+ #: mappress_settings.php:372
175
  msgid "What's new"
176
  msgstr ""
177
 
178
+ #: mappress.php:1011
179
  msgid "Version"
180
  msgstr ""
181
 
182
  #: mappress_map.php:86
183
+ #: mappress_settings.php:367
184
  msgid "MapPress"
185
  msgstr ""
186
 
200
  msgid "Post not found"
201
  msgstr ""
202
 
203
+ #: mappress_settings.php:172
204
  msgid "Default"
205
  msgstr ""
206
 
207
+ #: mappress_settings.php:221
208
  msgid "Easy Google Maps"
209
  msgstr ""
210
 
211
+ #: mappress_settings.php:245
212
  msgid "Active"
213
  msgstr ""
214
 
215
+ #: mappress_settings.php:248
216
  msgid "Communication error, please try again later: %s"
217
  msgstr ""
218
 
219
+ #: mappress_settings.php:250
220
  msgid "License is invalid or expired"
221
  msgstr ""
222
 
223
+ #: mappress_settings.php:258
224
  msgid "Address line "
225
  msgstr ""
226
 
227
+ #: mappress_settings.php:259
228
  msgid "Latitude"
229
  msgstr ""
230
 
231
+ #: mappress_settings.php:259
232
  msgid "Longitude"
233
  msgstr ""
234
 
235
+ #: mappress_settings.php:259
236
  #: mappress_template.php:37
237
  msgid "Title"
238
  msgstr ""
239
 
240
+ #: mappress_settings.php:259
241
  #: mappress_template.php:34
242
  msgid "Body"
243
  msgstr ""
244
 
245
+ #: mappress_settings.php:259
246
  #: mappress_template.php:35
247
  msgid "Icon"
248
  msgstr ""
249
 
250
+ #: mappress_settings.php:259
251
  msgid "Zoom"
252
  msgstr ""
253
 
254
+ #: mappress_settings.php:348
255
  msgid "OK, you deserve it!"
256
  msgstr ""
257
 
258
+ #: mappress_settings.php:349
259
  msgid "Nope, maybe later"
260
  msgstr ""
261
 
262
+ #: mappress_settings.php:350
263
  msgid "I need help using the plugin"
264
  msgstr ""
265
 
266
+ #: mappress_settings.php:352
267
  msgid "Help Spread the Word"
268
  msgstr ""
269
 
270
+ #: mappress_settings.php:353
271
  msgid "Hi, I hope you're enjoying MapPress. Would you mind taking a moment to write a brief review? It would mean a lot to me!"
272
  msgstr ""
273
 
274
+ #: mappress_settings.php:371
275
  msgid "Get help"
276
  msgstr ""
277
 
278
+ #: mappress_settings.php:374
279
  msgid "Your account"
280
  msgstr ""
281
 
282
+ #: mappress_settings.php:376
283
  msgid "Upgrade to MapPress Pro"
284
  msgstr ""
285
 
419
  msgid "Get Directions"
420
  msgstr ""
421
 
422
+ #: templates/map-filters.php:14
423
  msgid "Done"
424
  msgstr ""
425
 
426
+ #: templates/map-filters.php:15
427
  msgid "Reset"
428
  msgstr ""
429
 
431
  msgid "Results"
432
  msgstr ""
433
 
434
+ #: templates/map-loop.php:36
435
+ msgid "%d of %d"
436
+ msgstr ""
437
+
438
  #: templates/map.php:16
439
  #: templates/map.php:39
440
  msgid "Your Location"
languages/texts.php CHANGED
@@ -17,6 +17,7 @@ __("MapPress Gutenberg blocks require WordPress 5.3 or the latest Gutenberg Plug
17
  __("MapPress has many new features! %s.");
18
  __("Learn more");
19
  __("MapPress popup templates have changed! Please update custom templates to the new format. %s.");
 
20
  __("Are you sure you want to delete?");
21
  __("Permanently delete this map from the map library?");
22
  __("Error reading KML file");
@@ -27,13 +28,15 @@ __("Unable to get your location");
27
  __("No results");
28
  __("Save changes?");
29
  __("Shape");
30
- __("Improve this map");
31
  __("Streets");
32
  __("Outdoors");
33
  __("Light");
34
  __("Dark");
35
  __("Satellite");
36
  __("Satellite Streets");
 
 
 
37
  __("What's new");
38
  __("Version");
39
  __("MapPress");
@@ -95,6 +98,7 @@ __("Get Directions");
95
  __("Done");
96
  __("Reset");
97
  __("Results");
 
98
  __("Your Location");
99
  __("Search");
100
  __("Filter");
17
  __("MapPress has many new features! %s.");
18
  __("Learn more");
19
  __("MapPress popup templates have changed! Please update custom templates to the new format. %s.");
20
+ __("MapPress templates and filters have changed. Please update custom templates and filters. %s.");
21
  __("Are you sure you want to delete?");
22
  __("Permanently delete this map from the map library?");
23
  __("Error reading KML file");
28
  __("No results");
29
  __("Save changes?");
30
  __("Shape");
 
31
  __("Streets");
32
  __("Outdoors");
33
  __("Light");
34
  __("Dark");
35
  __("Satellite");
36
  __("Satellite Streets");
37
+ __("Roadmap");
38
+ __("Terrain");
39
+ __("Hybrid");
40
  __("What's new");
41
  __("Version");
42
  __("MapPress");
98
  __("Done");
99
  __("Reset");
100
  __("Results");
101
+ __("%d of %d");
102
  __("Your Location");
103
  __("Search");
104
  __("Filter");
mappress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
4
  Plugin URI: https://www.mappresspro.com/mappress
5
  Author URI: https://www.mappresspro.com/chris-contact
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
- Version: 2.62.12
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
@@ -35,7 +35,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
35
  }
36
 
37
  class Mappress {
38
- const VERSION = '2.62.12';
39
 
40
  static
41
  $baseurl,
@@ -529,6 +529,32 @@ class Mappress {
529
  if ($current_version && $current_version < '2.60' && self::VERSION >= '2.60')
530
  self::$notices['260_whats_new'] = array('warning', sprintf(__('MapPress popup templates have changed! Please update custom templates to the new format. %s.', 'mappress-google-maps-for-wordpress'), '<a target="_blank" href="https://mappresspro.com/whats-new">' . __("Learn more", 'mappress-google-maps-for-wordpress') . '</a>'));
531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  update_option('mappress_version', self::VERSION);
533
  }
534
 
@@ -586,6 +612,7 @@ class Mappress {
586
  $l10n['options'] = array(
587
  'admin' => current_user_can('administrator'),
588
  'ajaxurl' => admin_url('admin-ajax.php'),
 
589
  'baseurl' => self::$baseurl,
590
  'debug' => self::$debug,
591
  'editurl' => admin_url('post.php'),
@@ -599,65 +626,42 @@ class Mappress {
599
  'ssl' => self::is_ssl(), // SSL is needed for 'your location' in directions
600
  'standardIcons' => (self::$pro) ? Mappress_Icons::$standard_icons : null,
601
  'standardIconsUrl' => (self::$pro) ? Mappress_Icons::$standard_icons_url : null,
 
602
  'userIcons' => (self::$pro) ? Mappress_Icons::get_user_icons() : null,
603
  'version' => self::$version
604
  );
605
 
606
- // Leaflet layers for mapbox / OSM
607
- if (self::$options->engine == 'leaflet') {
608
- // Providers
609
- $providers = array(
610
- 'mapbox' => array(
611
- 'accessToken' => self::get_api_keys()->mapbox,
612
- 'attribution' => "<a href='https://www.mapbox.com/about/maps/' target='_blank'>&copy; Mapbox &copy; OpenStreetMap</a> <a class='mapbox-improve-map' href='https://www.mapbox.com/map-feedback/' target='_blank'>" . __('Improve this map', 'mappress-google-maps-for-wordpress') . "</a>",
613
- 'fresh' => true, // Fresh = true in order to provide updated studio styles
614
- 'url' => "https://api.mapbox.com/styles/v1/{user}/{id}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh={fresh}",
615
- 'zoomOffset' => 0
616
- ),
617
- 'osm' => array(
618
- 'attribution' => 'Map data (c)<a href="https://openstreetmap.org">OpenStreetMap</a>',
619
- 'url' => 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
620
- )
621
- );
622
- $l10n['options']['providers'] = $providers;
623
-
624
- // Baselayers
625
- $baselayers = array();
626
- if (self::get_api_keys()->mapbox) {
627
- $baselayers = array(
628
- array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'streets-v10', 'name' => 'streets', 'label' => __('Streets', 'mappress-google-maps-for-wordpress')),
629
- array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'outdoors-v10', 'name' => 'outdoors', 'label' => __('Outdoors', 'mappress-google-maps-for-wordpress')),
630
- array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'light-v9', 'name' => 'light', 'label' => __('Light', 'mappress-google-maps-for-wordpress')),
631
- array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'dark-v9', 'name' => 'dark', 'label' => __('Dark', 'mappress-google-maps-for-wordpress')),
632
- array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'satellite-v9', 'name' => 'satellite', 'label' => __('Satellite', 'mappress-google-maps-for-wordpress')),
633
- array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'satellite-streets-v10', 'name' => 'satellite-streets', 'label' => __('Satellite Streets', 'mappress-google-maps-for-wordpress'))
634
  );
635
-
636
- // Mapbox studio styles - extract user/id from url
637
- foreach(self::$options->mapboxStyles as $name => $url) {
638
- $parts = explode('?', strtolower($url));
639
- $url = str_ireplace(array('.html', 'https://api.mapbox.com/styles/v1/', 'mapbox://styles/'), '', $parts[0]);
640
- $parts = explode('/', $url);
641
- if (count($parts) == 2)
642
- $baselayers[] = array('provider' => 'mapbox', 'user' => $parts[0], 'id' => $parts[1], 'name' => $name, 'label' => $name);
643
- }
644
  } else {
645
- $baselayers = array(
646
- array('provider' => 'osm', 'id' => 'osm', 'name' => 'osm', 'label' => __('Streets', 'mappress-google-maps-for-wordpress'))
647
  );
648
  }
649
- $l10n['options']['baseLayers'] = $baselayers;
650
  } else {
651
- // Google wizard styles
652
- $l10n['options']['styles'] = array();
653
- foreach(self::$options->styles as $id => &$style)
654
- $l10n['options']['styles'][$id] = json_decode($style);
 
 
 
655
  }
 
656
 
657
  // Global settings
658
  $options = array('alignment', 'clustering', 'country', 'defaultIcon', 'directions', 'directionsServer',
659
- 'engine', 'filter', 'geocoder', 'highlight', 'highlightIcon', 'iconScale', 'initialOpenInfo', 'layout', 'listThumbs',
660
- 'mashupClick', 'mini', 'poiList', 'poiZoom', 'popupThumbs', 'radius', 'search', 'size', 'sizes', 'style', 'thumbs', 'tooltips');
661
 
662
  foreach($options as $option) {
663
  if (isset(self::$options->$option)) {
4
  Plugin URI: https://www.mappresspro.com/mappress
5
  Author URI: https://www.mappresspro.com/chris-contact
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
+ Version: 2.63
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
35
  }
36
 
37
  class Mappress {
38
+ const VERSION = '2.63';
39
 
40
  static
41
  $baseurl,
529
  if ($current_version && $current_version < '2.60' && self::VERSION >= '2.60')
530
  self::$notices['260_whats_new'] = array('warning', sprintf(__('MapPress popup templates have changed! Please update custom templates to the new format. %s.', 'mappress-google-maps-for-wordpress'), '<a target="_blank" href="https://mappresspro.com/whats-new">' . __("Learn more", 'mappress-google-maps-for-wordpress') . '</a>'));
531
 
532
+ if ($current_version && $current_version < '2.63' && self::VERSION >= '2.63') {
533
+ // New list templates
534
+ self::$notices['263_whats_new'] = array('warning', sprintf(__('MapPress templates and filters have changed. Please update custom templates and filters. %s.', 'mappress-google-maps-for-wordpress'), '<a target="_blank" href="https://mappresspro.com/whats-new">' . __("Learn more", 'mappress-google-maps-for-wordpress') . '</a>'));
535
+
536
+ // Convert filters to array
537
+ if (self::$options->filter) {
538
+ self::$options->filters = array(array('key' => self::$options->filter));
539
+ self::$options->save();
540
+ }
541
+
542
+ // Convert styles to indexed arrays
543
+ if (self::$options->styles && is_array(self::$options->styles)) {
544
+ self::$options->stylesGoogle = array();
545
+ self::$options->stylesMapbox = array();
546
+ foreach(self::$options->styles as $name => $json)
547
+ self::$options->stylesGoogle[] = array('id' => $name, 'name' => $name, 'url' => null, 'json' => $json, 'imageUrl' => self::$baseurl . '/images/roadmap.png');
548
+ foreach(self::$options->mapboxStyles as $name => $url) {
549
+ $parts = explode('?', strtolower($url));
550
+ $short_url = str_ireplace(array('.html', 'https://api.mapbox.com/styles/v1/', 'mapbox://styles/'), '', $parts[0]);
551
+ $parts = explode('/', $short_url);
552
+ if (count($parts) == 2)
553
+ self::$options->stylesMapbox[] = array('url' => $url, 'provider' => 'mapbox', 'user' => $parts[0], 'id' => $name, 'mapboxid' => $parts[1], 'name' => $name);
554
+ }
555
+ self::$options->save();
556
+ }
557
+ }
558
  update_option('mappress_version', self::VERSION);
559
  }
560
 
612
  $l10n['options'] = array(
613
  'admin' => current_user_can('administrator'),
614
  'ajaxurl' => admin_url('admin-ajax.php'),
615
+ 'apikey' => self::get_api_keys()->browser,
616
  'baseurl' => self::$baseurl,
617
  'debug' => self::$debug,
618
  'editurl' => admin_url('post.php'),
626
  'ssl' => self::is_ssl(), // SSL is needed for 'your location' in directions
627
  'standardIcons' => (self::$pro) ? Mappress_Icons::$standard_icons : null,
628
  'standardIconsUrl' => (self::$pro) ? Mappress_Icons::$standard_icons_url : null,
629
+ 'userStyles' => (self::$options->engine == 'leaflet') ? self::$options->stylesMapbox : self::$options->stylesGoogle,
630
  'userIcons' => (self::$pro) ? Mappress_Icons::get_user_icons() : null,
631
  'version' => self::$version
632
  );
633
 
634
+ // Default styles
635
+ if (Mappress::$options->engine == 'leaflet') {
636
+ if (Mappress::get_api_keys()->mapbox) {
637
+ $styles = array(
638
+ array('id' => 'streets', 'type' => 'standard', 'provider' => 'mapbox', 'user' => 'mapbox', 'mapboxid' => 'streets-v11', 'name' => __('Streets', 'mappress-google-maps-for-wordpress')),
639
+ array('id' => 'outdoors', 'type' => 'standard', 'provider' => 'mapbox', 'user' => 'mapbox', 'mapboxid' => 'outdoors-v11', 'name' => __('Outdoors', 'mappress-google-maps-for-wordpress')),
640
+ array('id' => 'light', 'type' => 'standard', 'provider' => 'mapbox', 'user' => 'mapbox', 'mapboxid' => 'light-v10', 'name' => __('Light', 'mappress-google-maps-for-wordpress')),
641
+ array('id' => 'dark', 'type' => 'standard', 'provider' => 'mapbox', 'user' => 'mapbox', 'mapboxid' => 'dark-v10', 'name' => __('Dark', 'mappress-google-maps-for-wordpress')),
642
+ array('id' => 'satellite', 'type' => 'standard', 'provider' => 'mapbox', 'user' => 'mapbox', 'mapboxid' => 'satellite-v9', 'name' => __('Satellite', 'mappress-google-maps-for-wordpress')),
643
+ array('id' => 'satellite-streets', 'type' => 'standard', 'provider' => 'mapbox', 'user' => 'mapbox', 'mapboxid' => 'satellite-streets-v11', 'name' => __('Satellite Streets', 'mappress-google-maps-for-wordpress'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  );
 
 
 
 
 
 
 
 
 
645
  } else {
646
+ $styles = array(
647
+ array('id' => 'osm', 'type' => 'standard', 'provider' => 'osm', 'name' => __('Streets', 'mappress-google-maps-for-wordpress'))
648
  );
649
  }
 
650
  } else {
651
+ // Google styles
652
+ $styles = array(
653
+ array( 'id' => 'roadmap', 'type' => 'standard', 'name' => __('Roadmap', 'mappress-google-maps-for-wordpress'), 'imageUrl' => Mappress::$baseurl . '/images/roadmap.png'),
654
+ array( 'id' => 'terrain', 'type' => 'standard', 'name' => __('Terrain', 'mappress-google-maps-for-wordpress'), 'imageUrl' => Mappress::$baseurl . '/images/terrain.png'),
655
+ array( 'id' => 'satellite', 'type' => 'standard', 'name' => __('Satellite', 'mappress-google-maps-for-wordpress'), 'imageUrl' => Mappress::$baseurl . '/images/satellite.png'),
656
+ array( 'id' => 'hybrid', 'type' => 'standard', 'name' => __('Hybrid', 'mappress-google-maps-for-wordpress'), 'imageUrl' => Mappress::$baseurl . '/images/hybrid.png'),
657
+ );
658
  }
659
+ $l10n['options']['standardStyles'] = $styles;
660
 
661
  // Global settings
662
  $options = array('alignment', 'clustering', 'country', 'defaultIcon', 'directions', 'directionsServer',
663
+ 'engine', 'filters', 'geocoder', 'highlight', 'highlightIcon', 'iconScale', 'initialOpenInfo', 'layout',
664
+ 'mashupClick', 'mini', 'poiList', 'poiZoom', 'radius', 'search', 'size', 'sizes', 'style', 'thumbs', 'thumbsList', 'thumbsPopup', 'tooltips');
665
 
666
  foreach($options as $option) {
667
  if (isset(self::$options->$option)) {
mappress_poi.php CHANGED
@@ -72,9 +72,15 @@ class Mappress_Poi extends Mappress_Obj {
72
  return apply_filters('mappress_poi_excerpt', $excerpt, $raw);
73
  }
74
 
 
 
 
 
 
75
  function get_thumbnail($post) {
76
- $size = (Mappress::$options->thumbSize) ? Mappress::$options->thumbSize : null;
77
- $style = (Mappress::$options->thumbWidth && Mappress::$options->thumbHeight) ? sprintf("width: %spx; height : %spx;", Mappress::$options->thumbWidth, Mappress::$options->thumbHeight) : null;
 
78
  return get_the_post_thumbnail($post, $size, array('style' => $style)); // Slow due to get_post_thumbnail_id()
79
  }
80
  }
72
  return apply_filters('mappress_poi_excerpt', $excerpt, $raw);
73
  }
74
 
75
+ /**
76
+ * Get thumbnails if needed. If dimensions are specified, size 'medium-large' is used to allow scaling w/o pixellation
77
+ *
78
+ * @param mixed $post
79
+ */
80
  function get_thumbnail($post) {
81
+ $force_size = (Mappress::$options->thumbWidth && Mappress::$options->thumbHeight);
82
+ $size = (Mappress::$options->thumbSize && !$force_size) ? Mappress::$options->thumbSize : 'medium_large';
83
+ $style = ($force_size) ? sprintf("width: %spx; height : %spx;", Mappress::$options->thumbWidth, Mappress::$options->thumbHeight) : null;
84
  return get_the_post_thumbnail($post, $size, array('style' => $style)); // Slow due to get_post_thumbnail_id()
85
  }
86
  }
mappress_settings.php CHANGED
@@ -18,7 +18,8 @@ class Mappress_Options extends Mappress_Obj {
18
  $directions = 'google',
19
  $directionsServer = 'https://maps.google.com',
20
  $engine = 'leaflet',
21
- $filter,
 
22
  $footer = true,
23
  $geocoder,
24
  $highlight,
@@ -29,7 +30,7 @@ class Mappress_Options extends Mappress_Obj {
29
  $layout = 'left',
30
  $license,
31
  $mapbox,
32
- $mapboxStyles = array(),
33
  $mashupBody = 'poi',
34
  $mashupClick = 'poi',
35
  $mashupKml,
@@ -51,11 +52,13 @@ class Mappress_Options extends Mappress_Obj {
51
  ),
52
  $sort,
53
  $style,
54
- $styles = array(),
55
- $thumbs = true,
 
 
56
  $thumbSize = 'medium',
57
  $thumbsPopup = 'left',
58
- $thumbsList = 'right',
59
  $thumbWidth,
60
  $thumbHeight,
61
  $tooltips = false,
@@ -86,9 +89,8 @@ class Mappress_Settings {
86
  static function register() {
87
  add_action('wp_ajax_mapp_license_check', array(__CLASS__, 'ajax_license_check'));
88
  add_action('wp_ajax_mapp_options_reset', array(__CLASS__, 'ajax_reset'));
89
- add_action('wp_ajax_mapp_options_save', array(__CLASS__, 'ajax_save'));
90
-
91
- //add_action( 'admin_menu', array(__CLASS__, 'admin_menu'));
92
  add_action('load-toplevel_page_mappress', array(__CLASS__, 'review_admin_notice'));
93
  }
94
 
@@ -108,19 +110,17 @@ class Mappress_Settings {
108
  Mappress::ajax_response('OK');
109
  }
110
 
111
- static function ajax_reset() {
112
- check_ajax_referer('mappress', 'nonce');
113
-
114
- if (!current_user_can('manage_options'))
115
- Mappress::ajax_response('Not authorized');
116
-
117
- ob_start();
118
- $options = new Mappress_Options();
119
  $options->save();
120
- Mappress::ajax_response('OK');
121
  }
122
 
123
- static function ajax_save() {
124
  check_ajax_referer('mappress', 'nonce');
125
 
126
  if (!current_user_can('manage_options'))
@@ -135,9 +135,7 @@ class Mappress_Settings {
135
 
136
  // Convert JS object arrays to PHP associative arrays
137
  self::assoc($settings->autoicons['values'], true);
138
- self::assoc($settings->mapboxStyles, true);
139
  self::assoc($settings->metaKeys, true);
140
- self::assoc($settings->styles, true);
141
 
142
  // If license changed, re-check it
143
  if ($settings->license && $settings->license != Mappress::$options->license)
@@ -148,6 +146,18 @@ class Mappress_Settings {
148
  Mappress::ajax_response('OK');
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  static function get_initial_state() {
152
  $state = array();
153
 
@@ -156,9 +166,7 @@ class Mappress_Settings {
156
 
157
  // Convert PHP associative arrays to object arrays for JS
158
  self::assoc($state->autoicons['values'], false);
159
- self::assoc($state->mapboxStyles, false);
160
  self::assoc($state->metaKeys, false);
161
- self::assoc($state->styles, false);
162
 
163
  // Setup helpers
164
  $languages = array('' => __('Default', 'mappress-google-maps-for-wordpress'), 'ab' => 'Abkhazian', 'aa' => 'Afar', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'bm' => 'Bambara', 'ba' => 'Bashkir', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali', 'bh' => 'Bihari languages', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan, Valencian', 'km' => 'Central Khmer', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'ny' => 'Chichewa, Chewa, Nyanja', 'zh' => 'Chinese', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree', 'hr' => 'Croatian', 'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi, Dhivehi, Maldivian', 'nl' => 'Dutch, Flemish', 'dz' => 'Dzongkha', 'en' => 'English', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijian', 'fi' => 'Finnish', 'fr' => 'French', 'ff' => 'Fulah', 'gd' => 'Gaelic, Scottish Gaelic', 'gl' => 'Galician', 'lg' => 'Ganda', 'ka' => 'Georgian', 'de' => 'German', 'ki' => 'Gikuyu, Kikuyu', 'el' => 'Greek (Modern)', 'kl' => 'Greenlandic, Kalaallisut', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'ht' => 'Haitian, Haitian Creole', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hz' => 'Herero', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hu' => 'Hungarian', 'is' => 'Icelandic', 'io' => 'Ido', 'ig' => 'Igbo', 'id' => 'Indonesian', 'iu' => 'Inuktitut', 'ik' => 'Inupiaq', 'ga' => 'Irish', 'it' => 'Italian', 'ja' => 'Japanese', 'jv' => 'Javanese', 'kn' => 'Kannada', 'kr' => 'Kanuri', 'ks' => 'Kashmiri', 'kk' => 'Kazakh', 'rw' => 'Kinyarwanda', 'kv' => 'Komi', 'kg' => 'Kongo', 'ko' => 'Korean', 'kj' => 'Kwanyama, Kuanyama', 'ku' => 'Kurdish', 'ky' => 'Kyrgyz', 'lo' => 'Lao', 'la' => 'Latin', 'lv' => 'Latvian', 'lb' => 'Letzeburgesch, Luxembourgish', 'li' => 'Limburgish, Limburgan, Limburger', 'ln' => 'Lingala', 'lt' => 'Lithuanian', 'lu' => 'Luba-Katanga', 'mk' => 'Macedonian', 'mg' => 'Malagasy', 'ms' => 'Malay', 'ml' => 'Malayalam', 'mt' => 'Maltese', 'gv' => 'Manx', 'mi' => 'Maori', 'mr' => 'Marathi', 'mh' => 'Marshallese', 'ro' => 'Moldovan, Moldavian, Romanian', 'mn' => 'Mongolian', 'na' => 'Nauru', 'nv' => 'Navajo, Navaho', 'nd' => 'Northern Ndebele', 'ng' => 'Ndonga', 'ne' => 'Nepali', 'se' => 'Northern Sami', 'no' => 'Norwegian', 'nb' => 'Norwegian Bokmål', 'nn' => 'Norwegian Nynorsk', 'ii' => 'Nuosu, Sichuan Yi', 'oc' => 'Occitan (post 1500)', 'oj' => 'Ojibwa', 'or' => 'Oriya', 'om' => 'Oromo', 'os' => 'Ossetian, Ossetic', 'pi' => 'Pali', 'pa' => 'Panjabi, Punjabi', 'ps' => 'Pashto, Pushto', 'fa' => 'Persian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'qu' => 'Quechua', 'rm' => 'Romansh', 'rn' => 'Rundi', 'ru' => 'Russian', 'sm' => 'Samoan', 'sg' => 'Sango', 'sa' => 'Sanskrit', 'sc' => 'Sardinian', 'sr' => 'Serbian', 'sn' => 'Shona', 'sd' => 'Sindhi', 'si' => 'Sinhala, Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'nr' => 'South Ndebele', 'es' => 'Spanish, Castilian', 'su' => 'Sundanese', 'sw' => 'Swahili', 'ss' => 'Swati', 'sv' => 'Swedish', 'tl' => 'Tagalog', 'ty' => 'Tahitian', 'tg' => 'Tajik', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'ts' => 'Tsonga', 'tn' => 'Tswana', 'tr' => 'Turkish', 'tk' => 'Turkmen', 'tw' => 'Twi', 'ug' => 'Uighur, Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volap_k', 'wa' => 'Walloon', 'cy' => 'Welsh', 'fy' => 'Western Frisian', 'wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang, Chuang', 'zu' => 'Zulu');
@@ -197,15 +205,9 @@ class Mappress_Settings {
197
  // Convert to associative
198
  if ($to_assoc) {
199
  foreach($a as $i => $row) {
200
- // Sanitize keys
201
- $key = sanitize_title_with_dashes($row['key'], '', 'save');
202
- $value = trim($row['value']);
203
-
204
- // Discard rows with empty key or value
205
- if (empty($key) && empty($value))
206
- continue;
207
- else
208
- $result[$key] = $value;
209
  }
210
  } else {
211
  // Convert from associative
@@ -318,7 +320,7 @@ class Mappress_Settings {
318
  $usage->wp_version = get_bloginfo('version');
319
  $usage->gutenberg = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ) && function_exists('is_plugin_active') && !is_plugin_active( 'classic-editor/classic-editor.php' );
320
  $usage->license = (trim(Mappress::$options->license)) ? true : false;
321
- $usage->filter = (Mappress::$options->filter) ? true : false;
322
  $usage->mapbox = (Mappress::$options->mapbox) ? true : false;
323
  $usage->autoicons = Mappress::$options->autoicons && Mappress::$options->autoicons['key'];
324
  $usage->multisite = is_multisite();
18
  $directions = 'google',
19
  $directionsServer = 'https://maps.google.com',
20
  $engine = 'leaflet',
21
+ $filter, // deprecated
22
+ $filters = array(),
23
  $footer = true,
24
  $geocoder,
25
  $highlight,
30
  $layout = 'left',
31
  $license,
32
  $mapbox,
33
+ $mapboxStyles = array(), // deprecated
34
  $mashupBody = 'poi',
35
  $mashupClick = 'poi',
36
  $mashupKml,
52
  ),
53
  $sort,
54
  $style,
55
+ $styles = array(), // deprecated
56
+ $stylesGoogle = array(),
57
+ $stylesMapbox = array(),
58
+ $thumbs = true, // deprecated
59
  $thumbSize = 'medium',
60
  $thumbsPopup = 'left',
61
+ $thumbsList = null,
62
  $thumbWidth,
63
  $thumbHeight,
64
  $tooltips = false,
89
  static function register() {
90
  add_action('wp_ajax_mapp_license_check', array(__CLASS__, 'ajax_license_check'));
91
  add_action('wp_ajax_mapp_options_reset', array(__CLASS__, 'ajax_reset'));
92
+ add_action('wp_ajax_mapp_option_save', array(__CLASS__, 'ajax_option_save'));
93
+ add_action('wp_ajax_mapp_options_save', array(__CLASS__, 'ajax_options_save'));
 
94
  add_action('load-toplevel_page_mappress', array(__CLASS__, 'review_admin_notice'));
95
  }
96
 
110
  Mappress::ajax_response('OK');
111
  }
112
 
113
+ static function ajax_option_save() {
114
+ $args = Mappress::ajax_start(array('setting', 'value'));
115
+ $options = Mappress_Options::get();
116
+ $setting = $args->setting;
117
+ $value = wp_unslash($args->value);
118
+ $options->$setting = $value;
 
 
119
  $options->save();
120
+ Mappress::ajax_response('OK', $options->$setting);
121
  }
122
 
123
+ static function ajax_options_save() {
124
  check_ajax_referer('mappress', 'nonce');
125
 
126
  if (!current_user_can('manage_options'))
135
 
136
  // Convert JS object arrays to PHP associative arrays
137
  self::assoc($settings->autoicons['values'], true);
 
138
  self::assoc($settings->metaKeys, true);
 
139
 
140
  // If license changed, re-check it
141
  if ($settings->license && $settings->license != Mappress::$options->license)
146
  Mappress::ajax_response('OK');
147
  }
148
 
149
+ static function ajax_reset() {
150
+ check_ajax_referer('mappress', 'nonce');
151
+
152
+ if (!current_user_can('manage_options'))
153
+ Mappress::ajax_response('Not authorized');
154
+
155
+ ob_start();
156
+ $options = new Mappress_Options();
157
+ $options->save();
158
+ Mappress::ajax_response('OK');
159
+ }
160
+
161
  static function get_initial_state() {
162
  $state = array();
163
 
166
 
167
  // Convert PHP associative arrays to object arrays for JS
168
  self::assoc($state->autoicons['values'], false);
 
169
  self::assoc($state->metaKeys, false);
 
170
 
171
  // Setup helpers
172
  $languages = array('' => __('Default', 'mappress-google-maps-for-wordpress'), 'ab' => 'Abkhazian', 'aa' => 'Afar', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'bm' => 'Bambara', 'ba' => 'Bashkir', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali', 'bh' => 'Bihari languages', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan, Valencian', 'km' => 'Central Khmer', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'ny' => 'Chichewa, Chewa, Nyanja', 'zh' => 'Chinese', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree', 'hr' => 'Croatian', 'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi, Dhivehi, Maldivian', 'nl' => 'Dutch, Flemish', 'dz' => 'Dzongkha', 'en' => 'English', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijian', 'fi' => 'Finnish', 'fr' => 'French', 'ff' => 'Fulah', 'gd' => 'Gaelic, Scottish Gaelic', 'gl' => 'Galician', 'lg' => 'Ganda', 'ka' => 'Georgian', 'de' => 'German', 'ki' => 'Gikuyu, Kikuyu', 'el' => 'Greek (Modern)', 'kl' => 'Greenlandic, Kalaallisut', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'ht' => 'Haitian, Haitian Creole', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hz' => 'Herero', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hu' => 'Hungarian', 'is' => 'Icelandic', 'io' => 'Ido', 'ig' => 'Igbo', 'id' => 'Indonesian', 'iu' => 'Inuktitut', 'ik' => 'Inupiaq', 'ga' => 'Irish', 'it' => 'Italian', 'ja' => 'Japanese', 'jv' => 'Javanese', 'kn' => 'Kannada', 'kr' => 'Kanuri', 'ks' => 'Kashmiri', 'kk' => 'Kazakh', 'rw' => 'Kinyarwanda', 'kv' => 'Komi', 'kg' => 'Kongo', 'ko' => 'Korean', 'kj' => 'Kwanyama, Kuanyama', 'ku' => 'Kurdish', 'ky' => 'Kyrgyz', 'lo' => 'Lao', 'la' => 'Latin', 'lv' => 'Latvian', 'lb' => 'Letzeburgesch, Luxembourgish', 'li' => 'Limburgish, Limburgan, Limburger', 'ln' => 'Lingala', 'lt' => 'Lithuanian', 'lu' => 'Luba-Katanga', 'mk' => 'Macedonian', 'mg' => 'Malagasy', 'ms' => 'Malay', 'ml' => 'Malayalam', 'mt' => 'Maltese', 'gv' => 'Manx', 'mi' => 'Maori', 'mr' => 'Marathi', 'mh' => 'Marshallese', 'ro' => 'Moldovan, Moldavian, Romanian', 'mn' => 'Mongolian', 'na' => 'Nauru', 'nv' => 'Navajo, Navaho', 'nd' => 'Northern Ndebele', 'ng' => 'Ndonga', 'ne' => 'Nepali', 'se' => 'Northern Sami', 'no' => 'Norwegian', 'nb' => 'Norwegian Bokmål', 'nn' => 'Norwegian Nynorsk', 'ii' => 'Nuosu, Sichuan Yi', 'oc' => 'Occitan (post 1500)', 'oj' => 'Ojibwa', 'or' => 'Oriya', 'om' => 'Oromo', 'os' => 'Ossetian, Ossetic', 'pi' => 'Pali', 'pa' => 'Panjabi, Punjabi', 'ps' => 'Pashto, Pushto', 'fa' => 'Persian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'qu' => 'Quechua', 'rm' => 'Romansh', 'rn' => 'Rundi', 'ru' => 'Russian', 'sm' => 'Samoan', 'sg' => 'Sango', 'sa' => 'Sanskrit', 'sc' => 'Sardinian', 'sr' => 'Serbian', 'sn' => 'Shona', 'sd' => 'Sindhi', 'si' => 'Sinhala, Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'nr' => 'South Ndebele', 'es' => 'Spanish, Castilian', 'su' => 'Sundanese', 'sw' => 'Swahili', 'ss' => 'Swati', 'sv' => 'Swedish', 'tl' => 'Tagalog', 'ty' => 'Tahitian', 'tg' => 'Tajik', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'ts' => 'Tsonga', 'tn' => 'Tswana', 'tr' => 'Turkish', 'tk' => 'Turkmen', 'tw' => 'Twi', 'ug' => 'Uighur, Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volap_k', 'wa' => 'Walloon', 'cy' => 'Welsh', 'fy' => 'Western Frisian', 'wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang, Chuang', 'zu' => 'Zulu');
205
  // Convert to associative
206
  if ($to_assoc) {
207
  foreach($a as $i => $row) {
208
+ $key = $row['key'];
209
+ $value = $row['value'];
210
+ $result[$key] = $value;
 
 
 
 
 
 
211
  }
212
  } else {
213
  // Convert from associative
320
  $usage->wp_version = get_bloginfo('version');
321
  $usage->gutenberg = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ) && function_exists('is_plugin_active') && !is_plugin_active( 'classic-editor/classic-editor.php' );
322
  $usage->license = (trim(Mappress::$options->license)) ? true : false;
323
+ $usage->filters = (Mappress::$options->filters) ? true : false;
324
  $usage->mapbox = (Mappress::$options->mapbox) ? true : false;
325
  $usage->autoicons = Mappress::$options->autoicons && Mappress::$options->autoicons['key'];
326
  $usage->multisite = is_multisite();
readme.txt CHANGED
@@ -5,10 +5,10 @@ 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.7
8
- Stable tag: 2.62.12
9
 
10
  == Description ==
11
- MapPress is the easiest way to add beautiful interfactive Google and Leaflet maps to WordPress.
12
 
13
  Create unlimited maps and map markers using Gutenberg blocks or the classic editor. The popup map editor makes creating and editing maps easy!
14
 
@@ -25,7 +25,6 @@ Upgrade to [MapPress Pro](https://mappresspro.com/mappress) for even more featur
25
  2. Map Library in Gutenberg
26
  3. Creating a map
27
  4. Creating a mashup
28
- 5. POI with YouTube video
29
 
30
  = Key Features =
31
  * The only full-featured google map plugin and leaflet map plugin that is compatible with the Gutenberg editor
@@ -44,7 +43,7 @@ Upgrade to [MapPress Pro](https://mappresspro.com/mappress) for even more featur
44
  * Filter locations by by taxonomy, tag or category
45
  * Map widget and mashup widget are included
46
  * Marker clustering for both Leaflet and Google
47
- * Multiple geocoders including Google, Nominatim, Algolia and MapBox
48
  * Customizable marker and list templates
49
  * Custom map colors and styles using Google styled maps and Mapbox Studio
50
  * Generate maps automatically from custom fields
@@ -84,6 +83,19 @@ Please see the plugin documentation pages:
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  = 2.62.12 =
88
  * Fixed: mapbox style preview URL not working
89
  * Added: workaround for Jetpack Infinite Scroll bug that prevents inline scripts
5
  Requires at least: 5.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.7
8
+ Stable tag: 2.63
9
 
10
  == Description ==
11
+ MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
12
 
13
  Create unlimited maps and map markers using Gutenberg blocks or the classic editor. The popup map editor makes creating and editing maps easy!
14
 
25
  2. Map Library in Gutenberg
26
  3. Creating a map
27
  4. Creating a mashup
 
28
 
29
  = Key Features =
30
  * The only full-featured google map plugin and leaflet map plugin that is compatible with the Gutenberg editor
43
  * Filter locations by by taxonomy, tag or category
44
  * Map widget and mashup widget are included
45
  * Marker clustering for both Leaflet and Google
46
+ * Multiple geocoders including Google, Nominatim, Algolia and Mapbox
47
  * Customizable marker and list templates
48
  * Custom map colors and styles using Google styled maps and Mapbox Studio
49
  * Generate maps automatically from custom fields
83
 
84
  == Changelog ==
85
 
86
+ = 2.63 =
87
+ * Added: new map control and modal for editing custom map styles
88
+ * Added: new templates for map list items - please update custom templates to match
89
+ * Added: filters now support multiple filter taxonomies
90
+ * Added: POI list now has pagination controls
91
+ * Fixed: icon scale of 0 should be blank (auto scale)
92
+
93
+ = 2.62.13 =
94
+ * Fixed: popup text not sizing to featured image
95
+ * Fixed: directions server and POI body settings not saving properly
96
+ * Fixed: mapbox default style not applying for maps saved without a map type
97
+ * Changed: updated filters 'mappress_post_query' and 'mappress_pre_filter'
98
+
99
  = 2.62.12 =
100
  * Fixed: mapbox style preview URL not working
101
  * Added: workaround for Jetpack Infinite Scroll bug that prevents inline scripts
templates/map-filters.php CHANGED
@@ -1,12 +1,14 @@
1
  <?php if (Mappress::$pro) { ?>
2
- <# if (map.query && mappl10n.options.filter) { #>
3
  <div class='mapp-filters'>
4
  <div class='mapp-filters-list'>
5
- <?php $filter = new Mappress_Filter(array('key' => Mappress::$options->filter, 'format' => null)); ?>
6
- <div class='mapp-filter mapp-<?php echo $filter->key; ?>'>
7
- <div class='mapp-filter-label'><?php echo $filter->get_label(); ?></div>
8
- <div class='mapp-filter-values'><?php echo $filter->get_html(); ?></div>
9
- </div>
 
 
10
  </div>
11
  <div class='mapp-filters-toolbar'>
12
  <span class='mapp-button-submit mapp-filters-done' data-mapp-action='filters-toggle'><?php _e('Done', 'mappress-google-maps-for-wordpress');?></span>
1
  <?php if (Mappress::$pro) { ?>
2
+ <# if (map.query && mappl10n.options.filters && mappl10n.options.filters.length > 0) { #>
3
  <div class='mapp-filters'>
4
  <div class='mapp-filters-list'>
5
+ <?php foreach(Mappress::$options->filters as $atts) { ?>
6
+ <?php $filter = new Mappress_Filter($atts); ?>
7
+ <div class='mapp-filter mapp-<?php echo $filter->key; ?>'>
8
+ <div class='mapp-filter-label'><?php echo $filter->get_label(); ?></div>
9
+ <div class='mapp-filter-values'><?php echo $filter->get_html(); ?></div>
10
+ </div>
11
+ <?php } ?>
12
  </div>
13
  <div class='mapp-filters-toolbar'>
14
  <span class='mapp-button-submit mapp-filters-done' data-mapp-action='filters-toggle'><?php _e('Done', 'mappress-google-maps-for-wordpress');?></span>
templates/map-item.php CHANGED
@@ -1,2 +1,4 @@
1
- <img class="mapp-icon" src="{{{poi.icon}}}">
2
- <div class="mapp-title">{{{poi.title}}}</div>
 
 
1
+ <div class="mapp-info">
2
+ <img class="mapp-icon" src="{{{poi.icon}}}">
3
+ <div class="mapp-title">{{{poi.title}}}</div>
4
+ </div>
templates/map-loop.php CHANGED
@@ -1,6 +1,6 @@
1
  <# if (map.query) { #>
2
- <div class="mapp-list-header">
3
- {{{count}}} <?php _e("Results", 'mappress-google-maps-for-wordpress'); ?>
4
  </div>
5
  <# } #>
6
 
@@ -8,15 +8,34 @@
8
  <div class='mapp-list-toggle' data-mapp-action='list-toggle'></div>
9
  <# } #>
10
 
11
- <div class="mapp-items">
 
12
  <# _.forEach(pois, function(poi, i) { #>
13
- <# if (!poi.visible) { return; } #>
14
- <div class="mapp-item {{ (map.selected==poi) ? 'mapp-selected' : ''}}" data-mapp-action="open" data-mapp-poi="{{{i}}}">
15
- <# print(poi.render('item')); #>
16
- </div>
 
17
  <# }); #>
18
  </div>
19
- <# if (map.layout || mappl10n.options.layout == 'left') { #>
20
- <div class="mapp-list-footer">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </div>
22
  <# } #>
1
  <# if (map.query) { #>
2
+ <div class='mapp-list-header'>
3
+ {{{pagination.count}}} <?php _e("Results", 'mappress-google-maps-for-wordpress'); ?>
4
  </div>
5
  <# } #>
6
 
8
  <div class='mapp-list-toggle' data-mapp-action='list-toggle'></div>
9
  <# } #>
10
 
11
+
12
+ <div class='mapp-items'>
13
  <# _.forEach(pois, function(poi, i) { #>
14
+ <# if (poi.visible) { #>
15
+ <div class="mapp-item {{ (map.selected==poi) ? 'mapp-selected' : ''}}" data-mapp-action="open" data-mapp-poi="{{{i}}}">
16
+ <# print(poi.render('item')); #>
17
+ </div>
18
+ <# } #>
19
  <# }); #>
20
  </div>
21
+
22
+ <# //if (map.layout || mappl10n.options.layout == 'left') { #>
23
+
24
+ <# if (pagination.count > pagination.pageSize) { // Only show pagination if >1 page #>
25
+ <div class='mapp-list-footer'>
26
+ <div class='mapp-paginate'>
27
+ <#
28
+ const pages = Math.ceil(pagination.count / pagination.pageSize);
29
+ let prevClass = (pagination.page <= 1) ? 'mapp-paginate-button mapp-disabled' : 'mapp-paginate-button';
30
+ let prevAction = (pagination.page <= 1) ? '' : 'page';
31
+ let nextClass = (pagination.page >= pages) ? 'mapp-paginate-button mapp-disabled' : 'mapp-paginate-button';
32
+ let nextAction = (pagination.page >= pages) ? '' : 'page';
33
+ #>
34
+ <div class='{{prevClass}}' data-mapp-action='{{prevAction}}' data-mapp-page='1' >&laquo;</div>
35
+ <div class='{{prevClass}}' data-mapp-action='{{prevAction}}' data-mapp-page='{{ pagination.page - 1}}'>&lsaquo;</div>
36
+ <div class='mapp-paginate-count'><# print('<?php _e('%d of %d', 'mappress-google-maps-for-wordpress');?>'.replace('%d', pagination.page).replace('%d', pages)); #></div>
37
+ <div class='{{nextClass}}' data-mapp-action='{{nextAction}}' data-mapp-page='{{ pagination.page + 1}}'>&rsaquo;</div>
38
+ <div class='{{nextClass}}' data-mapp-action='{{nextAction}}' data-mapp-page='{{ pages }}'>&raquo;</div>
39
+ </div>
40
  </div>
41
  <# } #>
templates/map.php CHANGED
@@ -28,7 +28,7 @@
28
  </script>
29
 
30
  <script type='text/template' id='mapp-tmpl-map-header'>
31
- <# var filter = !map.editable && map.query && mappl10n.options.filter; #>
32
  <# var search = map.editable || (map.query && mappl10n.options.search); #>
33
  <# if (search || filter) { #>
34
  <div class='mapp-header'>
28
  </script>
29
 
30
  <script type='text/template' id='mapp-tmpl-map-header'>
31
+ <# var filter = !map.editable && map.query && mappl10n.options.filters && mappl10n.options.filters.length > 0; #>
32
  <# var search = map.editable || (map.query && mappl10n.options.search); #>
33
  <# if (search || filter) { #>
34
  <div class='mapp-header'>
templates/mashup-item.php CHANGED
@@ -1,2 +1,5 @@
1
- <img class="mapp-icon" src="{{{poi.icon}}}">
2
- <div class="mapp-title">{{{poi.title}}}</div>
 
 
 
1
+ <div class="mapp-info">
2
+ <img class="mapp-icon" src="{{{poi.icon}}}">
3
+ <div class="mapp-title">{{{poi.title}}}</div>
4
+ </div>
5
+ <div class='mapp-thumbnail'>{{{poi.thumbnail}}}</div>