/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.4.0 Release Candidate 1
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2018 vBulletin Solutions Inc. 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   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.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","datepicker_clicktotoggle","datepicker_rangeseparator","datepicker_scrolltoincrement","datepicker_weekabbreviation",]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["pickerdateformat",]);(function(G){function P(a,X){var W=["january","february","march","april","may","june","july","august","september","october","november","december"],b=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Y=(X=="long")?"":"_short",V=(a=="month")?W:b,Z=[];G.each(V,function(c,d){Z.push(vBulletin.phrase.get(d+Y))});return Z}function M(){var Z=vBulletin.options.get("pickerdateformat"),W="",a="";if(pageData.user_lang_pickerdateformatoverride){Z=pageData.user_lang_pickerdateformatoverride}var c="",f=null,b=null,X=null,V=null,Y=false,e=false;G.each(Z.split(""),function(g,j){var i=!!j.match(/[GHhiSsK]/),k=!!j.match(/[a-z]/i),h=k&&!i;if(c!="\\"){if(i){if(j==="K"){Y=true}if(j==="h"){e=true}if(f===null){f=g}b=g}else{if(h){if(X===null){X=g}V=g}}}c=j});if(b<X){var d=b+1;a=Z.slice(0,d);W=Z.slice(d)}else{if(V<f){var d=V+1;W=Z.slice(0,d);a=Z.slice(d)}else{W=Z;a=Z}}return{datetime:Z,date:W,time:a,use24hour:!(Y||e)}}function K(W){var V="m/d/Y",a="H:i",Y=M(),Z;var X={time_24hr:Y.use24hour,onReady:D,onOpen:H,onChange:Q,altInput:true,locale:{weekdays:{shorthand:P("weekday","short"),longhand:P("weekday","long"),},months:{shorthand:P("month","short"),longhand:P("month","long"),},rangeSeparator:vBulletin.phrase.get("datepicker_rangeseparator"),weekAbbreviation:vBulletin.phrase.get("datepicker_weekabbreviation"),scrollTitle:vBulletin.phrase.get("datepicker_scrolltoincrement"),toggleTitle:vBulletin.phrase.get("datepicker_clicktotoggle"),firstDayOfWeek:(parseInt(pageData.user_startofweek,10)||1)-1,},};if(vBulletin.isRtl()){X.nextArrow="<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>";X.prevArrow="<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>"}switch(W){case"date":X.enableTime=false;X.noCalendar=false;X.dateFormat=V;X.altFormat=Y.date;break;case"time":X.enableTime=true;X.noCalendar=true;X.dateFormat=a;X.altFormat=Y.time;break;case"datetime":X.enableTime=true;X.noCalendar=false;X.dateFormat=V+" "+a;X.altFormat=Y.datetime;break}return X}function A(X,W){var V=["onChange","onClose","onOpen","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"];G.each(V,function(Y,Z){if(typeof W[Z]=="function"){W[Z]=[W[Z]]}if(typeof X[Z]=="function"){X[Z]=[X[Z]]}});return G.extend(true,{},X,W)}function E(X,W,V){W=W||{};W=A(K(V),W);X.flatpickr(W);X.attr("data-vb-flatpicker-initialized",V);X.trigger("vb-flatpicker-initialized")}function B(W,V){var X=S(W),Y=W.val();if(!X){return }X.destroy();E(W,null,V);X=S(W);X.setDate(Y)}function F(W,V){E(W,V,"date")}function O(W,V){E(W,V,"time")}function T(W,V){E(W,V,"datetime")}function U(a){var Y=a.find(".js-daterange--min[data-vb-flatpicker-initialized]"),X=a.find(".js-daterange--max[data-vb-flatpicker-initialized]");if(a.data("vb-daterange-initialized")){return true}if(!Y.length){G(".js-daterange--min",a).one("vb-flatpicker-initialized",function(){U(a)});return true}if(!X.length){G(".js-daterange--max",a).one("vb-flatpicker-initialized",function(){U(a)});return true}if(Y.length&&X.length){var b=vBulletin.flatpickr.getInstance(Y),c=vBulletin.flatpickr.getInstance(X);if(!b||!c){return true}var d=b.config.onChange,W=(function(){var e=false;return function(h,g,f,i){if(!e){e=true;if(g){c.set("minDate",g)}e=false}}})(),V=c.config.onChange,Z=(function(){var e=false;return function(h,g,f,i){if(!e){e=true;if(g){b.set("maxDate",g)}e=false}}})();d.push(W);b.set("onChange",d);V.push(Z);c.set("onChange",V)}a.attr("data-vb-daterange-initialized",1)}function C(){G(".js-datepicker").each(function(){F(G(this))});G(".js-timepicker").each(function(){O(G(this))});G(".js-datetimepicker").each(function(){T(G(this))});G(".js-daterange").each(function(){U(G(this))})}function S(V){try{return V.get(0)._flatpickr}catch(W){}return null}function J(V){var W=S(V);if(W){V.data("vb-flatpickr-disabled","1");W.clear();W.close()}}function L(V){var W=S(V);if(W){V.data("vb-flatpickr-disabled","0")}}function I(c){if(!vBulletin.isRtl()){return }if(!(c&&c.calendarContainer&&c._positionElement)){return }var Z=c.calendarContainer,V=c._positionElement,a=Z.offsetWidth,X=V.offsetWidth,Y=V.getBoundingClientRect(),W=window.pageXOffset+Y.left,b=window.document.body.offsetWidth-Y.right,d=W+X<a;if(!d){G(Z).addClass("rightMost").css({left:"auto",right:b+"px"})}}function D(X,W,V,Y){I(V)}function H(Y,W,V,Z){var X=G(V.element);I(V);if(X.data("vb-flatpickr-disabled")=="1"){V.close()}}function Q(Y,W,V,Z){var X=G(V.element);X.change();I(V)}function N(){C()}function R(){G(N);vBulletin.flatpickr=vBulletin.flatpickr||{};vBulletin.flatpickr.initPickers=C;vBulletin.flatpickr.getInstance=S;vBulletin.flatpickr.disablePicker=J;vBulletin.flatpickr.enablePicker=L;vBulletin.flatpickr.initDatePicker=F;vBulletin.flatpickr.initTimePicker=O;vBulletin.flatpickr.initDateTimePicker=T;vBulletin.flatpickr.changePickerType=B}R()})(jQuery);