;(function($){"use strict";ips.controller.register('calendar.front.venue.main',{_ajaxObj:null,initialize(){this.on('click','[data-action="changeView"]',this.changeView);this.on(window,'historychange:venueView',this.stateChange);this.setup();},setup(){ips.utils.history.pushState({controller:'venueView'},'venueView',window.location.href);},changeView(e){e.preventDefault();ips.utils.history.pushState({controller:'venueView'},'venueView',$(e.currentTarget).attr('href'));document.title=$(e.currentTarget).attr('title');},stateChange(){const data=ips.utils.history.getState('venueView')||{},url=window.location.href
if(data.controller!=='venueView'){return;}
ips.utils.analytics.trackPageView(url);this._updateView(url)},_updateView(url){if(this._ajaxObj&&(typeof this._ajaxObj.abort==="function")){this._ajaxObj.abort();}
this._setLoading(true);this._ajaxObj=ips.getAjax()(url,{showLoading:true}).done(response=>{console.log(response);this.scope.html(response);$(document).trigger('contentChange',[self.scope]);}).always(()=>{this._setLoading(false);});},_setLoading(state){this.scope.animate({opacity:state?"0.6":"1"},"fast");}});}(jQuery));;