PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
wp-google-maps-pro
/
js
/
v8
jQuery(function($){var key,core={MARKER_PULL_DATABASE:"0",MARKER_PULL_XML:"1",PAGE_MAP_LIST:"map-list",PAGE_MAP_EDIT:"map-edit",PAGE_SETTINGS:"map-settings",PAGE_SUPPORT:"map-support",PAGE_CATEGORIES:"categories",PAGE_ADVANCED:"advanced",PAGE_CUSTOM_FIELDS:"custom-fields",maps:[],events:null,settings:null,restAPI:null,localized_strings:null,loadingHTML:'<div class="wpgmza-preloader"><div class="wpgmza-loader">...</div></div>',preloaderHTML:"<div class='wpgmza-preloader'><div></div><div></div><div></div><div></div></div>",getCurrentPage:function(){switch(WPGMZA.getQueryParamValue("page")){case"wp-google-maps-menu":return window.location.href.match(/action=edit/)&&window.location.href.match(/map_id=\d+/)?WPGMZA.PAGE_MAP_EDIT:WPGMZA.PAGE_MAP_LIST;case"wp-google-maps-menu-settings":return WPGMZA.PAGE_SETTINGS;case"wp-google-maps-menu-support":return WPGMZA.PAGE_SUPPORT;case"wp-google-maps-menu-categories":return WPGMZA.PAGE_CATEGORIES;case"wp-google-maps-menu-advanced":return WPGMZA.PAGE_ADVANCED;case"wp-google-maps-menu-custom-fields":return WPGMZA.PAGE_CUSTOM_FIELDS;default:return null}},getScrollAnimationOffset:function(){return(WPGMZA.settings.scroll_animation_offset||0)+($("#wpadminbar").height()||0)},getScrollAnimationDuration:function(){return WPGMZA.settings.scroll_animation_milliseconds||500},animateScroll:function(element,milliseconds){var offset=WPGMZA.getScrollAnimationOffset();milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$("html, body").animate({scrollTop:$(element).offset().top-offset},milliseconds)},extend:function(child,parent){var constructor=child;child.prototype=Object.create(parent.prototype),child.prototype.constructor=constructor},guid:function(){var d=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(d+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)})},hexOpacityToRGBA:function(hex,opacity){hex=parseInt(hex.replace(/^#/,""),16);return[(16711680&hex)>>16,(65280&hex)>>8,255&hex,parseFloat(opacity)]},hexOpacityToString:function(colour,arr){arr=WPGMZA.hexOpacityToRGBA(colour,arr);return"rgba("+arr[0]+", "+arr[1]+", "+arr[2]+", "+arr[3]+")"},hexToRgba:function(c){return/^#([A-Fa-f0-9]{3}){1,2}$/.test(c)?(3==(c=c.substring(1).split("")).length&&(c=[c[0],c[0],c[1],c[1],c[2],c[2]]),{r:(c="0x"+c.join(""))>>16&255,g:c>>8&255,b:255&c,a:1}):0},rgbaToString:function(rgba){return"rgba("+rgba.r+", "+rgba.g+", "+rgba.b+", "+rgba.a+")"},latLngRegexp:/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,isLatLngString:function(m){if("string"!=typeof m)return null;m.match(/^\(.+\)$/)&&(m=m.replace(/^\(|\)$/,""));m=m.match(WPGMZA.latLngRegexp);return m?new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])}):null},stringToLatLng:function(result){result=WPGMZA.isLatLngString(result);if(!result)throw new Error("Not a valid latLng");return result},isHexColorString:function(str){return"string"==typeof str&&!!str.match(/#[0-9A-F]{6}/i)},imageDimensionsCache:{},getImageDimensions:function(src,callback){var img;WPGMZA.imageDimensionsCache[src]?callback(WPGMZA.imageDimensionsCache[src]):((img=document.createElement("img")).onload=function(event){var result={width:img.width,height:img.height};WPGMZA.imageDimensionsCache[src]=result,callback(result)},img.src=src)},decodeEntities:function(input){return input.replace(/&(nbsp|amp|quot|lt|gt);/g,function(m,e){return m[e]}).replace(/&#(\d+);/gi,function(m,e){return String.fromCharCode(parseInt(e,10))})},isDeveloperMode:function(){return this.settings.developer_mode||window.Cookies&&window.Cookies.get("wpgmza-developer-mode")},isProVersion:function(){return"1"==this._isProVersion},openMediaDialog:function(callback){var file_frame;if(file_frame)return file_frame.uploader.uploader.param("post_id",set_to_post_id),void file_frame.open();(file_frame=wp.media.frames.file_frame=wp.media({title:"Select a image to upload",button:{text:"Use this image"},multiple:!1})).on("select",function(){attachment=file_frame.state().get("selection").first().toJSON(),callback(attachment.id,attachment.url)}),file_frame.open()},getCurrentPosition:function(callback,error,watch){var options,nativeFunction="getCurrentPosition";WPGMZA.userLocationDenied?error&&error({code:1,message:"Location unavailable"}):(watch&&(nativeFunction="watchPosition"),navigator.geolocation?(options={enableHighAccuracy:!0},navigator.geolocation[nativeFunction]?navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){options.enableHighAccuracy=!1,navigator.geolocation[nativeFunction](function(position){callback&&callback(position),WPGMZA.events.trigger("userlocationfound")},function(err){console.warn(err.code,err.message),1==err.code&&(WPGMZA.userLocationDenied=!0),error&&error(err)},options)},options):console.warn(nativeFunction+" is not available")):console.warn("No geolocation available on this device"))},watchPosition:function(callback,error){return WPGMZA.getCurrentPosition(callback,error,!0)},runCatchableTask:function(callback,friendlyErrorContainer){if(WPGMZA.isDeveloperMode())callback();else try{callback()}catch(e){var friendlyError=new WPGMZA.FriendlyError(e);$(friendlyErrorContainer).html(""),$(friendlyErrorContainer).append(friendlyError.element),$(friendlyErrorContainer).show()}},capitalizeWords:function(string){return(string+"").replace(/^(.)|\s+(.)/g,function(m){return m.toUpperCase()})},pluralize:function(string){return WPGMZA.singularize(string)+"s"},singularize:function(string){return string.replace(/s$/,"")},assertInstanceOf:function(instance,fullInstanceName){var pro=WPGMZA.isProVersion()?"Pro":"",engine="open-layers"===WPGMZA.settings.engine?"OL":"Google",fullInstanceName=WPGMZA[engine+pro+fullInstanceName]&&engine+fullInstanceName!="OLFeature"?engine+pro+fullInstanceName:WPGMZA[pro+fullInstanceName]?pro+fullInstanceName:WPGMZA[engine+fullInstanceName]&&WPGMZA[engine+fullInstanceName].prototype?engine+fullInstanceName:fullInstanceName;if("OLFeature"!=fullInstanceName&&!(instance instanceof WPGMZA[fullInstanceName]))throw new Error("Object must be an instance of "+fullInstanceName+" (did you call a constructor directly, rather than createInstance?)")},getMapByID:function(id){for(var i=0;i<WPGMZA.maps.length;i++)if(WPGMZA.maps[i].id==id)return WPGMZA.maps[i];return null},isGoogleAutocompleteSupported:function(){return!!window.google&&(!!google.maps&&(!!google.maps.places&&(!!google.maps.places.Autocomplete&&(!WPGMZA.CloudAPI||!WPGMZA.CloudAPI.isBeingUsed))))},googleAPIStatus:window.wpgmza_google_api_status,isSafari:function(){var ua=navigator.userAgent.toLowerCase();return ua.match(/safari/i)&&!ua.match(/chrome/i)},isTouchDevice:function(){return"ontouchstart"in window},isDeviceiOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},isModernComponentStyleAllowed:function(){return!WPGMZA.settings.user_interface_style||"legacy"==WPGMZA.settings.user_interface_style||"modern"==WPGMZA.settings.user_interface_style},isElementInView:function(elementBottom){var pageTop=$(window).scrollTop(),pageBottom=pageTop+$(window).height(),elementTop=$(elementBottom).offset().top,elementBottom=elementTop+$(elementBottom).height();return elementTop<pageTop&&pageBottom<elementBottom||(pageTop<=elementTop&&elementTop<=pageBottom||pageTop<=elementBottom&&elementBottom<=pageBottom)},isFullScreen:function(){return wpgmzaisFullScreen},getQueryParamValue:function(m){m=new RegExp(m+"=([^&#]*)");return(m=window.location.href.match(m))?decodeURIComponent(m[1]):null},notification:function(text,time){switch(arguments.length){case 0:text="",time=4e3;break;case 1:time=4e3}var html='<div class="wpgmza-popup-notification">'+text+"</div>";jQuery("body").append(html),setTimeout(function(){jQuery("body").find(".wpgmza-popup-notification").remove()},time)},initMaps:function(){$(document.body).find(".wpgmza_map:not(.wpgmza-initialized)").each(function(index,el){if(el.wpgmzaMap)console.warn("Element missing class wpgmza-initialized but does have wpgmzaMap property. No new instance will be created");else try{el.wpgmzaMap=WPGMZA.Map.createInstance(el)}catch(ex){console.warn("Map initalization: "+ex)}}),WPGMZA.Map.nextInitTimeoutID=setTimeout(WPGMZA.initMaps,3e3)},onScroll:function(){$(".wpgmza_map").each(function(index,el){var isInView=WPGMZA.isElementInView(el);el.wpgmzaScrollIntoViewTriggerFlag?isInView||(el.wpgmzaScrollIntoViewTriggerFlag=!1):isInView&&($(el).trigger("mapscrolledintoview.wpgmza"),el.wpgmzaScrollIntoViewTriggerFlag=!0)})}},wpgmzaisFullScreen=!1;for(key in[]){console.warn("It appears that the built in JavaScript Array has been extended, this can create issues with for ... in loops, which may cause failure.");break}for(key in window.WPGMZA?window.WPGMZA=$.extend(window.WPGMZA,core):window.WPGMZA=core,window.uc&&window.uc.reloadOnOptIn&&(window.uc.reloadOnOptIn("S1pcEj_jZX"),window.uc.reloadOnOptOut("S1pcEj_jZX")),WPGMZA_localized_data){var value=WPGMZA_localized_data[key];WPGMZA[key]=value}WPGMZA.settings.useLegacyGlobals=!0,$(document).on("fullscreenchange",function(){wpgmzaisFullScreen=!!document.fullscreenElement}),$("body").on("click","#wpgmzaCloseChat",function(e){e.preventDefault(),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_hide_chat",nonce:WPGMZA_localized_data.ajaxnonce}}),$(".wpgmza-chat-help").remove()}),$(window).on("scroll",WPGMZA.onScroll),$(document.body).on("click","button.wpgmza-api-consent",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()}),$(document.body).on("keydown",function(event){event.altKey&&(WPGMZA.altKeyDown=!0)}),$(document.body).on("keyup",function(event){event.altKey||(WPGMZA.altKeyDown=!1)}),$(document.body).on("preinit.wpgmza",function(){$(window).trigger("ready.wpgmza"),$("script[src*='wp-google-maps.combined.js'], script[src*='wp-google-maps-pro.combined.js']").length&&console.warn("Minified script is out of date, using combined script instead.");var warning=$("script[src]").filter(function(){return this.src.match(/(^|\/)jquery\.(min\.)?js(\?|$)/i)});1<warning.length&&console.warn("Multiple jQuery versions detected: ",warning);for(var key in[]){console.warn("The Array object has been extended incorrectly by your theme or another plugin. This can cause issues with functionality.");break}"https:"!=window.location.protocol&&(warning='<div class="notice notice-warning"><p>'+WPGMZA.localized_strings.unsecure_geolocation+"</p></div>",$(".wpgmza-geolocation-setting").first().after($(warning))),WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code&&jQuery(".wpgmza-gdpr-compliance").length<=0&&$("button.wpgmza-api-consent").on("click",function(event){Cookies.set("wpgmza-api-consent-given",!0),window.location.reload()})}),function($){$(function(){WPGMZA.restAPI=WPGMZA.RestAPI.createInstance(),WPGMZA.CloudAPI&&(WPGMZA.cloudAPI=WPGMZA.CloudAPI.createInstance()),$(document.body).trigger("preinit.wpgmza"),WPGMZA.initMaps(),WPGMZA.onScroll()})}($)}),jQuery(function($){WPGMZA.Compatibility=function(){this.preventDocumentWriteGoogleMapsAPI()},WPGMZA.Compatibility.prototype.preventDocumentWriteGoogleMapsAPI=function(){var old=document.write;document.write=function(content){content.match&&content.match(/maps\.google/)||old.call(document,content)}},WPGMZA.compatiblityModule=new WPGMZA.Compatibility}),function(root,factory){"object"==typeof exports?module.exports=factory(root):"function"==typeof define&&define.amd?define([],factory.bind(root,root)):factory(root)}("undefined"!=typeof global?global:this,function(root){if(root.CSS&&root.CSS.escape)return root.CSS.escape;function cssEscape(value){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var codeUnit,string=String(value),length=string.length,index=-1,result="",firstCodeUnit=string.charCodeAt(0);++index<length;)0!=(codeUnit=string.charCodeAt(index))?result+=1<=codeUnit&&codeUnit<=31||127==codeUnit||0==index&&48<=codeUnit&&codeUnit<=57||1==index&&48<=codeUnit&&codeUnit<=57&&45==firstCodeUnit?"\\"+codeUnit.toString(16)+" ":(0!=index||1!=length||45!=codeUnit)&&(128<=codeUnit||45==codeUnit||95==codeUnit||48<=codeUnit&&codeUnit<=57||65<=codeUnit&&codeUnit<=90||97<=codeUnit&&codeUnit<=122)?string.charAt(index):"\\"+string.charAt(index):result+="�";return result}return root.CSS||(root.CSS={}),root.CSS.escape=cssEscape}),jQuery(function($){Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Distance={MILES:!0,KILOMETERS:!1,MILES_PER_KILOMETER:.621371,KILOMETERS_PER_MILE:1.60934,uiToMeters:function(uiDistance){return parseFloat(uiDistance)/(WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?WPGMZA.Distance.MILES_PER_KILOMETER:1)*1e3},uiToKilometers:function(uiDistance){return.001*WPGMZA.Distance.uiToMeters(uiDistance)},uiToMiles:function(uiDistance){return WPGMZA.Distance.uiToKilometers(uiDistance)*WPGMZA.Distance.MILES_PER_KILOMETER},kilometersToUI:function(km){return WPGMZA.settings.distance_units==WPGMZA.Distance.MILES?km*WPGMZA.Distance.MILES_PER_KILOMETER:km},between:function(a,dLat){if(!(a instanceof WPGMZA.LatLng||"lat"in a&&"lng"in a))throw new Error("First argument must be an instance of WPGMZA.LatLng or a literal");if(!(dLat instanceof WPGMZA.LatLng||"lat"in dLat&&"lng"in dLat))throw new Error("Second argument must be an instance of WPGMZA.LatLng or a literal");if(a===dLat)return 0;var lat1=a.lat,dLon=a.lng,lat2=dLat.lat,lon2=dLat.lng,dLat=deg2rad(lat2-lat1),dLon=deg2rad(lon2-dLon),a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(dLon/2)*Math.sin(dLon/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}}),jQuery(function($){WPGMZA.EliasFano=function(){if(!WPGMZA.EliasFano.isSupported)throw new Error("Elias Fano encoding is not supported on browsers without Uint8Array");WPGMZA.EliasFano.decodingTablesInitialised||WPGMZA.EliasFano.createDecodingTable()},WPGMZA.EliasFano.isSupported="Uint8Array"in window,WPGMZA.EliasFano.decodingTableHighBits=[],WPGMZA.EliasFano.decodingTableDocIDNumber=null,WPGMZA.EliasFano.decodingTableHighBitsCarryover=null,WPGMZA.EliasFano.createDecodingTable=function(){WPGMZA.EliasFano.decodingTableDocIDNumber=new Uint8Array(256),WPGMZA.EliasFano.decodingTableHighBitsCarryover=new Uint8Array(256);for(var decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,i=0;i<256;i++){var zeroCount=0;decodingTableHighBits[i]=[];for(var j=7;0<=j;j--)zeroCount=0<(i&1<<j)?(decodingTableHighBits[i][decodingTableDocIDNumber[i]]=zeroCount,decodingTableDocIDNumber[i]++,0):(zeroCount+1)%255;decodingTableHighBitsCarryover[i]=zeroCount}WPGMZA.EliasFano.decodingTablesInitialised=!0},WPGMZA.EliasFano.prototype.encode=function(list){var lastDocID=0,buffer1=0,bufferLength1=0,buffer2=0,bufferLength2=0;if(0==list.length)return result;var compressedBufferPointer1=0,compressedBufferPointer2=0,maxCompressedSize=list[list.length-1]/list.length,averageDeltaLog=Math.log2(maxCompressedSize),lowBitsLength=Math.floor(averageDeltaLog),lowBitsMask=(1<<lowBitsLength)-1,prev=null,maxCompressedSize=Math.floor((2+Math.ceil(Math.log2(maxCompressedSize)))*list.length/8)+6,compressedBuffer=new Uint8Array(maxCompressedSize);lowBitsLength<0&&(lowBitsLength=0),compressedBufferPointer2=Math.floor(lowBitsLength*list.length/8+6),compressedBuffer[compressedBufferPointer1++]=255&list.length,compressedBuffer[compressedBufferPointer1++]=255&list.length>>8,compressedBuffer[compressedBufferPointer1++]=255&list.length>>16,compressedBuffer[compressedBufferPointer1++]=255&list.length>>24,compressedBuffer[compressedBufferPointer1++]=255&lowBitsLength,list.forEach(function(docID){var unaryCodeLength=docID-lastDocID-1;if(!$.isNumeric(docID))throw new Error("Value is not numeric");if(docID=parseInt(docID),null!==prev&&docID<=prev)throw new Error("Elias Fano encoding can only be used on a sorted, ascending list of unique integers.");for(prev=docID,buffer1<<=lowBitsLength,buffer1|=unaryCodeLength&lowBitsMask,bufferLength1+=lowBitsLength;7<bufferLength1;)bufferLength1-=8,compressedBuffer[compressedBufferPointer1++]=255&buffer1>>bufferLength1;unaryCodeLength=1+(unaryCodeLength>>lowBitsLength);for(buffer2<<=unaryCodeLength,buffer2|=1,bufferLength2+=unaryCodeLength;7<bufferLength2;)bufferLength2-=8,compressedBuffer[compressedBufferPointer2++]=255&buffer2>>bufferLength2;lastDocID=docID}),0<bufferLength1&&(compressedBuffer[compressedBufferPointer1++]=255&buffer1<<8-bufferLength1),0<bufferLength2&&(compressedBuffer[compressedBufferPointer2++]=255&buffer2<<8-bufferLength2);var result=new Uint8Array(compressedBuffer);return result.pointer=compressedBufferPointer2,result},WPGMZA.EliasFano.prototype.decode=function(compressedBuffer){var docIDNumber,resultPointer=0,list=[],decodingTableHighBits=WPGMZA.EliasFano.decodingTableHighBits,decodingTableDocIDNumber=WPGMZA.EliasFano.decodingTableDocIDNumber,decodingTableHighBitsCarryover=WPGMZA.EliasFano.decodingTableHighBitsCarryover,lowBitsPointer=0,lastDocID=0,docID=0,listCount=compressedBuffer[lowBitsPointer++];listCount|=compressedBuffer[lowBitsPointer++]<<8,listCount|=compressedBuffer[lowBitsPointer++]<<16,listCount|=compressedBuffer[lowBitsPointer++]<<24;for(var lowBitsLength=compressedBuffer[lowBitsPointer++],lowBitsCount=0,lowBits=0,cb=1,highBitsPointer=Math.floor(lowBitsLength*listCount/8+6);highBitsPointer<compressedBuffer.pointer;highBitsPointer++){docID+=decodingTableHighBitsCarryover[cb],docIDNumber=decodingTableDocIDNumber[cb=compressedBuffer[highBitsPointer]];for(var i=0;i<docIDNumber;i++){for(docID<<=lowBitsCount,docID|=lowBits&(1<<lowBitsCount)-1;lowBitsCount<lowBitsLength;)docID<<=8,docID|=lowBits=compressedBuffer[lowBitsPointer++],lowBitsCount+=8;docID>>=lowBitsCount-=lowBitsLength,docID+=(decodingTableHighBits[cb][i]<<lowBitsLength)+lastDocID+1,lastDocID=list[resultPointer++]=docID,docID=0}}return list}}),jQuery(function($){WPGMZA.EventDispatcher=function(){WPGMZA.assertInstanceOf(this,"EventDispatcher"),this._listenersByType={}},WPGMZA.EventDispatcher.prototype.addEventListener=function(obj,listener,thisObject,useCapture){var types=obj.split(/\s+/);if(1<types.length)for(var i=0;i<types.length;i++)this.addEventListener(types[i],listener,thisObject,useCapture);else{if(!(listener instanceof Function))throw new Error("Listener must be a function");var target=this._listenersByType.hasOwnProperty(obj)?this._listenersByType[obj]:this._listenersByType[obj]=[],obj={listener:listener,thisObject:thisObject||this,useCapture:!!useCapture};target.push(obj)}},WPGMZA.EventDispatcher.prototype.on=WPGMZA.EventDispatcher.prototype.addEventListener,WPGMZA.EventDispatcher.prototype.removeEventListener=function(type,listener,thisObject,useCapture){var arr,obj;if(arr=this._listenersByType[type]){thisObject=thisObject||this,useCapture=!!useCapture;for(var i=0;i<arr.length;i++)if(obj=arr[i],(1==arguments.length||obj.listener==listener)&&obj.thisObject==thisObject&&obj.useCapture==useCapture)return void arr.splice(i,1)}},WPGMZA.EventDispatcher.prototype.off=WPGMZA.EventDispatcher.prototype.removeEventListener,WPGMZA.EventDispatcher.prototype.hasEventListener=function(type){return!!_listenersByType[type]},WPGMZA.EventDispatcher.prototype.dispatchEvent=function(event){if(!(event instanceof WPGMZA.Event))if("string"==typeof event)event=new WPGMZA.Event(event);else{var name,src=event;for(name in event=new WPGMZA.Event,src)event[name]=src[name]}for(var path=[],obj=(event.target=this).parent;null!=obj;obj=obj.parent)path.unshift(obj);event.phase=WPGMZA.Event.CAPTURING_PHASE;for(var i=0;i<path.length&&!event._cancelled;i++)path[i]._triggerListeners(event);if(!event._cancelled){for(event.phase=WPGMZA.Event.AT_TARGET,this._triggerListeners(event),event.phase=WPGMZA.Event.BUBBLING_PHASE,i=path.length-1;0<=i&&!event._cancelled;i--)path[i]._triggerListeners(event);for(var topMostElement=this.element,obj=this.parent;null!=obj;obj=obj.parent)obj.element&&(topMostElement=obj.element);if(topMostElement){var key,customEvent={};for(key in event){var value=event[key];"type"==key&&(value+=".wpgmza"),customEvent[key]=value}$(topMostElement).trigger(customEvent)}}},WPGMZA.EventDispatcher.prototype.trigger=WPGMZA.EventDispatcher.prototype.dispatchEvent,WPGMZA.EventDispatcher.prototype._triggerListeners=function(event){var arr,obj;if(arr=this._listenersByType[event.type])for(var i=0;i<arr.length;i++)obj=arr[i],event.phase==WPGMZA.Event.CAPTURING_PHASE&&!obj.useCapture||obj.listener.call(arr[i].thisObject,event)},WPGMZA.events=new WPGMZA.EventDispatcher}),jQuery(function($){WPGMZA.AddressInput=function(element,map){if(!(element instanceof HTMLInputElement))throw new Error("Element is not an instance of HTMLInputElement");var json;this.element=element;var options={fields:["name","formatted_address"],types:["geocode","establishment"]};(json=$(element).attr("data-autocomplete-options"))&&(options=$.extend(options,JSON.parse(json))),map&&map.settings.wpgmza_store_locator_restrict&&(options.country=map.settings.wpgmza_store_locator_restrict),WPGMZA.isGoogleAutocompleteSupported()?"wpgmza_add_address_map_editor"!=this.id&&WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey&&(element.googleAutoComplete=new google.maps.places.Autocomplete(element,options),options.country&&element.googleAutoComplete.setComponentRestrictions({country:options.country})):WPGMZA.CloudAPI&&WPGMZA.CloudAPI.isBeingUsed&&(element.cloudAutoComplete=new WPGMZA.CloudAutocomplete(element,options))},WPGMZA.extend(WPGMZA.AddressInput,WPGMZA.EventDispatcher),WPGMZA.AddressInput.createInstance=function(element,map){return new WPGMZA.AddressInput(element,map)}}),jQuery(function($){WPGMZA.DrawingManager=function(map){WPGMZA.assertInstanceOf(this,"DrawingManager"),WPGMZA.EventDispatcher.call(this),this.map=map,this.mode=WPGMZA.DrawingManager.MODE_NONE},WPGMZA.DrawingManager.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.DrawingManager.prototype.constructor=WPGMZA.DrawingManager,WPGMZA.DrawingManager.MODE_NONE=null,WPGMZA.DrawingManager.MODE_MARKER="marker",WPGMZA.DrawingManager.MODE_POLYGON="polygon",WPGMZA.DrawingManager.MODE_POLYLINE="polyline",WPGMZA.DrawingManager.MODE_CIRCLE="circle",WPGMZA.DrawingManager.MODE_RECTANGLE="rectangle",WPGMZA.DrawingManager.MODE_HEATMAP="heatmap",WPGMZA.DrawingManager.getConstructor=function(){return"google-maps"!==WPGMZA.settings.engine?WPGMZA.OLDrawingManager:WPGMZA.GoogleDrawingManager},WPGMZA.DrawingManager.createInstance=function(map){return new(WPGMZA.DrawingManager.getConstructor())(map)},WPGMZA.DrawingManager.prototype.setDrawingMode=function(mode){this.mode=mode,this.trigger("drawingmodechanged")}}),jQuery(function($){WPGMZA.Event=function(options){if("string"==typeof options&&(this.type=options),this.bubbles=!0,this.cancelable=!0,this.phase=WPGMZA.Event.PHASE_CAPTURE,this.target=null,this._cancelled=!1,"object"==typeof options)for(var name in options)this[name]=options[name]},WPGMZA.Event.CAPTURING_PHASE=0,WPGMZA.Event.AT_TARGET=1,WPGMZA.Event.BUBBLING_PHASE=2,WPGMZA.Event.prototype.stopPropagation=function(){this._cancelled=!0}}),jQuery(function($){WPGMZA.FancyControls={formatToggleSwitch:function(label){var div=$("<div class='switch'></div>"),input=label,container=label.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-round-flat"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)},formatToggleButton:function(label){var div=$("<div class='switch'></div>"),input=label,container=label.parentNode,text=$(container).text().trim(),label=$("<label></label>");$(input).addClass("cmn-toggle cmn-toggle-yes-no"),$(input).attr("id",$(input).attr("name")),$(label).attr("for",$(input).attr("name")),$(label).attr("data-on",WPGMZA.localized_strings.yes),$(label).attr("data-off",WPGMZA.localized_strings.no),$(div).append(input),$(div).append(label),$(container).replaceWith(div),$(div).wrap($("<div></div>")),$(div).after(text)}},$(".wpgmza-fancy-toggle-switch").each(function(index,el){WPGMZA.FancyControls.formatToggleSwitch(el)}),$(".wpgmza-fancy-toggle-button").each(function(index,el){WPGMZA.FancyControls.formatToggleButton(el)})}),jQuery(function($){WPGMZA.Feature=function(options){for(var key in WPGMZA.assertInstanceOf(this,"Feature"),WPGMZA.EventDispatcher.call(this),this.id=-1,options)this[key]=options[key]},WPGMZA.extend(WPGMZA.Feature,WPGMZA.EventDispatcher),WPGMZA.MapObject=WPGMZA.Feature,WPGMZA.Feature.prototype.parseGeometry=function(subject){if("string"==typeof subject&&subject.match(/^\[/))try{subject=JSON.parse(subject)}catch(e){}if("object"==typeof subject){for(var arr=subject,i=0;i<arr.length;i++)arr[i].lat=parseFloat(arr[i].lat),arr[i].lng=parseFloat(arr[i].lng);return arr}if("string"!=typeof subject)throw new Error("Invalid geometry");for(var coords,results=[],pairs=subject.replace(/[^ ,\d\.\-+e]/g,"").split(","),i=0;i<pairs.length;i++)coords=pairs[i].split(" "),results.push({lat:parseFloat(coords[1]),lng:parseFloat(coords[0])});return results},WPGMZA.Feature.prototype.setOptions=function(options){for(var key in options)this[key]=options[key];this.updateNativeFeature()},WPGMZA.Feature.prototype.setEditable=function(editable){this.setOptions({editable:editable})},WPGMZA.Feature.prototype.setDraggable=function(draggable){this.setOptions({draggable:draggable})},WPGMZA.Feature.prototype.getScalarProperties=function(){var key,options={};for(key in this)switch(typeof this[key]){case"number":options[key]=parseFloat(this[key]);break;case"boolean":case"string":options[key]=this[key]}return options},WPGMZA.Feature.prototype.updateNativeFeature=function(){var props=this.getScalarProperties();"open-layers"===WPGMZA.settings.engine?this.layer&&this.layer.setStyle(WPGMZA.OLFeature.getOLStyle(props)):this.googleFeature.setOptions(props)}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Circle=function(options,engineCircle){WPGMZA.assertInstanceOf(this,"Circle"),this.center=new WPGMZA.LatLng,this.radius=100,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Circle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Circle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeColor",{enumerable:!0,get:function(){return this.lineColor||"#000000"},set:function(a){this.lineColor=a}}),Object.defineProperty(WPGMZA.Circle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineOpacity||0==this.lineOpacity?parseFloat(this.lineOpacity):0},set:function(a){this.lineOpacity=a}}),WPGMZA.Circle.createInstance=function(options,engineCircle){var constructor="open-layers"===WPGMZA.settings.engine?WPGMZA.OLCircle:WPGMZA.GoogleCircle;return new constructor(options,engineCircle)},WPGMZA.Circle.prototype.getCenter=function(){return this.center.clone()},WPGMZA.Circle.prototype.setCenter=function(latLng){this.center.lat=latLng.lat,this.center.lng=latLng.lng},WPGMZA.Circle.prototype.getRadius=function(){return this.radius},WPGMZA.Circle.prototype.setRadius=function(radius){this.radius=radius},WPGMZA.Circle.prototype.getMap=function(){return this.map},WPGMZA.Circle.prototype.setMap=function(map){this.map&&this.map.removeCircle(this),map&&map.addCircle(this)}}),jQuery(function($){WPGMZA.FriendlyError=function(){}}),jQuery(function($){WPGMZA.Geocoder=function(){WPGMZA.assertInstanceOf(this,"Geocoder")},WPGMZA.Geocoder.SUCCESS="success",WPGMZA.Geocoder.ZERO_RESULTS="zero-results",WPGMZA.Geocoder.FAIL="fail",WPGMZA.Geocoder.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleGeocoder:WPGMZA.OLGeocoder},WPGMZA.Geocoder.createInstance=function(){return new(WPGMZA.Geocoder.getConstructor())},WPGMZA.Geocoder.prototype.getLatLngFromAddress=function(latLng,callback){WPGMZA.isLatLngString(latLng.address)&&(latLng=latLng.address.split(/,\s*/),callback([(latLng=new WPGMZA.LatLng({lat:parseFloat(latLng[0]),lng:parseFloat(latLng[1])})).latLng=latLng],WPGMZA.Geocoder.SUCCESS))},WPGMZA.Geocoder.prototype.getAddressFromLatLng=function(options,callback){callback([new WPGMZA.LatLng(options.latLng).toString()],WPGMZA.Geocoder.SUCCESS)},WPGMZA.Geocoder.prototype.geocode=function(options,callback){if("address"in options)return this.getLatLngFromAddress(options,callback);if("latLng"in options)return this.getAddressFromLatLng(options,callback);throw new Error("You must supply either a latLng or address")}}),jQuery(function($){WPGMZA.GoogleAPIErrorHandler=function(){var _error,self=this;"google-maps"==WPGMZA.settings.engine&&("map-edit"==WPGMZA.currentPage||0==WPGMZA.is_admin&&1==WPGMZA.userCanAdministrator)&&(this.element=$(WPGMZA.html.googleMapsAPIErrorDialog),1==WPGMZA.is_admin&&this.element.find(".wpgmza-front-end-only").remove(),this.errorMessageList=this.element.find(".wpgmza-google-api-error-list"),this.templateListItem=this.element.find("li.template").remove(),this.messagesAlreadyDisplayed={},_error=console.error,console.error=function(message){self.onErrorMessage(message),_error.apply(this,arguments)},"google-maps"!=WPGMZA.settings.engine||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT||this.addErrorMessage(WPGMZA.localized_strings.no_google_maps_api_key,["https://www.wpgmaps.com/documentation/creating-a-google-maps-api-key/"]))},WPGMZA.GoogleAPIErrorHandler.prototype.onErrorMessage=function(message){var m,urls;message&&((m=message.match(/You have exceeded your (daily )?request quota for this API/))||(m=message.match(/This API project is not authorized to use this API/))||(m=message.match(/^Geocoding Service: .+/))?(urls=message.match(/http(s)?:\/\/[^\s]+/gm),this.addErrorMessage(m[0],urls)):(m=message.match(/^Google Maps.+error: (.+)\s+(http(s?):\/\/.+)/m))&&this.addErrorMessage(m[1].replace(/([A-Z])/g," $1"),[m[2]]))},WPGMZA.GoogleAPIErrorHandler.prototype.addErrorMessage=function(message,urls){var self=this;if(!this.messagesAlreadyDisplayed[message]){var li=this.templateListItem.clone();$(li).find(".wpgmza-message").html(message);var buttonContainer=$(li).find(".wpgmza-documentation-buttons"),buttonTemplate=$(li).find(".wpgmza-documentation-buttons>a");if(buttonTemplate.remove(),urls&&urls.length){for(var i=0;i<urls.length;i++){urls[i];var button=buttonTemplate.clone(),text=WPGMZA.localized_strings.documentation;button.attr("href",urls[i]),$(button).find("i").addClass("fa-external-link"),$(button).append(text)}buttonContainer.append(button)}$(this.errorMessageList).append(li),$("#wpgmza_map, .wpgmza_map").each(function(index,el){var container=$(el).find(".wpgmza-google-maps-api-error-overlay");0==container.length&&(container=$("<div class='wpgmza-google-maps-api-error-overlay'></div>")).html(self.element.html()),setTimeout(function(){$(el).append(container)},1e3)}),$(".gm-err-container").parent().css({"z-index":1}),this.messagesAlreadyDisplayed[message]=!0}},WPGMZA.googleAPIErrorHandler=new WPGMZA.GoogleAPIErrorHandler}),jQuery(function($){WPGMZA.InfoWindow=function(feature){var self=this;WPGMZA.EventDispatcher.call(this),WPGMZA.assertInstanceOf(this,"InfoWindow"),this.on("infowindowopen",function(event){self.onOpen(event)}),feature&&(this.feature=feature,this.state=WPGMZA.InfoWindow.STATE_CLOSED,feature.map?setTimeout(function(){self.onFeatureAdded(event)},100):feature.addEventListener("added",function(event){self.onFeatureAdded(event)}))},WPGMZA.InfoWindow.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.InfoWindow.prototype.constructor=WPGMZA.InfoWindow,WPGMZA.InfoWindow.OPEN_BY_CLICK=1,WPGMZA.InfoWindow.OPEN_BY_HOVER=2,WPGMZA.InfoWindow.STATE_OPEN="open",WPGMZA.InfoWindow.STATE_CLOSED="closed",WPGMZA.InfoWindow.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProInfoWindow:WPGMZA.GoogleInfoWindow:WPGMZA.isProVersion()?WPGMZA.OLProInfoWindow:WPGMZA.OLInfoWindow},WPGMZA.InfoWindow.createInstance=function(feature){return new(this.getConstructor())(feature)},Object.defineProperty(WPGMZA.InfoWindow.prototype,"content",{get:function(){return this.getContent()},set:function(value){this.contentHtml=value}}),WPGMZA.InfoWindow.prototype.addEditButton=function(){return"map-edit"==WPGMZA.currentPage&&this.feature instanceof WPGMZA.Marker?' <a title="Edit this marker" style="width:15px;" class="wpgmza_edit_btn" data-edit-marker-id="'+this.feature.id+'"><i class="fa fa-edit"></i></a>':""},WPGMZA.InfoWindow.prototype.workOutDistanceBetweenTwoMarkers=function(location1,distanceToDisplay){if(location1&&distanceToDisplay){distanceToDisplay=WPGMZA.Distance.between(location1,distanceToDisplay);return this.distanceUnits==WPGMZA.Distance.MILES&&(distanceToDisplay/=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(distanceToDisplay,2)}},WPGMZA.InfoWindow.prototype.getContent=function(callback){var distance,html="",extra_html="";return this.feature instanceof WPGMZA.Marker&&(this.feature.map.settings.store_locator_show_distance&&this.feature.map.storeLocator&&this.feature.map.storeLocator.state==WPGMZA.StoreLocator.STATE_APPLIED&&(distance=this.feature.getPosition(),distance=this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center,distance),extra_html+="<p>"+(this.feature.map.settings.store_locator_distance==WPGMZA.Distance.KILOMETERS?distance+WPGMZA.localized_strings.kilometers_away:distance+" "+WPGMZA.localized_strings.miles_away)+"</p>"),html=this.feature.address+extra_html),this.contentHtml&&(html=this.contentHtml),callback&&callback(html),html},WPGMZA.InfoWindow.prototype.open=function(map,feature){return this.feature=feature,!WPGMZA.settings.disable_infowindows&&"1"!=WPGMZA.settings.wpgmza_settings_disable_infowindows&&(!this.feature.disableInfoWindow&&(this.state=WPGMZA.InfoWindow.STATE_OPEN,!0))},WPGMZA.InfoWindow.prototype.close=function(){this.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(this.state=WPGMZA.InfoWindow.STATE_CLOSED,this.trigger("infowindowclose"))},WPGMZA.InfoWindow.prototype.setContent=function(options){},WPGMZA.InfoWindow.prototype.setOptions=function(options){},WPGMZA.InfoWindow.prototype.onFeatureAdded=function(){1==this.feature.settings.infoopen&&this.open()},WPGMZA.InfoWindow.prototype.onOpen=function(){}}),jQuery(function($){WPGMZA.LatLng=function(arg,lng){if(this._lat=0,(this._lng=0)!=arguments.length)if(1==arguments.length){if("string"==typeof arg){var m;if(!(m=arg.match(WPGMZA.LatLng.REGEXP)))throw new Error("Invalid LatLng string");arg={lat:m[1],lng:m[3]}}if("object"!=typeof arg||!("lat"in arg&&"lng"in arg))throw new Error("Argument must be a LatLng literal");this.lat=arg.lat,this.lng=arg.lng}else this.lat=arg,this.lng=lng},WPGMZA.LatLng.REGEXP=/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,WPGMZA.LatLng.isValid=function(obj){return"object"==typeof obj&&("lat"in obj&&"lng"in obj)},WPGMZA.LatLng.isLatLngString=function(str){return"string"==typeof str&&!!str.match(WPGMZA.LatLng.REGEXP)},Object.defineProperty(WPGMZA.LatLng.prototype,"lat",{get:function(){return this._lat},set:function(val){if(!$.isNumeric(val))throw new Error("Latitude must be numeric");this._lat=parseFloat(val)}}),Object.defineProperty(WPGMZA.LatLng.prototype,"lng",{get:function(){return this._lng},set:function(val){if(!$.isNumeric(val))throw new Error("Longitude must be numeric");this._lng=parseFloat(val)}}),WPGMZA.LatLng.fromString=function(m){if(!WPGMZA.LatLng.isLatLngString(m))throw new Error("Not a valid latlng string");m=m.match(WPGMZA.LatLng.REGEXP);return new WPGMZA.LatLng({lat:parseFloat(m[1]),lng:parseFloat(m[3])})},WPGMZA.LatLng.prototype.toString=function(){return this._lat+", "+this._lng},WPGMZA.LatLng.fromCurrentPosition=function(callback,options){options=options||{},callback&&WPGMZA.getCurrentPosition(function(position){var latLng=new WPGMZA.LatLng({lat:position.coords.latitude,lng:position.coords.longitude});options.geocodeAddress?WPGMZA.Geocoder.createInstance().getAddressFromLatLng({latLng:latLng},function(results){results.length&&(latLng.address=results[0]),callback(latLng)}):callback(latLng)})},WPGMZA.LatLng.fromGoogleLatLng=function(googleLatLng){return new WPGMZA.LatLng(googleLatLng.lat(),googleLatLng.lng())},WPGMZA.LatLng.toGoogleLatLngArray=function(arr){var result=[];return arr.forEach(function(nativeLatLng){if(!(nativeLatLng instanceof WPGMZA.LatLng||"lat"in nativeLatLng&&"lng"in nativeLatLng))throw new Error("Unexpected input");result.push(new google.maps.LatLng({lat:parseFloat(nativeLatLng.lat),lng:parseFloat(nativeLatLng.lng)}))}),result},WPGMZA.LatLng.prototype.toGoogleLatLng=function(){return new google.maps.LatLng({lat:this.lat,lng:this.lng})},WPGMZA.LatLng.prototype.toLatLngLiteral=function(){return{lat:this.lat,lng:this.lng}},WPGMZA.LatLng.prototype.moveByDistance=function(sinDelta,cosDelta){var lambda2=parseFloat(sinDelta)/6371,phi2=parseFloat(cosDelta)/180*Math.PI,sinTheta=this.lat/180*Math.PI,lambda1=this.lng/180*Math.PI,sinPhi1=Math.sin(sinTheta),y=Math.cos(sinTheta),sinDelta=Math.sin(lambda2),cosDelta=Math.cos(lambda2),sinTheta=Math.sin(phi2),lambda2=sinPhi1*cosDelta+y*sinDelta*Math.cos(phi2),phi2=Math.asin(lambda2),y=sinTheta*sinDelta*y,lambda2=cosDelta-sinPhi1*lambda2,lambda2=lambda1+Math.atan2(y,lambda2);this.lat=180*phi2/Math.PI,this.lng=180*lambda2/Math.PI},WPGMZA.LatLng.prototype.getGreatCircleDistance=function(arg1,arg2){var deltaPhi=this.lat,a=this.lng;if(1==arguments.length)phi2=new WPGMZA.LatLng(arg1);else{if(2!=arguments.length)throw new Error("Invalid number of arguments");phi2=new WPGMZA.LatLng(arg1,arg2)}var lat2=phi2.lat,lon2=phi2.lng,phi1=deltaPhi.toRadians(),phi2=lat2.toRadians(),deltaPhi=(lat2-deltaPhi).toRadians(),a=(lon2-a).toRadians(),a=Math.sin(deltaPhi/2)*Math.sin(deltaPhi/2)+Math.cos(phi1)*Math.cos(phi2)*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}}),jQuery(function($){WPGMZA.LatLngBounds=function(southWest,northEast){var other;southWest instanceof WPGMZA.LatLngBounds?(other=southWest,this.south=other.south,this.north=other.north,this.west=other.west,this.east=other.east):southWest&&northEast&&(this.south=southWest.lat,this.north=northEast.lat,this.west=southWest.lng,this.east=northEast.lng)},WPGMZA.LatLngBounds.fromGoogleLatLngBounds=function(northEast){if(!(northEast instanceof google.maps.LatLngBounds))throw new Error("Argument must be an instance of google.maps.LatLngBounds");var result=new WPGMZA.LatLngBounds,southWest=northEast.getSouthWest(),northEast=northEast.getNorthEast();return result.north=northEast.lat(),result.south=southWest.lat(),result.west=southWest.lng(),result.east=northEast.lng(),result},WPGMZA.LatLngBounds.fromGoogleLatLngBoundsLiteral=function(northEast){var result=new WPGMZA.LatLngBounds,southWest=northEast.southwest,northEast=northEast.northeast;return result.north=northEast.lat,result.south=southWest.lat,result.west=southWest.lng,result.east=northEast.lng,result},WPGMZA.LatLngBounds.prototype.isInInitialState=function(){return null==this.north&&null==this.south&&null==this.west&&null==this.east},WPGMZA.LatLngBounds.prototype.extend=function(latLng){if(latLng instanceof WPGMZA.LatLng||(latLng=new WPGMZA.LatLng(latLng)),this.isInInitialState())return this.north=this.south=latLng.lat,void(this.west=this.east=latLng.lng);latLng.lat<this.north&&(this.north=latLng.lat),latLng.lat>this.south&&(this.south=latLng.lat),latLng.lng<this.west&&(this.west=latLng.lng),latLng.lng>this.east&&(this.east=latLng.lng)},WPGMZA.LatLngBounds.prototype.extendByPixelMargin=function(map,x,arg){var y=x;if(!(map instanceof WPGMZA.Map))throw new Error("First argument must be an instance of WPGMZA.Map");if(this.isInInitialState())throw new Error("Cannot extend by pixels in initial state");3<=arguments.length&&(y=arg);var southWest=new WPGMZA.LatLng(this.south,this.west),northEast=new WPGMZA.LatLng(this.north,this.east),southWest=map.latLngToPixels(southWest),northEast=map.latLngToPixels(northEast);southWest.x-=x,southWest.y+=y,northEast.x+=x,northEast.y-=y,southWest=map.pixelsToLatLng(southWest.x,southWest.y),northEast=map.pixelsToLatLng(northEast.x,northEast.y);this.toString();this.north=northEast.lat,this.south=southWest.lat,this.west=southWest.lng,this.east=northEast.lng},WPGMZA.LatLngBounds.prototype.contains=function(latLng){if(!(latLng instanceof WPGMZA.LatLng))throw new Error("Argument must be an instance of WPGMZA.LatLng");return!(latLng.lat<Math.min(this.north,this.south))&&(!(latLng.lat>Math.max(this.north,this.south))&&(this.west<this.east?latLng.lng>=this.west&&latLng.lng<=this.east:latLng.lng<=this.west||latLng.lng>=this.east))},WPGMZA.LatLngBounds.prototype.toString=function(){return this.north+"N "+this.south+"S "+this.west+"W "+this.east+"E"},WPGMZA.LatLngBounds.prototype.toLiteral=function(){return{north:this.north,south:this.south,west:this.west,east:this.east}}}),jQuery(function($){var key,legacyGlobals={marker_pull:"0",marker_array:[],MYMAP:[],infoWindow_poly:[],markerClusterer:[],heatmap:[],WPGM_Path:[],WPGM_Path_Polygon:[],WPGM_PathLine:[],WPGM_PathLineData:[],WPGM_PathData:[],original_iw:null,wpgmza_user_marker:null,wpgmaps_localize_marker_data:[],wpgmaps_localize_polygon_settings:[],wpgmaps_localize_heatmap_settings:[],wpgmaps_localize_polyline_settings:[],wpgmza_cirtcle_data_array:[],wpgmza_rectangle_data_array:[],wpgmzaForceLegacyMarkerClusterer:!1};for(key in legacyGlobals)!function(key){key in window?console.warn("Cannot redefine legacy global "+key):Object.defineProperty(window,key,{get:function(){return console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]},set:function(value){console.warn("This property is deprecated and should no longer be used"),legacyGlobals[key]=value}})}(key);WPGMZA.legacyGlobals=legacyGlobals,window.InitMap=window.resetLocations=window.searchLocations=window.fillInAddress=window.searchLocationsNear=function(){console.warn("This function is deprecated and should no longer be used")}}),jQuery(function($){WPGMZA.MapListPage=function(){$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")})},WPGMZA.MapListPage.createInstance=function(){return new WPGMZA.MapListPage},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_LIST&&(WPGMZA.mapListPage=WPGMZA.MapListPage.createInstance())})}),jQuery(function($){WPGMZA.MapSettings=function(element){var json,self=this,str=element.getAttribute("data-settings");try{json=JSON.parse(str)}catch(e){str=(str=str.replace(/\\%/g,"%")).replace(/\\\\"/g,'\\"');try{json=JSON.parse(str)}catch(e){json={},console.warn("Failed to parse map settings JSON")}}function addSettings(input){if(input)for(var key in input){var value;"other_settings"!=key&&(value=input[key],String(value).match(/^-?\d+$/)&&(value=parseInt(value)),self[key]=value)}}WPGMZA.assertInstanceOf(this,"MapSettings"),addSettings(WPGMZA.settings),addSettings(json),json&&json.other_settings&&addSettings(json.other_settings)},WPGMZA.MapSettings.prototype.toOLViewOptions=function(){var coords,self=this,options={center:ol.proj.fromLonLat([-119.4179,36.7783]),zoom:4};function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}return"string"==typeof this.start_location&&(coords=this.start_location.replace(/^\(|\)$/g,"").split(","),WPGMZA.isLatLngString(this.start_location)?options.center=ol.proj.fromLonLat([parseFloat(coords[1]),parseFloat(coords[0])]):console.warn("Invalid start location")),this.center&&(options.center=ol.proj.fromLonLat([parseFloat(this.center.lng),parseFloat(this.center.lat)])),empty("map_start_lat")||empty("map_start_lng")||(options.center=ol.proj.fromLonLat([parseFloat(this.map_start_lng),parseFloat(this.map_start_lat)])),this.zoom&&(options.zoom=parseInt(this.zoom)),this.start_zoom&&(options.zoom=parseInt(this.start_zoom)),this.map_start_zoom&&(options.zoom=parseInt(this.map_start_zoom)),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options},WPGMZA.MapSettings.prototype.toGoogleMapsOptions=function(){var self=this,zoom=this.start_location&&this.start_location.length?this.start_location.split(","):[36.7783,-119.4179];function empty(name){return"object"!=typeof self[name]&&(!self[name]||!self[name].length)}function formatCoord(coord){return $.isNumeric(coord)?coord:parseFloat(String(coord).replace(/[\(\)\s]/,""))}var latLng=new google.maps.LatLng(formatCoord(zoom[0]),formatCoord(zoom[1])),zoom=this.start_zoom?parseInt(this.start_zoom):4;!this.start_zoom&&this.zoom&&(zoom=parseInt(this.zoom)),this.map_start_zoom&&(zoom=parseInt(this.map_start_zoom));var options={zoom:zoom,center:latLng};function isSettingDisabled(value){return"yes"===value||!!value}switch(empty("center")||(options.center=new google.maps.LatLng({lat:parseFloat(this.center.lat),lng:parseFloat(this.center.lng)})),empty("map_start_lat")||empty("map_start_lng")||(options.center=new google.maps.LatLng({lat:parseFloat(this.map_start_lat),lng:parseFloat(this.map_start_lng)})),this.map_min_zoom&&this.map_max_zoom&&(options.minZoom=Math.min(this.map_min_zoom,this.map_max_zoom),options.maxZoom=Math.max(this.map_min_zoom,this.map_max_zoom)),options.zoomControl=!isSettingDisabled(this.wpgmza_settings_map_zoom),options.panControl=!isSettingDisabled(this.wpgmza_settings_map_pan),options.mapTypeControl=!isSettingDisabled(this.wpgmza_settings_map_type),options.streetViewControl=!isSettingDisabled(this.wpgmza_settings_map_streetview),options.fullscreenControl=!isSettingDisabled(this.wpgmza_settings_map_full_screen_control),options.draggable=!isSettingDisabled(this.wpgmza_settings_map_draggable),options.disableDoubleClickZoom=isSettingDisabled(this.wpgmza_settings_map_clickzoom),isSettingDisabled(this.wpgmza_settings_map_tilt_controls)&&(options.rotateControl=!1,options.tilt=0),this.wpgmza_settings_map_scroll&&(options.scrollwheel=!1),"greedy"==this.wpgmza_force_greedy_gestures||"yes"==this.wpgmza_force_greedy_gestures||1==this.wpgmza_force_greedy_gestures?(options.gestureHandling="greedy",!this.wpgmza_settings_map_scroll&&"scrollwheel"in options&&delete options.scrollwheel):options.gestureHandling="cooperative",parseInt(this.type)){case 2:options.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case 3:options.mapTypeId=google.maps.MapTypeId.HYBRID;break;case 4:options.mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:options.mapTypeId=google.maps.MapTypeId.ROADMAP}return this.wpgmza_theme_data&&this.wpgmza_theme_data.length&&(options.styles=WPGMZA.GoogleMap.parseThemeData(this.wpgmza_theme_data)),options}}),jQuery(function($){WPGMZA.Map=function(element,options){var self=this;if(WPGMZA.assertInstanceOf(this,"Map"),WPGMZA.EventDispatcher.call(this),!(element instanceof HTMLElement||window.elementor))throw new Error("Argument must be a HTMLElement");if(element.hasAttribute("data-map-id")?this.id=element.getAttribute("data-map-id"):this.id=1,!/\d+/.test(this.id))throw new Error("Map ID must be an integer");if(WPGMZA.maps.push(this),this.element=element,this.element.wpgmzaMap=this,$(this.element).addClass("wpgmza-initialized"),this.engineElement=element,this.markers=[],this.polygons=[],this.polylines=[],this.circles=[],this.rectangles=[],WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code)return $(element).append($(WPGMZA.api_consent_html)),void $(element).css({height:"auto"});if(this.loadSettings(options),this.shortcodeAttributes={},$(this.element).attr("data-shortcode-attributes"))try{this.shortcodeAttributes=JSON.parse($(this.element).attr("data-shortcode-attributes")),this.shortcodeAttributes.zoom&&(this.settings.map_start_zoom=parseInt(this.shortcodeAttributes.zoom))}catch(e){console.warn("Error parsing shortcode attributes")}WPGMZA.getCurrentPage()!=WPGMZA.PAGE_MAP_EDIT&&this.initStoreLocator(),this.setDimensions(),this.setAlignment(),this.markerFilter=WPGMZA.MarkerFilter.createInstance(this),this.on("init",function(event){self.onInit(event)}),this.on("click",function(event){self.onClick(event)}),WPGMZA.useLegacyGlobals&&(wpgmzaLegacyGlobals.MYMAP[this.id]={map:null,bounds:null,mc:null},wpgmzaLegacyGlobals.MYMAP.init=wpgmzaLegacyGlobals.MYMAP[this.id].init=wpgmzaLegacyGlobals.MYMAP.placeMarkers=wpgmzaLegacyGlobals.MYMAP[this.id].placeMarkers=function(){console.warn("This function is deprecated and should no longer be used")})},WPGMZA.Map.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.Map.prototype.constructor=WPGMZA.Map,WPGMZA.Map.nightTimeThemeData=[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"landscape",elementType:"geometry.fill",stylers:[{color:"#575663"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#80823e"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#1b737a"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],WPGMZA.Map.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProMap:WPGMZA.GoogleMap:WPGMZA.isProVersion()?WPGMZA.OLProMap:WPGMZA.OLMap},WPGMZA.Map.createInstance=function(element,options){return new(WPGMZA.Map.getConstructor())(element,options)},Object.defineProperty(WPGMZA.Map.prototype,"markersPlaced",{get:function(){return this._markersPlaced},set:function(value){throw new Error("Value is read only")}}),Object.defineProperty(WPGMZA.Map.prototype,"lat",{get:function(){return this.getCenter().lat},set:function(value){var center=this.getCenter();center.lat=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"lng",{get:function(){return this.getCenter().lng},set:function(value){var center=this.getCenter();center.lng=value,this.setCenter(center)}}),Object.defineProperty(WPGMZA.Map.prototype,"zoom",{get:function(){return this.getZoom()},set:function(value){this.setZoom(value)}}),WPGMZA.Map.prototype.onInit=function(event){this.initPreloader(),"autoFetchFeatures"in this.settings&&!1===this.settings.autoFetchFeatures||this.fetchFeatures()},WPGMZA.Map.prototype.initPreloader=function(){this.preloader=$(WPGMZA.preloaderHTML),$(this.preloader).hide(),$(this.element).append(this.preloader)},WPGMZA.Map.prototype.showPreloader=function(show){show?$(this.preloader).show():$(this.preloader).hide()},WPGMZA.Map.prototype.loadSettings=function(options){var settings=new WPGMZA.MapSettings(this.element);settings.other_settings;if(delete settings.other_settings,options)for(var key in options)settings[key]=options[key];this.settings=settings},WPGMZA.Map.prototype.initStoreLocator=function(){var storeLocatorElement=$(".wpgmza_sl_main_div");storeLocatorElement.length&&(this.storeLocator=WPGMZA.StoreLocator.createInstance(this,storeLocatorElement[0]))},WPGMZA.Map.prototype.getFeatureArrays=function(){var arrays=WPGMZA.Map.prototype.getFeatureArrays.call(this);return arrays.heatmaps=this.heatmaps,arrays},WPGMZA.Map.prototype.setOptions=function(options){for(var name in options)this.settings[name]=options[name]},WPGMZA.Map.prototype.getRESTParameters=function(options){var defaults={};return options&&options.filter||(defaults.filter=JSON.stringify(this.markerFilter.getFilteringParameters())),$.extend(!0,defaults,options)},WPGMZA.Map.prototype.fetchFeaturesViaREST=function(){var data,offset,limit,self=this,filter=this.markerFilter.getFilteringParameters();"1"==WPGMZA.is_admin&&(filter.includeUnapproved=!0,filter.excludeIntegrated=!0),this.shortcodeAttributes.acf_post_id&&(filter.acfPostID=this.shortcodeAttributes.acf_post_id),this.showPreloader(!0),this.fetchFeaturesXhr&&this.fetchFeaturesXhr.abort(),WPGMZA.settings.fetchMarkersBatchSize?(offset=0,limit=WPGMZA.settings.fetchMarkersBatchSize,function fetchNextBatch(){filter.offset=offset,filter.limit=limit,data=self.getRESTParameters({filter:JSON.stringify(filter)}),self.fetchFeaturesXhr=WPGMZA.restAPI.call("/markers/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){result.length?(self.onMarkersFetched(result,!0),offset+=limit,fetchNextBatch()):(self.onMarkersFetched(result),data.exclude="markers",WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}}))}})}()):(data=this.getRESTParameters({filter:JSON.stringify(filter)}),this.fetchFeaturesXhr=WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}}))},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var data={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(data),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var worker=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),worker=new Blob([worker],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(worker));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){for(var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']"),i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){for(var arr=this.shortcodeAttributes.markers.split(","),markers=[],i=0;i<arr.length;i++){var id=(id=arr[i]).replace(" ",""),marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}},WPGMZA.Map.prototype.fetchFeaturesViaXML=function(){var self=this,urls=[WPGMZA.markerXMLPathURL+this.id+"markers.xml"];function fetchFeaturesExcludingMarkersViaREST(){var data={map_id:this.id,mashup_ids:this.mashupIDs},data={filter:JSON.stringify(data),exclude:"markers"};WPGMZA.restAPI.call("/features/",{useCompressedPathVariable:!0,data:data,success:function(result,status,xhr){self.onFeaturesFetched(result)}})}if(this.mashupIDs&&this.mashupIDs.forEach(function(id){urls.push(WPGMZA.markerXMLPathURL+id+"markers.xml")}),urls=urls.filter(function(item,index){return urls.indexOf(item)==index}),window.Worker&&window.Blob&&window.URL&&WPGMZA.settings.enable_asynchronous_xml_parsing){var worker=WPGMZA.loadXMLAsWebWorker.toString().replace(/function\(\)\s*{([\s\S]+)}/,"$1"),worker=new Blob([worker],{type:"text/javascript"}),worker=new Worker(URL.createObjectURL(worker));worker.onmessage=function(event){self.onMarkersFetched(event.data),fetchFeaturesExcludingMarkersViaREST()},worker.postMessage({command:"load",protocol:window.location.protocol,urls:urls})}else for(var filesLoaded=0,converter=new WPGMZA.XMLCacheConverter,converted=[],i=0;i<urls.length;i++)$.ajax(urls[i],{success:function(response,status,xhr){converted=converted.concat(converter.convert(response)),++filesLoaded==urls.length&&(self.onMarkersFetched(converted),fetchFeaturesExcludingMarkersViaREST())}})},WPGMZA.Map.prototype.fetchFeatures=function(){WPGMZA.settings.wpgmza_settings_marker_pull!=WPGMZA.MARKER_PULL_XML||"1"==WPGMZA.is_admin?this.fetchFeaturesViaREST():this.fetchFeaturesViaXML()},WPGMZA.Map.prototype.onFeaturesFetched=function(data){for(var type in data.markers&&this.onMarkersFetched(data.markers),data)if("markers"!=type)for(var module=type.substr(0,1).toUpperCase()+type.substr(1).replace(/s$/,""),i=0;i<data[type].length;i++){var instance=WPGMZA[module].createInstance(data[type][i]);this["add"+module](instance)}},WPGMZA.Map.prototype.onMarkersFetched=function(data,expectMoreBatches){for(var self=this,startFiltered=this.shortcodeAttributes.cat&&this.shortcodeAttributes.cat.length,i=0;i<data.length;i++){var obj=data[i],marker=WPGMZA.Marker.createInstance(obj);startFiltered&&(marker.isFiltered=!0,marker.setVisible(!1)),this.addMarker(marker)}if(!expectMoreBatches){this.showPreloader(!1);var triggerEvent=function(){self._markersPlaced=!0,self.trigger("markersplaced"),self.off("filteringcomplete",triggerEvent)};if(this.shortcodeAttributes.cat){for(var categories=this.shortcodeAttributes.cat.split(","),select=$("select[mid='"+this.id+"'][name='wpgmza_filter_select']"),i=0;i<categories.length;i++)$("input[type='checkbox'][mid='"+this.id+"'][value='"+categories[i]+"']").prop("checked",!0),select.val(categories[i]);this.on("filteringcomplete",triggerEvent),this.markerFilter.update({categories:categories})}else triggerEvent();if(this.shortcodeAttributes.markers){for(var arr=this.shortcodeAttributes.markers.split(","),markers=[],i=0;i<arr.length;i++){var id=(id=arr[i]).replace(" ",""),marker=this.getMarkerByID(id);markers.push(marker)}this.fitMapBoundsToMarkers(markers)}}};Math.PI;function deg2rad(deg){return deg*(Math.PI/180)}WPGMZA.Map.getGeographicDistance=function(lat1,a,lat2,lon2){var dLat=deg2rad(lat2-lat1),a=deg2rad(lon2-a),a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(deg2rad(lat1))*Math.cos(deg2rad(lat2))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))},WPGMZA.Map.prototype.setCenter=function(latLng){if(!("lat"in latLng&&"lng"in latLng))throw new Error("Argument is not an object with lat and lng")},WPGMZA.Map.prototype.setDimensions=function(width,height){0==arguments.length&&(width=this.settings.map_width||"100",this.settings.map_width_type?width+=this.settings.map_width_type.replace("\\",""):width+="%",height=this.settings.map_height||"400",this.settings.map_height_type?height+=this.settings.map_height_type.replace("\\",""):height+="px"),$(this.engineElement).css({width:width,height:height})},WPGMZA.Map.prototype.setAlignment=function(){switch(parseInt(this.settings.wpgmza_map_align)){case 1:$(this.element).css({float:"left"});break;case 2:$(this.element).css({"margin-left":"auto","margin-right":"auto"});break;case 3:$(this.element).css({float:"right"})}},WPGMZA.Map.prototype.addMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");marker.map=this,(marker.parent=this).markers.push(marker),this.dispatchEvent({type:"markeradded",marker:marker}),marker.dispatchEvent({type:"added"})},WPGMZA.Map.prototype.removeMarker=function(marker){if(!(marker instanceof WPGMZA.Marker))throw new Error("Argument must be an instance of WPGMZA.Marker");if(marker.map!==this)throw new Error("Wrong map error");marker.infoWindow&&marker.infoWindow.close(),marker.map=null,marker.parent=null;var index=this.markers.indexOf(marker);if(-1==index)throw new Error("Marker not found in marker array");this.markers.splice(index,1),this.dispatchEvent({type:"markerremoved",marker:marker}),marker.dispatchEvent({type:"removed"})},WPGMZA.Map.prototype.removeAllMarkers=function(options){for(var i=this.markers.length-1;0<=i;i--)this.removeMarker(this.markers[i])},WPGMZA.Map.prototype.getMarkerByID=function(id){for(var i=0;i<this.markers.length;i++)if(this.markers[i].id==id)return this.markers[i];return null},WPGMZA.Map.prototype.getMarkerByTitle=function(title){if("string"==typeof title){for(var i=0;i<this.markers.length;i++)if(this.markers[i].title==title)return this.markers[i]}else{if(!(title instanceof RegExp))throw new Error("Invalid argument");for(i=0;i<this.markers.length;i++)if(title.test(this.markers[i].title))return this.markers[i]}return null},WPGMZA.Map.prototype.removeMarkerByID=function(marker){marker=this.getMarkerByID(marker);marker&&this.removeMarker(marker)},WPGMZA.Map.prototype.addPolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");(polygon.map=this).polygons.push(polygon),this.dispatchEvent({type:"polygonadded",polygon:polygon})},WPGMZA.Map.prototype.removePolygon=function(polygon){if(!(polygon instanceof WPGMZA.Polygon))throw new Error("Argument must be an instance of WPGMZA.Polygon");if(polygon.map!==this)throw new Error("Wrong map error");polygon.map=null,this.polygons.splice(this.polygons.indexOf(polygon),1),this.dispatchEvent({type:"polygonremoved",polygon:polygon})},WPGMZA.Map.prototype.getPolygonByID=function(id){for(var i=0;i<this.polygons.length;i++)if(this.polygons[i].id==id)return this.polygons[i];return null},WPGMZA.Map.prototype.removePolygonByID=function(polygon){polygon=this.getPolygonByID(polygon);polygon&&this.removePolygon(polygon)},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.addPolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");(polyline.map=this).polylines.push(polyline),this.dispatchEvent({type:"polylineadded",polyline:polyline})},WPGMZA.Map.prototype.removePolyline=function(polyline){if(!(polyline instanceof WPGMZA.Polyline))throw new Error("Argument must be an instance of WPGMZA.Polyline");if(polyline.map!==this)throw new Error("Wrong map error");polyline.map=null,this.polylines.splice(this.polylines.indexOf(polyline),1),this.dispatchEvent({type:"polylineremoved",polyline:polyline})},WPGMZA.Map.prototype.getPolylineByID=function(id){for(var i=0;i<this.polylines.length;i++)if(this.polylines[i].id==id)return this.polylines[i];return null},WPGMZA.Map.prototype.removePolylineByID=function(polyline){polyline=this.getPolylineByID(polyline);polyline&&this.removePolyline(polyline)},WPGMZA.Map.prototype.addCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");(circle.map=this).circles.push(circle),this.dispatchEvent({type:"circleadded",circle:circle})},WPGMZA.Map.prototype.removeCircle=function(circle){if(!(circle instanceof WPGMZA.Circle))throw new Error("Argument must be an instance of WPGMZA.Circle");if(circle.map!==this)throw new Error("Wrong map error");circle.map=null,this.circles.splice(this.circles.indexOf(circle),1),this.dispatchEvent({type:"circleremoved",circle:circle})},WPGMZA.Map.prototype.getCircleByID=function(id){for(var i=0;i<this.circles.length;i++)if(this.circles[i].id==id)return this.circles[i];return null},WPGMZA.Map.prototype.removeCircleByID=function(circle){circle=this.getCircleByID(circle);circle&&this.removeCircle(circle)},WPGMZA.Map.prototype.addRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");(rectangle.map=this).rectangles.push(rectangle),this.dispatchEvent({type:"rectangleadded",rectangle:rectangle})},WPGMZA.Map.prototype.removeRectangle=function(rectangle){if(!(rectangle instanceof WPGMZA.Rectangle))throw new Error("Argument must be an instance of WPGMZA.Rectangle");if(rectangle.map!==this)throw new Error("Wrong map error");rectangle.map=null,this.rectangles.splice(this.rectangles.indexOf(rectangle),1),this.dispatchEvent({type:"rectangleremoved",rectangle:rectangle})},WPGMZA.Map.prototype.getRectangleByID=function(id){for(var i=0;i<this.rectangles.length;i++)if(this.rectangles[i].id==id)return this.rectangles[i];return null},WPGMZA.Map.prototype.removeRectangleByID=function(rectangle){rectangle=this.getRectangleByID(rectangle);rectangle&&this.removeRectangle(rectangle)},WPGMZA.Map.prototype.resetBounds=function(){var latlng=new WPGMZA.LatLng(this.settings.map_start_lat,this.settings.map_start_lng);this.panTo(latlng),this.setZoom(this.settings.map_start_zoom)},WPGMZA.Map.prototype.nudge=function(x,nudged){nudged=this.nudgeLatLng(this.getCenter(),x,nudged);this.setCenter(nudged)},WPGMZA.Map.prototype.nudgeLatLng=function(pixels,x,y){pixels=this.latLngToPixels(pixels);if(pixels.x+=parseFloat(x),pixels.y+=parseFloat(y),isNaN(pixels.x)||isNaN(pixels.y))throw new Error("Invalid coordinates supplied");return this.pixelsToLatLng(pixels)},WPGMZA.Map.prototype.animateNudge=function(x,nudged,origin,milliseconds){if(origin){if(!(origin instanceof WPGMZA.LatLng))throw new Error("Origin must be an instance of WPGMZA.LatLng")}else origin=this.getCenter();nudged=this.nudgeLatLng(origin,x,nudged),milliseconds=milliseconds||WPGMZA.getScrollAnimationDuration(),$(this).animate({lat:nudged.lat,lng:nudged.lng},milliseconds)},WPGMZA.Map.prototype.onWindowResize=function(event){},WPGMZA.Map.prototype.onElementResized=function(event){},WPGMZA.Map.prototype.onBoundsChanged=function(event){this.trigger("boundschanged"),this.trigger("bounds_changed")},WPGMZA.Map.prototype.onIdle=function(event){this.trigger("idle")},WPGMZA.Map.prototype.onClick=function(event){},WPGMZA.Map.prototype.hasVisibleMarkers=function(){for(var marker,length=this.markers.length,i=0;i<length;i++)if((marker=this.markers[i]).isFilterable&&marker.getVisible())return!0;return!1},WPGMZA.Map.prototype.closeAllInfoWindows=function(){this.markers.forEach(function(marker){marker.infoWindow&&marker.infoWindow.close()})},$(document).ready(function(event){var invisibleMaps;WPGMZA.visibilityWorkaroundIntervalID||(invisibleMaps=jQuery(".wpgmza_map:hidden"),WPGMZA.visibilityWorkaroundIntervalID=setInterval(function(){jQuery(invisibleMaps).each(function(index,el){var id;jQuery(el).is(":visible")&&(id=jQuery(el).attr("data-map-id"),WPGMZA.getMapByID(id).onElementResized(),invisibleMaps.splice(invisibleMaps.toArray().indexOf(el),1))})},1e3))})}),jQuery(function($){WPGMZA.MapsEngineDialog=function(element){var self=this;this.element=element,window.wpgmzaUnbindSaveReminder&&window.wpgmzaUnbindSaveReminder(),$(element).show(),$(element).remodal().open(),$(element).find("input:radio").on("change",function(event){$("#wpgmza-confirm-engine").prop("disabled",!1),$("#wpgmza-confirm-engine").click()}),$("#wpgmza-confirm-engine").on("click",function(event){self.onButtonClicked(event)})},WPGMZA.MapsEngineDialog.prototype.onButtonClicked=function(event){$(event.target).prop("disabled",!0),$.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_engine_dialog_set_engine",engine:$("[name='wpgmza_maps_engine']:checked").val(),nonce:$("#wpgmza-maps-engine-dialog").attr("data-ajax-nonce")},success:function(response,status,xhr){window.location.reload()}})},$(document).ready(function(event){var element=$("#wpgmza-maps-engine-dialog");element.length&&(WPGMZA.settings.wpgmza_maps_engine_dialog_done||WPGMZA.settings.wpgmza_google_maps_api_key&&WPGMZA.settings.wpgmza_google_maps_api_key.length||(WPGMZA.mapsEngineDialog=new WPGMZA.MapsEngineDialog(element)))})}),jQuery(function($){WPGMZA.MarkerFilter=function(map){WPGMZA.EventDispatcher.call(this),this.map=map},WPGMZA.MarkerFilter.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.MarkerFilter.prototype.constructor=WPGMZA.MarkerFilter,WPGMZA.MarkerFilter.createInstance=function(map){return new WPGMZA.MarkerFilter(map)},WPGMZA.MarkerFilter.prototype.getFilteringParameters=function(){var params={map_id:this.map.id};return this.map.storeLocator&&(params=$.extend(params,this.map.storeLocator.getFilteringParameters())),params},WPGMZA.MarkerFilter.prototype.update=function(params,source){var self=this;function dispatchEvent(result){var event=new WPGMZA.Event("filteringcomplete");event.map=self.map,event.source=source,event.filteredMarkers=result,event.filteringParams=params,self.onFilteringComplete(event),self.trigger(event),self.map.trigger(event)}this.updateTimeoutID||(params=params||{},this.xhr&&(this.xhr.abort(),delete this.xhr),this.updateTimeoutID=setTimeout(function(){return(params=$.extend(self.getFilteringParameters(),params)).center instanceof WPGMZA.LatLng&&(params.center=params.center.toLatLngLiteral()),params.hideAll?dispatchEvent([]):(self.map.showPreloader(!0),self.xhr=WPGMZA.restAPI.call("/markers",{data:{fields:["id"],filter:JSON.stringify(params)},success:function(result,status,xhr){self.map.showPreloader(!1),dispatchEvent(result)},useCompressedPathVariable:!0})),void delete self.updateTimeoutID},0))},WPGMZA.MarkerFilter.prototype.onFilteringComplete=function(event){var map=[];event.filteredMarkers.forEach(function(data){map[data.id]=!0}),this.map.markers.forEach(function(marker){var allowByFilter;marker.isFilterable&&(allowByFilter=!!map[marker.id],marker.isFiltered=!allowByFilter,marker.setVisible(allowByFilter))})}}),jQuery(function($){WPGMZA.Marker=function(row){var self=this;this._offset={x:0,y:0},WPGMZA.assertInstanceOf(this,"Marker"),this.lat="36.778261",this.lng="-119.4179323999",this.address="California",this.title=null,this.description="",this.link="",this.icon="",this.approved=1,this.pic=null,this.isFilterable=!0,this.disableInfoWindow=!1,WPGMZA.Feature.apply(this,arguments),row&&row.heatmap||(row&&this.on("init",function(event){row.position&&this.setPosition(row.position),row.map&&row.map.addMarker(this)}),this.addEventListener("added",function(event){self.onAdded(event)}),this.handleLegacyGlobals(row))},WPGMZA.Marker.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Marker.prototype.constructor=WPGMZA.Marker,WPGMZA.Marker.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProMarker:WPGMZA.GoogleMarker:WPGMZA.isProVersion()?WPGMZA.OLProMarker:WPGMZA.OLMarker},WPGMZA.Marker.createInstance=function(row){return new(WPGMZA.Marker.getConstructor())(row)},WPGMZA.Marker.ANIMATION_NONE="0",WPGMZA.Marker.ANIMATION_BOUNCE="1",WPGMZA.Marker.ANIMATION_DROP="2",Object.defineProperty(WPGMZA.Marker.prototype,"offsetX",{get:function(){return this._offset.x},set:function(value){this._offset.x=value,this.updateOffset()}}),Object.defineProperty(WPGMZA.Marker.prototype,"offsetY",{get:function(){return this._offset.y},set:function(value){this._offset.y=value,this.updateOffset()}}),WPGMZA.Marker.prototype.onAdded=function(event){var self=this;this.addEventListener("click",function(event){self.onClick(event)}),this.addEventListener("mouseover",function(event){self.onMouseOver(event)}),this.addEventListener("select",function(event){self.onSelect(event)}),this.map.settings.marker==this.id&&self.trigger("select"),"1"==this.infoopen&&this.openInfoWindow(!0)},WPGMZA.Marker.prototype.handleLegacyGlobals=function(cloned){var m;WPGMZA.settings.useLegacyGlobals&&this.map_id&&this.id&&(WPGMZA.pro_version&&(m=WPGMZA.pro_version.match(/\d+/))&&m[0]<=7||(WPGMZA.legacyGlobals.marker_array[this.map_id]||(WPGMZA.legacyGlobals.marker_array[this.map_id]=[]),WPGMZA.legacyGlobals.marker_array[this.map_id][this.id]=this,WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]||(WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id]=[]),cloned=$.extend({marker_id:this.id},cloned),WPGMZA.legacyGlobals.wpgmaps_localize_marker_data[this.map_id][this.id]=cloned))},WPGMZA.Marker.prototype.initInfoWindow=function(){this.infoWindow||(this.infoWindow=WPGMZA.InfoWindow.createInstance())},WPGMZA.Marker.prototype.openInfoWindow=function(autoOpen){this.map?(autoOpen||(this.map.lastInteractedMarker&&this.map.lastInteractedMarker.infoWindow.close(),this.map.lastInteractedMarker=this),this.initInfoWindow(),this.infoWindow.open(this.map,this)):console.warn("Cannot open infowindow for marker with no map")},WPGMZA.Marker.prototype.onClick=function(event){},WPGMZA.Marker.prototype.onSelect=function(event){this.openInfoWindow()},WPGMZA.Marker.prototype.onMouseOver=function(event){WPGMZA.settings.wpgmza_settings_map_open_marker_by==WPGMZA.InfoWindow.OPEN_BY_HOVER&&this.openInfoWindow()},WPGMZA.Marker.prototype.getIcon=function(){function stripProtocol(url){return"string"!=typeof url?url:url.replace(/^http(s?):/,"")}return WPGMZA.defaultMarkerIcon?stripProtocol(WPGMZA.defaultMarkerIcon):stripProtocol(WPGMZA.settings.default_marker_icon)},WPGMZA.Marker.prototype.getPosition=function(){return new WPGMZA.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})},WPGMZA.Marker.prototype.setPosition=function(latLng){latLng instanceof WPGMZA.LatLng?(this.lat=latLng.lat,this.lng=latLng.lng):(this.lat=parseFloat(latLng.lat),this.lng=parseFloat(latLng.lng))},WPGMZA.Marker.prototype.setOffset=function(x,y){this._offset.x=x,this._offset.y=y,this.updateOffset()},WPGMZA.Marker.prototype.updateOffset=function(){},WPGMZA.Marker.prototype.getAnimation=function(){return this.anim},WPGMZA.Marker.prototype.setAnimation=function(animation){},WPGMZA.Marker.prototype.getVisible=function(){},WPGMZA.Marker.prototype.setVisible=function(visible){!visible&&this.infoWindow&&this.infoWindow.close()},WPGMZA.Marker.prototype.getMap=function(){return this.map},WPGMZA.Marker.prototype.setMap=function(map){map?map.addMarker(this):this.map&&this.map.removeMarker(this),this.map=map},WPGMZA.Marker.prototype.getDraggable=function(){},WPGMZA.Marker.prototype.setDraggable=function(draggable){},WPGMZA.Marker.prototype.setOptions=function(options){},WPGMZA.Marker.prototype.setOpacity=function(opacity){},WPGMZA.Marker.prototype.panIntoView=function(){if(!this.map)throw new Error("Marker hasn't been added to a map");this.map.setCenter(this.getPosition())},WPGMZA.Marker.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this),position=this.getPosition();return $.extend(result,{lat:position.lat,lng:position.lng,address:this.address,title:this.title,description:this.description,link:this.link,icon:this.icon,pic:this.pic,approved:this.approved}),result}}),jQuery(function($){WPGMZA.ModernStoreLocatorCircle=function(map_id,settings){var map=WPGMZA.isProVersion()?this.map=WPGMZA.getMapByID(map_id):this.map=WPGMZA.maps[0];this.map_id=map_id,this.mapElement=map.element,this.mapSize={width:$(this.mapElement).width(),height:$(this.mapElement).height()},this.initCanvasLayer(),this.settings={center:new WPGMZA.LatLng(0,0),radius:1,color:"#ff0000",shadowColor:"white",shadowBlur:4,centerRingRadius:10,centerRingLineWidth:3,numInnerRings:9,innerRingLineWidth:1,innerRingFade:!0,numOuterRings:7,ringLineWidth:1,mainRingLineWidth:2,numSpokes:6,spokesStartAngle:Math.PI/2,numRadiusLabels:6,radiusLabelsStartAngle:Math.PI/2,radiusLabelFont:"13px sans-serif",visible:!1},settings&&this.setOptions(settings)},WPGMZA.ModernStoreLocatorCircle.createInstance=function(map,settings){return new("google-maps"==WPGMZA.settings.engine?WPGMZA.GoogleModernStoreLocatorCircle:WPGMZA.OLModernStoreLocatorCircle)(map,settings)},WPGMZA.ModernStoreLocatorCircle.prototype.initCanvasLayer=function(){},WPGMZA.ModernStoreLocatorCircle.prototype.onResize=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.onUpdate=function(event){this.draw()},WPGMZA.ModernStoreLocatorCircle.prototype.setOptions=function(options){for(var name in options){var functionName="set"+name.substr(0,1).toUpperCase()+name.substr(1);"function"==typeof this[functionName]?this[functionName](options[name]):this.settings[name]=options[name]}},WPGMZA.ModernStoreLocatorCircle.prototype.getResolutionScale=function(){return window.devicePixelRatio||1},WPGMZA.ModernStoreLocatorCircle.prototype.getCenter=function(){return this.getPosition()},WPGMZA.ModernStoreLocatorCircle.prototype.setCenter=function(value){this.setPosition(value)},WPGMZA.ModernStoreLocatorCircle.prototype.getPosition=function(){return this.settings.center},WPGMZA.ModernStoreLocatorCircle.prototype.setPosition=function(position){this.settings.center=position},WPGMZA.ModernStoreLocatorCircle.prototype.getRadius=function(){return this.settings.radius},WPGMZA.ModernStoreLocatorCircle.prototype.setRadius=function(radius){if(isNaN(radius))throw new Error("Invalid radius");this.settings.radius=radius},WPGMZA.ModernStoreLocatorCircle.prototype.getVisible=function(){return this.settings.visible},WPGMZA.ModernStoreLocatorCircle.prototype.setVisible=function(visible){this.settings.visible=visible},WPGMZA.ModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getContext=function(type){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){throw new Error("Abstract function called")},WPGMZA.ModernStoreLocatorCircle.prototype.validateSettings=function(){WPGMZA.isHexColorString(this.settings.color)||(this.settings.color="#ff0000")},WPGMZA.ModernStoreLocatorCircle.prototype.draw=function(){this.validateSettings();var settings=this.settings,end=this.getCanvasDimensions(),m=end.width,start=end.height;this.map,this.getResolutionScale();if(context=this.getContext("2d"),context.clearRect(0,0,m,start),settings.visible){context.shadowColor=settings.shadowColor,context.shadowBlur=settings.shadowBlur,context.setTransform(1,0,0,1,0,0);var scale=this.getScale();context.scale(scale,scale);end=this.getWorldOriginOffset();context.translate(end.x,end.y);new WPGMZA.LatLng(this.settings.center);var worldPoint=this.getCenterPixels(),rgba=WPGMZA.hexToRgba(settings.color),ringSpacing=this.getTransformedRadius(settings.radius)/(settings.numInnerRings+1);context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.centerRingRadius)/scale,0,2*Math.PI),context.stroke(),context.closePath();var radius=this.getTransformedRadius(settings.radius)+ringSpacing*settings.numOuterRings+1,m=context.createRadialGradient(0,0,0,0,0,radius),rgba=WPGMZA.hexToRgba(settings.color),start=WPGMZA.rgbaToString(rgba);rgba.a=0,end=WPGMZA.rgbaToString(rgba),m.addColorStop(0,start),m.addColorStop(1,end),context.save(),context.translate(worldPoint.x,worldPoint.y),context.strokeStyle=m,context.lineWidth=2/scale;for(var i=0;i<settings.numSpokes;i++)spokeAngle=settings.spokesStartAngle+2*Math.PI*(i/settings.numSpokes),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.setLineDash([2/scale,15/scale]),context.beginPath(),context.moveTo(0,0),context.lineTo(x,y),context.stroke();context.setLineDash([]),context.restore(),context.lineWidth=1/scale*settings.innerRingLineWidth;for(i=1;i<=settings.numInnerRings;i++){radius=i*ringSpacing;settings.innerRingFade&&(rgba.a=1-(i-1)/settings.numInnerRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath()}context.strokeStyle=settings.color,context.lineWidth=1/scale*settings.centerRingLineWidth,context.beginPath(),context.arc(worldPoint.x,worldPoint.y,this.getTransformedRadius(settings.radius),0,2*Math.PI),context.stroke(),context.closePath();for(radius=radius+ringSpacing,i=0;i<settings.numOuterRings;i++)settings.innerRingFade&&(rgba.a=1-i/settings.numOuterRings),context.strokeStyle=WPGMZA.rgbaToString(rgba),context.beginPath(),context.arc(worldPoint.x,worldPoint.y,radius,0,2*Math.PI),context.stroke(),context.closePath(),radius+=ringSpacing;if(0<settings.numRadiusLabels){var x,y,radius=this.getTransformedRadius(settings.radius);(m=settings.radiusLabelFont.match(/(\d+)px/))&&parseInt(m[1]),context.font=settings.radiusLabelFont,context.textAlign="center",context.textBaseline="middle",context.fillStyle=settings.color,context.save(),context.translate(worldPoint.x,worldPoint.y);for(i=0;i<settings.numRadiusLabels;i++){var spokeAngle,textAngle=(spokeAngle=settings.radiusLabelsStartAngle+2*Math.PI*(i/settings.numRadiusLabels))+Math.PI/2,width=settings.radiusString;0<Math.sin(spokeAngle)&&(textAngle-=Math.PI),x=Math.cos(spokeAngle)*radius,y=Math.sin(spokeAngle)*radius,context.save(),context.translate(x,y),context.rotate(textAngle),context.scale(1/scale,1/scale),width=context.measureText(width).width,height=width/2,context.clearRect(-width,-height,2*width,2*height),context.fillText(settings.radiusString,0,0),context.restore()}context.restore()}}}}),jQuery(function($){WPGMZA.NativeMapsAppIcon=function(){navigator.userAgent.match(/^Apple|iPhone|iPad|iPod/)?(this.type="apple",this.element=$('<span><i class="fab fa fa-apple" aria-hidden="true"></i></span>')):(this.type="google",this.element=$('<span><i class="fab fa fa-google" aria-hidden="true"></i></span>'))}}),jQuery(function($){Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(begin,end){return new Uint8Array(Array.prototype.slice.call(this,begin,end))}}),WPGMZA.isSafari()&&!window.external&&(window.external={})}),jQuery(function($){WPGMZA.Polygon=function(row,enginePolygon){WPGMZA.assertInstanceOf(this,"Polygon"),this.paths=null,WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polygon.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polygon.prototype.constructor=WPGMZA.Polygon,Object.defineProperty(WPGMZA.Polygon.prototype,"fillColor",{enumerable:!0,get:function(){return this.fillcolor&&this.fillcolor.length?"#"+this.fillcolor.replace(/^#/,""):"#ff0000"},set:function(a){this.fillcolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polygon.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.lineopacity&&this.lineopacity.length?this.lineopacity:.6},set:function(a){this.lineopacity=a}}),WPGMZA.Polygon.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.isProVersion()?WPGMZA.GoogleProPolygon:WPGMZA.GooglePolygon:WPGMZA.isProVersion()?WPGMZA.OLProPolygon:WPGMZA.OLPolygon},WPGMZA.Polygon.createInstance=function(row,engineObject){return new(WPGMZA.Polygon.getConstructor())(row,engineObject)}}),jQuery(function($){WPGMZA.Polyline=function(options,googlePolyline){WPGMZA.assertInstanceOf(this,"Polyline"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.Polyline.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Polyline.prototype.constructor=WPGMZA.Polyline,Object.defineProperty(WPGMZA.Polyline.prototype,"strokeColor",{enumerable:!0,get:function(){return this.linecolor&&this.linecolor.length?"#"+this.linecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.linecolor=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeOpacity",{enumerable:!0,get:function(){return this.opacity&&this.opacity.length?this.opacity:.6},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Polyline.prototype,"strokeWeight",{enumerable:!0,get:function(){return this.linethickness&&this.linethickness.length?parseInt(this.linethickness):1},set:function(a){this.linethickness=a}}),WPGMZA.Polyline.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.GooglePolyline:WPGMZA.OLPolyline},WPGMZA.Polyline.createInstance=function(options,engineObject){return new(WPGMZA.Polyline.getConstructor())(options,engineObject)},WPGMZA.Polyline.prototype.getPoints=function(){return this.toJSON().points},WPGMZA.Polyline.prototype.toJSON=function(){var result=WPGMZA.Feature.prototype.toJSON.call(this);return result.title=this.title,result}}),jQuery(function($){WPGMZA.PopoutPanel=function(element){this.element=element},WPGMZA.PopoutPanel.prototype.open=function(){$(this.element).addClass("wpgmza-open")},WPGMZA.PopoutPanel.prototype.close=function(){$(this.element).removeClass("wpgmza-open")}}),jQuery(function($){var Parent=WPGMZA.Feature;WPGMZA.Rectangle=function(options,engineRectangle){WPGMZA.assertInstanceOf(this,"Rectangle"),this.name="",this.cornerA=new WPGMZA.LatLng,this.cornerB=new WPGMZA.LatLng,this.color="#ff0000",this.opacity=.5,Parent.apply(this,arguments)},WPGMZA.extend(WPGMZA.Rectangle,WPGMZA.Feature),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillColor",{enumerable:!0,get:function(){return this.color&&this.color.length?this.color:"#ff0000"},set:function(a){this.color=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"fillOpacity",{enumerable:!0,get:function(){return this.opacity||0==this.opacity?parseFloat(this.opacity):.5},set:function(a){this.opacity=a}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeColor",{enumerable:!0,get:function(){return"#000000"}}),Object.defineProperty(WPGMZA.Rectangle.prototype,"strokeOpacity",{enumerable:!0,get:function(){return 0}}),WPGMZA.Rectangle.createInstance=function(options,engineRectangle){var constructor="open-layers"===WPGMZA.settings.engine?WPGMZA.OLRectangle:WPGMZA.GoogleRectangle;return new constructor(options,engineRectangle)}}),jQuery(function($){function sendAJAXFallbackRequest(route,params){if((params=$.extend({},params)).data||(params.data={}),"route"in params.data)throw new Error("Cannot send route through this method");if("action"in params.data)throw new Error("Cannot send action through this method");return params.data.route=route,params.data.action="wpgmza_rest_api_request",WPGMZA.restAPI.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_AJAX),$.ajax(WPGMZA.ajaxurl,params)}WPGMZA.RestAPI=function(){WPGMZA.RestAPI.URL=WPGMZA.resturl,this.useAJAXFallback=!1},WPGMZA.RestAPI.CONTEXT_REST="REST",WPGMZA.RestAPI.CONTEXT_AJAX="AJAX",WPGMZA.RestAPI.createInstance=function(){return new WPGMZA.RestAPI},Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableSupported",{get:function(){return WPGMZA.serverCanInflate&&"Uint8Array"in window&&"TextEncoder"in window}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"isCompressedPathVariableAllowed",{get:function(){return!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?!WPGMZA.settings.disable_compressed_path_variables:WPGMZA.settings.enable_compressed_path_variables}}),Object.defineProperty(WPGMZA.RestAPI.prototype,"maxURLLength",{get:function(){return 2083}}),WPGMZA.RestAPI.prototype.compressParams=function(params){var encoded,suffix="";!params.markerIDs||1<(encoded=params.markerIDs.split(",")).length&&(encoded=(new WPGMZA.EliasFano).encode(encoded),raw=pako.deflate(encoded),input=Array.prototype.map.call(raw,function(ch){return String.fromCharCode(ch)}).join(""),suffix="/"+btoa(input).replace(/\//g,"-").replace(/=+$/,""),params.midcbp=encoded.pointer,delete params.markerIDs);var input=JSON.stringify(params),input=(new TextEncoder).encode(input),raw=pako.deflate(input),raw=Array.prototype.map.call(raw,function(ch){return String.fromCharCode(ch)}).join("");return btoa(raw).replace(/\//g,"-").replace(/=+$/,"")+suffix},WPGMZA.RestAPI.prototype.getNonce=function(route){var pattern,matches=[];for(pattern in WPGMZA.restnoncetable){var regex=new RegExp(pattern);route.match(regex)&&matches.push({pattern:pattern,nonce:WPGMZA.restnoncetable[pattern],length:pattern.length})}if(!matches.length)throw new Error("No nonce found for route");return matches.sort(function(a,b){return b.length-a.length}),matches[0].nonce},WPGMZA.RestAPI.prototype.addNonce=function(route,params,context){function setRESTNonce(xhr){context==WPGMZA.RestAPI.CONTEXT_REST&&self.shouldAddNonce(route)&&xhr.setRequestHeader("X-WP-Nonce",WPGMZA.restnonce),params&¶ms.method&&!params.method.match(/^GET$/i)&&xhr.setRequestHeader("X-WPGMZA-Action-Nonce",self.getNonce(route))}var base,self=this;params.beforeSend?(base=params.beforeSend,params.beforeSend=function(xhr){base(xhr),setRESTNonce(xhr)}):params.beforeSend=setRESTNonce},WPGMZA.RestAPI.prototype.shouldAddNonce=function(route){route=route.replace(/\//g,"");var isAdmin=!1;WPGMZA.is_admin&&1===parseInt(WPGMZA.is_admin)&&(isAdmin=!0);return!(route&&["markers","features","marker-listing","datatables"].includes(route)&&!isAdmin)},WPGMZA.RestAPI.prototype.call=function(route,params){if(this.useAJAXFallback)return sendAJAXFallbackRequest(route,params);var compressedParams,compressedRoute,attemptedCompressedPathVariable=!1,fallbackRoute=route,fallbackParams=$.extend({},params);if("string"!=typeof route||!route.match(/^\//)&&!route.match(/^http/))throw new Error("Invalid route");WPGMZA.RestAPI.URL.match(/\/$/)&&(route=route.replace(/^\//,"")),params=params||{},this.addNonce(route,params,WPGMZA.RestAPI.CONTEXT_REST),params.error||(params.error=function(xhr,status,message){if("abort"!=status){switch(xhr.status){case 401:case 403:case 405:return($.post(WPGMZA.ajaxurl,{action:"wpgmza_report_rest_api_blocked"},function(response){}),console.warn("The REST API was blocked. This is usually due to security plugins blocking REST requests for non-authenticated users."),"DELETE"===params.method)?(console.warn("The REST API rejected a DELETE request, attempting again with POST fallback"),params.method="POST",params.data||(params.data={}),params.data.simulateDelete="yes",WPGMZA.restAPI.call(route,params)):(this.useAJAXFallback=!0,sendAJAXFallbackRequest(fallbackRoute,fallbackParams));case 414:if(!attemptedCompressedPathVariable)break;return fallbackParams.method="POST",fallbackParams.useCompressedPathVariable=!1,WPGMZA.restAPI.call(fallbackRoute,fallbackParams)}throw new Error(message)}}),params.useCompressedPathVariable&&this.isCompressedPathVariableSupported&&this.isCompressedPathVariableAllowed&&(compressedParams=$.extend({},params),compressedRoute=params.data,compressedRoute=this.compressParams(compressedRoute),WPGMZA.isServerIIS&&(compressedRoute=compressedRoute.replace(/\+/g,"%20")),compressedRoute=route.replace(/\/$/,"")+"/base64"+compressedRoute,WPGMZA.RestAPI.URL,compressedParams.method="GET",delete compressedParams.data,!1===params.cache&&(compressedParams.data={skip_cache:1}),compressedRoute.length<this.maxURLLength?(attemptedCompressedPathVariable=!0,route=compressedRoute,params=compressedParams):(WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed||console.warn("Compressed path variable route would exceed URL length limit"),WPGMZA.RestAPI.compressedPathVariableURLLimitWarningDisplayed=!0));var onSuccess=null;return params.success&&(onSuccess=params.success),params.success=function(result,status,xhr){if("object"!=typeof result){var rawResult=result;try{result=JSON.parse(result)}catch(parseExc){result=rawResult}}onSuccess&&"function"==typeof onSuccess&&onSuccess(result,status,xhr)},WPGMZA.RestAPI.URL.match(/\?/)&&(route=route.replace(/\?/,"&")),$.ajax(WPGMZA.RestAPI.URL+route,params)};var nativeCallFunction=WPGMZA.RestAPI.call;WPGMZA.RestAPI.call=function(){console.warn("WPGMZA.RestAPI.call was called statically, did you mean to call the function on WPGMZA.restAPI?"),nativeCallFunction.apply(this,arguments)},$(document.body).on("click","#wpgmza-rest-api-blocked button.notice-dismiss",function(event){WPGMZA.restAPI.call("/rest-api/",{method:"POST",data:{dismiss_blocked_notice:!0}})})});var $_GET={};if(-1!==document.location.toString().indexOf("?"))for(var query=document.location.toString().replace(/^.*?\?/,"").replace(/#.*$/,"").split("&"),wpgmza_i=0,wpgmza_l=query.length;wpgmza_i<wpgmza_l;wpgmza_i++){var aux=decodeURIComponent(query[wpgmza_i]).split("=");$_GET[aux[0]]=aux[1]}jQuery(function($){WPGMZA.SettingsPage=function(){var self=this;this._keypressHistory=[],this.updateEngineSpecificControls(),this.updateStorageControls(),this.updateGDPRControls(),$(window).on("keypress",function(event){self.onKeyPress(event)}),jQuery("body").on("click",".wpgmza_destroy_data",function(warning){warning.preventDefault();var ttype=jQuery(this).attr("danger"),warning="wpgmza_destroy_all_data"==ttype?"Are you sure? This will delete ALL data and settings for WP Google Maps!":"Are you sure?";window.confirm(warning)&&jQuery.ajax(WPGMZA.ajaxurl,{method:"POST",data:{action:"wpgmza_maps_settings_danger_zone_delete_data",type:ttype,nonce:wpgmza_dz_nonce},success:function(response,status,xhr){"wpgmza_destroy_all_data"==ttype?window.location.replace("admin.php?page=wp-google-maps-menu&action=welcome_page"):"wpgmza_reset_all_settings"==ttype?window.location.reload():alert("Complete.")}})}),$("select[name='wpgmza_maps_engine']").on("change",function(event){self.updateEngineSpecificControls()}),$('[name="wpgmza_settings_marker_pull"]').on("click",function(event){self.updateStorageControls()}),$("input[name='wpgmza_gdpr_require_consent_before_load'], input[name='wpgmza_gdpr_require_consent_before_vgm_submit'], input[name='wpgmza_gdpr_override_notice']").on("change",function(event){self.updateGDPRControls()}),$('select[name="tile_server_url"]').on("change",function(event){"custom_override"===$('select[name="tile_server_url"]').val()?$(".wpgmza_tile_server_override_component").removeClass("wpgmza-hidden"):$(".wpgmza_tile_server_override_component").addClass("wpgmza-hidden")}),$('select[name="tile_server_url"]').trigger("change"),jQuery("#wpgmza_flush_cache_btn").on("click",function(){jQuery(this).attr("disabled","disabled"),WPGMZA.settingsPage.flushGeocodeCache()}),$("#wpgmza-global-settings").tabs({create:function(event,ui){var elmnt,y;void 0!==$_GET.highlight&&((elmnt=document.getElementById($_GET.highlight)).classList.add("highlight-item"),setTimeout(function(){elmnt.classList.add("highlight-item-step-2")},1e3),y=elmnt.getBoundingClientRect().top+window.pageYOffset+-100,window.scrollTo({top:y,behavior:"smooth"}))}}),$("#wpgmza-global-setting").bind("create",function(event,ui){alert("now")}),$("#wpgmza-global-settings fieldset").each(function(index,el){$(el).children(":not(legend)").wrapAll("<span class='settings-group'></span>")})},WPGMZA.SettingsPage.createInstance=function(){return new WPGMZA.SettingsPage},WPGMZA.SettingsPage.prototype.updateEngineSpecificControls=function(){var engine=$("select[name='wpgmza_maps_engine']").val();$("[data-required-maps-engine][data-required-maps-engine!='"+engine+"']").hide(),$("[data-required-maps-engine='"+engine+"']").show()},WPGMZA.SettingsPage.prototype.updateStorageControls=function(){$("input[name='wpgmza_settings_marker_pull'][value='1']").is(":checked")?$("#xml-cache-settings").show():$("#xml-cache-settings").hide()},WPGMZA.SettingsPage.prototype.updateGDPRControls=function(){var showNoticeControls=$("input[name='wpgmza_gdpr_require_consent_before_load']").prop("checked"),showOverrideTextarea=$("input[name='wpgmza_gdpr_require_consent_before_vgm_submit']");showOverrideTextarea.length&&(showNoticeControls=showNoticeControls||showOverrideTextarea.prop("checked"));showOverrideTextarea=showNoticeControls&&$("input[name='wpgmza_gdpr_override_notice']").prop("checked");showNoticeControls?$("#wpgmza-gdpr-compliance-notice").show("slow"):$("#wpgmza-gdpr-compliance-notice").hide("slow"),showOverrideTextarea?$("#wpgmza_gdpr_override_notice_text").show("slow"):$("#wpgmza_gdpr_override_notice_text").hide("slow")},WPGMZA.SettingsPage.prototype.flushGeocodeCache=function(){(new WPGMZA.OLGeocoder).clearCache(function(response){jQuery("#wpgmza_flush_cache_btn").removeAttr("disabled")})},WPGMZA.SettingsPage.prototype.onKeyPress=function(event){this._keypressHistory.push(event.key),9<this._keypressHistory.length&&(this._keypressHistory=this._keypressHistory.slice(this._keypressHistory.length-9)),"codecabin"!=this._keypressHistory.join("")||this._developerModeRevealed||($("fieldset#wpgmza-developer-mode").show(),this._developerModeRevealed=!0)},$(document).ready(function(event){WPGMZA.getCurrentPage()&&(WPGMZA.settingsPage=WPGMZA.SettingsPage.createInstance())})}),jQuery(function($){WPGMZA.StoreLocator=function(map,element){var self=this;WPGMZA.EventDispatcher.call(this),this._center=null,this.map=map,this.element=element,this.state=WPGMZA.StoreLocator.STATE_INITIAL,this.distanceUnits=this.map.settings.store_locator_distance,this.addressInput=WPGMZA.AddressInput.createInstance(this.addressElement,this.map),$(element).find(".wpgmza-not-found-msg").hide(),this.radiusElement&&this.map.settings.wpgmza_store_locator_default_radius&&0<this.radiusElement.find("option[value='"+this.map.settings.wpgmza_store_locator_default_radius+"']").length&&this.radiusElement.val(this.map.settings.wpgmza_store_locator_default_radius),this.map.on("storelocatorgeocodecomplete",function(event){self.onGeocodeComplete(event)}),this.map.on("init",function(event){self.map.markerFilter.on("filteringcomplete",function(event){self.onFilteringComplete(event)}),void 0!==self.map.settings.store_locator_style&&"modern"!=self.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style||"default"!==WPGMZA.settings.user_interface_style&&"modern"!=WPGMZA.settings.user_interface_style&&"legacy"!=WPGMZA.settings.user_interface_style||(self.legacyModernAdapter=WPGMZA.ModernStoreLocator.createInstance(map.id))}),$(document.body).on("click",".wpgmza_sl_search_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_search_button",function(event){self.onSearch(event)}),$(document.body).on("click",".wpgmza_sl_reset_button_"+map.id+", [data-map-id='"+map.id+"'] .wpgmza_sl_reset_button_div",function(event){self.onReset(event)}),$(this.addressElement).on("keypress",function(event){13==event.which&&self.onSearch(event)})},WPGMZA.StoreLocator.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.StoreLocator.prototype.constructor=WPGMZA.StoreLocator,WPGMZA.StoreLocator.STATE_INITIAL="initial",WPGMZA.StoreLocator.STATE_APPLIED="applied",WPGMZA.StoreLocator.createInstance=function(map,element){return new WPGMZA.StoreLocator(map,element)},Object.defineProperty(WPGMZA.StoreLocator.prototype,"address",{get:function(){return $(this.addressElement).val()}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"addressElement",{get:function(){return(this.legacyModernAdapter?$(this.legacyModernAdapter.element):$(this.element)).find("input.wpgmza-address")[0]}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"countryRestriction",{get:function(){return this.map.settings.wpgmza_store_locator_restrict}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radiusElement",{get:function(){return $("#radiusSelect, #radiusSelect_"+this.map.id)}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"radius",{get:function(){return parseFloat(this.radiusElement.val())}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"center",{get:function(){return this._center}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"bounds",{get:function(){return this._bounds}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"marker",{get:function(){if(1!=this.map.settings.store_locator_bounce)return null;if(this._marker)return this._marker;return this._marker=WPGMZA.Marker.createInstance({visible:!1}),this._marker.disableInfoWindow=!0,this._marker.isFilterable=!1,this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE),this._marker}}),Object.defineProperty(WPGMZA.StoreLocator.prototype,"circle",{get:function(){return this._circle||("modern"!=this.map.settings.wpgmza_store_locator_radius_style||WPGMZA.isDeviceiOS()?this._circle=WPGMZA.Circle.createInstance({strokeColor:"#ff0000",strokeOpacity:"0.25",strokeWeight:2,fillColor:"#ff0000",fillOpacity:"0.15",visible:!1,clickable:!1,center:new WPGMZA.LatLng}):(this._circle=WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id),this._circle.settings.color=this.circleStrokeColor),this._circle)}}),WPGMZA.StoreLocator.prototype.onGeocodeComplete=function(event){if(!event.results||!event.results.length)return this._center=null,void(this._bounds=null);this._center=new WPGMZA.LatLng(event.results[0].latLng),this._bounds=new WPGMZA.LatLngBounds(event.results[0].bounds),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.onSearch=function(event){var geocoder,options,self=this;return this.state=WPGMZA.StoreLocator.STATE_APPLIED,this.address&&this.address.length?(void 0!==this.map.settings.store_locator_style&&"modern"!==this.map.settings.store_locator_style&&"modern"!==WPGMZA.settings.user_interface_style&&"default"===WPGMZA.settings.user_interface_style&&WPGMZA.animateScroll(this.map.element),$(this.element).find(".wpgmza-not-found-msg").hide(),WPGMZA.LatLng.isLatLngString(this.address)?callback([WPGMZA.LatLng.fromString(this.address)],WPGMZA.Geocoder.SUCCESS):(geocoder=WPGMZA.Geocoder.createInstance(),options={address:this.address},this.countryRestriction&&(options.country=this.countryRestriction),geocoder.geocode(options,function(results,status){status==WPGMZA.Geocoder.SUCCESS?callback(results,status):alert(WPGMZA.localized_strings.address_not_found)})),!0):(this.addressElement.focus(),!1);function callback(results,status){self.map.trigger({type:"storelocatorgeocodecomplete",results:results,status:status})}},WPGMZA.StoreLocator.prototype.onReset=function(event){this.state=WPGMZA.StoreLocator.STATE_INITIAL,this._center=null,this._bounds=null,this.map.setZoom(this.map.settings.map_start_zoom),$(this.element).find(".wpgmza-not-found-msg").hide(),this.circle&&this.circle.setVisible(!1),this.marker&&this.marker.map&&this.map.removeMarker(this.marker),this.map.markerFilter.update({},this)},WPGMZA.StoreLocator.prototype.getFilteringParameters=function(){return this.center?{center:this.center,radius:this.radius}:{}},WPGMZA.StoreLocator.prototype.getZoomFromRadius=function(radius){return this.distanceUnits==WPGMZA.Distance.MILES&&(radius*=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(14-Math.log(radius)/Math.LN2)},WPGMZA.StoreLocator.prototype.onFilteringComplete=function(event){var params=event.filteringParams,factor=this.marker;factor&&factor.setVisible(!1),params.center&&(this.map.setCenter(params.center),factor&&(factor.setPosition(params.center),factor.setVisible(!0),factor.map!=this.map&&this.map.addMarker(factor))),params.radius&&this.map.setZoom(this.getZoomFromRadius(params.radius));var circle=this.circle;circle&&(circle.setVisible(!1),factor=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.Distance.KILOMETERS_PER_MILE:1,params.center&¶ms.radius&&(circle.setRadius(params.radius*factor),circle.setCenter(params.center),circle.setVisible(!0),circle instanceof WPGMZA.ModernStoreLocatorCircle||circle.map==this.map||this.map.addCircle(circle)),circle instanceof WPGMZA.ModernStoreLocatorCircle&&(circle.settings.radiusString=this.radius)),0==event.filteredMarkers.length&&this.state===WPGMZA.StoreLocator.STATE_APPLIED&&(0<$(this.element).find(".wpgmza-no-results").length&&"legacy"===WPGMZA.settings.user_interface_style?$(this.element).find(".wpgmza-no-results").show():alert(this.map.settings.store_locator_not_found_message||WPGMZA.localized_strings.zero_results))}}),jQuery(function($){WPGMZA.Text=function(options){if(options)for(var name in options)this[name]=options[name]},WPGMZA.Text.createInstance=function(options){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleText:WPGMZA.OLText)(options)}}),jQuery(function($){WPGMZA.ThemeEditor=function(){WPGMZA.EventDispatcher.call(this),this.element=$("#wpgmza-theme-editor"),"open-layers"!=WPGMZA.settings.engine?this.element.length?(this.json=[{}],this.mapElement=WPGMZA.maps[0].element,this.element.appendTo("#wpgmza-map-theme-editor__holder"),$(window).on("scroll",function(event){}),setInterval(function(){},200),this.initHTML(),WPGMZA.themeEditor=this):console.warn("No element to initialise theme editor on"):this.element.remove()},WPGMZA.extend(WPGMZA.ThemeEditor,WPGMZA.EventDispatcher),WPGMZA.ThemeEditor.prototype.updatePosition=function(){},WPGMZA.ThemeEditor.features={all:[],administrative:["country","land_parcel","locality","neighborhood","province"],landscape:["man_made","natural","natural.landcover","natural.terrain"],poi:["attraction","business","government","medical","park","place_of_worship","school","sports_complex"],road:["arterial","highway","highway.controlled_access","local"],transit:["line","station","station.airport","station.bus","station.rail"],water:[]},WPGMZA.ThemeEditor.elements={all:[],geometry:["fill","stroke"],labels:["icon","text","text.fill","text.stroke"]},WPGMZA.ThemeEditor.prototype.parse=function(){$("#wpgmza_theme_editor_feature option, #wpgmza_theme_editor_element option").css("font-weight","normal"),$("#wpgmza_theme_editor_error").hide(),$("#wpgmza_theme_editor").show(),$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val("");var jsonCopy=$('textarea[name="wpgmza_theme_data"]');if(!jsonCopy.val()||jsonCopy.val().length<1)this.json=[{}];else{try{this.json=$.parseJSON($('textarea[name="wpgmza_theme_data"]').val())}catch(e){return this.json=[{}],$("#wpgmza_theme_editor").hide(),void $("#wpgmza_theme_editor_error").show()}$.isArray(this.json)||(jsonCopy=this.json,this.json=[],this.json.push(jsonCopy)),this.highlightFeatures(),this.highlightElements(),this.loadElementStylers()}},WPGMZA.ThemeEditor.prototype.highlightFeatures=function(){$("#wpgmza_theme_editor_feature option").css("font-weight","normal"),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")?$('#wpgmza_theme_editor_feature option[value="'+v.featureType+'"]'):$('#wpgmza_theme_editor_feature option[value="all"]')).css("font-weight","bold")})},WPGMZA.ThemeEditor.prototype.highlightElements=function(){var feature=$("#wpgmza_theme_editor_feature").val();$("#wpgmza_theme_editor_element option").css("font-weight","normal"),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")?$('#wpgmza_theme_editor_element option[value="'+v.elementType+'"]'):$('#wpgmza_theme_editor_element option[value="all"]')).css("font-weight","bold")})},WPGMZA.ThemeEditor.prototype.loadElementStylers=function(){var feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val();$("#wpgmza_theme_editor_do_hue").prop("checked",!1),$("#wpgmza_theme_editor_hue").val("#000000"),$("#wpgmza_theme_editor_lightness").val(""),$("#wpgmza_theme_editor_saturation").val(""),$("#wpgmza_theme_editor_gamma").val(""),$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!1),$("#wpgmza_theme_editor_visibility").val("inherit"),$("#wpgmza_theme_editor_do_color").prop("checked",!1),$("#wpgmza_theme_editor_color").val("#000000"),$("#wpgmza_theme_editor_weight").val(""),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&v.hasOwnProperty("stylers")&&$.isArray(v.stylers)&&0<v.stylers.length&&$.each(v.stylers,function(ii,vv){vv.hasOwnProperty("hue")&&($("#wpgmza_theme_editor_do_hue").prop("checked",!0),$("#wpgmza_theme_editor_hue").val(vv.hue)),vv.hasOwnProperty("lightness")&&$("#wpgmza_theme_editor_lightness").val(vv.lightness),vv.hasOwnProperty("saturation")&&$("#wpgmza_theme_editor_saturation").val(vv.xaturation),vv.hasOwnProperty("gamma")&&$("#wpgmza_theme_editor_gamma").val(vv.gamma),vv.hasOwnProperty("invert_lightness")&&$("#wpgmza_theme_editor_do_invert_lightness").prop("checked",!0),vv.hasOwnProperty("visibility")&&$("#wpgmza_theme_editor_visibility").val(vv.visibility),vv.hasOwnProperty("color")&&($("#wpgmza_theme_editor_do_color").prop("checked",!0),$("#wpgmza_theme_editor_color").val(vv.color)),vv.hasOwnProperty("weight")&&$("#wpgmza_theme_editor_weight").val(vv.weight)})})},WPGMZA.ThemeEditor.prototype.writeElementStylers=function(){var new_feature_element_stylers,feature=$("#wpgmza_theme_editor_feature").val(),element=$("#wpgmza_theme_editor_element").val(),indexJSON=null,stylers=[];"inherit"!=$("#wpgmza_theme_editor_visibility").val()&&stylers.push({visibility:$("#wpgmza_theme_editor_visibility").val()}),!0===$("#wpgmza_theme_editor_do_color").prop("checked")&&stylers.push({color:$("#wpgmza_theme_editor_color").val()}),!0===$("#wpgmza_theme_editor_do_hue").prop("checked")&&stylers.push({hue:$("#wpgmza_theme_editor_hue").val()}),0<$("#wpgmza_theme_editor_gamma").val().length&&stylers.push({gamma:parseFloat($("#wpgmza_theme_editor_gamma").val())}),0<$("#wpgmza_theme_editor_weight").val().length&&stylers.push({weight:parseFloat($("#wpgmza_theme_editor_weight").val())}),0<$("#wpgmza_theme_editor_saturation").val().length&&stylers.push({saturation:parseFloat($("#wpgmza_theme_editor_saturation").val())}),0<$("#wpgmza_theme_editor_lightness").val().length&&stylers.push({lightness:parseFloat($("#wpgmza_theme_editor_lightness").val())}),!0===$("#wpgmza_theme_editor_do_invert_lightness").prop("checked")&&stylers.push({invert_lightness:!0}),$.each(this.json,function(i,v){(v.hasOwnProperty("featureType")&&v.featureType==feature||"all"==feature&&!v.hasOwnProperty("featureType"))&&(v.hasOwnProperty("elementType")&&v.elementType==element||"all"==element&&!v.hasOwnProperty("elementType"))&&(indexJSON=i)}),null===indexJSON?0<stylers.length&&(new_feature_element_stylers={},"all"!=feature&&(new_feature_element_stylers.featureType=feature),"all"!=element&&(new_feature_element_stylers.elementType=element),new_feature_element_stylers.stylers=stylers,this.json.push(new_feature_element_stylers)):0<stylers.length?this.json[indexJSON].stylers=stylers:this.json.splice(indexJSON,1),$('textarea[name="wpgmza_theme_data"]').val(JSON.stringify(this.json).replace(/:/g,": ").replace(/,/g,", ")),this.highlightFeatures(),this.highlightElements(),WPGMZA.themePanel.updateMapTheme()},WPGMZA.ThemeEditor.prototype.initHTML=function(){var self=this;$.each(WPGMZA.ThemeEditor.features,function(i,v){$("#wpgmza_theme_editor_feature").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_feature").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),$.each(WPGMZA.ThemeEditor.elements,function(i,v){$("#wpgmza_theme_editor_element").append('<option value="'+i+'">'+i+"</option>"),0<v.length&&$.each(v,function(ii,vv){$("#wpgmza_theme_editor_element").append('<option value="'+i+"."+vv+'">'+i+"."+vv+"</option>")})}),this.parse(),$('textarea[name="wpgmza_theme_data"]').on("input selectionchange propertychange",function(){self.parse()}),$(".wpgmza_theme_selection").click(function(){setTimeout(function(){$('textarea[name="wpgmza_theme_data"]').trigger("input")},1e3)}),$("#wpgmza-theme-editor__toggle").click(function(){$("#wpgmza-theme-editor").removeClass("active")}),$("#wpgmza_theme_editor_feature").on("change",function(){self.highlightElements(),self.loadElementStylers()}),$("#wpgmza_theme_editor_element").on("change",function(){self.loadElementStylers()}),$("#wpgmza_theme_editor_do_hue, #wpgmza_theme_editor_hue, #wpgmza_theme_editor_lightness, #wpgmza_theme_editor_saturation, #wpgmza_theme_editor_gamma, #wpgmza_theme_editor_do_invert_lightness, #wpgmza_theme_editor_visibility, #wpgmza_theme_editor_do_color, #wpgmza_theme_editor_color, #wpgmza_theme_editor_weight").on("input selectionchange propertychange",function(){self.writeElementStylers()}),"open-layers"==WPGMZA.settings.engine&&$("#wpgmza_theme_editor :input").prop("disabled",!0)}}),jQuery(function($){WPGMZA.ThemePanel=function(){var self=this;this.element=$("#wpgmza-theme-panel"),this.map=WPGMZA.maps[0],"open-layers"!=WPGMZA.settings.engine?this.element.length?($("#wpgmza-theme-presets").owlCarousel({items:6,dots:!0}),this.element.on("click","#wpgmza-theme-presets label",function(event){self.onThemePresetClick(event)}),$("#wpgmza-open-theme-editor").on("click",function(event){$("#wpgmza-map-theme-editor__holder").addClass("active"),$("#wpgmza-theme-editor").addClass("active"),WPGMZA.animateScroll($("#wpgmza-theme-editor"))}),WPGMZA.themePanel=this):console.warn("No element to initialise theme panel on"):this.element.remove()},WPGMZA.ThemePanel.previewImageCenter={lat:33.701806462148646,lng:-118.15949896058983},WPGMZA.ThemePanel.previewImageZoom=11,WPGMZA.ThemePanel.prototype.onThemePresetClick=function(existingData){var selectedData=$(existingData.currentTarget).find("[data-theme-json]").attr("data-theme-json"),textarea=$(this.element).find("textarea[name='wpgmza_theme_data']"),existingData=textarea.val(),allPresetData=[];$(this.element).find("[data-theme-json]").each(function(index,el){allPresetData.push($(el).attr("data-theme-json"))}),existingData.length&&-1==allPresetData.indexOf(existingData)&&!confirm(WPGMZA.localized_strings.overwrite_theme_data)||(textarea.val(selectedData),this.updateMapTheme(),WPGMZA.themeEditor.parse())},WPGMZA.ThemePanel.prototype.updateMapTheme=function(){var data;try{data=JSON.parse($("textarea[name='wpgmza_theme_data']").val())}catch(e){return void alert(WPGMZA.localized_strings.invalid_theme_data)}this.map.setOptions({styles:data})}}),jQuery(function($){WPGMZA.Version=function(){},WPGMZA.Version.GREATER_THAN=1,WPGMZA.Version.EQUAL_TO=0,WPGMZA.Version.LESS_THAN=-1,WPGMZA.Version.compare=function(v1,v2){for(var v1parts=v1.match(/\d+/g),v2parts=v2.match(/\d+/g),i=0;i<v1parts.length;++i){if(v2parts.length===i)return 1;if(v1parts[i]!==v2parts[i])return v1parts[i]>v2parts[i]?1:-1}return v1parts.length!=v2parts.length?-1:0}}),jQuery(function($){WPGMZA.XMLCacheConverter=function(){},WPGMZA.XMLCacheConverter.prototype.convert=function(xml){var markers=[],remap={marker_id:"id",linkd:"link"};return $(xml).find("marker").each(function(index,el){var data={};$(el).children().each(function(j,child){var key=child.nodeName;remap[key]&&(key=remap[key]),child.hasAttribute("data-json")?data[key]=JSON.parse($(child).text()):data[key]=$(child).text()}),markers.push(data)}),markers}}),jQuery(function($){WPGMZA.loadXMLAsWebWorker=function(){function tXml(a,d){function c(){for(var l=[];a[b];){if(60==a.charCodeAt(b)){if(47===a.charCodeAt(b+1)){b=a.indexOf(">",b);break}if(33===a.charCodeAt(b+1)){if(45==a.charCodeAt(b+2)){for(;62!==a.charCodeAt(b)||45!=a.charCodeAt(b-1)||45!=a.charCodeAt(b-2)||-1==b;)b=a.indexOf(">",b+1);-1===b&&(b=a.length)}else for(b+=2;62!==a.charCodeAt(b);)b++;b++;continue}var c=f();l.push(c)}else c=b,-2===(b=a.indexOf("<",b)-1)&&(b=a.length),0<(c=a.slice(c,b+1)).trim().length&&l.push(c);b++}return l}function l(){for(var c=b;-1===g.indexOf(a[b]);)b++;return a.slice(c,b)}function f(){var d={};b++,d.tagName=l();for(var f=!1;62!==a.charCodeAt(b);){if(64<(e=a.charCodeAt(b))&&e<91||96<e&&e<123){for(var h,g=l(),e=a.charCodeAt(b);39!==e&&34!==e&&!(64<e&&e<91||96<e&&e<123)&&62!==e;)b++,e=a.charCodeAt(b);f||(d.attributes={},f=!0),39===e||34===e?(e=a[b],h=++b,b=a.indexOf(e,h),e=a.slice(h,b)):(e=null,b--),d.attributes[g]=e}b++}return 47!==a.charCodeAt(b-1)&&("script"==d.tagName?(f=b+1,b=a.indexOf("<\/script>",b),d.children=[a.slice(f,b-1)],b+=8):"style"==d.tagName?(f=b+1,b=a.indexOf("</style>",b),d.children=[a.slice(f,b-1)],b+=7):-1==k.indexOf(d.tagName)&&(b++,d.children=c())),d}var g="\n\t>/= ",k=["img","br","input","meta","link"],h=null;if((d=d||{}).searchId){var b=new RegExp("s*ids*=s*['\"]"+d.searchId+"['\"]").exec(a).index;return-1!==b&&(-1!==(b=a.lastIndexOf("<",b))&&(h=f())),b}return b=0,h=c(),d.filter&&(h=tXml.filter(h,d.filter)),d.simplify&&(h=tXml.simplefy(h)),h}tXml.simplify=function(a){var c,d={};if(1===a.length&&"string"==typeof a[0])return a[0];for(c in a.forEach(function(a){var c;d[a.tagName]||(d[a.tagName]=[]),"object"==typeof a?(c=tXml.simplefy(a.children),d[a.tagName].push(c),a.attributes&&(c._attributes=a.attributes)):d[a.tagName].push(a)}),d)1==d[c].length&&(d[c]=d[c][0]);return d},tXml.filter=function(a,d){var c=[];return a.forEach(function(a){"object"==typeof a&&d(a)&&c.push(a),a.children&&(a=tXml.filter(a.children,d),c=c.concat(a))}),c},tXml.domToXml=function(a){var c="";return function d(a){if(a)for(var f=0;f<a.length;f++)if("string"==typeof a[f])c+=a[f].trim();else{var g=a[f];c+="<"+g.tagName;var k=void 0;for(k in g.attributes)c=-1===g.attributes[k].indexOf('"')?c+(" "+k+'="'+g.attributes[k].trim())+'"':c+(" "+k+"='"+g.attributes[k].trim())+"'";c+=">",d(g.children),c+="</"+g.tagName+">"}}(O),c},"object"!=typeof window&&(module.exports=tXml);var inputData,totalFiles,worker=self,dataForMainThread=[],filesLoaded=0;function onXMLLoaded(request){4==request.readyState&&200==request.status&&((new Date).getTime(),function(){for(var markers=tXml(request.responseText)[0].children[0],remap={marker_id:"id",linkd:"link"},i=0;i<markers.children.length;i++){var data={};markers.children[i].children.forEach(function(node){var key=node.tagName;remap[key]&&(key=remap[key]),node.attributes["data-json"]?data[key]=JSON.parse(node.children[0]):node.children.length?data[key]=node.children[0]:data[key]=""}),dataForMainThread.push(data)}}(),++filesLoaded>=totalFiles?worker.postMessage(dataForMainThread):loadNextFile())}function loadNextFile(){var url=inputData.urls[filesLoaded],request=new XMLHttpRequest;request.onreadystatechange=function(){onXMLLoaded(this)},request.open("GET",inputData.protocol+url,!0),request.send()}self.addEventListener("message",function(data){data=data.data;if("load"!==data.command)throw new Error("Unknown command");dataForMainThread=[],filesLoaded=0,totalFiles=(inputData=data).urls.length,loadNextFile()},!1)}}),jQuery(function($){WPGMZA.Integration={},WPGMZA.integrationModules={}}),jQuery(function($){var __,registerBlockType,InspectorControls,_wp$components,Dashicon,PanelBody;window.wp&&wp.i18n&&wp.blocks&&wp.editor&&wp.components&&(__=wp.i18n.__,registerBlockType=wp.blocks.registerBlockType,_wp$components=wp.editor,InspectorControls=_wp$components.InspectorControls,_wp$components.BlockControls,_wp$components=wp.components,Dashicon=_wp$components.Dashicon,_wp$components.Toolbar,_wp$components.Button,_wp$components.Tooltip,PanelBody=_wp$components.PanelBody,_wp$components.TextareaControl,_wp$components.CheckboxControl,_wp$components.TextControl,_wp$components.SelectControl,_wp$components.RichText,WPGMZA.Integration.Gutenberg=function(){registerBlockType("gutenberg-wpgmza/block",this.getBlockDefinition())},WPGMZA.Integration.Gutenberg.prototype.getBlockTitle=function(){return __("WP Google Maps")},WPGMZA.Integration.Gutenberg.prototype.getBlockInspectorControls=function(props){return React.createElement(InspectorControls,{key:"inspector"},React.createElement(PanelBody,{title:__("Map Settings")},React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu&action=edit&map_id=1",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-pencil-square-o","aria-hidden":"true"}),__("Go to Map Editor"))),React.createElement("p",{class:"map-block-gutenberg-button-container"},React.createElement("a",{href:"https://www.wpgmaps.com/documentation/creating-your-first-map/",target:"_blank",class:"button button-primary"},React.createElement("i",{class:"fa fa-book","aria-hidden":"true"}),__("View Documentation")))))},WPGMZA.Integration.Gutenberg.prototype.getBlockAttributes=function(){return{}},WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition=function(props){var _this=this;return{title:__("WP Google Maps"),description:__("The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss."),category:"common",icon:"location-alt",keywords:[__("Map"),__("Maps"),__("Google")],attributes:this.getBlockAttributes(),edit:function(props){return[!!props.isSelected&&_this.getBlockInspectorControls(props),React.createElement("div",{className:props.className+" wpgmza-gutenberg-block"},React.createElement(Dashicon,{icon:"location-alt"}),React.createElement("span",{class:"wpgmza-gutenberg-block-title"},__("Your map will appear here on your websites front end")))]},save:function(){return null}}},WPGMZA.Integration.Gutenberg.getConstructor=function(){return WPGMZA.Integration.Gutenberg},WPGMZA.Integration.Gutenberg.createInstance=function(){return new(WPGMZA.Integration.Gutenberg.getConstructor())},WPGMZA.isProVersion()||/^6/.test(WPGMZA.pro_version)||(WPGMZA.integrationModules.gutenberg=WPGMZA.Integration.Gutenberg.createInstance()))}),jQuery(function($){$(document).ready(function(event){var parent=document.body.onclick;parent&&(document.body.onclick=function(event){event.target instanceof WPGMZA.Marker||parent(event)})})}),jQuery(function($){WPGMZA.GoogleUICompatibility=function(){var style;navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS")||((style=$("<style id='wpgmza-google-ui-compatiblity-fix'/>")).html(".wpgmza_map img:not(button img) { padding:0 !important; }"),$(document.head).append(style))},WPGMZA.googleUICompatibility=new WPGMZA.GoogleUICompatibility}),jQuery(function($){WPGMZA.GoogleCircle=function(options,googleCircle){var self=this;WPGMZA.Circle.call(this,options,googleCircle),googleCircle?(this.googleCircle=googleCircle,options&&(options.center=WPGMZA.LatLng.fromGoogleLatLng(googleCircle.getCenter()),options.radius=googleCircle.getRadius()/1e3)):(this.googleCircle=new google.maps.Circle,this.googleCircle.wpgmzaCircle=this),this.googleFeature=this.googleCircle,options&&this.setOptions(options),google.maps.event.addListener(this.googleCircle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleCircle.prototype=Object.create(WPGMZA.Circle.prototype),WPGMZA.GoogleCircle.prototype.constructor=WPGMZA.GoogleCircle,WPGMZA.GoogleCircle.prototype.getCenter=function(){return WPGMZA.LatLng.fromGoogleLatLng(this.googleCircle.getCenter())},WPGMZA.GoogleCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.googleCircle.setCenter(center)},WPGMZA.GoogleCircle.prototype.getRadius=function(){return this.googleCircle.getRadius()/1e3},WPGMZA.GoogleCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments),this.googleCircle.setRadius(1e3*parseFloat(radius))},WPGMZA.GoogleCircle.prototype.setVisible=function(visible){this.googleCircle.setVisible(!!visible)},WPGMZA.GoogleCircle.prototype.setDraggable=function(value){this.googleCircle.setDraggable(!!value)},WPGMZA.GoogleCircle.prototype.setEditable=function(value){var self=this;this.googleCircle.setOptions({editable:value}),value&&(google.maps.event.addListener(this.googleCircle,"center_changed",function(event){self.center=WPGMZA.LatLng.fromGoogleLatLng(self.googleCircle.getCenter()),self.trigger("change")}),google.maps.event.addListener(this.googleCircle,"radius_changed",function(event){self.radius=self.googleCircle.getRadius()/1e3,self.trigger("change")}))},WPGMZA.GoogleCircle.prototype.setOptions=function(options){WPGMZA.Circle.prototype.setOptions.apply(this,arguments),options.center&&(this.center=new WPGMZA.LatLng(options.center))},WPGMZA.GoogleCircle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),center=new WPGMZA.LatLng(this.center);googleOptions.radius*=1e3,googleOptions.center=center.toGoogleLatLng(),this.googleCircle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleDrawingManager=function(map){var self=this;WPGMZA.DrawingManager.call(this,map),this.mode=null,this.googleDrawingManager=new google.maps.drawing.DrawingManager({drawingControl:!1,polygonOptions:{editable:!0},polylineOptions:{editable:!0},circleOptions:{editable:!0},rectangleOptions:{editable:!0}}),this.googleDrawingManager.setMap(map.googleMap),google.maps.event.addListener(this.googleDrawingManager,"polygoncomplete",function(polygon){self.onPolygonClosed(polygon)}),google.maps.event.addListener(this.googleDrawingManager,"polylinecomplete",function(polyline){self.onPolylineComplete(polyline)}),google.maps.event.addListener(this.googleDrawingManager,"circlecomplete",function(circle){self.onCircleComplete(circle)}),google.maps.event.addListener(this.googleDrawingManager,"rectanglecomplete",function(rectangle){self.onRectangleComplete(rectangle)})},WPGMZA.GoogleDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.GoogleDrawingManager.prototype.constructor=WPGMZA.GoogleDrawingManager,WPGMZA.GoogleDrawingManager.prototype.setDrawingMode=function(mode){var googleMode;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:googleMode=null;break;case WPGMZA.DrawingManager.MODE_POLYGON:googleMode=google.maps.drawing.OverlayType.POLYGON;break;case WPGMZA.DrawingManager.MODE_POLYLINE:googleMode=google.maps.drawing.OverlayType.POLYLINE;break;case WPGMZA.DrawingManager.MODE_CIRCLE:googleMode=google.maps.drawing.OverlayType.CIRCLE;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:googleMode=google.maps.drawing.OverlayType.RECTANGLE;break;case WPGMZA.DrawingManager.MODE_HEATMAP:googleMode=null;break;default:throw new Error("Invalid drawing mode")}this.googleDrawingManager.setDrawingMode(googleMode)},WPGMZA.GoogleDrawingManager.prototype.setOptions=function(options){this.googleDrawingManager.setOptions({polygonOptions:options,polylineOptions:options})},WPGMZA.GoogleDrawingManager.prototype.onVertexClicked=function(event){},WPGMZA.GoogleDrawingManager.prototype.onPolygonClosed=function(googlePolygon){var event=new WPGMZA.Event("polygonclosed");event.enginePolygon=googlePolygon,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onPolylineComplete=function(googlePolyline){var event=new WPGMZA.Event("polylinecomplete");event.enginePolyline=googlePolyline,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onCircleComplete=function(googleCircle){var event=new WPGMZA.Event("circlecomplete");event.engineCircle=googleCircle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onRectangleComplete=function(googleRectangle){var event=new WPGMZA.Event("rectanglecomplete");event.engineRectangle=googleRectangle,this.dispatchEvent(event)},WPGMZA.GoogleDrawingManager.prototype.onHeatmapPointAdded=function(image){var position=WPGMZA.LatLng.fromGoogleLatLng(image.getPosition());image.setMap(null);var event=WPGMZA.Marker.createInstance();event.setPosition(position);image={url:WPGMZA.imageFolderURL+"heatmap-point.png",origin:new google.maps.Point(0,0),anchor:new google.maps.Point(13,13)};event.googleMarker.setIcon(image),this.map.addMarker(event);event=new WPGMZA.Event("heatmappointadded");event.position=position,this.trigger(event)}}),jQuery(function($){WPGMZA.GoogleGeocoder=function(){},WPGMZA.GoogleGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.GoogleGeocoder.prototype.constructor=WPGMZA.GoogleGeocoder,WPGMZA.GoogleGeocoder.prototype.getLatLngFromAddress=function(options,callback){return options&&options.address?(options.lat&&options.lng&&(latLng={lat:options.lat,lng:options.lng},callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:null}],WPGMZA.Geocoder.SUCCESS)),WPGMZA.isLatLngString(options.address)?WPGMZA.Geocoder.prototype.getLatLngFromAddress.call(this,options,callback):(options.country&&(options.componentRestrictions={country:options.country}),void(new google.maps.Geocoder).geocode(options,function(nativeStatus,status){var latLng,bounds;status==google.maps.GeocoderStatus.OK?(latLng={lat:(bounds=nativeStatus[0].geometry.location).lat(),lng:bounds.lng()},bounds=null,nativeStatus[0].geometry.bounds&&(bounds=WPGMZA.LatLngBounds.fromGoogleLatLngBounds(nativeStatus[0].geometry.bounds)),callback(nativeStatus=[{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng,bounds:bounds}],WPGMZA.Geocoder.SUCCESS)):(nativeStatus=WPGMZA.Geocoder.FAIL,status==google.maps.GeocoderStatus.ZERO_RESULTS&&(nativeStatus=WPGMZA.Geocoder.ZERO_RESULTS),callback(null,nativeStatus))}))):(nativeStatus=WPGMZA.Geocoder.NO_ADDRESS,void callback(null,nativeStatus));var latLng},WPGMZA.GoogleGeocoder.prototype.getAddressFromLatLng=function(options,callback){if(!options||!options.latLng)throw new Error("No latLng specified");var latLng=new WPGMZA.LatLng(options.latLng),geocoder=new google.maps.Geocoder;delete(options=$.extend(options,{location:{lat:latLng.lat,lng:latLng.lng}})).latLng,geocoder.geocode(options,function(results,status){"OK"!==status&&callback(null,WPGMZA.Geocoder.FAIL),results&&results.length||callback([],WPGMZA.Geocoder.NO_RESULTS),callback([results[0].formatted_address],WPGMZA.Geocoder.SUCCESS)})}}),jQuery(function($){WPGMZA.settings.engine&&"google-maps"!=WPGMZA.settings.engine||window.google&&window.google.maps&&(WPGMZA.GoogleHTMLOverlay=function(map){this.element=$("<div class='wpgmza-google-html-overlay'></div>"),this.visible=!0,this.position=new WPGMZA.LatLng,this.setMap(map.googleMap),this.wpgmzaMap=map},WPGMZA.GoogleHTMLOverlay.prototype=new google.maps.OverlayView,WPGMZA.GoogleHTMLOverlay.prototype.onAdd=function(){this.getPanes().overlayMouseTarget.appendChild(this.element[0])},WPGMZA.GoogleHTMLOverlay.prototype.onRemove=function(){this.element&&$(this.element).parent().length&&($(this.element).remove(),this.element=null)},WPGMZA.GoogleHTMLOverlay.prototype.draw=function(){this.updateElementPosition()},WPGMZA.GoogleHTMLOverlay.prototype.updateElementPosition=function(){var pixels=this.getProjection();pixels&&(pixels=pixels.fromLatLngToDivPixel(this.position.toGoogleLatLng()),$(this.element).css({left:pixels.x,top:pixels.y}))})}),jQuery(function($){WPGMZA.GoogleModernStoreLocatorCircle=function(map,settings){var self=this;WPGMZA.ModernStoreLocatorCircle.call(this,map,settings),this.intervalID=setInterval(function(){var mapSize={width:$(self.mapElement).width(),height:$(self.mapElement).height()};mapSize.width==self.mapSize.width&&mapSize.height==self.mapSize.height||(self.canvasLayer.resize_(),self.canvasLayer.draw(),self.mapSize=mapSize)},1e3),$(document).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){self.canvasLayer.resize_(),self.canvasLayer.draw()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.GoogleModernStoreLocatorCircle.prototype.constructor=WPGMZA.GoogleModernStoreLocatorCircle,WPGMZA.GoogleModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this;this.canvasLayer&&(this.canvasLayer.setMap(null),this.canvasLayer.setAnimate(!1)),this.canvasLayer=new CanvasLayer({map:this.map.googleMap,resizeHandler:function(event){self.onResize(event)},updateHandler:function(event){self.onUpdate(event)},animate:!0,resolutionScale:this.getResolutionScale()})},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setOptions=function(options){WPGMZA.ModernStoreLocatorCircle.prototype.setOptions.call(this,options),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setPosition=function(position){WPGMZA.ModernStoreLocatorCircle.prototype.setPosition.call(this,position),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setRadius=function(radius){WPGMZA.ModernStoreLocatorCircle.prototype.setRadius.call(this,radius),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var spherical=google.maps.geometry.spherical,latitude=this.settings.center,result=new WPGMZA.LatLng({lat:0,lng:0}),latitude=new WPGMZA.LatLng({lat:latitude.lat,lng:0}),result=spherical.computeOffset(result.toGoogleLatLng(),1e3*km,90),result=.006395*km*(spherical.computeOffset(latitude.toGoogleLatLng(),1e3*km,90).lng()/result.lng());if(isNaN(result))throw new Error("here");return result},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvasLayer.canvas.width,height:this.canvasLayer.canvas.height}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){var position=this.map.googleMap.getProjection().fromLatLngToPoint(this.canvasLayer.getTopLeft());return{x:-position.x,y:-position.y}},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getCenterPixels=function(){var center=new WPGMZA.LatLng(this.settings.center);return this.map.googleMap.getProjection().fromLatLngToPoint(center.toGoogleLatLng())},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvasLayer.canvas.getContext("2d")},WPGMZA.GoogleModernStoreLocatorCircle.prototype.getScale=function(){return Math.pow(2,this.map.getZoom())*this.getResolutionScale()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.setVisible=function(visible){WPGMZA.ModernStoreLocatorCircle.prototype.setVisible.call(this,visible),this.canvasLayer.scheduleUpdate()},WPGMZA.GoogleModernStoreLocatorCircle.prototype.destroy=function(){this.canvasLayer.setMap(null),this.canvasLayer=null,clearInterval(this.intervalID)}}),jQuery(function($){WPGMZA.GooglePolyline=function(options,path){var self=this;WPGMZA.Polyline.call(this,options,path),this.googlePolyline=path||new google.maps.Polyline(this.settings),this.googleFeature=this.googlePolyline,options&&options.polydata&&(path=this.parseGeometry(options.polydata),this.googlePolyline.setPath(path)),this.googlePolyline.wpgmzaPolyline=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolyline,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GooglePolyline.prototype=Object.create(WPGMZA.Polyline.prototype),WPGMZA.GooglePolyline.prototype.constructor=WPGMZA.GooglePolyline,WPGMZA.GooglePolyline.prototype.updateNativeFeature=function(){this.googlePolyline.setOptions(this.getScalarProperties())},WPGMZA.GooglePolyline.prototype.setEditable=function(value){var path,self=this;this.googlePolyline.setOptions({editable:value}),value&&(path=this.googlePolyline.getPath(),["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})}),google.maps.event.addListener(this.googlePolyline,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolyline,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))}))},WPGMZA.GooglePolyline.prototype.setDraggable=function(value){this.googlePolyline.setOptions({draggable:value})},WPGMZA.GooglePolyline.prototype.getGeometry=function(){for(var result=[],path=this.googlePolyline.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){WPGMZA.GoogleRectangle=function(options,googleRectangle){var self=this;options=options||{},WPGMZA.Rectangle.call(this,options,googleRectangle),googleRectangle?(this.googleRectangle=googleRectangle,this.cornerA=options.cornerA=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getNorthEast().lat(),lng:googleRectangle.getBounds().getSouthWest().lng()}),this.cornerB=options.cornerB=new WPGMZA.LatLng({lat:googleRectangle.getBounds().getSouthWest().lat(),lng:googleRectangle.getBounds().getNorthEast().lng()})):(this.googleRectangle=new google.maps.Rectangle,this.googleRectangle.wpgmzaRectangle=this),this.googleFeature=this.googleRectangle,options&&this.setOptions(options),google.maps.event.addListener(this.googleRectangle,"click",function(){self.dispatchEvent({type:"click"})})},WPGMZA.GoogleRectangle.prototype=Object.create(WPGMZA.Rectangle.prototype),WPGMZA.GoogleRectangle.prototype.constructor=WPGMZA.GoogleRectangle,WPGMZA.GoogleRectangle.prototype.getBounds=function(){return WPGMZA.LatLngBounds.fromGoogleLatLngBounds(this.googleRectangle.getBounds())},WPGMZA.GoogleRectangle.prototype.setVisible=function(visible){this.googleRectangle.setVisible(!!visible)},WPGMZA.GoogleRectangle.prototype.setDraggable=function(value){this.googleRectangle.setDraggable(!!value)},WPGMZA.GoogleRectangle.prototype.setEditable=function(value){var self=this;this.googleRectangle.setEditable(!!value),value&&google.maps.event.addListener(this.googleRectangle,"bounds_changed",function(event){self.trigger("change")})},WPGMZA.GoogleRectangle.prototype.setOptions=function(options){WPGMZA.Rectangle.prototype.setOptions.apply(this,arguments),options.cornerA&&options.cornerB&&(this.cornerA=new WPGMZA.LatLng(options.cornerA),this.cornerB=new WPGMZA.LatLng(options.cornerB))},WPGMZA.GoogleRectangle.prototype.updateNativeFeature=function(){var googleOptions=this.getScalarProperties(),north=parseFloat(this.cornerA.lat),west=parseFloat(this.cornerA.lng),south=parseFloat(this.cornerB.lat),east=parseFloat(this.cornerB.lng);north&&west&&south&&east&&(googleOptions.bounds={north:north,west:west,south:south,east:east}),this.googleRectangle.setOptions(googleOptions)}}),jQuery(function($){WPGMZA.GoogleText=function(options){WPGMZA.Text.apply(this,arguments),this.overlay=new WPGMZA.GoogleTextOverlay(options)},WPGMZA.extend(WPGMZA.GoogleText,WPGMZA.Text)}),jQuery(function($){WPGMZA.GoogleTextOverlay=function(options){this.element=$("<div class='wpgmza-google-text-overlay'><div class='wpgmza-inner'></div></div>"),(options=options||{}).position&&(this.position=options.position),options.text&&this.element.find(".wpgmza-inner").text(options.text),options.map&&this.setMap(options.map.googleMap)},window.google&&google.maps&&google.maps.OverlayView&&(WPGMZA.GoogleTextOverlay.prototype=new google.maps.OverlayView),WPGMZA.GoogleTextOverlay.prototype.onAdd=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"}),this.getPanes().floatPane.appendChild(this.element[0])},WPGMZA.GoogleTextOverlay.prototype.draw=function(){var position=this.getProjection().fromLatLngToDivPixel(this.position.toGoogleLatLng());this.element.css({position:"absolute",left:position.x+"px",top:position.y+"px",minWidth:"200px"})},WPGMZA.GoogleTextOverlay.prototype.onRemove=function(){this.element.remove()},WPGMZA.GoogleTextOverlay.prototype.hide=function(){this.element.hide()},WPGMZA.GoogleTextOverlay.prototype.show=function(){this.element.show()},WPGMZA.GoogleTextOverlay.prototype.toggle=function(){this.element.is(":visible")?this.element.hide():this.element.show()}}),jQuery(function($){"google-maps"==WPGMZA.settings.engine&&(WPGMZA.googleAPIStatus&&"USER_CONSENT_NOT_GIVEN"==WPGMZA.googleAPIStatus.code||(WPGMZA.GoogleVertexContextMenu=function(mapEditPage){var self=this;this.mapEditPage=mapEditPage,this.element=document.createElement("div"),this.element.className="wpgmza-vertex-context-menu",this.element.innerHTML="Delete",google.maps.event.addDomListener(this.element,"click",function(event){return self.removeVertex(),event.preventDefault(),event.stopPropagation(),!1})},WPGMZA.GoogleVertexContextMenu.prototype=new google.maps.OverlayView,WPGMZA.GoogleVertexContextMenu.prototype.onAdd=function(){var self=this,map=this.getMap();this.getPanes().floatPane.appendChild(this.element),this.divListener=google.maps.event.addDomListener(map.getDiv(),"mousedown",function(e){e.target!=self.element&&self.close()},!0)},WPGMZA.GoogleVertexContextMenu.prototype.onRemove=function(){google.maps.event.removeListener(this.divListener),this.element.parentNode.removeChild(this.element),this.set("position"),this.set("path"),this.set("vertex")},WPGMZA.GoogleVertexContextMenu.prototype.open=function(map,path,vertex){this.set("position",path.getAt(vertex)),this.set("path",path),this.set("vertex",vertex),this.setMap(map),this.draw()},WPGMZA.GoogleVertexContextMenu.prototype.close=function(){this.setMap(null)},WPGMZA.GoogleVertexContextMenu.prototype.draw=function(){var point=this.get("position"),projection=this.getProjection();point&&projection&&(point=projection.fromLatLngToDivPixel(point),this.element.style.top=point.y+"px",this.element.style.left=point.x+"px")},WPGMZA.GoogleVertexContextMenu.prototype.removeVertex=function(){var path=this.get("path"),vertex=this.get("vertex");path&&null!=vertex&&path.removeAt(vertex),this.close()}))}),jQuery(function($){WPGMZA.FeaturePanel=function(element,mapEditPage){var self=this;WPGMZA.EventDispatcher.apply(this,arguments),this.map=mapEditPage.map,this.drawingManager=mapEditPage.drawingManager,this.feature=null,this.element=element,this.initDefaults(),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.drawingInstructionsElement=$(this.element).find(".wpgmza-feature-drawing-instructions"),this.drawingInstructionsElement.detach(),this.editingInstructionsElement=$(this.element).find(".wpgmza-feature-editing-instructions"),this.editingInstructionsElement.detach(),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.newPanel[0],self.element[0])&&self.onTabActivated(event)}),$("#wpgmaps_tabs_markers").on("tabsactivate",function(event,ui){$.contains(ui.oldPanel[0],self.element[0])&&self.onTabDeactivated(event)}),$(document.body).on("click","[data-edit-"+this.featureType+"-id]",function(event){self.onEditFeature(event)}),$(document.body).on("click","[data-delete-"+this.featureType+"-id]",function(event){self.onDeleteFeature(event)}),$(this.element).find(".wpgmza-save-feature").on("click",function(event){self.onSave(event)}),this.drawingManager.on(self.drawingManagerCompleteEvent,function(event){self.onDrawingComplete(event)}),this.drawingManager.on("drawingmodechanged",function(event){self.onDrawingModeChanged(event)}),$(this.element).on("change input",function(event){self.onPropertyChanged(event)})},WPGMZA.extend(WPGMZA.FeaturePanel,WPGMZA.EventDispatcher),WPGMZA.FeaturePanel.MODE_ADD="add",WPGMZA.FeaturePanel.MODE_EDIT="edit",WPGMZA.FeaturePanel.prevEditableFeature=null,Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"drawingManagerCompleteEvent",{get:function(){return this.featureType+"complete"}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureDataTable",{get:function(){return $("[data-wpgmza-datatable][data-wpgmza-feature-type='"+this.featureType+"']")[0].wpgmzaDataTable}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"featureAccordion",{get:function(){return $(this.element).closest(".wpgmza-accordion")}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"map",{get:function(){return WPGMZA.mapEditPage.map}}),Object.defineProperty(WPGMZA.FeaturePanel.prototype,"mode",{get:function(){return this._mode}}),WPGMZA.FeaturePanel.prototype.initPreloader=function(){this.preloader||(this.preloader=$(WPGMZA.preloaderHTML),this.preloader.hide(),$(this.element).append(this.preloader))},WPGMZA.FeaturePanel.prototype.initDataTable=function(){var el=$(this.element).find("[data-wpgmza-datatable][data-wpgmza-rest-api-route]");this[this.featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)},WPGMZA.FeaturePanel.prototype.initDefaults=function(){$(this.element).find("[data-ajax-name]:not([type='radio'])").each(function(index,el){var val=$(el).val();val&&$(el).attr("data-default-value",val)})},WPGMZA.FeaturePanel.prototype.setCaptionType=function(type,id){var icons={add:"fa-plus-circle",save:"fa-pencil-square-o"};switch(type){case WPGMZA.FeaturePanel.MODE_ADD:case WPGMZA.FeaturePanel.MODE_EDIT:this.featureAccordion.find("[data-add-caption][data-edit-caption]").each(function(index,el){var text=$(el).attr("data-"+type+"-caption"),icon=$(el).find("i.fa");id&&(text+=" "+id),$(el).text(text),icon.length&&((icon=$("<i class='fa' aria-hidden='true'></i>")).addClass(icons[type]),$(el).prepend(" "),$(el).prepend(icon))});break;default:throw new Error("Invalid type")}},WPGMZA.FeaturePanel.prototype.setMode=function(type,id){this._mode=type,this.setCaptionType(type,id)},WPGMZA.FeaturePanel.prototype.setTargetFeature=function(feature){var prev,self=this;WPGMZA.FeaturePanel.prevEditableFeature&&((prev=WPGMZA.FeaturePanel.prevEditableFeature).setEditable(!1),prev.setDraggable(!1),prev.off("change")),feature?(feature.setEditable(!0),feature.setDraggable(!0),feature.on("change",function(event){self.onFeatureChanged(event)}),this.setMode(WPGMZA.FeaturePanel.MODE_EDIT),this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showInstructions()):this.setMode(WPGMZA.FeaturePanel.MODE_ADD),this.feature=WPGMZA.FeaturePanel.prevEditableFeature=feature},WPGMZA.FeaturePanel.prototype.reset=function(){$(this.element).find("[data-ajax-name]:not([data-ajax-name='map_id']):not([type='color']):not([type='checkbox']):not([type='radio'])").val(""),$(this.element).find("select[data-ajax-name]>option:first-child").prop("selected",!0),$(this.element).find("[data-ajax-name='id']").val("-1"),$(this.element).find("input[type='checkbox']").prop("checked",!1),tinyMCE.get("wpgmza-description-editor")?tinyMCE.get("wpgmza-description-editor").setContent(""):$("#wpgmza-description-editor").val(""),$("#wpgmza-description-editor").val(""),this.showPreloader(!1),this.setMode(WPGMZA.FeaturePanel.MODE_ADD),$(this.element).find("[data-ajax-name][data-default-value]").each(function(index,el){$(el).val($(el).data("default-value"))})},WPGMZA.FeaturePanel.prototype.select=function(arg){var id,expectedBaseClass,self=this;if(this.reset(),$.isNumeric(arg))id=arg;else{if(expectedBaseClass=WPGMZA[WPGMZA.capitalizeWords(this.featureType)],!(feature instanceof expectedBaseClass))throw new Error("Invalid feature type for this panel");id=arg.id}this.showPreloader(!0),WPGMZA.animateScroll($(".wpgmza_map")),WPGMZA.restAPI.call("/"+this.featureType+"s/"+id+"?skip_cache=1",{success:function(data,status,xhr){var feature="get"+WPGMZA.capitalizeWords(self.featureType)+"ByID",feature=self.map[feature](id);self.populate(data),self.showPreloader(!1),self.setMode(WPGMZA.FeaturePanel.MODE_EDIT,id),self.setTargetFeature(feature)}})},WPGMZA.FeaturePanel.prototype.showPreloader=function(show){this.initPreloader(),0==arguments.length||show?(this.preloader.fadeIn(),this.element.addClass("wpgmza-loading")):(this.preloader.fadeOut(),this.element.removeClass("wpgmza-loading"))},WPGMZA.FeaturePanel.prototype.populate=function(data){var value,target,name;for(name in data)switch(target=$(this.element).find("[data-ajax-name='"+name+"']"),value=data[name],(target.attr("type")||"").toLowerCase()){case"checkbox":case"radio":target.prop("checked",1==data[name]);break;case"color":value.match(/^#/)||(value="#"+value);default:"object"==typeof value&&(value=JSON.stringify(value)),$(this.element).find("[data-ajax-name='"+name+"']:not(select)").val(value),$(this.element).find("select[data-ajax-name='"+name+"']").each(function(index,el){"string"==typeof value&&0==data[name].length||$(el).val(value)})}},WPGMZA.FeaturePanel.prototype.serializeFormData=function(){var fields=$(this.element).find("[data-ajax-name]"),data={};return fields.each(function(index,el){var type="text";switch($(el).attr("type")&&(type=$(el).attr("type").toLowerCase()),type){case"checkbox":data[$(el).attr("data-ajax-name")]=$(el).prop("checked")?1:0;break;case"radio":$(el).prop("checked")&&(data[$(el).attr("data-ajax-name")]=$(el).val());break;default:data[$(el).attr("data-ajax-name")]=$(el).val()}}),data},WPGMZA.FeaturePanel.prototype.discardChanges=function(){var feature;this.feature&&(feature=this.feature,this.setTargetFeature(null),feature&&feature.map&&(this.map["remove"+WPGMZA.capitalizeWords(this.featureType)](feature),-1<feature.id&&this.updateFeatureByID(feature.id)))},WPGMZA.FeaturePanel.prototype.updateFeatureByID=function(id){var feature,self=this,route="/"+this.featureType+"s/",functionSuffix=WPGMZA.capitalizeWords(self.featureType),getByIDFunction="get"+functionSuffix+"ByID",removeFunction="remove"+functionSuffix,addFunction="add"+functionSuffix;WPGMZA.restAPI.call(route+id,{success:function(data,status,xhr){(feature=self.map[getByIDFunction](id))&&self.map[removeFunction](feature),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature)}})},WPGMZA.FeaturePanel.prototype.showInstructions=function(){this.mode===WPGMZA.FeaturePanel.MODE_ADD?($(this.map.element).append(this.drawingInstructionsElement),$(this.drawingInstructionsElement).hide().fadeIn()):($(this.map.element).append(this.editingInstructionsElement),$(this.editingInstructionsElement).hide().fadeIn())},WPGMZA.FeaturePanel.prototype.onTabActivated=function(){this.reset(),this.drawingManager.setDrawingMode(this.featureType),this.onAddFeature(event),$(".wpgmza-table-container-title").hide(),$(".wpgmza-table-container").hide();var featureString=this.featureType.charAt(0).toUpperCase()+this.featureType.slice(1);$("#wpgmza-table-container-"+featureString).show(),$("#wpgmza-table-container-title-"+featureString).show()},WPGMZA.FeaturePanel.prototype.onTabDeactivated=function(){this.discardChanges(),this.setTargetFeature(null)},WPGMZA.FeaturePanel.prototype.onAddFeature=function(event){this.drawingManager.setDrawingMode(this.featureType)},WPGMZA.FeaturePanel.prototype.onEditFeature=function(event){var id="data-edit-"+this.featureType+"-id",id=$(event.currentTarget).attr(id);this.discardChanges(),this.select(id)},WPGMZA.FeaturePanel.prototype.onDeleteFeature=function(id){var self=this,route="data-delete-"+this.featureType+"-id",id=$(id.currentTarget).attr(route),route="/"+this.featureType+"s/",feature=this.map["get"+WPGMZA.capitalizeWords(this.featureType)+"ByID"](id);this.featureDataTable.dataTable.processing(!0),WPGMZA.restAPI.call(route+id,{method:"DELETE",success:function(data,status,xhr){self.map["remove"+WPGMZA.capitalizeWords(self.featureType)](feature),self.featureDataTable.reload()}})},WPGMZA.FeaturePanel.prototype.onDrawingModeChanged=function(event){$(this.drawingInstructionsElement).detach(),$(this.editingInstructionsElement).detach(),this.drawingManager.mode==this.featureType&&this.showInstructions()},WPGMZA.FeaturePanel.prototype.onDrawingComplete=function(geometryField){var nativeFeature=geometryField["engine"+WPGMZA.capitalizeWords(this.featureType)],formData=this.serializeFormData(),geometryField=$(this.element).find("textarea[data-ajax-name$='data']");delete formData.polydata;nativeFeature=WPGMZA[WPGMZA.capitalizeWords(this.featureType)].createInstance(formData,nativeFeature);this.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.map["add"+WPGMZA.capitalizeWords(this.featureType)](nativeFeature),this.setTargetFeature(nativeFeature),geometryField.length&&geometryField.val(JSON.stringify(nativeFeature.getGeometry())),this.featureType},WPGMZA.FeaturePanel.prototype.onPropertyChanged=function(event){var feature=this.feature;feature&&($(this.element).find(":input[data-ajax-name]").each(function(index,el){var key=$(el).attr("data-ajax-name");feature[key]=$(el).val()}),feature.updateNativeFeature())},WPGMZA.FeaturePanel.prototype.onFeatureChanged=function(event){var geometryField=$(this.element).find("textarea[data-ajax-name$='data']");geometryField.length&&geometryField.val(JSON.stringify(this.feature.getGeometry()))},WPGMZA.FeaturePanel.prototype.onSave=function(event){var self=this,id=$(self.element).find("[data-ajax-name='id']").val(),data=this.serializeFormData(),route="/"+this.featureType+"s/",isNew=-1==id;"circle"!=this.featureType||data.center?"rectangle"!=this.featureType||data.cornerA?"polygon"!=this.featureType||data.polydata?"polyline"!=this.featureType||data.polydata?(isNew||(route+=id),WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0),WPGMZA.restAPI.call(route,{method:"POST",data:data,success:function(data,status,xhr){var addFunction=WPGMZA.capitalizeWords(self.featureType),feature="get"+addFunction+"ByID",removeFunction="remove"+addFunction,addFunction="add"+addFunction;self.reset(),(feature=self.map[feature](id))&&self.map[removeFunction](feature),self.setTargetFeature(null),self.showPreloader(!1),feature=WPGMZA[WPGMZA.capitalizeWords(self.featureType)].createInstance(data),self.map[addFunction](feature),self.featureDataTable.reload(),self.onTabActivated(event)}})):alert(WPGMZA.localized_strings.no_shape_polyline):alert(WPGMZA.localized_strings.no_shape_polygon):alert(WPGMZA.localized_strings.no_shape_rectangle):alert(WPGMZA.localized_strings.no_shape_circle)}}),jQuery(function($){WPGMZA.MarkerPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.MarkerPanel,WPGMZA.FeaturePanel),WPGMZA.MarkerPanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProMarkerPanel:WPGMZA.MarkerPanel)(element,mapEditPage)},WPGMZA.MarkerPanel.prototype.initDefaults=function(){var self=this;WPGMZA.FeaturePanel.prototype.initDefaults.apply(this,arguments),this.adjustSubMode=!1,this.onTabActivated(null),$(document.body).on("click","[data-adjust-"+this.featureType+"-id]",function(event){self.onAdjustFeature(event)}),$(document.body).on("click",".wpgmza_approve_btn",function(event){self.onApproveMarker(event)})},WPGMZA.MarkerPanel.prototype.onAdjustFeature=function(event){var id="data-adjust-"+this.featureType+"-id",id=$(event.currentTarget).attr(id);this.discardChanges(),this.adjustSubMode=!0,this.select(id)},WPGMZA.MarkerPanel.prototype.onApproveMarker=function(route){var self=this,route="/"+this.featureType+"s/"+$(route.currentTarget).attr("id");WPGMZA.restAPI.call(route,{method:"POST",data:{approved:"1"},success:function(data,status,xhr){self.featureDataTable.reload()}})},WPGMZA.MarkerPanel.prototype.onFeatureChanged=function(event){var addressField,pos;this.adjustSubMode?(pos=this.feature.getPosition())&&($(this.element).find("[data-ajax-name='lat']").val(pos.lat),$(this.element).find("[data-ajax-name='lng']").val(pos.lng)):(addressField=$(this.element).find("input[data-ajax-name$='address']")).length&&(pos=this.feature.getPosition(),addressField.val(pos.lat+","+pos.lng))},WPGMZA.MarkerPanel.prototype.setTargetFeature=function(feature){var prev;!WPGMZA.FeaturePanel.prevEditableFeature||(prev=WPGMZA.FeaturePanel.prevEditableFeature).setOpacity&&prev.setOpacity(1),$(this.element).find("[data-ajax-name]").removeAttr("disabled"),$(this.element).find("fieldset").show(),$(this.element).find(".wpgmza-adjust-mode-notice").addClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","hidden"),$(this.element).find('[data-ajax-name="lng"]').attr("type","hidden"),$(this.element).find(".wpgmza-hide-in-adjust-mode").removeClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").addClass("wpgmza-hidden"),feature?(feature.setOpacity&&feature.setOpacity(.7),feature.getMap().panTo(feature.getPosition()),this.adjustSubMode&&($(this.element).find("[data-ajax-name]").attr("disabled","disabled"),$(this.element).find("fieldset:not(.wpgmza-always-on)").hide(),$(this.element).find(".wpgmza-adjust-mode-notice").removeClass("wpgmza-hidden"),$(this.element).find('[data-ajax-name="lat"]').attr("type","text").removeAttr("disabled"),$(this.element).find('[data-ajax-name="lng"]').attr("type","text").removeAttr("disabled"),$(this.element).find(".wpgmza-hide-in-adjust-mode").addClass("wpgmza-hidden"),$(this.element).find(".wpgmza-show-in-adjust-mode").removeClass("wpgmza-hidden"))):this.adjustSubMode=!1,WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments)},WPGMZA.MarkerPanel.prototype.onSave=function(event){var self=this,geocoder=WPGMZA.Geocoder.createInstance(),address=$(this.element).find("[data-ajax-name='address']").val(),geocodingData={address:address};WPGMZA.mapEditPage.drawingManager.setDrawingMode(WPGMZA.DrawingManager.MODE_NONE),this.showPreloader(!0);var cloud_lat=!1,addressUnchanged=!1;0<document.getElementsByName("lat").length&&(cloud_lat=document.getElementsByName("lat")[0].value),0<document.getElementsByName("lng").length&&(addressUnchanged=document.getElementsByName("lng")[0].value),cloud_lat&&addressUnchanged&&(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey||(geocodingData.lat=parseFloat(cloud_lat),geocodingData.lng=parseFloat(addressUnchanged)));addressUnchanged=!1;this.feature&&this.feature.address&&address&&"string"==typeof this.feature.address&&"string"==typeof address&&this.feature.address.trim()===address.trim()&&(addressUnchanged=!0),this.adjustSubMode||addressUnchanged?WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments):geocoder.geocode(geocodingData,function(results,status){switch(status){case WPGMZA.Geocoder.ZERO_RESULTS:return alert(WPGMZA.localized_strings.zero_results),void self.showPreloader(!1);case WPGMZA.Geocoder.SUCCESS:break;case WPGMZA.Geocoder.NO_ADDRESS:return alert(WPGMZA.localized_strings.no_address),void self.showPreloader(!1);case WPGMZA.Geocoder.FAIL:default:return alert(WPGMZA.localized_strings.geocode_fail),void self.showPreloader(!1)}var result=results[0];$(self.element).find("[data-ajax-name='lat']").val(result.lat),$(self.element).find("[data-ajax-name='lng']").val(result.lng),WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments)}),WPGMZA.mapEditPage.map.resetBounds()}}),jQuery(function($){WPGMZA.CirclePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.CirclePanel,WPGMZA.FeaturePanel),WPGMZA.CirclePanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProCirclePanel:WPGMZA.CirclePanel)(element,mapEditPage)},WPGMZA.CirclePanel.prototype.updateFields=function(){$(this.element).find("[data-ajax-name='center']").val(this.feature.getCenter().toString()),$(this.element).find("[data-ajax-name='radius']").val(this.feature.getRadius())},WPGMZA.CirclePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.CirclePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.CirclePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}});var wpgmza_autoCompleteDisabled=!1;jQuery(function($){"map-edit"==WPGMZA.currentPage&&(WPGMZA.MapEditPage=function(){var self=this,element=document.body;WPGMZA.EventDispatcher.call(this),$("#wpgmaps_options fieldset").wrapInner("<div class='wpgmza-flex'></div>"),this.themePanel=new WPGMZA.ThemePanel,this.themeEditor=new WPGMZA.ThemeEditor,this.map=WPGMZA.maps[0],(!WPGMZA.pro_version||WPGMZA.Version.compare(WPGMZA.pro_version,"8.1.0")>=WPGMZA.Version.EQUAL_TO)&&(this.drawingManager=WPGMZA.DrawingManager.createInstance(this.map)),this.initDataTables(),this.initFeaturePanels(),this.initJQueryUIControls(),"en"!==WPGMZA.locale&&$("#datatable_no_result_message,#datatable_search_string").parent().parent().hide(),$("input.wpgmza-address").each(function(index,el){el.addressInput=WPGMZA.AddressInput.createInstance(el,self.map)}),$('#wpgmza-map-edit-page input[type="color"]').each(function(){$("<div class='button-secondary wpgmza-paste-color-btn' title='Paste a HEX color code'><i class='fa fa-clipboard' aria-hidden='true'></i></div>").insertAfter(this)}),jQuery("body").on("click",".wpgmza_ac_result",function(e){var name=jQuery(this).data("id"),lat=jQuery(this).data("lat"),lng=jQuery(this).data("lng"),name=jQuery("#wpgmza_item_address_"+name).html();jQuery("input[name='lat']").val(lat),jQuery("input[name='lng']").val(lng),jQuery("#wpgmza_add_address_map_editor").val(name),jQuery("#wpgmza_autocomplete_search_results").hide()}),jQuery("body").on("click",".wpgmza-paste-color-btn",function(){try{var colorBtn=$(this);if(!navigator||!navigator.clipboard||!navigator.clipboard.readText)return;navigator.clipboard.readText().then(function(textcopy){colorBtn.parent().find('input[type="color"]').val("#"+textcopy.replace("#","").trim())}).catch(function(err){console.error("WP Google Maps: Could not access clipboard",err)})}catch(c_ex){}}),jQuery("body").on("focusout","#wpgmza_add_address_map_editor",function(e){setTimeout(function(){jQuery("#wpgmza_autocomplete_search_results").fadeOut("slow")},500)});var ajaxRequest=!1,wpgmzaAjaxTimeout=!1,wpgmzaStartTyping=!1,wpgmzaKeyStrokeCount=1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0,wpgmzaTmp="",wpgmzaIdentifiedTypingSpeed=!1;$("body").on("keypress",".wpgmza-address",function(e){if("wpgmza_add_address_map_editor"==this.id&&!wpgmza_autoCompleteDisabled){var wpgmza_apikey=!1;if(WPGMZA_localized_data.settings.googleMapsApiKey&&""!==WPGMZA_localized_data.settings.googleMapsApiKey)wpgmza_apikey=WPGMZA_localized_data.settings.googleMapsApiKey;else if("Escape"!==e.key&&"Alt"!==e.key&&"Control"!==e.key&&"Option"!==e.key&&"Shift"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if(!wpgmzaIdentifiedTypingSpeed){var currentSearch=new Date;return clearTimeout(wpgmzaTmp),wpgmzaTmp=setTimeout(function(){wpgmzaStartTyping=!1,wpgmzaAvgTimeBetweenStrokes=300,wpgmzaTotalTimeForKeyStrokes=0},1500),wpgmzaStartTyping?1==wpgmzaKeyStrokeCount||(wpgmzaCurrentTimeBetweenStrokes=currentSearch.getTime()-wpgmzaStartTyping,wpgmzaTotalTimeForKeyStrokes+=wpgmzaCurrentTimeBetweenStrokes,wpgmzaAvgTimeBetweenStrokes=wpgmzaTotalTimeForKeyStrokes/(wpgmzaKeyStrokeCount-1),wpgmzaStartTyping=currentSearch.getTime(),3<=wpgmzaKeyStrokeCount&&(wpgmzaIdentifiedTypingSpeed=wpgmzaAvgTimeBetweenStrokes)):wpgmzaStartTyping=currentSearch.getTime(),void wpgmzaKeyStrokeCount++}clearTimeout(wpgmzaAjaxTimeout),$("#wpgmza_autocomplete_search_results").html("Searching..."),$("#wpgmza_autocomplete_search_results").show();currentSearch=jQuery(this).val();if(""!==currentSearch){!1!==ajaxRequest&&ajaxRequest.abort();var domain=window.location.hostname;if("localhost"===domain)try{var paths=window.location.pathname.match(/\/(.*?)\//);paths&&2<=paths.length&&paths[1]&&(domain+="-"+paths[1])}catch(ex){}var wpgmza_api_url="",wpgmza_api_url=wpgmza_apikey?"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+domain+"&hash="+WPGMZA_localized_data.siteHash+"&k="+wpgmza_apikey:"https://wpgmaps.us-3.evennode.com/api/v1/autocomplete?s="+currentSearch+"&d="+domain+"&hash="+WPGMZA_localized_data.siteHash;WPGMZA&&WPGMZA.settings&&WPGMZA.settings.engine&&(wpgmza_api_url+="&engine="+WPGMZA.settings.engine),wpgmzaAjaxTimeout=setTimeout(function(){ajaxRequest=$.ajax({url:wpgmza_api_url,type:"GET",dataType:"json",success:function(results){try{if(void 0!==results.error)"error1"==results.error?($("#wpgmza_autoc_disabled").html(WPGMZA.localized_strings.cloud_api_key_error_1),$("#wpgmza_autoc_disabled").fadeIn("slow"),$("#wpgmza_autocomplete_search_results").hide(),wpgmza_autoCompleteDisabled=!0):console.error(results.error);else{$("#wpgmza_autocomplete_search_results").html("");var i,html="";for(i in results)html+="<div class='wpgmza_ac_result "+(""===html?"":"border-top")+"' data-id='"+i+"' data-lat='"+results[i].lat+"' data-lng='"+results[i].lng+"'><div class='wpgmza_ac_container'><div class='wpgmza_ac_icon'><img src='"+results[i].icon+"' /></div><div class='wpgmza_ac_item'><span id='wpgmza_item_name_"+i+"' class='wpgmza_item_name'>"+results[i].place_name+"</span><span id='wpgmza_item_address_"+i+"' class='wpgmza_item_address'>"+results[i].formatted_address+"</span></div></div></div>";""==html&&(html="<div class='p-2 text-center'><small>No results found...</small></div>"),$("#wpgmza_autocomplete_search_results").html(html),$("#wpgmza_autocomplete_search_results").show()}}catch(exception){console.error("WP Google Maps Plugin: There was an error returning the list of places for your search")}}})},2*wpgmzaIdentifiedTypingSpeed)}else $("#wpgmza_autocomplete_search_results").hide()}else $("#wpgmza_autocomplete_search_results").hide()}}),$("#wpgmza_map_height_type").on("change",function(event){self.onMapHeightTypeChange(event)}),$("#advanced-markers .wpgmza-feature-drawing-instructions").remove(),$("[data-search-area='auto']").hide(),$(document.body).on("click","[data-wpgmza-admin-marker-datatable] input[name='mark']",function(event){self.onShiftClick(event)}),$("#wpgmza_map_type").on("change",function(event){self.onMapTypeChanged(event)}),$("body").on("click",".wpgmza_copy_shortcode",function(){var $temp=jQuery("<input>");jQuery('<span id="wpgmza_tmp" style="display:none; width:100%; text-align:center;">');jQuery("body").append($temp),$temp.val(jQuery(this).val()).select(),document.execCommand("copy"),$temp.remove(),WPGMZA.notification("Shortcode Copied")}),this.on("markerupdated",function(event){self.onMarkerUpdated(event)}),this.map&&(this.map.on("zoomchanged",function(event){self.onZoomChanged(event)}),this.map.on("boundschanged",function(event){self.onBoundsChanged(event)}),this.map.on("rightclick",function(event){self.onRightClick(event)})),$(element).on("click",".wpgmza_poly_del_btn",function(event){self.onDeletePolygon(event)}),$(element).on("click",".wpgmza_polyline_del_btn",function(event){self.onDeletePolyline(event)}),$(element).on("click",".wpgmza_dataset_del_btn",function(evevnt){self.onDeleteHeatmap(event)}),$(element).on("click",".wpgmza_circle_del_btn",function(event){self.onDeleteCircle(event)}),$(element).on("click",".wpgmza_rectangle_del_btn",function(event){self.onDeleteRectangle(event)}),$(element).on("click","#wpgmza-open-advanced-theme-data",function(event){event.preventDefault(),$(".wpgmza_theme_data_container").toggleClass("wpgmza_hidden")})},WPGMZA.extend(WPGMZA.MapEditPage,WPGMZA.EventDispatcher),WPGMZA.MapEditPage.createInstance=function(){return new(WPGMZA.isProVersion()&&WPGMZA.Version.compare(WPGMZA.pro_version,"8.0.0")>=WPGMZA.Version.EQUAL_TO?WPGMZA.ProMapEditPage:WPGMZA.MapEditPage)},WPGMZA.MapEditPage.prototype.initDataTables=function(){var self=this;$("[data-wpgmza-datatable][data-wpgmza-rest-api-route]").each(function(index,el){var featureType=$(el).attr("data-wpgmza-feature-type");self[featureType+"AdminDataTable"]=new WPGMZA.AdminFeatureDataTable(el)})},WPGMZA.MapEditPage.prototype.initFeaturePanels=function(){var self=this;$(".wpgmza-feature-accordion[data-wpgmza-feature-type]").each(function(index,panelClassName){var instance=$(panelClassName).find(".wpgmza-feature-panel-container > *"),featureType=$(panelClassName).attr("data-wpgmza-feature-type"),panelClassName=WPGMZA.capitalizeWords(featureType)+"Panel",instance=WPGMZA[panelClassName].createInstance(instance,self);self[featureType+"Panel"]=instance})},WPGMZA.MapEditPage.prototype.initJQueryUIControls=function(){var mapContainer,self=this;$("#wpgmaps_tabs").tabs(),mapContainer=$("#wpgmza-map-container").detach(),$("#wpgmaps_tabs_markers").tabs(),$(".map_wrapper").prepend(mapContainer),$("#slider-range-max").slider({range:"max",min:1,max:21,value:$("input[name='map_start_zoom']").val(),slide:function(event,ui){$("input[name='map_start_zoom']").val(ui.value),self.map.setZoom(ui.value)}})},WPGMZA.MapEditPage.prototype.onShiftClick=function(startIndex){var currIndex=startIndex.currentTarget,row=jQuery(currIndex).closest("tr");if(this.lastSelectedRow&&startIndex.shiftKey){var prevIndex=this.lastSelectedRow.index(),currIndex=row.index(),startIndex=Math.min(prevIndex,currIndex),endIndex=Math.max(prevIndex,currIndex),rows=jQuery("[data-wpgmza-admin-marker-datatable] tbody>tr");jQuery("[data-wpgmza-admin-marker-datatable] input[name='mark']").prop("checked",!1);for(var i=startIndex;i<=endIndex;i++)jQuery(rows[i]).find("input[name='mark']").prop("checked",!0)}this.lastSelectedRow=row},WPGMZA.MapEditPage.prototype.onMapTypeChanged=function(event){if("open-layers"!=WPGMZA.settings.engine){var mapTypeId;switch(event.target.value){case"2":mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"3":mapTypeId=google.maps.MapTypeId.HYBRID;break;case"4":mapTypeId=google.maps.MapTypeId.TERRAIN;break;default:mapTypeId=google.maps.MapTypeId.ROADMAP}this.map.setOptions({mapTypeId:mapTypeId})}},WPGMZA.MapEditPage.prototype.onMarkerUpdated=function(event){this.markerDataTable.reload()},WPGMZA.MapEditPage.prototype.onZoomChanged=function(event){$(".map_start_zoom").val(this.map.getZoom())},WPGMZA.MapEditPage.prototype.onBoundsChanged=function(event){var location=this.map.getCenter();$("#wpgmza_start_location").val(location.lat+","+location.lng),$("input[name='map_start_lat']").val(location.lat),$("input[name='map_start_lng']").val(location.lng),$("#wpgmza_start_zoom").val(this.map.getZoom()),$("#wpgmaps_save_reminder").show()},WPGMZA.MapEditPage.prototype.onMapHeightTypeChange=function(event){"%"==event.target.value&&$("#wpgmza_height_warning").show()},WPGMZA.MapEditPage.prototype.onRightClick=function(event){var marker,self=this;this.drawingManager&&this.drawingManager.mode!=WPGMZA.DrawingManager.MODE_MARKER||(this.rightClickMarker||(this.rightClickMarker=WPGMZA.Marker.createInstance({draggable:!0}),this.rightClickMarker.on("dragend",function(event){$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+","+event.latLng.lng)}),this.map.on("click",function(event){self.rightClickMarker.setMap(null)})),(marker=this.rightClickMarker).setPosition(event.latLng),marker.setMap(this.map),$(".wpgmza-marker-panel [data-ajax-name='address']").val(event.latLng.lat+", "+event.latLng.lng))},WPGMZA.MapEditPage.prototype.onDeletePolygon=function(event){var cur_id=parseInt($(this).attr("id")),data={action:"delete_poly",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_Path[cur_id].setMap(null),delete WPGM_PathData[cur_id],delete WPGM_Path[cur_id],$("#wpgmza_poly_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeletePolyline=function(event){var cur_id=$(this).attr("id"),data={action:"delete_polyline",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){WPGM_PathLine[cur_id].setMap(null),delete WPGM_PathLineData[cur_id],delete WPGM_PathLine[cur_id],$("#wpgmza_polyline_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteHeatmap=function(event){var cur_id=$(this).attr("id"),data={action:"delete_dataset",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,poly_id:cur_id};$.post(ajaxurl,data,function(response){heatmap[cur_id].setMap(null),delete heatmap[cur_id],$("#wpgmza_heatmap_holder").html(response)})},WPGMZA.MapEditPage.prototype.onDeleteCircle=function(event){var circle_id=$(this).attr("id"),data={action:"delete_circle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,circle_id:circle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-5 table").replaceWith(response),circle_array.forEach(function(circle){if(circle.id==circle_id)return circle.setMap(null),!1})})},WPGMZA.MapEditPage.prototype.onDeleteRectangle=function(event){var rectangle_id=$(this).attr("id"),data={action:"delete_rectangle",security:wpgmza_legacy_map_edit_page_vars.ajax_nonce,map_id:this.map.id,rectangle_id:rectangle_id};$.post(ajaxurl,data,function(response){$("#tabs-m-6 table").replaceWith(response),rectangle_array.forEach(function(rectangle){if(rectangle.id==rectangle_id)return rectangle.setMap(null),!1})})},$(document).ready(function(event){WPGMZA.mapEditPage=WPGMZA.MapEditPage.createInstance()}))}),jQuery(function($){WPGMZA.PolygonPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolygonPanel,WPGMZA.FeaturePanel),WPGMZA.PolygonPanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProPolygonPanel:WPGMZA.PolygonPanel)(element,mapEditPage)},Object.defineProperty(WPGMZA.PolygonPanel.prototype,"drawingManagerCompleteEvent",{get:function(){return"polygonclosed"}})}),jQuery(function($){WPGMZA.PolylinePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.PolylinePanel,WPGMZA.FeaturePanel),WPGMZA.PolylinePanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProPolylinePanel:WPGMZA.PolylinePanel)(element,mapEditPage)}}),jQuery(function($){WPGMZA.RectanglePanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.RectanglePanel,WPGMZA.FeaturePanel),WPGMZA.RectanglePanel.createInstance=function(element,mapEditPage){return new(WPGMZA.isProVersion()?WPGMZA.ProRectanglePanel:WPGMZA.RectanglePanel)(element,mapEditPage)},WPGMZA.RectanglePanel.prototype.updateFields=function(){var bounds=this.feature.getBounds();bounds.north&&bounds.west&&bounds.south&&bounds.east&&($(this.element).find("[data-ajax-name='cornerA']").val(bounds.north+", "+bounds.west),$(this.element).find("[data-ajax-name='cornerB']").val(bounds.south+", "+bounds.east))},WPGMZA.RectanglePanel.prototype.setTargetFeature=function(feature){WPGMZA.FeaturePanel.prototype.setTargetFeature.apply(this,arguments),feature&&this.updateFields()},WPGMZA.RectanglePanel.prototype.onDrawingComplete=function(event){WPGMZA.FeaturePanel.prototype.onDrawingComplete.apply(this,arguments),this.updateFields()},WPGMZA.RectanglePanel.prototype.onFeatureChanged=function(event){WPGMZA.FeaturePanel.prototype.onFeatureChanged.apply(this,arguments),this.updateFields()}}),jQuery(function($){var Parent=WPGMZA.Circle;WPGMZA.OLCircle=function(options,center){var circle,geom;Parent.call(this,options,center),options=options||{},center?(circle=center.getGeometry(),center=ol.proj.toLonLat(circle.getCenter()),geom=circle,options.center=new WPGMZA.LatLng(center[1],center[0]),options.radius=circle.getRadius()/1e3):geom=new ol.geom.Circle(ol.proj.fromLonLat([parseFloat(options.center.lng),parseFloat(options.center.lat)]),1e3*options.radius),this.layer=new ol.layer.Vector({source:new ol.source.Vector}),this.olFeature=new ol.Feature({geometry:geom}),this.layer.getSource().addFeature(this.olFeature),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaCircle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.OLCircle.prototype=Object.create(Parent.prototype),WPGMZA.OLCircle.prototype.constructor=WPGMZA.OLCircle,WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)},WPGMZA.OLCircle.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olFeature.getGeometry().getCenter());return new WPGMZA.LatLng({lat:lonLat[1],lng:lonLat[0]})},WPGMZA.OLCircle.prototype.recreate=function(){var x,y,circle3857;this.olFeature&&(this.layer.getSource().removeFeature(this.olFeature),delete this.olFeature),this.center&&this.radius&&(circle3857=1e3*parseFloat(this.radius),x=this.center.lng,y=this.center.lat,circle3857=ol.geom.Polygon.circular([x,y],circle3857,64).clone().transform("EPSG:4326","EPSG:3857"),this.olFeature=new ol.Feature(circle3857),this.layer.getSource().addFeature(this.olFeature))},WPGMZA.OLCircle.prototype.setVisible=function(visible){this.layer.setVisible(!!visible)},WPGMZA.OLCircle.prototype.setCenter=function(center){WPGMZA.Circle.prototype.setCenter.apply(this,arguments),this.recreate()},WPGMZA.OLCircle.prototype.getRadius=function(){return this.layer.getSource().getFeatures()[0].getGeometry().getRadius()/1e3},WPGMZA.OLCircle.prototype.setRadius=function(radius){WPGMZA.Circle.prototype.setRadius.apply(this,arguments)},WPGMZA.OLCircle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLDrawingManager=function(map){WPGMZA.DrawingManager.call(this,map),this.source=new ol.source.Vector({wrapX:!1}),this.layer=new ol.layer.Vector({source:this.source})},WPGMZA.OLDrawingManager.prototype=Object.create(WPGMZA.DrawingManager.prototype),WPGMZA.OLDrawingManager.prototype.constructor=WPGMZA.OLDrawingManager,WPGMZA.OLDrawingManager.prototype.setOptions=function(options){var params={};options.strokeOpacity&&(params.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToRGBA(options.strokeColor,options.strokeOpacity)})),options.fillOpacity&&(params.fill=new ol.style.Fill({color:WPGMZA.hexOpacityToRGBA(options.fillColor,options.fillOpacity)})),this.layer.setStyle(new ol.style.Style(params))},WPGMZA.OLDrawingManager.prototype.setDrawingMode=function(mode){var type,endEventType,self=this;switch(WPGMZA.DrawingManager.prototype.setDrawingMode.call(this,mode),this.interaction&&(this.map.olMap.removeInteraction(this.interaction),this.interaction=null),mode){case WPGMZA.DrawingManager.MODE_NONE:case WPGMZA.DrawingManager.MODE_MARKER:return;case WPGMZA.DrawingManager.MODE_POLYGON:type="Polygon",endEventType="polygonclosed";break;case WPGMZA.DrawingManager.MODE_POLYLINE:type="LineString",endEventType="polylinecomplete";break;case WPGMZA.DrawingManager.MODE_CIRCLE:type="Circle",endEventType="circlecomplete";break;case WPGMZA.DrawingManager.MODE_RECTANGLE:type="Circle",endEventType="rectanglecomplete";break;case WPGMZA.DrawingManager.MODE_HEATMAP:return;default:throw new Error("Invalid drawing mode")}WPGMZA.mapEditPage&&WPGMZA.mapEditPage.selectInteraction&&WPGMZA.mapEditPage.map.olMap.removeInteraction(WPGMZA.mapEditPage.selectInteraction);var options={source:this.source,type:type};mode==WPGMZA.DrawingManager.MODE_RECTANGLE&&(options.geometryFunction=ol.interaction.Draw.createBox()),this.interaction=new ol.interaction.Draw(options),this.interaction.on("drawend",function(event){if(endEventType){var WPGMZAEvent=new WPGMZA.Event(endEventType);switch(mode){case WPGMZA.DrawingManager.MODE_POLYGON:WPGMZAEvent.enginePolygon=event.feature;break;case WPGMZA.DrawingManager.MODE_POLYLINE:WPGMZAEvent.enginePolyline=event.feature;break;case WPGMZA.DrawingManager.MODE_CIRCLE:WPGMZAEvent.engineCircle=event.feature;break;case WPGMZA.DrawingManager.MODE_RECTANGLE:WPGMZAEvent.engineRectangle=event.feature;break;default:throw new Error("Drawing mode not implemented")}self.dispatchEvent(WPGMZAEvent)}}),this.map.olMap.addInteraction(this.interaction)}}),jQuery(function($){WPGMZA.OLFeature=function(options){WPGMZA.assertInstangeOf(this,"OLFeature"),WPGMZA.Feature.apply(this,arguments)},WPGMZA.extend(WPGMZA.OLFeature,WPGMZA.Feature),WPGMZA.OLFeature.getOLStyle=function(options){var translated={};if(!options)return new ol.style.Style;var name,weight,color,map={fillcolor:"fillColor",opacity:"fillOpacity",linecolor:"strokeColor",lineopacity:"strokeOpacity",linethickness:"strokeWeight"};for(name in options=$.extend({},options))name in map&&(options[map[name]]=options[name]);return options.strokeColor&&(weight=color=1,"strokeOpacity"in options&&(color=options.strokeOpacity),"strokeWeight"in options&&(weight=options.strokeWeight),translated.stroke=new ol.style.Stroke({color:WPGMZA.hexOpacityToString(options.strokeColor,color),width:weight})),options.fillColor&&(color=1,"fillOpacity"in options&&(color=options.fillOpacity),color=WPGMZA.hexOpacityToString(options.fillColor,color),translated.fill=new ol.style.Fill({color:color})),new ol.style.Style(translated)},WPGMZA.OLFeature.setInteractionsOnFeature=function(feature,enable){enable?feature.modifyInteraction||(feature.snapInteraction=new ol.interaction.Snap({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.snapInteraction),feature.modifyInteraction=new ol.interaction.Modify({source:feature.layer.getSource()}),feature.map.olMap.addInteraction(feature.modifyInteraction),feature.modifyInteraction.on("modifyend",function(event){feature.trigger("change")})):feature.modifyInteraction&&(feature.map&&(feature.map.olMap.removeInteraction(feature.snapInteraction),feature.map.olMap.removeInteraction(feature.modifyInteraction)),delete feature.snapInteraction,delete feature.modifyInteraction)}}),jQuery(function($){WPGMZA.OLGeocoder=function(){},WPGMZA.OLGeocoder.prototype=Object.create(WPGMZA.Geocoder.prototype),WPGMZA.OLGeocoder.prototype.constructor=WPGMZA.OLGeocoder,WPGMZA.OLGeocoder.prototype.getResponseFromCache=function(query,callback){WPGMZA.restAPI.call("/geocode-cache",{data:{query:JSON.stringify(query)},success:function(response,xhr,status){response.lng=response.lon,callback(response)},useCompressedPathVariable:!0})},WPGMZA.OLGeocoder.prototype.getResponseFromNominatim=function(options,callback){var data={q:options.address,format:"json"};options.componentRestrictions&&options.componentRestrictions.country?data.countrycodes=options.componentRestrictions.country:options.country&&(data.countrycodes=options.country),$.ajax("https://nominatim.openstreetmap.org/search/",{data:data,success:function(response,xhr,status){callback(response)},error:function(response,xhr,status){callback(null,WPGMZA.Geocoder.FAIL)}})},WPGMZA.OLGeocoder.prototype.cacheResponse=function(query,response){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_store_nominatim_cache",query:JSON.stringify(query),response:JSON.stringify(response)},method:"POST"})},WPGMZA.OLGeocoder.prototype.clearCache=function(callback){$.ajax(WPGMZA.ajaxurl,{data:{action:"wpgmza_clear_nominatim_cache"},method:"POST",success:function(response){callback(response)}})},WPGMZA.OLGeocoder.prototype.getLatLngFromAddress=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.getAddressFromLatLng=function(options,callback){return WPGMZA.OLGeocoder.prototype.geocode(options,callback)},WPGMZA.OLGeocoder.prototype.geocode=function(options,callback){var finish,location,self=this;if(!options)throw new Error("Invalid options");if(WPGMZA.LatLng.REGEXP.test(options.address)){var latLng=WPGMZA.LatLng.fromString(options.address);callback([{geometry:{location:latLng},latLng:latLng,lat:latLng.lat,lng:latLng.lng}],WPGMZA.Geocoder.SUCCESS)}else{if(options.location&&(options.latLng=new WPGMZA.LatLng(options.location)),options.address)location=options.address,finish=function(response,status){for(var i=0;i<response.length;i++)response[i].geometry={location:new WPGMZA.LatLng({lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)})},response[i].latLng={lat:parseFloat(response[i].lat),lng:parseFloat(response[i].lon)},response[i].bounds=new WPGMZA.LatLngBounds(new WPGMZA.LatLng({lat:response[i].boundingbox[1],lng:response[i].boundingbox[2]}),new WPGMZA.LatLng({lat:response[i].boundingbox[0],lng:response[i].boundingbox[3]})),response[i].lng=response[i].lon;callback(response,status)};else{if(!options.latLng)throw new Error("You must supply either a latLng or address");location=options.latLng.toString(),finish=function(address,status){address=address[0].display_name;callback([address],status)}}var query={location:location,options:options};this.getResponseFromCache(query,function(response){response.length?finish(response,WPGMZA.Geocoder.SUCCESS):self.getResponseFromNominatim($.extend(options,{address:location}),function(response,status){status!=WPGMZA.Geocoder.FAIL?0!=response.length?(finish(response,WPGMZA.Geocoder.SUCCESS),self.cacheResponse(query,response)):callback([],WPGMZA.Geocoder.ZERO_RESULTS):callback(null,WPGMZA.Geocoder.FAIL)})})}}}),jQuery(function($){WPGMZA.OLModernStoreLocatorCircle=function(map,settings){WPGMZA.ModernStoreLocatorCircle.call(this,map,settings)},WPGMZA.OLModernStoreLocatorCircle.prototype=Object.create(WPGMZA.ModernStoreLocatorCircle.prototype),WPGMZA.OLModernStoreLocatorCircle.prototype.constructor=WPGMZA.OLModernStoreLocatorCircle,WPGMZA.OLModernStoreLocatorCircle.prototype.initCanvasLayer=function(){var self=this,olViewportElement=$(this.map.element).children(".ol-viewport");this.canvas=document.createElement("canvas"),this.canvas.className="wpgmza-ol-canvas-overlay",olViewportElement.find(".ol-layers .ol-layer:first-child").prepend(this.canvas),this.renderFunction=function(event){self.canvas.width==olViewportElement.width()&&self.canvas.height==olViewportElement.height()||(self.canvas.width=olViewportElement.width(),self.canvas.height=olViewportElement.height(),$(this.canvas).css({width:olViewportElement.width()+"px",height:olViewportElement.height()+"px"})),self.draw()},this.map.olMap.on("postrender",this.renderFunction)},WPGMZA.OLModernStoreLocatorCircle.prototype.getContext=function(type){return this.canvas.getContext(type)},WPGMZA.OLModernStoreLocatorCircle.prototype.getCanvasDimensions=function(){return{width:this.canvas.width,height:this.canvas.height}},WPGMZA.OLModernStoreLocatorCircle.prototype.getCenterPixels=function(){return this.map.latLngToPixels(this.settings.center)},WPGMZA.OLModernStoreLocatorCircle.prototype.getWorldOriginOffset=function(){return{x:0,y:0}},WPGMZA.OLModernStoreLocatorCircle.prototype.getTransformedRadius=function(km){var centerPixels=new WPGMZA.LatLng(this.settings.center),outerPixels=new WPGMZA.LatLng(centerPixels);outerPixels.moveByDistance(km,90);centerPixels=this.map.latLngToPixels(centerPixels),outerPixels=this.map.latLngToPixels(outerPixels);return Math.abs(outerPixels.x-centerPixels.x)},WPGMZA.OLModernStoreLocatorCircle.prototype.getScale=function(){return 1},WPGMZA.OLModernStoreLocatorCircle.prototype.destroy=function(){$(this.canvas).remove(),this.map.olMap.un("postrender",this.renderFunction),this.map=null,this.canvas=null}}),jQuery(function($){var Parent;WPGMZA.OLPolyline=function(options,olFeature){if(WPGMZA.Polyline.call(this,options),olFeature)this.olFeature=olFeature;else{var coordinates=[];if(options&&options.polydata)for(var path=this.parseGeometry(options.polydata),i=0;i<path.length;i++){if(!$.isNumeric(path[i].lat))throw new Error("Invalid latitude");if(!$.isNumeric(path[i].lng))throw new Error("Invalid longitude");coordinates.push(ol.proj.fromLonLat([parseFloat(path[i].lng),parseFloat(path[i].lat)]))}this.olFeature=new ol.Feature({geometry:new ol.geom.LineString(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolyline:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.Polyline,WPGMZA.OLPolyline.prototype=Object.create(Parent.prototype),WPGMZA.OLPolyline.prototype.constructor=WPGMZA.OLPolyline,WPGMZA.OLPolyline.prototype.getGeometry=function(){for(var result=[],coordinates=this.olFeature.getGeometry().getCoordinates(),i=0;i<coordinates.length;i++){var latLng=ol.proj.toLonLat(coordinates[i]),latLng={lat:latLng[1],lng:latLng[0]};result.push(latLng)}return result},WPGMZA.OLPolyline.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){var Parent=WPGMZA.Rectangle;WPGMZA.OLRectangle=function(options,olFeature){var coordinates;Parent.apply(this,arguments),olFeature?this.olFeature=olFeature:(coordinates=[[]],options.cornerA&&options.cornerB&&(coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerA.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerB.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerB.lat)])),coordinates[0].push(ol.proj.fromLonLat([parseFloat(options.cornerA.lng),parseFloat(options.cornerA.lat)]))),this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})),this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]}),style:this.olStyle}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaRectangle:this,wpgmzaFeature:this}),options&&this.setOptions(options)},WPGMZA.extend(WPGMZA.OLRectangle,WPGMZA.Rectangle),WPGMZA.OLRectangle.prototype.getBounds=function(){var bottomRightLatLng=this.olFeature.getGeometry().getExtent(),topLeftLatLng=ol.extent.getTopLeft(bottomRightLatLng),bottomRightLatLng=ol.extent.getBottomRight(bottomRightLatLng),topLeftLatLng=ol.proj.toLonLat(topLeftLatLng),bottomRightLatLng=ol.proj.toLonLat(bottomRightLatLng),topLeftLatLng=new WPGMZA.LatLng(topLeftLatLng[1],topLeftLatLng[0]),bottomRightLatLng=new WPGMZA.LatLng(bottomRightLatLng[1],bottomRightLatLng[0]);return new WPGMZA.LatLngBounds(topLeftLatLng,bottomRightLatLng)},WPGMZA.OLRectangle.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.OLText=function(){}}),jQuery(function($){WPGMZA.DataTable=function(element){var version,self=this;if(!$.fn.dataTable)return console.warn("The dataTables library is not loaded. Cannot create a dataTable. Did you enable 'Do not enqueue dataTables'?"),void(WPGMZA.settings.wpgmza_do_not_enqueue_datatables&&WPGMZA.getCurrentPage()==WPGMZA.PAGE_MAP_EDIT&&alert("You have selected 'Do not enqueue DataTables' in WP Google Maps' settings. No 3rd party software is loading the DataTables library. Because of this, the marker table cannot load. Please uncheck this option to use the marker table."));$.fn.dataTable.ext?$.fn.dataTable.ext.errMode="throw":(version=$.fn.dataTable.version||"unknown",console.warn("You appear to be running an outdated or modified version of the dataTables library. This may cause issues with table functionality. This is usually caused by 3rd party software loading an older version of DataTables. The loaded version is "+version+", we recommend version 1.10.12 or above.")),$.fn.dataTable.Api&&$.fn.dataTable.Api.register("processing()",function(show){return this.iterator("table",function(ctx){ctx.oApi._fnProcessingDisplay(ctx,show)})}),this.element=element,(this.element.wpgmzaDataTable=this).dataTableElement=this.getDataTableElement();var settings=this.getDataTableSettings();this.phpClass=$(element).attr("data-wpgmza-php-class"),(this.wpgmzaDataTable=this).useCompressedPathVariable=WPGMZA.restAPI&&WPGMZA.restAPI.isCompressedPathVariableSupported&&WPGMZA.settings.enable_compressed_path_variables,this.method=this.useCompressedPathVariable?"GET":"POST",null==this.getLanguageURL()||"//cdn.datatables.net/plug-ins/1.10.12/i18n/English.json"==this.getLanguageURL()?(this.dataTable=$(this.dataTableElement).DataTable(settings),this.dataTable.ajax.reload()):$.ajax(this.getLanguageURL(),{success:function(response,status,xhr){self.languageJSON=response,self.dataTable=$(self.dataTableElement).DataTable(settings),self.dataTable.ajax.reload()}})},WPGMZA.DataTable.prototype.getDataTableElement=function(){return $(this.element).find("table")},WPGMZA.DataTable.prototype.onAJAXRequest=function(data,settings){var params={phpClass:this.phpClass},attr=$(this.element).attr("data-wpgmza-ajax-parameters");return attr&&$.extend(params,JSON.parse(attr)),$.extend(data,params)},WPGMZA.DataTable.prototype.onDataTableAjaxRequest=function(data,callback,options){var self=this,route=this.element,route=$(route).attr("data-wpgmza-rest-api-route"),options=this.onAJAXRequest(data,options),draw=options.draw;if(delete options.draw,!route)throw new Error("No data-wpgmza-rest-api-route attribute specified");options={method:"POST",useCompressedPathVariable:!0,data:options,dataType:"json",cache:!this.preventCaching,beforeSend:function(xhr){xhr.setRequestHeader("X-DataTables-Draw",draw)},success:function(response,status,xhr){response.draw=draw,self.lastResponse=response,callback(response),$("[data-marker-icon-src]").each(function(index,element){WPGMZA.MarkerIcon.createInstance($(element).attr("data-marker-icon-src")).applyToElement(element)})}};return WPGMZA.restAPI.call(route,options)},WPGMZA.DataTable.prototype.getDataTableSettings=function(){var self=this,languageURL=this.element,options={};$(languageURL).attr("data-wpgmza-datatable-options")&&(options=JSON.parse($(languageURL).attr("data-wpgmza-datatable-options"))),options.deferLoading=!0,options.processing=!0,options.serverSide=!0,options.ajax=function(data,callback,settings){return WPGMZA.DataTable.prototype.onDataTableAjaxRequest.apply(self,arguments)},WPGMZA.AdvancedTableDataTable&&this instanceof WPGMZA.AdvancedTableDataTable&&WPGMZA.settings.wpgmza_default_items&&(options.iDisplayLength=parseInt(WPGMZA.settings.wpgmza_default_items)),options.aLengthMenu=[[5,10,25,50,100,-1],["5","10","25","50","100",WPGMZA.localized_strings.all]];languageURL=this.getLanguageURL();return languageURL&&(options.language={url:languageURL}),options},WPGMZA.DataTable.prototype.getLanguageURL=function(){if(!WPGMZA.locale)return null;var languageURL;switch(WPGMZA.locale.substr(0,2)){case"af":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Afrikaans.json";break;case"sq":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Albanian.json";break;case"am":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Amharic.json";break;case"ar":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Arabic.json";break;case"hy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Armenian.json";break;case"az":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Azerbaijan.json";break;case"bn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bangla.json";break;case"eu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Basque.json";break;case"be":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Belarusian.json";break;case"bg":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Bulgarian.json";break;case"ca":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Catalan.json";break;case"zh":languageURL="zh_TW"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Chinese-traditional.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Chinese.json";break;case"hr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Croatian.json";break;case"cs":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Czech.json";break;case"da":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Danish.json";break;case"nl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Dutch.json";break;case"et":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Estonian.json";break;case"fi":languageURL=WPGMZA.locale.match(/^fil/)?WPGMZA.pluginDirURL+"languages/datatables/Filipino.json":WPGMZA.pluginDirURL+"languages/datatables/Finnish.json";break;case"fr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/French.json";break;case"gl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Galician.json";break;case"ka":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Georgian.json";break;case"de":languageURL=WPGMZA.pluginDirURL+"languages/datatables/German.json";break;case"el":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Greek.json";break;case"gu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Gujarati.json";break;case"he":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hebrew.json";break;case"hi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hindi.json";break;case"hu":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Hungarian.json";break;case"is":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Icelandic.json";break;case"id":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Indonesian.json";break;case"ga":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Irish.json";break;case"it":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Italian.json";break;case"ja":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Japanese.json";break;case"kk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kazakh.json";break;case"ko":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Korean.json";break;case"ky":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Kyrgyz.json";break;case"lv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Latvian.json";break;case"lt":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Lithuanian.json";break;case"mk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Macedonian.json";break;case"ml":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Malay.json";break;case"mn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Mongolian.json";break;case"ne":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Nepali.json";break;case"nb":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Bokmal.json";break;case"nn":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Norwegian-Nynorsk.json";break;case"ps":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Pashto.json";break;case"fa":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Persian.json";break;case"pl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Polish.json";break;case"pt":languageURL="pt_BR"==WPGMZA.locale?WPGMZA.pluginDirURL+"languages/datatables/Portuguese-Brasil.json":"//cdn.datatables.net/plug-ins/1.10.12/i18n/Portuguese.json";break;case"ro":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Romanian.json";break;case"ru":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Russian.json";break;case"sr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Serbian.json";break;case"si":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Sinhala.json";break;case"sk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovak.json";break;case"sl":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Slovenian.json";break;case"es":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Spanish.json";break;case"sw":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swahili.json";break;case"sv":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Swedish.json";break;case"ta":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Tamil.json";break;case"te":languageURL=WPGMZA.pluginDirURL+"languages/datatables/telugu.json";break;case"th":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Thai.json";break;case"tr":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Turkish.json";break;case"uk":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Ukrainian.json";break;case"ur":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Urdu.json";break;case"uz":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Uzbek.json";break;case"vi":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Vietnamese.json";break;case"cy":languageURL=WPGMZA.pluginDirURL+"languages/datatables/Welsh.json"}return languageURL},WPGMZA.DataTable.prototype.onAJAXResponse=function(response){},WPGMZA.DataTable.prototype.reload=function(){this.dataTable.ajax.reload(null,!1)}}),jQuery(function($){WPGMZA.AdminFeatureDataTable=function(element){var self=this;this.allSelected=!1,WPGMZA.DataTable.call(this,element),$(element).on("click",".wpgmza.bulk_delete",function(event){self.onBulkDelete(event)}),$(element).on("click",".wpgmza.select_all_markers",function(event){self.onSelectAll(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.extend(WPGMZA.AdminFeatureDataTable,WPGMZA.DataTable),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featureType",{get:function(){return $(this.element).attr("data-wpgmza-feature-type")}}),Object.defineProperty(WPGMZA.AdminFeatureDataTable.prototype,"featurePanel",{get:function(){return WPGMZA.mapEditPage[this.featureType+"Panel"]}}),WPGMZA.AdminFeatureDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,meta){meta=self.lastResponse.meta[meta];row.wpgmzaFeatureData=meta},options},WPGMZA.AdminFeatureDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0],plural=this.featureType+"s";$(this.element).find("input[name='mark']:checked").each(function(index,row){row=$(row).closest("tr")[0];ids.push(row.wpgmzaFeatureData.id)}),ids.forEach(function(marker){marker=map.getMarkerByID(marker);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/"+plural+"/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminFeatureDataTable.prototype.onSelectAll=function(event){this.allSelected=!this.allSelected;var self=this;$(this.element).find("input[name='mark']").each(function(){self.allSelected?$(this).prop("checked",!0):$(this).prop("checked",!1)})},WPGMZA.AdminFeatureDataTable.prototype.onCenterMarker=function(latLng){latLng=null==latLng.currentTarget?latLng:$(latLng.currentTarget).attr("data-center-marker-id"),latLng=WPGMZA.mapEditPage.map.getMarkerByID(latLng);latLng&&(latLng=new WPGMZA.LatLng({lat:latLng.lat,lng:latLng.lng}),WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.animateScroll("#wpgmaps_tabs_markers"))}}),jQuery(function($){WPGMZA.AdminMapDataTable=function(element){var self=this;WPGMZA.DataTable.call(this,element),$(element).on("mousedown","button[data-action='edit']",function(event){switch(event.which){case 1:var map_id=$(event.target).attr("data-map-id");window.location.href=window.location.href+"&action=edit&map_id="+map_id;break;case 2:map_id=$(event.target).attr("data-map-id");window.open(window.location.href+"&action=edit&map_id="+map_id)}}),$(element).find(".wpgmza.select_all_maps").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete_maps").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","button[data-action='duplicate']",function(map_id){map_id=$(map_id.target).attr("data-map-id");self.dataTable.processing(!0),WPGMZA.restAPI.call("/maps/",{method:"POST",data:{id:map_id,action:"duplicate"},success:function(response,status,xhr){self.reload()}})}),$(element).on("click","button[data-action='trash']",function(map_id){var result=confirm(WPGMZA.localized_strings.map_delete_prompt_text);self.dataTable.processing(!0),result&&(map_id=$(map_id.target).attr("data-map-id"),WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{id:map_id},success:function(response,status,xhr){self.reload()}}))})},WPGMZA.extend(WPGMZA.AdminMapDataTable,WPGMZA.DataTable),WPGMZA.AdminMapDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,meta){meta=self.lastResponse.meta[meta];row.wpgmzaMapData=meta},options},WPGMZA.AdminMapDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMapDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[];$(this.element).find("input[name='mark']:checked").each(function(index,row){row=$(row).closest("tr")[0];ids.push(row.wpgmzaMapData.id)}),confirm(WPGMZA.localized_strings.map_bulk_delete_prompt_text)&&WPGMZA.restAPI.call("/maps/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},$(document).ready(function(event){$("[data-wpgmza-admin-map-datatable]").each(function(index,el){WPGMZA.AdminMapDataTable=new WPGMZA.AdminMapDataTable(el)})})}),jQuery(function($){WPGMZA.AdminMarkerDataTable=function(element){var self=this;this.preventCaching=!0,WPGMZA.DataTable.call(this,element),$(element).on("click","[data-delete-marker-id]",function(event){self.onDeleteMarker(event)}),$(element).find(".wpgmza.select_all_markers").on("click",function(event){self.onSelectAll(event)}),$(element).find(".wpgmza.bulk_delete").on("click",function(event){self.onBulkDelete(event)}),$(element).on("click","[data-center-marker-id]",function(event){self.onCenterMarker(event)})},WPGMZA.AdminMarkerDataTable.prototype=Object.create(WPGMZA.DataTable.prototype),WPGMZA.AdminMarkerDataTable.prototype.constructor=WPGMZA.AdminMarkerDataTable,WPGMZA.AdminMarkerDataTable.createInstance=function(element){return new WPGMZA.AdminMarkerDataTable(element)},WPGMZA.AdminMarkerDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.call(this);return options.createdRow=function(row,data,meta){meta=self.lastResponse.meta[meta];row.wpgmzaMarkerData=meta},options},WPGMZA.AdminMarkerDataTable.prototype.onEditMarker=function(event){WPGMZA.animatedScroll("#wpgmaps_tabs_markers")},WPGMZA.AdminMarkerDataTable.prototype.onDeleteMarker=function(data){var self=this,id=$(data.currentTarget).attr("data-delete-marker-id"),data={action:"delete_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:id};$.post(ajaxurl,data,function(response){WPGMZA.mapEditPage.map.removeMarkerByID(id),self.reload()})},WPGMZA.AdminMarkerDataTable.prototype.onApproveMarker=function(event){var data=$(this).attr("id"),data={action:"approve_marker",security:WPGMZA.legacyajaxnonce,map_id:WPGMZA.mapEditPage.map.id,marker_id:data};$.post(ajaxurl,data,function(response){wpgmza_InitMap(),wpgmza_reinitialisetbl()})},WPGMZA.AdminMarkerDataTable.prototype.onSelectAll=function(event){$(this.element).find("input[name='mark']").prop("checked",!0)},WPGMZA.AdminMarkerDataTable.prototype.onBulkDelete=function(event){var self=this,ids=[],map=WPGMZA.maps[0];$(this.element).find("input[name='mark']:checked").each(function(index,row){row=$(row).closest("tr")[0];ids.push(row.wpgmzaMarkerData.id)}),ids.forEach(function(marker){marker=map.getMarkerByID(marker);marker&&map.removeMarker(marker)}),WPGMZA.restAPI.call("/markers/",{method:"DELETE",data:{ids:ids},complete:function(){self.reload()}})},WPGMZA.AdminMarkerDataTable.prototype.onCenterMarker=function(latLng){latLng=null==latLng.currentTarget?latLng:$(latLng.currentTarget).attr("data-center-marker-id"),latLng=WPGMZA.mapEditPage.map.getMarkerByID(latLng);latLng&&(latLng=new WPGMZA.LatLng({lat:latLng.lat,lng:latLng.lng}),WPGMZA.mapEditPage.map.setCenter(latLng),WPGMZA.mapEditPage.map.setZoom(6),WPGMZA.animateScroll("#wpgmaps_tabs_markers"))}}),jQuery(function($){WPGMZA.AdvancedPage=function(){$("#wpgmaps_tabs").tabs(),WPGMZA.restAPI.call("/markers?action=count-duplicates",{success:function(result){}}),$("button#wpgmza-remove-duplicates").on("click",function(event){confirm(WPGMZA.localized_strings.confirm_remove_duplicates)&&($(event.target).prop("disabled",!0),WPGMZA.restAPI.call("/markers?action=remove-duplicates",{success:function(result){alert(result.message),$(event.target).prop("disabled",!1)}}))})},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_ADVANCED&&(WPGMZA.advancedPage=new WPGMZA.AdvancedPage)})}),jQuery(function($){WPGMZA.CategoriesPage=function(){0<$(".wpgmza-marker-icon-picker").length&&(this.markerIconPicker=new WPGMZA.MarkerIconPicker($(".wpgmza-marker-icon-picker")))},$(document).ready(function(event){WPGMZA.getCurrentPage()==WPGMZA.PAGE_CATEGORIES&&(WPGMZA.categoriesPage=new WPGMZA.CategoriesPage)})}),jQuery(function($){WPGMZA.CategoryPicker=function(element){var self=this,data=JSON.parse($(element).attr("data-js-tree-data"));this.element=element,this.input=$(this.element).find("input.wpgmza-category-picker-input"),$(this.element).jstree({core:{data:data},plugins:["checkbox"]}).on("loaded.jstree",function(){$(self.element).jstree("open_all")}),$(this.element).after(this.input),$(this.element).on("changed.jstree",function(e,data){self.input.val(self.getSelection().join(","))})},WPGMZA.CategoryPicker.prototype.getSelection=function(){return $(this.element).jstree("get_selected")},WPGMZA.CategoryPicker.prototype.setSelection=function(arr){$(this.element).jstree("deselect_all"),arr&&$(this.element).jstree("select_node",arr)}}),jQuery(function($){WPGMZA.CategoryTreeNode=function(options){for(var name in this.children=[],options)if("children"===name)for(var i=0;i<options.children.length;i++){var child=WPGMZA.CategoryTreeNode.createInstance(options.children[i]);(child.parent=this).children.push(child)}else this[name]=options[name]},WPGMZA.extend(WPGMZA.CategoryTreeNode,WPGMZA.EventDispatcher),WPGMZA.CategoryTreeNode.createInstance=function(options){return new WPGMZA.CategoryTreeNode(options)},WPGMZA.CategoryTreeNode.prototype.getChildByID=function(id){if(this.id==id)return this;for(var i=0;i<this.children.length;i++){var result=this.children[i].getChildByID(id);if(result)return result}return null}}),jQuery(function($){WPGMZA.CategoryTree=function(options){WPGMZA.CategoryTreeNode.call(this,options)},WPGMZA.extend(WPGMZA.CategoryTree,WPGMZA.CategoryTreeNode),WPGMZA.CategoryTree.createInstance=function(options){return new WPGMZA.CategoryTree(options)},WPGMZA.CategoryTree.prototype.getCategoryByID=function(id){return this.getChildByID(id)},WPGMZA.categoryTreeData&&(WPGMZA.categories=WPGMZA.CategoryTree.createInstance(WPGMZA.categoryTreeData),delete WPGMZA.categoryTreeData)}),jQuery(function($){WPGMZA.CustomFieldFilterController=function(map_id){var self=this;this.map_id=map_id,this.widgets=[],this.ajaxTimeoutID=null,this.ajaxRequest=null,this.markerListingCSS=$("<style type='text/css'/>"),$(document.body).append(this.markerListingCSS),WPGMZA.CustomFieldFilterController.controllersByMapID[map_id]=this,$("[data-wpgmza-filter-widget-class][data-map-id="+map_id+"]").each(function(index,el){self.widgets.push(WPGMZA.CustomFieldFilterWidget.createInstance(el)),$(el).on("input change",function(event){self.onWidgetChanged(event)}),$(el).is(":checkbox")&&$(el).on("click",function(event){self.onWidgetChanged(event)})});var container=$(".wpgmza-filter-widgets[data-map-id='"+map_id+"']");$(container).find("button.wpgmza-reset-custom-fields").on("click",function(event){$(container).find("input:not([type='checkbox']):not([type='radio']), textarea").val(""),$(container).find("input[type='checkbox']").prop("checked",!1),$(container).find("select").val(""),self.onWidgetChanged()})},WPGMZA.CustomFieldFilterController.AJAX_DELAY=500,WPGMZA.CustomFieldFilterController.controllersByMapID={},WPGMZA.CustomFieldFilterController.dataTablesSourceHTMLByMapID={},WPGMZA.CustomFieldFilterController.createInstance=function(map_id){return new WPGMZA.CustomFieldFilterController(map_id)},WPGMZA.CustomFieldFilterController.prototype.getAjaxRequestData=function(){var self=this,result={url:WPGMZA.ajaxurl,method:"POST",data:{action:"wpgmza_custom_field_filter_get_filtered_marker_ids",map_id:this.map_id,widgetData:[]},success:function(response,status,xhr){self.onAjaxResponse(response,status,xhr)}};return this.widgets.forEach(function(widget){result.data.widgetData.push(widget.getAjaxRequestData())}),result},WPGMZA.CustomFieldFilterController.prototype.onWidgetChanged=function(event){var map=WPGMZA.getMapByID(this.map_id);map.markerListing&&map.markerListing.dataTable&&map.markerListing.dataTable.dataTable&&map.markerListing.dataTable.dataTable.page(1).draw(),map.markerFilter.update({},this)},WPGMZA.CustomFieldFilterController.prototype.onAjaxResponse=function(response,status,xhr){this.lastResponse=response;var marker_id,container,selectors=[];for(marker_id in marker_array[this.map_id]){var visible=0==response.marker_ids.length||-1<response.marker_ids.indexOf(marker_id);marker_array[this.map_id][marker_id].setVisible(visible),visible||selectors.push(".wpgmaps_mlist_row[mid='"+marker_id+"']")}wpgmaps_localize[this.map_id].order_markers_by&&2==wpgmaps_localize[this.map_id].order_markers_by?wpgmza_update_data_table(WPGMZA.CustomFieldFilterController.dataTablesSourceHTMLByMapID[this.map_id],this.map_id):(this.markerListingCSS.html(selectors.join(", ")+"{ display: none; }"),container=this.currAdvancedTableHTML?$("#wpgmza_marker_holder_"+this.map_id):$(this.currAdvancedTableHTML),this.applyToAdvancedTable(container))},WPGMZA.CustomFieldFilterController.prototype.reapplyLastResponse=function(){if(this.lastResponse){var marker_id,response=this.lastResponse;for(marker_id in marker_array[this.map_id]){var visible=-1<response.marker_ids.indexOf(marker_id);marker_array[this.map_id][marker_id].setVisible(visible)}}},WPGMZA.CustomFieldFilterController.prototype.applyToAdvancedTable=function(){var response,container;this.lastResponse&&(response=this.lastResponse,container=$("#wpgmza_marker_holder_"+this.map_id),$(container).find("[mid]").each(function(index,el){var marker_id=$(el).attr("mid");-1==response.marker_ids.indexOf(marker_id)&&$(el).remove()}))},$(window).on("load",function(event){1!=WPGMZA.is_admin&&$(".wpgmza_map").each(function(index,el){parseInt($(el).attr("id").match(/\d+/)[0]);setTimeout(function(){$(el).children("div").first().after($(".wpgmza-modern-marker-open-button"))},500)})})}),jQuery(function($){WPGMZA.CustomFieldFilterWidget=function(element){this.element=element},WPGMZA.CustomFieldFilterWidget.createInstance=function(element){var widgetPHPClass=$(element).attr("data-wpgmza-filter-widget-class"),constructor=null;switch(widgetPHPClass){case"WPGMZA\\CustomFieldFilterWidget\\Text":constructor=WPGMZA.CustomFieldFilterWidget.Text;break;case"WPGMZA\\CustomFieldFilterWidget\\Dropdown":constructor=WPGMZA.CustomFieldFilterWidget.Dropdown;break;case"WPGMZA\\CustomFieldFilterWidget\\Checkboxes":constructor=WPGMZA.CustomFieldFilterWidget.Checkboxes;break;case"WPGMZA\\CustomFieldFilterWidget\\Time":constructor=WPGMZA.CustomFieldFilterWidget.Time;break;case"WPGMZA\\CustomFieldFilterWidget\\Date":constructor=WPGMZA.CustomFieldFilterWidget.Date;break;default:throw new Error("Unknown field type '"+widgetPHPClass+"'")}return new constructor(element)},WPGMZA.CustomFieldFilterWidget.prototype.getAjaxRequestData=function(){return{field_id:$(this.element).attr("data-field-id"),value:$(this.element).val()}},WPGMZA.CustomFieldFilterWidget.Text=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Text.prototype=Object.create(WPGMZA.CustomFieldFilterWidget.prototype),WPGMZA.CustomFieldFilterWidget.Text.prototype.constructor=WPGMZA.CustomFieldFilterWidget.Text,WPGMZA.CustomFieldFilterWidget.Dropdown=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Dropdown.prototype=Object.create(WPGMZA.CustomFieldFilterWidget.prototype),WPGMZA.CustomFieldFilterWidget.Dropdown.prototype.constructor=WPGMZA.CustomFieldFilterWidget.Dropdown,WPGMZA.CustomFieldFilterWidget.Checkboxes=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Checkboxes.prototype=Object.create(WPGMZA.CustomFieldFilterWidget.prototype),WPGMZA.CustomFieldFilterWidget.Checkboxes.prototype.constructor=WPGMZA.CustomFieldFilterWidget.Checkboxes,WPGMZA.CustomFieldFilterWidget.Checkboxes.prototype.getAjaxRequestData=function(){var checked=[];return $(this.element).find(":checked").each(function(index,el){checked.push($(el).val())}),{field_id:$(this.element).attr("data-field-id"),value:checked}},$(document.body).on("mouseover",".wpgmza-placeholder-label",function(event){$(event.currentTarget).children("ul.wpgmza-checkboxes").stop(!0,!1).fadeIn()}),$(document.body).on("mouseleave",".wpgmza-placeholder-label",function(event){$(event.currentTarget).children("ul.wpgmza-checkboxes").stop(!0,!1).fadeOut()}),WPGMZA.CustomFieldFilterWidget.Time=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Time.prototype.getAjaxRequestData=function(){var field_id=$(this.element).attr("data-field-id");return{field_id:field_id,value_start:$('[data-field-id="'+field_id+'"][data-date-start="true"]').val(),value_end:$('[data-field-id="'+field_id+'"][data-date-end="true"]').val(),type:"time"}},WPGMZA.CustomFieldFilterWidget.Date=function(element){WPGMZA.CustomFieldFilterWidget.apply(this,arguments)},WPGMZA.CustomFieldFilterWidget.Date.prototype.getAjaxRequestData=function(){var field_id=$(this.element).attr("data-field-id");return{field_id:field_id,value_start:$('[data-field-id="'+field_id+'"][data-date-start="true"]').val(),value_end:$('[data-field-id="'+field_id+'"][data-date-end="true"]').val(),type:"date"}}}),jQuery(function($){WPGMZA.DirectionsBox=function(map){var self=this;if(this.map=map,this.element=$("#wpgmaps_directions_edit_"+map.id),this.element[0].wpgmzaMap=map,$(this.element).find("input.wpgmza-address").each(function(index,el){el.wpgmzaAddressInput=WPGMZA.AddressInput.createInstance(el,map)}),this.optionsElement=this.element.find(".wpgmza-directions-options"),this.optionsElement.hide(),this.showOptionsElement=this.element.find("#wpgmza_show_options_"+map.id),this.showOptionsElement.on("click",function(event){self.onShowOptions(event)}),this.hideOptionsElement=this.element.find("#wpgmza_hide_options_"+map.id),this.hideOptionsElement.on("click",function(event){self.onHideOptions(event)}),this.hideOptionsElement.hide(),this.waypointTemplateItem=$(this.element).find(".wpgmaps_via.wpgmaps_template"),this.waypointTemplateItem.removeClass("wpgmaps_template"),this.waypointTemplateItem.remove(),this.element.find(".wpgmaps_add_waypoint a").on("click",function(event){self.onAddWaypoint(event)}),this.element.on("click",".wpgmza_remove_via",function(event){self.onRemoveWaypoint(event)}),this.element.on("click",".wpgmza-travel-mode-option",function(){var mode=jQuery(this).data("mode");self.travelMode=mode,jQuery("body").find(".wpgmza-travel-mode-option").removeClass("wpgmza-travel-option__selected"),jQuery(this).addClass("wpgmza-travel-option__selected"),jQuery("body").find(".wpgmza-travel-mode").val(mode)}),$("body").sortable&&$(this.element).find(".wpgmaps_directions_outer_div [data-map-id]").sortable({items:".wpgmza-form-field.wpgmaps_via"}),this.getDirectionsButton=this.element.find(".wpgmaps_get_directions"),this.getDirectionsButton.on("click",function(event){self.onGetDirections()}),$(this.element).find(".wpgmza-reset-directions").on("click",function(event){self.onResetDirections(event)}),$(this.element).find(".wpgmza-print-directions").on("click",function(event){self.onPrintDirections(event)}),this.service=WPGMZA.DirectionsService.createInstance(map),this.renderer=WPGMZA.DirectionsRenderer.createInstance(map),this.map.shortcodeAttributes.directions_from&&$("#wpgmza_input_from_"+this.map.id).val(this.map.shortcodeAttributes.directions_from),this.map.shortcodeAttributes.directions_to&&$("#wpgmza_input_to_"+this.map.id).val(this.map.shortcodeAttributes.directions_to),this.map.shortcodeAttributes.directions_waypoints)for(var addresses=this.map.shortcodeAttributes.directions_waypoints.split("|"),i=0;i<addresses.length;i++)this.addWaypoint(addresses[i]);"true"==this.map.shortcodeAttributes.directions_auto&&this.route(),this.openExternal&&this.isUsingAppleMaps&&$(".wpgmza-add-waypoint").hide()},WPGMZA.DirectionsBox.prototype=Object.create(WPGMZA.EventDispatcher),WPGMZA.DirectionsBox.prototype.constructor=WPGMZA.DirectionsBox,WPGMZA.DirectionsBox.STYLE_DEFAULT="default",WPGMZA.DirectionsBox.STYLE_MODERN="modern",WPGMZA.DirectionsBox.STATE_INPUT="input",WPGMZA.DirectionsBox.STATE_DISPLAY="display",WPGMZA.DirectionsBox.forceGoogleMaps=!1,WPGMZA.DirectionsBox.createInstance=function(map){return new(!WPGMZA.isModernComponentStyleAllowed()||"modern"!=map.settings.directions_box_style&&"modern"!=WPGMZA.settings.user_interface_style?WPGMZA.DirectionsBox:WPGMZA.ModernDirectionsBox)(map)},Object.defineProperty(WPGMZA.DirectionsBox.prototype,"style",{get:function(){return this.map.settings.directions_box_style}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"state",{set:function(value){switch($(".wpgmza-directions-box[data-map-id='"+this.map.id+"']").show(),value){case WPGMZA.DirectionsBox.STATE_INPUT:$("#wpgmaps_directions_editbox_"+this.map.id).show("slow"),$("#wpgmaps_directions_notification_"+this.map.id).hide("slow"),$(this.element).find("input.wpgmza-get-directions").show(),$(this.element).find("a.wpgmza-reset-directions").hide(),$(this.element).find("a.wpgmza-print-directions").hide();break;case WPGMZA.DirectionsBox.STATE_DISPLAY:$("#wpgmaps_directions_editbox_"+this.map.id).hide("slow"),$("#wpgmaps_directions_notification_"+this.map.id).show("slow"),$(this.element).find("input.wpgmza-get-directions").hide(),$(this.element).find("a.wpgmza-reset-directions").show(),$(this.element).find("a.wpgmza-print-directions").show();break;default:throw new Error("Unknown state")}}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"start",{get:function(){return this.from}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"end",{get:function(){return this.to}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"from",{get:function(){return $("#wpgmza_input_from_"+this.map.id).val()},set:function(value){$("#wpgmza_input_from_"+this.map.id).val(value)}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"to",{get:function(){return $("#wpgmza_input_to_"+this.map.id).val()},set:function(value){$("#wpgmza_input_to_"+this.map.id).val(value)}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"avoidTolls",{get:function(){return $("#wpgmza_tolls_"+this.map.id).is(":checked")}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"avoidHighways",{get:function(){return $("#wpgmza_highways_"+this.map.id).is(":checked")}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"avoidFerries",{get:function(){return $("#wpgmza_ferries_"+this.map.id).is(":checked")}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"travelMode",{get:function(){return $("#wpgmza_dir_type_"+this.map.id).val()}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"travelModeShort",{get:function(){return this.travelMode.substr(0,1).toLowerCase()}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"openExternal",{get:function(){return"external"==this.map.settings.directions_behaviour||"intelligent"==this.map.settings.directions_behaviour&&WPGMZA.isTouchDevice()}}),Object.defineProperty(WPGMZA.DirectionsBox.prototype,"isUsingAppleMaps",{get:function(){return navigator.platform.match(/iPhone|iPod|iPad/)&&!this.map.settings.force_google_directions_app}}),WPGMZA.DirectionsBox.prototype.getAjaxParameters=function(){var request={origin:this.from,destination:this.to,provideRouteAlternatives:!0,avoidHighways:this.avoidHighways,avoidTolls:this.avoidTolls,avoidFerries:this.avoidFerries,travelMode:this.travelMode,unitSystem:this.map.settings.store_locator_distance},addresses=this.getWaypointAddresses(),waypoints=[];if(addresses.length){for(var i in addresses){var location=addresses[i];waypoints[i]={location:location,stopover:!1}}request.waypoints=waypoints}return request},WPGMZA.DirectionsBox.prototype.getWaypointAddresses=function(){$("#wpgmza_input_waypoints_"+this.map.id).val();var elements=$("#wpgmaps_directions_edit_"+this.map.id+" input.wpgmaps_via"),values=[];return elements.length&&elements.each(function(index,el){values.push($(el).val())}),values},WPGMZA.DirectionsBox.prototype.getExternalURLParameters=function(options){var waypoints;if("apple"==(options=options||{}).scheme?(params={saddr:this.from,daddr:this.to},options.marker&&(params.daddr=options.marker.address)):(params={api:1,origin:this.from,destination:this.to,travelmode:this.travelMode},(waypoints=this.getWaypointAddresses()).length&&(params.waypoints=waypoints.join("|")),options.marker&&(params.destination=options.marker.address)),"string"!=options.format)return params;var name,components=[];for(name in params)components.push(name+"="+encodeURIComponent(params[name]));return"?"+components.join("&")},WPGMZA.DirectionsBox.prototype.getExternalURL=function(options){return options=options||{},options=$.extend(options,{format:"string"}),this.isUsingAppleMaps?(options.scheme="apple","https://maps.apple.com/maps"+this.getExternalURLParameters(options)):"https://www.google.com/maps/dir/"+this.getExternalURLParameters(options)},WPGMZA.DirectionsBox.prototype.route=function(){var params,self=this;""!=this.from||""!=this.to?(params=this.getAjaxParameters(),"legacy"==WPGMZA.settings.user_interface_style&&"modern"==self.map.settings.directions_box_style||WPGMZA.settings.user_interface_style,this.state=WPGMZA.DirectionsBox.STATE_DISPLAY,this.map.modernDirectionsBox&&this.map.modernDirectionsBox.open(),this.service.route(params,function(response,status){switch(status){case WPGMZA.DirectionsService.SUCCESS:$("#wpgmaps_directions_notification_"+self.map.id).html(""),$("#directions_panel_"+self.map.id).show(),self.renderer.setDirections(response);break;case WPGMZA.DirectionsService.ZERO_RESULTS:self.state=WPGMZA.DirectionsBox.STATE_INPUT,$("#wpgmaps_directions_notification_"+self.map.id).html(WPGMZA.localized_strings.zero_results),self.reset();break;case WPGMZA.DirectionsService.NOT_FOUND:if(self.state=WPGMZA.DirectionsBox.STATE_INPUT,$("#wpgmaps_directions_notification_"+self.map.id).html(WPGMZA.localized_strings.zero_results),self.reset(),response.geocoded_waypoints&&response.geocoded_waypoints.length)for(var i=0;i<response.geocoded_waypoints.length;i++)(status=response.geocoded_waypoints[i].geocoder_status)==WPGMZA.DirectionsService.NOT_FOUND&&(0==i?$(self.element).find(".wpgmza-directions-from"):i==response.geocoded_waypoints.length-1?$(self.element).find(".wpgmza-directions-to"):$($(self.element).find("div.wpgmza-waypoint-via")[i-1])).addClass("wpgmza-not-found");break;default:alert(WPGMZA.localized_strings.unknown_directions_service_status),this.state=WPGMZA.DirectionsBox.STATE_INPUT}})):alert(WPGMZA.localized_strings.please_fill_out_both_from_and_to_fields)},WPGMZA.DirectionsBox.prototype.reset=function(){$("#wpgmaps_directions_editbox_"+this.map.id).show(),$("#directions_panel_"+this.map.id).hide(),$("#directions_panel_"+this.map.id).html(""),$("#wpgmaps_directions_notification_"+this.map.id).hide(),$("#wpgmaps_directions_reset_"+this.map.id).hide(),$("#wpgmaps_directions_notification_"+this.map.id).html(WPGMZA.localized_strings.fetching_directions),$(".wpgmza-not-found").removeClass("wpgmza-not-found"),this.state=WPGMZA.DirectionsBox.STATE_INPUT,this.renderer.clear()},WPGMZA.DirectionsBox.prototype.showOptions=function(show){show||0==arguments.length?(this.optionsElement.show(),this.showOptionsElement.hide(),this.hideOptionsElement.show()):(this.optionsElement.hide(),this.showOptionsElement.show(),this.hideOptionsElement.hide())},WPGMZA.DirectionsBox.prototype.hideOptions=function(){this.showOptions(!1)},WPGMZA.DirectionsBox.prototype.addWaypoint=function(address){var row=this.waypointTemplateItem.clone();return $(this.element).find("div.wpgmza-directions-to").before(row),address&&$(row).find("input").val(address),WPGMZA.AddressInput.createInstance($(row).find("input")[0],this.map),row},WPGMZA.DirectionsBox.prototype.onAddWaypoint=function(){this.addWaypoint().find("input").focus()},WPGMZA.DirectionsBox.prototype.onShowOptions=function(event){$(this.element).find(".wpgmza-directions-options").show(),$(this.element).find(".wpgmza-hide-directions-options").show(),$(this.element).find(".wpgmza-show-directions-options").hide()},WPGMZA.DirectionsBox.prototype.onHideOptions=function(event){$(this.element).find(".wpgmza-directions-options").hide(),$(this.element).find(".wpgmza-hide-directions-options").hide(),$(this.element).find(".wpgmza-show-directions-options").show()},WPGMZA.DirectionsBox.prototype.onRemoveWaypoint=function(){$(event.target).closest(".wpgmza-form-field").remove()},WPGMZA.DirectionsBox.prototype.onGetDirections=function(event){this.openExternal?window.open(this.getExternalURL(),"_blank"):this.route()},WPGMZA.DirectionsBox.prototype.onPrintDirections=function(event){try{var routeHtml=document.getElementById("directions_panel_"+this.map.id).innerHTML,printWindow=window.open("","","height=600,width=800");printWindow.document.write("<html><head><title>Get Directions</title>"),printWindow.document.write("</head><body >"),printWindow.document.write(routeHtml),printWindow.document.write("</body></html>"),printWindow.document.close(),printWindow.print()}catch(ex){var url=this.getExternalURL()+"&om=1";window.open(url,"_blank")}},WPGMZA.DirectionsBox.prototype.onResetDirections=function(event){this.reset()},$(document.body).on("click",".wpgmza_gd, .wpgmza-directions-button",function(arbLatLng){var marker,address,coords,map,element=$(arbLatLng.currentTarget).closest("[data-wpgmza-marker-listing]");element.length||(element=$(arbLatLng.currentTarget).closest(".wpgmza_modern_infowindow, [data-map-id]")),element[0].wpgmzaMarkerListing||element[0].wpgmzaInfoWindow||element[0].wpgmzaMap||(element=$(arbLatLng.currentTarget).closest(".wpgmza_map[data-map-id]")),element.length&&(element.length&&((element=element[0]).wpgmzaMarkerListing?marker=(map=element.wpgmzaMarkerListing.map).getMarkerByID($(arbLatLng.currentTarget).closest("[data-marker-id]").attr("data-marker-id")):element.wpgmzaInfoWindow?map=(marker=element.wpgmzaInfoWindow.mapObject).map:marker=element.wpgmzaMap?(map=element.wpgmzaMap,element.wpgmzaMap.getMarkerByID($(arbLatLng.currentTarget).attr("data-marker-id"))):(map=element.wpgmzaMap).getMarkerByID($(arbLatLng.currentTarget).closest("[data-marker-id]").attr("data-marker-id"))),marker?(address=marker.address,coords=marker.getPosition().toString()):(arbLatLng=$(arbLatLng.currentTarget).data("latlng"))&&(marker={address:coords=arbLatLng}),map.directionsBox.openExternal?window.open(map.directionsBox.getExternalURL({marker:marker})):(map.directionsBox.state=WPGMZA.DirectionsBox.STATE_INPUT,map.directionsBox.to=address&&address.length?address:coords,$("#wpgmza_input_from_"+map.id).focus().select(),map.directionsBox instanceof WPGMZA.ModernDirectionsBox?map.directionsBox.open():WPGMZA.animateScroll(map.directionsBox.element)))})}),jQuery(function($){WPGMZA.DirectionsRenderer=function(map){WPGMZA.EventDispatcher.apply(this,arguments),this.map=map},WPGMZA.extend(WPGMZA.DirectionsRenderer,WPGMZA.EventDispatcher),WPGMZA.DirectionsRenderer.createInstance=function(map){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.CloudAPI.isBeingUsed?WPGMZA.CloudDirectionsRenderer:WPGMZA.GoogleDirectionsRenderer:WPGMZA.OLDirectionsRenderer)(map)},WPGMZA.DirectionsRenderer.prototype.getPolylineOptions=function(){var settings={strokeColor:"#4285F4",strokeWeight:4,strokeOpacity:.8};return this.map.settings.directions_route_stroke_color&&(settings.strokeColor=this.map.settings.directions_route_stroke_color),this.map.settings.directions_route_stroke_weight&&(settings.strokeWeight=parseInt(this.map.settings.directions_route_stroke_weight)),this.map.settings.directions_route_stroke_opacity&&(settings.strokeOpacity=parseFloat(this.map.settings.directions_route_stroke_opacity)),settings},WPGMZA.DirectionsRenderer.prototype.removeMarkers=function(){this.directionStartMarker&&this.map.removeMarker(this.directionStartMarker),this.directionEndMarker&&this.map.removeMarker(this.directionEndMarker)},WPGMZA.DirectionsRenderer.prototype.addMarkers=function(points){this.directionStartMarker=WPGMZA.Marker.createInstance({position:points[0],icon:this.map.settings.directions_route_origin_icon,retina:this.map.settings.directions_origin_retina,disableInfoWindow:!0}),this.directionStartMarker._icon.retina=this.directionStartMarker.retina,this.map.addMarker(this.directionStartMarker),this.directionEndMarker=WPGMZA.Marker.createInstance({position:points[points.length-1],icon:this.map.settings.directions_route_destination_icon,retina:this.map.settings.directions_destination_retina,disableInfoWindow:!0}),this.directionEndMarker._icon.retina=this.directionEndMarker.retina,this.map.addMarker(this.directionEndMarker)},WPGMZA.DirectionsRenderer.prototype.setDirections=function(directions){},WPGMZA.DirectionsRenderer.prototype.fitBoundsToRoute=function(pointA,pointB){var bounds=new WPGMZA.LatLngBounds;bounds.extend(pointA),bounds.extend(pointB),this.map.fitBounds(bounds)}}),jQuery(function($){WPGMZA.DirectionsService=function(map){WPGMZA.EventDispatcher.apply(this,arguments),this.map=map},WPGMZA.extend(WPGMZA.DirectionsService,WPGMZA.EventDispatcher),WPGMZA.DirectionsService.ZERO_RESULTS="zero-results",WPGMZA.DirectionsService.NOT_FOUND="not-found",WPGMZA.DirectionsService.SUCCESS="success",WPGMZA.DirectionsService.DRIVING="driving",WPGMZA.DirectionsService.WALKING="walking",WPGMZA.DirectionsService.TRANSIT="transit",WPGMZA.DirectionsService.BICYCLING="bicycling",WPGMZA.DirectionsService.createInstance=function(map){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleDirectionsService:WPGMZA.OLDirectionsService)(map)},WPGMZA.DirectionsService.route=function(params,callback){}}),jQuery(function($){WPGMZA.Heatmap=function(options){WPGMZA.assertInstanceOf(this,"EventDispatcher"),options=options||{},this.name="",this.radius=20,this.opacity=.5;options.gradient&&"default"!=options.gradient&&("string"==typeof options.gradient?options.gradient=JSON.parse(options.gradient):"array"!=typeof options.gradient&&console.warn("Ignoring invalid gradient")),"default"==options.gradient&&delete options.gradient,WPGMZA.Feature.apply(this,arguments)},WPGMZA.Heatmap.prototype=Object.create(WPGMZA.Feature.prototype),WPGMZA.Heatmap.prototype.constructor=WPGMZA.Heatmap,WPGMZA.Heatmap.getConstructor=function(){return"open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleHeatmap:WPGMZA.OLHeatmap},WPGMZA.Heatmap.createInstance=function(row){return new(WPGMZA.Heatmap.getConstructor())(row)},WPGMZA.Heatmap.createEditableMarker=function(options){var options=$.extend({draggable:!0},options),marker=WPGMZA.Marker.createInstance(options),callback=function(){marker.setIcon(WPGMZA.heatmapIcon),marker.off("added",callback)};return marker.on("added",callback),options.heatmap&&options.heatmap.markers.push(marker),marker},WPGMZA.Heatmap.prototype.setEditable=function(editable){var map,self=this;this.markers&&(this.markers.forEach(function(marker){marker.map.removeMarker(marker)}),delete this.markers),this._prevMap&&delete this._prevMap,editable&&(this.markers=[],this.dataset.forEach(function(marker){marker={lat:marker.lat,lng:marker.lng,heatmap:self},marker=WPGMZA.Heatmap.createEditableMarker(marker);self.map.addMarker(marker)}),this._clickCallback=function(event){self.onClick(event)},this._dragEndCallback=function(event){self.onDragEnd(event)},this._mouseDownCallback=function(event){self.onMapMouseDown(event)},this._mouseMoveCallback=function(event){self.onMapMouseMove(event)},this._mouseUpCallback=function(event){self.onWindowMouseUp(event)},(map=this.map).on("click",this._clickCallback),map.on("dragend",this._dragEndCallback),$(map.element).on("mousedown",this._mouseDownCallback),$(map.element).on("mousemove",this._mouseMoveCallback),$(window).on("mouseup",function(event){self.onWindowMouseUp(event)}),map.on("heatmapremoved",function(event){event.heatmap===self&&(map.off("click",self._clickCallback),map.off("dragend",self._dragEndCallback),$(map.element).off("mousedown",self._mouseDownCallback),$(map.element).off("mousemove",self._mouseMoveCallback),$(window).off("mouseup",this._mouseUpCallback))}))},WPGMZA.Heatmap.prototype.updateDatasetFromMarkers=function(){var dataset=[];this.markers.forEach(function(marker){dataset.push(marker.getPosition())}),this.dataset=dataset},WPGMZA.Heatmap.prototype.onClick=function(marker){if(marker.target instanceof WPGMZA.Marker&&marker.target.heatmap===this){var index=this.markers.indexOf(marker.target);return this.markers.splice(index,1),this.map.removeMarker(marker.target),this.updateDatasetFromMarkers(),void this.trigger("change")}marker.target instanceof WPGMZA.Map&&(marker={lat:marker.latLng.lat,lng:marker.latLng.lng,heatmap:this},marker=WPGMZA.Heatmap.createEditableMarker(marker),this.map.addMarker(marker),this.updateDatasetFromMarkers(),this.trigger("change"))},WPGMZA.Heatmap.prototype.onDragEnd=function(event){event.target instanceof WPGMZA.Marker&&this.markers&&-1!=this.markers.indexOf(event.target)&&(this.updateDatasetFromMarkers(),this.trigger("change"))},WPGMZA.Heatmap.prototype.getGeometry=function(){return this.dataset},WPGMZA.Heatmap.prototype.onMapMouseDown=function(event){if(2==event.button)return this._rightMouseDown=!0,event.preventDefault(),!1},WPGMZA.Heatmap.prototype.onWindowMouseUp=function(event){2==event.button&&(this._rightMouseDown=!1)},WPGMZA.Heatmap.prototype.onMapMouseMove=function(marker){this._rightMouseDown&&(marker={x:marker.pageX-$(this.map.element).offset().left,y:marker.pageY-$(this.map.element).offset().top},marker={lat:(marker=this.map.pixelsToLatLng(marker)).lat,lng:marker.lng,heatmap:this},marker=WPGMZA.Heatmap.createEditableMarker(marker),this.map.addMarker(marker),this.updateDatasetFromMarkers(),this.trigger("change"))}}),jQuery(function($){WPGMZA.LegacyJSONConverter=function(){},WPGMZA.LegacyJSONConverter.prototype.convert=function(json){var key,markers=[];for(key in"string"==typeof json&&(json=JSON.parse(json)),json){var data={map_id:json.map_id,marker_id:json.marker_id,title:json.title,address:json.address,icon:json.icon,pic:json.pic,desc:json.desc,linkd:json.linkd,anim:json.anim,retina:json.retina,category:json.category,lat:json.lat,lng:json.lng,infoopen:json.infoopen};markers[data.marker_id]=data}return markers}}),jQuery(function($){WPGMZA.MarkerGalleryInput=function(input){var self=this,container=$(input).parent();container.append("<div class='wpgmza-gallery-input'><ul><li class='wpgmza-add-new-picture'><i class='fa fa-camera' aria-hidden='true'></i></li></ul></div>"),this.input=input,this.element=container.find(".wpgmza-gallery-input"),$(this.input).next("#upload_image_button").remove(),$(this.input).hide(),this.addNewPictureButton=$(this.element).find(".wpgmza-add-new-picture"),this.addNewPictureButton.on("click",function(event){self.onAddNewPictureClicked(event)}),this.templateItem=$(this.addNewPictureButton).clone(),this.templateItem.removeClass("wpgmza-add-new-picture"),this.templateItem.find("i").remove(),$(this.element).find("ul").sortable({items:"li:not(.wpgmza-add-new-picture)",stop:function(){self.onDragEnd()}}),$(document.body).on("click",".wpgmza-delete-gallery-item",function(event){self.onDeleteItem(event)})},WPGMZA.MarkerGalleryInput.prototype.populate=function(arr){if(this.clear(),arr&&arr.length)for(var i=0;i<arr.length;i++)this.addPicture(arr[i])},WPGMZA.MarkerGalleryInput.prototype.update=function(){var string=this.serialize();this.input.val(string),this.input.attr("value",string)},WPGMZA.MarkerGalleryInput.prototype.clear=function(){$(this.element).find("[data-picture-url]").remove()},WPGMZA.MarkerGalleryInput.prototype.addPicture=function(picture){var item=this.templateItem.clone(),url=picture.url;item.css({"background-image":"url('"+url+"')"}),item.attr("data-picture-url",url),item.attr("data-attachment-id",picture.attachment_id),item.insertBefore(this.addNewPictureButton),item.append($("<button type='button' class='wpgmza-delete-gallery-item'>✖</button>")),this.update()},WPGMZA.MarkerGalleryInput.prototype.serialize=function(){return JSON.stringify(this.toJSON())},WPGMZA.MarkerGalleryInput.prototype.toJSON=function(){var gallery=[];return $(this.element).find("[data-picture-url]").each(function(index,el){gallery.push({attachment_id:$(el).attr("data-attachment-id"),url:$(el).attr("data-picture-url")})}),gallery},WPGMZA.MarkerGalleryInput.prototype.onDragEnd=function(){this.update()},WPGMZA.MarkerGalleryInput.prototype.onAttachmentPicked=function(attachment_id,attachment_url){this.addPicture({attachment_id:attachment_id,url:attachment_url})},WPGMZA.MarkerGalleryInput.prototype.onAddNewPictureClicked=function(event){var self=this;WPGMZA.openMediaDialog(function(attachment_id,attachment_url){self.onAttachmentPicked(attachment_id,attachment_url)})},WPGMZA.MarkerGalleryInput.prototype.onDeleteItem=function(event){$(event.target).closest("[data-picture-url]").remove()}}),jQuery(function($){WPGMZA.MarkerGallery=function(width,context){var self=this,guid=WPGMZA.guid();if(this.element=$("<div class='wpgmza-empty-gallery'/>"),(this.marker=width).gallery){if(width.gallery.length<2){var first=width.gallery[0];if(0==width.gallery.length)return;var img=first.thumbnail||first.url,img=context.getImageElementFromURL(img);return WPGMZA.settings.disable_lightbox_images||this.marker.map.settings.disable_lightbox_images||(img.attr("data-featherlight",first.url),context instanceof WPGMZA.ProInfoWindow&&(img.attr("id",guid),context.on("domready",function(event){$("#"+guid).on("click",function(event){self.onFeatherLightClick(event)})}))),void(this.element=img)}this.element=$("<div class='wpgmza-marker-gallery'><div id='"+guid+"' class='owl-carousel'></div></div>"),this.carouselElement=this.element.find(".owl-carousel"),width.gallery.forEach(function(item){self.addPicture(item,context)}),context instanceof WPGMZA.ProInfoWindow?(width=(width=context.imageWidth)||200,this.element.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),this.carouselElement.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),context.on("domready",function(event){$("#"+guid).owlCarousel(self.getOwlCarouselOptions()),$("#"+guid).on("click","[data-featherlight]",function(event){self.onFeatherLightClick(event)})})):context instanceof WPGMZA.CarouselMarkerListing?setTimeout(function(){var width=$(context.element).find(".owl-item").innerWidth()-40;self.element.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),self.carouselElement.css({width:width+"px","max-width":width+"px",overflow:"hidden"}),$(self.carouselElement).owlCarousel(self.getOwlCarouselOptions())},1e3):setTimeout(function(){$(self.carouselElement).owlCarousel(self.getOwlCarouselOptions())},100)}},WPGMZA.MarkerGallery.prototype.getOwlCarouselOptions=function(){return{navigation:!0,pagination:!1,dots:!1,slideSpeed:3e3,paginationSpeed:400,singleItem:!0,loop:!0,items:1,autoplay:!0,autoplayTimeout:4e3}},WPGMZA.MarkerGallery.prototype.addPicture=function(item,context){var img,container=$("<div/>");item.thumbnail||(item.thumbnail=item.url),context instanceof WPGMZA.ProInfoWindow?img=context.getImageElementFromURL(item.thumbnail):(img=$("<img/>")).attr("src",item.thumbnail),img.css({float:"none"}),WPGMZA.settings.disable_lightbox_images||this.marker.map.settings.disable_lightbox_images||img.attr("data-featherlight",item.url),container.append(img),$(this.carouselElement).append(container)},WPGMZA.MarkerGallery.prototype.onFeatherLightClick=function(event){var self=this;WPGMZA.isFullScreen()&&setTimeout(function(){$($(self.marker.map.element).find(".gm-style")[0]).append($(".featherlight"))},250)},$(document).on("fullscreenchange",function(){$(".featherlight").remove()})}),jQuery(function($){WPGMZA.MarkerIconPicker=function(name){var self=this;if(!name)throw new Error("Element cannot be undefined");if(!(name instanceof HTMLElement||name instanceof jQuery&&1==name.length))throw new Error("Invalid element");this.element=name;var input=$(this.element).find("input.wpgmza-marker-icon-url"),name=$(input).attr("name")||$(input).attr("data-ajax-name");if(input.length){if(!name)throw new Error("Input must have a name for marker library to function");$(this.element).find("button.wpgmza-marker-library").attr("data-target-name",name);WPGMZA.MarkerIcon.createInstance(input.val())}$(this.element).find("button.wpgmza-upload").on("click",function(event){self.onUploadImage(event)}),$(this.element).find("button.wpgmza-reset").on("click",function(event){self.onReset(event)})},WPGMZA.MarkerIconPicker.prototype.setIcon=function(preview){var url=WPGMZA.MarkerIcon.createInstance(preview).url,preview=url;url!=WPGMZA.defaultMarkerIcon?$(this.element).find("input.wpgmza-marker-icon-url").val(url):$(this.element).find("input.wpgmza-marker-icon-url").val(""),0==url.length&&(preview=WPGMZA.defaultMarkerIcon),$(this.element).find(".wpgmza-marker-icon-preview").css({"background-image":"url('"+preview+"')"})},WPGMZA.MarkerIconPicker.prototype.onUploadImage=function(){var self=this;WPGMZA.openMediaDialog(function(attachment_id,attachment_url){self.setIcon(attachment_url),$(this.element).find("input.wpgmza-marker-icon-url").val("")})},WPGMZA.MarkerIconPicker.prototype.onReset=function(){this.reset()},WPGMZA.MarkerIconPicker.prototype.reset=function(){this.setIcon(WPGMZA.defaultMarkerIcon)}}),jQuery(function($){WPGMZA.MarkerIcon=function(options){var self=this;if(WPGMZA.EventDispatcher.apply(this,arguments),this.isLoaded=!1,this.url="",this.retina=!1,"object"==typeof options)for(var key in options)this[key]=options[key];else if("string"==typeof options)try{var json=JSON.parse(options);for(key in json)this[key]=json[key]}catch(e){this.url=options}else if(options)throw new Error("Argument must be an object");this.url=this.url.replace(/^http(s?):/,""),this.dimensions={width:null,height:null};var url=this.isDefault?WPGMZA.defaultMarkerIcon:this.url;WPGMZA.getImageDimensions(url,function(dimensions){self.dimensions=dimensions,self.isLoaded=!0,self.trigger("load")})},WPGMZA.extend(WPGMZA.MarkerIcon,WPGMZA.EventDispatcher),WPGMZA.MarkerIcon.createInstance=function(options){return new WPGMZA.MarkerIcon(options)},Object.defineProperty(WPGMZA.MarkerIcon.prototype,"width",{get:function(){return this.retina?parseInt(WPGMZA.settings.retinaWidth):parseInt(this.dimensions.width)}}),Object.defineProperty(WPGMZA.MarkerIcon.prototype,"height",{get:function(){return this.retina?parseInt(WPGMZA.settings.retinaHeight):parseInt(this.dimensions.height)}}),Object.defineProperty(WPGMZA.MarkerIcon.prototype,"isDefault",{get:function(){return 0==this.url.length||this.url==WPGMZA.defaultMarkerIcon.replace(/^http(s?):/,"")}}),WPGMZA.MarkerIcon.prototype.applyToElement=function(element){this.isDefault?$(element).attr("src",WPGMZA.defaultMarkerIcon):$(element).attr("src",this.url),this.retina&&$(element).css({width:this.width+"px",height:this.height+"px"})}}),jQuery(function($){var currentCallback;window.WPGMZA||(window.WPGMZA={}),WPGMZA.MarkerLibraryDialog=function(element){var self=this;this.element=element,$(element).remodal(),window.addEventListener("message",function(event){"download_marker"==event.data.action&&$.ajax({url:ajaxurl,type:"POST",data:{action:"wpgmza_upload_base64_image",security:WPGMZA.legacyajaxnonce,data:event.data.data.replace(/^data:.+?base64,/,""),mimeType:"image/png"},success:function(url,status,xhr){url=url.url;currentCallback(url),$(self.element).remodal().close()}})},!1)},WPGMZA.MarkerLibraryDialog.prototype.open=function(callback){currentCallback=callback,$(this.element).remodal().open(),$("iframe#mappity").attr("src","https://www.mappity.org?wpgmza-embed=1")},WPGMZA.MarkerLibraryDialog.prototype.onSearch=function(){var string=this.searchInput.val().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),regexp=new RegExp(string,"i");$(this.element).find("img").each(function(index,filename){var li=$(filename).closest("li"),filename=$(filename).attr("title").replace(/\.png$/,"");string.length&&!filename.match(regexp)?$(li).addClass("wpgmza-marker-library-no-result"):$(li).removeClass("wpgmza-marker-library-no-result")})},WPGMZA.MarkerLibraryDialog.prototype.onIconSelected=function(event){currentCallback(event.target.src),$(this.element).remodal().close()},$(document).ready(function(event){var el=$(".wpgmza-marker-library-dialog");el.length&&($(el).css("display",""),WPGMZA.markerLibraryDialog=new WPGMZA.MarkerLibraryDialog(el),$("input.wpgmza-marker-library, button.wpgmza-marker-library").each(function(index,el){var button,target,preview;target=$(button=el).closest(".wpgmza-marker-icon-picker").find(".wpgmza-marker-icon-url"),preview=$(button).closest(".wpgmza-marker-icon-picker").find("img, .wpgmza-marker-icon-preview"),$(button).on("click",function(){WPGMZA.markerLibraryDialog.open(function(src){target.val(src),target.change(),preview.prop("tagName").match(/img/)?preview.attr("src",src):preview.css({"background-image":"url("+src+")"}),$(button).hasClass("wpgmza-marker-directions-library")||$("#wpgmza_cmm>img").attr("src",src)})})}))})}),jQuery(function($){WPGMZA.ModernDirectionsBox=function(map){WPGMZA.DirectionsBox.apply(this,arguments);var behaviour,self=this,original=this.element;original.length&&(behaviour=$(map.element),this.map=map,this.element=$("<div class='wpgmza-popout-panel wpgmza-modern-directions-box'></div>"),this.panel=new WPGMZA.PopoutPanel(this.element),this.element.append(original),behaviour.append(this.element),$(this.element).find("h2").after($("\t\t\t<div class='wpgmza-directions-buttons'>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-times' aria-hidden='true'></i></span>\t\t\t</div>\t\t")),$(this.element).find("td:first-child").remove(),behaviour=$(this.element).find("select[name^='wpgmza_dir_type']").closest("tr"),$(this.element).find(".wpgmaps_to_row").after(behaviour),$(this.element).find("#wpgmza_options_box_"+map.id).addClass("wpgmza-directions-options"),this.resultBox=new WPGMZA.ModernDirectionsResultBox(map,this),"intelligent"==(behaviour=map.settings.directions_behaviour)&&(behaviour=WPGMZA.isTouchDevice()?"external":"default"),"default"==behaviour&&$(this.element).find(".wpgmaps_get_directions").on("click",function(event){0!=self.from.length&&0!=self.to.length&&self.resultBox.open()}),$(this.element).find(".wpgmza-close").on("click",function(event){self.panel.close()}),$(this.element).on("click",".wpgmza-travel-mode-option",function(){var mode=jQuery(this).data("mode");jQuery("body").find(".wpgmza-travel-mode-option").removeClass("wpgmza-travel-option__selected"),jQuery(this).addClass("wpgmza-travel-option__selected"),jQuery("body").find(".wpgmza-travel-mode").val(mode)}))},WPGMZA.extend(WPGMZA.ModernDirectionsBox,WPGMZA.DirectionsBox),Object.defineProperty(WPGMZA.ModernDirectionsBox.prototype,"from",{get:function(){return $(this.element).find("input.wpgmza-directions-from").val()},set:function(value){return $(this.element).find("input.wpgmza-directions-from").val(value)}}),Object.defineProperty(WPGMZA.ModernDirectionsBox.prototype,"to",{get:function(){return $(this.element).find("input.wpgmza-directions-to").val()},set:function(value){return $(this.element).find("input.wpgmza-directions-to").val(value)}}),WPGMZA.ModernDirectionsBox.prototype.open=function(){this.panel.open(),this.resultBox&&this.resultBox.close(),$(this.element).children().show()},WPGMZA.ModernDirectionsBox.prototype.onNativeMapsApp=function(){var url=this.getExternalURL();window.open(url,"_blank")}}),jQuery(function($){WPGMZA.ModernDirectionsResultBox=function(map,directionsBox){WPGMZA.PopoutPanel.apply(this,arguments);var self=this,container=$(map.element);this.map=map,this.directionsBox=directionsBox,this.element=$("<div class='wpgmza-popout-panel wpgmza-modern-directions-box'>\t\t\t<h2 class='wpgmza-directions-box__title'>"+$(directionsBox.element).find("h2").html()+"</h2>\t\t\t<div class='wpgmza-directions-buttons'>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-arrow-left' aria-hidden='true'></i></span>\t\t\t\t<a class='wpgmza-print' style='display: none;'><i class='fa fa-print' aria-hidden='true'></i></a>\t\t\t</div>\t\t\t<div class='wpgmza-directions-results'>\t\t\t</div>\t\t</div>"),this.element.addClass("wpgmza-modern-directions-box__results");var nativeIcon=new WPGMZA.NativeMapsAppIcon;this.nativeMapAppIcon=nativeIcon,$(this.element).find(".wpgmza-directions-buttons").append(nativeIcon.element),$(nativeIcon.element).on("click",function(event){self.onNativeMapsApp(event)}),container.append(this.element),this.element.append($("#directions_panel_"+map.id)),$(this.element).find(".wpgmza-print").attr("href","data:text/html,<script>document.body.innerHTML += sessionStorage.wpgmzaPrintDirectionsHTML; window.print();<\/script>"),$(this.element).find(".wpgmza-close").on("click",function(event){self.close()}),$(this.element).find(".wpgmza-print").on("click",function(event){self.onPrint(event)}),this.map.on("directionsserviceresult",function(event){self.onDirectionsChanged(event,event.response,event.status)}),this.clear()},WPGMZA.ModernDirectionsResultBox.prototype=Object.create(WPGMZA.PopoutPanel.prototype),WPGMZA.ModernDirectionsResultBox.prototype.constructor=WPGMZA.ModernDirectionsResultBox,WPGMZA.ModernDirectionsResultBox.prototype.clear=function(){$(this.element).find(".wpgmza-directions-results").html(""),$(this.element).find("a.wpgmza-print").attr("href","")},WPGMZA.ModernDirectionsResultBox.prototype.open=function(){WPGMZA.PopoutPanel.prototype.open.apply(this,arguments),this.showPreloader()},WPGMZA.ModernDirectionsResultBox.prototype.showPreloader=function(){$(this.element).find(".wpgmza-directions-results").html("<img src='"+wpgmza_ajax_loader_gif.src+"'/>")},WPGMZA.ModernDirectionsResultBox.prototype.onDirectionsChanged=function(event,response,status){switch(this.clear(),status){case WPGMZA.DirectionsService.SUCCESS:break;case WPGMZA.DirectionsService.NOT_FOUND:case WPGMZA.DirectionsService.ZERO_RESULTS:var message=status.toLowerCase(),message=WPGMZA.localized_strings[message];$(this.element).find(".wpgmza-directions-results").html('<i class="fa fa-times" aria-hidden="true"></i>'+message);break;default:message=WPGMZA.localized_strings.unknown_error;$(this.element).find(".wpgmza-directions-results").html('<i class="fa fa-times" aria-hidden="true"></i>'+message)}},WPGMZA.ModernDirectionsResultBox.prototype.onNativeMapsApp=function(event){var url=this.directionsBox.getExternalURL();window.open(url,"_blank")},WPGMZA.ModernDirectionsResultBox.prototype.onPrint=function(event){var content=$(this.element).find(".wpgmza-directions-results").html();document.implementation.createHTMLDocument();sessionStorage.wpgmzaPrintDirectionsHTML=content}}),jQuery(function($){WPGMZA.ModernMarkerListingMarkerView=function(map){var self=this;this.map=map,this.map_id=map.id,WPGMZA.PopoutPanel.apply(this,arguments);var container=$("#wpgmza_map_"+map.id);this.element=$("<div class='wpgmza-popout-panel wpgmza-modern-marker-listing-marker-view'>\t\t\t<div class='wpgmza-close-container'>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-arrow-left' aria-hidden='true'></i></span>\t\t\t\t<span class='wpgmza-close'><i class='fa fa-times' aria-hidden='true'></i></span>\t\t\t</div>\t\t\t<div data-name='title'></div>\t\t\t<div data-name='address'></div>\t\t\t<div data-name='category'></div>\t\t\t<img data-name='pic'/>\t\t\t<div data-name='description'></div>\t\t\t<div class='wpgmza-modern-marker-listing-buttons'>\t\t\t\t<div class='wpgmza-modern-marker-listing-button wpgmza-link-button'>\t\t\t\t\t<i class='fa fa-link' aria-hidden='true'></i>\t\t\t\t\t<div>\t\t\t\t\t\t"+WPGMZA.localized_strings.link+"\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t\t<div class='wpgmza-modern-marker-listing-button wpgmza-directions-button'>\t\t\t\t\t<i class='fa fa-road' aria-hidden='true'></i>\t\t\t\t\t<div>\t\t\t\t\t\t"+WPGMZA.localized_strings.directions+"\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t\t<div class='wpgmza-modern-marker-listing-button wpgmza-zoom-button'>\t\t\t\t\t<i class='fa fa-search-plus' aria-hidden='true'></i>\t\t\t\t\t<div>\t\t\t\t\t\t"+WPGMZA.localized_strings.zoom+"\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t</div>\t\t</div>"),map.on("init",function(){container.append(self.element)}),map.on("click",function(event){event.target instanceof WPGMZA.Marker&&event.target!=self.map.userLocationMarker&&event.target!=self.map.storeLocatorMarker&&self.open(event.target.id)}),$(this.element).find(".wpgmza-close").on("click",function(event){self.close(),$("#wpgmza_map_"+self.map_id+" .wpgmza-modern-store-locator").removeClass("wpgmza_sl_mv_offset")}),$(this.element).find(".wpgmza-link-button").on("click",function(event){self.onLink(event)}),$(this.element).find(".wpgmza-directions-button").on("click",function(event){self.onDirections(event)}),$(this.element).find(".wpgmza-zoom-button").on("click",function(event){self.onZoom(event)}),$(container).append(this.element),container.children(".wpgmza-modern-directions-box").length&&$(this.element).after(container.children(".wpgmza-modern-directions-box"))},WPGMZA.ModernMarkerListingMarkerView.prototype=Object.create(WPGMZA.PopoutPanel.prototype),WPGMZA.ModernMarkerListingMarkerView.prototype.constructor=WPGMZA.ModernMarkerListingMarkerView,WPGMZA.ModernMarkerListingMarkerView.prototype.open=function(marker_id){var self=this,marker=this.map.getMarkerByID(marker_id);marker.disableInfoWindow||(WPGMZA.PopoutPanel.prototype.open.apply(this,arguments),this.marker=marker,$(this.element).find("[data-name]").each(function(index,el){var name=$(el).attr("data-name"),value=marker[name]||"";switch("category"===name&&0<marker.categories.length&&(value=marker.categories.join(",")),name){case"pic":$(el).attr("src",value),$(el).attr("alt",marker.title),marker.pic.length?$(el).show():$(el).hide();break;case"category":for(var ids=value.split(","),names=[],i=0;i<ids.length;i++){var id=ids[i];wpgmza_category_data[id]&&names.push(wpgmza_category_data[id].category_name)}$(el).html(names.join(", "));break;default:$(el).html(value)}}),marker.link&&0!=marker.link.length?$(this.element).find(".wpgmza-link-button").show():$(this.element).find(".wpgmza-link-button").hide(),$("#wpgmza_map_"+this.map_id+" .wpgmza-modern-store-locator").addClass("wpgmza_sl_mv_offset"),$(this.element).find("[data-custom-field-name]").remove(),$(this.element).find(".wpgmza-modern-marker-listing-buttons").before(marker.custom_fields_html),$(this.element).find(".wpgmza-directions-button").attr("data-marker-id",marker_id),$(this.element).find(".wpgmza-close").on("click",function(event){self.close()}))},WPGMZA.ModernMarkerListingMarkerView.prototype.onLink=function(event){window.open(this.marker.link,"_blank")},WPGMZA.ModernMarkerListingMarkerView.prototype.onDirections=function(event){this.map.directionsBox.to=this.marker.address,this.map.directionsBox.element.show()},WPGMZA.ModernMarkerListingMarkerView.prototype.onZoom=function(event){this.map.setCenter(this.marker.getPosition()),this.map.setZoom(14)}}),jQuery(function($){WPGMZA.ProAddressInput=function(element,map){WPGMZA.AddressInput.apply(this,arguments),this.useMyLocationButton=new WPGMZA.UseMyLocationButton(element),$(this.element).after(this.useMyLocationButton.element)},WPGMZA.extend(WPGMZA.ProAddressInput,WPGMZA.AddressInput),WPGMZA.AddressInput.createInstance=function(element,map){return new WPGMZA.ProAddressInput(element,map)}}),jQuery(function($){var Parent="open-layers"==WPGMZA.settings.engine?WPGMZA.OLDrawingManager:WPGMZA.GoogleDrawingManager;WPGMZA.ProDrawingManager=function(map){var self=this;Parent.apply(this,arguments),this.map.on("click rightclick",function(event){self.onMapClick(event)})},WPGMZA.extend(WPGMZA.ProDrawingManager,Parent),WPGMZA.DrawingManager.getConstructor=function(){return"google-maps"!==WPGMZA.settings.engine?WPGMZA.OLProDrawingManager:WPGMZA.GoogleProDrawingManager},WPGMZA.ProDrawingManager.prototype.setDrawingMode=function(mode){var self=this;if(mode!=WPGMZA.DrawingManager.MODE_HEATMAP)return this.heatmap&&(this.heatmap.markers.forEach(function(marker){self.map.removeMarker(marker)}),this.map.removeHeatmap(this.heatmap),delete this.heatmap),void Parent.prototype.setDrawingMode.apply(this,arguments);Parent.prototype.setDrawingMode.apply(this,arguments)},WPGMZA.ProDrawingManager.prototype.getHeatmapParameters=function(){var params={};$(".wpgmza-feature-panel[data-wpgmza-feature-type='heatmap'] [data-ajax-name]").each(function(index,el){var value;"gradient"!=$(el).attr("data-ajax-name")&&(value="number"===$(el).attr("type")?parseFloat($(el).val()):$(el).val(),params[$(el).attr("data-ajax-name")]=value)});var str=$(".wpgmza-feature-panel[data-wpgmza-feature-type='heatmap'] [data-ajax-name='gradient']:checked").val();return"default"!=str&&(params.gradient=JSON.parse(str)),params},WPGMZA.ProDrawingManager.prototype.onMapClick=function(event){var self=this;if(this.mode==WPGMZA.DrawingManager.MODE_HEATMAP&&event.target instanceof WPGMZA.Map)return this.heatmap||(this.heatmap=WPGMZA.Heatmap.createInstance({dataset:[]}),this.map.addHeatmap(this.heatmap),this.heatmap.setEditable(!0),this.heatmap.on("change",function(event){self.onHeatmapGeometryChanged(event)})),2==event.button?(event.preventDefault(),!1):void 0},WPGMZA.ProDrawingManager.prototype.updateHeatmapGeometryField=function(){var arr=[];this.heatmap.markers.forEach(function(position){position=position.getPosition().toLatLngLiteral();arr.push(position)}),$("[data-wpgmza-feature-type='heatmap']").find("[data-ajax-name='dataset']").val(JSON.stringify(arr))},WPGMZA.ProDrawingManager.prototype.updateHeatmap=function(){var key,params=this.getHeatmapParameters();for(key in params)this.heatmap[key]=params[key];this.heatmap.update()},WPGMZA.ProDrawingManager.prototype.onHeatmapPropertyChanged=function(event){"dataset_name"!=$(event.target).attr("data-ajax-name")&&this.updateHeatmap()},WPGMZA.ProDrawingManager.prototype.onHeatmapGeometryChanged=function(event){this.updateHeatmapGeometryField()}}),jQuery(function($){WPGMZA.ProInfoWindow=function(feature){var self=this;WPGMZA.InfoWindow.call(this,feature),this.on("infowindowopen",function(event){self.updateDistanceFromLocation(),self.showDistanceAwayFromStoreLocatorCenter()})},WPGMZA.ProInfoWindow.prototype=Object.create(WPGMZA.InfoWindow.prototype),WPGMZA.ProInfoWindow.prototype.constructor=WPGMZA.ProInfoWindow,WPGMZA.ProInfoWindow.STYLE_INHERIT="-1",WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE="0",WPGMZA.ProInfoWindow.STYLE_MODERN="1",WPGMZA.ProInfoWindow.STYLE_MODERN_PLUS="2",WPGMZA.ProInfoWindow.STYLE_MODERN_CIRCULAR="3",WPGMZA.ProInfoWindow.STYLE_TEMPLATE="template",WPGMZA.ProInfoWindow.OPEN_BY_CLICK=1,WPGMZA.ProInfoWindow.OPEN_BY_HOVER=2,Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"maxWidth",{get:function(){var width=WPGMZA.settings.wpgmza_settings_infowindow_width;return!(!width||!/^\d+$/.test(width))&&width}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"imageWidth",{get:function(){var width=WPGMZA.settings.wpgmza_settings_image_width;return!(!width||!/^\d+$/.test(width))&&width}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"imageHeight",{get:function(){var height=WPGMZA.settings.wpgmza_settings_image_height;return!(!height||!/^\d+$/.test(height))&&height}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"enableImageResizing",{get:function(){return 1==WPGMZA.settings.wpgmza_settings_image_resizing}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"linkTarget",{get:function(){return 1==WPGMZA.settings.infoWindowLinks?"_BLANK":""}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"linkText",{get:function(){return WPGMZA.localized_strings.more_info}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"directionsText",{get:function(){return WPGMZA.localized_strings.get_directions}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"distanceUnits",{get:function(){return 1==this.feature.map.settings.store_locator_distance?WPGMZA.Distance.MILES:WPGMZA.Distance.KILOMETERS}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"showAddress",{get:function(){return 1!=WPGMZA.settings.infoWindowAddress||"map-edit"==WPGMZA.currentPage}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"style",{get:function(){return this.map&&this.map.userLocationMarker==this?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:this.getSelectedStyle()}}),Object.defineProperty(WPGMZA.ProInfoWindow.prototype,"isPanIntoViewAllowed",{get:function(){return this.style==WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE}}),WPGMZA.ProInfoWindow.prototype.getSelectedStyle=function(){var globalTypeSetting=WPGMZA.settings.wpgmza_iw_type,localTypeSetting=this.feature.map.settings.wpgmza_iw_type,type=localTypeSetting;return(localTypeSetting!=WPGMZA.ProInfoWindow.STYLE_INHERIT&&void 0!==localTypeSetting||(type=globalTypeSetting)!=WPGMZA.ProInfoWindow.STYLE_INHERIT)&&type?String(type):WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE},WPGMZA.ProInfoWindow.prototype.getImageElementFromURL=function(url){var img=$("<img/>");return img.addClass("wpgmza_infowindow_image"),img.attr("src",url),img.css({float:"right"}),this.maxWidth&&img.css({"max-width":this.maxWidth}),this.enableImageResizing&&this.imageWidth&&(img.css({width:this.imageWidth}),img.css({height:this.imageHeight})),this.enableImageResizing||img.css({margin:"5px"}),img},WPGMZA.ProInfoWindow.prototype.showDistanceAwayFromStoreLocatorCenter=function(){var distance;this.feature instanceof WPGMZA.Marker&&this.feature.map.settings.store_locator_show_distance&&this.feature.map.storeLocator&&this.feature.map.storeLocator.state==WPGMZA.StoreLocator.STATE_APPLIED&&(this.feature.map.settings.show_distance_from_location||(distance=this.feature.getPosition(),distance=this.workOutDistanceBetweenTwoMarkers(this.feature.map.storeLocator.center,distance),$(this.element).append("<p>"+(this.feature.map.settings.store_locator_distance==WPGMZA.Distance.KILOMETERS?distance+WPGMZA.localized_strings.kilometers_away:distance+" "+WPGMZA.localized_strings.miles_away)+"</p>")))},WPGMZA.ProInfoWindow.prototype.updateDistanceFromLocation=function(){var source,text=this.feature;text instanceof WPGMZA.Marker?(source=text.map.showDistanceFromLocation)&&(text=WPGMZA.Distance.between(source,text.getPosition()),this.distanceUnits==WPGMZA.Distance.MILES&&(text/=WPGMZA.Distance.KILOMETERS_PER_MILE),text=Math.round(text,2),source=source.source==WPGMZA.ProMap.SHOW_DISTANCE_FROM_USER_LOCATION?WPGMZA.localized_strings.from_your_location:WPGMZA.localized_strings.from_searched_location,$(this.element).find(".wpgmza-distance-from-location .wpgmza-amount").text(text),$(this.element).find(".wpgmza-distance-from-location .wpgmza-source").text(source)):console.warn("This function is only intended for use with markers and should not have been called in this manner")},WPGMZA.ProInfoWindow.prototype.legacyCreateDefaultInfoWindow=function(map){var marker=this.feature,map=marker.map;function empty(field){return!(field&&field.length&&0<field.length)}var description,div,link,p,a,container=$("<div class='wpgmza_markerbox scrollFix'></div>");this.maxWidth&&container.css({"max-width":this.maxWidth}),empty(marker.gallery)?empty(marker.pic)||(description=this.getImageElementFromURL(marker.pic),container.append(description)):(div=new WPGMZA.MarkerGallery(marker,this),container.append(div.element)),empty(marker.title)||((p=$("<p class='wpgmza_infowindow_title'></p>")).html(marker.title),container.append(p)),!empty(marker.address)&&this.showAddress&&((p=$("<p class='wpgmza_infowindow_address'></p>")).html(marker.address),container.append(p)),empty(marker.desc)&&empty(marker.description)||(description=empty(marker.desc)?marker.description:marker.desc,(div=$("<div class='wpgmza_infowindow_description'></div>")).html(description),container.append(div)),1==map.settings.show_distance_from_location&&(p=$("<p class='wpgmza-distance-from-location'><span class='wpgmza-amount'></span> <span class='wpgmza-units'></span> <span class='wpgmza-source'></span></p>"),link=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.localized_strings.miles_away:WPGMZA.localized_strings.kilometers_away,p.find(".wpgmza-units").text(link),container.append(p)),empty(marker.linkd)&&empty(marker.link)||(link=empty(marker.link)?marker.linkd:marker.link,p=$("<p class='wpgmza_infowindow_link'></p>"),(a=$("<a class='wpgmza_infowindow_link'></a>")).attr("href",WPGMZA.decodeEntities(link)),a.attr("target",this.linkTarget),a.text(this.linkText),p.append(a),container.append(p)),map.directionsEnabled&&1!==parseInt(WPGMZA.is_admin)&&marker.getPosition&&(p=$("<p></p>"),(a=$("<a class='wpgmza_gd'></a>")).attr("href","javascript: ;"),a.attr("id",map.id),a.attr("data-address",marker.address),a.attr("data-latlng",marker.getPosition().toString()),a.attr("data-marker-id",marker.id),a.attr("wpgm_addr_field",marker.address),a.attr("gps",marker.lat+","+marker.lng),a.text(this.directionsText),p.append(a),container.append(p)),marker.custom_fields_html&&container.append(marker.custom_fields_html),container.append(this.addEditButton()),this.setContent(container.html())},WPGMZA.ProInfoWindow.prototype.legacyCreateModernInfoWindow=function(container){var units,ratingContainer,t,legend,mapid=container.id;0==$("#wpgmza_iw_holder_"+container.id).length&&($(document.body).append("<div id='wpgmza_iw_holder_"+container.id+"'></div>"),null!==(legend=document.getElementById("wpgmza_iw_holder_"+mapid))&&$(legend).remove(),window.wpgmza_iw_Div||(window.wpgmza_iw_Div=[]),wpgmza_iw_Div[mapid]=document.createElement("div"),wpgmza_iw_Div[mapid].id="wpgmza_iw_holder_"+mapid,wpgmza_iw_Div[mapid].style="display:block;",document.getElementsByTagName("body")[0].appendChild(wpgmza_iw_Div[mapid]),wpgmza_iw_Div_inner=document.createElement("div"),wpgmza_iw_Div_inner.className="wpgmza_modern_infowindow_inner wpgmza_modern_infowindow_inner_"+mapid,wpgmza_iw_Div[mapid].appendChild(wpgmza_iw_Div_inner),wpgmza_iw_Div_close=document.createElement("div"),wpgmza_iw_Div_close.className="wpgmza_modern_infowindow_close",wpgmza_iw_Div_close.setAttribute("mid",mapid),$(wpgmza_iw_Div_close).on("click",function(event){$(wpgmza_iw_Div[mapid]).remove()}),t=document.createTextNode("x"),wpgmza_iw_Div_close.appendChild(t),wpgmza_iw_Div_inner.appendChild(wpgmza_iw_Div_close),wpgmza_iw_Div_img=document.createElement("div"),wpgmza_iw_Div_img.className="wpgmza_iw_image",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_Div_img),wpgmza_iw_img=document.createElement("img"),wpgmza_iw_img.className="wpgmza_iw_marker_image",wpgmza_iw_img.src="",wpgmza_iw_img.style="max-width:100%;",wpgmza_iw_Div_img.appendChild(wpgmza_iw_img),wpgmza_iw_img_div=document.createElement("div"),wpgmza_iw_img_div.className="wpgmza_iw_title",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_img_div),wpgmza_iw_img_div_p=document.createElement("p"),wpgmza_iw_img_div_p.className="wpgmza_iw_title_p",wpgmza_iw_img_div.appendChild(wpgmza_iw_img_div_p),WPGMZA.settings.wpgmza_settings_infowindow_address||(wpgmza_iw_address_div=document.createElement("div"),wpgmza_iw_address_div.className="wpgmza_iw_address",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_address_div),wpgmza_iw_address_p=document.createElement("p"),wpgmza_iw_address_p.className="wpgmza_iw_address_p",wpgmza_iw_address_div.appendChild(wpgmza_iw_address_p)),wpgmza_iw_description=document.createElement("div"),wpgmza_iw_description.className="wpgmza_iw_description",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_description),wpgmza_iw_description_p=document.createElement("p"),wpgmza_iw_description_p.className="wpgmza_iw_description_p",wpgmza_iw_description.appendChild(wpgmza_iw_description_p),1==container.settings.show_distance_from_location&&(ratingContainer=$("<p class='wpgmza-distance-from-location'><span class='wpgmza-amount'></span> <span class='wpgmza-units'></span> <span class='wpgmza-source'></span></p>"),units=this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.localized_strings.miles_away:WPGMZA.localized_strings.kilometers_away,ratingContainer.find(".wpgmza-units").text(units),$(wpgmza_iw_Div_inner).append(ratingContainer)),ratingContainer=$("<div class='wpgmza-rating-container'></div>")[0],wpgmza_iw_Div_inner.appendChild(ratingContainer),$(wpgmza_iw_Div_inner).append("<div class='wpgmza_iw_custom_fields'/>"),wpgmza_iw_buttons=document.createElement("div"),wpgmza_iw_buttons.className="wpgmza_iw_buttons",wpgmza_iw_Div_inner.appendChild(wpgmza_iw_buttons),wpgmza_directions_button=document.createElement("a"),wpgmza_directions_button.className="wpgmza_button wpgmza_left wpgmza_directions_button",wpgmza_directions_button.src="#",t=document.createTextNode(WPGMZA.localized_strings.directions),wpgmza_directions_button.appendChild(t),wpgmza_iw_buttons.appendChild(wpgmza_directions_button),wpgmza_more_info_button=document.createElement("a"),wpgmza_more_info_button.className="wpgmza_button wpgmza_right wpgmza_more_info_button",wpgmza_more_info_button.src="#",t=document.createTextNode(WPGMZA.localized_strings.more_info),wpgmza_more_info_button.appendChild(t),wpgmza_iw_buttons.appendChild(wpgmza_more_info_button),legend=document.getElementById("wpgmza_iw_holder_"+mapid),$(legend).css("display","block"),$(legend).addClass("wpgmza_modern_infowindow"),$(legend).addClass("wpgmza-shadow"),"google-maps"==WPGMZA.settings.engine?(container=this.feature.map).googleMap.controls[google.maps.ControlPosition.RIGHT_TOP].push(legend):((container=$(".wpgmza-ol-modern-infowindow-container[data-map-id='"+mapid+"']")).length||(container=$("<div class='wpgmza-ol-modern-infowindow-container' data-map-id='"+mapid+"'></div>"),$(".wpgmza_map[data-map-id='"+mapid+"']").append(container)),container.append(legend)))},WPGMZA.ProInfoWindow.prototype.open=function(map,feature){if(window.infoWindow&&(infoWindow[feature.map.id]=this),!WPGMZA.InfoWindow.prototype.open.call(this,map,feature))return!1;if(this.feature==map.userLocationMarker)return!0;if(map.settings.wpgmza_list_markers_by==WPGMZA.MarkerListing.STYLE_MODERN)return!1;if(WPGMZA.settings.wpgmza_settings_disable_infowindows)return!1;if(this.style==WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE||"map-edit"==WPGMZA.currentPage)return this.legacyCreateDefaultInfoWindow(),!0;var data=wpgmaps_localize_marker_data[map.id],marker=feature;if("array"==typeof data){for(var i=0;i<data.length;i++)if(data[i].marker_id==feature.id){data[i];break}}else if("object"==typeof data)for(var key in data)if(data[key].marker_id==feature.id){data[key];break}this.legacyCreateModernInfoWindow(map),window.modern_iw_open&&(modern_iw_open[map.id]=!0);var gallery,element=this.element=jQuery("#wpgmza_iw_holder_"+map.id);element.find(".wpgmza_iw_marker_image").attr("src",""),element.find(".wpgmza_iw_title").html(""),element.find(".wpgmza_iw_description").html(""),element.find(".wpgmza_iw_address_p").html(""),element.find(".wpgmza_more_info_button").attr("href","#"),element.find(".wpgmza_more_info_button").attr("target",""),element.find(".wpgmza_directions_button").attr("gps",""),element.find(".wpgmza_directions_button").attr("href","#"),element.find(".wpgmza_directions_button").attr("id",""),element.find(".wpgmza_directions_button").attr("data-marker-id",""),element.find(".wpgmza_directions_button").attr("wpgm_addr_field",""),""===marker.image&&""===marker.title?element.find(".wpgmza_iw_image").css("display","none"):element.find(".wpgmza_iw_image").css("display","block"),(container=$("#wpgmza_iw_holder_"+map.id+" .wpgmza_iw_image")).html(""),marker.gallery?((gallery=new WPGMZA.MarkerGallery(marker,this)).element.css({float:"none"}),container.append(gallery.element)):marker.pic.length?((description=$("<img class='wpgmza_infowindow_image'/>")).attr("src",marker.pic),description.css({display:"block"}),container.append(description)):(element.find(".wpgmza_iw_marker_image").css("display","none"),element.find(".wpgmza_iw_title").attr("style","position: relative !important"),element.find(".wpgmza_iw_title").addClass("wpgmze_iw_title_no_image")),""!==marker.title&&element.find(".wpgmza_iw_title").html(marker.title);var description="";marker.desc?description=marker.desc:marker.description&&(description=marker.description),description&&description.length?(element.find(".wpgmza_iw_description").css("display","block"),element.find(".wpgmza_iw_description").html(description)):element.find(".wpgmza_iw_description").css("display","none");var container=element.find(".wpgmza_iw_description");return marker.custom_fields_html&&(container.append(marker.custom_fields_html),container.css("display","block")),void 0!==marker.address&&""!==marker.address&&element.find(".wpgmza_iw_address_p").html(marker.address),void 0!==marker.link&&""!==marker.link?(element.find(".wpgmza_more_info_button").show(),element.find(".wpgmza_more_info_button").attr("href",marker.link),element.find(".wpgmza_more_info_button").attr("target",this.linkTarget)):element.find(".wpgmza_more_info_button").hide(),map.directionsEnabled?(element.find(".wpgmza_directions_button").show(),element.find(".wpgmza_directions_button").attr("href","javascript:void(0);"),element.find(".wpgmza_directions_button").attr("gps",marker.lat+","+marker.lng),element.find(".wpgmza_directions_button").attr("wpgm_addr_field",marker.address),element.find(".wpgmza_directions_button").attr("id",map.id),element.find(".wpgmza_directions_button").attr("data-marker-id",marker.id),element.find(".wpgmza_directions_button").addClass("wpgmza_gd")):element.find(".wpgmza_directions_button").hide(),element.show(),this.trigger("domready"),this.trigger("infowindowopen"),!0},WPGMZA.ProInfoWindow.prototype.close=function(){$(this.feature.map.element).find(".wpgmza-pro-info-window-container").html()},WPGMZA.ProInfoWindow.prototype.setPosition=function(position){},$(document).ready(function(event){$(document.body).on("click",".wpgmza-close-info-window",function(event){$(event.target).closest(".wpgmza-info-window").remove()})})}),jQuery(function($){var Parent;WPGMZA.GoogleInfoWindow=function(feature){Parent.call(this,feature),this.setFeature(feature)},WPGMZA.GoogleInfoWindow.Z_INDEX=99,Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.GoogleInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.GoogleInfoWindow.prototype.constructor=WPGMZA.GoogleInfoWindow,WPGMZA.GoogleInfoWindow.prototype.setFeature=function(feature){(this.feature=feature)instanceof WPGMZA.Marker?this.googleObject=feature.googleMarker:feature instanceof WPGMZA.Polygon?this.googleObject=feature.googlePolygon:feature instanceof WPGMZA.Polyline&&(this.googleObject=feature.googlePolyline)},WPGMZA.GoogleInfoWindow.prototype.createGoogleInfoWindow=function(){var self=this;this.googleInfoWindow||(this.googleInfoWindow=new google.maps.InfoWindow,this.googleInfoWindow.setZIndex(WPGMZA.GoogleInfoWindow.Z_INDEX),google.maps.event.addListener(this.googleInfoWindow,"domready",function(event){self.trigger("domready")}),google.maps.event.addListener(this.googleInfoWindow,"closeclick",function(event){self.state!=WPGMZA.InfoWindow.STATE_CLOSED&&(self.state=WPGMZA.InfoWindow.STATE_CLOSED,self.feature.map.trigger("infowindowclose"))}))},WPGMZA.GoogleInfoWindow.prototype.open=function(map,html){var self=this;if(!Parent.prototype.open.call(this,map,html))return!1;this.parent=map,this.createGoogleInfoWindow(),this.setFeature(html),this.googleInfoWindow.open(this.feature.map.googleMap,this.googleObject);var intervalID,guid=WPGMZA.guid(),html=WPGMZA.isProVersion()?"":this.addEditButton(),html="<div id='"+guid+"'>"+html+" "+this.content+"</div>";return this.googleInfoWindow.setContent(html),intervalID=setInterval(function(event){div=$("#"+guid),div.length&&(clearInterval(intervalID),div[0].wpgmzaFeature=self.feature,div.addClass("wpgmza-infowindow"),self.element=div[0],self.trigger("infowindowopen"))},50),!0},WPGMZA.GoogleInfoWindow.prototype.close=function(){this.googleInfoWindow&&(WPGMZA.InfoWindow.prototype.close.call(this),this.googleInfoWindow.close())},WPGMZA.GoogleInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html,this.createGoogleInfoWindow(),this.googleInfoWindow.setContent(html)},WPGMZA.GoogleInfoWindow.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.createGoogleInfoWindow(),this.googleInfoWindow.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.OLInfoWindow=function(feature){var self=this;Parent.call(this,feature),this.element=$("<div class='wpgmza-infowindow ol-info-window-container ol-info-window-plain'></div>")[0],$(this.element).on("click",".ol-info-window-close",function(event){self.close()})},Parent=WPGMZA.isProVersion()?WPGMZA.ProInfoWindow:WPGMZA.InfoWindow,WPGMZA.OLInfoWindow.prototype=Object.create(Parent.prototype),WPGMZA.OLInfoWindow.prototype.constructor=WPGMZA.OLInfoWindow,Object.defineProperty(WPGMZA.OLInfoWindow.prototype,"isPanIntoViewAllowed",{get:function(){return!0}}),WPGMZA.OLInfoWindow.prototype.open=function(map,feature){var self=this,latLng=feature.getPosition();if(!Parent.prototype.open.call(this,map,feature))return!1;this.parent=map,this.overlay&&this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=new ol.Overlay({element:this.element,stopEvent:!0,insertFirst:!0}),this.overlay.setPosition(ol.proj.fromLonLat([latLng.lng,latLng.lat])),self.feature.map.olMap.addOverlay(this.overlay),$(this.element).show(),this.setContent(this.content),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&WPGMZA.getImageDimensions(feature.getIcon(),function(size){$(self.element).css({left:Math.round(size.width/2)+"px"})}),this.trigger("infowindowopen"),this.trigger("domready")},WPGMZA.OLInfoWindow.prototype.close=function(event){$(this.element).hide(),this.overlay&&(WPGMZA.InfoWindow.prototype.close.call(this),this.trigger("infowindowclose"),this.feature.map.olMap.removeOverlay(this.overlay),this.overlay=null)},WPGMZA.OLInfoWindow.prototype.setContent=function(html){Parent.prototype.setContent.call(this,html),this.content=html;var eaBtn=WPGMZA.isProVersion()?"":this.addEditButton();$(this.element).html(eaBtn+"<i class='fa fa-times ol-info-window-close' aria-hidden='true'></i>"+html)},WPGMZA.OLInfoWindow.prototype.setOptions=function(options){options.maxWidth&&$(this.element).css({"max-width":options.maxWidth+"px"})},WPGMZA.OLInfoWindow.prototype.onOpen=function(){var self=this,imgs=$(this.element).find("img"),numImages=imgs.length,numImagesLoaded=0;function inside(a,b){a=$(a)[0].getBoundingClientRect(),b=$(b)[0].getBoundingClientRect();return a.left>=b.left&&a.left<=b.right&&a.right<=b.right&&a.right>=b.left&&a.top>=b.top&&a.top<=b.bottom&&a.bottom<=b.bottom&&a.bottom>=b.top}function panIntoView(){var offset=.45*-$(self.element).height();self.feature.map.animateNudge(0,offset,self.feature.getPosition())}WPGMZA.InfoWindow.prototype.onOpen.apply(this,arguments),this.isPanIntoViewAllowed&&(imgs.each(function(index,el){el.onload=function(){++numImagesLoaded!=numImages||inside(self.element,self.feature.map.element)||panIntoView()}}),0!=numImages||inside(self.element,self.feature.map.element)||panIntoView())}}),jQuery(function($){WPGMZA.LatLng.fromJpeg=function(src,callback){var img=new Image;img.onload=function(){EXIF.getData(img,function(){var fLat,fLng,aLat=EXIF.getTag(img,"GPSLatitude"),aLng=EXIF.getTag(img,"GPSLongitude");aLat&&aLng?(fLat=EXIF.getTag(img,"GPSLatitudeRef")||"N",fLng=EXIF.getTag(img,"GPSLongitudeRef")||"W",fLat=(aLat[0]+aLat[1]/60+aLat[2]/3600)*("N"==fLat?1:-1),fLng=(aLng[0]+aLng[1]/60+aLng[2]/3600)*("W"==fLng?-1:1),callback(new WPGMZA.LatLng({lat:fLat,lng:fLng}))):callback(null)})},img.src=src},WPGMZA.LatLng.EXIF_ADDRESS_GEOCODE_KM_THRESHOLD=.5,$(document.body).on("click",".wpgmza-get-location-from-picture[data-source][data-destination]",function(event){var url,m=$(this).attr("data-source"),dest=$(this).attr("data-destination"),lat=$(this).attr("data-destination-lat"),lng=$(this).attr("data-destination-lng");if(!$(m).length)throw alert(WPGMZA.localized_strings.no_picture_found),new Error("Source element not found");if(!$(dest).length)throw new Error("Destination element not found");if($(m).is("img"))url=$(m).attr("src");else{if(!(m=$(m).css("background-image").match(/url\(["'](.+)["'"]\)/)))throw new Error("No background image found");url=m[1]}url&&0!=url.length||alert(WPGMZA.localized_strings.no_picture_found),WPGMZA.LatLng.fromJpeg(url,function(jpegLatLng){var geocoder;jpegLatLng?($(dest).val(jpegLatLng.toString()),lat&&lng&&($(lat).val(jpegLatLng.lat),$(lng).val(jpegLatLng.lng)),WPGMZA.settings.useRawJpegCoordinates||(geocoder=WPGMZA.Geocoder.createInstance()).getAddressFromLatLng({latLng:jpegLatLng},function(results,status){var address;status==WPGMZA.Geocoder.SUCCESS&&(address=results[0],geocoder.getLatLngFromAddress({address:address},function(addressLatLng,status){status==WPGMZA.Geocoder.SUCCESS&&(addressLatLng=new WPGMZA.LatLng(addressLatLng[0].latLng),WPGMZA.Distance.between(addressLatLng,jpegLatLng)<=WPGMZA.LatLng.EXIF_ADDRESS_GEOCODE_KM_THRESHOLD&&$(dest).val(address))}))})):alert(WPGMZA.localized_strings.no_gps_coordinates)})})}),jQuery(function($){"map-edit"==WPGMZA.currentPage&&(WPGMZA.ProMapEditPage=function(){var self=this;WPGMZA.MapEditPage.apply(this,arguments),this.directionsOriginIconPicker=new WPGMZA.MarkerIconPicker($("#directions_origin_icon_picker_container > .wpgmza-marker-icon-picker")),this.directionsDestinationIconPicker=new WPGMZA.MarkerIconPicker($("#directions_destination_icon_picker_container > .wpgmza-marker-icon-picker")),this.advancedSettingsMarkerIconPicker=new WPGMZA.MarkerIconPicker($("#advanced-settings-marker-icon-picker-container .wpgmza-marker-icon-picker")),this.userIconPicker=new WPGMZA.MarkerIconPicker($("#wpgmza_show_user_location_conditional .wpgmza-marker-icon-picker")),this.storeLocatorIconPicker=new WPGMZA.MarkerIconPicker($("#wpgmza_store_locator_bounce_conditional .wpgmza-marker-icon-picker")),$("input[name='store_locator_search_area']").on("input",function(event){self.onStoreLocatorSearchAreaChanged(event)}),self.onStoreLocatorSearchAreaChanged(),$('input[name="wpgmza_iw_type"][value="1"]').prop("checked")||$('input[name="wpgmza_iw_type"][value="2"]').prop("checked")||$('input[name="wpgmza_iw_type"][value="3"]').prop("checked")?$("#iw_custom_colors_row").fadeIn():$("#iw_custom_colors_row").fadeOut(),$(".iw_custom_click_show").on("click",function(){$("#iw_custom_colors_row").fadeIn()}),$(".iw_custom_click_hide").on("click",function(){$("#iw_custom_colors_row").fadeOut()}),$("#wpgmza_push_in_map").prop("checked")?$("#wpgmza_marker_list_conditional").fadeIn():$("#wpgmza_marker_list_conditional").fadeOut(),$("#wpgmza_push_in_map").on("change",function(){$(this).prop("checked")?$("#wpgmza_marker_list_conditional").fadeIn():$("#wpgmza_marker_list_conditional").fadeOut()}),$("#wpgmza_show_user_location").prop("checked")?$("#wpgmza_show_user_location_conditional").fadeIn():$("#wpgmza_show_user_location_conditional").fadeOut(),$("#wpgmza_show_user_location").on("change",function(){$(this).prop("checked")?$("#wpgmza_show_user_location_conditional").fadeIn():$("#wpgmza_show_user_location_conditional").fadeOut()}),$("#wpgmza_store_locator_bounce").prop("checked")?$("#wpgmza_store_locator_bounce_conditional").fadeIn():$("#wpgmza_store_locator_bounce_conditional").fadeOut(),$("#wpgmza_store_locator_bounce").on("change",function(){$(this).prop("checked")?$("#wpgmza_store_locator_bounce_conditional").fadeIn():$("#wpgmza_store_locator_bounce_conditional").fadeOut()}),$("#zoom_level_on_marker_listing_override").prop("checked")?$("#zoom_level_on_marker_listing_click_level").fadeIn():$("#zoom_level_on_marker_listing_click_level").fadeOut(),$("#zoom_level_on_marker_listing_override").on("change",function(){$(this).prop("checked")?$("#zoom_level_on_marker_listing_click_level").fadeIn():$("#zoom_level_on_marker_listing_click_level").fadeOut()}),$("#zoom-on-marker-listing-click-slider").slider({range:"max",min:1,max:21,value:$("input[name='zoom_level_on_marker_listing_click']").val(),slide:function(event,ui){$("input[name='zoom_level_on_marker_listing_click']").val(ui.value)}}),$("#wpgmza_override_users_location_zoom_level").prop("checked")?$("#wpgmza_override_users_location_zoom_levels_slider").fadeIn():$("#wpgmza_override_users_location_zoom_levels_slider").fadeOut(),$("#wpgmza_override_users_location_zoom_level").on("change",function(){$(this).prop("checked")?$("#wpgmza_override_users_location_zoom_levels_slider").fadeIn():$("#wpgmza_override_users_location_zoom_levels_slider").fadeOut()}),$("#override-users-location-zoom-levels-slider").slider({range:"max",min:1,max:21,value:$("input[name='override_users_location_zoom_levels']").val(),slide:function(event,ui){$("input[name='override_users_location_zoom_levels']").val(ui.value)}}),$("#open-route-service-key-notice").wrapInner("<div class='notice notice-error'><p></p></div>"),$("#zoom-on-marker-click-slider").slider({range:"max",min:1,max:21,value:$("input[name='wpgmza_zoom_on_marker_click_slider']").val(),slide:function(event,ui){$("input[name='wpgmza_zoom_on_marker_click_slider']").val(ui.value)}}),$("#wpgmza_zoom_on_marker_click").prop("checked")?$("#wpgmza_zoom_on_marker_click_zoom_level").fadeIn():$("#wpgmza_zoom_on_marker_click_zoom_level").fadeOut(),$("#wpgmza_zoom_on_marker_click").on("change",function(){$(this).prop("checked")?$("#wpgmza_zoom_on_marker_click_zoom_level").fadeIn():$("#wpgmza_zoom_on_marker_click_zoom_level").fadeOut()}),$("#datatable_result").prop("checked")?$("#datable_strings").fadeIn():$("#datable_strings").fadeOut(),$("#datatable_result").on("change",function(){$(this).prop("checked")?$("#datable_strings").fadeIn():$("#datable_strings").fadeOut()}),$("#datatable_result_page").prop("checked")?$("#datable_strings_entries").fadeIn():$("#datable_strings_entries").fadeOut(),$("#datatable_result_page").on("change",function(){$(this).prop("checked")?$("#datable_strings_entries").fadeIn():$("#datable_strings_entries").fadeOut()})},WPGMZA.extend(WPGMZA.ProMapEditPage,WPGMZA.MapEditPage),WPGMZA.ProMapEditPage.prototype.onStoreLocatorSearchAreaChanged=function(event){var value=$("input[name='store_locator_search_area']:checked").val();$("[data-search-area='"+value+"']").show(),$("[data-search-area][data-search-area!='"+value+"']").hide()})}),jQuery(function($){WPGMZA.ProMapListPage=function(){var self=this;WPGMZA.MapListPage.apply(this,arguments),$("[data-action='new-map']").on("click",function(event){self.onNewMap(event)}),$("[data-action='wizard']").on("click",function(event){self.onWizard(event)})},WPGMZA.extend(WPGMZA.ProMapListPage,WPGMZA.MapListPage),WPGMZA.MapListPage.createInstance=function(){return new WPGMZA.ProMapListPage},WPGMZA.ProMapListPage.prototype.onNewMap=function(event){$(event.target).prop("disabled","true"),WPGMZA.restAPI.call("/maps/",{method:"POST",data:{map_title:WPGMZA.localized_strings.new_map,map_start_lat:36.778261,map_start_lng:-119.4179323999,map_start_zoom:3},success:function(response,status,xhr){window.location.href=window.location.href="admin.php?page=wp-google-maps-menu&action=edit&map_id="+response.id}})},WPGMZA.ProMapListPage.prototype.onWizard=function(event){window.location.href="admin.php?page=wp-google-maps-menu&action=wizard"}}),jQuery(function($){WPGMZA.ProMap=function(element,options){var self=this;this._markersPlaced=!1,this.element=element,WPGMZA.Map.call(this,element,options),this.defaultMarkerIcon=null,this.settings.upload_default_marker&&(this.defaultMarkerIcon=WPGMZA.MarkerIcon.createInstance(this.settings.upload_default_marker)),this.heatmaps=[],this.showDistanceFromLocation=null,this.initCustomFieldFilterController(),this.initUserLocationMarker(),this.on("filteringcomplete",function(){self.onFilteringComplete()}),this._onMarkersPlaced=function(event){self.onMarkersPlaced(event)},this.on("markersplaced",this._onMarkersPlaced),WPGMZA.CloudAPI&&WPGMZA.CloudAPI.isBeingUsed&&WPGMZA.cloudAPI.call("/load")},WPGMZA.ProMap.prototype=Object.create(WPGMZA.Map.prototype),WPGMZA.ProMap.prototype.constructor=WPGMZA.ProMap,WPGMZA.ProMap.SHOW_DISTANCE_FROM_USER_LOCATION="user",WPGMZA.ProMap.SHOW_DISTANCE_FROM_SEARCHED_ADDRESS="searched",WPGMZA.ProMap.ControlPosition={TOP_CENTER:1,TOP_LEFT:2,TOP_RIGHT:3,LEFT_TOP:4,RIGHT_TOP:5,LEFT_CENTER:6,RIGHT_CENTER:7,LEFT_BOTTOM:8,RIGHT_BOTTOM:9,BOTTOM_CENTER:10,BOTTOM_LEFT:11,BOTTOM_RIGHT:12},Object.defineProperty(WPGMZA.ProMap.prototype,"mashupIDs",{get:function(){var result=[],attr=$(this.element).attr("data-mashup-ids");return attr&&attr.length&&(result=attr.split(",")),result}}),Object.defineProperty(WPGMZA.ProMap.prototype,"directionsEnabled",{get:function(){return 1==this.settings.directions_enabled}}),WPGMZA.ProMap.prototype.onInit=function(event){var latLng,zoom,self=this;WPGMZA.Map.prototype.onInit.apply(this,arguments),this.initDirectionsBox(),this.shortcodeAttributes.lat&&this.shortcodeAttributes.lng?(latLng=new WPGMZA.LatLng({lat:this.shortcodeAttributes.lat,lng:this.shortcodeAttributes.lng}),this.setCenter(latLng),this.shortcodeAttributes.mark_center&&"true"===this.shortcodeAttributes.mark_center&&(zoom=WPGMZA.Marker.createInstance({lat:this.shortcodeAttributes.lat,lng:this.shortcodeAttributes.lng,address:this.shortcodeAttributes.lat+", "+this.shortcodeAttributes.lng}),this.addMarker(zoom))):this.shortcodeAttributes.address&&WPGMZA.Geocoder.createInstance().geocode({address:this.shortcodeAttributes.address},function(results,status){status==WPGMZA.Geocoder.SUCCESS?self.setCenter(results[0].latLng):console.warn("Shortcode attribute address could not be geocoded")}),(zoom=WPGMZA.getQueryParamValue("mzoom"))&&this.setZoom(zoom),WPGMZA.getCurrentPage()!=WPGMZA.PAGE_MAP_EDIT&&"1"==this.settings.automatically_pan_to_users_location&&WPGMZA.getCurrentPosition(function(result){self.userLocationMarker||self.initUserLocationMarker(result),self.setCenter(new WPGMZA.LatLng({lat:result.coords.latitude,lng:result.coords.longitude})),self.settings.override_users_location_zoom_level&&self.setZoom(self.settings.override_users_location_zoom_levels)})},WPGMZA.ProMap.prototype.onMarkersPlaced=function(event){var self=this,jumpToNearestMarker=0==WPGMZA.is_admin&&1==self.settings.jump_to_nearest_marker_on_initialization;if(this.settings.order_markers_by!=WPGMZA.MarkerListing.ORDER_BY_DISTANCE&&1!=this.settings.show_distance_from_location&&!jumpToNearestMarker||WPGMZA.getCurrentPosition(function(location){location=new WPGMZA.LatLng({lat:location.coords.latitude,lng:location.coords.longitude});self.userLocation=location,self.userLocation.source=WPGMZA.ProMap.SHOW_DISTANCE_FROM_USER_LOCATION,self.showDistanceFromLocation=location,self.updateInfoWindowDistances(),self.markerListing&&(self.markersPlaced?self.markerListing.reload():self.on("markersplaced",function(event){self.markerListing.reload()})),jumpToNearestMarker&&self.panToNearestMarker(location)},function(error){self.markerListing&&self.markerListing.reload()}),self.settings.fit_maps_bounds_to_markers&&0<self.markers.length&&self.fitBoundsToMarkers(),self.initMarkerListing(),1==this.settings.mass_marker_support&&WPGMZA.MarkerClusterer){var options={};if(WPGMZA.settings.wpgmza_cluster_advanced_enabled){var styles=[];options.gridSize=parseInt(WPGMZA.settings.wpgmza_cluster_grid_size),options.maxZoom=parseInt(WPGMZA.settings.wpgmza_cluster_max_zoom),options.minClusterSize=parseInt(WPGMZA.settings.wpgmza_cluster_min_cluster_size),options.zoomOnClick=!!WPGMZA.settings.wpgmza_cluster_zoom_click;for(var i=1;i<=5;i++)level={},level.url=WPGMZA.settings["clusterLevel"+i].replace(/%2F/g,"/"),level.width=parseInt(WPGMZA.settings["clusterLevel"+i+"Width"]),level.height=parseInt(WPGMZA.settings["clusterLevel"+i+"Height"]),level.textColor=WPGMZA.settings.wpgmza_cluster_font_color,level.textSize=parseInt(WPGMZA.settings.wpgmza_cluster_font_size),styles.push(level);options.styles=styles}this.markerClusterer=new WPGMZA.MarkerClusterer(this,null,options),this.markerClusterer.addMarkers(this.markers)}},WPGMZA.ProMap.prototype.getRESTParameters=function(options){var params=WPGMZA.Map.prototype.getRESTParameters.apply(this,arguments);return this.settings.only_load_markers_within_viewport&&this.initialFetchCompleted&&(params.include="markers"),params},WPGMZA.ProMap.prototype.fetchFeatures=function(){var self=this;this.settings.only_load_markers_within_viewport?this.on("idle",function(event){self.fetchFeaturesViaREST(),self.initialFetchCompleted=!0}):WPGMZA.Map.prototype.fetchFeatures.apply(this,arguments)},WPGMZA.ProMap.prototype.onMarkersFetched=function(data,expectMoreBatches){this.settings.only_load_markers_within_viewport&&this.removeAllMarkers(),WPGMZA.Map.prototype.onMarkersFetched.apply(this,arguments)},WPGMZA.ProMap.prototype.panToNearestMarker=function(latlng){var closestMarker,distance=1/0;latlng=latlng||this.getCenter();for(var i=0;i<this.markers.length;i++){var distanceToMarker=WPGMZA.Distance.between(latlng,this.markers[i].getPosition());distanceToMarker<distance&&(closestMarker=this.markers[i],distance=distanceToMarker)}closestMarker&&this.panTo(closestMarker.getPosition(this.setZoom(7)))},WPGMZA.ProMap.prototype.fitBoundsToMarkers=function(markers){var bounds=new WPGMZA.LatLngBounds;markers=markers||this.markers;for(var i=0;i<markers.length;i++){if(!(markers[i]instanceof WPGMZA.Marker))throw new Error("Invalid input, not a WPGMZA.Marker");markers[i].isFiltered||bounds.extend(markers[i])}this.fitBounds(bounds)},WPGMZA.ProMap.prototype.fitMapBoundsToMarkers=WPGMZA.ProMap.prototype.fitBoundsToMarkers,WPGMZA.ProMap.prototype.resetBounds=function(){var latlng=new WPGMZA.LatLng(this.settings.map_start_lat,this.settings.map_start_lng);this.panTo(latlng),this.setZoom(this.settings.map_start_zoom)},WPGMZA.ProMap.prototype.onFilteringComplete=function(){if("1"==this.settings.fit_maps_bounds_to_markers_after_filtering){for(var areMarkersVisible=!1,i=0;i<this.markers.length;i++)if(!this.markers[i].isFiltered){areMarkersVisible=!0;break}areMarkersVisible&&this.fitBoundsToMarkers()}},WPGMZA.ProMap.prototype.initMarkerListing=function(){var markerListingElement;"1"!=WPGMZA.is_admin&&(markerListingElement=$("[data-wpgmza-marker-listing][id$='_"+this.id+"']"),this.markerListing=WPGMZA.MarkerListing.createInstance(this,markerListingElement[0]),this.off("markersplaced",this._onMarkersPlaced),delete this._onMarkersPlaced)},WPGMZA.ProMap.prototype.initCustomFieldFilterController=function(){this.customFieldFilterController=WPGMZA.CustomFieldFilterController.createInstance(this.id),WPGMZA.useLegacyGlobals&&wpgmzaLegacyGlobals.MYMAP[this.id]&&(wpgmzaLegacyGlobals.MYMAP[this.id].customFieldFilterController=this.customFieldFilterController)},WPGMZA.ProMap.prototype.initUserLocationMarker=function(cachedPos){var icon,options,marker,self=this;1==this.settings.show_user_location&&1!=parseInt(WPGMZA.is_admin)&&(icon=this.settings.upload_default_ul_marker,options={id:WPGMZA.guid(),animation:WPGMZA.Marker.ANIMATION_DROP,user_location:!0},icon&&icon.length&&(options.icon=icon),this.settings.upload_default_ul_marker_retina&&(options.retina=!0),(marker=WPGMZA.Marker.createInstance(options)).isFilterable=!1,marker.setOptions({zIndex:999999}),marker._icon.retina=marker.retina,cachedPos&&cachedPos.coords&&(marker.setPosition({lat:cachedPos.coords.latitude,lng:cachedPos.coords.longitude}),marker.map||self.addMarker(marker),self.userLocationMarker||(self.userLocationMarker=marker,self.trigger("userlocationmarkerplaced"))),WPGMZA.watchPosition(function(position){marker.setPosition({lat:position.coords.latitude,lng:position.coords.longitude}),marker.map||self.addMarker(marker),self.userLocationMarker||(self.userLocationMarker=marker,self.trigger("userlocationmarkerplaced"))}))},WPGMZA.ProMap.prototype.initDirectionsBox=function(){1!=WPGMZA.is_admin&&this.directionsEnabled&&(this.directionsBox=WPGMZA.DirectionsBox.createInstance(this))},WPGMZA.ProMap.prototype.addHeatmap=function(heatmap){if(!(heatmap instanceof WPGMZA.Heatmap))throw new Error("Argument must be an instance of WPGMZA.Heatmap");(heatmap.map=this).heatmaps.push(heatmap),this.dispatchEvent({type:"heatmapadded",heatmap:heatmap})},WPGMZA.ProMap.prototype.getHeatmapByID=function(id){for(var i=0;i<this.heatmaps.length;i++)if(this.heatmaps[i].id==id)return this.heatmaps[i];return null},WPGMZA.ProMap.prototype.removeHeatmap=function(heatmap){if(!(heatmap instanceof WPGMZA.Heatmap))throw new Error("Argument must be an instance of WPGMZA.Heatmap");if(heatmap.map!=this)throw new Error("Wrong map error");heatmap.map=null,heatmap instanceof WPGMZA.GoogleHeatmap&&heatmap.googleHeatmap.setMap(null),this.heatmaps.splice(this.heatmaps.indexOf(heatmap),1),this.dispatchEvent({type:"heatmapremoved",heatmap:heatmap})},WPGMZA.ProMap.prototype.removeHeatmapByID=function(heatmap){heatmap=this.getHeatmapByID(heatmap);heatmap&&this.removeHeatmap(heatmap)},WPGMZA.ProMap.prototype.getInfoWindowStyle=function(){if(!this.settings.other_settings)return WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE;var local=this.settings.other_settings.wpgmza_iw_type,global=WPGMZA.settings.wpgmza_iw_type;return"-1"==local&&"-1"==global?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:"-1"==local?global:local||WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE},WPGMZA.ProMap.prototype.getFilteringParameters=function(){},WPGMZA.ProMap.prototype.updateInfoWindowDistances=function(){this.showDistanceFromLocation;this.markers.forEach(function(marker){marker.infoWindow&&marker.infoWindow.updateDistanceFromLocation()})},WPGMZA.ProMap.prototype.hasVisibleMarkers=function(){for(var markers=this.markers,i=0;i<markers.length;i++)if(markers[i].isFilterable&&markers[i].getVisible())return!0;return!1},WPGMZA.ProMap.prototype.pushElementIntoMapPanel=function(element,position){},WPGMZA.ProMap.prototype.onClick=function(event){this.settings.close_infowindow_on_map_click&&event.target instanceof WPGMZA.Map&&void 0!==this.lastInteractedMarker&&this.lastInteractedMarker.infoWindow&&(this.lastInteractedMarker.infoWindow.close(),$(this.lastInteractedMarker.infoWindow.element).hasClass("wpgmza_modern_infowindow")&&$(this.lastInteractedMarker.infoWindow.element).remove())},jQuery(document).bind("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){var isFullScreen=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen,modernMarkerButton=jQuery(".wpgmza-modern-marker-open-button"),modernPopoutPanel=jQuery(".wpgmza-popout-panel"),modernStoreLocator=jQuery(".wpgmza-modern-store-locator"),fullScreenMap=void 0,fullScreenMap=(modernMarkerButton.length?modernMarkerButton:modernPopoutPanel.length?modernPopoutPanel:modernStoreLocator).parent(".wpgmza_map").children("div").first();isFullScreen&&void 0!==fullScreenMap&&fullScreenMap.append(modernMarkerButton,modernPopoutPanel,modernStoreLocator)})}),jQuery(function($){var Parent;WPGMZA.GoogleMap=function(element,options){var self=this;Parent.call(this,element,options),this.loadGoogleMap(),options?this.setOptions(options,!0):this.setOptions({},!0),google.maps.event.addListener(this.googleMap,"click",function(event){var wpgmzaEvent=new WPGMZA.Event("click");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"rightclick",function(event){var wpgmzaEvent=new WPGMZA.Event("rightclick");wpgmzaEvent.latLng={lat:event.latLng.lat(),lng:event.latLng.lng()},self.dispatchEvent(wpgmzaEvent)}),google.maps.event.addListener(this.googleMap,"dragend",function(event){self.dispatchEvent("dragend")}),google.maps.event.addListener(this.googleMap,"zoom_changed",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged")}),google.maps.event.addListener(this.googleMap,"idle",function(event){self.onIdle(event)}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},WPGMZA.isProVersion()?(Parent=WPGMZA.ProMap,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.ProMap.prototype)):(Parent=WPGMZA.Map,WPGMZA.GoogleMap.prototype=Object.create(WPGMZA.Map.prototype)),WPGMZA.GoogleMap.prototype.constructor=WPGMZA.GoogleMap,WPGMZA.GoogleMap.parseThemeData=function(raw){var json;try{json=JSON.parse(raw)}catch(e){try{json=eval(raw)}catch(e){var str=raw,str=str.replace(/\\'/g,"'");str=str.replace(/\\"/g,'"'),str=str.replace(/\\0/g,"\0"),str=str.replace(/\\\\/g,"\\");try{json=eval(str)}catch(e){return console.warn("Couldn't parse theme data"),[]}}}return json},WPGMZA.GoogleMap.prototype.loadGoogleMap=function(){var self=this,options=this.settings.toGoogleMapsOptions();this.googleMap=new google.maps.Map(this.engineElement,options),google.maps.event.addListener(this.googleMap,"bounds_changed",function(){self.onBoundsChanged()}),1==this.settings.bicycle&&this.enableBicycleLayer(!0),1==this.settings.traffic&&this.enableTrafficLayer(!0),this.settings.transport_layer&&this.enablePublicTransportLayer(!0),this.showPointsOfInterest(this.settings.wpgmza_show_point_of_interest),$(this.engineElement).append($(this.element).find(".wpgmza-loader"))},WPGMZA.GoogleMap.prototype.setOptions=function(options,clone){Parent.prototype.setOptions.call(this,options),options.scrollwheel&&delete options.scrollwheel,clone?(clone=$.extend(options,this.settings.toGoogleMapsOptions()),!(clone=$.extend({},clone)).center instanceof google.maps.LatLng&&(clone.center instanceof WPGMZA.LatLng||"object"==typeof clone.center)&&(clone.center={lat:parseFloat(clone.center.lat),lng:parseFloat(clone.center.lng)}),this.settings.hide_point_of_interest&&(clone.styles||(clone.styles=[]),clone.styles.push({featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]})),this.googleMap.setOptions(clone)):this.googleMap.setOptions(options)},WPGMZA.GoogleMap.prototype.addMarker=function(marker){marker.googleMarker.setMap(this.googleMap),Parent.prototype.addMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.removeMarker=function(marker){marker.googleMarker.setMap(null),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.GoogleMap.prototype.addPolygon=function(polygon){polygon.googlePolygon.setMap(this.googleMap),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.removePolygon=function(polygon){polygon.googlePolygon.setMap(null),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.GoogleMap.prototype.addPolyline=function(polyline){polyline.googlePolyline.setMap(this.googleMap),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.removePolyline=function(polyline){polyline.googlePolyline.setMap(null),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.GoogleMap.prototype.addCircle=function(circle){circle.googleCircle.setMap(this.googleMap),Parent.prototype.addCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.removeCircle=function(circle){circle.googleCircle.setMap(null),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.GoogleMap.prototype.addRectangle=function(rectangle){rectangle.googleRectangle.setMap(this.googleMap),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.removeRectangle=function(rectangle){rectangle.googleRectangle.setMap(null),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.GoogleMap.prototype.getCenter=function(){var latLng=this.googleMap.getCenter();return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.setCenter=function(latLng){WPGMZA.Map.prototype.setCenter.call(this,latLng),latLng instanceof WPGMZA.LatLng?this.googleMap.setCenter({lat:latLng.lat,lng:latLng.lng}):this.googleMap.setCenter(latLng)},WPGMZA.GoogleMap.prototype.panTo=function(latLng){latLng instanceof WPGMZA.LatLng?this.googleMap.panTo({lat:latLng.lat,lng:latLng.lng}):this.googleMap.panTo(latLng)},WPGMZA.GoogleMap.prototype.getZoom=function(){return this.googleMap.getZoom()},WPGMZA.GoogleMap.prototype.setZoom=function(value){if(isNaN(value))throw new Error("Value must not be NaN");return this.googleMap.setZoom(parseInt(value))},WPGMZA.GoogleMap.prototype.getBounds=function(){var nativeBounds=new WPGMZA.LatLngBounds({});try{var southWest=this.googleMap.getBounds(),northEast=southWest.getNorthEast(),southWest=southWest.getSouthWest();nativeBounds.north=northEast.lat(),nativeBounds.south=southWest.lat(),nativeBounds.west=southWest.lng(),nativeBounds.east=northEast.lng(),nativeBounds.topLeft={lat:northEast.lat(),lng:southWest.lng()},nativeBounds.bottomRight={lat:southWest.lat(),lng:northEast.lng()}}catch(ex){}return nativeBounds},WPGMZA.GoogleMap.prototype.fitBounds=function(southWest,nativeBounds){var bounds;southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),nativeBounds instanceof WPGMZA.LatLng?nativeBounds={lat:nativeBounds.lat,lng:nativeBounds.lng}:southWest instanceof WPGMZA.LatLngBounds&&(southWest={lat:(bounds=southWest).south,lng:bounds.west},nativeBounds={lat:bounds.north,lng:bounds.east});nativeBounds=new google.maps.LatLngBounds(southWest,nativeBounds);this.googleMap.fitBounds(nativeBounds)},WPGMZA.GoogleMap.prototype.fitBoundsToVisibleMarkers=function(){for(var bounds=new google.maps.LatLngBounds,i=0;i<this.markers.length;i++)markers[i].getVisible()&&bounds.extend(markers[i].getPosition());this.googleMap.fitBounds(bounds)},WPGMZA.GoogleMap.prototype.enableBicycleLayer=function(enable){this.bicycleLayer||(this.bicycleLayer=new google.maps.BicyclingLayer),this.bicycleLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enableTrafficLayer=function(enable){this.trafficLayer||(this.trafficLayer=new google.maps.TrafficLayer),this.trafficLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.enablePublicTransportLayer=function(enable){this.publicTransportLayer||(this.publicTransportLayer=new google.maps.TransitLayer),this.publicTransportLayer.setMap(enable?this.googleMap:null)},WPGMZA.GoogleMap.prototype.showPointsOfInterest=function(show){var styles=$("textarea[name='theme_data']").val();styles&&((styles=JSON.parse(styles)).push({featureType:"poi",stylers:[{visibility:show?"on":"off"}]}),this.googleMap.setOptions({styles:styles}))},WPGMZA.GoogleMap.prototype.getMinZoom=function(){return parseInt(this.settings.min_zoom)},WPGMZA.GoogleMap.prototype.setMinZoom=function(value){this.googleMap.setOptions({minZoom:value,maxZoom:this.getMaxZoom()})},WPGMZA.GoogleMap.prototype.getMaxZoom=function(){return parseInt(this.settings.max_zoom)},WPGMZA.GoogleMap.prototype.setMaxZoom=function(value){this.googleMap.setOptions({minZoom:this.getMinZoom(),maxZoom:value})},WPGMZA.GoogleMap.prototype.latLngToPixels=function(scale){var map=this.googleMap,worldPoint=new google.maps.LatLng({lat:parseFloat(scale.lat),lng:parseFloat(scale.lng)}),topRight=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),worldPoint=map.getProjection().fromLatLngToPoint(worldPoint);return{x:(worldPoint.x-bottomLeft.x)*scale,y:(worldPoint.y-topRight.y)*scale}},WPGMZA.GoogleMap.prototype.pixelsToLatLng=function(x,y){null==y&&("x"in x&&"y"in x?(y=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));var map=this.googleMap,latLng=map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()),bottomLeft=map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()),scale=Math.pow(2,map.getZoom()),latLng=new google.maps.Point(x/scale+bottomLeft.x,y/scale+latLng.y),latLng=map.getProjection().fromPointToLatLng(latLng);return{lat:latLng.lat(),lng:latLng.lng()}},WPGMZA.GoogleMap.prototype.onElementResized=function(event){this.googleMap&&google.maps.event.trigger(this.googleMap,"resize")},WPGMZA.GoogleMap.prototype.enableAllInteractions=function(){var options={scrollwheel:!0,draggable:!0,disableDoubleClickZoom:!1};this.googleMap.setOptions(options)}}),jQuery(function($){var Parent;WPGMZA.OLMap=function(element,viewOptions){var self=this;Parent.call(this,element),this.setOptions(viewOptions);viewOptions=this.settings.toOLViewOptions();function isSettingDisabled(value){return"yes"===value||!!value}$(this.element).html(""),this.olMap=new ol.Map({target:$(element)[0],layers:[this.getTileLayer()],view:new ol.View(viewOptions)}),this.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_draggable)):interaction instanceof ol.interaction.DoubleClickZoom?interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_clickzoom)):interaction instanceof ol.interaction.MouseWheelZoom&&interaction.setActive(!isSettingDisabled(self.settings.wpgmza_settings_map_scroll))},this),"greedy"!=this.settings.wpgmza_force_greedy_gestures&&"yes"!=this.settings.wpgmza_force_greedy_gestures&&1!=this.settings.wpgmza_force_greedy_gestures&&(this.gestureOverlay=$("<div class='wpgmza-gesture-overlay'></div>"),this.gestureOverlayTimeoutID=null,WPGMZA.isTouchDevice()||(this.olMap.on("wheel",function(event){if(!ol.events.condition.platformModifierKeyOnly(event))return self.showGestureOverlay(),event.originalEvent.preventDefault(),!1}),this.gestureOverlay.text(WPGMZA.localized_strings.use_ctrl_scroll_to_zoom))),this.olMap.getControls().forEach(function(control){control instanceof ol.control.Zoom&&1==WPGMZA.settings.wpgmza_settings_map_zoom&&self.olMap.removeControl(control)},this),isSettingDisabled(WPGMZA.settings.wpgmza_settings_map_full_screen_control)||this.olMap.addControl(new ol.control.FullScreen),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(this.markerLayer=new ol.layer.Vector({source:new ol.source.Vector({features:[]})}),this.olMap.addLayer(this.markerLayer),this.olMap.on("click",function(marker){marker=self.olMap.getFeaturesAtPixel(marker.pixel);marker&&marker.length&&((marker=marker[0].wpgmzaMarker)&&(marker.trigger("click"),marker.trigger("select")))})),this.olMap.on("movestart",function(event){self.isBeingDragged=!0}),this.olMap.on("moveend",function(event){self.wrapLongitude(),self.isBeingDragged=!1,self.dispatchEvent("dragend"),self.onIdle()}),this.olMap.getView().on("change:resolution",function(event){self.dispatchEvent("zoom_changed"),self.dispatchEvent("zoomchanged"),setTimeout(function(){self.onIdle()},10)}),this.olMap.getView().on("change",function(){self.onBoundsChanged()}),self.onBoundsChanged(),this._mouseoverNativeFeatures=[],this.olMap.on("pointermove",function(event){if(!event.dragging){try{var featuresUnderPixel=event.target.getFeaturesAtPixel(event.pixel)}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];for(var props,nativeFeaturesUnderPixel=[],i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),-1==self._mouseoverNativeFeatures.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseover"),self._mouseoverNativeFeatures.push(nativeFeature)));for(i=self._mouseoverNativeFeatures.length-1;0<=i;i--)nativeFeature=self._mouseoverNativeFeatures[i],-1==nativeFeaturesUnderPixel.indexOf(nativeFeature)&&(nativeFeature.trigger("mouseout"),self._mouseoverNativeFeatures.splice(i,1))}}),$(this.element).on("click contextmenu",function(event){var isRight;event=event||window.event;var latLng=self.pixelsToLatLng(event.offsetX,event.offsetY);if("which"in event?isRight=3==event.which:"button"in event&&(isRight=2==event.button),1==event.which||1==event.button){if(self.isBeingDragged)return;if($(event.target).closest(".ol-marker").length)return;try{var featuresUnderPixel=self.olMap.getFeaturesAtPixel([event.offsetX,event.offsetY])}catch(e){return}featuresUnderPixel=featuresUnderPixel||[];for(var props,nativeFeaturesUnderPixel=[],i=0;i<featuresUnderPixel.length;i++)(props=featuresUnderPixel[i].getProperties()).wpgmzaFeature&&(nativeFeature=props.wpgmzaFeature,nativeFeaturesUnderPixel.push(nativeFeature),nativeFeature.trigger("click"));return 0<featuresUnderPixel.length?void 0:void self.trigger({type:"click",latLng:latLng})}if(isRight)return self.onRightClick(event)}),WPGMZA.isProVersion()||(this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded"))},Parent=WPGMZA.isProVersion()?WPGMZA.ProMap:WPGMZA.Map,WPGMZA.OLMap.prototype=Object.create(Parent.prototype),WPGMZA.OLMap.prototype.constructor=WPGMZA.OLMap,WPGMZA.OLMap.prototype.getTileLayer=function(){var options={};return WPGMZA.settings.tile_server_url&&(options.url=WPGMZA.settings.tile_server_url,"custom_override"===WPGMZA.settings.tile_server_url&&(WPGMZA.settings.tile_server_url_override&&""!==WPGMZA.settings.tile_server_url_override.trim()?options.url=WPGMZA.settings.tile_server_url_override.trim():options.url="https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png"),WPGMZA.settings.open_layers_api_key&&""!==WPGMZA.settings.open_layers_api_key&&(options.url+="?apikey="+WPGMZA.settings.open_layers_api_key.trim())),new ol.layer.Tile({source:new ol.source.OSM(options)})},WPGMZA.OLMap.prototype.wrapLongitude=function(){var center=ol.proj.transform(this.olMap.getView().getCenter(),"EPSG:3857","EPSG:4326"),center={lat:center[1],lng:center[0]};-180<=center.lng&¢er.lng<=180||(center.lng=center.lng-360*Math.floor(center.lng/360),180<center.lng&&(center.lng-=360),this.setCenter(center))},WPGMZA.OLMap.prototype.getCenter=function(){var lonLat=ol.proj.toLonLat(this.olMap.getView().getCenter());return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.setCenter=function(latLng){var view=this.olMap.getView();WPGMZA.Map.prototype.setCenter.call(this,latLng),view.setCenter(ol.proj.fromLonLat([latLng.lng,latLng.lat])),this.wrapLongitude(),this.onBoundsChanged()},WPGMZA.OLMap.prototype.getBounds=function(){var bottomRight=this.olMap.getView().calculateExtent(this.olMap.getSize()),nativeBounds=new WPGMZA.LatLngBounds,topLeft=ol.proj.toLonLat([bottomRight[0],bottomRight[1]]),bottomRight=ol.proj.toLonLat([bottomRight[2],bottomRight[3]]);return nativeBounds.north=topLeft[1],nativeBounds.south=bottomRight[1],nativeBounds.west=topLeft[0],nativeBounds.east=bottomRight[0],nativeBounds},WPGMZA.OLMap.prototype.fitBounds=function(southWest,extent){southWest instanceof WPGMZA.LatLng&&(southWest={lat:southWest.lat,lng:southWest.lng}),extent instanceof WPGMZA.LatLng?extent={lat:extent.lat,lng:extent.lng}:southWest instanceof WPGMZA.LatLngBounds&&(southWest={lat:(view=southWest).south,lng:view.west},extent={lat:view.north,lng:view.east});var view=this.olMap.getView(),extent=ol.extent.boundingExtent([ol.proj.fromLonLat([parseFloat(southWest.lng),parseFloat(southWest.lat)]),ol.proj.fromLonLat([parseFloat(extent.lng),parseFloat(extent.lat)])]);view.fit(extent,this.olMap.getSize())},WPGMZA.OLMap.prototype.panTo=function(latLng,zoom){var view=this.olMap.getView(),options={center:ol.proj.fromLonLat([parseFloat(latLng.lng),parseFloat(latLng.lat)]),duration:500};1<arguments.length&&(options.zoom=parseInt(zoom)),view.animate(options)},WPGMZA.OLMap.prototype.getZoom=function(){return Math.round(this.olMap.getView().getZoom())},WPGMZA.OLMap.prototype.setZoom=function(value){this.olMap.getView().setZoom(value)},WPGMZA.OLMap.prototype.getMinZoom=function(){return this.olMap.getView().getMinZoom()},WPGMZA.OLMap.prototype.setMinZoom=function(value){this.olMap.getView().setMinZoom(value)},WPGMZA.OLMap.prototype.getMaxZoom=function(){return this.olMap.getView().getMaxZoom()},WPGMZA.OLMap.prototype.setMaxZoom=function(value){this.olMap.getView().setMaxZoom(value)},WPGMZA.OLMap.prototype.setOptions=function(options){Parent.prototype.setOptions.call(this,options),this.olMap&&this.olMap.getView().setProperties(this.settings.toOLViewOptions())},WPGMZA.OLMap.prototype.addMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.addOverlay(marker.overlay):(this.markerLayer.getSource().addFeature(marker.feature),marker.featureInSource=!0),Parent.prototype.addMarker.call(this,marker)},WPGMZA.OLMap.prototype.removeMarker=function(marker){WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?this.olMap.removeOverlay(marker.overlay):(this.markerLayer.getSource().removeFeature(marker.feature),marker.featureInSource=!1),Parent.prototype.removeMarker.call(this,marker)},WPGMZA.OLMap.prototype.addPolygon=function(polygon){this.olMap.addLayer(polygon.layer),Parent.prototype.addPolygon.call(this,polygon)},WPGMZA.OLMap.prototype.removePolygon=function(polygon){this.olMap.removeLayer(polygon.layer),Parent.prototype.removePolygon.call(this,polygon)},WPGMZA.OLMap.prototype.addPolyline=function(polyline){this.olMap.addLayer(polyline.layer),Parent.prototype.addPolyline.call(this,polyline)},WPGMZA.OLMap.prototype.removePolyline=function(polyline){this.olMap.removeLayer(polyline.layer),Parent.prototype.removePolyline.call(this,polyline)},WPGMZA.OLMap.prototype.addCircle=function(circle){this.olMap.addLayer(circle.layer),Parent.prototype.addCircle.call(this,circle)},WPGMZA.OLMap.prototype.removeCircle=function(circle){this.olMap.removeLayer(circle.layer),Parent.prototype.removeCircle.call(this,circle)},WPGMZA.OLMap.prototype.addRectangle=function(rectangle){this.olMap.addLayer(rectangle.layer),Parent.prototype.addRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.removeRectangle=function(rectangle){this.olMap.removeLayer(rectangle.layer),Parent.prototype.removeRectangle.call(this,rectangle)},WPGMZA.OLMap.prototype.pixelsToLatLng=function(x,lonLat){null==lonLat&&("x"in x&&"y"in x?(lonLat=x.y,x=x.x):console.warn("Y coordinate undefined in pixelsToLatLng (did you mean to pass 2 arguments?)"));lonLat=this.olMap.getCoordinateFromPixel([x,lonLat]);if(!lonLat)return{x:null,y:null};lonLat=ol.proj.toLonLat(lonLat);return{lat:lonLat[1],lng:lonLat[0]}},WPGMZA.OLMap.prototype.latLngToPixels=function(pixel){pixel=ol.proj.fromLonLat([pixel.lng,pixel.lat]),pixel=this.olMap.getPixelFromCoordinate(pixel);return pixel?{x:pixel[0],y:pixel[1]}:{x:null,y:null}},WPGMZA.OLMap.prototype.enableBicycleLayer=function(value){value?(this.bicycleLayer||(this.bicycleLayer=new ol.layer.Tile({source:new ol.source.OSM({url:"http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"})})),this.olMap.addLayer(this.bicycleLayer)):this.bicycleLayer&&this.olMap.removeLayer(this.bicycleLayer)},WPGMZA.OLMap.prototype.showGestureOverlay=function(){var self=this;clearTimeout(this.gestureOverlayTimeoutID),$(this.gestureOverlay).stop().animate({opacity:"100"}),$(this.element).append(this.gestureOverlay),$(this.gestureOverlay).css({"line-height":$(this.element).height()+"px",opacity:"1.0"}),$(this.gestureOverlay).show(),this.gestureOverlayTimeoutID=setTimeout(function(){self.gestureOverlay.fadeOut(2e3)},2e3)},WPGMZA.OLMap.prototype.onElementResized=function(event){this.olMap.updateSize()},WPGMZA.OLMap.prototype.onRightClick=function(event){if($(event.target).closest(".ol-marker, .wpgmza_modern_infowindow, .wpgmza-modern-store-locator").length)return!0;var latLng=$(this.element).offset(),relX=event.pageX-latLng.left,latLng=event.pageY-latLng.top,latLng=this.pixelsToLatLng(relX,latLng);return this.trigger({type:"rightclick",latLng:latLng}),$(this.element).trigger({type:"rightclick",latLng:latLng}),event.preventDefault(),!1},WPGMZA.OLMap.prototype.enableAllInteractions=function(){this.olMap.getInteractions().forEach(function(interaction){(interaction instanceof ol.interaction.DragPan||interaction instanceof ol.interaction.DoubleClickZoom||interaction instanceof ol.interaction.MouseWheelZoom)&&interaction.setActive(!0)},this)}}),jQuery(function($){WPGMZA.ProMarkerFilter=function(map){WPGMZA.MarkerFilter.call(this,map)},WPGMZA.ProMarkerFilter.prototype=Object.create(WPGMZA.MarkerFilter.prototype),WPGMZA.ProMarkerFilter.prototype.constructor=WPGMZA.ProMarkerFilter,WPGMZA.MarkerFilter.createInstance=function(map){return new WPGMZA.ProMarkerFilter(map)},WPGMZA.ProMarkerFilter.prototype.getFilteringParameters=function(){var bounds,params=WPGMZA.MarkerFilter.prototype.getFilteringParameters.call(this),mashupIDs=this.map.mashupIDs;return mashupIDs&&(params.mashupIDs=mashupIDs),this.map.markerListing&&(params=$.extend(params,this.map.markerListing.getFilteringParameters())),this.map.customFieldFilterController&&(bounds=this.map.customFieldFilterController.getAjaxRequestData().data.widgetData,params.customFields=bounds),this.map.settings.only_load_markers_within_viewport&&(bounds=this.map.getBounds(),params.bounds=bounds),params},WPGMZA.ProMarkerFilter.prototype.update=function(params,source){var self=this;function dispatchEvent(result){var event=new WPGMZA.Event("filteringcomplete");event.map=self.map,event.source=source,event.filteredMarkers=result,event.filteringParams=params,self.onFilteringComplete(event),self.trigger(event),self.map.trigger(event)}this.updateTimeoutID||(params=params||{},this.xhr&&(this.xhr.abort(),delete this.xhr),this.updateTimeoutID=setTimeout(function(){return(params=$.extend(self.getFilteringParameters(),params)).center instanceof WPGMZA.LatLng&&(params.center=params.center.toLatLngLiteral()),params.hideAll?dispatchEvent([]):(self.map.showPreloader(!0),self.xhr=WPGMZA.restAPI.call("/markers",{data:{fields:["id"],filter:JSON.stringify(params)},success:function(result,status,xhr){self.map.showPreloader(!1),dispatchEvent(result)},useCompressedPathVariable:!0})),void delete self.updateTimeoutID},0))},WPGMZA.ProMarkerFilter.prototype.onFilteringComplete=function(event){var map=[];event.filteredMarkers.forEach(function(data){map[data.id]=!0}),this.map.markers.forEach(function(marker){var allowByFilter;marker.isFilterable&&(allowByFilter=!!map[marker.id],marker.isFiltered=!allowByFilter,marker.setVisible(allowByFilter))})}}),jQuery(function($){WPGMZA.ProMarker=function(row){var currentMap,m,self=this;if(this._icon=WPGMZA.MarkerIcon.createInstance(),row&&row.map_id&&(currentMap=WPGMZA.getMapByID(row.map_id)),this.title="",this.description="",this.categories=[],this.approved=1,row&&row.retina?"object"==typeof row.icon&&row.icon.retina?this.retina=row.icon.retina:!0===row.retina?this.retina=row.retina:this.retina=row.retina&&"1"==row.retina?1:0:this.retina=0,currentMap&¤tMap.settings&¤tMap.settings.default_marker)try{var objtmp=JSON.parse(currentMap.settings.default_marker);"object"==typeof objtmp&&objtmp.retina&&1==objtmp.retina&&(this.retina=!0)}catch(e){}row&&row.category&&row.category.length&&((m=row.category.match(/\d+/g))&&(this.categories=m)),WPGMZA.Marker.call(this,row),this.on("mouseover",function(event){self.onMouseOver(event)})},WPGMZA.ProMarker.prototype=Object.create(WPGMZA.Marker.prototype),WPGMZA.ProMarker.prototype.constructor=WPGMZA.ProMarker,WPGMZA.ProMarker.STICKY_ZINDEX=999999,Object.defineProperty(WPGMZA.ProMarker.prototype,"isIntegrated",{get:function(){return/[^\d]/.test(this.id)}}),Object.defineProperty(WPGMZA.ProMarker.prototype,"icon",{get:function(){return this._icon.isDefault?this.map.defaultMarkerIcon:this._icon},set:function(value){if(value instanceof WPGMZA.MarkerIcon)this._icon=value,this.map&&this.updateIcon();else{if("object"!=typeof value&&"string"!=typeof value)throw new Error("Value must be an instance of WPGMZA.MarkerIcon, an icon literal, or a string");"object"==typeof value&&(value.retina=!(!this.retina||!0!==this.retina)||(this.retina&&"1"==this.retina?1:0)),this._icon=WPGMZA.MarkerIcon.createInstance(value),this.map&&this.updateIcon()}}}),WPGMZA.ProMarker.prototype.onAdded=function(event){if(WPGMZA.Marker.prototype.onAdded.call(this,event),this.updateIcon(),(!this.map.storeLocator||this!=this.map.storeLocator.marker)&&this!=this.map.userLocationMarker){if(1==this.map.settings.wpgmza_store_locator_hide_before_search&&1!=WPGMZA.is_admin&&this.isFilterable)return this.userCreated?void 0:(this.isFiltered=!0,void this.setVisible(!1));WPGMZA.getQueryParamValue("markerid")!=this.id&&this.map.shortcodeAttributes.marker!=this.id||(this.openInfoWindow(),this.map.setCenter(this.getPosition())),"approved"in this&&0==this.approved&&this.setOpacity(.6),1==this.sticky&&this.setOptions({zIndex:WPGMZA.ProMarker.STICKY_ZINDEX})}},WPGMZA.ProMarker.prototype.onClick=function(event){WPGMZA.Marker.prototype.onClick.apply(this,arguments),this.map.settings.wpgmza_zoom_on_marker_click&&this.map.settings.wpgmza_zoom_on_marker_click_slider&&(this.map.setZoom(this.map.settings.wpgmza_zoom_on_marker_click_slider),this.map.setCenter(this.getPosition())),1==this.map.settings.click_open_link&&this.link&&this.link.length&&("yes"==WPGMZA.settings.wpgmza_settings_infowindow_links?window.open(this.link):window.open(this.link,"_self"))},WPGMZA.ProMarker.prototype.onMouseOver=function(event){WPGMZA.settings.wpgmza_settings_map_open_marker_by==WPGMZA.ProInfoWindow.OPEN_BY_HOVER&&this.openInfoWindow()},WPGMZA.ProMarker.prototype.getIconFromCategory=function(){if(this.categories.length){var self=this,categoryIDs=this.categories.slice();categoryIDs.sort(function(categoryA,categoryB){categoryA=self.map.getCategoryByID(categoryA),categoryB=self.map.getCategoryByID(categoryB);return categoryA&&categoryB?categoryA.depth<categoryB.depth?-1:1:null});for(var i=0;i<categoryIDs.length;i++){var icon=this.map.getCategoryByID(categoryIDs[i]);if(icon){icon=icon.icon;if(icon&&icon.length)return icon}}}},WPGMZA.ProMarker.prototype.setIcon=function(icon){this.icon=icon},WPGMZA.ProMarker.prototype.openInfoWindow=function(autoOpen){return(!this.map.settings.wpgmza_listmarkers_by||6!=parseInt(this.map.settings.wpgmza_listmarkers_by))&&(WPGMZA.Marker.prototype.openInfoWindow.apply(this,arguments),!this.disableInfoWindow&&void((this.map&&this.map.userLocationMarker==this||void 0!==this.user_location&&this.user_location)&&this.infoWindow.setContent(WPGMZA.localized_strings.my_location)))}}),jQuery(function($){var Parent;WPGMZA.GoogleMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toGoogleLatLng():options[name]instanceof WPGMZA.Map||"icon"==name||(settings[name]=options[name]);this.googleMarker=new google.maps.Marker(settings),(this.googleMarker.wpgmzaMarker=this).googleFeature=this.googleMarker,this.googleMarker.setPosition(new google.maps.LatLng({lat:parseFloat(this.lat),lng:parseFloat(this.lng)})),this.anim&&this.googleMarker.setAnimation(this.anim),this.animation&&this.googleMarker.setAnimation(this.animation),google.maps.event.addListener(this.googleMarker,"click",function(){self.dispatchEvent("click"),self.dispatchEvent("select")}),google.maps.event.addListener(this.googleMarker,"mouseover",function(){self.dispatchEvent("mouseover")}),google.maps.event.addListener(this.googleMarker,"dragend",function(){var googleMarkerPosition=self.googleMarker.getPosition();self.setPosition({lat:googleMarkerPosition.lat(),lng:googleMarkerPosition.lng()}),self.dispatchEvent({type:"dragend",latLng:self.getPosition()}),self.trigger("change")}),this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.GoogleMarker.prototype=Object.create(Parent.prototype),WPGMZA.GoogleMarker.prototype.constructor=WPGMZA.GoogleMarker,Object.defineProperty(WPGMZA.GoogleMarker.prototype,"opacity",{get:function(){return this._opacity},set:function(value){this._opacity=value,this.googleMarker.setOpacity(value)}}),WPGMZA.GoogleMarker.prototype.setLabel=function(label){label?(this.googleMarker.setLabel({text:label}),this.googleMarker.getIcon()||this.googleMarker.setIcon(WPGMZA.settings.default_marker_icon)):this.googleMarker.setLabel(null)},WPGMZA.GoogleMarker.prototype.setPosition=function(latLng){Parent.prototype.setPosition.call(this,latLng),this.googleMarker.setPosition({lat:this.lat,lng:this.lng})},WPGMZA.GoogleMarker.prototype.updateOffset=function(){var self=this,icon=this.googleMarker.getIcon(),img=new Image,x=this._offset.x,y=this._offset.y,params="string"==typeof(icon=icon||WPGMZA.settings.default_marker_icon)?{url:icon}:icon;img.onload=function(){var defaultAnchor_x=img.width/2,defaultAnchor_y=img.height;params.anchor=new google.maps.Point(defaultAnchor_x-x,defaultAnchor_y-y),self.googleMarker.setIcon(params)},img.src=params.url},WPGMZA.GoogleMarker.prototype.setOptions=function(options){this.googleMarker.setOptions(options)},WPGMZA.GoogleMarker.prototype.setAnimation=function(animation){Parent.prototype.setAnimation.call(this,animation),this.googleMarker.setAnimation(animation)},WPGMZA.GoogleMarker.prototype.setVisible=function(visible){Parent.prototype.setVisible.call(this,visible),this.googleMarker.setVisible(!!visible)},WPGMZA.GoogleMarker.prototype.getVisible=function(visible){return this.googleMarker.getVisible()},WPGMZA.GoogleMarker.prototype.setDraggable=function(draggable){this.googleMarker.setDraggable(draggable)},WPGMZA.GoogleMarker.prototype.setOpacity=function(opacity){this.googleMarker.setOpacity(opacity)}}),jQuery(function($){var Parent;WPGMZA.OLMarker=function(options){var self=this;Parent.call(this,options);var settings={};if(options)for(var name in options)options[name]instanceof WPGMZA.LatLng?settings[name]=options[name].toLatLngLiteral():options[name]instanceof WPGMZA.Map||(settings[name]=options[name]);var origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);if(WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT){var img=$("<img alt=''/>")[0];img.onload=function(event){self.updateElementHeight(),self.map&&self.map.olMap.updateSize()},img.src=WPGMZA.defaultMarkerIcon,this.element=$("<div class='ol-marker'></div>")[0],this.element.appendChild(img),this.element.wpgmzaMarker=this,$(this.element).on("mouseover",function(event){self.dispatchEvent("mouseover")}),this.overlay=new ol.Overlay({element:this.element,position:origin,positioning:"bottom-center",stopEvent:!1}),this.overlay.setPosition(origin),this.animation?this.setAnimation(this.animation):this.anim&&this.setAnimation(this.anim),options&&options.draggable&&this.setDraggable(!0),this.rebindClickListener()}else{if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)throw new Error("Invalid marker render mode");this.feature=new ol.Feature({geometry:new ol.geom.Point(origin)}),this.feature.setStyle(this.getVectorLayerStyle()),(this.feature.wpgmzaMarker=this).feature.wpgmzaFeature=this}this.setOptions(settings),this.trigger("init")},Parent=WPGMZA.isProVersion()?WPGMZA.ProMarker:WPGMZA.Marker,WPGMZA.OLMarker.prototype=Object.create(Parent.prototype),WPGMZA.OLMarker.prototype.constructor=WPGMZA.OLMarker,WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT="element",WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER="vector",WPGMZA.OLMarker.renderMode=WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT,"open-layers"==WPGMZA.settings.engine&&WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER&&(WPGMZA.OLMarker.defaultVectorLayerStyle=new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:WPGMZA.defaultMarkerIcon})}),WPGMZA.OLMarker.hiddenVectorLayerStyle=new ol.style.Style({})),WPGMZA.OLMarker.prototype.getVectorLayerStyle=function(){return this.vectorLayerStyle||WPGMZA.OLMarker.defaultVectorLayerStyle},WPGMZA.OLMarker.prototype.updateElementHeight=function(height,calledOnFocus){var self=this;0!=(height=height||$(this.element).find("img").height())||calledOnFocus||$(window).one("focus",function(event){self.updateElementHeight(!1,!0)}),$(this.element).css({height:height+"px"})},WPGMZA.OLMarker.prototype.addLabel=function(){this.setLabel(this.getLabelText())},WPGMZA.OLMarker.prototype.setLabel=function(label){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?label?(this.label||(this.label=$("<div class='ol-marker-label'/>"),$(this.element).append(this.label)),this.label.html(label)):this.label&&$(this.element).find(".ol-marker-label").remove():console.warn("Marker labels are not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.getVisible=function(visible){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)return"none"!=this.overlay.getElement().style.display},WPGMZA.OLMarker.prototype.setVisible=function(visible){var style;Parent.prototype.setVisible.call(this,visible),WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?visible?(style=this.getVectorLayerStyle(),this.feature.setStyle(style)):this.feature.setStyle(null):this.overlay.getElement().style.display=visible?"block":"none"},WPGMZA.OLMarker.prototype.setPosition=function(origin){Parent.prototype.setPosition.call(this,origin);origin=ol.proj.fromLonLat([parseFloat(this.lng),parseFloat(this.lat)]);WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?this.feature.setGeometry(new ol.geom.Point(origin)):this.overlay.setPosition(origin)},WPGMZA.OLMarker.prototype.updateOffset=function(x,y){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?(x=this._offset.x,y=this._offset.y,this.element.style.position="relative",this.element.style.left=x+"px",this.element.style.top=y+"px"):console.warn("Marker offset is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setAnimation=function(anim){if(WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER)switch(Parent.prototype.setAnimation.call(this,anim),anim){case WPGMZA.Marker.ANIMATION_NONE:$(this.element).removeAttr("data-anim");break;case WPGMZA.Marker.ANIMATION_BOUNCE:$(this.element).attr("data-anim","bounce");break;case WPGMZA.Marker.ANIMATION_DROP:$(this.element).attr("data-anim","drop")}else console.warn("Marker animation is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setDraggable=function(options){var self=this;WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?options?(options={disabled:!1},this.jQueryDraggableInitialized||(options.start=function(event){self.onDragStart(event)},options.stop=function(event){self.onDragEnd(event)}),$(this.element).draggable(options),this.jQueryDraggableInitialized=!0,this.rebindClickListener()):$(this.element).draggable({disabled:!0}):console.warn("Marker dragging is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.setOpacity=function(opacity){WPGMZA.OLMarker.renderMode!=WPGMZA.OLMarker.RENDER_MODE_VECTOR_LAYER?$(this.element).css({opacity:opacity}):console.warn("Marker opacity is not currently supported in Vector Layer rendering mode")},WPGMZA.OLMarker.prototype.onDragStart=function(event){this.isBeingDragged=!0,this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!1)})},WPGMZA.OLMarker.prototype.onDragEnd=function(event){var latLngAfterDrag=parseFloat($(this.element).css("top").match(/-?\d+/)[0]),offset_left=parseFloat($(this.element).css("left").match(/-?\d+/)[0]);$(this.element).css({top:"0px",left:"0px"});var pixelsBeforeDrag=this.getPosition(),pixelsBeforeDrag=this.map.latLngToPixels(pixelsBeforeDrag),latLngAfterDrag={x:pixelsBeforeDrag.x+offset_left,y:pixelsBeforeDrag.y+latLngAfterDrag},latLngAfterDrag=this.map.pixelsToLatLng(latLngAfterDrag);this.setPosition(latLngAfterDrag),this.isBeingDragged=!1,this.trigger({type:"dragend",latLng:latLngAfterDrag}),this.trigger("change"),"yes"!=this.map.settings.wpgmza_settings_map_draggable&&this.map.olMap.getInteractions().forEach(function(interaction){interaction instanceof ol.interaction.DragPan&&interaction.setActive(!0)})},WPGMZA.OLMarker.prototype.onElementClick=function(self){self=self.currentTarget.wpgmzaMarker;self.isBeingDragged||(self.dispatchEvent("click"),self.dispatchEvent("select"))},WPGMZA.OLMarker.prototype.rebindClickListener=function(){$(this.element).off("click",this.onElementClick),$(this.element).on("click",this.onElementClick)}}),jQuery(function($){var Parent;function compareMax(a,b){return b.max-a.max}function Cell(x,y,h,polygon){this.x=x,this.y=y,this.h=h,this.d=function(x,y,polygon){for(var inside=!1,minDistSq=1/0,k=0;k<polygon.length;k++)for(var ring=polygon[k],i=0,len=ring.length,j=len-1;i<len;j=i++){var a=ring[i],b=ring[j];a[1]>y!=b[1]>y&&x<(b[0]-a[0])*(y-a[1])/(b[1]-a[1])+a[0]&&(inside=!inside),minDistSq=Math.min(minDistSq,function(px,py,t,b){var x=t[0],y=t[1],dx=b[0]-x,dy=b[1]-y;0===dx&&0===dy||(1<(t=((px-x)*dx+(py-y)*dy)/(dx*dx+dy*dy))?(x=b[0],y=b[1]):0<t&&(x+=dx*t,y+=dy*t));return(dx=px-x)*dx+(dy=py-y)*dy}(x,y,a,b))}return(inside?1:-1)*Math.sqrt(minDistSq)}(x,y,polygon),this.max=this.d+this.h*Math.SQRT2}WPGMZA.ProPolygon=function(row,enginePolygon){var self=this;Parent.call(this,row,enginePolygon),this.on("mouseover",function(event){self.onMouseOver(event)}),this.on("mouseout",function(event){self.onMouseOut(event)}),this.on("click",function(event){self.onClick(event)}),this.initPolygonLabels()},Parent=WPGMZA.Polygon,WPGMZA.ProPolygon.prototype=Object.create(Parent.prototype),WPGMZA.ProPolygon.prototype.constructor=WPGMZA.ProPolygon,Object.defineProperty(WPGMZA.ProPolygon.prototype,"hoverFillColor",{enumerable:!0,get:function(){return this.ohfillcolor&&this.ohfillcolor.length?"#"+this.ohfillcolor.replace(/^#/,""):"#ff0000"},set:function(a){this.ohfillcolor=a}}),Object.defineProperty(WPGMZA.ProPolygon.prototype,"hoverStrokeColor",{enumerable:!0,get:function(){return this.ohlinecolor&&this.ohlinecolor.length?"#"+this.ohlinecolor.replace(/^#/,""):"#ff0000"},set:function(a){this.ohlinecolor=a}}),Object.defineProperty(WPGMZA.ProPolygon.prototype,"hoverOpacity",{enumerable:!0,get:function(){return this.ohopacity||.6},set:function(a){this.ohopacity=a}}),WPGMZA.ProPolygon.getLabelPosition=function(bboxCell,precision,debug){var minX,minY,maxX,maxY,polygon=bboxCell;precision=precision||1;for(var i=0;i<polygon[0].length;i++){var p=polygon[0][i];(!i||p[0]<minX)&&(minX=p[0]),(!i||p[1]<minY)&&(minY=p[1]),(!i||p[0]>maxX)&&(maxX=p[0]),(!i||p[1]>maxY)&&(maxY=p[1])}var width=maxX-minX,bboxCell=maxY-minY,cellSize=Math.min(width,bboxCell),h=cellSize/2;if(0===cellSize)return[minX,minY];for(var cellQueue=new WPGMZA.Queue(null,compareMax),x=minX;x<maxX;x+=cellSize)for(var y=minY;y<maxY;y+=cellSize)cellQueue.push(new Cell(x+h,y+h,h,polygon));var bestCell=function(polygon){for(var area=0,x=0,y=0,points=polygon[0],i=0,len=points.length,j=len-1;i<len;j=i++){var a=points[i],b=points[j],f=a[0]*b[1]-b[0]*a[1];x+=(a[0]+b[0])*f,y+=(a[1]+b[1])*f,area+=3*f}return 0===area?new Cell(points[0][0],points[0][1],0,polygon):new Cell(x/area,y/area,0,polygon)}(polygon),bboxCell=new Cell(minX+width/2,minY+bboxCell/2,0,polygon);bboxCell.d>bestCell.d&&(bestCell=bboxCell);for(var numProbes=cellQueue.length;cellQueue.length;){var cell=cellQueue.pop();cell.d>bestCell.d&&(bestCell=cell,debug&&console.log("found best %d after %d probes",Math.round(1e4*cell.d)/1e4,numProbes)),cell.max-bestCell.d<=precision||(h=cell.h/2,cellQueue.push(new Cell(cell.x-h,cell.y-h,h,polygon)),cellQueue.push(new Cell(cell.x+h,cell.y-h,h,polygon)),cellQueue.push(new Cell(cell.x-h,cell.y+h,h,polygon)),cellQueue.push(new Cell(cell.x+h,cell.y+h,h,polygon)),numProbes+=4)}return debug&&(console.log("num probes: "+numProbes),console.log("best distance: "+bestCell.d)),[bestCell.x,bestCell.y]},WPGMZA.ProPolygon.prototype.onMouseOver=function(event){this.revertOptions=this.getScalarProperties();var options={fillColor:this.hoverFillColor,strokeColor:this.hoverStrokeColor,fillOpacity:this.hoverOpacity};this.setOptions(options)},WPGMZA.ProPolygon.prototype.onMouseOut=function(event){var options={fillColor:this.fillColor,strokeColor:this.strokeColor,fillOpacity:this.fillOpacity};this.revertOptions&&(options=this.revertOptions,this.revertOptions=!1),this.setOptions(options)},WPGMZA.ProPolygon.prototype.onClick=function(event){this.map.settings.disable_polygon_info_windows||this.openInfoWindow()},WPGMZA.ProPolygon.prototype.getPosition=function(){return this.getCentroid()},WPGMZA.ProPolygon.prototype.openInfoWindow=function(){this.map?(this.map.lastInteractedMarker&&this.map.lastInteractedMarker.infoWindow.close(),(this.map.lastInteractedMarker=this).initInfoWindow(),this.pic="",this.infoWindow.open(this.map,this),this.centroid=this.getCentroid(),this.infoWindow.setPosition(this.centroid),this.infoWindow.element.classList.add("ol-info-window-polygon"),1==this.map.settings.click_open_link&&this.link&&this.link.length&&("yes"==WPGMZA.settings.wpgmza_settings_infowindow_links?window.open(this.link):window.open(this.link,"_self"))):console.warn("Cannot open infowindow for polygon with no map")},WPGMZA.ProPolygon.prototype.initInfoWindow=function(){this.infoWindow||(this.infoWindow=WPGMZA.InfoWindow.createInstance())},WPGMZA.ProPolygon.prototype.getCentroid=function(){var i,geojson=[[]];for(i in this.polydata)geojson[0].push([parseFloat(this.polydata[i].lat),parseFloat(this.polydata[i].lng)]);var latLng=WPGMZA.ProPolygon.getLabelPosition(geojson);return new WPGMZA.LatLng({lat:latLng[0],lng:latLng[1]})},WPGMZA.ProPolygon.prototype.getCenterApprox=function(){var i,pos={lat:0,lng:0},n=this.polydata.length;for(i in this.polydata)pos.lat+=parseFloat(this.polydata[i].lat),pos.lng+=parseFloat(this.polydata[i].lng);return new WPGMZA.LatLng(pos.lat/n,pos.lng/n)},WPGMZA.ProPolygon.prototype.initPolygonLabels=function(){var settings;!WPGMZA.getMapByID(this.map_id)||(settings=WPGMZA.getMapByID(this.map_id).settings)&&settings.polygon_labels&&this.title&&WPGMZA.Text.createInstance({text:this.title,map:WPGMZA.getMapByID(this.map_id),position:this.getCentroid()})}}),jQuery(function($){var Parent;WPGMZA.GooglePolygon=function(options,googlePolygon){var self=this;options=options||{},Parent.call(this,options,googlePolygon),this.googlePolygon=googlePolygon||new google.maps.Polygon,this.googleFeature=this.googlePolygon,options&&options.polydata&&this.googlePolygon.setOptions({paths:this.parseGeometry(options.polydata)}),this.googlePolygon.wpgmzaPolygon=this,options&&this.setOptions(options),google.maps.event.addListener(this.googlePolygon,"click",function(){self.dispatchEvent({type:"click"})})},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.GooglePolygon.prototype=Object.create(Parent.prototype),WPGMZA.GooglePolygon.prototype.constructor=WPGMZA.GooglePolygon,WPGMZA.GooglePolygon.prototype.updateNativeFeature=function(){this.googlePolygon.setOptions(this.getScalarProperties())},WPGMZA.GooglePolygon.prototype.getEditable=function(){return this.googlePolygon.getOptions().editable},WPGMZA.GooglePolygon.prototype.setEditable=function(value){var self=this;this.googlePolygon.setOptions({editable:value}),value&&(this.googlePolygon.getPaths().forEach(function(path,index){["insert_at","remove_at","set_at"].forEach(function(name){google.maps.event.addListener(path,name,function(){self.trigger("change")})})}),google.maps.event.addListener(this.googlePolygon,"dragend",function(event){self.trigger("change")}),google.maps.event.addListener(this.googlePolygon,"click",function(event){WPGMZA.altKeyDown&&(this.getPath().removeAt(event.vertex),self.trigger("change"))}))},WPGMZA.GooglePolygon.prototype.setDraggable=function(value){this.googlePolygon.setDraggable(value)},WPGMZA.GooglePolygon.prototype.getGeometry=function(){for(var result=[],path=this.googlePolygon.getPath(),i=0;i<path.getLength();i++){var latLng=path.getAt(i);result.push({lat:latLng.lat(),lng:latLng.lng()})}return result}}),jQuery(function($){var Parent;WPGMZA.OLPolygon=function(options,olFeature){if(Parent.call(this,options,olFeature),olFeature)this.olFeature=olFeature;else{var coordinates=[[]];if(options&&options.polydata)for(var paths=this.parseGeometry(options.polydata),i=0;i<=paths.length;i++)coordinates[0].push(ol.proj.fromLonLat([parseFloat(paths[i%paths.length].lng),parseFloat(paths[i%paths.length].lat)]));this.olFeature=new ol.Feature({geometry:new ol.geom.Polygon(coordinates)})}this.layer=new ol.layer.Vector({source:new ol.source.Vector({features:[this.olFeature]})}),this.layer.getSource().getFeatures()[0].setProperties({wpgmzaPolygon:this,wpgmzaFeature:this}),options&&this.setOptions(options)},Parent=WPGMZA.isProVersion()?WPGMZA.ProPolygon:WPGMZA.Polygon,WPGMZA.OLPolygon.prototype=Object.create(Parent.prototype),WPGMZA.OLPolygon.prototype.constructor=WPGMZA.OLPolygon,WPGMZA.OLPolygon.prototype.getGeometry=function(){for(var coordinates=this.olFeature.getGeometry().getCoordinates()[0],result=[],i=0;i<coordinates.length;i++){var latLng=ol.proj.toLonLat(coordinates[i]),latLng={lat:latLng[1],lng:latLng[0]};result.push(latLng)}return result},WPGMZA.OLPolygon.prototype.setOptions=function(options){Parent.prototype.setOptions.apply(this,arguments),"editable"in options&&WPGMZA.OLFeature.setInteractionsOnFeature(this,options.editable)}}),jQuery(function($){WPGMZA.ProStoreLocator=function(map,element){WPGMZA.StoreLocator.call(this,map,element);var buttons=$(element).find("input[type='button'], button:not(.wpgmza-use-my-location)");buttons.prop("disabled",!0),map.on("markersplaced",function(event){buttons.prop("disabled",!1)}),map.settings.wpgmza_store_locator_use_their_location||$(this.element).find(".wpgmza-use-my-location").remove(),map.settings.store_locator_search_area==WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO&&$(this.element).find(".wpgmza_sl_radius_select").remove(),this.map.on("init",function(event){})},WPGMZA.ProStoreLocator.prototype=Object.create(WPGMZA.StoreLocator.prototype),WPGMZA.ProStoreLocator.prototype.constructor=WPGMZA.ProStoreLocator,WPGMZA.ProStoreLocator.SEARCH_AREA_RADIAL="radial",WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO="auto",WPGMZA.StoreLocator.createInstance=function(map,element){return new WPGMZA.ProStoreLocator(map,element)},Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"keywords",{get:function(){var legacy=$(".wpgmza_name_search_string + input").val();return legacy||$(this.map.element).find(".wpgmza-text-search").val()}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"categories",{configurable:!0,get:function(){var value,results;if(0<$(this.map.element).find(".wpgmza-modern-store-locator").length)$(this.map.element).find(".wpgmza-modern-store-locator [name='wpgmza_cat_checkbox']:checked").each(function(index,el){(results=results||[]).push($(el).val())});else{if((value=$(this.element).find(".wpgmza_sl_category_div > select")).length)return"0"==(value=value.val())?null:[value];$(this.element).find(".wpgmza_sl_category_div :checked").each(function(index,el){(results=results||[]).push($(el).val())})}return results}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"hideMarkersInInitialState",{get:function(){return 1==this.map.settings.wpgmza_store_locator_hide_before_search}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleStrokeColor",{get:function(){return this.map.settings.sl_stroke_color?"#"+this.map.settings.sl_stroke_color.replace(/^#/,""):"#ff0000"}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleFillColor",{get:function(){return this.map.settings.sl_fill_color?"#"+this.map.settings.sl_fill_color.replace(/^#/,""):"#ff0000"}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleStrokeOpacity",{get:function(){return void 0!==this.map.settings.sl_stroke_opacity&&""!==this.map.settings.sl_stroke_opacity?parseFloat(this.map.settings.sl_stroke_opacity):.25}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circleFillOpacity",{get:function(){return void 0!==this.map.settings.sl_fill_opacity&&""!==this.map.settings.sl_fill_opacity?parseFloat(this.map.settings.sl_fill_opacity):.15}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"circle",{get:function(){return this.map.settings.store_locator_search_area==WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO?null:this._circle||(WPGMZA.isDeviceiOS()||"modern"!=this.map.settings.wpgmza_store_locator_radius_style?this._circle=WPGMZA.Circle.createInstance({strokeColor:this.circleStrokeColor,strokeOpacity:this.circleStrokeOpacity,strokeWeight:2,fillColor:this.circleFillColor,fillOpacity:this.circleFillOpacity,visible:!1,clickable:!1,center:new WPGMZA.LatLng}):(this._circle=WPGMZA.ModernStoreLocatorCircle.createInstance(this.map.id),this._circle.settings.color=this.circleStrokeColor),this._circle)}}),Object.defineProperty(WPGMZA.ProStoreLocator.prototype,"marker",{get:function(){if(1!=this.map.settings.wpgmza_store_locator_bounce)return null;if(this._marker)return this._marker;var options={visible:!1};return this.map.settings.upload_default_sl_marker&&this.map.settings.upload_default_sl_marker.length&&(options.icon=this.map.settings.upload_default_sl_marker,this.map.settings.upload_default_sl_marker_retina&&(options.retina=!0)),this._marker=WPGMZA.Marker.createInstance(options),this._marker.disableInfoWindow=!0,this._marker.isFilterable=!1,this._marker._icon.retina=this._marker.retina,1==this.map.settings.wpgmza_sl_animation?this._marker.setAnimation(WPGMZA.Marker.ANIMATION_BOUNCE):2==this.map.settings.wpgmza_sl_animation&&this._marker.setAnimation(WPGMZA.Marker.ANIMATION_DROP),this._marker}}),WPGMZA.ProStoreLocator.prototype.getZoomFromRadius=function(radius){return this.distanceUnits==WPGMZA.Distance.MILES&&(radius*=WPGMZA.Distance.KILOMETERS_PER_MILE),Math.round(14-Math.log(radius)/Math.LN2)},WPGMZA.ProStoreLocator.prototype.getFilteringParameters=function(){if(this.state==WPGMZA.StoreLocator.STATE_INITIAL)return this.hideMarkersInInitialState?{hideAll:!0}:{};var params=WPGMZA.StoreLocator.prototype.getFilteringParameters.call(this),proParams={};return this.map.settings.store_locator_search_area==WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO&&(delete params.center,delete params.radius),this.keywords&&(proParams.keywords=this.keywords),this.categories&&(proParams.categories=this.categories),$.extend(params,proParams)},WPGMZA.ProStoreLocator.prototype.onFilteringComplete=function(event){var params=event.filteringParams,circle=this.circle,factor=(this.marker,this.distanceUnits==WPGMZA.Distance.MILES?WPGMZA.Distance.KILOMETERS_PER_MILE:1);if(event.source instanceof WPGMZA.StoreLocator){switch(WPGMZA.StoreLocator.prototype.onFilteringComplete.apply(this,arguments),this.map.settings.store_locator_search_area){case WPGMZA.ProStoreLocator.SEARCH_AREA_AUTO:if(!this.bounds||this.bounds.isInInitialState()){this.map.setZoom(this.map.settings.map_start_zoom);break}this.map.fitBounds(this.bounds);var maxZoom=this.map.settings.store_locator_auto_area_max_zoom;maxZoom&&this.map.getZoom()>=maxZoom&&this.map.setZoom(maxZoom);break;default:if(circle&&circle.setVisible(!1),params.center&¶ms.radius){this.map.setCenter(params.center),this.map.setZoom(this.getZoomFromRadius(params.radius)),circle&&(circle instanceof WPGMZA.ModernStoreLocatorCircle&&(circle.settings.radiusString=Math.round(params.radius)),circle.setRadius(params.radius*factor),circle.setCenter(params.center),circle.setVisible(!0),circle.map!=this.map&&this.map.addCircle(circle));break}}var storeLocatorResultEvent={type:"storelocatorresult"};event.center&&(storeLocatorResultEvent.center=event.center),this.map.trigger(storeLocatorResultEvent)}},WPGMZA.ProStoreLocator.prototype.onGeocodeComplete=function(event){var location;event.results&&event.results.length&&((location=new WPGMZA.LatLng({lat:event.results[0].lat,lng:event.results[0].lng})).source=WPGMZA.ProMap.SHOW_DISTANCE_FROM_SEARCHED_ADDRESS,this.map.showDistanceFromLocation=location),WPGMZA.StoreLocator.prototype.onGeocodeComplete.apply(this,arguments)},WPGMZA.ProStoreLocator.prototype.onReset=function(event){this.map.showDistanceFromLocation=this.map.userLocation,this.map.updateInfoWindowDistances(),WPGMZA.StoreLocator.prototype.onReset.apply(this,arguments)}}),jQuery(function($){function defaultCompare(a,b){return a<b?-1:b<a?1:0}WPGMZA.Queue=function(data,compare){if(data=data||[],compare=compare||defaultCompare,this.data=data,this.length=this.data.length,this.compare=compare,0<this.lenght)for(var i=(this.length>>1)-1;0<=i;i--)this._down(i)},WPGMZA.Queue.prototype.push=function(item){this.data.push(item),this.length++,this._up(this.length-1)},WPGMZA.Queue.prototype.pop=function(){if(0!==this.length){var top=this.data[0],bottom=this.data.pop();return this.length--,0<this.length&&(this.data[0]=bottom,this._down(0)),top}},WPGMZA.Queue.prototype.peek=function(){return this.data[0]},WPGMZA.Queue.prototype._up=function(pos){for(var data=this.data,compare=this.compare,item=data[pos];0<pos;){var parent=pos-1>>1,current=data[parent];if(0<=compare(item,current))break;data[pos]=current,pos=parent}data[pos]=item},WPGMZA.Queue.prototype._down=function(pos){for(var data=this.data,compare=this.compare,halfLength=this.length>>1,item=data[pos];pos<halfLength;){var left=1+(pos<<1),best=data[left],right=left+1;if(right<this.length&&compare(data[right],best)<0&&(best=data[left=right]),0<=compare(best,item))break;data[pos]=best,pos=left}data[pos]=item}}),jQuery(function($){WPGMZA.UseMyLocationButton=function(target,options){var self=this;this.options={},options&&(this.options=options),this.target=$(target),this.element=$("<button class='wpgmza-use-my-location button-secondary' type='button' title='"+WPGMZA.localized_strings.use_my_location+"'><i class='fa fa-crosshairs' aria-hidden='true'></i></button>"),this.element.on("click",function(event){self.onClick(event)})},WPGMZA.UseMyLocationButton.prototype=Object.create(WPGMZA.EventDispatcher.prototype),WPGMZA.UseMyLocationButton.prototype.constructor=WPGMZA.UseMyLocationButton,WPGMZA.UseMyLocationButton.prototype.onClick=function(event){var self=this;WPGMZA.getCurrentPosition(function(lng){var lat=lng.coords.latitude,lng=lng.coords.longitude;self.target.val(lat+", "+lng),self.target.trigger("change"),WPGMZA.Geocoder.createInstance().geocode({latLng:{lat:lat,lng:lng}},function(results){results&&results.length&&self.target.val(results[0])})})}}),jQuery(function($){WPGMZA.ModernStoreLocator=function(map_id){var original,inner,placeholder,button,container,items,numCategories,icons,self=this,map=WPGMZA.getMapByID(map_id);WPGMZA.assertInstanceOf(this,"ModernStoreLocator"),(original=(WPGMZA.isProVersion()?$(".wpgmza_sl_search_button[mid='"+map_id+"'], .wpgmza_sl_search_button_"+map_id):$(".wpgmza_sl_search_button")).closest(".wpgmza_sl_main_div")).length&&(this.element=$("<div class='wpgmza-modern-store-locator'><div class='wpgmza-inner wpgmza-modern-hover-opaque'/></div>")[0],inner=$(this.element).find(".wpgmza-inner"),items=WPGMZA.isProVersion()?$(original).find(".addressInput"):$(original).find("#addressInput"),map.settings.store_locator_query_string&&map.settings.store_locator_query_string.length&&items.attr("placeholder",map.settings.store_locator_query_string),inner.append(items),(button=$(original).find("[id='nameInput_"+map_id+"']")).length&&((placeholder=map.settings.store_locator_name_string)&&placeholder.length&&button.attr("placeholder",placeholder),inner.append(button)),(button=$(original).find("button.wpgmza-use-my-location"))&&inner.append(button),$(items).on("keydown keypress",function(event){13==event.keyCode&&self.searchButton.is(":visible")&&self.searchButton.trigger("click")}),$(items).on("input",function(event){self.searchButton.show(),self.resetButton.hide()}),inner.append($(original).find("select.wpgmza_sl_radius_select")),this.searchButton=$(original).find(".wpgmza_sl_search_button, .wpgmza_sl_search_button_div"),inner.append(this.searchButton),this.resetButton=$(original).find(".wpgmza_sl_reset_button_div"),inner.append(this.resetButton),this.resetButton.on("click",function(event){resetLocations(map_id)}),this.resetButton.hide(),WPGMZA.isProVersion()&&(this.searchButton.on("click",function(event){0!=$("addressInput_"+map_id).val()&&(self.searchButton.hide(),self.resetButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_APPLIED)}),this.resetButton.on("click",function(event){self.resetButton.hide(),self.searchButton.show(),map.storeLocator.state=WPGMZA.StoreLocator.STATE_INITIAL})),inner.append($("#wpgmza_distance_type_"+map_id)),container=$(original).find(".wpgmza_cat_checkbox_holder"),$(container).children("ul"),items=$(container).find("li"),numCategories=0,icons=[],items.each(function(index,el){var category_id,id=$(el).attr("class").match(/\d+/);for(category_id in wpgmza_category_data)if(id==category_id){var src=wpgmza_category_data[category_id].image,icon=$('<div class="wpgmza-chip-icon"/>');icon.css({"background-image":"url('"+src+"')",width:$("#wpgmza_cat_checkbox_"+category_id+" + label").height()+"px"}),icons.push(icon),null!=src&&""!=src&&$("#wpgmza_cat_checkbox_"+category_id+" + label").prepend(icon),numCategories++;break}}),$(this.element).append(container),numCategories&&(this.optionsButton=$('<span class="wpgmza_store_locator_options_button"><i class="fa fa-list"></i></span>'),$(this.searchButton).before(this.optionsButton)),setInterval(function(){icons.forEach(function(icon){var height=$(icon).height();$(icon).css({width:height+"px"}),$(icon).closest("label").css({"padding-left":height+8+"px"})}),$(container).css("width",$(self.element).find(".wpgmza-inner").outerWidth()+"px")},1e3),$(this.element).find(".wpgmza_store_locator_options_button").on("click",function(event){container.hasClass("wpgmza-open")?container.removeClass("wpgmza-open"):container.addClass("wpgmza-open")}),$(original).remove(),$(this.element).find("input, select").on("focus",function(){$(inner).addClass("active")}),$(this.element).find("input, select").on("blur",function(){$(inner).removeClass("active")}),$(this.element).on("mouseover","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseOverCategory(event)}),$(this.element).on("mouseleave","li.wpgmza_cat_checkbox_item_holder",function(event){self.onMouseLeaveCategory(event)}),$("body").on("click",".wpgmza_store_locator_options_button",function(event){setTimeout(function(){var position_cat,$p_map;$(".wpgmza_cat_checkbox_holder").hasClass("wpgmza-open")&&(position_cat=($p_map=$(".wpgmza_cat_checkbox_holder")).position().top+$p_map.outerHeight(!0)+$(".wpgmza-modern-store-locator").height(),($p_map=$(".wpgmza_map")).position().top+$p_map.outerHeight(!0)<=position_cat&&($(".wpgmza_cat_ul").css("overflow","scroll "),$(".wpgmza_cat_ul").css("height","100%"),$(".wpgmza-modern-store-locator").css("height","100%"),$(".wpgmza_cat_checkbox_holder.wpgmza-open").css({"padding-bottom":"50px",height:"100%"})))},500)}))},WPGMZA.ModernStoreLocator.createInstance=function(map_id){return new("open-layers"!==WPGMZA.settings.engine?WPGMZA.GoogleModernStoreLocator:WPGMZA.OLModernStoreLocator)(map_id)},WPGMZA.ModernStoreLocator.prototype.onMouseOverCategory=function(li){li=li.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeIn()},WPGMZA.ModernStoreLocator.prototype.onMouseLeaveCategory=function(li){li=li.currentTarget;$(li).children("ul.wpgmza_cat_checkbox_item_holder").stop(!0,!1).fadeOut()}}),jQuery(function($){WPGMZA.GoogleModernStoreLocator=function(map_id){var restrict=this.map=WPGMZA.getMapByID(map_id);WPGMZA.ModernStoreLocator.call(this,map_id);restrict=restrict.settings.wpgmza_store_locator_restrict;this.addressInput=$(this.element).find(".addressInput, #addressInput")[0],this.addressInput&&restrict&&restrict.length,this.map.googleMap.controls[google.maps.ControlPosition.TOP_CENTER].push(this.element)},WPGMZA.GoogleModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator.prototype),WPGMZA.GoogleModernStoreLocator.prototype.constructor=WPGMZA.GoogleModernStoreLocator}),jQuery(function($){WPGMZA.OLModernStoreLocator=function(map_id){WPGMZA.ModernStoreLocator.call(this,map_id),(WPGMZA.isProVersion()?$(".wpgmza_map[data-map-id='"+map_id+"']"):$("#wpgmza_map")).append(this.element)},WPGMZA.OLModernStoreLocator.prototype=Object.create(WPGMZA.ModernStoreLocator),WPGMZA.OLModernStoreLocator.prototype.constructor=WPGMZA.OLModernStoreLocator}),jQuery(function($){var __,InspectorControls,_wp$components,PanelBody,SelectControl,RangeControl;window.wp&&wp.i18n&&wp.blocks&&wp.editor&&wp.components&&(__=wp.i18n.__,wp.blocks.registerBlockType,_wp$components=wp.editor,InspectorControls=_wp$components.InspectorControls,_wp$components.BlockControls,(_wp$components=wp.components).Dashicon,_wp$components.Toolbar,_wp$components.Button,_wp$components.Tooltip,PanelBody=_wp$components.PanelBody,_wp$components.TextareaControl,_wp$components.TextControl,_wp$components.RichText,SelectControl=_wp$components.SelectControl,RangeControl=_wp$components.RangeControl,WPGMZA.Integration.ProGutenberg=function(){WPGMZA.Integration.Gutenberg.call(this)},WPGMZA.Integration.ProGutenberg.prototype=Object.create(WPGMZA.Integration.Gutenberg.prototype),WPGMZA.Integration.ProGutenberg.prototype.constructor=WPGMZA.Integration.ProGutenberg,WPGMZA.Integration.Gutenberg.getConstructor=function(){return WPGMZA.Integration.ProGutenberg},WPGMZA.Integration.ProGutenberg.prototype.getMapSelectOptions=function(){var result=[];return WPGMZA.gutenbergData.maps.forEach(function(el){result.push({key:el.id,value:el.id,label:el.map_title+" ("+el.id+")"})}),result},WPGMZA.Integration.ProGutenberg.prototype.updateMarkerSelectOptions=function(props){var select=$("select[name='marker']"),mashup_ids=$("select[name='mashup_ids']").val(),none=$("<option value='none'></option>"),request={fields:["id","address","title"],filter:{map_id:$("select[name='map_id']").val()}};none.text(__("None")),mashup_ids&&(request.filter.mashup_ids=mashup_ids),select.prop("disabled",!0),WPGMZA.restAPI.call("/markers/",{success:function(response){select.html(""),select.append(none),response.forEach(function(data){var option=$("<option/>");option.val(data.id),option.prop("value",data.id),option.text((data.title.length?data.title:data.address)+" ("+data.id+")"),select.append(option)}),select.prop("disabled",!1),props.attributes.marker&&select.val(props.attributes.marker)},data:request})},WPGMZA.Integration.ProGutenberg.prototype.updateCategorySelectOptions=function(props){var select=$("select[name='cat']"),none=$("<option value='none'></option>"),request={filter:{map_id:$("select[name='map_id']").val()}};none.text(__("None")),select.prop("disabled",!0),WPGMZA.restAPI.call("/categories/",{success:function(response){select.html(""),select.append(none),function addNodeChildren(node,depth){depth=depth||0,node.children&&node.children.forEach(function(child){for(var prefix="",option=$("<option/>"),i=0;i<depth;i++)prefix+=" ";option.val(child.id),option.prop(child.id),option.html(prefix+child.name+" ("+child.id+")"),select.append(option),addNodeChildren(child,depth+1)})}(response),select.prop("disabled",!1),props.attributes.cat&&select.val(props.attributes.cat)},data:request})},WPGMZA.Integration.ProGutenberg.prototype.getBlockInspectorControls=function(props){var self=this,selectedMapID="1";return props.attributes.id?selectedMapID=props.attributes.id:WPGMZA.gutenbergData.maps.length&&(selectedMapID=WPGMZA.gutenbergData.maps[0].id),setTimeout(function(){self.updateMarkerSelectOptions(props),self.updateCategorySelectOptions(props)},100),React.createElement(InspectorControls,{key:"inspector"},React.createElement(PanelBody,{title:__("Map Settings")},React.createElement(SelectControl,{name:"map_id",label:__("Map"),value:selectedMapID,options:this.getMapSelectOptions(),onChange:function(value){props.setAttributes({id:value})}}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("a",{href:WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu",onClick:function(event){var map_id=$("select[name='map_id']").val();return window.open(WPGMZA.adminurl+"admin.php?page=wp-google-maps-menu&action=edit&map_id="+map_id),event.preventDefault(),!1},target:"_blank",className:"button button-primary"},React.createElement("i",{className:"fa fa-pencil-square-o","aria-hidden":"true"}),__("Go to Map Editor"))),React.createElement(SelectControl,{name:"mashup_ids",label:__("Mashup IDs"),value:props.attributes.mashup_ids||[],options:this.getMapSelectOptions(),multiple:!0,onChange:function(value){props.setAttributes({mashup_ids:value})}}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("button",{className:"button button-primary",onClick:function(){$("select[name='mashup_ids']").val(null),props.setAttributes({mashup_ids:[]})}},React.createElement("i",{className:"fa fa-times","aria-hidden":"true"}),__("Reset Mashup IDs"))),React.createElement(SelectControl,{name:"marker",label:__("Focused Marker"),value:"none",options:[{key:"none",value:"none",label:__("None")}],onChange:function(value){props.setAttributes({marker:value})}}),React.createElement(RangeControl,{name:"zoom",label:__("Override Zoom"),onChange:function(value){props.setAttributes({zoom:value})},min:1,max:21,step:1,value:parseInt(props.attributes.zoom)}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("button",{className:"button button-primary",onClick:function(){props.setAttributes({zoom:""})}},React.createElement("i",{className:"fa fa-times","aria-hidden":"true"}),__("Reset Override Zoom"))),React.createElement(SelectControl,{name:"cat",label:__("Initial Category"),value:"none",options:[{key:"none",value:"none",label:__("None")}],onChange:function(value){props.setAttributes({cat:value})}}),React.createElement("p",{className:"map-block-gutenberg-button-container"},React.createElement("a",{href:"https://www.wpgmaps.com/documentation/creating-your-first-map/",target:"_blank",className:"button button-primary"},React.createElement("i",{className:"fa fa-book","aria-hidden":"true"}),__("View Documentation")))))},WPGMZA.Integration.ProGutenberg.prototype.getBlockAttributes=function(props){return{id:{type:"string"},mashup_ids:{type:"array"},marker:{type:"string"},zoom:{type:"string"},cat:{type:"string"}}},WPGMZA.Integration.ProGutenberg.prototype.getBlockDefinition=function(props){return WPGMZA.Integration.Gutenberg.prototype.getBlockDefinition.call(this,props)},WPGMZA.integrationModules.gutenberg=WPGMZA.Integration.Gutenberg.createInstance())}),jQuery(function($){WPGMZA.CloudAPI=function(){},WPGMZA.CloudAPI.createInstance=function(){return new WPGMZA.CloudAPI},Object.defineProperty(WPGMZA.CloudAPI,"url",{value:"https://www.wpgmaps.com/cloud/public",writable:!1}),Object.defineProperty(WPGMZA.CloudAPI,"isBeingUsed",{get:function(){return/^wpgmza[a-f0-9]+$/.test(WPGMZA.settings.wpgmza_google_maps_api_key)}}),Object.defineProperty(WPGMZA.CloudAPI,"key",{get:function(){return WPGMZA.settings.wpgmza_google_maps_api_key}});var nativeCallFunction=WPGMZA.CloudAPI.call;WPGMZA.CloudAPI.call=function(){console.warn("WPGMZA.CloudAPI.call was called statically, did you mean to call the function on WPGMZA.cloudAPI?"),nativeCallFunction.apply(this,arguments)},WPGMZA.CloudAPI.prototype.call=function(url,options){var sessionToken;(options=options||{}).data||(options.data={});var language=WPGMZA.locale.substr(0,2);options.data.sessiontoken&&(sessionToken=options.data.sessiontoken,delete options.data.sessiontoken),"he_IL"==WPGMZA.locale&&(language="iw"),options.url=WPGMZA.CloudAPI.url+url,options.beforeSend=function(xhr){xhr.setRequestHeader("X-WPGMZA-CLOUD-API-KEY",WPGMZA.CloudAPI.key),sessionToken&&xhr.setRequestHeader("X-WPGMZA-CLOUD-API-SESSION-TOKEN",sessionToken)},options.data.language=language,$.ajax(options)}}),jQuery(function($){WPGMZA.CloudAutocomplete=function(element,options){var self=this;WPGMZA.EventDispatcher.apply(this,arguments),this.element=element,this.options=options,$(this.element).wrap("<div class='wpgmza-cloud-address-input-wrapper'></div>"),this.wrapper=$(this.element).parent(),this.preloader=$(WPGMZA.loadingHTML),$(this.element).after(this.preloader),$(this.preloader).hide(),this.session={guid:null,expires:0},$(element).autocomplete({open:function(event,ui){self.onOpen(event,ui)},select:function(event,ui){self.onSelect(event,ui)},source:function(request,response){var data=(new Date).getTime();self.session.expires<data&&(self.session.guid=WPGMZA.guid()),self.session.expires=data+3e4;data={input:$(self.element).val(),sessiontoken:self.session.guid};options.country&&(data.components="country:"+options.country);data=$.extend(data,self.options);self.showPreloader(!0),WPGMZA.cloudAPI.call("/autocomplete",{data:data,success:function(data){var items=[];data.predictions.forEach(function(prediction){items.push({id:prediction.id,value:prediction.description})}),response(items),self.showPreloader(!1)}})}}),this.widget=$(element).autocomplete("widget"),this.widget.addClass("wpgmza-cloud-autocomplete")},WPGMZA.extend(WPGMZA.CloudAutocomplete,WPGMZA.EventDispatcher),WPGMZA.CloudAutocomplete.prototype.onOpen=function(event,ui){this.widget.css({width:$(this.element).outerWidth()+"px"})},WPGMZA.CloudAutocomplete.prototype.onSelect=function(event,ui){this.session.expires=0},WPGMZA.CloudAutocomplete.prototype.showPreloader=function(show){show?$(this.preloader).show():$(this.preloader).hide()}}),jQuery(function($){WPGMZA.CloudDirectionsRenderer=function(map){WPGMZA.DirectionsRenderer.apply(this,arguments),this.panel=$("#directions_panel_"+map.id)},WPGMZA.extend(WPGMZA.CloudDirectionsRenderer,WPGMZA.DirectionsRenderer),WPGMZA.CloudDirectionsRenderer.maneuverToClassName=function(maneuver){var map={"turn-slight-left":"slight-left","turn-sharp-left":"sharp-left","uturn-left":"sharp-left","turn-left":"left","turn-slight-right":"slight-right","turn-sharp-right":"sharp-right","uturn-right":"sharp-right","turn-right":"right",straight:"straight","ramp-left":"keep-left","ramp-right":"keep-right","fork-left":"keep-left","fork-right":"keep-right","roundabout-left":"enter-roundabout","roundabout-right":"enter-roundabout"};return map[maneuver]?"wpgmza-instruction-type-"+map[maneuver]:""},WPGMZA.CloudDirectionsRenderer.prototype.clear=function(){this.removeMarkers(),this.polyline&&(this.map.removePolyline(this.polyline),delete this.polyline),this.panel.html("")},WPGMZA.CloudDirectionsRenderer.prototype.setDirections=function(settings){var path,points,steps,self=this,route=settings.routes[0];this.clear(),route&&(path=[],points=[],window.polyline.decode(route.overview_polyline.points).forEach(function(arr){path.push(new google.maps.LatLng({lat:arr[0],lng:arr[1]})),points.push(new WPGMZA.LatLng({lat:arr[0],lng:arr[1]}))}),settings=this.getPolylineOptions(),this.polyline=WPGMZA.Polyline.createInstance({settings:settings}),this.polyline.googlePolyline.setOptions({path:path}),this.map.addPolyline(this.polyline),this.addMarkers(points),steps=[],route.legs&&route.legs.forEach(function(leg){steps=steps.concat(leg.steps)}),steps.forEach(function(step){var div=$("<div class='wpgmza-directions-step'></div>");div[0].wpgmzaDirectionsStep=step,div.html(step.html_instructions),div.addClass(WPGMZA.CloudDirectionsRenderer.maneuverToClassName(step.maneuver)),self.panel.append(div)}))}}),jQuery(function($){WPGMZA.CloudDirectionsService=function(map){WPGMZA.DirectionsService.apply(this,arguments)},WPGMZA.extend(WPGMZA.CloudDirectionsService,WPGMZA.DirectionsService),WPGMZA.CloudDirectionsService.prototype.route=function(request,callback){WPGMZA.cloudAPI.call("/directions",{data:request,success:function(response,status,xhr){for(var key in request)response[key]=request[key];callback(response)}})}}),jQuery(function($){WPGMZA.CloudGeocoder=function(){},WPGMZA.CloudGeocoder.SUCCESS="success",WPGMZA.CloudGeocoder.prototype.geocode=function(options,callback){WPGMZA.cloudAPI.call("/geocode",{data:options,success:function(results,status){results?(results.forEach(function(result){result.geometry.location=new google.maps.LatLng(result.geometry.location.lat,result.geometry.location.lng)}),0==results.length&&(status=WPGMZA.Geocoder.ZERO_RESULTS),callback(results,status)):callback(results,WPGMZA.GeocoderStatus.FAIL)}})}}),jQuery(function($){WPGMZA.GoogleDirectionsRenderer=function(map){WPGMZA.DirectionsRenderer.apply(this,arguments),this.map=map,this.googleDirectionsDisplay=new google.maps.DirectionsRenderer({map:map.googleMap,preserveViewport:!0,draggable:!0,suppressMarkers:!0}),this.googleDirectionsDisplay.setPanel($("#directions_panel_"+map.id)[0])},WPGMZA.extend(WPGMZA.GoogleDirectionsRenderer,WPGMZA.DirectionsRenderer),WPGMZA.GoogleDirectionsRenderer.prototype.setDirections=function(options){this.googleDirectionsDisplay.setDirections(options.originalResponse),options.routes&&options.routes[0]&&options.routes[0].legs&&options.routes[0].legs[0]&&(this.directionLeg=options.routes[0].legs[0],this.directionStartMarker=WPGMZA.Marker.createInstance({position:new WPGMZA.LatLng(this.directionLeg.start_location.lat(),this.directionLeg.start_location.lng()),icon:this.map.settings.directions_route_origin_icon||"",retina:this.map.settings.directions_origin_retina,disableInfoWindow:!0}),this.directionStartMarker._icon.retina=this.directionStartMarker.retina,this.map.addMarker(this.directionStartMarker),this.directionEndMarker=WPGMZA.Marker.createInstance({position:new WPGMZA.LatLng(this.directionLeg.end_location.lat(),this.directionLeg.end_location.lng()),icon:this.map.settings.directions_route_destination_icon||"",retina:this.map.settings.directions_destination_retina,disableInfoWindow:!0}),this.directionEndMarker._icon.retina=this.directionEndMarker.retina,this.map.addMarker(this.directionEndMarker));options={polylineOptions:{strokeColor:"#4285F4"}};this.map.settings.directions_route_stroke_color&&(options.polylineOptions.strokeColor=this.map.settings.directions_route_stroke_color),this.map.settings.directions_route_stroke_weight&&(options.polylineOptions.strokeWeight=parseFloat(this.map.settings.directions_route_stroke_weight)),this.map.settings.directions_route_stroke_opacity&&(options.polylineOptions.strokeOpacity=parseFloat(this.map.settings.directions_route_stroke_opacity)),this.googleDirectionsDisplay.setMap(this.map.googleMap),this.googleDirectionsDisplay.setOptions(options),this.map.settings.directions_fit_bounds_to_route&&this.directionStartMarker&&this.directionEndMarker&&this.fitBoundsToRoute(this.directionStartMarker.getPosition(),this.directionEndMarker.getPosition())},WPGMZA.GoogleDirectionsRenderer.prototype.clear=function(){this.googleDirectionsDisplay.setMap(null),this.directionStartMarker&&this.map.removeMarker(this.directionStartMarker),this.directionEndMarker&&this.map.removeMarker(this.directionEndMarker)}}),jQuery(function($){WPGMZA.GoogleDirectionsService=function(map){WPGMZA.DirectionsService.apply(this,arguments),WPGMZA.CloudAPI.isBeingUsed?this.googleDirectionsService=new WPGMZA.CloudDirectionsService:this.googleDirectionsService=new google.maps.DirectionsService},WPGMZA.extend(WPGMZA.GoogleDirectionsService,WPGMZA.DirectionsService),WPGMZA.GoogleDirectionsService.prototype.route=function(request,callback){var self=this;request.travelMode=request.travelMode.toUpperCase(),request.unitSystem===WPGMZA.Distance.KILOMETERS?request.unitSystem=google.maps.UnitSystem.METRIC:request.unitSystem=google.maps.UnitSystem.IMPERIAL,this.googleDirectionsService.route(request,function(response){var status;switch(response.originalResponse=$.extend({},response),response.status){case google.maps.DirectionsStatus.OK:status=WPGMZA.DirectionsService.SUCCESS;break;case google.maps.DirectionsStatus.ZERO_RESULTS:status=WPGMZA.DirectionsService.ZERO_RESULTS;break;case google.maps.DirectionsStatus.NOT_FOUND:status=WPGMZA.DirectionsService.NOT_FOUND;break;default:return void console.warn("Failed to get directions from Google: "+response.status)}callback(response,status);var event=new WPGMZA.Event({type:"directionsserviceresult",response:response,status:status});self.map.trigger(event)})}}),jQuery(function($){WPGMZA.GoogleHeatmap=function(options){WPGMZA.Heatmap.call(this,options),google.maps.visualization?(this.googleHeatmap=new google.maps.visualization.HeatmapLayer,this.googleFeature=this.googleHeatmap,this.updateGoogleHeatmap()):console.warn("Heatmaps disabled. You must include the visualization library in the Google Maps API")},WPGMZA.GoogleHeatmap.prototype=Object.create(WPGMZA.Heatmap.prototype),WPGMZA.GoogleHeatmap.prototype.constructor=WPGMZA.GoogleHeatmap,WPGMZA.GoogleHeatmap.prototype.updateGoogleHeatmap=function(){for(var points=this.parseGeometry(this.dataset),len=points.length,data=[],i=0;i<len;i++)data.push(new google.maps.LatLng(parseFloat(points[i].lat),parseFloat(points[i].lng)));this.googleHeatmap.setData(data),this.gradient&&this.googleHeatmap.set("gradient",this.gradient),this.radius&&this.googleHeatmap.set("radius",parseFloat(this.radius)),this.heatmap_radius&&this.googleHeatmap.set("radius",parseFloat(this.heatmap_radius)),this.opacity&&this.googleHeatmap.set("opacity",parseFloat(this.opacity)),this.heatmap_opacity&&this.googleHeatmap.set("opacity",parseFloat(this.heatmap_opacity)),this.map&&!this.googleHeatmap.getMap()&&this.googleHeatmap.setMap(this.map.googleMap)},WPGMZA.GoogleHeatmap.prototype.update=function(){this.updateGoogleHeatmap()},WPGMZA.GoogleHeatmap.prototype.updateDatasetFromMarkers=function(){WPGMZA.Heatmap.prototype.updateDatasetFromMarkers.apply(this,arguments),this.updateGoogleHeatmap()},WPGMZA.GoogleHeatmap.prototype.onMapMouseDown=function(event){2==event.button&&this.map.googleMap.setOptions({draggable:!1}),WPGMZA.Heatmap.prototype.onMapMouseDown.apply(this,arguments)},WPGMZA.GoogleHeatmap.prototype.onWindowMouseUp=function(event){2==event.button&&this.map.googleMap.setOptions({draggable:!0}),WPGMZA.Heatmap.prototype.onWindowMouseUp.apply(this,arguments)}}),jQuery(function($){WPGMZA.GoogleProDrawingManager=function(map){WPGMZA.ProDrawingManager.apply(this,arguments)},WPGMZA.extend(WPGMZA.GoogleProDrawingManager,WPGMZA.ProDrawingManager)}),jQuery(function($){WPGMZA.GoogleProInfoWindow=function(feature){WPGMZA.GoogleInfoWindow.call(this,feature)},WPGMZA.GoogleProInfoWindow.prototype=Object.create(WPGMZA.GoogleInfoWindow.prototype),WPGMZA.GoogleProInfoWindow.prototype.constructor=WPGMZA.GoogleProInfoWindow,WPGMZA.GoogleProInfoWindow.prototype.open=function(map,feature){switch(this.feature=feature,"map-edit"==WPGMZA.currentPage?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:this.style){case WPGMZA.ProInfoWindow.STYLE_MODERN:case WPGMZA.ProInfoWindow.STYLE_MODERN_PLUS:case WPGMZA.ProInfoWindow.STYLE_MODERN_CIRCULAR:case WPGMZA.ProInfoWindow.STYLE_TEMPLATE:return WPGMZA.ProInfoWindow.prototype.open.call(this,map,feature);default:var result=WPGMZA.GoogleInfoWindow.prototype.open.call(this,map,feature);return this.maxWidth&&this.googleInfoWindow&&this.googleInfoWindow.setOptions({maxWidth:this.maxWidth}),result}},WPGMZA.GoogleProInfoWindow.prototype.setPosition=function(position){this.googleInfoWindow&&this.googleInfoWindow.setPosition(position.toGoogleLatLng())}}),jQuery(function($){WPGMZA.GoogleProMap=function(element,options){WPGMZA.GoogleMap.call(this,element,options),this.loadKMLLayers(),this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded")},WPGMZA.GoogleProMap.prototype=Object.create(WPGMZA.GoogleMap.prototype),WPGMZA.GoogleProMap.prototype.constructor=WPGMZA.GoogleProMap.prototype,WPGMZA.GoogleProMap.prototype.addHeatmap=function(heatmap){heatmap.googleHeatmap.setMap(this.googleMap),WPGMZA.ProMap.prototype.addHeatmap.call(this,heatmap)},WPGMZA.GoogleProMap.prototype.loadKMLLayers=function(){if(this.kmlLayers)for(var i=0;i<this.kmlLayers.length;i++)this.kmlLayers[i].setMap(null);if(this.kmlLayers=[],this.settings.kml)for(var urls=this.settings.kml.split(","),cachebuster=(new Date).getTime(),i=0;i<urls.length;i++)this.kmlLayers.push(new google.maps.KmlLayer(urls[i]+"?cachebuster="+cachebuster,{map:this.googleMap,preserveViewport:!0}))},WPGMZA.GoogleProMap.prototype.loadFusionTableLayer=function(){this.settings.fusion&&(console.warn("Fusion Table Layers are deprecated and will cease functioning from 2019/12/03"),this.fusionLayer=new google.maps.FusionTablesLayer(this.settings.fusion,{map:this.googleMap,surpressInfoWindows:!0}))},WPGMZA.GoogleProMap.prototype.setStreetView=function(options){var latLng=this.getCenter();"marker"in(options=options||{bearing:0,pitch:10})&&(marker=this.getMarkerByID(options.marker))?latLng=marker.getPosition().toLatLngLiteral():"lat"in options&&"lng"in options&&(latLng={lat:parseFloat(options.lat),lng:parseFloat(options.lng)}),"bearing"in options&&(options.bearing=parseInt(options.bearing),isNaN(options.bearing)&&console.warn("Invalid bearing")),"pitch"in options&&(options.pitch=parseInt(options.pitch),isNaN(options.pitch)&&console.warn("Invalid pitch")),this.panorama=new google.maps.StreetViewPanorama(this.element,{position:latLng,pov:{heading:parseInt(options.bearing),pitch:parseInt(options.pitch)}})},WPGMZA.GoogleProMap.prototype.onInit=function(event){WPGMZA.GoogleMap.prototype.onInit.call(this,event),this.shortcodeAttributes.streetview&&!this.shortcodeAttributes.marker&&this.setStreetView(this.shortcodeAttributes)},WPGMZA.GoogleProMap.prototype.onMarkersPlaced=function(event){WPGMZA.GoogleMap.prototype.onMarkersPlaced.call(this,event),this.shortcodeAttributes.streetview&&this.shortcodeAttributes.marker&&this.setStreetView(this.shortcodeAttributes)}}),jQuery(function($){WPGMZA.GoogleProMarker=function(row){WPGMZA.GoogleMarker.call(this,row)},WPGMZA.GoogleProMarker.prototype=Object.create(WPGMZA.GoogleMarker.prototype),WPGMZA.GoogleProMarker.prototype.constructor=WPGMZA.GoogleProMarker,WPGMZA.GoogleProMarker.prototype.onAdded=function(event){WPGMZA.GoogleMarker.prototype.onAdded.apply(this,arguments),this.map.settings.wpgmza_settings_disable_infowindows&&this.googleMarker.setOptions({clickable:!1})},WPGMZA.GoogleProMarker.prototype.updateIcon=function(){var img,self=this,icon=this._icon;icon.retina?((img=new Image).onload=function(event){var size=new google.maps.Size(WPGMZA.settings.retinaWidth?parseInt(WPGMZA.settings.retinaWidth):Math.round(img.width/2),WPGMZA.settings.retinaHeight?parseInt(WPGMZA.settings.retinaHeight):Math.round(img.height/2));self.googleMarker.setIcon(new google.maps.MarkerImage(icon.url,null,null,null,size))},img.src=icon.isDefault?WPGMZA.defaultMarkerIcon:icon.url):this.googleMarker.setIcon(icon.url)}}),jQuery(function($){WPGMZA.GoogleProPolygon=function(row,googlePolygon){var self=this;WPGMZA.GooglePolygon.call(this,row,googlePolygon),google.maps.event.addListener(this.googlePolygon,"mouseover",function(event){self.trigger("mouseover")}),google.maps.event.addListener(this.googlePolygon,"mouseout",function(event){self.trigger("mouseout")})},WPGMZA.GoogleProPolygon.prototype=Object.create(WPGMZA.GooglePolygon.prototype),WPGMZA.GoogleProPolygon.prototype.constructor=WPGMZA.GoogleProPolygon}),jQuery(function($){WPGMZA.HeatmapPanel=function(element,mapEditPage){WPGMZA.FeaturePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.HeatmapPanel,WPGMZA.FeaturePanel),WPGMZA.HeatmapPanel.createInstance=function(element,mapEditPage){return new WPGMZA.HeatmapPanel(element,mapEditPage)},WPGMZA.HeatmapPanel.prototype.reset=function(event){WPGMZA.FeaturePanel.prototype.reset.apply(this,arguments),$(this.element).find("[data-ajax-name='gradient']").prop("checked",!1),$($(this.element).find("[data-ajax-name='gradient']")[0]).prop("checked",!0)},WPGMZA.HeatmapPanel.prototype.populate=function(data){var str;WPGMZA.FeaturePanel.prototype.populate.apply(this,arguments),data.gradient&&(str=JSON.stringify(JSON.parse(data.gradient)),$(this.element).find("input[data-ajax-name='gradient']").each(function(index,el){var compare=JSON.stringify(JSON.parse($(el).val()));if(str==compare)return $(el).prop("checked",!0),!1}))},WPGMZA.HeatmapPanel.prototype.onPropertyChanged=function(value){var name;this.drawingManager.mode==WPGMZA.DrawingManager.MODE_HEATMAP?this.drawingManager.onHeatmapPropertyChanged(value):this.feature&&(name=$(value.target).attr("data-ajax-name"),value=$(value.target).val(),"gradient"===name&&(value=JSON.parse(value)),this.feature[name]=value,this.feature.update())},WPGMZA.HeatmapPanel.prototype.onFeatureChanged=function(event){var geometryField=$(this.element).find("[data-ajax-name='dataset']");geometryField.length&&geometryField.val(JSON.stringify(this.feature.getGeometry()))}}),jQuery(function($){WPGMZA.ProCirclePanel=function(element){WPGMZA.CirclePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProCirclePanel,WPGMZA.CirclePanel)}),jQuery(function($){WPGMZA.ProMarkerPanel=function(element){WPGMZA.MarkerPanel.apply(this,arguments),this.initMarkerIconPicker(),this.initMarkerGalleryInput(),this.initCategoryPicker()},WPGMZA.extend(WPGMZA.ProMarkerPanel,WPGMZA.MarkerPanel),WPGMZA.ProMarkerPanel.prototype.initMarkerIconPicker=function(){this.markerIconPicker=new WPGMZA.MarkerIconPicker($(this.element).find(".wpgmza-marker-icon-picker"))},WPGMZA.ProMarkerPanel.prototype.initMarkerGalleryInput=function(){this.markerGalleryInput=new WPGMZA.MarkerGalleryInput($(this.element).find("input[data-ajax-name='gallery']"))},WPGMZA.ProMarkerPanel.prototype.initCategoryPicker=function(){this.categoryPicker=new WPGMZA.CategoryPicker($(this.element).find(".wpgmza-category-picker"))},WPGMZA.ProMarkerPanel.prototype.focusMapOnFeature=function(marker){this.map.panTo(marker.getPosition())},WPGMZA.ProMarkerPanel.prototype.reset=function(){WPGMZA.MarkerPanel.prototype.reset.apply(this,arguments),this.categoryPicker.setSelection(null),this.markerGalleryInput.clear(),this.markerIconPicker.reset()},WPGMZA.ProMarkerPanel.prototype.initDefaults=function(){var self=this,args=arguments;$(this.element).find(".wpgmza-category-picker").on("loaded.jstree",function(){WPGMZA.MarkerPanel.prototype.initDefaults.apply(self,args)})},WPGMZA.ProMarkerPanel.prototype.populate=function(data){for(var name in WPGMZA.FeaturePanel.prototype.populate.apply(this,arguments),data)switch(name){case"description":var tinyMCEInstance,tinyMCEModeToggled;tinyMCE.get("wpgmza-description-editor")?(tinyMCEModeToggled=!1,(tinyMCEInstance=tinyMCE.get("wpgmza-description-editor")).isHidden()&&(tinyMCEInstance.show(),tinyMCEModeToggled=!0),tinyMCEInstance.setContent(data.description),tinyMCEModeToggled&&tinyMCEInstance.hide()):$("#wpgmza-description-editor").val(data.description);break;case"icon":this.markerIconPicker.setIcon(data.icon);break;case"categories":this.categoryPicker.setSelection(data.categories);break;case"gallery":data.gallery&&this.markerGalleryInput.populate(data.gallery);break;case"custom_field_data":data.custom_field_data.forEach(function(field){$("fieldset[data-custom-field-id='"+field.id+"'] input[data-ajax-name]").val(field.value)})}!data.pic||!data.pic.length||data.gallery&&data.gallery.length||this.markerGalleryInput.addPicture({url:data.pic})},WPGMZA.ProMarkerPanel.prototype.serializeFormData=function(){var data=WPGMZA.MarkerPanel.prototype.serializeFormData.apply(this,arguments);return 0<$("#wpgmza-description-editor-tmce").length&&$("#wpgmza-description-editor-tmce").click(),tinyMCE.get("wpgmza-description-editor")?data.description=tinyMCE.get("wpgmza-description-editor").getContent():data.description=$("#wpgmza-description-editor").val(),data.gallery=this.markerGalleryInput.toJSON(),data},WPGMZA.ProMarkerPanel.prototype.onSave=function(event){var addressUnchanged,self=this,address=$(this.element).find("[data-ajax-name='address']").val();0!=address.length?(this.showPreloader(!0),addressUnchanged=!1,this.feature&&this.feature.address&&address&&"string"==typeof this.feature.address&&"string"==typeof address&&this.feature.address.trim()===address.trim()&&(addressUnchanged=!0),this.adjustSubMode||addressUnchanged?WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments):WPGMZA.Geocoder.createInstance().geocode({address:address},function(results,status){switch(status){case WPGMZA.Geocoder.SUCCESS:var latLng=results[0].latLng;$(self.element).find("[data-ajax-name='lat']").val(latLng.lat),$(self.element).find("[data-ajax-name='lng']").val(latLng.lng),WPGMZA.FeaturePanel.prototype.onSave.apply(self,arguments);break;case WPGMZA.Geocoder.ZERO_RESULTS:alert(WPGMZA.localized_strings.zero_results);break;default:alert(WPGMZA.localized_strings.geocode_fail)}})):alert(WPGMZA.localized_strings.no_address_specified)}}),jQuery(function($){WPGMZA.ProPolygonPanel=function(element){WPGMZA.PolygonPanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProPolygonPanel,WPGMZA.PolygonPanel)}),jQuery(function($){WPGMZA.ProPolylinePanel=function(element){WPGMZA.PolylinePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProPolylinePanel,WPGMZA.PolylinePanel)}),jQuery(function($){WPGMZA.ProRectanglePanel=function(element){WPGMZA.RectanglePanel.apply(this,arguments)},WPGMZA.extend(WPGMZA.ProRectanglePanel,WPGMZA.RectanglePanel)}),jQuery(function($){WPGMZA.AdvancedTableDataTable=function(element,listing){var self=this;this.element=element,this.listing=listing,WPGMZA.DataTable.apply(this,arguments),this.overrideListingOrderSettings=!1,$(this.dataTableElement).on("click","th",function(event){self.onUserChangedOrder(event)})},WPGMZA.AdvancedTableDataTable.prototype=Object.create(WPGMZA.DataTable.prototype),WPGMZA.AdvancedTableDataTable.prototype.constructor=WPGMZA.AdvancedTableDataTable,WPGMZA.AdvancedTableDataTable.prototype.getDataTableSettings=function(){var self=this,options=WPGMZA.DataTable.prototype.getDataTableSettings.apply(this,arguments);(languageURL=$(this.element).attr("data-order-json"))&&(options.order=JSON.parse(languageURL)),options.drawCallback=function(settings){var ths=$(self.element).find(".wpgmza_table > thead th");self.lastResponse&&self.lastResponse.meta&&(0!=self.lastResponse.meta.length&&($(self.element).find(".wpgmza_table > tbody > tr").each(function(meta,tr){meta=self.lastResponse.meta[meta];$(tr).addClass("wpgmaps_mlist_row"),$(tr).attr("mid",meta.id),$(tr).attr("mapid",self.map.id),$(tr).children("td").each(function(wpgmza_class,td){wpgmza_class=ths[wpgmza_class].className.match(/wpgmza_\w+/)[0];$(td).addClass(wpgmza_class)})}),$(self.element).find("[data-marker-icon-src]").each(function(index,el){var data,src=$(el).attr("data-marker-icon-src");try{data=JSON.parse(src)}catch(e){data=src}WPGMZA.MarkerIcon.createInstance(data).applyToElement(el)})),self.map.markerListing.trigger("markerlistingupdated"))},options.language={};var search_string,start,string_of,string_to,total,show,entries,languageURL=this.getLanguageURL();switch(languageURL&&(options.language={url:languageURL}),""!=this.listing.map.settings.datatable_no_result_message&&(search_string=this.listing.map.settings.datatable_no_result_message,options.language.zeroRecords=search_string),1==this.listing.map.settings.remove_search_box_datables&&(options.searching=!1),this.listing.map.settings.dataTable_pagination_style){case"page-number-buttons-only":options.pagingType="numbers";break;case"prev-and-next-buttons-only":options.pagingType="simple";break;case"prev-and-next-buttons-plus-page-numbers":options.pagingType="simple_numbers";break;case"first-prev-next-and-last-buttons":options.pagingType="full";break;case"first-prev-next-and-last-buttons-plus-page-numbers":options.pagingType="full_numbers";break;case"first-and-last-buttons-plus-page-numbers":options.pagingType="fist_last_numbers"}return""!=this.listing.map.settings.datatable_search_string&&(search_string=this.listing.map.settings.datatable_search_string,options.language.search=search_string),this.listing.map.settings.datatable_result&&(""!=this.listing.map.settings.datatable_result_start&&(start=this.listing.map.settings.datatable_result_start),""!=this.listing.map.settings.datatable_result_of&&(string_of=this.listing.map.settings.datatable_result_of),""!=this.listing.map.settings.datatable_result_to&&(string_to=this.listing.map.settings.datatable_result_to),""!=this.listing.map.settings.datatable_result_total&&(total=this.listing.map.settings.datatable_result_total),options.language.sInfo=start+" _START_ "+string_of+" _END_ "+string_to+" _TOTAL_ "+total),this.listing.map.settings.datatable_result_page&&(""!=this.listing.map.settings.datatable_result_show&&(show=this.listing.map.settings.datatable_result_show),""!=this.listing.map.settings.datatable_result_to&&(entries=this.listing.map.settings.datatable_result_entries),options.language.sLengthMenu=show+" _MENU_ "+entries),options},WPGMZA.AdvancedTableDataTable.prototype.onAJAXRequest=function(data,settings){var request=this.listing.getAJAXRequestParameters().data,listingFilteringParams=request.filteringParams;request.overrideMarkerIDs;return delete request.filteringParams,delete request.overrideMarkerIDs,(request=$.extend({},request,WPGMZA.DataTable.prototype.onAJAXRequest.apply(this,arguments))).filteringParams=$.extend({},listingFilteringParams,this.filteringParams),this.filteredMarkerIDs&&(request.markerIDs=this.filteredMarkerIDs.join(",")),void 0!==this.overrideListingOrderSettings&&(request.overrideListingOrderSettings=this.overrideListingOrderSettings),request},WPGMZA.AdvancedTableDataTable.prototype.getLanguageURL=function(){return WPGMZA.DataTable.prototype.getLanguageURL.apply(this,arguments)},WPGMZA.AdvancedTableDataTable.prototype.onMarkerFilterFilteringComplete=function(event){var self=this;this.filteredMarkerIDs=[],event.filteredMarkers.forEach(function(data){self.filteredMarkerIDs.push(data.id)}),self.filteringParams=event.filteringParams},WPGMZA.AdvancedTableDataTable.prototype.onUserChangedOrder=function(event){this.overrideListingOrderSettings=!0}}),jQuery(function($){WPGMZA.MarkerListing=function(map,element,options){var self=this;if(WPGMZA.EventDispatcher.apply(this),this._paginationEnabled=!0,this.map=this.parent=map,this.element=element,this.element?this.element.wpgmzaMarkerListing=this:WPGMZA.isDeveloperMode()&&console.warn("Marker listing initialised with null element. This is presently supported to allow the marker listing category filter to still function, however this will be removed in the future."),options)for(var key in options)this[key]=options[key];this.categoryDropdown=$(".wpgmza-marker-listing-category-filter[data-map-id='"+this.map.id+"'] select"),$(this.categoryDropdown).closest(".wpgmza-store-locator").length||this.categoryDropdown.on("change",function(event){WPGMZA.getMapByID(self.map.id).markerFilter.update()}),this.categoryCheckboxes=$(".wpgmza-marker-listing-category-filter[data-map-id='"+this.map.id+"'] input[type='checkbox']"),this.categoryCheckboxes.on("change",function(event){WPGMZA.getMapByID(self.map.id).markerFilter.update()}),1==map.settings.wpgmza_store_locator_hide_before_search&&(this.showOnFilteringComplete=!0,$(this.element).hide()),void 0!==map.settings.push_in_map&&void 0===map.settings.wpgmza_push_in_map&&(map.settings.wpgmza_push_in_map=map.settings.push_in_map,map.settings.wpgmza_push_in_map_placement=map.settings.push_in_map_placement),map.settings.wpgmza_push_in_map&&this.pushIntoMap(),$(this.element).on("click",".wpgmaps_mlist_row, .wpgmaps_blist_row",function(event){self.onItemClick(event)}),$(document.body).on("filteringcomplete.wpgmza",function(event){event.map.id==self.map.id&&self.onFilteringComplete(event)}),this.reload()},WPGMZA.extend(WPGMZA.MarkerListing,WPGMZA.EventDispatcher),WPGMZA.MarkerListing.createInstance=function(map,element,options){switch(void 0!==map.settings.list_markers_by&&void 0===map.settings.wpgmza_listmarkers_by&&(map.settings.wpgmza_listmarkers_by=parseInt(map.settings.list_markers_by)),map.settings.wpgmza_listmarkers_by){case WPGMZA.MarkerListing.STYLE_ADVANCED_TABLE:return new WPGMZA.AdvancedTableMarkerListing(map,element,options);case WPGMZA.MarkerListing.STYLE_CAROUSEL:return new WPGMZA.CarouselMarkerListing(map,element,options);case WPGMZA.MarkerListing.STYLE_MODERN:return new WPGMZA.ModernMarkerListing(map,element,options);default:return new WPGMZA.MarkerListing(map,element,options)}},WPGMZA.MarkerListing.STYLE_NONE=0,WPGMZA.MarkerListing.STYLE_BASIC_TABLE=1,WPGMZA.MarkerListing.STYLE_BASIC_LIST=4,WPGMZA.MarkerListing.STYLE_ADVANCED_TABLE=2,WPGMZA.MarkerListing.STYLE_CAROUSEL=3,WPGMZA.MarkerListing.STYLE_MODERN=6,WPGMZA.MarkerListing.ORDER_BY_ID=1,WPGMZA.MarkerListing.ORDER_BY_TITLE=2,WPGMZA.MarkerListing.ORDER_BY_ADDRESS=3,WPGMZA.MarkerListing.ORDER_BY_DESCRIPTION=4,WPGMZA.MarkerListing.ORDER_BY_CATEGORY=5,WPGMZA.MarkerListing.ORDER_BY_CATEGORY_PRIORITY=6,WPGMZA.MarkerListing.ORDER_BY_DISTANCE=7,WPGMZA.MarkerListing.ORDER_BY_RATING=8,Object.defineProperty(WPGMZA.MarkerListing.prototype,"mapID",{get:function(){return this.map.id}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"paginationEnabled",{get:function(){return this._paginationEnabled},set:function(value){this._paginationEnabled=!!value}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"pageSize",{get:function(){if(!WPGMZA.settings.wpgmza_default_items)return 10;var pageSize=parseInt(WPGMZA.settings.wpgmza_default_items);return isNaN(pageSize)?null:pageSize},set:function(value){this.pagination("pageSize",value)}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"currentPage",{get:function(){if(!this.paginationElement)return 0;try{return $(this.paginationElement).pagination("getSelectedPageNum")-1}catch(e){return 0}},set:function(value){throw new Error("Not yet implemented")}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"imageWidth",{get:function(){var width=WPGMZA.settings.wpgmza_settings_image_width;return!(!width||!/^\d+$/.test(width))&&width}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"imageHeight",{get:function(){var height=WPGMZA.settings.wpgmza_settings_image_height;return!(!height||!/^\d+$/.test(height))&&height}}),Object.defineProperty(WPGMZA.MarkerListing.prototype,"style",{get:function(){return this.map.settings.list_markers_by}}),WPGMZA.MarkerListing.prototype.initPagination=function(){if(this.paginationElement){try{$(this.paginationElement).pagination("destroy")}catch(e){}$(this.paginationElement).remove()}var position;this.paginationEnabled&&!this.showOnFilteringComplete&&this.pageSize&&(position=this.getPaginationOptions(),this.lastAJAXResponse.recordsFiltered<=position.pageSize||(this.paginationElement=$("<div class='wpgmza-pagination'/>"),this.pagination=$(this.paginationElement).pagination(this.getPaginationOptions()),$(this.element).after(this.paginationElement),this.map.settings.wpgmza_push_in_map&&this.paginationElement&&"google-maps"===WPGMZA.settings.engine&&($(this.paginationElement).css({zIndex:"999"}),position=parseInt(this.map.settings.wpgmza_push_in_map_placement),this.paginationElement.style?this.map.googleMap.controls[position].push(this.paginationElement):this.paginationElement[0]&&this.map.googleMap.controls[position].push(this.paginationElement[0]))))},WPGMZA.MarkerListing.prototype.getPaginationOptions=function(){var self=this,options={triggerPagingOnInit:!1,pageSize:this.pageSize,dataSource:function(done){done(self.getPaginationDataSource())},callback:function(data,pagination){self.pageOnPaginationReinit=$(self.paginationElement).pagination("getSelectedPageNum"),$(self.paginationElement).pagination("disable"),self.reload()}};return this.pageOnPaginationReinit&&(options.pageNumber=this.pageOnPaginationReinit),options},WPGMZA.MarkerListing.prototype.getPaginationDataSource=function(){var source=[];if(!this.lastAJAXResponse)return source;for(var i=0;i<this.lastAJAXResponse.recordsFiltered;i++)source.push(i);return source},WPGMZA.MarkerListing.prototype.getAJAXRequestParameters=function(params){var self=this;(params=params||{}).data||(params.data={}),params.method="POST",params.useCompressedPathVariable=!0,params.cache=!0;var location=$(this.element).attr("data-wpgmza-ajax-parameters");if(!location||!location.length)throw new Error("No AJAX parameters specified on Marker Listing attribute");location=JSON.parse(location);return $.extend(params.data,{phpClass:$(this.element).attr("data-wpgmza-php-class"),start:this.currentPage*this.pageSize,length:this.pageSize},location),this.overrideMarkerIDs&&(params.data.overrideMarkerIDs=this.overrideMarkerIDs.join(",")),this.lastFilteringParams&&(params.data.filteringParams=this.lastFilteringParams),this.map.showDistanceFromLocation&&(params.data.filteringParams||(params.data.filteringParams={}),location=this.map.showDistanceFromLocation,params.data.filteringParams.center={lat:location.lat,lng:location.lng,source:location.source}),params.success=function(response,textStatus,xhr){self.onAJAXResponse(response,textStatus,xhr)},params},WPGMZA.MarkerListing.prototype.onAJAXResponse=function(response,textStatus,xhr){this.map.showPreloader(!1),this.lastAJAXResponse=response,this.onHTMLResponse(response.html),this.initPagination(),void 0!==this.map.settings.directions_enabled&&0==parseInt(this.map.settings.directions_enabled)&&$(".wpgmza_marker_directions_link").remove(),this.trigger("markerlistingupdated")},WPGMZA.MarkerListing.prototype.onHTMLResponse=function(html){var self=this;$(this.element).html(html),$(this.element).find(".wpgmza-gallery-container").each(function(index,el){var map=self.map,gallery=$(el).closest("[data-marker-id]").attr("data-marker-id"),gallery=map.getMarkerByID(gallery);gallery.gallery&&(gallery=new WPGMZA.MarkerGallery(gallery,self),$(el).html(""),$(el).append(gallery.element))}),$(this.element).find("[data-marker-icon-src]").each(function(index,el){var data,src=$(el).attr("data-marker-icon-src");try{data=JSON.parse(src)}catch(e){data=src}WPGMZA.MarkerIcon.createInstance(data).applyToElement(el)})},WPGMZA.MarkerListing.prototype.getImageElementFromURL=function(url){var img=$("<img class='wpgmza_map_image'/>");return $(img).attr("src",url),this.imageWidth&&$(img).css({width:this.imageWidth+"px"}),this.imageHeight&&$(img).css({height:this.imageHeight+"px"}),img},WPGMZA.MarkerListing.prototype.getRatingWidget=function(marker){var options={type:"marker",id:marker.id};return marker.rating&&(options.averageRating=marker.rating.average,options.numRatings=marker.rating.count),WPGMZA.RatingWidget.createInstance(options)},WPGMZA.MarkerListing.prototype.reload=function(){var route,params;this.element&&(this.prevXHRRequest&&this.prevXHRRequest.abort(),route=$(this.element).attr("data-wpgmza-rest-api-route"),params=this.getAJAXRequestParameters(),this.map.showPreloader(!0),this.prevXHRRequest=WPGMZA.restAPI.call(route,params))},WPGMZA.MarkerListing.prototype.enable=function(value){value?this.pagination("enable"):this.pagination("disable")},WPGMZA.MarkerListing.prototype.getFilteringParameters=function(){var params={};return this.categoryDropdown.length&&"0"!=this.categoryDropdown.val()&&(params.categories=[this.categoryDropdown.val()]),this.categoryCheckboxes.length&&(params.categories=[],this.categoryCheckboxes.each(function(index,el){$(el).prop("checked")&¶ms.categories.push($(el).val())})),params},WPGMZA.MarkerListing.prototype.pushIntoMap=function(){var setting,width="30%",position="50%";return!!this.element&&("open-layers"==WPGMZA.settings.engine?(console.warn("Push into map is not yet supported when using OpenLayers engine"),!1):this.map.settings.list_markers_by==WPGMZA.MarkerListing.STYLE_MODERN?(console.warn("Push into map is not available with modern style marker listing"),!1):((setting=this.map.settings.wpgmza_push_in_map_width)&&setting.length&&(width=setting),(setting=this.map.settings.wpgmza_push_in_map_height)&&setting.length&&(position=setting),$(this.element).css({margin:"15px",overflow:"auto",zIndex:"999",width:width,height:position}),$(this.element).addClass("wpgmza-shadow-sm wpgmza_innermap_holder"),"open-layers"===WPGMZA.settings.engine||(position=parseInt(this.map.settings.wpgmza_push_in_map_placement),this.element.style?this.map.googleMap.controls[position].push(this.element):this.element[0]&&this.map.googleMap.controls[position].push(this.element[0])),!0))},WPGMZA.MarkerListing.prototype.onFilteringComplete=function(event){var self=this;this.showOnFilteringComplete&&($(this.element).show(),delete this.showOnFilteringComplete),this.overrideMarkerIDs=[],event.filteredMarkers.forEach(function(data){self.overrideMarkerIDs.push(data.id)}),this.lastFilteringParams=event.filteringParams,this.pageOnPaginationReinit=1,this.reload()},WPGMZA.MarkerListing.prototype.onItemClick=function(zoomLevelOnClick){var clickedGetDirections=$(zoomLevelOnClick.currentTarget).attr("mid"),marker=this.map.getMarkerByID(clickedGetDirections),offset=WPGMZA.maps[0].settings.push_in_map&&WPGMZA.maps[0].settings.push_in_map.length,clickedGetDirections=$(zoomLevelOnClick.target).hasClass("wpgmza_gd"),zoomLevelOnClick=13;marker.trigger("select"),this.style==WPGMZA.MarkerListing.STYLE_MODERN||WPGMZA.settings.disable_scroll_on_marker_listing_click||clickedGetDirections||offset||(offset=0,WPGMZA.settings.marker_listing_item_click_scroll_offset&&(offset=parseInt(WPGMZA.settings.marker_listing_item_click_scroll_offset)),this.map.settings.wpgmza_push_in_map||$("html, body").animate({scrollTop:$(this.map.element).offset().top-offset},500)),this.map.settings.zoom_level_on_marker_listing_override&&this.map.settings.zoom_level_on_marker_listing_click?zoomLevelOnClick=this.map.settings.zoom_level_on_marker_listing_click:this.map.settings.mass_marker_support&&WPGMZA.settings.clusterAdvancedEnabled&&WPGMZA.settings.clusterMaxZoom&&(zoomLevelOnClick=parseInt(WPGMZA.settings.clusterMaxZoom)),this.map instanceof WPGMZA.GoogleMap?(this.map.panTo(marker.getPosition()),this.map.setZoom(zoomLevelOnClick)):this.map.panTo(marker.getPosition(),zoomLevelOnClick)}}),jQuery(function($){WPGMZA.AdvancedTableMarkerListing=function(map,element,options){this.element=element=$("#wpgmza_marker_holder_"+map.id+", #wpgmza_marker_list_"+map.id),WPGMZA.MarkerListing.apply(this,arguments),this.dataTable=new WPGMZA.AdvancedTableDataTable(element,this),this.dataTable.map=map},WPGMZA.AdvancedTableMarkerListing.prototype=Object.create(WPGMZA.MarkerListing.prototype),WPGMZA.AdvancedTableMarkerListing.prototype.constructor=WPGMZA.AdvancedTableMarkerListing,WPGMZA.AdvancedTableMarkerListing.prototype.reload=function(){this.dataTable&&this.dataTable.reload()},WPGMZA.AdvancedTableMarkerListing.prototype.onFilteringComplete=function(event){this.dataTable.onMarkerFilterFilteringComplete(event),WPGMZA.MarkerListing.prototype.onFilteringComplete.apply(this,arguments)},WPGMZA.AdvancedTableMarkerListing.prototype.onItemClick=function(event){var isFirstCell=$(event.target).is(":first-child");$(event.target).closest(".dataTable").is(".collapsed")&&isFirstCell||WPGMZA.MarkerListing.prototype.onItemClick.call(this,event)}}),jQuery(function($){WPGMZA.CarouselMarkerListing=function(map,element,options){WPGMZA.MarkerListing.call(this,map,element,$.extend({paginationEnabled:!1},options))},WPGMZA.CarouselMarkerListing.prototype=Object.create(WPGMZA.MarkerListing.prototype),WPGMZA.CarouselMarkerListing.prototype.constructor=WPGMZA.CarouselMarkerListing,WPGMZA.CarouselMarkerListing.createInstance=function(el){return new WPGMZA.CarouselMarkerListing(el)},WPGMZA.CarouselMarkerListing.prototype.getOwlCarouselOptions=function(){var options={autoplay:!0,autoplayTimeout:5e3,lazyLoad:!1,autoHeight:!1,dots:!1,nav:!1,loop:!0,responsive:{0:{items:1},500:{items:3},800:{items:5}}};return WPGMZA.settings.carousel_lazyload&&(options.lazyLoad=!0),WPGMZA.settings.carouselAutoplay&&!isNaN(WPGMZA.settings.carouselAutoplay)&&(options.autoplayTimeout=parseInt(WPGMZA.settings.carouselAutoplay)),WPGMZA.settings.carousel_autoheight&&(options.autoHeight=!0),WPGMZA.settings.carousel_pagination&&(options.dots=!0),WPGMZA.settings.carousel_navigation&&(options.nav=!0),WPGMZA.settings.carousel_items&&!isNaN(WPGMZA.settings.carousel_items)&&(options.responsive[800].items=parseInt(WPGMZA.settings.carousel_items)),WPGMZA.settings.carousel_items_tablet&&!isNaN(WPGMZA.settings.carousel_items_tablet)&&(options.responsive[500].items=parseInt(WPGMZA.settings.carousel_items_tablet)),WPGMZA.settings.carousel_items_mobile&&!isNaN(WPGMZA.settings.carousel_items_mobile)&&(options.responsive[0].items=parseInt(WPGMZA.settings.carousel_items_mobile)),options},WPGMZA.CarouselMarkerListing.prototype.getAJAXRequestParameters=function(params){return delete(params=WPGMZA.MarkerListing.prototype.getAJAXRequestParameters.call(this,params)).data.start,delete params.data.length,params},WPGMZA.CarouselMarkerListing.prototype.onHTMLResponse=function(html){WPGMZA.MarkerListing.prototype.onHTMLResponse.call(this,html),$(this.element).trigger("destroy.owl.carousel"),$(this.element).owlCarousel(this.getOwlCarouselOptions())}}),jQuery(function($){WPGMZA.ModernMarkerListing=function(map,element,options){var self=this,map_id=map.id,container=$("#wpgmza_map_"+map_id);container.attr("data-mashup-ids");WPGMZA.MarkerListing.apply(this,arguments),this.map=map,this.element=element,this.openButton=$('<div class="wpgmza-modern-marker-open-button wpgmza-modern-shadow wpgmza-modern-hover-opaque"><i class="fa fa-map-marker"></i> <i class="fa fa-list"></i></div>'),container.append(this.openButton),container.append(this.element),this.popoutPanel=new WPGMZA.PopoutPanel,this.popoutPanel.element=this.element,map.on("init",function(event){container.append(self.element),container.append(self.openButton)}),self.openButton.on("click",function(event){self.open(),$("#wpgmza_map_"+map_id+" .wpgmza-modern-store-locator").addClass("wpgmza_sl_offset")}),this.markerView=new WPGMZA.ModernMarkerListingMarkerView(map),this.markerView.parent=this,$(this.element).find(".wpgmza-close-container").on("click",function(event){self.close(),$("#wpgmza_map_"+self.map.id+" .wpgmza-modern-store-locator").removeClass("wpgmza_sl_offset")}),$(this.element).on("click","li",function(event){self.markerView.open($(event.currentTarget).attr("mid"))}),$(document.body).on("click",".wpgmza_sl_reset_button_"+map_id,function(event){$(self.element).find("li[mid]").show()}),$(document.body).on("filteringcomplete.wpgmza",function(event){event.map.id==self._mapID&&self.onFilteringComplete(event)})},WPGMZA.ModernMarkerListing.prototype=Object.create(WPGMZA.MarkerListing.prototype),WPGMZA.ModernMarkerListing.prototype.constructor=WPGMZA.ModernMarkerListing,WPGMZA.ModernMarkerListing.prototype.initPagination=function(){WPGMZA.MarkerListing.prototype.initPagination.apply(this,arguments),this.pageSize&&$(this.element).find("ul").after(this.paginationElement)},WPGMZA.ModernMarkerListing.prototype.onHTMLResponse=function(html){$(this.element).find("ul.wpgmza-modern-marker-listing-list-item-container").html(html)},WPGMZA.ModernMarkerListing.prototype.open=function(){this.popoutPanel.open()},WPGMZA.ModernMarkerListing.prototype.close=function(){this.popoutPanel.close()}}),jQuery(function($){WPGMZA.OLDirectionsRenderer=function(map){var self=this;WPGMZA.DirectionsRenderer.apply(this,arguments),this.panel=$("#directions_panel_"+map.id),this.panel.on("click",".wpgmza-directions-step",function(event){self.onStepClicked(event)})},WPGMZA.extend(WPGMZA.OLDirectionsRenderer,WPGMZA.DirectionsRenderer),WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_LEFT=0,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_RIGHT=1,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SHARP_LEFT=2,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SHARP_RIGHT=3,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SLIGHT_LEFT=4,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_SLIGHT_RIGHT=5,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_STRAIGHT=6,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_ENTER_ROUNDABOUT=7,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_EXIT_ROUNDABOUT=8,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_U_TURN=9,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_GOAL=10,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_DEPART=11,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_KEEP_LEFT=12,WPGMZA.OLDirectionsRenderer.INSTRUCTION_TYPE_KEEP_RIGHT=13,WPGMZA.OLDirectionsRenderer.instructionTypeToClassName=function(type){for(var name in WPGMZA.OLDirectionsRenderer)if(name.match(/^INSTRUCTION_TYPE_/)&&WPGMZA.OLDirectionsRenderer[name]==type)return"wpgmza-"+name.replace(/_/g,"-").toLowerCase()},WPGMZA.OLDirectionsRenderer.prototype.clear=function(){this.polyline&&(this.map.removePolyline(this.polyline),delete this.polyline),this.stepHighlightPolyline&&(this.map.removePolyline(this.stepHighlightPolyline),delete this.stepHighlightPolyline),this.panel.html("")},WPGMZA.OLDirectionsRenderer.prototype.setDirections=function(settings){var self=this,route=settings.routes[0],settings=window.polyline.decode(route.geometry),points=[];this.clear(),settings.forEach(function(arr){points.push({lat:arr[0],lng:arr[1]})});settings={linecolor:"#4285F4",linethickness:4,opacity:.8};this.map.settings.directions_route_stroke_color&&(settings.linecolor=this.map.settings.directions_route_stroke_color),this.map.settings.directions_route_stroke_weight&&(settings.linethickness=this.map.settings.directions_route_stroke_weight),this.map.settings.directions_route_stroke_opacity&&(settings.opacity=this.map.settings.directions_route_stroke_opacity),this.polyline=WPGMZA.Polyline.createInstance({polydata:points,strokeWeight:settings.linethickness,strokeOpacity:settings.opacity,strokeColor:settings.linecolor}),this.polyline.map=this.map,this.map.addPolyline(this.polyline),this.directionStartMarker&&this.map.removeMarker(this.directionStartMarker),this.directionEndMarker&&this.map.removeMarker(this.directionEndMarker),this.directionStartMarker=WPGMZA.Marker.createInstance({position:points[0],icon:this.map.settings.directions_route_origin_icon,retina:this.map.settings.directions_origin_retina,disableInfoWindow:!0}),this.directionStartMarker._icon.retina=this.directionStartMarker.retina,this.map.addMarker(this.directionStartMarker),this.directionEndMarker=WPGMZA.Marker.createInstance({position:points[points.length-1],icon:this.map.settings.directions_route_destination_icon,retina:this.map.settings.directions_destination_retina,disableInfoWindow:!0}),this.directionEndMarker._icon.retina=this.directionEndMarker.retina,this.map.addMarker(this.directionEndMarker);var steps=[];route.segments&&route.segments.forEach(function(segment){steps=steps.concat(segment.steps)}),steps.forEach(function(step){var div=$("<div class='wpgmza-directions-step'></div>");div[0].wpgmzaDirectionsStep=step,div.html(step.instruction),div.addClass(WPGMZA.OLDirectionsRenderer.instructionTypeToClassName(step.type)),self.panel.append(div)}),this.map.settings.directions_fit_bounds_to_route&&this.fitBoundsToRoute(points[0],points[points.length-1])},WPGMZA.OLDirectionsRenderer.prototype.onStepClicked=function(polyline){var step=polyline.currentTarget.wpgmzaDirectionsStep,bounds=new WPGMZA.LatLngBounds,polyline=step.way_points[0],endIndex=step.way_points[step.way_points.length-1];if(this.stepHighlightPolyline&&(this.map.removePolyline(this.stepHighlightPolyline),delete this.stepHighlightPolyline),polyline!=endIndex){for(var points=[],i=polyline;i<=endIndex;i++){var vertex=this.polyline.polydata[i];points.push(vertex),bounds.extend(vertex)}polyline={strokeColor:"#ff0000",strokeWeight:4,strokeOpacity:.8};this.map.settings.directions_route_stroke_weight&&(polyline.linethickness=this.map.settings.directions_route_stroke_weight),this.map.settings.directions_route_stroke_opacity&&(polyline.opacity=this.map.settings.directions_route_stroke_opacity);polyline=WPGMZA.Polyline.createInstance({polydata:points,settings:polyline});this.stepHighlightPolyline=polyline,this.map.addPolyline(this.stepHighlightPolyline),this.map.fitBounds(bounds),WPGMZA.animateScroll(this.map.element)}}}),jQuery(function($){WPGMZA.OLDirectionsService=function(map){WPGMZA.DirectionsService.apply(this,arguments),this.apiKey=WPGMZA.settings.open_route_service_key},WPGMZA.extend(WPGMZA.OLDirectionsService,WPGMZA.DirectionsService),WPGMZA.OLDirectionsService.prototype.geocodeWaypoints=function(waypoints,callback){var geocoder=WPGMZA.Geocoder.createInstance(),index=0,coordinates=[];!function geocodeNextWaypoint(){geocoder.geocode({address:waypoints[index]},function(results){results.length?coordinates.push([results[0].latLng.lng,results[0].latLng.lat]):coordinates.push(WPGMZA.DirectionsService.NOT_FOUND),++index==waypoints.length?callback(coordinates):geocodeNextWaypoint()})}()},WPGMZA.OLDirectionsService.prototype.route=function(request,callback){var profile,url,self=this,translated={};switch(request.travelMode){case WPGMZA.DirectionsService.WALKING:profile="foot-walking";break;case WPGMZA.DirectionsService.BICYCLING:profile="cycling-regular";break;case WPGMZA.DirectionsService.TRANSIT:console.warn("Public transport profile is not supported by OpenRouteService");default:profile="driving-car"}request.unitSystem===WPGMZA.Distance.KILOMETERS?translated.units="km":translated.units="mi",url="https://api.openrouteservice.org/v2/directions/"+profile;var waypoints=[request.origin];request.waypoints&&request.waypoints.forEach(function(obj){waypoints.push(obj.location)}),waypoints.push(request.destination),this.geocodeWaypoints(waypoints,function(coordinates){for(var i=0;i<coordinates.length;i++)if(coordinates[i]==WPGMZA.DirectionsService.NOT_FOUND){for(var response={geocoded_waypoints:[]},i=0;i<waypoints.length;i++)response.geocoded_waypoints.push({geocoder_status:coordinates[i]});return void callback(response,WPGMZA.DirectionsService.NOT_FOUND)}switch(translated.coordinates=coordinates,WPGMZA.locale.substr(0,2)){case"de":case"en":case"pt":case"ru":case"hu":case"fr":case"it":case"cn":case"dk":case"de":translated.language=WPGMZA.locale.substr(0,2)}$.ajax(url,{method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(translated),beforeSend:function(xhr){xhr.setRequestHeader("Authorization",self.apiKey)},success:function(response,event,xhr){event=response.routes&&0<response.routes.length?WPGMZA.DirectionsService.SUCCESS:WPGMZA.DirectionsService.ZERO_RESULTS,callback(response,event);event=new WPGMZA.Event({type:"directionsserviceresult",response:response,status:event});self.map.trigger(event)}})})}}),jQuery(function($){WPGMZA.OLHeatmap=function(settings){WPGMZA.Heatmap.call(this,settings),this._removeListenerBound=!1;settings=this.getOLHeatmapSettings();this.olHeatmap=new ol.layer.Heatmap(settings)},WPGMZA.OLHeatmap.prototype=Object.create(WPGMZA.Heatmap.prototype),WPGMZA.OLHeatmap.prototype.constructor=WPGMZA.OLHeatmap,WPGMZA.OLHeatmap.prototype.getOLHeatmapSettings=function(){var settings={source:this.getSource()};return this.opacity&&(settings.opacity=parseFloat(this.opacity)),this.radius&&(settings.radius=parseFloat(this.radius)),this.heatmap_opacity&&(settings.opacity=parseFloat(this.heatmap_opacity)),this.heatmap_radius&&(settings.radius=parseFloat(this.heatmap_radius)),this.gradient&&(settings.gradient=this.gradient),settings},WPGMZA.OLHeatmap.prototype.removeLayer=function(){this.olHeatmap&&(this.olHeatmap.getSource().dispose(),this.olHeatmap.renderer_&&this.olHeatmap.renderer_.dispose(),this.olHeatmap.setMap(null),this.olHeatmap.dispose(),delete this.olHeatmap)},WPGMZA.OLHeatmap.prototype.updateOLHeatmap=function(){var self=this;this.olHeatmap&&this.removeLayer();var settings=this.getOLHeatmapSettings();this.olHeatmap=new ol.layer.Heatmap(settings),this.map&&(this.olHeatmap.setMap(this.map.olMap),this._removeListenerBound||this.map.on("heatmapremoved",function(event){event.heatmap===self&&self.removeLayer()}))},WPGMZA.OLHeatmap.prototype.getSource=function(){for(var points=this.parseGeometry(this.dataset),len=points.length,features=[],i=0;i<len;i++)features.push(new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([parseFloat(points[i].lng),parseFloat(points[i].lat)]))}));return new ol.source.Vector({features:features})},WPGMZA.OLHeatmap.prototype.setDraggable=function(){},WPGMZA.OLHeatmap.prototype.update=function(){this.updateOLHeatmap()},WPGMZA.OLHeatmap.prototype.updateDatasetFromMarkers=function(){WPGMZA.Heatmap.prototype.updateDatasetFromMarkers.apply(this,arguments),this.updateOLHeatmap()}}),jQuery(function($){WPGMZA.OLProDrawingManager=function(){WPGMZA.ProDrawingManager.apply(this,arguments)},WPGMZA.extend(WPGMZA.OLProDrawingManager,WPGMZA.ProDrawingManager)}),jQuery(function($){WPGMZA.OLProInfoWindow=function(feature){WPGMZA.OLInfoWindow.call(this,feature);var self=this;$(this.element).on("click",function(event){self.feature.map.settings.close_infowindow_on_map_click&&(event.stopPropagation(),event.stopImmediatePropagation())})},WPGMZA.OLProInfoWindow.prototype=Object.create(WPGMZA.OLInfoWindow.prototype),WPGMZA.OLProInfoWindow.prototype.constructor=WPGMZA.OLProInfoWindow,Object.defineProperty(WPGMZA.OLProInfoWindow.prototype,"panIntoViewOnOpen",{get:function(){return this.style==WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE}}),WPGMZA.OLProInfoWindow.prototype.open=function(map,feature){switch(this.feature=feature,"map-edit"==WPGMZA.currentPage?WPGMZA.ProInfoWindow.STYLE_NATIVE_GOOGLE:this.style){case WPGMZA.ProInfoWindow.STYLE_MODERN:case WPGMZA.ProInfoWindow.STYLE_MODERN_PLUS:case WPGMZA.ProInfoWindow.STYLE_MODERN_CIRCULAR:case WPGMZA.ProInfoWindow.STYLE_TEMPLATE:return WPGMZA.ProInfoWindow.prototype.open.call(this,map,feature);default:return WPGMZA.OLInfoWindow.prototype.open.call(this,map,feature)}},WPGMZA.OLProInfoWindow.prototype.setPosition=function(latLng){latLng=latLng.toLatLngLiteral();this.overlay.setPosition(ol.proj.fromLonLat([latLng.lng,latLng.lat]))}}),jQuery(function($){WPGMZA.OLProMap=function(element,options){WPGMZA.OLMap.call(this,element,options);this.loadKMLLayers(),this.trigger("init"),this.dispatchEvent("created"),WPGMZA.events.dispatchEvent({type:"mapcreated",map:this}),$(this.element).trigger("wpgooglemaps_loaded")},WPGMZA.OLProMap.prototype=Object.create(WPGMZA.OLMap.prototype),WPGMZA.OLProMap.prototype.constructor=WPGMZA.OLMap.prototype,WPGMZA.OLMap.prototype.addHeatmap=function(heatmap){heatmap.olHeatmap.setMap(this.olMap),WPGMZA.ProMap.prototype.addHeatmap.call(this,heatmap)},WPGMZA.OLProMap.prototype.loadKMLLayers=function(){if(this.kmlLayers)for(var i=0;i<this.kmlLayers.length;i++)this.olMap.removeLayer(this.kmlLayers[i]);if(this.kmlLayers=[],this.settings.kml)for(var urls=this.settings.kml.split(","),i=((new Date).getTime(),0);i<urls.length;i++){var layer=new ol.layer.Vector({source:new ol.source.Vector({url:urls[i],format:new ol.format.KML({extractAttributes:!0})})});this.kmlLayers.push(layer),this.olMap.addLayer(layer)}}}),jQuery(function($){WPGMZA.OLProMarker=function(row){WPGMZA.OLMarker.call(this,row)},WPGMZA.OLProMarker.prototype=Object.create(WPGMZA.OLMarker.prototype),WPGMZA.OLProMarker.prototype.constructor=WPGMZA.OLProMarker,WPGMZA.OLProMarker.prototype.updateIcon=function(){var self=this,icon=this._icon;WPGMZA.OLMarker.renderMode==WPGMZA.OLMarker.RENDER_MODE_HTML_ELEMENT?(icon.applyToElement($(this.element).find("img")),WPGMZA.getImageDimensions(icon.url,function(dimensions){self.updateElementHeight(dimensions.height)})):(this.vectorLayerStyle=new ol.style.Style({image:new ol.style.Icon({anchor:[.5,1],src:icon.url})}),this.feature.setStyle(this.vectorLayerStyle))}}),jQuery(function($){WPGMZA.OLProPolygon=function(row,olFeature){WPGMZA.OLPolygon.call(this,row,olFeature)},WPGMZA.OLProPolygon.prototype=Object.create(WPGMZA.OLPolygon.prototype),WPGMZA.OLProPolygon.prototype.constructor=WPGMZA.OLProPolygon});
[-] pro-scripts.json
[edit]
[-] pro-map-edit-page.js
[edit]
[+]
3rd-party-integration
[-] directions-renderer.js
[edit]
[-] modern-marker-listing-marker-view.js
[edit]
[-] wp-google-maps-pro.min.js
[edit]
[-] pro-drawing-manager.js
[edit]
[-] use-my-location-button.js
[edit]
[-] category-tree-node.js
[edit]
[-] wp-google-maps-pro.min.js.map
[edit]
[-] queue.js
[edit]
[-] pro-polygon.js
[edit]
[-] pro-marker-filter.js
[edit]
[-] modern-directions-box.js
[edit]
[-] category-picker.js
[edit]
[-] marker-gallery.js
[edit]
[-] admin-map-datatable.js
[edit]
[-] wp-google-maps-pro.combined.js
[edit]
[-] categories-page.js
[edit]
[-] category-tree.js
[edit]
[+]
open-layers
[-] marker-gallery-input.js
[edit]
[-] custom-field-filter-widget.js
[edit]
[+]
google-maps
[-] custom-field-filter-controller.js
[edit]
[-] pro-map-list-page.js
[edit]
[-] modern-marker-listing.js
[edit]
[-] pro-store-locator.js
[edit]
[-] pro-map.js
[edit]
[-] pro-latlng.js
[edit]
[-] pro-info-window.js
[edit]
[-] modern-directions-result-box.js
[edit]
[-] theme-editor.js
[edit]
[-] pro-address-input.js
[edit]
[-] directions-box.js
[edit]
[-] marker-icon.js
[edit]
[-] heatmap.js
[edit]
[+]
marker-listings
[-] directions-service.js
[edit]
[+]
..
[+]
map-edit-page
[-] marker-icon-picker.js
[edit]
[-] content-editor-map-button.js
[edit]
[-] pro-marker.js
[edit]
[-] advanced-page.js
[edit]
[-] marker-library-dialog.js
[edit]
[-] legacy-json-converter.js
[edit]