tribe.events=tribe.events||{},tribe.events.views=tribe.events.views||{},tribe.events.views.weekMultidayToggle={},function(e,t){"use strict";var n=e(document);t.selectors={weekMultidayRow:'[data-js="tribe-events-pro-week-multiday-events-row"]',weekMultidayToggleButton:'[data-js="tribe-events-pro-week-multiday-toggle-button"]',weekMultidayToggleButtonOpenClass:".tribe-events-pro-week-grid__multiday-toggle-button--open",weekMultidayMoreButtonWrapper:'[data-js="tribe-events-pro-week-multiday-more-events-wrapper"]',weekMultidayMoreButton:'[data-js="tribe-events-pro-week-multiday-more-events"]',tribeCommonA11yHiddenClass:".tribe-common-a11y-hidden"},t.toggleMultidayEvents=function(n){var o=n.data.toggleButton,i=n.data.togglesAndContainers;"true"===o.attr("aria-expanded")?(tribe.events.views.accordion.closeAccordion(o,e("")),o.removeClass(t.selectors.weekMultidayToggleButtonOpenClass.className())):(tribe.events.views.accordion.openAccordion(o,e("")),o.addClass(t.selectors.weekMultidayToggleButtonOpenClass.className())),i.forEach((function(e){var n=e.headerWrapper,o=e.header,i=e.content;"true"===o.attr("aria-expanded")?(tribe.events.views.accordion.closeAccordion(o,i),n.removeClass(t.selectors.tribeCommonA11yHiddenClass.className())):(tribe.events.views.accordion.openAccordion(o,i),n.addClass(t.selectors.tribeCommonA11yHiddenClass.className()))}))},t.getTogglesAndContainers=function(e,n){var o=[];return n.forEach((function(n){var i=e.find("#"+n),s=i.siblings(t.selectors.weekMultidayMoreButtonWrapper),r=s.find(t.selectors.weekMultidayMoreButton);o.push({headerWrapper:s,header:r,content:i})})),o},t.initToggle=function(e){var n=e.find(t.selectors.weekMultidayRow),o=n.find(t.selectors.weekMultidayToggleButton),i=o.attr("aria-controls").split(" "),s=t.getTogglesAndContainers(n,i);o.on("click",{toggleButton:o,togglesAndContainers:s},t.toggleMultidayEvents),s.forEach((function(e){e.header.on("click",{toggleButton:o,togglesAndContainers:s},t.toggleMultidayEvents)}))},t.deinitToggle=function(n){var o=n.find(t.selectors.weekMultidayRow);o.find(t.selectors.weekMultidayToggleButton).off("click",t.toggleMultidayEvents),o.find(t.selectors.weekMultidayMoreButton).each((function(n,o){e(o).off("click",t.toggleMultidayEvents)}))},t.deinit=function(e,n,o){var i=e.data.container;t.deinitToggle(i),i.off("beforeAjaxSuccess.tribeEvents",t.deinit)},t.init=function(e,n,o,i){o.find(t.selectors.weekMultidayToggleButton).length&&(t.initToggle(o),o.on("beforeAjaxSuccess.tribeEvents",{container:o},t.deinit))},t.ready=function(){n.on("afterSetup.tribeEvents",tribe.events.views.manager.selectors.container,t.init)},e(t.ready)}(jQuery,tribe.events.views.weekMultidayToggle),window.tec=window.tec||{},window.tec.eventsPro=window.tec.eventsPro||{},window.tec.eventsPro.views=window.tec.eventsPro.views||{},window.tec.eventsPro.views.weekMultidayToggle={};