/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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   # ||
|| ###################################################################### ||
\*========================================================================*/
vBulletin.precache("january february march april may june july august september october november december january_short february_short march_short april_short may_short june_short july_short august_short september_short october_short november_short december_short sunday monday tuesday wednesday thursday friday saturday sunday_short monday_short tuesday_short wednesday_short thursday_short friday_short saturday_short today calendar_plus_n_more go_to_topic export_event".split(" "),[]);
(function(e,p){function u(c){function l(a){var b=[],f=a.find(".js-calendar__events-event");f.length&&(e(".js-calendar__event-highlight-css").length||a.find(".js-calendar__event-highlight-css").appendTo("head"),e.each(f,function(d,h){d=e(h);var m=d.data("ignoredst")?v:w;h=d.data("eventstartdate")&&d.data("eventstartdate")+m||0;m=d.data("eventenddate")&&d.data("eventenddate")+m+1||0;var k=d.data("eventhighlightid"),x=d.data("type"),y=d.data("allday");h=d.data("date_is_unix")?moment.unix(h):d.data("eventstartdate");
thisEvent={id:d.data("id"),title:d.data("title"),description:d.data("description")||"",start:h,end:moment.unix(m),url:"",link_url:d.data("url"),ics_url:d.data("ics_url"),type:x,allDay:!1,vb_isallday:y};k&&(thisEvent.className="vbfc-event-highlight-"+k);b.push(thisEvent)}));return b}function q(a){var b=500>=a.outerWidth()?"auto":"";return t!==b?(a.fullCalendar("option","contentHeight",b),a.fullCalendar("option","height",b),t=b,!0):!1}if("1"!=c.data("vb-calendar-initialized")){var z=c.find(".js-calendar-loading-placeholder");
c.data("widget-instance-id");var n=parseInt(c.data("goto-month"),10)||0,w=parseInt(c.data("user-timezone-offset"),10)||0,v=parseInt(c.data("user-timezone-offset-ignore-dst"),10)||0,r,A=vBulletin.isRtl(),t=null;c.fullCalendar({nextDayThreshold:"00:00:00",events:function(a,b,f,d){var h=[];a={from:a.unix()||0,to:b.unix()||0};b=c.data("search-json");f=c.data("results-per-page");var m=c.data("additional-options");p.AJAX({call:"/ajax/render/widget_calendar__events",data:{searchJSON:b,events_during:a,resultsPerPage:f,
additionalOptions:m},success:function(k){k=e(k);k=k.hasClass("js-calendar__events")&&k||k.find(".js-calendar__events");h=l(k);d(h)}})},loading:function(a,b){"undefined"==typeof r&&(r=e('<img src="images/loader-box-blue.gif" /> ').appendTo(c.find(".fc-center")));a?r.show():r.hide()},eventLimit:!0,eventRender:function(a,b,f){f=b.find(".fc-title");a.vb_isallday&&b.addClass("fc-event--allday");switch(a.type){case "birthday":b.addClass("fc-event--birthday");b.attr("href",a.link_url);f.html('<i class="fa-solid fa-cake-candles"></i>'+
a.title);break;case "holiday":b.addClass("fc-event--holiday js-popup--holiday h-pointer");f.html(a.title);b.data("title",a.title);b.data("description",a.description);break;default:b.addClass("fc-event--node js-popup--node-event h-pointer"),f.html(a.title),b.data("url",a.link_url),b.data("ics_url",a.ics_url),b.data("title",a.title),b.data("description",a.description)}},viewRender:function(a,b){z.addClass("h-hide")},windowResize:function(){q(c)&&c.fullCalendar("render")},isRTL:A,timezone:"UTC",buttonText:g.buttonText,
monthNames:g.monthNames,monthNamesShort:g.monthNamesShort,dayNames:g.dayNames,dayNamesShort:g.dayNamesShort,eventLimitText:g.eventLimitText,firstDay:(parseInt(pageData.user_startofweek,10)||1)-1});q(c);n&&1<=n&&12>=n&&(n=moment().month(n-1).date(1),c.fullCalendar("gotoDate",n));c.addClass("js-parent-tab-render-listener");c.on("parent-tab-render",function(a){c.fullCalendar("render")});c.on("mouseenter","a.fc-event:not(.fc-start.fc-end)",function(a){a=e(this).attr("href");var b=c.find("a.fc-event:not(.fc-start.fc-end)[href='"+
a+"']");b&&(b.addClass("fc-event--simulate-hover"),e(this).one("mouseleave",function(){b.removeClass("fc-event--simulate-hover")}))});var B=p.phrase.get("go_to_topic"),C=p.phrase.get("export_event");c.on("click",".js-popup--holiday",function(a){a=e(a.currentTarget);var b=a.data("title");let f=a.data("description"),d=e('<span class="fc-close fc-icon fc-icon-x h-pointer close-btn"></span>');b={position:{my:"top center",at:"bottom center",viewport:e(window),adjust:{method:"shift flip"}},style:{classes:"qtip--fullcalendar"},
content:{title:{text:b,button:d},text:f},show:{event:"",ready:!0},hide:{event:"unfocus",fixed:!0}};f||(b.style.classes+=" qtip--title-only");p.qtip.apply(a,"qtip-whovoted",b)});c.on("click",".js-popup--node-event",function(a){a=e(a.currentTarget);var b=a.data("url"),f=a.data("ics_url"),d=a.data("title");let h=a.data("description");b=(h?`<div class="h-margin-bottom-l">${h}</div>`:"")+'<div class="h-flex--vertical">'+`<a href="${b}" class="${"h-center-content b-button b-button--event-export"}">${B}<span class="${"b-icon-fa b-icon-fa--24 fa-solid"} fa-up-right-from-square"></span></a>`+
`<a href="${f}" class="${"h-center-content b-button b-button--event-export"}">${C}<span class="${"b-icon-fa b-icon-fa--24 fa-solid"} fa-file-export"></span></a>`+"</div>";f=e('<span class="fc-close fc-icon fc-icon-x h-pointer close-btn"></span>');d={position:{my:"top center",at:"bottom center",viewport:e(window),adjust:{method:"shift flip"}},style:{classes:"qtip--fullcalendar"},content:{title:{text:d,button:f},text:b},show:{event:"",ready:!0},hide:{event:"unfocus",fixed:!0}};p.qtip.apply(a,"qtip-whovoted",
d)});c.attr("vb-calendar-initialized","1")}}var g;(function(){if("undefined"==typeof g){g={};var c={monthNames:"january february march april may june july august september october november december".split(" "),monthNamesShort:"january_short february_short march_short april_short may_short june_short july_short august_short september_short october_short november_short december_short".split(" "),dayNames:"sunday monday tuesday wednesday thursday friday saturday".split(" "),dayNamesShort:"sunday_short monday_short tuesday_short wednesday_short thursday_short friday_short saturday_short".split(" ")};
for(optionName in c)g[optionName]=[],c[optionName].forEach(function(l,q){g[optionName].push(vBulletin.phrase.get(l))});g.buttonText={today:vBulletin.phrase.get("today")};g.eventLimitText=function(l){return vBulletin.phrase.get("calendar_plus_n_more",parseInt(l,10))}}})();e(function(){var c=e(".js-widget-calendar");c.length&&e.each(c,function(l,q){u(e(q))})})})(jQuery,vBulletin);
