ips.templates.set("eventLoading"," <li class='ipsBox ipsBox--child event event--withImage event--loading'>  <div class='cEvents__skeleton cEvents__skeleton--eventImage'></div>  <div class='cEvents__details'>   <div class='cEvents__skeleton cEvents__skeleton--eventDate'></div>   <div class='cEvents__skeleton cEvents__skeleton--eventTitle'></div>   <div class='cEvents__skeleton cEvents__skeleton--eventBlurb'></div>  </div> </li>");ips.templates.set("nearMe"," <ul class='eventList nearMe__events'>  <li class='nearMe__map cEvents__skeleton cEvents__skeleton--map' id='map'></li>  {{{events}}} </ul>");;
;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.overview.carousel',{initialize:function(){this.on('mouseenter',this.stopTimer);this.on('mouseleave',this.startTimer);this.on('click','.cFeaturedEvents__dots',this.dotClick);this.setup();},setup:function(){this._scroller=this.scope[0].querySelector('.cFeaturedEvents__scroller');this._dotContainer=this.scope[0].querySelector('.cFeaturedEvents__dots');this.scrollPercentage();this.startTimer();},scrollPercentage:function(){this._scroller.addEventListener('scroll',e=>{let percentage=Math.floor(100*this._scroller.scrollLeft /(this._scroller.scrollWidth-this._scroller.clientWidth));this._dotContainer.style.setProperty('--percentage',percentage);},{passive:true,});},autoPlay:function(){let currentScroll=this._scroller.scrollLeft,carouselChildWidth=this._scroller.firstElementChild.offsetWidth;if((currentScroll>=this._scroller.scrollWidth-this._scroller.clientWidth)){this._scroller.scrollLeft=0;}else{this._scroller.scrollLeft=currentScroll+carouselChildWidth;}
this.startTimer();},dotClick:function(ev){let slide=this.scope[0].querySelector(`.cFeaturedEvents__scroller [data-item='${ev.target.dataset.carouselDot}']`);slide.scrollIntoView({behavior:'smooth',block:'nearest',inline:'start'});},stopTimer:function(){clearInterval(this._timer);},startTimer:function(){this._timer=setTimeout(this.autoPlay.bind(this),5000);}});}(jQuery,_));;
var PER_PAGE=16;;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.overview.eventList',{initialize:function(){this.on('click','[data-action="loadMore"]',this.loadMore);this.on('click','[data-action="changeMonth"]',this.changeMonth);this.setup();},setup:function(){this._eventList=this.scope.find('[data-role="eventList"]');this._loadMore=this.scope.find('[data-action="loadMore"]');this._monthNav=this.scope.find('[data-role="monthNav"]');},loadMore:function(e){e.preventDefault();var placeholders=this.getPlaceholders();this._eventList.append(placeholders);this._loadMore.prop('disabled',true);var self=this;var current=this.getCurrentDate();var total=this.scope.find('[data-eventID]').length;var url=ips.getSetting('baseURL')+'?app=calendar&module=calendar&controller=view&view=overview&get=byMonth&m='+current.month+'&y='+current.year+'&offset='+total;ips.getAjax()(url).done(function(response){self._eventList.append(response.html);self.removePlaceholders();self.checkMoreButton(response.count);self._loadMore.prop('disabled',false);$(document).trigger('contentChange',[self.scope]);});},changeMonth:function(e){e.preventDefault();var placeholders=this.getPlaceholders(4);this._eventList.html(placeholders);this._loadMore.prop('disabled',true);this._monthNav.find('[data-action="changeMonth"]').removeClass('cEvents__monthNav__monthItem--active');$(e.currentTarget).addClass('cEvents__monthNav__monthItem--active');var self=this;var current=this.getCurrentDate();var url=ips.getSetting('baseURL')+'?app=calendar&module=calendar&controller=view&view=overview&get=byMonth&m='+current.month+'&y='+current.year+'&offset=0';ips.getAjax()(url).done(function(response){self._eventList.html(response.html);self.checkMoreButton(response.count);self._loadMore.prop('disabled',false);$(document).trigger('contentChange',[self.scope]);});},getPlaceholders:function(count){var events=[];if(_.isUndefined(count)){count=4;}
for(var i=0;i<count;i++){events.push(ips.templates.render('eventLoading'));}
return events.join('');},removePlaceholders:function(){this.scope.find('.event--loading').remove();},checkMoreButton:function(count){if(_.isNumber(count)&&count<PER_PAGE){this.scope.find('[data-action="loadMore"]').hide();this.scope.find('[data-role="noMoreResults"]').show();}else{this.scope.find('[data-action="loadMore"]').show();this.scope.find('[data-role="noMoreResults"]').hide();}},getCurrentDate:function(){var current=this.scope.find('[data-role="monthNav"] .cEvents__monthNav__monthItem--active');return{month:current.attr('data-month'),year:current.attr('data-year')};}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.overview.nearMe',{useGoogleMaps:false,events:{},useGeolocation:false,initialize:function(){this.setup();this.on('change','input#useCurrentLocation',this.useCurrentLocation);},setup:function(){var self=this;if(ips.utils.geolocation.getGeolocationIsAllowed()){self.scope.find('input[type="checkbox"]').attr('checked',true);this.useGeolocation=true;}
if('nearmeUseGoogle'in this.scope.data()){let apiKey=this.scope.data()['googlemapsApiKey'];if(!apiKey){}
this.useGoogleMaps=true;window.ipsGoogleMapsCallback=this.setupGoogleMaps.bind(self);window.ips.loader.get([`https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=ipsGoogleMapsCallback&v=weekly`]);}
else{$('head').append(`<link rel='stylesheet' type='text/css' media='all' href='https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.css'>
                        <link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v1.0.0/MarkerCluster.css' rel='stylesheet' />
                        <link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v1.0.0/MarkerCluster.Default.css' rel='stylesheet' />
                        <link rel='stylesheet' type='text/css' media='all' href='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css' />`);window.ips.loader.get(['https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.js']).then(()=>ips.loader.get(['https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v1.0.0/leaflet.markercluster.js','https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js'])).then(()=>{if(this.useGeolocation){self.getEventsByLocation();}else{self.fetchEvents();}
self._mapReady=true;});}},googleMap:undefined,setupGoogleMaps:function(){if(this.useGeolocation){this.getEventsByLocation();}else{this.fetchEvents();}
window.ipsGoogleMapsCallback=undefined;this._mapReady=true;},useCurrentLocation:function(){if(this.useGoogleMaps){this.googleMap=false;}
if(this.scope.find('#useCurrentLocation').is(':checked')){this.getEventsByLocation();}else{ips.utils.geolocation.setGeolocationIsAllowed(ips.utils.geolocation.permissions.DENIED);this.fetchEvents();}},getEventsByLocation:function(){this.showPlaceholders();ips.utils.geolocation.getCurrentPosition().then(coords=>{var lat=coords.latitude;var long=coords.longitude;this.scope.find('[data-role="nearMeLink"]').attr('href',ips.getSetting('baseURL')+'?app=calendar&do=search&form_submitted=1&lat='+lat+'&lon='+long).attr('data-lat',lat).attr('data-long',long);this.fetchEvents(lat,long);}).catch(()=>{ips.ui.alert.show({type:'alert',message:ips.getString('event_your_current_location_sorry'),icon:'warn'});this.scope.find('#useCurrentLocation').closest('li').remove();this.fetchEvents();});},fetchEvents:function(lat,long){var self=this;this.showPlaceholders();ips.getAjax()(ips.getSetting('baseURL')+'?app=calendar&module=calendar&controller=view&view=overview&get=nearMe'+(lat&&long?'&lat='+lat+'&lon='+long:'')).done(function(response){self.scope.find('[data-role="locationEvents"]').html(response.content);self.setUpMap(response.lat,response.long);$(document).trigger('contentChange',[self.scope]);});},setUpMap:function(lat,long){var self=this;var mapDiv=this.scope.find('#map');if(!mapDiv.length){Debug.log("No map container");return;}
if(this.useGoogleMaps){lat=Number(lat);long=Number(long);if(!this.googleMap){const mapContainer=mapDiv.get(0);mapContainer.style.width='100%';mapContainer.style.height='400px';this.googleMap=new window.google.maps.Map(mapContainer,{zoom:4,center:{lat,lng:long}});}else{this.googleMap.setCenter({lat,lng:long});}
self.scope.find('[data-role="nearMeLink"]').attr('href',ips.getSetting('baseURL')+'?app=calendar&do=search&form_submitted=1&lat='+lat+'&lon='+long).attr('data-lat',lat).attr('data-long',long);if(this.googleMap){let markers;try{let _markers=JSON.parse(mapDiv.attr('data-markers'));let markers=[];for(let marker of Object.values(_markers)){markers.push({...marker,lat:Number(marker.lat),long:Number(marker.long)});}
for(let marker of Object.values(markers)){let mapMarker=new window.google.maps.Marker({position:{lat:marker.lat,lng:marker.long},map:this.googleMap,title:marker.title});}
if(Object.values(markers).length){const cb=(()=>{let bounds=this.googleMap.getBounds();if(!bounds){return window.setTimeout(cb,200);}
let firstMarker=null;let markerVisible=false;let markerBounds={latMax:null,latMin:null,lngMax:null,lngMin:null};for(let marker of Object.values(markers)){markerBounds.latMax=markerBounds.latMax===null?marker.lat:Math.max(markerBounds.latMax,marker.lat);markerBounds.latMin=markerBounds.latMin===null?marker.lat:Math.min(markerBounds.latMin,marker.lat);markerBounds.lngMax=markerBounds.lngMax===null?marker.long:Math.max(markerBounds.lngMax,marker.long);markerBounds.lngMin=markerBounds.lngMin===null?marker.long:Math.min(markerBounds.lngMin,marker.long);firstMarker=firstMarker||marker;if(bounds.contains({lat:marker.lat,lng:marker.long})){markerVisible=true;}}
if(!markerVisible&&firstMarker){let evtMidpoint={lat:((markerBounds.latMax+markerBounds.latMin)/ 2),lng:((markerBounds.lngMax+markerBounds.lngMin)/ 2)};let minDistance=null;let mostMiddleMarker=null;if(Object.values(markers).length>1){for(let marker of Object.values(markers)){let distance=this.getDistance(evtMidpoint.lat,marker.lat,evtMidpoint.lng,marker.long);if(minDistance===null||distance<minDistance){minDistance=distance;mostMiddleMarker={lat:marker.lat,lng:marker.long};}}}else{mostMiddleMarker={lat:firstMarker.lat,lng:firstMarker.long};}
this.googleMap.panTo(mostMiddleMarker);}}).bind(this);window.setTimeout(cb,0);}}catch(e){}}}else{L.mapbox.accessToken=ips.getSetting('mapApiKey');this._map=L.mapbox.map(mapDiv.get(0)).addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));this._map.zoomControl=false;this._map.minZoom=2;this._map.dragging=false;this._map.zoomControl=false;var markersGroup=new L.featureGroup([]);var markers=$.parseJSON(mapDiv.attr('data-markers'));for(var id in markers){var marker=L.marker([Number(markers[id].lat),Number(markers[id].long)],{title:markers[id].title,draggable:false,eventId:parseInt(id)});markersGroup.addLayer(marker);marker.on('mouseover',_.bind(this._markerMouseOver,this));marker.on('mouseout',_.bind(this._markerMouseOut,this));}
markersGroup.addTo(this._map);this._map.fitBounds(markersGroup.getBounds(),{maxZoom:5});}},getDistance:function(lat1,lat2,lng1,lng2){lng1=lng1*Math.PI / 180;lng2=lng2*Math.PI / 180;lat1=lat1*Math.PI / 180;lat2=lat2*Math.PI / 180;let dlng=lng2-lng1;let dlat=lat2-lat1;let a=Math.pow(Math.sin(dlat / 2),2)
+Math.cos(lat1)*Math.cos(lat2)*Math.pow(Math.sin(dlng / 2),2);let c=Math.asin(Math.sqrt(a));return c;},_markerMouseOver:function(e){var eventId=e.target.options.eventId;this.scope.find('[data-eventid]').stop(false,true);this.scope.find('[data-eventid]:not([data-eventid="'+eventId+'"])').animate({opacity:0.4},'fast');},_markerMouseOut:function(e){this.scope.find('[data-eventid]').stop(false,true);this.scope.find('[data-eventid]').animate({opacity:1},'fast');},showPlaceholders:function(count){var events=[];for(var i=0;i<6;i++){events.push(ips.templates.render('eventLoading'));}
this.scope.find('[data-role="locationEvents"]').removeClass('ipsJS_hide').html(ips.templates.render('nearMe',{events:events.join('')}));}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('calendar.front.overview.search',{initialize:function(){this.on('click','[data-action="useMyLocation"]',this.useMyLocation);this.on('click','[data-action="cancelLocation"]',this.cancelLocation);this.on('submit',this.doSearch);this.on(document,'click','[data-action="backToOverview"]',this.backToOverview);this.on(document,'click','[data-action="loadMoreSearch"]',this.loadMore);this.on(document,'menuItemSelected','#elSortMenu',this.changeSort);this.on(document,'click','[data-action="moreNearMe"]',this.moreNearMe);this.on(document,'click','[data-action="moreExhibitions"]',this.moreExhibitions);History.Adapter.bind(window,'statechange',_.bind(this.stateChange,this));this.setup();},setup:function(){this._gotCoords=false;this._offset=0;this._limit=20;this._currentSort=$('body').find('#elSortMenu_menu .ipsMenu_itemChecked').attr('data-ipsMenuValue');this._baseURL=this.scope.attr('action');this._initialURL=window.location.href;this._cancelledLookup=false;this._searchBox=this.scope.find('input[name="location"]');this._previousValue=this._searchBox.val();this._originalPlaceholder=this.scope.attr('data-placeholder');this._locationLink=this.scope.find('[data-action="useMyLocation"]');this._cancelLocationLink=this.scope.find('[data-action="cancelLocation"]');this._page=this.scope.closest('[data-role="eventsPage"]');this._resultsContainer=$('body').find('[data-role="searchResults"]');this._noResults=$('body').find('[data-role="noSearchResults"]');this._loadMore=$('body').find('[data-action="loadMoreSearch"]');this._noMore=$('body').find('[data-role="noMoreSearchResults"]');this._map=null;this._mapContainer=$('body').find('[data-role="searchResultsMap"]');this._markers={};this.getInitialLocation();if(ips.getSetting('mapProvider')==='google'){this.setupGoogle();}else{this.setupMapbox();}},setupGoogle:function(){var self=this;self._mapReady=true;Debug.log(self._resultsContainer.find('[data-eventid]'));Debug.log(self._mapContainer.attr('data-markers'));if(self._resultsContainer.find('[data-eventid]').length&&self._mapContainer.attr('data-markers')){Debug.log('here');try{var markers=JSON.parse(self._mapContainer.attr('data-markers'));Debug.log(markers);self._updateGoogleMap(markers);}catch(err){Debug.log("Invalid marker JSON");Debug.log(err);}}},setupMapbox:function(){var self=this;$('head').append("<link rel='stylesheet' type='text/css' media='all' href='https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.css'><link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v1.0.0/MarkerCluster.css' rel='stylesheet' /><link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v1.0.0/MarkerCluster.Default.css' rel='stylesheet' /><link rel='stylesheet' type='text/css' media='all' href='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css' />");ips.loader.get(['https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.js']).then(function(){ips.loader.get(['https://api.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v1.0.0/leaflet.markercluster.js','https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js']).then(function(){self._mapReady=true;if(self._resultsContainer.find('[data-eventid]').length&&self._mapContainer.attr('data-markers')){try{var markers=JSON.parse(self._mapContainer.attr('data-markers'));self._updateMapboxMap(markers);}catch(err){Debug.log("Invalid marker JSON");Debug.log(err);}}});});},getInitialLocation:function(){if(ips.utils.geolocation.getGeolocationIsAllowed()){ips.utils.geolocation.getCurrentPosition().then(coords=>{this.setCoords(coords.latitude,coords.longitude);})
this.setSearchToLocation();this._locationLink.hide();this._cancelLocationLink.show();}},setCoords:function(lat,long){this.scope.prepend("<input type='hidden' name='lat' value='"+lat+"'>");this.scope.prepend("<input type='hidden' name='lon' value='"+long+"'>");this._gotCoords=true;},clearCoords:function(){this.scope.find('input[name="lat"]').remove();this.scope.find('input[name="lon"]').remove();this._gotCoords=false;},moreNearMe:function(e){e.preventDefault();var lat=$(e.currentTarget).attr('data-lat');var long=$(e.currentTarget).attr('data-long');var self=this;this.setSearchToLocation();this.scope.find('[name="date[start]"]').val('');this.scope.find('[name="date[end]"]').val('');this.scope.find('[name="show"]').val('regular');$("html, body").animate({scrollTop:"300px"},function(){self.doSearch();});},moreExhibitions:function(e){e.preventDefault();var self=this;this.cancelLocation();this.scope.find('[name="date[start]"]').val('');this.scope.find('[name="date[end]"]').val('');this.scope.find('[name="show"]').val('exhibitions');$("html, body").animate({scrollTop:"300px"},function(){self.doSearch();});},doSearch:function(e){if(e){e.preventDefault();}
var url=this._getUrlFromData();History.replaceState({controller:'calendar.front.overview.search',url:url},document.title,url);},getPlaceholders:function(count){var events=[];if(_.isUndefined(count)){count=10;}
for(var i=0;i<count;i++){events.push(ips.templates.render('eventLoading'));}
return events.join('');},stateChange:function(){var state=History.getState();if((!state.data.controller||state.data.controller!='calendar.front.overview.search')&&this._initialURL!==state.url){return;}
if(this._initialURL==state.url){this.hideResults();}else if(this._initialURL==state.url&&_.isUndefined(state.data.url)){this._loadResults(this._getUrlFromData(this._initialData));}else{this._loadResults(state.data.url);}},changeSort:function(e,data){e.preventDefault();this._currentSort=data.selectedItemID;var title=data.menuElem.find('[data-ipsMenuValue="'+this._currentSort+'"]').text();$('body').find('[data-role="searchOrder"]').text(title);this.doSearch();},_getUrlFromData:function(){var formData=this.scope.serializeArray();var params=[];_.each(formData,function(item){if($.trim(item.value)!==''){params.push(item.name+"="+encodeURIComponent(item.value));}});params.push("sortBy="+this._currentSort);return this._baseURL+'&'+params.join('&');},_loadResults:function(url){var self=this;if(this._page.length){this._page.find('[data-role="eventsOverview"]').hide();this._page.find('[data-role="searchResultsWrapper"]').show();}
this._resultsContainer.removeClass('ipsHide').html(this.getPlaceholders(6));this._mapContainer.addClass('cEvents__searchMap--loading').show();this._currentUrl=url;ips.getAjax()(url).done(function(response){if(response.count){self._resultsContainer.html(response.content);self._noResults.addClass('ipsHide');self._updateMap(_.extend({},self._markers,response.markers));if(response.totalCount>(response.count+self._offset)){self._loadMore.show();self._noMore.hide();}else{self._loadMore.hide();self._noMore.hide();}}else{self._resultsContainer.html('').addClass('ipsHide');self._noResults.removeClass('ipsHide');self._loadMore.hide();self._noMore.hide();self._mapContainer.hide();}
if(response.virtual){self._mapContainer.hide();}
$(document).trigger('contentChange',[self._resultsContainer]);});},_updateMap:function(markers){if(ips.getSetting('mapProvider')==='google'){this._updateGoogleMap(markers);}else{this._updateMapboxMap(markers);}},_updateGoogleMap:function(markers){if(!this._map){this._map=new window.google.maps.Map(document.querySelector('[data-role="searchResultsMap"]'));this._mapMarkers=[];}
this._mapContainer.removeClass('cEvents__searchMap--loading');if(this._mapMarkers.length){for(let marker of Object.values(this._mapMarkers)){marker.setMap(null);}
this._mapMarkers=[];}
var bounds=new google.maps.LatLngBounds();for(let marker of Object.values(markers)){let mapMarker=new window.google.maps.Marker({position:{lat:marker.lat,lng:marker.long},map:this._map,title:marker.title});this._mapMarkers.push(mapMarker);var coords=new google.maps.LatLng(marker.lat,marker.long);if(!(bounds.contains(coords))){bounds.extend(coords);}}
if(this._mapMarkers.length===1){this._map.setZoom(15);this._map.setCenter(bounds.getCenter());}else{this._map.fitBounds(bounds);}
this._mapContainer.show();},_updateMapboxMap:function(markers){if(!this._map){L.mapbox.accessToken=ips.getSetting('mapApiKey');this._map=L.mapbox.map(this._mapContainer.get(0)).addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));this._map.zoomControl=false;this._map.minZoom=2;this._map.dragging=false;this._map.zoomControl=false;this._markersGroup=new L.featureGroup([]);this._markersGroup.addTo(this._map);}
this._mapContainer.removeClass('cEvents__searchMap--loading');this._markersGroup.clearLayers();for(var id in markers){var marker=L.marker([markers[id].lat,markers[id].long],{title:markers[id].title,draggable:false,eventId:parseInt(id)});this._markersGroup.addLayer(marker);marker.on('click',_.bind(this._markerClick,this));}
this._mapContainer.show();this._map.fitBounds(this._markersGroup.getBounds(),{maxZoom:5});},_markerClick:function(e,data){var targetEvent=e.target.options.eventId;var eventBlock=this._resultsContainer.find('[data-eventId="'+targetEvent+'"]');var topPos=eventBlock.offset().top;$('html, body').animate({scrollTop:topPos},function(){eventBlock.css({transform:'scale(1.1)'});setTimeout(function(){eventBlock.css({transform:'scale(1)'});},2000);});},loadMore:function(e){e.preventDefault();var placeholders=this.getPlaceholders(2);this._resultsContainer.append(placeholders);this._loadMore.prop('disabled',true);var self=this;var currentCount=this._resultsContainer.find('[data-eventid]').length;ips.getAjax()(this._currentUrl+"&offset="+currentCount+"&limit="+this._limit).done(function(response){self._resultsContainer.find('.event--loading').remove();self._resultsContainer.append(response.content);self._updateMap(response.markers);self._loadMore.prop('disabled',false);if(self._resultsContainer.find('[data-eventid]').length>=response.totalCount){self._loadMore.hide();self._noMore.show();}else{self._loadMore.show();self._noMore.hide();}
$(document).trigger('contentChange',[self._resultsContainer]);});},cancelLocation:function(e){if(e){e.preventDefault();}
let geolocation=ips.utils.geolocation.setGeolocationIsAllowed(ips.utils.geolocation.permissions.DENIED);this._cancelledLookup=true;this._searchBox.val(this._previousValue).attr('placeholder',this._originalPlaceholder).prop('disabled',false).removeClass('ipsField_loading');this._locationLink.show();this._cancelLocationLink.hide();this.scope.find('[name="searchNearLocation"]').remove();},useMyLocation:function(e){e.preventDefault();var self=this;self._cancelledLookup=false;self._searchBox.val('').attr('placeholder',ips.getString('event_finding_location')).prop('disabled',true).addClass('ipsField_loading');self._locationLink.hide();self._cancelLocationLink.show();var afterCoords=function(){if(self._cancelledLookup){self._cancelledLookup=false;return;}
self.setSearchToLocation();self._cancelledLookup=false;};if(self._gotCoords){afterCoords()}else{ips.utils.geolocation.getCurrentPosition().then(coords=>{self.setCoords(coords.latitude,coords.longitude);this.setSearchToLocation();});}},setSearchToLocation:function(){this._searchBox.val('').attr('placeholder',ips.getString('event_your_current_location')).prop('disabled',true).removeClass('ipsField_loading');this.scope.prepend("<input type='hidden' name='searchNearLocation' value='1'>");},backToOverview:function(e){if(!this._page.length){return;}
e.preventDefault();History.replaceState({controller:'calendar.front.overview.search',url:this._initialURL},document.title,this._initialURL);},hideResults:function(e){this._page.find('[data-role="eventsOverview"]').show();this._page.find('[data-role="searchResultsWrapper"]').hide();}});}(jQuery,_));;