tribe.events=tribe.events||{},tribe.events.views=tribe.events.views||{},tribe.events.views.mapEventsScroller={},function(e,s){"use strict";var t=e(document);s.selectors={mapEventCardsOuterWrapper:'[data-js="tribe-events-pro-map-event-cards-wrapper"]',mapEventCardsWrapper:'[data-js="tribe-events-pro-map-event-cards"]',mapEventCardsWrapperClass:".tribe-events-pro-map__event-cards",mapEventCardsWrapperActiveClass:".tribe-events-pro-map__event-cards--active",mapEventCardsPaneClass:".tribe-events-pro-map__event-cards-scroll-pane",mapEventCardsSliderClass:".tribe-events-pro-map__event-cards-scroll-slider"},s.scrollTo=function(e,t){var r=e.find(s.selectors.mapEventCardsWrapperClass),a=t.offset().top-r.offset().top+r.scrollTop();r.animate({scrollTop:a},"fast")},s.isWithinScrollView=function(e,t){var r=e.find(s.selectors.mapEventCardsWrapperClass),a=t.offset().top-r.offset().top,n=r.offset().top+r.height()-t.offset().top-t.height();return 0<=a&&0<=n},s.deinitScroller=function(e){e.find(s.selectors.mapEventCardsOuterWrapper).nanoScroller({destroy:!0})},s.initScroller=function(e){e.find(s.selectors.mapEventCardsOuterWrapper).nanoScroller({paneClass:s.selectors.mapEventCardsPaneClass.className(),sliderClass:s.selectors.mapEventCardsSliderClass.className(),contentClass:s.selectors.mapEventCardsWrapperClass.className(),iOSNativeScrolling:!0,alwaysVisible:!1}).find(s.selectors.mapEventCardsWrapper).addClass(s.selectors.mapEventCardsWrapperActiveClass.className())},s.deinit=function(e,t,r){var a=e.data.container;s.deinitScroller(a),a.off("beforeAjaxSuccess.tribeEvents",s.deinit)},s.init=function(e,t,r,a){"map"===a.slug&&(s.initScroller(r),r.on("beforeAjaxSuccess.tribeEvents",{container:r},s.deinit))},s.ready=function(){t.on("afterSetup.tribeEvents",tribe.events.views.manager.selectors.container,s.init)},e(s.ready)}(jQuery,tribe.events.views.mapEventsScroller),window.tec=window.tec||{},window.tec.eventsPro=window.tec.eventsPro||{},window.tec.eventsPro.views=window.tec.eventsPro.views||{},window.tec.eventsPro.views.mapEventsScroller={};