/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
(function(e){function z(a){var c=a.find(".js-widget-search2-nodelist-item"),b=0,f=a.find(".js-fixed-event-year-header"),n=a.find(".js-year-header");0==f.length&&(f=e("<li />").addClass("js-fixed-event-year-header b-event__listyear b-event__listyear--fixed h-hide").prependTo(a));e.each(n,function(g,d){g=e(d);g.next().hasClass("js-widget-search2-nodelist-item")||g.remove()});e.each(c,function(g,d){g=e(d);d=parseInt(g.data("start-year"),10);var l=g.prev(".js-year-header");d>b&&(l.length||e("<li />").addClass("js-year-header b-event__listyear").text(d).data("start-year",
d).insertBefore(g),b=d)})}function A(a){var c=a.find(".js-widget-search2-nodelist-item"),b=a.data("search-max-page")||!1,f=a.data("loaded-pages")||{};c.removeClass("b-event--lastchild h-hide");z(a);a.find(".js-loading").appendTo(a);a.find(".js-no-more-items").appendTo(a);b&&f.hasOwnProperty(b)&&a.find(".js-no-more-items").removeClass("h-hide");c=a.height();b=a.scrollTop();a.height("auto");f=a.height();a.height(c);a.scrollTop(b);a.data("full-height",f)}function E(a,c){var b=c.$anchorItem&&c.$anchorItem.offset().top||
0;c=c.anchorItemPreviousTop-b;a.scrollTop();a.scrollTop(a.scrollTop()-c)}function F(a){var c=a.find(".js-widget-search2-nodelist-item"),b={},f=a.offset().top,n=f+a.height(),g=!1,d=!1,l,k=Number.POSITIVE_INFINITY,h,p=0;e.each(c,function(m,q){m=e(q);q=m.hasClass("h-hide");var u=m.offset().top,v=u+m.height(),x=m.data("nodeid");b["nodeid"+x]=!0;g=!q&&!(v<=f||n<=u);d=f<=u;"undefined"==typeof l&&g&&d&&(l=m,k=l.data("page"));g&&(h=m,p=h.data("page"))});return{$items:c,haveNodeids:b,$firstVisibleItem:l,firstVisiblePage:k,
$lastVisibleItem:h,lastVisiblePage:p,$anchorItem:h,anchorItemPreviousTop:h&&h.offset().top||0}}function B(a){a=e(a.target);var c=a.scrollTop();a.data("full-height");var b=a.position().top,f=a.height(),n=a.find(".js-widget-search2-nodelist-item");f=n.slice(-5).first().position().top-b<f;var g=n.slice(0,5).last();g=g.position().top-b+g.height()>b;var d=a.find(".js-fixed-event-year-header");if(0<c){var l=0;e.each(n,function(k,h){k=e(h);h=k.position().top-b;var p=k.height();if(0<h+p)return l=k.data("start-year"),
!1});d.css({top:b,width:n.first().width()}).text(l).removeClass("h-hide")}else d.addClass("h-hide");f?C(a,"bottom"):g&&C(a,"top")}function D(){e(".js-widget-search2").each(function(a,c){c=e(c);a=c.find(".js-fixed-event-year-header");c=c.find(".js-widget-search2-nodelist-item").first();a.css("width",c.width())})}function C(a,c){if(!r){r=!0;var b=a.closest(".js-widget-search2"),f=b.data("widget-id"),n=b.data("widget-instance-id"),g=a.data("search-max-page")||Number.POSITIVE_INFINITY,d=a.data("loaded-pages")||
{};e.isEmptyObject(d)&&(b=b.data("current-page"),d={},d[b]=b,a.data("loaded-pages",d));var l=Object.keys(d).sort(function(k,h){return parseInt(k,10)-parseInt(h,10)});if("bottom"==c){if(b=d[l[l.length-1]]+1,g<b){r=!1;return}}else if("top"==c){if(b=d[l[0]]-1,1>b){r=!1;return}}else{r=!1;return}a.find(".js-loading").removeClass("h-hide");vBulletin.AJAX({call:"/ajax/render/widget_search2",data:{widgetinstanceid:n,widgetid:f,currentPage:b},success:function(k){var h=e(k).filter(".js-widget-search2"),p=h.find(".js-widget-search2-nodelist"),
m=p.find(".js-widget-search2-nodelist-item");k=F(a);var q=k.$items,u=q.first(),v=q.length,x=k.haveNodeids;p=p.data("search-has-more");h=h.data("current-page");d[h]=h;a.data("loaded-pages",d);p||a.data("search-max-page",h);e.each(m,function(w,y){w=e(y);y=w.data("nodeid");"undefined"==typeof x["nodeid"+y]&&("bottom"==c?a.append(w):"top"==c&&u.before(w),v++)});if(200<v){var t;m=a.find(".js-widget-search2-nodelist-item");"bottom"==c?t=d[l[0]]:"top"==c&&(t=d[l[l.length-1]]);m=m.filter("[data-page='"+t+
"']");if(t<=k.firstVisiblePage||t>=k.lastVisiblePage)m.remove(),delete d[t],a.data("loaded-pages",d)}A(a);E(a,k)},complete:function(){a.find(".js-loading").addClass("h-hide");r=!1}})}}var r=!1;e(function(){var a=e(".js-widget-search2");a.length&&e.each(a,function(c,b){c=e(b);if("1"!=c.data("vb-continuous-scroll-initialized")){b=c.find(".js-widget-search2-nodelist");if(b.data("search-has-more")||b.find(".js-widget-search2-nodelist-item.h-hide").length){z(b);var f=b.parents(".js-show-on-tabs-create.h-hide");
f.length&&f.removeClass("h-hide");b.css({height:b.height(),overflowY:"scroll"});f.length&&f.addClass("h-hide");A(b)}b.off("scroll",B).on("scroll",B);e(window).off("resize",D).on("resize",D);c.attr("vb-continuous-scroll-initialized","1")}})})})(jQuery);
