/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.5.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2019 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   # ||
|| ###################################################################### ||
\*========================================================================*/
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,[]);(function(E){var G={};function H(O){O.preventDefault();var N=E(this);if(N.hasClass("option-less")){E(".faqSearchControl.option-more").removeClass("h-hide");E(".faqSearchFields").addClass("h-hide")}if(N.hasClass("option-more")){N.addClass("h-hide");E(".faqSearchFields").removeClass("h-hide")}}function C(O){var N=E(".faq-content .faq-answer");E(".faq-group-title",N).html(O.title);E(".faq-group-body",N).html(O.text);E(".faq-groups .faq-link.selected").removeClass("selected");E(".faq-groups .faq-link").each(function(){var P=E(this);if(P.data("group")==O.faqparent&&P.data("item")==O.faqname){P.addClass("selected");E(".js-rx-help-menu-select").selectBox("value",P.data("path"));return false}});J(N)}function J(N){var O=E(".js-faq-search-query").data("highlight");if(O){E(O.split(",")).each(function(Q,P){E(".faq-group-body",N).highlight(P)})}}function L(O){O.preventDefault();var P=E(this).data("group");var N=E(this).data("item");window.location.hash=E(this).data("path");if(G[P]&&G[P][N]){C(G[P][N]);return }vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/ajax/api/help/getAnswers",data:{group:P},success:function(Q,R,S){if(Q.answers){G[P]=Q.answers;if(G[P][N]){C(G[P][N])}else{console.log("can't load help for "+P+"/"+N)}}else{console.log("can't load help for "+P)}}})}function D(N){E(".faq-groups a").each(function(){var S=E(this);var U=S.data("path");if(U==N){var P=S;var R=false;var Q=false;var O=100;while(--O){P=P.parent().closest(".faq-group");R=P.find("> .faq-group-title");if(R.length==1){Q=R}else{break}}if(Q&&Q.length==1){var V=E(".faq-groups");var T=E(".faqs");V.removeClass("h-hide-on-small");T.css("width","220px");Q.click();V.addClass("h-hide-on-small");T.css("width","")}if(!S.is(".faq-link")){S.parent().find(".faq-link").first().click()}S.click();return false}})}function F(Q){var N=E(Q.target);var P=N.attr("href");if(P.substr(0,5)=="help#"){var O=P.substr(5);D(O);return false}}function A(){if(window.location.hash){var N=window.location.hash.substr(1);D(N)}}function M(Q,N,P){var O=Q.find("> li.faq-group, > li");O.each(function(){var R=E(this);var S=R.find("> .faq-group-title, > .faq-link");E("<option />").prop("value",S.data("path")).text(N+" "+S.text()).appendTo(P);var T=R.find("> .sub-faqs > .faq-group-body");if(T.length>0){M(T,N+"---",P)}})}function K(O){var P=O.target;var N=E(P[P.selectedIndex]).val();D(N)}function B(){var O=E(".faq-groups");var N=E("<select />").addClass("js-rx-help-menu-select");M(O,"",N);var P=E("<div />").addClass("rx-help-menu h-hide-on-large").append(N).insertAfter(O);N.off("change").on("change",K);O.addClass("h-hide-on-small");P.removeClass("h-hide-on-large");N.selectBox();P.addClass("h-hide-on-large")}function I(){E(".faqSearchControl").off("click").on("click",H);E(".help-widget").off("click",".faq-link").on("click",".faq-link",L);E(".help-widget").off("click",".faq-content a").on("click",".faq-content a",F);var N="js-help-icon h-center-vertical h-margin-right-s b-icon ";E(".faqs ul.acc").accordion({heightStyle:"content",icons:{activeHeader:N+"b-icon__arrow-down-s",header:N+"b-icon__arrow-right-s"}});E(".js-help-icon").removeClass("ui-icon").parent().addClass("h-center-vertical-container");A();J(E(".faq-content .faq-answer"));B()}E(document).ready(I)})(jQuery);