!function(t){"use strict";function e(t,i,r){this.extend(e,google.maps.OverlayView),this.map_=t,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var s=r||{};this.gridSize_=s.gridSize||60,this.minClusterSize_=s.minimumClusterSize||2,this.maxZoom_=s.maxZoom||null,this.styles_=s.styles||[],this.imagePath_=s.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=s.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,void 0!=s.zoomOnClick&&(this.zoomOnClick_=s.zoomOnClick),this.averageCenter_=!1,void 0!=s.averageCenter&&(this.averageCenter_=s.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var o=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var t=o.map_.getZoom();o.prevZoom_!=t&&(o.prevZoom_=t,o.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){o.redraw()}),i&&i.length&&this.addMarkers(i,!1)}function i(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new r(this,t.getStyles(),t.getGridSize())}function r(t,e,i){t.getMarkerClusterer().extend(r,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}var s,o=function(){return s||(s=t.Deferred(),window.wkInitializeGoogleMapsApi=s.resolve,t.getScript("//maps.google.com/maps/api/js?callback=wkInitializeGoogleMapsApi&key="+(window.GOOGLE_MAPS_API_KEY||""))),s.promise()};t(function(){t('script[type="widgetkit/map"]').each(function(){var i=t(this),r=t("
").attr(i.data()),s=JSON.parse(this.innerHTML);i.replaceWith(r),o().then(function(){var i,o,n,a,h,p=s.markers,l=[],u=window.MapsMarkerHelper||!1;Object.keys(s).forEach(function(t){isNaN(s[t])||(s[t]=Number(s[t]))}),n=p.length?new google.maps.LatLng(p[0].lat,p[0].lng):new google.maps.LatLng((-34.397),150.644),o={zoom:parseInt(s.zoom,10),center:n,streetViewControl:s.mapctrl,navigationControl:s.mapctrl,scrollwheel:s.zoomwheel,draggable:s.draggable,mapTypeId:google.maps.MapTypeId[s.maptypeid.toUpperCase()],mapTypeControl:s.maptypecontrol,zoomControl:s.zoomcontrol,disableDefaultUI:s.disabledefaultui,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,mapTypeIds:["styled_map",google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE]},zoomControlOptions:{style:s.mapctrl?google.maps.ZoomControlStyle.DEFAULT:google.maps.ZoomControlStyle.SMALL}},i=new google.maps.Map(r[0],o),r.data("googlemap",i).on("display.uk.check",function(){google.maps.event.trigger(i,"resize")}),p.length&&s.directions&&(a=t('').css({padding:"5px 1px","text-decoration":"none"}),h=t("
").css({"-webkit-background-clip":"padding-box",padding:"1px 4px",backgroundColor:"white",borderColor:"rgba(0, 0, 0, 0.14902)",borderStyle:"solid",borderWidth:"1px",cursor:"pointer",textAlign:"center",fontFamily:"Roboto, Arial, sans-serif",fontWeight:500,boxShadow:"rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px",index:1}),h.html(''+(s.directionsText||"Get Directions")+""),a.append(h),a.setHref=function(t,e){this.attr("href","http://maps.google.com/?daddr="+t+","+e)},i.controls[google.maps.ControlPosition.TOP_RIGHT].push(a[0])),p.length&&s.marker&&(p.forEach(function(t,e){var r,o=new google.maps.Marker({position:new google.maps.LatLng(t.lat,t.lng),map:i,title:t.title});(u&&t.icon||s.marker_icon)&&u.setIcon(o,t.icon||s.marker_icon),l.push(o),s.marker>=1&&(r=new google.maps.InfoWindow({content:t.content,maxWidth:s.popup_max_width?parseInt(s.popup_max_width,10):300}),google.maps.event.addListener(o,"click",function(){t.content&&r.open(i,o),a&&(a.setHref(t.lat,t.lng),a.show())}),0===e&&(3===s.marker&&t.content&&r.open(i,o),a&&(a.setHref(t.lat,t.lng),a.show())))}),i.panTo(new google.maps.LatLng(p[0].lat,p[0].lng))),s.markercluster&&(this.markerCluster=new e(i,l));var g=new google.maps.StyledMapType([{featureType:"all",elementType:"all",stylers:[{invert_lightness:s.styler_invert_lightness},{hue:s.styler_hue},{saturation:s.styler_saturation},{lightness:s.styler_lightness},{gamma:s.styler_gamma}]}],{name:"Styled"});i.mapTypes.set("styled_map",g),"ROADMAP"==s.maptypeid.toUpperCase()&&i.setMapTypeId("styled_map")})})}),e.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://raw.githubusercontent.com/googlemaps/js-marker-clusterer/gh-pages/images/m",e.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",e.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},e.prototype.onAdd=function(){this.setReady_(!0)},e.prototype.draw=function(){},e.prototype.setupStyles_=function(){if(!this.styles_.length)for(var t,e=0;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})},e.prototype.fitMapToMarkers=function(){for(var t,e=this.getMarkers(),i=new google.maps.LatLngBounds,r=0;t=e[r];r++)i.extend(t.getPosition());this.map_.fitBounds(i)},e.prototype.setStyles=function(t){this.styles_=t},e.prototype.getStyles=function(){return this.styles_},e.prototype.isZoomOnClick=function(){return this.zoomOnClick_},e.prototype.isAverageCenter=function(){return this.averageCenter_},e.prototype.getMarkers=function(){return this.markers_},e.prototype.getTotalMarkers=function(){return this.markers_.length},e.prototype.setMaxZoom=function(t){this.maxZoom_=t},e.prototype.getMaxZoom=function(){return this.maxZoom_},e.prototype.calculator_=function(t,e){for(var i=0,r=t.length,s=r;0!==s;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:r,index:i}},e.prototype.setCalculator=function(t){this.calculator_=t},e.prototype.getCalculator=function(){return this.calculator_},e.prototype.addMarkers=function(t,e){for(var i,r=0;i=t[r];r++)this.pushMarkerTo_(i);e||this.redraw()},e.prototype.pushMarkerTo_=function(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)},e.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw()},e.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i,r=0;i=this.markers_[r];r++)if(i==t){e=r;break}return e!=-1&&(t.setMap(null),this.markers_.splice(e,1),!0)},e.prototype.removeMarker=function(t,e){var i=this.removeMarker_(t);return!(e||!i)&&(this.resetViewport(),this.redraw(),!0)},e.prototype.removeMarkers=function(t,e){for(var i,r=!1,s=0;i=t[s];s++){var o=this.removeMarker_(i);r=r||o}if(!e&&r)return this.resetViewport(),this.redraw(),!0},e.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},e.prototype.getTotalClusters=function(){return this.clusters_.length},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_=t},e.prototype.getGridSize=function(){return this.gridSize_},e.prototype.setGridSize=function(t){this.gridSize_=t},e.prototype.getMinClusterSize=function(){return this.minClusterSize_},e.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},e.prototype.getExtendedBounds=function(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),r=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var o=e.fromLatLngToDivPixel(r);o.x-=this.gridSize_,o.y+=this.gridSize_;var n=e.fromDivPixelToLatLng(s),a=e.fromDivPixelToLatLng(o);return t.extend(n),t.extend(a),t},e.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},e.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},e.prototype.resetViewport=function(t){for(var e,i=0;e=this.clusters_[i];i++)e.remove();for(var r,i=0;r=this.markers_[i];i++)r.isAdded=!1,t&&r.setMap(null);this.clusters_=[]},e.prototype.repaint=function(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var e,i=0;e=t[i];i++)e.remove()},0)},e.prototype.redraw=function(){this.createClusters_()},e.prototype.distanceBetweenPoints_=function(t,e){if(!t||!e)return 0;var i=6371,r=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),n=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)),a=i*n;return a},e.prototype.addToClosestCluster_=function(t){for(var e,r=4e4,s=null,o=(t.getPosition(),0);e=this.clusters_[o];o++){var n=e.getCenter();if(n){var a=this.distanceBetweenPoints_(n,t.getPosition());a=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0},i.prototype.getMarkerClusterer=function(){return this.markerClusterer_},i.prototype.getBounds=function(){for(var t,e=new google.maps.LatLngBounds(this.center_,this.center_),i=this.getMarkers(),r=0;t=i[r];r++)e.extend(t.getPosition());return e},i.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},i.prototype.getSize=function(){return this.markers_.length},i.prototype.getMarkers=function(){return this.markers_},i.prototype.getCenter=function(){return this.center_},i.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},i.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},i.prototype.getMap=function(){return this.map_},i.prototype.updateIcon=function(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e)for(var i,r=0;i=this.markers_[r];r++)i.setMap(this.map_);else{if(this.markers_.length0&&this.anchor_[0]0&&this.anchor_[1] '},parseColor:function(e){var s,a;return a=(s=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(e))?[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16),1]:(s=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(e))?[17*parseInt(s[1],16),17*parseInt(s[2],16),17*parseInt(s[3],16),1]:(s=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))?[parseInt(s[1]),parseInt(s[2]),parseInt(s[3]),1]:(s=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(e))?[parseInt(s[1],10),parseInt(s[2],10),parseInt(s[3],10),parseFloat(s[4])]:this.colors[e]||[230,88,87,1],"rgba("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},setIcon:function(e,s){var a,r=new google.maps.Point(11,40),t=function(){e.setIcon({url:a,anchor:r})};if(!s.trim())return a="https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png",t();if(s.indexOf("/")!=-1){var n=new Image;n.onload=function(){a=n.src,r=new google.maps.Point(Math.ceil(n.width/2),n.height),t()},n.onerror=function(){return a="https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png",t()},n.src=s}else a="data:image/svg+xml;base64,"+btoa(this.getSVG.apply(this,s.split(" "))),r=new google.maps.Point(11,34),t()}};