/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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("close email_addresses_must_match error invalid_email_address moderateuser paid_subscription_required paid_subscriptions please_enter_a_username please_enter_your_email_address please_enter_your_parent_or_guardians_email_address please_select_a_day please_select_a_month please_select_a_year register_not_agreed registeremail registration_age_restricted registration_complete registration_gregister registration_start_failed site_terms_and_rules_title terms_of_service_page_text".split(" "),
"checkcoppa registration_min_age regrequirepaidsub reqbirthday usecoppa webmasteremail".split(" "));
(function(a,n,r,x,y){if(!n.pageHasSelectors([".registration-widget"]))return!1;a(function(){function E(b,e,c,f,d){d=d||!1;0!=b&&0!=e&&0!=c&&(f&&a(".birth-date-wrapper").addClass("h-hide"),x.ajax({call:"/registration/checkAgeAndCoppa",data:{month:b,day:e,year:c},success:function(g){t=g.needcoppa;let k=a(".birth-date-wrapper"),h=a(".signup-content");if(g.canRegister){g=a(".js-registration__paidsubscription");let m=t||!d,l=!!t;d&&f&&!m&&(a("#regMonth").val(0),a("#regDay").val(0),a("#regYear").val(0));
k.toggleClass("h-hide",m);h.removeClass("h-hide");g.toggleClass("h-hide-imp",l);g.find("select,input").prop("disabled",l);m?(a("#regContent").removeClass("h-hide"),a("#frmRegister .js-button-group").removeClass("h-hide")):a(".registration-widget select").selectBox();a(".coppa").toggleClass("h-hide-imp",!t)}else f||(r.error("error",["registration_age_restricted",F]),k.addClass("h-hide")),h.addClass("h-hide"),a(".js-age-restricted-notice").removeClass("h-hide")},error_phrase:"registration_start_failed"}))}
function u(b,e){return b?(r.warning("error",b,e),!1):!0}function K(){if(B){var b={"#regMonth":"please_select_a_month","#regDay":"please_select_a_day","#regYear":"please_select_a_year"};for(var e in b)if(0==a(e).val())return u(b[e],a(e).next(".selectBox"))}e=function(d,g,k,h,m,l){var q=a(d);if(q.length){d=q.val();if(""==a.trim(d))return u(g,q);if(k&&!k(d))return u(h,q);if(m&&(g=a(m),g.length&&d!=g.val()))return u(l,g)}return!0};b=[["#regDataUsername","please_enter_a_username"],["#regDataEmail","please_enter_your_email_address",
isValidEmailAddress,"invalid_email_address","#regDataEmailConfirm","email_addresses_must_match"]];t&&b.push(["#parentGuardianEmail","please_enter_your_parent_or_guardians_email_address",isValidEmailAddress,"invalid_email_address"]);for(var c=0;c<b.length;c++)if(!e.apply(window,b[c]))return!1;if(!n.checkPassword(a("#regDataPassword"),a("#regDataConfirmpassword")))return!1;b="";if(!a("#cbApproveTerms").is(":checked")){b="register_not_agreed";var f=a("#cbApproveTerms")}G&&!p&&(b="paid_subscription_required",
f=a(".cost"));p&&!z&&(b="please_select_a_payment_method",f=a("input.paymentapi").first());return u(b,f)}function L(b){console.log("Paid Subscriptions Data: subscriptionid: "+p+"; subscriptionsubid: "+C+"; paymentapiclass: "+z+"; currency: "+A);if(!K())return!1;a(".js-button-group .js-button",b).prop("disabled",!0);var e=a(b).serializeArray();x.ajax({call:"/registration/registration",data:e,success:function(c){if(c.usecoppa)location.replace(c.urlPath);else{c.newtoken&&"guest"!=c.newtoken&&n.doReplaceSecurityToken(c.newtoken);
var f=function(){r.alert("registration_gregister",c.msg,null,function(){c.urlPath?location.replace(c.urlPath):(a(".signup-success").removeClass("h-hide"),a(".signup-content").addClass("h-hide"))})};n.ensureObj("paypal2");n.paypal2.regfinal=f;p?r.openTemplateConfirmDialog(x,{title:"paid_subscriptions",width:500,yesPhrase:"order",noPhrase:"cancel",onClickYes:d=>{d.find("form").submit();return!1},onClickNo:d=>{if(G)return r.error("error","paid_subscription_required"),!1;f()}},{call:"/ajax/api/paidsubscription/placeorder",
data:{subscriptionid:p,subscriptionsubid:C,paymentapiclass:z,currency:A,context:"registration"}}).then(d=>{a(".dialog-content .message",d).find('input[type="submit"], .js-subscription__cancel').hide()}):f()}},api_error:y.resetOnError,error_phrase:"registration_start_failed",complete:function(){a(".js-button-group .js-button",b).prop("disabled",!1)}})}const v=n.options,B=parseInt(v.get("usecoppa")),F=parseInt(v.get("registration_min_age")),H=0<F,M=parseInt(v.get("reqbirthday")),G=parseInt(v.get("regrequirepaidsub")),
N=parseInt(v.get("checkcoppa"));let t=!1,D=!1,p,C,z,A;(function(){a("#frmRegister").trigger("reset");setTimeout(y.reset,0);if(B||H||M){var b=n.storagetools.getCookie("coppaage"),e=!1;if((B||H)&&b&&N){if(b=b.split("-",3),3==b.length){var c=parseInt(b[0]);var f=parseInt(b[1]);var d=parseInt(b[2]);0!=c&&0!=f&&0!=d&&(e=!0,a("#regMonth").val(c),a("#regDay").val(f),a("#regYear").val(d));E(c,f,d,e,!0)}}else a(".signup-content").removeClass("h-hide");a("#regMonth, #regDay, #regYear").off("change").on("change",
function(){c=a("#regMonth").val();f=a("#regDay").val();d=a("#regYear").val();E(c,f,d,e)})}else a(".signup-content").removeClass("h-hide");a(".registration-widget select").selectBox();a("#regDataUsername").off("keydown blur").on("keydown",function(k){13==k.keyCode&&a(this).triggerHandler("blur");return!0}).on("blur",k=>{let h=k.currentTarget;k=h.value.trim();if(""==k)return!0;D=!0;x.ajax({call:"/registration/checkusername",data:{username:k},complete:function(){D=!1},after_error:function(){h.value=
"";h.select();h.focus()}})});var g=a(".paidsubscription_row");0<g.length&&a("select.cost",g).change(function(){var k=a(this).closest(".newsubscription_row"),h=a(this).find("option:selected").first(),m=a(this).closest(".subscriptions_list"),l=a(".order_confirm",g);a(".payment-form",g);var q=k.data("allowedapis"),O=h.data("recurring"),I=0,J;p=k.data("id");C=h.data("subid");A=h.data("currency");a('<tr class="confirm_data"><td>'+h.data("subtitle")+"</td><td>"+h.data("duration")+"</td><td>"+h.data("value")+
"</td></tr>").appendTo(a(".order_confirm_table",l));m.addClass("h-hide");l.off("click",".remove_subscription").on("click",".remove_subscription",function(){a(".confirm_data",l).remove();a("input.paymentapi",l).closest("label").removeClass("h-hide");a(".subscriptions-order",l).prop("disabled",!1);a("select.cost",m).selectBox("value","");l.addClass("h-hide");m.removeClass("h-hide");p=0;return!1});l.off("click","input.paymentapi").on("click","input.paymentapi",function(){z=a("input.paymentapi:checked",
l).val()});a("input.paymentapi",l).each(function(){var w=a(this),P=w.data("currency").split(","),Q=w.data("recurring");-1==a.inArray(A,P)||-1==a.inArray(w.val(),q)||O&&!Q?w.closest("label").addClass("h-hide"):(I++,J=w)});1==I&&J.click();l.removeClass("h-hide")})})();y.initForm(a("#frmRegister"),b=>{var e=b.currentTarget;setTimeout(function(){D||L(e)},10);return!1});a("#regBtnReset").off("click").on("click",function(b){y.reset();setTimeout(function(){a(".registration-widget select").selectBox("refresh");
a("#regMonth").next(".selectBox").trigger("focus")},50)})})})(jQuery,vBulletin,vBulletin.dialogtools,vBulletin.ajaxtools,vBulletin.hv);
