text: "use strict";var map,infoWindow,initMaps=function(){console.log("Google Maps Successfully loaded!"),map=new google.maps.Map(document.getElementById("map"),{center:{lat:40.708116,lng:-73.95707},zoom:12,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,position:google.maps.ControlPosition.TOP_RIGHT,mapTypeIds:["roadmap","terrain","styled_tron","styled_vibrant"]}}),infoWindow=new google.maps.InfoWindow({maxWidth:400,maxHeight:570});var a=new google.maps.StyledMapType([{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"off"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.man_made",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.natural",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.landcover",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.terrain",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#00ffff"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#00fbff"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:.2}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway.controlled_access",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#00fffb"},{lightness:18}]},{featureType:"road.arterial",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#00ffff"},{lightness:16}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19},{visibility:"off"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{visibility:"off"}]},{featureType:"transit.line",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.station",elementType:"labels",stylers:[{visibility:"on"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000303"},{lightness:17}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"off"}]}],{name:"Tron"}),b=new google.maps.StyledMapType([{featureType:"water",stylers:[{color:"#19a0d8"}]},{featureType:"administrative",elementType:"labels.text.stroke",stylers:[{color:"#ffffff"},{weight:6}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#e85113"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#efe9e4"},{lightness:-40}]},{featureType:"transit.station",stylers:[{weight:9},{hue:"#e85113"}]},{featureType:"road.highway",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{lightness:100}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{lightness:-100}]},{featureType:"poi",elementType:"geometry",stylers:[{visibility:"on"},{color:"#f0e4d3"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#efe9e4"},{lightness:-25}]}],{name:"Vibrant"});map.mapTypes.set("styled_tron",a),map.setMapTypeId("styled_tron"),map.mapTypes.set("styled_vibrant",b),map.setMapTypeId("styled_vibrant");var c=new google.maps.TrafficLayer;document.getElementById("toggle-traffic").addEventListener("click",function(){d()});var d=function(){null==c.getMap()?c.setMap(map):c.setMap(null)};ko.applyBindings(new ViewModel)},mapsErrorHandler=function(){console.log("Google maps api failed to load");var a="<h1> Hello User! </h1><h2>The map did not load properly, please refresh and try again.</h2>";$("#map").html(a)},ViewModel=function(){var a=this;a.venueList=ko.observableArray([]),a.filteredVenueList=ko.observableArray([]),a.filter=ko.observable(""),a.buildVenueLocations=function(){venueLocations.forEach(function(b){a.venueList.push(new Venue(b))})},a.setVenueClickFunctions=function(){a.venueList().forEach(function(b){google.maps.event.addListener(b.marker(),"click",function(){a.venueClick(b)})})},a.venueClick=function(b){infoWindow.open(map,b.marker());var c=$(".gm-style-iw").parent();c.stop().hide(),c.fadeIn(1500),map.panTo({lat:b.lat(),lng:b.lng()}),map.setZoom(13),map.panBy(0,-250),a.getYelpData(b),a.setMarkerAnimation(b)},a.setMarkerAnimation=function(a){a.marker().setAnimation(google.maps.Animation.BOUNCE),setTimeout(function(){a.marker().setAnimation(null)},1400)},a.filterVenues=ko.computed(function(b){a.filteredVenueList([]);var c=a.filter().toLowerCase();$.each(a.venueList(),function(b){var d=a.venueList()[b].name().toLowerCase();if(d.indexOf(c)>-1){a.filteredVenueList.push(a.venueList()[b]),a.venueList()[b].marker().setMap(map);var e=a.venueList()[b].marker().getPosition();map.panTo(e)}else a.venueList()[b].marker().setMap(null)})},a),a.getYelpData=function(a){function d(){return Math.floor(1e12*Math.random()).toString()}var b="GET",c="https://api.yelp.com/v2/search/",e="Ff-UjdYVgCfiI2lXXqK6ZA",f="ayaZ2gPDYwTORpJ3EgnlnI8sEGc",g="iT9LEQqPxqNuvL8cFVyTSSAlYFJer9Jd",h="Hro-TZlsX2NHIe7SWC0f2n5HquE",i={oauth_consumer_key:e,oauth_token:g,oauth_nonce:d(),oauth_timestamp:Math.floor(Date.now()/1e3),oauth_signature_method:"HMAC-SHA1",oauth_version:"1.0",callback:"cb",term:a.name(),location:"Brooklyn, NY"},j=oauthSignature.generate(b,c,i,f,h);i.oauth_signature=j;var k={url:c,data:i,cache:!0,dataType:"jsonp",success:function(b,c){console.log("YELP Search API Request: "+c);var d=b.businesses[0],e='<div class="infoWindow-styling"><div class="venue-header" id="venue-name">'+a.name()+'</div><div class="content-left"><img class="yelp-thumb-image" id="yelp-image" src="'+d.image_url+'"></div><div class="content-right"><p><span class="yelp-rating-image"><img id="yelp-rating" src="'+d.rating_img_url+'"></span><span class="yelp-rating-count" id="yelp-rating-count">'+d.review_count+'</span></p><div class="cta-url"><span><a class="yelp-website" id="yelp-url" target="_blank" href="'+d.url+'">YELP</a></span> </div><p class="venue-neighborhood" id="venue-neighborhood">Hood? '+a.neighborhood()+'</p><p class="venue-address" id="venue-address">'+a.address()+'</p></div><div class="content-fill"><p class="yelp-about" id="yelp-about-snippet">'+d.snippet_text+"</p></div></div>";infoWindow.setContent(e)},error:function(){console.log("YELP Search API Error Status: "+status),infoWindow.setContent('<div class="infoWindow-styling"><p>Error, could not load content</p></div>')}};$.ajax(k)},google.maps.event.addDomListener(window,"load",function(){a.buildVenueLocations(),a.setVenueClickFunctions(),a.filteredVenueList(a.venueList())}),google.maps.event.addDomListener(window,"resize",function(){var a=map.getCenter();google.maps.event.trigger(map,"resize"),map.setCenter(a)}),google.maps.event.addDomListener(infoWindow,"domready",function(){var a=$(".gm-style-iw"),b=a.prev();b.children(":nth-child(2)").css({display:"none"}),b.children(":nth-child(4)").css({display:"none"}),b.children(":nth-child(3)").find("div").children().css({"box-shadow":"#333333 0px 1px 6px","z-index":"0","background-color":"#333333"});var c=a.next();c.css({opacity:"1",width:"19px",height:"19px",right:"30px",top:"17px",border:"3px solid #333333","border-radius":"5px","background-color":"#333333",color:"white"}),c.toggleClass(function(){$(this).css({opacity:"1","background-color":"white"})})})},Venue=function(a){function d(a){var b=new google.maps.MarkerImage("https://chart.googleapis.com/chart?chst=d_map_spin&chld=1.15|0|"+a+"|40|_|%E2%80%A2",new google.maps.Size(21,34),new google.maps.Point(0,0),new google.maps.Point(10,34),new google.maps.Size(21,34));return b}var c,b=this;b.name=ko.observable(a.name),b.lat=ko.observable(a.lat),b.lng=ko.observable(a.lng),b.address=ko.observable(a.address),b.neighborhood=ko.observable(a.neighborhood),b.pid=ko.observable(a.pid);var e=d("44a2a1"),f=d("00BCD4");c=new google.maps.Marker({position:new google.maps.LatLng(b.lat(),b.lng()),map:map,title:b.name(),icon:e,animation:google.maps.Animation.DROP}),c.addListener("mouseover",function(){this.setIcon(f)}),c.addListener("mouseout",function(){this.setIcon(e)}),b.marker=ko.observable(c)};ko.bindingHandlers.fadein={init:function(a,b){var c=b();$(a).toggle(ko.unwrap(c))},update:function(a,b){var c=b();ko.unwrap(c)?$(a).fadeIn():$(a).fadeOut()}};