Server : Apache System : Linux ls31.server.ly 3.10.0-962.3.2.lve1.5.68.el7.x86_64 #1 SMP Wed Apr 6 11:12:23 UTC 2022 x86_64 User : medchoco ( 2906) PHP Version : 8.3.16 Disable Function : mail Directory : /home/medchoco/www/wp-content/themes/puca/js/admin/ |
Upload File : |
"use strict";!function(b,c,d,f){function g(a,c){this.options=b.extend(!0,{},e,c),this.input=a,this.$input=b(a),this._defaults=e,this._name="geocomplete",this.init()}var e={bounds:!0,country:null,map:!1,details:!1,detailsAttribute:"name",location:!1,mapOptions:{zoom:14,scrollwheel:!1,mapTypeId:"roadmap"},markerOptions:{draggable:!1},maxZoom:16,types:["geocode"],blur:!1},h=["street_address","route","intersection","political","country","administrative_area_level_1","administrative_area_level_2","administrative_area_level_3","colloquial_area","locality","sublocality","neighborhood","premise","subpremise","postal_code","natural_feature","airport","park","point_of_interest","post_box","street_number","floor","room","lat","lng","viewport","location","formatted_address","location_type","bounds"],a=["id","url","website","vicinity","reference","name","rating","international_phone_number","icon","formatted_phone_number"];b.extend(g.prototype,{init:function(){this.initMap(),this.initMarker(),this.initGeocoder(),this.initDetails(),this.initLocation()},initMap:function(){if(this.options.map){if("function"==typeof this.options.map.setCenter)return this.map=this.options.map,f;this.map=new google.maps.Map(b(this.options.map)[0],this.options.mapOptions),google.maps.event.addListener(this.map,"click",b.proxy(this.mapClicked,this))}},initMarker:function(){if(this.map){var a=b.extend(this.options.markerOptions,{map:this.map});a.disabled||(this.marker=new google.maps.Marker(a),google.maps.event.addListener(this.marker,"dragend",b.proxy(this.markerDragged,this)))}},initGeocoder:function(){var a={types:this.options.types,bounds:!0===this.options.bounds?null:this.options.bounds,componentRestrictions:this.options.componentRestrictions};this.options.country&&(a.componentRestrictions={country:this.options.country}),this.autocomplete=new google.maps.places.Autocomplete(this.input,a),this.geocoder=new google.maps.Geocoder,this.map&&!0===this.options.bounds&&this.autocomplete.bindTo("bounds",this.map),google.maps.event.addListener(this.autocomplete,"place_changed",b.proxy(this.placeChanged,this)),this.$input.keypress(function(a){return 13!==a.keyCode&&f}),this.$input.bind("geocode",b.proxy(function(){this.find()},this)),!0===this.options.blur&&this.$input.blur(b.proxy(function(){this.find()},this))},initDetails:function(){function c(a){e[a]=d.find("["+f+"="+a+"]")}if(this.options.details){var d=b(this.options.details),f=this.options.detailsAttribute,e={};b.each(h,function(a,b){c(b),c(b+"_short")}),b.each(a,function(a,b){c(b)}),this.$details=d,this.details=e}},initLocation:function(){var a,b=this.options.location;if(b){if("string"==typeof b)return this.find(b),f;b instanceof Array&&(a=new google.maps.LatLng(b[0],b[1])),b instanceof google.maps.LatLng&&(a=b),a&&(this.map&&this.map.setCenter(a),this.marker&&this.marker.setPosition(a))}},find:function(a){this.geocode({address:a||this.$input.val()})},geocode:function(a){this.options.bounds&&!a.bounds&&(a.bounds=!0===this.options.bounds?this.map&&this.map.getBounds():this.options.bounds),this.options.country&&(a.region=this.options.country),this.geocoder.geocode(a,b.proxy(this.handleGeocode,this))},handleGeocode:function(a,b){if(b===google.maps.GeocoderStatus.OK){var c=a[0];this.$input.val(c.formatted_address),this.update(c),1<a.length&&this.trigger("geocode:multiple",a)}else this.trigger("geocode:error",b)},trigger:function(a,b){this.$input.trigger(a,[b])},center:function(a){a.viewport?(this.map.fitBounds(a.viewport),this.map.getZoom()>this.options.maxZoom&&this.map.setZoom(this.options.maxZoom)):(this.map.setZoom(this.options.maxZoom),this.map.setCenter(a.location)),this.marker&&(this.marker.setPosition(a.location),this.marker.setAnimation(this.options.markerOptions.animation))},update:function(a){this.map&&this.center(a.geometry),this.$details&&this.fillDetails(a),this.trigger("geocode:result",a)},fillDetails:function(c){var d={},f=c.geometry,e=f.viewport,g=f.bounds;b.each(c.address_components,function(a,b){var c=b.types[0];d[c]=b.long_name,d[c+"_short"]=b.short_name}),b.each(a,function(a,b){d[b]=c[b]}),b.extend(d,{formatted_address:c.formatted_address,location_type:f.location_type||"PLACES",viewport:e,bounds:g,location:f.location,lat:f.location.lat(),lng:f.location.lng()}),b.each(this.details,b.proxy(function(a,b){var c=d[a];this.setDetail(b,c)},this)),this.data=d},setDetail:function(a,b){b===f?b="":"function"==typeof b.toUrlValue&&(b=b.toUrlValue()),a.is(":input")?a.val(b):a.text(b)},markerDragged:function(a){this.trigger("geocode:dragged",a.latLng)},mapClicked:function(a){this.trigger("geocode:click",a.latLng)},resetMarker:function(){this.marker.setPosition(this.data.location),this.setDetail(this.details.lat,this.data.location.lat()),this.setDetail(this.details.lng,this.data.location.lng())},placeChanged:function(){var a=this.autocomplete.getPlace();a.geometry?this.update(a):this.find(a.name)}}),b.fn.geocomplete=function(a){if("string"==typeof a){var c=b(this).data("plugin_geocomplete")||b(this).geocomplete().data("plugin_geocomplete"),d=c[a];return"function"==typeof d?(d.apply(c,Array.prototype.slice.call(arguments,1)),b(this)):(2==arguments.length&&(d=arguments[1]),d)}return this.each(function(){var c=b.data(this,"plugin_geocomplete");c||(c=new g(this,a),b.data(this,"plugin_geocomplete",c))})}}(jQuery);