MapPress Easy Google Maps - Version 2.56.6

Version Description

  • Fixed: typo in initial open directions
Download this release

Release Info

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

Code changes from version 2.56.3 to 2.56.6

build/index_mappress.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([,,,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=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,g=i.city&&i.city[0]!==h?i.city[0]:void 0,d=i.suburb&&i.suburb[0]!==h?i.suburb[0]:void 0,m=i.county&&i.county[0]!==h?i.county[0]:void 0,f=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},y=f.postcode,v=f.highlightedPostcode,w={name:p(i._highlightResult.locale_names),city:g?p(i._highlightResult.city):void 0,administrative:u?p(i._highlightResult.administrative):void 0,country:c?i._highlightResult.country.value:void 0,suburb:d?p(i._highlightResult.suburb):void 0,county:m?p(i._highlightResult.county):void 0,postcode:v},b={name:h,administrative:u,county:m,city:g,suburb:d,country:c,countryCode:(0,o.default)(i._tags),type:(0,n.default)(i._tags),latlng:{lat:i._geoloc.lat,lng:i._geoloc.lng},postcode:y,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(12)),n=s(i(13));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,")"))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=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()}},function(t,e,i){i(8),i(9),i(10),i(11),i(14),i(15),i(16),i(17),i(18)},function(t,e){var i,o=window.mapp||{};i=jQuery,o.lib={ajax:function(t){var e=this,o={callback:null,data:null,silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(i,o,n){"OK"!=i.status&&console.log(i.status),i.output?e.alert("AJAX Invalid Output\r\n"+i.output):t.callback&&t.callback(i,n)},error:function(i,o,n){"cancel"!=o&&(void 0!==n&&""!=n&&e.alert("AJAX ERROR\r\nTextStatus="+o+"\r\nError="+n+"\r\nResponseText="+i.responseText),t.callback&&t.callback(null))}};return t=i.extend(o,t),i.ajax(t)},alert:function(t){function e(e){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(t){if(void 0===i||void 0===t)return!1;t=t.split("."),v=i.fn.jquery.split(".");for(var e=0;e<t.length;e++){var o=parseInt(t[e]),n=void 0!==v[e]?parseInt(v[e]):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(t,e){if(o.lib.templates=o.lib.templates?o.lib.templates:{},!o.lib.templates[t]){var n=mappl10n.options.templates?mappl10n.options.template[t]:i("#mapp-tmpl-"+t).html();if(!n)return"";o.lib.templates[t]=_.template(n.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return o.lib.templates[t](e)}},o.lib.jqVersionCheck("1.7")||o.lib.alert("jQuery version is too old: "+i.fn.jquery),i("body").on("tabsactivate tabsshow",(function(t,e){var o=e.newPanel?e.newPanel:e.panel;o&&i(".mapp-layout",o).each((function(){var t=i(this).find(".mapp-canvas").attr("id"),e=window[t];e.resize(),e.recenter()}))})),jQuery,"leaflet"==mappl10n.options.engine&&(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}),o.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,i){function o(t){return(o="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})(t)}var n,s=window.mapp||{};n=jQuery,s.Map=function(t,e){this.defaults={alignment:null,center:null,classname: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:null,pois:null,postid:null,query:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.highlight=null,this.iw=null,this.places=null,this.poi=null,this.settings=e||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.pois_=[],this.xhr_,this.zindex_=0,_.extend(this,this.defaults,t,this.settings),this.layout=this.layout?this.layout:mappl10n.options.layout,this.poiList=this.poiList?this.poiList:mappl10n.options.poiList,this.postid=this.postid?this.postid:mappl10n.options.postid},s.Map.prototype={display:function(){var t=this;if(!0===this.sanity()){var e;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?((e=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,worldCopyJump:!0,zoomControl:null},this.mapOpts)).minZoom=isNaN(parseInt(e.minZoom))?0:parseInt(e.minZoom),this.map_=new L.Map(this.div.canvas.get(0),e),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_),this.iw=L.popup(),this.iw.setContent(this.div.iw.get(0))):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),(e=_.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.editable&&!this.query},this.mapOpts)).minZoom=isNaN(parseInt(e.minZoom))?0:parseInt(e.minZoom),this.map_.setOptions(e),this.iw="ib"==mappl10n.options.iwType||this.editable?new s.InfoBox(this):new google.maps.InfoWindow,this.iw.setContent(this.div.iw.get(0)),this.addLayers()),this.addStyles(),this.addMenu(),this.setMapTypeId(this.mapTypeId),this.clustering(),this.places=new s.Places(n(".mapp-places",this.div.search),{map:t}),this.editable&&this.places.sel.focus(),n(this.places).on("search.mapp",(function(e,i){t.search(i)}));var i=this.clusterer?"click drag zoom_changed zoomstart":"click drag";this.addEvents(i,(function(){t.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(function(e){var i=n(this).attr("data-mapp-action");e.preventDefault(),t.action(i,n(this).attr("data-mapp-"+i),n(this))})),this.div.filters.on("change",(function(){t.ajaxQuery()})),n(window).resize((function(){t.toggleView("mini"),t.resize()})),s.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())}))}},initCenter:function(){var t=this;this.recenter(),this.renderList(),this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():s.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.drectionsOpen(null,t):t&&e&&t.open()},action:function(t,e,i){var o=this;switch(t){case"center":this.toggleView("menu",!1),this.poiClose(),this.recenter();break;case"dir":this.directionsOpen(null,this.poi);break;case"dir-from":this.directionsOpen(this.poi,null);break;case"filters-reset":this.div.filters.find(":input").each((function(){"checkbox"==this.type||"radio"==this.type?n(this).prop("checked",!1):n(this).val("")})),this.ajaxQuery();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((function(t){o.search(t)}));break;case"layer":this.toggleLayer(e),this.toggleView("menu",!1);break;case"list-toggle":this.togglePoiListOpen();break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=i.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 i=0;i<t.length;i++)s.event.addListener(this.map_,t[i],e)},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var t=n.makeArray(this.layers),e=0;e<t.length;e++){var i=n.trim(t[e]),o=i.split(".").pop();this.layers_[i]?this.toggleLayer(i):"kml"==o||"kmz"==o?this.layers_[i]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:i}):"json"==o&&(this.layers_[i]=new google.maps.Data({map:this.map_}).loadGeoJson(i))}},addMenu:function(){var t=this;n("body").on("click",(function(e){var i=n(e.target),o=i.attr("data-mapp-action");i==t.div.filters||"filters-toggle"==o||i.closest(t.div.filters).length||t.toggleView("filters",!1),i==t.div.menu||"menu-toggle"==o||i.closest(t.div.menu).length||t.toggleView("menu",!1)}))},addSearchMove:function(){},addStyles:function(){var t=this;if("leaflet"==mappl10n.options.engine){if(this.editable){for(var e=L.control.layers(),i=0;i<mappl10n.options.baseLayers.length;i++){var a=mappl10n.options.baseLayers[i],l=mappl10n.options.providers[a.provider],r=n.extend({},l,a);e.addBaseLayer(L.tileLayer(l.url,r),r.label)}mappl10n.options.baseLayers.length>1&&e.addTo(this.map_)}this.map_.on("baselayerchange",(function(e){t.mapTypeId=e.layer.options.name}))}else{var p=mappl10n.options.styles?mappl10n.options.styles:[],h=mappl10n.options.style,c=["roadmap","satellite","terrain","hybrid"];if(h&&"object"==o(p[h])&&this.map_.setOptions({styles:p[h]}),this.editable){for(var u in p)this.map_.mapTypes.set(u,new google.maps.StyledMapType(p[u],{name:u})),c.push(u);this.map_.setOptions({mapTypeControl:!0,mapTypeControlOptions:{mapTypeIds:c,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else this.mapTypeId&&"object"==o(p[this.mapTypeId])&&this.map_.setOptions({styles:p[this.mapTypeId]});s.event.addListener(this.map_,"maptypeid_changed",(function(){t.mapTypeId=t.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"}))},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 i=t?t.getAddress():"",o=e?e.getAddress():"";t?t.open():e&&e.open(),this.dir_||(this.dir_=new s.Directions(this.div.directions,this)),this.dir_.open(i,o)},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(){"leaflet"==mappl10n.options.engine?this.map_.closePopup():this.iw.close(),this.dir_&&this.dir_.close(),this.select(null),n(this).triggerHandler("mapp.close")},poiInsert:function(t){this.pois_.unshift(t),t.setMap(this),this.renderList(),this.select(t),this.set({dirty:!0})},poiOpen:function(t,e){var i=null;if(this.poiClose(),this.select(t),"poi"!=mappl10n.options.mashupClick&&t.postid&&t.url)"post"==mappl10n.options.mashupClick?window.location.assign(t.url):window.open(t.url);else{this.div.layout.hasClass("mapp-view-mini")&&this.togglePoiListOpen(!1),e&&e.featureData?i=e.featureData:e&&e.propagatedFrom&&e.propagatedFrom.feature&&e.propagatedFrom.feature.properties&&(i=e.propagatedFrom.feature.properties),this.div.iw.html(t.render("popup",i));var o=this.clusterGetLatLng(t),s=o||t.getPosition(e);if("leaflet"==mappl10n.options.engine)this.iw.setLatLng(s),this.iw.options.offset=t.getAnchorPoint(),this.map_.openPopup(this.iw);else{var a=new google.maps.MVCObject;a.setValues({position:s,anchorPoint:t.getAnchorPoint(e)}),this.iw.open(this.map_,a)}n(this).triggerHandler("mapp.open",t)}},poiRemove:function(t){var e=n.inArray(t,this.pois_);-1!=e&&(this.pois_[e].setMap(null),this.pois_.splice(e,1),this.renderList()),this.set({dirty:!0})},recenter:function(){var t=this.center&&this.center.lat&&this.center.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();i=n?"leaflet"==mappl10n.options.engine?i.extend(n):i.union(n):i.extend(this.pois_[o].getPosition())}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,e=s.lib.template("map",{map:this});if(this.sel?(this.sel.html(e),this.div.layout=n(".mapp-layout",this.sel)):(n("#"+this.name+"-layout").replaceWith(e),this.div.layout=n("#"+this.name+"-layout")),!this.div.layout.length)return s.lib.log("MapPress: Missing map name or container for map: "+this.name);n.each(["canvas","controls","dialog","directions","filters","iw","list","menu","wrapper","search"],(function(e,i){t.div[i]=n(".mapp-"+i,t.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderList:function(){var t=this.getBounds(),e=0,i=this;if(!this.editable)for(var o=0;o<this.pois_.length;o++)this.pois_[o].visible="kml"!=this.pois_[o].type,this.query&&t&&!t.contains(this.pois_[o].getPosition())&&(this.pois_[o].visible=!1),e+=this.pois_[o].visible;this.div.list.html(s.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:e})),this.editable&&n(".mapp-items",this.div.list).sortable({axis:"y",cursor:"move",delay:200,update:function(){i.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})},renderMenu:function(){for(layer in this.layers_)n('[data-mapp-layer="'+layer+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[layer].getMap())},resetPois:function(){for(var t=0;t<this.pois_.length;t++)this.pois_[t].setMap(null);this.pois_=[],this.zindex_=0,this.clustersReset()},resize:function(t,e){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():s.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){if("undefined"==typeof _)return s.lib.alert("ERROR: underscore.js not loaded. Check cacheing / optimizing plugins.");if("leaflet"==mappl10n.options.engine){if("undefined"==typeof L)return s.lib.alert("ERROR: Unable to load Leaflet")}else{if("undefined"==typeof google)return s.lib.alert("ERROR: Google Maps API not loaded");n(document).ready((function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&s.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")}))}return!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)}},select:function(t){if(n(".mapp-item",this.div.list).removeClass("mapp-selected"),t){var e=n.inArray(t,this.pois_),i=n('[data-mapp-poi="'+e+'"]',this.div.list);s.lib.scrollTo(this.div.list,i),t.setZIndex(++this.zindex_),i.addClass("mapp-selected")}this.poi=t},set:function(t){for(var e in t){var i=t[e];switch(e){case"dirty":this.dirty=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}}},setHighlight:function(t){this.highlight&&("leaflet"==mappl10n.options.engine?this.highlight.remove():this.highlight.setMap(null)),t&&("leaflet"==mappl10n.options.engine?this.highlight=new L.Marker(t.getPosition()).addTo(this.map_):(this.highlight=new google.maps.Marker({position:t.getPosition()}),this.highlight.setMap(this.map_)))},setMapTypeId:function(t){var e=this;if("leaflet"==mappl10n.options.engine){this.map_.eachLayer((function(t){e.map_.removeLayer(t)})),t=!this.editable&&mappl10n.options.style&&"streets"==t?mappl10n.options.style:t,t=_.findIndex(mappl10n.options.baseLayers,{name:t})>=0?t:mappl10n.options.baseLayers[0].name;for(var i=0;i<mappl10n.options.baseLayers.length;i++){var s=mappl10n.options.baseLayers[i],a=mappl10n.options.providers[s.provider];if(s.name==t){var l=n.extend({},a,s);L.tileLayer(l.url,l).addTo(this.map_)}}}else{var r=-1!=n.inArray(t,["roadmap","satellite","terrain","hybrid"]);t=this.editable?r||"object"==o(mappl10n.options.styles[t])?t:"roadmap":r?t:"roadmap",this.map_.setMapTypeId(t)}},setPois:function(t){if(this.resetPois(),t){for(var e=0;e<t.length;e++){var i=new s.Poi(t[e]);this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this),i.setZIndex(this.zindex_+t.length-1-e)}this.zindex_+=t.length-1}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({width:"100%",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,e){var i=this;e=void 0!==e?e:null==this.layers_[t].getMap(),n.each(["traffic","bicycling","transit"],(function(t,e){i.layers_[e].setMap(null)})),e&&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}},ajaxSave:function(t){var e=this;this.postid&&"0"!=this.postid||(this.postid=mappl10n.options.postid),s.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(this),nonce:mappl10n.options.nonce},callback:function(i){i&&"OK"==i.status&&(e.mapid||(e.mapid=i.data.mapid),t&&t())}})}},s.Map.ajaxGet=function(t,e){s.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:function(t){"OK"==t.status&&e(t.data)}})},s.Map.ajaxDelete=function(t,e){s.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:t,nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status&&e&&e()}})}},function(t,e){var i,o=window.mapp||{};i=jQuery,o.Directions=function(t,e){this.sel=i(t),this.map=e;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(t){var e=i(this).attr("data-mapp-action"),n=i(".mapp-dir-daddr",o.sel).val(),s=i(".mapp-dir-saddr",o.sel).val();switch(t.preventDefault(),e){case"dir-cancel":o.close();break;case"dir-get":o.getDirections();break;case"dir-swap":i(".mapp-dir-saddr",o.sel).val(n),i(".mapp-dir-daddr",o.sel).val(s)}})),this.open=function(t,e){"google"!=mappl10n.options.directions?(this.map.toggleView("directions",!0),i(".mapp-dir-addr",this.sel).removeClass("mapp-error"),i(".mapp-dir-saddr",this.sel).val(t),i(".mapp-dir-daddr",this.sel).val(e)):this.openGoogle(t,e)},this.close=function(){this.map.toggleView("directions",!1)},this.getDirections=function(){var t=i(".mapp-dir-saddr",this.sel).val().trim(),e=i(".mapp-dir-daddr",this.sel).val().trim();this.map.poiClose(),this.openGoogle(t,e)},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)}}},function(t,e,i){"use strict";i.r(e);var o,n=i(5),s=i.n(n),a=i(6),l=i.n(a),r=window.mapp||{};r.geocoders={},o=jQuery,r.geocoders.algolia=function(t){this.map=t},r.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 s()({formatInputValue:l.a,hit:e,hitIndex:o,query:t,rawAnswer:i})}));e(o)}else e(null)}))}},function(t){r.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()},r.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.map((function(t){return t.value=t.description,t})),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){r.geocoders.mapbox=function(t){this.map=t},r.geocoders.mapbox.prototype={getDetails:function(t,e){var i=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:t.name,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:i}})},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){r.geocoders.nominatim=function(t){this.map=t},r.geocoders.nominatim.prototype={getDetails:function(t,e){var i=t.display_name.indexOf(","),o=i>0?t.display_name.substring(0,i):t.display_name,n=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:o,geometry:{location:{lat:t.lat,lng:t.lon},viewport:n}})},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)},function(t,e,i){"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}},function(t,e,i){"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"}},function(t,e,i){var o=window.mapp||{};o.Icons={},o.Icons.get=function(t){var e="https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png";return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:e,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:e}},o.Icons.getUrl=function(t){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"}},function(t,e){var i,o=window.mapp||{};i=jQuery,o.InfoBox=function(t,e){var o,n=i.extend({border:20},e),s=null,a=null,l=this;a=i('<div class="mapp-ib-wrapper"><div class="mapp-ib" tabindex="0"></div><div class="mapp-ib-tip"></div></div>').appendTo(t.getMap().getDiv()),jQuery(window).resize((function(){l.close()})),a.on("keydown",(function(t){27==t.which&&(l.close(),t.stopImmediatePropagation(),t.preventDefault())})),a.on("click",".mapp-close",(function(){l.close()})),this.getContent=function(){return i(".mapp-ib",a)},this.setContent=function(t){i(".mapp-ib",a).empty().append(t)},this.open=function(t,e){s=e,this.setMap(t)},this.onAdd=function(){o=!1;var t=i(":input",a);a.show(),t.length?t.first().focus():a.focus(),google.maps.event.trigger(l,"domready")},this.draw=function(){var t=this.getMap(),e=(i(".mapp-ib-body",a),this.getProjection().fromLatLngToContainerPixel(s.position));if(!o){o=!0;var l={width:i(":first-child",t.getDiv()).width(),height:i(":first-child",t.getDiv()).height()};a.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"});var r=a.outerWidth(!0),p=a.outerHeight(!0);p>l.height+s.anchorPoint.y-2*n.border&&(p=l.height+s.anchorPoint.y-2*n.border,a.css({"max-height":p+2}));var h=e.x,c=e.y;h+r/2>l.width&&(h=l.width-r/2),h-r/2<0&&(h=r/2),c-p+s.anchorPoint.y<n.border&&(c=p-s.anchorPoint.y+n.border),c>l.height&&(c=l.height),(e.x-h||e.y-c)&&t.panBy(e.x-h,e.y-c),a.css({left:h-r/2,bottom:l.height-c-s.anchorPoint.y})}},this.close=function(){a.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))},this.onRemove=function(){a.hide()}},"leaflet"!=mappl10n.options.engine&&(o.InfoBox.prototype=new google.maps.OverlayView)},function(t,e){var i,o=window.mapp||{};i=jQuery,o.Places=function(t,e){var n=this;this.sel=i(t),this.opts=i.extend({map:null},e);var s="";s="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"algolia",this.geocoder=new o.geocoders[s](this.opts.map),this.sel.on("keydown",(function(t){if(13==t.which){t.preventDefault();var e=n.parseLatLng(n.sel.val());e&&(i(n).triggerHandler("search.mapp",e),n.sel.autocomplete("close"),t.stopImmediatePropagation()),"http"==n.sel.val().substring(0,4)&&(i(n).triggerHandler("search.mapp",n.sel.val()),n.sel.autocomplete("close"),t.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()},o.Places.prototype={parse:function(t,e){var o=t&&t.name?i.trim(t.name):i.trim(t);if(o)if("user"!=o)if(t&&t.geometry)e(t);else{var n=this.parseLatLng(t);n?e(n):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.lat&&t.lng)e=t;else{var o=(t&&t.name?i.trim(t.name):i.trim(t)).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 t=this;this.sel.on("autocompleteselect",(function(e,o){t.geocoder.getDetails(o.item,(function(e){t.parse(e,(function(e){e&&i(t).triggerHandler("search.mapp",e)}))}))})),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(e,i){t.geocoder.getPredictions(e.term,(function(t){i(t)}))}})}}},function(t,e){var i,o=window.mapp||{};i=jQuery,o.Poi=function(t){if(this.defaults={address:null,body:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},i.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),t.viewport&&t.viewport.sw&&t.viewport.ne&&t.viewport.sw.lat){var e=t.viewport.sw,o=t.viewport.ne;"leaflet"==mappl10n.options.engine?this.viewport=new L.LatLngBounds(L.latLng(e.lat,e.lng),L.latLng(o.lat,o.lng)):this.viewport=new google.maps.LatLngBounds(new google.maps.LatLng(e.lat,e.lng),new google.maps.LatLng(o.lat,o.lng))}var n=[],s=[];if(!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(var a=0;a<t.poly.paths.length;a++){n=[];for(var l=0;l<t.poly.paths[a].length;l++)n.push(new google.maps.LatLng(t.poly.paths[a][l].lat,t.poly.paths[a][l].lng));s.push(new google.maps.MVCArray(n))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(s)}),this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(a=0;a<t.poly.path.length;a++)n.push(new google.maps.LatLng(t.poly.path[a].lat,t.poly.path[a].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(n)}),this.setColors(t.poly);break;case"circle":var r=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:r,radius:parseFloat(t.poly.radius)}),this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport}),this.setColors(t.poly);break;case"kml":var p=t.kml&&t.kml.url?t.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(p):new google.maps.KmlLayer(p,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([t.point.lat,t.point.lng],{title:t.title}):this.overlay=new google.maps.Marker({position:new google.maps.LatLng(t.point.lat,t.point.lng),title:t.title})}t.type||this.setIcon(t.iconid)},o.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"leaflet"==mappl10n.options.engine?[0,0]:t&&t.pixelOffset?new google.maps.Point(t.pixelOffset.width,t.pixelOffset.height):new google.maps.Point(0,0);case"poly":return"leaflet"==mappl10n.options.engine?[0,0]:new google.maps.Point(0,0);default:return"leaflet"==mappl10n.options.engine?this.overlay.options.icon.options.popupAnchor?this.overlay.options.icon.options.popupAnchor:[0,-32]:void 0!==this.overlay.anchorPoint?this.overlay.anchorPoint:new google.maps.Point(0,-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}},open:function(t){this.map.poiOpen(this,t)},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},render:function(t,e){var i=_.extend(this,{icon:o.Icons.getUrl(this.iconid)});return e&&(i.body=e.description,i.title=e.name),o.lib.template(this.map.templates[t],{poi:i,colors:this.getTemplateColors()})},set:function(t){for(att in t){var e=t[att];switch(att){case"dirty":this.map.set({dirty:e});break;case"iconid":this.setIcon(e);break;default:this[att]=e}}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 e=this;"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=t:this.overlay.setDraggable(t),this.isPoly()&&this.overlay.setEditable(t),o.event.clearListeners(this.overlay,"rightclick"),o.event.clearListeners(this.overlay,"dragstart"),t&&(o.event.addListener(this.overlay,"dragstart",(function(){e.viewport=null,e.map.poiClose()})),o.event.addListener(this.overlay,"dragend",(function(){e.map.set({dirty:!0})})),"polygon"!=this.type&&"polyline"!=this.type||"leaflet"!=mappl10n.options.engine&&(o.event.addListener(this.overlay,"rightclick",(function(t){null!=t.vertex&&e.overlay.getPath().getLength()>2&&e.overlay.getPath().removeAt(t.vertex)})),o.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),o.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(function(){e.map.set({dirty:!0})})))))},setIcon:function(t){this.type||void 0===o.Icons||(this.iconid=t,"leaflet"==mappl10n.options.engine||this.overlay.setIcon(null),this.overlay.setIcon(o.Icons.get(t)))},setMap:function(t){var e=this;this.map=t,o.event.clearInstanceListeners(this.overlay),null!=t?("kml"==this.type&&("leaflet"==mappl10n.options.engine?(o.event.addListenerOnce(this.overlay,"ready",(function(){e.viewport=e.overlay.getBounds()})),o.event.addListenerOnce(this.overlay,"error",(function(){alert(mappl10n.kml_error)}))):(o.event.addListener(this.overlay,"defaultviewport_changed",(function(){e.viewport=e.overlay.getDefaultViewport()})),o.event.addListener(this.overlay,"status_changed",(function(){var t=e.overlay.getStatus();"OK"!=t&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+t)})))),o.event.addListener(this.overlay,"click",(function(t){e.open(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()))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setTemplateColors:function(t,e,i){var o="polyline"==this.type?{strokeColor:t,strokeOpacity:e/100,strokeWeight:i}:{fillColor:t,fillOpacity:e/100,strokeColor:t,strokeWeight:i,strokeOpacity:1};this.setColors(o)},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}}},function(t,e){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()}]);
1
+ !function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([,,,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=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,g=i.city&&i.city[0]!==h?i.city[0]:void 0,d=i.suburb&&i.suburb[0]!==h?i.suburb[0]:void 0,m=i.county&&i.county[0]!==h?i.county[0]:void 0,f=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},y=f.postcode,v=f.highlightedPostcode,w={name:p(i._highlightResult.locale_names),city:g?p(i._highlightResult.city):void 0,administrative:u?p(i._highlightResult.administrative):void 0,country:c?i._highlightResult.country.value:void 0,suburb:d?p(i._highlightResult.suburb):void 0,county:m?p(i._highlightResult.county):void 0,postcode:v},b={name:h,administrative:u,county:m,city:g,suburb:d,country:c,countryCode:(0,o.default)(i._tags),type:(0,n.default)(i._tags),latlng:{lat:i._geoloc.lat,lng:i._geoloc.lng},postcode:y,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(12)),n=s(i(13));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,")"))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=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()}},function(t,e,i){i(8),i(9),i(10),i(11),i(14),i(15),i(16),i(17),i(18)},function(t,e){var i,o=window.mapp||{};i=jQuery,o.lib={ajax:function(t){var e=this,o={callback:null,data:null,silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(i,o,n){"OK"!=i.status&&console.log(i.status),i.output?e.alert("AJAX Invalid Output\r\n"+i.output):t.callback&&t.callback(i,n)},error:function(i,o,n){"cancel"!=o&&(void 0!==n&&""!=n&&e.alert("AJAX ERROR\r\nTextStatus="+o+"\r\nError="+n+"\r\nResponseText="+i.responseText),t.callback&&t.callback(null))}};return t=i.extend(o,t),i.ajax(t)},alert:function(t){function e(e){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(t){if(void 0===i||void 0===t)return!1;t=t.split("."),v=i.fn.jquery.split(".");for(var e=0;e<t.length;e++){var o=parseInt(t[e]),n=void 0!==v[e]?parseInt(v[e]):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(t,e){if(o.lib.templates=o.lib.templates?o.lib.templates:{},!o.lib.templates[t]){var n=mappl10n.options.templates?mappl10n.options.template[t]:i("#mapp-tmpl-"+t).html();if(!n)return"";o.lib.templates[t]=_.template(n.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return o.lib.templates[t](e)}},o.lib.jqVersionCheck("1.7")||o.lib.alert("jQuery version is too old: "+i.fn.jquery),i("body").on("tabsactivate tabsshow",(function(t,e){var o=e.newPanel?e.newPanel:e.panel;o&&i(".mapp-layout",o).each((function(){var t=i(this).find(".mapp-canvas").attr("id"),e=window[t];e.resize(),e.recenter()}))})),jQuery,"leaflet"==mappl10n.options.engine&&(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}),o.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,i){function o(t){return(o="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})(t)}var n,s=window.mapp||{};n=jQuery,s.Map=function(t,e){this.defaults={alignment:null,center:null,classname: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:null,pois:null,postid:null,query:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.highlight=null,this.iw=null,this.places=null,this.poi=null,this.settings=e||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.pois_=[],this.xhr_,this.zindex_=0,_.extend(this,this.defaults,t,this.settings),this.layout=this.layout?this.layout:mappl10n.options.layout,this.poiList=this.poiList?this.poiList:mappl10n.options.poiList,this.postid=this.postid?this.postid:mappl10n.options.postid},s.Map.prototype={display:function(){var t=this;if(!0===this.sanity()){var e;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?((e=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,worldCopyJump:!0,zoomControl:null},this.mapOpts)).minZoom=isNaN(parseInt(e.minZoom))?0:parseInt(e.minZoom),this.map_=new L.Map(this.div.canvas.get(0),e),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_),this.iw=L.popup(),this.iw.setContent(this.div.iw.get(0))):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),(e=_.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.editable&&!this.query},this.mapOpts)).minZoom=isNaN(parseInt(e.minZoom))?0:parseInt(e.minZoom),this.map_.setOptions(e),this.iw="ib"==mappl10n.options.iwType||this.editable?new s.InfoBox(this):new google.maps.InfoWindow,this.iw.setContent(this.div.iw.get(0)),this.addLayers()),this.addStyles(),this.addMenu(),this.setMapTypeId(this.mapTypeId),this.clustering(),this.places=new s.Places(n(".mapp-places",this.div.search),{map:t}),this.editable&&this.places.sel.focus(),n(this.places).on("search.mapp",(function(e,i){t.search(i)}));var i=this.clusterer?"click drag zoom_changed zoomstart":"click drag";this.addEvents(i,(function(){t.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(function(e){var i=n(this).attr("data-mapp-action");e.preventDefault(),t.action(i,n(this).attr("data-mapp-"+i),n(this))})),this.div.filters.on("change",(function(){t.ajaxQuery()})),n(window).resize((function(){t.toggleView("mini"),t.resize()})),s.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())}))}},initCenter:function(){var t=this;this.recenter(),this.renderList(),this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():s.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,e,i){var o=this;switch(t){case"center":this.toggleView("menu",!1),this.poiClose(),this.recenter();break;case"dir":this.directionsOpen(null,this.poi);break;case"dir-from":this.directionsOpen(this.poi,null);break;case"filters-reset":this.div.filters.find(":input").each((function(){"checkbox"==this.type||"radio"==this.type?n(this).prop("checked",!1):n(this).val("")})),this.ajaxQuery();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((function(t){o.search(t)}));break;case"layer":this.toggleLayer(e),this.toggleView("menu",!1);break;case"list-toggle":this.togglePoiListOpen();break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=i.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 i=0;i<t.length;i++)s.event.addListener(this.map_,t[i],e)},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var t=n.makeArray(this.layers),e=0;e<t.length;e++){var i=n.trim(t[e]),o=i.split(".").pop();this.layers_[i]?this.toggleLayer(i):"kml"==o||"kmz"==o?this.layers_[i]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:i}):"json"==o&&(this.layers_[i]=new google.maps.Data({map:this.map_}).loadGeoJson(i))}},addMenu:function(){var t=this;n("body").on("click",(function(e){var i=n(e.target),o=i.attr("data-mapp-action");i==t.div.filters||"filters-toggle"==o||i.closest(t.div.filters).length||t.toggleView("filters",!1),i==t.div.menu||"menu-toggle"==o||i.closest(t.div.menu).length||t.toggleView("menu",!1)}))},addSearchMove:function(){},addStyles:function(){var t=this;if("leaflet"==mappl10n.options.engine){if(this.editable){for(var e=L.control.layers(),i=0;i<mappl10n.options.baseLayers.length;i++){var a=mappl10n.options.baseLayers[i],l=mappl10n.options.providers[a.provider],r=n.extend({},l,a);e.addBaseLayer(L.tileLayer(l.url,r),r.label)}mappl10n.options.baseLayers.length>1&&e.addTo(this.map_)}this.map_.on("baselayerchange",(function(e){t.mapTypeId=e.layer.options.name}))}else{var p=mappl10n.options.styles?mappl10n.options.styles:[],h=mappl10n.options.style,c=["roadmap","satellite","terrain","hybrid"];if(h&&"object"==o(p[h])&&this.map_.setOptions({styles:p[h]}),this.editable){for(var u in p)this.map_.mapTypes.set(u,new google.maps.StyledMapType(p[u],{name:u})),c.push(u);this.map_.setOptions({mapTypeControl:!0,mapTypeControlOptions:{mapTypeIds:c,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else this.mapTypeId&&"object"==o(p[this.mapTypeId])&&this.map_.setOptions({styles:p[this.mapTypeId]});s.event.addListener(this.map_,"maptypeid_changed",(function(){t.mapTypeId=t.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"}))},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 i=t?t.getAddress():"",o=e?e.getAddress():"";t?t.open():e&&e.open(),this.dir_||(this.dir_=new s.Directions(this.div.directions,this)),this.dir_.open(i,o)},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(){"leaflet"==mappl10n.options.engine?this.map_.closePopup():this.iw.close(),this.dir_&&this.dir_.close(),this.select(null),n(this).triggerHandler("mapp.close")},poiInsert:function(t){this.pois_.unshift(t),t.setMap(this),this.renderList(),this.select(t),this.set({dirty:!0})},poiOpen:function(t,e){var i=null;if(this.poiClose(),this.select(t),"poi"!=mappl10n.options.mashupClick&&t.postid&&t.url)"post"==mappl10n.options.mashupClick?window.location.assign(t.url):window.open(t.url);else{this.div.layout.hasClass("mapp-view-mini")&&this.togglePoiListOpen(!1),e&&e.featureData?i=e.featureData:e&&e.propagatedFrom&&e.propagatedFrom.feature&&e.propagatedFrom.feature.properties&&(i=e.propagatedFrom.feature.properties),this.div.iw.html(t.render("popup",i));var o=this.clusterGetLatLng(t),s=o||t.getPosition(e);if("leaflet"==mappl10n.options.engine)this.iw.setLatLng(s),this.iw.options.offset=t.getAnchorPoint(),this.map_.openPopup(this.iw);else{var a=new google.maps.MVCObject;a.setValues({position:s,anchorPoint:t.getAnchorPoint(e)}),this.iw.open(this.map_,a)}n(this).triggerHandler("mapp.open",t)}},poiRemove:function(t){var e=n.inArray(t,this.pois_);-1!=e&&(this.pois_[e].setMap(null),this.pois_.splice(e,1),this.renderList()),this.set({dirty:!0})},recenter:function(){var t=this.center&&this.center.lat&&this.center.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();i=n?"leaflet"==mappl10n.options.engine?i.extend(n):i.union(n):i.extend(this.pois_[o].getPosition())}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,e=s.lib.template("map",{map:this});if(this.sel?(this.sel.html(e),this.div.layout=n(".mapp-layout",this.sel)):(n("#"+this.name+"-layout").replaceWith(e),this.div.layout=n("#"+this.name+"-layout")),!this.div.layout.length)return s.lib.log("MapPress: Missing map name or container for map: "+this.name);n.each(["canvas","controls","dialog","directions","filters","iw","list","menu","wrapper","search"],(function(e,i){t.div[i]=n(".mapp-"+i,t.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderList:function(){var t=this.getBounds(),e=0,i=this;if(!this.editable)for(var o=0;o<this.pois_.length;o++)this.pois_[o].visible="kml"!=this.pois_[o].type,this.query&&t&&!t.contains(this.pois_[o].getPosition())&&(this.pois_[o].visible=!1),e+=this.pois_[o].visible;this.div.list.html(s.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:e})),this.editable&&n(".mapp-items",this.div.list).sortable({axis:"y",cursor:"move",delay:200,update:function(){i.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})},renderMenu:function(){for(layer in this.layers_)n('[data-mapp-layer="'+layer+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[layer].getMap())},resetPois:function(){for(var t=0;t<this.pois_.length;t++)this.pois_[t].setMap(null);this.pois_=[],this.zindex_=0,this.clustersReset()},resize:function(t,e){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():s.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){if("undefined"==typeof _)return s.lib.alert("ERROR: underscore.js not loaded. Check cacheing / optimizing plugins.");if("leaflet"==mappl10n.options.engine){if("undefined"==typeof L)return s.lib.alert("ERROR: Unable to load Leaflet")}else{if("undefined"==typeof google)return s.lib.alert("ERROR: Google Maps API not loaded");n(document).ready((function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&s.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")}))}return!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)}},select:function(t){if(n(".mapp-item",this.div.list).removeClass("mapp-selected"),t){var e=n.inArray(t,this.pois_),i=n('[data-mapp-poi="'+e+'"]',this.div.list);s.lib.scrollTo(this.div.list,i),t.setZIndex(++this.zindex_),i.addClass("mapp-selected")}this.poi=t},set:function(t){for(var e in t){var i=t[e];switch(e){case"dirty":this.dirty=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}}},setHighlight:function(t){this.highlight&&("leaflet"==mappl10n.options.engine?this.highlight.remove():this.highlight.setMap(null)),t&&("leaflet"==mappl10n.options.engine?this.highlight=new L.Marker(t.getPosition()).addTo(this.map_):(this.highlight=new google.maps.Marker({position:t.getPosition()}),this.highlight.setMap(this.map_)))},setMapTypeId:function(t){var e=this;if("leaflet"==mappl10n.options.engine){this.map_.eachLayer((function(t){e.map_.removeLayer(t)})),t=!this.editable&&mappl10n.options.style&&"streets"==t?mappl10n.options.style:t,t=_.findIndex(mappl10n.options.baseLayers,{name:t})>=0?t:mappl10n.options.baseLayers[0].name;for(var i=0;i<mappl10n.options.baseLayers.length;i++){var s=mappl10n.options.baseLayers[i],a=mappl10n.options.providers[s.provider];if(s.name==t){var l=n.extend({},a,s);L.tileLayer(l.url,l).addTo(this.map_)}}}else{var r=-1!=n.inArray(t,["roadmap","satellite","terrain","hybrid"]);t=this.editable?r||"object"==o(mappl10n.options.styles[t])?t:"roadmap":r?t:"roadmap",this.map_.setMapTypeId(t)}},setPois:function(t){if(this.resetPois(),t){for(var e=0;e<t.length;e++){var i=new s.Poi(t[e]);this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this),i.setZIndex(this.zindex_+t.length-1-e)}this.zindex_+=t.length-1}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({width:"100%",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,e){var i=this;e=void 0!==e?e:null==this.layers_[t].getMap(),n.each(["traffic","bicycling","transit"],(function(t,e){i.layers_[e].setMap(null)})),e&&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}},ajaxSave:function(t){var e=this;this.postid&&"0"!=this.postid||(this.postid=mappl10n.options.postid),s.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(this),nonce:mappl10n.options.nonce},callback:function(i){i&&"OK"==i.status&&(e.mapid||(e.mapid=i.data.mapid),t&&t())}})}},s.Map.ajaxGet=function(t,e){s.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:function(t){"OK"==t.status&&e(t.data)}})},s.Map.ajaxDelete=function(t,e){s.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:t,nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status&&e&&e()}})}},function(t,e){var i,o=window.mapp||{};i=jQuery,o.Directions=function(t,e){this.sel=i(t),this.map=e;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(t){var e=i(this).attr("data-mapp-action"),n=i(".mapp-dir-daddr",o.sel).val(),s=i(".mapp-dir-saddr",o.sel).val();switch(t.preventDefault(),e){case"dir-cancel":o.close();break;case"dir-get":o.getDirections();break;case"dir-swap":i(".mapp-dir-saddr",o.sel).val(n),i(".mapp-dir-daddr",o.sel).val(s)}})),this.open=function(t,e){"google"!=mappl10n.options.directions?(this.map.toggleView("directions",!0),i(".mapp-dir-addr",this.sel).removeClass("mapp-error"),i(".mapp-dir-saddr",this.sel).val(t),i(".mapp-dir-daddr",this.sel).val(e)):this.openGoogle(t,e)},this.close=function(){this.map.toggleView("directions",!1)},this.getDirections=function(){var t=i(".mapp-dir-saddr",this.sel).val().trim(),e=i(".mapp-dir-daddr",this.sel).val().trim();this.map.poiClose(),this.openGoogle(t,e)},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)}}},function(t,e,i){"use strict";i.r(e);var o,n=i(5),s=i.n(n),a=i(6),l=i.n(a),r=window.mapp||{};r.geocoders={},o=jQuery,r.geocoders.algolia=function(t){this.map=t},r.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 s()({formatInputValue:l.a,hit:e,hitIndex:o,query:t,rawAnswer:i})}));e(o)}else e(null)}))}},function(t){r.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()},r.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.map((function(t){return t.value=t.description,t})),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){r.geocoders.mapbox=function(t){this.map=t},r.geocoders.mapbox.prototype={getDetails:function(t,e){var i=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:t.name,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:i}})},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){r.geocoders.nominatim=function(t){this.map=t},r.geocoders.nominatim.prototype={getDetails:function(t,e){var i=t.display_name.indexOf(","),o=i>0?t.display_name.substring(0,i):t.display_name,n=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:o,geometry:{location:{lat:t.lat,lng:t.lon},viewport:n}})},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)},function(t,e,i){"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}},function(t,e,i){"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"}},function(t,e,i){var o=window.mapp||{};o.Icons={},o.Icons.get=function(t){var e="https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png";return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:e,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:e}},o.Icons.getUrl=function(t){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"}},function(t,e){var i,o=window.mapp||{};i=jQuery,o.InfoBox=function(t,e){var o,n=i.extend({border:20},e),s=null,a=null,l=this;a=i('<div class="mapp-ib-wrapper"><div class="mapp-ib" tabindex="0"></div><div class="mapp-ib-tip"></div></div>').appendTo(t.getMap().getDiv()),jQuery(window).resize((function(){l.close()})),a.on("keydown",(function(t){27==t.which&&(l.close(),t.stopImmediatePropagation(),t.preventDefault())})),a.on("click",".mapp-close",(function(){l.close()})),this.getContent=function(){return i(".mapp-ib",a)},this.setContent=function(t){i(".mapp-ib",a).empty().append(t)},this.open=function(t,e){s=e,this.setMap(t)},this.onAdd=function(){o=!1;var t=i(":input",a);a.show(),t.length?t.first().focus():a.focus(),google.maps.event.trigger(l,"domready")},this.draw=function(){var t=this.getMap(),e=(i(".mapp-ib-body",a),this.getProjection().fromLatLngToContainerPixel(s.position));if(!o){o=!0;var l={width:i(":first-child",t.getDiv()).width(),height:i(":first-child",t.getDiv()).height()};a.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"});var r=a.outerWidth(!0),p=a.outerHeight(!0);p>l.height+s.anchorPoint.y-2*n.border&&(p=l.height+s.anchorPoint.y-2*n.border,a.css({"max-height":p+2}));var h=e.x,c=e.y;h+r/2>l.width&&(h=l.width-r/2),h-r/2<0&&(h=r/2),c-p+s.anchorPoint.y<n.border&&(c=p-s.anchorPoint.y+n.border),c>l.height&&(c=l.height),(e.x-h||e.y-c)&&t.panBy(e.x-h,e.y-c),a.css({left:h-r/2,bottom:l.height-c-s.anchorPoint.y})}},this.close=function(){a.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))},this.onRemove=function(){a.hide()}},"leaflet"!=mappl10n.options.engine&&(o.InfoBox.prototype=new google.maps.OverlayView)},function(t,e){var i,o=window.mapp||{};i=jQuery,o.Places=function(t,e){var n=this;this.sel=i(t),this.opts=i.extend({map:null},e);var s="";s="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"algolia",this.geocoder=new o.geocoders[s](this.opts.map),this.sel.on("keydown",(function(t){if(13==t.which){t.preventDefault();var e=n.parseLatLng(n.sel.val());e&&(i(n).triggerHandler("search.mapp",e),n.sel.autocomplete("close"),t.stopImmediatePropagation()),"http"==n.sel.val().substring(0,4)&&(i(n).triggerHandler("search.mapp",n.sel.val()),n.sel.autocomplete("close"),t.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()},o.Places.prototype={parse:function(t,e){var o=t&&t.name?i.trim(t.name):i.trim(t);if(o)if("user"!=o)if(t&&t.geometry)e(t);else{var n=this.parseLatLng(t);n?e(n):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.lat&&t.lng)e=t;else{var o=(t&&t.name?i.trim(t.name):i.trim(t)).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 t=this;this.sel.on("autocompleteselect",(function(e,o){t.geocoder.getDetails(o.item,(function(e){t.parse(e,(function(e){e&&i(t).triggerHandler("search.mapp",e)}))}))})),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(e,i){t.geocoder.getPredictions(e.term,(function(t){i(t)}))}})}}},function(t,e){var i,o=window.mapp||{};i=jQuery,o.Poi=function(t){if(this.defaults={address:null,body:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},i.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),t.viewport&&t.viewport.sw&&t.viewport.ne&&t.viewport.sw.lat){var e=t.viewport.sw,o=t.viewport.ne;"leaflet"==mappl10n.options.engine?this.viewport=new L.LatLngBounds(L.latLng(e.lat,e.lng),L.latLng(o.lat,o.lng)):this.viewport=new google.maps.LatLngBounds(new google.maps.LatLng(e.lat,e.lng),new google.maps.LatLng(o.lat,o.lng))}var n=[],s=[];if(!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(var a=0;a<t.poly.paths.length;a++){n=[];for(var l=0;l<t.poly.paths[a].length;l++)n.push(new google.maps.LatLng(t.poly.paths[a][l].lat,t.poly.paths[a][l].lng));s.push(new google.maps.MVCArray(n))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(s)}),this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(a=0;a<t.poly.path.length;a++)n.push(new google.maps.LatLng(t.poly.path[a].lat,t.poly.path[a].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(n)}),this.setColors(t.poly);break;case"circle":var r=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:r,radius:parseFloat(t.poly.radius)}),this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport}),this.setColors(t.poly);break;case"kml":var p=t.kml&&t.kml.url?t.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(p):new google.maps.KmlLayer(p,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([t.point.lat,t.point.lng],{title:t.title}):this.overlay=new google.maps.Marker({position:new google.maps.LatLng(t.point.lat,t.point.lng),title:t.title})}t.type||this.setIcon(t.iconid)},o.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"leaflet"==mappl10n.options.engine?[0,0]:t&&t.pixelOffset?new google.maps.Point(t.pixelOffset.width,t.pixelOffset.height):new google.maps.Point(0,0);case"poly":return"leaflet"==mappl10n.options.engine?[0,0]:new google.maps.Point(0,0);default:return"leaflet"==mappl10n.options.engine?this.overlay.options.icon.options.popupAnchor?this.overlay.options.icon.options.popupAnchor:[0,-32]:void 0!==this.overlay.anchorPoint?this.overlay.anchorPoint:new google.maps.Point(0,-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}},open:function(t){this.map.poiOpen(this,t)},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},render:function(t,e){var i=_.extend(this,{icon:o.Icons.getUrl(this.iconid)});return e&&(i.body=e.description,i.title=e.name),o.lib.template(this.map.templates[t],{poi:i,colors:this.getTemplateColors()})},set:function(t){for(att in t){var e=t[att];switch(att){case"dirty":this.map.set({dirty:e});break;case"iconid":this.setIcon(e);break;default:this[att]=e}}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 e=this;"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=t:this.overlay.setDraggable(t),this.isPoly()&&this.overlay.setEditable(t),o.event.clearListeners(this.overlay,"rightclick"),o.event.clearListeners(this.overlay,"dragstart"),t&&(o.event.addListener(this.overlay,"dragstart",(function(){e.viewport=null,e.map.poiClose()})),o.event.addListener(this.overlay,"dragend",(function(){e.map.set({dirty:!0})})),"polygon"!=this.type&&"polyline"!=this.type||"leaflet"!=mappl10n.options.engine&&(o.event.addListener(this.overlay,"rightclick",(function(t){null!=t.vertex&&e.overlay.getPath().getLength()>2&&e.overlay.getPath().removeAt(t.vertex)})),o.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),o.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(function(){e.map.set({dirty:!0})})))))},setIcon:function(t){this.type||void 0===o.Icons||(this.iconid=t,"leaflet"==mappl10n.options.engine||this.overlay.setIcon(null),this.overlay.setIcon(o.Icons.get(t)))},setMap:function(t){var e=this;this.map=t,o.event.clearInstanceListeners(this.overlay),null!=t?("kml"==this.type&&("leaflet"==mappl10n.options.engine?(o.event.addListenerOnce(this.overlay,"ready",(function(){e.viewport=e.overlay.getBounds()})),o.event.addListenerOnce(this.overlay,"error",(function(){alert(mappl10n.kml_error)}))):(o.event.addListener(this.overlay,"defaultviewport_changed",(function(){e.viewport=e.overlay.getDefaultViewport()})),o.event.addListener(this.overlay,"status_changed",(function(){var t=e.overlay.getStatus();"OK"!=t&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+t)})))),o.event.addListener(this.overlay,"click",(function(t){e.open(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()))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setTemplateColors:function(t,e,i){var o="polyline"==this.type?{strokeColor:t,strokeOpacity:e/100,strokeWeight:i}:{fillColor:t,fillOpacity:e/100,strokeColor:t,strokeWeight:i,strokeOpacity:1};this.setColors(o)},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}}},function(t,e){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()}]);
build/index_mappress_admin.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=19)}([function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"default",(function(){return O}));var p=window.mapp||{},l=wp.element.createElement,c=wp.i18n,u=c.__,m=(c._x,c._n,c.sprintf,wp.element),d=m.Fragment,f=m.useEffect,h=(m.useLayoutEffect,m.useRef),y=m.useState,b=wp.components,v=b.Button,g=b.Modal,w=(b.Popover,b.Spinner,b.TextControl);function O(t){var e=o(y({isFetchingMap:!!t.mapid,isSavingMap:!1,map:null}),2),n=e[0],i=e[1],a=h(null);function s(t){i((function(e){return r(r({},e),t)}))}function c(e,i){switch(e){case"change-title":n.map.set({dirty:!0,title:i}),s({map:n.map});break;case"close":t.onAction("edit-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(p.store.destroyMap({mapid:t.mapid}),t.onAction("edit-destroy"));break;case"save":p.store.saveMap({mapdata:n.map.toJSON(),success:function(e){n.map.set({dirty:!1}),t.onAction("edit-save",e.mapid)}})}}function m(){if(n.map&&!n.isFetchingMap){var t=n.map.title?n.map.title:"";return l(w,{className:"mapp-edit-title",placeholder:u("Untitled"),value:t,onChange:function(t){return c("change-title",t)}})}}function b(){return l("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:function(t){return t.stopPropagation()}},l(v,{isPrimary:!0,isBusy:n.isSavingMap,onClick:function(){return c("save")}},u("Save")),l(v,{disabled:n.isSavingMap,onClick:function(){return c("close")}},u("Cancel")),l(v,{disabled:!t.mapid||n.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:function(){return c("destroy")}},u("Delete")))}return f((function(){var e=function(e){s({mapdata:e.maps[t.mapid],isFetchingMap:e.isFetchingMap,isSavingMap:e.isSavingMap})};return p.store.subscribe(e),function(){return p.store.unsubscribe(e)}})),f((function(){t.mapid&&p.store.fetchMap({mapid:t.mapid})}),[]),f((function(){n.isFetchingMap||function(t){var e=new p.Map(t,{center:null,editable:!0,embed:!0,iwType:"ib",layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!0,sel:jQuery(a.current),zoom:null});new p.Editor(e);s({map:e})}(n.mapdata)}),[n.mapdata]),"library"==t.context?l(d,null,m(),l("div",{className:"mapp-edit",ref:a}),b()):l(g,{className:"mapp-edit-modal",focusOnMount:!0,isDismissible:!1,title:m(),shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!1,onRequestClose:function(){c("close")}},l("div",{className:"mapp-edit",ref:a,onKeyDown:function(t){return t.stopPropagation()},tabIndex:-1}),b())}},function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"default",(function(){return S}));var p=window.mapp||{},l=wp.element.createElement,c=wp.i18n,u=c.__,m=(c._x,c._n,c.sprintf,wp.data.select),d=wp.element,f=d.Fragment,h=d.useEffect,y=(d.useLayoutEffect,d.useRef),b=d.useState,v=wp.components,g=(v.BaseControl,v.Button),w=(v.Dashicon,v.Modal),O=(v.PanelBody,v.RadioControl),j=v.Spinner,k=v.TextControl;function S(t){var e=o(b({isFetchingItems:!0,items:null,search:"",type:"all"}),2),n=e[0],i=e[1],a=y(null),s=y(null);function c(t){i((function(e){return r(r({},e),t)}))}function d(t){if("post"==n.type&&t.postid!=mappl10n.options.postid)return!1;var e=n.search.toLowerCase();return!e||(t.mapid.indexOf(e)>=0||(!!(t.post_title&&t.post_title.toLowerCase().indexOf(e)>=0)||!!(t.map_title&&t.map_title.toLowerCase().indexOf(e)>=0)))}function v(e,n){switch(e){case"close":t.onAction("list-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(p.store.destroyMap({mapid:n}),n==t.mapid&&t.onAction("list-destroy",n)),a.current.focus();break;case"select":t.onAction("list-select",n)}}function S(){var e="library"==t.context?null:l(O,{className:"mapp-pick-type",options:[{label:u("All maps"),value:"all"},{label:u("Attached to this post"),value:"post"}],onChange:function(t){return c({type:t})},selected:n.type});return l("div",{className:"mapp-pick-filter"},l(k,{ref:a,className:"mapp-pick-search",tabIndex:1,label:u("Search"),placeholder:u("post title, map title, or map id"),onChange:function(t){return c({search:t})}}),n.isFetchingItems&&l(j,null),e)}function C(){var t=_.filter(n.items,d);return n.isFetchingItems?null:t.length?l("div",{className:"mapp-pick-items"},l("div",{className:"mapp-pick-header"},l("div",{className:"mapp-pick-col-map-title"},u("Map title")),l("div",{className:"mapp-pick-col-mapid"},u("Map ID")),l("div",{className:"mapp-pick-col-post-title"},u("Attached to")),l("div",{className:"mapp-pick-col-actions"},u("Action"))),_.map(t,P)):void l("div",{className:"mapp-pick-items"},l("div",{className:"mapp-pick-message"},u("No maps found")))}function P(e){var i,r,a,o=e.mapid==t.mapid;r=e.postid==mappl10n.options.postid?m("core/editor").getEditedPostAttribute("title"):e.post_title,i=e.map_title?e.map_title:u("Untitled"),r=r||u("Untitled"),e.postid>0&&e.postid==mappl10n.options.postid&&"all"==n.type&&(r+=" ("+u("current post")+")"),a=e.postid>0?e.postid==mappl10n.options.postid?r:l("a",{onClick:function(t){return t.stopPropagation()},href:mappl10n.options.editurl+"?post="+e.postid+"&action=edit",target:"_blank",title:u("Edit post")},r):u("Unattached");var p=l("div",{className:"mapp-pick-col-actions"},"library"==t.context&&l(g,{onClick:function(t){var n,i;t.stopPropagation(),n=e.mapid,i=jQuery("<input>"),jQuery("body").append(i),i.val('[mappress mapid="'+n+'"]').select(),document.execCommand("copy"),i.remove(),alert(u("Shortcode copied"))},title:u("Copy shortcode"),icon:"admin-page"}),l(g,{onClick:function(t){t.stopPropagation(),v("destroy",e.mapid)},title:u("Delete map"),icon:"trash"}));"library"==t.context&&e.mapid;return l("div",{className:"mapp-pick-item"+(o?" mapp-selected":""),ref:o?s:null,key:e.mapid+"|"+e.postid,onClick:function(){return v("select",e.mapid)}},l("div",{className:"mapp-pick-col-map-title"},i),l("div",{className:"mapp-pick-col-mapid"},e.mapid),l("div",{className:"mapp-pick-col-post-title"},a),p)}return h((function(){var t=function(t){c({isFetchingItems:t.isFetchingItems,items:t.items})};return p.store.subscribe(t),function(){return p.store.unsubscribe(t)}})),h((function(){a.current&&a.current.focus(),p.store.fetchItems({})}),[]),h((function(){n.items&&(t.scrollTop>=0?jQuery(".mapp-pick-items").scrollTop(t.scrollTop):s.current&&s.current.scrollIntoView(!0))}),[n.items]),"library"==t.context?l(f,null,S(),C()):l(w,{className:"mapp-pick-modal",title:u("Select a map"),onRequestClose:function(){return v("close")}},S(),C())}},function(t,e,n){"use strict";function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"MappSettings",(function(){return v}));window.mapp;var a=wp.element.createElement,o=wp.i18n,s=o.__,p=(o._x,o._n,o.sprintf,wp.element),l=p.Fragment,c=(p.useEffect,p.useLayoutEffect,p.useRef,p.useState),u=wp.components,m=u.BaseControl,d=u.Button,f=u.ButtonGroup,h=(u.Dashicon,u.Dropdown,u.ExternalLink,u.Panel,u.PanelBody,u.PanelRow),y=(u.RadioControl,u.SelectControl),b=u.TextControl;function v(t){var e,n=i(c({}),2);n[0],n[1];function r(t){if(!t||"string"!=typeof t)return t;var e={px:2048,vw:100,vh:100,"%":100},n=parseInt(t),i=2048,r="";for(var a in e)t.includes(a)&&(r=a,i=e[a]);return n>i?i+r:t}function o(e,n){var i=null;switch(e){case"poiList":t.map.set({poiList:n}),i={poiList:n};break;case"size":n.hasOwnProperty("height")&&(n.height=r(n.height)),n.hasOwnProperty("width")&&(n.width=r(n.width)),t.map.setSize(n),i=n;break;case"viewport-reset":t.map.center=t.map.zoom=null,t.map.recenter(),i={center:void 0,zoom:void 0};break;case"viewport-save":var a=t.map.getCenter().toJSON();i={center:a.lat+","+a.lng,zoom:t.map.getZoom()},wp.data.dispatch("core/notices").createNotice("success",s("Viewport saved"),{type:"snackbar",isDismissible:!0})}i&&t.onAction("change-settings",i)}return a("div",{className:"mapp-settings"},null,"mashup"!=t.context&&(e=t.map.title?t.map.title:s("Untitled"),a(h,null,a(m,{className:"mapp-settings-title"},e),a(m,{className:"mapp-settings-id",label:s("Map ID")},t.map.mapid))),function(){var e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=mappl10n.options.sizes.map((function(t,e){return{label:t.width+"x"+t.height,height:t.height,width:t.width,value:e+1}}));n.unshift({height:"",label:s("Default"),value:0,width:""}),n.push({label:s("Custom"),value:"custom",disabled:!0});for(var i="custom",r=0;r<n.length-1;r++)n[r].width==t.width&&n[r].height==t.height&&(i=r);return a(l,null,a(y,{className:"mapp-settings-dims-select",help:"",label:s("Size"),value:i,options:n,onChange:function(t){return o("size",{width:n[t].width,height:n[t].height})}}),a(h,null,a(b,{className:"mapp-settings-dims-custom",help:s("px, %, vw"),label:s("Width"),onChange:function(t){return o("size",{width:t})},placeholder:e.width,value:t.width}),a(b,{className:"mapp-settings-dims-custom",help:s("px, %, vh"),label:s("Height"),onChange:function(t){return o("size",{height:t})},placeholder:e.height,value:t.height})))}(),(t.center&&(t.center.lat,t.center.lng,s("Zoom"),t.zoom),a(h,null,a(m,{label:s("Center/Zoom")}),a(m,null,a(f,null,a(d,{onClick:function(){return o("viewport-reset")},isPressed:!t.center,isSmall:!0},s("Automatic")),a(d,{onClick:function(){return o("viewport-save")},isPressed:t.center,isSmall:!0},s("Save")))))))}},function(t,e,n){"use strict";function i(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||p(t)||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 r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||p(t,e)||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(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"MappMultiSelect",(function(){return O}));var c=wp.element.createElement,u=wp.i18n,m=u.__,d=(u._x,u._n,u.sprintf,wp.element),f=(d.Fragment,d.useEffect),h=(d.useLayoutEffect,d.useRef),y=d.useState,b=wp.components,v=b.BaseControl,g=(b.Button,b.CheckboxControl),w=(b.Panel,b.PanelBody,b.PanelRow,b.Spinner,b.TextControl);function O(t){var e,n=h(null),r=h(null),o=s(y({isOpen:!1,filter:"",filteredOptions:[]}),2),p=o[0],l=o[1];function u(t){l((function(e){return a(a({},e),t)}))}function d(e){var n=_.findWhere(t.options,{value:e});return n?n.label:e}function b(){var e;return t.values instanceof Array?e=i(t.values):t.values&&(e=[t.values]),e||[]}function O(e,n){var i=b(),r=i.indexOf(e);(n=void 0!==n?n:-1==r)?i.push(e):i.splice(r,1),t.onChange(i)}function j(){return p.isOpen?c("div",{className:"mapp-select-dropdown-wrapper"},c("div",{className:"mapp-select-dropdown"},!p.isOpen||!t.options||t.options.length<10?null:c("div",{className:"mapp-select-filter",ref:r},c(w,{autocomplete:"off",placeholder:m("Search"),value:p.filter,onChange:function(t){return u({filter:t})}})),c("div",{className:"mapp-select-dropdown-list"},(e=b(),0==p.filteredOptions.length?c("div",{className:"mapp-select-dropdown-item"},m("No results")):p.filteredOptions.map((function(t){return c(g,{className:"mapp-select-dropdown-item",checked:e.includes(t.value),onChange:function(e){return O(t.value,e)},label:t.label})})))))):null;var e}return f((function(){if(t.options)if(p.filter){var e=p.filter.toUpperCase();u({filteredOptions:t.options.filter((function(t){return 0==t.label.toUpperCase().indexOf(e)}))})}else u({filteredOptions:t.options})}),[t.options,p.filter]),f((function(){p.isOpen&&r.current&&(jQuery("input",jQuery(r.current)).focus(),u({filter:""}))}),[p.isOpen]),c(v,{className:"mapp-select",label:t.label},c("div",{ref:n,tabIndex:0,onBlur:function(t){return function(t){event.relatedTarget||document.activeElement,n.current.contains(t.relatedTarget)||u({isOpen:!1})}(t)}},((e=b())instanceof Array&&e.map((function(t){return d(t)})),void 0===t.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:!p.isOpen})}},c("div",{className:"mapp-select-tokens"},e.map((function(t){return c("span",{className:"mapp-select-token",onClick:function(e){e.stopPropagation(),O(t,!1)}},d(t))}))),c("span",{className:"dashicons "+(p.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))),j()))}},function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"MappOptions",(function(){return w}));var p=window.mapp||{},l=wp.element.createElement,c=wp.i18n,u=c.__,m=(c._x,c._n,c.sprintf,wp.element),d=(m.Fragment,m.useEffect,m.useLayoutEffect,m.useRef,m.useState),f=wp.components,h=f.BaseControl,y=f.Button,b=f.ButtonGroup,v=(f.Dashicon,f.Dropdown,f.ExternalLink,f.Panel,f.PanelBody,f.PanelRow),g=(f.RadioControl,f.SelectControl,f.TextControl);function w(t){var e=o(d({apiKey:mappl10n.options.apiKey,engine:mappl10n.options.engine}),2),n=e[0],i=e[1];function a(t){i((function(e){return r(r({},e),t)}))}function s(t,e){switch(t){case"apikey":a({apiKey:e});break;case"engine":a({engine:e});break;case"save":p.lib.ajax({type:"POST",data:{action:"mapp_options_save",apiKey:n.apiKey,engine:n.engine,nonce:mappl10n.options.nonce},callback:function(t){wp.data.dispatch("core/notices").createNotice("success",u("Options saved."),{type:"snackbar",isDismissible:!0,actions:[{url:window.location,label:"Refresh page"}]})}})}}return l("div",{className:"mapp-options"},null,l(v,null,l(h,{label:u("Mapping Engine")}),l(h,null,l(b,null,l(y,{onClick:function(){return s("engine","leaflet")},isPressed:"google"!=n.engine,isSmall:!0},u("Leaflet")),l(y,{onClick:function(){return s("engine","google")},isPressed:"google"==n.engine,isSmall:!0},u("Google"))))),"google"!=n.engine?null:l(g,{className:"mapp-settings-apikey",label:l("a",{href:"https://mappresspro.com/mappress-faq/#toc-google-maps-api-keys"},u("Google API key")),onChange:function(t){return s("apikey",t)},value:n.apiKey}),l(y,{onClick:function(){return s("save")},isPrimary:!0},u("Save options")))}},,,,,,,,,,,,,,,function(t,e,n){n(0),n(20),n(21),n(22),n(4),n(1),n(2),n(25),n(3),n(26),n(27),n(28)},function(t,e,n){"use strict";n.r(e);var i=n(1),r=n(0);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}window.mapp;var c=wp.element.createElement,u=wp.i18n,m=u.__,d=(u._x,u._n,u.sprintf,wp.element),f=(d.Fragment,d.render),h=d.useEffect,y=(d.useLayoutEffect,d.useRef,d.useState),b=wp.components.Button;document.getElementById("mapp-library")&&(mappl10n.options.postid=0,f(c((function(t){var e=p(y({mode:"list",mapid:null,scrollTop:null}),2),n=e[0],a=e[1];function s(t){a((function(e){return o(o({},e),t)}))}function l(t,e){switch(t){case"add-new":s({mode:"edit",mapid:null});break;case"edit-close":s({mode:"list"});break;case"edit-destroy":s({mode:"list",mapid:null});break;case"edit-save":s({mode:"list"});break;case"list-select":s({mode:"edit",mapid:e,scrollTop:jQuery(".mapp-pick-items").scrollTop()})}}return h((function(){}),[]),"list"==n.mode?c("div",{className:"wrap"},c("div",null,c("h1",null,m("Map Library")),c(b,{className:"button button-default",onClick:function(){return l("add-new")}},m("Add New"))),c("div",{className:"mapp-library-wrapper"},c(i.default,{context:"library",mapid:n.mapid,onAction:l,scrollTop:n.scrollTop}))):c("div",{className:"wrap"},c("div",{className:"mapp-library-wrapper"},c(r.default,{context:"library",mapid:n.mapid,onAction:l})))}),null),document.getElementById("mapp-library")))},function(t,e,n){"use strict";n.r(e);var i=n(2),r=n(4),a=n(1),o=n(0);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var m=window.mapp||{},d=wp.element.createElement,f=wp.i18n,h=f.__,y=(f._x,f._n,f.sprintf,wp.element),b=y.Fragment,v=y.useEffect,g=(y.useLayoutEffect,y.useRef),w=y.useState;function O(t){var e=wp.components,n=(e.BaseControl,e.Button),s=(e.ButtonGroup,e.CheckboxControl,e.Dropdown,e.Modal,e.Panel,e.PanelBody),l=(e.PanelRow,e.Placeholder),u=(e.RadioControl,e.SelectControl,e.TextControl,e.ToggleControl,e.Toolbar),f=e.ToolbarButton,y=(e.ToolbarGroup,wp.blockEditor),O=y.BlockControls,j=y.InspectorControls,k=c(w({editMapid:null,isListOpen:!1,isEditorOpen:!1,map:null,mapdata:null,scrollTop:null}),2),S=k[0],C=k[1],P=g(null);function _(t){C((function(e){return p(p({},e),t)}))}function M(e,n){switch(e){case"add":_({isEditorOpen:!0,editMapid:null});break;case"change-settings":t.setAttributes(n);break;case"edit":_({isEditorOpen:!0,editMapid:t.attributes.mapid});break;case"edit-close":_({isEditorOpen:!1,editMapid:null});break;case"edit-destroy":case"list-destroy":t.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),_({isEditorOpen:!1,isListOpen:!1});break;case"edit-save":_({isEditorOpen:!1,editMapid:null}),t.setAttributes({mapid:n});break;case"list-close":_({isListOpen:!1,scrollTop:jQuery(".mapp-pick-items").scrollTop()});break;case"list-select":n!=t.attributes.mapid&&t.setAttributes({center:void 0,mapid:n,zoom:void 0}),M("list-close");break;case"open-list":_({isListOpen:!0})}}function E(){var e=void 0!==e?e:u,n=mappl10n.options.block?null:d(f,{icon:"portfolio",label:h("Map Library"),onClick:function(){return M("open-list")}});return d(O,null,d(e,null,d(f,{icon:"insert",label:h("New map"),onClick:function(){return M("add")}}),t.attributes.mapid&&d(f,{icon:"edit",label:h("Edit map"),onClick:function(){return M("edit")}}),n))}function A(){if(S.isEditorOpen)return d(o.default,{mapid:S.editMapid,onAction:M})}function x(){if(S.isListOpen)return d(a.default,{mapid:t.attributes.mapid,onAction:M,scrollTop:S.scrollTop})}return v((function(){var e=function(e){var n=e.maps[t.attributes.mapid];n&&_({mapdata:n})};return m.store.subscribe(e),function(){return m.store.unsubscribe(e)}})),v((function(){t.attributes.mapid&&m.store.fetchMap({mapid:t.attributes.mapid,failure:function(){return _({mapdata:void 0})}})}),[t.attributes.mapid]),v((function(){var e;t.attributes.mapid&&P.current&&S.mapdata&&((e=new m.Map(S.mapdata,{center:t.attributes.center,height:t.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:t.attributes.poiList,sel:jQuery(P.current),width:t.attributes.width,zoom:t.attributes.zoom})).display(),_({map:e}))}),[S.mapdata]),t.attributes.preview?d("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):t.attributes.mapid&&void 0!==S.mapdata?d(b,null,E(),function(){if(!S.map)return null;var e,a;mappl10n.options.block&&(a=d("div",null,d("p",null,h("Like the block? Upgrade to the free plugin or MapPress Pro for more features!")),d("div",null,d(n,{isPrimary:!0,target:"_blank",href:"https://mappresspro.com"},h("MapPress Pro")),d(n,{isSecondary:!0,href:"https://wordpress.org/plugins/mappress-google-maps-for-wordpress"},h("Free plugin")))),e=d(s,{title:h("MapPress options"),initialOpen:!1},d(r.MappOptions,{onAction:M})));var o=t.attributes,p=o.center,l=o.height,c=o.poiList,u=o.width,m=o.zoom;return d(j,null,d("div",{className:"mapp-gt-inspector"},d(s,{title:h("Map settings")},d(i.MappSettings,{map:S.map,context:"map",onAction:M,center:p,height:l,poiList:c,width:u,zoom:m}),a),e))}(),d("div",{className:"mapp-gt",ref:P}),x(),A()):d(b,null,d(b,null,E(),d(l,{className:"mapp-gt-placeholder",icon:"location",label:h("MapPress Map"),instructions:h("Create a new map or choose one from the map library.")},d(n,{icon:"insert",isSecondary:!0,onClick:function(){return M("add")}},h("New map")),!mappl10n.options.block&&d(n,{icon:"portfolio",isSecondary:!0,onClick:function(){return M("open-list")}},h("Map Library")))),x(),A())}mappl10n.options.gt&&wp.blocks.registerBlockType("mappress/map",{title:"MapPress Map",icon:"location",description:h("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:["left","center","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:function(t){return t.named.center}},height:{type:"string",shortcode:function(t){return t.named.height}},initialOpenDirections:{type:"boolean",shortcode:function(t){return"true"==t.named.initialOpenDirections||"true"==t.named.initialopendirections}},mapid:{type:"string",shortcode:function(t){return t.named.mapid}},poiList:{type:"boolean",shortcode:function(t){return"true"==t.named.poiList||"true"==t.named.poilist}},width:{type:"string",shortcode:function(t){return t.named.width}},zoom:{type:"number",shortcode:function(t){return parseInt(t.named.zoom)?parseInt(t.named.zoom):null}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(t){var e=t.text,n=wp.shortcode.regexp("mappress");return n.lastIndex=0,n.test(e)},transform:function(t){var e=t.text;return wp.blocks.rawHandler({HTML:"<p>"+e+"</p>",mode:"BLOCKS"})}}]},edit:function(t){return d(O,t)},save:function(t){return t},example:{attributes:{preview:!0}}})},function(t,e,n){"use strict";n.r(e);n(2),n(3),n(23);window.mapp,wp.element.createElement;var i=wp.i18n,r=(i.__,i._x,i._n,i.sprintf,wp.element),a=(r.Fragment,r.useEffect,r.useLayoutEffect,r.useRef,r.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},function(t,e,n){"use strict";(function(e){t.exports=function(t,n){var i,r,a,o,s,p,l,c,u,m,d,f,h,y=String(t).replace(/^&/,"").replace(/&$/,"").split("&"),b=y.length,v=function(t){return decodeURIComponent(t.replace(/\+/g,"%20"))},g="undefined"!=typeof window?window:e;g.$locutus=g.$locutus||{};var w=g.$locutus;for(w.php=w.php||{},n||(n=g),i=0;i<b&&(u=v((c=y[i].split("="))[0]),m=c.length<2?"":v(c[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));i++){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,r=0;r<u.length;r++)if("["!==u.charAt(r)||d){if("]"===u.charAt(r)&&d&&(f.length||f.push(u.slice(0,d-1)),f.push(u.substr(d,r-d)),d=0,"["!==u.charAt(r+1)))break}else d=r+1;for(f.length||(f=[u]),r=0;r<f[0].length&&(" "!==(l=f[0].charAt(r))&&"."!==l&&"["!==l||(f[0]=f[0].substr(0,r)+"_"+f[0].substr(r+1)),"["!==l);r++);for(p=n,r=0,h=f.length;r<h;r++){if(s=p,(""===(u=f[r].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==r){for(o in a=-1,p)p.hasOwnProperty(o)&&+o>a&&o.match(/^\d+$/g)&&(a=+o);u=a+1}Object(p[u])!==p[u]&&(p[u]={}),p=p[u]}s[u]=m}}}}).call(this,n(24))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||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(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var s=window.mapp||{},p=wp.i18n,l=p.__;p._x,p._n,p.sprintf;s.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,maps:{},items:[]}},s.Store.prototype={createMap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.success,n=void 0===e?function(){}:e;this.state.isFetchingMap=!1,this.publish(),n()},destroyMap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mapid,n=t.success,i=void 0===n?function(){}:n,r=this;s.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:e,nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status?(delete r.state.maps[e],r.destroyItem(e),i(e)):failure(),r.publish()}})},fetchMap:function(t){var e=t.mapid,n=t.success,i=void 0===n?function(){}:n,r=t.failure,a=void 0===r?function(){}:r,o=this;if(void 0!==this.state.maps[e])return o.publish(),void i(this.state.maps[e]);this.state.isFetchingMap=!0,o.publish(),s.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:e,nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status?(o.state.maps[e]=t.data,i(t.data)):a(),o.state.isFetchingMap=!1,o.publish()}})},saveMap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mapdata,n=t.success,i=void 0===n?function(){}:n,r=t.failure,a=void 0===r?function(){}:r,o=this;this.state.isSavingMap=!0,this.publish(),s.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(e),nonce:mappl10n.options.nonce},callback:function(t){if(t&&"OK"==t.status){var e=t.data,n=e.mapid;o.state.maps[n]=e,o.saveItem(e),i(e)}else a();o.state.isSavingMap=!1,o.publish()}})},destroyItem:function(t){var e=this.state.items?this.state.items:[],n=_.findIndex(e,{mapid:t});n>-1&&e.splice(n,1),this.state.items=r(e),this.publish()},fetchItems:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.success,n=void 0===e?function(){}:e,i=t.failure,r=void 0===i?function(){}:i,a=this;if(this.state.itemsFetched)return n(this.state.items),void a.publish();this.state.isFetchingItems=!0,a.publish(),s.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status?(a.state.items=t.data,a.sortItems(),n(a.state.items),a.state.itemsFetched=!0):r(),a.state.isFetchingItems=!1,a.sortItems(),a.publish()}})},saveItem:function(t){var e=this.state.items?this.state.items:[],r=_.findWhere(e,{mapid:t.mapid});r?(r.map_title=t.title,r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r)):(r={mapid:t.mapid,map_title:t.title,postid:mappl10n.options.postid,post_title:null},e.unshift(r))},sortItems:function(){var t=l("Untitled");this.state.items=_.sortBy(this.state.items,(function(t){return parseInt(t.mapid)})),this.state.items=_.sortBy(this.state.items,(function(e){return e.map_title?e.map_title:t}))},subscribe:function(t){this.subs.add(t)},unsubscribe:function(t){this.subs.delete(t)},publish:function(){var t,e=function(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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 o,s=!0,p=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){p=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(p)throw o}}}}(r(this.subs));try{for(e.s();!(t=e.n()).done;){(0,t.value)(this.state)}}catch(t){e.e(t)}finally{e.f()}}},s.store=new s.Store},function(t,e,n){var i,r=window.mapp||{};i=jQuery,r.Editor=function(t){this.drawingManager=null,this.map=t,this.poiEditor=null;var e=this;this.initialize=function(){this.map.display(),this.poiEditor=new r.PoiEditor(this.map),this.initDrawingManager(),i(this.map.places).off("search.mapp"),i(this.map.places).on("search.mapp",(function(t,n){e.insert(n)}))},this.insert=function(t){if(t)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),t.geometry){var e=t.formatted_address?t.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,n=t.name==e?"":e,i=new r.Poi({address:e,body:n,iconid:this.poiEditor.lastIcon,point:t.geometry.location,title:t.name,viewport:t.geometry.viewport?t.geometry.viewport:null});this.map.poiInsert(i),i.center()}else t.overlay?(i=new r.Poi({body:"",iconid:"marker"==t.type?null:"poly",overlay:t.overlay,title:"marker"==t.type?t.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:"marker"==t.type?null:t.type}),this.map.poiInsert(i)):"string"==typeof t&&t.substring(0,4)},this.initDrawingManager=function(){},this.initialize.apply(this)},r.PoiEditor=function(t){this.map=t,this.poi=null,this.sel=null,this.lastIcon=null;var e=this;this.initialize=function(){this.sel=i(this.map.iw.getContent()),i(this.map).on("mapp.open",(function(t,n){e.render(n)})),i(this.map).on("mapp.close",(function(){e.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(t){t.preventDefault();var n=i(this).attr("data-mapp-poi");e[n]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(t){var n=i(this).hasClass("mapp-poi-visual");e.mce(n)})),this.sel.on("keydown",(function(t){13==t.which&&t.target!=i("#mapp-poi-body")&&(t.preventDefault(),e.save())})),this.sel.on("change","[data-mapp-iconpicker]",(function(){e.poi.set({dirty:!0,iconid:i("[data-mapp-iconpicker]").attr("data-mapp-iconid")}),e.lastIcon=e.poi.iconid,e.map.renderList()})),this.sel.on("change","[data-mapp-colorpicker]",(function(){e.poi.setTemplateColors(i("[data-mapp-colorpicker]").attr("data-mapp-color"),i("[data-mapp-colorpicker]").attr("data-mapp-opacity"),i("[data-mapp-colorpicker]").attr("data-mapp-weight")),e.map.renderList()}))},this.cancel=function(){this.map.poiClose()},this.initMCE=function(){if("undefined"!=typeof tinyMCE&&void 0!==tinyMCE.init){var t="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var e=window.tinyMCEPreInit.mceInit.content;t=void 0!==e.language?e.language:"en"}var n={mode:"none",height:"75px",convert_urls:!1,language:t,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(n),this.mce(!0)}},this.mce=function(t){var n=t?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(n,!1,"mapp-poi-body"),i(".mapp-poi-visual, .mapp-poi-html",e.sel).removeClass("mapp-active"),t?i(".mapp-poi-visual",e.sel).addClass("mapp-active"):i(".mapp-poi-html",e.sel).addClass("mapp-active")},this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.poiClose(),this.map.poiRemove(this.poi))},this.render=function(t){this.poi=t,i("[data-mapp-iconpicker]").trigger("refresh"),i("[data-mapp-colorpicker]").trigger("refresh"),this.initMCE()},this.save=function(){"undefined"!=typeof tinyMCE&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save(),this.poi.set({dirty:!0,title:i(".mapp-poi-title").val(),body:i(".mapp-poi-body").val()}),this.map.renderList(),this.map.poiClose()},this.initialize.apply(this)}},function(t,e){var n,i=window.mapp||{};n=jQuery,i.Media=function(){this.editor=null,this.map=null,this.settings={editable:!0,layout:"left",poiList:!0,sel:n(".mapp-edit")},this.sel=n(".mapp-mce"),this.items=null;var t=this;this.initialize=function(){this.sel.length&&(this.find(),this.sel.on("change",".mapp-mce-list-type",(function(){var e=n(".mapp-mce-list-type",this.sel).val();n(".mapp-mce-search").val(""),n(".mapp-mce-search").toggle("all"==e),t.find()})),this.sel.on("keydown",".mapp-mce-search",(function(t){if(13==t.which)return!1})),this.sel.on("input",".mapp-mce-search",(function(e){t.find()})),this.sel.on("click","[data-mapp-mce]",(function(e){e.preventDefault();var i=n(this).attr("data-mapp-mce");t[i]()})),this.sel.on("click",".mapp-mce-item",(function(){n(".mapp-mce-list .mapp-mce-item",this.sel).removeClass("mapp-active"),n(this).addClass("mapp-active")})),this.sel.on("click",".mapp-mce-list [data-mapp-mce-list]",(function(e){e.preventDefault();var i=n(this).attr("data-mapp-mce-list"),r=n(this).closest(".mapp-mce-item").attr("data-mapp-mapid");return t[i](r),!1})),this.sel.on("change",".mapp-mce-viewport",(function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())})),n(".mapp-mce-size").click((function(t){var e=n(this).data("width"),i=n(this).data("height");n(".mapp-mce-width").val(e),n(".mapp-mce-height").val(i),t.preventDefault()})),n("#publish, #post-preview").click((function(){t.save()})),n(".mapp-mce-title").keydown((function(e){13==e.which&&(e.preventDefault(),t.save())})))},this.add=function(){var e=new i.Map({},this.settings);e.width=mappl10n.options.sizes[mappl10n.options.size].width,e.height=mappl10n.options.sizes[mappl10n.options.size].height,t.open(e)},this.cancel=function(){t.closeEditor()},this.closeEditor=function(){this.map.poiClose(),this.map=null,this.editor=null,n(".mapp-mce-edit-panel").hide(),n(".mapp-mce-list-panel").show()},this.edit=function(e){i.Map.ajaxGet(e,(function(e){var n=new i.Map(e,t.settings);t.open(n)}))},this.find=function(){var t=this;null!==this.items?this.renderList():(n(".spinner",this.sel).css("visibility","visible"),i.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&(n(".spinner",this.sel).css("visibility","hidden"),t.items=_.sortBy(e.data,"post_title"),t.renderList())}}))},this.insert=function(t){var e='[mappress mapid="'+(t=t||this.map.mapid)+'"]';"undefined"==typeof wpActiveEditor?alert(mappl10n.need_classic):send_to_editor(e)},this.open=function(t){this.map=t,n(".mapp-edit",this.sel).html(i.lib.template("edit-map"));var e=this.map.mapid;e?n(".mapp-mce-mapid").text(e):n(".mapp-mce-mapid").text(""),n(".mapp-mce-title").val(this.map.title),n(".mapp-mce-width").val(this.map.width),n(".mapp-mce-height").val(this.map.height),n(".mapp-mce-viewport").prop("checked",!(!this.map.center||!this.map.zoom)),n(".mapp-mce-edit-panel").show(),n(".mapp-mce-list-panel").hide(),this.editor=new i.Editor(this.map)},this.remove=function(t){if(confirm(mappl10n.delete_map_prompt)){var e=_.findIndex(this.items,{mapid:t});e>-1&&(this.items.splice(e,1),i.Map.ajaxDelete(t),this.renderList())}},this.renderList=function(){var t=null,e=n(".mapp-mce-list-type",this.sel).val(),r=n(".mapp-mce-search",this.sel).val().toLowerCase();t="all"==e?_.filter(this.items,(function(t){return t.post_title&&-1!=t.post_title.toLowerCase().indexOf(r)||t.map_title&&-1!=t.map_title.toLowerCase().indexOf(r)})):_.filter(this.items,(function(t){return t.postid==mappl10n.options.postid})),n(".mapp-mce-list",this.sel).html(i.lib.template("mce-list",{items:t,type:e,limit:400}))},this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-mce-title").val()),this.map.width=n(".mapp-mce-width").val(),this.map.height=n(".mapp-mce-height").val(),n(".mapp-mce-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave((function(){var e=t.map.mapid?t.map.mapid.toString():null,i=_.findIndex(t.items,(function(t){return t.mapid==e}));-1==i?t.items.unshift({mapid:e,map_title:t.map.title,postid:mappl10n.options.postid,post_title:n("#title").val()||n("#post-title-0").val()}):t.items[i].map_title=t.map.title,t.renderList(),t.closeEditor()})))},this.initialize.apply(this)},i.media=new i.Media},function(t,e){var n;(n=jQuery)(document).ready((function(){n('input[name="mappress_options[engine]"]').on("change",(function(){n('input[name="save"]').click()})),n('input[name="mappress_options[geocoder]"]').on("change",(function(){n('input[name="save"]').click()})),n("[data-mapp-grid]").each((function(t,e){new mapp.widgets.Grid(e)})),n(document).on("focus",".mapp-expand",(function(){n(this).parent().width("100%"),n(this).attr("rows",20)})),n(document).on("blur",".mapp-expand",(function(){n(this).parent().width("auto"),n(this).attr("rows",1)})),n(".mapp-autoicons").on("change","#mapp-autoicons-key",(function(t){mapp.lib.ajax({data:{action:"mapp_autoicons_form",key:n(this).val()},callback:function(t){t&&t.status&&(n(".mapp-autoicons").html(t.data),new mapp.widgets.Grid(n("[data-mapp-grid]",".mapp-autoicons")))}})})),n("#mapp-filters tbody").sortable({handle:".mapp-handle"}),n(".mapp-confirm").on("change",(function(){var t=n(".mapp-confirm").is(":checked");n(".mapp-import").prop("disabled",!t)}))}))}]);
1
+ !function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=19)}([function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"default",(function(){return O}));var p=window.mapp||{},l=wp.element.createElement,c=wp.i18n,u=c.__,m=(c._x,c._n,c.sprintf,wp.element),d=m.Fragment,f=m.useEffect,h=(m.useLayoutEffect,m.useRef),y=m.useState,b=wp.components,v=b.Button,g=b.Modal,w=(b.Popover,b.Spinner,b.TextControl);function O(t){var e=o(y({isFetchingMap:!!t.mapid,isSavingMap:!1,map:null}),2),n=e[0],i=e[1],a=h(null);function s(t){i((function(e){return r(r({},e),t)}))}function c(e,i){switch(e){case"change-title":n.map.set({dirty:!0,title:i}),s({map:n.map});break;case"close":t.onAction("edit-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(p.store.destroyMap({mapid:t.mapid}),t.onAction("edit-destroy"));break;case"save":p.store.saveMap({mapdata:n.map.toJSON(),success:function(e){n.map.set({dirty:!1}),t.onAction("edit-save",e.mapid)}})}}function m(){if(n.map&&!n.isFetchingMap){var t=n.map.title?n.map.title:"";return l(w,{className:"mapp-edit-title",placeholder:u("Untitled"),value:t,onChange:function(t){return c("change-title",t)}})}}function b(){return l("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:function(t){return t.stopPropagation()}},l(v,{isPrimary:!0,isBusy:n.isSavingMap,onClick:function(){return c("save")}},u("Save")),l(v,{disabled:n.isSavingMap,onClick:function(){return c("close")}},u("Cancel")),l(v,{disabled:!t.mapid||n.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:function(){return c("destroy")}},u("Delete")))}return f((function(){var e=function(e){s({mapdata:e.maps[t.mapid],isFetchingMap:e.isFetchingMap,isSavingMap:e.isSavingMap})};return p.store.subscribe(e),function(){return p.store.unsubscribe(e)}})),f((function(){t.mapid&&p.store.fetchMap({mapid:t.mapid})}),[]),f((function(){n.isFetchingMap||function(t){var e=new p.Map(t,{center:null,editable:!0,embed:!0,iwType:"ib",layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!0,sel:jQuery(a.current),zoom:null});new p.Editor(e);s({map:e})}(n.mapdata)}),[n.mapdata]),"library"==t.context?l(d,null,m(),l("div",{className:"mapp-edit",ref:a}),b()):l(g,{className:"mapp-edit-modal",focusOnMount:!0,isDismissible:!1,title:m(),shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!1,onRequestClose:function(){c("close")}},l("div",{className:"mapp-edit",ref:a,onKeyDown:function(t){return t.stopPropagation()},tabIndex:-1}),b())}},function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"default",(function(){return S}));var p=window.mapp||{},l=wp.element.createElement,c=wp.i18n,u=c.__,m=(c._x,c._n,c.sprintf,wp.data.select),d=wp.element,f=d.Fragment,h=d.useEffect,y=(d.useLayoutEffect,d.useRef),b=d.useState,v=wp.components,g=(v.BaseControl,v.Button),w=(v.Dashicon,v.Modal),O=(v.PanelBody,v.RadioControl),j=v.Spinner,k=v.TextControl;function S(t){var e=o(b({isFetchingItems:!0,items:null,search:"",type:"all"}),2),n=e[0],i=e[1],a=y(null),s=y(null);function c(t){i((function(e){return r(r({},e),t)}))}function d(t){if("post"==n.type&&t.postid!=mappl10n.options.postid)return!1;var e=n.search.toLowerCase();return!e||(t.mapid.indexOf(e)>=0||(!!(t.post_title&&t.post_title.toLowerCase().indexOf(e)>=0)||!!(t.map_title&&t.map_title.toLowerCase().indexOf(e)>=0)))}function v(e,n){switch(e){case"close":t.onAction("list-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(p.store.destroyMap({mapid:n}),n==t.mapid&&t.onAction("list-destroy",n)),a.current.focus();break;case"select":t.onAction("list-select",n)}}function S(){var e="library"==t.context?null:l(O,{className:"mapp-pick-type",options:[{label:u("All maps"),value:"all"},{label:u("Attached to this post"),value:"post"}],onChange:function(t){return c({type:t})},selected:n.type});return l("div",{className:"mapp-pick-filter"},l(k,{ref:a,className:"mapp-pick-search",tabIndex:1,label:u("Search"),placeholder:u("post title, map title, or map id"),onChange:function(t){return c({search:t})}}),n.isFetchingItems&&l(j,null),e)}function C(){var t=_.filter(n.items,d);return n.isFetchingItems?null:t.length?l("div",{className:"mapp-pick-items"},l("div",{className:"mapp-pick-header"},l("div",{className:"mapp-pick-col-map-title"},u("Map title")),l("div",{className:"mapp-pick-col-mapid"},u("Map ID")),l("div",{className:"mapp-pick-col-post-title"},u("Attached to")),l("div",{className:"mapp-pick-col-actions"},u("Action"))),_.map(t,P)):void l("div",{className:"mapp-pick-items"},l("div",{className:"mapp-pick-message"},u("No maps found")))}function P(e){var i,r,a,o=e.mapid==t.mapid;r=e.postid==mappl10n.options.postid?m("core/editor").getEditedPostAttribute("title"):e.post_title,i=e.map_title?e.map_title:u("Untitled"),r=r||u("Untitled"),e.postid>0&&e.postid==mappl10n.options.postid&&"all"==n.type&&(r+=" ("+u("current post")+")"),a=e.postid>0?e.postid==mappl10n.options.postid?r:l("a",{onClick:function(t){return t.stopPropagation()},href:mappl10n.options.editurl+"?post="+e.postid+"&action=edit",target:"_blank",title:u("Edit post")},r):u("Unattached");var p=l("div",{className:"mapp-pick-col-actions"},"library"==t.context&&l(g,{onClick:function(t){var n,i;t.stopPropagation(),n=e.mapid,i=jQuery("<input>"),jQuery("body").append(i),i.val('[mappress mapid="'+n+'"]').select(),document.execCommand("copy"),i.remove(),alert(u("Shortcode copied"))},title:u("Copy shortcode"),icon:"admin-page"}),l(g,{onClick:function(t){t.stopPropagation(),v("destroy",e.mapid)},title:u("Delete map"),icon:"trash"}));"library"==t.context&&e.mapid;return l("div",{className:"mapp-pick-item"+(o?" mapp-selected":""),ref:o?s:null,key:e.mapid+"|"+e.postid,onClick:function(){return v("select",e.mapid)}},l("div",{className:"mapp-pick-col-map-title"},i),l("div",{className:"mapp-pick-col-mapid"},e.mapid),l("div",{className:"mapp-pick-col-post-title"},a),p)}return h((function(){var t=function(t){c({isFetchingItems:t.isFetchingItems,items:t.items})};return p.store.subscribe(t),function(){return p.store.unsubscribe(t)}})),h((function(){a.current&&a.current.focus(),p.store.fetchItems({})}),[]),h((function(){n.items&&(t.scrollTop>=0?jQuery(".mapp-pick-items").scrollTop(t.scrollTop):s.current&&s.current.scrollIntoView(!0))}),[n.items]),"library"==t.context?l(f,null,S(),C()):l(w,{className:"mapp-pick-modal",title:u("Select a map"),onRequestClose:function(){return v("close")}},S(),C())}},function(t,e,n){"use strict";function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"MappSettings",(function(){return v}));window.mapp;var a=wp.element.createElement,o=wp.i18n,s=o.__,p=(o._x,o._n,o.sprintf,wp.element),l=p.Fragment,c=(p.useEffect,p.useLayoutEffect,p.useRef,p.useState),u=wp.components,m=u.BaseControl,d=u.Button,f=u.ButtonGroup,h=(u.Dashicon,u.Dropdown,u.ExternalLink,u.Panel,u.PanelBody,u.PanelRow),y=(u.RadioControl,u.SelectControl),b=u.TextControl;function v(t){var e,n=i(c({}),2);n[0],n[1];function r(t){if(!t||"string"!=typeof t)return t;var e={px:2048,vw:100,vh:100,"%":100},n=parseInt(t),i=2048,r="";for(var a in e)t.includes(a)&&(r=a,i=e[a]);return n>i?i+r:t}function o(e,n){var i=null;switch(e){case"poiList":t.map.set({poiList:n}),i={poiList:n};break;case"size":n.hasOwnProperty("height")&&(n.height=r(n.height)),n.hasOwnProperty("width")&&(n.width=r(n.width)),t.map.setSize(n),i=n;break;case"viewport-reset":t.map.center=t.map.zoom=null,t.map.recenter(),i={center:void 0,zoom:void 0};break;case"viewport-save":var a=t.map.getCenter().toJSON();i={center:a.lat+","+a.lng,zoom:t.map.getZoom()},wp.data.dispatch("core/notices").createNotice("success",s("Viewport saved"),{type:"snackbar",isDismissible:!0})}i&&t.onAction("change-settings",i)}return a("div",{className:"mapp-settings"},null,"mashup"!=t.context&&(e=t.map.title?t.map.title:s("Untitled"),a(h,null,a(m,{className:"mapp-settings-title"},e),a(m,{className:"mapp-settings-id",label:s("Map ID")},t.map.mapid))),function(){var e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=mappl10n.options.sizes.map((function(t,e){return{label:t.width+"x"+t.height,height:t.height,width:t.width,value:e+1}}));n.unshift({height:"",label:s("Default"),value:0,width:""}),n.push({label:s("Custom"),value:"custom",disabled:!0});for(var i="custom",r=0;r<n.length-1;r++)n[r].width==t.width&&n[r].height==t.height&&(i=r);return a(l,null,a(y,{className:"mapp-settings-dims-select",help:"",label:s("Size"),value:i,options:n,onChange:function(t){return o("size",{width:n[t].width,height:n[t].height})}}),a(h,null,a(b,{className:"mapp-settings-dims-custom",help:s("px, %, vw"),label:s("Width"),onChange:function(t){return o("size",{width:t})},placeholder:e.width,value:t.width}),a(b,{className:"mapp-settings-dims-custom",help:s("px, %, vh"),label:s("Height"),onChange:function(t){return o("size",{height:t})},placeholder:e.height,value:t.height})))}(),(t.center&&(t.center.lat,t.center.lng,s("Zoom"),t.zoom),a(h,null,a(m,{label:s("Center/Zoom")}),a(m,null,a(f,null,a(d,{onClick:function(){return o("viewport-reset")},isPressed:!t.center,isSmall:!0},s("Automatic")),a(d,{onClick:function(){return o("viewport-save")},isPressed:t.center,isSmall:!0},s("Save")))))))}},function(t,e,n){"use strict";function i(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||p(t)||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 r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||p(t,e)||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(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"MappMultiSelect",(function(){return O}));var c=wp.element.createElement,u=wp.i18n,m=u.__,d=(u._x,u._n,u.sprintf,wp.element),f=(d.Fragment,d.useEffect),h=(d.useLayoutEffect,d.useRef),y=d.useState,b=wp.components,v=b.BaseControl,g=(b.Button,b.CheckboxControl),w=(b.Panel,b.PanelBody,b.PanelRow,b.Spinner,b.TextControl);function O(t){var e,n=h(null),r=h(null),o=s(y({isOpen:!1,filter:"",filteredOptions:[]}),2),p=o[0],l=o[1];function u(t){l((function(e){return a(a({},e),t)}))}function d(e){var n=_.findWhere(t.options,{value:e});return n?n.label:e}function b(){var e;return t.values instanceof Array?e=i(t.values):t.values&&(e=[t.values]),e||[]}function O(e,n){var i=b(),r=i.indexOf(e);(n=void 0!==n?n:-1==r)?i.push(e):i.splice(r,1),t.onChange(i)}function j(){return p.isOpen?c("div",{className:"mapp-select-dropdown-wrapper"},c("div",{className:"mapp-select-dropdown"},!p.isOpen||!t.options||t.options.length<10?null:c("div",{className:"mapp-select-filter",ref:r},c(w,{autocomplete:"off",placeholder:m("Search"),value:p.filter,onChange:function(t){return u({filter:t})}})),c("div",{className:"mapp-select-dropdown-list"},(e=b(),0==p.filteredOptions.length?c("div",{className:"mapp-select-dropdown-item"},m("No results")):p.filteredOptions.map((function(t){return c(g,{className:"mapp-select-dropdown-item",checked:e.includes(t.value),onChange:function(e){return O(t.value,e)},label:t.label})})))))):null;var e}return f((function(){if(t.options)if(p.filter){var e=p.filter.toUpperCase();u({filteredOptions:t.options.filter((function(t){return 0==t.label.toUpperCase().indexOf(e)}))})}else u({filteredOptions:t.options})}),[t.options,p.filter]),f((function(){p.isOpen&&r.current&&(jQuery("input",jQuery(r.current)).focus(),u({filter:""}))}),[p.isOpen]),c(v,{className:"mapp-select",label:t.label},c("div",{ref:n,tabIndex:0,onBlur:function(t){return function(t){event.relatedTarget||document.activeElement,n.current.contains(t.relatedTarget)||u({isOpen:!1})}(t)}},((e=b())instanceof Array&&e.map((function(t){return d(t)})),void 0===t.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:!p.isOpen})}},c("div",{className:"mapp-select-tokens"},e.map((function(t){return c("span",{className:"mapp-select-token",onClick:function(e){e.stopPropagation(),O(t,!1)}},d(t))}))),c("span",{className:"dashicons "+(p.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))),j()))}},function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,"MappOptions",(function(){return w}));var p=window.mapp||{},l=wp.element.createElement,c=wp.i18n,u=c.__,m=(c._x,c._n,c.sprintf,wp.element),d=(m.Fragment,m.useEffect,m.useLayoutEffect,m.useRef,m.useState),f=wp.components,h=f.BaseControl,y=f.Button,b=f.ButtonGroup,v=(f.Dashicon,f.Dropdown,f.ExternalLink,f.Panel,f.PanelBody,f.PanelRow),g=(f.RadioControl,f.SelectControl,f.TextControl);function w(t){var e=o(d({apiKey:mappl10n.options.apiKey,engine:mappl10n.options.engine}),2),n=e[0],i=e[1];function a(t){i((function(e){return r(r({},e),t)}))}function s(t,e){switch(t){case"apikey":a({apiKey:e});break;case"engine":a({engine:e});break;case"save":p.lib.ajax({type:"POST",data:{action:"mapp_options_save",apiKey:n.apiKey,engine:n.engine,nonce:mappl10n.options.nonce},callback:function(t){wp.data.dispatch("core/notices").createNotice("success",u("Options saved."),{type:"snackbar",isDismissible:!0,actions:[{url:window.location,label:"Refresh page"}]})}})}}return l("div",{className:"mapp-options"},null,l(v,null,l(h,{label:u("Mapping Engine")}),l(h,null,l(b,null,l(y,{onClick:function(){return s("engine","leaflet")},isPressed:"google"!=n.engine,isSmall:!0},u("Leaflet")),l(y,{onClick:function(){return s("engine","google")},isPressed:"google"==n.engine,isSmall:!0},u("Google"))))),"google"!=n.engine?null:l(g,{className:"mapp-settings-apikey",label:l("a",{href:"https://mappresspro.com/mappress-faq/#toc-google-maps-api-keys"},u("Google API key")),onChange:function(t){return s("apikey",t)},value:n.apiKey}),l(y,{onClick:function(){return s("save")},isPrimary:!0},u("Save options")))}},,,,,,,,,,,,,,,function(t,e,n){n(0),n(20),n(21),n(22),n(4),n(1),n(2),n(25),n(3),n(26),n(27),n(28)},function(t,e,n){"use strict";n.r(e);var i=n(1),r=n(0);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}window.mapp;var c=wp.element.createElement,u=wp.i18n,m=u.__,d=(u._x,u._n,u.sprintf,wp.element),f=(d.Fragment,d.render),h=d.useEffect,y=(d.useLayoutEffect,d.useRef,d.useState),b=wp.components.Button;document.getElementById("mapp-library")&&(mappl10n.options.postid=0,f(c((function(t){var e=p(y({mode:"list",mapid:null,scrollTop:null}),2),n=e[0],a=e[1];function s(t){a((function(e){return o(o({},e),t)}))}function l(t,e){switch(t){case"add-new":s({mode:"edit",mapid:null});break;case"edit-close":s({mode:"list"});break;case"edit-destroy":s({mode:"list",mapid:null});break;case"edit-save":s({mode:"list"});break;case"list-select":s({mode:"edit",mapid:e,scrollTop:jQuery(".mapp-pick-items").scrollTop()})}}return h((function(){}),[]),"list"==n.mode?c("div",{className:"wrap"},c("div",null,c("h1",null,m("Map Library")),c(b,{className:"button button-default",onClick:function(){return l("add-new")}},m("Add New"))),c("div",{className:"mapp-library-wrapper"},c(i.default,{context:"library",mapid:n.mapid,onAction:l,scrollTop:n.scrollTop}))):c("div",{className:"wrap"},c("div",{className:"mapp-library-wrapper"},c(r.default,{context:"library",mapid:n.mapid,onAction:l})))}),null),document.getElementById("mapp-library")))},function(t,e,n){"use strict";n.r(e);var i=n(2),r=n(4),a=n(1),o=n(0);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t,e)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var m=window.mapp||{},d=wp.element.createElement,f=wp.i18n,h=f.__,y=(f._x,f._n,f.sprintf,wp.element),b=y.Fragment,v=y.useEffect,g=(y.useLayoutEffect,y.useRef),w=y.useState;function O(t){var e=wp.components,n=(e.BaseControl,e.Button),s=(e.ButtonGroup,e.CheckboxControl,e.Dropdown,e.Modal,e.Panel,e.PanelBody),l=(e.PanelRow,e.Placeholder),u=(e.RadioControl,e.SelectControl,e.TextControl,e.ToggleControl,e.Toolbar),f=e.ToolbarButton,y=(e.ToolbarGroup,wp.blockEditor),O=y.BlockControls,j=y.InspectorControls,k=c(w({editMapid:null,isListOpen:!1,isEditorOpen:!1,map:null,mapdata:null,scrollTop:null}),2),S=k[0],C=k[1],P=g(null);function _(t){C((function(e){return p(p({},e),t)}))}function M(e,n){switch(e){case"add":_({isEditorOpen:!0,editMapid:null});break;case"change-settings":t.setAttributes(n);break;case"edit":_({isEditorOpen:!0,editMapid:t.attributes.mapid});break;case"edit-close":_({isEditorOpen:!1,editMapid:null});break;case"edit-destroy":case"list-destroy":t.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),_({isEditorOpen:!1,isListOpen:!1});break;case"edit-save":_({isEditorOpen:!1,editMapid:null}),t.setAttributes({mapid:n});break;case"list-close":_({isListOpen:!1,scrollTop:jQuery(".mapp-pick-items").scrollTop()});break;case"list-select":n!=t.attributes.mapid&&t.setAttributes({center:void 0,mapid:n,zoom:void 0}),M("list-close");break;case"open-list":_({isListOpen:!0})}}function E(){var e=void 0!==e?e:u,n=mappl10n.options.block?null:d(f,{icon:"portfolio",label:h("Map Library"),onClick:function(){return M("open-list")}});return d(O,null,d(e,null,d(f,{icon:"insert",label:h("New map"),onClick:function(){return M("add")}}),t.attributes.mapid&&d(f,{icon:"edit",label:h("Edit map"),onClick:function(){return M("edit")}}),n))}function A(){if(S.isEditorOpen)return d(o.default,{mapid:S.editMapid,onAction:M})}function x(){if(S.isListOpen)return d(a.default,{mapid:t.attributes.mapid,onAction:M,scrollTop:S.scrollTop})}return v((function(){var e=function(e){var n=e.maps[t.attributes.mapid];n&&_({mapdata:n})};return m.store.subscribe(e),function(){return m.store.unsubscribe(e)}})),v((function(){t.attributes.mapid&&m.store.fetchMap({mapid:t.attributes.mapid,failure:function(){return _({mapdata:void 0})}})}),[t.attributes.mapid]),v((function(){var e;t.attributes.mapid&&P.current&&S.mapdata&&((e=new m.Map(S.mapdata,{center:t.attributes.center,height:t.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:t.attributes.poiList,sel:jQuery(P.current),width:t.attributes.width,zoom:t.attributes.zoom})).display(),_({map:e}))}),[S.mapdata]),t.attributes.preview?d("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):t.attributes.mapid&&void 0!==S.mapdata?d(b,null,E(),function(){if(!S.map)return null;var e,a;mappl10n.options.block&&(a=d("div",null,d("p",null,h("Like the block? Upgrade to the free plugin or MapPress Pro for more features!")),d("div",null,d(n,{isPrimary:!0,target:"_blank",href:"https://mappresspro.com"},h("MapPress Pro")),d(n,{isSecondary:!0,href:"https://wordpress.org/plugins/mappress-google-maps-for-wordpress"},h("Free plugin")))),e=d(s,{title:h("MapPress options"),initialOpen:!1},d(r.MappOptions,{onAction:M})));var o=t.attributes,p=o.center,l=o.height,c=o.poiList,u=o.width,m=o.zoom;return d(j,null,d("div",{className:"mapp-gt-inspector"},d(s,{title:h("Map settings")},d(i.MappSettings,{map:S.map,context:"map",onAction:M,center:p,height:l,poiList:c,width:u,zoom:m}),a),e))}(),d("div",{className:"mapp-gt",ref:P}),x(),A()):d(b,null,d(b,null,E(),d(l,{className:"mapp-gt-placeholder",icon:"location",label:h("MapPress Map"),instructions:h("Create a new map or choose one from the map library.")},d(n,{icon:"insert",isSecondary:!0,onClick:function(){return M("add")}},h("New map")),!mappl10n.options.block&&d(n,{icon:"portfolio",isSecondary:!0,onClick:function(){return M("open-list")}},h("Map Library")))),x(),A())}wp.blocks.registerBlockType("mappress/map",{title:"MapPress Map",icon:"location",description:h("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:["left","center","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:function(t){return t.named.center}},height:{type:"string",shortcode:function(t){return t.named.height}},initialOpenDirections:{type:"boolean",shortcode:function(t){return"true"==t.named.initialOpenDirections||"true"==t.named.initialopendirections}},mapid:{type:"string",shortcode:function(t){return t.named.mapid}},poiList:{type:"boolean",shortcode:function(t){return"true"==t.named.poiList||"true"==t.named.poilist}},width:{type:"string",shortcode:function(t){return t.named.width}},zoom:{type:"number",shortcode:function(t){return parseInt(t.named.zoom)?parseInt(t.named.zoom):null}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(t){var e=t.text,n=wp.shortcode.regexp("mappress");return n.lastIndex=0,n.test(e)},transform:function(t){var e=t.text;return wp.blocks.rawHandler({HTML:"<p>"+e+"</p>",mode:"BLOCKS"})}}]},edit:function(t){return d(O,t)},save:function(t){return t},example:{attributes:{preview:!0}}})},function(t,e,n){"use strict";n.r(e);n(2),n(3),n(23);window.mapp,wp.element.createElement;var i=wp.i18n,r=(i.__,i._x,i._n,i.sprintf,wp.element),a=(r.Fragment,r.useEffect,r.useLayoutEffect,r.useRef,r.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},function(t,e,n){"use strict";(function(e){t.exports=function(t,n){var i,r,a,o,s,p,l,c,u,m,d,f,h,y=String(t).replace(/^&/,"").replace(/&$/,"").split("&"),b=y.length,v=function(t){return decodeURIComponent(t.replace(/\+/g,"%20"))},g="undefined"!=typeof window?window:e;g.$locutus=g.$locutus||{};var w=g.$locutus;for(w.php=w.php||{},n||(n=g),i=0;i<b&&(u=v((c=y[i].split("="))[0]),m=c.length<2?"":v(c[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));i++){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,r=0;r<u.length;r++)if("["!==u.charAt(r)||d){if("]"===u.charAt(r)&&d&&(f.length||f.push(u.slice(0,d-1)),f.push(u.substr(d,r-d)),d=0,"["!==u.charAt(r+1)))break}else d=r+1;for(f.length||(f=[u]),r=0;r<f[0].length&&(" "!==(l=f[0].charAt(r))&&"."!==l&&"["!==l||(f[0]=f[0].substr(0,r)+"_"+f[0].substr(r+1)),"["!==l);r++);for(p=n,r=0,h=f.length;r<h;r++){if(s=p,(""===(u=f[r].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==r){for(o in a=-1,p)p.hasOwnProperty(o)&&+o>a&&o.match(/^\d+$/g)&&(a=+o);u=a+1}Object(p[u])!==p[u]&&(p[u]={}),p=p[u]}s[u]=m}}}}).call(this,n(24))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||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(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var s=window.mapp||{},p=wp.i18n,l=p.__;p._x,p._n,p.sprintf;s.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,maps:{},items:[]}},s.Store.prototype={createMap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.success,n=void 0===e?function(){}:e;this.state.isFetchingMap=!1,this.publish(),n()},destroyMap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mapid,n=t.success,i=void 0===n?function(){}:n,r=this;s.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:e,nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status?(delete r.state.maps[e],r.destroyItem(e),i(e)):failure(),r.publish()}})},fetchMap:function(t){var e=t.mapid,n=t.success,i=void 0===n?function(){}:n,r=t.failure,a=void 0===r?function(){}:r,o=this;if(void 0!==this.state.maps[e])return o.publish(),void i(this.state.maps[e]);this.state.isFetchingMap=!0,o.publish(),s.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:e,nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status?(o.state.maps[e]=t.data,i(t.data)):a(),o.state.isFetchingMap=!1,o.publish()}})},saveMap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mapdata,n=t.success,i=void 0===n?function(){}:n,r=t.failure,a=void 0===r?function(){}:r,o=this;this.state.isSavingMap=!0,this.publish(),s.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(e),nonce:mappl10n.options.nonce},callback:function(t){if(t&&"OK"==t.status){var e=t.data,n=e.mapid;o.state.maps[n]=e,o.saveItem(e),i(e)}else a();o.state.isSavingMap=!1,o.publish()}})},destroyItem:function(t){var e=this.state.items?this.state.items:[],n=_.findIndex(e,{mapid:t});n>-1&&e.splice(n,1),this.state.items=r(e),this.publish()},fetchItems:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.success,n=void 0===e?function(){}:e,i=t.failure,r=void 0===i?function(){}:i,a=this;if(this.state.itemsFetched)return n(this.state.items),void a.publish();this.state.isFetchingItems=!0,a.publish(),s.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(t){t&&"OK"==t.status?(a.state.items=t.data,a.sortItems(),n(a.state.items),a.state.itemsFetched=!0):r(),a.state.isFetchingItems=!1,a.sortItems(),a.publish()}})},saveItem:function(t){var e=this.state.items?this.state.items:[],r=_.findWhere(e,{mapid:t.mapid});r?(r.map_title=t.title,r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r)):(r={mapid:t.mapid,map_title:t.title,postid:mappl10n.options.postid,post_title:null},e.unshift(r))},sortItems:function(){var t=l("Untitled");this.state.items=_.sortBy(this.state.items,(function(t){return parseInt(t.mapid)})),this.state.items=_.sortBy(this.state.items,(function(e){return e.map_title?e.map_title:t}))},subscribe:function(t){this.subs.add(t)},unsubscribe:function(t){this.subs.delete(t)},publish:function(){var t,e=function(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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 o,s=!0,p=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){p=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(p)throw o}}}}(r(this.subs));try{for(e.s();!(t=e.n()).done;){(0,t.value)(this.state)}}catch(t){e.e(t)}finally{e.f()}}},s.store=new s.Store},function(t,e,n){var i,r=window.mapp||{};i=jQuery,r.Editor=function(t){this.drawingManager=null,this.map=t,this.poiEditor=null;var e=this;this.initialize=function(){this.map.display(),this.poiEditor=new r.PoiEditor(this.map),this.initDrawingManager(),i(this.map.places).off("search.mapp"),i(this.map.places).on("search.mapp",(function(t,n){e.insert(n)}))},this.insert=function(t){if(t)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),t.geometry){var e=t.formatted_address?t.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,n=t.name==e?"":e,i=new r.Poi({address:e,body:n,iconid:this.poiEditor.lastIcon,point:t.geometry.location,title:t.name,viewport:t.geometry.viewport?t.geometry.viewport:null});this.map.poiInsert(i),i.center()}else t.overlay?(i=new r.Poi({body:"",iconid:"marker"==t.type?null:"poly",overlay:t.overlay,title:"marker"==t.type?t.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:"marker"==t.type?null:t.type}),this.map.poiInsert(i)):"string"==typeof t&&t.substring(0,4)},this.initDrawingManager=function(){},this.initialize.apply(this)},r.PoiEditor=function(t){this.map=t,this.poi=null,this.sel=null,this.lastIcon=null;var e=this;this.initialize=function(){this.sel=i(this.map.iw.getContent()),i(this.map).on("mapp.open",(function(t,n){e.render(n)})),i(this.map).on("mapp.close",(function(){e.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(t){t.preventDefault();var n=i(this).attr("data-mapp-poi");e[n]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(t){var n=i(this).hasClass("mapp-poi-visual");e.mce(n)})),this.sel.on("keydown",(function(t){13==t.which&&t.target!=i("#mapp-poi-body")&&(t.preventDefault(),e.save())})),this.sel.on("change","[data-mapp-iconpicker]",(function(){e.poi.set({dirty:!0,iconid:i("[data-mapp-iconpicker]").attr("data-mapp-iconid")}),e.lastIcon=e.poi.iconid,e.map.renderList()})),this.sel.on("change","[data-mapp-colorpicker]",(function(){e.poi.setTemplateColors(i("[data-mapp-colorpicker]").attr("data-mapp-color"),i("[data-mapp-colorpicker]").attr("data-mapp-opacity"),i("[data-mapp-colorpicker]").attr("data-mapp-weight")),e.map.renderList()}))},this.cancel=function(){this.map.poiClose()},this.initMCE=function(){if("undefined"!=typeof tinyMCE&&void 0!==tinyMCE.init){var t="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var e=window.tinyMCEPreInit.mceInit.content;t=void 0!==e.language?e.language:"en"}var n={mode:"none",height:"75px",convert_urls:!1,language:t,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(n),this.mce(!0)}},this.mce=function(t){var n=t?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(n,!1,"mapp-poi-body"),i(".mapp-poi-visual, .mapp-poi-html",e.sel).removeClass("mapp-active"),t?i(".mapp-poi-visual",e.sel).addClass("mapp-active"):i(".mapp-poi-html",e.sel).addClass("mapp-active")},this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.poiClose(),this.map.poiRemove(this.poi))},this.render=function(t){this.poi=t,i("[data-mapp-iconpicker]").trigger("refresh"),i("[data-mapp-colorpicker]").trigger("refresh"),this.initMCE()},this.save=function(){"undefined"!=typeof tinyMCE&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save(),this.poi.set({dirty:!0,title:i(".mapp-poi-title").val(),body:i(".mapp-poi-body").val()}),this.map.renderList(),this.map.poiClose()},this.initialize.apply(this)}},function(t,e){var n,i=window.mapp||{};n=jQuery,i.Media=function(){this.editor=null,this.map=null,this.settings={editable:!0,layout:"left",poiList:!0,sel:n(".mapp-edit")},this.sel=n(".mapp-mce"),this.items=null;var t=this;this.initialize=function(){this.sel.length&&(this.find(),this.sel.on("change",".mapp-mce-list-type",(function(){var e=n(".mapp-mce-list-type",this.sel).val();n(".mapp-mce-search").val(""),n(".mapp-mce-search").toggle("all"==e),t.find()})),this.sel.on("keydown",".mapp-mce-search",(function(t){if(13==t.which)return!1})),this.sel.on("input",".mapp-mce-search",(function(e){t.find()})),this.sel.on("click","[data-mapp-mce]",(function(e){e.preventDefault();var i=n(this).attr("data-mapp-mce");t[i]()})),this.sel.on("click",".mapp-mce-item",(function(){n(".mapp-mce-list .mapp-mce-item",this.sel).removeClass("mapp-active"),n(this).addClass("mapp-active")})),this.sel.on("click",".mapp-mce-list [data-mapp-mce-list]",(function(e){e.preventDefault();var i=n(this).attr("data-mapp-mce-list"),r=n(this).closest(".mapp-mce-item").attr("data-mapp-mapid");return t[i](r),!1})),this.sel.on("change",".mapp-mce-viewport",(function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())})),n(".mapp-mce-size").click((function(t){var e=n(this).data("width"),i=n(this).data("height");n(".mapp-mce-width").val(e),n(".mapp-mce-height").val(i),t.preventDefault()})),n("#publish, #post-preview").click((function(){t.save()})),n(".mapp-mce-title").keydown((function(e){13==e.which&&(e.preventDefault(),t.save())})))},this.add=function(){var e=new i.Map({},this.settings);e.width=mappl10n.options.sizes[mappl10n.options.size].width,e.height=mappl10n.options.sizes[mappl10n.options.size].height,t.open(e)},this.cancel=function(){t.closeEditor()},this.closeEditor=function(){this.map.poiClose(),this.map=null,this.editor=null,n(".mapp-mce-edit-panel").hide(),n(".mapp-mce-list-panel").show()},this.edit=function(e){i.Map.ajaxGet(e,(function(e){var n=new i.Map(e,t.settings);t.open(n)}))},this.find=function(){var t=this;null!==this.items?this.renderList():(n(".spinner",this.sel).css("visibility","visible"),i.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&(n(".spinner",this.sel).css("visibility","hidden"),t.items=_.sortBy(e.data,"post_title"),t.renderList())}}))},this.insert=function(t){var e='[mappress mapid="'+(t=t||this.map.mapid)+'"]';"undefined"==typeof wpActiveEditor?alert(mappl10n.need_classic):send_to_editor(e)},this.open=function(t){this.map=t,n(".mapp-edit",this.sel).html(i.lib.template("edit-map"));var e=this.map.mapid;e?n(".mapp-mce-mapid").text(e):n(".mapp-mce-mapid").text(""),n(".mapp-mce-title").val(this.map.title),n(".mapp-mce-width").val(this.map.width),n(".mapp-mce-height").val(this.map.height),n(".mapp-mce-viewport").prop("checked",!(!this.map.center||!this.map.zoom)),n(".mapp-mce-edit-panel").show(),n(".mapp-mce-list-panel").hide(),this.editor=new i.Editor(this.map)},this.remove=function(t){if(confirm(mappl10n.delete_map_prompt)){var e=_.findIndex(this.items,{mapid:t});e>-1&&(this.items.splice(e,1),i.Map.ajaxDelete(t),this.renderList())}},this.renderList=function(){var t=null,e=n(".mapp-mce-list-type",this.sel).val(),r=n(".mapp-mce-search",this.sel).val().toLowerCase();t="all"==e?_.filter(this.items,(function(t){return t.post_title&&-1!=t.post_title.toLowerCase().indexOf(r)||t.map_title&&-1!=t.map_title.toLowerCase().indexOf(r)})):_.filter(this.items,(function(t){return t.postid==mappl10n.options.postid})),n(".mapp-mce-list",this.sel).html(i.lib.template("mce-list",{items:t,type:e,limit:400}))},this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-mce-title").val()),this.map.width=n(".mapp-mce-width").val(),this.map.height=n(".mapp-mce-height").val(),n(".mapp-mce-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave((function(){var e=t.map.mapid?t.map.mapid.toString():null,i=_.findIndex(t.items,(function(t){return t.mapid==e}));-1==i?t.items.unshift({mapid:e,map_title:t.map.title,postid:mappl10n.options.postid,post_title:n("#title").val()||n("#post-title-0").val()}):t.items[i].map_title=t.map.title,t.renderList(),t.closeEditor()})))},this.initialize.apply(this)},i.media=new i.Media},function(t,e){var n;(n=jQuery)(document).ready((function(){n('input[name="mappress_options[engine]"]').on("change",(function(){n('input[name="save"]').click()})),n('input[name="mappress_options[geocoder]"]').on("change",(function(){n('input[name="save"]').click()})),n("[data-mapp-grid]").each((function(t,e){new mapp.widgets.Grid(e)})),n(document).on("focus",".mapp-expand",(function(){n(this).parent().width("100%"),n(this).attr("rows",20)})),n(document).on("blur",".mapp-expand",(function(){n(this).parent().width("auto"),n(this).attr("rows",1)})),n(".mapp-autoicons").on("change","#mapp-autoicons-key",(function(t){mapp.lib.ajax({data:{action:"mapp_autoicons_form",key:n(this).val()},callback:function(t){t&&t.status&&(n(".mapp-autoicons").html(t.data),new mapp.widgets.Grid(n("[data-mapp-grid]",".mapp-autoicons")))}})})),n("#mapp-filters tbody").sortable({handle:".mapp-handle"}),n(".mapp-confirm").on("change",(function(){var t=n(".mapp-confirm").is(":checked");n(".mapp-import").prop("disabled",!t)}))}))}]);
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.56.4\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: 2020-11-09T16:30:37+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,15 +34,15 @@ msgid "https://www.mappresspro.com/chris-contact"
34
  msgstr ""
35
 
36
  #: mappress.php:158
37
- #: mappress.php:630
38
  #: src/mappress_gt_mashup.js:152
39
  msgid "Settings"
40
  msgstr ""
41
 
42
  #: mappress.php:159
43
  #: src/mappress_gt_library.js:65
44
- #: src/mappress_gt_map.js:186
45
- #: src/mappress_gt_map.js:277
46
  msgid "Map Library"
47
  msgstr ""
48
 
@@ -63,7 +63,7 @@ msgid "MapPress Settings"
63
  msgstr ""
64
 
65
  #: mappress.php:344
66
- #: mappress.php:860
67
  msgid "Version"
68
  msgstr ""
69
 
@@ -129,32 +129,32 @@ msgstr ""
129
  msgid "Shape"
130
  msgstr ""
131
 
132
- #: mappress.php:502
133
  msgid "Improve this map"
134
  msgstr ""
135
 
136
- #: mappress.php:518
137
- #: mappress.php:537
138
  msgid "Streets"
139
  msgstr ""
140
 
141
- #: mappress.php:519
142
  msgid "Outdoors"
143
  msgstr ""
144
 
145
- #: mappress.php:520
146
  msgid "Light"
147
  msgstr ""
148
 
149
- #: mappress.php:521
150
  msgid "Dark"
151
  msgstr ""
152
 
153
- #: mappress.php:522
154
  msgid "Satellite"
155
  msgstr ""
156
 
157
- #: mappress.php:523
158
  msgid "Satellite Streets"
159
  msgstr ""
160
 
@@ -1098,44 +1098,44 @@ msgstr ""
1098
  msgid "Add New"
1099
  msgstr ""
1100
 
1101
- #: src/mappress_gt_map.js:16
1102
  msgid "Insert a map"
1103
  msgstr ""
1104
 
1105
- #: src/mappress_gt_map.js:190
1106
- #: src/mappress_gt_map.js:276
1107
  msgid "New map"
1108
  msgstr ""
1109
 
1110
- #: src/mappress_gt_map.js:191
1111
  msgid "Edit map"
1112
  msgstr ""
1113
 
1114
- #: src/mappress_gt_map.js:212
1115
  msgid "Like the block? Upgrade to the free plugin or MapPress Pro for more features!"
1116
  msgstr ""
1117
 
1118
- #: src/mappress_gt_map.js:214
1119
  msgid "MapPress Pro"
1120
  msgstr ""
1121
 
1122
- #: src/mappress_gt_map.js:215
1123
  msgid "Free plugin"
1124
  msgstr ""
1125
 
1126
- #: src/mappress_gt_map.js:218
1127
  msgid "MapPress options"
1128
  msgstr ""
1129
 
1130
- #: src/mappress_gt_map.js:228
1131
  msgid "Map settings"
1132
  msgstr ""
1133
 
1134
- #: src/mappress_gt_map.js:275
1135
  msgid "MapPress Map"
1136
  msgstr ""
1137
 
1138
- #: src/mappress_gt_map.js:275
1139
  msgid "Create a new map or choose one from the map library."
1140
  msgstr ""
1141
 
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.56.6\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-11-10T16:34:13+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:158
37
+ #: mappress.php:629
38
  #: src/mappress_gt_mashup.js:152
39
  msgid "Settings"
40
  msgstr ""
41
 
42
  #: mappress.php:159
43
  #: src/mappress_gt_library.js:65
44
+ #: src/mappress_gt_map.js:184
45
+ #: src/mappress_gt_map.js:275
46
  msgid "Map Library"
47
  msgstr ""
48
 
63
  msgstr ""
64
 
65
  #: mappress.php:344
66
+ #: mappress.php:859
67
  msgid "Version"
68
  msgstr ""
69
 
129
  msgid "Shape"
130
  msgstr ""
131
 
132
+ #: mappress.php:501
133
  msgid "Improve this map"
134
  msgstr ""
135
 
136
+ #: mappress.php:517
137
+ #: mappress.php:536
138
  msgid "Streets"
139
  msgstr ""
140
 
141
+ #: mappress.php:518
142
  msgid "Outdoors"
143
  msgstr ""
144
 
145
+ #: mappress.php:519
146
  msgid "Light"
147
  msgstr ""
148
 
149
+ #: mappress.php:520
150
  msgid "Dark"
151
  msgstr ""
152
 
153
+ #: mappress.php:521
154
  msgid "Satellite"
155
  msgstr ""
156
 
157
+ #: mappress.php:522
158
  msgid "Satellite Streets"
159
  msgstr ""
160
 
1098
  msgid "Add New"
1099
  msgstr ""
1100
 
1101
+ #: src/mappress_gt_map.js:15
1102
  msgid "Insert a map"
1103
  msgstr ""
1104
 
1105
+ #: src/mappress_gt_map.js:188
1106
+ #: src/mappress_gt_map.js:274
1107
  msgid "New map"
1108
  msgstr ""
1109
 
1110
+ #: src/mappress_gt_map.js:189
1111
  msgid "Edit map"
1112
  msgstr ""
1113
 
1114
+ #: src/mappress_gt_map.js:210
1115
  msgid "Like the block? Upgrade to the free plugin or MapPress Pro for more features!"
1116
  msgstr ""
1117
 
1118
+ #: src/mappress_gt_map.js:212
1119
  msgid "MapPress Pro"
1120
  msgstr ""
1121
 
1122
+ #: src/mappress_gt_map.js:213
1123
  msgid "Free plugin"
1124
  msgstr ""
1125
 
1126
+ #: src/mappress_gt_map.js:216
1127
  msgid "MapPress options"
1128
  msgstr ""
1129
 
1130
+ #: src/mappress_gt_map.js:226
1131
  msgid "Map settings"
1132
  msgstr ""
1133
 
1134
+ #: src/mappress_gt_map.js:273
1135
  msgid "MapPress Map"
1136
  msgstr ""
1137
 
1138
+ #: src/mappress_gt_map.js:273
1139
  msgid "Create a new map or choose one from the map library."
1140
  msgstr ""
1141
 
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.56.4
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/)
@@ -36,7 +36,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
36
  }
37
 
38
  class Mappress {
39
- const VERSION = '2.56.3';
40
 
41
  static
42
  $baseurl,
@@ -481,7 +481,6 @@ class Mappress {
481
  'debug' => self::$debug,
482
  'editurl' => admin_url('post.php'),
483
  'iconsUrl' => (self::$pro) ? Mappress_Icons::$icons_url : null,
484
- 'gt' => self::is_gt($post),
485
  'language' => self::get_language(),
486
  'mapbox' => self::get_api_keys()->mapbox,
487
  'nonce' => wp_create_nonce('mappress'),
@@ -548,7 +547,7 @@ class Mappress {
548
  }
549
 
550
  // Global settings
551
- $options = array('alignment', 'clustering', 'country', 'defaultIcon', 'directions', 'directionsServer', 'engine', 'filter', 'geocoder', 'gt', 'iconScale', 'initialOpenInfo', 'iwType', 'layout', 'mashupClick', 'mini', 'poiList', 'poiZoom', 'radius', 'search', 'size', 'sizes', 'style');
552
  foreach($options as $option) {
553
  if (isset(self::$options->$option)) {
554
  $l10n['options'][$option] = 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.56.6
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/)
36
  }
37
 
38
  class Mappress {
39
+ const VERSION = '2.56.6';
40
 
41
  static
42
  $baseurl,
481
  'debug' => self::$debug,
482
  'editurl' => admin_url('post.php'),
483
  'iconsUrl' => (self::$pro) ? Mappress_Icons::$icons_url : null,
 
484
  'language' => self::get_language(),
485
  'mapbox' => self::get_api_keys()->mapbox,
486
  'nonce' => wp_create_nonce('mappress'),
547
  }
548
 
549
  // Global settings
550
+ $options = array('alignment', 'clustering', 'country', 'defaultIcon', 'directions', 'directionsServer', 'engine', 'filter', 'geocoder', 'iconScale', 'initialOpenInfo', 'iwType', 'layout', 'mashupClick', 'mini', 'poiList', 'poiZoom', 'radius', 'search', 'size', 'sizes', 'style');
551
  foreach($options as $option) {
552
  if (isset(self::$options->$option)) {
553
  $l10n['options'][$option] = self::$options->$option;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: google, leaflet, openstreetmap, osm, mapbox, map, maps, mapping, mapper, gps, geocoder, geocoding, georss, mashup, wpml, multisite
5
  Requires at least: 5.3
6
  Tested up to: 5.6
7
- Stable tag: 2.56.3
8
 
9
  == Description ==
10
  MapPress adds beautiful interfactive Google and Leaflet maps to WordPress.
@@ -73,6 +73,15 @@ Please see the plugin documentation pages:
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
 
 
 
 
76
  = 2.56.3 =
77
  * Fixed: directions form not working
78
  * Fixed: fatal error for missing icon upload
4
  Tags: google, leaflet, openstreetmap, osm, mapbox, map, maps, mapping, mapper, gps, geocoder, geocoding, georss, mashup, wpml, multisite
5
  Requires at least: 5.3
6
  Tested up to: 5.6
7
+ Stable tag: 2.56.6
8
 
9
  == Description ==
10
  MapPress adds beautiful interfactive Google and Leaflet maps to WordPress.
73
 
74
  == Changelog ==
75
 
76
+ = 2.56.6 =
77
+ * Fixed: typo in initial open directions
78
+
79
+ = 2.56.5 =
80
+ * Fixed: fixed version incompatibility in plugin header
81
+
82
+ = 2.56.4 =
83
+ * Changed: enabled Gutenberg blocks for blogs that did not use beta versions
84
+
85
  = 2.56.3 =
86
  * Fixed: directions form not working
87
  * Fixed: fatal error for missing icon upload