"use strict";var Scripts,searchMap,eventOverviewViewModel;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){this.Id=n;this.Title=t;this.Subtitle=i;this.Date=r;this.EndDate=u;this.Color=f;this.EventType=e;this.EventLocationType=o;this.Url=s;this.ImageUrl=h;this.Latitude=c;this.Longitude=l;this.Street=a;this.Number=v;this.City=y;this.Timing=p;this.Address=w}return n}();n.Event=t})(t=n.Events||(n.Events={}))})(t=n.Components||(n.Components={}))})(Scripts||(Scripts={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this.events=[];this.totalNumberOfResults=0;this.events=t;this.totalNumberOfResults=n}return n}();n.SearchResult=t})(t=n.Events||(n.Events={}))})(t=n.Components||(n.Components={}))}(Scripts||(Scripts={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n){this.showHiddenEvents=n;this.apiLocation="/api/sitecore/Events/"}return t.prototype.search=function(t,i,r,u){$.ajax({url:this.apiLocation+"FilteredEvents?region="+t+"&eventtype="+i+"&numberOfEvents="+r+"&showHiddenEvents="+this.showHiddenEvents,dataType:"json",cache:!1,ifModified:!1,success:function(t){for(var f=[],i=null,r=0;r<t.Events.length;r++)i=t.Events[r],f.push(new n.Components.Events.Event(i.Id,i.Title,i.Subtitle,i.Date,i.EndDate,i.Color,i.EventType,i.EventLocationType,i.Url,i.ImageUrl,i.Latitude,i.Longitude,i.Street,i.Number,i.City,i.Timing,i.Address));u(new n.Components.Events.SearchResult(t.TotalNumberOfItems,f))}})},t}();t.EventSearchService=i})(i=t.Events||(t.Events={}))})(t=n.Components||(n.Components={}))}(Scripts||(Scripts={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i){this.searchService=n;this.onSearchLoaded=i;this.events=ko.observableArray();this.numberOfItemsToShowPerLoad=ko.observable(t);this.numberOfItems=ko.observable(t);this.numberOfItemsToLoadNext=ko.observable(t);this.totalNumberOfItems=ko.observable(1e3);this.region=ko.observable("");this.eventtype=ko.observable("");this.isLoading=ko.observable(!1)}return n.prototype.search=function(){this.isLoading(!0);this.getValuesFromInput();this.searchService.search(this.region(),this.eventtype(),this.numberOfItemsToLoadNext(),this.showResults.bind(this))},n.prototype.loadMore=function(){this.isLoading(!0);this.getValuesFromInput();this.windowXBeforeScrolling=window.scrollX;this.windowYBeforeScrolling=window.scrollY;this.numberOfItemsToLoadNext(this.numberOfItemsToLoadNext()+this.numberOfItemsToShowPerLoad());this.searchService.search(this.region(),this.eventtype(),this.numberOfItemsToLoadNext(),this.showResults.bind(this))},n.prototype.showResults=function(n){this.events(n.events);this.numberOfItems(n.events.length);this.totalNumberOfItems(n.totalNumberOfResults);this.onSearchLoaded(n.events);this.isLoading(!1);window.scrollTo(this.windowXBeforeScrolling,this.windowYBeforeScrolling)},n.prototype.getValuesFromInput=function(){this.region($("#eventregion").val());this.eventtype($("#eventtype").val())},n}();n.EventOverviewViewModel=t})(t=n.Events||(n.Events={}))})(t=n.Components||(n.Components={}))}(Scripts||(Scripts={}));searchMap=null;eventOverviewViewModel=null;$(document).ready(function(){var n=$("#event_search_filter"),t=parseInt(n.attr("data-NumberOfItemsToShow")),i=n.attr("data-showHiddenEvents");eventOverviewViewModel=new Scripts.Components.Events.EventOverviewViewModel(new Scripts.Components.Events.EventSearchService(i),t,function(){var n,t,i;chopstickBlazy();chopstickBlocklink();n=$("[data-mh='event-teaser']");n.matchHeight({remove:!0});n.matchHeight();t=$("[data-mh='event-title']");t.matchHeight({remove:!0});t.matchHeight();$.fn.matchHeight._update();i=[];$("div[data-type='event']").each(function(){i.push($(this).attr("id"))});$.get("/api/sitecore/Events/Events",{ids:i},function(n){for(var r=[],t,i=0;i<n.length;i++)t=n[i],t.Latitude&&r.push({id:t.Id,tooltip:'<div class="p-i-map-tooltip-main"><a class="p-i-map-tooltip-image-link" href="'+t.Url+'"><figure class="p-i-map-mask"><img class="p-i-map-tooltip-image" src="'+t.ImageUrl+'" /><\/figure><\/a><h3 class="c-card__title u-plr-gamma p-i-map-tooltip-title-wrapper"><a href="'+t.Url+'" class="c-card__link p-i-map-tooltip-title"><span class="u-color-alpha-base">'+t.City+"<\/span> "+t.Title+'<\/a><\/h3><p class="c-card__text u-plr-beta"><a href="'+t.Url+'" class="c-link c-link--neutral c-map-markers__link p-i-map-tooltip-address">'+t.Street+" "+t.Number+", "+t.City+'<\/a><\/p><div class="c-card__criteria p-i-map-tooltip-criteria"><\/div><\/div>',address:t.Street+" "+t.Number+", "+t.City,latitude:t.Latitude,longitude:t.Longitude,markerType:"event",link:t.Url,icon:"/Design/img/png/marker-orange.png",iconHover:"/Design/img/png/marker-blue.png",iconViewed:"/Design/img/png/marker-orange.png",iconPerfectMatch:"/Design/img/png/marker-orange.png",iconActive:"/Design/img/png/marker-blue.png",isPerfect:!0});searchMap=new interactiveMapGoogle("interactive-map",r,{center:{lat:51.117077,lng:3.715433},zoom:11,mapTypeControl:!1,styles:[{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{visibility:"on"},{color:"#4ba4df"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#4ba4df"}]},{featureType:"administrative.province",elementType:"labels.text.fill",stylers:[{color:"#6d6d6d"},{visibility:"on"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#555555"}]},{featureType:"administrative.neighborhood",elementType:"labels.text.fill",stylers:[{color:"#999999"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"landscape.natural",elementType:"geometry.fill",stylers:[{visibility:"on"}]},{featureType:"landscape.natural.landcover",elementType:"geometry.fill",stylers:[{visibility:"on"}]},{featureType:"poi.attraction",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.business",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.government",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.medical",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#e1eddd"}]},{featureType:"poi.place_of_worship",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.school",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.sports_complex",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"road",elementType:"all",stylers:[{saturation:"-100"},{lightness:"45"}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#f2f2f2"}]},{featureType:"road.highway",elementType:"labels.icon",stylers:[{visibility:"on"},{hue:"#c6e7fd"},{saturation:"100"},{lightness:"5"}]},{featureType:"road.highway.controlled_access",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"road.highway.controlled_access",elementType:"geometry.fill",stylers:[{color:"#f2f2f2"}]},{featureType:"road.highway.controlled_access",elementType:"geometry.stroke",stylers:[{visibility:"off"}]},{featureType:"road.highway.controlled_access",elementType:"labels.icon",stylers:[{lightness:"1"},{saturation:"100"},{hue:"#c6e7fd"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#8a8a8a"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{color:"#ffffff"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"transit.station.airport",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"transit.station.airport",elementType:"geometry.fill",stylers:[{lightness:"33"},{saturation:"-100"},{visibility:"on"}]},{featureType:"transit.station.bus",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"transit.station.rail",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"water",elementType:"all",stylers:[{color:"#c6e7fd"},{visibility:"on"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#c6e7fd"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#ffffff"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{visibility:"off"}]}]},700,".c-map-markers__hover",".c-map-markers__link")})});ko.applyBindings(eventOverviewViewModel);eventOverviewViewModel.search()})