MapPress Easy Google Maps - Version 2.83.17

Version Description

  • Fixed: mini map class not being applied to small maps
  • Fixed: other plugins break iframes by adding 'defer' to script tags
Download this release

Release Info

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

Code changes from version 2.83.13 to 2.83.17

build/index_mappress.js CHANGED
@@ -1 +1 @@
1
- (()=>{var t={117:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappAutocomplete:()=>m});var o=n(326);const a=wp.element.createElement,{Fragment:i,useCallback:l,useEffect:s,useLayoutEffect:p,useMemo:r,useRef:c,useState:u}=wp.element;function m(e){e={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...e};const t=c(null),n=c(null),[i,l]=u({isOpen:!1,value:""});function p(e){l((t=>({...t,...e})))}(0,o.useClickOutside)(t,(()=>{i.isOpen&&p({isOpen:!1})})),s((()=>{e.focus&&n.current&&n.current.focus()}),[]),s((()=>{i.map&&setMapTypeId(e.mapTypeId)}),[e.mapTypeId,i.map]);const r=(0,o.useDebounce)((t=>{e.onFetch&&e.onFetch(t)}),e.delay);function m(){let t;p({isOpen:!1}),e.suggestions&&(t=null==i.selected?e.suggestions[0]:e.suggestions[i.selected]),e.onSelect({suggestion:t,value:g})}const g=i.selected>=0&&e.suggestions&&e.suggestions[i.selected]?e.suggestions[i.selected].value:i.value;return a("div",{className:"mapp-autocomplete",ref:t},a("div",{className:"mapp-autocomplete-wrapper"},a("input",{className:e.className,onChange:e=>{!function(e){p({value:e,selected:null}),r(e)}(e.target.value)},onKeyDownCapture:t=>function(t){switch(t.stopPropagation(),t.code){case"Backspace":p({isOpen:i.value.length>1});break;case"Enter":m();break;case"Escape":p({isOpen:!1});break;case"ArrowUp":if(t.preventDefault(),e.suggestions&&0!=i.selected){const t=null==i.selected?e.suggestions.length-1:i.selected-1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"ArrowDown":if(e.suggestions&&i.selected<e.suggestions.length-1){const t=null==i.selected?0:i.selected+1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:p({isOpen:!0})}}(t),placeholder:e.placeholder,ref:n,title:e.title,type:"text",value:g}),i.isOpen&&function(){if(e.suggestions&&e.suggestions.length)return a("div",{className:"mapp-autocomplete-list"},_.map(e.suggestions,((t,n)=>{const o="mapp-autocomplete-item"+(i.selected==n?" mapp-selected":"");return a("div",{className:o,key:n,onClick:()=>function(t,n){p({isOpen:!1,selected:n}),e.onSelect({suggestion:t})}(t,n)},t.value)})))}()),e.buttonLabel&&a("div",{className:"mapp-submit-button",onClick:()=>m()},e.buttonLabel))}},715:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappDirections:()=>r});const o=wp.element.createElement,{Fragment:a,useEffect:i,useLayoutEffect:l,useRef:s,useState:p}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(e){e={from:null,onClose:null,to:null,...e};const[t,n]=p({from:e.from?e.from:"",to:e.to?e.to:""});function a(e){n((t=>({...t,...e})))}function l(){e.onClose&&e.onClose()}function s(){const e=t.from.trim(),n=t.to.trim();let o=mappl10n.options.directionsServer;o="https://maps.google.com"==o?"https://www.google.com":o,-1==o.toLowerCase().indexOf("http")&&(o="https://"+o),o+="/maps/dir/?api=1&origin="+encodeURIComponent(e)+"&destination="+encodeURIComponent(n),window.open(o),l()}function r(e){13==e?s():27==e&&l()}return i((()=>{"google"==mappl10n.options.directions&&s()}),[]),"google"==mappl10n.options.directions?null:o("div",{className:"mapp-directions"},o("div",{className:"mapp-close",onClick:()=>l()}),o("div",null,o("input",{className:"mapp-dir-from",onChange:e=>a({from:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"1",placeholder:__("My location"),value:t.from}),o("div",{className:"mapp-dir-arrows",onClick:()=>{a({from:t.to,to:t.from})}})),o("div",null,o("input",{className:"mapp-dir-to",onChange:e=>a({to:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"2",value:t.to})),o("div",{className:"mapp-dir-toolbar"},o("div",{className:"mapp-submit-button",onClick:()=>s()},__("Get Directions"))))}},817:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappFilters:()=>u});var o=n(939),a=n(326);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:p,useRef:r,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf,u=e=>{e={onChange:null,otype:"post",poiCount:0,...e};const t=(0,a.useDebounce)(e.onChange,500),[n,p]=c({filters:[],isBusy:!0,open:null,selected:{}});function u(e){p((t=>({...t,...e})))}const m=r({});function g(e,o){let a=n.selected[e.key]?n.selected[e.key].values:null;if("checkbox"==e.format){var i;const e=null===(i=a)||void 0===i?void 0:i.indexOf(o);e>-1?a.splice(e,1):(a=a||[],a.push(o))}else a=o?[o]:[];a.length?n.selected[e.key]={key:e.key,values:a,meta_key:e.meta_key,meta_values:e.meta_values}:delete n.selected[e.key],u({selected:n.selected}),t(n.selected)}function d(e){u({open:n.open==e?null:e})}function f(e){e.key;const t=[...e.values],a=n.selected[e.key]?n.selected[e.key].values:"";switch(e.format){case"input":return i("input",{type:"text",value:a?a[0]:"",onChange:t=>g(e,t.target.value)});case"checkbox":return _.map(t,(t=>i("label",{key:t.value},i("input",{checked:null==a?void 0:a.includes(t.value),key:t.value,onChange:t=>g(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"radio":return"radio"==e.format&&t.unshift({value:"",label:__("All")}),_.map(t,(t=>i("label",{key:t.value},i("input",{checked:a==t.value||""==t.value&&!a,key:t.value,onChange:t=>g(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"select":t.unshift({value:"",label:""});const n=_.map(t,(e=>'<option value="'+e.value+'">'+e.label+"</option>"));return i("select",{value:a[0],dangerouslySetInnerHTML:{__html:n},onChange:t=>g(e,t.target.value)})}}function v(o){return i("div",{className:"mapp-filter-dropdown"},function(e){return i("div",{className:"mapp-filter-values"},"all"==e?n.filters.map((e=>i(l,{key:e.key},i("div",{className:"mapp-filter-label"},e.label),f(e)))):f(e))}(o),"all"==o&&function(n){const o="all"==n?"all":n.key;let a=e.poiCount>1?__("%d Results"):__("%d Result");return a=sprintf(a,e.poiCount),i("div",{className:"mapp-filter-toolbar"},i("div",{className:"mapp-link-button",onClick:()=>(u({selected:{}}),void t())},__("Reset")),i("div",{className:"mapp-filter-count"},a),i("div",{className:"mapp-submit-button",onClick:()=>d(o)},__("Done")))}(o))}function h(e){const t="all"==e?"all":e.key,o="all"==e?__("Filter"):e.label,a="mapp-filter mapp-filter-"+t+(n.open==t?" mapp-filter-open":"");return i("div",{key:t,className:a,ref:e=>m.current[t]=e},i("div",{className:"mapp-button mapp-button-caret mapp-filter-button"+(n.isBusy?" mapp-button-disabled":""),onClick:()=>d(t)},o),v(e))}return(0,a.useClickOutside)({current:n.open&&m.current[n.open]?m.current[n.open]:null},(()=>{u({open:null})})),s((()=>{u({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_filters_get",nonce:mappl10n.options.nonce,otype:e.otype},callback:e=>{e&&"OK"==e.status?u({filters:e.data}):console.error("MapPress: unable to fetch filter data"),u({isBusy:!1})}})}),[]),i("div",{className:"mapp-filters"},h("all"),_.map(n.filters,(e=>e.isStandalone?h(e):null)))}},10:(e,t,n)=>{"use strict";n.r(t),n.d(t,{useGeocoding:()=>u});const o=n(939).mappLib.toJSON,{Fragment:a,useCallback:i,useEffect:l,useLayoutEffect:s,useRef:p,useState:r}=(wp.element.createElement,wp.element),c={google:function(){this.token=null;const e=document.createElement("div");this.placesService=new google.maps.places.PlacesService(e),this.autocompleteService=new google.maps.places.AutocompleteService}};c.google.prototype={getDetails:function(e){let{suggestion:t,callback:n}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var a={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(a,(function(e,t){if("OK"==t&&e&&e.geometry){if(e.geometry.location&&(e.geometry.location=o(e.geometry.location)),e.geometry.viewport){var a=o(e.geometry.viewport);e.geometry.viewport={sw:{lat:a.south,lng:a.west},ne:{lat:a.north,lng:a.east}}}n(e)}else n(null)}))},getFirstPrediction:function(e){let{map:t,value:n,callback:o}=e;this.getPredictions({map:t,value:n,callback:e=>{e&&Array.isArray(e)?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:n,includeBusinesses:o,callback:a}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=t?t.getBounds():null;"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 l={input:n,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:o?null:["geocode"]};this.autocompleteService.getPlacePredictions(l,(function(e,t){"OK"==t&&e&&e.length?(e=(e=e.map((e=>(e.value=e.description,e)))).filter((e=>e.place_id)),a(e)):(t==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):t==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),a(null))}))}},c.mapbox=function(){},c.mapbox.prototype={getDetails:function(e){let{suggestion:t,callback:n}=e,o=t.place_name,a=o.indexOf(","),i=o.indexOf(",",a+1);a>0&&(o=parseInt(o.substr(0,a))?o.substr(0,i).replace(",",""):o.substr(0,a));let l=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;n({formatted_address:t.place_name,name:o,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:n,callback:o}=e;this.getPredictions({map:t,value:n,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:n,callback:o}=e;var a="https://api.mapbox.com/geocoding/v5/mapbox.places/"+n+".json?access_token="+mappl10n.options.mapbox;a=mappl10n.options.country?a+"&country="+mappl10n.options.country.toLowerCase():a,a=mappl10n.options.language?a+"&language="+mappl10n.options.language.toLowerCase():a;var i=t?t.getCenter():null;i&&(a+="&proximity="+i.lng+","+i.lat),mappl10n.options.searchBox&&(a+="&bbox="+mappl10n.options.searchBox),fetch(a).then((e=>e.json())).then((e=>{e&&e.features&&e.features.length>0?(e.features=e.features.map((e=>(e.value=e.label=e.place_name,e))),o(e.features)):o(null)}))}},c.nominatim=function(){},c.nominatim.prototype={getDetails:function(e){let{suggestion:t,callback:n}=e,o=t.display_name,a=o.indexOf(","),i=o.indexOf(",",a+1);a>0&&(o=parseInt(o.substr(0,a))?o.substr(0,i).replace(",",""):o.substr(0,a));let l=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;n({formatted_address:t.display_name,name:o,geometry:{location:{lat:t.lat,lng:t.lon},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:n,callback:o}=e;this.getPredictions({map:t,value:n,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:n,callback:o}=e;var a="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(n);if(a=mappl10n.options.country?a+"&countrycodes="+mappl10n.options.country.toLowerCase():a,a=mappl10n.options.language?a+"&accept-language="+mappl10n.options.language.toLowerCase():a,mappl10n.options.searchBox)a+="&viewbox="+mappl10n.options.searchBox,a+="&bounded=1";else{var i=t?t.getBounds():null;if(i){let e=i.getSouthWest(),t=i.getNorthEast();a+="&viewbox="+e.lng+","+e.lat+","+t.lng+","+t.lat}}fetch(a).then((e=>e.json())).then((e=>{e&&e.length?(e=e.map((e=>(e.value=e.display_name,e))),o(e)):o(null)}))}};const u=e=>{let{includeBusinesses:t}=e;function n(){let e="";return e="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new c[e]}function o(e,t){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){var n={lat:t.coords.latitude,lng:t.coords.longitude};e({name:n.lat+", "+n.lng,geometry:{location:n}})}),(function(n){if(!t){var o=n&&n.message?" : "+n.message:"";alert(mappl10n.no_geolocate+o)}e(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(e){let{map:a,suggestion:i,value:l,callback:s}=e;const p=n();l="string"==typeof l?l.trim():l,i||l?function(e){let{map:t,value:n,callback:a}=e;if(!n)return void a(null);if("string"!=typeof n){const e=n.lat&&n.lng?{geometry:{location:{lat:n.lat,lng:n.lng}}}:null;return void a(e)}if("http"==n.substring(0,4))return void a(n);if("user"==n)return void o((function(e){a(e)}));const i=n.split(",");if(2==i.length){const e=parseFloat(i[0]),t=parseFloat(i[1]);if(!isNaN(e)&&!isNaN(t))return void a({name:e+", "+t,geometry:{location:{lat:e,lng:t}}})}a(null)}({map:a,value:l,callback:e=>{e?s(e):i?p.getDetails({suggestion:i,callback:s}):p.getFirstPrediction({map:a,value:l,includeBusinesses:t,callback:s})}}):s(null)},geolocate:o,getPredictions:function(e){let{map:t,value:o,callback:a}=e;n().getPredictions({map:t,value:o,callback:a})}}}},326:(e,t,n)=>{"use strict";n.r(t),n.d(t,{useClickOutside:()=>c,useDebounce:()=>u,useResizeObserver:()=>m,useIntersectionObserver:()=>g,useTimeout:()=>d});wp.element.createElement;const{Fragment:o,useCallback:a,useEffect:i,useLayoutEffect:l,useMemo:s,useRef:p,useState:r}=wp.element;function c(e,t){i((()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}))}function u(e,t,n){const o=p(!1);i((()=>(o.current=!0,()=>o.current=!1)),[]);const l=_.debounce((function(){o.current&&e(...arguments)}),t);return a(l,n=n||[])}function m(e,t){const n=p();n.current=t,i((()=>{if(!e)return;const t=new ResizeObserver(((e,t)=>{n.current()}));return t.observe(e),()=>{t.disconnect()}}),[e])}function g(e){let{container:t,element:n,options:o,callback:a}=e;const l=p(null),s=p(null);s.current=a,i((()=>(!l.current&&n&&t&&(l.current=new IntersectionObserver((e=>{e[0].isIntersecting&&s.current()}),{...o,root:t}),l.current.observe(n)),()=>{l.current&&(l.current.disconnect(),l.current=null)})),[t,n])}function d(e,t){const n=React.useRef(null),o=React.useRef(e);return i((()=>{o.current=e}),[e]),i((()=>(t>0&&(n.current=window.setTimeout((()=>o.current()),t)),()=>{n.current&&window.clearTimeout(n.current)})),[t]),n}},939:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mappLib:()=>o,mappEvent:()=>a,mappPoi:()=>i});const o={ajax:function(e){if("POST"==(e={cache:"no-cache",credentials:"same-origin",data:null,method:e.method?e.method:"GET",mode:"cors",redirect:"follow",referrerPolicy:"no-referrer",responseType:"json",url:e.url?e.url:mappl10n.options.ajaxurl,...e}).method)if(e.data instanceof FormData)e.body=e.data;else{const t=new FormData;t.append("action",e.data.action),t.append("nonce",e.data.nonce),t.append("data",JSON.stringify(e.data)),e.body=t}else"GET"==e.method&&(e.url+="?"+o.jQueryParam(e.data));fetch(e.url,e).then((t=>{if("html"==e.responseType)return t.text();if(t.ok)return t.json();throw Error(`Request rejected with status ${t.status}`)})).then((t=>{e.url!=mappl10n.options.ajaxurl||t&&"OK"==t.status||o.alert(t.status),t.output&&o.alert("MapPress: invalid output from a plugin or theme file. Deactivate plugins to find the problem. Output:\r\n"+t.output),e.callback&&e.callback(t)})).catch((t=>{if(e.error)return void e.error();const n=void 0!==t.message?t.message:t.statusText;o.alert("AJAX error -- "+n)}))},alert:function(e){mappl10n.options.admin||mappl10n.options.debug?alert(e):window.console&&console.error(e)},boundsToViewport:function(e){return e?{sw:o.toJSON(e.getSouthWest()),ne:o.toJSON(e.getNorthEast())}:null},getIcon:function(e){{const t=this.getIconUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:t,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:t}}},getIconUrl:function(e){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"},jQueryParam:function(e){var t=[],n=function(e,n){n=null==(n="function"==typeof n?n():n)?"":n,t[t.length]=encodeURIComponent(e)+"="+encodeURIComponent(n)},o=function(e,a){var i,l,s;if(e)if(Array.isArray(a))for(i=0,l=a.length;i<l;i++)o(e+"["+("object"==typeof a[i]&&a[i]?i:"")+"]",a[i]);else if("[object Object]"===Object.prototype.toString.call(a))for(s in a)o(e+"["+s+"]",a[s]);else n(e,a);else if(Array.isArray(a))for(i=0,l=a.length;i<l;i++)n(a[i].name,a[i].value);else for(s in a)o(s,a[s]);return t};return o("",e).join("&")},nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;const t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let n="",o=e;for(;o--;)n+=t[64*Math.random()|0];return n},pointToLatLng:function(e){return e?"leaflet"==mappl10n.options.engine?L.latLng(e):new google.maps.LatLng(e.lat,e.lng):null},template:function(e,t){if(o.templates=o.templates?o.templates:{},!o.templates[e]){var n=document.getElementById("mapp-tmpl-"+e).innerHTML;if(!n)return"";o.templates[e]=_.template(n,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return o.templates[e](t)},toJSON:e=>e.toJSON?e.toJSON():"undefined"!=typeof L&&e instanceof L.LatLng?{lat:e.lat,lng:e.lng}:"undefined"!=typeof L&&L.LatLngBounds&&e instanceof L.LatLngBounds?{south:e.getSouth(),west:e.getWest(),north:e.getNorth(),east:e.getEast()}:null,toUrlValue(e){return e.toUrlValue?e.toUrlValue():"undefined"!=typeof L&&e instanceof L.LatLng?Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6:null},viewportToBounds:function(e){return e&&e.sw&&e.ne?"leaflet"==mappl10n.options.engine?new L.LatLngBounds(L.latLng(e.sw.lat,e.sw.lng),L.latLng(e.ne.lat,e.ne.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(e.sw.lat,e.sw.lng),new google.maps.LatLng(e.ne.lat,e.ne.lng)):null}},a={addListener:function(e,t,n){let o=[];t=t.split(" ");for(var a=0;a<t.length;a++)"leaflet"==mappl10n.options.engine?(e.on(t[a],n),o.push({target:e,event:t[a],callback:n})):o.push(google.maps.event.addListener(e,t[a],n));return o},addListenerOnce:function(e,t,n){t=t.split(" ");for(var o=0;o<t.length;o++)"leaflet"==mappl10n.options.engine?e.once(t[o],n):google.maps.event.addListenerOnce(e,t[o],n)},clearInstanceListeners:function(e){"leaflet"==mappl10n.options.engine?e.off():google.maps.event.clearInstanceListeners(e)},clearListeners:function(e,t){t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?e.off(t[n]):google.maps.event.clearListeners(e,t[n])},removeListener:function(e){for(let t=0;t<e.length;t++)"leaflet"==mappl10n.options.engine?e[t].target.off(e[t].event,e[t].callback):google.maps.event.removeListener(e[t])},trigger:function(e,t,n){"leaflet"==mappl10n.options.engine?e.fire(t,n):google.maps.event.trigger(e,t,n)}},i={parseOverlay:function(e,t){if("google"==mappl10n.options.engine){if("kml"==e){const e=t.getDefaultViewport();return{point:e?o.toJSON(e.getCenter()):null,viewport:e?o.boundsToViewport(e):null}}const n=t instanceof google.maps.Polyline?{strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,stokeWeight:t.strokeWeight}:{fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight};if("circle"==e)return{point:o.toJSON(t.getCenter()),poly:{radius:t.getRadius(),...n}};if("rectangle"==e)return{viewport:o.boundsToViewport(t.getBounds()),poly:{...n}};if("polyline"==e){const e=[];return t.getPath().forEach((function(t){e.push(o.toJSON(t))})),{poly:{path:e,...n}}}if("polygon"==e){const e={fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight},n=[];return t.getPaths().forEach((function(e){var t=[];e.forEach((function(e){t.push(o.toJSON(e))})),n.push(t)})),{poly:{paths:n,...e}}}if(!e)return{point:o.toJSON(t.getPosition())}}else{if("kml"==e){const e=t.getBounds();return{point:e&&e.isValid()?o.toJSON(e.getCenter()):null,viewport:e&&e.isValid()?o.boundsToViewport(e):null}}if(!e)return{point:"leaflet"==mappl10n.options.engine?o.toJSON(t.getLatLng()):o.toJSON(t.getPosition())}}}}},374:(e,t,n)=>{"use strict";n.r(t);var o=n(939),a=n(346);window.mapp=window.mapp||{};const i=wp.element.createElement;mapp.load=function(){const e=e=>{let{data:t,container:n}=e;t.pois&&t.pois.map((e=>{e.id=o.mappLib.nanoid()})),n?ReactDOM.render(i(a.MappMap,{...t,container:n}),n):console.log("Missing container for map "+t.name)};if(window.frameElement){const t=window.frameElement.id,n=window.parent.mapp.data;e({data:n?n.find((e=>e.name==t)):null,container:document.querySelector(".mapp-iframe-content")})}else if(mapp.data)for(;mapp.data.length;){const t=mapp.data.pop();e({data:t,container:document.getElementById(t.name)})}},mapp.load()},346:(t,n,o)=>{"use strict";o.r(n),o.d(n,{MappMap:()=>D});var a=o(939),i=o(715),l=(o(817),o(602)),s=o(818),p=o(81),r=o(50),c=o(615);const u=wp.element.createElement,{Fragment:m,useEffect:g,useLayoutEffect:d,useMemo:f,useRef:v,useState:h}=wp.element;function y(e){e={anchor:null,className:null,content:null,map:null,onMouseEnter:null,onMouseLeave:null,point:null,...e};const t=v(null),[n,o]=h({isLoaded:null,mapDiv:"leaflet"==mappl10n.options.engine?e.map.getContainer():e.map.getDiv(),overlayView:null});function i(e){o((t=>({...t,...e})))}function l(){const o=t.current;if(!o)return;if(document.fullscreenElement||e.map.isFullscreen)return;let i;const{width:l,height:s}=o.getBoundingClientRect(),p=a.mappLib.pointToLatLng(e.point);if("leaflet"==mappl10n.options.engine)i=e.map.latLngToContainerPoint(p);else{const e=n.overlayView.getProjection();if(!e)return;i=e.fromLatLngToContainerPixel(p)}o.style.bottom=n.mapDiv.clientHeight-i.y-e.anchor.y+"px",o.style.left=i.x-l/2+e.anchor.x+"px"}return d((()=>{"google"==mappl10n.options.engine?n.overlayView||(n.overlayView=new google.maps.OverlayView,n.overlayView.onAdd=function(){i({isLoaded:!0})},n.overlayView.setMap(e.map)):(e.map.stop(),i({isLoaded:!0}))}),[]),d((()=>{if(!n.isLoaded)return;let t;return"google"==mappl10n.options.engine?n.overlayView.draw=()=>l():t=a.mappEvent.addListener(e.map,"move",(e=>l())),()=>{"google"==mappl10n.options.engine?n.overlayView.draw=null:a.mappEvent.removeListener(t)}})),d((()=>{n.isLoaded&&(l(),function(){const o=t.current;if(!o)return;const i=30,l=o.offsetWidth,s=o.offsetHeight,p=n.mapDiv.clientWidth,r=n.mapDiv.clientHeight,c=a.mappLib.pointToLatLng(e.point);let u;if("leaflet"==mappl10n.options.engine)u=e.map.latLngToContainerPoint(c);else{const e=n.overlayView.getProjection();u=e?e.fromLatLngToContainerPixel(c):null}if(!u)return;var m={x:u.x,y:u.y};u.x+l/2+e.anchor.x>p-i?m.x=Math.max(p-l/2-e.anchor.x-i,p/2-e.anchor.x):u.x-l/2+e.anchor.x<i&&(m.x=Math.min(l/2+e.anchor.x+i,p/2-e.anchor.x));u.y+e.anchor.y-s<i&&(m.y=s-e.anchor.y+i);m.y>=r&&(m.y=r-i);const g={x:u.x-m.x,y:u.y-m.y};(g.x<=-1||g.x>=1||g.y<=-1||g.y>=1)&&("leaflet"==mappl10n.options.engine?e.map.panBy([g.x,g.y]):e.map.panBy(g.x,g.y))}())}),[n.isLoaded]),n.isLoaded?u("div",{className:"mapp-ib-wrapper",ref:t,onMouseEnter:()=>{e.onMouseEnter&&e.onMouseEnter()},onMouseLeave:()=>{e.onMouseLeave&&e.onMouseLeave()}},u("div",{className:"mapp-ib-content"},u("div",{className:"mapp-ib"},u("div",{className:"mapp-iw "+(e.className?e.className:"")},e.content)),u("div",{className:"mapp-ib-tip"}))):null}var b=o(892),w=o(10),k=o(326);const E=a.mappLib.toJSON,{Fragment:C,useCallback:O,useEffect:x,useLayoutEffect:M,useRef:N,useState:P}=wp.element,S=wp.element.createElement,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function D(t){t={alignment:null,center:null,centerPoi:null,classname:null,container:null,height:null,initialOpenInfo:null,isEditable:null,layers:null,layout:null,lines:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,oid:null,otype:null,onDragDrop:null,onDrawingEvent:null,onPoiChange:null,onPopupHover:null,onRenderPopup:null,onRenderSidebar:null,onSearch:null,onViewportChange:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,query:null,search:null,width:null,zoom:null,...t};const[n,o]=P({clusterer:null,directionsTo:null,drawingManager:null,filters:null,hovered:null,hoveredDelay:null,hoveredPopup:null,iframe:window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?window.frameElement:null,init:null,isDirectionsOpen:null,isFetching:null,isGeolocating:null,isHidden:!1,isLoaded:null,isMounted:null,isMini:null,isSidebarOpen:null!=t.poiListOpen?t.poiListOpen:mappl10n.options.poiListOpen,kmlEvent:null,layers:{},layout:t.layout?t.layout:mappl10n.options.layout,map:null,opened:null,oid:t.oid?t.oid:mappl10n.options.oid,otype:t.otype?t.otype:mappl10n.options.otype,page:1,pageCount:0,parsedCenter:null,poiList:void 0!==t.poiList&&null!=t.poiList?t.poiList:mappl10n.options.poiList,pois:[],polyline:null,templates:t.query?"user"==t.otype?{item:"user-mashup-item",popup:"user-mashup-popup"}:{item:"mashup-item",popup:"mashup-popup"}:{item:"map-item",popup:"map-popup"},userLocation:null}),u=N(null),m=N(t.container),{geocode:g,geolocate:d}=(N(),(0,w.useGeocoding)({withBusinesses:t.isEditable}));function f(e){o((t=>({...t,...e})))}(0,k.useResizeObserver)(m.current,(function(){if(n.poiList&&"inline"!=n.layout&&m.current){const e=m.current.clientWidth<mappl10n.options.mini;null==n.isMini?e&&f({isMini:e,isSidebarOpen:!1}):e!=n.isMini&&f({isMini:e,isSidebarOpen:!e})}if(n.iframe&&"inline"==n.layout){const e=m.current.getBoundingClientRect().height;n.iframe.parentElement.style.height=e+"px",t.container.style.height="auto"}})),(0,k.useResizeObserver)(u.current,U),x((()=>{switch(n.init){case null:!function(){const e=[__("MapPress FAQ")+": http://mappresspro.com/mappress-faq",__("Support")+": http://mappresspro.com/chris-contact",__("Get an API Key")+": https://mappresspro.com/how-to-get-a-google-maps-api-key"];let t=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:__("Leaflet library not loaded"),text:__("A theme or plugin is preventing the Leaflet library from loading.")},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:__("Google Maps API not loaded"),text:__("A theme or plugin is preventing Google Maps from loading.")},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:__("Google Maps API key required")},{condition:document.querySelectorAll('script[src*="https://maps.googleapis.com/maps/api/js?v="]').length>1,title:__("Google Maps API loaded multiple times"),text:__("A theme or plugin has loaded Google Maps twice")},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")}];t=t.filter((e=>e.condition));let n=t.map((e=>e.title+" : "+e.text));n.length&&(console.log(__("Map Error")+"\n----------------\n"+n.join("\n")+"\n----------------\n"+e.join("\n")),mappl10n.options.admin&&alert(__("Map error: please see the developer console (F12 in most browsers) for details.")))}();let e,o={...t.mapOpts};o.minZoom=isNaN(parseInt(o.minZoom))?0:parseInt(o.minZoom),"leaflet"==mappl10n.options.engine?(e=new L.Map(u.current,{attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null,...o}),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(e)):e=new google.maps.Map(u.current,{backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!t.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},...o}),f({map:e}),mappl10n.options.userLocation&&mappl10n.options.ssl&&d((e=>{e&&e.geometry&&e.geometry.location&&f({userLocation:e.geometry.location})}),!0),g({value:t.center,callback:e=>{e&&e.geometry&&e.geometry.location?f({parsedCenter:{lat:e.geometry.location.lat,lng:e.geometry.location.lng}}):f({parsedCenter:null}),f({init:1})}});break;case 1:ee(t.mapTypeId),function(){if(t.isEditable&&"google"==mappl10n.options.engine&&google.maps.drawing){const e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};n.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),n.drawingManager.setMap(n.map)}}(),function(){n.polyline&&("leaflet"==mappl10n.options.engine?n.polyline.remove():n.polyline.setMap(null),f({polyline:null}));if(t.isEditable||!t.lines&&!mappl10n.options.lines||n.pois.length<2)return;const e={...mappl10n.options.lineOpts},o=[];if(_.map(n.pois,(e=>{o.push(R(e))})),"leaflet"==mappl10n.options.engine)f({polyline:new L.Polyline(o,e).addTo(n.map)});else{const t={strokeColor:e.color,strokeWeight:e.weight,strokeOpacity:e.opacity};e.icons&&(_.map(e.icons,(e=>{e.icon.path=parseInt(e.icon.path)})),e.icons[0].repeat="50px"),f({polyline:new google.maps.Polyline({map:n.map,path:o,...e,...t})}),e.animate&&e.icons&&e.icons.length&&function(){let e=0;const t=n.polyline.get("icons");t[0].repeat.replace("%","").replace("px","");window.setInterval((()=>{e+=1;t[0].offset=e+(t[0].repeat.indexOf("%")>=0?"%":"px"),n.polyline.set("icons",t)}),20)}()}}(),t.query?v((()=>f({init:2}))):(f({pois:t.pois?t.pois:[]}),f({init:2}));break;case 2:const i="leaflet"==mappl10n.options.engine?"load":"tilesloaded";a.mappEvent.addListenerOnce(n.map,i,(()=>{f({bounds:M()}),function(){if(mappl10n.options.clustering&&!t.isEditable){let e,t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?(e=L.markerClusterGroup(t),n.map.addLayer(e)):(t={...t,imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"},e=new MarkerClusterer(n.map,[],t)),f({clusterer:e})}}(),(t.initialOpenInfo||mappl10n.options.initialOpenInfo)&&!t.isEditable&&n.pois&&H(n.pois[0]),f({isLoaded:!0})})),J()}}),[n.init]);(0,k.useTimeout)((()=>{f({hoveredDelay:0}),n.hoveredPopup||f({hovered:null})}),n.hoveredDelay);function v(e){}function h(e){return n.pois.find((t=>t.id==e))}function O(e){return n.map.fitBounds(e)}function M(){try{return n.map.getBounds()}catch(e){return null}}function D(){let e;try{e=n.map.getCenter()}catch(t){e=null}return e?E(e):null}function I(){if(t.embed)return{width:"100%",height:"100%"};const e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=e=>"string"==typeof e&&(e.indexOf("px")>=0||e.indexOf("%")>=0||e.indexOf("vh")>=0||e.indexOf("vw")>=0)?e:e+"px";return{width:t.width?n(t.width):n(e.width),height:t.height?n(t.height):n(e.height)}}function T(e){let t;switch("leaflet"==mappl10n.options.engine&&"kml"!=e.type?null:e.type){case"polygon":t=new google.maps.LatLngBounds,e.poly.paths.map((e=>{e.map((e=>{t.extend(e)}))}));break;case"polyline":t=new google.maps.LatLngBounds,e.poly.path.map((e=>{t.extend(e)}));break;case"circle":const n=new google.maps.Circle({center:e.point,radius:e.poly.radius});t=n.getBounds();break;default:t=a.mappLib.viewportToBounds(e.viewport)}return t}function R(e,t){if(e.point&&!e.type)return"leaflet"==mappl10n.options.engine?L.latLng(e.point):new google.maps.LatLng(e.point.lat,e.point.lng);if("kml"==e.type&&t&&t.latLng)return t.latLng;const n=T(e);return"leaflet"==mappl10n.options.engine?n&&n.isValid()?n.getCenter():new L.latLng(0,0):n?n.getCenter():new google.maps.LatLng(0,0)}function B(){let e;try{e=n.map.getZoom()}catch(t){e=null}return e?parseInt(e):null}function z(){return!!(t.isEditable||t.search||mappl10n.options.search&&t.query)}x((()=>{n.isLoaded&&!t.query&&f({pois:t.pois?t.pois:[]})}),[t.pois]),x((()=>{n.isLoaded&&t.query&&v()}),[t.query,n.filters]),x((()=>{n.isLoaded&&null==t.center&&J(null)}),[t.center]),x((()=>{n.isLoaded&&ee(t.mapTypeId)}),[t.mapTypeId]),x((()=>{n.isLoaded&&Z(t.centerPoi)}),[t.centerPoi]),x((()=>{if(!n.isLoaded)return;let e,o,i;return e=a.mappEvent.addListener(n.map,"moveend idle",(e=>A())),o=a.mappEvent.addListener(n.map,"click dragstart zoom_changed zoomstart",(e=>{"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||V()})),n.drawingManager&&(i=a.mappEvent.addListener(n.drawingManager,"overlaycomplete",(e=>{n.drawingManager.setDrawingMode(null),j(null),t.onDrawingEvent&&t.onDrawingEvent(e)}))),t.name&&(window[t.name]={getPois:()=>n.pois,poiOpen:e=>f({opened:"string"==typeof e?e:e.id})}),()=>{a.mappEvent.removeListener(e),a.mappEvent.removeListener(o),i&&a.mappEvent.removeListener(i)}}));const A=(0,k.useDebounce)((()=>{f({bounds:M(),page:1}),t.onViewportChange&&t.onViewportChange({center:D(),zoom:B()})}),500,[t.onViewportChange,n.map]);function F(e,n){if("poi"!=mappl10n.options.mashupClick&&t.query&&"post"==e.otype&&e.oid&&e.url)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":const t=document.createElement("div");return document.body.appendChild(t),ReactDOM.render(S(b.MappPopupModal,{onClose:()=>{wp.element.unmountComponentAtNode(t),t.remove()},poi:e}),t)}else H(e,n)}function V(){f({hovered:null,opened:null,isDirectionsOpen:!1})}function j(e,o){!t.isEditable&&mappl10n.options.tooltips&&(e&&e.id==n.opened||n.opened||f(e?{hovered:e.id,hoveredDelay:0}:o?{hoveredDelay:300}:{hovered:null,hoveredDelay:0}))}function H(e,t){V(),n.isMini&&W(!1),f({kmlEvent:t,opened:e.id})}function G(e){e?f({hoveredPopup:e.id,hoveredDelay:0}):(f({hoveredPopup:null}),n.hovered&&!n.opened&&f({hoveredDelay:300}))}function U(){"leaflet"==mappl10n.options.engine?n.map.invalidateSize():a.mappEvent.trigger(n.map,"resize"),0==m.current.offsetHeight?f({isHidden:!0}):n.isHidden&&(f({isHidden:!1}),J())}function W(e){f({isSidebarOpen:e=void 0!==e?e:!n.isSidebarOpen,isDirectionsOpen:!1}),setTimeout((()=>U()),100)}function J(e){e=null==e?n.parsedCenter:e;const o=t.zoom&&parseInt(t.zoom)?parseInt(t.zoom):null;if(e)return void te(e,o||1);if(0==n.pois.length)return void te({lat:0,lng:0},o||1);if(1==n.pois.length)return void Z(n.pois[0]);let a="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var i=0;i<n.pois.length;i++){var l=T(n.pois[i]);a=l?"leaflet"==mappl10n.options.engine?a.extend(l):a.union(l):a.extend(R(n.pois[i]))}o?te(E(a.getCenter()),o):O(a)}function Z(e){let n=null;if(t.zoom)n=parseInt(t.zoom);else if(mappl10n.options.poiZoom)n=parseInt(mappl10n.options.poiZoom);else if(e.viewport){var o=e.viewport.ne.lng-e.viewport.sw.lng;o<0&&(o+=360),n=Math.floor(Math.log(360*u.current.clientWidth/o/256)/Math.LN2)}te(R(e),n)}function q(){return mappl10n.options.ssl?S("div",{className:"mapp-"+mappl10n.options.engine+"-geolocate-wrapper"},S("div",{className:"mapp-geolocate-control",onClick:()=>(f({isGeolocating:!0}),void d((e=>{f({isGeolocating:!1}),e&&e.geometry&&e.geometry.location&&te(e.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1)),title:__("Your Location")})):null}function K(){if(n.isLoaded)return z()?S("div",{className:"mapp-header"},z()&&n.map?S("div",{className:"mapp-search-container"},S(s.MappPlaces,{buttonLabel:t.isEditable?__("Add to map"):S("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:t.isEditable,includeBusinesses:t.isEditable,map:n.map,onSearch:e=>{t.onSearch?t.onSearch(e):function(e){if(!e||!e.geometry)return;const t=e.geometry.location?e.geometry.location:null,n=e.geometry.viewport?e.geometry.viewport:null;let o;if("leaflet"==mappl10n.options.engine){const e=new L.LatLng(t.lat,t.lng);o=n?new L.LatLngBounds(new L.LatLng(n.sw.lat,n.sw.lng),new L.LatLng(n.ne.lat,n.ne.lng)):e.toBounds(1e3*mappl10n.options.radius)}else{const e=new google.maps.Circle({center:t,radius:1e3*mappl10n.options.radius});o=n?new google.maps.LatLngBounds(new google.maps.LatLng(n.sw.lat,n.sw.lng),new google.maps.LatLng(n.ne.lat,n.ne.lng)).union(e.getBounds()):e.getBounds()}o&&O(o),te(t)}(e)}})):null,"top"==mappl10n.options.filtersPos&&null):null}function Y(){return S("div",{className:"mapp-content"},n.isFetching||n.isGeolocating?S(C,null,S("div",{className:"mapp-spinner-overlay"}),S("div",{className:"mapp-spinner"})):null,K(),S("div",{className:"mapp-main"},"inline"!=n.layout&&$(),S("div",{className:"mapp-canvas-panel"+("google"==mappl10n.options.engine?" mapp-google":" mapp-leaflet")},S("div",{className:"mapp-canvas",ref:u}),n.isLoaded&&n.userLocation?S(p.MappPoi,{isClusterable:!1,isEditable:!1,isOpen:!1,key:"user",map:n.map,poi:{point:n.userLocation,iconid:"geolocation"}}):null,function(){if(!n.isLoaded)return;return n.pois.map((o=>S(p.MappPoi,{key:o.id,isClusterable:!!n.clusterer&&!o.type,isEditable:!!t.isEditable,isHovered:o.id==n.hovered,isOpen:o.id==n.opened,map:n.map,onChange:e=>{t.onPoiChange&&t.onPoiChange(o.id,e)},onClick:e=>F(o,e),onClusterAdd:e=>function(e){n.clusterer&&("leaflet"==mappl10n.options.engine?n.clusterer.addLayer(e):n.clusterer.addMarker(e))}(e),onMouseOut:()=>{j(null,!0)},onMouseOver:()=>j(o),onRenderPopup:(o,a)=>function(o,a){const i=function(e){if(n.clusterer){if("leaflet"==mappl10n.options.engine){var t=n.clusterer.getVisibleParent(e);return t&&t!=e?t.getLatLng():null}const a=n.clusterer.getClusters();for(var o=0;o<a.length;o++){const t=a[o].markers_;if(t.length>1)for(let n=0;n<t.length;n++)if(t[n]==e)return a[o].center_}}}(a),l=R(o),s=E(i||l);let p,c,u={x:0,y:0};i?u={x:0,y:-14}:o.type||(u=mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32});n.kmlEvent&&(n.kmlEvent.pixelOffset&&(u={x:e.pixelOffset.width,y:e.pixelOffset.height}),n.kmlEvent.featureData?p=n.kmlEvent.featureData:n.kmlEvent&&n.kmlEvent.propagatedFrom&&n.kmlEvent.propagatedFrom.feature&&n.kmlEvent.propagatedFrom.feature.properties&&(p=n.kmlEvent.propagatedFrom.feature.properties));c=t.onRenderPopup?t.onRenderPopup(o,V):S(r.MappPoiContent,{context:"popup",feature:p,isEditable:t.isEditable,onDirectionsClick:()=>f({isDirectionsOpen:!0,directionsTo:o}),poi:o,template:n.templates.popup,thumbs:mappl10n.options.thumbsPopup});return S(y,{anchor:u,className:!t.isEditable&&mappl10n.options.thumbsPopup?"mapp-thumb-"+mappl10n.options.thumbsPopup:"",content:c,map:n.map,onMouseEnter:()=>G(o),onMouseLeave:()=>G(null),point:s})}(o,a),poi:o})))}(),t.isEditable||"leaflet"==mappl10n.options.engine||!n.map?null:S(l.MappMenuControl,{map:n.map,onCenter:()=>{V(),J()}}),q())),n.poiList&&"inline"!=n.layout&&n.isMini?S("div",{className:"mapp-footer"},!n.isSidebarOpen&&S("div",{className:"mapp-button mapp-view-list",onClick:()=>W(!0)},S("img",{src:mappl10n.options.baseurl+"/images/outline_format_list_bulleted_black_18dp.png"}),"List"),n.isSidebarOpen&&S("div",{className:"mapp-button mapp-view-map",onClick:()=>W(!1)},S("img",{src:mappl10n.options.baseurl+"/images/outline_map_black_18dp.png"}),"Map")):null)}function X(){const e={paddingBottom:I().height};return S(C,null,S("div",{className:"mapp-wrapper",style:e},Y()),"inline"==n.layout&&$())}function Q(){if(!n.poiList||!n.isLoaded)return null;let e=[];return e=z()&&n.bounds&&!t.isEditable?n.pois.filter(((e,t)=>n.bounds.contains(R(e)))):n.pois,n.pageCount!=e.length&&f({pageCount:e.length}),S(c.MappPoiList,{className:!t.isEditable&&mappl10n.options.thumbsList?" mapp-thumb-"+mappl10n.options.thumbsList:"",hovered:n.hovered,isEditable:t.isEditable,isPaged:!!t.query,onClick:e=>F(h(e)),onDirectionsClick:e=>f({isDirectionsOpen:!0,directionsTo:h(e)}),onDragDrop:e=>{let{from:n,to:o}=e;return function(e,n){t.onDragDrop&&t.onDragDrop(e,n)}(n,o)},onMouseEnter:e=>j(h(e)),onMouseLeave:e=>j(null),onPage:e=>{f({page:e})},opened:n.opened,page:n.page,pois:e,template:t.isEditable?null:n.templates.item})}function $(){let e="mapp-sidebar";return e+="inline"==n.layout?" mapp-sidebar-inline":"",e+=n.isSidebarOpen?" mapp-sidebar-open":"",n.isDirectionsOpen?S("div",{className:e},function(){if(!n.isDirectionsOpen)return null;let e="";if(n.directionsTo)if(n.directionsTo.address)e=n.directionsTo.address;else{const t=E(R(n.directionsTo));e=t.lat+", "+t.lng}return S(i.MappDirections,{from:"",to:e,onClose:()=>{f({isDirectionsOpen:!1,directionsTo:null})}})}()):n.poiList?S("div",{className:e},S("div",{className:"mapp-sidebar-toggle",onClick:()=>W()}),"list"==mappl10n.options.filtersPos&&null,t.onRenderSidebar&&t.onRenderSidebar(),Q()):void 0}function ee(e){const t=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),o=_.find(t,(t=>t.id==e));!mappl10n.options.style||"roadmap"!=e&&"streets"!=e&&o||(e=mappl10n.options.style);let a=_.find(t,(t=>t.id==e));if(a=a||t[0],"leaflet"==mappl10n.options.engine){let e={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">&copy; Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">&copy; OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[a.provider],t={...e,...a};L.tileLayer(e.url,t).addTo(n.map)}else if(n.map.setMapTypeId("standard"==a.type?a.id:"roadmap"),a.json){let e=null;try{e=JSON.parse(a.json)}catch(e){console.log("Invalid JSON in map style")}n.map.setOptions({styles:e||null})}else n.map.setOptions({styles:null})}function te(e,t,o){"leaflet"==mappl10n.options.engine?(null==t&&(t=n.map.getZoom()?n.map.getZoom():0),n.map.setView(e,t,o)):(e=e&&!E(e)?{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}:e,t=t?parseInt(t):null,e&&n.map.setCenter(e),t&&n.map.setZoom(t))}return t.container?X():function(){const e=I();t.name&&t.name;let o="mapp-layout";o+="left"==n.layout?" mapp-list-left":" mapp-inline",n.isMini&&(o+=" mapp-mini");const a=t.alignment?t.alignment:mappl10n.options.alignment;a&&!document.body.classList.contains("block-editor-page")&&(o+=" align"+a,o+=" mapp-align-"+a);let i="full"==t.alignment?{width:"auto"}:{width:e.width};return S("div",{className:o,style:i,ref:m,tabIndex:"-1"},X())}()}},759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mappMarker:()=>a});var o=n(939);function a(e){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(e),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove(),this.div=document.createElement("div"),this.div.classList.add("mapp-marker")}a.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let t=e.fromLatLngToDivPixel(this.position),n=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.left=t.x-n.width/2+"px",this.div.style.top=t.y-n.height+"px"}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(e){let t="on"+e.type[0].toUpperCase()+e.type.slice(1);this[t]&&this[t](e)},onAdd:function(){let e=this.overlayView.getPanes();e&&(this.div||(this.div=document.createElement("div"),this.div.classList.add("mapp-marker")),e.overlayMouseTarget.append(this.div),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div),this.div.addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&o.mappEvent.trigger(this,"click"),this.dragging=null})),this.div.addEventListener("mouseenter",this),this.div.addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(e){o.mappEvent.trigger(this,"mouseover")},onMouseleave:function(e){o.mappEvent.trigger(this,"mouseout")},onPointerdown:function(e){const t=this.map.getDiv().getBoundingClientRect(),n=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:e.clientX,y:e.clientY},offset:{x:n.x-(e.clientX-t.left),y:n.y-(e.clientY-t.top)}},this.toggleDragEvents(!0)},onPointermove:function(e){if(Math.abs(e.clientX-this.dragging.startPixel.x)+Math.abs(e.clientY-this.dragging.startPixel.y)<3)return;const t=this.map.getDiv().getBoundingClientRect();let n={x:e.clientX-t.left+this.dragging.offset.x,y:e.clientY-t.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(n)),this.draw(),this.dragging.moved=!0,o.mappEvent.trigger(this,"dragstart")},onPointercancel:function(e){this.onPointerup(e)},onPointerup:function(e){this.dragging&&this.dragging.moved&&o.mappEvent.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(e,t){let n="set"+e[0].toUpperCase()+e.slice(1);this[n]&&this[n](t)},setDraggable:function(e){this.draggable=e,this.map&&this.div&&(this.div.removeEventListener("pointerdown",this,{passive:!0}),e&&this.div.addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(e){if(void 0!==e&&(this.icon=e),this.icon&&this.div){let e='<img draggable="false" src="'+this.icon.url+'">';this.div.innerHTML=e;let t=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.width=t.width+"px",this.div.style.height=t.height+"px",this.setZIndex(),this.draw()}},setMap:function(e){this.map=e,this.overlayView.setMap(e)},setPosition:function(e){this.position=e},setValues:function(e){for(const t in e)this.set(t,e[t])},setVisible:function(e){this.visible=e,this.div&&(this.div.style.visibility=e?"visible":"hidden")},setZIndex:function(e){this.zIndex=void 0!==e?e:this.zIndex,this.div&&(this.div.style.zIndex=e)},toggleDragEvents(e){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),e&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},602:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappMenuControl:()=>c});var o=n(326);const a=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useRef:p,useState:r}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function c(e){e={layer:null,map:null,onCenter:null,...e};const[t,n]=r({activeLayer:e.layer?e.layer:null,layers:null,isOpen:!1}),s=p(null);function c(e){n((t=>({...t,...e})))}function u(){c({isOpen:!t.isOpen})}return(0,o.useClickOutside)(s,(()=>{t.isOpen&&u()})),l((()=>{if("google"==mappl10n.options.engine){c({layers:{traffic:{googleLayer:new google.maps.TrafficLayer,label:__("Traffic")},bicycling:{googleLayer:new google.maps.BicyclingLayer,label:__("Bicycling")},transit:{googleLayer:new google.maps.TransitLayer,label:__("Transit")}}})}}),[]),a("div",{ref:s},a("div",{className:"mapp-menu-toggle",onClick:()=>u()}),t.isOpen&&function(){const n=_.map(t.layers,((n,o)=>{const i=t.activeLayer==o?"mapp-menu-item mapp-active":"mapp-menu-item";return a("div",{className:i,key:o,onClick:()=>function(n){t.activeLayer&&t.layers[t.activeLayer].googleLayer.setMap(null),n!=t.activeLayer&&t.layers[n].googleLayer.setMap(e.map),c({activeLayer:n==t.activeLayer?null:n,isOpen:!1})}(o)},n.label)}));return a("div",{className:"mapp-menu"},a("div",{className:"mapp-menu-items"},a("div",{className:"mapp-menu-item",onClick:()=>(c({isOpen:!1}),void e.onCenter())},__("Center map")),"google"==mappl10n.options.engine&&a(i,null,a("div",{className:"mapp-menu-separator"}),n)),a("div",{className:"mapp-menu-footer"},a("a",{className:"mapp-menu-help",href:"https://mappresspro.com/mappress-documentation",target:"_blank"},a("span",null,__("Help")))))}())}},27:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPaginate:()=>r});const o=wp.element.createElement,{Fragment:a,useEffect:i,useLayoutEffect:l,useRef:s,useState:p}=wp.element,{sprintf}=wp.i18n;function r(e){function t(t,n){const o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.page<o&&e.onChange(e.page+1);break;case"prev":e.page>1&&e.onChange(e.page-1)}}return function(){const n=Math.ceil(e.count/e.pageSize),a=e.isBusy||e.page<=1,i=e.isBusy||e.page>=n,l=a?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",s=i?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",p=(r="%d of %d",wp.i18n.__(r,"mappress-google-maps-for-wordpress"));var r;return o("div",{className:"mapp-paginate"},o("div",{className:l,onClick:()=>{a||t("first")}},"«"),o("div",{className:l,onClick:()=>{a||t("prev")}},"‹"),o("div",{className:"mapp-paginate-count"},sprintf(p,e.page,n)),o("div",{className:s,onClick:()=>{i||t("next")}},"›"),o("div",{className:s,onClick:()=>{i||t("last")}},"»"))}()}},818:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPlaces:()=>m});var o=n(117),a=n(10);const i=wp.element.createElement,{Fragment:l,useCallback:s,useEffect:p,useLayoutEffect:r,useRef:c,useState:u}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function m(e){e={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...e};const{geocode:t,getPredictions:n}=(0,a.useGeocoding)({map:e.map,includeBusinesses:e.includeBusinesses}),[l,s]=u({suggestions:[]});return i(o.MappAutocomplete,{buttonLabel:e.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:e.focus,onFetch:function(t){n({map:e.map,value:t,callback:e=>{var t;t={suggestions:e},s((e=>({...e,...t})))}})},onSelect:function(n){let{suggestion:o,value:a}=n;t({map:e.map,suggestion:o,value:a,callback:t=>{t&&e.onSearch(t)}})},placeholder:__("Search"),suggestions:l.suggestions,title:__("Enter an address, place, KML file URL, or lat,lng")})}},50:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPoiContent:()=>u});var o=n(939);const a=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:p,useRef:r,useState:c}=wp.element;wp.i18n.sprintf;function u(e){e={context:null,feature:null,isEditable:null,onDirectionsClick:null,poi:null,template:null,thumbs:null,...e};const[t,n]=c({imageNumber:0});function l(e){n((t=>({...t,...e})))}return a(i,null,function(){const n="list"!=e.context&&mappl10n.options.thumbWidth&&mappl10n.options.thumbHeight?{width:mappl10n.options.thumbWidth+"px",height:mappl10n.options.thumbHeight+"px"}:null,o=e.thumbs&&e.poi.images&&e.poi.images.length&&e.poi.images[t.imageNumber]?e.poi.images[t.imageNumber]:null;if(!o)return null;const i=function(e){switch(e.type){case"avatar":return a("div",{className:"mapp-avatar",dangerouslySetInnerHTML:{__html:e.html}});case"embed":return a("div",{className:"mapp-embed",dangerouslySetInnerHTML:{__html:e.html}});default:if("image"==e.type||!e.type){const t=e.size?{src:e.url,width:e.size[0]+"px",height:e.size[1]+"px"}:{src:e.url};return a("img",t)}}}(o);return a("div",{className:"mapp-thumbnail",onClick:()=>function(t){e.isEditable||"popup"!=e.context||"embed"==t.type||e.poi.url&&window.open(e.poi.url,"_blank")}(o),style:n},t.imageNumber>=1&&a("div",{className:"mapp-gallery-previous",onClick:e=>function(e){t.imageNumber>0&&(l({imageNumber:t.imageNumber-1}),e.stopPropagation())}(e)}),i,t.imageNumber<e.poi.images.length-1&&a("div",{className:"mapp-gallery-next",onClick:n=>function(n){t.imageNumber<e.poi.images.length-1&&(l({imageNumber:t.imageNumber+1}),n.stopPropagation())}(n)}))}(),a("div",{className:"mapp-info"},function(){let t={...e.poi};t.icon=o.mappLib.getIconUrl(e.poi.iconid),e.feature&&(t.body=e.feature.description,t.title=e.feature.name),t.props=t.props?t.props:{};const n=o.mappLib.template(e.template,{poi:t});return a("div",{className:"mapp-template",dangerouslySetInnerHTML:{__html:n}})}(),function(){var t;if(!(e.template.indexOf("user")>=0))return"popup"==e.context&&mappl10n.options.directionsPopup||"list"==e.context&&mappl10n.options.directionsList?a("div",{className:"mapp-dir-wrapper"},a("span",{className:"mapp-dir",onClick:t=>function(t){t.stopPropagation(),e.onDirectionsClick()}(t)},(t="Get Directions",wp.i18n.__(t,"mappress-google-maps-for-wordpress")))):void 0}()))}},615:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPoiList:()=>g});var o=n(939),a=n(27),i=n(50);const l=wp.element.createElement,{Fragment:s,useEffect:p,useLayoutEffect:r,useMemo:c,useRef:u,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf;const g=wp.element.memo((function(e){e={className:null,hovered:null,isEditable:!1,isPaged:!1,onClick:null,onDragDrop:null,onMouseEnter:null,onMouseLeave:null,onPage:null,opened:null,page:1,pois:null,template:null,...e};const[t,n]=m({dragging:null,dragover:null,pageSize:!e.isEditable&&mappl10n.options.poiListPageSize?parseInt(mappl10n.options.poiListPageSize):20});function p(e){n((t=>({...t,...e})))}function r(n){let a,r="mapp-item";return e.opened!=n.id&&e.hovered!=n.id||(r+=" mapp-selected"),r+=t.dragover==n.id?" mapp-dragover":"",a=e.isEditable?l(s,null,l("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(n.iconid)}),l("div",{className:"mapp-title"},n.title)):l(i.MappPoiContent,{context:"list",onDirectionsClick:()=>e.onDirectionsClick(n.id),poi:n,template:e.template,thumbs:mappl10n.options.thumbsList}),l("div",{className:r,dangerouslySetInnerHTML:null,draggable:e.isEditable,key:n.id,onClick:()=>e.onClick(n.id),onDragOver:e=>e.preventDefault(),onDragStart:e=>p({dragging:n.id}),onDragEnter:e=>p({dragover:n.id}),onDragEnd:e=>p({dragging:null,dragover:null}),onDrop:o=>{return a=n.id,void(e.onDragDrop&&e.onDragDrop({from:t.dragging,to:a}));var a},onMouseEnter:t=>{e.onMouseEnter(n.id)},onMouseLeave:t=>{e.onMouseLeave(n.id)}},a)}return l("div",{className:"mapp-list "+(e.className?e.className:"")},e.isPaged&&function(){let t=1!=e.pois.length?__("%d Results"):__("%d Result");return t=sprintf(t,e.pois.length),l("div",{className:"mapp-list-header"},l("div",{className:"mapp-list-count"},t))}(),function(){const n=t.pageSize*(e.page-1),o=n+t.pageSize-1;return l("div",{className:"mapp-items",key:e.page},_.map(e.pois,((t,a)=>{if(!e.isPaged||a>=n&&a<=o)return r(t)})))}(),e.isPaged&&(!e.isPaged||e.pois.length<=t.pageSize?null:l("div",{className:"mapp-list-footer"},l(a.MappPaginate,{count:e.pois.length,onChange:t=>e.onPage(t),page:e.page,pageSize:t.pageSize}))))}))},81:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPoi:()=>u});var o=n(939),a=n(759);wp.element.createElement;const{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:p,useRef:r,useState:c}=wp.element;function u(e){e={isClusterable:null,isEditable:null,isHovered:null,isOpen:null,map:null,onClusterAdd:null,onMouseOut:null,onMouseOver:null,poi:null,...e};const t=r(null),[n,i]=c({overlay:null});function s(t){p()&&"google"==mappl10n.options.engine&&("rectangle"==e.poi.type&&(o.mappEvent.clearListeners(n.overlay,"bounds_changed"),t&&o.mappEvent.addListener(n.overlay,"bounds_changed",(()=>{u()}))),"circle"==e.poi.type&&(o.mappEvent.clearListeners(n.overlay,"center_changed radius_changed"),t&&o.mappEvent.addListener(n.overlay,"center_changed radius_changed",(()=>{u()}))),"polygon"!=e.poi.type&&"polyline"!=e.poi.type||(o.mappEvent.clearListeners(n.overlay,"rightclick"),o.mappEvent.clearListeners(n.overlay.getPath(),"insert_at remove_at set_at"),t&&(o.mappEvent.addListener(n.overlay,"rightclick",(e=>{null!=e.vertex&&n.overlay.getPath().getLength()>2&&(n.overlay.getPath().removeAt(e.vertex),u())})),o.mappEvent.addListener(n.overlay.getPath(),"insert_at remove_at set_at",(()=>{u()})))))}function p(){return"google"==mappl10n.options.engine&&-1!=["polyline","polygon","circle","rectangle"].indexOf(e.poi.type)}function u(){const t=o.mappPoi.parseOverlay(e.poi.type,n.overlay);e.onChange(t)}function m(t,n){n?"leaflet"==mappl10n.options.engine?t.addTo(e.map):t.setMap(e.map):"leaflet"==mappl10n.options.engine?t.remove():t.setMap(null)}return l((()=>{const n="leaflet"==mappl10n.options.engine&&"kml"!=e.poi.type?null:e.poi.type,l=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");let s;switch(n){case"polygon":s=new google.maps.Polygon({paths:e.poi.poly.paths,...l});break;case"polyline":s=new google.maps.Polyline({path:e.poi.poly.path,...l});break;case"circle":const t=new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng);s=new google.maps.Circle({center:t,radius:parseFloat(e.poi.poly.radius),...l});break;case"rectangle":s=new google.maps.Rectangle({bounds:o.mappLib.viewportToBounds(e.poi.viewport),...l});break;case"kml":const n=e.poi.kml&&e.poi.kml.url?e.poi.kml.url:"";s="leaflet"==mappl10n.options.engine?omnivore.kml(n):new google.maps.KmlLayer({url:n,preserveViewport:!0,suppressInfoWindows:!0});break;default:s="leaflet"==mappl10n.options.engine?L.marker([e.poi.point.lat,e.poi.point.lng]):new a.mappMarker({position:new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng)}),s.setIcon(o.mappLib.getIcon(e.poi.iconid))}var r;return r={overlay:s},i((e=>({...e,...r}))),"kml"!=e.poi.type&&("leaflet"==mappl10n.options.engine?s.options.draggable=e.isEditable:s.setDraggable(e.isEditable),p()&&s.setEditable(e.isEditable)),e.isClusterable?(e.onClusterAdd(s),"google"==mappl10n.options.engine&&m(s,e.map)):m(s,e.map),t.current=s,()=>{m(t.current,null)}}),[]),l((()=>{if(n.overlay){const t=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");n.overlay.setOptions({...t})}}),[e.poi.poly]),l((()=>{n.overlay&&n.overlay.setIcon(o.mappLib.getIcon(e.poi.iconid))}),[e.poi.iconid]),l((()=>{n.overlay&&function(t){if(e.poi.type)return;if("icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&e.isEditable)return;var a="leaflet"==mappl10n.options.engine?n.overlay._icon:n.overlay.getDiv();if(!a)return;switch(e.isEditable?"circle":mappl10n.options.highlight){case"circle":a.classList.toggle("mapp-marker-circle",t);break;case"icon":var i=t?o.mappLib.getIcon(mappl10n.options.highlightIcon):o.mappLib.getIcon(e.poi.iconid);if("leaflet"==mappl10n.options.engine&&n.overlay.getIcon().options.iconUrl==i.options.iconUrl)return;n.overlay.setIcon(i);break;case"scale":a.classList.add("mapp-marker"),a.classList.toggle("mapp-marker-scale",t)}const l=t?1e4:0;"leaflet"==mappl10n.options.engine?e.poi.type||n.overlay.setZIndexOffset(l):n.overlay.set("zIndex",l)}(e.isHovered||e.isOpen)}),[e.isHovered,e.isOpen,n.overlay]),l((()=>{if(n.overlay)return o.mappEvent.addListener(n.overlay,"click",(t=>{e.onClick(t)})),o.mappEvent.addListener(n.overlay,"mouseover",(t=>e.onMouseOver(t))),o.mappEvent.addListener(n.overlay,"mouseout",(t=>e.onMouseOut(t))),"kml"==e.poi.type&&("leaflet"==mappl10n.options.engine?(o.mappEvent.addListenerOnce(n.overlay,"ready",(()=>{n.overlayUpdate()})),o.mappEvent.addListenerOnce(n.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+e.poi.kml.url)}))):(o.mappEvent.addListener(n.overlay,"defaultviewport_changed",(()=>{u()})),o.mappEvent.addListener(n.overlay,"status_changed",(()=>{"OK"!=n.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+e.poi.kml.url)})))),e.isEditable&&(s(!0),o.mappEvent.addListener(n.overlay,"dragstart",(()=>(s(!1),void(e.onChange&&e.onChange({viewport:null}))))),o.mappEvent.addListener(n.overlay,"dragend",(()=>(u(),void s(!0))))),()=>{o.mappEvent.clearInstanceListeners(n.overlay)}})),e.isOpen||e.isHovered?e.onRenderPopup(e.poi,n.overlay):null}},892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPopupModal:()=>u});var o=n(939);const a=wp.element.createElement,i=wp.element.createPortal,{Fragment:l,useEffect:s,useLayoutEffect:p,useRef:r,useState:c}=wp.element;function u(e){e={onClose:null,poi:null,...e};const[t,n]=c({isBusy:!1,html:null});function l(e){n((t=>({...t,...e})))}const p=React.createRef();function r(t){27==t.keyCode&&e.onClose()}return s((()=>(document.body.classList.add("mapp-modal-noscroll"),()=>document.body.classList.remove("mapp-modal-noscroll"))),[]),s((()=>{e.poi.oid&&(l({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_get_post",oid:e.poi.oid,nonce:mappl10n.options.nonce},responseType:"html",callback:e=>{l({isBusy:!1,html:e})}}))}),[e.poi.oid]),s((()=>{p.current&&p.current.focus(),console.log("focus"+document.activeElement)}),[p.current]),i(a("div",{className:"mapp-modal"},a("div",{className:"mapp-modal-backdrop",onClick:e.onClose,onKeyDown:r},a("div",{className:"mapp-modal-close",onClick:e.onClose},"×")),a("div",{className:"mapp-modal-content-wrapper",ref:p,onKeyDown:r,tabIndex:0},a("div",{className:"mapp-modal-content"},t.isBusy&&a("div",{className:"mapp-modal-spinner"}),!t.isBusy&&a("div",{className:"mapp-modal-template",dangerouslySetInnerHTML:{__html:t.html}}),a("div",{className:"mapp-modal-close",onClick:e.onClose},"X")))),document.body)}}},n={};function o(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(117),o(715),o(817),o(10),o(326),o(939),o(346),o(759),o(602),o(27),o(818),o(81),o(50),o(615),o(892),o(374)})();
1
+ (()=>{var t={117:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappAutocomplete:()=>m});var o=n(326);const a=wp.element.createElement,{Fragment:i,useCallback:l,useEffect:s,useLayoutEffect:p,useMemo:r,useRef:c,useState:u}=wp.element;function m(e){e={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...e};const t=c(null),n=c(null),[i,l]=u({isOpen:!1,value:""});function p(e){l((t=>({...t,...e})))}(0,o.useClickOutside)(t,(()=>{i.isOpen&&p({isOpen:!1})})),s((()=>{e.focus&&n.current&&n.current.focus()}),[]),s((()=>{i.map&&setMapTypeId(e.mapTypeId)}),[e.mapTypeId,i.map]);const r=(0,o.useDebounce)((t=>{e.onFetch&&e.onFetch(t)}),e.delay);function m(){let t;p({isOpen:!1}),e.suggestions&&(t=null==i.selected?e.suggestions[0]:e.suggestions[i.selected]),e.onSelect({suggestion:t,value:g})}const g=i.selected>=0&&e.suggestions&&e.suggestions[i.selected]?e.suggestions[i.selected].value:i.value;return a("div",{className:"mapp-autocomplete",ref:t},a("div",{className:"mapp-autocomplete-wrapper"},a("input",{className:e.className,onChange:e=>{!function(e){p({value:e,selected:null}),r(e)}(e.target.value)},onKeyDownCapture:t=>function(t){switch(t.stopPropagation(),t.code){case"Backspace":p({isOpen:i.value.length>1});break;case"Enter":m();break;case"Escape":p({isOpen:!1});break;case"ArrowUp":if(t.preventDefault(),e.suggestions&&0!=i.selected){const t=null==i.selected?e.suggestions.length-1:i.selected-1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"ArrowDown":if(e.suggestions&&i.selected<e.suggestions.length-1){const t=null==i.selected?0:i.selected+1;e.suggestions[t]&&p({isOpen:!0,selected:t})}else p({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:p({isOpen:!0})}}(t),placeholder:e.placeholder,ref:n,title:e.title,type:"text",value:g}),i.isOpen&&function(){if(e.suggestions&&e.suggestions.length)return a("div",{className:"mapp-autocomplete-list"},_.map(e.suggestions,((t,n)=>{const o="mapp-autocomplete-item"+(i.selected==n?" mapp-selected":"");return a("div",{className:o,key:n,onClick:()=>function(t,n){p({isOpen:!1,selected:n}),e.onSelect({suggestion:t})}(t,n)},t.value)})))}()),e.buttonLabel&&a("div",{className:"mapp-submit-button",onClick:()=>m()},e.buttonLabel))}},715:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappDirections:()=>r});const o=wp.element.createElement,{Fragment:a,useEffect:i,useLayoutEffect:l,useRef:s,useState:p}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(e){e={from:null,onClose:null,to:null,...e};const[t,n]=p({from:e.from?e.from:"",to:e.to?e.to:""});function a(e){n((t=>({...t,...e})))}function l(){e.onClose&&e.onClose()}function s(){const e=t.from.trim(),n=t.to.trim();let o=mappl10n.options.directionsServer;o="https://maps.google.com"==o?"https://www.google.com":o,-1==o.toLowerCase().indexOf("http")&&(o="https://"+o),o+="/maps/dir/?api=1&origin="+encodeURIComponent(e)+"&destination="+encodeURIComponent(n),window.open(o),l()}function r(e){13==e?s():27==e&&l()}return i((()=>{"google"==mappl10n.options.directions&&s()}),[]),"google"==mappl10n.options.directions?null:o("div",{className:"mapp-directions"},o("div",{className:"mapp-close",onClick:()=>l()}),o("div",null,o("input",{className:"mapp-dir-from",onChange:e=>a({from:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"1",placeholder:__("My location"),value:t.from}),o("div",{className:"mapp-dir-arrows",onClick:()=>{a({from:t.to,to:t.from})}})),o("div",null,o("input",{className:"mapp-dir-to",onChange:e=>a({to:e.target.value}),onKeyPress:e=>r(e.which),tabIndex:"2",value:t.to})),o("div",{className:"mapp-dir-toolbar"},o("div",{className:"mapp-submit-button",onClick:()=>s()},__("Get Directions"))))}},817:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappFilters:()=>u});var o=n(939),a=n(326);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:p,useRef:r,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf,u=e=>{e={onChange:null,otype:"post",poiCount:0,...e};const t=(0,a.useDebounce)(e.onChange,500),[n,p]=c({filters:[],isBusy:!0,open:null,selected:{}});function u(e){p((t=>({...t,...e})))}const m=r({});function g(e,o){let a=n.selected[e.key]?n.selected[e.key].values:null;if("checkbox"==e.format){var i;const e=null===(i=a)||void 0===i?void 0:i.indexOf(o);e>-1?a.splice(e,1):(a=a||[],a.push(o))}else a=o?[o]:[];a.length?n.selected[e.key]={key:e.key,values:a,meta_key:e.meta_key,meta_values:e.meta_values}:delete n.selected[e.key],u({selected:n.selected}),t(n.selected)}function d(e){u({open:n.open==e?null:e})}function f(e){e.key;const t=[...e.values],a=n.selected[e.key]?n.selected[e.key].values:"";switch(e.format){case"input":return i("input",{type:"text",value:a?a[0]:"",onChange:t=>g(e,t.target.value)});case"checkbox":return _.map(t,(t=>i("label",{key:t.value},i("input",{checked:null==a?void 0:a.includes(t.value),key:t.value,onChange:t=>g(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"radio":return"radio"==e.format&&t.unshift({value:"",label:__("All")}),_.map(t,(t=>i("label",{key:t.value},i("input",{checked:a==t.value||""==t.value&&!a,key:t.value,onChange:t=>g(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"select":t.unshift({value:"",label:""});const n=_.map(t,(e=>'<option value="'+e.value+'">'+e.label+"</option>"));return i("select",{value:a[0],dangerouslySetInnerHTML:{__html:n},onChange:t=>g(e,t.target.value)})}}function v(o){return i("div",{className:"mapp-filter-dropdown"},function(e){return i("div",{className:"mapp-filter-values"},"all"==e?n.filters.map((e=>i(l,{key:e.key},i("div",{className:"mapp-filter-label"},e.label),f(e)))):f(e))}(o),"all"==o&&function(n){const o="all"==n?"all":n.key;let a=e.poiCount>1?__("%d Results"):__("%d Result");return a=sprintf(a,e.poiCount),i("div",{className:"mapp-filter-toolbar"},i("div",{className:"mapp-link-button",onClick:()=>(u({selected:{}}),void t())},__("Reset")),i("div",{className:"mapp-filter-count"},a),i("div",{className:"mapp-submit-button",onClick:()=>d(o)},__("Done")))}(o))}function h(e){const t="all"==e?"all":e.key,o="all"==e?__("Filter"):e.label,a="mapp-filter mapp-filter-"+t+(n.open==t?" mapp-filter-open":"");return i("div",{key:t,className:a,ref:e=>m.current[t]=e},i("div",{className:"mapp-button mapp-button-caret mapp-filter-button"+(n.isBusy?" mapp-button-disabled":""),onClick:()=>d(t)},o),v(e))}return(0,a.useClickOutside)({current:n.open&&m.current[n.open]?m.current[n.open]:null},(()=>{u({open:null})})),s((()=>{u({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_filters_get",nonce:mappl10n.options.nonce,otype:e.otype},callback:e=>{e&&"OK"==e.status?u({filters:e.data}):console.error("MapPress: unable to fetch filter data"),u({isBusy:!1})}})}),[]),i("div",{className:"mapp-filters"},h("all"),_.map(n.filters,(e=>e.isStandalone?h(e):null)))}},10:(e,t,n)=>{"use strict";n.r(t),n.d(t,{useGeocoding:()=>u});const o=n(939).mappLib.toJSON,{Fragment:a,useCallback:i,useEffect:l,useLayoutEffect:s,useRef:p,useState:r}=(wp.element.createElement,wp.element),c={google:function(){this.token=null;const e=document.createElement("div");this.placesService=new google.maps.places.PlacesService(e),this.autocompleteService=new google.maps.places.AutocompleteService}};c.google.prototype={getDetails:function(e){let{suggestion:t,callback:n}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var a={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(a,(function(e,t){if("OK"==t&&e&&e.geometry){if(e.geometry.location&&(e.geometry.location=o(e.geometry.location)),e.geometry.viewport){var a=o(e.geometry.viewport);e.geometry.viewport={sw:{lat:a.south,lng:a.west},ne:{lat:a.north,lng:a.east}}}n(e)}else n(null)}))},getFirstPrediction:function(e){let{map:t,value:n,callback:o}=e;this.getPredictions({map:t,value:n,callback:e=>{e&&Array.isArray(e)?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:n,includeBusinesses:o,callback:a}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=t?t.getBounds():null;"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 l={input:n,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:o?null:["geocode"]};this.autocompleteService.getPlacePredictions(l,(function(e,t){"OK"==t&&e&&e.length?(e=(e=e.map((e=>(e.value=e.description,e)))).filter((e=>e.place_id)),a(e)):(t==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):t==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),a(null))}))}},c.mapbox=function(){},c.mapbox.prototype={getDetails:function(e){let{suggestion:t,callback:n}=e,o=t.place_name,a=o.indexOf(","),i=o.indexOf(",",a+1);a>0&&(o=parseInt(o.substr(0,a))?o.substr(0,i).replace(",",""):o.substr(0,a));let l=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;n({formatted_address:t.place_name,name:o,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:n,callback:o}=e;this.getPredictions({map:t,value:n,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:n,callback:o}=e;var a="https://api.mapbox.com/geocoding/v5/mapbox.places/"+n+".json?access_token="+mappl10n.options.mapbox;a=mappl10n.options.country?a+"&country="+mappl10n.options.country.toLowerCase():a,a=mappl10n.options.language?a+"&language="+mappl10n.options.language.toLowerCase():a;var i=t?t.getCenter():null;i&&(a+="&proximity="+i.lng+","+i.lat),mappl10n.options.searchBox&&(a+="&bbox="+mappl10n.options.searchBox),fetch(a).then((e=>e.json())).then((e=>{e&&e.features&&e.features.length>0?(e.features=e.features.map((e=>(e.value=e.label=e.place_name,e))),o(e.features)):o(null)}))}},c.nominatim=function(){},c.nominatim.prototype={getDetails:function(e){let{suggestion:t,callback:n}=e,o=t.display_name,a=o.indexOf(","),i=o.indexOf(",",a+1);a>0&&(o=parseInt(o.substr(0,a))?o.substr(0,i).replace(",",""):o.substr(0,a));let l=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;n({formatted_address:t.display_name,name:o,geometry:{location:{lat:t.lat,lng:t.lon},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:n,callback:o}=e;this.getPredictions({map:t,value:n,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:n,callback:o}=e;var a="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(n);if(a=mappl10n.options.country?a+"&countrycodes="+mappl10n.options.country.toLowerCase():a,a=mappl10n.options.language?a+"&accept-language="+mappl10n.options.language.toLowerCase():a,mappl10n.options.searchBox)a+="&viewbox="+mappl10n.options.searchBox,a+="&bounded=1";else{var i=t?t.getBounds():null;if(i){let e=i.getSouthWest(),t=i.getNorthEast();a+="&viewbox="+e.lng+","+e.lat+","+t.lng+","+t.lat}}fetch(a).then((e=>e.json())).then((e=>{e&&e.length?(e=e.map((e=>(e.value=e.display_name,e))),o(e)):o(null)}))}};const u=e=>{let{includeBusinesses:t}=e;function n(){let e="";return e="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new c[e]}function o(e,t){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){var n={lat:t.coords.latitude,lng:t.coords.longitude};e({name:n.lat+", "+n.lng,geometry:{location:n}})}),(function(n){if(!t){var o=n&&n.message?" : "+n.message:"";alert(mappl10n.no_geolocate+o)}e(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(e){let{map:a,suggestion:i,value:l,callback:s}=e;const p=n();l="string"==typeof l?l.trim():l,i||l?function(e){let{map:t,value:n,callback:a}=e;if(!n)return void a(null);if("string"!=typeof n){const e=n.lat&&n.lng?{geometry:{location:{lat:n.lat,lng:n.lng}}}:null;return void a(e)}if("http"==n.substring(0,4))return void a(n);if("user"==n)return void o((function(e){a(e)}));const i=n.split(",");if(2==i.length){const e=parseFloat(i[0]),t=parseFloat(i[1]);if(!isNaN(e)&&!isNaN(t))return void a({name:e+", "+t,geometry:{location:{lat:e,lng:t}}})}a(null)}({map:a,value:l,callback:e=>{e?s(e):i?p.getDetails({suggestion:i,callback:s}):p.getFirstPrediction({map:a,value:l,includeBusinesses:t,callback:s})}}):s(null)},geolocate:o,getPredictions:function(e){let{map:t,value:o,callback:a}=e;n().getPredictions({map:t,value:o,callback:a})}}}},326:(e,t,n)=>{"use strict";n.r(t),n.d(t,{useClickOutside:()=>c,useDebounce:()=>u,useResizeObserver:()=>m,useIntersectionObserver:()=>g,useTimeout:()=>d});wp.element.createElement;const{Fragment:o,useCallback:a,useEffect:i,useLayoutEffect:l,useMemo:s,useRef:p,useState:r}=wp.element;function c(e,t){i((()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}))}function u(e,t,n){const o=p(!1);i((()=>(o.current=!0,()=>o.current=!1)),[]);const l=_.debounce((function(){o.current&&e(...arguments)}),t);return a(l,n=n||[])}function m(e,t){const n=p();n.current=t,i((()=>{if(!e)return;const t=new ResizeObserver(((e,t)=>{n.current()}));return t.observe(e),()=>{t.disconnect()}}),[e])}function g(e){let{container:t,element:n,options:o,callback:a}=e;const l=p(null),s=p(null);s.current=a,i((()=>(!l.current&&n&&t&&(l.current=new IntersectionObserver((e=>{e[0].isIntersecting&&s.current()}),{...o,root:t}),l.current.observe(n)),()=>{l.current&&(l.current.disconnect(),l.current=null)})),[t,n])}function d(e,t){const n=React.useRef(null),o=React.useRef(e);return i((()=>{o.current=e}),[e]),i((()=>(t>0&&(n.current=window.setTimeout((()=>o.current()),t)),()=>{n.current&&window.clearTimeout(n.current)})),[t]),n}},939:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mappLib:()=>o,mappEvent:()=>a,mappPoi:()=>i});const o={ajax:function(e){if("POST"==(e={cache:"no-cache",credentials:"same-origin",data:null,method:e.method?e.method:"GET",mode:"cors",redirect:"follow",referrerPolicy:"no-referrer",responseType:"json",url:e.url?e.url:mappl10n.options.ajaxurl,...e}).method)if(e.data instanceof FormData)e.body=e.data;else{const t=new FormData;t.append("action",e.data.action),t.append("nonce",e.data.nonce),t.append("data",JSON.stringify(e.data)),e.body=t}else"GET"==e.method&&(e.url+="?"+o.jQueryParam(e.data));fetch(e.url,e).then((t=>{if("html"==e.responseType)return t.text();if(t.ok)return t.json();throw Error(`Request rejected with status ${t.status}`)})).then((t=>{e.url!=mappl10n.options.ajaxurl||t&&"OK"==t.status||o.alert(t.status),t.output&&o.alert("MapPress: invalid output from a plugin or theme file. Deactivate plugins to find the problem. Output:\r\n"+t.output),e.callback&&e.callback(t)})).catch((t=>{if(e.error)return void e.error();const n=void 0!==t.message?t.message:t.statusText;o.alert("AJAX error -- "+n)}))},alert:function(e){mappl10n.options.admin||mappl10n.options.debug?alert(e):window.console&&console.error(e)},boundsToViewport:function(e){return e?{sw:o.toJSON(e.getSouthWest()),ne:o.toJSON(e.getNorthEast())}:null},getIcon:function(e){{const t=this.getIconUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:t,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:t}}},getIconUrl:function(e){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"},jQueryParam:function(e){var t=[],n=function(e,n){n=null==(n="function"==typeof n?n():n)?"":n,t[t.length]=encodeURIComponent(e)+"="+encodeURIComponent(n)},o=function(e,a){var i,l,s;if(e)if(Array.isArray(a))for(i=0,l=a.length;i<l;i++)o(e+"["+("object"==typeof a[i]&&a[i]?i:"")+"]",a[i]);else if("[object Object]"===Object.prototype.toString.call(a))for(s in a)o(e+"["+s+"]",a[s]);else n(e,a);else if(Array.isArray(a))for(i=0,l=a.length;i<l;i++)n(a[i].name,a[i].value);else for(s in a)o(s,a[s]);return t};return o("",e).join("&")},nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;const t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let n="",o=e;for(;o--;)n+=t[64*Math.random()|0];return n},pointToLatLng:function(e){return e?"leaflet"==mappl10n.options.engine?L.latLng(e):new google.maps.LatLng(e.lat,e.lng):null},template:function(e,t){if(o.templates=o.templates?o.templates:{},!o.templates[e]){var n=document.getElementById("mapp-tmpl-"+e).innerHTML;if(!n)return"";o.templates[e]=_.template(n,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return o.templates[e](t)},toJSON:e=>e.toJSON?e.toJSON():"undefined"!=typeof L&&e instanceof L.LatLng?{lat:e.lat,lng:e.lng}:"undefined"!=typeof L&&L.LatLngBounds&&e instanceof L.LatLngBounds?{south:e.getSouth(),west:e.getWest(),north:e.getNorth(),east:e.getEast()}:null,toUrlValue(e){return e.toUrlValue?e.toUrlValue():"undefined"!=typeof L&&e instanceof L.LatLng?Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6:null},viewportToBounds:function(e){return e&&e.sw&&e.ne?"leaflet"==mappl10n.options.engine?new L.LatLngBounds(L.latLng(e.sw.lat,e.sw.lng),L.latLng(e.ne.lat,e.ne.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(e.sw.lat,e.sw.lng),new google.maps.LatLng(e.ne.lat,e.ne.lng)):null}},a={addListener:function(e,t,n){let o=[];t=t.split(" ");for(var a=0;a<t.length;a++)"leaflet"==mappl10n.options.engine?(e.on(t[a],n),o.push({target:e,event:t[a],callback:n})):o.push(google.maps.event.addListener(e,t[a],n));return o},addListenerOnce:function(e,t,n){t=t.split(" ");for(var o=0;o<t.length;o++)"leaflet"==mappl10n.options.engine?e.once(t[o],n):google.maps.event.addListenerOnce(e,t[o],n)},clearInstanceListeners:function(e){"leaflet"==mappl10n.options.engine?e.off():google.maps.event.clearInstanceListeners(e)},clearListeners:function(e,t){t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?e.off(t[n]):google.maps.event.clearListeners(e,t[n])},removeListener:function(e){for(let t=0;t<e.length;t++)"leaflet"==mappl10n.options.engine?e[t].target.off(e[t].event,e[t].callback):google.maps.event.removeListener(e[t])},trigger:function(e,t,n){"leaflet"==mappl10n.options.engine?e.fire(t,n):google.maps.event.trigger(e,t,n)}},i={parseOverlay:function(e,t){if("google"==mappl10n.options.engine){if("kml"==e){const e=t.getDefaultViewport();return{point:e?o.toJSON(e.getCenter()):null,viewport:e?o.boundsToViewport(e):null}}const n=t instanceof google.maps.Polyline?{strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,stokeWeight:t.strokeWeight}:{fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight};if("circle"==e)return{point:o.toJSON(t.getCenter()),poly:{radius:t.getRadius(),...n}};if("rectangle"==e)return{viewport:o.boundsToViewport(t.getBounds()),poly:{...n}};if("polyline"==e){const e=[];return t.getPath().forEach((function(t){e.push(o.toJSON(t))})),{poly:{path:e,...n}}}if("polygon"==e){const e={fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight},n=[];return t.getPaths().forEach((function(e){var t=[];e.forEach((function(e){t.push(o.toJSON(e))})),n.push(t)})),{poly:{paths:n,...e}}}if(!e)return{point:o.toJSON(t.getPosition())}}else{if("kml"==e){const e=t.getBounds();return{point:e&&e.isValid()?o.toJSON(e.getCenter()):null,viewport:e&&e.isValid()?o.boundsToViewport(e):null}}if(!e)return{point:"leaflet"==mappl10n.options.engine?o.toJSON(t.getLatLng()):o.toJSON(t.getPosition())}}}}},374:(e,t,n)=>{"use strict";n.r(t);var o=n(939),a=n(346);window.mapp=window.mapp||{};const i=wp.element.createElement;mapp.load=function(){const e=e=>{let{data:t,container:n}=e;t.pois&&t.pois.map((e=>{e.id=o.mappLib.nanoid()})),n?ReactDOM.render(i(a.MappMap,{...t,container:n}),n):console.log("Missing container for map "+t.name)};if(window.frameElement){const t=window.frameElement.id,n=window.parent.mapp.data;e({data:n?n.find((e=>e.name==t)):null,container:document.querySelector(".mapp-iframe-content")})}else if(mapp.data)for(;mapp.data.length;){const t=mapp.data.pop();e({data:t,container:document.getElementById(t.name)})}},mapp.load()},346:(t,n,o)=>{"use strict";o.r(n),o.d(n,{MappMap:()=>D});var a=o(939),i=o(715),l=(o(817),o(602)),s=o(818),p=o(81),r=o(50),c=o(615);const u=wp.element.createElement,{Fragment:m,useEffect:g,useLayoutEffect:d,useMemo:f,useRef:v,useState:h}=wp.element;function y(e){e={anchor:null,className:null,content:null,map:null,onMouseEnter:null,onMouseLeave:null,point:null,...e};const t=v(null),[n,o]=h({isLoaded:null,mapDiv:"leaflet"==mappl10n.options.engine?e.map.getContainer():e.map.getDiv(),overlayView:null});function i(e){o((t=>({...t,...e})))}function l(){const o=t.current;if(!o)return;if(document.fullscreenElement||e.map.isFullscreen)return;let i;const{width:l,height:s}=o.getBoundingClientRect(),p=a.mappLib.pointToLatLng(e.point);if("leaflet"==mappl10n.options.engine)i=e.map.latLngToContainerPoint(p);else{const e=n.overlayView.getProjection();if(!e)return;i=e.fromLatLngToContainerPixel(p)}o.style.bottom=n.mapDiv.clientHeight-i.y-e.anchor.y+"px",o.style.left=i.x-l/2+e.anchor.x+"px"}return d((()=>{"google"==mappl10n.options.engine?n.overlayView||(n.overlayView=new google.maps.OverlayView,n.overlayView.onAdd=function(){i({isLoaded:!0})},n.overlayView.setMap(e.map)):(e.map.stop(),i({isLoaded:!0}))}),[]),d((()=>{if(!n.isLoaded)return;let t;return"google"==mappl10n.options.engine?n.overlayView.draw=()=>l():t=a.mappEvent.addListener(e.map,"move",(e=>l())),()=>{"google"==mappl10n.options.engine?n.overlayView.draw=null:a.mappEvent.removeListener(t)}})),d((()=>{n.isLoaded&&(l(),function(){const o=t.current;if(!o)return;const i=30,l=o.offsetWidth,s=o.offsetHeight,p=n.mapDiv.clientWidth,r=n.mapDiv.clientHeight,c=a.mappLib.pointToLatLng(e.point);let u;if("leaflet"==mappl10n.options.engine)u=e.map.latLngToContainerPoint(c);else{const e=n.overlayView.getProjection();u=e?e.fromLatLngToContainerPixel(c):null}if(!u)return;var m={x:u.x,y:u.y};u.x+l/2+e.anchor.x>p-i?m.x=Math.max(p-l/2-e.anchor.x-i,p/2-e.anchor.x):u.x-l/2+e.anchor.x<i&&(m.x=Math.min(l/2+e.anchor.x+i,p/2-e.anchor.x));u.y+e.anchor.y-s<i&&(m.y=s-e.anchor.y+i);m.y>=r&&(m.y=r-i);const g={x:u.x-m.x,y:u.y-m.y};(g.x<=-1||g.x>=1||g.y<=-1||g.y>=1)&&("leaflet"==mappl10n.options.engine?e.map.panBy([g.x,g.y]):e.map.panBy(g.x,g.y))}())}),[n.isLoaded]),n.isLoaded?u("div",{className:"mapp-ib-wrapper",ref:t,onMouseEnter:()=>{e.onMouseEnter&&e.onMouseEnter()},onMouseLeave:()=>{e.onMouseLeave&&e.onMouseLeave()}},u("div",{className:"mapp-ib-content"},u("div",{className:"mapp-ib"},u("div",{className:"mapp-iw "+(e.className?e.className:"")},e.content)),u("div",{className:"mapp-ib-tip"}))):null}var b=o(892),w=o(10),k=o(326);const E=a.mappLib.toJSON,{Fragment:C,useCallback:O,useEffect:x,useLayoutEffect:M,useRef:N,useState:P}=wp.element,S=wp.element.createElement,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function D(t){t={alignment:null,center:null,centerPoi:null,classname:null,container:null,height:null,initialOpenInfo:null,isEditable:null,layers:null,layout:null,lines:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,oid:null,otype:null,onDragDrop:null,onDrawingEvent:null,onPoiChange:null,onPopupHover:null,onRenderPopup:null,onRenderSidebar:null,onSearch:null,onViewportChange:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,query:null,search:null,width:null,zoom:null,...t};const[n,o]=P({clusterer:null,directionsTo:null,drawingManager:null,filters:null,hovered:null,hoveredDelay:null,hoveredPopup:null,iframe:window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?window.frameElement:null,init:null,isDirectionsOpen:null,isFetching:null,isGeolocating:null,isHidden:!1,isLoaded:null,isMounted:null,isMini:null,isSidebarOpen:null!=t.poiListOpen?t.poiListOpen:mappl10n.options.poiListOpen,kmlEvent:null,layers:{},layout:t.layout?t.layout:mappl10n.options.layout,map:null,opened:null,oid:t.oid?t.oid:mappl10n.options.oid,otype:t.otype?t.otype:mappl10n.options.otype,page:1,pageCount:0,parsedCenter:null,poiList:void 0!==t.poiList&&null!=t.poiList?t.poiList:mappl10n.options.poiList,pois:[],polyline:null,templates:t.query?"user"==t.otype?{item:"user-mashup-item",popup:"user-mashup-popup"}:{item:"mashup-item",popup:"mashup-popup"}:{item:"map-item",popup:"map-popup"},userLocation:null}),u=N(null),m=N(t.container),{geocode:g,geolocate:d}=(N(),(0,w.useGeocoding)({withBusinesses:t.isEditable}));function f(e){o((t=>({...t,...e})))}(0,k.useResizeObserver)(m.current,(function(){const e=I();if(n.poiList&&"inline"!=n.layout&&m.current){const e=m.current.clientWidth<mappl10n.options.mini;null==n.isMini&&e&&f({isSidebarOpen:!1}),e!=n.isMini&&(f({isMini:e,isSidebarOpen:!e}),m.current&&m.current.classList.toggle("mapp-mini",e))}if(n.iframe&&"inline"==n.layout&&!e.height.includes("vh")){const e=m.current.getBoundingClientRect().height;n.iframe.parentElement.style.height=e+"px",t.container.style.height="auto"}})),(0,k.useResizeObserver)(u.current,U),x((()=>{switch(n.init){case null:!function(){const e=[__("MapPress FAQ")+": http://mappresspro.com/mappress-faq",__("Support")+": http://mappresspro.com/chris-contact",__("Get an API Key")+": https://mappresspro.com/how-to-get-a-google-maps-api-key"];let t=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:__("Leaflet library not loaded"),text:__("A theme or plugin is preventing the Leaflet library from loading.")},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:__("Google Maps API not loaded"),text:__("A theme or plugin is preventing Google Maps from loading.")},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:__("Google Maps API key required")},{condition:document.querySelectorAll('script[src*="https://maps.googleapis.com/maps/api/js?v="]').length>1,title:__("Google Maps API loaded multiple times"),text:__("A theme or plugin has loaded Google Maps twice")},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")}];t=t.filter((e=>e.condition));let n=t.map((e=>e.title+" : "+e.text));n.length&&(console.log(__("Map Error")+"\n----------------\n"+n.join("\n")+"\n----------------\n"+e.join("\n")),mappl10n.options.admin&&alert(__("Map error: please see the developer console (F12 in most browsers) for details.")))}();let e,o={...t.mapOpts};o.minZoom=isNaN(parseInt(o.minZoom))?0:parseInt(o.minZoom),"leaflet"==mappl10n.options.engine?(e=new L.Map(u.current,{attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null,...o}),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(e)):e=new google.maps.Map(u.current,{backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!t.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},...o}),f({map:e}),mappl10n.options.userLocation&&mappl10n.options.ssl&&d((e=>{e&&e.geometry&&e.geometry.location&&f({userLocation:e.geometry.location})}),!0),g({value:t.center,callback:e=>{e&&e.geometry&&e.geometry.location?f({parsedCenter:{lat:e.geometry.location.lat,lng:e.geometry.location.lng}}):f({parsedCenter:null}),f({init:1})}});break;case 1:ee(t.mapTypeId),function(){if(t.isEditable&&"google"==mappl10n.options.engine&&google.maps.drawing){const e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};n.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),n.drawingManager.setMap(n.map)}}(),function(){n.polyline&&("leaflet"==mappl10n.options.engine?n.polyline.remove():n.polyline.setMap(null),f({polyline:null}));if(t.isEditable||!t.lines&&!mappl10n.options.lines||n.pois.length<2)return;const e={...mappl10n.options.lineOpts},o=[];if(_.map(n.pois,(e=>{o.push(R(e))})),"leaflet"==mappl10n.options.engine)f({polyline:new L.Polyline(o,e).addTo(n.map)});else{const t={strokeColor:e.color,strokeWeight:e.weight,strokeOpacity:e.opacity};e.icons&&(_.map(e.icons,(e=>{e.icon.path=parseInt(e.icon.path)})),e.icons[0].repeat="50px"),f({polyline:new google.maps.Polyline({map:n.map,path:o,...e,...t})}),e.animate&&e.icons&&e.icons.length&&function(){let e=0;const t=n.polyline.get("icons");t[0].repeat.replace("%","").replace("px","");window.setInterval((()=>{e+=1;t[0].offset=e+(t[0].repeat.indexOf("%")>=0?"%":"px"),n.polyline.set("icons",t)}),20)}()}}(),t.query?v((()=>f({init:2}))):(f({pois:t.pois?t.pois:[]}),f({init:2}));break;case 2:const i="leaflet"==mappl10n.options.engine?"load":"tilesloaded";a.mappEvent.addListenerOnce(n.map,i,(()=>{f({bounds:M()}),function(){if(mappl10n.options.clustering&&!t.isEditable){let e,t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?(e=L.markerClusterGroup(t),n.map.addLayer(e)):(t={...t,imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"},e=new MarkerClusterer(n.map,[],t)),f({clusterer:e})}}(),(t.initialOpenInfo||mappl10n.options.initialOpenInfo)&&!t.isEditable&&n.pois&&n.pois.length&&H(n.pois[0]),f({isLoaded:!0})})),J()}}),[n.init]);(0,k.useTimeout)((()=>{f({hoveredDelay:0}),n.hoveredPopup||f({hovered:null})}),n.hoveredDelay);function v(e){}function h(e){return n.pois.find((t=>t.id==e))}function O(e){return n.map.fitBounds(e)}function M(){try{return n.map.getBounds()}catch(e){return null}}function D(){let e;try{e=n.map.getCenter()}catch(t){e=null}return e?E(e):null}function I(){if(t.embed)return{width:"100%",height:"100%"};const e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=e=>"string"==typeof e&&(e.indexOf("px")>=0||e.indexOf("%")>=0||e.indexOf("vh")>=0||e.indexOf("vw")>=0)?e:e+"px";return{width:t.width?n(t.width):n(e.width),height:t.height?n(t.height):n(e.height)}}function T(e){let t;switch("leaflet"==mappl10n.options.engine&&"kml"!=e.type?null:e.type){case"polygon":t=new google.maps.LatLngBounds,e.poly.paths.map((e=>{e.map((e=>{t.extend(e)}))}));break;case"polyline":t=new google.maps.LatLngBounds,e.poly.path.map((e=>{t.extend(e)}));break;case"circle":const n=new google.maps.Circle({center:e.point,radius:e.poly.radius});t=n.getBounds();break;default:t=a.mappLib.viewportToBounds(e.viewport)}return t}function R(e,t){if(e.point&&!e.type)return"leaflet"==mappl10n.options.engine?L.latLng(e.point):new google.maps.LatLng(e.point.lat,e.point.lng);if("kml"==e.type&&t&&t.latLng)return t.latLng;const n=T(e);return"leaflet"==mappl10n.options.engine?n&&n.isValid()?n.getCenter():new L.latLng(0,0):n?n.getCenter():new google.maps.LatLng(0,0)}function B(){let e;try{e=n.map.getZoom()}catch(t){e=null}return e?parseInt(e):null}function z(){return!!(t.isEditable||t.search||mappl10n.options.search&&t.query)}x((()=>{n.isLoaded&&!t.query&&f({pois:t.pois?t.pois:[]})}),[t.pois]),x((()=>{n.isLoaded&&t.query&&v()}),[t.query,n.filters]),x((()=>{n.isLoaded&&null==t.center&&J(null)}),[t.center]),x((()=>{n.isLoaded&&ee(t.mapTypeId)}),[t.mapTypeId]),x((()=>{n.isLoaded&&Z(t.centerPoi)}),[t.centerPoi]),x((()=>{if(!n.isLoaded)return;let e,o,i;return e=a.mappEvent.addListener(n.map,"moveend idle",(e=>A())),o=a.mappEvent.addListener(n.map,"click dragstart zoom_changed zoomstart",(e=>{"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||V()})),n.drawingManager&&(i=a.mappEvent.addListener(n.drawingManager,"overlaycomplete",(e=>{n.drawingManager.setDrawingMode(null),j(null),t.onDrawingEvent&&t.onDrawingEvent(e)}))),t.name&&(window[t.name]={getPois:()=>n.pois,poiOpen:e=>f({opened:"string"==typeof e?e:e.id})}),()=>{a.mappEvent.removeListener(e),a.mappEvent.removeListener(o),i&&a.mappEvent.removeListener(i)}}));const A=(0,k.useDebounce)((()=>{f({bounds:M(),page:1}),t.onViewportChange&&t.onViewportChange({center:D(),zoom:B()})}),500,[t.onViewportChange,n.map]);function F(e,n){if("poi"!=mappl10n.options.mashupClick&&t.query&&"post"==e.otype&&e.oid&&e.url)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":const t=document.createElement("div");return document.body.appendChild(t),ReactDOM.render(S(b.MappPopupModal,{onClose:()=>{wp.element.unmountComponentAtNode(t),t.remove()},poi:e}),t)}else H(e,n)}function V(){f({hovered:null,opened:null,isDirectionsOpen:!1})}function j(e,o){!t.isEditable&&mappl10n.options.tooltips&&(e&&e.id==n.opened||n.opened||f(e?{hovered:e.id,hoveredDelay:0}:o?{hoveredDelay:300}:{hovered:null,hoveredDelay:0}))}function H(e,t){V(),n.isMini&&W(!1),f({kmlEvent:t,opened:e.id})}function G(e){e?f({hoveredPopup:e.id,hoveredDelay:0}):(f({hoveredPopup:null}),n.hovered&&!n.opened&&f({hoveredDelay:300}))}function U(){"leaflet"==mappl10n.options.engine?n.map.invalidateSize():a.mappEvent.trigger(n.map,"resize"),0==m.current.offsetHeight?f({isHidden:!0}):n.isHidden&&(f({isHidden:!1}),J())}function W(e){f({isSidebarOpen:e=void 0!==e?e:!n.isSidebarOpen,isDirectionsOpen:!1}),setTimeout((()=>U()),100)}function J(e){e=null==e?n.parsedCenter:e;const o=t.zoom&&parseInt(t.zoom)?parseInt(t.zoom):null;if(e)return void te(e,o||1);if(0==n.pois.length)return void te({lat:0,lng:0},o||1);if(1==n.pois.length)return void Z(n.pois[0]);let a="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var i=0;i<n.pois.length;i++){var l=T(n.pois[i]);a=l?"leaflet"==mappl10n.options.engine?a.extend(l):a.union(l):a.extend(R(n.pois[i]))}o?te(E(a.getCenter()),o):O(a)}function Z(e){let n=null;if(t.zoom)n=parseInt(t.zoom);else if(mappl10n.options.poiZoom)n=parseInt(mappl10n.options.poiZoom);else if(e.viewport){var o=e.viewport.ne.lng-e.viewport.sw.lng;o<0&&(o+=360),n=Math.floor(Math.log(360*u.current.clientWidth/o/256)/Math.LN2)}te(R(e),n)}function q(){return mappl10n.options.ssl?S("div",{className:"mapp-"+mappl10n.options.engine+"-geolocate-wrapper"},S("div",{className:"mapp-geolocate-control",onClick:()=>(f({isGeolocating:!0}),void d((e=>{f({isGeolocating:!1}),e&&e.geometry&&e.geometry.location&&te(e.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1)),title:__("Your Location")})):null}function K(){if(z())return n.isLoaded?S("div",{className:"mapp-header"},z()&&n.map?S("div",{className:"mapp-search-container"},S(s.MappPlaces,{buttonLabel:t.isEditable?__("Add to map"):S("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:t.isEditable,includeBusinesses:t.isEditable,map:n.map,onSearch:e=>{t.onSearch?t.onSearch(e):function(e){if(!e||!e.geometry)return;const t=e.geometry.location?e.geometry.location:null,n=e.geometry.viewport?e.geometry.viewport:null;let o;if("leaflet"==mappl10n.options.engine){const e=new L.LatLng(t.lat,t.lng);o=n?new L.LatLngBounds(new L.LatLng(n.sw.lat,n.sw.lng),new L.LatLng(n.ne.lat,n.ne.lng)):e.toBounds(1e3*mappl10n.options.radius)}else{const e=new google.maps.Circle({center:t,radius:1e3*mappl10n.options.radius});o=n?new google.maps.LatLngBounds(new google.maps.LatLng(n.sw.lat,n.sw.lng),new google.maps.LatLng(n.ne.lat,n.ne.lng)).union(e.getBounds()):e.getBounds()}o&&O(o),te(t)}(e)}})):null,"top"==mappl10n.options.filtersPos&&null):S("div",{className:"mapp-header"})}function Y(){return S("div",{className:"mapp-content"},n.isFetching||n.isGeolocating?S(C,null,S("div",{className:"mapp-spinner-overlay"}),S("div",{className:"mapp-spinner"})):null,K(),S("div",{className:"mapp-main"},"inline"!=n.layout&&$(),S("div",{className:"mapp-canvas-panel"+("google"==mappl10n.options.engine?" mapp-google":" mapp-leaflet")},S("div",{className:"mapp-canvas",ref:u}),n.isLoaded&&n.userLocation?S(p.MappPoi,{isClusterable:!1,isEditable:!1,isOpen:!1,key:"user",map:n.map,poi:{point:n.userLocation,iconid:"geolocation"}}):null,function(){if(!n.isLoaded)return;return n.pois.map((o=>S(p.MappPoi,{key:o.id,isClusterable:!!n.clusterer&&!o.type,isEditable:!!t.isEditable,isHovered:o.id==n.hovered,isOpen:o.id==n.opened,map:n.map,onChange:e=>{t.onPoiChange&&t.onPoiChange(o.id,e)},onClick:e=>F(o,e),onClusterAdd:e=>function(e){n.clusterer&&("leaflet"==mappl10n.options.engine?n.clusterer.addLayer(e):n.clusterer.addMarker(e))}(e),onMouseOut:()=>{j(null,!0)},onMouseOver:()=>j(o),onRenderPopup:(o,a)=>function(o,a){const i=function(e){if(n.clusterer){if("leaflet"==mappl10n.options.engine){var t=n.clusterer.getVisibleParent(e);return t&&t!=e?t.getLatLng():null}const a=n.clusterer.getClusters();for(var o=0;o<a.length;o++){const t=a[o].markers_;if(t.length>1)for(let n=0;n<t.length;n++)if(t[n]==e)return a[o].center_}}}(a),l=R(o),s=E(i||l);let p,c,u={x:0,y:0};i?u={x:0,y:-14}:o.type||(u=mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32});n.kmlEvent&&(n.kmlEvent.pixelOffset&&(u={x:e.pixelOffset.width,y:e.pixelOffset.height}),n.kmlEvent.featureData?p=n.kmlEvent.featureData:n.kmlEvent&&n.kmlEvent.propagatedFrom&&n.kmlEvent.propagatedFrom.feature&&n.kmlEvent.propagatedFrom.feature.properties&&(p=n.kmlEvent.propagatedFrom.feature.properties));c=t.onRenderPopup?t.onRenderPopup(o,V):S(r.MappPoiContent,{context:"popup",feature:p,isEditable:t.isEditable,onDirectionsClick:()=>f({isDirectionsOpen:!0,directionsTo:o}),poi:o,template:n.templates.popup,thumbs:mappl10n.options.thumbsPopup});return S(y,{anchor:u,className:!t.isEditable&&mappl10n.options.thumbsPopup?"mapp-thumb-"+mappl10n.options.thumbsPopup:"",content:c,map:n.map,onMouseEnter:()=>G(o),onMouseLeave:()=>G(null),point:s})}(o,a),poi:o})))}(),t.isEditable||"leaflet"==mappl10n.options.engine||!n.map?null:S(l.MappMenuControl,{map:n.map,onCenter:()=>{V(),J()}}),q())),n.poiList&&"inline"!=n.layout&&n.isMini?S("div",{className:"mapp-footer"},!n.isSidebarOpen&&S("div",{className:"mapp-button mapp-view-list",onClick:()=>W(!0)},S("img",{src:mappl10n.options.baseurl+"/images/outline_format_list_bulleted_black_18dp.png"}),"List"),n.isSidebarOpen&&S("div",{className:"mapp-button mapp-view-map",onClick:()=>W(!1)},S("img",{src:mappl10n.options.baseurl+"/images/outline_map_black_18dp.png"}),"Map")):null)}function X(){const e=I(),t=n.iframe&&e.height.includes("vh")?{height:"100%"}:{paddingBottom:e.height};return S(C,null,S("div",{className:"mapp-wrapper",style:t},Y()),"inline"==n.layout&&$())}function Q(){if(!n.poiList||!n.isLoaded)return null;let e=[];return e=z()&&n.bounds&&!t.isEditable?n.pois.filter(((e,t)=>n.bounds.contains(R(e)))):n.pois,n.pageCount!=e.length&&f({pageCount:e.length}),S(c.MappPoiList,{className:!t.isEditable&&mappl10n.options.thumbsList?" mapp-thumb-"+mappl10n.options.thumbsList:"",hovered:n.hovered,isEditable:t.isEditable,isPaged:!!t.query,onClick:e=>F(h(e)),onDirectionsClick:e=>f({isDirectionsOpen:!0,directionsTo:h(e)}),onDragDrop:e=>{let{from:n,to:o}=e;return function(e,n){t.onDragDrop&&t.onDragDrop(e,n)}(n,o)},onMouseEnter:e=>j(h(e)),onMouseLeave:e=>j(null),onPage:e=>{f({page:e})},opened:n.opened,page:n.page,pois:e,template:t.isEditable?null:n.templates.item})}function $(){let e="mapp-sidebar";return e+="inline"==n.layout?" mapp-sidebar-inline":"",e+=n.isSidebarOpen?" mapp-sidebar-open":"",n.isDirectionsOpen?S("div",{className:e},function(){if(!n.isDirectionsOpen)return null;let e="";if(n.directionsTo)if(n.directionsTo.address)e=n.directionsTo.address;else{const t=E(R(n.directionsTo));e=t.lat+", "+t.lng}return S(i.MappDirections,{from:"",to:e,onClose:()=>{f({isDirectionsOpen:!1,directionsTo:null})}})}()):n.poiList?S("div",{className:e},S("div",{className:"mapp-sidebar-toggle",onClick:()=>W()}),"list"==mappl10n.options.filtersPos&&null,t.onRenderSidebar&&t.onRenderSidebar(),Q()):void 0}function ee(e){const t=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),o=_.find(t,(t=>t.id==e));!mappl10n.options.style||"roadmap"!=e&&"streets"!=e&&o||(e=mappl10n.options.style);let a=_.find(t,(t=>t.id==e));if(a=a||t[0],"leaflet"==mappl10n.options.engine){let e={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">&copy; Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">&copy; OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[a.provider],t={...e,...a};L.tileLayer(e.url,t).addTo(n.map)}else if(n.map.setMapTypeId("standard"==a.type?a.id:"roadmap"),a.json){let e=null;try{e=JSON.parse(a.json)}catch(e){console.log("Invalid JSON in map style")}n.map.setOptions({styles:e||null})}else n.map.setOptions({styles:null})}function te(e,t,o){"leaflet"==mappl10n.options.engine?(null==t&&(t=n.map.getZoom()?n.map.getZoom():0),n.map.setView(e,t,o)):(e=e&&!E(e)?{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}:e,t=t?parseInt(t):null,e&&n.map.setCenter(e),t&&n.map.setZoom(t))}return t.container?X():function(){const e=I();t.name&&t.name;let o="mapp-layout";o+="left"==n.layout?" mapp-list-left":" mapp-inline";const a=t.alignment?t.alignment:mappl10n.options.alignment;a&&!document.body.classList.contains("block-editor-page")&&(o+=" align"+a,o+=" mapp-align-"+a);let i="full"==t.alignment?{width:"auto"}:{width:e.width};return S("div",{className:o,style:i,ref:m,tabIndex:"-1"},X())}()}},759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mappMarker:()=>a});var o=n(939);function a(e){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(e),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove(),this.div=document.createElement("div"),this.div.classList.add("mapp-marker")}a.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let t=e.fromLatLngToDivPixel(this.position),n=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.left=t.x-n.width/2+"px",this.div.style.top=t.y-n.height+"px"}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(e){let t="on"+e.type[0].toUpperCase()+e.type.slice(1);this[t]&&this[t](e)},onAdd:function(){let e=this.overlayView.getPanes();e&&(this.div||(this.div=document.createElement("div"),this.div.classList.add("mapp-marker")),e.overlayMouseTarget.append(this.div),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div),this.div.addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&o.mappEvent.trigger(this,"click"),this.dragging=null})),this.div.addEventListener("mouseenter",this),this.div.addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(e){o.mappEvent.trigger(this,"mouseover")},onMouseleave:function(e){o.mappEvent.trigger(this,"mouseout")},onPointerdown:function(e){const t=this.map.getDiv().getBoundingClientRect(),n=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:e.clientX,y:e.clientY},offset:{x:n.x-(e.clientX-t.left),y:n.y-(e.clientY-t.top)}},this.toggleDragEvents(!0)},onPointermove:function(e){if(Math.abs(e.clientX-this.dragging.startPixel.x)+Math.abs(e.clientY-this.dragging.startPixel.y)<3)return;const t=this.map.getDiv().getBoundingClientRect();let n={x:e.clientX-t.left+this.dragging.offset.x,y:e.clientY-t.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(n)),this.draw(),this.dragging.moved=!0,o.mappEvent.trigger(this,"dragstart")},onPointercancel:function(e){this.onPointerup(e)},onPointerup:function(e){this.dragging&&this.dragging.moved&&o.mappEvent.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(e,t){let n="set"+e[0].toUpperCase()+e.slice(1);this[n]&&this[n](t)},setDraggable:function(e){this.draggable=e,this.map&&this.div&&(this.div.removeEventListener("pointerdown",this,{passive:!0}),e&&this.div.addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(e){if(void 0!==e&&(this.icon=e),this.icon&&this.div){let e='<img draggable="false" src="'+this.icon.url+'">';this.div.innerHTML=e;let t=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.width=t.width+"px",this.div.style.height=t.height+"px",this.setZIndex(),this.draw()}},setMap:function(e){this.map=e,this.overlayView.setMap(e)},setPosition:function(e){this.position=e},setValues:function(e){for(const t in e)this.set(t,e[t])},setVisible:function(e){this.visible=e,this.div&&(this.div.style.visibility=e?"visible":"hidden")},setZIndex:function(e){this.zIndex=void 0!==e?e:this.zIndex,this.div&&(this.div.style.zIndex=e)},toggleDragEvents(e){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),e&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},602:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappMenuControl:()=>c});var o=n(326);const a=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useRef:p,useState:r}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function c(e){e={layer:null,map:null,onCenter:null,...e};const[t,n]=r({activeLayer:e.layer?e.layer:null,layers:null,isOpen:!1}),s=p(null);function c(e){n((t=>({...t,...e})))}function u(){c({isOpen:!t.isOpen})}return(0,o.useClickOutside)(s,(()=>{t.isOpen&&u()})),l((()=>{if("google"==mappl10n.options.engine){c({layers:{traffic:{googleLayer:new google.maps.TrafficLayer,label:__("Traffic")},bicycling:{googleLayer:new google.maps.BicyclingLayer,label:__("Bicycling")},transit:{googleLayer:new google.maps.TransitLayer,label:__("Transit")}}})}}),[]),a("div",{ref:s},a("div",{className:"mapp-menu-toggle",onClick:()=>u()}),t.isOpen&&function(){const n=_.map(t.layers,((n,o)=>{const i=t.activeLayer==o?"mapp-menu-item mapp-active":"mapp-menu-item";return a("div",{className:i,key:o,onClick:()=>function(n){t.activeLayer&&t.layers[t.activeLayer].googleLayer.setMap(null),n!=t.activeLayer&&t.layers[n].googleLayer.setMap(e.map),c({activeLayer:n==t.activeLayer?null:n,isOpen:!1})}(o)},n.label)}));return a("div",{className:"mapp-menu"},a("div",{className:"mapp-menu-items"},a("div",{className:"mapp-menu-item",onClick:()=>(c({isOpen:!1}),void e.onCenter())},__("Center map")),"google"==mappl10n.options.engine&&a(i,null,a("div",{className:"mapp-menu-separator"}),n)),a("div",{className:"mapp-menu-footer"},a("a",{className:"mapp-menu-help",href:"https://mappresspro.com/mappress-documentation",target:"_blank"},a("span",null,__("Help")))))}())}},27:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPaginate:()=>r});const o=wp.element.createElement,{Fragment:a,useEffect:i,useLayoutEffect:l,useRef:s,useState:p}=wp.element,{sprintf}=wp.i18n;function r(e){function t(t,n){const o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.page<o&&e.onChange(e.page+1);break;case"prev":e.page>1&&e.onChange(e.page-1)}}return function(){const n=Math.ceil(e.count/e.pageSize),a=e.isBusy||e.page<=1,i=e.isBusy||e.page>=n,l=a?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",s=i?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",p=(r="%d of %d",wp.i18n.__(r,"mappress-google-maps-for-wordpress"));var r;return o("div",{className:"mapp-paginate"},o("div",{className:l,onClick:()=>{a||t("first")}},"«"),o("div",{className:l,onClick:()=>{a||t("prev")}},"‹"),o("div",{className:"mapp-paginate-count"},sprintf(p,e.page,n)),o("div",{className:s,onClick:()=>{i||t("next")}},"›"),o("div",{className:s,onClick:()=>{i||t("last")}},"»"))}()}},818:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPlaces:()=>m});var o=n(117),a=n(10);const i=wp.element.createElement,{Fragment:l,useCallback:s,useEffect:p,useLayoutEffect:r,useRef:c,useState:u}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function m(e){e={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...e};const{geocode:t,getPredictions:n}=(0,a.useGeocoding)({map:e.map,includeBusinesses:e.includeBusinesses}),[l,s]=u({suggestions:[]});return i(o.MappAutocomplete,{buttonLabel:e.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:e.focus,onFetch:function(t){n({map:e.map,value:t,callback:e=>{var t;t={suggestions:e},s((e=>({...e,...t})))}})},onSelect:function(n){let{suggestion:o,value:a}=n;t({map:e.map,suggestion:o,value:a,callback:t=>{t&&e.onSearch(t)}})},placeholder:__("Search"),suggestions:l.suggestions,title:__("Enter an address, place, KML file URL, or lat,lng")})}},50:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPoiContent:()=>u});var o=n(939);const a=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:p,useRef:r,useState:c}=wp.element;wp.i18n.sprintf;function u(e){e={context:null,feature:null,isEditable:null,onDirectionsClick:null,poi:null,template:null,thumbs:null,...e};const[t,n]=c({imageNumber:0});function l(e){n((t=>({...t,...e})))}return a(i,null,function(){const n="list"!=e.context&&mappl10n.options.thumbWidth&&mappl10n.options.thumbHeight?{width:mappl10n.options.thumbWidth+"px",height:mappl10n.options.thumbHeight+"px"}:null,o=e.thumbs&&e.poi.images&&e.poi.images.length&&e.poi.images[t.imageNumber]?e.poi.images[t.imageNumber]:null;if(!o)return null;const i=function(e){switch(e.type){case"avatar":return a("div",{className:"mapp-avatar",dangerouslySetInnerHTML:{__html:e.html}});case"embed":return a("div",{className:"mapp-embed",dangerouslySetInnerHTML:{__html:e.html}});default:if("image"==e.type||!e.type){const t=e.size?{src:e.url,width:e.size[0]+"px",height:e.size[1]+"px"}:{src:e.url};return a("img",t)}}}(o);return a("div",{className:"mapp-thumbnail",onClick:()=>function(t){e.isEditable||"popup"!=e.context||"embed"==t.type||e.poi.url&&window.open(e.poi.url,"_blank")}(o),style:n},t.imageNumber>=1&&a("div",{className:"mapp-gallery-previous",onClick:e=>function(e){t.imageNumber>0&&(l({imageNumber:t.imageNumber-1}),e.stopPropagation())}(e)}),i,t.imageNumber<e.poi.images.length-1&&a("div",{className:"mapp-gallery-next",onClick:n=>function(n){t.imageNumber<e.poi.images.length-1&&(l({imageNumber:t.imageNumber+1}),n.stopPropagation())}(n)}))}(),a("div",{className:"mapp-info"},function(){let t={...e.poi};t.icon=o.mappLib.getIconUrl(e.poi.iconid),e.feature&&(t.body=e.feature.description,t.title=e.feature.name),t.props=t.props?t.props:{};const n=o.mappLib.template(e.template,{poi:t});return a("div",{className:"mapp-template",dangerouslySetInnerHTML:{__html:n}})}(),function(){var t;if(!(e.template.indexOf("user")>=0))return"popup"==e.context&&mappl10n.options.directionsPopup||"list"==e.context&&mappl10n.options.directionsList?a("div",{className:"mapp-dir-wrapper"},a("span",{className:"mapp-dir",onClick:t=>function(t){t.stopPropagation(),e.onDirectionsClick()}(t)},(t="Get Directions",wp.i18n.__(t,"mappress-google-maps-for-wordpress")))):void 0}()))}},615:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPoiList:()=>g});var o=n(939),a=n(27),i=n(50);const l=wp.element.createElement,{Fragment:s,useEffect:p,useLayoutEffect:r,useMemo:c,useRef:u,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf;const g=wp.element.memo((function(e){e={className:null,hovered:null,isEditable:!1,isPaged:!1,onClick:null,onDragDrop:null,onMouseEnter:null,onMouseLeave:null,onPage:null,opened:null,page:1,pois:null,template:null,...e};const[t,n]=m({dragging:null,dragover:null,pageSize:!e.isEditable&&mappl10n.options.poiListPageSize?parseInt(mappl10n.options.poiListPageSize):20});function p(e){n((t=>({...t,...e})))}function r(n){let a,r="mapp-item";return e.opened!=n.id&&e.hovered!=n.id||(r+=" mapp-selected"),r+=t.dragover==n.id?" mapp-dragover":"",a=e.isEditable?l(s,null,l("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(n.iconid)}),l("div",{className:"mapp-title"},n.title)):l(i.MappPoiContent,{context:"list",onDirectionsClick:()=>e.onDirectionsClick(n.id),poi:n,template:e.template,thumbs:mappl10n.options.thumbsList}),l("div",{className:r,dangerouslySetInnerHTML:null,draggable:e.isEditable,key:n.id,onClick:()=>e.onClick(n.id),onDragOver:e=>e.preventDefault(),onDragStart:e=>p({dragging:n.id}),onDragEnter:e=>p({dragover:n.id}),onDragEnd:e=>p({dragging:null,dragover:null}),onDrop:o=>{return a=n.id,void(e.onDragDrop&&e.onDragDrop({from:t.dragging,to:a}));var a},onMouseEnter:t=>{e.onMouseEnter(n.id)},onMouseLeave:t=>{e.onMouseLeave(n.id)}},a)}return l("div",{className:"mapp-list "+(e.className?e.className:"")},e.isPaged&&function(){let t=1!=e.pois.length?__("%d Results"):__("%d Result");return t=sprintf(t,e.pois.length),l("div",{className:"mapp-list-header"},l("div",{className:"mapp-list-count"},t))}(),function(){const n=t.pageSize*(e.page-1),o=n+t.pageSize-1;return l("div",{className:"mapp-items",key:e.page},_.map(e.pois,((t,a)=>{if(!e.isPaged||a>=n&&a<=o)return r(t)})))}(),e.isPaged&&(!e.isPaged||e.pois.length<=t.pageSize?null:l("div",{className:"mapp-list-footer"},l(a.MappPaginate,{count:e.pois.length,onChange:t=>e.onPage(t),page:e.page,pageSize:t.pageSize}))))}))},81:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPoi:()=>u});var o=n(939),a=n(759);wp.element.createElement;const{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:p,useRef:r,useState:c}=wp.element;function u(e){e={isClusterable:null,isEditable:null,isHovered:null,isOpen:null,map:null,onClusterAdd:null,onMouseOut:null,onMouseOver:null,poi:null,...e};const t=r(null),[n,i]=c({overlay:null});function s(t){p()&&"google"==mappl10n.options.engine&&("rectangle"==e.poi.type&&(o.mappEvent.clearListeners(n.overlay,"bounds_changed"),t&&o.mappEvent.addListener(n.overlay,"bounds_changed",(()=>{u()}))),"circle"==e.poi.type&&(o.mappEvent.clearListeners(n.overlay,"center_changed radius_changed"),t&&o.mappEvent.addListener(n.overlay,"center_changed radius_changed",(()=>{u()}))),"polygon"!=e.poi.type&&"polyline"!=e.poi.type||(o.mappEvent.clearListeners(n.overlay,"rightclick"),o.mappEvent.clearListeners(n.overlay.getPath(),"insert_at remove_at set_at"),t&&(o.mappEvent.addListener(n.overlay,"rightclick",(e=>{null!=e.vertex&&n.overlay.getPath().getLength()>2&&(n.overlay.getPath().removeAt(e.vertex),u())})),o.mappEvent.addListener(n.overlay.getPath(),"insert_at remove_at set_at",(()=>{u()})))))}function p(){return"google"==mappl10n.options.engine&&-1!=["polyline","polygon","circle","rectangle"].indexOf(e.poi.type)}function u(){const t=o.mappPoi.parseOverlay(e.poi.type,n.overlay);e.onChange(t)}function m(t,n){n?"leaflet"==mappl10n.options.engine?t.addTo(e.map):t.setMap(e.map):"leaflet"==mappl10n.options.engine?t.remove():t.setMap(null)}return l((()=>{const n="leaflet"==mappl10n.options.engine&&"kml"!=e.poi.type?null:e.poi.type,l=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");let s;switch(n){case"polygon":s=new google.maps.Polygon({paths:e.poi.poly.paths,...l});break;case"polyline":s=new google.maps.Polyline({path:e.poi.poly.path,...l});break;case"circle":const t=new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng);s=new google.maps.Circle({center:t,radius:parseFloat(e.poi.poly.radius),...l});break;case"rectangle":s=new google.maps.Rectangle({bounds:o.mappLib.viewportToBounds(e.poi.viewport),...l});break;case"kml":const n=e.poi.kml&&e.poi.kml.url?e.poi.kml.url:"";s="leaflet"==mappl10n.options.engine?omnivore.kml(n):new google.maps.KmlLayer({url:n,preserveViewport:!0,suppressInfoWindows:!0});break;default:s="leaflet"==mappl10n.options.engine?L.marker([e.poi.point.lat,e.poi.point.lng]):new a.mappMarker({position:new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng)}),s.setIcon(o.mappLib.getIcon(e.poi.iconid))}var r;return r={overlay:s},i((e=>({...e,...r}))),"kml"!=e.poi.type&&("leaflet"==mappl10n.options.engine?s.options.draggable=e.isEditable:s.setDraggable(e.isEditable),p()&&s.setEditable(e.isEditable)),e.isClusterable?(e.onClusterAdd(s),"google"==mappl10n.options.engine&&m(s,e.map)):m(s,e.map),t.current=s,()=>{m(t.current,null)}}),[]),l((()=>{if(n.overlay){const t=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");n.overlay.setOptions({...t})}}),[e.poi.poly]),l((()=>{n.overlay&&n.overlay.setIcon(o.mappLib.getIcon(e.poi.iconid))}),[e.poi.iconid]),l((()=>{n.overlay&&function(t){if(e.poi.type)return;if("icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&e.isEditable)return;var a="leaflet"==mappl10n.options.engine?n.overlay._icon:n.overlay.getDiv();if(!a)return;switch(e.isEditable?"circle":mappl10n.options.highlight){case"circle":a.classList.toggle("mapp-marker-circle",t);break;case"icon":var i=t?o.mappLib.getIcon(mappl10n.options.highlightIcon):o.mappLib.getIcon(e.poi.iconid);if("leaflet"==mappl10n.options.engine&&n.overlay.getIcon().options.iconUrl==i.options.iconUrl)return;n.overlay.setIcon(i);break;case"scale":a.classList.add("mapp-marker"),a.classList.toggle("mapp-marker-scale",t)}const l=t?1e4:0;"leaflet"==mappl10n.options.engine?e.poi.type||n.overlay.setZIndexOffset(l):n.overlay.set("zIndex",l)}(e.isHovered||e.isOpen)}),[e.isHovered,e.isOpen,n.overlay]),l((()=>{if(n.overlay)return o.mappEvent.addListener(n.overlay,"click",(t=>{e.onClick(t)})),o.mappEvent.addListener(n.overlay,"mouseover",(t=>e.onMouseOver(t))),o.mappEvent.addListener(n.overlay,"mouseout",(t=>e.onMouseOut(t))),"kml"==e.poi.type&&("leaflet"==mappl10n.options.engine?(o.mappEvent.addListenerOnce(n.overlay,"ready",(()=>{n.overlayUpdate()})),o.mappEvent.addListenerOnce(n.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+e.poi.kml.url)}))):(o.mappEvent.addListener(n.overlay,"defaultviewport_changed",(()=>{u()})),o.mappEvent.addListener(n.overlay,"status_changed",(()=>{"OK"!=n.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+e.poi.kml.url)})))),e.isEditable&&(s(!0),o.mappEvent.addListener(n.overlay,"dragstart",(()=>(s(!1),void(e.onChange&&e.onChange({viewport:null}))))),o.mappEvent.addListener(n.overlay,"dragend",(()=>(u(),void s(!0))))),()=>{o.mappEvent.clearInstanceListeners(n.overlay)}})),e.isOpen||e.isHovered?e.onRenderPopup(e.poi,n.overlay):null}},892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappPopupModal:()=>u});var o=n(939);const a=wp.element.createElement,i=wp.element.createPortal,{Fragment:l,useEffect:s,useLayoutEffect:p,useRef:r,useState:c}=wp.element;function u(e){e={onClose:null,poi:null,...e};const[t,n]=c({isBusy:!1,html:null});function l(e){n((t=>({...t,...e})))}const p=React.createRef();function r(t){27==t.keyCode&&e.onClose()}return s((()=>(document.body.classList.add("mapp-modal-noscroll"),()=>document.body.classList.remove("mapp-modal-noscroll"))),[]),s((()=>{e.poi.oid&&(l({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_get_post",oid:e.poi.oid,nonce:mappl10n.options.nonce},responseType:"html",callback:e=>{l({isBusy:!1,html:e})}}))}),[e.poi.oid]),s((()=>{p.current&&p.current.focus(),console.log("focus"+document.activeElement)}),[p.current]),i(a("div",{className:"mapp-modal"},a("div",{className:"mapp-modal-backdrop",onClick:e.onClose,onKeyDown:r},a("div",{className:"mapp-modal-close",onClick:e.onClose},"×")),a("div",{className:"mapp-modal-content-wrapper",ref:p,onKeyDown:r,tabIndex:0},a("div",{className:"mapp-modal-content"},t.isBusy&&a("div",{className:"mapp-modal-spinner"}),!t.isBusy&&a("div",{className:"mapp-modal-template",dangerouslySetInnerHTML:{__html:t.html}}),a("div",{className:"mapp-modal-close",onClick:e.onClose},"X")))),document.body)}}},n={};function o(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(117),o(715),o(817),o(10),o(326),o(939),o(346),o(759),o(602),o(27),o(818),o(81),o(50),o(615),o(892),o(374)})();
build/index_mappress_admin.js CHANGED
@@ -1 +1 @@
1
- (()=>{var t={117:(e,t,a)=>{"use strict";a.d(t,{MappAutocomplete:()=>d});var o=a(326);const n=wp.element.createElement,{Fragment:i,useCallback:l,useEffect:s,useLayoutEffect:r,useMemo:p,useRef:c,useState:m}=wp.element;function d(e){e={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...e};const t=c(null),a=c(null),[i,l]=m({isOpen:!1,value:""});function r(e){l((t=>({...t,...e})))}(0,o.useClickOutside)(t,(()=>{i.isOpen&&r({isOpen:!1})})),s((()=>{e.focus&&a.current&&a.current.focus()}),[]),s((()=>{i.map&&setMapTypeId(e.mapTypeId)}),[e.mapTypeId,i.map]);const p=(0,o.useDebounce)((t=>{e.onFetch&&e.onFetch(t)}),e.delay);function d(){let t;r({isOpen:!1}),e.suggestions&&(t=null==i.selected?e.suggestions[0]:e.suggestions[i.selected]),e.onSelect({suggestion:t,value:u})}const u=i.selected>=0&&e.suggestions&&e.suggestions[i.selected]?e.suggestions[i.selected].value:i.value;return n("div",{className:"mapp-autocomplete",ref:t},n("div",{className:"mapp-autocomplete-wrapper"},n("input",{className:e.className,onChange:e=>{!function(e){r({value:e,selected:null}),p(e)}(e.target.value)},onKeyDownCapture:t=>function(t){switch(t.stopPropagation(),t.code){case"Backspace":r({isOpen:i.value.length>1});break;case"Enter":d();break;case"Escape":r({isOpen:!1});break;case"ArrowUp":if(t.preventDefault(),e.suggestions&&0!=i.selected){const t=null==i.selected?e.suggestions.length-1:i.selected-1;e.suggestions[t]&&r({isOpen:!0,selected:t})}else r({selected:null});break;case"ArrowDown":if(e.suggestions&&i.selected<e.suggestions.length-1){const t=null==i.selected?0:i.selected+1;e.suggestions[t]&&r({isOpen:!0,selected:t})}else r({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:r({isOpen:!0})}}(t),placeholder:e.placeholder,ref:a,title:e.title,type:"text",value:u}),i.isOpen&&function(){if(e.suggestions&&e.suggestions.length)return n("div",{className:"mapp-autocomplete-list"},_.map(e.suggestions,((t,a)=>{const o="mapp-autocomplete-item"+(i.selected==a?" mapp-selected":"");return n("div",{className:o,key:a,onClick:()=>function(t,a){r({isOpen:!1,selected:a}),e.onSelect({suggestion:t})}(t,a)},t.value)})))}()),e.buttonLabel&&n("div",{className:"mapp-submit-button",onClick:()=>d()},e.buttonLabel))}},715:(e,t,a)=>{"use strict";a.d(t,{MappDirections:()=>p});const o=wp.element.createElement,{Fragment:n,useEffect:i,useLayoutEffect:l,useRef:s,useState:r}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function p(e){e={from:null,onClose:null,to:null,...e};const[t,a]=r({from:e.from?e.from:"",to:e.to?e.to:""});function n(e){a((t=>({...t,...e})))}function l(){e.onClose&&e.onClose()}function s(){const e=t.from.trim(),a=t.to.trim();let o=mappl10n.options.directionsServer;o="https://maps.google.com"==o?"https://www.google.com":o,-1==o.toLowerCase().indexOf("http")&&(o="https://"+o),o+="/maps/dir/?api=1&origin="+encodeURIComponent(e)+"&destination="+encodeURIComponent(a),window.open(o),l()}function p(e){13==e?s():27==e&&l()}return i((()=>{"google"==mappl10n.options.directions&&s()}),[]),"google"==mappl10n.options.directions?null:o("div",{className:"mapp-directions"},o("div",{className:"mapp-close",onClick:()=>l()}),o("div",null,o("input",{className:"mapp-dir-from",onChange:e=>n({from:e.target.value}),onKeyPress:e=>p(e.which),tabIndex:"1",placeholder:__("My location"),value:t.from}),o("div",{className:"mapp-dir-arrows",onClick:()=>{n({from:t.to,to:t.from})}})),o("div",null,o("input",{className:"mapp-dir-to",onChange:e=>n({to:e.target.value}),onKeyPress:e=>p(e.which),tabIndex:"2",value:t.to})),o("div",{className:"mapp-dir-toolbar"},o("div",{className:"mapp-submit-button",onClick:()=>s()},__("Get Directions"))))}},817:(e,t,a)=>{"use strict";a.d(t,{MappFilters:()=>m});var o=a(939),n=a(326);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useRef:p,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf,m=e=>{e={onChange:null,otype:"post",poiCount:0,...e};const t=(0,n.useDebounce)(e.onChange,500),[a,r]=c({filters:[],isBusy:!0,open:null,selected:{}});function m(e){r((t=>({...t,...e})))}const d=p({});function u(e,o){let n=a.selected[e.key]?a.selected[e.key].values:null;if("checkbox"==e.format){var i;const e=null===(i=n)||void 0===i?void 0:i.indexOf(o);e>-1?n.splice(e,1):(n=n||[],n.push(o))}else n=o?[o]:[];n.length?a.selected[e.key]={key:e.key,values:n,meta_key:e.meta_key,meta_values:e.meta_values}:delete a.selected[e.key],m({selected:a.selected}),t(a.selected)}function g(e){m({open:a.open==e?null:e})}function h(e){e.key;const t=[...e.values],n=a.selected[e.key]?a.selected[e.key].values:"";switch(e.format){case"input":return i("input",{type:"text",value:n?n[0]:"",onChange:t=>u(e,t.target.value)});case"checkbox":return _.map(t,(t=>i("label",{key:t.value},i("input",{checked:null==n?void 0:n.includes(t.value),key:t.value,onChange:t=>u(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"radio":return"radio"==e.format&&t.unshift({value:"",label:__("All")}),_.map(t,(t=>i("label",{key:t.value},i("input",{checked:n==t.value||""==t.value&&!n,key:t.value,onChange:t=>u(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"select":t.unshift({value:"",label:""});const a=_.map(t,(e=>'<option value="'+e.value+'">'+e.label+"</option>"));return i("select",{value:n[0],dangerouslySetInnerHTML:{__html:a},onChange:t=>u(e,t.target.value)})}}function f(o){return i("div",{className:"mapp-filter-dropdown"},function(e){return i("div",{className:"mapp-filter-values"},"all"==e?a.filters.map((e=>i(l,{key:e.key},i("div",{className:"mapp-filter-label"},e.label),h(e)))):h(e))}(o),"all"==o&&function(a){const o="all"==a?"all":a.key;let n=e.poiCount>1?__("%d Results"):__("%d Result");return n=sprintf(n,e.poiCount),i("div",{className:"mapp-filter-toolbar"},i("div",{className:"mapp-link-button",onClick:()=>(m({selected:{}}),void t())},__("Reset")),i("div",{className:"mapp-filter-count"},n),i("div",{className:"mapp-submit-button",onClick:()=>g(o)},__("Done")))}(o))}function b(e){const t="all"==e?"all":e.key,o="all"==e?__("Filter"):e.label,n="mapp-filter mapp-filter-"+t+(a.open==t?" mapp-filter-open":"");return i("div",{key:t,className:n,ref:e=>d.current[t]=e},i("div",{className:"mapp-button mapp-button-caret mapp-filter-button"+(a.isBusy?" mapp-button-disabled":""),onClick:()=>g(t)},o),f(e))}return(0,n.useClickOutside)({current:a.open&&d.current[a.open]?d.current[a.open]:null},(()=>{m({open:null})})),s((()=>{m({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_filters_get",nonce:mappl10n.options.nonce,otype:e.otype},callback:e=>{e&&"OK"==e.status?m({filters:e.data}):console.error("MapPress: unable to fetch filter data"),m({isBusy:!1})}})}),[]),i("div",{className:"mapp-filters"},b("all"),_.map(a.filters,(e=>e.isStandalone?b(e):null)))}},10:(e,t,a)=>{"use strict";a.d(t,{useGeocoding:()=>m});const o=a(939).mappLib.toJSON,{Fragment:n,useCallback:i,useEffect:l,useLayoutEffect:s,useRef:r,useState:p}=(wp.element.createElement,wp.element),c={google:function(){this.token=null;const e=document.createElement("div");this.placesService=new google.maps.places.PlacesService(e),this.autocompleteService=new google.maps.places.AutocompleteService}};c.google.prototype={getDetails:function(e){let{suggestion:t,callback:a}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var n={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(n,(function(e,t){if("OK"==t&&e&&e.geometry){if(e.geometry.location&&(e.geometry.location=o(e.geometry.location)),e.geometry.viewport){var n=o(e.geometry.viewport);e.geometry.viewport={sw:{lat:n.south,lng:n.west},ne:{lat:n.north,lng:n.east}}}a(e)}else a(null)}))},getFirstPrediction:function(e){let{map:t,value:a,callback:o}=e;this.getPredictions({map:t,value:a,callback:e=>{e&&Array.isArray(e)?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:a,includeBusinesses:o,callback:n}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=t?t.getBounds():null;"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 l={input:a,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:o?null:["geocode"]};this.autocompleteService.getPlacePredictions(l,(function(e,t){"OK"==t&&e&&e.length?(e=(e=e.map((e=>(e.value=e.description,e)))).filter((e=>e.place_id)),n(e)):(t==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):t==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),n(null))}))}},c.mapbox=function(){},c.mapbox.prototype={getDetails:function(e){let{suggestion:t,callback:a}=e,o=t.place_name,n=o.indexOf(","),i=o.indexOf(",",n+1);n>0&&(o=parseInt(o.substr(0,n))?o.substr(0,i).replace(",",""):o.substr(0,n));let l=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;a({formatted_address:t.place_name,name:o,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:a,callback:o}=e;this.getPredictions({map:t,value:a,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:a,callback:o}=e;var n="https://api.mapbox.com/geocoding/v5/mapbox.places/"+a+".json?access_token="+mappl10n.options.mapbox;n=mappl10n.options.country?n+"&country="+mappl10n.options.country.toLowerCase():n,n=mappl10n.options.language?n+"&language="+mappl10n.options.language.toLowerCase():n;var i=t?t.getCenter():null;i&&(n+="&proximity="+i.lng+","+i.lat),mappl10n.options.searchBox&&(n+="&bbox="+mappl10n.options.searchBox),fetch(n).then((e=>e.json())).then((e=>{e&&e.features&&e.features.length>0?(e.features=e.features.map((e=>(e.value=e.label=e.place_name,e))),o(e.features)):o(null)}))}},c.nominatim=function(){},c.nominatim.prototype={getDetails:function(e){let{suggestion:t,callback:a}=e,o=t.display_name,n=o.indexOf(","),i=o.indexOf(",",n+1);n>0&&(o=parseInt(o.substr(0,n))?o.substr(0,i).replace(",",""):o.substr(0,n));let l=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;a({formatted_address:t.display_name,name:o,geometry:{location:{lat:t.lat,lng:t.lon},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:a,callback:o}=e;this.getPredictions({map:t,value:a,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:a,callback:o}=e;var n="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(a);if(n=mappl10n.options.country?n+"&countrycodes="+mappl10n.options.country.toLowerCase():n,n=mappl10n.options.language?n+"&accept-language="+mappl10n.options.language.toLowerCase():n,mappl10n.options.searchBox)n+="&viewbox="+mappl10n.options.searchBox,n+="&bounded=1";else{var i=t?t.getBounds():null;if(i){let e=i.getSouthWest(),t=i.getNorthEast();n+="&viewbox="+e.lng+","+e.lat+","+t.lng+","+t.lat}}fetch(n).then((e=>e.json())).then((e=>{e&&e.length?(e=e.map((e=>(e.value=e.display_name,e))),o(e)):o(null)}))}};const m=e=>{let{includeBusinesses:t}=e;function a(){let e="";return e="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new c[e]}function o(e,t){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){var a={lat:t.coords.latitude,lng:t.coords.longitude};e({name:a.lat+", "+a.lng,geometry:{location:a}})}),(function(a){if(!t){var o=a&&a.message?" : "+a.message:"";alert(mappl10n.no_geolocate+o)}e(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(e){let{map:n,suggestion:i,value:l,callback:s}=e;const r=a();l="string"==typeof l?l.trim():l,i||l?function(e){let{map:t,value:a,callback:n}=e;if(!a)return void n(null);if("string"!=typeof a){const e=a.lat&&a.lng?{geometry:{location:{lat:a.lat,lng:a.lng}}}:null;return void n(e)}if("http"==a.substring(0,4))return void n(a);if("user"==a)return void o((function(e){n(e)}));const i=a.split(",");if(2==i.length){const e=parseFloat(i[0]),t=parseFloat(i[1]);if(!isNaN(e)&&!isNaN(t))return void n({name:e+", "+t,geometry:{location:{lat:e,lng:t}}})}n(null)}({map:n,value:l,callback:e=>{e?s(e):i?r.getDetails({suggestion:i,callback:s}):r.getFirstPrediction({map:n,value:l,includeBusinesses:t,callback:s})}}):s(null)},geolocate:o,getPredictions:function(e){let{map:t,value:o,callback:n}=e;a().getPredictions({map:t,value:o,callback:n})}}}},286:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappAttachControl:()=>u});const o=wp.element.createElement,{addQueryArgs:n}=wp.url,{useCallback:i,useEffect:l,useState:s}=wp.element,{Button:r,Dashicon:p,Dropdown:c,Spinner:m,TextControl:d}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function u(e){const[t,a]=s({isFetching:!1,isOpen:!1,results:[],search:"",searchTerm:""});function r(e){a((t=>({...t,...e})))}l((()=>{r({isFetching:!0}),wp.apiFetch({path:n("/wp/v2/search",{search:t.search,per_page:20})}).then((e=>{r({results:e,isFetching:!1})}))}),[t.search]);const p=i(_.debounce((function(e){r({search:e})}),1e3),[]);function u(a,n){return o("div",{className:"mapp-attach-control"},o("div",{className:"mapp-attach-control-toolbar"},o(d,{autoComplete:"false",value:t.searchTerm,onChange:e=>function(e){r({searchTerm:e}),p(e)}(e),placeholder:__("Search")})),function(){if(t.isFetching)return o(m,null);if(t.results)return t.results.length?o("div",{className:"mapp-attach-items"},t.results.map((t=>o("div",{key:t.id,className:"mapp-attach-item",onClick:()=>{e.onChange(t.id,t.title)}},o("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),o("div",{className:"mapp-attach-item-type"},t.subtype))))):o("div",{},__("No posts found"))}())}return o("div",{className:"mapp-attach-control",onClick:e=>e.stopPropagation()},o(c,{renderToggle:e=>{let{isOpen:t,onToggle:a}=e;return o("a",{href:"#",onClick:a},__("Attach map to post"))},renderContent:e=>{let{isOpen:t,onToggle:a}=e;return u()}}))}},569:(e,t,a)=>{"use strict";a.r(t);var o=a(185);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useRef:r,useState:p}=wp.element,{Button:c,Dashicon:m,Modal:d}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function u(e){const[t,a]=p({isOpen:!0,mapid:null});function l(e){a((t=>({...t,...e})))}function s(){const e="undefined"!=typeof tinyMCE&&tinyMCE?tinyMCE.get("content"):null,t=e&&e.selection?e.selection.getSel():null;if(!t||void 0===t.anchorOffset||!t.anchorNode||!t.anchorNode.data)return null;let a=null,o=t.anchorNode.data,n=-1;for(let e=t.anchorOffset-1;e>=0;e--){let t=o[e];if("["==t){n=e;break}if("]"==t||"<"==t||">"==t)break}return n>=0&&(a=wp.shortcode.next("mappress",o,n),a)?a.shortcode.attrs.named.mapid:null}return n(i,null,n("button",{className:"button",type:"button",onClick:e=>{e.preventDefault(),l({isOpen:!0,mapid:s()})}},n(m,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&n(o.MappPicker,{context:"mce",mapid:t.mapid,onClose:()=>{l({isOpen:!1,mapid:null})},onInsert:e=>function(e){l({isOpen:!1});var t='[mappress mapid="'+e+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(t)}(e)}))}document.addEventListener("click",(e=>{e.target.classList.contains("mapp-classic-button")&&wp.element.render(n(u),e.target.parentElement)}))},107:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappColorPicker:()=>O});var o=a(577);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:m}=wp.data,{withState:d}=wp.compose,{Button:u,ColorPalette:g,ColorPicker:h,Dashicon:f,Dropdown:b,ExternalLink:v,Modal:y,Panel:k,PanelBody:w,PanelRow:C,Popover:x,RadioControl:N,Spinner:S,TabPanel:L}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function O(e){e={isExtended:null,onChange:null,color:null,opacity:null,weight:null,...e};const[t,a]=c({color:e.color,isCustomOpen:!1,isOpen:!1,opacity:e.opacity?e.opacity:1,weight:e.weight?e.weight:2});function s(e){a((t=>({...t,...e})))}function r(){s({isOpen:!1})}function p(a){s({color:a,isOpen:!1}),e.onChange({color:a,opacity:t.opacity,weight:t.weight})}return l((()=>{}),[]),n(i,null,n("span",{className:"mapp-colors-toggle",onClick:()=>{s({isOpen:!0})},style:{backgroundColor:e.color,border:e.isExtended?"1px solid "+e.color:"1px solid gray",opacity:e.isExtended&&e.opacity?e.opacity:1},tabIndex:0}),function(){if(!t.isOpen)return null;const a=_.map([1,.9,.8,.7,.6,.5,.4,.3,.2,.1,0],(e=>({label:100*e+"%",value:e}))),i=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(e=>({label:e+"px",value:e})));return n(y,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:()=>r()},n("div",{className:"mapp-colors"},n("div",{className:"mapp-colors-list"},_.map([["yellow","yellowgreen","green","seagreen","blue","cornflowerblue","darkslateblue","purple","firebrick","red","darkorange","orange","saddlebrown"],["lightyellow","greenyellow","lightgreen","darkseagreen","lightblue","skyblue","slateblue","orchid","plum","pink","sandybrown","goldenrod","peru"],["white","lightgray","gray","black"]],((t,a)=>n("div",{key:a},_.map(t,(t=>n("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:()=>{s({isCustomOpen:!1}),p(t)},style:{backgroundColor:t},title:t}))))))),t.isCustomOpen&&n(h,{color:e.color,onChangeComplete:e=>p(e.hex),disableAlpha:!0}),e.isExtended&&n(o.Select,{label:__("Opacity"),options:a,value:t.opacity,onChange:a=>{return s({opacity:o=a}),void e.onChange({color:t.color,opacity:o,weight:t.weight});var o}}),e.isExtended&&n(o.Select,{label:__("Stroke"),options:i,value:e.weight?e.weight:"",onChange:a=>{return s({weight:o=a}),void e.onChange({color:t.color,opacity:t.opacity,weight:o});var o}}),n("div",{className:"mapp-colors-toolbar"},n(u,{isPrimary:!0,onClick:()=>r()},__("Done")),n(u,{onClick:()=>s({isCustomOpen:!t.isCustomOpen})},__("Custom color")))))}())}},946:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>d});a(577);var o=a(939);const{Button:n}=wp.components,i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useCallback:p,useRef:c,useState:m}=wp.element,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){const[t,a]=m({error:"",isBusy:!1,isComplete:!1});function l(e){a((t=>({...t,...e})))}return i("div",{className:""},i(n,{isPrimary:!0,disabled:t.isComplete||t.isBusy,isBusy:t.isBusy,onClick:()=>{t.isBusy||(l({isBusy:!0}),o.mappLib.ajax({method:"POST",data:{action:"mapp_upgrade",nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status?l({isBusy:!1,isComplete:!0,error:null}):l({isBusy:!1,isComplete:!0,error:e.status})}}))}},__("Upgrade")),function(){if(t.isComplete)return t.error?i("div",{className:""},i("div",{className:"mapp-upgrade-error"},__("Error during update! Please contact support."),i("div",{className:""},t.error))):i("div",{className:"mapp-upgrade-success"},__("Success! Database updated."))}())}const u=document.getElementById("mapp-db-upgrade");u&&wp.element.render(i(d,null),u)},972:()=>{const e=wp.element.createElement,{Fragment:t,useEffect:a,useLayoutEffect:o,useRef:n,useState:i}=wp.element,{Button:l,Modal:s}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(t){const[o,n]=i({isOpen:!1,reason:"",reasonText:"",redirectUrl:null});function r(e){n((t=>({...t,...e})))}function p(e,t){switch(e){case"cancel":r({isOpen:!1});break;case"submit":r({isOpen:!1}),window.location.href=o.redirectUrl+"&mapp_reason="+o.reason+"&mapp_reason_text="+encodeURIComponent(o.reasonText.trim())}}return a((()=>{const e=document.getElementById("deactivate-mappress-google-maps-for-wordpress");if(!e)return;const t=e.addEventListener("click",(e=>{!function(e){const t=e?e.href:null;t&&r({isOpen:!0,redirectUrl:t})}(e.target),e.stopPropagation(),e.preventDefault()}));return()=>{e.removeEventListener("click",t)}}),[]),o.isOpen?e(s,{isDismissible:!0,onRequestClose:()=>p("cancel"),shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:__("Feedback")},function(){const t=!o.reason||"other"==o.reason&&!o.reasonText;return sprintf("<a href='https://mappresspro.com/chris-contact' target='_blank'>%s</a>",__("contact me")),e("div",{className:"mapp-deactivate"},e("div",{className:"mapp-deactivate-content"},e("h2",null,__("Sorry to see you go! Need help?"),e(l,{className:"mapp-deactivate-help",isSecondary:!0,href:"https://mappresspro.com/chris-contact",target:"_blank"},__("Contact me"))),e("h2",null,__("If not, I'd really appreciate some feedback:")),function(){const t=[{value:"badday",label:__("I don't want to say")},{value:"noapikey",label:__("I didn't want to set up an API key")},{value:"nodisplay",label:__("The map didn't display")},{value:"noaddress",label:__("My address wasn't found")},{value:"uglymap",label:__("The map looked too plain")},{value:"toohard",label:__("Too hard to use"),placeholder:__("What was too hard?")},{value:"feature",label:__("Missing feature"),placeholder:__("What's missing?")},{value:"other",label:__("Other"),placeholder:__("Can you provide any details?")}];return e("div",{className:"mapp-deactivate-reasons"},_.map(t,(t=>{const a=t.value==o.reason;return e("div",{className:"mapp-deactivate-reason",key:t.value},e("label",null,e("input",{checked:a,onChange:e=>r({reason:e.target.value}),type:"radio",value:t.value}),t.label),a&&t.placeholder&&e("div",null,e("textarea",{onChange:e=>r({reasonText:e.target.value}),placeholder:t.placeholder,value:o.reasonText})))})))}()),e("div",{className:"mapp-deactivate-footer"},e(l,{isSecondary:!0,disabled:t,onClick:()=>p("submit")},__("Deactivate")),e(l,{isPrimary:!0,onClick:()=>p("cancel")},__("Cancel"))))}()):null}document.addEventListener("DOMContentLoaded",(()=>{const t=document.createElement("div");wp.element.render(e(r),t)}))},800:(e,t,a)=>{"use strict";a.r(t);var o=a(185);wp&&wp.plugins&&wp.plugins.registerPlugin&&wp.editPost&&wp.plugins.registerPlugin("mappress-document-settings-panel",{render:function(){const{PluginDocumentSettingPanel:e}=wp.editPost,t=wp.element.createElement,{Fragment:a,useEffect:n,useLayoutEffect:i,useRef:l,useState:s}=wp.element,{Button:r,Spinner:p}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),[c,m]=s({isFetchingItems:!0,isPickerOpen:!1,items:null,pickerMapid:null,pickerMode:"list"});function d(e){m((t=>({...t,...e})))}function u(e){let a=e.title?e.title:__("Untitled");return t("div",{className:"mapp-document-item",key:e.mapid+e.otype+e.oid},t("a",{className:"mapp-document-col-title",href:"#",onClick:t=>{d({isPickerOpen:!0,pickerMapid:e.mapid,pickerMode:"edit"})}},a),t("div",{className:"mapp-document-col-mapid"},e.mapid))}return n((()=>{const e=e=>{d({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)})),n((()=>{mapp.store.fetchItems()}),[]),t(e,{title:"MapPress",className:"mapp-document-panel"},function(){const e=_.filter(c.items,(e=>"post"==e.otype&&e.oid==mappl10n.options.oid));let o;return o=c.isFetchingItems?t(p,null):e.length?t(a,null,t("div",{className:"mapp-document-header"},t("div",{className:"mapp-document-col-title"},__("Map title")),t("div",{className:"mapp-document-col-mapid"},null,__("Map ID"))),_.map(e,u)):t("div",{className:"mapp-document-message"},__("No maps found")),t("div",null,t("div",{className:"mapp-document-list"},o))}(),t(r,{icon:"portfolio",isSecondary:!0,onClick:()=>{d({isPickerOpen:!0,pickerMode:"list"})}},__("Open map library")),function(){if(c.isPickerOpen)return t(o.MappPicker,{mapid:c.pickerMapid,mode:c.pickerMode,onClose:()=>{d({isPickerOpen:!1,pickerMapid:null})},onInsert:e=>function(e){const t=wp.blocks.createBlock("mappress/map",{mapid:e});wp.data.dispatch("core/block-editor").insertBlock(t,0),d({isPickerOpen:!1,pickerMapid:null})}(e)})}())},icon:null})},68:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappEdit:()=>A});var o=a(107),n=a(641);const i=wp.element.createElement,{Button:l,Dashicon:s,Icon:r,Spinner:p}=wp.components,{useSelect:c}=wp.data,{Fragment:m,useEffect:d,useLayoutEffect:u,useRef:g,useState:h}=wp.element,{MediaUpload:f}=wp.mediaUtils,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function b(e){e={poi:null,onChange:null,onClose:null,onDelete:null,onSave:null,...e};const t="mapp-poi-body",a=g(null),[s,r]=h({images:e.poi.images?e.poi.images:[],isBusy:!1,title:e.poi.title,isVisual:!0});function p(e){r((t=>({...t,...e})))}function c(e){e?tinyMCE.execCommand("mceAddEditor",!1,t):tinyMCE.execCommand("mceRemoveEditor",!1,t)}function u(){return["circle","polyline","polygon","rectangle"].includes(e.poi.type)}function b(){e.onChange({images:s.images,body:tinymce&&tinymce.get(t)?tinymce.get(t).getContent():a.current.value,title:s.title}),e.onClose()}function y(e){return i("div",{className:"mapp-poi-image",key:e.id?e.id:e.url},"embed"==e.type&&i(v,{url:e.url}),"embed"!=e.type&&i("img",{src:e.url}),i("div",{className:"mapp-poi-image-delete",onClick:()=>function(e){const t=s.images.findIndex((t=>t.url==e));t>=0&&(s.images.splice(t,1),p({images:s.images}))}(e.url)},"X"))}return d((()=>(function(){if("undefined"==typeof tinyMCE||void 0===tinyMCE.init)return;var e="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var t=window.tinyMCEPreInit.mceInit.content;e=void 0!==t.language?t.language:"en"}var a={mode:"none",height:"100%",convert_urls:!1,language:e,menubar:!1,plugins:"image,paste,textcolor,wordpress,wpeditimage,wplink,wpview",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(a)}(),()=>{c(!1)})),[]),d((()=>{s.isVisual?c(!0):c(!1)}),[s.isVisual]),i(m,null,i("div",{className:"mapp-poi-header"},i("input",{className:"mapp-poi-title",value:s.title,onChange:e=>{p({title:e.target.value})},onKeyDown:e=>function(e){13==e.keyCode&&(b(),e.stopPropagation(),e.preventDefault())}(e)}),u(s.type)?null:i(n.MappIconPicker,{iconid:e.poi.iconid,onChange:t=>{e.onChange({iconid:t})}}),function(){var t,a,n,l,s,r;const p=e.poi;return u(p.type)?i(o.MappColorPicker,{color:"polyline"==p.type?null===(t=p.poly)||void 0===t?void 0:t.strokeColor:null===(a=p.poly)||void 0===a?void 0:a.fillColor,opacity:"polyline"==p.type?null===(n=p.poly)||void 0===n?void 0:n.strokeOpacity:null===(l=p.poly)||void 0===l?void 0:l.fillOpacity,weight:"polyline"==p.type?null===(s=p.poly)||void 0===s?void 0:s.strokeWeight:null===(r=p.poly)||void 0===r?void 0:r.strokeWeight,isExtended:!0,onChange:t=>{let{color:a,opacity:o,weight:n}=t;const i="polyline"==e.poi.type?{strokeColor:a,strokeOpacity:o,strokeWeight:n}:{fillColor:a,fillOpacity:o,strokeColor:a,strokeWeight:n,strokeOpacity:1};e.onChange({poly:{...e.poi.poly,...i}})}}):null}()),function(){const o="mapp-mce-visual"+(s.isVisual?" mapp-active":""),n="mapp-mce-html"+(s.isVisual?"":" mapp-active");return i(m,null,i("div",{className:"mapp-mce-toolbar"},i("div",{className:"mapp-mce-tabs"},i("a",{className:o,onClick:()=>p({isVisual:!0})},__("Visual"))," | ",i("a",{className:n,onClick:()=>p({isVisual:!1})},__("HTML"))),i("a",{href:"#",className:"insert-media add_media","data-editor":t},__("Add Media"))),i("div",{className:"mapp-mce-main"},i("textarea",{defaultValue:e.poi.body,id:t,ref:a,style:{height:"100%"}})))}(),"kml"==e.poi.type&&i("div",{className:"mapp-poi-kml"},i("span",null,__("KML")+" : "),i("a",{href:e.poi.kml.url,target:"_blank"},e.poi.kml.url)),s.images?i("div",{className:"mapp-poi-images"},s.images.map((e=>y(e)))):null,i("div",{className:"mapp-poi-toolbar"},i("div",null,i(l,{isPrimary:!0,onClick:()=>b()},__("Save")),i(l,{isSecondary:!0,onClick:()=>e.onClose()},__("Cancel"))),i("div",null,i(f,{allowedTypes:["image","video"],autoOpen:!0,gallery:!0,multiple:!0,onClose:()=>{p({images:s.images})},onSelect:e=>{return t=e,t=Array.isArray(t)?t:[t],void p({images:_.map(t,(e=>({id:e.id,url:e.url})))});var t},type:"image",value:s.images?s.images.map((e=>e.id)):[],render:e=>{let{open:t}=e;return i(l,{isSecondary:!0,onClick:t},__("Images"))}}),i(l,{isSecondary:!0,onClick:()=>function(){const e=prompt(__("Video URL"));if(e){let t=s.images?[...s.images]:[];t.push({type:"embed",url:e}),p({images:t})}}()},__("Video")),i(l,{isDestructive:!0,onClick:()=>e.onDelete()},__("Delete")))))}function v(e){e={url:null,...e};const{html:t}=c((t=>{const a=t("core").getEmbedPreview(e.url);return a?{html:a.html}:{html:null}}));return t?i("div",{className:"mapp-poi-embed",dangerouslySetInnerHTML:{__html:t}}):i("div",{className:"mapp-poi-embed"},i(p,null))}var y=a(939),k=a(346),w=a(885),C=a(614);window.mapp=window.mapp||{};const x=wp.element.createElement,{Fragment:N,useEffect:S,useLayoutEffect:L,useRef:O,useState:M}=wp.element,{Button:E,Dropdown:P,Modal:I,Panel:T,PanelBody:D,Popover:z,Spinner:B,TextControl:F}=wp.components,R=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function A(e){e={context:null,mapid:null,onClose:null,onSave:null,...e};const[t,a]=M({mapdata:void 0,viewport:null,zoom:null});function o(e){a((t=>({...t,...e})))}function n(e,a){let n={...t.mapdata};const i=n.pois.findIndex((t=>t.id==e));-1==i&&alert("ERROR poi not found"),n.pois[i]={...n.pois[i],...a},o({mapdata:n}),a.iconid&&o({lastIcon:a.iconid})}function i(e){let a={...t.mapdata};a.pois=a.pois?a.pois:[],a.pois.unshift(e),o({centerPoi:e,mapdata:a})}function l(e,a){return x(b,{onClose:()=>a(),onDelete:a=>function(e){if(!confirm(mappl10n.delete_prompt))return;let a={...t.mapdata};const n=a.pois.findIndex((t=>t.id==e));a.pois.splice(n,1),o({mapdata:a})}(e.id),onChange:t=>n(e.id,t),poi:e})}function s(){mapp.store.saveMap(t.mapdata,(t=>{e.onSave(t)}))}function r(e){o({mapdata:{...t.mapdata,...e}})}function p(){if(null==t.mapdata)return null;const a={centerPoi:t.centerPoi,embed:!0,isEditable:!0,layout:"left",mapOpts:{minZoom:2,streetViewControl:!1},menu:!1,name:"media-map",onDragDrop:(e,a)=>function(e,a){const n={...t.mapdata};let i=_.findIndex(n.pois,(t=>t.id==e)),l=_.findIndex(n.pois,(e=>e.id==a));n.pois.splice(l,0,n.pois.splice(i,1)[0]),o({mapdata:n})}(e,a),onDrawingEvent:e=>function(e){const a="marker"==e.type?null:e.type,o={...y.mappPoi.parseOverlay(a,e.overlay),body:"",iconid:t.lastIcon,id:y.mappLib.nanoid(),type:a,title:"marker"==e.type?y.mappLib.toUrlValue(e.overlay.position):mappl10n.shape};e.overlay.setMap(null),i(o)}(e),onPoiChange:(e,t)=>n(e,t),onRenderPopup:(e,t)=>l(e,t),onRenderSidebar:()=>function(){if(null==t.mapdata)return null;if("mce"!=e.context&&"library"!=e.context)return null;const{center:a,height:o,poiList:n,search:i,title:l,width:s,zoom:p}=t.mapdata;return x(w.MappSettings,{center:a,context:e.context,height:o,mapid:e.mapid,onChange:e=>r(e),poiList:n,search:i,title:l,viewport:t.viewport,width:s,zoom:p})}(),onSearch:e=>function(e){let a;if(e.geometry){const o=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,n=e.name==o?"":o;a={id:y.mappLib.nanoid(),address:o,body:n,iconid:t.lastIcon,id:y.mappLib.nanoid(),point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null}}else"string"==typeof e&&"http"==e.substring(0,4)&&(a={iconid:t.lastIcon,kml:{url:e},title:"KML",type:"kml"});i(a)}(e),onViewportChange:e=>function(e){o({viewport:e})}(e),poiList:!0};return"map"!=e.context&&"mashup"!=e.context||(a.center=null,a.zoom=null),x(k.MappMap,{...t.mapdata,...a})}return S((()=>{const t=t=>{o({isFetching:t.isFetchingMap,isSaving:t.isSavingMap,mapdata:t.maps[e.mapid]})};return mapp.store.subscribe(t),()=>{mapp.store.unsubscribe(t)}}),[]),S((()=>{e.mapid?mapp.store.fetchMap(e.mapid):o({mapdata:{otype:mappl10n.options.otype,oid:mappl10n.options.oid}})}),[e.mapid]),x("div",{className:"mapp-edit"},function(){var e;let a=null!==(e=t.mapdata)&&void 0!==e&&e.title?t.mapdata.title:"",n=t.isFetching?"":R("Untitled");return x("div",{className:"mapp-gt-modal-header"},x(F,{className:"mapp-edit-title",placeholder:n,value:a,onChange:e=>function(e){o({mapdata:{...t.mapdata,title:e}})}(e),onKeyDown:e=>function(e){13==e.keyCode&&(s(),e.stopPropagation(),e.preventDefault())}(e)}))}(),x("div",{className:"mapp-edit-main"},x("div",{className:"mapp-edit-map",key:e.mapid,onKeyDown:e=>e.stopPropagation(),tabIndex:-1},p()),t.mapdata?x(C.m,{selected:t.mapdata.mapTypeId,onChange:e=>r({mapTypeId:e})}):null),x("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:e=>e.stopPropagation()},x(E,{isPrimary:!0,disabled:t.isSaving||t.isFetching,isBusy:t.isSaving,onClick:()=>s()},R("Save")),x(E,{isSecondary:!0,disabled:t.isSaving||t.isFetching,onClick:()=>{e.onClose()}},R("Cancel"))))}},641:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappIconPicker:()=>O});var o=a(939),n=a(107),i=a(577);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useCallback:c,useRef:m,useState:d}=wp.element,{useSelect:u}=wp.data,{withState:g}=wp.compose,{Button:h,ColorPicker:f,DropZone:b,DropZoneProvider:v,FormFileUpload:y,Modal:k,Popover:w,RangeControl:C,Spinner:x,TabPanel:N}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),S=[{id:"mapp-shapes",fontFamily:"Marker Shapes",glyphs:[{name:"circle",center:[16,16]},{name:"widepin",center:[16,14]},{name:"route",center:[16,16]},{name:"shield",center:[16,16]},{name:"squarepin",center:[16,15]},{name:"square",center:[16,16]},{name:"squarerounded",center:[16,16]},{name:"roundpin",center:[16,13]},{name:"pin",center:null},{name:"pindot",center:null}]}],L=[{id:"mapp-icons",className:"mapp-marker-icons",filePrefix:"mp",fontFamily:"Marker Icons",label:"Map icons",glyphs:["airport","amusement-park","aquarium","archery","art-gallery","assistive-listening","atm","audio-description","bakery","bank","bar","baseball","beauty-salon","bicycle-store","bicycling","boat-ramp","boat-tour","boating","book-store","bowling-alley","braille","bus-station","cafe","campground","canoe","car-dealer","car-rental","car-repair","car-wash","casino","cemetery","chairlift","church","city-hall","closed-captioning","clothing-store","compass","convenience-store","courthouse","cross-country-skiing","crosshairs","dentist","department-store","diving","doctor","electrician","electronics-store","embassy","expand","female","finance","fire-station","fish-cleaning","fishing-pier","fishing","florist","food","fullscreen","funeral-home","furniture-store","gas-station","contractor","golf","grocery","gym","hair-care","hang-gliding","hardware-store","health","hindu-temple","horse-riding","hospital","ice-fishing","ice-skating","inline-skating","insurance-agency","jet-skiing","jewelry-store","kayaking","laundry","lawyer","library","liquor-store","local-government","location-arrow","locksmith","lodging","low-vision-access","male","marina","mosque","motobike-trail","movie-rental","movie-theater","moving-company","museum","natural-feature","night-club","open-captioning","painter","park","parking","pet-store","pharmacy","physiotherapist","place-of-worship","playground","plumber","point-of-interest","police","political","post-box","post-office","rafting","real-estate-agency","restaurant","roofing-contractor","route","rv-park","sailing","school","scuba-diving","search","shopping-mall","sign-language","skateboarding","ski-jumping","skiing","sledding","snow-shoeing","snow","snowboarding","snowmobile","spa","stadium","storage","store","subway-station","surfing","swimming","synagogue","taxi-stand","tennis","toilet","trail-walking","train-station","transit-station","travel-agency","unisex","university","veterinary-care","viewing","volume-control-telephone","walking","waterskiing","whale-watching","wheelchair","wind-surfing","zoo"]},{id:"material-icons",className:"material-icons",filePrefix:"mi",fontFamily:"Material Icons",label:"Material Icons",glyphs:["ac_unit","access_alarm","access_alarms","access_time","access_time_filled","accessibility","accessibility_new","accessible","accessible_forward","account_balance","account_balance_wallet","account_box","account_circle","account_tree","ad_units","adb","add","add_a_photo","add_alarm","add_alert","add_box","add_business","add_chart","add_circle","add_circle_outline","add_comment","add_ic_call","add_link","add_location","add_location_alt","add_moderator","add_photo_alternate","add_reaction","add_road","add_shopping_cart","add_task","add_to_drive","add_to_home_screen","add_to_photos","add_to_queue","addchart","adjust","admin_panel_settings","ads_click","agriculture","air","airline_seat_flat","airline_seat_flat_angled","airline_seat_individual_suite","airline_seat_legroom_extra","airline_seat_legroom_normal","airline_seat_legroom_reduced","airline_seat_recline_extra","airline_seat_recline_normal","airplane_ticket","airplanemode_active","airplanemode_inactive","airplanemode_off","airplanemode_on","airplay","airport_shuttle","alarm","alarm_add","alarm_off","alarm_on","album","align_horizontal_center","align_horizontal_left","align_horizontal_right","align_vertical_bottom","align_vertical_center","align_vertical_top","all_inbox","all_inclusive","all_out","alt_route","alternate_email","amp_stories","analytics","anchor","android","animation","announcement","aod","apartment","api","app_blocking","app_registration","app_settings_alt","approval","apps","architecture","archive","area_chart","arrow_back","arrow_back_ios","arrow_back_ios_new","arrow_circle_down","arrow_circle_up","arrow_downward","arrow_drop_down","arrow_drop_down_circle","arrow_drop_up","arrow_forward","arrow_forward_ios","arrow_left","arrow_right","arrow_right_alt","arrow_upward","art_track","article","aspect_ratio","assessment","assignment","assignment_ind","assignment_late","assignment_return","assignment_returned","assignment_turned_in","assistant","assistant_direction","assistant_photo","atm","attach_email","attach_file","attach_money","attachment","attractions","attribution","audiotrack","auto_awesome","auto_awesome_mosaic","auto_awesome_motion","auto_delete","auto_fix_high","auto_fix_normal","auto_fix_off","auto_graph","auto_stories","autofps_select","autorenew","av_timer","baby_changing_station","back_hand","backpack","backspace","backup","backup_table","badge","bakery_dining","balcony","ballot","bar_chart","batch_prediction","bathroom","bathtub","battery_alert","battery_charging_full","battery_full","battery_saver","battery_std","battery_unknown","beach_access","bed","bedroom_baby","bedroom_child","bedroom_parent","bedtime","beenhere","bento","bike_scooter","biotech","blender","block","bloodtype","bluetooth","bluetooth_audio","bluetooth_connected","bluetooth_disabled","bluetooth_drive","bluetooth_searching","blur_circular","blur_linear","blur_off","blur_on","bolt","book","book_online","bookmark","bookmark_add","bookmark_added","bookmark_border","bookmark_outline","bookmark_remove","bookmarks","border_all","border_bottom","border_clear","border_color","border_horizontal","border_inner","border_left","border_outer","border_right","border_style","border_top","border_vertical","branding_watermark","breakfast_dining","brightness_1","brightness_2","brightness_3","brightness_4","brightness_5","brightness_6","brightness_7","brightness_auto","brightness_high","brightness_low","brightness_medium","broken_image","browser_not_supported","brunch_dining","brush","bubble_chart","bug_report","build","build_circle","bungalow","burst_mode","bus_alert","business","business_center","cabin","cable","cached","cake","calculate","calendar_today","calendar_view_day","calendar_view_month","calendar_view_week","call","call_end","call_made","call_merge","call_missed","call_missed_outgoing","call_received","call_split","call_to_action","camera","camera_alt","camera_enhance","camera_front","camera_indoor","camera_outdoor","camera_rear","camera_roll","cameraswitch","campaign","cancel","cancel_presentation","cancel_schedule_send","car_rental","car_repair","card_giftcard","card_membership","card_travel","carpenter","cases","casino","cast","cast_connected","cast_for_education","catching_pokemon","category","celebration","cell_wifi","center_focus_strong","center_focus_weak","chair","chair_alt","chalet","change_circle","change_history","charging_station","chat","chat_bubble","chat_bubble_outline","check","check_box","check_box_outline_blank","check_circle","check_circle_outline","checklist","checklist_rtl","checkroom","chevron_left","chevron_right","child_care","child_friendly","chrome_reader_mode","circle","circle_notifications","class","clean_hands","cleaning_services","clear","clear_all","close","close_fullscreen","closed_caption","closed_caption_disabled","closed_caption_off","cloud","cloud_circle","cloud_done","cloud_download","cloud_off","cloud_queue","cloud_upload","code","code_off","coffee","coffee_maker","collections","collections_bookmark","color_lens","colorize","comment","comment_bank","commute","compare","compare_arrows","compass_calibration","compost","compress","computer","confirmation_num","confirmation_number","connect_without_contact","connected_tv","construction","contact_mail","contact_page","contact_phone","contact_support","contactless","contacts","content_copy","content_cut","content_paste","content_paste_off","control_camera","control_point","control_point_duplicate","copy","copy_all","copyright","coronavirus","corporate_fare","cottage","countertops","create","create_new_folder","credit_card","credit_card_off","credit_score","crib","crop","crop_16_9","crop_3_2","crop_5_4","crop_7_5","crop_din","crop_free","crop_landscape","crop_original","crop_portrait","crop_rotate","crop_square","cruelty_free","cut","dangerous","dark_mode","dashboard","dashboard_customize","data_exploration","data_saver_off","data_saver_on","data_usage","date_range","deck","dehaze","delete","delete_forever","delete_outline","delete_sweep","delivery_dining","departure_board","description","design_services","desktop_access_disabled","desktop_mac","desktop_windows","details","developer_board","developer_board_off","developer_mode","device_hub","device_thermostat","device_unknown","devices","devices_other","dialer_sip","dialpad","dining","dinner_dining","directions","directions_bike","directions_boat","directions_boat_filled","directions_bus","directions_bus_filled","directions_car","directions_car_filled","directions_ferry","directions_off","directions_railway","directions_railway_filled","directions_run","directions_subway","directions_subway_filled","directions_train","directions_transit","directions_transit_filled","directions_walk","dirty_lens","disabled_by_default","disabled_visible","disc_full","dnd_forwardslash","dns","do_disturb","do_disturb_alt","do_disturb_off","do_disturb_on","do_not_disturb","do_not_disturb_alt","do_not_disturb_off","do_not_disturb_on","do_not_disturb_on_total_silence","do_not_step","do_not_touch","dock","document_scanner","domain","domain_disabled","domain_verification","done","done_all","done_outline","donut_large","donut_small","door_back","door_front","door_sliding","doorbell","double_arrow","downhill_skiing","download","download_done","download_for_offline","downloading","drafts","drag_handle","drag_indicator","draw","drive_eta","drive_file_move","drive_file_move_rtl","drive_file_rename_outline","drive_folder_upload","dry","dry_cleaning","duo","dvr","dynamic_feed","dynamic_form","e_mobiledata","earbuds","earbuds_battery","east","eco","edgesensor_high","edgesensor_low","edit","edit_attributes","edit_calendar","edit_location","edit_location_alt","edit_note","edit_notifications","edit_off","edit_road","eject","elderly","electric_bike","electric_car","electric_moped","electric_rickshaw","electric_scooter","electrical_services","elevator","email","emergency","emoji_emotions","emoji_events","emoji_flags","emoji_food_beverage","emoji_nature","emoji_objects","emoji_people","emoji_symbols","emoji_transportation","engineering","enhance_photo_translate","enhanced_encryption","equalizer","error","error_outline","escalator","escalator_warning","euro","euro_symbol","ev_station","event","event_available","event_busy","event_note","event_seat","exit_to_app","expand","expand_less","expand_more","explicit","explore","explore_off","exposure","exposure_minus_1","exposure_minus_2","exposure_neg_1","exposure_neg_2","exposure_plus_1","exposure_plus_2","exposure_zero","extension","extension_off","face","face_retouching_natural","face_retouching_off","face_unlock","facebook","fact_check","family_restroom","fast_forward","fast_rewind","fastfood","favorite","favorite_border","favorite_outline","featured_play_list","featured_video","feed","feedback","female","fence","festival","fiber_dvr","fiber_manual_record","fiber_new","fiber_pin","fiber_smart_record","file_copy","file_download","file_download_done","file_download_off","file_present","file_upload","filter","filter_1","filter_2","filter_3","filter_4","filter_5","filter_6","filter_7","filter_8","filter_9","filter_9_plus","filter_alt","filter_b_and_w","filter_center_focus","filter_drama","filter_frames","filter_hdr","filter_list","filter_none","filter_tilt_shift","filter_vintage","find_in_page","find_replace","fingerprint","fire_extinguisher","fireplace","first_page","fit_screen","fitness_center","flag","flaky","flare","flash_auto","flash_off","flash_on","flashlight_off","flashlight_on","flatware","flight","flight_land","flight_takeoff","flip","flip_camera_android","flip_camera_ios","flip_to_back","flip_to_front","flourescent","flutter_dash","fmd_bad","fmd_good","folder","folder_open","folder_shared","folder_special","follow_the_signs","font_download","font_download_off","food_bank","format_align_center","format_align_justify","format_align_left","format_align_right","format_bold","format_clear","format_color_fill","format_color_reset","format_color_text","format_indent_decrease","format_indent_increase","format_italic","format_line_spacing","format_list_bulleted","format_list_numbered","format_list_numbered_rtl","format_paint","format_quote","format_shapes","format_size","format_strikethrough","format_textdirection_l_to_r","format_textdirection_r_to_l","format_underline","format_underlined","forum","forward","forward_10","forward_30","forward_5","forward_to_inbox","foundation","free_breakfast","free_cancellation","front_hand","fullscreen","fullscreen_exit","functions","g_mobiledata","g_translate","gamepad","games","garage","gavel","generating_tokens","gesture","get_app","gif","gite","golf_course","gpp_bad","gpp_good","gpp_maybe","gps_fixed","gps_not_fixed","gps_off","grade","gradient","grading","grain","graphic_eq","grass","grid_3x3","grid_4x4","grid_goldenratio","grid_off","grid_on","grid_view","group","group_add","group_off","group_work","groups","h_mobiledata","h_plus_mobiledata","hail","handyman","hardware","hd","hdr_auto","hdr_auto_select","hdr_enhanced_select","hdr_off","hdr_off_select","hdr_on","hdr_on_select","hdr_plus","hdr_strong","hdr_weak","headphones","headphones_battery","headset","headset_mic","headset_off","healing","health_and_safety","hearing","hearing_disabled","height","help","help_center","help_outline","hevc","hide_image","hide_source","high_quality","highlight","highlight_alt","highlight_off","highlight_remove","hiking","history","history_edu","history_toggle_off","holiday_village","home","home_max","home_mini","home_repair_service","home_work","horizontal_distribute","horizontal_rule","horizontal_split","hot_tub","hotel","hotel_class","hourglass_bottom","hourglass_disabled","hourglass_empty","hourglass_full","hourglass_top","house","house_siding","houseboat","how_to_reg","how_to_vote","http","https","hvac","ice_skating","icecream","image","image_aspect_ratio","image_not_supported","image_search","imagesearch_roller","import_contacts","import_export","important_devices","inbox","incomplete_circle","indeterminate_check_box","info","input","insert_chart","insert_chart_outlined","insert_comment","insert_drive_file","insert_emoticon","insert_invitation","insert_link","insert_photo","insights","integration_instructions","inventory","inventory_2","invert_colors","invert_colors_off","invert_colors_on","ios_share","iron","iso","kayaking","keyboard","keyboard_alt","keyboard_arrow_down","keyboard_arrow_left","keyboard_arrow_right","keyboard_arrow_up","keyboard_backspace","keyboard_capslock","keyboard_control","keyboard_hide","keyboard_return","keyboard_tab","keyboard_voice","king_bed","kitchen","kitesurfing","label","label_important","label_off","landscape","language","laptop","laptop_chromebook","laptop_mac","laptop_windows","last_page","launch","layers","layers_clear","leaderboard","leak_add","leak_remove","leave_bags_at_home","legend_toggle","lens","lens_blur","library_add","library_add_check","library_books","library_music","light","light_mode","lightbulb","line_style","line_weight","linear_scale","link","link_off","linked_camera","liquor","list","list_alt","live_help","live_tv","living","local_activity","local_airport","local_atm","local_attraction","local_bar","local_cafe","local_car_wash","local_convenience_store","local_dining","local_drink","local_fire_department","local_florist","local_gas_station","local_grocery_store","local_hospital","local_hotel","local_laundry_service","local_library","local_mall","local_movies","local_offer","local_parking","local_pharmacy","local_phone","local_pizza","local_play","local_police","local_post_office","local_print_shop","local_printshop","local_restaurant","local_see","local_shipping","local_taxi","location_city","location_disabled","location_history","location_off","location_on","location_searching","lock","lock_clock","lock_open","login","logout","looks","looks_3","looks_4","looks_5","looks_6","looks_one","looks_two","loop","loupe","low_priority","loyalty","lte_mobiledata","lte_plus_mobiledata","luggage","lunch_dining","mail","mail_outline","male","manage_accounts","manage_search","map","maps_home_work","maps_ugc","margin","mark_as_unread","mark_chat_read","mark_chat_unread","mark_email_read","mark_email_unread","markunread","markunread_mailbox","masks","maximize","media_bluetooth_off","media_bluetooth_on","mediation","medical_services","medication","meeting_room","memory","menu","menu_book","menu_open","merge_type","message","messenger","messenger_outline","mic","mic_external_off","mic_external_on","mic_none","mic_off","microwave","military_tech","minimize","miscellaneous_services","missed_video_call","mms","mobile_friendly","mobile_off","mobile_screen_share","mobiledata_off","mode","mode_comment","mode_edit","mode_edit_outline","mode_night","mode_standby","model_training","monetization_on","money","money_off","money_off_csred","monitor","monitor_weight","monochrome_photos","mood","mood_bad","moped","more","more_horiz","more_time","more_vert","motion_photos_auto","motion_photos_off","motion_photos_on","motion_photos_pause","motion_photos_paused","motorcycle","mouse","move_to_inbox","movie","movie_creation","movie_filter","moving","mp","multiline_chart","multiple_stop","multitrack_audio","museum","music_note","music_off","music_video","my_library_add","my_library_books","my_library_music","my_location","nat","nature","nature_people","navigate_before","navigate_next","navigation","near_me","near_me_disabled","nearby_error","nearby_off","network_cell","network_check","network_locked","network_wifi","new_label","new_releases","next_plan","next_week","nfc","night_shelter","nightlife","nightlight","nightlight_round","nights_stay","no_accounts","no_backpack","no_cell","no_drinks","no_encryption","no_encryption_gmailerrorred","no_flash","no_food","no_luggage","no_meals","no_meeting_room","no_photography","no_sim","no_stroller","no_transfer","nordic_walking","north","north_east","north_west","not_accessible","not_interested","not_listed_location","not_started","note","note_add","note_alt","notes","notification_add","notification_important","notifications","notifications_active","notifications_none","notifications_off","notifications_on","notifications_paused","now_wallpaper","now_widgets","offline_bolt","offline_pin","offline_share","ondemand_video","online_prediction","opacity","open_in_browser","open_in_full","open_in_new","open_in_new_off","open_with","other_houses","outbond","outbound","outbox","outdoor_grill","outlet","outlined_flag","padding","pages","pageview","paid","palette","pan_tool","panorama","panorama_fish_eye","panorama_fisheye","panorama_horizontal","panorama_horizontal_select","panorama_photosphere","panorama_photosphere_select","panorama_vertical","panorama_vertical_select","panorama_wide_angle","panorama_wide_angle_select","paragliding","park","party_mode","password","paste","pattern","pause","pause_circle","pause_circle_filled","pause_circle_outline","pause_presentation","payment","payments","pedal_bike","pending","pending_actions","people","people_alt","people_outline","perm_camera_mic","perm_contact_cal","perm_contact_calendar","perm_data_setting","perm_device_info","perm_device_information","perm_identity","perm_media","perm_phone_msg","perm_scan_wifi","person","person_add","person_add_alt","person_add_alt_1","person_add_disabled","person_off","person_outline","person_pin","person_pin_circle","person_remove","person_remove_alt_1","person_search","personal_injury","personal_video","pest_control","pest_control_rodent","pets","phone","phone_android","phone_bluetooth_speaker","phone_callback","phone_disabled","phone_enabled","phone_forwarded","phone_in_talk","phone_iphone","phone_locked","phone_missed","phone_paused","phonelink","phonelink_erase","phonelink_lock","phonelink_off","phonelink_ring","phonelink_setup","photo","photo_album","photo_camera","photo_camera_back","photo_camera_front","photo_filter","photo_library","photo_size_select_actual","photo_size_select_large","photo_size_select_small","piano","piano_off","picture_as_pdf","picture_in_picture","picture_in_picture_alt","pie_chart","pie_chart_outline","pin","pin_drop","pin_end","pin_invoke","pivot_table_chart","place","plagiarism","play_arrow","play_circle","play_circle_fill","play_circle_filled","play_circle_outline","play_disabled","play_for_work","play_lesson","playlist_add","playlist_add_check","playlist_play","plumbing","plus_one","podcasts","point_of_sale","policy","poll","polymer","pool","portable_wifi_off","portrait","post_add","power","power_input","power_off","power_settings_new","precision_manufacturing","pregnant_woman","present_to_all","preview","price_change","price_check","print","print_disabled","priority_high","privacy_tip","private_connectivity","production_quantity_limits","psychology","public","public_off","publish","published_with_changes","push_pin","qr_code","qr_code_2","qr_code_scanner","query_builder","query_stats","question_answer","queue","queue_music","queue_play_next","quick_contacts_dialer","quick_contacts_mail","quickreply","quiz","r_mobiledata","radar","radio","radio_button_checked","radio_button_off","radio_button_on","radio_button_unchecked","railway_alert","ramen_dining","rate_review","raw_off","raw_on","read_more","real_estate_agent","receipt","receipt_long","recent_actors","recommend","record_voice_over","recycling","redeem","redo","reduce_capacity","refresh","remember_me","remove","remove_circle","remove_circle_outline","remove_done","remove_from_queue","remove_moderator","remove_red_eye","remove_shopping_cart","reorder","repeat","repeat_on","repeat_one","repeat_one_on","replay","replay_10","replay_30","replay_5","replay_circle_filled","reply","reply_all","report","report_gmailerrorred","report_off","report_problem","request_page","request_quote","reset_tv","restart_alt","restaurant","restaurant_menu","restore","restore_from_trash","restore_page","reviews","rice_bowl","ring_volume","roofing","room","room_preferences","room_service","rotate_90_degrees_ccw","rotate_left","rotate_right","rounded_corner","router","rowing","rss_feed","rsvp","rtt","rule","rule_folder","run_circle","running_with_errors","rv_hookup","safety_divider","sailing","sanitizer","satellite","save","save_alt","saved_search","savings","scanner","scatter_plot","schedule","schedule_send","schema","school","science","score","screen_lock_landscape","screen_lock_portrait","screen_lock_rotation","screen_rotation","screen_search_desktop","screen_share","screenshot","sd","sd_card","sd_card_alert","sd_storage","search","search_off","security","security_update","security_update_good","security_update_warning","segment","select_all","self_improvement","sell","send","send_and_archive","send_to_mobile","sensor_door","sensor_window","sensors","sensors_off","sentiment_dissatisfied","sentiment_neutral","sentiment_satisfied","sentiment_satisfied_alt","sentiment_very_dissatisfied","sentiment_very_satisfied","set_meal","settings","settings_accessibility","settings_applications","settings_backup_restore","settings_bluetooth","settings_brightness","settings_cell","settings_display","settings_ethernet","settings_input_antenna","settings_input_component","settings_input_composite","settings_input_hdmi","settings_input_svideo","settings_overscan","settings_phone","settings_power","settings_remote","settings_suggest","settings_system_daydream","settings_voice","share","share_arrival_time","share_location","shield","shop","shop_2","shop_two","shopping_bag","shopping_basket","shopping_cart","short_text","shortcut","show_chart","shower","shuffle","shuffle_on","shutter_speed","sick","signal_cellular_0_bar","signal_cellular_4_bar","signal_cellular_alt","signal_cellular_connected_no_internet_0_bar","signal_cellular_connected_no_internet_4_bar","signal_cellular_no_sim","signal_cellular_nodata","signal_cellular_null","signal_cellular_off","signal_wifi_0_bar","signal_wifi_4_bar","signal_wifi_4_bar_lock","signal_wifi_bad","signal_wifi_connected_no_internet_4","signal_wifi_off","signal_wifi_statusbar_4_bar","signal_wifi_statusbar_connected_no_internet_4","signal_wifi_statusbar_null","sim_card","sim_card_alert","sim_card_download","single_bed","sip","skateboarding","skip_next","skip_previous","sledding","slideshow","slow_motion_video","smart_button","smart_display","smart_screen","smart_toy","smartphone","smoke_free","smoking_rooms","sms","sms_failed","snippet_folder","snooze","snowboarding","snowmobile","snowshoeing","soap","social_distance","sort","sort_by_alpha","source","south","south_east","south_west","spa","space_bar","space_dashboard","speaker","speaker_group","speaker_notes","speaker_notes_off","speaker_phone","speed","spellcheck","splitscreen","sports","sports_bar","sports_baseball","sports_basketball","sports_cricket","sports_esports","sports_football","sports_golf","sports_handball","sports_hockey","sports_kabaddi","sports_mma","sports_motorsports","sports_rugby","sports_score","sports_soccer","sports_tennis","sports_volleyball","square_foot","stacked_bar_chart","stacked_line_chart","stairs","star","star_border","star_border_purple500","star_half","star_outline","star_purple500","star_rate","stars","stay_current_landscape","stay_current_portrait","stay_primary_landscape","stay_primary_portrait","sticky_note_2","stop","stop_circle","stop_screen_share","storage","store","store_mall_directory","storefront","storm","straighten","stream","streetview","strikethrough_s","stroller","style","subdirectory_arrow_left","subdirectory_arrow_right","subject","subscript","subscriptions","subtitles","subtitles_off","subway","summarize","superscript","supervised_user_circle","supervisor_account","support","support_agent","surfing","surround_sound","swap_calls","swap_horiz","swap_horizontal_circle","swap_vert","swap_vert_circle","swap_vertical_circle","swipe","switch_account","switch_camera","switch_left","switch_right","switch_video","sync","sync_alt","sync_disabled","sync_problem","system_security_update","system_security_update_good","system_security_update_warning","system_update","system_update_alt","system_update_tv","tab","tab_unselected","table_chart","table_rows","table_view","tablet","tablet_android","tablet_mac","tag","tag_faces","takeout_dining","tap_and_play","tapas","task","task_alt","taxi_alert","terrain","text_fields","text_format","text_rotate_up","text_rotate_vertical","text_rotation_angledown","text_rotation_angleup","text_rotation_down","text_rotation_none","text_snippet","textsms","texture","theater_comedy","theaters","thermostat","thermostat_auto","thumb_down","thumb_down_alt","thumb_down_off_alt","thumb_up","thumb_up_alt","thumb_up_off_alt","thumbs_up_down","time_to_leave","timelapse","timeline","timer","timer_10","timer_10_select","timer_3","timer_3_select","timer_off","tips_and_updates","title","toc","today","toggle_off","toggle_on","toll","tonality","topic","touch_app","tour","toys","track_changes","traffic","train","tram","transfer_within_a_station","transform","transgender","transit_enterexit","translate","travel_explore","trending_down","trending_flat","trending_neutral","trending_up","trip_origin","try","tty","tune","tungsten","turned_in","turned_in_not","tv","tv_off","two_wheeler","umbrella","unarchive","undo","unfold_less","unfold_more","unpublished","unsubscribe","upcoming","update","update_disabled","upgrade","upload","upload_file","usb","usb_off","verified","verified_user","vertical_align_bottom","vertical_align_center","vertical_align_top","vertical_distribute","vertical_split","vibration","video_call","video_camera_back","video_camera_front","video_collection","video_label","video_library","video_settings","video_stable","videocam","videocam_off","videogame_asset","videogame_asset_off","view_agenda","view_array","view_carousel","view_column","view_comfortable","view_comfy","view_compact","view_day","view_headline","view_in_ar","view_list","view_module","view_quilt","view_sidebar","view_stream","view_week","vignette","villa","visibility","visibility_off","voice_chat","voice_over_off","voicemail","volume_down","volume_mute","volume_off","volume_up","volunteer_activism","vpn_key","vpn_lock","vrpano","wallet_giftcard","wallet_membership","wallet_travel","wallpaper","warning","warning_amber","wash","watch","watch_later","water","water_damage","water_drop","waterfall_chart","waves","waving_hand","wb_auto","wb_cloudy","wb_incandescent","wb_iridescent","wb_shade","wb_sunny","wb_twilight","wc","web","web_asset","web_asset_off","weekend","west","whatshot","wheelchair_pickup","where_to_vote","widgets","wifi","wifi_calling","wifi_calling_3","wifi_lock","wifi_off","wifi_protected_setup","wifi_tethering","wifi_tethering_error_rounded","wifi_tethering_off","window","wine_bar","work","work_off","work_outline","workspaces","wrap_text","wrong_location","wysiwyg","yard","youtube_searched_for","zoom_in","zoom_out","zoom_out_map"]}];function O(e){const[t,a]=d({defaultIcon:mappl10n.options.defaultIcon,filename:null,filter:"",glyph:"",glyphColor:"white",glyphFont:L[0],glyphSize:20,isOpen:!1,mode:"list",shape:"circle",shapeColor:"gray",shapeFont:S[0],toDelete:[],userIcons:mappl10n.options.userIcons});function p(e){a((t=>({...t,...e})))}function c(a,n){switch(a){case"bulk-select":let a=[...t.toDelete],i=t.toDelete.indexOf(n.iconid);i>=0?a.splice(i,1):a.push(n.iconid),p({toDelete:a});break;case"close":p({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&o.mappLib.ajax({method:"POST",data:{action:"mapp_icon_delete",iconids:t.toDelete,nonce:mappl10n.options.nonce},callback:function(a){a&&"OK"==a.status?(t.toDelete.indexOf(e.iconid)>=0&&!function(e){if(!e)return!1;let t=e.replace(/.png|.gif|.jpg/gi,"").toLowerCase();return mappl10n.options.standardIcons.indexOf(t)>=0}(e.iconid)&&e.onChange(null),mappl10n.options.userIcons=a.data,p({toDelete:[],mode:"list",userIcons:mappl10n.options.userIcons})):alert("Delete error: "+a.status)}});break;case"edit-cancel":p({mode:"list"});break;case"edit-save":!function(e){const a=32,o=2;let n=document.createElement("canvas");n.width=a*o,n.height=a*o,n.style.imageRendering="pixelated";let i=n.getContext("2d");i.font=a*o+"px "+t.shapeFont.fontFamily,i.fillStyle=t.shapeColor,i.textBaseline="bottom",i.fillText(t.shape,0,a*o),i.strokeStyle="white",i.strokeText(t.shape,1,a*o);const l=_.findWhere(t.shapeFont.glyphs,{name:t.shape});if(t.glyph&&l.center){i.imageSmoothingEnabled=!1,i.font=t.glyphSize*o+"px "+t.glyphFont.fontFamily,i.fillStyle=t.glyphColor;const e=[l.center[0]*o,l.center[1]*o];i.fillText(t.glyph,e[0]-t.glyphSize,e[1]+t.glyphSize)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(n):n.toBlob((e=>{let a=new FormData;a.append("image0",e,t.filename),u(a)}),"image/png",100)}();break;case"edit-upload":!function(e){let t=new FormData;_.map(e,((e,a)=>{e.type.match("image.*")?t.append("image"+a,e):alert("File "+e.name+" is not an image.")})),u(t)}(n);break;case"list-select":e.onChange&&e.onChange(n),c("close");break;case"mode":p("bulk"==n?{mode:n,toDelete:[]}:{mode:n});break;case"open":p({isOpen:!0})}}function m(a){const n="user"==a?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(n,(n=>{if("standard"==a&&function(e){return mappl10n.options.userIcons.indexOf(e)>=0}(n+".png"))return"";let i="mapp-icon-wrapper";return"bulk"==t.mode&&t.toDelete.indexOf(n)>=0?i+=" mapp-bulk-selected":"list"!=t.mode||e.iconid!=n&&e.iconid+".png"!=n||(i+=" mapp-selected"),l("div",{alt:n,className:i,key:n,onClick:()=>{"list"==t.mode?c("list-select",n):"user"==a&&c("bulk-select",{iconid:n,type:a})}},l("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(n),title:n}))}))}function u(t){t.append("action","mapp_icon_save"),t.append("nonce",mappl10n.options.nonce),o.mappLib.ajax({method:"POST",data:t,callback:t=>{t&&"OK"==t.status?(mappl10n.options.userIcons=t.data.icons,p({userIcons:mappl10n.options.userIcons}),p({mode:"list"}),e.onChange&&e.onChange(t.data.filename)):alert("Upload error: "+t.status)}})}return r((()=>{let e=t.glyph?t.glyph:t.shape;e+=".png",p({filename:e})}),[t.shape,t.shapeColor,t.glyphFont,t.glyph,t.glyphColor,t.glyphSize]),l(s,null,l("img",{className:"mapp-icon",onClick:()=>c("open",null),src:o.mappLib.getIconUrl(e.iconid)}),"list"==t.mode&&t.isOpen&&l(k,{title:l("div",{className:"mapp-icons-title"},__("Select icon"),l(h,{disabled:"bulk"==t.mode,isPrimary:!0,onClick:()=>c("mode","edit")},__("New icon"))),className:"mapp-icons-modal",onRequestClose:()=>c("close")},l("div",{className:"mapp-icons"},l("div",{className:"mapp-icons-list"},mappl10n.options.userIcons.length>0&&l("div",{className:"mapp-icons-list-title"},__("Custom icons")),l("div",{className:"mapp-icons-user"},m("user")),mappl10n.options.userIcons.length>0&&l("div",{className:"mapp-icons-list-title"},__("Standard icons")),l("div",{className:"mapp-icons-standard"},m("standard"))),l("div",{className:"mapp-icons-toolbar"},l("div",null,l(h,{disabled:"bulk"==t.mode,isSecondary:!0,onClick:()=>c("list-select",null)},__("Use default icon")),mappl10n.options.userIcons.length>0&&l(h,{isTertiary:!0,onClick:()=>c("mode","bulk")},__("Edit list"))),l("div",{className:"mapp-icons-filename"},e.iconid?e.iconid:__("No icon selected"))))),"bulk"==t.mode&&t.isOpen&&l(k,{title:l("div",{className:"mapp-icons-title"},__("Select icons to delete")),className:"mapp-icons-modal",onRequestClose:()=>c("close")},l("div",{className:"mapp-icons"},l("div",{className:"mapp-icons-list"},l("div",{className:"mapp-icons-user"},m("user"))),l("div",{className:"mapp-icons-toolbar"},l("div",null,l(h,{isDestructive:!0,disabled:t.toDelete.length<1,onClick:()=>c("delete")},__("Delete")),l(h,{isSecondary:!0,onClick:()=>c("mode","list")},__("Cancel")))))),"edit"==t.mode&&l(k,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:()=>c("edit-cancel"),shouldCloseOnClickOutside:!1},l("div",{className:"mapp-icons-edit"},l("div",{id:"mapp-edit-debug"}),l("section",null,l("h2",null,__("Shape")),l("span",{className:"mapp-icons-edit-shapes",style:{color:t.shapeColor,fontFamily:t.shapeFont.fontFamily}},_.map(t.shapeFont.glyphs,((e,a)=>{const o=t.shape==e.name;return l("span",{className:"mapp-icons-edit-shape-wrapper"+(o?" mapp-selected":""),key:e.name,onClick:()=>p({shape:e.name}),title:e.name},l("span",{className:"mapp-icons-edit-shape"},e.name,e.center&&t.glyph&&l("div",{className:"mapp-icons-edit-shape-glyph "+t.glyphFont.className,style:{left:e.center[0],top:e.center[1],color:t.glyphColor,fontSize:t.glyphSize,width:t.glyphSize}},t.glyph)))})))),l("section",{className:"mapp-icons-edit-font"},l("h2",null,__("Font")),l(i.Select,{value:t.glyphFont.id,options:_.map(L,(e=>({value:e.id,label:e.label}))),onChange:e=>p({glyphFont:_.findWhere(L,{id:e}),glyph:null})}),l("span",null,__("Font size")),l(C,{initialPosition:20,min:16,max:24,value:t.glyphSize,onChange:e=>p({glyphSize:e})})),l("section",null,l("h2",null,__("Color")),l("span",{className:"mapp-icons-edit-colors"},l(n.MappColorPicker,{color:t.shapeColor,isExtended:!1,onChange:e=>p({shapeColor:e.color})}),l("span",null,__("Fill")),l(n.MappColorPicker,{color:t.glyphColor,isExtended:!1,onChange:e=>p({glyphColor:e.color})}),l("span",null,__("Stroke")))),function(){const e=_.filter(t.glyphFont.glyphs,(e=>!t.filter||e.includes(t.filter)));return l("div",{className:"mapp-icons-edit-glyphs"},l("section",{className:"mapp-icons-edit-search"},l("h2",null,__("Search")),l(i.Input,{value:t.filter,onChange:e=>p({filter:e})})),l("div",{className:"mapp-icons-edit-glyph-list",style:{color:t.glyphColor}},_.map(e,((e,a)=>l("div",{tabIndex:0,className:"mapp-icons-edit-glyph-wrapper"+(t.glyph==e?" mapp-selected":""),key:a,onClick:()=>p({glyph:t.glyph==e?null:e})},l("span",{className:"mapp-icons-edit-glyph "+t.glyphFont.className},e),l("div",{className:"mapp-icons-edit-glyph-title"},e.replaceAll("_"," ")))))))}(),l("div",{className:"mapp-icons-edit-toolbar"},l("div",{className:"mapp-icons-edit-toolbar-left"},l(h,{isPrimary:!0,onClick:()=>c("edit-save")},__("Save")),l(h,{isSecondary:!0,onClick:()=>c("edit-cancel")},__("Cancel")),l(i.Input,{className:"mapp-icons-filename",value:t.filename,onChange:e=>p({filename:e})})),l("div",null,l(y,{accept:"image/*",icon:"upload",multiple:!0,onChange:e=>{c("edit-upload",e.target.files)}},__("Upload icons")))))))}},897:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappImport:()=>y});var o=a(939),n=a(346),i=a(577);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useCallback:c,useRef:m,useState:d}=wp.element,{useSelect:u}=wp.data,{withState:g}=wp.compose,{Button:h,FormFileUpload:f,Modal:b,ToggleControl:v}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function y(e){const[t,a]=d({isBusy:!1,isFetching:!1,file:null,isMapModalOpen:!1,mapid:null,mapdata:null,overwrite:!1,response:null,tab:"sheet",url:""});m(null);function p(e){a((t=>({...t,...e})))}r((()=>{t.mapid&&(p({isFetching:!0,mapdata:null}),o.mappLib.ajax({method:"GET",data:{action:"mapp_get",mapid:t.mapid,nonce:mappl10n.options.nonce},callback:e=>{if(e&&"OK"==e.status){const t=e.data;t.pois&&t.pois.map((e=>{e.id=o.mappLib.nanoid()})),p({mapdata:t})}else alert(e.status);p({isFetching:!1})}}))}),[t.mapid]);const c=t.isBusy||"file"==t.tab&&!t.file||"sheet"==t.tab&&0==t.url.trim().length;return l("div",{className:"mapp-import"},l("form",{onSubmit:e=>{e.preventDefault(),function(){p({isBusy:!0,response:null});let e={method:"POST",data:{url:t.url,action:"mapp_import",nonce:mappl10n.options.nonce,overwrite:t.overwrite},callback:e=>{p({isBusy:!1}),e&&"OK"==e.status&&p({response:e.data})}};if("file"==t.tab){let a=new FormData;_.map(e.data,((e,t)=>a.append(t,e))),a.append("file",t.file),e={...e,data:a}}o.mappLib.ajax(e)}()}},l(s,null,l("h2",null,__("Source")),l(i.MappTabs,{tabs:[{name:"sheet",label:__("Google Sheets")},{name:"file",label:__("File")}],initialTab:t.tab,onRender:e=>"sheet"==e?function(){const e=l("div",{className:"mapp-import-help"},__("Google sheets must be shared before importing:"),l("ol",null,l("li",null,__("File -> Share -> Publish to web")),l("li",null,__("Select 'Entire Document' and 'Comma-Separated Values (.csv)")),l("li",null,__("Copy the URL and paste it here"))));return l("div",{className:"mapp-import-tab-sheet"},l("label",{className:"mapp-import-sheet-name"},l("span",null,"URL"),l("input",{onChange:e=>{p({url:e.target.value})},type:"text",value:t.url})),e)}():"file"==e?function(){const e=l("div",{className:"mapp-import-help"},__("File must be in CSV format:"),l("ol",null,l("li",null,__("Excel: File -> Save As -> 'CSV' or 'CSV UTF-8' (for special characters)'")),l("li",null,__("Google sheets: File -> Download -> Comma Separated Values (.csv)"))));return l("div",{className:"mapp-import-tab-file"},l("div",{className:"mapp-import-file-name"},l(f,{accept:"text/csv",isSecondary:!0,multiple:!1,onChange:e=>{p({file:e.target.files[0]})}},__("Select file")),l("input",{disabled:!0,type:"text",value:t.file?t.file.name:""})),e)}():void 0,onSelect:e=>p({tab:e})})),l(v,{checked:t.overwrite,label:__("Use map IDs from file"),onChange:e=>p({overwrite:e})}),t.overwrite&&l("div",{className:"mapp-import-overwrite-warning"},__("WARNING: this will overwrite any existing maps with the same IDs")),l(h,{disabled:c,isBusy:t.isBusy,isPrimary:!0,type:"submit"},__("Import"))),function(){if(t.response&&t.response.results)return l("div",{className:"mapp-import-log"},l("h2",null,__("Results")),_.map(t.response.results,((e,a)=>l("div",{key:a},function(e){let a=t.response.headers;return l("div",{className:"mapp-import-table"},l("div",{className:"mapp-import-table-header"},l("div",{key:"line",className:"mapp-import-cell"},__("Line")),_.map(a,((e,t)=>l("div",{key:t,className:"mapp-import-cell"},e))),l("div",{key:"msg",className:"mapp-import-cell"},__("Result"))),_.map(e.logs,((e,t)=>{let o="mapp-import-cell";return e.msg&&(o+="e"==e.msg.msgtype?" mapp-import-cell-error":" mapp-import-cell-info"),l("div",{className:"mapp-import-row",key:t},l("div",{key:"col_rowid",className:"mapp-import-cell"},e.rowid),_.map(a,((t,a)=>l("div",{key:a,className:"mapp-import-cell"},e[t]?e[t]:" "))),l("div",{key:"error",className:o},e.msg.msg))})))}(e),function(e){return _.map(e.msgs,((e,a)=>{const o="e"==e.msgtype?"mapp-import-error":"mapp-import-info";return l("div",{className:o,key:a},e.msg,e.mapid&&l(h,{onClick:()=>{p({mapid:e.mapid,isMapModalOpen:!0})},disabled:t.isFetching||t.isMapModalOpen,isBusy:t.isFetching&&t.mapid==e.mapid,isSecondary:!0},__("Show map")))}))}(e)))))}(),t.isMapModalOpen&&!t.isFetching&&l(b,{title:__("Map")+" "+t.mapid,onRequestClose:()=>p({isMapModalOpen:!1})},l("div",{className:"mapp-import-map"},!t.isFetching&&t.mapdata&&l(n.MappMap,{...t.mapdata,height:"50vh",mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:!0,search:!1,width:"50vw"}))))}document.getElementById("mapp-import-container")&&wp.element.render(l(y,null),document.getElementById("mapp-import-container"))},218:(e,t,a)=>{"use strict";a.r(t);var o=a(346),n=a(185),i=a(885);window.mapp=window.mapp||{};const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){const{Button:t,Placeholder:a,Toolbar:p,ToolbarButton:c,ToolbarGroup:d}=wp.components,{BlockControls:u,InspectorControls:g}=wp.blockEditor,[h,_]=m({isFetching:null,isPickerOpen:!1,pickerMode:"list",viewport:null});function f(e){_((t=>({...t,...e})))}function b(){f({isPickerOpen:!0,pickerMode:"list"})}function v(){return l(u,null,l(void 0!==d?d:p,null,e.attributes.mapid&&l(c,{icon:"edit",label:__("Edit map"),onClick:()=>{f({isPickerOpen:!0,pickerMode:"edit"})}}),l(c,{icon:"portfolio",label:__("Map Library"),onClick:()=>b()})))}if(r((()=>{const t=t=>{let a=t.maps[e.attributes.mapid];f({isFetching:t.isFetchingMap,mapdata:a})};return mapp.store.subscribe(t),()=>mapp.store.unsubscribe(t)})),r((()=>{e.attributes.mapid&&mapp.store.fetchMap(e.attributes.mapid)}),[e.attributes.mapid]),r((()=>{"wide"!=e.attributes.align&&"full"!=e.attributes.align||e.setAttributes({width:"100%"})}),[e.attributes.align]),e.attributes.preview)return l("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"});let y=e.attributes.mapid&&null!==h.mapdata?l(s,null,v(),function(){const{align:t,center:a,height:o,mapid:n,poiList:s,search:r,width:p,zoom:c}=e.attributes;return l(g,null,l("div",{className:"mapp-gt-inspector"},l(i.MappSettings,{center:a,context:"map",height:o,mapid:n,onChange:t=>{return a=t,void e.setAttributes(a);var a},poiList:s,search:r,title:h.mapdata?h.mapdata.title:null,viewport:h.viewport,width:p,zoom:c})))}(),function(){if(e.attributes.mapid&&h.mapdata)return l(o.MappMap,{...h.mapdata,alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},onViewportChange:e=>function(e){f({viewport:e})}(e),poiList:e.attributes.poiList,search:e.attributes.search,width:e.attributes.width,zoom:e.attributes.zoom})}()):l(s,null,v(),l(a,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},l(t,{icon:"portfolio",isSecondary:!0,onClick:()=>b()},__("Map Library"))));return l(s,null,y,function(){if(h.isPickerOpen)return l(n.MappPicker,{mapid:e.attributes.mapid,mode:h.pickerMode,onClose:()=>(null==e.attributes.center&&(e.setAttributes({center:1}),e.setAttributes({center:null})),void f({isPickerOpen:!1})),onInsert:t=>function(t){t!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:t,zoom:void 0}),f({isPickerOpen:!1})}(t),onTrash:()=>{e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0})},type:"post"})}())}"post"==mappl10n.options.otype&&mappl10n.options.oid&&wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:mappl10n.options.blockCategory,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},search:{type:"boolean"},width:{type:"string",default:""},zoom:{type:"number"}},supports:{align:["full","wide","center","left","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:e=>e.named.center},height:{type:"string",shortcode:e=>e.named.height},initialOpenDirections:{type:"boolean",shortcode:e=>"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections||void 0},mapid:{type:"string",shortcode:e=>e.named.mapid},poiList:{type:"boolean",shortcode:e=>"true"==e.named.poiList||"true"==e.named.poilist||void 0},search:{type:"boolean",shortcode:e=>"true"==e.named.search||"true"==e.named.search||void 0},width:{type:"string",shortcode:e=>e.named.width},zoom:{type:"number",shortcode:e=>parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}},{type:"block",blocks:["core/shortcode"],isMatch:e=>{let{text:t}=e;var a=wp.shortcode.regexp("mappress");return a.lastIndex=0,a.test(t)},transform:e=>{let{text:t}=e;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return l(d,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},265:(e,t,a)=>{"use strict";a.r(t);a(346),a(74),a(885),a(308);wp.element.createElement;const{Fragment:o,useEffect:n,useLayoutEffect:i,useRef:l,useState:s}=wp.element,{BaseControl:r,Button:p,ButtonGroup:c,Card:m,CardBody:d,CardFooter:u,CardHeader:g,CheckboxControl:h,ExternalLink:_,HorizontalRule:f,Panel:b,PanelBody:v,PanelRow:y,Placeholder:k,RadioControl:w,SelectControl:C,TabPanel:x,TextControl:N,TextareaControl:S,ToggleControl:L,Toolbar:O}=wp.components,{useSelect:M}=wp.data},74:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappMultiSelect:()=>b});const o=wp.element.createElement,{Fragment:n,useEffect:i,useLayoutEffect:l,useRef:s,useState:r}=wp.element,{BaseControl:p,Button:c,CheckboxControl:m,Panel:d,PanelBody:u,PanelRow:g,Spinner:h,TextControl:f}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function b(e){const t=s(null),a=s(null),[n,l]=r({isOpen:!1,filter:"",filteredOptions:[]});function c(e){l((t=>({...t,...e})))}function d(t){let a=_.findWhere(e.options,{value:t});return a?a.label:t}function u(){let t;return e.values instanceof Array?t=[...e.values]:e.values&&(t=[e.values]),t||[]}function g(t,a){let o=u(),n=o.indexOf(t);(a=void 0!==a?a:-1==n)?o.push(t):o.splice(n,1),e.onChange(o)}function h(){return n.isOpen?o("div",{className:"mapp-select-dropdown-wrapper"},o("div",{className:"mapp-select-dropdown"},!n.isOpen||!e.options||e.options.length<10?null:o("div",{className:"mapp-select-filter",ref:a},o(f,{autoComplete:"off",placeholder:__("Search"),value:n.filter,onChange:e=>c({filter:e})})),o("div",{className:"mapp-select-dropdown-list"},function(){const e=u();if(0==n.filteredOptions.length)return o("div",{className:"mapp-select-dropdown-item"},__("No results"));return n.filteredOptions.map((t=>o(m,{className:"mapp-select-dropdown-item",checked:e.includes(t.value),key:t.value,onChange:e=>g(t.value,e),label:t.label})))}()))):null}return i((()=>{if(e.options)if(n.filter){let t=n.filter.toUpperCase();c({filteredOptions:e.options.filter((e=>0==e.label.toUpperCase().indexOf(t)))})}else c({filteredOptions:e.options})}),[e.options,n.filter]),i((()=>{n.isOpen&&a.current&&(a.current.focus(),c({filter:""}))}),[n.isOpen]),o(p,{className:"mapp-select",label:e.label},o("div",{ref:t,tabIndex:0,onBlur:e=>function(e){event.relatedTarget||document.activeElement,t.current.contains(e.relatedTarget)||c({isOpen:!1})}(e)},function(){const t=u();return t instanceof Array&&t.map((e=>d(e))),void 0===e.options?o("div",{className:"mapp-select-input"},o("div",{className:"mapp-select-tokens"}),o("span",{className:"dashicons dashicons-arrow-down-alt2"})):o("div",{className:"mapp-select-input",onClick:()=>c({isOpen:!n.isOpen})},o("div",{className:"mapp-select-tokens"},t.map((e=>o("span",{className:"mapp-select-token",key:e,onClick:t=>{t.stopPropagation(),g(e,!1)}},d(e))))),o("span",{className:"dashicons "+(n.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))}(),h()))}},577:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Control:()=>f,Help:()=>b,Checkbox:()=>v,Checkboxes:()=>y,Datalist:()=>k,Input:()=>w,Radios:()=>x,Select:()=>N,Textarea:()=>S,Section:()=>L,Option:()=>O,MappCrudList:()=>M,MappExpand:()=>E,MappGrid:()=>P,MappTabs:()=>I});var o=a(641);a(939);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:m}=wp.data,{Button:d,Dashicon:u,Modal:g,TabPanel:h}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){let{className:t,help:a,type:o,...l}=e;const s=Array.isArray(l.children)?i:"label";let r="mapp-control";return o&&(r+=" mapp-control-"+o),t&&(r+=" "+t),n("div",{className:r},l.labelTop&&n("div",{className:"mapp-label-top"},l.labelTop),n(s,null,l.labelLeft&&n("span",null,l.labelLeft),l.children,(l.label||l.labelRight)&&n("span",null,l.label||l.labelRight)),a&&n(b,a))}function b(e){let t="mapp-help-text";e.type&&(t+=" mapp-help-"+e.type);let a=null;return e.href&&(a="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),n(i,null,a&&n("a",{className:"mapp-help-link",href:a,target:"_blank"},n(u,{icon:"editor-help"})),e.text&&n("div",{className:t},e.text))}function v(e){let{checked:t,className:a,disabled:o,onChange:i,value:l,...s}=e;return n(f,{type:"checkbox",...s},n("input",{checked:void 0!==t&&t,className:a,disabled:o,onChange:e=>i(e.target.checked),type:"checkbox",value:l}))}function y(e){let{label:t,onChange:a,options:o,values:i,...l}=e;return n(f,{type:"checkboxes",...l},_.map(o,((e,t)=>{let o=i?i.indexOf(e.value):-1;return n(v,{key:t,label:e.label,value:e.value,checked:o>=0,disabled:e.disabled,onChange:t=>{let n=[...i];t&&-1==o&&a(n.concat(e.value)),!t&&o>=0&&(n.splice(o,1),a(n))}})})))}function k(e){let{className:t,list:a,onChange:o,options:i,value:l,...s}=e;return n(f,{type:"select",...s},n("span",{className:t},n("input",{list:a,value:null!=l?l:"",onChange:e=>o(e.target.value)}),n("datalist",{id:a},_.map(i,((e,t)=>n("option",{key:t,value:e.value,disabled:e.disabled},e.label))))))}function w(e){let{autoFocus:t,disabled:a,max:o,min:i,name:l,onChange:s,placeholder:r,size:p,trim:c,type:m,value:d,...u}=e;return n(f,{type:"input",...u},n("input",{autoFocus:t,disabled:a,max:o,min:i,name:l,onChange:e=>{if(s){const t=c?e.target.value.trim():e.target.value;s(t)}},placeholder:r,size:p,type:m||"text",value:null!==d?d:""}))}const C=function(e){let{checked:t,className:a,disabled:o,onChange:i,value:l,...s}=e;return n(f,{type:"radio",...s},n("input",{checked:t,className:a,disabled:o,onChange:e=>i(e.target.value),type:"radio",value:l}))};function x(e){let{checked:t,label:a,onChange:o,options:i,...l}=e;return n(f,{type:"radios",...l},_.map(i,((e,a)=>{if(!e.hide)return n(C,{key:a,value:e.value,checked:t==e.value||null==t&&""==e.value,onChange:e=>o(e),disabled:e.disabled,label:e.label})})))}function N(e){let{className:t,onChange:a,options:o,placeholder:i,value:l,...s}=e,r=[...o];return void 0!==i&&r.unshift({value:"",label:i}),n(f,{type:"select",...s},n("select",{className:t,value:null!=l?l:"",onChange:e=>a(e.target.value)},_.map(r,((e,t)=>n("option",{key:t,value:e.value,disabled:e.disabled},e.label)))))}function S(e){let{className:t,onChange:a,...o}=e;return n(f,{type:"textarea",...o},n("textarea",{className:t,onChange:e=>a(e.target.value)}))}function L(e){let t=e.className?" "+e.className:"";return n("div",{className:"mapp-option-section"+t},n("h2",null,e.title),e.children)}function O(e){const t=e.className?"mapp-option "+e.className:"mapp-option";return n("div",{className:t},n("div",{className:"mapp-option-title"},e.title),n("div",{className:"mapp-option-value"},e.children))}function M(e){let{data:t,isDraggable:a,onAdd:o,onChangeData:i,onRender:s,...r}=e;const[p,m]=c({dragging:null,dragover:null,isDraggable:!1});function u(e){m((t=>({...t,...e})))}function g(e,a,n){let l=Array.isArray(t)?[...t]:[];switch(e){case"add":const e=o?o():{};l.push(e),i(l);break;case"change":l[n]={...t[n],...a},i(l);break;case"delete":confirm(mappl10n.delete_prompt)&&(l.splice(a,1),i(l));break;case"sort":let s=p.dragging,r=s<a?a-1:a;l.splice(r,0,l.splice(s,1)[0]),i(l),u({dragover:null})}}return l((()=>{}),[]),n("div",{className:"mapp-crud-list"},_.map(t,((e,t)=>n("div",{className:"mapp-crud-row"+(p.dragover==t?" mapp-dragover":""),draggable:a,key:t,onDragOver:e=>e.preventDefault(),onDragStart:e=>u({dragging:t}),onDragEnter:e=>u({dragover:t}),onDragEnd:e=>u({dragging:null,dragover:null}),onDrop:e=>g("sort",t)},s({row:e,rowId:t,onChange:e=>g("change",e,t),onDelete:()=>g("delete",t)})))),n("div",{className:"mapp-crud-toolbar"},n(d,{isSecondary:!0,onClick:()=>g("add")},__("Add"))))}function E(e){let{actions:t,initialOpen:a,showToggle:o,subTitle:i,title:l,...s}=e;const[r,p]=c({isOpen:!o||a});function m(e,t){if("toggle"===e)o&&(a={isOpen:!r.isOpen},p((e=>({...e,...a}))));var a}let d="mapp-expand";return d+=r.isOpen?"":" mapp-expand-closed",d+=s.className?" "+s.className:"",n("div",{className:d},n("div",{className:"mapp-expand-header",onClick:()=>m("toggle")},n("div",null,l,i),o&&n("div",null,n(u,{icon:r.isOpen?"arrow-up":"arrow-down"}))),n("div",{className:"mapp-expand-body"},s.children),t&&n("div",{className:"mapp-expand-footer"},t))}function P(e){const[t,a]=c({dragging:null,dragover:null});function i(e){a((t=>({...t,...e})))}function l(a,o){let n=[...e.data];switch(a){case"add":let a={};_.map(e.cols,(e=>{a[e.id]=""})),n.push(a),e.onChange(n,e.selected);break;case"change":n[o.i][o.id]=o.value,e.onChange(n,e.selected);break;case"delete":let l;n.splice(o,1),l=o==e.selected?null:o<e.selected?e.selected-1:e.selected,e.onChange(n,l);break;case"select":i({selected:o}),e.onChange(n,o);break;case"sort":let s=t.dragging,r=s<o?o-1:o;n.splice(r,0,n.splice(s,1)[0]),e.onChange(n,r),i({dragover:null})}}return n("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&n("div",{className:"mapp-grid-table"},function(){const t=e.selectionColumn?n("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,a=n("div",{className:"mapp-grid-cell",key:"actions"},"");return n("div",{className:"mapp-grid-header"},n("div",{className:"mapp-grid-row"},t,_.map(e.cols,(e=>n("div",{className:"mapp-grid-cell",key:e.id},e.label))),a))}(),n("div",{className:"mapp-grid-body"},_.map(e.data,((a,s)=>function(a,s){return n("div",{className:"mapp-grid-row"+(t.dragover==s?" mapp-dragover":""),draggable:!0,key:s,onDragOver:e=>e.preventDefault(),onDragStart:e=>i({dragging:s}),onDragEnter:e=>i({dragover:s}),onDragEnd:e=>i({dragging:null,dragover:null}),onDrop:e=>l("sort",s)},function(t,a){if(!e.selectionColumn)return null;let o,i;return"rowid"==e.selectionColumn?o=a:t[e.selectionColumn]?o=t[e.selectionColumn]:i=!0,"checkbox"===e.selectionType?n("div",{className:"mapp-grid-cell"},n(v,{value:o,checked:e.selected==o,disabled:i,onChange:e=>{l("select",e?o:null)}})):n("div",{className:"mapp-grid-cell"},n(C,{checked:e.selected==o,onChange:()=>l("select",o)}))}(a,s),_.map(e.cols,((t,a)=>n("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:s+"-"+a},function(t,a){if(a.onRender)return a.onRender({id:a.id,value:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});switch(a.type){case"combobox":return n(k,{list:a.id+"_"+t,options:a.options,value:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});case"icon":return n(o.MappIconPicker,{iconid:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});default:return n(w,{size:e.data[t][a.size],value:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});case"select":return n(N,{value:e.data[t][a.id],options:a.options,onChange:e=>l("change",{i:t,id:a.id,value:e}),placeholder:""})}}(s,t)))),function(e){return n("div",{className:"mapp-grid-cell",key:"delete"},n(d,{icon:"trash",onClick:()=>l("delete",e)}))}(s))}(a,s))))),n("div",{className:"mapp-grid-toolbar"},n(d,{isSecondary:!0,onClick:()=>l("add")},__("Add"))))}function I(e){e={className:null,onRender:null,onSelect:null,initialTab:null,tabs:[],...e};const[t,a]=c({tab:e.initialTab?e.initialTab:e.tabs[0].name});function o(t){var o;o={tab:t},a((e=>({...e,...o}))),e.onSelect&&e.onSelect(t)}const{className:i="",style:l={}}=e;return n("div",{className:"mapp-tabs "+i,style:l},n("div",{className:"mapp-tabs-nav"},_.map(e.tabs,(e=>n("div",{className:e.name==t.tab?"mapp-tab mapp-active":"mapp-tab",key:e.name,onClick:()=>o(e.name)},e.label)))),n("div",{className:"mapp-tab-content"},e.onRender(t.tab)))}},315:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappOptionsMeta:()=>f});var o=a(577),n=a(939);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useCallback:p,useRef:c,useState:m}=wp.element,{Button:d,Dashicon:u,FormTokenField:g,Modal:h}=wp.components,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){e={errors:null,postEdit:null,userEdit:null,...e};const[t,a]=m({errors:e.errors?e.errors:[],isBusy:!1,isDone:!1,logs:[],otype:null,start:null});c(null);function r(e){a((t=>({...t,...e})))}function p(t){if(t)return i("div",{className:"mapp-option-geocode-log"},_.map(t,(t=>{let a="";return a="user"==t.otype?e.userEdit+"?user_id="+t.oid:e.postEdit+"?post="+t.oid+"&action=edit",i("div",{className:"mapp-option-geocode-log-row",key:t.oid},i("div",null,t.otype),i("div",null,t.oid),i("div",null,i("a",{href:a,target:"_blank"},t.title)),i("div",null,t.msg))})))}s((()=>{t.isDone&&r({isBusy:!1})}),[t.start,t.isDone]),s((()=>{null===t.start||t.isDone||n.mappLib.ajax({method:"POST",data:{action:"mapp_geocode",batch_size:5,nonce:mappl10n.options.nonce,otype:t.otype,start:t.start},callback:e=>{if(e&&"OK"==e.status){const a=e.data.logs.length<5;r({errors:e.data.errors,isBusy:!a,isDone:a,logs:t.logs.concat(e.data.logs),start:a?t.start:t.start+5})}}})}),[t.start,t.isDone]);const u=t.logs.length?t.logs.length:1;let g="";return t.isBusy?g=__("Geocoding... "+u):t.isDone&&(g=__("Done")),i(l,null,i(o.Option,{title:__("Geocoding")},i(d,{className:"mapp-option-geocode",disabled:t.isBusy,isBusy:t.isBusy,isSecondary:!0,onClick:()=>{t.isBusy||r({isDone:!1,isBusy:!0,errors:[],logs:[],otype:"post",start:0})}},__("Geocode posts")),g,i("div",{style:{fontStyle:"italic"}},__("For bulk geocoding (>100 items) online geocoding services are faster and less expensive.")),p(t.logs)),function(){const e=t.errors.length>0?p(t.errors):__("No errors");return i(o.Option,{title:__("Geocoding errors")},i("div",{className:"mapp-option-geocode-errors"},e))}())}},146:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>x});var o=a(577),n=a(107),i=a(641),l=a(939),s=a(346),r=a(315),p=a(614),c=a(697);const m=wp.element.createElement,{Fragment:d,useEffect:u,useLayoutEffect:g,useCallback:h,useRef:f,useState:b}=wp.element,{useSelect:v}=wp.data,{Button:y,Dashicon:k,FormTokenField:w,Modal:C}=wp.components,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function x(e){const[t,a]=b({...e,isCheckingLicense:!1,isSaving:!1});f(null);function g(e){a((t=>({...t,...e})))}function h(e){return _.map(e,((e,t)=>({value:t,label:e})))}function C(e,t){return e&&Array.isArray(e)&&e.length?(_.map(e,(e=>{for(let t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),t?e.filter((e=>{for(let t in e)if(!e[t]||0==e[t].length)return!1;return!0})):e.filter((e=>!(!e.hasOwnProperty("key")||!e.key)))):[]}function x(e,a){switch(e){case"license-check":g({isCheckingLicense:!0}),l.mappLib.ajax({method:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:t.license},callback:e=>{if(g({isCheckingLicense:!1}),e&&"OK"==e.status){let a={...t.helpers};a.license_status=e.data,g({helpers:a})}}});break;case"reset":g({isSaving:!0}),l.mappLib.ajax({method:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:e=>{g({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}});break;case"save":let e={...t};delete e.helpers,e.filters.post=C(e.filters.post,!1),e.filters.user=C(e.filters.user,!1),e.metaKeys.post=C(e.metaKeys.post,!0),e.metaKeys.user=C(e.metaKeys.user,!0),e.sizes=C(e.sizes,!0),e.autoicons&&e.autoicons.values&&(e.autoicons.values=C(e.autoicons.values,!0)),g({isSaving:!0}),l.mappLib.ajax({method:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:e},callback:e=>{g({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}})}}return u((()=>{mappl10n.options.engine!=t.engine&&x("save")}),[t.engine]),m("div",{className:"mapp-options"},m("form",{onSubmit:e=>{e.preventDefault(),x("save")}},m(o.Section,{title:__("Sample Map"),className:"mapp-demo-section"},m("div",{className:"mapp-options-demo"},m(s.MappMap,{alignment:"default",height:300,pois:[{address:"San Francisco, CA",id:1,title:"MapPress",body:__("Maps for WordPress"),point:{lat:37.774095,lng:-122.418731}}],width:"100%",zoom:8}))),mappl10n.options.pro&&(!t.helpers.is_multisite||t.helpers.is_super_admin||t.helpers.is_main_site)&&m(o.Section,{title:__("License")},m(o.Option,{title:__("MapPress license key"),className:"mapp-option-license"},m(o.Input,{value:t.license,name:"license",onChange:e=>{let a={...t.helpers};a.license_status="",g({license:e,helpers:a})},size:37,placeholder:__("Enter license to enable automatic updates")}),function(){const e=t.helpers.license_status,a=m(y,{isSecondary:!0,href:"https://mappresspro.com/mappress"},__("Get license")),o=m(y,{isBusy:t.isCheckingLicense,isSecondary:!0,onClick:()=>x("license-check")},__("Check now")),n=m(y,{isLink:!0,target:"_blank",href:"https://mappresspro.com/account"},__("Your account"));return t.license?"active"==e?m("span",{className:"mapp-license-status"},m(k,{icon:"yes"}),__("Active")):m(d,null,o,n,e&&!t.isCheckingLicense&&m("div",null,m(k,{icon:"no"}),"inactive"==e?__("License is invalid or expired"):e)):a}()),m(o.Option,{title:__("Beta versions")},m(o.Checkbox,{checked:t.betas,label:__("Enable updates for beta versions"),onChange:e=>g({betas:e})}))),m(o.Section,{title:__("Basic Settings")},m(o.Option,{title:__("Mapping API")},m(o.Radios,{options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:e=>{g({engine:e,geocoder:"google"==e?"google":""})},checked:t.engine,help:{href:"#toc-picking-a-mapping-api",text:__("Leaflet is free and requires no API key. Google requires an API key and has usage limits.")}})),"leaflet"==t.engine&&function(){const e=[{value:"nominatim",label:"Nominatim",disabled:t.mapbox},{value:"mapbox",label:"MapBox",disabled:!t.mapbox},{value:"google",label:"Google",disabled:!t.apiKey}];let a={};return"nominatim"==t.geocoder&&(a={text:__("Nominatim is free but inaccurate. Consider using Mapbox or Google instead."),type:"warning"}),a.href="#toc-picking-a-geocoder",m(o.Option,{title:__("Geocoder")},m(o.Radios,{options:e,checked:t.geocoder,onChange:e=>g({geocoder:e}),help:a}))}(),"leaflet"==t.engine&&function(){const e=m(y,{isSecondary:!0,href:"https://account.mapbox.com/access-tokens/",target:"_blank"},__("Get an Access Token"));return m(o.Option,{title:__("Mapbox access token")},m("div",{className:"mapp-option-mapbox"},m(o.Input,{name:"mapbox",value:t.mapbox,onChange:e=>{g({mapbox:e}),g({geocoder:e?"mapbox":"nominatim"})},placeholder:__("Enter token to use Mapbox"),size:50}),e),m("div",{className:"mapp-help-text"},__("Mapbox makes Leaflet maps look great and provides an excellent geocoder.")))}(),function(){const e=m(y,{isSecondary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key",target:"_blank"},__("Get an API Key"));return m(o.Option,{title:__("Google API key"),className:"mapp-option-apikey"},m(o.Input,{name:"apiKey",value:t.apiKey,onChange:e=>{g({apiKey:e})},placeholder:"google"==t.engine?__("Enter API key to use Google maps"):__("Enter API key to use Google geocoder"),size:50}),e)}()),m(o.Section,{title:__("Map Settings")},m(o.Option,{title:__("Automatic display")},m(o.Radios,{options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:t.autodisplay,onChange:e=>g({autodisplay:e})})),m(o.Option,{title:__("Map alignment")},m(o.Radios,{options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:t.alignment,onChange:e=>g({alignment:e})})),m(o.Option,{title:__("Directions")},m(o.Radios,{checked:t.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:e=>g({directions:e})})),m(o.Option,{title:__("Mini width")},m(o.Input,{value:t.mini,onChange:e=>g({mini:e}),size:3,label:__("Width (px) to use map/list toggle buttons")})),"leaflet"==mappl10n.options.engine&&m(o.Option,{title:__("Scroll wheel zoom")},m(o.Checkbox,{checked:t.scrollWheel,label:__("Enable map zoom with mouse scroll wheel"),onChange:e=>g({scrollWheel:e})}))),m(o.Section,{title:__("POIs")},m(o.Option,{title:__("Default zoom")},m(o.Select,{label:__("Default zoom when displaying a single POI"),value:t.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(e=>({value:e,label:e}))),onChange:e=>g({poiZoom:e})})),m(o.Option,{title:__("Hover")},m(o.Checkbox,{checked:t.tooltips,label:__("Open POIs on hover"),onChange:e=>g({tooltips:e})})),m(o.Option,{title:__("Open first POI")},m(o.Checkbox,{checked:t.initialOpenInfo,onChange:e=>g({initialOpenInfo:e}),label:__("Open first POI when a map is displayed")})),m(o.Option,{title:__("Travel lines")},m(o.Checkbox,{label:__("Connect POIs with lines"),checked:t.lines,onChange:e=>g({lines:e})})),function(){const e=e=>g({lineOpts:{...t.lineOpts,...e}}),a=t.lineOpts,i=m(o.Select,{label:__("Icon"),onChange:t=>{e(t?{icons:[{icon:{path:t}}]}:{icons:null})},options:[{value:0,label:__("Circle")},{value:1,label:__("Arrow")},{value:2,label:__("Open arrow")}],placeholder:__("None"),value:a.icons?a.icons[0].icon.path:null}),l=m(o.Checkbox,{label:__("Geodesic (curved) lines"),checked:!!a.geodesic,onChange:t=>e({geodesic:t})}),s=m(o.Checkbox,{label:__("Animate icon"),checked:!!a.animate,onChange:t=>e({animate:t})});return m(o.Option,{title:__("Travel line options"),className:"mapp-option-line-options"},m(o.Control,{labelRight:__("Color")},m(n.MappColorPicker,{color:a.color,weight:a.weight,opacity:a.opacity,isExtended:!0,onChange:t=>e(t)})),"google"==t.engine&&l,"google"==t.engine&&i,"google"==t.engine&&s)}()),m(o.Section,{title:__("POI List")},m(o.Option,{title:__("Display")},m(o.Checkbox,{checked:t.poiList,label:__("Show a list of POIs with each map"),onChange:e=>g({poiList:e})})),m(o.Option,{title:__("Position")},m("div",{className:"mapp-option-poilist-radios"},m(o.Radios,{checked:t.layout,options:[{value:"left",label:__("Left of map")},{value:"inline",label:__("Below map")}],onChange:e=>g({layout:e})}))),"left"==t.layout&&m(o.Option,{title:__("Initial open")},m("div",{className:"mapp-option-poilist-open"},m(o.Checkbox,{checked:t.poiListOpen,label:__("Open list when map is displayed"),onChange:e=>g({poiListOpen:e})}))),m(o.Option,{title:__("Paging")},m("div",{className:"mapp-option-poilist-page-size"},m(o.Input,{labelRight:__("POIs per page"),max:999,min:1,onChange:e=>g({poiListPageSize:e}),size:3,type:"number",value:t.poiListPageSize}))),m(o.Option,{title:__("Sort")},m(o.Checkbox,{checked:t.sort,label:__("Sort POI list by title"),onChange:e=>g({sort:e})}))),m(o.Section,{title:__("Styled Maps")},m(o.Option,{title:__("Default style")},m("div",{className:"mapp-option-style"},m(p.m,{selected:t.style,onChange:e=>{g({style:e}),mappl10n.options.style=e}}),m("div",null,__('Replace the default "roadmap" or "streets" style'))))),mappl10n.options.pro&&m(o.Section,{title:__("Icons")},m(o.Option,{title:__("Default icon")},m(i.MappIconPicker,{iconid:t.defaultIcon,onChange:e=>{mappl10n.options.defaultIcon=e,g({defaultIcon:e})}})),m(o.Option,{title:__("Icon directory")},m("code",null,t.helpers.icon_directory)),m(o.Option,{title:__("Highlight selected POI")},m(o.Radios,{checked:t.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:e=>g({highlight:e})}),"icon"==t.highlight&&m(i.MappIconPicker,{defaultIcon:t.defaultIcon,iconid:t.highlightIcon,onChange:e=>g({highlightIcon:e})})),function(){let e=t.iconScale&&Array.isArray(t.iconScale)?[...t.iconScale]:[0,0];return m(o.Option,{title:__("Icon size")},m(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[0]=t>0?t:"",g({iconScale:e}))},size:3,type:"number",value:e[0]?e[0]:""}),m("span",null," X "),m(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[1]=t>0?t:"",g({iconScale:e}))},size:3,type:"number",value:e[1]?e[1]:""}),m("span",null," (px) "))}(),function(){let e=h(t.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});const a=v((e=>{if("post_type"==t.autoicons.key)return h(t.helpers.post_types);const a=wp.data.select("core").getEntityRecords("taxonomy",t.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return a?a.map((e=>({value:e.slug,label:e.name}))):[]}),[t.autoicons.key]);return m(o.Option,{title:__("Automatic icons")},m(o.Select,{label:__('Be sure to set "Show in REST API" for custom taxonomies'),value:t.autoicons?t.autoicons.key:null,options:e,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.key=e,a.values=[],g({autoicons:a})},placeholder:""}),m(o.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:a},{id:"value",label:__("Icon"),type:"icon"}],data:t.autoicons.values,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.values=e,g({autoicons:a})}}))}()),m(o.Section,{title:__("Clustering")},m(o.Option,{title:__("Clustering")},m(o.Checkbox,{checked:t.clustering,label:__("Enable marker clustering"),onChange:e=>g({clustering:e})})),function(){let e=t.clusteringOptions?t.clusteringOptions:{};const a=(t,a)=>{e[t]=a,g({clusteringOptions:e})};if("google"==t.engine){const t="https://github.com/googlemaps/v3-utility-library/blob/3fca406/packages/markerclustererplus/src/markerclusterer.ts",n=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return m("div",{className:"mapp-option-clustering-options"},m(o.Option,{title:__("Max zoom")},m(o.Select,{help:{href:t},label:m(d,null,__("Disable clustering at zoom"),m("code",null,"maxZoom")),onChange:e=>a("maxZoom",e),options:_.map(n,(e=>({value:e,label:e}))),placeholder:__("None"),value:e.maxZoom})))}{const t="https://github.com/Leaflet/Leaflet.markercluster#all-options",n=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return m("div",{className:"mapp-option-clustering-options"},m(o.Option,{title:__("Max zoom")},m(o.Select,{help:{href:t},label:m(d,null,__("Disable clustering at zoom"),m("code",null,"disableClusteringAtZoom")),onChange:e=>a("disableClusteringAtZoom",e),options:_.map(n,(e=>({value:e,label:e}))),placeholder:__("Auto"),value:e.disableClusteringAtZoom})),m(o.Option,{title:__("Spiderfy")},m(o.Checkbox,{checked:e.spiderfyOnMaxZoom,help:{href:t},label:m(d,null,__("Spiderfy"),m("code",null,"spiderfyOnMaxZoom")),onChange:e=>a("spiderfyOnMaxZoom",e)})),m(o.Option,{title:__("Coverage")},m(o.Checkbox,{checked:void 0===e.showCoverageOnHover||e.showCoverageOnHover,help:{href:t},label:m(d,null,__("Show cluster bounds on hover"),m("code",null,"showCoverageOnHover")),onChange:e=>a("showCoverageOnHover",e)})))}}()),mappl10n.options.pro&&m(o.Section,{title:__("Mashups")},function(){const e=[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}];return m(o.Option,{title:__("Marker click")},m(o.Radios,{checked:t.mashupClick,options:e,onChange:e=>g({mashupClick:e})}))}(),m(o.Option,{title:__("Popup content")},m(o.Radios,{checked:t.mashupBody,options:[{value:"poi",label:__("POI title + body")},{value:"post",label:__("Post title + excerpt")}],onChange:e=>g({mashupBody:e})})),m(o.Option,{title:__("Thumbnails")},m(o.Radios,{checked:t.mashupThumbs,options:[{value:"poi",label:__("POI images")},{value:"post",label:__("Post featured image")}],onChange:e=>g({mashupThumbs:e})})),m(o.Option,{title:__("KMLs")},m(o.Checkbox,{checked:t.mashupKml,label:__("Include KML POIs in mashups"),onChange:e=>g({mashupKml:e})}))),mappl10n.options.pro&&m(o.Section,{title:__("Search")},m(o.Option,{title:__("Search")},m(o.Checkbox,{checked:t.search,label:__("Enable search for mashups"),onChange:e=>g({search:e})})),m(o.Option,{title:__("Search radius")},m(o.Select,{help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},label:__("Minimum search radius (km)"),value:t.radius,options:_.map([1,5,10,15,25,50,75,100,200,300],(e=>({value:e,label:e}))),onChange:e=>g({radius:e})})),m(o.Option,{title:__("Search country")},m(o.Select,{label:__("Country code for searches"),value:t.country,options:_.map(["","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","VI","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW"],(e=>({value:e,label:e}))),onChange:e=>g({country:e}),help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}})),mappl10n.options.ssl?m(o.Option,{title:__("User location")},m(o.Checkbox,{checked:t.userLocation,label:__("Show user location on map"),onChange:e=>g({userLocation:e})})):null,function(){if("google"!=t.engine)return m(o.Option,{title:__("Bounding box")},m(o.Input,{onChange:e=>g({searchBox:e}),help:{text:__("Restrict searches to a bounding box (optional)"),href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},placeholder:"SW lon, SW lat, NE lng, NE lat",size:45,value:t.searchBox}))}()),mappl10n.options.pro&&m(o.Section,{title:__("Mashup filters")},m(o.Option,{title:__("Filters position")},m(o.Radios,{options:[{value:"top",label:__("Top")},{value:"list",label:__("POI list")}],checked:t.filtersPos,onChange:e=>g({filtersPos:e})})),function(){const e=[{name:"post",label:__("Posts")},{name:"user",label:__("Users")}];return m(o.Option,{className:"mapp-option-filters",title:__("Filters")},m(o.MappTabs,{tabs:e,onRender:e=>m(o.MappCrudList,{data:t.filters&&t.filters[e]?t.filters[e]:[],isDraggable:!0,onChangeData:a=>{let o={...t.filters};o[e]=a,g({filters:o})},onRender:a=>function(e){let a,{otype:n,row:i,rowId:l,onChange:s,onDelete:r,...p}=e,c=h(t.helpers.taxonomies);a="user"==n?[{label:__("Role"),value:"role"}]:[{label:__("Post type"),value:"post"},{label:__("Text search"),value:"text"},{label:"──────────",value:"",disabled:!0},...c];const d=function(e){const t=_.findWhere(a,{value:e.key});return t?t.label:__("New filter")},u="text"==i.key?[{value:"input",label:__("Input")}]:[{value:"checkbox",label:__("Checkboxes")},{value:"radio",label:__("Radio buttons")},{value:"select",label:__("Select")}];return m(o.MappExpand,{actions:m("div",null,m(y,{icon:"trash",onClick:()=>r(),title:__("Delete")})),className:"mapp-option-filter",initialOpen:!i.key,showToggle:!0,title:d(i)},m("div",{className:"mapp-option-filter-row"},m(o.Select,{labelTop:__("Filter type"),options:a,onChange:e=>s({key:e,format:"text"==e?"input":"checkbox"}),placeholder:"",value:i.key?i.key:""}),m(o.Select,{onChange:e=>s({format:e}),labelTop:__("Format"),options:u,placeholder:"",value:i.format?i.format:""}),m(o.Input,{labelTop:__("Label"),placeholder:d(i),value:i.label,onChange:e=>s({label:e})}),"post"!=i.key&&"meta"!=i.key&&"text"!=i.key&&m(o.Select,{labelTop:__("Sort"),value:i.sort,options:[{value:"name",label:__("Name")},{value:"slug",label:__("Slug")}],onChange:e=>s({sort:e})})),i.key&&"meta"!=i.key&&"text"!=i.key&&m("div",{className:"mapp-option-filter-row mapp-option-filter-tokens"},m(w,{label:__("Include term slugs"),value:i.include,onChange:e=>s({include:e}),__experimentalShowHowTo:!0}),m(w,{label:__("Exclude term slugs"),value:i.exclude,onChange:e=>s({exclude:e})})))}({otype:e,...a})})}))}()),mappl10n.options.pro&&m(o.Section,{title:__("Templates")},m(o.Option,{title:__("Custom templates")},m(c.MappTemplateEditor)),m(o.Option,{title:__("Directions link")},m(o.Checkbox,{checked:t.directionsPopup,label:__("Show in popup"),onChange:e=>g({directionsPopup:e})}),m(o.Checkbox,{checked:t.directionsList,label:__("Show in list"),onChange:e=>g({directionsList:e})})),m(o.Option,{title:__("Thumbnails")},m(o.Select,{label:__("Popups"),onChange:e=>g({thumbsPopup:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsPopup}),m(o.Select,{label:__("POI lists"),onChange:e=>g({thumbsList:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsList})),m(o.Option,{title:__("Popup thumbnail size")},m(o.Select,{onChange:e=>g({thumbSize:e}),options:h(t.helpers.thumbnail_sizes),value:t.thumbSize}),m("span",null," "+__("or")+" "),m(o.Input,{value:t.thumbWidth,onChange:e=>g({thumbWidth:e}),type:"number",min:0,max:9999}),m("span",null," X "),m(o.Input,{value:t.thumbHeight,onChange:e=>g({thumbHeight:e}),type:"number",min:0,max:9999}),m("span",null," (px) "))),m(o.Section,{title:__("Localization")},function(){const e="leaflet"==t.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport";return m(o.Option,{title:__("Language")},m(o.Select,{value:t.language,options:h(t.helpers.languages),onChange:e=>g({language:e}),help:{href:e,text:__("Language for searches and Google map controls")}}))}(),m(o.Option,{title:__("Directions server")},m(o.Input,{value:t.directionsServer,onChange:e=>g({directionsServer:e}),size:25}))),mappl10n.options.pro&&m(o.Section,{title:__("Generate Maps from Custom Fields")},function(){const e=[{name:"post",label:__("Posts")},{name:"user",label:__("Users")}];return m(o.Option,{className:"mapp-option-metakeys",title:__("Field mapping")},m(o.MappTabs,{tabs:e,onRender:e=>m(o.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:h(t.helpers.meta_fields)},{id:"value",label:__("post"==e?"Post custom field":"User custom field"),type:"combobox",options:h("post"==e?t.helpers.meta_keys:t.helpers.meta_keys_user)}],data:t.metaKeys[e],onChange:a=>{let o={...t.metakeys};o[e]=a,g({metaKeys:o})}})}))}(),m(o.Option,{title:__("Post types")},m(o.Checkboxes,{values:t.postTypes,options:h(t.helpers.post_types),onChange:e=>g({postTypes:e})})),m(o.Option,{title:__("Overwrite")},m(o.Checkbox,{label:__("Overwrite maps on publish/save"),checked:t.metaSyncSave,onChange:e=>{g({metaSyncSave:e})}})),"google"==t.engine&&m(o.Option,{title:__("Google Server API key")},m(o.Input,{name:"apiKeyServer",value:t.apiKeyServer,onChange:e=>g({apiKeyServer:e}),size:50,help:{text:__("Server API key for geocoding. Only required if client key is restricted by referrer."),href:"https://mappresspro.com/mappress-documentation/#toc-google-api-keys"}})),m(r.MappOptionsMeta,{errors:t.helpers.geocoding_errors,postEdit:t.helpers.post_edit,userEdit:t.helpers.user_edit})),mappl10n.options.pro&&mappl10n.options.acfActive&&m(o.Section,{title:__("Frontend Forms")},m(o.Option,{title:__("Advanced Custom Fields")},m(o.Input,{className:"mapp-option-acf",name:"acf",value:t.acf,onChange:e=>{g({acf:e})},size:20}),__("ACF map field to include on MapPress mashups"),m(o.Help,{text:__("To generate MapPress maps from ACF fields, leave this blank and use the Geocoding section"),href:"https://mappresspro.com/mappress-documentation/#toc-frontend-forms"}))),m(o.Section,{title:__("Miscellaneous")},m(o.Option,{title:__("Map sizes")},m(o.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:t.sizes,onChange:(e,t)=>g({sizes:e,size:t}),selectionColumn:"rowid",selected:t.size})),t.helpers.jetpack?null:m(o.Option,{title:__("Scripts")},m(o.Checkbox,{checked:t.footer,label:__("Output scripts in footer"),onChange:e=>g({footer:e}),help:{text:__("Disable footer scripts if maps are output using AJAX")}})),m(o.Option,{title:"WPML"},m(o.Checkbox,{checked:t.wpml,label:__("Copy maps when overwriting a translation"),onChange:e=>g({wpml:e}),help:{href:"https://mappresspro.com/mappress-documentation#wpml"}})),m(o.Option,{title:__("Compatibility")},m("div",null,m(o.Checkbox,{checked:t.deregister,label:__("Prevent loading Google Maps multiple times"),onChange:e=>g({deregister:e})})),m("div",null,m(o.Checkbox,{checked:t.iframes,label:__("Output maps in iframes for better compatibility"),onChange:e=>g({iframes:e})})))),m("div",{className:"mapp-options-toolbar"},m(y,{isBusy:t.isSaving,className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),m(y,{isBusy:t.isSaving,isSecondary:!0,onClick:()=>x("reset")},__("Reset Defaults")))))}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-options-settings")&&wp.element.render(m(x,mappress_options_state),document.getElementById("mapp-options-settings"))}))},185:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappPicker:()=>C});var o=a(286),n=a(68),i=(a(939),a(27)),l=a(78);window.mapp=window.mapp||{};const s=wp.element.createElement,{select:r}=wp.data,{Fragment:p,useEffect:c,useLayoutEffect:m,useRef:d,useState:u}=wp.element,{BaseControl:g,Button:h,Dashicon:f,Icon:b,Modal:v,PanelBody:y,Spinner:k,TextControl:w}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function C(e){e={context:null,mapid:null,mode:null,onClose:null,onInsert:null,onTrash:null,...e};const[t,a]=u({counts:{all:null,trashed:null,object:null},filter:"all",isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:""}),{addSnackbar:p,renderSnackbar:m}=(0,l.D)(),g=d(null),y=d(null),C=d(null);function x(e){a((t=>({...t,...e})))}function N(e,t,a){mapp.store.mutateMap(e,{otype:"post",oid:t,postTitle:a})}function S(){e.onClose()}function L(e){"trashed"!=t.filter&&x({mode:"edit",mapid:e})}function O(a){let n,i=a.mapid==t.mapid;n=a.title?a.title:__("Untitled");let l,c=function(t){let a;return a="map"==e.context||"mashup"==e.context&&"post"==t.otype&&t.oid==mappl10n.options.oid?r("core/editor").getEditedPostAttribute("title"):t.post_title,a=a||__("Untitled"),"post"==t.otype&&t.oid>0&&t.oid==mappl10n.options.oid&&(a=__("Current post")),"post"==t.otype&&t.oid>0?t.oid==mappl10n.options.oid?a:s("a",{href:mappl10n.options.editurl+"?post="+t.oid+"&action=edit",target:"_blank",title:__("Edit post")},a):__("Unattached")}(a);l="trashed"==t.filter?s("div",{className:"mapp-pick-actions"},s("a",{href:"#",key:"restore",onClick:()=>{return e=a.mapid,mapp.store.mutateMap(e,{status:""}),void p(__("Map restored"));var e}},__("Restore")),s("a",{href:"#",className:"mapp-destructive",key:"delete",onClick:()=>{return o=a.mapid,confirm(mappl10n.delete_map_prompt)&&(mapp.store.destroyMap(o),p(__("Map deleted"))),t.mapid&&o==t.mapid&&e.onTrash&&e.onTrash(),void(y.current&&y.current.focus());var o}},__("Delete Permanently"))):s("div",{className:"mapp-pick-actions"},s("a",{href:"#",key:"edit",onClick:()=>L(a.mapid)},__("Edit")),"library"!=e.context&&s("a",{href:"#",key:"insert",onClick:t=>{return o=a.mapid,void e.onInsert(o);var o}},__("Insert into post")),s("a",{href:"#",key:"duplicate",onClick:e=>{return t=a.mapid,void mapp.store.duplicateMap(t,(e=>{p(__("Map copied")),x({mapid:e}),g.current&&(g.current.scrollTop=0)}));var t}},__("Copy")),s("a",{href:"#",className:"mapp-destructive",key:"trashed",onClick:e=>{return t=a.mapid,mapp.store.mutateMap(t,{status:"trashed"}),void p(__("Map moved to trash"));var t}},__("Trash")));let m=null;return m="post"==a.otype&&a.oid>0?s("a",{href:"#",onClick:()=>{return e=a.mapid,void mapp.store.mutateMap(e,{oid:0});var e}},__("Detach")):"library"==e.context?s(o.MappAttachControl,{onChange:(e,t)=>N(a.mapid,e,t)},__("Attach")):s("a",{href:"#",onClick:()=>N(a.mapid,mappl10n.options.oid,null)},__("Attach")),s("div",{className:"mapp-pick-item"+(i?" mapp-selected":""),key:a.mapid+a.otype+a.oid,ref:i?C:null},s("div",{className:"mapp-pick-col-mapid",onClick:()=>L(a.mapid)},a.mapid),s("div",{className:"mapp-pick-col-title"},s("div",{className:"mapp-title",onClick:()=>L(a.mapid)},n),s("div",null,l)),s("div",{className:"mapp-pick-col-otitle"},c,s("div",null,m)),"library"==e.context&&s("div",{className:"mapp-pick-col-shortcode"},s(h,{isSmall:!0,isSecondary:!0,onClick:e=>{!function(e){const t=document.createElement("input");document.body.appendChild(t),t.value='[mappress mapid="'+e+'"]',t.select(),document.execCommand("copy"),t.remove(),p(__("Shortcode copied"))}(a.mapid)}},__("Copy"))))}function M(e){return e&&e.length?s(i.MappPaginate,{count:e?e.length:0,onChange:e=>function(e){x({page:e}),g.current&&(g.current.scrollTop=0)}(e),page:t.page,pageSize:20}):null}c((()=>{const e=e=>{if(!e.isFetchingItems){let t={all:0,object:0,trashed:0};_.map(e.items,(e=>{"trashed"==e.status?t.trashed++:(t.all++,"post"==e.otype&&e.oid==mappl10n.options.oid&&t.object++)})),x({counts:t})}x({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)}),[]),c((()=>{mapp.store.fetchItems()}),[]),c((()=>{x({page:1})}),[t.filter,t.search]),c((()=>{"list"==t.mode&&y.current&&y.current.focus()}),[t.mode]);const E=_.filter(t.items,(function(e){if("trashed"==t.filter)return"trashed"==e.status;if("trashed"==e.status)return!1;if("object"==t.filter&&("post"!=e.otype||e.oid!=mappl10n.options.oid))return!1;var a=t.search.toLowerCase();return!a||(e.mapid.indexOf(a)>=0||(!!(e.post_title&&e.post_title.toLowerCase().indexOf(a)>=0)||!!(e.title&&e.title.toLowerCase().indexOf(a)>=0)))}));let P=s("div",{className:"mapp-list-panel"},s("div",{className:"mapp-gt-modal-header"},s("div",{className:"mapp-gt-modal-header-title"},s("h1",null,__("Maps")),s(h,{isPrimary:!0,onClick:()=>{x({mode:"edit",mapid:null})}},__("Add New"))),s(h,{onClick:()=>S(),icon:"no-alt"})),function(){let a=[{label:__("All"),value:"all"},{label:__("Attached to post"),value:"object",hide:"library"==e.context},{label:__("Trash"),value:"trashed"}];return s("div",{className:"mapp-pick-filter-wrapper"},s("div",{className:"mapp-pick-filter-tabs"},_.map(a,((e,a)=>{const o="mapp-pick-filter-tab"+(t.filter==e.value?" mapp-active":""),n=t.counts[e.value];if(!e.hide)return s("div",{className:o,href:"#",key:a,onClick:()=>function(e){x({filter:e})}(e.value)},e.label,null!=n&&s("span",{className:"mapp-pick-filter-count"},n))}))),function(){if("trashed"!=t.filter)return s("div",{className:"mapp-pick-search-wrapper"},s(w,{ref:y,className:"mapp-pick-search",tabIndex:1,placeholder:__("post title, map title, or map id"),onChange:e=>x({search:e}),size:50,value:t.search}),s(b,{icon:"search"}),(t.isFetchingItems||t.isAttaching&&"library"!=e.context)&&s(k,null))}())}(),function(a){if(a){const e=20*(t.page-1),o=e+20;a=a.slice(e,o)}let o="";return o=t.isFetchingItems?null:a.length?_.map(a,O):s("div",{className:"mapp-pick-message"},__("No maps found")),s("div",{className:"mapp-pick-items-section"},s("div",{className:"mapp-pick-items",ref:g},function(){let t=[{id:"mapid",className:"mapp-pick-col-mapid",label:__("ID"),sortable:!0},{id:"title",className:"mapp-pick-col-title",label:__("Map title"),sortable:!0},{id:"post_title",className:"mapp-pick-col-otitle",label:__("Attached to"),sortable:!0}];"library"==e.context&&t.push({id:"shortcode",className:"mapp-pick-col-shortcode",label:__("Shortcode"),sortable:!1});return s("div",{className:"mapp-pick-items-header"},_.map(t,(e=>s("div",{className:e.className,onClick:()=>{return t=e.id,void mapp.store.setSort({sortBy:t,sortAsc:mapp.store.state.sortBy!=t||!mapp.store.state.sortAsc});var t},key:e.id},e.label,e.sortable&&mapp.store.state.sortBy==e.id&&s(f,{icon:mapp.store.state.sortAsc?"arrow-up":"arrow-down"}),e.sortable&&mapp.store.state.sortBy!=e.id&&s(f,{icon:"leftright"})))))}(),o))}(E),function(e){return s("div",{className:"mapp-pick-toolbar"},M(e))}(E)),I=null;if("edit"==t.mode){let a=s("div",{className:"mapp-edit-panel"},s(n.MappEdit,{context:e.context,mapid:t.mapid,onClose:()=>{"edit"==e.mode?e.onClose():x({mode:"list"})},onSave:t=>function(t){"edit"==e.mode?e.onClose():(x({mode:"list",mapid:t.mapid}),p(sprintf(__("Map %d saved"),t.mapid)))}(t)}));I="library"==e.context?s(v,{className:"mapp-gt-modal",isDismissible:!1},a):a}const T="mapp-pick mapp-mode-"+t.mode+" mapp-context-"+e.context;return"library"==e.context?s("div",{className:T},P,I,m()):s(v,{className:"mapp-gt-modal "+T,isDismissible:"list"==t.mode,onRequestClose:()=>S(),shouldCloseOnEsc:"list"==t.mode,shouldCloseOnClickOutside:"list"==t.mode},P,I,m())}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-library")&&(mappl10n.options.otype="post",mappl10n.options.oid=0,wp.element.render(s(C,{context:"library"}),document.getElementById("mapp-library")))}))},885:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappSettings:()=>v});var o=a(614),n=a(78),i=a(577);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,{BaseControl:d,Button:u,ButtonGroup:g,Dashicon:h,Dropdown:_,Panel:f,PanelBody:b}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function v(e){e={center:null,context:null,height:null,mapid:null,mapTypeId:null,onChange:null,poiList:null,search:null,title:null,width:null,zoom:null,...e};const[t,a]=m({});const{addSnackbar:r,renderSnackbar:p}=(0,n.D)();function c(t,a){let o={};null!=a&&(o.height=a),null!=t&&(o.width=t),e.onChange(o)}const d="mce"!=e.context&&"library"!=e.context;return l("div",{className:"mapp-settings"},l(b,{title:__("Map settings"),initialOpen:d},"map"==e.context&&function(){const t=e.title?e.title:__("Untitled");return l("div",{className:"mapp-settings-row mapp-settings-title"},l(i.Control,{labelTop:__("Title")},t))}(),"map"==e.context&&l("div",{className:"mapp-settings-row"},l(i.Control,{labelTop:__("Map ID")},e.mapid)),function(){if("mashup"==e.context)return l("div",{className:"mapp-settings-row mapp-style-toggle"},l("div",null,__("Style")),l(o.m,{selected:e.mapTypeId,onChange:t=>function(t){e.onChange({mapTypeId:t})}(t)}))}(),function(){mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];var t=mappl10n.options.sizes.map(((e,t)=>({label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1})));t.unshift({height:"",label:__("Default"),value:0,width:""}),t.push({label:__("Custom"),value:"custom",disabled:!0});for(var a="custom",o=0;o<t.length-1;o++)t[o].width==e.width&&t[o].height==e.height&&(a=o);return l(s,null,l("div",{className:"mapp-settings-row"},l(i.Select,{className:"mapp-settings-dims-select",help:"",labelTop:__("Size"),value:a,options:t,onChange:e=>c(t[e].width,t[e].height)})),l("div",{className:"mapp-settings-row"},l(i.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vw")},labelTop:__("Width"),onChange:e=>c(e,null),value:e.width?e.width:""}),l(i.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vh")},labelTop:__("Height"),onChange:e=>c(null,e),value:e.height?e.height:""})))}(),l("div",{className:"mapp-settings-row"},l(i.Control,{className:"mapp-settings-viewport",labelTop:__("Center/Zoom")},l(g,{label:__("Center/Zoom")},l(u,{onClick:()=>(r(__("Viewport automatic")),void e.onChange({center:null,zoom:null})),isPressed:!e.center,isSmall:!0},__("Automatic")),l(u,{onClick:()=>function(){r(__("Viewport set"));const t=e.viewport.center?e.viewport.center.lat+","+e.viewport.center.lng:null;e.onChange({center:t,zoom:e.viewport.zoom})}(),isPressed:e.center,isSmall:!0},__("Set"))))),void 0,p()))}},78:(e,t,a)=>{"use strict";a.d(t,{D:()=>s});const{useEffect:o,useState:n}=wp.element,{createContext:i}=React,l=wp.element.createElement,s=()=>{const[e,t]=n({snackbars:[]});function a(e){t((t=>({...t,...e})))}o((()=>{if(e.snackbars.length){const t=setTimeout((()=>{let t=[...e.snackbars];t.shift(),a({snackbars:t})}),5e3);return()=>clearTimeout(t)}}),[e.snackbars]);return{addSnackbar:t=>a({snackbars:[...e.snackbars,t]}),renderSnackbar:()=>l("div",{className:"mapp-snackbars"},e.snackbars.map(((e,t)=>l("div",{className:"mapp-snackbar mapp-snackbar-show",key:t},e))))}}},66:(e,t,a)=>{"use strict";a.r(t);var o=a(939);window.mapp=window.mapp||{};mapp.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"mapid",sortAsc:!1,maps:{},items:[]}},mapp.Store.prototype={createMap:function(){let{success:e=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isFetchingMap=!1,this.publish(),e()},destroyMap:function(e){o.mappLib.ajax({method:"POST",data:{action:"mapp_delete",mapid:e,nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status&&(delete this.state.maps[e],this.destroyItem(e)),this.publish()}})},duplicateMap:function(e,t){this.state.isSavingMap=!0,this.publish(),o.mappLib.ajax({method:"POST",data:{action:"mapp_duplicate",mapid:e,nonce:mappl10n.options.nonce},callback:e=>{if(e&&"OK"==e.status){const a=e.data;this.saveItem(a.mapid,a),t&&t(a.mapid)}this.state.isSavingMap=!1,this.publish()}})},fetchMap:function(e){void 0===this.state.maps[e]?(this.state.isFetchingMap=!0,this.publish(),o.mappLib.ajax({method:"GET",data:{action:"mapp_get",mapid:e,nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status?(t.data.pois.map((e=>{e.id=o.mappLib.nanoid()})),this.state.maps[e]=t.data):this.state.maps[e]=null,this.state.isFetchingMap=!1,this.publish()}})):this.publish()},mutateMap:function(e,t){this.state.isSavingMap=!0,this.saveItem(e,t),this.state.maps[e]&&(this.state.maps[e]={...this.state.maps[e],...t}),this.publish(),o.mappLib.ajax({method:"POST",data:{action:"mapp_mutate",mapid:e,mapdata:t,nonce:mappl10n.options.nonce},callback:e=>{this.state.isSavingMap=!1,this.publish()}})},saveMap:function(e,t){e.mapid&&(this.state.maps[e.mapid]=e),this.state.isSavingMap=!0,this.publish(),o.mappLib.ajax({method:"POST",data:{action:"mapp_save",mapdata:e,nonce:mappl10n.options.nonce},callback:a=>{if(a&&"OK"==a.status){const o=a.data,n={...e,mapid:o};this.state.maps[o]=n,this.saveItem(o,n),t&&t(n)}this.state.isSavingMap=!1,this.publish()}})},destroyItem:function(e){let t=this.state.items?this.state.items:[],a=_.findIndex(t,{mapid:e});a>-1&&t.splice(a,1),this.state.items=[...t],this.publish()},fetchItems(e){if(this.state.itemsFetched)return this.publish(),void(e&&e(this.state.items));this.state.isFetchingItems=!0,this.publish(),o.mappLib.ajax({method:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status&&(this.state.items=t.data,this.sort(),this.state.itemsFetched=!0,e&&e(this.state.items)),this.state.isFetchingItems=!1,this.sort(),this.publish()}})},saveItem:function(e,t){let a=this.state.items?this.state.items:[],o=_.findWhere(a,{mapid:e});o?(_.map(["otype","oid","title","post_title","status"],(e=>{void 0!==t[e]&&(o[e]=t[e])})),o={...o}):(o={mapid:e,title:t.title,otype:mappl10n.options.otype,oid:mappl10n.options.oid,post_title:null},a.unshift(o))},setSort:function(e){e.sortBy&&(this.state.sortBy=e.sortBy),void 0!==e.sortAsc&&(this.state.sortAsc=e.sortAsc),this.sort(),this.publish()},sort:function(e,t){const a=(o="untitled",wp.i18n.__(o,"mappress-google-maps-for-wordpress"));var o;this.state.items.sort(((e,t)=>function(e,t,o,n){if(n=n?1:-1,"mapid"==o)return n*(Number(e.mapid)-Number(t.mapid));let i=e[o]?e[o]:a,l=t[o]?t[o]:a,s=n*i.localeCompare(l);return 0==s?Number(e.mapid)-Number(t.mapid):s}(e,t,this.state.sortBy,this.state.sortAsc)))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){let e=[...this.subs];for(let t of e)t(this.state)}},mapp.store=new mapp.Store},614:(e,t,a)=>{"use strict";a.d(t,{m:()=>w});var o=a(577),n=a(939),i=a(27);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,{Button:d,Dashicon:u,ExternalLink:g,Icon:h,Modal:f,Panel:b,PanelBody:v,PanelRow:y,Spinner:k}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function w(e){const[t,a]=m({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",isOpen:!1,isBusy:!1,isSearching:!1,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,snazzyPagination:null,snazzySearch:"",snazzySelected:null,snazzyStyles:null,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles});function r(e){a((t=>({...t,...e})))}function p(a){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=_.findIndex(t.userStyles,{id:a.id});i>=0&&!o&&!confirm(__("Style already exists, overwrite?"))||(r({isBusy:!0}),n.mappLib.ajax({method:"POST",data:{action:"mapp_style_save",style:a,nonce:mappl10n.options.nonce},callback:t=>{r({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,r({mode:"pick",userStyles:t.data}),e.onChange(a.id))}}))}function c(e){r({isSearching:!0,snazzyStyles:null}),n.mappLib.ajax({method:"GET",data:{sort:"popular",page:e,pageSize:50,text:t.snazzySearch,key:t.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){if(r({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles){r({snazzyStyles:_.map(e.styles,((e,t)=>(e.id=e.id+"",e)))})}else alert("Error: unable to fetch styles")}})}function u(e,t){t="large"==t||"small"==t?t:"small",t=800;let a=mappl10n.options.baseurl+"/images/json_style.png";if("leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(a="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):a=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(a=e.imageUrl),a)return l("img",{src:a,title:e.name})}function b(a,o){switch(a){case"close":case"pick-cancel":r({isOpen:!1});break;case"json-add":r({mode:"json-add"});break;case"json-cancel":case"mapbox-cancel":case"snazzy-cancel":r({mode:"pick"});break;case"json-edit":e.onChange(o.id),r({mode:"json-edit"});break;case"json-save":p(o,!0);break;case"mapbox-add":case"snazzy-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"mapbox-change-url":{let e,t,a;e=o.trim().toLowerCase(),e=e.replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/",""),e=e.split("?")[0];let n=e.split("/");2==n.length&&(t=n[0],a=n[1]),r({mapboxUrl:o,mapboxUser:t,mapboxId:a});break}case"mapbox-edit":e.onChange(o.id),r({mode:"mapbox",mapboxId:o.mapboxid,mapboxName:o.name,mapboxUrl:o.url,mapboxUser:o.user});break;case"mapbox-save":t.mapboxName&&t.mapboxUser&&p({id:t.mapboxId,name:t.mapboxName,mapboxid:t.mapboxId,provider:"mapbox",url:t.mapboxUrl,user:t.mapboxUser});break;case"mode":r({mode:o});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?r({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen to use styled maps."));break;case"pick-delete":confirm(mappl10n.delete_prompt)&&(i=o,_.findIndex(t.userStyles,{id:i})<0?n.mappLib.alert("Invalid delete"):(r({isBusy:!0}),n.mappLib.ajax({method:"POST",data:{action:"mapp_style_delete",id:i,nonce:mappl10n.options.nonce},callback:t=>{r({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,r({userStyles:t.data}),e.selected==i&&e.onChange(null))}})));break;case"pick-select":e.onChange(o),r({isOpen:!1});break;case"snazzy-save":{let e=_.findWhere(t.snazzyStyles,{id:o});e&&p({id:o,imageUrl:e.imageUrl,json:e.json,name:e.name});break}case"snazzy-search":c()}var i}function v(){let a;return"json-add"==t.mode?a={id:null,name:"",json:""}:"json-edit"==t.mode&&(a=e.selected?_.findWhere(t.userStyles,{id:e.selected}):null),l(C,{style:a,onSave:e=>b("json-save",e),onCancel:()=>b("json-cancel")})}function y(e){let a;return a=e.styles&&e.styles.length?_.map(e.styles,((t,a)=>function(e,t){let a,o="mapp-style"+(t.selected==e.id?" mapp-selected":"");(t.onEdit||t.onDelete)&&(a=l("div",{className:"mapp-style-actions"},l("a",{onClick:()=>t.onEdit(e)},__("Edit")),l(h,{icon:"trash",onClick:()=>t.onDelete(e.id)})));return l("div",{className:o,key:e.id},l("div",{className:"mapp-style-image",onClick:()=>t.onSelect(e.id)},u(e)),l("div",{className:"mapp-style-details"},l("div",{className:"mapp-style-title"},e.name),a))}(t,e))):t.isSearching?"":l("div",{className:"mapp-style-list-msg"},__("No results")),l("div",{className:"mapp-style-list-wrapper"},l("div",{className:"mapp-style-list-header"},e.title),l("div",{className:"mapp-style-list"},a))}return l(s,null,function(){const a=t.standardStyles.concat(t.userStyles);let o=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,n=_.findWhere(a,{id:o});return n=n||t.standardStyles[0],l(d,{className:"mapp-style-toggle",icon:u(n),iconSize:75,isSecondary:!0,onClick:()=>b("open",null),title:n.name})}(),"edit"==t.mode&&t.isOpen&&renderEdit(),"json-add"==t.mode&&t.isOpen&&v(),"json-edit"==t.mode&&t.isOpen&&v(),"mapbox"==t.mode&&t.isOpen&&function(){let e=t.mapboxUser&&t.mapboxId?u({user:t.mapboxUser,mapboxid:t.mapboxId,name:t.mapboxName},"large"):null;const a=!t.mapboxUser||!t.mapboxId||!t.mapboxName;return l(f,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:()=>b("mapbox-cancel"),shouldCloseOnClickOutside:!0},l("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),l(g,{href:"https://studio.mapbox.com"})),l("form",{className:"mapp-style-mapbox-form",onSubmit:e=>{e.stopPropagation(),e.preventDefault(),b("mapbox-save")}},l("label",null,l(o.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",labelTop:l(s,null,__("MapBox Share URL"),l(o.Help,{href:"#toc-mapbox-studio-styles"})),onChange:e=>b("mapbox-change-url",e),value:t.mapboxUrl})),l("label",null,l("div",{className:"mapp-style-mapbox-label"},__("Style name")),l(o.Input,{className:"mapp-style-mapbox-name",value:t.mapboxName,onChange:e=>r({mapboxName:e})})),l("div",{className:"mapp-style-mapbox-preview"},e),l("div",{className:"mapp-style-toolbar"},l("div",null,l(d,{isBusy:t.isBusy,isPrimary:!0,disabled:a,type:"submit"},__("Save")),l(d,{isBusy:t.isBusy,onClick:()=>b("mapbox-cancel")},__("Cancel"))))))}(),"pick"==t.mode&&t.isOpen&&function(){let a="";return t.userStyles&&t.userStyles.length&&(a=y({selected:e.selected,onEdit:e=>"leaflet"==mappl10n.options.engine?b("mapbox-edit"):b("json-edit",e),onDelete:e=>b("pick-delete",e),onSelect:e=>b("pick-select",e),styles:t.userStyles,title:__("Custom styles")})),l(f,{title:l("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:()=>b("close")},l("div",{className:"mapp-style-list-wrapper"},y({onSelect:e=>b("pick-select",e),selected:e.selected,styles:t.standardStyles,title:__("Standard styles")}),a),l("div",{className:"mapp-style-toolbar"},l("div",null,l(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>"leaflet"==mappl10n.options.engine?b("mapbox-add"):b("json-add")},__("New style")),"google"==mappl10n.options.engine&&l(d,{isBusy:t.isBusy,isSecondary:!0,onClick:()=>b("snazzy-add")},__("Download style")),l(d,{isBusy:t.isBusy,onClick:()=>b("pick-cancel")},__("Cancel")))))}(),"snazzy"==t.mode&&t.isOpen&&(t.snazzySelected,l(f,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:()=>b("snazzy-cancel"),shouldCloseOnClickOutside:!0},l("form",{className:"mapp-style-snazzy-form",onSubmit:e=>{b("snazzy-search"),e.preventDefault()}},l(o.Input,{className:"mapp-style-snazzy-search",value:t.search,placeholder:__("Search"),onChange:e=>r({snazzySearch:e})}),t.isSearching&&l(k,null),!t.isSearching&&l(d,{isPrimary:!0,icon:"search",onClick:()=>b("snazzy-search")})),y({selected:t.snazzySelected,styles:t.snazzyStyles,onSelect:e=>r({snazzySelected:e})}),l("div",{className:"mapp-style-toolbar"},l("div",null,l(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>b("snazzy-save",t.snazzySelected)},__("Save")),l(d,{isBusy:t.isBusy,onClick:()=>b("snazzy-cancel")},__("Cancel"))),function(){const e=t.snazzyPagination;return e&&t.snazzyStyles&&t.snazzyStyles.length?l(i.MappPaginate,{count:e.totalItems,onChange:e=>c(e),page:e.currentPage,pageSize:e.pageSize}):null}()))))}function C(e){const[t,a]=m((()=>{let t={...e.style},a="";try{a=JSON.stringify(JSON.parse(t.json),null,2)}catch(e){}return t.json=a,{style:t}}));function n(e){a((t=>({...t,...e})))}function i(a,o){let i={...t.style};switch(a){case"cancel":e.onCancel();break;case"change-json":i.json=o,n({style:i});break;case"change-name":i.name=o,n({style:i});break;case"save":i.json=i.json?JSON.stringify(JSON.parse(i.json)):"",e.onSave(i)}}let s;if(t.style.json)try{JSON.parse(t.style.json)}catch(e){s=e.toString()}let r=s?"mapp-json mapp-json-error":"mapp-json";return l(f,{title:l(o.Input,{value:t.style.name,onChange:e=>i("change-name",e),placeholder:__("Enter style name")}),className:"mapp-style-modal mapp-json-modal",onRequestClose:()=>i("cancel"),shouldCloseOnClickOutside:!0},l("div",null,__("JSON")),l("div",{className:r},l("textarea",{value:t.style.json,spellCheck:!1,onChange:e=>i("change-json",e.target.value)})),l("div",{className:"mapp-json-error"},s||""),l("div",{className:"mapp-json-toolbar"},l("div",null,l(d,{disabled:s,isBusy:t.isBusy,isPrimary:!0,onClick:()=>i("save")},__("Save")),l(d,{isBusy:t.isBusy,onClick:()=>i("cancel")},__("Cancel")))))}},573:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappCard:()=>f});var o=a(939);a(577);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:m}=wp.data,{Button:d,Dashicon:u,ExternalLink:g,Guide:h,Modal:_}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){let{icon:t,title:a,...o}=e;return n("div",{className:"mapp-support-card"},a&&n("div",{className:"mapp-support-card-title"},n("h3",null,t&&n(u,{icon:t}),a)),n("div",{className:"mapp-support-card-content"},o.children))}document.getElementById("mapp-support-page")&&wp.element.render(n((function(e){const[t,a]=c({engine:e.engine?e.engine:"leaflet",isOpen:e.isOpen,apiKey:e.apiKey,mapbox:e.mapbox});function s(e){a((t=>({...t,...e})))}function r(e){return n("div",{className:"mapp-guide-engine"+(e.selected?" mapp-selected":""),onClick:()=>e.onClick()},n("h2",{className:"mapp-guide-engine-title"},e.title),n("div",{className:"mapp-guide-engine-content"},e.content))}return p(null),l((()=>{}),[]),n("div",{className:"mapp-support"},n(i,null,n("div",{className:"mapp-support-section"},n("div",{className:"mapp-support-header"},n("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),n("h1",null,__("MapPress Support")),n("i",null,__("Build amazing maps with the easiest and most powerful mapping plugin available")),n("div",null,n(d,{className:"mapp-support-guide-toggle",isPrimary:!0,onClick:()=>s({isOpen:!0})},__("Open Setup Wizard"))))),n("div",{className:"mapp-support-section"},n("div",{className:"mapp-support-cards"},n(f,{icon:"book",title:__("Documentation")},n("p",null,__("Detailed plugin documentation:")),n(g,{href:"https://mappresspro.com/mappress-documentation/"},__("Documentation")),n(g,{href:"https://mappresspro.com/whats-new/"},__("What's new")),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Creating your first map"))),n(f,{icon:"warning",title:__("Troubleshooting")},n("p",null,n("b",null,__("Check for a plugin or theme conflict:"))),n("ol",null,n("li",null,__("Deactivate ALL other plugins")),n("li",null,__("Switch to a standard WordPress theme")),n("li",null,__("If the maps are working, reactivate one by one to find the conflict."))),n("p",null,__("For more info:")),n(g,{href:"https://mappresspro.com/mappress-faq/"},__("MapPress FAQ"))),n(f,{icon:"megaphone",title:__("Support")},n("p",null,__("Need some help?")),n(g,{href:"https://mappresspro.com/forums/forum/mappress-support/"},__("Support forum")),n(g,{href:"https://mappresspro.com/chris-contact/"},__("Contact")))))),function(){if(t.isOpen)return n(h,{className:"mapp-guide",onFinish:()=>function(e,a){if("save"===e){let e;s({isOpen:!1}),e="google"==t.engine?"google":t.mapbox?"mapbox":"nominatim",o.mappLib.ajax({method:"POST",data:{action:"mapp_option_save",nonce:mappl10n.options.nonce,settings:{engine:t.engine,apiKey:t.apiKey,mapbox:t.mapbox,geocoder:e}},callback:e=>{"OK"!=e.status&&alert("Unable to save settings. Please check the support troubleshooting guide.")}})}}("save"),pages:[{content:n("div",{className:"mapp-guide-page mapp-guide-engines"},n("h1",null,__("Please Choose a Mapping API")),n("p",null,__("MapPress supports both Leaflet and Google mapping APIs."),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-picking-a-mapping-api"},__("Learn more"))),n("div",{className:"mapp-guide-engines"},r({onClick:()=>s({engine:"leaflet"}),selected:"leaflet"==t.engine,title:"Leaflet",content:n("ul",null,n("li",null,__("No API key")),n("li",null,__("Free unlimited usage")),n("li",null,__("Good functionality")),n("li",null,__("Best for high traffic sites")))}),r({onClick:()=>s({engine:"google"}),selected:"google"==t.engine,title:"Google",content:n("ul",null,n("li",null,__("API key required")),n("li",null,__("Limited free usage")),n("li",null,__("Excellent functionality")),n("li",null,__("Best for low traffic sites")))}))),image:n("div",{className:"mapp-guide-header mapp-guide-image-small"},n("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),n("h1",null,__("Welcome to MapPress!")))},{content:"google"==t.engine?n("div",{className:"mapp-guide-page mapp-guide-apikey"},n("h1",null,__("Google API Key")),n("p",null,__("Google requires an API key to use Google Maps. Please enter your key below.")),n(d,{isPrimary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key/",target:"_blank"},__("Get an API Key")),n("input",{className:"mapp-guide-apikey",onChange:e=>s({apiKey:e.target.value}),placeholder:__("Enter your API key here"),value:t.apiKey})):n("div",{className:"mapp-guide-page mapp-guide-apikey"},n("h1",null,__("Sign up with Mapbox")),n("p",null,__("Mapbox makes Leaflet better, with great-looking map tiles, styled maps, and a powerful geocoder.")," "+__("A generous free tier means it's free for most sites."),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-using-mapbox-with-leaflet"},__("Learn more"))),n(d,{isPrimary:!0,href:"https://account.mapbox.com/auth/signup/",target:"_blank"},__("Get Mapbox Access Token")),n("input",{className:"mapp-guide-apikey",onChange:e=>s({mapbox:e.target.value}),placeholder:__("Enter your access token here"),value:t.mapbox})),image:n("div",{className:"mapp-guide-header mapp-guide-image-small"},"google"==t.engine&&n("img",{src:mappl10n.options.baseurl+"/images/google_logo.png"}),"leaflet"==t.engine&&n("img",{src:mappl10n.options.baseurl+"/images/mapbox_logo_white.png"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-gutenberg"},n("h1",null,__("Maps in the Block Editor")),n("p",null,__("MapPress provides custom block types for the Gutenberg editor.")),n("p",null,__("Just insert a MapPress Map block to get started."),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-gutenberg-block-editor"},__("Learn more")))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/gutenberg_map_block.gif"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-classic"},n("h1",null,__("Maps in the Classic Editor")),n("p",null,__('MapPress also supports the "classic" editor. Just click the MapPress button to open the map library.')),n("p",null,n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-classic-editor"},__("Learn more")))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/classic_map.gif"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-library"},n("h1",null,__("Map Library")),n("p",null,__("The Map Library provides an easy way to see and edit all of your maps. The library can be opened in the post editor or from the MapPress menu.")),n("p",null,n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Learn more")))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/library_menu.gif"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-end"},n("h1",null,__("Happy Mapping")),n("p",null,__("Enjoy the plugin! Replay this guide any time from the MapPress support menu."))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/icon-128x128"}))}]})}())}),mappress_support_state),document.getElementById("mapp-support-page"))},697:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappTemplateEditor:()=>f});var o=a(577),n=a(939);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useCallback:p,useRef:c,useState:m}=wp.element,{Button:d,Dashicon:u,Modal:g,TabPanel:h}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){const[t,a]=m({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null});function s(e){a((t=>({...t,...e})))}const r=p((e=>{if(null!=e){let a=wp.codeEditor.initialize(e);a.codemirror.setSize("auto","auto"),a.codemirror.setOption("readOnly","editor"!=t.tab),s({codeEditor:a})}}),[t.tab]);function c(){s({isOpen:!1})}function u(e){return"editor"==e?function(){const e=i("div",{className:"mapp-templates-tokens"},_.map(t.tokens,((e,a)=>i("code",{onClick:()=>function(e){let a=t.codeEditor.codemirror.getDoc(),o=a.getCursor();a.replaceRange("{{{poi."+e+"}}}",o)}(a),key:a,title:e},e))));return i(l,null,i("div",{className:"mapp-templates-path"},t.template.path),e,i("div",{className:"mapp-templates-editor"},i("textarea",{ref:r,defaultValue:t.template.content})))}():i(l,null,i("div",{className:"mapp-templates-standard"},i("textarea",{ref:r,defaultValue:t.template.standard})))}function h(){const e=t.template.name+" ("+(t.template.exists?__("Custom"):__("New"))+")";return i("div",{className:"mapp-templates-name"},e)}return i("div",{className:"mapp-templates"},function(){const e=[{name:"map-popup",label:__("Map popup")},{name:"map-item",label:__("Map list item")},{name:"mashup-popup",label:__("Mashup popup")},{name:"mashup-item",label:__("Mashup list item")},{name:"user-mashup-popup",label:__("User popup")},{name:"user-mashup-item",label:__("User list item")}];return i("div",{className:"mapp-templates-list"},_.map(e,((e,t)=>i("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:t=>{var a;t.preventDefault(),a=e.name,n.mappLib.ajax({method:"GET",data:{action:"mapp_tpl_get",name:a,nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status&&s({isOpen:!0,name:a,tab:"editor",template:e.data.template,tokens:e.data.tokens})}})}},e.label))))}(),t.isOpen&&t.template?i(g,{title:h(),className:"mapp-templates-modal",onRequestClose:()=>c(),shouldCloseOnClickOutside:!1},i(o.MappTabs,{className:"mapp-templates-tabs",onRender:e=>u(e),onSelect:e=>function(e){if("editor"!=e){let e={...t.template};e.content=t.codeEditor.codemirror.getValue(),s({template:e})}s({tab:e})}(e),tabs:[{name:"editor",label:__("Editor")},{name:"standard",label:__("Default")}]}),t.error&&i("div",{className:"mapp-templates-error"},t.error),i("div",{className:"mapp-templates-toolbar"},i("div",null,i(d,{isPrimary:!0,onClick:()=>function(){let e="editor"==t.tab?t.codeEditor.codemirror.getValue():t.template.content;n.mappLib.ajax({method:"POST",data:{action:"mapp_tpl_save",content:e,name:t.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&s({isOpen:!1,template:null,tokens:null})}})}()},__("Save")),i(d,{isSecondary:!0,onClick:()=>c()},__("Cancel"))),i("div",null,t.template.exists&&i(d,{isDestructive:!0,title:__("Reset template to default"),onClick:e=>{e.preventDefault(),confirm(mappl10n.delete_prompt)&&(n.mappLib.ajax({method:"POST",data:{action:"mapp_tpl_delete",name:t.template.name,nonce:mappl10n.options.nonce}}),s({isOpen:!1}))}},__("Reset"))))):null)}},326:(e,t,a)=>{"use strict";a.d(t,{useClickOutside:()=>c,useDebounce:()=>m,useResizeObserver:()=>d,useTimeout:()=>u});wp.element.createElement;const{Fragment:o,useCallback:n,useEffect:i,useLayoutEffect:l,useMemo:s,useRef:r,useState:p}=wp.element;function c(e,t){i((()=>{const a=a=>{e.current&&!e.current.contains(a.target)&&t()};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}}))}function m(e,t,a){const o=r(!1);i((()=>(o.current=!0,()=>o.current=!1)),[]);const l=_.debounce((function(){o.current&&e(...arguments)}),t);return n(l,a=a||[])}function d(e,t){const a=r();a.current=t,i((()=>{if(!e)return;const t=new ResizeObserver(((e,t)=>{a.current()}));return t.observe(e),()=>{t.disconnect()}}),[e])}function u(e,t){const a=React.useRef(null),o=React.useRef(e);return i((()=>{o.current=e}),[e]),i((()=>(t>0&&(a.current=window.setTimeout((()=>o.current()),t)),()=>{a.current&&window.clearTimeout(a.current)})),[t]),a}},939:(e,t,a)=>{"use strict";a.d(t,{mappLib:()=>o,mappEvent:()=>n,mappPoi:()=>i});const o={ajax:function(e){if("POST"==(e={cache:"no-cache",credentials:"same-origin",data:null,method:e.method?e.method:"GET",mode:"cors",redirect:"follow",referrerPolicy:"no-referrer",responseType:"json",url:e.url?e.url:mappl10n.options.ajaxurl,...e}).method)if(e.data instanceof FormData)e.body=e.data;else{const t=new FormData;t.append("action",e.data.action),t.append("nonce",e.data.nonce),t.append("data",JSON.stringify(e.data)),e.body=t}else"GET"==e.method&&(e.url+="?"+o.jQueryParam(e.data));fetch(e.url,e).then((t=>{if("html"==e.responseType)return t.text();if(t.ok)return t.json();throw Error(`Request rejected with status ${t.status}`)})).then((t=>{e.url!=mappl10n.options.ajaxurl||t&&"OK"==t.status||o.alert(t.status),t.output&&o.alert("MapPress: invalid output from a plugin or theme file. Deactivate plugins to find the problem. Output:\r\n"+t.output),e.callback&&e.callback(t)})).catch((t=>{if(e.error)return void e.error();const a=void 0!==t.message?t.message:t.statusText;o.alert("AJAX error -- "+a)}))},alert:function(e){mappl10n.options.admin||mappl10n.options.debug?alert(e):window.console&&console.error(e)},boundsToViewport:function(e){return e?{sw:o.toJSON(e.getSouthWest()),ne:o.toJSON(e.getNorthEast())}:null},getIcon:function(e){{const t=this.getIconUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:t,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:t}}},getIconUrl:function(e){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"},jQueryParam:function(e){var t=[],a=function(e,a){a=null==(a="function"==typeof a?a():a)?"":a,t[t.length]=encodeURIComponent(e)+"="+encodeURIComponent(a)},o=function(e,n){var i,l,s;if(e)if(Array.isArray(n))for(i=0,l=n.length;i<l;i++)o(e+"["+("object"==typeof n[i]&&n[i]?i:"")+"]",n[i]);else if("[object Object]"===Object.prototype.toString.call(n))for(s in n)o(e+"["+s+"]",n[s]);else a(e,n);else if(Array.isArray(n))for(i=0,l=n.length;i<l;i++)a(n[i].name,n[i].value);else for(s in n)o(s,n[s]);return t};return o("",e).join("&")},nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;const t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let a="",o=e;for(;o--;)a+=t[64*Math.random()|0];return a},pointToLatLng:function(e){return e?"leaflet"==mappl10n.options.engine?L.latLng(e):new google.maps.LatLng(e.lat,e.lng):null},template:function(e,t){if(o.templates=o.templates?o.templates:{},!o.templates[e]){var a=document.getElementById("mapp-tmpl-"+e).innerHTML;if(!a)return"";o.templates[e]=_.template(a,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return o.templates[e](t)},toJSON:e=>e.toJSON?e.toJSON():"undefined"!=typeof L&&e instanceof L.LatLng?{lat:e.lat,lng:e.lng}:"undefined"!=typeof L&&L.LatLngBounds&&e instanceof L.LatLngBounds?{south:e.getSouth(),west:e.getWest(),north:e.getNorth(),east:e.getEast()}:null,toUrlValue(e){return e.toUrlValue?e.toUrlValue():"undefined"!=typeof L&&e instanceof L.LatLng?Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6:null},viewportToBounds:function(e){return e&&e.sw&&e.ne?"leaflet"==mappl10n.options.engine?new L.LatLngBounds(L.latLng(e.sw.lat,e.sw.lng),L.latLng(e.ne.lat,e.ne.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(e.sw.lat,e.sw.lng),new google.maps.LatLng(e.ne.lat,e.ne.lng)):null}},n={addListener:function(e,t,a){let o=[];t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?(e.on(t[n],a),o.push({target:e,event:t[n],callback:a})):o.push(google.maps.event.addListener(e,t[n],a));return o},addListenerOnce:function(e,t,a){t=t.split(" ");for(var o=0;o<t.length;o++)"leaflet"==mappl10n.options.engine?e.once(t[o],a):google.maps.event.addListenerOnce(e,t[o],a)},clearInstanceListeners:function(e){"leaflet"==mappl10n.options.engine?e.off():google.maps.event.clearInstanceListeners(e)},clearListeners:function(e,t){t=t.split(" ");for(var a=0;a<t.length;a++)"leaflet"==mappl10n.options.engine?e.off(t[a]):google.maps.event.clearListeners(e,t[a])},removeListener:function(e){for(let t=0;t<e.length;t++)"leaflet"==mappl10n.options.engine?e[t].target.off(e[t].event,e[t].callback):google.maps.event.removeListener(e[t])},trigger:function(e,t,a){"leaflet"==mappl10n.options.engine?e.fire(t,a):google.maps.event.trigger(e,t,a)}},i={parseOverlay:function(e,t){if("google"==mappl10n.options.engine){if("kml"==e){const e=t.getDefaultViewport();return{point:e?o.toJSON(e.getCenter()):null,viewport:e?o.boundsToViewport(e):null}}const a=t instanceof google.maps.Polyline?{strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,stokeWeight:t.strokeWeight}:{fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight};if("circle"==e)return{point:o.toJSON(t.getCenter()),poly:{radius:t.getRadius(),...a}};if("rectangle"==e)return{viewport:o.boundsToViewport(t.getBounds()),poly:{...a}};if("polyline"==e){const e=[];return t.getPath().forEach((function(t){e.push(o.toJSON(t))})),{poly:{path:e,...a}}}if("polygon"==e){const e={fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight},a=[];return t.getPaths().forEach((function(e){var t=[];e.forEach((function(e){t.push(o.toJSON(e))})),a.push(t)})),{poly:{paths:a,...e}}}if(!e)return{point:o.toJSON(t.getPosition())}}else{if("kml"==e){const e=t.getBounds();return{point:e&&e.isValid()?o.toJSON(e.getCenter()):null,viewport:e&&e.isValid()?o.boundsToViewport(e):null}}if(!e)return{point:"leaflet"==mappl10n.options.engine?o.toJSON(t.getLatLng()):o.toJSON(t.getPosition())}}}}},346:(t,a,o)=>{"use strict";o.d(a,{MappMap:()=>I});var n=o(939),i=o(715),l=(o(817),o(602)),s=o(818),r=o(81),p=o(50),c=o(615);const m=wp.element.createElement,{Fragment:d,useEffect:u,useLayoutEffect:g,useMemo:h,useRef:f,useState:b}=wp.element;function v(e){e={anchor:null,className:null,content:null,map:null,onMouseEnter:null,onMouseLeave:null,point:null,...e};const t=f(null),[a,o]=b({isLoaded:null,mapDiv:"leaflet"==mappl10n.options.engine?e.map.getContainer():e.map.getDiv(),overlayView:null});function i(e){o((t=>({...t,...e})))}function l(){const o=t.current;if(!o)return;if(document.fullscreenElement||e.map.isFullscreen)return;let i;const{width:l,height:s}=o.getBoundingClientRect(),r=n.mappLib.pointToLatLng(e.point);if("leaflet"==mappl10n.options.engine)i=e.map.latLngToContainerPoint(r);else{const e=a.overlayView.getProjection();if(!e)return;i=e.fromLatLngToContainerPixel(r)}o.style.bottom=a.mapDiv.clientHeight-i.y-e.anchor.y+"px",o.style.left=i.x-l/2+e.anchor.x+"px"}return g((()=>{"google"==mappl10n.options.engine?a.overlayView||(a.overlayView=new google.maps.OverlayView,a.overlayView.onAdd=function(){i({isLoaded:!0})},a.overlayView.setMap(e.map)):(e.map.stop(),i({isLoaded:!0}))}),[]),g((()=>{if(!a.isLoaded)return;let t;return"google"==mappl10n.options.engine?a.overlayView.draw=()=>l():t=n.mappEvent.addListener(e.map,"move",(e=>l())),()=>{"google"==mappl10n.options.engine?a.overlayView.draw=null:n.mappEvent.removeListener(t)}})),g((()=>{a.isLoaded&&(l(),function(){const o=t.current;if(!o)return;const i=30,l=o.offsetWidth,s=o.offsetHeight,r=a.mapDiv.clientWidth,p=a.mapDiv.clientHeight,c=n.mappLib.pointToLatLng(e.point);let m;if("leaflet"==mappl10n.options.engine)m=e.map.latLngToContainerPoint(c);else{const e=a.overlayView.getProjection();m=e?e.fromLatLngToContainerPixel(c):null}if(!m)return;var d={x:m.x,y:m.y};m.x+l/2+e.anchor.x>r-i?d.x=Math.max(r-l/2-e.anchor.x-i,r/2-e.anchor.x):m.x-l/2+e.anchor.x<i&&(d.x=Math.min(l/2+e.anchor.x+i,r/2-e.anchor.x));m.y+e.anchor.y-s<i&&(d.y=s-e.anchor.y+i);d.y>=p&&(d.y=p-i);const u={x:m.x-d.x,y:m.y-d.y};(u.x<=-1||u.x>=1||u.y<=-1||u.y>=1)&&("leaflet"==mappl10n.options.engine?e.map.panBy([u.x,u.y]):e.map.panBy(u.x,u.y))}())}),[a.isLoaded]),a.isLoaded?m("div",{className:"mapp-ib-wrapper",ref:t,onMouseEnter:()=>{e.onMouseEnter&&e.onMouseEnter()},onMouseLeave:()=>{e.onMouseLeave&&e.onMouseLeave()}},m("div",{className:"mapp-ib-content"},m("div",{className:"mapp-ib"},m("div",{className:"mapp-iw "+(e.className?e.className:"")},e.content)),m("div",{className:"mapp-ib-tip"}))):null}var y=o(892),k=o(10),w=o(326);const C=n.mappLib.toJSON,{Fragment:x,useCallback:N,useEffect:S,useLayoutEffect:O,useRef:M,useState:E}=wp.element,P=wp.element.createElement,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function I(t){t={alignment:null,center:null,centerPoi:null,classname:null,container:null,height:null,initialOpenInfo:null,isEditable:null,layers:null,layout:null,lines:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,oid:null,otype:null,onDragDrop:null,onDrawingEvent:null,onPoiChange:null,onPopupHover:null,onRenderPopup:null,onRenderSidebar:null,onSearch:null,onViewportChange:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,query:null,search:null,width:null,zoom:null,...t};const[a,o]=E({clusterer:null,directionsTo:null,drawingManager:null,filters:null,hovered:null,hoveredDelay:null,hoveredPopup:null,iframe:window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?window.frameElement:null,init:null,isDirectionsOpen:null,isFetching:null,isGeolocating:null,isHidden:!1,isLoaded:null,isMounted:null,isMini:null,isSidebarOpen:null!=t.poiListOpen?t.poiListOpen:mappl10n.options.poiListOpen,kmlEvent:null,layers:{},layout:t.layout?t.layout:mappl10n.options.layout,map:null,opened:null,oid:t.oid?t.oid:mappl10n.options.oid,otype:t.otype?t.otype:mappl10n.options.otype,page:1,pageCount:0,parsedCenter:null,poiList:void 0!==t.poiList&&null!=t.poiList?t.poiList:mappl10n.options.poiList,pois:[],polyline:null,templates:t.query?"user"==t.otype?{item:"user-mashup-item",popup:"user-mashup-popup"}:{item:"mashup-item",popup:"mashup-popup"}:{item:"map-item",popup:"map-popup"},userLocation:null}),m=M(null),d=M(t.container),{geocode:u,geolocate:g}=(M(),(0,k.useGeocoding)({withBusinesses:t.isEditable}));function h(e){o((t=>({...t,...e})))}(0,w.useResizeObserver)(d.current,(function(){if(a.poiList&&"inline"!=a.layout&&d.current){const e=d.current.clientWidth<mappl10n.options.mini;null==a.isMini?e&&h({isMini:e,isSidebarOpen:!1}):e!=a.isMini&&h({isMini:e,isSidebarOpen:!e})}if(a.iframe&&"inline"==a.layout){const e=d.current.getBoundingClientRect().height;a.iframe.parentElement.style.height=e+"px",t.container.style.height="auto"}})),(0,w.useResizeObserver)(m.current,V),S((()=>{switch(a.init){case null:!function(){const e=[__("MapPress FAQ")+": http://mappresspro.com/mappress-faq",__("Support")+": http://mappresspro.com/chris-contact",__("Get an API Key")+": https://mappresspro.com/how-to-get-a-google-maps-api-key"];let t=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:__("Leaflet library not loaded"),text:__("A theme or plugin is preventing the Leaflet library from loading.")},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:__("Google Maps API not loaded"),text:__("A theme or plugin is preventing Google Maps from loading.")},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:__("Google Maps API key required")},{condition:document.querySelectorAll('script[src*="https://maps.googleapis.com/maps/api/js?v="]').length>1,title:__("Google Maps API loaded multiple times"),text:__("A theme or plugin has loaded Google Maps twice")},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")}];t=t.filter((e=>e.condition));let a=t.map((e=>e.title+" : "+e.text));a.length&&(console.log(__("Map Error")+"\n----------------\n"+a.join("\n")+"\n----------------\n"+e.join("\n")),mappl10n.options.admin&&alert(__("Map error: please see the developer console (F12 in most browsers) for details.")))}();let e,o={...t.mapOpts};o.minZoom=isNaN(parseInt(o.minZoom))?0:parseInt(o.minZoom),"leaflet"==mappl10n.options.engine?(e=new L.Map(m.current,{attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null,...o}),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(e)):e=new google.maps.Map(m.current,{backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!t.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},...o}),h({map:e}),mappl10n.options.userLocation&&mappl10n.options.ssl&&g((e=>{e&&e.geometry&&e.geometry.location&&h({userLocation:e.geometry.location})}),!0),u({value:t.center,callback:e=>{e&&e.geometry&&e.geometry.location?h({parsedCenter:{lat:e.geometry.location.lat,lng:e.geometry.location.lng}}):h({parsedCenter:null}),h({init:1})}});break;case 1:ee(t.mapTypeId),function(){if(t.isEditable&&"google"==mappl10n.options.engine&&google.maps.drawing){const e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};a.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),a.drawingManager.setMap(a.map)}}(),function(){a.polyline&&("leaflet"==mappl10n.options.engine?a.polyline.remove():a.polyline.setMap(null),h({polyline:null}));if(t.isEditable||!t.lines&&!mappl10n.options.lines||a.pois.length<2)return;const e={...mappl10n.options.lineOpts},o=[];if(_.map(a.pois,(e=>{o.push(z(e))})),"leaflet"==mappl10n.options.engine)h({polyline:new L.Polyline(o,e).addTo(a.map)});else{const t={strokeColor:e.color,strokeWeight:e.weight,strokeOpacity:e.opacity};e.icons&&(_.map(e.icons,(e=>{e.icon.path=parseInt(e.icon.path)})),e.icons[0].repeat="50px"),h({polyline:new google.maps.Polyline({map:a.map,path:o,...e,...t})}),e.animate&&e.icons&&e.icons.length&&function(){let e=0;const t=a.polyline.get("icons");t[0].repeat.replace("%","").replace("px","");window.setInterval((()=>{e+=1;t[0].offset=e+(t[0].repeat.indexOf("%")>=0?"%":"px"),a.polyline.set("icons",t)}),20)}()}}(),t.query?f((()=>h({init:2}))):(h({pois:t.pois?t.pois:[]}),h({init:2}));break;case 2:const i="leaflet"==mappl10n.options.engine?"load":"tilesloaded";n.mappEvent.addListenerOnce(a.map,i,(()=>{h({bounds:O()}),function(){if(mappl10n.options.clustering&&!t.isEditable){let e,t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?(e=L.markerClusterGroup(t),a.map.addLayer(e)):(t={...t,imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"},e=new MarkerClusterer(a.map,[],t)),h({clusterer:e})}}(),(t.initialOpenInfo||mappl10n.options.initialOpenInfo)&&!t.isEditable&&a.pois&&U(a.pois[0]),h({isLoaded:!0})})),W()}}),[a.init]);(0,w.useTimeout)((()=>{h({hoveredDelay:0}),a.hoveredPopup||h({hovered:null})}),a.hoveredDelay);function f(e){}function b(e){return a.pois.find((t=>t.id==e))}function N(e){return a.map.fitBounds(e)}function O(){try{return a.map.getBounds()}catch(e){return null}}function I(){let e;try{e=a.map.getCenter()}catch(t){e=null}return e?C(e):null}function T(){if(t.embed)return{width:"100%",height:"100%"};const e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],a=e=>"string"==typeof e&&(e.indexOf("px")>=0||e.indexOf("%")>=0||e.indexOf("vh")>=0||e.indexOf("vw")>=0)?e:e+"px";return{width:t.width?a(t.width):a(e.width),height:t.height?a(t.height):a(e.height)}}function D(e){let t;switch("leaflet"==mappl10n.options.engine&&"kml"!=e.type?null:e.type){case"polygon":t=new google.maps.LatLngBounds,e.poly.paths.map((e=>{e.map((e=>{t.extend(e)}))}));break;case"polyline":t=new google.maps.LatLngBounds,e.poly.path.map((e=>{t.extend(e)}));break;case"circle":const a=new google.maps.Circle({center:e.point,radius:e.poly.radius});t=a.getBounds();break;default:t=n.mappLib.viewportToBounds(e.viewport)}return t}function z(e,t){if(e.point&&!e.type)return"leaflet"==mappl10n.options.engine?L.latLng(e.point):new google.maps.LatLng(e.point.lat,e.point.lng);if("kml"==e.type&&t&&t.latLng)return t.latLng;const a=D(e);return"leaflet"==mappl10n.options.engine?a&&a.isValid()?a.getCenter():new L.latLng(0,0):a?a.getCenter():new google.maps.LatLng(0,0)}function B(){let e;try{e=a.map.getZoom()}catch(t){e=null}return e?parseInt(e):null}function F(){return!!(t.isEditable||t.search||mappl10n.options.search&&t.query)}S((()=>{a.isLoaded&&!t.query&&h({pois:t.pois?t.pois:[]})}),[t.pois]),S((()=>{a.isLoaded&&t.query&&f()}),[t.query,a.filters]),S((()=>{a.isLoaded&&null==t.center&&W(null)}),[t.center]),S((()=>{a.isLoaded&&ee(t.mapTypeId)}),[t.mapTypeId]),S((()=>{a.isLoaded&&H(t.centerPoi)}),[t.centerPoi]),S((()=>{if(!a.isLoaded)return;let e,o,i;return e=n.mappEvent.addListener(a.map,"moveend idle",(e=>R())),o=n.mappEvent.addListener(a.map,"click dragstart zoom_changed zoomstart",(e=>{"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||j()})),a.drawingManager&&(i=n.mappEvent.addListener(a.drawingManager,"overlaycomplete",(e=>{a.drawingManager.setDrawingMode(null),G(null),t.onDrawingEvent&&t.onDrawingEvent(e)}))),t.name&&(window[t.name]={getPois:()=>a.pois,poiOpen:e=>h({opened:"string"==typeof e?e:e.id})}),()=>{n.mappEvent.removeListener(e),n.mappEvent.removeListener(o),i&&n.mappEvent.removeListener(i)}}));const R=(0,w.useDebounce)((()=>{h({bounds:O(),page:1}),t.onViewportChange&&t.onViewportChange({center:I(),zoom:B()})}),500,[t.onViewportChange,a.map]);function A(e,a){if("poi"!=mappl10n.options.mashupClick&&t.query&&"post"==e.otype&&e.oid&&e.url)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":const t=document.createElement("div");return document.body.appendChild(t),ReactDOM.render(P(y.MappPopupModal,{onClose:()=>{wp.element.unmountComponentAtNode(t),t.remove()},poi:e}),t)}else U(e,a)}function j(){h({hovered:null,opened:null,isDirectionsOpen:!1})}function G(e,o){!t.isEditable&&mappl10n.options.tooltips&&(e&&e.id==a.opened||a.opened||h(e?{hovered:e.id,hoveredDelay:0}:o?{hoveredDelay:300}:{hovered:null,hoveredDelay:0}))}function U(e,t){j(),a.isMini&&q(!1),h({kmlEvent:t,opened:e.id})}function K(e){e?h({hoveredPopup:e.id,hoveredDelay:0}):(h({hoveredPopup:null}),a.hovered&&!a.opened&&h({hoveredDelay:300}))}function V(){"leaflet"==mappl10n.options.engine?a.map.invalidateSize():n.mappEvent.trigger(a.map,"resize"),0==d.current.offsetHeight?h({isHidden:!0}):a.isHidden&&(h({isHidden:!1}),W())}function q(e){h({isSidebarOpen:e=void 0!==e?e:!a.isSidebarOpen,isDirectionsOpen:!1}),setTimeout((()=>V()),100)}function W(e){e=null==e?a.parsedCenter:e;const o=t.zoom&&parseInt(t.zoom)?parseInt(t.zoom):null;if(e)return void te(e,o||1);if(0==a.pois.length)return void te({lat:0,lng:0},o||1);if(1==a.pois.length)return void H(a.pois[0]);let n="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var i=0;i<a.pois.length;i++){var l=D(a.pois[i]);n=l?"leaflet"==mappl10n.options.engine?n.extend(l):n.union(l):n.extend(z(a.pois[i]))}o?te(C(n.getCenter()),o):N(n)}function H(e){let a=null;if(t.zoom)a=parseInt(t.zoom);else if(mappl10n.options.poiZoom)a=parseInt(mappl10n.options.poiZoom);else if(e.viewport){var o=e.viewport.ne.lng-e.viewport.sw.lng;o<0&&(o+=360),a=Math.floor(Math.log(360*m.current.clientWidth/o/256)/Math.LN2)}te(z(e),a)}function Z(){return mappl10n.options.ssl?P("div",{className:"mapp-"+mappl10n.options.engine+"-geolocate-wrapper"},P("div",{className:"mapp-geolocate-control",onClick:()=>(h({isGeolocating:!0}),void g((e=>{h({isGeolocating:!1}),e&&e.geometry&&e.geometry.location&&te(e.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1)),title:__("Your Location")})):null}function J(){if(a.isLoaded)return F()?P("div",{className:"mapp-header"},F()&&a.map?P("div",{className:"mapp-search-container"},P(s.MappPlaces,{buttonLabel:t.isEditable?__("Add to map"):P("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:t.isEditable,includeBusinesses:t.isEditable,map:a.map,onSearch:e=>{t.onSearch?t.onSearch(e):function(e){if(!e||!e.geometry)return;const t=e.geometry.location?e.geometry.location:null,a=e.geometry.viewport?e.geometry.viewport:null;let o;if("leaflet"==mappl10n.options.engine){const e=new L.LatLng(t.lat,t.lng);o=a?new L.LatLngBounds(new L.LatLng(a.sw.lat,a.sw.lng),new L.LatLng(a.ne.lat,a.ne.lng)):e.toBounds(1e3*mappl10n.options.radius)}else{const e=new google.maps.Circle({center:t,radius:1e3*mappl10n.options.radius});o=a?new google.maps.LatLngBounds(new google.maps.LatLng(a.sw.lat,a.sw.lng),new google.maps.LatLng(a.ne.lat,a.ne.lng)).union(e.getBounds()):e.getBounds()}o&&N(o),te(t)}(e)}})):null,"top"==mappl10n.options.filtersPos&&null):null}function Y(){return P("div",{className:"mapp-content"},a.isFetching||a.isGeolocating?P(x,null,P("div",{className:"mapp-spinner-overlay"}),P("div",{className:"mapp-spinner"})):null,J(),P("div",{className:"mapp-main"},"inline"!=a.layout&&$(),P("div",{className:"mapp-canvas-panel"+("google"==mappl10n.options.engine?" mapp-google":" mapp-leaflet")},P("div",{className:"mapp-canvas",ref:m}),a.isLoaded&&a.userLocation?P(r.MappPoi,{isClusterable:!1,isEditable:!1,isOpen:!1,key:"user",map:a.map,poi:{point:a.userLocation,iconid:"geolocation"}}):null,function(){if(!a.isLoaded)return;return a.pois.map((o=>P(r.MappPoi,{key:o.id,isClusterable:!!a.clusterer&&!o.type,isEditable:!!t.isEditable,isHovered:o.id==a.hovered,isOpen:o.id==a.opened,map:a.map,onChange:e=>{t.onPoiChange&&t.onPoiChange(o.id,e)},onClick:e=>A(o,e),onClusterAdd:e=>function(e){a.clusterer&&("leaflet"==mappl10n.options.engine?a.clusterer.addLayer(e):a.clusterer.addMarker(e))}(e),onMouseOut:()=>{G(null,!0)},onMouseOver:()=>G(o),onRenderPopup:(o,n)=>function(o,n){const i=function(e){if(a.clusterer){if("leaflet"==mappl10n.options.engine){var t=a.clusterer.getVisibleParent(e);return t&&t!=e?t.getLatLng():null}const n=a.clusterer.getClusters();for(var o=0;o<n.length;o++){const t=n[o].markers_;if(t.length>1)for(let a=0;a<t.length;a++)if(t[a]==e)return n[o].center_}}}(n),l=z(o),s=C(i||l);let r,c,m={x:0,y:0};i?m={x:0,y:-14}:o.type||(m=mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32});a.kmlEvent&&(a.kmlEvent.pixelOffset&&(m={x:e.pixelOffset.width,y:e.pixelOffset.height}),a.kmlEvent.featureData?r=a.kmlEvent.featureData:a.kmlEvent&&a.kmlEvent.propagatedFrom&&a.kmlEvent.propagatedFrom.feature&&a.kmlEvent.propagatedFrom.feature.properties&&(r=a.kmlEvent.propagatedFrom.feature.properties));c=t.onRenderPopup?t.onRenderPopup(o,j):P(p.MappPoiContent,{context:"popup",feature:r,isEditable:t.isEditable,onDirectionsClick:()=>h({isDirectionsOpen:!0,directionsTo:o}),poi:o,template:a.templates.popup,thumbs:mappl10n.options.thumbsPopup});return P(v,{anchor:m,className:!t.isEditable&&mappl10n.options.thumbsPopup?"mapp-thumb-"+mappl10n.options.thumbsPopup:"",content:c,map:a.map,onMouseEnter:()=>K(o),onMouseLeave:()=>K(null),point:s})}(o,n),poi:o})))}(),t.isEditable||"leaflet"==mappl10n.options.engine||!a.map?null:P(l.MappMenuControl,{map:a.map,onCenter:()=>{j(),W()}}),Z())),a.poiList&&"inline"!=a.layout&&a.isMini?P("div",{className:"mapp-footer"},!a.isSidebarOpen&&P("div",{className:"mapp-button mapp-view-list",onClick:()=>q(!0)},P("img",{src:mappl10n.options.baseurl+"/images/outline_format_list_bulleted_black_18dp.png"}),"List"),a.isSidebarOpen&&P("div",{className:"mapp-button mapp-view-map",onClick:()=>q(!1)},P("img",{src:mappl10n.options.baseurl+"/images/outline_map_black_18dp.png"}),"Map")):null)}function X(){const e={paddingBottom:T().height};return P(x,null,P("div",{className:"mapp-wrapper",style:e},Y()),"inline"==a.layout&&$())}function Q(){if(!a.poiList||!a.isLoaded)return null;let e=[];return e=F()&&a.bounds&&!t.isEditable?a.pois.filter(((e,t)=>a.bounds.contains(z(e)))):a.pois,a.pageCount!=e.length&&h({pageCount:e.length}),P(c.MappPoiList,{className:!t.isEditable&&mappl10n.options.thumbsList?" mapp-thumb-"+mappl10n.options.thumbsList:"",hovered:a.hovered,isEditable:t.isEditable,isPaged:!!t.query,onClick:e=>A(b(e)),onDirectionsClick:e=>h({isDirectionsOpen:!0,directionsTo:b(e)}),onDragDrop:e=>{let{from:a,to:o}=e;return function(e,a){t.onDragDrop&&t.onDragDrop(e,a)}(a,o)},onMouseEnter:e=>G(b(e)),onMouseLeave:e=>G(null),onPage:e=>{h({page:e})},opened:a.opened,page:a.page,pois:e,template:t.isEditable?null:a.templates.item})}function $(){let e="mapp-sidebar";return e+="inline"==a.layout?" mapp-sidebar-inline":"",e+=a.isSidebarOpen?" mapp-sidebar-open":"",a.isDirectionsOpen?P("div",{className:e},function(){if(!a.isDirectionsOpen)return null;let e="";if(a.directionsTo)if(a.directionsTo.address)e=a.directionsTo.address;else{const t=C(z(a.directionsTo));e=t.lat+", "+t.lng}return P(i.MappDirections,{from:"",to:e,onClose:()=>{h({isDirectionsOpen:!1,directionsTo:null})}})}()):a.poiList?P("div",{className:e},P("div",{className:"mapp-sidebar-toggle",onClick:()=>q()}),"list"==mappl10n.options.filtersPos&&null,t.onRenderSidebar&&t.onRenderSidebar(),Q()):void 0}function ee(e){const t=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),o=_.find(t,(t=>t.id==e));!mappl10n.options.style||"roadmap"!=e&&"streets"!=e&&o||(e=mappl10n.options.style);let n=_.find(t,(t=>t.id==e));if(n=n||t[0],"leaflet"==mappl10n.options.engine){let e={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">&copy; Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">&copy; OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[n.provider],t={...e,...n};L.tileLayer(e.url,t).addTo(a.map)}else if(a.map.setMapTypeId("standard"==n.type?n.id:"roadmap"),n.json){let e=null;try{e=JSON.parse(n.json)}catch(e){console.log("Invalid JSON in map style")}a.map.setOptions({styles:e||null})}else a.map.setOptions({styles:null})}function te(e,t,o){"leaflet"==mappl10n.options.engine?(null==t&&(t=a.map.getZoom()?a.map.getZoom():0),a.map.setView(e,t,o)):(e=e&&!C(e)?{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}:e,t=t?parseInt(t):null,e&&a.map.setCenter(e),t&&a.map.setZoom(t))}return t.container?X():function(){const e=T();t.name&&t.name;let o="mapp-layout";o+="left"==a.layout?" mapp-list-left":" mapp-inline",a.isMini&&(o+=" mapp-mini");const n=t.alignment?t.alignment:mappl10n.options.alignment;n&&!document.body.classList.contains("block-editor-page")&&(o+=" align"+n,o+=" mapp-align-"+n);let i="full"==t.alignment?{width:"auto"}:{width:e.width};return P("div",{className:o,style:i,ref:d,tabIndex:"-1"},X())}()}},759:(e,t,a)=>{"use strict";a.d(t,{mappMarker:()=>n});var o=a(939);function n(e){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(e),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove(),this.div=document.createElement("div"),this.div.classList.add("mapp-marker")}n.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let t=e.fromLatLngToDivPixel(this.position),a=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.left=t.x-a.width/2+"px",this.div.style.top=t.y-a.height+"px"}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(e){let t="on"+e.type[0].toUpperCase()+e.type.slice(1);this[t]&&this[t](e)},onAdd:function(){let e=this.overlayView.getPanes();e&&(this.div||(this.div=document.createElement("div"),this.div.classList.add("mapp-marker")),e.overlayMouseTarget.append(this.div),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div),this.div.addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&o.mappEvent.trigger(this,"click"),this.dragging=null})),this.div.addEventListener("mouseenter",this),this.div.addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(e){o.mappEvent.trigger(this,"mouseover")},onMouseleave:function(e){o.mappEvent.trigger(this,"mouseout")},onPointerdown:function(e){const t=this.map.getDiv().getBoundingClientRect(),a=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:e.clientX,y:e.clientY},offset:{x:a.x-(e.clientX-t.left),y:a.y-(e.clientY-t.top)}},this.toggleDragEvents(!0)},onPointermove:function(e){if(Math.abs(e.clientX-this.dragging.startPixel.x)+Math.abs(e.clientY-this.dragging.startPixel.y)<3)return;const t=this.map.getDiv().getBoundingClientRect();let a={x:e.clientX-t.left+this.dragging.offset.x,y:e.clientY-t.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(a)),this.draw(),this.dragging.moved=!0,o.mappEvent.trigger(this,"dragstart")},onPointercancel:function(e){this.onPointerup(e)},onPointerup:function(e){this.dragging&&this.dragging.moved&&o.mappEvent.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(e,t){let a="set"+e[0].toUpperCase()+e.slice(1);this[a]&&this[a](t)},setDraggable:function(e){this.draggable=e,this.map&&this.div&&(this.div.removeEventListener("pointerdown",this,{passive:!0}),e&&this.div.addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(e){if(void 0!==e&&(this.icon=e),this.icon&&this.div){let e='<img draggable="false" src="'+this.icon.url+'">';this.div.innerHTML=e;let t=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.width=t.width+"px",this.div.style.height=t.height+"px",this.setZIndex(),this.draw()}},setMap:function(e){this.map=e,this.overlayView.setMap(e)},setPosition:function(e){this.position=e},setValues:function(e){for(const t in e)this.set(t,e[t])},setVisible:function(e){this.visible=e,this.div&&(this.div.style.visibility=e?"visible":"hidden")},setZIndex:function(e){this.zIndex=void 0!==e?e:this.zIndex,this.div&&(this.div.style.zIndex=e)},toggleDragEvents(e){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),e&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},602:(e,t,a)=>{"use strict";a.d(t,{MappMenuControl:()=>c});var o=a(326);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useRef:r,useState:p}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function c(e){e={layer:null,map:null,onCenter:null,...e};const[t,a]=p({activeLayer:e.layer?e.layer:null,layers:null,isOpen:!1}),s=r(null);function c(e){a((t=>({...t,...e})))}function m(){c({isOpen:!t.isOpen})}return(0,o.useClickOutside)(s,(()=>{t.isOpen&&m()})),l((()=>{if("google"==mappl10n.options.engine){c({layers:{traffic:{googleLayer:new google.maps.TrafficLayer,label:__("Traffic")},bicycling:{googleLayer:new google.maps.BicyclingLayer,label:__("Bicycling")},transit:{googleLayer:new google.maps.TransitLayer,label:__("Transit")}}})}}),[]),n("div",{ref:s},n("div",{className:"mapp-menu-toggle",onClick:()=>m()}),t.isOpen&&function(){const a=_.map(t.layers,((a,o)=>{const i=t.activeLayer==o?"mapp-menu-item mapp-active":"mapp-menu-item";return n("div",{className:i,key:o,onClick:()=>function(a){t.activeLayer&&t.layers[t.activeLayer].googleLayer.setMap(null),a!=t.activeLayer&&t.layers[a].googleLayer.setMap(e.map),c({activeLayer:a==t.activeLayer?null:a,isOpen:!1})}(o)},a.label)}));return n("div",{className:"mapp-menu"},n("div",{className:"mapp-menu-items"},n("div",{className:"mapp-menu-item",onClick:()=>(c({isOpen:!1}),void e.onCenter())},__("Center map")),"google"==mappl10n.options.engine&&n(i,null,n("div",{className:"mapp-menu-separator"}),a)),n("div",{className:"mapp-menu-footer"},n("a",{className:"mapp-menu-help",href:"https://mappresspro.com/mappress-documentation",target:"_blank"},n("span",null,__("Help")))))}())}},27:(e,t,a)=>{"use strict";a.d(t,{MappPaginate:()=>p});const o=wp.element.createElement,{Fragment:n,useEffect:i,useLayoutEffect:l,useRef:s,useState:r}=wp.element,{sprintf}=wp.i18n;function p(e){function t(t,a){const o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.page<o&&e.onChange(e.page+1);break;case"prev":e.page>1&&e.onChange(e.page-1)}}return function(){const a=Math.ceil(e.count/e.pageSize),n=e.isBusy||e.page<=1,i=e.isBusy||e.page>=a,l=n?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",s=i?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",r=(p="%d of %d",wp.i18n.__(p,"mappress-google-maps-for-wordpress"));var p;return o("div",{className:"mapp-paginate"},o("div",{className:l,onClick:()=>{n||t("first")}},"«"),o("div",{className:l,onClick:()=>{n||t("prev")}},"‹"),o("div",{className:"mapp-paginate-count"},sprintf(r,e.page,a)),o("div",{className:s,onClick:()=>{i||t("next")}},"›"),o("div",{className:s,onClick:()=>{i||t("last")}},"»"))}()}},818:(e,t,a)=>{"use strict";a.d(t,{MappPlaces:()=>d});var o=a(117),n=a(10);const i=wp.element.createElement,{Fragment:l,useCallback:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){e={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...e};const{geocode:t,getPredictions:a}=(0,n.useGeocoding)({map:e.map,includeBusinesses:e.includeBusinesses}),[l,s]=m({suggestions:[]});return i(o.MappAutocomplete,{buttonLabel:e.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:e.focus,onFetch:function(t){a({map:e.map,value:t,callback:e=>{var t;t={suggestions:e},s((e=>({...e,...t})))}})},onSelect:function(a){let{suggestion:o,value:n}=a;t({map:e.map,suggestion:o,value:n,callback:t=>{t&&e.onSearch(t)}})},placeholder:__("Search"),suggestions:l.suggestions,title:__("Enter an address, place, KML file URL, or lat,lng")})}},50:(e,t,a)=>{"use strict";a.d(t,{MappPoiContent:()=>m});var o=a(939);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:r,useRef:p,useState:c}=wp.element;wp.i18n.sprintf;function m(e){e={context:null,feature:null,isEditable:null,onDirectionsClick:null,poi:null,template:null,thumbs:null,...e};const[t,a]=c({imageNumber:0});function l(e){a((t=>({...t,...e})))}return n(i,null,function(){const a="list"!=e.context&&mappl10n.options.thumbWidth&&mappl10n.options.thumbHeight?{width:mappl10n.options.thumbWidth+"px",height:mappl10n.options.thumbHeight+"px"}:null,o=e.thumbs&&e.poi.images&&e.poi.images.length&&e.poi.images[t.imageNumber]?e.poi.images[t.imageNumber]:null;if(!o)return null;const i=function(e){switch(e.type){case"avatar":return n("div",{className:"mapp-avatar",dangerouslySetInnerHTML:{__html:e.html}});case"embed":return n("div",{className:"mapp-embed",dangerouslySetInnerHTML:{__html:e.html}});default:if("image"==e.type||!e.type){const t=e.size?{src:e.url,width:e.size[0]+"px",height:e.size[1]+"px"}:{src:e.url};return n("img",t)}}}(o);return n("div",{className:"mapp-thumbnail",onClick:()=>function(t){e.isEditable||"popup"!=e.context||"embed"==t.type||e.poi.url&&window.open(e.poi.url,"_blank")}(o),style:a},t.imageNumber>=1&&n("div",{className:"mapp-gallery-previous",onClick:e=>function(e){t.imageNumber>0&&(l({imageNumber:t.imageNumber-1}),e.stopPropagation())}(e)}),i,t.imageNumber<e.poi.images.length-1&&n("div",{className:"mapp-gallery-next",onClick:a=>function(a){t.imageNumber<e.poi.images.length-1&&(l({imageNumber:t.imageNumber+1}),a.stopPropagation())}(a)}))}(),n("div",{className:"mapp-info"},function(){let t={...e.poi};t.icon=o.mappLib.getIconUrl(e.poi.iconid),e.feature&&(t.body=e.feature.description,t.title=e.feature.name),t.props=t.props?t.props:{};const a=o.mappLib.template(e.template,{poi:t});return n("div",{className:"mapp-template",dangerouslySetInnerHTML:{__html:a}})}(),function(){var t;if(!(e.template.indexOf("user")>=0))return"popup"==e.context&&mappl10n.options.directionsPopup||"list"==e.context&&mappl10n.options.directionsList?n("div",{className:"mapp-dir-wrapper"},n("span",{className:"mapp-dir",onClick:t=>function(t){t.stopPropagation(),e.onDirectionsClick()}(t)},(t="Get Directions",wp.i18n.__(t,"mappress-google-maps-for-wordpress")))):void 0}()))}},615:(e,t,a)=>{"use strict";a.d(t,{MappPoiList:()=>u});var o=a(939),n=a(27),i=a(50);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useMemo:c,useRef:m,useState:d}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf;const u=wp.element.memo((function(e){e={className:null,hovered:null,isEditable:!1,isPaged:!1,onClick:null,onDragDrop:null,onMouseEnter:null,onMouseLeave:null,onPage:null,opened:null,page:1,pois:null,template:null,...e};const[t,a]=d({dragging:null,dragover:null,pageSize:!e.isEditable&&mappl10n.options.poiListPageSize?parseInt(mappl10n.options.poiListPageSize):20});function r(e){a((t=>({...t,...e})))}function p(a){let n,p="mapp-item";return e.opened!=a.id&&e.hovered!=a.id||(p+=" mapp-selected"),p+=t.dragover==a.id?" mapp-dragover":"",n=e.isEditable?l(s,null,l("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(a.iconid)}),l("div",{className:"mapp-title"},a.title)):l(i.MappPoiContent,{context:"list",onDirectionsClick:()=>e.onDirectionsClick(a.id),poi:a,template:e.template,thumbs:mappl10n.options.thumbsList}),l("div",{className:p,dangerouslySetInnerHTML:null,draggable:e.isEditable,key:a.id,onClick:()=>e.onClick(a.id),onDragOver:e=>e.preventDefault(),onDragStart:e=>r({dragging:a.id}),onDragEnter:e=>r({dragover:a.id}),onDragEnd:e=>r({dragging:null,dragover:null}),onDrop:o=>{return n=a.id,void(e.onDragDrop&&e.onDragDrop({from:t.dragging,to:n}));var n},onMouseEnter:t=>{e.onMouseEnter(a.id)},onMouseLeave:t=>{e.onMouseLeave(a.id)}},n)}return l("div",{className:"mapp-list "+(e.className?e.className:"")},e.isPaged&&function(){let t=1!=e.pois.length?__("%d Results"):__("%d Result");return t=sprintf(t,e.pois.length),l("div",{className:"mapp-list-header"},l("div",{className:"mapp-list-count"},t))}(),function(){const a=t.pageSize*(e.page-1),o=a+t.pageSize-1;return l("div",{className:"mapp-items",key:e.page},_.map(e.pois,((t,n)=>{if(!e.isPaged||n>=a&&n<=o)return p(t)})))}(),e.isPaged&&(!e.isPaged||e.pois.length<=t.pageSize?null:l("div",{className:"mapp-list-footer"},l(n.MappPaginate,{count:e.pois.length,onChange:t=>e.onPage(t),page:e.page,pageSize:t.pageSize}))))}))},81:(e,t,a)=>{"use strict";a.d(t,{MappPoi:()=>m});var o=a(939),n=a(759);wp.element.createElement;const{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:r,useRef:p,useState:c}=wp.element;function m(e){e={isClusterable:null,isEditable:null,isHovered:null,isOpen:null,map:null,onClusterAdd:null,onMouseOut:null,onMouseOver:null,poi:null,...e};const t=p(null),[a,i]=c({overlay:null});function s(t){r()&&"google"==mappl10n.options.engine&&("rectangle"==e.poi.type&&(o.mappEvent.clearListeners(a.overlay,"bounds_changed"),t&&o.mappEvent.addListener(a.overlay,"bounds_changed",(()=>{m()}))),"circle"==e.poi.type&&(o.mappEvent.clearListeners(a.overlay,"center_changed radius_changed"),t&&o.mappEvent.addListener(a.overlay,"center_changed radius_changed",(()=>{m()}))),"polygon"!=e.poi.type&&"polyline"!=e.poi.type||(o.mappEvent.clearListeners(a.overlay,"rightclick"),o.mappEvent.clearListeners(a.overlay.getPath(),"insert_at remove_at set_at"),t&&(o.mappEvent.addListener(a.overlay,"rightclick",(e=>{null!=e.vertex&&a.overlay.getPath().getLength()>2&&(a.overlay.getPath().removeAt(e.vertex),m())})),o.mappEvent.addListener(a.overlay.getPath(),"insert_at remove_at set_at",(()=>{m()})))))}function r(){return"google"==mappl10n.options.engine&&-1!=["polyline","polygon","circle","rectangle"].indexOf(e.poi.type)}function m(){const t=o.mappPoi.parseOverlay(e.poi.type,a.overlay);e.onChange(t)}function d(t,a){a?"leaflet"==mappl10n.options.engine?t.addTo(e.map):t.setMap(e.map):"leaflet"==mappl10n.options.engine?t.remove():t.setMap(null)}return l((()=>{const a="leaflet"==mappl10n.options.engine&&"kml"!=e.poi.type?null:e.poi.type,l=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");let s;switch(a){case"polygon":s=new google.maps.Polygon({paths:e.poi.poly.paths,...l});break;case"polyline":s=new google.maps.Polyline({path:e.poi.poly.path,...l});break;case"circle":const t=new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng);s=new google.maps.Circle({center:t,radius:parseFloat(e.poi.poly.radius),...l});break;case"rectangle":s=new google.maps.Rectangle({bounds:o.mappLib.viewportToBounds(e.poi.viewport),...l});break;case"kml":const a=e.poi.kml&&e.poi.kml.url?e.poi.kml.url:"";s="leaflet"==mappl10n.options.engine?omnivore.kml(a):new google.maps.KmlLayer({url:a,preserveViewport:!0,suppressInfoWindows:!0});break;default:s="leaflet"==mappl10n.options.engine?L.marker([e.poi.point.lat,e.poi.point.lng]):new n.mappMarker({position:new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng)}),s.setIcon(o.mappLib.getIcon(e.poi.iconid))}var p;return p={overlay:s},i((e=>({...e,...p}))),"kml"!=e.poi.type&&("leaflet"==mappl10n.options.engine?s.options.draggable=e.isEditable:s.setDraggable(e.isEditable),r()&&s.setEditable(e.isEditable)),e.isClusterable?(e.onClusterAdd(s),"google"==mappl10n.options.engine&&d(s,e.map)):d(s,e.map),t.current=s,()=>{d(t.current,null)}}),[]),l((()=>{if(a.overlay){const t=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");a.overlay.setOptions({...t})}}),[e.poi.poly]),l((()=>{a.overlay&&a.overlay.setIcon(o.mappLib.getIcon(e.poi.iconid))}),[e.poi.iconid]),l((()=>{a.overlay&&function(t){if(e.poi.type)return;if("icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&e.isEditable)return;var n="leaflet"==mappl10n.options.engine?a.overlay._icon:a.overlay.getDiv();if(!n)return;switch(e.isEditable?"circle":mappl10n.options.highlight){case"circle":n.classList.toggle("mapp-marker-circle",t);break;case"icon":var i=t?o.mappLib.getIcon(mappl10n.options.highlightIcon):o.mappLib.getIcon(e.poi.iconid);if("leaflet"==mappl10n.options.engine&&a.overlay.getIcon().options.iconUrl==i.options.iconUrl)return;a.overlay.setIcon(i);break;case"scale":n.classList.add("mapp-marker"),n.classList.toggle("mapp-marker-scale",t)}const l=t?1e4:0;"leaflet"==mappl10n.options.engine?e.poi.type||a.overlay.setZIndexOffset(l):a.overlay.set("zIndex",l)}(e.isHovered||e.isOpen)}),[e.isHovered,e.isOpen,a.overlay]),l((()=>{if(a.overlay)return o.mappEvent.addListener(a.overlay,"click",(t=>{e.onClick(t)})),o.mappEvent.addListener(a.overlay,"mouseover",(t=>e.onMouseOver(t))),o.mappEvent.addListener(a.overlay,"mouseout",(t=>e.onMouseOut(t))),"kml"==e.poi.type&&("leaflet"==mappl10n.options.engine?(o.mappEvent.addListenerOnce(a.overlay,"ready",(()=>{a.overlayUpdate()})),o.mappEvent.addListenerOnce(a.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+e.poi.kml.url)}))):(o.mappEvent.addListener(a.overlay,"defaultviewport_changed",(()=>{m()})),o.mappEvent.addListener(a.overlay,"status_changed",(()=>{"OK"!=a.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+e.poi.kml.url)})))),e.isEditable&&(s(!0),o.mappEvent.addListener(a.overlay,"dragstart",(()=>(s(!1),void(e.onChange&&e.onChange({viewport:null}))))),o.mappEvent.addListener(a.overlay,"dragend",(()=>(m(),void s(!0))))),()=>{o.mappEvent.clearInstanceListeners(a.overlay)}})),e.isOpen||e.isHovered?e.onRenderPopup(e.poi,a.overlay):null}},892:(e,t,a)=>{"use strict";a.d(t,{MappPopupModal:()=>m});var o=a(939);const n=wp.element.createElement,i=wp.element.createPortal,{Fragment:l,useEffect:s,useLayoutEffect:r,useRef:p,useState:c}=wp.element;function m(e){e={onClose:null,poi:null,...e};const[t,a]=c({isBusy:!1,html:null});function l(e){a((t=>({...t,...e})))}const r=React.createRef();function p(t){27==t.keyCode&&e.onClose()}return s((()=>(document.body.classList.add("mapp-modal-noscroll"),()=>document.body.classList.remove("mapp-modal-noscroll"))),[]),s((()=>{e.poi.oid&&(l({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_get_post",oid:e.poi.oid,nonce:mappl10n.options.nonce},responseType:"html",callback:e=>{l({isBusy:!1,html:e})}}))}),[e.poi.oid]),s((()=>{r.current&&r.current.focus(),console.log("focus"+document.activeElement)}),[r.current]),i(n("div",{className:"mapp-modal"},n("div",{className:"mapp-modal-backdrop",onClick:e.onClose,onKeyDown:p},n("div",{className:"mapp-modal-close",onClick:e.onClose},"×")),n("div",{className:"mapp-modal-content-wrapper",ref:r,onKeyDown:p,tabIndex:0},n("div",{className:"mapp-modal-content"},t.isBusy&&n("div",{className:"mapp-modal-spinner"}),!t.isBusy&&n("div",{className:"mapp-modal-template",dangerouslySetInnerHTML:{__html:t.html}}),n("div",{className:"mapp-modal-close",onClick:e.onClose},"X")))),document.body)}},308:(e,t,a)=>{"use strict";e.exports=function(e,t){var o=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),n=o.length,i=void 0,l=void 0,s=void 0,r=void 0,p=void 0,c=void 0,m=void 0,d=void 0,u=void 0,g=void 0,h=void 0,_=void 0,f=void 0,b=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},v="undefined"!=typeof window?window:a.g;v.$locutus=v.$locutus||{};var y=v.$locutus;for(y.php=y.php||{},t||(t=v),i=0;i<n&&(u=b((d=o[i].split("="))[0]),g=d.length<2?"":b(d[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(_=[],h=0,l=0;l<u.length;l++)if("["!==u.charAt(l)||h){if("]"===u.charAt(l)&&h&&(_.length||_.push(u.slice(0,h-1)),_.push(u.substr(h,l-h)),h=0,"["!==u.charAt(l+1)))break}else h=l+1;for(_.length||(_=[u]),l=0;l<_[0].length&&(" "!==(m=_[0].charAt(l))&&"."!==m&&"["!==m||(_[0]=_[0].substr(0,l)+"_"+_[0].substr(l+1)),"["!==m);l++);for(c=t,l=0,f=_.length;l<f;l++){if(p=c,(""===(u=_[l].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==l){for(r in s=-1,c)c.hasOwnProperty(r)&&+r>s&&r.match(/^\d+$/g)&&(s=+r);u=s+1}Object(c[u])!==c[u]&&(c[u]={}),c=c[u]}p[u]=g}}}}},a={};function o(e){var n=a[e];if(void 0!==n)return n.exports;var i=a[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(569),o(66),o(972),o(286),o(107),o(946),o(800),o(68),o(641),o(897),o(218),o(265),o(74),o(146),o(577),o(315),o(185),o(885),o(573),o(697)})();
1
+ (()=>{var t={117:(e,t,a)=>{"use strict";a.d(t,{MappAutocomplete:()=>d});var o=a(326);const n=wp.element.createElement,{Fragment:i,useCallback:l,useEffect:s,useLayoutEffect:r,useMemo:p,useRef:c,useState:m}=wp.element;function d(e){e={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...e};const t=c(null),a=c(null),[i,l]=m({isOpen:!1,value:""});function r(e){l((t=>({...t,...e})))}(0,o.useClickOutside)(t,(()=>{i.isOpen&&r({isOpen:!1})})),s((()=>{e.focus&&a.current&&a.current.focus()}),[]),s((()=>{i.map&&setMapTypeId(e.mapTypeId)}),[e.mapTypeId,i.map]);const p=(0,o.useDebounce)((t=>{e.onFetch&&e.onFetch(t)}),e.delay);function d(){let t;r({isOpen:!1}),e.suggestions&&(t=null==i.selected?e.suggestions[0]:e.suggestions[i.selected]),e.onSelect({suggestion:t,value:u})}const u=i.selected>=0&&e.suggestions&&e.suggestions[i.selected]?e.suggestions[i.selected].value:i.value;return n("div",{className:"mapp-autocomplete",ref:t},n("div",{className:"mapp-autocomplete-wrapper"},n("input",{className:e.className,onChange:e=>{!function(e){r({value:e,selected:null}),p(e)}(e.target.value)},onKeyDownCapture:t=>function(t){switch(t.stopPropagation(),t.code){case"Backspace":r({isOpen:i.value.length>1});break;case"Enter":d();break;case"Escape":r({isOpen:!1});break;case"ArrowUp":if(t.preventDefault(),e.suggestions&&0!=i.selected){const t=null==i.selected?e.suggestions.length-1:i.selected-1;e.suggestions[t]&&r({isOpen:!0,selected:t})}else r({selected:null});break;case"ArrowDown":if(e.suggestions&&i.selected<e.suggestions.length-1){const t=null==i.selected?0:i.selected+1;e.suggestions[t]&&r({isOpen:!0,selected:t})}else r({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:r({isOpen:!0})}}(t),placeholder:e.placeholder,ref:a,title:e.title,type:"text",value:u}),i.isOpen&&function(){if(e.suggestions&&e.suggestions.length)return n("div",{className:"mapp-autocomplete-list"},_.map(e.suggestions,((t,a)=>{const o="mapp-autocomplete-item"+(i.selected==a?" mapp-selected":"");return n("div",{className:o,key:a,onClick:()=>function(t,a){r({isOpen:!1,selected:a}),e.onSelect({suggestion:t})}(t,a)},t.value)})))}()),e.buttonLabel&&n("div",{className:"mapp-submit-button",onClick:()=>d()},e.buttonLabel))}},715:(e,t,a)=>{"use strict";a.d(t,{MappDirections:()=>p});const o=wp.element.createElement,{Fragment:n,useEffect:i,useLayoutEffect:l,useRef:s,useState:r}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function p(e){e={from:null,onClose:null,to:null,...e};const[t,a]=r({from:e.from?e.from:"",to:e.to?e.to:""});function n(e){a((t=>({...t,...e})))}function l(){e.onClose&&e.onClose()}function s(){const e=t.from.trim(),a=t.to.trim();let o=mappl10n.options.directionsServer;o="https://maps.google.com"==o?"https://www.google.com":o,-1==o.toLowerCase().indexOf("http")&&(o="https://"+o),o+="/maps/dir/?api=1&origin="+encodeURIComponent(e)+"&destination="+encodeURIComponent(a),window.open(o),l()}function p(e){13==e?s():27==e&&l()}return i((()=>{"google"==mappl10n.options.directions&&s()}),[]),"google"==mappl10n.options.directions?null:o("div",{className:"mapp-directions"},o("div",{className:"mapp-close",onClick:()=>l()}),o("div",null,o("input",{className:"mapp-dir-from",onChange:e=>n({from:e.target.value}),onKeyPress:e=>p(e.which),tabIndex:"1",placeholder:__("My location"),value:t.from}),o("div",{className:"mapp-dir-arrows",onClick:()=>{n({from:t.to,to:t.from})}})),o("div",null,o("input",{className:"mapp-dir-to",onChange:e=>n({to:e.target.value}),onKeyPress:e=>p(e.which),tabIndex:"2",value:t.to})),o("div",{className:"mapp-dir-toolbar"},o("div",{className:"mapp-submit-button",onClick:()=>s()},__("Get Directions"))))}},817:(e,t,a)=>{"use strict";a.d(t,{MappFilters:()=>m});var o=a(939),n=a(326);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useRef:p,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf,m=e=>{e={onChange:null,otype:"post",poiCount:0,...e};const t=(0,n.useDebounce)(e.onChange,500),[a,r]=c({filters:[],isBusy:!0,open:null,selected:{}});function m(e){r((t=>({...t,...e})))}const d=p({});function u(e,o){let n=a.selected[e.key]?a.selected[e.key].values:null;if("checkbox"==e.format){var i;const e=null===(i=n)||void 0===i?void 0:i.indexOf(o);e>-1?n.splice(e,1):(n=n||[],n.push(o))}else n=o?[o]:[];n.length?a.selected[e.key]={key:e.key,values:n,meta_key:e.meta_key,meta_values:e.meta_values}:delete a.selected[e.key],m({selected:a.selected}),t(a.selected)}function g(e){m({open:a.open==e?null:e})}function h(e){e.key;const t=[...e.values],n=a.selected[e.key]?a.selected[e.key].values:"";switch(e.format){case"input":return i("input",{type:"text",value:n?n[0]:"",onChange:t=>u(e,t.target.value)});case"checkbox":return _.map(t,(t=>i("label",{key:t.value},i("input",{checked:null==n?void 0:n.includes(t.value),key:t.value,onChange:t=>u(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"radio":return"radio"==e.format&&t.unshift({value:"",label:__("All")}),_.map(t,(t=>i("label",{key:t.value},i("input",{checked:n==t.value||""==t.value&&!n,key:t.value,onChange:t=>u(e,t.target.value),type:e.format,value:t.value}),t.iconid&&i("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(t.iconid)}),i("span",{dangerouslySetInnerHTML:{__html:t.label}}))));case"select":t.unshift({value:"",label:""});const a=_.map(t,(e=>'<option value="'+e.value+'">'+e.label+"</option>"));return i("select",{value:n[0],dangerouslySetInnerHTML:{__html:a},onChange:t=>u(e,t.target.value)})}}function f(o){return i("div",{className:"mapp-filter-dropdown"},function(e){return i("div",{className:"mapp-filter-values"},"all"==e?a.filters.map((e=>i(l,{key:e.key},i("div",{className:"mapp-filter-label"},e.label),h(e)))):h(e))}(o),"all"==o&&function(a){const o="all"==a?"all":a.key;let n=e.poiCount>1?__("%d Results"):__("%d Result");return n=sprintf(n,e.poiCount),i("div",{className:"mapp-filter-toolbar"},i("div",{className:"mapp-link-button",onClick:()=>(m({selected:{}}),void t())},__("Reset")),i("div",{className:"mapp-filter-count"},n),i("div",{className:"mapp-submit-button",onClick:()=>g(o)},__("Done")))}(o))}function b(e){const t="all"==e?"all":e.key,o="all"==e?__("Filter"):e.label,n="mapp-filter mapp-filter-"+t+(a.open==t?" mapp-filter-open":"");return i("div",{key:t,className:n,ref:e=>d.current[t]=e},i("div",{className:"mapp-button mapp-button-caret mapp-filter-button"+(a.isBusy?" mapp-button-disabled":""),onClick:()=>g(t)},o),f(e))}return(0,n.useClickOutside)({current:a.open&&d.current[a.open]?d.current[a.open]:null},(()=>{m({open:null})})),s((()=>{m({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_filters_get",nonce:mappl10n.options.nonce,otype:e.otype},callback:e=>{e&&"OK"==e.status?m({filters:e.data}):console.error("MapPress: unable to fetch filter data"),m({isBusy:!1})}})}),[]),i("div",{className:"mapp-filters"},b("all"),_.map(a.filters,(e=>e.isStandalone?b(e):null)))}},10:(e,t,a)=>{"use strict";a.d(t,{useGeocoding:()=>m});const o=a(939).mappLib.toJSON,{Fragment:n,useCallback:i,useEffect:l,useLayoutEffect:s,useRef:r,useState:p}=(wp.element.createElement,wp.element),c={google:function(){this.token=null;const e=document.createElement("div");this.placesService=new google.maps.places.PlacesService(e),this.autocompleteService=new google.maps.places.AutocompleteService}};c.google.prototype={getDetails:function(e){let{suggestion:t,callback:a}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var n={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(n,(function(e,t){if("OK"==t&&e&&e.geometry){if(e.geometry.location&&(e.geometry.location=o(e.geometry.location)),e.geometry.viewport){var n=o(e.geometry.viewport);e.geometry.viewport={sw:{lat:n.south,lng:n.west},ne:{lat:n.north,lng:n.east}}}a(e)}else a(null)}))},getFirstPrediction:function(e){let{map:t,value:a,callback:o}=e;this.getPredictions({map:t,value:a,callback:e=>{e&&Array.isArray(e)?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:a,includeBusinesses:o,callback:n}=e;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=t?t.getBounds():null;"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 l={input:a,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:o?null:["geocode"]};this.autocompleteService.getPlacePredictions(l,(function(e,t){"OK"==t&&e&&e.length?(e=(e=e.map((e=>(e.value=e.description,e)))).filter((e=>e.place_id)),n(e)):(t==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):t==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),n(null))}))}},c.mapbox=function(){},c.mapbox.prototype={getDetails:function(e){let{suggestion:t,callback:a}=e,o=t.place_name,n=o.indexOf(","),i=o.indexOf(",",n+1);n>0&&(o=parseInt(o.substr(0,n))?o.substr(0,i).replace(",",""):o.substr(0,n));let l=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;a({formatted_address:t.place_name,name:o,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:a,callback:o}=e;this.getPredictions({map:t,value:a,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:a,callback:o}=e;var n="https://api.mapbox.com/geocoding/v5/mapbox.places/"+a+".json?access_token="+mappl10n.options.mapbox;n=mappl10n.options.country?n+"&country="+mappl10n.options.country.toLowerCase():n,n=mappl10n.options.language?n+"&language="+mappl10n.options.language.toLowerCase():n;var i=t?t.getCenter():null;i&&(n+="&proximity="+i.lng+","+i.lat),mappl10n.options.searchBox&&(n+="&bbox="+mappl10n.options.searchBox),fetch(n).then((e=>e.json())).then((e=>{e&&e.features&&e.features.length>0?(e.features=e.features.map((e=>(e.value=e.label=e.place_name,e))),o(e.features)):o(null)}))}},c.nominatim=function(){},c.nominatim.prototype={getDetails:function(e){let{suggestion:t,callback:a}=e,o=t.display_name,n=o.indexOf(","),i=o.indexOf(",",n+1);n>0&&(o=parseInt(o.substr(0,n))?o.substr(0,i).replace(",",""):o.substr(0,n));let l=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;a({formatted_address:t.display_name,name:o,geometry:{location:{lat:t.lat,lng:t.lon},viewport:l}})},getFirstPrediction:function(e){let{map:t,value:a,callback:o}=e;this.getPredictions({map:t,value:a,callback:e=>{e&&e.length?this.getDetails({suggestion:e[0],callback:e=>o(e)}):o(null)}})},getPredictions:function(e){let{map:t,value:a,callback:o}=e;var n="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(a);if(n=mappl10n.options.country?n+"&countrycodes="+mappl10n.options.country.toLowerCase():n,n=mappl10n.options.language?n+"&accept-language="+mappl10n.options.language.toLowerCase():n,mappl10n.options.searchBox)n+="&viewbox="+mappl10n.options.searchBox,n+="&bounded=1";else{var i=t?t.getBounds():null;if(i){let e=i.getSouthWest(),t=i.getNorthEast();n+="&viewbox="+e.lng+","+e.lat+","+t.lng+","+t.lat}}fetch(n).then((e=>e.json())).then((e=>{e&&e.length?(e=e.map((e=>(e.value=e.display_name,e))),o(e)):o(null)}))}};const m=e=>{let{includeBusinesses:t}=e;function a(){let e="";return e="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new c[e]}function o(e,t){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){var a={lat:t.coords.latitude,lng:t.coords.longitude};e({name:a.lat+", "+a.lng,geometry:{location:a}})}),(function(a){if(!t){var o=a&&a.message?" : "+a.message:"";alert(mappl10n.no_geolocate+o)}e(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(e){let{map:n,suggestion:i,value:l,callback:s}=e;const r=a();l="string"==typeof l?l.trim():l,i||l?function(e){let{map:t,value:a,callback:n}=e;if(!a)return void n(null);if("string"!=typeof a){const e=a.lat&&a.lng?{geometry:{location:{lat:a.lat,lng:a.lng}}}:null;return void n(e)}if("http"==a.substring(0,4))return void n(a);if("user"==a)return void o((function(e){n(e)}));const i=a.split(",");if(2==i.length){const e=parseFloat(i[0]),t=parseFloat(i[1]);if(!isNaN(e)&&!isNaN(t))return void n({name:e+", "+t,geometry:{location:{lat:e,lng:t}}})}n(null)}({map:n,value:l,callback:e=>{e?s(e):i?r.getDetails({suggestion:i,callback:s}):r.getFirstPrediction({map:n,value:l,includeBusinesses:t,callback:s})}}):s(null)},geolocate:o,getPredictions:function(e){let{map:t,value:o,callback:n}=e;a().getPredictions({map:t,value:o,callback:n})}}}},286:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappAttachControl:()=>u});const o=wp.element.createElement,{addQueryArgs:n}=wp.url,{useCallback:i,useEffect:l,useState:s}=wp.element,{Button:r,Dashicon:p,Dropdown:c,Spinner:m,TextControl:d}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function u(e){const[t,a]=s({isFetching:!1,isOpen:!1,results:[],search:"",searchTerm:""});function r(e){a((t=>({...t,...e})))}l((()=>{r({isFetching:!0}),wp.apiFetch({path:n("/wp/v2/search",{search:t.search,per_page:20})}).then((e=>{r({results:e,isFetching:!1})}))}),[t.search]);const p=i(_.debounce((function(e){r({search:e})}),1e3),[]);function u(a,n){return o("div",{className:"mapp-attach-control"},o("div",{className:"mapp-attach-control-toolbar"},o(d,{autoComplete:"false",value:t.searchTerm,onChange:e=>function(e){r({searchTerm:e}),p(e)}(e),placeholder:__("Search")})),function(){if(t.isFetching)return o(m,null);if(t.results)return t.results.length?o("div",{className:"mapp-attach-items"},t.results.map((t=>o("div",{key:t.id,className:"mapp-attach-item",onClick:()=>{e.onChange(t.id,t.title)}},o("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),o("div",{className:"mapp-attach-item-type"},t.subtype))))):o("div",{},__("No posts found"))}())}return o("div",{className:"mapp-attach-control",onClick:e=>e.stopPropagation()},o(c,{renderToggle:e=>{let{isOpen:t,onToggle:a}=e;return o("a",{href:"#",onClick:a},__("Attach map to post"))},renderContent:e=>{let{isOpen:t,onToggle:a}=e;return u()}}))}},569:(e,t,a)=>{"use strict";a.r(t);var o=a(185);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useRef:r,useState:p}=wp.element,{Button:c,Dashicon:m,Modal:d}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function u(e){const[t,a]=p({isOpen:!0,mapid:null});function l(e){a((t=>({...t,...e})))}function s(){const e="undefined"!=typeof tinyMCE&&tinyMCE?tinyMCE.get("content"):null,t=e&&e.selection?e.selection.getSel():null;if(!t||void 0===t.anchorOffset||!t.anchorNode||!t.anchorNode.data)return null;let a=null,o=t.anchorNode.data,n=-1;for(let e=t.anchorOffset-1;e>=0;e--){let t=o[e];if("["==t){n=e;break}if("]"==t||"<"==t||">"==t)break}return n>=0&&(a=wp.shortcode.next("mappress",o,n),a)?a.shortcode.attrs.named.mapid:null}return n(i,null,n("button",{className:"button",type:"button",onClick:e=>{e.preventDefault(),l({isOpen:!0,mapid:s()})}},n(m,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&n(o.MappPicker,{context:"mce",mapid:t.mapid,onClose:()=>{l({isOpen:!1,mapid:null})},onInsert:e=>function(e){l({isOpen:!1});var t='[mappress mapid="'+e+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(t)}(e)}))}document.addEventListener("click",(e=>{e.target.classList.contains("mapp-classic-button")&&wp.element.render(n(u),e.target.parentElement)}))},107:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappColorPicker:()=>O});var o=a(577);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:m}=wp.data,{withState:d}=wp.compose,{Button:u,ColorPalette:g,ColorPicker:h,Dashicon:f,Dropdown:b,ExternalLink:v,Modal:y,Panel:k,PanelBody:w,PanelRow:C,Popover:x,RadioControl:N,Spinner:S,TabPanel:L}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function O(e){e={isExtended:null,onChange:null,color:null,opacity:null,weight:null,...e};const[t,a]=c({color:e.color,isCustomOpen:!1,isOpen:!1,opacity:e.opacity?e.opacity:1,weight:e.weight?e.weight:2});function s(e){a((t=>({...t,...e})))}function r(){s({isOpen:!1})}function p(a){s({color:a,isOpen:!1}),e.onChange({color:a,opacity:t.opacity,weight:t.weight})}return l((()=>{}),[]),n(i,null,n("span",{className:"mapp-colors-toggle",onClick:()=>{s({isOpen:!0})},style:{backgroundColor:e.color,border:e.isExtended?"1px solid "+e.color:"1px solid gray",opacity:e.isExtended&&e.opacity?e.opacity:1},tabIndex:0}),function(){if(!t.isOpen)return null;const a=_.map([1,.9,.8,.7,.6,.5,.4,.3,.2,.1,0],(e=>({label:100*e+"%",value:e}))),i=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(e=>({label:e+"px",value:e})));return n(y,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:()=>r()},n("div",{className:"mapp-colors"},n("div",{className:"mapp-colors-list"},_.map([["yellow","yellowgreen","green","seagreen","blue","cornflowerblue","darkslateblue","purple","firebrick","red","darkorange","orange","saddlebrown"],["lightyellow","greenyellow","lightgreen","darkseagreen","lightblue","skyblue","slateblue","orchid","plum","pink","sandybrown","goldenrod","peru"],["white","lightgray","gray","black"]],((t,a)=>n("div",{key:a},_.map(t,(t=>n("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:()=>{s({isCustomOpen:!1}),p(t)},style:{backgroundColor:t},title:t}))))))),t.isCustomOpen&&n(h,{color:e.color,onChangeComplete:e=>p(e.hex),disableAlpha:!0}),e.isExtended&&n(o.Select,{label:__("Opacity"),options:a,value:t.opacity,onChange:a=>{return s({opacity:o=a}),void e.onChange({color:t.color,opacity:o,weight:t.weight});var o}}),e.isExtended&&n(o.Select,{label:__("Stroke"),options:i,value:e.weight?e.weight:"",onChange:a=>{return s({weight:o=a}),void e.onChange({color:t.color,opacity:t.opacity,weight:o});var o}}),n("div",{className:"mapp-colors-toolbar"},n(u,{isPrimary:!0,onClick:()=>r()},__("Done")),n(u,{onClick:()=>s({isCustomOpen:!t.isCustomOpen})},__("Custom color")))))}())}},946:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>d});a(577);var o=a(939);const{Button:n}=wp.components,i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useCallback:p,useRef:c,useState:m}=wp.element,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){const[t,a]=m({error:"",isBusy:!1,isComplete:!1});function l(e){a((t=>({...t,...e})))}return i("div",{className:""},i(n,{isPrimary:!0,disabled:t.isComplete||t.isBusy,isBusy:t.isBusy,onClick:()=>{t.isBusy||(l({isBusy:!0}),o.mappLib.ajax({method:"POST",data:{action:"mapp_upgrade",nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status?l({isBusy:!1,isComplete:!0,error:null}):l({isBusy:!1,isComplete:!0,error:e.status})}}))}},__("Upgrade")),function(){if(t.isComplete)return t.error?i("div",{className:""},i("div",{className:"mapp-upgrade-error"},__("Error during update! Please contact support."),i("div",{className:""},t.error))):i("div",{className:"mapp-upgrade-success"},__("Success! Database updated."))}())}const u=document.getElementById("mapp-db-upgrade");u&&wp.element.render(i(d,null),u)},972:()=>{const e=wp.element.createElement,{Fragment:t,useEffect:a,useLayoutEffect:o,useRef:n,useState:i}=wp.element,{Button:l,Modal:s}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(t){const[o,n]=i({isOpen:!1,reason:"",reasonText:"",redirectUrl:null});function r(e){n((t=>({...t,...e})))}function p(e,t){switch(e){case"cancel":r({isOpen:!1});break;case"submit":r({isOpen:!1}),window.location.href=o.redirectUrl+"&mapp_reason="+o.reason+"&mapp_reason_text="+encodeURIComponent(o.reasonText.trim())}}return a((()=>{const e=document.getElementById("deactivate-mappress-google-maps-for-wordpress");if(!e)return;const t=e.addEventListener("click",(e=>{!function(e){const t=e?e.href:null;t&&r({isOpen:!0,redirectUrl:t})}(e.target),e.stopPropagation(),e.preventDefault()}));return()=>{e.removeEventListener("click",t)}}),[]),o.isOpen?e(s,{isDismissible:!0,onRequestClose:()=>p("cancel"),shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:__("Feedback")},function(){const t=!o.reason||"other"==o.reason&&!o.reasonText;return sprintf("<a href='https://mappresspro.com/chris-contact' target='_blank'>%s</a>",__("contact me")),e("div",{className:"mapp-deactivate"},e("div",{className:"mapp-deactivate-content"},e("h2",null,__("Sorry to see you go! Need help?"),e(l,{className:"mapp-deactivate-help",isSecondary:!0,href:"https://mappresspro.com/chris-contact",target:"_blank"},__("Contact me"))),e("h2",null,__("If not, I'd really appreciate some feedback:")),function(){const t=[{value:"badday",label:__("I don't want to say")},{value:"noapikey",label:__("I didn't want to set up an API key")},{value:"nodisplay",label:__("The map didn't display")},{value:"noaddress",label:__("My address wasn't found")},{value:"uglymap",label:__("The map looked too plain")},{value:"toohard",label:__("Too hard to use"),placeholder:__("What was too hard?")},{value:"feature",label:__("Missing feature"),placeholder:__("What's missing?")},{value:"other",label:__("Other"),placeholder:__("Can you provide any details?")}];return e("div",{className:"mapp-deactivate-reasons"},_.map(t,(t=>{const a=t.value==o.reason;return e("div",{className:"mapp-deactivate-reason",key:t.value},e("label",null,e("input",{checked:a,onChange:e=>r({reason:e.target.value}),type:"radio",value:t.value}),t.label),a&&t.placeholder&&e("div",null,e("textarea",{onChange:e=>r({reasonText:e.target.value}),placeholder:t.placeholder,value:o.reasonText})))})))}()),e("div",{className:"mapp-deactivate-footer"},e(l,{isSecondary:!0,disabled:t,onClick:()=>p("submit")},__("Deactivate")),e(l,{isPrimary:!0,onClick:()=>p("cancel")},__("Cancel"))))}()):null}document.addEventListener("DOMContentLoaded",(()=>{const t=document.createElement("div");wp.element.render(e(r),t)}))},800:(e,t,a)=>{"use strict";a.r(t);var o=a(185);wp&&wp.plugins&&wp.plugins.registerPlugin&&wp.editPost&&wp.plugins.registerPlugin("mappress-document-settings-panel",{render:function(){const{PluginDocumentSettingPanel:e}=wp.editPost,t=wp.element.createElement,{Fragment:a,useEffect:n,useLayoutEffect:i,useRef:l,useState:s}=wp.element,{Button:r,Spinner:p}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),[c,m]=s({isFetchingItems:!0,isPickerOpen:!1,items:null,pickerMapid:null,pickerMode:"list"});function d(e){m((t=>({...t,...e})))}function u(e){let a=e.title?e.title:__("Untitled");return t("div",{className:"mapp-document-item",key:e.mapid+e.otype+e.oid},t("a",{className:"mapp-document-col-title",href:"#",onClick:t=>{d({isPickerOpen:!0,pickerMapid:e.mapid,pickerMode:"edit"})}},a),t("div",{className:"mapp-document-col-mapid"},e.mapid))}return n((()=>{const e=e=>{d({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)})),n((()=>{mapp.store.fetchItems()}),[]),t(e,{title:"MapPress",className:"mapp-document-panel"},function(){const e=_.filter(c.items,(e=>"post"==e.otype&&e.oid==mappl10n.options.oid));let o;return o=c.isFetchingItems?t(p,null):e.length?t(a,null,t("div",{className:"mapp-document-header"},t("div",{className:"mapp-document-col-title"},__("Map title")),t("div",{className:"mapp-document-col-mapid"},null,__("Map ID"))),_.map(e,u)):t("div",{className:"mapp-document-message"},__("No maps found")),t("div",null,t("div",{className:"mapp-document-list"},o))}(),t(r,{icon:"portfolio",isSecondary:!0,onClick:()=>{d({isPickerOpen:!0,pickerMode:"list"})}},__("Open map library")),function(){if(c.isPickerOpen)return t(o.MappPicker,{mapid:c.pickerMapid,mode:c.pickerMode,onClose:()=>{d({isPickerOpen:!1,pickerMapid:null})},onInsert:e=>function(e){const t=wp.blocks.createBlock("mappress/map",{mapid:e});wp.data.dispatch("core/block-editor").insertBlock(t,0),d({isPickerOpen:!1,pickerMapid:null})}(e)})}())},icon:null})},68:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappEdit:()=>A});var o=a(107),n=a(641);const i=wp.element.createElement,{Button:l,Dashicon:s,Icon:r,Spinner:p}=wp.components,{useSelect:c}=wp.data,{Fragment:m,useEffect:d,useLayoutEffect:u,useRef:g,useState:h}=wp.element,{MediaUpload:f}=wp.mediaUtils,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function b(e){e={poi:null,onChange:null,onClose:null,onDelete:null,onSave:null,...e};const t="mapp-poi-body",a=g(null),[s,r]=h({images:e.poi.images?e.poi.images:[],isBusy:!1,title:e.poi.title,isVisual:!0});function p(e){r((t=>({...t,...e})))}function c(e){e?tinyMCE.execCommand("mceAddEditor",!1,t):tinyMCE.execCommand("mceRemoveEditor",!1,t)}function u(){return["circle","polyline","polygon","rectangle"].includes(e.poi.type)}function b(){e.onChange({images:s.images,body:tinymce&&tinymce.get(t)?tinymce.get(t).getContent():a.current.value,title:s.title}),e.onClose()}function y(e){return i("div",{className:"mapp-poi-image",key:e.id?e.id:e.url},"embed"==e.type&&i(v,{url:e.url}),"embed"!=e.type&&i("img",{src:e.url}),i("div",{className:"mapp-poi-image-delete",onClick:()=>function(e){const t=s.images.findIndex((t=>t.url==e));t>=0&&(s.images.splice(t,1),p({images:s.images}))}(e.url)},"X"))}return d((()=>(function(){if("undefined"==typeof tinyMCE||void 0===tinyMCE.init)return;var e="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var t=window.tinyMCEPreInit.mceInit.content;e=void 0!==t.language?t.language:"en"}var a={mode:"none",height:"100%",convert_urls:!1,language:e,menubar:!1,plugins:"image,paste,textcolor,wordpress,wpeditimage,wplink,wpview",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(a)}(),()=>{c(!1)})),[]),d((()=>{s.isVisual?c(!0):c(!1)}),[s.isVisual]),i(m,null,i("div",{className:"mapp-poi-header"},i("input",{className:"mapp-poi-title",value:s.title,onChange:e=>{p({title:e.target.value})},onKeyDown:e=>function(e){13==e.keyCode&&(b(),e.stopPropagation(),e.preventDefault())}(e)}),u(s.type)?null:i(n.MappIconPicker,{iconid:e.poi.iconid,onChange:t=>{e.onChange({iconid:t})}}),function(){var t,a,n,l,s,r;const p=e.poi;return u(p.type)?i(o.MappColorPicker,{color:"polyline"==p.type?null===(t=p.poly)||void 0===t?void 0:t.strokeColor:null===(a=p.poly)||void 0===a?void 0:a.fillColor,opacity:"polyline"==p.type?null===(n=p.poly)||void 0===n?void 0:n.strokeOpacity:null===(l=p.poly)||void 0===l?void 0:l.fillOpacity,weight:"polyline"==p.type?null===(s=p.poly)||void 0===s?void 0:s.strokeWeight:null===(r=p.poly)||void 0===r?void 0:r.strokeWeight,isExtended:!0,onChange:t=>{let{color:a,opacity:o,weight:n}=t;const i="polyline"==e.poi.type?{strokeColor:a,strokeOpacity:o,strokeWeight:n}:{fillColor:a,fillOpacity:o,strokeColor:a,strokeWeight:n,strokeOpacity:1};e.onChange({poly:{...e.poi.poly,...i}})}}):null}()),function(){const o="mapp-mce-visual"+(s.isVisual?" mapp-active":""),n="mapp-mce-html"+(s.isVisual?"":" mapp-active");return i(m,null,i("div",{className:"mapp-mce-toolbar"},i("div",{className:"mapp-mce-tabs"},i("a",{className:o,onClick:()=>p({isVisual:!0})},__("Visual"))," | ",i("a",{className:n,onClick:()=>p({isVisual:!1})},__("HTML"))),i("a",{href:"#",className:"insert-media add_media","data-editor":t},__("Add Media"))),i("div",{className:"mapp-mce-main"},i("textarea",{defaultValue:e.poi.body,id:t,ref:a,style:{height:"100%"}})))}(),"kml"==e.poi.type&&i("div",{className:"mapp-poi-kml"},i("span",null,__("KML")+" : "),i("a",{href:e.poi.kml.url,target:"_blank"},e.poi.kml.url)),s.images?i("div",{className:"mapp-poi-images"},s.images.map((e=>y(e)))):null,i("div",{className:"mapp-poi-toolbar"},i("div",null,i(l,{isPrimary:!0,onClick:()=>b()},__("Save")),i(l,{isSecondary:!0,onClick:()=>e.onClose()},__("Cancel"))),i("div",null,i(f,{allowedTypes:["image","video"],autoOpen:!0,gallery:!0,multiple:!0,onClose:()=>{p({images:s.images})},onSelect:e=>{return t=e,t=Array.isArray(t)?t:[t],void p({images:_.map(t,(e=>({id:e.id,url:e.url})))});var t},type:"image",value:s.images?s.images.map((e=>e.id)):[],render:e=>{let{open:t}=e;return i(l,{isSecondary:!0,onClick:t},__("Images"))}}),i(l,{isSecondary:!0,onClick:()=>function(){const e=prompt(__("Video URL"));if(e){let t=s.images?[...s.images]:[];t.push({type:"embed",url:e}),p({images:t})}}()},__("Video")),i(l,{isDestructive:!0,onClick:()=>e.onDelete()},__("Delete")))))}function v(e){e={url:null,...e};const{html:t}=c((t=>{const a=t("core").getEmbedPreview(e.url);return a?{html:a.html}:{html:null}}));return t?i("div",{className:"mapp-poi-embed",dangerouslySetInnerHTML:{__html:t}}):i("div",{className:"mapp-poi-embed"},i(p,null))}var y=a(939),k=a(346),w=a(885),C=a(614);window.mapp=window.mapp||{};const x=wp.element.createElement,{Fragment:N,useEffect:S,useLayoutEffect:L,useRef:O,useState:M}=wp.element,{Button:E,Dropdown:P,Modal:I,Panel:T,PanelBody:D,Popover:z,Spinner:B,TextControl:F}=wp.components,R=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function A(e){e={context:null,mapid:null,onClose:null,onSave:null,...e};const[t,a]=M({mapdata:void 0,viewport:null,zoom:null});function o(e){a((t=>({...t,...e})))}function n(e,a){let n={...t.mapdata};const i=n.pois.findIndex((t=>t.id==e));-1==i&&alert("ERROR poi not found"),n.pois[i]={...n.pois[i],...a},o({mapdata:n}),a.iconid&&o({lastIcon:a.iconid})}function i(e){let a={...t.mapdata};a.pois=a.pois?a.pois:[],a.pois.unshift(e),o({centerPoi:e,mapdata:a})}function l(e,a){return x(b,{onClose:()=>a(),onDelete:a=>function(e){if(!confirm(mappl10n.delete_prompt))return;let a={...t.mapdata};const n=a.pois.findIndex((t=>t.id==e));a.pois.splice(n,1),o({mapdata:a})}(e.id),onChange:t=>n(e.id,t),poi:e})}function s(){mapp.store.saveMap(t.mapdata,(t=>{e.onSave(t)}))}function r(e){o({mapdata:{...t.mapdata,...e}})}function p(){if(null==t.mapdata)return null;const a={centerPoi:t.centerPoi,embed:!0,isEditable:!0,layout:"left",mapOpts:{minZoom:2,streetViewControl:!1},menu:!1,name:"media-map",onDragDrop:(e,a)=>function(e,a){const n={...t.mapdata};let i=_.findIndex(n.pois,(t=>t.id==e)),l=_.findIndex(n.pois,(e=>e.id==a));n.pois.splice(l,0,n.pois.splice(i,1)[0]),o({mapdata:n})}(e,a),onDrawingEvent:e=>function(e){const a="marker"==e.type?null:e.type,o={...y.mappPoi.parseOverlay(a,e.overlay),body:"",iconid:t.lastIcon,id:y.mappLib.nanoid(),type:a,title:"marker"==e.type?y.mappLib.toUrlValue(e.overlay.position):mappl10n.shape};e.overlay.setMap(null),i(o)}(e),onPoiChange:(e,t)=>n(e,t),onRenderPopup:(e,t)=>l(e,t),onRenderSidebar:()=>function(){if(null==t.mapdata)return null;if("mce"!=e.context&&"library"!=e.context)return null;const{center:a,height:o,poiList:n,search:i,title:l,width:s,zoom:p}=t.mapdata;return x(w.MappSettings,{center:a,context:e.context,height:o,mapid:e.mapid,onChange:e=>r(e),poiList:n,search:i,title:l,viewport:t.viewport,width:s,zoom:p})}(),onSearch:e=>function(e){let a;if(e.geometry){const o=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,n=e.name==o?"":o;a={id:y.mappLib.nanoid(),address:o,body:n,iconid:t.lastIcon,id:y.mappLib.nanoid(),point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null}}else"string"==typeof e&&"http"==e.substring(0,4)&&(a={iconid:t.lastIcon,kml:{url:e},title:"KML",type:"kml"});i(a)}(e),onViewportChange:e=>function(e){o({viewport:e})}(e),poiList:!0};return"map"!=e.context&&"mashup"!=e.context||(a.center=null,a.zoom=null),x(k.MappMap,{...t.mapdata,...a})}return S((()=>{const t=t=>{o({isFetching:t.isFetchingMap,isSaving:t.isSavingMap,mapdata:t.maps[e.mapid]})};return mapp.store.subscribe(t),()=>{mapp.store.unsubscribe(t)}}),[]),S((()=>{e.mapid?mapp.store.fetchMap(e.mapid):o({mapdata:{otype:mappl10n.options.otype,oid:mappl10n.options.oid}})}),[e.mapid]),x("div",{className:"mapp-edit"},function(){var e;let a=null!==(e=t.mapdata)&&void 0!==e&&e.title?t.mapdata.title:"",n=t.isFetching?"":R("Untitled");return x("div",{className:"mapp-gt-modal-header"},x(F,{className:"mapp-edit-title",placeholder:n,value:a,onChange:e=>function(e){o({mapdata:{...t.mapdata,title:e}})}(e),onKeyDown:e=>function(e){13==e.keyCode&&(s(),e.stopPropagation(),e.preventDefault())}(e)}))}(),x("div",{className:"mapp-edit-main"},x("div",{className:"mapp-edit-map",key:e.mapid,onKeyDown:e=>e.stopPropagation(),tabIndex:-1},p()),t.mapdata?x(C.m,{selected:t.mapdata.mapTypeId,onChange:e=>r({mapTypeId:e})}):null),x("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:e=>e.stopPropagation()},x(E,{isPrimary:!0,disabled:t.isSaving||t.isFetching,isBusy:t.isSaving,onClick:()=>s()},R("Save")),x(E,{isSecondary:!0,disabled:t.isSaving||t.isFetching,onClick:()=>{e.onClose()}},R("Cancel"))))}},641:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappIconPicker:()=>O});var o=a(939),n=a(107),i=a(577);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useCallback:c,useRef:m,useState:d}=wp.element,{useSelect:u}=wp.data,{withState:g}=wp.compose,{Button:h,ColorPicker:f,DropZone:b,DropZoneProvider:v,FormFileUpload:y,Modal:k,Popover:w,RangeControl:C,Spinner:x,TabPanel:N}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),S=[{id:"mapp-shapes",fontFamily:"Marker Shapes",glyphs:[{name:"circle",center:[16,16]},{name:"widepin",center:[16,14]},{name:"route",center:[16,16]},{name:"shield",center:[16,16]},{name:"squarepin",center:[16,15]},{name:"square",center:[16,16]},{name:"squarerounded",center:[16,16]},{name:"roundpin",center:[16,13]},{name:"pin",center:null},{name:"pindot",center:null}]}],L=[{id:"mapp-icons",className:"mapp-marker-icons",filePrefix:"mp",fontFamily:"Marker Icons",label:"Map icons",glyphs:["airport","amusement-park","aquarium","archery","art-gallery","assistive-listening","atm","audio-description","bakery","bank","bar","baseball","beauty-salon","bicycle-store","bicycling","boat-ramp","boat-tour","boating","book-store","bowling-alley","braille","bus-station","cafe","campground","canoe","car-dealer","car-rental","car-repair","car-wash","casino","cemetery","chairlift","church","city-hall","closed-captioning","clothing-store","compass","convenience-store","courthouse","cross-country-skiing","crosshairs","dentist","department-store","diving","doctor","electrician","electronics-store","embassy","expand","female","finance","fire-station","fish-cleaning","fishing-pier","fishing","florist","food","fullscreen","funeral-home","furniture-store","gas-station","contractor","golf","grocery","gym","hair-care","hang-gliding","hardware-store","health","hindu-temple","horse-riding","hospital","ice-fishing","ice-skating","inline-skating","insurance-agency","jet-skiing","jewelry-store","kayaking","laundry","lawyer","library","liquor-store","local-government","location-arrow","locksmith","lodging","low-vision-access","male","marina","mosque","motobike-trail","movie-rental","movie-theater","moving-company","museum","natural-feature","night-club","open-captioning","painter","park","parking","pet-store","pharmacy","physiotherapist","place-of-worship","playground","plumber","point-of-interest","police","political","post-box","post-office","rafting","real-estate-agency","restaurant","roofing-contractor","route","rv-park","sailing","school","scuba-diving","search","shopping-mall","sign-language","skateboarding","ski-jumping","skiing","sledding","snow-shoeing","snow","snowboarding","snowmobile","spa","stadium","storage","store","subway-station","surfing","swimming","synagogue","taxi-stand","tennis","toilet","trail-walking","train-station","transit-station","travel-agency","unisex","university","veterinary-care","viewing","volume-control-telephone","walking","waterskiing","whale-watching","wheelchair","wind-surfing","zoo"]},{id:"material-icons",className:"material-icons",filePrefix:"mi",fontFamily:"Material Icons",label:"Material Icons",glyphs:["ac_unit","access_alarm","access_alarms","access_time","access_time_filled","accessibility","accessibility_new","accessible","accessible_forward","account_balance","account_balance_wallet","account_box","account_circle","account_tree","ad_units","adb","add","add_a_photo","add_alarm","add_alert","add_box","add_business","add_chart","add_circle","add_circle_outline","add_comment","add_ic_call","add_link","add_location","add_location_alt","add_moderator","add_photo_alternate","add_reaction","add_road","add_shopping_cart","add_task","add_to_drive","add_to_home_screen","add_to_photos","add_to_queue","addchart","adjust","admin_panel_settings","ads_click","agriculture","air","airline_seat_flat","airline_seat_flat_angled","airline_seat_individual_suite","airline_seat_legroom_extra","airline_seat_legroom_normal","airline_seat_legroom_reduced","airline_seat_recline_extra","airline_seat_recline_normal","airplane_ticket","airplanemode_active","airplanemode_inactive","airplanemode_off","airplanemode_on","airplay","airport_shuttle","alarm","alarm_add","alarm_off","alarm_on","album","align_horizontal_center","align_horizontal_left","align_horizontal_right","align_vertical_bottom","align_vertical_center","align_vertical_top","all_inbox","all_inclusive","all_out","alt_route","alternate_email","amp_stories","analytics","anchor","android","animation","announcement","aod","apartment","api","app_blocking","app_registration","app_settings_alt","approval","apps","architecture","archive","area_chart","arrow_back","arrow_back_ios","arrow_back_ios_new","arrow_circle_down","arrow_circle_up","arrow_downward","arrow_drop_down","arrow_drop_down_circle","arrow_drop_up","arrow_forward","arrow_forward_ios","arrow_left","arrow_right","arrow_right_alt","arrow_upward","art_track","article","aspect_ratio","assessment","assignment","assignment_ind","assignment_late","assignment_return","assignment_returned","assignment_turned_in","assistant","assistant_direction","assistant_photo","atm","attach_email","attach_file","attach_money","attachment","attractions","attribution","audiotrack","auto_awesome","auto_awesome_mosaic","auto_awesome_motion","auto_delete","auto_fix_high","auto_fix_normal","auto_fix_off","auto_graph","auto_stories","autofps_select","autorenew","av_timer","baby_changing_station","back_hand","backpack","backspace","backup","backup_table","badge","bakery_dining","balcony","ballot","bar_chart","batch_prediction","bathroom","bathtub","battery_alert","battery_charging_full","battery_full","battery_saver","battery_std","battery_unknown","beach_access","bed","bedroom_baby","bedroom_child","bedroom_parent","bedtime","beenhere","bento","bike_scooter","biotech","blender","block","bloodtype","bluetooth","bluetooth_audio","bluetooth_connected","bluetooth_disabled","bluetooth_drive","bluetooth_searching","blur_circular","blur_linear","blur_off","blur_on","bolt","book","book_online","bookmark","bookmark_add","bookmark_added","bookmark_border","bookmark_outline","bookmark_remove","bookmarks","border_all","border_bottom","border_clear","border_color","border_horizontal","border_inner","border_left","border_outer","border_right","border_style","border_top","border_vertical","branding_watermark","breakfast_dining","brightness_1","brightness_2","brightness_3","brightness_4","brightness_5","brightness_6","brightness_7","brightness_auto","brightness_high","brightness_low","brightness_medium","broken_image","browser_not_supported","brunch_dining","brush","bubble_chart","bug_report","build","build_circle","bungalow","burst_mode","bus_alert","business","business_center","cabin","cable","cached","cake","calculate","calendar_today","calendar_view_day","calendar_view_month","calendar_view_week","call","call_end","call_made","call_merge","call_missed","call_missed_outgoing","call_received","call_split","call_to_action","camera","camera_alt","camera_enhance","camera_front","camera_indoor","camera_outdoor","camera_rear","camera_roll","cameraswitch","campaign","cancel","cancel_presentation","cancel_schedule_send","car_rental","car_repair","card_giftcard","card_membership","card_travel","carpenter","cases","casino","cast","cast_connected","cast_for_education","catching_pokemon","category","celebration","cell_wifi","center_focus_strong","center_focus_weak","chair","chair_alt","chalet","change_circle","change_history","charging_station","chat","chat_bubble","chat_bubble_outline","check","check_box","check_box_outline_blank","check_circle","check_circle_outline","checklist","checklist_rtl","checkroom","chevron_left","chevron_right","child_care","child_friendly","chrome_reader_mode","circle","circle_notifications","class","clean_hands","cleaning_services","clear","clear_all","close","close_fullscreen","closed_caption","closed_caption_disabled","closed_caption_off","cloud","cloud_circle","cloud_done","cloud_download","cloud_off","cloud_queue","cloud_upload","code","code_off","coffee","coffee_maker","collections","collections_bookmark","color_lens","colorize","comment","comment_bank","commute","compare","compare_arrows","compass_calibration","compost","compress","computer","confirmation_num","confirmation_number","connect_without_contact","connected_tv","construction","contact_mail","contact_page","contact_phone","contact_support","contactless","contacts","content_copy","content_cut","content_paste","content_paste_off","control_camera","control_point","control_point_duplicate","copy","copy_all","copyright","coronavirus","corporate_fare","cottage","countertops","create","create_new_folder","credit_card","credit_card_off","credit_score","crib","crop","crop_16_9","crop_3_2","crop_5_4","crop_7_5","crop_din","crop_free","crop_landscape","crop_original","crop_portrait","crop_rotate","crop_square","cruelty_free","cut","dangerous","dark_mode","dashboard","dashboard_customize","data_exploration","data_saver_off","data_saver_on","data_usage","date_range","deck","dehaze","delete","delete_forever","delete_outline","delete_sweep","delivery_dining","departure_board","description","design_services","desktop_access_disabled","desktop_mac","desktop_windows","details","developer_board","developer_board_off","developer_mode","device_hub","device_thermostat","device_unknown","devices","devices_other","dialer_sip","dialpad","dining","dinner_dining","directions","directions_bike","directions_boat","directions_boat_filled","directions_bus","directions_bus_filled","directions_car","directions_car_filled","directions_ferry","directions_off","directions_railway","directions_railway_filled","directions_run","directions_subway","directions_subway_filled","directions_train","directions_transit","directions_transit_filled","directions_walk","dirty_lens","disabled_by_default","disabled_visible","disc_full","dnd_forwardslash","dns","do_disturb","do_disturb_alt","do_disturb_off","do_disturb_on","do_not_disturb","do_not_disturb_alt","do_not_disturb_off","do_not_disturb_on","do_not_disturb_on_total_silence","do_not_step","do_not_touch","dock","document_scanner","domain","domain_disabled","domain_verification","done","done_all","done_outline","donut_large","donut_small","door_back","door_front","door_sliding","doorbell","double_arrow","downhill_skiing","download","download_done","download_for_offline","downloading","drafts","drag_handle","drag_indicator","draw","drive_eta","drive_file_move","drive_file_move_rtl","drive_file_rename_outline","drive_folder_upload","dry","dry_cleaning","duo","dvr","dynamic_feed","dynamic_form","e_mobiledata","earbuds","earbuds_battery","east","eco","edgesensor_high","edgesensor_low","edit","edit_attributes","edit_calendar","edit_location","edit_location_alt","edit_note","edit_notifications","edit_off","edit_road","eject","elderly","electric_bike","electric_car","electric_moped","electric_rickshaw","electric_scooter","electrical_services","elevator","email","emergency","emoji_emotions","emoji_events","emoji_flags","emoji_food_beverage","emoji_nature","emoji_objects","emoji_people","emoji_symbols","emoji_transportation","engineering","enhance_photo_translate","enhanced_encryption","equalizer","error","error_outline","escalator","escalator_warning","euro","euro_symbol","ev_station","event","event_available","event_busy","event_note","event_seat","exit_to_app","expand","expand_less","expand_more","explicit","explore","explore_off","exposure","exposure_minus_1","exposure_minus_2","exposure_neg_1","exposure_neg_2","exposure_plus_1","exposure_plus_2","exposure_zero","extension","extension_off","face","face_retouching_natural","face_retouching_off","face_unlock","facebook","fact_check","family_restroom","fast_forward","fast_rewind","fastfood","favorite","favorite_border","favorite_outline","featured_play_list","featured_video","feed","feedback","female","fence","festival","fiber_dvr","fiber_manual_record","fiber_new","fiber_pin","fiber_smart_record","file_copy","file_download","file_download_done","file_download_off","file_present","file_upload","filter","filter_1","filter_2","filter_3","filter_4","filter_5","filter_6","filter_7","filter_8","filter_9","filter_9_plus","filter_alt","filter_b_and_w","filter_center_focus","filter_drama","filter_frames","filter_hdr","filter_list","filter_none","filter_tilt_shift","filter_vintage","find_in_page","find_replace","fingerprint","fire_extinguisher","fireplace","first_page","fit_screen","fitness_center","flag","flaky","flare","flash_auto","flash_off","flash_on","flashlight_off","flashlight_on","flatware","flight","flight_land","flight_takeoff","flip","flip_camera_android","flip_camera_ios","flip_to_back","flip_to_front","flourescent","flutter_dash","fmd_bad","fmd_good","folder","folder_open","folder_shared","folder_special","follow_the_signs","font_download","font_download_off","food_bank","format_align_center","format_align_justify","format_align_left","format_align_right","format_bold","format_clear","format_color_fill","format_color_reset","format_color_text","format_indent_decrease","format_indent_increase","format_italic","format_line_spacing","format_list_bulleted","format_list_numbered","format_list_numbered_rtl","format_paint","format_quote","format_shapes","format_size","format_strikethrough","format_textdirection_l_to_r","format_textdirection_r_to_l","format_underline","format_underlined","forum","forward","forward_10","forward_30","forward_5","forward_to_inbox","foundation","free_breakfast","free_cancellation","front_hand","fullscreen","fullscreen_exit","functions","g_mobiledata","g_translate","gamepad","games","garage","gavel","generating_tokens","gesture","get_app","gif","gite","golf_course","gpp_bad","gpp_good","gpp_maybe","gps_fixed","gps_not_fixed","gps_off","grade","gradient","grading","grain","graphic_eq","grass","grid_3x3","grid_4x4","grid_goldenratio","grid_off","grid_on","grid_view","group","group_add","group_off","group_work","groups","h_mobiledata","h_plus_mobiledata","hail","handyman","hardware","hd","hdr_auto","hdr_auto_select","hdr_enhanced_select","hdr_off","hdr_off_select","hdr_on","hdr_on_select","hdr_plus","hdr_strong","hdr_weak","headphones","headphones_battery","headset","headset_mic","headset_off","healing","health_and_safety","hearing","hearing_disabled","height","help","help_center","help_outline","hevc","hide_image","hide_source","high_quality","highlight","highlight_alt","highlight_off","highlight_remove","hiking","history","history_edu","history_toggle_off","holiday_village","home","home_max","home_mini","home_repair_service","home_work","horizontal_distribute","horizontal_rule","horizontal_split","hot_tub","hotel","hotel_class","hourglass_bottom","hourglass_disabled","hourglass_empty","hourglass_full","hourglass_top","house","house_siding","houseboat","how_to_reg","how_to_vote","http","https","hvac","ice_skating","icecream","image","image_aspect_ratio","image_not_supported","image_search","imagesearch_roller","import_contacts","import_export","important_devices","inbox","incomplete_circle","indeterminate_check_box","info","input","insert_chart","insert_chart_outlined","insert_comment","insert_drive_file","insert_emoticon","insert_invitation","insert_link","insert_photo","insights","integration_instructions","inventory","inventory_2","invert_colors","invert_colors_off","invert_colors_on","ios_share","iron","iso","kayaking","keyboard","keyboard_alt","keyboard_arrow_down","keyboard_arrow_left","keyboard_arrow_right","keyboard_arrow_up","keyboard_backspace","keyboard_capslock","keyboard_control","keyboard_hide","keyboard_return","keyboard_tab","keyboard_voice","king_bed","kitchen","kitesurfing","label","label_important","label_off","landscape","language","laptop","laptop_chromebook","laptop_mac","laptop_windows","last_page","launch","layers","layers_clear","leaderboard","leak_add","leak_remove","leave_bags_at_home","legend_toggle","lens","lens_blur","library_add","library_add_check","library_books","library_music","light","light_mode","lightbulb","line_style","line_weight","linear_scale","link","link_off","linked_camera","liquor","list","list_alt","live_help","live_tv","living","local_activity","local_airport","local_atm","local_attraction","local_bar","local_cafe","local_car_wash","local_convenience_store","local_dining","local_drink","local_fire_department","local_florist","local_gas_station","local_grocery_store","local_hospital","local_hotel","local_laundry_service","local_library","local_mall","local_movies","local_offer","local_parking","local_pharmacy","local_phone","local_pizza","local_play","local_police","local_post_office","local_print_shop","local_printshop","local_restaurant","local_see","local_shipping","local_taxi","location_city","location_disabled","location_history","location_off","location_on","location_searching","lock","lock_clock","lock_open","login","logout","looks","looks_3","looks_4","looks_5","looks_6","looks_one","looks_two","loop","loupe","low_priority","loyalty","lte_mobiledata","lte_plus_mobiledata","luggage","lunch_dining","mail","mail_outline","male","manage_accounts","manage_search","map","maps_home_work","maps_ugc","margin","mark_as_unread","mark_chat_read","mark_chat_unread","mark_email_read","mark_email_unread","markunread","markunread_mailbox","masks","maximize","media_bluetooth_off","media_bluetooth_on","mediation","medical_services","medication","meeting_room","memory","menu","menu_book","menu_open","merge_type","message","messenger","messenger_outline","mic","mic_external_off","mic_external_on","mic_none","mic_off","microwave","military_tech","minimize","miscellaneous_services","missed_video_call","mms","mobile_friendly","mobile_off","mobile_screen_share","mobiledata_off","mode","mode_comment","mode_edit","mode_edit_outline","mode_night","mode_standby","model_training","monetization_on","money","money_off","money_off_csred","monitor","monitor_weight","monochrome_photos","mood","mood_bad","moped","more","more_horiz","more_time","more_vert","motion_photos_auto","motion_photos_off","motion_photos_on","motion_photos_pause","motion_photos_paused","motorcycle","mouse","move_to_inbox","movie","movie_creation","movie_filter","moving","mp","multiline_chart","multiple_stop","multitrack_audio","museum","music_note","music_off","music_video","my_library_add","my_library_books","my_library_music","my_location","nat","nature","nature_people","navigate_before","navigate_next","navigation","near_me","near_me_disabled","nearby_error","nearby_off","network_cell","network_check","network_locked","network_wifi","new_label","new_releases","next_plan","next_week","nfc","night_shelter","nightlife","nightlight","nightlight_round","nights_stay","no_accounts","no_backpack","no_cell","no_drinks","no_encryption","no_encryption_gmailerrorred","no_flash","no_food","no_luggage","no_meals","no_meeting_room","no_photography","no_sim","no_stroller","no_transfer","nordic_walking","north","north_east","north_west","not_accessible","not_interested","not_listed_location","not_started","note","note_add","note_alt","notes","notification_add","notification_important","notifications","notifications_active","notifications_none","notifications_off","notifications_on","notifications_paused","now_wallpaper","now_widgets","offline_bolt","offline_pin","offline_share","ondemand_video","online_prediction","opacity","open_in_browser","open_in_full","open_in_new","open_in_new_off","open_with","other_houses","outbond","outbound","outbox","outdoor_grill","outlet","outlined_flag","padding","pages","pageview","paid","palette","pan_tool","panorama","panorama_fish_eye","panorama_fisheye","panorama_horizontal","panorama_horizontal_select","panorama_photosphere","panorama_photosphere_select","panorama_vertical","panorama_vertical_select","panorama_wide_angle","panorama_wide_angle_select","paragliding","park","party_mode","password","paste","pattern","pause","pause_circle","pause_circle_filled","pause_circle_outline","pause_presentation","payment","payments","pedal_bike","pending","pending_actions","people","people_alt","people_outline","perm_camera_mic","perm_contact_cal","perm_contact_calendar","perm_data_setting","perm_device_info","perm_device_information","perm_identity","perm_media","perm_phone_msg","perm_scan_wifi","person","person_add","person_add_alt","person_add_alt_1","person_add_disabled","person_off","person_outline","person_pin","person_pin_circle","person_remove","person_remove_alt_1","person_search","personal_injury","personal_video","pest_control","pest_control_rodent","pets","phone","phone_android","phone_bluetooth_speaker","phone_callback","phone_disabled","phone_enabled","phone_forwarded","phone_in_talk","phone_iphone","phone_locked","phone_missed","phone_paused","phonelink","phonelink_erase","phonelink_lock","phonelink_off","phonelink_ring","phonelink_setup","photo","photo_album","photo_camera","photo_camera_back","photo_camera_front","photo_filter","photo_library","photo_size_select_actual","photo_size_select_large","photo_size_select_small","piano","piano_off","picture_as_pdf","picture_in_picture","picture_in_picture_alt","pie_chart","pie_chart_outline","pin","pin_drop","pin_end","pin_invoke","pivot_table_chart","place","plagiarism","play_arrow","play_circle","play_circle_fill","play_circle_filled","play_circle_outline","play_disabled","play_for_work","play_lesson","playlist_add","playlist_add_check","playlist_play","plumbing","plus_one","podcasts","point_of_sale","policy","poll","polymer","pool","portable_wifi_off","portrait","post_add","power","power_input","power_off","power_settings_new","precision_manufacturing","pregnant_woman","present_to_all","preview","price_change","price_check","print","print_disabled","priority_high","privacy_tip","private_connectivity","production_quantity_limits","psychology","public","public_off","publish","published_with_changes","push_pin","qr_code","qr_code_2","qr_code_scanner","query_builder","query_stats","question_answer","queue","queue_music","queue_play_next","quick_contacts_dialer","quick_contacts_mail","quickreply","quiz","r_mobiledata","radar","radio","radio_button_checked","radio_button_off","radio_button_on","radio_button_unchecked","railway_alert","ramen_dining","rate_review","raw_off","raw_on","read_more","real_estate_agent","receipt","receipt_long","recent_actors","recommend","record_voice_over","recycling","redeem","redo","reduce_capacity","refresh","remember_me","remove","remove_circle","remove_circle_outline","remove_done","remove_from_queue","remove_moderator","remove_red_eye","remove_shopping_cart","reorder","repeat","repeat_on","repeat_one","repeat_one_on","replay","replay_10","replay_30","replay_5","replay_circle_filled","reply","reply_all","report","report_gmailerrorred","report_off","report_problem","request_page","request_quote","reset_tv","restart_alt","restaurant","restaurant_menu","restore","restore_from_trash","restore_page","reviews","rice_bowl","ring_volume","roofing","room","room_preferences","room_service","rotate_90_degrees_ccw","rotate_left","rotate_right","rounded_corner","router","rowing","rss_feed","rsvp","rtt","rule","rule_folder","run_circle","running_with_errors","rv_hookup","safety_divider","sailing","sanitizer","satellite","save","save_alt","saved_search","savings","scanner","scatter_plot","schedule","schedule_send","schema","school","science","score","screen_lock_landscape","screen_lock_portrait","screen_lock_rotation","screen_rotation","screen_search_desktop","screen_share","screenshot","sd","sd_card","sd_card_alert","sd_storage","search","search_off","security","security_update","security_update_good","security_update_warning","segment","select_all","self_improvement","sell","send","send_and_archive","send_to_mobile","sensor_door","sensor_window","sensors","sensors_off","sentiment_dissatisfied","sentiment_neutral","sentiment_satisfied","sentiment_satisfied_alt","sentiment_very_dissatisfied","sentiment_very_satisfied","set_meal","settings","settings_accessibility","settings_applications","settings_backup_restore","settings_bluetooth","settings_brightness","settings_cell","settings_display","settings_ethernet","settings_input_antenna","settings_input_component","settings_input_composite","settings_input_hdmi","settings_input_svideo","settings_overscan","settings_phone","settings_power","settings_remote","settings_suggest","settings_system_daydream","settings_voice","share","share_arrival_time","share_location","shield","shop","shop_2","shop_two","shopping_bag","shopping_basket","shopping_cart","short_text","shortcut","show_chart","shower","shuffle","shuffle_on","shutter_speed","sick","signal_cellular_0_bar","signal_cellular_4_bar","signal_cellular_alt","signal_cellular_connected_no_internet_0_bar","signal_cellular_connected_no_internet_4_bar","signal_cellular_no_sim","signal_cellular_nodata","signal_cellular_null","signal_cellular_off","signal_wifi_0_bar","signal_wifi_4_bar","signal_wifi_4_bar_lock","signal_wifi_bad","signal_wifi_connected_no_internet_4","signal_wifi_off","signal_wifi_statusbar_4_bar","signal_wifi_statusbar_connected_no_internet_4","signal_wifi_statusbar_null","sim_card","sim_card_alert","sim_card_download","single_bed","sip","skateboarding","skip_next","skip_previous","sledding","slideshow","slow_motion_video","smart_button","smart_display","smart_screen","smart_toy","smartphone","smoke_free","smoking_rooms","sms","sms_failed","snippet_folder","snooze","snowboarding","snowmobile","snowshoeing","soap","social_distance","sort","sort_by_alpha","source","south","south_east","south_west","spa","space_bar","space_dashboard","speaker","speaker_group","speaker_notes","speaker_notes_off","speaker_phone","speed","spellcheck","splitscreen","sports","sports_bar","sports_baseball","sports_basketball","sports_cricket","sports_esports","sports_football","sports_golf","sports_handball","sports_hockey","sports_kabaddi","sports_mma","sports_motorsports","sports_rugby","sports_score","sports_soccer","sports_tennis","sports_volleyball","square_foot","stacked_bar_chart","stacked_line_chart","stairs","star","star_border","star_border_purple500","star_half","star_outline","star_purple500","star_rate","stars","stay_current_landscape","stay_current_portrait","stay_primary_landscape","stay_primary_portrait","sticky_note_2","stop","stop_circle","stop_screen_share","storage","store","store_mall_directory","storefront","storm","straighten","stream","streetview","strikethrough_s","stroller","style","subdirectory_arrow_left","subdirectory_arrow_right","subject","subscript","subscriptions","subtitles","subtitles_off","subway","summarize","superscript","supervised_user_circle","supervisor_account","support","support_agent","surfing","surround_sound","swap_calls","swap_horiz","swap_horizontal_circle","swap_vert","swap_vert_circle","swap_vertical_circle","swipe","switch_account","switch_camera","switch_left","switch_right","switch_video","sync","sync_alt","sync_disabled","sync_problem","system_security_update","system_security_update_good","system_security_update_warning","system_update","system_update_alt","system_update_tv","tab","tab_unselected","table_chart","table_rows","table_view","tablet","tablet_android","tablet_mac","tag","tag_faces","takeout_dining","tap_and_play","tapas","task","task_alt","taxi_alert","terrain","text_fields","text_format","text_rotate_up","text_rotate_vertical","text_rotation_angledown","text_rotation_angleup","text_rotation_down","text_rotation_none","text_snippet","textsms","texture","theater_comedy","theaters","thermostat","thermostat_auto","thumb_down","thumb_down_alt","thumb_down_off_alt","thumb_up","thumb_up_alt","thumb_up_off_alt","thumbs_up_down","time_to_leave","timelapse","timeline","timer","timer_10","timer_10_select","timer_3","timer_3_select","timer_off","tips_and_updates","title","toc","today","toggle_off","toggle_on","toll","tonality","topic","touch_app","tour","toys","track_changes","traffic","train","tram","transfer_within_a_station","transform","transgender","transit_enterexit","translate","travel_explore","trending_down","trending_flat","trending_neutral","trending_up","trip_origin","try","tty","tune","tungsten","turned_in","turned_in_not","tv","tv_off","two_wheeler","umbrella","unarchive","undo","unfold_less","unfold_more","unpublished","unsubscribe","upcoming","update","update_disabled","upgrade","upload","upload_file","usb","usb_off","verified","verified_user","vertical_align_bottom","vertical_align_center","vertical_align_top","vertical_distribute","vertical_split","vibration","video_call","video_camera_back","video_camera_front","video_collection","video_label","video_library","video_settings","video_stable","videocam","videocam_off","videogame_asset","videogame_asset_off","view_agenda","view_array","view_carousel","view_column","view_comfortable","view_comfy","view_compact","view_day","view_headline","view_in_ar","view_list","view_module","view_quilt","view_sidebar","view_stream","view_week","vignette","villa","visibility","visibility_off","voice_chat","voice_over_off","voicemail","volume_down","volume_mute","volume_off","volume_up","volunteer_activism","vpn_key","vpn_lock","vrpano","wallet_giftcard","wallet_membership","wallet_travel","wallpaper","warning","warning_amber","wash","watch","watch_later","water","water_damage","water_drop","waterfall_chart","waves","waving_hand","wb_auto","wb_cloudy","wb_incandescent","wb_iridescent","wb_shade","wb_sunny","wb_twilight","wc","web","web_asset","web_asset_off","weekend","west","whatshot","wheelchair_pickup","where_to_vote","widgets","wifi","wifi_calling","wifi_calling_3","wifi_lock","wifi_off","wifi_protected_setup","wifi_tethering","wifi_tethering_error_rounded","wifi_tethering_off","window","wine_bar","work","work_off","work_outline","workspaces","wrap_text","wrong_location","wysiwyg","yard","youtube_searched_for","zoom_in","zoom_out","zoom_out_map"]}];function O(e){const[t,a]=d({defaultIcon:mappl10n.options.defaultIcon,filename:null,filter:"",glyph:"",glyphColor:"white",glyphFont:L[0],glyphSize:20,isOpen:!1,mode:"list",shape:"circle",shapeColor:"gray",shapeFont:S[0],toDelete:[],userIcons:mappl10n.options.userIcons});function p(e){a((t=>({...t,...e})))}function c(a,n){switch(a){case"bulk-select":let a=[...t.toDelete],i=t.toDelete.indexOf(n.iconid);i>=0?a.splice(i,1):a.push(n.iconid),p({toDelete:a});break;case"close":p({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&o.mappLib.ajax({method:"POST",data:{action:"mapp_icon_delete",iconids:t.toDelete,nonce:mappl10n.options.nonce},callback:function(a){a&&"OK"==a.status?(t.toDelete.indexOf(e.iconid)>=0&&!function(e){if(!e)return!1;let t=e.replace(/.png|.gif|.jpg/gi,"").toLowerCase();return mappl10n.options.standardIcons.indexOf(t)>=0}(e.iconid)&&e.onChange(null),mappl10n.options.userIcons=a.data,p({toDelete:[],mode:"list",userIcons:mappl10n.options.userIcons})):alert("Delete error: "+a.status)}});break;case"edit-cancel":p({mode:"list"});break;case"edit-save":!function(e){const a=32,o=2;let n=document.createElement("canvas");n.width=a*o,n.height=a*o,n.style.imageRendering="pixelated";let i=n.getContext("2d");i.font=a*o+"px "+t.shapeFont.fontFamily,i.fillStyle=t.shapeColor,i.textBaseline="bottom",i.fillText(t.shape,0,a*o),i.strokeStyle="white",i.strokeText(t.shape,1,a*o);const l=_.findWhere(t.shapeFont.glyphs,{name:t.shape});if(t.glyph&&l.center){i.imageSmoothingEnabled=!1,i.font=t.glyphSize*o+"px "+t.glyphFont.fontFamily,i.fillStyle=t.glyphColor;const e=[l.center[0]*o,l.center[1]*o];i.fillText(t.glyph,e[0]-t.glyphSize,e[1]+t.glyphSize)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(n):n.toBlob((e=>{let a=new FormData;a.append("image0",e,t.filename),u(a)}),"image/png",100)}();break;case"edit-upload":!function(e){let t=new FormData;_.map(e,((e,a)=>{e.type.match("image.*")?t.append("image"+a,e):alert("File "+e.name+" is not an image.")})),u(t)}(n);break;case"list-select":e.onChange&&e.onChange(n),c("close");break;case"mode":p("bulk"==n?{mode:n,toDelete:[]}:{mode:n});break;case"open":p({isOpen:!0})}}function m(a){const n="user"==a?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(n,(n=>{if("standard"==a&&function(e){return mappl10n.options.userIcons.indexOf(e)>=0}(n+".png"))return"";let i="mapp-icon-wrapper";return"bulk"==t.mode&&t.toDelete.indexOf(n)>=0?i+=" mapp-bulk-selected":"list"!=t.mode||e.iconid!=n&&e.iconid+".png"!=n||(i+=" mapp-selected"),l("div",{alt:n,className:i,key:n,onClick:()=>{"list"==t.mode?c("list-select",n):"user"==a&&c("bulk-select",{iconid:n,type:a})}},l("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(n),title:n}))}))}function u(t){t.append("action","mapp_icon_save"),t.append("nonce",mappl10n.options.nonce),o.mappLib.ajax({method:"POST",data:t,callback:t=>{t&&"OK"==t.status?(mappl10n.options.userIcons=t.data.icons,p({userIcons:mappl10n.options.userIcons}),p({mode:"list"}),e.onChange&&e.onChange(t.data.filename)):alert("Upload error: "+t.status)}})}return r((()=>{let e=t.glyph?t.glyph:t.shape;e+=".png",p({filename:e})}),[t.shape,t.shapeColor,t.glyphFont,t.glyph,t.glyphColor,t.glyphSize]),l(s,null,l("img",{className:"mapp-icon",onClick:()=>c("open",null),src:o.mappLib.getIconUrl(e.iconid)}),"list"==t.mode&&t.isOpen&&l(k,{title:l("div",{className:"mapp-icons-title"},__("Select icon"),l(h,{disabled:"bulk"==t.mode,isPrimary:!0,onClick:()=>c("mode","edit")},__("New icon"))),className:"mapp-icons-modal",onRequestClose:()=>c("close")},l("div",{className:"mapp-icons"},l("div",{className:"mapp-icons-list"},mappl10n.options.userIcons.length>0&&l("div",{className:"mapp-icons-list-title"},__("Custom icons")),l("div",{className:"mapp-icons-user"},m("user")),mappl10n.options.userIcons.length>0&&l("div",{className:"mapp-icons-list-title"},__("Standard icons")),l("div",{className:"mapp-icons-standard"},m("standard"))),l("div",{className:"mapp-icons-toolbar"},l("div",null,l(h,{disabled:"bulk"==t.mode,isSecondary:!0,onClick:()=>c("list-select",null)},__("Use default icon")),mappl10n.options.userIcons.length>0&&l(h,{isTertiary:!0,onClick:()=>c("mode","bulk")},__("Edit list"))),l("div",{className:"mapp-icons-filename"},e.iconid?e.iconid:__("No icon selected"))))),"bulk"==t.mode&&t.isOpen&&l(k,{title:l("div",{className:"mapp-icons-title"},__("Select icons to delete")),className:"mapp-icons-modal",onRequestClose:()=>c("close")},l("div",{className:"mapp-icons"},l("div",{className:"mapp-icons-list"},l("div",{className:"mapp-icons-user"},m("user"))),l("div",{className:"mapp-icons-toolbar"},l("div",null,l(h,{isDestructive:!0,disabled:t.toDelete.length<1,onClick:()=>c("delete")},__("Delete")),l(h,{isSecondary:!0,onClick:()=>c("mode","list")},__("Cancel")))))),"edit"==t.mode&&l(k,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:()=>c("edit-cancel"),shouldCloseOnClickOutside:!1},l("div",{className:"mapp-icons-edit"},l("div",{id:"mapp-edit-debug"}),l("section",null,l("h2",null,__("Shape")),l("span",{className:"mapp-icons-edit-shapes",style:{color:t.shapeColor,fontFamily:t.shapeFont.fontFamily}},_.map(t.shapeFont.glyphs,((e,a)=>{const o=t.shape==e.name;return l("span",{className:"mapp-icons-edit-shape-wrapper"+(o?" mapp-selected":""),key:e.name,onClick:()=>p({shape:e.name}),title:e.name},l("span",{className:"mapp-icons-edit-shape"},e.name,e.center&&t.glyph&&l("div",{className:"mapp-icons-edit-shape-glyph "+t.glyphFont.className,style:{left:e.center[0],top:e.center[1],color:t.glyphColor,fontSize:t.glyphSize,width:t.glyphSize}},t.glyph)))})))),l("section",{className:"mapp-icons-edit-font"},l("h2",null,__("Font")),l(i.Select,{value:t.glyphFont.id,options:_.map(L,(e=>({value:e.id,label:e.label}))),onChange:e=>p({glyphFont:_.findWhere(L,{id:e}),glyph:null})}),l("span",null,__("Font size")),l(C,{initialPosition:20,min:16,max:24,value:t.glyphSize,onChange:e=>p({glyphSize:e})})),l("section",null,l("h2",null,__("Color")),l("span",{className:"mapp-icons-edit-colors"},l(n.MappColorPicker,{color:t.shapeColor,isExtended:!1,onChange:e=>p({shapeColor:e.color})}),l("span",null,__("Fill")),l(n.MappColorPicker,{color:t.glyphColor,isExtended:!1,onChange:e=>p({glyphColor:e.color})}),l("span",null,__("Stroke")))),function(){const e=_.filter(t.glyphFont.glyphs,(e=>!t.filter||e.includes(t.filter)));return l("div",{className:"mapp-icons-edit-glyphs"},l("section",{className:"mapp-icons-edit-search"},l("h2",null,__("Search")),l(i.Input,{value:t.filter,onChange:e=>p({filter:e})})),l("div",{className:"mapp-icons-edit-glyph-list",style:{color:t.glyphColor}},_.map(e,((e,a)=>l("div",{tabIndex:0,className:"mapp-icons-edit-glyph-wrapper"+(t.glyph==e?" mapp-selected":""),key:a,onClick:()=>p({glyph:t.glyph==e?null:e})},l("span",{className:"mapp-icons-edit-glyph "+t.glyphFont.className},e),l("div",{className:"mapp-icons-edit-glyph-title"},e.replaceAll("_"," ")))))))}(),l("div",{className:"mapp-icons-edit-toolbar"},l("div",{className:"mapp-icons-edit-toolbar-left"},l(h,{isPrimary:!0,onClick:()=>c("edit-save")},__("Save")),l(h,{isSecondary:!0,onClick:()=>c("edit-cancel")},__("Cancel")),l(i.Input,{className:"mapp-icons-filename",value:t.filename,onChange:e=>p({filename:e})})),l("div",null,l(y,{accept:"image/*",icon:"upload",multiple:!0,onChange:e=>{c("edit-upload",e.target.files)}},__("Upload icons")))))))}},897:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappImport:()=>y});var o=a(939),n=a(346),i=a(577);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useCallback:c,useRef:m,useState:d}=wp.element,{useSelect:u}=wp.data,{withState:g}=wp.compose,{Button:h,FormFileUpload:f,Modal:b,ToggleControl:v}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function y(e){const[t,a]=d({isBusy:!1,isFetching:!1,file:null,isMapModalOpen:!1,mapid:null,mapdata:null,overwrite:!1,response:null,tab:"sheet",url:""});m(null);function p(e){a((t=>({...t,...e})))}r((()=>{t.mapid&&(p({isFetching:!0,mapdata:null}),o.mappLib.ajax({method:"GET",data:{action:"mapp_get",mapid:t.mapid,nonce:mappl10n.options.nonce},callback:e=>{if(e&&"OK"==e.status){const t=e.data;t.pois&&t.pois.map((e=>{e.id=o.mappLib.nanoid()})),p({mapdata:t})}else alert(e.status);p({isFetching:!1})}}))}),[t.mapid]);const c=t.isBusy||"file"==t.tab&&!t.file||"sheet"==t.tab&&0==t.url.trim().length;return l("div",{className:"mapp-import"},l("form",{onSubmit:e=>{e.preventDefault(),function(){p({isBusy:!0,response:null});let e={method:"POST",data:{url:t.url,action:"mapp_import",nonce:mappl10n.options.nonce,overwrite:t.overwrite},callback:e=>{p({isBusy:!1}),e&&"OK"==e.status&&p({response:e.data})}};if("file"==t.tab){let a=new FormData;_.map(e.data,((e,t)=>a.append(t,e))),a.append("file",t.file),e={...e,data:a}}o.mappLib.ajax(e)}()}},l(s,null,l("h2",null,__("Source")),l(i.MappTabs,{tabs:[{name:"sheet",label:__("Google Sheets")},{name:"file",label:__("File")}],initialTab:t.tab,onRender:e=>"sheet"==e?function(){const e=l("div",{className:"mapp-import-help"},__("Google sheets must be shared before importing:"),l("ol",null,l("li",null,__("File -> Share -> Publish to web")),l("li",null,__("Select 'Entire Document' and 'Comma-Separated Values (.csv)")),l("li",null,__("Copy the URL and paste it here"))));return l("div",{className:"mapp-import-tab-sheet"},l("label",{className:"mapp-import-sheet-name"},l("span",null,"URL"),l("input",{onChange:e=>{p({url:e.target.value})},type:"text",value:t.url})),e)}():"file"==e?function(){const e=l("div",{className:"mapp-import-help"},__("File must be in CSV format:"),l("ol",null,l("li",null,__("Excel: File -> Save As -> 'CSV' or 'CSV UTF-8' (for special characters)'")),l("li",null,__("Google sheets: File -> Download -> Comma Separated Values (.csv)"))));return l("div",{className:"mapp-import-tab-file"},l("div",{className:"mapp-import-file-name"},l(f,{accept:"text/csv",isSecondary:!0,multiple:!1,onChange:e=>{p({file:e.target.files[0]})}},__("Select file")),l("input",{disabled:!0,type:"text",value:t.file?t.file.name:""})),e)}():void 0,onSelect:e=>p({tab:e})})),l(v,{checked:t.overwrite,label:__("Use map IDs from file"),onChange:e=>p({overwrite:e})}),t.overwrite&&l("div",{className:"mapp-import-overwrite-warning"},__("WARNING: this will overwrite any existing maps with the same IDs")),l(h,{disabled:c,isBusy:t.isBusy,isPrimary:!0,type:"submit"},__("Import"))),function(){if(t.response&&t.response.results)return l("div",{className:"mapp-import-log"},l("h2",null,__("Results")),_.map(t.response.results,((e,a)=>l("div",{key:a},function(e){let a=t.response.headers;return l("div",{className:"mapp-import-table"},l("div",{className:"mapp-import-table-header"},l("div",{key:"line",className:"mapp-import-cell"},__("Line")),_.map(a,((e,t)=>l("div",{key:t,className:"mapp-import-cell"},e))),l("div",{key:"msg",className:"mapp-import-cell"},__("Result"))),_.map(e.logs,((e,t)=>{let o="mapp-import-cell";return e.msg&&(o+="e"==e.msg.msgtype?" mapp-import-cell-error":" mapp-import-cell-info"),l("div",{className:"mapp-import-row",key:t},l("div",{key:"col_rowid",className:"mapp-import-cell"},e.rowid),_.map(a,((t,a)=>l("div",{key:a,className:"mapp-import-cell"},e[t]?e[t]:" "))),l("div",{key:"error",className:o},e.msg.msg))})))}(e),function(e){return _.map(e.msgs,((e,a)=>{const o="e"==e.msgtype?"mapp-import-error":"mapp-import-info";return l("div",{className:o,key:a},e.msg,e.mapid&&l(h,{onClick:()=>{p({mapid:e.mapid,isMapModalOpen:!0})},disabled:t.isFetching||t.isMapModalOpen,isBusy:t.isFetching&&t.mapid==e.mapid,isSecondary:!0},__("Show map")))}))}(e)))))}(),t.isMapModalOpen&&!t.isFetching&&l(b,{title:__("Map")+" "+t.mapid,onRequestClose:()=>p({isMapModalOpen:!1})},l("div",{className:"mapp-import-map"},!t.isFetching&&t.mapdata&&l(n.MappMap,{...t.mapdata,height:"50vh",mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:!0,search:!1,width:"50vw"}))))}document.getElementById("mapp-import-container")&&wp.element.render(l(y,null),document.getElementById("mapp-import-container"))},218:(e,t,a)=>{"use strict";a.r(t);var o=a(346),n=a(185),i=a(885);window.mapp=window.mapp||{};const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){const{Button:t,Placeholder:a,Toolbar:p,ToolbarButton:c,ToolbarGroup:d}=wp.components,{BlockControls:u,InspectorControls:g}=wp.blockEditor,[h,_]=m({isFetching:null,isPickerOpen:!1,pickerMode:"list",viewport:null});function f(e){_((t=>({...t,...e})))}function b(){f({isPickerOpen:!0,pickerMode:"list"})}function v(){return l(u,null,l(void 0!==d?d:p,null,e.attributes.mapid&&l(c,{icon:"edit",label:__("Edit map"),onClick:()=>{f({isPickerOpen:!0,pickerMode:"edit"})}}),l(c,{icon:"portfolio",label:__("Map Library"),onClick:()=>b()})))}if(r((()=>{const t=t=>{let a=t.maps[e.attributes.mapid];f({isFetching:t.isFetchingMap,mapdata:a})};return mapp.store.subscribe(t),()=>mapp.store.unsubscribe(t)})),r((()=>{e.attributes.mapid&&mapp.store.fetchMap(e.attributes.mapid)}),[e.attributes.mapid]),r((()=>{"wide"!=e.attributes.align&&"full"!=e.attributes.align||e.setAttributes({width:"100%"})}),[e.attributes.align]),e.attributes.preview)return l("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"});let y=e.attributes.mapid&&null!==h.mapdata?l(s,null,v(),function(){const{align:t,center:a,height:o,mapid:n,poiList:s,search:r,width:p,zoom:c}=e.attributes;return l(g,null,l("div",{className:"mapp-gt-inspector"},l(i.MappSettings,{center:a,context:"map",height:o,mapid:n,onChange:t=>{return a=t,void e.setAttributes(a);var a},poiList:s,search:r,title:h.mapdata?h.mapdata.title:null,viewport:h.viewport,width:p,zoom:c})))}(),function(){if(e.attributes.mapid&&h.mapdata)return l(o.MappMap,{...h.mapdata,alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},onViewportChange:e=>function(e){f({viewport:e})}(e),poiList:e.attributes.poiList,search:e.attributes.search,width:e.attributes.width,zoom:e.attributes.zoom})}()):l(s,null,v(),l(a,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},l(t,{icon:"portfolio",isSecondary:!0,onClick:()=>b()},__("Map Library"))));return l(s,null,y,function(){if(h.isPickerOpen)return l(n.MappPicker,{mapid:e.attributes.mapid,mode:h.pickerMode,onClose:()=>(null==e.attributes.center&&(e.setAttributes({center:1}),e.setAttributes({center:null})),void f({isPickerOpen:!1})),onInsert:t=>function(t){t!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:t,zoom:void 0}),f({isPickerOpen:!1})}(t),onTrash:()=>{e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0})},type:"post"})}())}"post"==mappl10n.options.otype&&mappl10n.options.oid&&wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:mappl10n.options.blockCategory,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},search:{type:"boolean"},width:{type:"string",default:""},zoom:{type:"number"}},supports:{align:["full","wide","center","left","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:e=>e.named.center},height:{type:"string",shortcode:e=>e.named.height},initialOpenDirections:{type:"boolean",shortcode:e=>"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections||void 0},mapid:{type:"string",shortcode:e=>e.named.mapid},poiList:{type:"boolean",shortcode:e=>"true"==e.named.poiList||"true"==e.named.poilist||void 0},search:{type:"boolean",shortcode:e=>"true"==e.named.search||"true"==e.named.search||void 0},width:{type:"string",shortcode:e=>e.named.width},zoom:{type:"number",shortcode:e=>parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}},{type:"block",blocks:["core/shortcode"],isMatch:e=>{let{text:t}=e;var a=wp.shortcode.regexp("mappress");return a.lastIndex=0,a.test(t)},transform:e=>{let{text:t}=e;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return l(d,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},265:(e,t,a)=>{"use strict";a.r(t);a(346),a(74),a(885),a(308);wp.element.createElement;const{Fragment:o,useEffect:n,useLayoutEffect:i,useRef:l,useState:s}=wp.element,{BaseControl:r,Button:p,ButtonGroup:c,Card:m,CardBody:d,CardFooter:u,CardHeader:g,CheckboxControl:h,ExternalLink:_,HorizontalRule:f,Panel:b,PanelBody:v,PanelRow:y,Placeholder:k,RadioControl:w,SelectControl:C,TabPanel:x,TextControl:N,TextareaControl:S,ToggleControl:L,Toolbar:O}=wp.components,{useSelect:M}=wp.data},74:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappMultiSelect:()=>b});const o=wp.element.createElement,{Fragment:n,useEffect:i,useLayoutEffect:l,useRef:s,useState:r}=wp.element,{BaseControl:p,Button:c,CheckboxControl:m,Panel:d,PanelBody:u,PanelRow:g,Spinner:h,TextControl:f}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function b(e){const t=s(null),a=s(null),[n,l]=r({isOpen:!1,filter:"",filteredOptions:[]});function c(e){l((t=>({...t,...e})))}function d(t){let a=_.findWhere(e.options,{value:t});return a?a.label:t}function u(){let t;return e.values instanceof Array?t=[...e.values]:e.values&&(t=[e.values]),t||[]}function g(t,a){let o=u(),n=o.indexOf(t);(a=void 0!==a?a:-1==n)?o.push(t):o.splice(n,1),e.onChange(o)}function h(){return n.isOpen?o("div",{className:"mapp-select-dropdown-wrapper"},o("div",{className:"mapp-select-dropdown"},!n.isOpen||!e.options||e.options.length<10?null:o("div",{className:"mapp-select-filter",ref:a},o(f,{autoComplete:"off",placeholder:__("Search"),value:n.filter,onChange:e=>c({filter:e})})),o("div",{className:"mapp-select-dropdown-list"},function(){const e=u();if(0==n.filteredOptions.length)return o("div",{className:"mapp-select-dropdown-item"},__("No results"));return n.filteredOptions.map((t=>o(m,{className:"mapp-select-dropdown-item",checked:e.includes(t.value),key:t.value,onChange:e=>g(t.value,e),label:t.label})))}()))):null}return i((()=>{if(e.options)if(n.filter){let t=n.filter.toUpperCase();c({filteredOptions:e.options.filter((e=>0==e.label.toUpperCase().indexOf(t)))})}else c({filteredOptions:e.options})}),[e.options,n.filter]),i((()=>{n.isOpen&&a.current&&(a.current.focus(),c({filter:""}))}),[n.isOpen]),o(p,{className:"mapp-select",label:e.label},o("div",{ref:t,tabIndex:0,onBlur:e=>function(e){event.relatedTarget||document.activeElement,t.current.contains(e.relatedTarget)||c({isOpen:!1})}(e)},function(){const t=u();return t instanceof Array&&t.map((e=>d(e))),void 0===e.options?o("div",{className:"mapp-select-input"},o("div",{className:"mapp-select-tokens"}),o("span",{className:"dashicons dashicons-arrow-down-alt2"})):o("div",{className:"mapp-select-input",onClick:()=>c({isOpen:!n.isOpen})},o("div",{className:"mapp-select-tokens"},t.map((e=>o("span",{className:"mapp-select-token",key:e,onClick:t=>{t.stopPropagation(),g(e,!1)}},d(e))))),o("span",{className:"dashicons "+(n.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))}(),h()))}},577:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Control:()=>f,Help:()=>b,Checkbox:()=>v,Checkboxes:()=>y,Datalist:()=>k,Input:()=>w,Radios:()=>x,Select:()=>N,Textarea:()=>S,Section:()=>L,Option:()=>O,MappCrudList:()=>M,MappExpand:()=>E,MappGrid:()=>P,MappTabs:()=>I});var o=a(641);a(939);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:m}=wp.data,{Button:d,Dashicon:u,Modal:g,TabPanel:h}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){let{className:t,help:a,type:o,...l}=e;const s=Array.isArray(l.children)?i:"label";let r="mapp-control";return o&&(r+=" mapp-control-"+o),t&&(r+=" "+t),n("div",{className:r},l.labelTop&&n("div",{className:"mapp-label-top"},l.labelTop),n(s,null,l.labelLeft&&n("span",null,l.labelLeft),l.children,(l.label||l.labelRight)&&n("span",null,l.label||l.labelRight)),a&&n(b,a))}function b(e){let t="mapp-help-text";e.type&&(t+=" mapp-help-"+e.type);let a=null;return e.href&&(a="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),n(i,null,a&&n("a",{className:"mapp-help-link",href:a,target:"_blank"},n(u,{icon:"editor-help"})),e.text&&n("div",{className:t},e.text))}function v(e){let{checked:t,className:a,disabled:o,onChange:i,value:l,...s}=e;return n(f,{type:"checkbox",...s},n("input",{checked:void 0!==t&&t,className:a,disabled:o,onChange:e=>i(e.target.checked),type:"checkbox",value:l}))}function y(e){let{label:t,onChange:a,options:o,values:i,...l}=e;return n(f,{type:"checkboxes",...l},_.map(o,((e,t)=>{let o=i?i.indexOf(e.value):-1;return n(v,{key:t,label:e.label,value:e.value,checked:o>=0,disabled:e.disabled,onChange:t=>{let n=[...i];t&&-1==o&&a(n.concat(e.value)),!t&&o>=0&&(n.splice(o,1),a(n))}})})))}function k(e){let{className:t,list:a,onChange:o,options:i,value:l,...s}=e;return n(f,{type:"select",...s},n("span",{className:t},n("input",{list:a,value:null!=l?l:"",onChange:e=>o(e.target.value)}),n("datalist",{id:a},_.map(i,((e,t)=>n("option",{key:t,value:e.value,disabled:e.disabled},e.label))))))}function w(e){let{autoFocus:t,disabled:a,max:o,min:i,name:l,onChange:s,placeholder:r,size:p,trim:c,type:m,value:d,...u}=e;return n(f,{type:"input",...u},n("input",{autoFocus:t,disabled:a,max:o,min:i,name:l,onChange:e=>{if(s){const t=c?e.target.value.trim():e.target.value;s(t)}},placeholder:r,size:p,type:m||"text",value:null!==d?d:""}))}const C=function(e){let{checked:t,className:a,disabled:o,onChange:i,value:l,...s}=e;return n(f,{type:"radio",...s},n("input",{checked:t,className:a,disabled:o,onChange:e=>i(e.target.value),type:"radio",value:l}))};function x(e){let{checked:t,label:a,onChange:o,options:i,...l}=e;return n(f,{type:"radios",...l},_.map(i,((e,a)=>{if(!e.hide)return n(C,{key:a,value:e.value,checked:t==e.value||null==t&&""==e.value,onChange:e=>o(e),disabled:e.disabled,label:e.label})})))}function N(e){let{className:t,onChange:a,options:o,placeholder:i,value:l,...s}=e,r=[...o];return void 0!==i&&r.unshift({value:"",label:i}),n(f,{type:"select",...s},n("select",{className:t,value:null!=l?l:"",onChange:e=>a(e.target.value)},_.map(r,((e,t)=>n("option",{key:t,value:e.value,disabled:e.disabled},e.label)))))}function S(e){let{className:t,onChange:a,...o}=e;return n(f,{type:"textarea",...o},n("textarea",{className:t,onChange:e=>a(e.target.value)}))}function L(e){let t=e.className?" "+e.className:"";return n("div",{className:"mapp-option-section"+t},n("h2",null,e.title),e.children)}function O(e){const t=e.className?"mapp-option "+e.className:"mapp-option";return n("div",{className:t},n("div",{className:"mapp-option-title"},e.title),n("div",{className:"mapp-option-value"},e.children))}function M(e){let{data:t,isDraggable:a,onAdd:o,onChangeData:i,onRender:s,...r}=e;const[p,m]=c({dragging:null,dragover:null,isDraggable:!1});function u(e){m((t=>({...t,...e})))}function g(e,a,n){let l=Array.isArray(t)?[...t]:[];switch(e){case"add":const e=o?o():{};l.push(e),i(l);break;case"change":l[n]={...t[n],...a},i(l);break;case"delete":confirm(mappl10n.delete_prompt)&&(l.splice(a,1),i(l));break;case"sort":let s=p.dragging,r=s<a?a-1:a;l.splice(r,0,l.splice(s,1)[0]),i(l),u({dragover:null})}}return l((()=>{}),[]),n("div",{className:"mapp-crud-list"},_.map(t,((e,t)=>n("div",{className:"mapp-crud-row"+(p.dragover==t?" mapp-dragover":""),draggable:a,key:t,onDragOver:e=>e.preventDefault(),onDragStart:e=>u({dragging:t}),onDragEnter:e=>u({dragover:t}),onDragEnd:e=>u({dragging:null,dragover:null}),onDrop:e=>g("sort",t)},s({row:e,rowId:t,onChange:e=>g("change",e,t),onDelete:()=>g("delete",t)})))),n("div",{className:"mapp-crud-toolbar"},n(d,{isSecondary:!0,onClick:()=>g("add")},__("Add"))))}function E(e){let{actions:t,initialOpen:a,showToggle:o,subTitle:i,title:l,...s}=e;const[r,p]=c({isOpen:!o||a});function m(e,t){if("toggle"===e)o&&(a={isOpen:!r.isOpen},p((e=>({...e,...a}))));var a}let d="mapp-expand";return d+=r.isOpen?"":" mapp-expand-closed",d+=s.className?" "+s.className:"",n("div",{className:d},n("div",{className:"mapp-expand-header",onClick:()=>m("toggle")},n("div",null,l,i),o&&n("div",null,n(u,{icon:r.isOpen?"arrow-up":"arrow-down"}))),n("div",{className:"mapp-expand-body"},s.children),t&&n("div",{className:"mapp-expand-footer"},t))}function P(e){const[t,a]=c({dragging:null,dragover:null});function i(e){a((t=>({...t,...e})))}function l(a,o){let n=[...e.data];switch(a){case"add":let a={};_.map(e.cols,(e=>{a[e.id]=""})),n.push(a),e.onChange(n,e.selected);break;case"change":n[o.i][o.id]=o.value,e.onChange(n,e.selected);break;case"delete":let l;n.splice(o,1),l=o==e.selected?null:o<e.selected?e.selected-1:e.selected,e.onChange(n,l);break;case"select":i({selected:o}),e.onChange(n,o);break;case"sort":let s=t.dragging,r=s<o?o-1:o;n.splice(r,0,n.splice(s,1)[0]),e.onChange(n,r),i({dragover:null})}}return n("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&n("div",{className:"mapp-grid-table"},function(){const t=e.selectionColumn?n("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,a=n("div",{className:"mapp-grid-cell",key:"actions"},"");return n("div",{className:"mapp-grid-header"},n("div",{className:"mapp-grid-row"},t,_.map(e.cols,(e=>n("div",{className:"mapp-grid-cell",key:e.id},e.label))),a))}(),n("div",{className:"mapp-grid-body"},_.map(e.data,((a,s)=>function(a,s){return n("div",{className:"mapp-grid-row"+(t.dragover==s?" mapp-dragover":""),draggable:!0,key:s,onDragOver:e=>e.preventDefault(),onDragStart:e=>i({dragging:s}),onDragEnter:e=>i({dragover:s}),onDragEnd:e=>i({dragging:null,dragover:null}),onDrop:e=>l("sort",s)},function(t,a){if(!e.selectionColumn)return null;let o,i;return"rowid"==e.selectionColumn?o=a:t[e.selectionColumn]?o=t[e.selectionColumn]:i=!0,"checkbox"===e.selectionType?n("div",{className:"mapp-grid-cell"},n(v,{value:o,checked:e.selected==o,disabled:i,onChange:e=>{l("select",e?o:null)}})):n("div",{className:"mapp-grid-cell"},n(C,{checked:e.selected==o,onChange:()=>l("select",o)}))}(a,s),_.map(e.cols,((t,a)=>n("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:s+"-"+a},function(t,a){if(a.onRender)return a.onRender({id:a.id,value:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});switch(a.type){case"combobox":return n(k,{list:a.id+"_"+t,options:a.options,value:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});case"icon":return n(o.MappIconPicker,{iconid:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});default:return n(w,{size:e.data[t][a.size],value:e.data[t][a.id],onChange:e=>l("change",{i:t,id:a.id,value:e})});case"select":return n(N,{value:e.data[t][a.id],options:a.options,onChange:e=>l("change",{i:t,id:a.id,value:e}),placeholder:""})}}(s,t)))),function(e){return n("div",{className:"mapp-grid-cell",key:"delete"},n(d,{icon:"trash",onClick:()=>l("delete",e)}))}(s))}(a,s))))),n("div",{className:"mapp-grid-toolbar"},n(d,{isSecondary:!0,onClick:()=>l("add")},__("Add"))))}function I(e){e={className:null,onRender:null,onSelect:null,initialTab:null,tabs:[],...e};const[t,a]=c({tab:e.initialTab?e.initialTab:e.tabs[0].name});function o(t){var o;o={tab:t},a((e=>({...e,...o}))),e.onSelect&&e.onSelect(t)}const{className:i="",style:l={}}=e;return n("div",{className:"mapp-tabs "+i,style:l},n("div",{className:"mapp-tabs-nav"},_.map(e.tabs,(e=>n("div",{className:e.name==t.tab?"mapp-tab mapp-active":"mapp-tab",key:e.name,onClick:()=>o(e.name)},e.label)))),n("div",{className:"mapp-tab-content"},e.onRender(t.tab)))}},315:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappOptionsMeta:()=>f});var o=a(577),n=a(939);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useCallback:p,useRef:c,useState:m}=wp.element,{Button:d,Dashicon:u,FormTokenField:g,Modal:h}=wp.components,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){e={errors:null,postEdit:null,userEdit:null,...e};const[t,a]=m({errors:e.errors?e.errors:[],isBusy:!1,isDone:!1,logs:[],otype:null,start:null});c(null);function r(e){a((t=>({...t,...e})))}function p(t){if(t)return i("div",{className:"mapp-option-geocode-log"},_.map(t,(t=>{let a="";return a="user"==t.otype?e.userEdit+"?user_id="+t.oid:e.postEdit+"?post="+t.oid+"&action=edit",i("div",{className:"mapp-option-geocode-log-row",key:t.oid},i("div",null,t.otype),i("div",null,t.oid),i("div",null,i("a",{href:a,target:"_blank"},t.title)),i("div",null,t.msg))})))}s((()=>{t.isDone&&r({isBusy:!1})}),[t.start,t.isDone]),s((()=>{null===t.start||t.isDone||n.mappLib.ajax({method:"POST",data:{action:"mapp_geocode",batch_size:5,nonce:mappl10n.options.nonce,otype:t.otype,start:t.start},callback:e=>{if(e&&"OK"==e.status){const a=e.data.logs.length<5;r({errors:e.data.errors,isBusy:!a,isDone:a,logs:t.logs.concat(e.data.logs),start:a?t.start:t.start+5})}}})}),[t.start,t.isDone]);const u=t.logs.length?t.logs.length:1;let g="";return t.isBusy?g=__("Geocoding... "+u):t.isDone&&(g=__("Done")),i(l,null,i(o.Option,{title:__("Geocoding")},i(d,{className:"mapp-option-geocode",disabled:t.isBusy,isBusy:t.isBusy,isSecondary:!0,onClick:()=>{t.isBusy||r({isDone:!1,isBusy:!0,errors:[],logs:[],otype:"post",start:0})}},__("Geocode posts")),g,i("div",{style:{fontStyle:"italic"}},__("For bulk geocoding (>100 items) online geocoding services are faster and less expensive.")),p(t.logs)),function(){const e=t.errors.length>0?p(t.errors):__("No errors");return i(o.Option,{title:__("Geocoding errors")},i("div",{className:"mapp-option-geocode-errors"},e))}())}},146:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>x});var o=a(577),n=a(107),i=a(641),l=a(939),s=a(346),r=a(315),p=a(614),c=a(697);const m=wp.element.createElement,{Fragment:d,useEffect:u,useLayoutEffect:g,useCallback:h,useRef:f,useState:b}=wp.element,{useSelect:v}=wp.data,{Button:y,Dashicon:k,FormTokenField:w,Modal:C}=wp.components,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function x(e){const[t,a]=b({...e,isCheckingLicense:!1,isSaving:!1});f(null);function g(e){a((t=>({...t,...e})))}function h(e){return _.map(e,((e,t)=>({value:t,label:e})))}function C(e,t){return e&&Array.isArray(e)&&e.length?(_.map(e,(e=>{for(let t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),t?e.filter((e=>{for(let t in e)if(!e[t]||0==e[t].length)return!1;return!0})):e.filter((e=>!(!e.hasOwnProperty("key")||!e.key)))):[]}function x(e,a){switch(e){case"license-check":g({isCheckingLicense:!0}),l.mappLib.ajax({method:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:t.license},callback:e=>{if(g({isCheckingLicense:!1}),e&&"OK"==e.status){let a={...t.helpers};a.license_status=e.data,g({helpers:a})}}});break;case"reset":g({isSaving:!0}),l.mappLib.ajax({method:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:e=>{g({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}});break;case"save":let e={...t};delete e.helpers,e.filters.post=C(e.filters.post,!1),e.filters.user=C(e.filters.user,!1),e.metaKeys.post=C(e.metaKeys.post,!0),e.metaKeys.user=C(e.metaKeys.user,!0),e.sizes=C(e.sizes,!0),e.autoicons&&e.autoicons.values&&(e.autoicons.values=C(e.autoicons.values,!0)),g({isSaving:!0}),l.mappLib.ajax({method:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:e},callback:e=>{g({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}})}}return u((()=>{mappl10n.options.engine!=t.engine&&x("save")}),[t.engine]),m("div",{className:"mapp-options"},m("form",{onSubmit:e=>{e.preventDefault(),x("save")}},m(o.Section,{title:__("Sample Map"),className:"mapp-demo-section"},m("div",{className:"mapp-options-demo"},m(s.MappMap,{alignment:"default",height:300,pois:[{address:"San Francisco, CA",id:1,title:"MapPress",body:__("Maps for WordPress"),point:{lat:37.774095,lng:-122.418731}}],width:"100%",zoom:8}))),mappl10n.options.pro&&(!t.helpers.is_multisite||t.helpers.is_super_admin||t.helpers.is_main_site)&&m(o.Section,{title:__("License")},m(o.Option,{title:__("MapPress license key"),className:"mapp-option-license"},m(o.Input,{value:t.license,name:"license",onChange:e=>{let a={...t.helpers};a.license_status="",g({license:e,helpers:a})},size:37,placeholder:__("Enter license to enable automatic updates")}),function(){const e=t.helpers.license_status,a=m(y,{isSecondary:!0,href:"https://mappresspro.com/mappress"},__("Get license")),o=m(y,{isBusy:t.isCheckingLicense,isSecondary:!0,onClick:()=>x("license-check")},__("Check now")),n=m(y,{isLink:!0,target:"_blank",href:"https://mappresspro.com/account"},__("Your account"));return t.license?"active"==e?m("span",{className:"mapp-license-status"},m(k,{icon:"yes"}),__("Active")):m(d,null,o,n,e&&!t.isCheckingLicense&&m("div",null,m(k,{icon:"no"}),"inactive"==e?__("License is invalid or expired"):e)):a}()),m(o.Option,{title:__("Beta versions")},m(o.Checkbox,{checked:t.betas,label:__("Enable updates for beta versions"),onChange:e=>g({betas:e})}))),m(o.Section,{title:__("Basic Settings")},m(o.Option,{title:__("Mapping API")},m(o.Radios,{options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:e=>{g({engine:e,geocoder:"google"==e?"google":""})},checked:t.engine,help:{href:"#toc-picking-a-mapping-api",text:__("Leaflet is free and requires no API key. Google requires an API key and has usage limits.")}})),"leaflet"==t.engine&&function(){const e=[{value:"nominatim",label:"Nominatim",disabled:t.mapbox},{value:"mapbox",label:"MapBox",disabled:!t.mapbox},{value:"google",label:"Google",disabled:!t.apiKey}];let a={};return"nominatim"==t.geocoder&&(a={text:__("Nominatim is free but inaccurate. Consider using Mapbox or Google instead."),type:"warning"}),a.href="#toc-picking-a-geocoder",m(o.Option,{title:__("Geocoder")},m(o.Radios,{options:e,checked:t.geocoder,onChange:e=>g({geocoder:e}),help:a}))}(),"leaflet"==t.engine&&function(){const e=m(y,{isSecondary:!0,href:"https://account.mapbox.com/access-tokens/",target:"_blank"},__("Get an Access Token"));return m(o.Option,{title:__("Mapbox access token")},m("div",{className:"mapp-option-mapbox"},m(o.Input,{name:"mapbox",value:t.mapbox,onChange:e=>{g({mapbox:e}),g({geocoder:e?"mapbox":"nominatim"})},placeholder:__("Enter token to use Mapbox"),size:50}),e),m("div",{className:"mapp-help-text"},__("Mapbox makes Leaflet maps look great and provides an excellent geocoder.")))}(),function(){const e=m(y,{isSecondary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key",target:"_blank"},__("Get an API Key"));return m(o.Option,{title:__("Google API key"),className:"mapp-option-apikey"},m(o.Input,{name:"apiKey",value:t.apiKey,onChange:e=>{g({apiKey:e})},placeholder:"google"==t.engine?__("Enter API key to use Google maps"):__("Enter API key to use Google geocoder"),size:50}),e)}()),m(o.Section,{title:__("Map Settings")},m(o.Option,{title:__("Automatic display")},m(o.Radios,{options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:t.autodisplay,onChange:e=>g({autodisplay:e})})),m(o.Option,{title:__("Map alignment")},m(o.Radios,{options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:t.alignment,onChange:e=>g({alignment:e})})),m(o.Option,{title:__("Directions")},m(o.Radios,{checked:t.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:e=>g({directions:e})})),m(o.Option,{title:__("Mini width")},m(o.Input,{value:t.mini,onChange:e=>g({mini:e}),size:3,label:__("Width (px) to use map/list toggle buttons")})),"leaflet"==mappl10n.options.engine&&m(o.Option,{title:__("Scroll wheel zoom")},m(o.Checkbox,{checked:t.scrollWheel,label:__("Enable map zoom with mouse scroll wheel"),onChange:e=>g({scrollWheel:e})}))),m(o.Section,{title:__("POIs")},m(o.Option,{title:__("Default zoom")},m(o.Select,{label:__("Default zoom when displaying a single POI"),value:t.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(e=>({value:e,label:e}))),onChange:e=>g({poiZoom:e})})),m(o.Option,{title:__("Hover")},m(o.Checkbox,{checked:t.tooltips,label:__("Open POIs on hover"),onChange:e=>g({tooltips:e})})),m(o.Option,{title:__("Open first POI")},m(o.Checkbox,{checked:t.initialOpenInfo,onChange:e=>g({initialOpenInfo:e}),label:__("Open first POI when a map is displayed")})),m(o.Option,{title:__("Travel lines")},m(o.Checkbox,{label:__("Connect POIs with lines"),checked:t.lines,onChange:e=>g({lines:e})})),function(){const e=e=>g({lineOpts:{...t.lineOpts,...e}}),a=t.lineOpts,i=m(o.Select,{label:__("Icon"),onChange:t=>{e(t?{icons:[{icon:{path:t}}]}:{icons:null})},options:[{value:0,label:__("Circle")},{value:1,label:__("Arrow")},{value:2,label:__("Open arrow")}],placeholder:__("None"),value:a.icons?a.icons[0].icon.path:null}),l=m(o.Checkbox,{label:__("Geodesic (curved) lines"),checked:!!a.geodesic,onChange:t=>e({geodesic:t})}),s=m(o.Checkbox,{label:__("Animate icon"),checked:!!a.animate,onChange:t=>e({animate:t})});return m(o.Option,{title:__("Travel line options"),className:"mapp-option-line-options"},m(o.Control,{labelRight:__("Color")},m(n.MappColorPicker,{color:a.color,weight:a.weight,opacity:a.opacity,isExtended:!0,onChange:t=>e(t)})),"google"==t.engine&&l,"google"==t.engine&&i,"google"==t.engine&&s)}()),m(o.Section,{title:__("POI List")},m(o.Option,{title:__("Display")},m(o.Checkbox,{checked:t.poiList,label:__("Show a list of POIs with each map"),onChange:e=>g({poiList:e})})),m(o.Option,{title:__("Position")},m("div",{className:"mapp-option-poilist-radios"},m(o.Radios,{checked:t.layout,options:[{value:"left",label:__("Left of map")},{value:"inline",label:__("Below map")}],onChange:e=>g({layout:e})}))),"left"==t.layout&&m(o.Option,{title:__("Initial open")},m("div",{className:"mapp-option-poilist-open"},m(o.Checkbox,{checked:t.poiListOpen,label:__("Open list when map is displayed"),onChange:e=>g({poiListOpen:e})}))),m(o.Option,{title:__("Paging")},m("div",{className:"mapp-option-poilist-page-size"},m(o.Input,{labelRight:__("POIs per page"),max:999,min:1,onChange:e=>g({poiListPageSize:e}),size:3,type:"number",value:t.poiListPageSize}))),m(o.Option,{title:__("Sort")},m(o.Checkbox,{checked:t.sort,label:__("Sort POI list by title"),onChange:e=>g({sort:e})}))),m(o.Section,{title:__("Styled Maps")},m(o.Option,{title:__("Default style")},m("div",{className:"mapp-option-style"},m(p.m,{selected:t.style,onChange:e=>{g({style:e}),mappl10n.options.style=e}}),m("div",null,__('Replace the default "roadmap" or "streets" style'))))),mappl10n.options.pro&&m(o.Section,{title:__("Icons")},m(o.Option,{title:__("Default icon")},m(i.MappIconPicker,{iconid:t.defaultIcon,onChange:e=>{mappl10n.options.defaultIcon=e,g({defaultIcon:e})}})),m(o.Option,{title:__("Icon directory")},m("code",null,t.helpers.icon_directory)),m(o.Option,{title:__("Highlight selected POI")},m(o.Radios,{checked:t.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:e=>g({highlight:e})}),"icon"==t.highlight&&m(i.MappIconPicker,{defaultIcon:t.defaultIcon,iconid:t.highlightIcon,onChange:e=>g({highlightIcon:e})})),function(){let e=t.iconScale&&Array.isArray(t.iconScale)?[...t.iconScale]:[0,0];return m(o.Option,{title:__("Icon size")},m(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[0]=t>0?t:"",g({iconScale:e}))},size:3,type:"number",value:e[0]?e[0]:""}),m("span",null," X "),m(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[1]=t>0?t:"",g({iconScale:e}))},size:3,type:"number",value:e[1]?e[1]:""}),m("span",null," (px) "))}(),function(){let e=h(t.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});const a=v((e=>{if("post_type"==t.autoicons.key)return h(t.helpers.post_types);const a=wp.data.select("core").getEntityRecords("taxonomy",t.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return a?a.map((e=>({value:e.slug,label:e.name}))):[]}),[t.autoicons.key]);return m(o.Option,{title:__("Automatic icons")},m(o.Select,{label:__('Be sure to set "Show in REST API" for custom taxonomies'),value:t.autoicons?t.autoicons.key:null,options:e,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.key=e,a.values=[],g({autoicons:a})},placeholder:""}),m(o.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:a},{id:"value",label:__("Icon"),type:"icon"}],data:t.autoicons.values,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.values=e,g({autoicons:a})}}))}()),m(o.Section,{title:__("Clustering")},m(o.Option,{title:__("Clustering")},m(o.Checkbox,{checked:t.clustering,label:__("Enable marker clustering"),onChange:e=>g({clustering:e})})),function(){let e=t.clusteringOptions?t.clusteringOptions:{};const a=(t,a)=>{e[t]=a,g({clusteringOptions:e})};if("google"==t.engine){const t="https://github.com/googlemaps/v3-utility-library/blob/3fca406/packages/markerclustererplus/src/markerclusterer.ts",n=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return m("div",{className:"mapp-option-clustering-options"},m(o.Option,{title:__("Max zoom")},m(o.Select,{help:{href:t},label:m(d,null,__("Disable clustering at zoom"),m("code",null,"maxZoom")),onChange:e=>a("maxZoom",e),options:_.map(n,(e=>({value:e,label:e}))),placeholder:__("None"),value:e.maxZoom})))}{const t="https://github.com/Leaflet/Leaflet.markercluster#all-options",n=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return m("div",{className:"mapp-option-clustering-options"},m(o.Option,{title:__("Max zoom")},m(o.Select,{help:{href:t},label:m(d,null,__("Disable clustering at zoom"),m("code",null,"disableClusteringAtZoom")),onChange:e=>a("disableClusteringAtZoom",e),options:_.map(n,(e=>({value:e,label:e}))),placeholder:__("Auto"),value:e.disableClusteringAtZoom})),m(o.Option,{title:__("Spiderfy")},m(o.Checkbox,{checked:e.spiderfyOnMaxZoom,help:{href:t},label:m(d,null,__("Spiderfy"),m("code",null,"spiderfyOnMaxZoom")),onChange:e=>a("spiderfyOnMaxZoom",e)})),m(o.Option,{title:__("Coverage")},m(o.Checkbox,{checked:void 0===e.showCoverageOnHover||e.showCoverageOnHover,help:{href:t},label:m(d,null,__("Show cluster bounds on hover"),m("code",null,"showCoverageOnHover")),onChange:e=>a("showCoverageOnHover",e)})))}}()),mappl10n.options.pro&&m(o.Section,{title:__("Mashups")},function(){const e=[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}];return m(o.Option,{title:__("Marker click")},m(o.Radios,{checked:t.mashupClick,options:e,onChange:e=>g({mashupClick:e})}))}(),m(o.Option,{title:__("Popup content")},m(o.Radios,{checked:t.mashupBody,options:[{value:"poi",label:__("POI title + body")},{value:"post",label:__("Post title + excerpt")}],onChange:e=>g({mashupBody:e})})),m(o.Option,{title:__("Thumbnails")},m(o.Radios,{checked:t.mashupThumbs,options:[{value:"poi",label:__("POI images")},{value:"post",label:__("Post featured image")}],onChange:e=>g({mashupThumbs:e})})),m(o.Option,{title:__("KMLs")},m(o.Checkbox,{checked:t.mashupKml,label:__("Include KML POIs in mashups"),onChange:e=>g({mashupKml:e})}))),mappl10n.options.pro&&m(o.Section,{title:__("Search")},m(o.Option,{title:__("Search")},m(o.Checkbox,{checked:t.search,label:__("Enable search for mashups"),onChange:e=>g({search:e})})),m(o.Option,{title:__("Search radius")},m(o.Select,{help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},label:__("Minimum search radius (km)"),value:t.radius,options:_.map([1,5,10,15,25,50,75,100,200,300],(e=>({value:e,label:e}))),onChange:e=>g({radius:e})})),m(o.Option,{title:__("Search country")},m(o.Select,{label:__("Country code for searches"),value:t.country,options:_.map(["","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","VI","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW"],(e=>({value:e,label:e}))),onChange:e=>g({country:e}),help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}})),mappl10n.options.ssl?m(o.Option,{title:__("User location")},m(o.Checkbox,{checked:t.userLocation,label:__("Show user location on map"),onChange:e=>g({userLocation:e})})):null,function(){if("google"!=t.engine)return m(o.Option,{title:__("Bounding box")},m(o.Input,{onChange:e=>g({searchBox:e}),help:{text:__("Restrict searches to a bounding box (optional)"),href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},placeholder:"SW lon, SW lat, NE lng, NE lat",size:45,value:t.searchBox}))}()),mappl10n.options.pro&&m(o.Section,{title:__("Mashup filters")},m(o.Option,{title:__("Filters position")},m(o.Radios,{options:[{value:"top",label:__("Top")},{value:"list",label:__("POI list")}],checked:t.filtersPos,onChange:e=>g({filtersPos:e})})),function(){const e=[{name:"post",label:__("Posts")},{name:"user",label:__("Users")}];return m(o.Option,{className:"mapp-option-filters",title:__("Filters")},m(o.MappTabs,{tabs:e,onRender:e=>m(o.MappCrudList,{data:t.filters&&t.filters[e]?t.filters[e]:[],isDraggable:!0,onChangeData:a=>{let o={...t.filters};o[e]=a,g({filters:o})},onRender:a=>function(e){let a,{otype:n,row:i,rowId:l,onChange:s,onDelete:r,...p}=e,c=h(t.helpers.taxonomies);a="user"==n?[{label:__("Role"),value:"role"}]:[{label:__("Post type"),value:"post"},{label:__("Text search"),value:"text"},{label:"──────────",value:"",disabled:!0},...c];const d=function(e){const t=_.findWhere(a,{value:e.key});return t?t.label:__("New filter")},u="text"==i.key?[{value:"input",label:__("Input")}]:[{value:"checkbox",label:__("Checkboxes")},{value:"radio",label:__("Radio buttons")},{value:"select",label:__("Select")}];return m(o.MappExpand,{actions:m("div",null,m(y,{icon:"trash",onClick:()=>r(),title:__("Delete")})),className:"mapp-option-filter",initialOpen:!i.key,showToggle:!0,title:d(i)},m("div",{className:"mapp-option-filter-row"},m(o.Select,{labelTop:__("Filter type"),options:a,onChange:e=>s({key:e,format:"text"==e?"input":"checkbox"}),placeholder:"",value:i.key?i.key:""}),m(o.Select,{onChange:e=>s({format:e}),labelTop:__("Format"),options:u,placeholder:"",value:i.format?i.format:""}),m(o.Input,{labelTop:__("Label"),placeholder:d(i),value:i.label,onChange:e=>s({label:e})}),"post"!=i.key&&"meta"!=i.key&&"text"!=i.key&&m(o.Select,{labelTop:__("Sort"),value:i.sort,options:[{value:"name",label:__("Name")},{value:"slug",label:__("Slug")}],onChange:e=>s({sort:e})})),i.key&&"meta"!=i.key&&"text"!=i.key&&m("div",{className:"mapp-option-filter-row mapp-option-filter-tokens"},m(w,{label:__("Include term slugs"),value:i.include,onChange:e=>s({include:e}),__experimentalShowHowTo:!0}),m(w,{label:__("Exclude term slugs"),value:i.exclude,onChange:e=>s({exclude:e})})))}({otype:e,...a})})}))}()),mappl10n.options.pro&&m(o.Section,{title:__("Templates")},m(o.Option,{title:__("Custom templates")},m(c.MappTemplateEditor)),m(o.Option,{title:__("Directions link")},m(o.Checkbox,{checked:t.directionsPopup,label:__("Show in popup"),onChange:e=>g({directionsPopup:e})}),m(o.Checkbox,{checked:t.directionsList,label:__("Show in list"),onChange:e=>g({directionsList:e})})),m(o.Option,{title:__("Thumbnails")},m(o.Select,{label:__("Popups"),onChange:e=>g({thumbsPopup:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsPopup}),m(o.Select,{label:__("POI lists"),onChange:e=>g({thumbsList:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsList})),m(o.Option,{title:__("Popup thumbnail size")},m(o.Select,{onChange:e=>g({thumbSize:e}),options:h(t.helpers.thumbnail_sizes),value:t.thumbSize}),m("span",null," "+__("or")+" "),m(o.Input,{value:t.thumbWidth,onChange:e=>g({thumbWidth:e}),type:"number",min:0,max:9999}),m("span",null," X "),m(o.Input,{value:t.thumbHeight,onChange:e=>g({thumbHeight:e}),type:"number",min:0,max:9999}),m("span",null," (px) "))),m(o.Section,{title:__("Localization")},function(){const e="leaflet"==t.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport";return m(o.Option,{title:__("Language")},m(o.Select,{value:t.language,options:h(t.helpers.languages),onChange:e=>g({language:e}),help:{href:e,text:__("Language for searches and Google map controls")}}))}(),m(o.Option,{title:__("Directions server")},m(o.Input,{value:t.directionsServer,onChange:e=>g({directionsServer:e}),size:25}))),mappl10n.options.pro&&m(o.Section,{title:__("Generate Maps from Custom Fields")},function(){const e=[{name:"post",label:__("Posts")},{name:"user",label:__("Users")}];return m(o.Option,{className:"mapp-option-metakeys",title:__("Field mapping")},m(o.MappTabs,{tabs:e,onRender:e=>m(o.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:h(t.helpers.meta_fields)},{id:"value",label:__("post"==e?"Post custom field":"User custom field"),type:"combobox",options:h("post"==e?t.helpers.meta_keys:t.helpers.meta_keys_user)}],data:t.metaKeys[e],onChange:a=>{let o={...t.metakeys};o[e]=a,g({metaKeys:o})}})}))}(),m(o.Option,{title:__("Post types")},m(o.Checkboxes,{values:t.postTypes,options:h(t.helpers.post_types),onChange:e=>g({postTypes:e})})),m(o.Option,{title:__("Overwrite")},m(o.Checkbox,{label:__("Overwrite maps on publish/save"),checked:t.metaSyncSave,onChange:e=>{g({metaSyncSave:e})}})),"google"==t.engine&&m(o.Option,{title:__("Google Server API key")},m(o.Input,{name:"apiKeyServer",value:t.apiKeyServer,onChange:e=>g({apiKeyServer:e}),size:50,help:{text:__("Server API key for geocoding. Only required if client key is restricted by referrer."),href:"https://mappresspro.com/mappress-documentation/#toc-google-api-keys"}})),m(r.MappOptionsMeta,{errors:t.helpers.geocoding_errors,postEdit:t.helpers.post_edit,userEdit:t.helpers.user_edit})),mappl10n.options.pro&&mappl10n.options.acfActive&&m(o.Section,{title:__("Frontend Forms")},m(o.Option,{title:__("Advanced Custom Fields")},m(o.Input,{className:"mapp-option-acf",name:"acf",value:t.acf,onChange:e=>{g({acf:e})},size:20}),__("ACF map field to include on MapPress mashups"),m(o.Help,{text:__("To generate MapPress maps from ACF fields, leave this blank and use the Geocoding section"),href:"https://mappresspro.com/mappress-documentation/#toc-frontend-forms"}))),m(o.Section,{title:__("Miscellaneous")},m(o.Option,{title:__("Map sizes")},m(o.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:t.sizes,onChange:(e,t)=>g({sizes:e,size:t}),selectionColumn:"rowid",selected:t.size})),t.helpers.jetpack?null:m(o.Option,{title:__("Scripts")},m(o.Checkbox,{checked:t.footer,label:__("Output scripts in footer"),onChange:e=>g({footer:e}),help:{text:__("Disable footer scripts if maps are output using AJAX")}})),m(o.Option,{title:"WPML"},m(o.Checkbox,{checked:t.wpml,label:__("Copy maps when overwriting a translation"),onChange:e=>g({wpml:e}),help:{href:"https://mappresspro.com/mappress-documentation#wpml"}})),m(o.Option,{title:__("Compatibility")},m("div",null,m(o.Checkbox,{checked:t.deregister,label:__("Prevent loading Google Maps multiple times"),onChange:e=>g({deregister:e})})),m("div",null,m(o.Checkbox,{checked:t.iframes,label:__("Output maps in iframes for better compatibility"),onChange:e=>g({iframes:e})})))),m("div",{className:"mapp-options-toolbar"},m(y,{isBusy:t.isSaving,className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),m(y,{isBusy:t.isSaving,isSecondary:!0,onClick:()=>x("reset")},__("Reset Defaults")))))}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-options-settings")&&wp.element.render(m(x,mappress_options_state),document.getElementById("mapp-options-settings"))}))},185:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappPicker:()=>C});var o=a(286),n=a(68),i=(a(939),a(27)),l=a(78);window.mapp=window.mapp||{};const s=wp.element.createElement,{select:r}=wp.data,{Fragment:p,useEffect:c,useLayoutEffect:m,useRef:d,useState:u}=wp.element,{BaseControl:g,Button:h,Dashicon:f,Icon:b,Modal:v,PanelBody:y,Spinner:k,TextControl:w}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function C(e){e={context:null,mapid:null,mode:null,onClose:null,onInsert:null,onTrash:null,...e};const[t,a]=u({counts:{all:null,trashed:null,object:null},filter:"all",isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:""}),{addSnackbar:p,renderSnackbar:m}=(0,l.D)(),g=d(null),y=d(null),C=d(null);function x(e){a((t=>({...t,...e})))}function N(e,t,a){mapp.store.mutateMap(e,{otype:"post",oid:t,postTitle:a})}function S(){e.onClose()}function L(e){"trashed"!=t.filter&&x({mode:"edit",mapid:e})}function O(a){let n,i=a.mapid==t.mapid;n=a.title?a.title:__("Untitled");let l,c=function(t){let a;return a="map"==e.context||"mashup"==e.context&&"post"==t.otype&&t.oid==mappl10n.options.oid?r("core/editor").getEditedPostAttribute("title"):t.post_title,a=a||__("Untitled"),"post"==t.otype&&t.oid>0&&t.oid==mappl10n.options.oid&&(a=__("Current post")),"post"==t.otype&&t.oid>0?t.oid==mappl10n.options.oid?a:s("a",{href:mappl10n.options.editurl+"?post="+t.oid+"&action=edit",target:"_blank",title:__("Edit post")},a):__("Unattached")}(a);l="trashed"==t.filter?s("div",{className:"mapp-pick-actions"},s("a",{href:"#",key:"restore",onClick:()=>{return e=a.mapid,mapp.store.mutateMap(e,{status:""}),void p(__("Map restored"));var e}},__("Restore")),s("a",{href:"#",className:"mapp-destructive",key:"delete",onClick:()=>{return o=a.mapid,confirm(mappl10n.delete_map_prompt)&&(mapp.store.destroyMap(o),p(__("Map deleted"))),t.mapid&&o==t.mapid&&e.onTrash&&e.onTrash(),void(y.current&&y.current.focus());var o}},__("Delete Permanently"))):s("div",{className:"mapp-pick-actions"},s("a",{href:"#",key:"edit",onClick:()=>L(a.mapid)},__("Edit")),"library"!=e.context&&s("a",{href:"#",key:"insert",onClick:t=>{return o=a.mapid,void e.onInsert(o);var o}},__("Insert into post")),s("a",{href:"#",key:"duplicate",onClick:e=>{return t=a.mapid,void mapp.store.duplicateMap(t,(e=>{p(__("Map copied")),x({mapid:e}),g.current&&(g.current.scrollTop=0)}));var t}},__("Copy")),s("a",{href:"#",className:"mapp-destructive",key:"trashed",onClick:e=>{return t=a.mapid,mapp.store.mutateMap(t,{status:"trashed"}),void p(__("Map moved to trash"));var t}},__("Trash")));let m=null;return m="post"==a.otype&&a.oid>0?s("a",{href:"#",onClick:()=>{return e=a.mapid,void mapp.store.mutateMap(e,{oid:0});var e}},__("Detach")):"library"==e.context?s(o.MappAttachControl,{onChange:(e,t)=>N(a.mapid,e,t)},__("Attach")):s("a",{href:"#",onClick:()=>N(a.mapid,mappl10n.options.oid,null)},__("Attach")),s("div",{className:"mapp-pick-item"+(i?" mapp-selected":""),key:a.mapid+a.otype+a.oid,ref:i?C:null},s("div",{className:"mapp-pick-col-mapid",onClick:()=>L(a.mapid)},a.mapid),s("div",{className:"mapp-pick-col-title"},s("div",{className:"mapp-title",onClick:()=>L(a.mapid)},n),s("div",null,l)),s("div",{className:"mapp-pick-col-otitle"},c,s("div",null,m)),"library"==e.context&&s("div",{className:"mapp-pick-col-shortcode"},s(h,{isSmall:!0,isSecondary:!0,onClick:e=>{!function(e){const t=document.createElement("input");document.body.appendChild(t),t.value='[mappress mapid="'+e+'"]',t.select(),document.execCommand("copy"),t.remove(),p(__("Shortcode copied"))}(a.mapid)}},__("Copy"))))}function M(e){return e&&e.length?s(i.MappPaginate,{count:e?e.length:0,onChange:e=>function(e){x({page:e}),g.current&&(g.current.scrollTop=0)}(e),page:t.page,pageSize:20}):null}c((()=>{const e=e=>{if(!e.isFetchingItems){let t={all:0,object:0,trashed:0};_.map(e.items,(e=>{"trashed"==e.status?t.trashed++:(t.all++,"post"==e.otype&&e.oid==mappl10n.options.oid&&t.object++)})),x({counts:t})}x({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)}),[]),c((()=>{mapp.store.fetchItems()}),[]),c((()=>{x({page:1})}),[t.filter,t.search]),c((()=>{"list"==t.mode&&y.current&&y.current.focus()}),[t.mode]);const E=_.filter(t.items,(function(e){if("trashed"==t.filter)return"trashed"==e.status;if("trashed"==e.status)return!1;if("object"==t.filter&&("post"!=e.otype||e.oid!=mappl10n.options.oid))return!1;var a=t.search.toLowerCase();return!a||(e.mapid.indexOf(a)>=0||(!!(e.post_title&&e.post_title.toLowerCase().indexOf(a)>=0)||!!(e.title&&e.title.toLowerCase().indexOf(a)>=0)))}));let P=s("div",{className:"mapp-list-panel"},s("div",{className:"mapp-gt-modal-header"},s("div",{className:"mapp-gt-modal-header-title"},s("h1",null,__("Maps")),s(h,{isPrimary:!0,onClick:()=>{x({mode:"edit",mapid:null})}},__("Add New"))),s(h,{onClick:()=>S(),icon:"no-alt"})),function(){let a=[{label:__("All"),value:"all"},{label:__("Attached to post"),value:"object",hide:"library"==e.context},{label:__("Trash"),value:"trashed"}];return s("div",{className:"mapp-pick-filter-wrapper"},s("div",{className:"mapp-pick-filter-tabs"},_.map(a,((e,a)=>{const o="mapp-pick-filter-tab"+(t.filter==e.value?" mapp-active":""),n=t.counts[e.value];if(!e.hide)return s("div",{className:o,href:"#",key:a,onClick:()=>function(e){x({filter:e})}(e.value)},e.label,null!=n&&s("span",{className:"mapp-pick-filter-count"},n))}))),function(){if("trashed"!=t.filter)return s("div",{className:"mapp-pick-search-wrapper"},s(w,{ref:y,className:"mapp-pick-search",tabIndex:1,placeholder:__("post title, map title, or map id"),onChange:e=>x({search:e}),size:50,value:t.search}),s(b,{icon:"search"}),(t.isFetchingItems||t.isAttaching&&"library"!=e.context)&&s(k,null))}())}(),function(a){if(a){const e=20*(t.page-1),o=e+20;a=a.slice(e,o)}let o="";return o=t.isFetchingItems?null:a.length?_.map(a,O):s("div",{className:"mapp-pick-message"},__("No maps found")),s("div",{className:"mapp-pick-items-section"},s("div",{className:"mapp-pick-items",ref:g},function(){let t=[{id:"mapid",className:"mapp-pick-col-mapid",label:__("ID"),sortable:!0},{id:"title",className:"mapp-pick-col-title",label:__("Map title"),sortable:!0},{id:"post_title",className:"mapp-pick-col-otitle",label:__("Attached to"),sortable:!0}];"library"==e.context&&t.push({id:"shortcode",className:"mapp-pick-col-shortcode",label:__("Shortcode"),sortable:!1});return s("div",{className:"mapp-pick-items-header"},_.map(t,(e=>s("div",{className:e.className,onClick:()=>{return t=e.id,void mapp.store.setSort({sortBy:t,sortAsc:mapp.store.state.sortBy!=t||!mapp.store.state.sortAsc});var t},key:e.id},e.label,e.sortable&&mapp.store.state.sortBy==e.id&&s(f,{icon:mapp.store.state.sortAsc?"arrow-up":"arrow-down"}),e.sortable&&mapp.store.state.sortBy!=e.id&&s(f,{icon:"leftright"})))))}(),o))}(E),function(e){return s("div",{className:"mapp-pick-toolbar"},M(e))}(E)),I=null;if("edit"==t.mode){let a=s("div",{className:"mapp-edit-panel"},s(n.MappEdit,{context:e.context,mapid:t.mapid,onClose:()=>{"edit"==e.mode?e.onClose():x({mode:"list"})},onSave:t=>function(t){"edit"==e.mode?e.onClose():(x({mode:"list",mapid:t.mapid}),p(sprintf(__("Map %d saved"),t.mapid)))}(t)}));I="library"==e.context?s(v,{className:"mapp-gt-modal",isDismissible:!1},a):a}const T="mapp-pick mapp-mode-"+t.mode+" mapp-context-"+e.context;return"library"==e.context?s("div",{className:T},P,I,m()):s(v,{className:"mapp-gt-modal "+T,isDismissible:"list"==t.mode,onRequestClose:()=>S(),shouldCloseOnEsc:"list"==t.mode,shouldCloseOnClickOutside:"list"==t.mode},P,I,m())}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-library")&&(mappl10n.options.otype="post",mappl10n.options.oid=0,wp.element.render(s(C,{context:"library"}),document.getElementById("mapp-library")))}))},885:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappSettings:()=>v});var o=a(614),n=a(78),i=a(577);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,{BaseControl:d,Button:u,ButtonGroup:g,Dashicon:h,Dropdown:_,Panel:f,PanelBody:b}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function v(e){e={center:null,context:null,height:null,mapid:null,mapTypeId:null,onChange:null,poiList:null,search:null,title:null,width:null,zoom:null,...e};const[t,a]=m({});const{addSnackbar:r,renderSnackbar:p}=(0,n.D)();function c(t,a){let o={};null!=a&&(o.height=a),null!=t&&(o.width=t),e.onChange(o)}const d="mce"!=e.context&&"library"!=e.context;return l("div",{className:"mapp-settings"},l(b,{title:__("Map settings"),initialOpen:d},"map"==e.context&&function(){const t=e.title?e.title:__("Untitled");return l("div",{className:"mapp-settings-row mapp-settings-title"},l(i.Control,{labelTop:__("Title")},t))}(),"map"==e.context&&l("div",{className:"mapp-settings-row"},l(i.Control,{labelTop:__("Map ID")},e.mapid)),function(){if("mashup"==e.context)return l("div",{className:"mapp-settings-row mapp-style-toggle"},l("div",null,__("Style")),l(o.m,{selected:e.mapTypeId,onChange:t=>function(t){e.onChange({mapTypeId:t})}(t)}))}(),function(){mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];var t=mappl10n.options.sizes.map(((e,t)=>({label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1})));t.unshift({height:"",label:__("Default"),value:0,width:""}),t.push({label:__("Custom"),value:"custom",disabled:!0});for(var a="custom",o=0;o<t.length-1;o++)t[o].width==e.width&&t[o].height==e.height&&(a=o);return l(s,null,l("div",{className:"mapp-settings-row"},l(i.Select,{className:"mapp-settings-dims-select",help:"",labelTop:__("Size"),value:a,options:t,onChange:e=>c(t[e].width,t[e].height)})),l("div",{className:"mapp-settings-row"},l(i.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vw")},labelTop:__("Width"),onChange:e=>c(e,null),value:e.width?e.width:""}),l(i.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vh")},labelTop:__("Height"),onChange:e=>c(null,e),value:e.height?e.height:""})))}(),l("div",{className:"mapp-settings-row"},l(i.Control,{className:"mapp-settings-viewport",labelTop:__("Center/Zoom")},l(g,{label:__("Center/Zoom")},l(u,{onClick:()=>(r(__("Viewport automatic")),void e.onChange({center:null,zoom:null})),isPressed:!e.center,isSmall:!0},__("Automatic")),l(u,{onClick:()=>function(){r(__("Viewport set"));const t=e.viewport.center?e.viewport.center.lat+","+e.viewport.center.lng:null;e.onChange({center:t,zoom:e.viewport.zoom})}(),isPressed:e.center,isSmall:!0},__("Set"))))),void 0,p()))}},78:(e,t,a)=>{"use strict";a.d(t,{D:()=>s});const{useEffect:o,useState:n}=wp.element,{createContext:i}=React,l=wp.element.createElement,s=()=>{const[e,t]=n({snackbars:[]});function a(e){t((t=>({...t,...e})))}o((()=>{if(e.snackbars.length){const t=setTimeout((()=>{let t=[...e.snackbars];t.shift(),a({snackbars:t})}),5e3);return()=>clearTimeout(t)}}),[e.snackbars]);return{addSnackbar:t=>a({snackbars:[...e.snackbars,t]}),renderSnackbar:()=>l("div",{className:"mapp-snackbars"},e.snackbars.map(((e,t)=>l("div",{className:"mapp-snackbar mapp-snackbar-show",key:t},e))))}}},66:(e,t,a)=>{"use strict";a.r(t);var o=a(939);window.mapp=window.mapp||{};mapp.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"mapid",sortAsc:!1,maps:{},items:[]}},mapp.Store.prototype={createMap:function(){let{success:e=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isFetchingMap=!1,this.publish(),e()},destroyMap:function(e){o.mappLib.ajax({method:"POST",data:{action:"mapp_delete",mapid:e,nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status&&(delete this.state.maps[e],this.destroyItem(e)),this.publish()}})},duplicateMap:function(e,t){this.state.isSavingMap=!0,this.publish(),o.mappLib.ajax({method:"POST",data:{action:"mapp_duplicate",mapid:e,nonce:mappl10n.options.nonce},callback:e=>{if(e&&"OK"==e.status){const a=e.data;this.saveItem(a.mapid,a),t&&t(a.mapid)}this.state.isSavingMap=!1,this.publish()}})},fetchMap:function(e){void 0===this.state.maps[e]?(this.state.isFetchingMap=!0,this.publish(),o.mappLib.ajax({method:"GET",data:{action:"mapp_get",mapid:e,nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status?(t.data.pois.map((e=>{e.id=o.mappLib.nanoid()})),this.state.maps[e]=t.data):this.state.maps[e]=null,this.state.isFetchingMap=!1,this.publish()}})):this.publish()},mutateMap:function(e,t){this.state.isSavingMap=!0,this.saveItem(e,t),this.state.maps[e]&&(this.state.maps[e]={...this.state.maps[e],...t}),this.publish(),o.mappLib.ajax({method:"POST",data:{action:"mapp_mutate",mapid:e,mapdata:t,nonce:mappl10n.options.nonce},callback:e=>{this.state.isSavingMap=!1,this.publish()}})},saveMap:function(e,t){e.mapid&&(this.state.maps[e.mapid]=e),this.state.isSavingMap=!0,this.publish(),o.mappLib.ajax({method:"POST",data:{action:"mapp_save",mapdata:e,nonce:mappl10n.options.nonce},callback:a=>{if(a&&"OK"==a.status){const o=a.data,n={...e,mapid:o};this.state.maps[o]=n,this.saveItem(o,n),t&&t(n)}this.state.isSavingMap=!1,this.publish()}})},destroyItem:function(e){let t=this.state.items?this.state.items:[],a=_.findIndex(t,{mapid:e});a>-1&&t.splice(a,1),this.state.items=[...t],this.publish()},fetchItems(e){if(this.state.itemsFetched)return this.publish(),void(e&&e(this.state.items));this.state.isFetchingItems=!0,this.publish(),o.mappLib.ajax({method:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status&&(this.state.items=t.data,this.sort(),this.state.itemsFetched=!0,e&&e(this.state.items)),this.state.isFetchingItems=!1,this.sort(),this.publish()}})},saveItem:function(e,t){let a=this.state.items?this.state.items:[],o=_.findWhere(a,{mapid:e});o?(_.map(["otype","oid","title","post_title","status"],(e=>{void 0!==t[e]&&(o[e]=t[e])})),o={...o}):(o={mapid:e,title:t.title,otype:mappl10n.options.otype,oid:mappl10n.options.oid,post_title:null},a.unshift(o))},setSort:function(e){e.sortBy&&(this.state.sortBy=e.sortBy),void 0!==e.sortAsc&&(this.state.sortAsc=e.sortAsc),this.sort(),this.publish()},sort:function(e,t){const a=(o="untitled",wp.i18n.__(o,"mappress-google-maps-for-wordpress"));var o;this.state.items.sort(((e,t)=>function(e,t,o,n){if(n=n?1:-1,"mapid"==o)return n*(Number(e.mapid)-Number(t.mapid));let i=e[o]?e[o]:a,l=t[o]?t[o]:a,s=n*i.localeCompare(l);return 0==s?Number(e.mapid)-Number(t.mapid):s}(e,t,this.state.sortBy,this.state.sortAsc)))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){let e=[...this.subs];for(let t of e)t(this.state)}},mapp.store=new mapp.Store},614:(e,t,a)=>{"use strict";a.d(t,{m:()=>w});var o=a(577),n=a(939),i=a(27);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,{Button:d,Dashicon:u,ExternalLink:g,Icon:h,Modal:f,Panel:b,PanelBody:v,PanelRow:y,Spinner:k}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function w(e){const[t,a]=m({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",isOpen:!1,isBusy:!1,isSearching:!1,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,snazzyPagination:null,snazzySearch:"",snazzySelected:null,snazzyStyles:null,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles});function r(e){a((t=>({...t,...e})))}function p(a){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=_.findIndex(t.userStyles,{id:a.id});i>=0&&!o&&!confirm(__("Style already exists, overwrite?"))||(r({isBusy:!0}),n.mappLib.ajax({method:"POST",data:{action:"mapp_style_save",style:a,nonce:mappl10n.options.nonce},callback:t=>{r({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,r({mode:"pick",userStyles:t.data}),e.onChange(a.id))}}))}function c(e){r({isSearching:!0,snazzyStyles:null}),n.mappLib.ajax({method:"GET",data:{sort:"popular",page:e,pageSize:50,text:t.snazzySearch,key:t.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){if(r({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles){r({snazzyStyles:_.map(e.styles,((e,t)=>(e.id=e.id+"",e)))})}else alert("Error: unable to fetch styles")}})}function u(e,t){t="large"==t||"small"==t?t:"small",t=800;let a=mappl10n.options.baseurl+"/images/json_style.png";if("leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(a="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):a=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(a=e.imageUrl),a)return l("img",{src:a,title:e.name})}function b(a,o){switch(a){case"close":case"pick-cancel":r({isOpen:!1});break;case"json-add":r({mode:"json-add"});break;case"json-cancel":case"mapbox-cancel":case"snazzy-cancel":r({mode:"pick"});break;case"json-edit":e.onChange(o.id),r({mode:"json-edit"});break;case"json-save":p(o,!0);break;case"mapbox-add":case"snazzy-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"mapbox-change-url":{let e,t,a;e=o.trim().toLowerCase(),e=e.replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/",""),e=e.split("?")[0];let n=e.split("/");2==n.length&&(t=n[0],a=n[1]),r({mapboxUrl:o,mapboxUser:t,mapboxId:a});break}case"mapbox-edit":e.onChange(o.id),r({mode:"mapbox",mapboxId:o.mapboxid,mapboxName:o.name,mapboxUrl:o.url,mapboxUser:o.user});break;case"mapbox-save":t.mapboxName&&t.mapboxUser&&p({id:t.mapboxId,name:t.mapboxName,mapboxid:t.mapboxId,provider:"mapbox",url:t.mapboxUrl,user:t.mapboxUser});break;case"mode":r({mode:o});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?r({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen to use styled maps."));break;case"pick-delete":confirm(mappl10n.delete_prompt)&&(i=o,_.findIndex(t.userStyles,{id:i})<0?n.mappLib.alert("Invalid delete"):(r({isBusy:!0}),n.mappLib.ajax({method:"POST",data:{action:"mapp_style_delete",id:i,nonce:mappl10n.options.nonce},callback:t=>{r({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,r({userStyles:t.data}),e.selected==i&&e.onChange(null))}})));break;case"pick-select":e.onChange(o),r({isOpen:!1});break;case"snazzy-save":{let e=_.findWhere(t.snazzyStyles,{id:o});e&&p({id:o,imageUrl:e.imageUrl,json:e.json,name:e.name});break}case"snazzy-search":c()}var i}function v(){let a;return"json-add"==t.mode?a={id:null,name:"",json:""}:"json-edit"==t.mode&&(a=e.selected?_.findWhere(t.userStyles,{id:e.selected}):null),l(C,{style:a,onSave:e=>b("json-save",e),onCancel:()=>b("json-cancel")})}function y(e){let a;return a=e.styles&&e.styles.length?_.map(e.styles,((t,a)=>function(e,t){let a,o="mapp-style"+(t.selected==e.id?" mapp-selected":"");(t.onEdit||t.onDelete)&&(a=l("div",{className:"mapp-style-actions"},l("a",{onClick:()=>t.onEdit(e)},__("Edit")),l(h,{icon:"trash",onClick:()=>t.onDelete(e.id)})));return l("div",{className:o,key:e.id},l("div",{className:"mapp-style-image",onClick:()=>t.onSelect(e.id)},u(e)),l("div",{className:"mapp-style-details"},l("div",{className:"mapp-style-title"},e.name),a))}(t,e))):t.isSearching?"":l("div",{className:"mapp-style-list-msg"},__("No results")),l("div",{className:"mapp-style-list-wrapper"},l("div",{className:"mapp-style-list-header"},e.title),l("div",{className:"mapp-style-list"},a))}return l(s,null,function(){const a=t.standardStyles.concat(t.userStyles);let o=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,n=_.findWhere(a,{id:o});return n=n||t.standardStyles[0],l(d,{className:"mapp-style-toggle",icon:u(n),iconSize:75,isSecondary:!0,onClick:()=>b("open",null),title:n.name})}(),"edit"==t.mode&&t.isOpen&&renderEdit(),"json-add"==t.mode&&t.isOpen&&v(),"json-edit"==t.mode&&t.isOpen&&v(),"mapbox"==t.mode&&t.isOpen&&function(){let e=t.mapboxUser&&t.mapboxId?u({user:t.mapboxUser,mapboxid:t.mapboxId,name:t.mapboxName},"large"):null;const a=!t.mapboxUser||!t.mapboxId||!t.mapboxName;return l(f,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:()=>b("mapbox-cancel"),shouldCloseOnClickOutside:!0},l("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),l(g,{href:"https://studio.mapbox.com"})),l("form",{className:"mapp-style-mapbox-form",onSubmit:e=>{e.stopPropagation(),e.preventDefault(),b("mapbox-save")}},l("label",null,l(o.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",labelTop:l(s,null,__("MapBox Share URL"),l(o.Help,{href:"#toc-mapbox-studio-styles"})),onChange:e=>b("mapbox-change-url",e),value:t.mapboxUrl})),l("label",null,l("div",{className:"mapp-style-mapbox-label"},__("Style name")),l(o.Input,{className:"mapp-style-mapbox-name",value:t.mapboxName,onChange:e=>r({mapboxName:e})})),l("div",{className:"mapp-style-mapbox-preview"},e),l("div",{className:"mapp-style-toolbar"},l("div",null,l(d,{isBusy:t.isBusy,isPrimary:!0,disabled:a,type:"submit"},__("Save")),l(d,{isBusy:t.isBusy,onClick:()=>b("mapbox-cancel")},__("Cancel"))))))}(),"pick"==t.mode&&t.isOpen&&function(){let a="";return t.userStyles&&t.userStyles.length&&(a=y({selected:e.selected,onEdit:e=>"leaflet"==mappl10n.options.engine?b("mapbox-edit"):b("json-edit",e),onDelete:e=>b("pick-delete",e),onSelect:e=>b("pick-select",e),styles:t.userStyles,title:__("Custom styles")})),l(f,{title:l("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:()=>b("close")},l("div",{className:"mapp-style-list-wrapper"},y({onSelect:e=>b("pick-select",e),selected:e.selected,styles:t.standardStyles,title:__("Standard styles")}),a),l("div",{className:"mapp-style-toolbar"},l("div",null,l(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>"leaflet"==mappl10n.options.engine?b("mapbox-add"):b("json-add")},__("New style")),"google"==mappl10n.options.engine&&l(d,{isBusy:t.isBusy,isSecondary:!0,onClick:()=>b("snazzy-add")},__("Download style")),l(d,{isBusy:t.isBusy,onClick:()=>b("pick-cancel")},__("Cancel")))))}(),"snazzy"==t.mode&&t.isOpen&&(t.snazzySelected,l(f,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:()=>b("snazzy-cancel"),shouldCloseOnClickOutside:!0},l("form",{className:"mapp-style-snazzy-form",onSubmit:e=>{b("snazzy-search"),e.preventDefault()}},l(o.Input,{className:"mapp-style-snazzy-search",value:t.search,placeholder:__("Search"),onChange:e=>r({snazzySearch:e})}),t.isSearching&&l(k,null),!t.isSearching&&l(d,{isPrimary:!0,icon:"search",onClick:()=>b("snazzy-search")})),y({selected:t.snazzySelected,styles:t.snazzyStyles,onSelect:e=>r({snazzySelected:e})}),l("div",{className:"mapp-style-toolbar"},l("div",null,l(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>b("snazzy-save",t.snazzySelected)},__("Save")),l(d,{isBusy:t.isBusy,onClick:()=>b("snazzy-cancel")},__("Cancel"))),function(){const e=t.snazzyPagination;return e&&t.snazzyStyles&&t.snazzyStyles.length?l(i.MappPaginate,{count:e.totalItems,onChange:e=>c(e),page:e.currentPage,pageSize:e.pageSize}):null}()))))}function C(e){const[t,a]=m((()=>{let t={...e.style},a="";try{a=JSON.stringify(JSON.parse(t.json),null,2)}catch(e){}return t.json=a,{style:t}}));function n(e){a((t=>({...t,...e})))}function i(a,o){let i={...t.style};switch(a){case"cancel":e.onCancel();break;case"change-json":i.json=o,n({style:i});break;case"change-name":i.name=o,n({style:i});break;case"save":i.json=i.json?JSON.stringify(JSON.parse(i.json)):"",e.onSave(i)}}let s;if(t.style.json)try{JSON.parse(t.style.json)}catch(e){s=e.toString()}let r=s?"mapp-json mapp-json-error":"mapp-json";return l(f,{title:l(o.Input,{value:t.style.name,onChange:e=>i("change-name",e),placeholder:__("Enter style name")}),className:"mapp-style-modal mapp-json-modal",onRequestClose:()=>i("cancel"),shouldCloseOnClickOutside:!0},l("div",null,__("JSON")),l("div",{className:r},l("textarea",{value:t.style.json,spellCheck:!1,onChange:e=>i("change-json",e.target.value)})),l("div",{className:"mapp-json-error"},s||""),l("div",{className:"mapp-json-toolbar"},l("div",null,l(d,{disabled:s,isBusy:t.isBusy,isPrimary:!0,onClick:()=>i("save")},__("Save")),l(d,{isBusy:t.isBusy,onClick:()=>i("cancel")},__("Cancel")))))}},573:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappCard:()=>f});var o=a(939);a(577);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:m}=wp.data,{Button:d,Dashicon:u,ExternalLink:g,Guide:h,Modal:_}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){let{icon:t,title:a,...o}=e;return n("div",{className:"mapp-support-card"},a&&n("div",{className:"mapp-support-card-title"},n("h3",null,t&&n(u,{icon:t}),a)),n("div",{className:"mapp-support-card-content"},o.children))}document.getElementById("mapp-support-page")&&wp.element.render(n((function(e){const[t,a]=c({engine:e.engine?e.engine:"leaflet",isOpen:e.isOpen,apiKey:e.apiKey,mapbox:e.mapbox});function s(e){a((t=>({...t,...e})))}function r(e){return n("div",{className:"mapp-guide-engine"+(e.selected?" mapp-selected":""),onClick:()=>e.onClick()},n("h2",{className:"mapp-guide-engine-title"},e.title),n("div",{className:"mapp-guide-engine-content"},e.content))}return p(null),l((()=>{}),[]),n("div",{className:"mapp-support"},n(i,null,n("div",{className:"mapp-support-section"},n("div",{className:"mapp-support-header"},n("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),n("h1",null,__("MapPress Support")),n("i",null,__("Build amazing maps with the easiest and most powerful mapping plugin available")),n("div",null,n(d,{className:"mapp-support-guide-toggle",isPrimary:!0,onClick:()=>s({isOpen:!0})},__("Open Setup Wizard"))))),n("div",{className:"mapp-support-section"},n("div",{className:"mapp-support-cards"},n(f,{icon:"book",title:__("Documentation")},n("p",null,__("Detailed plugin documentation:")),n(g,{href:"https://mappresspro.com/mappress-documentation/"},__("Documentation")),n(g,{href:"https://mappresspro.com/whats-new/"},__("What's new")),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Creating your first map"))),n(f,{icon:"warning",title:__("Troubleshooting")},n("p",null,n("b",null,__("Check for a plugin or theme conflict:"))),n("ol",null,n("li",null,__("Deactivate ALL other plugins")),n("li",null,__("Switch to a standard WordPress theme")),n("li",null,__("If the maps are working, reactivate one by one to find the conflict."))),n("p",null,__("For more info:")),n(g,{href:"https://mappresspro.com/mappress-faq/"},__("MapPress FAQ"))),n(f,{icon:"megaphone",title:__("Support")},n("p",null,__("Need some help?")),n(g,{href:"https://mappresspro.com/forums/forum/mappress-support/"},__("Support forum")),n(g,{href:"https://mappresspro.com/chris-contact/"},__("Contact")))))),function(){if(t.isOpen)return n(h,{className:"mapp-guide",onFinish:()=>function(e,a){if("save"===e){let e;s({isOpen:!1}),e="google"==t.engine?"google":t.mapbox?"mapbox":"nominatim",o.mappLib.ajax({method:"POST",data:{action:"mapp_option_save",nonce:mappl10n.options.nonce,settings:{engine:t.engine,apiKey:t.apiKey,mapbox:t.mapbox,geocoder:e}},callback:e=>{"OK"!=e.status&&alert("Unable to save settings. Please check the support troubleshooting guide.")}})}}("save"),pages:[{content:n("div",{className:"mapp-guide-page mapp-guide-engines"},n("h1",null,__("Please Choose a Mapping API")),n("p",null,__("MapPress supports both Leaflet and Google mapping APIs."),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-picking-a-mapping-api"},__("Learn more"))),n("div",{className:"mapp-guide-engines"},r({onClick:()=>s({engine:"leaflet"}),selected:"leaflet"==t.engine,title:"Leaflet",content:n("ul",null,n("li",null,__("No API key")),n("li",null,__("Free unlimited usage")),n("li",null,__("Good functionality")),n("li",null,__("Best for high traffic sites")))}),r({onClick:()=>s({engine:"google"}),selected:"google"==t.engine,title:"Google",content:n("ul",null,n("li",null,__("API key required")),n("li",null,__("Limited free usage")),n("li",null,__("Excellent functionality")),n("li",null,__("Best for low traffic sites")))}))),image:n("div",{className:"mapp-guide-header mapp-guide-image-small"},n("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),n("h1",null,__("Welcome to MapPress!")))},{content:"google"==t.engine?n("div",{className:"mapp-guide-page mapp-guide-apikey"},n("h1",null,__("Google API Key")),n("p",null,__("Google requires an API key to use Google Maps. Please enter your key below.")),n(d,{isPrimary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key/",target:"_blank"},__("Get an API Key")),n("input",{className:"mapp-guide-apikey",onChange:e=>s({apiKey:e.target.value}),placeholder:__("Enter your API key here"),value:t.apiKey})):n("div",{className:"mapp-guide-page mapp-guide-apikey"},n("h1",null,__("Sign up with Mapbox")),n("p",null,__("Mapbox makes Leaflet better, with great-looking map tiles, styled maps, and a powerful geocoder.")," "+__("A generous free tier means it's free for most sites."),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-using-mapbox-with-leaflet"},__("Learn more"))),n(d,{isPrimary:!0,href:"https://account.mapbox.com/auth/signup/",target:"_blank"},__("Get Mapbox Access Token")),n("input",{className:"mapp-guide-apikey",onChange:e=>s({mapbox:e.target.value}),placeholder:__("Enter your access token here"),value:t.mapbox})),image:n("div",{className:"mapp-guide-header mapp-guide-image-small"},"google"==t.engine&&n("img",{src:mappl10n.options.baseurl+"/images/google_logo.png"}),"leaflet"==t.engine&&n("img",{src:mappl10n.options.baseurl+"/images/mapbox_logo_white.png"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-gutenberg"},n("h1",null,__("Maps in the Block Editor")),n("p",null,__("MapPress provides custom block types for the Gutenberg editor.")),n("p",null,__("Just insert a MapPress Map block to get started."),n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-gutenberg-block-editor"},__("Learn more")))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/gutenberg_map_block.gif"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-classic"},n("h1",null,__("Maps in the Classic Editor")),n("p",null,__('MapPress also supports the "classic" editor. Just click the MapPress button to open the map library.')),n("p",null,n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-classic-editor"},__("Learn more")))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/classic_map.gif"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-library"},n("h1",null,__("Map Library")),n("p",null,__("The Map Library provides an easy way to see and edit all of your maps. The library can be opened in the post editor or from the MapPress menu.")),n("p",null,n(g,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Learn more")))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/library_menu.gif"}))},{content:n("div",{className:"mapp-guide-page mapp-guide-end"},n("h1",null,__("Happy Mapping")),n("p",null,__("Enjoy the plugin! Replay this guide any time from the MapPress support menu."))),image:n("div",{className:"mapp-guide-header"},n("img",{src:mappl10n.options.baseurl+"/images/icon-128x128"}))}]})}())}),mappress_support_state),document.getElementById("mapp-support-page"))},697:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappTemplateEditor:()=>f});var o=a(577),n=a(939);const i=wp.element.createElement,{Fragment:l,useEffect:s,useLayoutEffect:r,useCallback:p,useRef:c,useState:m}=wp.element,{Button:d,Dashicon:u,Modal:g,TabPanel:h}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){const[t,a]=m({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null});function s(e){a((t=>({...t,...e})))}const r=p((e=>{if(null!=e){let a=wp.codeEditor.initialize(e);a.codemirror.setSize("auto","auto"),a.codemirror.setOption("readOnly","editor"!=t.tab),s({codeEditor:a})}}),[t.tab]);function c(){s({isOpen:!1})}function u(e){return"editor"==e?function(){const e=i("div",{className:"mapp-templates-tokens"},_.map(t.tokens,((e,a)=>i("code",{onClick:()=>function(e){let a=t.codeEditor.codemirror.getDoc(),o=a.getCursor();a.replaceRange("{{{poi."+e+"}}}",o)}(a),key:a,title:e},e))));return i(l,null,i("div",{className:"mapp-templates-path"},t.template.path),e,i("div",{className:"mapp-templates-editor"},i("textarea",{ref:r,defaultValue:t.template.content})))}():i(l,null,i("div",{className:"mapp-templates-standard"},i("textarea",{ref:r,defaultValue:t.template.standard})))}function h(){const e=t.template.name+" ("+(t.template.exists?__("Custom"):__("New"))+")";return i("div",{className:"mapp-templates-name"},e)}return i("div",{className:"mapp-templates"},function(){const e=[{name:"map-popup",label:__("Map popup")},{name:"map-item",label:__("Map list item")},{name:"mashup-popup",label:__("Mashup popup")},{name:"mashup-item",label:__("Mashup list item")},{name:"user-mashup-popup",label:__("User popup")},{name:"user-mashup-item",label:__("User list item")}];return i("div",{className:"mapp-templates-list"},_.map(e,((e,t)=>i("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:t=>{var a;t.preventDefault(),a=e.name,n.mappLib.ajax({method:"GET",data:{action:"mapp_tpl_get",name:a,nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status&&s({isOpen:!0,name:a,tab:"editor",template:e.data.template,tokens:e.data.tokens})}})}},e.label))))}(),t.isOpen&&t.template?i(g,{title:h(),className:"mapp-templates-modal",onRequestClose:()=>c(),shouldCloseOnClickOutside:!1},i(o.MappTabs,{className:"mapp-templates-tabs",onRender:e=>u(e),onSelect:e=>function(e){if("editor"!=e){let e={...t.template};e.content=t.codeEditor.codemirror.getValue(),s({template:e})}s({tab:e})}(e),tabs:[{name:"editor",label:__("Editor")},{name:"standard",label:__("Default")}]}),t.error&&i("div",{className:"mapp-templates-error"},t.error),i("div",{className:"mapp-templates-toolbar"},i("div",null,i(d,{isPrimary:!0,onClick:()=>function(){let e="editor"==t.tab?t.codeEditor.codemirror.getValue():t.template.content;n.mappLib.ajax({method:"POST",data:{action:"mapp_tpl_save",content:e,name:t.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&s({isOpen:!1,template:null,tokens:null})}})}()},__("Save")),i(d,{isSecondary:!0,onClick:()=>c()},__("Cancel"))),i("div",null,t.template.exists&&i(d,{isDestructive:!0,title:__("Reset template to default"),onClick:e=>{e.preventDefault(),confirm(mappl10n.delete_prompt)&&(n.mappLib.ajax({method:"POST",data:{action:"mapp_tpl_delete",name:t.template.name,nonce:mappl10n.options.nonce}}),s({isOpen:!1}))}},__("Reset"))))):null)}},326:(e,t,a)=>{"use strict";a.d(t,{useClickOutside:()=>c,useDebounce:()=>m,useResizeObserver:()=>d,useTimeout:()=>u});wp.element.createElement;const{Fragment:o,useCallback:n,useEffect:i,useLayoutEffect:l,useMemo:s,useRef:r,useState:p}=wp.element;function c(e,t){i((()=>{const a=a=>{e.current&&!e.current.contains(a.target)&&t()};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}}))}function m(e,t,a){const o=r(!1);i((()=>(o.current=!0,()=>o.current=!1)),[]);const l=_.debounce((function(){o.current&&e(...arguments)}),t);return n(l,a=a||[])}function d(e,t){const a=r();a.current=t,i((()=>{if(!e)return;const t=new ResizeObserver(((e,t)=>{a.current()}));return t.observe(e),()=>{t.disconnect()}}),[e])}function u(e,t){const a=React.useRef(null),o=React.useRef(e);return i((()=>{o.current=e}),[e]),i((()=>(t>0&&(a.current=window.setTimeout((()=>o.current()),t)),()=>{a.current&&window.clearTimeout(a.current)})),[t]),a}},939:(e,t,a)=>{"use strict";a.d(t,{mappLib:()=>o,mappEvent:()=>n,mappPoi:()=>i});const o={ajax:function(e){if("POST"==(e={cache:"no-cache",credentials:"same-origin",data:null,method:e.method?e.method:"GET",mode:"cors",redirect:"follow",referrerPolicy:"no-referrer",responseType:"json",url:e.url?e.url:mappl10n.options.ajaxurl,...e}).method)if(e.data instanceof FormData)e.body=e.data;else{const t=new FormData;t.append("action",e.data.action),t.append("nonce",e.data.nonce),t.append("data",JSON.stringify(e.data)),e.body=t}else"GET"==e.method&&(e.url+="?"+o.jQueryParam(e.data));fetch(e.url,e).then((t=>{if("html"==e.responseType)return t.text();if(t.ok)return t.json();throw Error(`Request rejected with status ${t.status}`)})).then((t=>{e.url!=mappl10n.options.ajaxurl||t&&"OK"==t.status||o.alert(t.status),t.output&&o.alert("MapPress: invalid output from a plugin or theme file. Deactivate plugins to find the problem. Output:\r\n"+t.output),e.callback&&e.callback(t)})).catch((t=>{if(e.error)return void e.error();const a=void 0!==t.message?t.message:t.statusText;o.alert("AJAX error -- "+a)}))},alert:function(e){mappl10n.options.admin||mappl10n.options.debug?alert(e):window.console&&console.error(e)},boundsToViewport:function(e){return e?{sw:o.toJSON(e.getSouthWest()),ne:o.toJSON(e.getNorthEast())}:null},getIcon:function(e){{const t=this.getIconUrl(e);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:t,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:t}}},getIconUrl:function(e){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"},jQueryParam:function(e){var t=[],a=function(e,a){a=null==(a="function"==typeof a?a():a)?"":a,t[t.length]=encodeURIComponent(e)+"="+encodeURIComponent(a)},o=function(e,n){var i,l,s;if(e)if(Array.isArray(n))for(i=0,l=n.length;i<l;i++)o(e+"["+("object"==typeof n[i]&&n[i]?i:"")+"]",n[i]);else if("[object Object]"===Object.prototype.toString.call(n))for(s in n)o(e+"["+s+"]",n[s]);else a(e,n);else if(Array.isArray(n))for(i=0,l=n.length;i<l;i++)a(n[i].name,n[i].value);else for(s in n)o(s,n[s]);return t};return o("",e).join("&")},nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;const t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let a="",o=e;for(;o--;)a+=t[64*Math.random()|0];return a},pointToLatLng:function(e){return e?"leaflet"==mappl10n.options.engine?L.latLng(e):new google.maps.LatLng(e.lat,e.lng):null},template:function(e,t){if(o.templates=o.templates?o.templates:{},!o.templates[e]){var a=document.getElementById("mapp-tmpl-"+e).innerHTML;if(!a)return"";o.templates[e]=_.template(a,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return o.templates[e](t)},toJSON:e=>e.toJSON?e.toJSON():"undefined"!=typeof L&&e instanceof L.LatLng?{lat:e.lat,lng:e.lng}:"undefined"!=typeof L&&L.LatLngBounds&&e instanceof L.LatLngBounds?{south:e.getSouth(),west:e.getWest(),north:e.getNorth(),east:e.getEast()}:null,toUrlValue(e){return e.toUrlValue?e.toUrlValue():"undefined"!=typeof L&&e instanceof L.LatLng?Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6:null},viewportToBounds:function(e){return e&&e.sw&&e.ne?"leaflet"==mappl10n.options.engine?new L.LatLngBounds(L.latLng(e.sw.lat,e.sw.lng),L.latLng(e.ne.lat,e.ne.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(e.sw.lat,e.sw.lng),new google.maps.LatLng(e.ne.lat,e.ne.lng)):null}},n={addListener:function(e,t,a){let o=[];t=t.split(" ");for(var n=0;n<t.length;n++)"leaflet"==mappl10n.options.engine?(e.on(t[n],a),o.push({target:e,event:t[n],callback:a})):o.push(google.maps.event.addListener(e,t[n],a));return o},addListenerOnce:function(e,t,a){t=t.split(" ");for(var o=0;o<t.length;o++)"leaflet"==mappl10n.options.engine?e.once(t[o],a):google.maps.event.addListenerOnce(e,t[o],a)},clearInstanceListeners:function(e){"leaflet"==mappl10n.options.engine?e.off():google.maps.event.clearInstanceListeners(e)},clearListeners:function(e,t){t=t.split(" ");for(var a=0;a<t.length;a++)"leaflet"==mappl10n.options.engine?e.off(t[a]):google.maps.event.clearListeners(e,t[a])},removeListener:function(e){for(let t=0;t<e.length;t++)"leaflet"==mappl10n.options.engine?e[t].target.off(e[t].event,e[t].callback):google.maps.event.removeListener(e[t])},trigger:function(e,t,a){"leaflet"==mappl10n.options.engine?e.fire(t,a):google.maps.event.trigger(e,t,a)}},i={parseOverlay:function(e,t){if("google"==mappl10n.options.engine){if("kml"==e){const e=t.getDefaultViewport();return{point:e?o.toJSON(e.getCenter()):null,viewport:e?o.boundsToViewport(e):null}}const a=t instanceof google.maps.Polyline?{strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,stokeWeight:t.strokeWeight}:{fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight};if("circle"==e)return{point:o.toJSON(t.getCenter()),poly:{radius:t.getRadius(),...a}};if("rectangle"==e)return{viewport:o.boundsToViewport(t.getBounds()),poly:{...a}};if("polyline"==e){const e=[];return t.getPath().forEach((function(t){e.push(o.toJSON(t))})),{poly:{path:e,...a}}}if("polygon"==e){const e={fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:1,stokeWeight:t.strokeWeight},a=[];return t.getPaths().forEach((function(e){var t=[];e.forEach((function(e){t.push(o.toJSON(e))})),a.push(t)})),{poly:{paths:a,...e}}}if(!e)return{point:o.toJSON(t.getPosition())}}else{if("kml"==e){const e=t.getBounds();return{point:e&&e.isValid()?o.toJSON(e.getCenter()):null,viewport:e&&e.isValid()?o.boundsToViewport(e):null}}if(!e)return{point:"leaflet"==mappl10n.options.engine?o.toJSON(t.getLatLng()):o.toJSON(t.getPosition())}}}}},346:(t,a,o)=>{"use strict";o.d(a,{MappMap:()=>I});var n=o(939),i=o(715),l=(o(817),o(602)),s=o(818),r=o(81),p=o(50),c=o(615);const m=wp.element.createElement,{Fragment:d,useEffect:u,useLayoutEffect:g,useMemo:h,useRef:f,useState:b}=wp.element;function v(e){e={anchor:null,className:null,content:null,map:null,onMouseEnter:null,onMouseLeave:null,point:null,...e};const t=f(null),[a,o]=b({isLoaded:null,mapDiv:"leaflet"==mappl10n.options.engine?e.map.getContainer():e.map.getDiv(),overlayView:null});function i(e){o((t=>({...t,...e})))}function l(){const o=t.current;if(!o)return;if(document.fullscreenElement||e.map.isFullscreen)return;let i;const{width:l,height:s}=o.getBoundingClientRect(),r=n.mappLib.pointToLatLng(e.point);if("leaflet"==mappl10n.options.engine)i=e.map.latLngToContainerPoint(r);else{const e=a.overlayView.getProjection();if(!e)return;i=e.fromLatLngToContainerPixel(r)}o.style.bottom=a.mapDiv.clientHeight-i.y-e.anchor.y+"px",o.style.left=i.x-l/2+e.anchor.x+"px"}return g((()=>{"google"==mappl10n.options.engine?a.overlayView||(a.overlayView=new google.maps.OverlayView,a.overlayView.onAdd=function(){i({isLoaded:!0})},a.overlayView.setMap(e.map)):(e.map.stop(),i({isLoaded:!0}))}),[]),g((()=>{if(!a.isLoaded)return;let t;return"google"==mappl10n.options.engine?a.overlayView.draw=()=>l():t=n.mappEvent.addListener(e.map,"move",(e=>l())),()=>{"google"==mappl10n.options.engine?a.overlayView.draw=null:n.mappEvent.removeListener(t)}})),g((()=>{a.isLoaded&&(l(),function(){const o=t.current;if(!o)return;const i=30,l=o.offsetWidth,s=o.offsetHeight,r=a.mapDiv.clientWidth,p=a.mapDiv.clientHeight,c=n.mappLib.pointToLatLng(e.point);let m;if("leaflet"==mappl10n.options.engine)m=e.map.latLngToContainerPoint(c);else{const e=a.overlayView.getProjection();m=e?e.fromLatLngToContainerPixel(c):null}if(!m)return;var d={x:m.x,y:m.y};m.x+l/2+e.anchor.x>r-i?d.x=Math.max(r-l/2-e.anchor.x-i,r/2-e.anchor.x):m.x-l/2+e.anchor.x<i&&(d.x=Math.min(l/2+e.anchor.x+i,r/2-e.anchor.x));m.y+e.anchor.y-s<i&&(d.y=s-e.anchor.y+i);d.y>=p&&(d.y=p-i);const u={x:m.x-d.x,y:m.y-d.y};(u.x<=-1||u.x>=1||u.y<=-1||u.y>=1)&&("leaflet"==mappl10n.options.engine?e.map.panBy([u.x,u.y]):e.map.panBy(u.x,u.y))}())}),[a.isLoaded]),a.isLoaded?m("div",{className:"mapp-ib-wrapper",ref:t,onMouseEnter:()=>{e.onMouseEnter&&e.onMouseEnter()},onMouseLeave:()=>{e.onMouseLeave&&e.onMouseLeave()}},m("div",{className:"mapp-ib-content"},m("div",{className:"mapp-ib"},m("div",{className:"mapp-iw "+(e.className?e.className:"")},e.content)),m("div",{className:"mapp-ib-tip"}))):null}var y=o(892),k=o(10),w=o(326);const C=n.mappLib.toJSON,{Fragment:x,useCallback:N,useEffect:S,useLayoutEffect:O,useRef:M,useState:E}=wp.element,P=wp.element.createElement,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function I(t){t={alignment:null,center:null,centerPoi:null,classname:null,container:null,height:null,initialOpenInfo:null,isEditable:null,layers:null,layout:null,lines:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,oid:null,otype:null,onDragDrop:null,onDrawingEvent:null,onPoiChange:null,onPopupHover:null,onRenderPopup:null,onRenderSidebar:null,onSearch:null,onViewportChange:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,query:null,search:null,width:null,zoom:null,...t};const[a,o]=E({clusterer:null,directionsTo:null,drawingManager:null,filters:null,hovered:null,hoveredDelay:null,hoveredPopup:null,iframe:window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?window.frameElement:null,init:null,isDirectionsOpen:null,isFetching:null,isGeolocating:null,isHidden:!1,isLoaded:null,isMounted:null,isMini:null,isSidebarOpen:null!=t.poiListOpen?t.poiListOpen:mappl10n.options.poiListOpen,kmlEvent:null,layers:{},layout:t.layout?t.layout:mappl10n.options.layout,map:null,opened:null,oid:t.oid?t.oid:mappl10n.options.oid,otype:t.otype?t.otype:mappl10n.options.otype,page:1,pageCount:0,parsedCenter:null,poiList:void 0!==t.poiList&&null!=t.poiList?t.poiList:mappl10n.options.poiList,pois:[],polyline:null,templates:t.query?"user"==t.otype?{item:"user-mashup-item",popup:"user-mashup-popup"}:{item:"mashup-item",popup:"mashup-popup"}:{item:"map-item",popup:"map-popup"},userLocation:null}),m=M(null),d=M(t.container),{geocode:u,geolocate:g}=(M(),(0,k.useGeocoding)({withBusinesses:t.isEditable}));function h(e){o((t=>({...t,...e})))}(0,w.useResizeObserver)(d.current,(function(){const e=T();if(a.poiList&&"inline"!=a.layout&&d.current){const e=d.current.clientWidth<mappl10n.options.mini;null==a.isMini&&e&&h({isSidebarOpen:!1}),e!=a.isMini&&(h({isMini:e,isSidebarOpen:!e}),d.current&&d.current.classList.toggle("mapp-mini",e))}if(a.iframe&&"inline"==a.layout&&!e.height.includes("vh")){const e=d.current.getBoundingClientRect().height;a.iframe.parentElement.style.height=e+"px",t.container.style.height="auto"}})),(0,w.useResizeObserver)(m.current,V),S((()=>{switch(a.init){case null:!function(){const e=[__("MapPress FAQ")+": http://mappresspro.com/mappress-faq",__("Support")+": http://mappresspro.com/chris-contact",__("Get an API Key")+": https://mappresspro.com/how-to-get-a-google-maps-api-key"];let t=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:__("Leaflet library not loaded"),text:__("A theme or plugin is preventing the Leaflet library from loading.")},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:__("Google Maps API not loaded"),text:__("A theme or plugin is preventing Google Maps from loading.")},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:__("Google Maps API key required")},{condition:document.querySelectorAll('script[src*="https://maps.googleapis.com/maps/api/js?v="]').length>1,title:__("Google Maps API loaded multiple times"),text:__("A theme or plugin has loaded Google Maps twice")},{condition:"undefined"==typeof _,title:__("Underscore library not loaded"),text:__("A theme or plugin is preventing the underscore.js library from loading.")}];t=t.filter((e=>e.condition));let a=t.map((e=>e.title+" : "+e.text));a.length&&(console.log(__("Map Error")+"\n----------------\n"+a.join("\n")+"\n----------------\n"+e.join("\n")),mappl10n.options.admin&&alert(__("Map error: please see the developer console (F12 in most browsers) for details.")))}();let e,o={...t.mapOpts};o.minZoom=isNaN(parseInt(o.minZoom))?0:parseInt(o.minZoom),"leaflet"==mappl10n.options.engine?(e=new L.Map(m.current,{attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null,...o}),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(e)):e=new google.maps.Map(m.current,{backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!t.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM},...o}),h({map:e}),mappl10n.options.userLocation&&mappl10n.options.ssl&&g((e=>{e&&e.geometry&&e.geometry.location&&h({userLocation:e.geometry.location})}),!0),u({value:t.center,callback:e=>{e&&e.geometry&&e.geometry.location?h({parsedCenter:{lat:e.geometry.location.lat,lng:e.geometry.location.lng}}):h({parsedCenter:null}),h({init:1})}});break;case 1:ee(t.mapTypeId),function(){if(t.isEditable&&"google"==mappl10n.options.engine&&google.maps.drawing){const e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};a.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),a.drawingManager.setMap(a.map)}}(),function(){a.polyline&&("leaflet"==mappl10n.options.engine?a.polyline.remove():a.polyline.setMap(null),h({polyline:null}));if(t.isEditable||!t.lines&&!mappl10n.options.lines||a.pois.length<2)return;const e={...mappl10n.options.lineOpts},o=[];if(_.map(a.pois,(e=>{o.push(z(e))})),"leaflet"==mappl10n.options.engine)h({polyline:new L.Polyline(o,e).addTo(a.map)});else{const t={strokeColor:e.color,strokeWeight:e.weight,strokeOpacity:e.opacity};e.icons&&(_.map(e.icons,(e=>{e.icon.path=parseInt(e.icon.path)})),e.icons[0].repeat="50px"),h({polyline:new google.maps.Polyline({map:a.map,path:o,...e,...t})}),e.animate&&e.icons&&e.icons.length&&function(){let e=0;const t=a.polyline.get("icons");t[0].repeat.replace("%","").replace("px","");window.setInterval((()=>{e+=1;t[0].offset=e+(t[0].repeat.indexOf("%")>=0?"%":"px"),a.polyline.set("icons",t)}),20)}()}}(),t.query?f((()=>h({init:2}))):(h({pois:t.pois?t.pois:[]}),h({init:2}));break;case 2:const i="leaflet"==mappl10n.options.engine?"load":"tilesloaded";n.mappEvent.addListenerOnce(a.map,i,(()=>{h({bounds:O()}),function(){if(mappl10n.options.clustering&&!t.isEditable){let e,t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?(e=L.markerClusterGroup(t),a.map.addLayer(e)):(t={...t,imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"},e=new MarkerClusterer(a.map,[],t)),h({clusterer:e})}}(),(t.initialOpenInfo||mappl10n.options.initialOpenInfo)&&!t.isEditable&&a.pois&&a.pois.length&&U(a.pois[0]),h({isLoaded:!0})})),W()}}),[a.init]);(0,w.useTimeout)((()=>{h({hoveredDelay:0}),a.hoveredPopup||h({hovered:null})}),a.hoveredDelay);function f(e){}function b(e){return a.pois.find((t=>t.id==e))}function N(e){return a.map.fitBounds(e)}function O(){try{return a.map.getBounds()}catch(e){return null}}function I(){let e;try{e=a.map.getCenter()}catch(t){e=null}return e?C(e):null}function T(){if(t.embed)return{width:"100%",height:"100%"};const e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],a=e=>"string"==typeof e&&(e.indexOf("px")>=0||e.indexOf("%")>=0||e.indexOf("vh")>=0||e.indexOf("vw")>=0)?e:e+"px";return{width:t.width?a(t.width):a(e.width),height:t.height?a(t.height):a(e.height)}}function D(e){let t;switch("leaflet"==mappl10n.options.engine&&"kml"!=e.type?null:e.type){case"polygon":t=new google.maps.LatLngBounds,e.poly.paths.map((e=>{e.map((e=>{t.extend(e)}))}));break;case"polyline":t=new google.maps.LatLngBounds,e.poly.path.map((e=>{t.extend(e)}));break;case"circle":const a=new google.maps.Circle({center:e.point,radius:e.poly.radius});t=a.getBounds();break;default:t=n.mappLib.viewportToBounds(e.viewport)}return t}function z(e,t){if(e.point&&!e.type)return"leaflet"==mappl10n.options.engine?L.latLng(e.point):new google.maps.LatLng(e.point.lat,e.point.lng);if("kml"==e.type&&t&&t.latLng)return t.latLng;const a=D(e);return"leaflet"==mappl10n.options.engine?a&&a.isValid()?a.getCenter():new L.latLng(0,0):a?a.getCenter():new google.maps.LatLng(0,0)}function B(){let e;try{e=a.map.getZoom()}catch(t){e=null}return e?parseInt(e):null}function F(){return!!(t.isEditable||t.search||mappl10n.options.search&&t.query)}S((()=>{a.isLoaded&&!t.query&&h({pois:t.pois?t.pois:[]})}),[t.pois]),S((()=>{a.isLoaded&&t.query&&f()}),[t.query,a.filters]),S((()=>{a.isLoaded&&null==t.center&&W(null)}),[t.center]),S((()=>{a.isLoaded&&ee(t.mapTypeId)}),[t.mapTypeId]),S((()=>{a.isLoaded&&H(t.centerPoi)}),[t.centerPoi]),S((()=>{if(!a.isLoaded)return;let e,o,i;return e=n.mappEvent.addListener(a.map,"moveend idle",(e=>R())),o=n.mappEvent.addListener(a.map,"click dragstart zoom_changed zoomstart",(e=>{"leaflet"==mappl10n.options.engine&&"click"==e.type&&e.originalEvent&&!e.originalEvent.target.matches(".mapp-canvas")||j()})),a.drawingManager&&(i=n.mappEvent.addListener(a.drawingManager,"overlaycomplete",(e=>{a.drawingManager.setDrawingMode(null),G(null),t.onDrawingEvent&&t.onDrawingEvent(e)}))),t.name&&(window[t.name]={getPois:()=>a.pois,poiOpen:e=>h({opened:"string"==typeof e?e:e.id})}),()=>{n.mappEvent.removeListener(e),n.mappEvent.removeListener(o),i&&n.mappEvent.removeListener(i)}}));const R=(0,w.useDebounce)((()=>{h({bounds:O(),page:1}),t.onViewportChange&&t.onViewportChange({center:I(),zoom:B()})}),500,[t.onViewportChange,a.map]);function A(e,a){if("poi"!=mappl10n.options.mashupClick&&t.query&&"post"==e.otype&&e.oid&&e.url)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(e.url);case"postnew":return void window.open(e.url);case"postmodal":const t=document.createElement("div");return document.body.appendChild(t),ReactDOM.render(P(y.MappPopupModal,{onClose:()=>{wp.element.unmountComponentAtNode(t),t.remove()},poi:e}),t)}else U(e,a)}function j(){h({hovered:null,opened:null,isDirectionsOpen:!1})}function G(e,o){!t.isEditable&&mappl10n.options.tooltips&&(e&&e.id==a.opened||a.opened||h(e?{hovered:e.id,hoveredDelay:0}:o?{hoveredDelay:300}:{hovered:null,hoveredDelay:0}))}function U(e,t){j(),a.isMini&&q(!1),h({kmlEvent:t,opened:e.id})}function K(e){e?h({hoveredPopup:e.id,hoveredDelay:0}):(h({hoveredPopup:null}),a.hovered&&!a.opened&&h({hoveredDelay:300}))}function V(){"leaflet"==mappl10n.options.engine?a.map.invalidateSize():n.mappEvent.trigger(a.map,"resize"),0==d.current.offsetHeight?h({isHidden:!0}):a.isHidden&&(h({isHidden:!1}),W())}function q(e){h({isSidebarOpen:e=void 0!==e?e:!a.isSidebarOpen,isDirectionsOpen:!1}),setTimeout((()=>V()),100)}function W(e){e=null==e?a.parsedCenter:e;const o=t.zoom&&parseInt(t.zoom)?parseInt(t.zoom):null;if(e)return void te(e,o||1);if(0==a.pois.length)return void te({lat:0,lng:0},o||1);if(1==a.pois.length)return void H(a.pois[0]);let n="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var i=0;i<a.pois.length;i++){var l=D(a.pois[i]);n=l?"leaflet"==mappl10n.options.engine?n.extend(l):n.union(l):n.extend(z(a.pois[i]))}o?te(C(n.getCenter()),o):N(n)}function H(e){let a=null;if(t.zoom)a=parseInt(t.zoom);else if(mappl10n.options.poiZoom)a=parseInt(mappl10n.options.poiZoom);else if(e.viewport){var o=e.viewport.ne.lng-e.viewport.sw.lng;o<0&&(o+=360),a=Math.floor(Math.log(360*m.current.clientWidth/o/256)/Math.LN2)}te(z(e),a)}function Z(){return mappl10n.options.ssl?P("div",{className:"mapp-"+mappl10n.options.engine+"-geolocate-wrapper"},P("div",{className:"mapp-geolocate-control",onClick:()=>(h({isGeolocating:!0}),void g((e=>{h({isGeolocating:!1}),e&&e.geometry&&e.geometry.location&&te(e.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1)),title:__("Your Location")})):null}function J(){if(F())return a.isLoaded?P("div",{className:"mapp-header"},F()&&a.map?P("div",{className:"mapp-search-container"},P(s.MappPlaces,{buttonLabel:t.isEditable?__("Add to map"):P("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:t.isEditable,includeBusinesses:t.isEditable,map:a.map,onSearch:e=>{t.onSearch?t.onSearch(e):function(e){if(!e||!e.geometry)return;const t=e.geometry.location?e.geometry.location:null,a=e.geometry.viewport?e.geometry.viewport:null;let o;if("leaflet"==mappl10n.options.engine){const e=new L.LatLng(t.lat,t.lng);o=a?new L.LatLngBounds(new L.LatLng(a.sw.lat,a.sw.lng),new L.LatLng(a.ne.lat,a.ne.lng)):e.toBounds(1e3*mappl10n.options.radius)}else{const e=new google.maps.Circle({center:t,radius:1e3*mappl10n.options.radius});o=a?new google.maps.LatLngBounds(new google.maps.LatLng(a.sw.lat,a.sw.lng),new google.maps.LatLng(a.ne.lat,a.ne.lng)).union(e.getBounds()):e.getBounds()}o&&N(o),te(t)}(e)}})):null,"top"==mappl10n.options.filtersPos&&null):P("div",{className:"mapp-header"})}function Y(){return P("div",{className:"mapp-content"},a.isFetching||a.isGeolocating?P(x,null,P("div",{className:"mapp-spinner-overlay"}),P("div",{className:"mapp-spinner"})):null,J(),P("div",{className:"mapp-main"},"inline"!=a.layout&&$(),P("div",{className:"mapp-canvas-panel"+("google"==mappl10n.options.engine?" mapp-google":" mapp-leaflet")},P("div",{className:"mapp-canvas",ref:m}),a.isLoaded&&a.userLocation?P(r.MappPoi,{isClusterable:!1,isEditable:!1,isOpen:!1,key:"user",map:a.map,poi:{point:a.userLocation,iconid:"geolocation"}}):null,function(){if(!a.isLoaded)return;return a.pois.map((o=>P(r.MappPoi,{key:o.id,isClusterable:!!a.clusterer&&!o.type,isEditable:!!t.isEditable,isHovered:o.id==a.hovered,isOpen:o.id==a.opened,map:a.map,onChange:e=>{t.onPoiChange&&t.onPoiChange(o.id,e)},onClick:e=>A(o,e),onClusterAdd:e=>function(e){a.clusterer&&("leaflet"==mappl10n.options.engine?a.clusterer.addLayer(e):a.clusterer.addMarker(e))}(e),onMouseOut:()=>{G(null,!0)},onMouseOver:()=>G(o),onRenderPopup:(o,n)=>function(o,n){const i=function(e){if(a.clusterer){if("leaflet"==mappl10n.options.engine){var t=a.clusterer.getVisibleParent(e);return t&&t!=e?t.getLatLng():null}const n=a.clusterer.getClusters();for(var o=0;o<n.length;o++){const t=n[o].markers_;if(t.length>1)for(let a=0;a<t.length;a++)if(t[a]==e)return n[o].center_}}}(n),l=z(o),s=C(i||l);let r,c,m={x:0,y:0};i?m={x:0,y:-14}:o.type||(m=mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32});a.kmlEvent&&(a.kmlEvent.pixelOffset&&(m={x:e.pixelOffset.width,y:e.pixelOffset.height}),a.kmlEvent.featureData?r=a.kmlEvent.featureData:a.kmlEvent&&a.kmlEvent.propagatedFrom&&a.kmlEvent.propagatedFrom.feature&&a.kmlEvent.propagatedFrom.feature.properties&&(r=a.kmlEvent.propagatedFrom.feature.properties));c=t.onRenderPopup?t.onRenderPopup(o,j):P(p.MappPoiContent,{context:"popup",feature:r,isEditable:t.isEditable,onDirectionsClick:()=>h({isDirectionsOpen:!0,directionsTo:o}),poi:o,template:a.templates.popup,thumbs:mappl10n.options.thumbsPopup});return P(v,{anchor:m,className:!t.isEditable&&mappl10n.options.thumbsPopup?"mapp-thumb-"+mappl10n.options.thumbsPopup:"",content:c,map:a.map,onMouseEnter:()=>K(o),onMouseLeave:()=>K(null),point:s})}(o,n),poi:o})))}(),t.isEditable||"leaflet"==mappl10n.options.engine||!a.map?null:P(l.MappMenuControl,{map:a.map,onCenter:()=>{j(),W()}}),Z())),a.poiList&&"inline"!=a.layout&&a.isMini?P("div",{className:"mapp-footer"},!a.isSidebarOpen&&P("div",{className:"mapp-button mapp-view-list",onClick:()=>q(!0)},P("img",{src:mappl10n.options.baseurl+"/images/outline_format_list_bulleted_black_18dp.png"}),"List"),a.isSidebarOpen&&P("div",{className:"mapp-button mapp-view-map",onClick:()=>q(!1)},P("img",{src:mappl10n.options.baseurl+"/images/outline_map_black_18dp.png"}),"Map")):null)}function X(){const e=T(),t=a.iframe&&e.height.includes("vh")?{height:"100%"}:{paddingBottom:e.height};return P(x,null,P("div",{className:"mapp-wrapper",style:t},Y()),"inline"==a.layout&&$())}function Q(){if(!a.poiList||!a.isLoaded)return null;let e=[];return e=F()&&a.bounds&&!t.isEditable?a.pois.filter(((e,t)=>a.bounds.contains(z(e)))):a.pois,a.pageCount!=e.length&&h({pageCount:e.length}),P(c.MappPoiList,{className:!t.isEditable&&mappl10n.options.thumbsList?" mapp-thumb-"+mappl10n.options.thumbsList:"",hovered:a.hovered,isEditable:t.isEditable,isPaged:!!t.query,onClick:e=>A(b(e)),onDirectionsClick:e=>h({isDirectionsOpen:!0,directionsTo:b(e)}),onDragDrop:e=>{let{from:a,to:o}=e;return function(e,a){t.onDragDrop&&t.onDragDrop(e,a)}(a,o)},onMouseEnter:e=>G(b(e)),onMouseLeave:e=>G(null),onPage:e=>{h({page:e})},opened:a.opened,page:a.page,pois:e,template:t.isEditable?null:a.templates.item})}function $(){let e="mapp-sidebar";return e+="inline"==a.layout?" mapp-sidebar-inline":"",e+=a.isSidebarOpen?" mapp-sidebar-open":"",a.isDirectionsOpen?P("div",{className:e},function(){if(!a.isDirectionsOpen)return null;let e="";if(a.directionsTo)if(a.directionsTo.address)e=a.directionsTo.address;else{const t=C(z(a.directionsTo));e=t.lat+", "+t.lng}return P(i.MappDirections,{from:"",to:e,onClose:()=>{h({isDirectionsOpen:!1,directionsTo:null})}})}()):a.poiList?P("div",{className:e},P("div",{className:"mapp-sidebar-toggle",onClick:()=>q()}),"list"==mappl10n.options.filtersPos&&null,t.onRenderSidebar&&t.onRenderSidebar(),Q()):void 0}function ee(e){const t=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),o=_.find(t,(t=>t.id==e));!mappl10n.options.style||"roadmap"!=e&&"streets"!=e&&o||(e=mappl10n.options.style);let n=_.find(t,(t=>t.id==e));if(n=n||t[0],"leaflet"==mappl10n.options.engine){let e={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">&copy; Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">&copy; OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[n.provider],t={...e,...n};L.tileLayer(e.url,t).addTo(a.map)}else if(a.map.setMapTypeId("standard"==n.type?n.id:"roadmap"),n.json){let e=null;try{e=JSON.parse(n.json)}catch(e){console.log("Invalid JSON in map style")}a.map.setOptions({styles:e||null})}else a.map.setOptions({styles:null})}function te(e,t,o){"leaflet"==mappl10n.options.engine?(null==t&&(t=a.map.getZoom()?a.map.getZoom():0),a.map.setView(e,t,o)):(e=e&&!C(e)?{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}:e,t=t?parseInt(t):null,e&&a.map.setCenter(e),t&&a.map.setZoom(t))}return t.container?X():function(){const e=T();t.name&&t.name;let o="mapp-layout";o+="left"==a.layout?" mapp-list-left":" mapp-inline";const n=t.alignment?t.alignment:mappl10n.options.alignment;n&&!document.body.classList.contains("block-editor-page")&&(o+=" align"+n,o+=" mapp-align-"+n);let i="full"==t.alignment?{width:"auto"}:{width:e.width};return P("div",{className:o,style:i,ref:d,tabIndex:"-1"},X())}()}},759:(e,t,a)=>{"use strict";a.d(t,{mappMarker:()=>n});var o=a(939);function n(e){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(e),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove(),this.div=document.createElement("div"),this.div.classList.add("mapp-marker")}n.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let t=e.fromLatLngToDivPixel(this.position),a=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.left=t.x-a.width/2+"px",this.div.style.top=t.y-a.height+"px"}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(e){let t="on"+e.type[0].toUpperCase()+e.type.slice(1);this[t]&&this[t](e)},onAdd:function(){let e=this.overlayView.getPanes();e&&(this.div||(this.div=document.createElement("div"),this.div.classList.add("mapp-marker")),e.overlayMouseTarget.append(this.div),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div),this.div.addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&o.mappEvent.trigger(this,"click"),this.dragging=null})),this.div.addEventListener("mouseenter",this),this.div.addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(e){o.mappEvent.trigger(this,"mouseover")},onMouseleave:function(e){o.mappEvent.trigger(this,"mouseout")},onPointerdown:function(e){const t=this.map.getDiv().getBoundingClientRect(),a=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:e.clientX,y:e.clientY},offset:{x:a.x-(e.clientX-t.left),y:a.y-(e.clientY-t.top)}},this.toggleDragEvents(!0)},onPointermove:function(e){if(Math.abs(e.clientX-this.dragging.startPixel.x)+Math.abs(e.clientY-this.dragging.startPixel.y)<3)return;const t=this.map.getDiv().getBoundingClientRect();let a={x:e.clientX-t.left+this.dragging.offset.x,y:e.clientY-t.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(a)),this.draw(),this.dragging.moved=!0,o.mappEvent.trigger(this,"dragstart")},onPointercancel:function(e){this.onPointerup(e)},onPointerup:function(e){this.dragging&&this.dragging.moved&&o.mappEvent.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(e,t){let a="set"+e[0].toUpperCase()+e.slice(1);this[a]&&this[a](t)},setDraggable:function(e){this.draggable=e,this.map&&this.div&&(this.div.removeEventListener("pointerdown",this,{passive:!0}),e&&this.div.addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(e){if(void 0!==e&&(this.icon=e),this.icon&&this.div){let e='<img draggable="false" src="'+this.icon.url+'">';this.div.innerHTML=e;let t=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.style.width=t.width+"px",this.div.style.height=t.height+"px",this.setZIndex(),this.draw()}},setMap:function(e){this.map=e,this.overlayView.setMap(e)},setPosition:function(e){this.position=e},setValues:function(e){for(const t in e)this.set(t,e[t])},setVisible:function(e){this.visible=e,this.div&&(this.div.style.visibility=e?"visible":"hidden")},setZIndex:function(e){this.zIndex=void 0!==e?e:this.zIndex,this.div&&(this.div.style.zIndex=e)},toggleDragEvents(e){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),e&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},602:(e,t,a)=>{"use strict";a.d(t,{MappMenuControl:()=>c});var o=a(326);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useRef:r,useState:p}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function c(e){e={layer:null,map:null,onCenter:null,...e};const[t,a]=p({activeLayer:e.layer?e.layer:null,layers:null,isOpen:!1}),s=r(null);function c(e){a((t=>({...t,...e})))}function m(){c({isOpen:!t.isOpen})}return(0,o.useClickOutside)(s,(()=>{t.isOpen&&m()})),l((()=>{if("google"==mappl10n.options.engine){c({layers:{traffic:{googleLayer:new google.maps.TrafficLayer,label:__("Traffic")},bicycling:{googleLayer:new google.maps.BicyclingLayer,label:__("Bicycling")},transit:{googleLayer:new google.maps.TransitLayer,label:__("Transit")}}})}}),[]),n("div",{ref:s},n("div",{className:"mapp-menu-toggle",onClick:()=>m()}),t.isOpen&&function(){const a=_.map(t.layers,((a,o)=>{const i=t.activeLayer==o?"mapp-menu-item mapp-active":"mapp-menu-item";return n("div",{className:i,key:o,onClick:()=>function(a){t.activeLayer&&t.layers[t.activeLayer].googleLayer.setMap(null),a!=t.activeLayer&&t.layers[a].googleLayer.setMap(e.map),c({activeLayer:a==t.activeLayer?null:a,isOpen:!1})}(o)},a.label)}));return n("div",{className:"mapp-menu"},n("div",{className:"mapp-menu-items"},n("div",{className:"mapp-menu-item",onClick:()=>(c({isOpen:!1}),void e.onCenter())},__("Center map")),"google"==mappl10n.options.engine&&n(i,null,n("div",{className:"mapp-menu-separator"}),a)),n("div",{className:"mapp-menu-footer"},n("a",{className:"mapp-menu-help",href:"https://mappresspro.com/mappress-documentation",target:"_blank"},n("span",null,__("Help")))))}())}},27:(e,t,a)=>{"use strict";a.d(t,{MappPaginate:()=>p});const o=wp.element.createElement,{Fragment:n,useEffect:i,useLayoutEffect:l,useRef:s,useState:r}=wp.element,{sprintf}=wp.i18n;function p(e){function t(t,a){const o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.page<o&&e.onChange(e.page+1);break;case"prev":e.page>1&&e.onChange(e.page-1)}}return function(){const a=Math.ceil(e.count/e.pageSize),n=e.isBusy||e.page<=1,i=e.isBusy||e.page>=a,l=n?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",s=i?"mapp-paginate-button mapp-disabled":"mapp-paginate-button",r=(p="%d of %d",wp.i18n.__(p,"mappress-google-maps-for-wordpress"));var p;return o("div",{className:"mapp-paginate"},o("div",{className:l,onClick:()=>{n||t("first")}},"«"),o("div",{className:l,onClick:()=>{n||t("prev")}},"‹"),o("div",{className:"mapp-paginate-count"},sprintf(r,e.page,a)),o("div",{className:s,onClick:()=>{i||t("next")}},"›"),o("div",{className:s,onClick:()=>{i||t("last")}},"»"))}()}},818:(e,t,a)=>{"use strict";a.d(t,{MappPlaces:()=>d});var o=a(117),n=a(10);const i=wp.element.createElement,{Fragment:l,useCallback:s,useEffect:r,useLayoutEffect:p,useRef:c,useState:m}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){e={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...e};const{geocode:t,getPredictions:a}=(0,n.useGeocoding)({map:e.map,includeBusinesses:e.includeBusinesses}),[l,s]=m({suggestions:[]});return i(o.MappAutocomplete,{buttonLabel:e.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:e.focus,onFetch:function(t){a({map:e.map,value:t,callback:e=>{var t;t={suggestions:e},s((e=>({...e,...t})))}})},onSelect:function(a){let{suggestion:o,value:n}=a;t({map:e.map,suggestion:o,value:n,callback:t=>{t&&e.onSearch(t)}})},placeholder:__("Search"),suggestions:l.suggestions,title:__("Enter an address, place, KML file URL, or lat,lng")})}},50:(e,t,a)=>{"use strict";a.d(t,{MappPoiContent:()=>m});var o=a(939);const n=wp.element.createElement,{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:r,useRef:p,useState:c}=wp.element;wp.i18n.sprintf;function m(e){e={context:null,feature:null,isEditable:null,onDirectionsClick:null,poi:null,template:null,thumbs:null,...e};const[t,a]=c({imageNumber:0});function l(e){a((t=>({...t,...e})))}return n(i,null,function(){const a="list"!=e.context&&mappl10n.options.thumbWidth&&mappl10n.options.thumbHeight?{width:mappl10n.options.thumbWidth+"px",height:mappl10n.options.thumbHeight+"px"}:null,o=e.thumbs&&e.poi.images&&e.poi.images.length&&e.poi.images[t.imageNumber]?e.poi.images[t.imageNumber]:null;if(!o)return null;const i=function(e){switch(e.type){case"avatar":return n("div",{className:"mapp-avatar",dangerouslySetInnerHTML:{__html:e.html}});case"embed":return n("div",{className:"mapp-embed",dangerouslySetInnerHTML:{__html:e.html}});default:if("image"==e.type||!e.type){const t=e.size?{src:e.url,width:e.size[0]+"px",height:e.size[1]+"px"}:{src:e.url};return n("img",t)}}}(o);return n("div",{className:"mapp-thumbnail",onClick:()=>function(t){e.isEditable||"popup"!=e.context||"embed"==t.type||e.poi.url&&window.open(e.poi.url,"_blank")}(o),style:a},t.imageNumber>=1&&n("div",{className:"mapp-gallery-previous",onClick:e=>function(e){t.imageNumber>0&&(l({imageNumber:t.imageNumber-1}),e.stopPropagation())}(e)}),i,t.imageNumber<e.poi.images.length-1&&n("div",{className:"mapp-gallery-next",onClick:a=>function(a){t.imageNumber<e.poi.images.length-1&&(l({imageNumber:t.imageNumber+1}),a.stopPropagation())}(a)}))}(),n("div",{className:"mapp-info"},function(){let t={...e.poi};t.icon=o.mappLib.getIconUrl(e.poi.iconid),e.feature&&(t.body=e.feature.description,t.title=e.feature.name),t.props=t.props?t.props:{};const a=o.mappLib.template(e.template,{poi:t});return n("div",{className:"mapp-template",dangerouslySetInnerHTML:{__html:a}})}(),function(){var t;if(!(e.template.indexOf("user")>=0))return"popup"==e.context&&mappl10n.options.directionsPopup||"list"==e.context&&mappl10n.options.directionsList?n("div",{className:"mapp-dir-wrapper"},n("span",{className:"mapp-dir",onClick:t=>function(t){t.stopPropagation(),e.onDirectionsClick()}(t)},(t="Get Directions",wp.i18n.__(t,"mappress-google-maps-for-wordpress")))):void 0}()))}},615:(e,t,a)=>{"use strict";a.d(t,{MappPoiList:()=>u});var o=a(939),n=a(27),i=a(50);const l=wp.element.createElement,{Fragment:s,useEffect:r,useLayoutEffect:p,useMemo:c,useRef:m,useState:d}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),sprintf=wp.i18n.sprintf;const u=wp.element.memo((function(e){e={className:null,hovered:null,isEditable:!1,isPaged:!1,onClick:null,onDragDrop:null,onMouseEnter:null,onMouseLeave:null,onPage:null,opened:null,page:1,pois:null,template:null,...e};const[t,a]=d({dragging:null,dragover:null,pageSize:!e.isEditable&&mappl10n.options.poiListPageSize?parseInt(mappl10n.options.poiListPageSize):20});function r(e){a((t=>({...t,...e})))}function p(a){let n,p="mapp-item";return e.opened!=a.id&&e.hovered!=a.id||(p+=" mapp-selected"),p+=t.dragover==a.id?" mapp-dragover":"",n=e.isEditable?l(s,null,l("img",{className:"mapp-icon",src:o.mappLib.getIconUrl(a.iconid)}),l("div",{className:"mapp-title"},a.title)):l(i.MappPoiContent,{context:"list",onDirectionsClick:()=>e.onDirectionsClick(a.id),poi:a,template:e.template,thumbs:mappl10n.options.thumbsList}),l("div",{className:p,dangerouslySetInnerHTML:null,draggable:e.isEditable,key:a.id,onClick:()=>e.onClick(a.id),onDragOver:e=>e.preventDefault(),onDragStart:e=>r({dragging:a.id}),onDragEnter:e=>r({dragover:a.id}),onDragEnd:e=>r({dragging:null,dragover:null}),onDrop:o=>{return n=a.id,void(e.onDragDrop&&e.onDragDrop({from:t.dragging,to:n}));var n},onMouseEnter:t=>{e.onMouseEnter(a.id)},onMouseLeave:t=>{e.onMouseLeave(a.id)}},n)}return l("div",{className:"mapp-list "+(e.className?e.className:"")},e.isPaged&&function(){let t=1!=e.pois.length?__("%d Results"):__("%d Result");return t=sprintf(t,e.pois.length),l("div",{className:"mapp-list-header"},l("div",{className:"mapp-list-count"},t))}(),function(){const a=t.pageSize*(e.page-1),o=a+t.pageSize-1;return l("div",{className:"mapp-items",key:e.page},_.map(e.pois,((t,n)=>{if(!e.isPaged||n>=a&&n<=o)return p(t)})))}(),e.isPaged&&(!e.isPaged||e.pois.length<=t.pageSize?null:l("div",{className:"mapp-list-footer"},l(n.MappPaginate,{count:e.pois.length,onChange:t=>e.onPage(t),page:e.page,pageSize:t.pageSize}))))}))},81:(e,t,a)=>{"use strict";a.d(t,{MappPoi:()=>m});var o=a(939),n=a(759);wp.element.createElement;const{Fragment:i,useEffect:l,useLayoutEffect:s,useMemo:r,useRef:p,useState:c}=wp.element;function m(e){e={isClusterable:null,isEditable:null,isHovered:null,isOpen:null,map:null,onClusterAdd:null,onMouseOut:null,onMouseOver:null,poi:null,...e};const t=p(null),[a,i]=c({overlay:null});function s(t){r()&&"google"==mappl10n.options.engine&&("rectangle"==e.poi.type&&(o.mappEvent.clearListeners(a.overlay,"bounds_changed"),t&&o.mappEvent.addListener(a.overlay,"bounds_changed",(()=>{m()}))),"circle"==e.poi.type&&(o.mappEvent.clearListeners(a.overlay,"center_changed radius_changed"),t&&o.mappEvent.addListener(a.overlay,"center_changed radius_changed",(()=>{m()}))),"polygon"!=e.poi.type&&"polyline"!=e.poi.type||(o.mappEvent.clearListeners(a.overlay,"rightclick"),o.mappEvent.clearListeners(a.overlay.getPath(),"insert_at remove_at set_at"),t&&(o.mappEvent.addListener(a.overlay,"rightclick",(e=>{null!=e.vertex&&a.overlay.getPath().getLength()>2&&(a.overlay.getPath().removeAt(e.vertex),m())})),o.mappEvent.addListener(a.overlay.getPath(),"insert_at remove_at set_at",(()=>{m()})))))}function r(){return"google"==mappl10n.options.engine&&-1!=["polyline","polygon","circle","rectangle"].indexOf(e.poi.type)}function m(){const t=o.mappPoi.parseOverlay(e.poi.type,a.overlay);e.onChange(t)}function d(t,a){a?"leaflet"==mappl10n.options.engine?t.addTo(e.map):t.setMap(e.map):"leaflet"==mappl10n.options.engine?t.remove():t.setMap(null)}return l((()=>{const a="leaflet"==mappl10n.options.engine&&"kml"!=e.poi.type?null:e.poi.type,l=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");let s;switch(a){case"polygon":s=new google.maps.Polygon({paths:e.poi.poly.paths,...l});break;case"polyline":s=new google.maps.Polyline({path:e.poi.poly.path,...l});break;case"circle":const t=new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng);s=new google.maps.Circle({center:t,radius:parseFloat(e.poi.poly.radius),...l});break;case"rectangle":s=new google.maps.Rectangle({bounds:o.mappLib.viewportToBounds(e.poi.viewport),...l});break;case"kml":const a=e.poi.kml&&e.poi.kml.url?e.poi.kml.url:"";s="leaflet"==mappl10n.options.engine?omnivore.kml(a):new google.maps.KmlLayer({url:a,preserveViewport:!0,suppressInfoWindows:!0});break;default:s="leaflet"==mappl10n.options.engine?L.marker([e.poi.point.lat,e.poi.point.lng]):new n.mappMarker({position:new google.maps.LatLng(e.poi.point.lat,e.poi.point.lng)}),s.setIcon(o.mappLib.getIcon(e.poi.iconid))}var p;return p={overlay:s},i((e=>({...e,...p}))),"kml"!=e.poi.type&&("leaflet"==mappl10n.options.engine?s.options.draggable=e.isEditable:s.setDraggable(e.isEditable),r()&&s.setEditable(e.isEditable)),e.isClusterable?(e.onClusterAdd(s),"google"==mappl10n.options.engine&&d(s,e.map)):d(s,e.map),t.current=s,()=>{d(t.current,null)}}),[]),l((()=>{if(a.overlay){const t=_.pick(e.poi.poly,"strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity");a.overlay.setOptions({...t})}}),[e.poi.poly]),l((()=>{a.overlay&&a.overlay.setIcon(o.mappLib.getIcon(e.poi.iconid))}),[e.poi.iconid]),l((()=>{a.overlay&&function(t){if(e.poi.type)return;if("icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&e.isEditable)return;var n="leaflet"==mappl10n.options.engine?a.overlay._icon:a.overlay.getDiv();if(!n)return;switch(e.isEditable?"circle":mappl10n.options.highlight){case"circle":n.classList.toggle("mapp-marker-circle",t);break;case"icon":var i=t?o.mappLib.getIcon(mappl10n.options.highlightIcon):o.mappLib.getIcon(e.poi.iconid);if("leaflet"==mappl10n.options.engine&&a.overlay.getIcon().options.iconUrl==i.options.iconUrl)return;a.overlay.setIcon(i);break;case"scale":n.classList.add("mapp-marker"),n.classList.toggle("mapp-marker-scale",t)}const l=t?1e4:0;"leaflet"==mappl10n.options.engine?e.poi.type||a.overlay.setZIndexOffset(l):a.overlay.set("zIndex",l)}(e.isHovered||e.isOpen)}),[e.isHovered,e.isOpen,a.overlay]),l((()=>{if(a.overlay)return o.mappEvent.addListener(a.overlay,"click",(t=>{e.onClick(t)})),o.mappEvent.addListener(a.overlay,"mouseover",(t=>e.onMouseOver(t))),o.mappEvent.addListener(a.overlay,"mouseout",(t=>e.onMouseOut(t))),"kml"==e.poi.type&&("leaflet"==mappl10n.options.engine?(o.mappEvent.addListenerOnce(a.overlay,"ready",(()=>{a.overlayUpdate()})),o.mappEvent.addListenerOnce(a.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+e.poi.kml.url)}))):(o.mappEvent.addListener(a.overlay,"defaultviewport_changed",(()=>{m()})),o.mappEvent.addListener(a.overlay,"status_changed",(()=>{"OK"!=a.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+e.poi.kml.url)})))),e.isEditable&&(s(!0),o.mappEvent.addListener(a.overlay,"dragstart",(()=>(s(!1),void(e.onChange&&e.onChange({viewport:null}))))),o.mappEvent.addListener(a.overlay,"dragend",(()=>(m(),void s(!0))))),()=>{o.mappEvent.clearInstanceListeners(a.overlay)}})),e.isOpen||e.isHovered?e.onRenderPopup(e.poi,a.overlay):null}},892:(e,t,a)=>{"use strict";a.d(t,{MappPopupModal:()=>m});var o=a(939);const n=wp.element.createElement,i=wp.element.createPortal,{Fragment:l,useEffect:s,useLayoutEffect:r,useRef:p,useState:c}=wp.element;function m(e){e={onClose:null,poi:null,...e};const[t,a]=c({isBusy:!1,html:null});function l(e){a((t=>({...t,...e})))}const r=React.createRef();function p(t){27==t.keyCode&&e.onClose()}return s((()=>(document.body.classList.add("mapp-modal-noscroll"),()=>document.body.classList.remove("mapp-modal-noscroll"))),[]),s((()=>{e.poi.oid&&(l({isBusy:!0}),o.mappLib.ajax({method:"GET",data:{action:"mapp_get_post",oid:e.poi.oid,nonce:mappl10n.options.nonce},responseType:"html",callback:e=>{l({isBusy:!1,html:e})}}))}),[e.poi.oid]),s((()=>{r.current&&r.current.focus(),console.log("focus"+document.activeElement)}),[r.current]),i(n("div",{className:"mapp-modal"},n("div",{className:"mapp-modal-backdrop",onClick:e.onClose,onKeyDown:p},n("div",{className:"mapp-modal-close",onClick:e.onClose},"×")),n("div",{className:"mapp-modal-content-wrapper",ref:r,onKeyDown:p,tabIndex:0},n("div",{className:"mapp-modal-content"},t.isBusy&&n("div",{className:"mapp-modal-spinner"}),!t.isBusy&&n("div",{className:"mapp-modal-template",dangerouslySetInnerHTML:{__html:t.html}}),n("div",{className:"mapp-modal-close",onClick:e.onClose},"X")))),document.body)}},308:(e,t,a)=>{"use strict";e.exports=function(e,t){var o=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),n=o.length,i=void 0,l=void 0,s=void 0,r=void 0,p=void 0,c=void 0,m=void 0,d=void 0,u=void 0,g=void 0,h=void 0,_=void 0,f=void 0,b=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},v="undefined"!=typeof window?window:a.g;v.$locutus=v.$locutus||{};var y=v.$locutus;for(y.php=y.php||{},t||(t=v),i=0;i<n&&(u=b((d=o[i].split("="))[0]),g=d.length<2?"":b(d[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(_=[],h=0,l=0;l<u.length;l++)if("["!==u.charAt(l)||h){if("]"===u.charAt(l)&&h&&(_.length||_.push(u.slice(0,h-1)),_.push(u.substr(h,l-h)),h=0,"["!==u.charAt(l+1)))break}else h=l+1;for(_.length||(_=[u]),l=0;l<_[0].length&&(" "!==(m=_[0].charAt(l))&&"."!==m&&"["!==m||(_[0]=_[0].substr(0,l)+"_"+_[0].substr(l+1)),"["!==m);l++);for(c=t,l=0,f=_.length;l<f;l++){if(p=c,(""===(u=_[l].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==l){for(r in s=-1,c)c.hasOwnProperty(r)&&+r>s&&r.match(/^\d+$/g)&&(s=+r);u=s+1}Object(c[u])!==c[u]&&(c[u]={}),c=c[u]}p[u]=g}}}}},a={};function o(e){var n=a[e];if(void 0!==n)return n.exports;var i=a[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(569),o(66),o(972),o(286),o(107),o(946),o(800),o(68),o(641),o(897),o(218),o(265),o(74),o(146),o(577),o(315),o(185),o(885),o(573),o(697)})();
css/mappress.css CHANGED
@@ -220,6 +220,8 @@ a.leaflet-control-zoom-in, .leaflet-control-zoom-out {
220
 
221
  /* Sidebar inline */
222
  .mapp-sidebar.mapp-sidebar-inline {
 
 
223
  max-width: none;
224
  width: auto;
225
  }
@@ -233,10 +235,7 @@ a.leaflet-control-zoom-in, .leaflet-control-zoom-out {
233
  width: auto;
234
  }
235
 
236
- /* List outside layout */
237
  .mapp-sidebar-inline .mapp-list {
238
- border: none;
239
- border-top: 1px solid lightgray;
240
  display: flex;
241
  flex: none;
242
  flex-direction: column;
@@ -380,6 +379,7 @@ a.leaflet-control-zoom-in, .leaflet-control-zoom-out {
380
  /*
381
  -----------------------------------------------------------------------------------
382
  Header
 
383
  -----------------------------------------------------------------------------------
384
  */
385
  .mapp-header {
@@ -388,6 +388,7 @@ a.leaflet-control-zoom-in, .leaflet-control-zoom-out {
388
  border-bottom: 1px solid lightgray;
389
  display: flex;
390
  gap: 5px;
 
391
  }
392
 
393
  /*
@@ -808,7 +809,8 @@ a.leaflet-control-zoom-in, .leaflet-control-zoom-out {
808
  overflow: hidden;
809
  }
810
 
811
- .mapp-iw * {
 
812
  font-size: 13px;
813
  }
814
 
@@ -1404,7 +1406,10 @@ body.mapp-modal-noscroll {
1404
  -----------------------------------------------------------------------------------
1405
  */
1406
 
1407
- .mapp-iframe-container {}
 
 
 
1408
  .mapp-iframe-wrapper { position: relative; }
1409
 
1410
  /* Size only works with position absolute AND h/w=100%; z-index because 2020 page breaks appear over map */
220
 
221
  /* Sidebar inline */
222
  .mapp-sidebar.mapp-sidebar-inline {
223
+ border: none;
224
+ border-top: 1px solid lightgray;
225
  max-width: none;
226
  width: auto;
227
  }
235
  width: auto;
236
  }
237
 
 
238
  .mapp-sidebar-inline .mapp-list {
 
 
239
  display: flex;
240
  flex: none;
241
  flex-direction: column;
379
  /*
380
  -----------------------------------------------------------------------------------
381
  Header
382
+ - min-height to prevent popins
383
  -----------------------------------------------------------------------------------
384
  */
385
  .mapp-header {
388
  border-bottom: 1px solid lightgray;
389
  display: flex;
390
  gap: 5px;
391
+ min-height: 45px;
392
  }
393
 
394
  /*
809
  overflow: hidden;
810
  }
811
 
812
+ /* Selectivity needed to override GT editor */
813
+ .mapp-ib .mapp-iw * {
814
  font-size: 13px;
815
  }
816
 
1406
  -----------------------------------------------------------------------------------
1407
  */
1408
 
1409
+ .mapp-iframe-container {
1410
+ border: 1px solid lightgray;
1411
+ }
1412
+
1413
  .mapp-iframe-wrapper { position: relative; }
1414
 
1415
  /* Size only works with position absolute AND h/w=100%; z-index because 2020 page breaks appear over map */
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.83.13\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-08-25T19:50:03+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
 
@@ -30,177 +30,177 @@ msgstr ""
30
  msgid "Chris Richardson"
31
  msgstr ""
32
 
33
- #: mappress.php:180
34
- #: mappress.php:768
35
  msgid "Settings"
36
  msgstr ""
37
 
38
- #: mappress.php:181
39
  #: build/index_mappress_admin.js:1
40
  msgid "Maps"
41
  msgstr ""
42
 
43
- #: mappress.php:183
44
  #: build/index_mappress_admin.js:1
45
  msgid "Import"
46
  msgstr ""
47
 
48
- #: mappress.php:184
49
  #: build/index_mappress.js:1
50
  #: build/index_mappress_admin.js:1
51
  msgid "Support"
52
  msgstr ""
53
 
54
- #: mappress.php:185
55
  #: build/index_mappress_admin.js:1
56
  msgid "Upgrade"
57
  msgstr ""
58
 
59
- #: mappress.php:198
60
  msgid "MapPress database tables are missing. Please deactivate the plugin and activate it again to fix this."
61
  msgstr ""
62
 
63
- #: mappress.php:203
64
  msgid "A Google Maps API key is required"
65
  msgstr ""
66
 
67
- #: mappress.php:203
68
  msgid "Please update your"
69
  msgstr ""
70
 
71
- #: mappress.php:203
72
  msgid "MapPress Settings"
73
  msgstr ""
74
 
75
- #: mappress.php:208
76
  msgid "Upgrade Now"
77
  msgstr ""
78
 
79
- #: mappress.php:209
80
  msgid "Your MapPress data must be upgraded! Please %s.</strong>"
81
  msgstr ""
82
 
83
- #: mappress.php:536
84
  msgid "Renew your license"
85
  msgstr ""
86
 
87
- #: mappress.php:538
88
  msgid "Your MapPress license has expired. %s to get the latest updates and prevent errors."
89
  msgstr ""
90
 
91
- #: mappress.php:547
92
  msgid "Please enter your MapPress license key to enable plugin updates"
93
  msgstr ""
94
 
95
- #: mappress.php:550
96
  msgid "MapPress Gutenberg blocks require WordPress 5.3 or the latest Gutenberg Plugin. Please update if using the block editor."
97
  msgstr ""
98
 
99
- #: mappress.php:553
100
  msgid "MapPress has many new features! %s."
101
  msgstr ""
102
 
103
- #: mappress.php:553
104
- #: mappress.php:556
105
- #: mappress.php:562
106
- #: mappress.php:598
107
  #: build/index_mappress_admin.js:1
108
  msgid "Learn more"
109
  msgstr ""
110
 
111
- #: mappress.php:556
112
- #: mappress.php:598
113
  msgid "MapPress templates have changed! Please update custom templates to the new format. %s."
114
  msgstr ""
115
 
116
- #: mappress.php:562
117
  msgid "MapPress templates and filters have changed. Please update custom templates and filters. %s."
118
  msgstr ""
119
 
120
- #: mappress.php:670
121
  msgid "Are you sure you want to delete?"
122
  msgstr ""
123
 
124
- #: mappress.php:671
125
  msgid "Permanently delete this map?"
126
  msgstr ""
127
 
128
- #: mappress.php:672
129
  msgid "Error reading KML file"
130
  msgstr ""
131
 
132
- #: mappress.php:673
133
  msgid "URL for KML file"
134
  msgstr ""
135
 
136
- #: mappress.php:674
137
  msgid "Please select an editor to insert into."
138
  msgstr ""
139
 
140
- #: mappress.php:675
141
  msgid "Unable to get your location"
142
  msgstr ""
143
 
144
- #: mappress.php:676
145
  #: build/index_mappress_admin.js:1
146
  msgid "No results"
147
  msgstr ""
148
 
149
- #: mappress.php:677
150
  msgid "Save changes?"
151
  msgstr ""
152
 
153
- #: mappress.php:678
154
  #: build/index_mappress_admin.js:1
155
  msgid "Shape"
156
  msgstr ""
157
 
158
- #: mappress.php:711
159
- #: mappress.php:720
160
  msgid "Streets"
161
  msgstr ""
162
 
163
- #: mappress.php:712
164
  msgid "Outdoors"
165
  msgstr ""
166
 
167
- #: mappress.php:713
168
  msgid "Light"
169
  msgstr ""
170
 
171
- #: mappress.php:714
172
  msgid "Dark"
173
  msgstr ""
174
 
175
- #: mappress.php:715
176
- #: mappress.php:728
177
  msgid "Satellite"
178
  msgstr ""
179
 
180
- #: mappress.php:716
181
  msgid "Satellite Streets"
182
  msgstr ""
183
 
184
- #: mappress.php:726
185
  msgid "Roadmap"
186
  msgstr ""
187
 
188
- #: mappress.php:727
189
  msgid "Terrain"
190
  msgstr ""
191
 
192
- #: mappress.php:729
193
  msgid "Hybrid"
194
  msgstr ""
195
 
196
- #: mappress.php:769
197
  #: mappress_settings.php:519
198
  #: mappress_settings.php:550
199
  #: build/index_mappress_admin.js:1
200
  msgid "What's new"
201
  msgstr ""
202
 
203
- #: mappress.php:1133
204
  msgid "Version"
205
  msgstr ""
206
 
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.83.17\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-08-31T16:21:01+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
 
30
  msgid "Chris Richardson"
31
  msgstr ""
32
 
33
+ #: mappress.php:181
34
+ #: mappress.php:769
35
  msgid "Settings"
36
  msgstr ""
37
 
38
+ #: mappress.php:182
39
  #: build/index_mappress_admin.js:1
40
  msgid "Maps"
41
  msgstr ""
42
 
43
+ #: mappress.php:184
44
  #: build/index_mappress_admin.js:1
45
  msgid "Import"
46
  msgstr ""
47
 
48
+ #: mappress.php:185
49
  #: build/index_mappress.js:1
50
  #: build/index_mappress_admin.js:1
51
  msgid "Support"
52
  msgstr ""
53
 
54
+ #: mappress.php:186
55
  #: build/index_mappress_admin.js:1
56
  msgid "Upgrade"
57
  msgstr ""
58
 
59
+ #: mappress.php:199
60
  msgid "MapPress database tables are missing. Please deactivate the plugin and activate it again to fix this."
61
  msgstr ""
62
 
63
+ #: mappress.php:204
64
  msgid "A Google Maps API key is required"
65
  msgstr ""
66
 
67
+ #: mappress.php:204
68
  msgid "Please update your"
69
  msgstr ""
70
 
71
+ #: mappress.php:204
72
  msgid "MapPress Settings"
73
  msgstr ""
74
 
75
+ #: mappress.php:209
76
  msgid "Upgrade Now"
77
  msgstr ""
78
 
79
+ #: mappress.php:210
80
  msgid "Your MapPress data must be upgraded! Please %s.</strong>"
81
  msgstr ""
82
 
83
+ #: mappress.php:537
84
  msgid "Renew your license"
85
  msgstr ""
86
 
87
+ #: mappress.php:539
88
  msgid "Your MapPress license has expired. %s to get the latest updates and prevent errors."
89
  msgstr ""
90
 
91
+ #: mappress.php:548
92
  msgid "Please enter your MapPress license key to enable plugin updates"
93
  msgstr ""
94
 
95
+ #: mappress.php:551
96
  msgid "MapPress Gutenberg blocks require WordPress 5.3 or the latest Gutenberg Plugin. Please update if using the block editor."
97
  msgstr ""
98
 
99
+ #: mappress.php:554
100
  msgid "MapPress has many new features! %s."
101
  msgstr ""
102
 
103
+ #: mappress.php:554
104
+ #: mappress.php:557
105
+ #: mappress.php:563
106
+ #: mappress.php:599
107
  #: build/index_mappress_admin.js:1
108
  msgid "Learn more"
109
  msgstr ""
110
 
111
+ #: mappress.php:557
112
+ #: mappress.php:599
113
  msgid "MapPress templates have changed! Please update custom templates to the new format. %s."
114
  msgstr ""
115
 
116
+ #: mappress.php:563
117
  msgid "MapPress templates and filters have changed. Please update custom templates and filters. %s."
118
  msgstr ""
119
 
120
+ #: mappress.php:671
121
  msgid "Are you sure you want to delete?"
122
  msgstr ""
123
 
124
+ #: mappress.php:672
125
  msgid "Permanently delete this map?"
126
  msgstr ""
127
 
128
+ #: mappress.php:673
129
  msgid "Error reading KML file"
130
  msgstr ""
131
 
132
+ #: mappress.php:674
133
  msgid "URL for KML file"
134
  msgstr ""
135
 
136
+ #: mappress.php:675
137
  msgid "Please select an editor to insert into."
138
  msgstr ""
139
 
140
+ #: mappress.php:676
141
  msgid "Unable to get your location"
142
  msgstr ""
143
 
144
+ #: mappress.php:677
145
  #: build/index_mappress_admin.js:1
146
  msgid "No results"
147
  msgstr ""
148
 
149
+ #: mappress.php:678
150
  msgid "Save changes?"
151
  msgstr ""
152
 
153
+ #: mappress.php:679
154
  #: build/index_mappress_admin.js:1
155
  msgid "Shape"
156
  msgstr ""
157
 
158
+ #: mappress.php:712
159
+ #: mappress.php:721
160
  msgid "Streets"
161
  msgstr ""
162
 
163
+ #: mappress.php:713
164
  msgid "Outdoors"
165
  msgstr ""
166
 
167
+ #: mappress.php:714
168
  msgid "Light"
169
  msgstr ""
170
 
171
+ #: mappress.php:715
172
  msgid "Dark"
173
  msgstr ""
174
 
175
+ #: mappress.php:716
176
+ #: mappress.php:729
177
  msgid "Satellite"
178
  msgstr ""
179
 
180
+ #: mappress.php:717
181
  msgid "Satellite Streets"
182
  msgstr ""
183
 
184
+ #: mappress.php:727
185
  msgid "Roadmap"
186
  msgstr ""
187
 
188
+ #: mappress.php:728
189
  msgid "Terrain"
190
  msgstr ""
191
 
192
+ #: mappress.php:730
193
  msgid "Hybrid"
194
  msgstr ""
195
 
196
+ #: mappress.php:770
197
  #: mappress_settings.php:519
198
  #: mappress_settings.php:550
199
  #: build/index_mappress_admin.js:1
200
  msgid "What's new"
201
  msgstr ""
202
 
203
+ #: mappress.php:1140
204
  msgid "Version"
205
  msgstr ""
206
 
lib/js-markerclustererplus-main/modified-clusterer.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CVR
2
+ //
3
+ // Modified version of https://github.com/googlemaps/js-markerclustererplus
4
+ // Based on unpkg: https://unpkg.com/browse/@googlemaps/markerclustererplus@1.2.10/dist/index.min.js
5
+ //
6
+ // The original file throws warnings because Google deprecated addDomListener.
7
+ // This version replaces addDomListener calls with addEventListener.
8
+ //
9
+ // Google has ported the clusterer to a new version, but a bug in THAT version prevents proper marker counts:
10
+ // https://github.com/googlemaps/js-markerclusterer/issues/220
11
+ //
12
+ var MarkerClusterer=function(){"use strict";var t,e,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){try{return!!t()}catch(t){return!0}},i=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o=function(t){return t&&t.Math==Math&&t},s=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof r&&r)||function(){return this}()||Function("return this")(),a=Function.prototype,u=a.bind,c=a.call,l=u&&u.bind(c),h=u?function(t){return t&&l(c,t)}:function(t){return t&&function(){return c.apply(t,arguments)}},p=function(t){return"function"==typeof t},f=n,g=p,d=/#|\.prototype\./,v=function(t,e){var r=_[m(t)];return r==b||r!=y&&(g(e)?f(e):!!e)},m=v.normalize=function(t){return String(t).replace(d,".").toLowerCase()},_=v.data={},y=v.NATIVE="N",b=v.POLYFILL="P",x=v,M={exports:{}},S=s.TypeError,I=function(t){if(null==t)throw S("Can't call method on "+t);return t},k=I,w=s.Object,C=function(t){return w(k(t))},E=C,O=h({}.hasOwnProperty),P=Object.hasOwn||function(t,e){return O(E(t),e)},T={},A=p,L=function(t){return"object"==typeof t?null!==t:A(t)},z=L,j=s.document,R=z(j)&&z(j.createElement),N=function(t){return R?j.createElement(t):{}},B=N,Z=!i&&!n((function(){return 7!=Object.defineProperty(B("div"),"a",{get:function(){return 7}}).a})),F=s,D=L,H=F.String,$=F.TypeError,G=function(t){if(D(t))return t;throw $(H(t)+" is not an object")},V=Function.prototype.call,U=V.bind?V.bind(V):function(){return V.apply(V,arguments)},W=s,X=p,Y=function(t){return X(t)?t:void 0},K=function(t,e){return arguments.length<2?Y(W[t]):W[t]&&W[t][e]},q=h({}.isPrototypeOf),J=s,Q=K("navigator","userAgent")||"",tt=J.process,et=J.Deno,rt=tt&&tt.versions||et&&et.version,nt=rt&&rt.v8;nt&&(e=(t=nt.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&Q&&(!(t=Q.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=Q.match(/Chrome\/(\d+)/))&&(e=+t[1]);var it=e,ot=it,st=n,at=!!Object.getOwnPropertySymbols&&!st((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ot&&ot<41})),ut=at&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ct=K,lt=p,ht=q,pt=ut,ft=s.Object,gt=pt?function(t){return"symbol"==typeof t}:function(t){var e=ct("Symbol");return lt(e)&&ht(e.prototype,ft(t))},dt=s.String,vt=function(t){try{return dt(t)}catch(t){return"Object"}},mt=p,_t=vt,yt=s.TypeError,bt=function(t){if(mt(t))return t;throw yt(_t(t)+" is not a function")},xt=function(t,e){var r=t[e];return null==r?void 0:bt(r)},Mt=U,St=p,It=L,kt=s.TypeError,wt={exports:{}},Ct=s,Et=Object.defineProperty,Ot=function(t,e){try{Et(Ct,t,{value:e,configurable:!0,writable:!0})}catch(r){Ct[t]=e}return e},Pt=Ot,Tt="__core-js_shared__",At=s[Tt]||Pt(Tt,{}),Lt=At;(wt.exports=function(t,e){return Lt[t]||(Lt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var zt=h,jt=0,Rt=Math.random(),Nt=zt(1..toString),Bt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Nt(++jt+Rt,36)},Zt=s,Ft=wt.exports,Dt=P,Ht=Bt,$t=at,Gt=ut,Vt=Ft("wks"),Ut=Zt.Symbol,Wt=Ut&&Ut.for,Xt=Gt?Ut:Ut&&Ut.withoutSetter||Ht,Yt=function(t){if(!Dt(Vt,t)||!$t&&"string"!=typeof Vt[t]){var e="Symbol."+t;$t&&Dt(Ut,t)?Vt[t]=Ut[t]:Vt[t]=Gt&&Wt?Wt(e):Xt(e)}return Vt[t]},Kt=U,qt=L,Jt=gt,Qt=xt,te=function(t,e){var r,n;if("string"===e&&St(r=t.toString)&&!It(n=Mt(r,t)))return n;if(St(r=t.valueOf)&&!It(n=Mt(r,t)))return n;if("string"!==e&&St(r=t.toString)&&!It(n=Mt(r,t)))return n;throw kt("Can't convert object to primitive value")},ee=Yt,re=s.TypeError,ne=ee("toPrimitive"),ie=function(t,e){if(!qt(t)||Jt(t))return t;var r,n=Qt(t,ne);if(n){if(void 0===e&&(e="default"),r=Kt(n,t,e),!qt(r)||Jt(r))return r;throw re("Can't convert object to primitive value")}return void 0===e&&(e="number"),te(t,e)},oe=ie,se=gt,ae=function(t){var e=oe(t,"string");return se(e)?e:e+""},ue=i,ce=Z,le=G,he=ae,pe=s.TypeError,fe=Object.defineProperty;T.f=ue?fe:function(t,e,r){if(le(t),e=he(e),le(r),ce)try{return fe(t,e,r)}catch(t){}if("get"in r||"set"in r)throw pe("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var ge=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},de=T,ve=ge,me=i?function(t,e,r){return de.f(t,e,ve(1,r))}:function(t,e,r){return t[e]=r,t},_e=p,ye=At,be=h(Function.toString);_e(ye.inspectSource)||(ye.inspectSource=function(t){return be(t)});var xe,Me,Se,Ie=ye.inspectSource,ke=p,we=Ie,Ce=s.WeakMap,Ee=ke(Ce)&&/native code/.test(we(Ce)),Oe=wt.exports,Pe=Bt,Te=Oe("keys"),Ae=function(t){return Te[t]||(Te[t]=Pe(t))},Le={},ze=Ee,je=s,Re=h,Ne=L,Be=me,Ze=P,Fe=At,De=Ae,He=Le,$e="Object already initialized",Ge=je.TypeError,Ve=je.WeakMap;if(ze||Fe.state){var Ue=Fe.state||(Fe.state=new Ve),We=Re(Ue.get),Xe=Re(Ue.has),Ye=Re(Ue.set);xe=function(t,e){if(Xe(Ue,t))throw new Ge($e);return e.facade=t,Ye(Ue,t,e),e},Me=function(t){return We(Ue,t)||{}},Se=function(t){return Xe(Ue,t)}}else{var Ke=De("state");He[Ke]=!0,xe=function(t,e){if(Ze(t,Ke))throw new Ge($e);return e.facade=t,Be(t,Ke,e),e},Me=function(t){return Ze(t,Ke)?t[Ke]:{}},Se=function(t){return Ze(t,Ke)}}var qe={set:xe,get:Me,has:Se,enforce:function(t){return Se(t)?Me(t):xe(t,{})},getterFor:function(t){return function(e){var r;if(!Ne(e)||(r=Me(e)).type!==t)throw Ge("Incompatible receiver, "+t+" required");return r}}},Je=i,Qe=P,tr=Function.prototype,er=Je&&Object.getOwnPropertyDescriptor,rr=Qe(tr,"name"),nr={EXISTS:rr,PROPER:rr&&"something"===function(){}.name,CONFIGURABLE:rr&&(!Je||Je&&er(tr,"name").configurable)},ir=s,or=p,sr=P,ar=me,ur=Ot,cr=Ie,lr=nr.CONFIGURABLE,hr=qe.get,pr=qe.enforce,fr=String(String).split("String");(M.exports=function(t,e,r,n){var i,o=!!n&&!!n.unsafe,s=!!n&&!!n.enumerable,a=!!n&&!!n.noTargetGet,u=n&&void 0!==n.name?n.name:e;or(r)&&("Symbol("===String(u).slice(0,7)&&(u="["+String(u).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!sr(r,"name")||lr&&r.name!==u)&&ar(r,"name",u),(i=pr(r)).source||(i.source=fr.join("string"==typeof u?u:""))),t!==ir?(o?!a&&t[e]&&(s=!0):delete t[e],s?t[e]=r:ar(t,e,r)):s?t[e]=r:ur(e,r)})(Function.prototype,"toString",(function(){return or(this)&&hr(this).source||cr(this)}));var gr=s,dr=p,vr=gr.String,mr=gr.TypeError,_r=h,yr=G,br=function(t){if("object"==typeof t||dr(t))return t;throw mr("Can't set "+vr(t)+" as a prototype")},xr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=_r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return yr(r),br(n),e?t(r,n):r.__proto__=n,r}}():void 0),Mr=p,Sr=L,Ir=xr,kr={},wr=h,Cr=wr({}.toString),Er=wr("".slice),Or=function(t){return Er(Cr(t),8,-1)},Pr=h,Tr=n,Ar=Or,Lr=s.Object,zr=Pr("".split),jr=Tr((function(){return!Lr("z").propertyIsEnumerable(0)}))?function(t){return"String"==Ar(t)?zr(t,""):Lr(t)}:Lr,Rr=jr,Nr=I,Br=function(t){return Rr(Nr(t))},Zr=Math.ceil,Fr=Math.floor,Dr=function(t){var e=+t;return e!=e||0===e?0:(e>0?Fr:Zr)(e)},Hr=Dr,$r=Math.max,Gr=Math.min,Vr=function(t,e){var r=Hr(t);return r<0?$r(r+e,0):Gr(r,e)},Ur=Dr,Wr=Math.min,Xr=function(t){return t>0?Wr(Ur(t),9007199254740991):0},Yr=Xr,Kr=function(t){return Yr(t.length)},qr=Br,Jr=Vr,Qr=Kr,tn=function(t){return function(e,r,n){var i,o=qr(e),s=Qr(o),a=Jr(n,s);if(t&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},en={includes:tn(!0),indexOf:tn(!1)},rn=P,nn=Br,on=en.indexOf,sn=Le,an=h([].push),un=function(t,e){var r,n=nn(t),i=0,o=[];for(r in n)!rn(sn,r)&&rn(n,r)&&an(o,r);for(;e.length>i;)rn(n,r=e[i++])&&(~on(o,r)||an(o,r));return o},cn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ln=un,hn=cn.concat("length","prototype");kr.f=Object.getOwnPropertyNames||function(t){return ln(t,hn)};var pn={},fn={},gn={}.propertyIsEnumerable,dn=Object.getOwnPropertyDescriptor,vn=dn&&!gn.call({1:2},1);fn.f=vn?function(t){var e=dn(this,t);return!!e&&e.enumerable}:gn;var mn=i,_n=U,yn=fn,bn=ge,xn=Br,Mn=ae,Sn=P,In=Z,kn=Object.getOwnPropertyDescriptor;pn.f=mn?kn:function(t,e){if(t=xn(t),e=Mn(e),In)try{return kn(t,e)}catch(t){}if(Sn(t,e))return bn(!_n(yn.f,t,e),t[e])};var wn=h(1..valueOf),Cn={};Cn[Yt("toStringTag")]="z";var En="[object z]"===String(Cn),On=s,Pn=En,Tn=p,An=Or,Ln=Yt("toStringTag"),zn=On.Object,jn="Arguments"==An(function(){return arguments}()),Rn=Pn?An:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=zn(t),Ln))?r:jn?An(e):"Object"==(n=An(e))&&Tn(e.callee)?"Arguments":n},Nn=Rn,Bn=s.String,Zn=function(t){if("Symbol"===Nn(t))throw TypeError("Cannot convert a Symbol value to a string");return Bn(t)},Fn=I,Dn=Zn,Hn=h("".replace),$n="[\t\n\v\f\r                \u2028\u2029\ufeff]",Gn=RegExp("^"+$n+$n+"*"),Vn=RegExp($n+$n+"*$"),Un=function(t){return function(e){var r=Dn(Fn(e));return 1&t&&(r=Hn(r,Gn,"")),2&t&&(r=Hn(r,Vn,"")),r}},Wn={start:Un(1),end:Un(2),trim:Un(3)},Xn=i,Yn=s,Kn=h,qn=x,Jn=M.exports,Qn=P,ti=function(t,e,r){var n,i;return Ir&&Mr(n=e.constructor)&&n!==r&&Sr(i=n.prototype)&&i!==r.prototype&&Ir(t,i),t},ei=q,ri=gt,ni=ie,ii=n,oi=kr.f,si=pn.f,ai=T.f,ui=wn,ci=Wn.trim,li="Number",hi=Yn.Number,pi=hi.prototype,fi=Yn.TypeError,gi=Kn("".slice),di=Kn("".charCodeAt),vi=function(t){var e=ni(t,"number");return"bigint"==typeof e?e:mi(e)},mi=function(t){var e,r,n,i,o,s,a,u,c=ni(t,"number");if(ri(c))throw fi("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=ci(c),43===(e=di(c,0))||45===e){if(88===(r=di(c,2))||120===r)return NaN}else if(48===e){switch(di(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(s=(o=gi(c,2)).length,a=0;a<s;a++)if((u=di(o,a))<48||u>i)return NaN;return parseInt(o,n)}return+c};if(qn(li,!hi(" 0o1")||!hi("0b1")||hi("+0x1"))){for(var _i,yi=function(t){var e=arguments.length<1?0:hi(vi(t)),r=this;return ei(pi,r)&&ii((function(){ui(r)}))?ti(Object(e),r,yi):e},bi=Xn?oi(hi):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),xi=0;bi.length>xi;xi++)Qn(hi,_i=bi[xi])&&!Qn(yi,_i)&&ai(yi,_i,si(hi,_i));yi.prototype=pi,pi.constructor=yi,Jn(Yn,li,yi)}var Mi={};Mi.f=Object.getOwnPropertySymbols;var Si=K,Ii=kr,ki=Mi,wi=G,Ci=h([].concat),Ei=Si("Reflect","ownKeys")||function(t){var e=Ii.f(wi(t)),r=ki.f;return r?Ci(e,r(t)):e},Oi=P,Pi=Ei,Ti=pn,Ai=T,Li=s,zi=pn.f,ji=me,Ri=M.exports,Ni=Ot,Bi=function(t,e){for(var r=Pi(e),n=Ai.f,i=Ti.f,o=0;o<r.length;o++){var s=r[o];Oi(t,s)||n(t,s,i(e,s))}},Zi=x,Fi=function(t,e){var r,n,i,o,s,a=t.target,u=t.global,c=t.stat;if(r=u?Li:c?Li[a]||Ni(a,{}):(Li[a]||{}).prototype)for(n in e){if(o=e[n],i=t.noTargetGet?(s=zi(r,n))&&s.value:r[n],!Zi(u?n:a+(c?".":"#")+n,t.forced)&&void 0!==i){if(typeof o==typeof i)continue;Bi(o,i)}(t.sham||i&&i.sham)&&ji(o,"sham",!0),Ri(r,n,o,t)}},Di=Or,Hi=Array.isArray||function(t){return"Array"==Di(t)},$i=h,Gi=n,Vi=p,Ui=Rn,Wi=Ie,Xi=function(){},Yi=[],Ki=K("Reflect","construct"),qi=/^\s*(?:class|function)\b/,Ji=$i(qi.exec),Qi=!qi.exec(Xi),to=function(t){if(!Vi(t))return!1;try{return Ki(Xi,Yi,t),!0}catch(t){return!1}},eo=!Ki||Gi((function(){var t;return to(to.call)||!to(Object)||!to((function(){t=!0}))||t}))?function(t){if(!Vi(t))return!1;switch(Ui(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Qi||!!Ji(qi,Wi(t))}:to,ro=s,no=Hi,io=eo,oo=L,so=Yt("species"),ao=ro.Array,uo=function(t){var e;return no(t)&&(e=t.constructor,(io(e)&&(e===ao||no(e.prototype))||oo(e)&&null===(e=e[so]))&&(e=void 0)),void 0===e?ao:e},co=function(t,e){return new(uo(t))(0===e?0:e)},lo=ae,ho=T,po=ge,fo=function(t,e,r){var n=lo(e);n in t?ho.f(t,n,po(0,r)):t[n]=r},go=n,vo=it,mo=Yt("species"),_o=function(t){return vo>=51||!go((function(){var e=[];return(e.constructor={})[mo]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},yo=Fi,bo=s,xo=Vr,Mo=Dr,So=Kr,Io=C,ko=co,wo=fo,Co=_o("splice"),Eo=bo.TypeError,Oo=Math.max,Po=Math.min,To=9007199254740991,Ao="Maximum allowed length exceeded";yo({target:"Array",proto:!0,forced:!Co},{splice:function(t,e){var r,n,i,o,s,a,u=Io(this),c=So(u),l=xo(t,c),h=arguments.length;if(0===h?r=n=0:1===h?(r=0,n=c-l):(r=h-2,n=Po(Oo(Mo(e),0),c-l)),c+r-n>To)throw Eo(Ao);for(i=ko(u,n),o=0;o<n;o++)(s=l+o)in u&&wo(i,o,u[s]);if(i.length=n,r<n){for(o=l;o<c-n;o++)a=o+r,(s=o+n)in u?u[a]=u[s]:delete u[a];for(o=c;o>c-n+r;o--)delete u[o-1]}else if(r>n)for(o=c-n;o>l;o--)a=o+r-1,(s=o+n-1)in u?u[a]=u[s]:delete u[a];for(o=0;o<r;o++)u[o+l]=arguments[o+2];return u.length=c-n+r,i}});var Lo=h([].slice),zo=Fi,jo=s,Ro=Hi,No=eo,Bo=L,Zo=Vr,Fo=Kr,Do=Br,Ho=fo,$o=Yt,Go=Lo,Vo=_o("slice"),Uo=$o("species"),Wo=jo.Array,Xo=Math.max;zo({target:"Array",proto:!0,forced:!Vo},{slice:function(t,e){var r,n,i,o=Do(this),s=Fo(o),a=Zo(t,s),u=Zo(void 0===e?s:e,s);if(Ro(o)&&(r=o.constructor,(No(r)&&(r===Wo||Ro(r.prototype))||Bo(r)&&null===(r=r[Uo]))&&(r=void 0),r===Wo||void 0===r))return Go(o,a,u);for(n=new(void 0===r?Wo:r)(Xo(u-a,0)),i=0;a<u;a++,i++)a in o&&Ho(n,i,o[a]);return n.length=i,n}});var Yo=Rn,Ko=En?{}.toString:function(){return"[object "+Yo(this)+"]"},qo=En,Jo=M.exports,Qo=Ko;qo||Jo(Object.prototype,"toString",Qo,{unsafe:!0});var ts=G,es=function(){var t=ts(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},rs=h,ns=nr.PROPER,is=M.exports,os=G,ss=q,as=Zn,us=n,cs=es,ls="toString",hs=RegExp.prototype,ps=hs.toString,fs=rs(cs),gs=us((function(){return"/a/b"!=ps.call({source:"a",flags:"b"})})),ds=ns&&ps.name!=ls;(gs||ds)&&is(RegExp.prototype,ls,(function(){var t=os(this),e=as(t.source),r=t.flags;return"/"+e+"/"+as(void 0===r&&ss(hs,t)&&!("flags"in hs)?fs(t):r)}),{unsafe:!0});var vs=function(t,e){return(vs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function ms(t,e){function r(){this.constructor=t}vs(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var _s=function(){return(_s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},ys=n,bs=Fi,xs=jr,Ms=Br,Ss=function(t,e){var r=[][t];return!!r&&ys((function(){r.call(null,e||function(){throw 1},1)}))},Is=h([].join),ks=xs!=Object,ws=Ss("join",",");bs({target:"Array",proto:!0,forced:ks||!ws},{join:function(t){return Is(Ms(this),void 0===t?",":t)}});var Cs=un,Es=cn,Os=Object.keys||function(t){return Cs(t,Es)},Ps=C,Ts=Os;Fi({target:"Object",stat:!0,forced:n((function(){Ts(1)}))},{keys:function(t){return Ts(Ps(t))}});var As,Ls=n,zs=s.RegExp,js=Ls((function(){var t=zs("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),Rs=js||Ls((function(){return!zs("a","y").sticky})),Ns={BROKEN_CARET:js||Ls((function(){var t=zs("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:Rs,UNSUPPORTED_Y:js},Bs=T,Zs=G,Fs=Br,Ds=Os,Hs=i?Object.defineProperties:function(t,e){Zs(t);for(var r,n=Fs(e),i=Ds(e),o=i.length,s=0;o>s;)Bs.f(t,r=i[s++],n[r]);return t},$s=K("document","documentElement"),Gs=G,Vs=Hs,Us=cn,Ws=Le,Xs=$s,Ys=N,Ks=Ae("IE_PROTO"),qs=function(){},Js=function(t){return"<script>"+t+"</"+"script>"},Qs=function(t){t.write(Js("")),t.close();var e=t.parentWindow.Object;return t=null,e},ta=function(){try{As=new ActiveXObject("htmlfile")}catch(t){}var t,e;ta="undefined"!=typeof document?document.domain&&As?Qs(As):((e=Ys("iframe")).style.display="none",Xs.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Js("document.F=Object")),t.close(),t.F):Qs(As);for(var r=Us.length;r--;)delete ta.prototype[Us[r]];return ta()};Ws[Ks]=!0;var ea,ra,na=Object.create||function(t,e){var r;return null!==t?(qs.prototype=Gs(t),r=new qs,qs.prototype=null,r[Ks]=t):r=ta(),void 0===e?r:Vs(r,e)},ia=n,oa=s.RegExp,sa=ia((function(){var t=oa(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),aa=n,ua=s.RegExp,ca=aa((function(){var t=ua("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),la=U,ha=h,pa=Zn,fa=es,ga=Ns,da=wt.exports,va=na,ma=qe.get,_a=sa,ya=ca,ba=da("native-string-replace",String.prototype.replace),xa=RegExp.prototype.exec,Ma=xa,Sa=ha("".charAt),Ia=ha("".indexOf),ka=ha("".replace),wa=ha("".slice),Ca=(ra=/b*/g,la(xa,ea=/a/,"a"),la(xa,ra,"a"),0!==ea.lastIndex||0!==ra.lastIndex),Ea=ga.BROKEN_CARET,Oa=void 0!==/()??/.exec("")[1];(Ca||Oa||Ea||_a||ya)&&(Ma=function(t){var e,r,n,i,o,s,a,u=this,c=ma(u),l=pa(t),h=c.raw;if(h)return h.lastIndex=u.lastIndex,e=la(Ma,h,l),u.lastIndex=h.lastIndex,e;var p=c.groups,f=Ea&&u.sticky,g=la(fa,u),d=u.source,v=0,m=l;if(f&&(g=ka(g,"y",""),-1===Ia(g,"g")&&(g+="g"),m=wa(l,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==Sa(l,u.lastIndex-1))&&(d="(?: "+d+")",m=" "+m,v++),r=new RegExp("^(?:"+d+")",g)),Oa&&(r=new RegExp("^"+d+"$(?!\\s)",g)),Ca&&(n=u.lastIndex),i=la(xa,f?r:u,m),f?i?(i.input=wa(i.input,v),i[0]=wa(i[0],v),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:Ca&&i&&(u.lastIndex=u.global?i.index+i[0].length:n),Oa&&i&&i.length>1&&la(ba,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&p)for(i.groups=s=va(null),o=0;o<p.length;o++)s[(a=p[o])[0]]=i[a[1]];return i});var Pa=Ma;Fi({target:"RegExp",proto:!0,forced:/./.exec!==Pa},{exec:Pa});var Ta=Function.prototype,Aa=Ta.apply,La=Ta.bind,za=Ta.call,ja="object"==typeof Reflect&&Reflect.apply||(La?za.bind(Aa):function(){return za.apply(Aa,arguments)}),Ra=h,Na=M.exports,Ba=Pa,Za=n,Fa=Yt,Da=me,Ha=Fa("species"),$a=RegExp.prototype,Ga=function(t,e,r,n){var i=Fa(t),o=!Za((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),s=o&&!Za((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[Ha]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return e=!0,null},r[i](""),!e}));if(!o||!s||r){var a=Ra(/./[i]),u=e(i,""[t],(function(t,e,r,n,i){var s=Ra(t),u=e.exec;return u===Ba||u===$a.exec?o&&!i?{done:!0,value:a(e,r,n)}:{done:!0,value:s(r,e,n)}:{done:!1}}));Na(String.prototype,t,u[0]),Na($a,i,u[1])}n&&Da($a[i],"sham",!0)},Va=L,Ua=Or,Wa=Yt("match"),Xa=eo,Ya=vt,Ka=s.TypeError,qa=G,Ja=function(t){if(Xa(t))return t;throw Ka(Ya(t)+" is not a constructor")},Qa=Yt("species"),tu=h,eu=Dr,ru=Zn,nu=I,iu=tu("".charAt),ou=tu("".charCodeAt),su=tu("".slice),au=function(t){return function(e,r){var n,i,o=ru(nu(e)),s=eu(r),a=o.length;return s<0||s>=a?t?"":void 0:(n=ou(o,s))<55296||n>56319||s+1===a||(i=ou(o,s+1))<56320||i>57343?t?iu(o,s):n:t?su(o,s,s+2):i-56320+(n-55296<<10)+65536}},uu={codeAt:au(!1),charAt:au(!0)}.charAt,cu=function(t,e,r){return e+(r?uu(t,e).length:1)},lu=Vr,hu=Kr,pu=fo,fu=s.Array,gu=Math.max,du=U,vu=G,mu=p,_u=Or,yu=Pa,bu=s.TypeError,xu=function(t,e){var r=t.exec;if(mu(r)){var n=du(r,t,e);return null!==n&&vu(n),n}if("RegExp"===_u(t))return du(yu,t,e);throw bu("RegExp#exec called on incompatible receiver")},Mu=ja,Su=U,Iu=h,ku=Ga,wu=function(t){var e;return Va(t)&&(void 0!==(e=t[Wa])?!!e:"RegExp"==Ua(t))},Cu=G,Eu=I,Ou=function(t,e){var r,n=qa(t).constructor;return void 0===n||null==(r=qa(n)[Qa])?e:Ja(r)},Pu=cu,Tu=Xr,Au=Zn,Lu=xt,zu=function(t,e,r){for(var n=hu(t),i=lu(e,n),o=lu(void 0===r?n:r,n),s=fu(gu(o-i,0)),a=0;i<o;i++,a++)pu(s,a,t[i]);return s.length=a,s},ju=xu,Ru=Pa,Nu=n,Bu=Ns.UNSUPPORTED_Y,Zu=4294967295,Fu=Math.min,Du=[].push,Hu=Iu(/./.exec),$u=Iu(Du),Gu=Iu("".slice);ku("split",(function(t,e,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var n=Au(Eu(this)),i=void 0===r?Zu:r>>>0;if(0===i)return[];if(void 0===t)return[n];if(!wu(t))return Su(e,n,t,i);for(var o,s,a,u=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,h=new RegExp(t.source,c+"g");(o=Su(Ru,h,n))&&!((s=h.lastIndex)>l&&($u(u,Gu(n,l,o.index)),o.length>1&&o.index<n.length&&Mu(Du,u,zu(o,1)),a=o[0].length,l=s,u.length>=i));)h.lastIndex===o.index&&h.lastIndex++;return l===n.length?!a&&Hu(h,"")||$u(u,""):$u(u,Gu(n,l)),u.length>i?zu(u,0,i):u}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:Su(e,this,t,r)}:e,[function(e,r){var i=Eu(this),o=null==e?void 0:Lu(e,t);return o?Su(o,e,i,r):Su(n,Au(i),e,r)},function(t,i){var o=Cu(this),s=Au(t),a=r(n,o,s,i,n!==e);if(a.done)return a.value;var u=Ou(o,RegExp),c=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Bu?"g":"y"),h=new u(Bu?"^(?:"+o.source+")":o,l),p=void 0===i?Zu:i>>>0;if(0===p)return[];if(0===s.length)return null===ju(h,s)?[s]:[];for(var f=0,g=0,d=[];g<s.length;){h.lastIndex=Bu?0:g;var v,m=ju(h,Bu?Gu(s,g):s);if(null===m||(v=Fu(Tu(h.lastIndex+(Bu?g:0)),s.length))===f)g=Pu(s,g,c);else{if($u(d,Gu(s,f,g)),d.length===p)return d;for(var _=1;_<=m.length-1;_++)if($u(d,m[_]),d.length===p)return d;g=f=v}}return $u(d,Gu(s,f)),d}]}),!!Nu((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Bu);var Vu=Fi,Uu=s,Wu=n,Xu=Hi,Yu=L,Ku=C,qu=Kr,Ju=fo,Qu=co,tc=_o,ec=it,rc=Yt("isConcatSpreadable"),nc=9007199254740991,ic="Maximum allowed index exceeded",oc=Uu.TypeError,sc=ec>=51||!Wu((function(){var t=[];return t[rc]=!1,t.concat()[0]!==t})),ac=tc("concat"),uc=function(t){if(!Yu(t))return!1;var e=t[rc];return void 0!==e?!!e:Xu(t)};Vu({target:"Array",proto:!0,forced:!sc||!ac},{concat:function(t){var e,r,n,i,o,s=Ku(this),a=Qu(s,0),u=0;for(e=-1,n=arguments.length;e<n;e++)if(uc(o=-1===e?s:arguments[e])){if(u+(i=qu(o))>nc)throw oc(ic);for(r=0;r<i;r++,u++)r in o&&Ju(a,u,o[r])}else{if(u>=nc)throw oc(ic);Ju(a,u++,o)}return a.length=u,a}});var cc=h,lc=C,hc=Math.floor,pc=cc("".charAt),fc=cc("".replace),gc=cc("".slice),dc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,vc=/\$([$&'`]|\d{1,2})/g,mc=ja,_c=U,yc=h,bc=Ga,xc=n,Mc=G,Sc=p,Ic=Dr,kc=Xr,wc=Zn,Cc=I,Ec=cu,Oc=xt,Pc=function(t,e,r,n,i,o){var s=r+t.length,a=n.length,u=vc;return void 0!==i&&(i=lc(i),u=dc),fc(o,u,(function(o,u){var c;switch(pc(u,0)){case"$":return"$";case"&":return t;case"`":return gc(e,0,r);case"'":return gc(e,s);case"<":c=i[gc(u,1,-1)];break;default:var l=+u;if(0===l)return o;if(l>a){var h=hc(l/10);return 0===h?o:h<=a?void 0===n[h-1]?pc(u,1):n[h-1]+pc(u,1):o}c=n[l-1]}return void 0===c?"":c}))},Tc=xu,Ac=Yt("replace"),Lc=Math.max,zc=Math.min,jc=yc([].concat),Rc=yc([].push),Nc=yc("".indexOf),Bc=yc("".slice),Zc="$0"==="a".replace(/./,"$0"),Fc=!!/./[Ac]&&""===/./[Ac]("a","$0");bc("replace",(function(t,e,r){var n=Fc?"$":"$0";return[function(t,r){var n=Cc(this),i=null==t?void 0:Oc(t,Ac);return i?_c(i,t,n,r):_c(e,wc(n),t,r)},function(t,i){var o=Mc(this),s=wc(t);if("string"==typeof i&&-1===Nc(i,n)&&-1===Nc(i,"$<")){var a=r(e,o,s,i);if(a.done)return a.value}var u=Sc(i);u||(i=wc(i));var c=o.global;if(c){var l=o.unicode;o.lastIndex=0}for(var h=[];;){var p=Tc(o,s);if(null===p)break;if(Rc(h,p),!c)break;""===wc(p[0])&&(o.lastIndex=Ec(s,kc(o.lastIndex),l))}for(var f,g="",d=0,v=0;v<h.length;v++){for(var m=wc((p=h[v])[0]),_=Lc(zc(Ic(p.index),s.length),0),y=[],b=1;b<p.length;b++)Rc(y,void 0===(f=p[b])?f:String(f));var x=p.groups;if(u){var M=jc([m],y,_,s);void 0!==x&&Rc(M,x);var S=wc(mc(i,void 0,M))}else S=Pc(m,s,_,y,x,i);_>=d&&(g+=Bc(s,d,_)+S,d=_+m.length)}return g+Bc(s,d)}]}),!!xc((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!Zc||Fc);var Dc=function t(){!function(t,e){for(var r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)};function Hc(t){return Object.keys(t).reduce((function(e,r){return t[r]&&e.push(r+":"+t[r]),e}),[]).join(";")}function $c(t){return t?t+"px":void 0}var Gc=function(t){function e(e,r){var n=t.call(this)||this;return n.cluster_=e,n.styles_=r,n.center_=null,n.div_=null,n.sums_=null,n.visible_=!1,n.style=null,n.setMap(e.getMap()),n}return ms(e,t),e.prototype.onAdd=function(){var t,e,r=this,n=this.cluster_.getMarkerClusterer(),i=google.maps.version.split("."),o=i[0],s=i[1],a=100*parseInt(o,10)+parseInt(s,10);this.div_=document.createElement("div"),this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",(function(){e=t})),this.div_.addEventListener("mousedown",(function(){t=!0,e=!1})),this.div_.addEventListener("contextmenu",(function(){google.maps.event.trigger(n,"contextmenu",r.cluster_)})),a>=332&&this.div_.addEventListener("touchstart",(function(t){t.stopPropagation()})),this.div_.addEventListener("click",(function(i){if(t=!1,!e){if(google.maps.event.trigger(n,"click",r.cluster_),google.maps.event.trigger(n,"clusterclick",r.cluster_),n.getZoomOnClick()){var o=n.getMaxZoom(),s=r.cluster_.getBounds();n.getMap().fitBounds(s),setTimeout((function(){n.getMap().fitBounds(s),null!==o&&n.getMap().getZoom()>o&&n.getMap().setZoom(o+1)}),100)}i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation()}})),this.div_.addEventListener("mouseover",(function(){google.maps.event.trigger(n,"mouseover",r.cluster_)})),this.div_.addEventListener("mouseout",(function(){google.maps.event.trigger(n,"mouseout",r.cluster_)}))},e.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},e.prototype.draw=function(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}},e.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},e.prototype.show=function(){this.div_&&(this.div_.className=this.className_,this.div_.style.cssText=this.createCss_(this.getPosFromLatLng_(this.center_)),this.div_.innerHTML=(this.style.url?this.getImageElementHtml():"")+this.getLabelDivHtml(),void 0===this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""),this.visible_=!0},e.prototype.getLabelDivHtml=function(){var t=this.cluster_.getMarkerClusterer().ariaLabelFn(this.sums_.text),e={position:"absolute",top:$c(this.anchorText_[0]),left:$c(this.anchorText_[1]),color:this.style.textColor,"font-size":$c(this.style.textSize),"font-family":this.style.fontFamily,"font-weight":this.style.fontWeight,"font-style":this.style.fontStyle,"text-decoration":this.style.textDecoration,"text-align":"center",width:$c(this.style.width),"line-height":$c(this.style.textLineHeight)};return'\n<div aria-label="'.concat(t,'" style="').concat(Hc(e),'" tabindex="0">\n <span aria-hidden="true">').concat(this.sums_.text,"</span>\n</div>\n")},e.prototype.getImageElementHtml=function(){var t=(this.style.backgroundPosition||"0 0").split(" "),e=parseInt(t[0].replace(/^\s+|\s+$/g,""),10),r=parseInt(t[1].replace(/^\s+|\s+$/g,""),10),n={};if(this.cluster_.getMarkerClusterer().getEnableRetinaIcons())n={width:$c(this.style.width),height:$c(this.style.height)};else{var i=[-1*r,-1*e+this.style.width,-1*r+this.style.height,-1*e],o=i[1],s=i[2],a=i[3];n={clip:"rect(".concat(i[0],"px, ").concat(o,"px, ").concat(s,"px, ").concat(a,"px)")}}var u=this.sums_.url?{width:"100%",height:"100%"}:{},c=Hc(_s(_s({position:"absolute",top:$c(r),left:$c(e)},n),u));return'<img alt="'.concat(this.sums_.text,'" aria-hidden="true" src="').concat(this.style.url,'" style="').concat(c,'"/>')},e.prototype.useStyle=function(t){this.sums_=t;var e=Math.max(0,t.index-1);e=Math.min(this.styles_.length-1,e),this.style=this.sums_.url?_s(_s({},this.styles_[e]),{url:this.sums_.url}):this.styles_[e],this.anchorText_=this.style.anchorText||[0,0],this.anchorIcon_=this.style.anchorIcon||[Math.floor(this.style.height/2),Math.floor(this.style.width/2)],this.className_=this.cluster_.getMarkerClusterer().getClusterClass()+" "+(this.style.className||"cluster-"+e)},e.prototype.setCenter=function(t){this.center_=t},e.prototype.createCss_=function(t){return Hc({"z-index":"".concat(this.cluster_.getMarkerClusterer().getZIndex()),top:$c(t.y),left:$c(t.x),width:$c(this.style.width),height:$c(this.style.height),cursor:"pointer",position:"absolute","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-o-user-select":"none","user-select":"none"})},e.prototype.getPosFromLatLng_=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x=Math.floor(e.x-this.anchorIcon_[1]),e.y=Math.floor(e.y-this.anchorIcon_[0]),e},e}(Dc),Vc=function(){function t(t){this.markerClusterer_=t,this.map_=this.markerClusterer_.getMap(),this.minClusterSize_=this.markerClusterer_.getMinimumClusterSize(),this.averageCenter_=this.markerClusterer_.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new Gc(this,this.markerClusterer_.getStyles())}return t.prototype.getSize=function(){return this.markers_.length},t.prototype.getMarkers=function(){return this.markers_},t.prototype.getCenter=function(){return this.center_},t.prototype.getMap=function(){return this.map_},t.prototype.getMarkerClusterer=function(){return this.markerClusterer_},t.prototype.getBounds=function(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),r=0;r<e.length;r++)t.extend(e[r].getPosition());return t},t.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},t.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded_(t))return!1;if(this.center_){if(this.averageCenter_){var e=this.markers_.length+1,r=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(r,n),this.calculateBounds_()}}else this.center_=t.getPosition(),this.calculateBounds_();t.isAdded=!0,this.markers_.push(t);var i=this.markers_.length,o=this.markerClusterer_.getMaxZoom();if(null!==o&&this.map_.getZoom()>o)t.getMap()!==this.map_&&t.setMap(this.map_);else if(i<this.minClusterSize_)t.getMap()!==this.map_&&t.setMap(this.map_);else if(i===this.minClusterSize_)for(var s=0;s<i;s++)this.markers_[s].setMap(null);else t.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},t.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},t.prototype.updateIcon=function(){var t=this.markers_.length,e=this.markerClusterer_.getMaxZoom();if(null!==e&&this.map_.getZoom()>e)this.clusterIcon_.hide();else if(t<this.minClusterSize_)this.clusterIcon_.hide();else{var r=this.markerClusterer_.getStyles().length,n=this.markerClusterer_.getCalculator()(this.markers_,r);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(n),this.clusterIcon_.show()}},t.prototype.isMarkerAlreadyAdded_=function(t){if(this.markers_.indexOf)return-1!==this.markers_.indexOf(t);for(var e=0;e<this.markers_.length;e++)if(t===this.markers_[e])return!0;return!1},t}(),Uc=function(t,e,r){return void 0!==t[e]?t[e]:r};return function(t){function e(r,n,i){void 0===n&&(n=[]),void 0===i&&(i={});var o=t.call(this)||this;return o.options=i,o.markers_=[],o.clusters_=[],o.listeners_=[],o.activeMap_=null,o.ready_=!1,o.ariaLabelFn=o.options.ariaLabelFn||function(){return""},o.zIndex_=o.options.zIndex||Number(google.maps.Marker.MAX_ZINDEX)+1,o.gridSize_=o.options.gridSize||60,o.minClusterSize_=o.options.minimumClusterSize||2,o.maxZoom_=o.options.maxZoom||null,o.styles_=o.options.styles||[],o.title_=o.options.title||"",o.zoomOnClick_=Uc(o.options,"zoomOnClick",!0),o.averageCenter_=Uc(o.options,"averageCenter",!1),o.ignoreHidden_=Uc(o.options,"ignoreHidden",!1),o.enableRetinaIcons_=Uc(o.options,"enableRetinaIcons",!1),o.imagePath_=o.options.imagePath||e.IMAGE_PATH,o.imageExtension_=o.options.imageExtension||e.IMAGE_EXTENSION,o.imageSizes_=o.options.imageSizes||e.IMAGE_SIZES,o.calculator_=o.options.calculator||e.CALCULATOR,o.batchSize_=o.options.batchSize||e.BATCH_SIZE,o.batchSizeIE_=o.options.batchSizeIE||e.BATCH_SIZE_IE,o.clusterClass_=o.options.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(o.batchSize_=o.batchSizeIE_),o.setupStyles_(),o.addMarkers(n,!0),o.setMap(r),o}return ms(e,t),e.prototype.onAdd=function(){var t=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.prevZoom_=this.getMap().getZoom(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",(function(){var e=t.getMap(),r=e.minZoom||0,n=Math.min(e.maxZoom||100,e.mapTypes[e.getMapTypeId()].maxZoom),i=Math.min(Math.max(t.getMap().getZoom(),r),n);t.prevZoom_!=i&&(t.prevZoom_=i,t.resetViewport_(!1))})),google.maps.event.addListener(this.getMap(),"idle",(function(){t.redraw_()}))]},e.prototype.onRemove=function(){for(var t=0;t<this.markers_.length;t++)this.markers_[t].getMap()!==this.activeMap_&&this.markers_[t].setMap(this.activeMap_);for(t=0;t<this.clusters_.length;t++)this.clusters_[t].remove();this.clusters_=[];for(t=0;t<this.listeners_.length;t++)google.maps.event.removeListener(this.listeners_[t]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},e.prototype.draw=function(){},e.prototype.setupStyles_=function(){if(!(this.styles_.length>0))for(var t=0;t<this.imageSizes_.length;t++){var r=this.imageSizes_[t];this.styles_.push(e.withDefaultStyle({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:r,width:r}))}},e.prototype.fitMapToMarkers=function(t){for(var e=this.getMarkers(),r=new google.maps.LatLngBounds,n=0;n<e.length;n++)!e[n].getVisible()&&this.getIgnoreHidden()||r.extend(e[n].getPosition());this.getMap().fitBounds(r,t)},e.prototype.getGridSize=function(){return this.gridSize_},e.prototype.setGridSize=function(t){this.gridSize_=t},e.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},e.prototype.setMinimumClusterSize=function(t){this.minClusterSize_=t},e.prototype.getMaxZoom=function(){return this.maxZoom_},e.prototype.setMaxZoom=function(t){this.maxZoom_=t},e.prototype.getZIndex=function(){return this.zIndex_},e.prototype.setZIndex=function(t){this.zIndex_=t},e.prototype.getStyles=function(){return this.styles_},e.prototype.setStyles=function(t){this.styles_=t},e.prototype.getTitle=function(){return this.title_},e.prototype.setTitle=function(t){this.title_=t},e.prototype.getZoomOnClick=function(){return this.zoomOnClick_},e.prototype.setZoomOnClick=function(t){this.zoomOnClick_=t},e.prototype.getAverageCenter=function(){return this.averageCenter_},e.prototype.setAverageCenter=function(t){this.averageCenter_=t},e.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},e.prototype.setIgnoreHidden=function(t){this.ignoreHidden_=t},e.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},e.prototype.setEnableRetinaIcons=function(t){this.enableRetinaIcons_=t},e.prototype.getImageExtension=function(){return this.imageExtension_},e.prototype.setImageExtension=function(t){this.imageExtension_=t},e.prototype.getImagePath=function(){return this.imagePath_},e.prototype.setImagePath=function(t){this.imagePath_=t},e.prototype.getImageSizes=function(){return this.imageSizes_},e.prototype.setImageSizes=function(t){this.imageSizes_=t},e.prototype.getCalculator=function(){return this.calculator_},e.prototype.setCalculator=function(t){this.calculator_=t},e.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},e.prototype.setBatchSizeIE=function(t){this.batchSizeIE_=t},e.prototype.getClusterClass=function(){return this.clusterClass_},e.prototype.setClusterClass=function(t){this.clusterClass_=t},e.prototype.getMarkers=function(){return this.markers_},e.prototype.getTotalMarkers=function(){return this.markers_.length},e.prototype.getClusters=function(){return this.clusters_},e.prototype.getTotalClusters=function(){return this.clusters_.length},e.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw_()},e.prototype.addMarkers=function(t,e){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.pushMarkerTo_(t[r]);e||this.redraw_()},e.prototype.pushMarkerTo_=function(t){var e=this;t.getDraggable()&&google.maps.event.addListener(t,"dragend",(function(){e.ready_&&(t.isAdded=!1,e.repaint())})),t.isAdded=!1,this.markers_.push(t)},e.prototype.removeMarker=function(t,e){var r=this.removeMarker_(t);return!e&&r&&this.repaint(),r},e.prototype.removeMarkers=function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=this.removeMarker_(t[n]);r=r||i}return!e&&r&&this.repaint(),r},e.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r=0;r<this.markers_.length;r++)if(t===this.markers_[r]){e=r;break}return-1!==e&&(t.setMap(null),this.markers_.splice(e,1),!0)},e.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},e.prototype.repaint=function(){var t=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout((function(){for(var e=0;e<t.length;e++)t[e].remove()}),0)},e.prototype.getExtendedBounds=function(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),i=e.fromLatLngToDivPixel(r);i.x+=this.gridSize_,i.y-=this.gridSize_;var o=e.fromLatLngToDivPixel(n);o.x-=this.gridSize_,o.y+=this.gridSize_;var s=e.fromDivPixelToLatLng(i),a=e.fromDivPixelToLatLng(o);return t.extend(s),t.extend(a),t},e.prototype.redraw_=function(){this.createClusters_(0)},e.prototype.resetViewport_=function(t){for(var e=0;e<this.clusters_.length;e++)this.clusters_[e].remove();this.clusters_=[];for(e=0;e<this.markers_.length;e++){var r=this.markers_[e];r.isAdded=!1,t&&r.setMap(null)}},e.prototype.distanceBetweenPoints_=function(t,e){var r=(e.lat()-t.lat())*Math.PI/180,n=(e.lng()-t.lng())*Math.PI/180,i=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)))},e.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},e.prototype.addToClosestCluster_=function(t){for(var e=4e4,r=null,n=0;n<this.clusters_.length;n++){var i,o=(i=this.clusters_[n]).getCenter();if(o){var s=this.distanceBetweenPoints_(o,t.getPosition());s<e&&(e=s,r=i)}}r&&r.isMarkerInClusterBounds(t)?r.addMarker(t):((i=new Vc(this)).addMarker(t),this.clusters_.push(i))},e.prototype.createClusters_=function(t){var e=this;if(this.ready_){0===t&&(google.maps.event.trigger(this,"clusteringbegin",this),void 0!==this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var r=new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()),n=this.getExtendedBounds(r),i=Math.min(t+this.batchSize_,this.markers_.length),o=t;o<i;o++){var s=this.markers_[o];!s.isAdded&&this.isMarkerInBounds_(s,n)&&(!this.ignoreHidden_||this.ignoreHidden_&&s.getVisible())&&this.addToClosestCluster_(s)}if(i<this.markers_.length)this.timerRefStatic=window.setTimeout((function(){e.createClusters_(i)}),0);else{delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this);for(o=0;o<this.clusters_.length;o++)this.clusters_[o].updateIcon()}}},e.CALCULATOR=function(t,e){for(var r=0,n=t.length,i=n;0!==i;)i=Math.floor(i/10),r++;return r=Math.min(r,e),{text:n.toString(),index:r,title:""}},e.withDefaultStyle=function(t){return _s({textColor:"black",textSize:11,textDecoration:"none",textLineHeight:t.height,fontWeight:"bold",fontStyle:"normal",fontFamily:"Arial,sans-serif",backgroundPosition:"0 0"},t)},e.BATCH_SIZE=2e3,e.BATCH_SIZE_IE=500,e.IMAGE_PATH="../images/m",e.IMAGE_EXTENSION="png",e.IMAGE_SIZES=[53,56,66,78,90],e}(Dc)}();
13
+ //# sourceMappingURL=index.min.js.map
mappress.php CHANGED
@@ -3,8 +3,9 @@
3
  Plugin Name: MapPress Maps for WordPress
4
  Plugin URI: https://www.mappresspro.com
5
  Author URI: https://www.mappresspro.com
 
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
- Version: 2.83.13
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Scott DeJonge for his wonderful icons
@@ -39,7 +40,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
39
  }
40
 
41
  class Mappress {
42
- const VERSION = '2.83.13';
43
 
44
  static
45
  $api,
@@ -798,8 +799,12 @@ class Mappress {
798
  self::$loaded = true;
799
 
800
  if ($scripts) {
 
 
 
801
  $scripts->enqueue('mappress');
802
  $scripts->localize('mappress', 'mappl10n', self::l10n());
 
803
  } else {
804
  wp_enqueue_script('mappress');
805
  wp_localize_script('mappress', 'mappl10n', self::l10n());
@@ -840,11 +845,13 @@ class Mappress {
840
 
841
  // Clustering ( https://github.com/googlemaps/js-markerclustererplus | https://github.com/Leaflet/Leaflet.markercluster )
842
  // Google's clusterer is still broken: https://github.com/googlemaps/js-markerclusterer/issues/220
 
843
  $register = array(
844
  array("mappress-leaflet", self::unpkg('leaflet', 'leaflet.js'), null, null, $footer),
845
  array("mappress-leaflet-omnivore", self::unpkg('leaflet-omnivore', 'leaflet-omnivore.min.js'), null, null, $footer),
846
  array("mappress-google", self::scripts_google_tag(), null, null, $footer),
847
- array('mappress-markerclustererplus', self::unpkg('markerclustererplus', 'index.min.js'), null, null, $footer),
 
848
  array('mappress-leaflet-markercluster', self::unpkg('leaflet.markercluster', 'leaflet.markercluster.js'), null, null, $footer),
849
  array('mappress', $js . "/index_mappress.js", $deps, self::$version, $footer),
850
  array('mappress_admin', $js . "/index_mappress_admin.js", $admin_deps, self::$version, $footer)
3
  Plugin Name: MapPress Maps for WordPress
4
  Plugin URI: https://www.mappresspro.com
5
  Author URI: https://www.mappresspro.com
6
+ Pro Update URI: https://www.mappresspro.com
7
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
8
+ Version: 2.83.17
9
  Author: Chris Richardson
10
  Text Domain: mappress-google-maps-for-wordpress
11
  Thanks to all the translators and to Scott DeJonge for his wonderful icons
40
  }
41
 
42
  class Mappress {
43
+ const VERSION = '2.83.17';
44
 
45
  static
46
  $api,
799
  self::$loaded = true;
800
 
801
  if ($scripts) {
802
+ // Some plugins add 'defer' using script_loader_tag, which interferes with script loading, so remove it
803
+ $nodefer = function ($tag, $handle) { return str_ireplace('defer="defer"', '', $tag); };
804
+ add_filter('script_loader_tag', $nodefer, 999);
805
  $scripts->enqueue('mappress');
806
  $scripts->localize('mappress', 'mappl10n', self::l10n());
807
+ remove_filter('script_loader_tag', $nodefer, 999);
808
  } else {
809
  wp_enqueue_script('mappress');
810
  wp_localize_script('mappress', 'mappl10n', self::l10n());
845
 
846
  // Clustering ( https://github.com/googlemaps/js-markerclustererplus | https://github.com/Leaflet/Leaflet.markercluster )
847
  // Google's clusterer is still broken: https://github.com/googlemaps/js-markerclusterer/issues/220
848
+ // The original Google clustered on unpkg throws warnings from google.maps.events.addDomListener, so custom version is required (for now)
849
  $register = array(
850
  array("mappress-leaflet", self::unpkg('leaflet', 'leaflet.js'), null, null, $footer),
851
  array("mappress-leaflet-omnivore", self::unpkg('leaflet-omnivore', 'leaflet-omnivore.min.js'), null, null, $footer),
852
  array("mappress-google", self::scripts_google_tag(), null, null, $footer),
853
+ //array('mappress-markerclustererplus', self::unpkg('markerclustererplus', 'index.min.js'), null, null, $footer),
854
+ array('mappress-markerclustererplus', $lib. "/js-markerclustererplus-main/modified-clusterer.js", null, '1.2.10-custom', $footer),
855
  array('mappress-leaflet-markercluster', self::unpkg('leaflet.markercluster', 'leaflet.markercluster.js'), null, null, $footer),
856
  array('mappress', $js . "/index_mappress.js", $deps, self::$version, $footer),
857
  array('mappress_admin', $js . "/index_mappress_admin.js", $admin_deps, self::$version, $footer)
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: maps, google maps, map, map markers, google map, leaflet maps, leaflet map
5
  Requires at least: 5.3
6
  Requires PHP: 5.6
7
  Tested up to: 6.0
8
- Stable tag: 2.83.13
9
 
10
  == Description ==
11
  MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
@@ -89,6 +89,20 @@ Please see the plugin documentation pages:
89
 
90
  == Changelog ==
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  = 2.83.13 =
93
  * Added: setting to allow mashup thumbnail images to come from either post or POI (mashupThumbs)
94
  * Added: fast iframes, and iframes that resize to inline (bottom) POI list layout
5
  Requires at least: 5.3
6
  Requires PHP: 5.6
7
  Tested up to: 6.0
8
+ Stable tag: 2.83.17
9
 
10
  == Description ==
11
  MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
89
 
90
  == Changelog ==
91
 
92
+ = 2.83.17 =
93
+ * Fixed: mini map class not being applied to small maps
94
+ * Fixed: other plugins break iframes by adding 'defer' to script tags
95
+
96
+ = 2.83.16 =
97
+ * Changed: prevent WP from overwriting Pro with free version
98
+
99
+ = 2.83.15 =
100
+ * Fixed: setting initialopeninfo with no map POIs causes JS error
101
+
102
+ = 2.83.14 =
103
+ * Fixed: console warnings in Google marker clusterer from deprecated google.maps.addDomEventListener
104
+ * Fixed: iframe not resizing when height is 'vh'
105
+
106
  = 2.83.13 =
107
  * Added: setting to allow mashup thumbnail images to come from either post or POI (mashupThumbs)
108
  * Added: fast iframes, and iframes that resize to inline (bottom) POI list layout
templates/iframe.html ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html class='mapp-iframe-html' lang="en-US">
3
+ <head>
4
+ <title>MapPress</title>
5
+
6
+ <!-- MapPress Easy Google Maps Version:2.83.17PRO-28648 (https://www.mappresspro.com) -->
7
+ <link rel='stylesheet' id='mappress-leaflet-css' href='https://unpkg.com/leaflet@1.7.1/dist/leaflet.css?ver=1.7.1' media='all' />
8
+ <link rel='stylesheet' id='mappress-leaflet-markercluster-default-css' href='http://localhost/dev/wp-content/plugins/mappress-google-maps-for-wordpress/lib/Leaflet.markercluster/MarkerCluster.Default.css?ver=1.4.1' media='all' />
9
+ <link rel='stylesheet' id='mappress-leaflet-markercluster-css' href='http://localhost/dev/wp-content/plugins/mappress-google-maps-for-wordpress/lib/Leaflet.markercluster/MarkerCluster.css?ver=1.4.1' media='all' />
10
+ <link rel='stylesheet' id='mappress-css' href='http://localhost/dev/wp-content/plugins/mappress-google-maps-for-wordpress/css/mappress.css?ver=2.83.17PRO-28648' media='all' />
11
+ </head>
12
+ <body class='mapp-iframe-body'>
13
+ <div class='mapp-iframe-content'></div>
14
+ <script src='https://unpkg.com/leaflet@1.7.1/dist/leaflet.js' id='mappress-leaflet-js'></script>
15
+ <script src='https://unpkg.com/leaflet-omnivore@0.3.4/leaflet-omnivore.min.js' id='mappress-leaflet-omnivore-js'></script>
16
+ <script src='http://localhost/dev/wp-includes/js/underscore.min.js?ver=1.13.3' id='underscore-js'></script>
17
+ <script src='http://localhost/dev/wp-includes/js/dist/vendor/regenerator-runtime.min.js?ver=0.13.9' id='regenerator-runtime-js'></script>
18
+ <script src='http://localhost/dev/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=3.15.0' id='wp-polyfill-js'></script>
19
+ <script src='http://localhost/dev/wp-content/plugins/gutenberg/build/hooks/index.min.js?ver=da24a732bf5c2bfffa4b' id='wp-hooks-js'></script>
20
+ <script src='http://localhost/dev/wp-content/plugins/gutenberg/build/i18n/index.min.js?ver=6fdf6f309c3796e73a49' id='wp-i18n-js'></script>
21
+ <script id='wp-i18n-js-after'>
22
+ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } );
23
+ </script>
24
+ <script src='http://localhost/dev/wp-content/plugins/gutenberg/build/vendors/react.min.js?ver=6.0.1' id='react-js'></script>
25
+ <script src='http://localhost/dev/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.0.1' id='react-dom-js'></script>
26
+ <script src='http://localhost/dev/wp-content/plugins/gutenberg/build/escape-html/index.min.js?ver=fbad781820bda8333f76' id='wp-escape-html-js'></script>
27
+ <script src='http://localhost/dev/wp-content/plugins/gutenberg/build/element/index.min.js?ver=76061f8671b9f454d217' id='wp-element-js'></script>
28
+ <script src='https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster.js' id='mappress-leaflet-markercluster-js'></script>
29
+ <script id='mappress-js-extra'>
30
+ var mappl10n = {"delete_prompt":"Are you sure you want to delete?","delete_map_prompt":"Permanently delete this map?","kml_error":"Error reading KML file","layer":"URL for KML file","need_classic":"Please select an editor to insert into.","no_geolocate":"Unable to get your location","no_results":"No results","save":"Save changes?","shape":"Shape","options":{"admin":true,"adminurl":"http:\/\/localhost\/dev\/wp-admin\/","ajaxurl":"http:\/\/localhost\/dev\/wp-admin\/admin-ajax.php","apikey":"AIzaSyC2Z-o0McyTviQ_p4jcYOFE_BxqqegI170","baseurl":"http:\/\/localhost\/dev\/wp-content\/plugins\/mappress-google-maps-for-wordpress","blockCategory":"text","debug":true,"editurl":"http:\/\/localhost\/dev\/wp-admin\/post.php","iconsUrl":"http:\/\/localhost\/dev\/wp-content\/uploads\/mappress\/icons\/","isIE":false,"language":"en","mapbox":"pk.eyJ1IjoieW91a3VudHUiLCJhIjoiY2txNDA4Z2xmMDI5OTJvczBvenJvMWpvNSJ9.lMBHKFkWBCkQS4zgMLFJzg","nonce":"55e79bcb35","oid":2537,"otype":"post","pro":true,"ssl":true,"standardIcons":["blue-dot","ltblue-dot","green-dot","pink-dot","purple-dot","red-dot","yellow-dot","blue","green","lightblue","pink","purple","red","yellow","blue-pushpin","grn-pushpin","ltblu-pushpin","pink-pushpin","purple-pushpin","red-pushpin","ylw-pushpin","bar","coffeehouse","man","wheel_chair_accessible","woman","restaurant","snack_bar","parkinglot","bus","cabs","ferry","helicopter","plane","rail","subway","tram","truck","info","info_circle","rainy","sailing","ski","snowflake_simple","swimming","water","fishing","flag","marina","campfire","campground","cycling","golfer","hiker","horsebackriding","motorcycling","picnic","POI","rangerstation","sportvenue","toilets","trail","tree","arts","conveniencestore","dollar","electronics","euro","gas","grocerystore","homegardenbusiness","mechanic","movies","realestate","salon","shopping","yen","caution","earthquake","fallingrocks","firedept","hospitals","lodging","phone","partly_cloudy","police","postoffice-us","sunny","volcano","camera","webcam","iimm1-blue","iimm1-green","iimm1-orange","iimm1-red","iimm2-blue","iimm2-green","iimm2-orange","iimm2-red"],"standardIconsUrl":"http:\/\/localhost\/dev\/wp-content\/plugins\/mappress-google-maps-for-wordpress\/pro\/standard_icons\/","userStyles":[],"userIcons":["airport.png","guard-protection-safe-3-svgrepo-com.svg"],"version":"2.83.17PRO-28648","standardStyles":[{"id":"streets","type":"standard","provider":"mapbox","user":"mapbox","mapboxid":"streets-v11","name":"Streets"},{"id":"outdoors","type":"standard","provider":"mapbox","user":"mapbox","mapboxid":"outdoors-v11","name":"Outdoors"},{"id":"light","type":"standard","provider":"mapbox","user":"mapbox","mapboxid":"light-v10","name":"Light"},{"id":"dark","type":"standard","provider":"mapbox","user":"mapbox","mapboxid":"dark-v10","name":"Dark"},{"id":"satellite","type":"standard","provider":"mapbox","user":"mapbox","mapboxid":"satellite-v9","name":"Satellite"},{"id":"satellite-streets","type":"standard","provider":"mapbox","user":"mapbox","mapboxid":"satellite-streets-v11","name":"Satellite Streets"}],"clustering":true,"defaultIcon":"guard-protection-safe-3-svgrepo-com.svg","directions":"inline","directionsList":false,"directionsPopup":true,"directionsServer":"https:\/\/maps.google.com","engine":"leaflet","filters":{"post":[{"key":"category","format":"checkbox","exclude":[],"include":["mm"]}],"user":[]},"filtersPos":"top","geocoder":"nominatim","highlight":"scale","iconScale":["",""],"layout":"left","lines":false,"lineOpts":{"color":"blue","weight":3,"opacity":1,"geodesic":true,"icons":[{"icon":{"path":"1"}}],"animate":true},"mashupClick":"poi","mini":"550","poiList":true,"poiListOpen":true,"poiListPageSize":"","poiZoom":"16","radius":15,"scrollWheel":true,"search":true,"size":0,"sizes":[{"width":"100%","height":"350px"},{"width":"50%","height":"50%"},{"width":"75%","height":"50%"},{"width":"100%","height":"50%"},{"width":"100vw","height":"100vh"}],"thumbHeight":"","thumbWidth":"","thumbs":true,"thumbsList":"","thumbsPopup":"top","tooltips":true,"userLocation":false}};
31
+ </script>
32
+ <script src='https://localhost/dev/wp-content/plugins/mappress-google-maps-for-wordpress/build/index_mappress.js?ver=2.83.17PRO-28648' id='mappress-js'></script>
33
+ <script type='text/html' id='mapp-tmpl-map-item'><img class="mapp-icon" src="{{{poi.icon}}}"><div class="mapp-title">{{{poi.title}}}</div></script><script type='text/html' id='mapp-tmpl-map-popup'><div class='mapp-title'>{{{poi.title}}}</div><div class='mapp-body'>{{{poi.body}}}</div></script><script type='text/html' id='mapp-tmpl-mashup-popup'><div class='mapp-title'><a href='{{{poi.url}}}' target='_blank'>{{{poi.title}}}</a></div><div class='mapp-body'>{{{poi.body}}}</div></script><script type='text/html' id='mapp-tmpl-mashup-item'><img class="mapp-icon" src="{{{poi.icon}}}"><div class="mapp-title">{{{poi.title}}}</div></script><script type='text/html' id='mapp-tmpl-user-mashup-item'><div class="mapp-title">{{{poi.name}}}</div></script><script type='text/html' id='mapp-tmpl-user-mashup-popup'><div class='mapp-title'>{{{poi.name}}}</div><div class='mapp-body'><div>{{{poi.address}}}</div><div><a href='mailto://{{{poi.email}}}' target='_blank'>{{{poi.email}}}</a></div></div></script> <script type='javascript'>if (typeof mappload != 'undefined') { mappload(); };</script>
34
+ </body>
35
+ </html>
36
+