PATH:
home
/
letacommog
/
entrepro
/
wp-content
/
plugins
/
geo-my-wp
/
assets
/
js
function GMW_Geocoder(e,o){this.provider=e||"nominatim",this.inputField=o||!1,jQuery.extend(this,GMW_Geocoders[this.provider]),this.options=jQuery.extend(GMW_Geocoders.options,this.options),this.response.provider=this.provider,this.initialize()}function gmw_geocoder(e){return new GMW_Geocoder(e)}var GMW_Maps={},gmwMapOptions={},GMW={options:gmwVars.settings,geocode_provider:gmwVars.geocodingProvider||"google_maps",hooks:{action:{},filter:{}},map_elements:{},navigator_timeout:1e4,autocomplete_fields:void 0!==typeof gmwAutocompleteFields?{}:gmwAutocompleteFields,navigator_error_messages:{1:"User denied the request for Geolocation.",2:"Location information is unavailable.",3:"The request to get user location timed out.",4:"An unknown error occurred"},vars:{auto_locator:{status:!1,type:!1,callback:!1},locator_button:{status:!1,element:!1,id:!1,loader:!1,submit:!1},form_submission:{status:!1,form:!1,id:!1,submit:!1}},current_location_fields:["lat","lng","address","formatted_address","street","city","region_name","region_code","postcode","country_name","country_code"],init:function(){GMW.add_action("gmw_init"),jQuery("div.gmw-map-wrapper.gmw-expanded-map").length&&jQuery("body, html").addClass("gmw-scroll-disabled"),jQuery("div.gmw-form-wrapper, ul.gmw-form-wrapper").length&&GMW.form_functions(),navigator.geolocation&&1==GMW.options.general.auto_locate&&1!=GMW.get_cookie("gmw_autolocate")&&(GMW.set_cookie("gmw_autolocate",1,1),GMW.auto_locator("page_locator",GMW.page_locator_success,!1)),"undefined"!=typeof google&&jQuery("input.gmw-address-autocomplete").each(function(){jQuery(this).is("[id]")&&GMW.address_autocomplete(jQuery(this).attr("id"),jQuery(this).data())}),"undefined"!=typeof jQuery.ui&&jQuery.ui.draggable&&GMW.draggable_element(),GMW.toggle_element(),GMW.rangeslider(),GMW.date_picker()},add_action:function(e,o,t,a){GMW.add_hook("action",e,o,t,a)},add_filter:function(e,o,t,a){GMW.add_hook("filter",e,o,t,a)},do_action:function(e){GMW.do_hook("action",e,arguments)},apply_filters:function(e){return GMW.do_hook("filter",e,arguments)},remove_action:function(e,o){GMW.remove_hook("action",e,o)},remove_filter:function(e,o,t){GMW.remove_hook("filter",e,o,t)},add_hook:function(e,o,t,a,n){void 0==GMW.hooks[e][o]&&(GMW.hooks[e][o]=[]);var r=GMW.hooks[e][o];void 0==n&&(n=o+"_"+r.length),void 0==a&&(a=10),GMW.hooks[e][o].push({tag:n,callable:t,priority:a})},do_hook:function(e,o,t){if(t=Array.prototype.slice.call(t,1),void 0!=GMW.hooks[e][o]){var a,n=GMW.hooks[e][o];n.sort(function(e,o){return e.priority-o.priority});for(var r=0;r<n.length;r++)a=n[r].callable,"function"!=typeof a&&(a=window[a]),"action"==e?a.apply(null,t):t[0]=a.apply(null,t)}return"filter"==e?t[0]:void 0},remove_hook:function(e,o,t,a){if(void 0!=GMW.hooks[e][o])for(var n=GMW.hooks[e][o],r=n.length-1;r>=0;r--)void 0!=a&&a!=n[r].tag||void 0!=t&&t!=n[r].priority||n.splice(r,1)},set_cookie:function(e,o,t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3);var n=escape(encodeURIComponent(o))+(null==t?"":"; expires="+a.toUTCString());document.cookie=e+"="+n+"; path=/"},get_cookie:function(e){var o=document.cookie.match("(^|;) ?"+e+"=([^;]*)(;|$)");return o?decodeURIComponent(o[2]):null},delete_cookie:function(e){document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"},navigator:function(e,o){function t(t){GMW.geocoder([t.coords.latitude,t.coords.longitude],e,o)}function a(e){return o(GMW.navigator_error_messages[e.code])}return navigator.geolocation?void navigator.geolocation.getCurrentPosition(t,a,{timeout:GMW.navigator_timeout}):o("Sorry! Geolocation is not supported by this browser.")},geocoder:function(e,o,t){var a="undefined"!=typeof GMW.options.general.country_code?GMW.options.general.country_code:"us",n="undefined"!=typeof GMW.options.general.language_code?GMW.options.general.language_code:"en",r=new GMW_Geocoder(GMW.geocode_provider),i="object"==typeof e?"reverseGeocode":"geocode",s={q:e,region:a,language:n};r[i](s,function(e,a){return"OK"==a?"undefined"!=typeof o?o(e.result,e):GMW.geocoder_success(e.result,e):"undefined"!=typeof t?t(a,e):GMW.geocoder_failed(a,e)})},geocode:function(e,o,t,a,n){var r=new GMW_Geocoder(e);"reverse"==o&&(o="reverseGeocode"),r[o](t,function(e,o){return"OK"==o?"undefined"!=typeof a?a(e):GMW.geocoder_success(e):"undefined"!=typeof n?n(o,e):GMW.geocoder_failed(o,e)})},geocoder_success:function(){},geocoder_failed:function(e){alert("We could not find the address you entered for the following reason: "+e)},address_autocomplete:function(e,o){var t=document.getElementById(e);if(null!=t){var a={};"undefined"!=typeof o.autocomplete_countries&&(a.componentRestrictions={country:o.autocomplete_countries.split(",")}),"undefined"!=typeof o.autocomplete_types&&(a.types=[o.autocomplete_types]),a=GMW.apply_filters("gmw_address_autocomplete_options",a,e,t,GMW);var n=new google.maps.places.Autocomplete(t,a);google.maps.event.addListener(n,"place_changed",function(){var o=n.getPlace();if(GMW.do_action("gmw_address_autocomplete_place_changed",o,n,e,t,a),o.geometry){var r=jQuery(t.closest("form"));1==o.address_components.length&&"country"==o.address_components[0].types[0]?r.find(".gmw-country").val(o.address_components[0].short_name).prop("disabled",!1):2==o.address_components.length&&"administrative_area_level_1"==o.address_components[0].types[0]&&(r.find(".gmw-state").val(o.address_components[0].long_name).prop("disabled",!1),r.find(".gmw-country").val(o.address_components[1].short_name).prop("disabled",!1)),r.find(".gmw-lat").val(o.geometry.location.lat().toFixed(6)),r.find(".gmw-lng").val(o.geometry.location.lng().toFixed(6))}})}},save_location_fields:function(e){var o=jQuery("form#gmw-current-location-hidden-form");GMW.do_action("gmw_save_location_fields",e);for(fieldName in e)-1!==jQuery.inArray(fieldName,GMW.current_location_fields)&&GMW.set_cookie("gmw_ul_"+fieldName,e[fieldName],7),o.find("input#gmw_cl_"+fieldName).val(e[fieldName]),GMW.do_action("gmw_save_location_field",e[fieldName],e);return e},auto_locator:function(e,o,t){GMW.vars.auto_locator.status=!0,GMW.vars.auto_locator.type=e,GMW.vars.auto_locator.success=o,GMW.vars.auto_locator.failed=t,GMW.navigator(GMW.auto_locator_success,GMW.auto_locator_failed)},auto_locator_success:function(e){address_fields=GMW.save_location_fields(e),0!=GMW.vars.auto_locator.success?GMW.vars.auto_locator.success(address_fields,e):(GMW.vars.auto_locator.status=!1,GMW.vars.auto_locator.type=!1,GMW.vars.auto_locator.success=!1,GMW.vars.auto_locator.failed=!1)},auto_locator_failed:function(e){0!=GMW.vars.auto_locator.failed?GMW.vars.auto_locator.failed(e):(alert(e),GMW.vars.auto_locator.status=!1,GMW.vars.auto_locator.type=!1,GMW.vars.auto_locator.success=!1,GMW.vars.auto_locator.failed=!1)},page_locator_success:function(e,o){GMW.vars.auto_locator.status=!1,GMW.vars.auto_locator.callback=!1,GMW.vars.auto_locator.type=!1,setTimeout(function(){jQuery("form.gmw-cl-form").length?jQuery("form.gmw-cl-form")[0].submit():window.location.reload()},500)},form_functions:function(){GMW.enable_smartbox(),jQuery("form").find("input.gmw-address").keyup(function(e){if(13!=e.which){var o=jQuery(this).closest("form");o.find("input.gmw-lat, input.gmw-lng").val(""),o.find("input.gmw-state, input.gmw-country").val("").prop("disabled",!0)}}),jQuery("form").find(".gmw-locator-button").click(function(){GMW.locator_button(jQuery(this),jQuery(this).closest("form"))}),jQuery("form.gmw-form").submit(function(e){GMW.form_submission(jQuery(this),e)})},enable_smartbox:function(){jQuery().chosen?jQuery("form").find("select.gmw-smartbox").chosen({width:"100%"}):jQuery().select2&&jQuery("form").find("select.gmw-smartbox").select2()},form_submission:function(e,o){if(GMW.vars.form_submission.status=!0,GMW.vars.form_submission.form=e,GMW.vars.form_submission.id=GMW.vars.form_submission.form.find(".gmw-form-id").val(),1==GMW.vars.form_submission.submit)return!0;var t=e.find("input.gmw-address"),a="";return o.preventDefault(),e.find("input.gmw-paged").val("1"),t=GMW.apply_filters("gmw_search_form_address_pre_geocoding",t,GMW),a=t.map(function(){return jQuery(this).val()}).get().join(" "),jQuery.trim(a).length?""!=e.find("input.gmw-lat").val()&&""!=e.find("input.gmw-lng").val()?(GMW.vars.form_submission.submit=!0,GMW.vars.form_submission.form.submit(),!1):void GMW.geocoder(a,GMW.form_geocoder_success,GMW.geocoder_failed):t.hasClass("mandatory")?(t.hasClass("gmw-no-address-error")||(t.addClass("gmw-no-address-error").on("focus keypress",function(){jQuery(this).removeClass("gmw-no-address-error").off("focus keypress")}),setTimeout(function(){t.removeClass("gmw-no-address-error").off("focus keypress")},4e3)),!1):(GMW.vars.form_submission.submit=!0,GMW.vars.form_submission.form.submit(),!1)},form_geocoder_success:function(e){var o=GMW.vars.form_submission.form;return"country"==e.level?o.find(".gmw-country").val(e.country_code).prop("disabled",!1):"region"==e.level&&(o.find(".gmw-state").val(e.region_name).prop("disabled",!1),o.find(".gmw-country").val(e.country_code).prop("disabled",!1)),o.find(".gmw-lat").val(parseFloat(e.lat).toFixed(6)),o.find(".gmw-lng").val(parseFloat(e.lng).toFixed(6)),setTimeout(function(){GMW.vars.form_submission.submit=!0,GMW.vars.form_submission.form.submit()},300),!1},locator_button:function(e,o){var t;t="undefined"==typeof o?e.closest("form"):o,jQuery("form.gmw-form").find('input[type="text"], .gmw-submit').attr("disabled","disabled"),GMW.vars.locator_button.status=!0,GMW.vars.locator_button.form=t,GMW.vars.locator_button.element=e,GMW.vars.locator_button.form_id=e.data("form_id"),GMW.vars.locator_button.loader=e.next(),GMW.vars.locator_button.submit=1==e.attr("data-locator_submit")?!0:!1,t.find("input.gmw-lat, input.gmw-lng").val(""),t.find("input.gmw-state, input.gmw-country").val("").prop("disabled",!0),e.hasClass("inside")?e.addClass("animate-spin"):e.hasClass("text")?GMW.vars.locator_button.loader.fadeIn("fast"):e.fadeOut("fast",function(){GMW.vars.locator_button.loader.fadeIn("fast")}),setTimeout(function(){GMW.auto_locator("locator_button",GMW.locator_button_success,GMW.locator_button_failed)},500)},locator_button_success:function(e){var o=GMW.vars.locator_button.form,t=o.find("input.gmw-address");jQuery("form.gmw-form").find('input[type="text"], .gmw-submit').removeAttr("disabled"),o.find("input.gmw-lat").val(parseFloat(e.lat).toFixed(6)),o.find("input.gmw-lng").val(parseFloat(e.lng).toFixed(6)),t.hasClass("gmw-full-address")?t.val(e.formatted_address):(o.find(".gmw-address.street").val(e.street),o.find(".gmw-address.city").val(e.city),o.find(".gmw-address.state").val(e.region_name),o.find(".gmw-address.zipcode").val(e.postcode),o.find(".gmw-address.country").val(e.country_code)),GMW.vars.locator_button.submit?setTimeout(function(){o.find(".gmw-submit").click(),GMW.locator_button_done()},500):GMW.locator_button_done()},locator_button_failed:function(e){alert("Geocoder failed due to: "+e),GMW.locator_button_done()},locator_button_done:function(){var e=GMW.vars.locator_button.element;jQuery("form.gmw-form").find('input[type="text"], .gmw-submit').removeAttr("disabled"),e.hasClass("inside")?e.removeClass("animate-spin"):GMW.vars.locator_button.loader.fadeOut("fast",function(){e.fadeIn("fast")}),setTimeout(function(){GMW.vars.locator_button.status=!1,GMW.vars.locator_button.element=!1,GMW.vars.locator_button.form_id=!1,GMW.vars.locator_button.loader=!1,GMW.vars.locator_button.submit=!1},500)},clear_form:function(e){$(":input",e).not(":button, :submit, :reset, :hidden").val("").prop("checked",!1).prop("selected",!1)},rangeslider:function(){jQuery("form").find("input.gmw-range-slider").on("input change",function(){jQuery(this).prev("span, label").find("output").html(jQuery(this).val())})},date_picker:function(){var e=jQuery(".gmw-date-field"),o=jQuery(".gmw-time-field");e.length>0&&"undefined"!=typeof jQuery.fn.pickadate&&e.each(function(){var e=jQuery(this).data("date_type");jQuery(this).pickadate({format:e||"yyyy/mm/dd"})}),o.length>0&&"undefined"!=typeof jQuery.fn.pickatime&&o.each(function(){jQuery(this).pickatime({interval:1})})},draggable_element:function(){jQuery(".gmw-draggable.remote-toggle").each(function(){var e=jQuery(this).data(),o=jQuery(e.handle);o.addClass("gmw-draggable").attr("data-draggable",e.draggable).attr("data-containment",e.containment)}),jQuery(document).on("mouseenter",".gmw-draggable",function(e){if(!jQuery(this).hasClass("enabled")){jQuery(this).addClass("enabled");var o=jQuery(this).data();"global_map"==o.draggable&&(o.draggable=jQuery(this).closest(".gmw-form-wrapper"),o.containment=jQuery(this).closest(".gmw-global-map-wrapper")),jQuery(o.draggable).draggable({containment:o.containment,handle:jQuery(this)})}})},toggle_element:function(){jQuery(document).on("click",".gmw-element-toggle-button",function(e){var o=jQuery(this),t=jQuery(this).data(),a=jQuery(t.target),n={};o.toggleClass(t.show_icon).toggleClass(t.hide_icon),"expand"==o.attr("data-state")?(n[t.animation]=t.close_length,o.attr("data-state","collapse"),a.attr("data-state","collapse")):(n[t.animation]=t.open_length,o.attr("data-state","expand"),a.attr("data-state","expand")),"height"==t.animation||"width"==t.animation?a.animate(n,t.duration):a.addClass("gmw-toggle-element").css(t.animation,n[t.animation])})},get_field_by_string:function(e,o){o=o.replace(/\[(\w+)\]/g,".$1"),o=o.replace(/^\./,"");for(var t=o.split("."),a=0,n=t.length;n>a;++a){var r=t[a];if(!(r in e))return"";e=e[r]}return"undefined"!==e?e:""}},GMW_Geocoders={options:{region:gmwVars.settings.general.country_code||"us",language:gmwVars.settings.general.language_code||"en",suggestResults:!1,limit:10},locationFields:{latitude:"",longitude:"",lat:"",lng:"",street_number:"",street_name:"",street:"",premise:"",neighborhood:"",city:"",county:"",region_name:"",region_code:"",postcode:"",country_name:"",country_code:"",address:"",formatted_address:"",place_id:"",level:""},google_maps:{options:{},locationFields:{},get:function(e,o,t,a){var n=this,r=new google.maps.Geocoder,i={region:o.region,language:o.language};"reverseGeocode"==e?i.latLng=new google.maps.LatLng(o.q[0],o.q[1]):(n.defaultFields.address=o.q,i.address=o.q),r.geocode(i,function(o,r){return n.response.data=o,r!==google.maps.GeocoderStatus.OK?void n.geocodeFailed(r,a):"reverseGeocode"==e&&"APPROXIMATE"==o[0].geometry.location_type?(n.response.data=o[0]=[],console.log("No results - Approximate."),n.geocodeFailed("ZERO_RESULTS",a)):n.geocodeSuccess(o[0],t)})},getLocationFields:function(e){var o={},t=e.address_components;void 0!==typeof e.place_id?e.place_id:"";o.formatted_address=e.formatted_address,o.lat=o.latitude=e.geometry.location.lat(),o.lng=o.longitude=e.geometry.location.lng();for(var a in t)"street_number"==t[a].types&&void 0!=t[a].long_name&&(o.street_number=t[a].long_name),"route"==t[a].types&&void 0!=t[a].long_name&&(o.street_name=t[a].long_name,o.street=o.street_number+" "+o.street_name),"subpremise"==t[a].types&&void 0!=t[a].long_name&&(o.premise=t[a].long_name),"neighborhood,political"==t[a].types&&void 0!=t[a].long_name&&(o.neighborhood=t[a].long_name),"locality,political"==t[a].types&&void 0!=t[a].long_name&&(o.city=t[a].long_name),"administrative_area_level_1,political"==t[a].types&&(o.region_name=t[a].long_name,o.region_code=t[a].short_name),"administrative_area_level_2,political"==t[a].types&&void 0!=t[a].long_name&&(o.county=t[a].long_name),"postal_code"==t[a].types&&void 0!=t[a].long_name&&(o.postcode=t[a].long_name),"country,political"==t[a].types&&(o.country_name=t[a].long_name,o.country_code=t[a].short_name);return o}},nominatim:{geocodeUrl:"https://nominatim.openstreetmap.org/search",reverseGeocodeUrl:"https://nominatim.openstreetmap.org/reverse",options:{format:"jsonv2",addressdetails:"1","accept-language":"en",zoom:"18",email:gmwVars.settings.api.nominatim_email||"",region:"us",limit:10},locationFields:{place_id:"place_id",formatted_address:"display_name",lat:"lat",lng:"lon",street_number:"address.house_number",street_name:"address.road",city:["address.city","address.town","address.suburb"],county:"address.county",region_name:"address.state",postcode:"address.postcode",country_name:"address.country",country_code:"address.country_code"},initialize:function(){this.options["accept-language"]=this.options.language},get:function(e,o,t,a){var n,r,i=this,s=o.q;delete o.q,n=jQuery.param(o),"reverseGeocode"==e?r=this.reverseGeocodeUrl+"?lat="+s[0]+"&lon="+s[1]+"&"+n:(i.defaultFields.address=s,r=this.geocodeUrl+"?q="+s+"&"+n),i.jqXHR=jQuery.getJSON(r,function(n,r){if(i.response.data=n,"undefined"!=typeof n.error)return i.geocodeFailed(n.error,a);if("reverseGeocode"==e)return i.geocodeSuccess(n,t);if(0==n.length)return i.geocodeFailed("No results found.",a);if(o.suggestResults&&n.length>1)return i.suggestResults(n,"display_name",t);if(n.length>1)for(var s in n)if("undefined"!=typeof n[s].address.country_code&&n[s].address.country_code==o.region)return void i.geocodeSuccess(n[s],t);return i.geocodeSuccess(n[0],t)}).fail(function(e,o,t){i.geocodeFailed(o+" "+t,a)})}},regions:{AL:"Alabama",AK:"Alaska",AS:"American Samoa",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FM:"Federated States Of Micronesia",FL:"Florida",GA:"Georgia",GU:"Guam",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MH:"Marshall Islands",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",MP:"Northern Mariana Islands",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PW:"Palau",PA:"Pennsylvania",PR:"Puerto Rico",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VI:"Virgin Islands",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},countries:{AF:"Afghanistan",AX:"Åland Islands",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"AndorrA",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Congo",CD:"Congo, Democratic Republic",CK:"Cook Islands",CR:"Costa Rica",CI:'Cote D"Ivoire',HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and Mcdonald Islands",VA:"Holy See (Vatican City State)",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"Korea (North)",KR:"Korea (South)",XK:"Kosovo",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Laos",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libyan Arab Jamahiriya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia",MD:"Moldova",MC:"Monaco",MN:"Mongolia",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",AN:"Netherlands Antilles",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestinian Territory, Occupied",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:"Russian Federation",RW:"Rwanda",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",ME:"Montenegro",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan, Province of China",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela",VN:"Viet Nam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"}};if(GMW_Geocoder.prototype.options={},GMW_Geocoder.prototype.defaultFields=GMW_Geocoders.locationFields,GMW_Geocoder.prototype.jqXHR={},GMW_Geocoder.prototype.response={provider:"",type:"",status:"",data:{},result:{}},GMW_Geocoder.prototype.initialize=function(){},GMW_Geocoder.prototype.setOptions=function(e){jQuery.extend(this.options,e)},GMW_Geocoder.prototype.geocode=function(e,o,t){this.response.type="geocode",this.setOptions(e),"undefined"==typeof t&&(t=o),this.get("geocode",this.options,o,t)},GMW_Geocoder.prototype.reverseGeocode=function(e,o,t){this.response.type="reverseGeocode",this.setOptions(e),"undefined"==typeof t&&(t=o),this.get("reverseGeocode",this.options,o,t)},GMW_Geocoder.prototype.search=function(e,o,t){this.response.type="search",this.setOptions(e),"undefined"==typeof t&&(t=o),this.get("search",this.options,o,t)},GMW_Geocoder.prototype.get=function(){},GMW_Geocoder.prototype.geocodeFailed=function(e,o){this.response.status=e,console.log("Request failed. "+this.response.status),console.log(this.jqXHR),o(this.response,e)},GMW_Geocoder.prototype.suggestResults=function(e,o,t){var a=this,n="";for(var r in e)n+='<li data-value="'+r+'">'+e[r][o]+"</li>";jQuery('<div class="gmw-geocoder-suggested-results-wrapper"><ul class="gmw-geocoder-suggested-results">'+n+"</ul></div>").appendTo("body").find("li").on("click",function(){a.geocodeSuccess(e[jQuery(this).data("value")],t),jQuery(this).closest(".gmw-geocoder-suggested-results-wrapper").fadeOut().remove()})},GMW_Geocoder.prototype.getLocationFieldValue=function(e,o){return o.indexOf(".")>-1?GMW.get_field_by_string(e,o):"undefined"!=typeof e[o]?e[o]:""},GMW_Geocoder.prototype.getLocationFields=function(e){var o=this,t=this.defaultFields,a=Object.keys(this.locationFields).length,n=0;jQuery.each(this.locationFields,function(r,i){if(jQuery.isArray(i))for(var s=0,d=i.length;d+1>s;++s)if(d>s){if(t[r]=o.getLocationFieldValue(e,i[s]),""!=t[r])return void n++}else n++;else t[r]=o.getLocationFieldValue(e,i),n++;return n==a?(t.street=t.street_number+" "+t.street_name,t.latitude=t.lat=parseFloat(t.lat),t.longitude=t.lng=parseFloat(t.lng),t):void 0})},GMW_Geocoder.prototype.getGeocodingLevel=function(e){return e.street_name.trim()?"street":e.city.trim()?"city":e.postcode.trim()?"postcode":e.region_name.trim()||e.region_code.trim()?"region":e.country_name.trim()||e.country_code.trim()?"country":""},GMW_Geocoder.prototype.getMissingData=function(e){return""==e.region_name.trim()&&""!=e.region_code.trim()&&GMW_Geocoders.regions[e.region_code]&&(e.region_name=GMW_Geocoders.regions[e.region_code]),""==e.region_code.trim()&&""!=e.region_name.trim()&&jQuery.each(GMW_Geocoders.regions,function(o,t){return e.region_name==t?(e.region_code=o,!1):void 0}),""==e.country_name.trim()&&""!=e.country_code.trim()&&GMW_Geocoders.countries[e.country_code]&&(e.country_name=GMW_Geocoders.countries[e.country_code]),""==e.country_code.trim()&&""!=e.country_name.trim()&&jQuery.each(GMW_Geocoders.countries,function(o,t){return e.country_name==t?(e.country_code=o,!1):void 0}),e},GMW_Geocoder.prototype.geocodeSuccess=function(e,o){this.response.status="OK",e=jQuery.extend(this.defaultFields,this.getLocationFields(e)),"usa"==e.country_code.toLowerCase()&&(e.country_code="US"),"united states of america"==e.country_name.toLowerCase()&&(e.country_name="United States"),e.region_code=e.region_code.toUpperCase(),e.country_code=e.country_code.toUpperCase(),e.level=this.getGeocodingLevel(e),(""==e.country_code.trim()||""==e.country_name.trim()||""==e.region_name.trim()||""==e.region_code.trim())&&(e=this.getMissingData(e)),this.response.result=e,this.response.result=GMW.apply_filters("gmw_geocoder_result_on_success",this.response.result,this.response),console.log("Geocoder results:"),console.log(this.response),o(this.response,"OK")},jQuery(".gmw-current-location-wrapper").length)var GMW_Current_Location={messages:{geocoder_failed:"Geocoder failed due to: ",no_address:"Enter an address."},object_id:!1,ajax:{},init:function(){jQuery(".gmw-cl-form-trigger").click(function(e){e.preventDefault(),jQuery(this).closest(".gmw-cl-form-wrapper").find("form").slideToggle()}),jQuery(".gmw-cl-clear-location-trigger").click(function(e){e.preventDefault(),GMW_Current_Location.object_id=jQuery(this).closest(".gmw-cl-form-wrapper").data("element-id"),GMW_Current_Location.delete_location()}),jQuery(".gmw-cl-locator-trigger").click(function(e){e.preventDefault(),GMW_Current_Location.object_id=jQuery(this).closest("form").data("element-id"),jQuery(".gmw-cl-address-input").prop("readonly",!0),jQuery(".gmw-cl-form-submit").removeClass("gmw-icon-search").addClass("gmw-icon-spin-light animate-spin");var o=jQuery("#gmw-cl-message-"+GMW_Current_Location.object_id).data("loading_message");0!=o&&0!==o.length&&jQuery("#gmw-cl-respond-wrapper-"+GMW_Current_Location.object_id).slideDown("fast",function(){jQuery("#gmw-cl-message-"+GMW_Current_Location.object_id).addClass("locating").html(o)}),GMW.auto_locator("cl_locator",GMW_Current_Location.auto_locator_success,GMW_Current_Location.geocoder_failed)}),jQuery(".gmw-cl-address-input").bind("keypress",function(e){13==e.keyCode&&jQuery(this).closest("form").find(".gmw-cl-form-submit").click()}),jQuery(".gmw-cl-form-submit").click(function(e){if(e.preventDefault(),GMW_Current_Location.object_id=jQuery(this).closest("form").data("element-id"),0===jQuery("#gmw-cl-address-input-"+GMW_Current_Location.object_id).val().length)return alert(GMW_Current_Location.messages.no_address),!1;jQuery(".gmw-cl-address-input").prop("readonly",!0),jQuery(".gmw-cl-form-submit").removeClass("gmw-icon-search").addClass("gmw-icon-spin-light animate-spin");var o=jQuery("#gmw-cl-message-"+GMW_Current_Location.object_id).data("loading_message");0!=o&&0!==o.length&&jQuery("#gmw-cl-respond-wrapper-"+GMW_Current_Location.object_id).slideDown("fast",function(){jQuery("#gmw-cl-message-"+GMW_Current_Location.object_id).addClass("locating").html(o)});var t=jQuery("#gmw-cl-address-input-"+GMW_Current_Location.object_id).val();GMW.geocoder(t,GMW_Current_Location.address_geocoder_success,GMW_Current_Location.geocoder_failed)})},delete_location:function(e){jQuery.each(GMW.current_location_fields,function(e,o){GMW.delete_cookie("gmw_ul_"+o)}),jQuery(".gmw-cl-address .address-holder").html(""),jQuery(".gmw-cl-element.gmw-cl-address-wrapper").slideUp(),jQuery(".gmw-map-wrapper.current_location").fadeOut(),jQuery(".gmw-cl-form-trigger, .gmw-cl-clear-location-trigger").slideUp(),jQuery(".gmw-cl-form").slideDown()},save_location:function(){GMW_Current_Location.ajax=jQuery.ajax({type:"POST",url:gmwVars.ajaxUrl,dataType:"json",data:{action:"gmw_update_current_location",form_values:jQuery("#gmw-current-location-hidden-form").serialize(),security:gmw_cl_nonce},success:function(e){if("undefined"!=typeof GMW_Maps&&"undefined"!=typeof GMW_Maps[GMW_Current_Location.object_id]){var o=GMW_Current_Location.object_id,t=GMW_Maps[o],a=t.latLng(e.lat,e.lng);t.setMarkerPosition(t.user_marker,a,t),t.map.panTo(a)}newAddress=jQuery("#gmw-cl-address-input-"+GMW_Current_Location.object_id).val(),jQuery(".gmw-cl-address .address-holder").html(newAddress)}}).fail(function(e){window.console&&window.console.log&&(e.responseText&&console.log(e.responseText),console.log(e))}),GMW_Current_Location.ajax.done(function(e){setTimeout(function(){jQuery(".gmw-cl-respond-wrapper").slideUp(),jQuery(".gmw-cl-address-input").prop("readonly",!1),jQuery(".gmw-cl-form-submit").removeClass("gmw-icon-spin-light animate-spin").addClass("gmw-icon-search")},500)})},submit_location:function(){setTimeout(function(){1==jQuery("#gmw-cl-form-wrapper-"+GMW_Current_Location.object_id).data("ajax_enabled")?GMW_Current_Location.save_location():jQuery("#gmw-current-location-hidden-form").submit()},3500)},auto_locator_success:function(e){jQuery("#gmw-cl-address-input-"+GMW_Current_Location.object_id).val(e.formatted_address),GMW_Current_Location.submit_location()},address_geocoder_success:function(e){GMW.save_location_fields(e),GMW_Current_Location.submit_location()},geocoder_failed:function(e){jQuery("#gmw-cl-respond-wrapper-"+GMW_Current_Location.object_id).slideDown(function(){jQuery("#gmw-cl-message-"+GMW_Current_Location.object_id).addClass("error").html(GMW_Current_Location.messages.geocoder_failed+e)}),setTimeout(function(){jQuery(".gmw-cl-respond-wrapper").slideUp(),jQuery(".gmw-cl-message").removeClass("error").html(""),jQuery(".gmw-cl-address-input").prop("readonly",!1),jQuery(".gmw-cl-form-submit").removeClass("gmw-icon-spin-light animate-spin").addClass("gmw-icon-search")},3e3)}};jQuery(document).ready(function(e){0==gmwVars.isAdmin&&(GMW.init(),e(".gmw-current-location-wrapper").length&&GMW_Current_Location.init())});
[+]
..
[-] gmw.directions.min.js
[edit]
[-] gmw.core.js
[edit]
[-] gmw.min.js
[edit]
[-] gmw.core.min.js
[edit]
[-] gmw.current.location.js
[edit]
[-] gmw.admin.js
[edit]
[-] gmw.map.min.js
[edit]
[-] gmw.geocoder.js
[edit]
[-] gmw.extensions.min.js
[edit]
[-] gmw.admin.min.js
[edit]
[-] gmw.js
[edit]
[-] gmw.map.js
[edit]
[-] gmw.directions.js
[edit]
[-] gmw.extensions.js
[edit]