/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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("error error_trying_to_change_user_status error_x follow following following_pending following_remove invalid_server_response_please_try_again profile_guser edit_avatar invalid_data no_permission upload_invalid_url unable_to_upload_profile_photo profile_media album album_saved please_enter_message_x_chars please_enter_title_x_chars unable_to_contact_server_please_try_again".split(" "),[]);var albumPhotoCount=0;
(function(a,k,m,p,v){function q(){var d=a(this).closest(".section-content").find(".js-user-status-text"),g=a.trim(d.val()),c=a(".js-profile-about-container").data("user-id");vBulletin.AJAX({call:"/ajax/api/user/updateStatus",data:{userid:c,status:g},title_phrase:"profile_guser",error_phrase:"error_trying_to_change_user_status",success:function(e){d.val(e);e&&(e='"'+e+'"');a("#userStatus").text(e)},allowEmptyResponse:!0})}function x(d){let g=!!d.avatarpath;d=new URL(g?d.avatarpath:d[0],pageData.baseurl_core+
"/");g&&"data:"!=d.protocol&&d.searchParams.set("random",Math.random());a("#profilePicImg, .avatar-"+pageData.userid).attr("src",d);a("#profilePicImgCrop").attr("src","");a("#btnProfilePhotoClose").trigger("click")}function L(){let d=a("#editProfilePhotoDlg");vBulletin.AJAX({call:"/profile/resetAvatar",success:g=>{x(g);a(".js-edit-profile-hide-on-reset").addClass("h-hide-imp")},complete:()=>{d.find(".js-upload-progress").addClass("h-hide-imp");d.find("input,button").prop("disabled",!1);d.find(".js-upload-button").removeClass("h-disabled")}})}
function M(){a(".defaultAvatarSet").removeClass("defaultAvatarSelected");a("#defaultAvatars").html("");var d=a("#editProfilePhotoDlg").dialog({width:734,title:vBulletin.phrase.get("edit_avatar"),autoOpen:!1,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,dialogClass:"dialog-container edit-profile-photo-dialog-container dialog-box",close:function(){modifyIasForTouch("disable")}}).dialog("open");d.on("vbulletin:dialogresize",function(c){resizeAvatarEditDialog()});a(".profile-img-option-container .browse-option").off("click").on("click",
function(c){a(".avatarHolder .defaultAvatarSet.defaultAvatarSelected").removeClass("defaultAvatarSelected")});a(".profile-img-option-container .url-option").off("click").on("click",function(c){var e=a(this);a(".avatarHolder .defaultAvatarSet.defaultAvatarSelected").removeClass("defaultAvatarSelected");setTimeout(function(){e.closest(".profile-img-option-container").find(".profilePhotoUrl").trigger("focus.photourl")},10)});a(".js-edit-profile").data("avatarmaxsize");var g=!1;a("#profilePhotoFile").off("click").on("click",
function(){a(this).closest(".profile-img-option-container").find(".browse-option").trigger("click")}).fileupload({url:vBulletin.getAjaxBaseurl()+"/profile/upload-profilepicture",dropZone:a(".frmprofilePhoto"),dataType:"json",add:function(c,e){c=a("#profilePicImgCrop");if(e.crop)e.crop.resized_width=c.width(),e.crop.resized_height=c.height(),g.formData=e.crop,g.formData.securitytoken=pageData.securitytoken,g.submit(),closeUploader();else{g=e;let w=e.files[0].fileName||e.files[0].name;a(".profile-img-option-container .fileText").val(w);
a("#btnProfilePhotoContinue").trigger("click");initIAS();c.attr("src",URL.createObjectURL(e.files[0]))}},done:function(c,e){c=e.result||{errors:[["invalid_server_response_please_try_again"]]};if(c.errors)return m.showApiError(c.errors,c,{title:"edit_avatar"}),!1;if(c.imageUrl)return a("#profilePhotoUrl").val(c.imageUrl).data("filedataid",c.filedataid).trigger("focus"),a("#btnProfilePhotoContinue").trigger("click"),!1;x(c)},fail:function(c,e){c="error";if(e&&0<e.files.length)switch(e.files[0].error){case "acceptFileTypes":c=
"warning"}vBulletin.alert("upload","error",c,function(){d.find(".fileText").val("");d.find(".browse-option").focus()})},always:function(c,e){d.find(".js-upload-progress").addClass("h-hide");d.find("input,button").prop("disabled",!1);d.find(".js-upload-button").removeClass("h-disabled");return!1}});a("#profilePhotoUrl").off("focus").on("focus",function(){a(this).closest(".profile-img-option-container").find(".url-option").trigger("click")})}function N(){if(""==a("#profilePicImgCrop").attr("src"))return closeUploader(),
vBulletin.error("edit_avatar","please_select_a_image_to_crop"),a("#btnProfilePhotoSave").addClass("h-hide-imp"),a("#btnProfilePhotoContinue").removeClass("h-hide-imp"),a("div#cropFrame").addClass("h-hide"),a("div#uploadFrame").removeClass("h-hide"),!1;var d={crop:{}},g=a(".js-edit-profile"),c=g.data("avatarmaxwidth");g=g.data("avatarmaxheight");d.crop.x1=a("#x1").val()||0;d.crop.x2=a("#x2").val()||c;d.crop.y1=a("#y1").val()||0;d.crop.y2=a("#y2").val()||g;d.crop.width=a("#width").val()||c;d.crop.height=
a("#height").val()||g;d.crop.resized_width=a("#profilePicImgCrop").width();d.crop.resized_height=a("#profilePicImgCrop").height();d.securitytoken=pageData.securitytoken;c=a("[name=profile-img-option]:checked").val();"1"==c?(d.files=a("#profilePhotoFile"),d.url=pageData.baseurl+"/profile/upload-profilepicture",a("#profilePhotoFile").fileupload("add",d)):"2"==c&&(d.profilePhotoUrl=a("#profilePhotoUrl").val(),d.filedataid=a("#profilePhotoUrl").data("filedataid"),vBulletin.AJAX({call:"/profile/upload-profilepicture",
data:d,success:e=>{x(e)}}));F()}function F(){a("#x1, #x2, #y1, #y2").val("")}function O(){a(".js-profile-ban-user").offon("click",d=>{let g=a(d.currentTarget).data("userid");p.openTemplateConfirmDialog(m,{title:"ban_user_gcphome",yesPhrase:"ban_user_gcphome",noPhrase:"cancel",onClickYes:c=>{c=c.find(".js-dialog-form");c=k.getFormData(c);c.userid=g;m.ajax({call:"/ajax/api/user/banUser",data:c,success:function(e){p.alert("success",e.response)}})}},{template:"inlinemod_banuser",data:{userid:g}})})}function G(d){a(".js-ipuser",
d).offon("click",g=>{g=a(g.currentTarget).data();p.openTemplateAlertDialog(m,{title:["users_matching_ip_x",g.ipaddress],maxHeight:300},{template:"profile_ipaddress_users",data:{userid:g.userid,ipaddress:g.ipaddress}})})}if(!vBulletin.pageHasSelectors([".profile-sidebar-widget"]))return!1;a(()=>{var d=vBulletin.tabtools,g=a(".profile-widget"),c=a("#profileTabs");if(0<c.length){var e=c.find(".ui-tabs-nav > li");0==e.length&&(e=c.find(".profile-tabs-nav > li"));var w=e.filter(".ui-tabs-active");0==w.length&&
(w=e.filter(".b-comp-menu-dropdown__content-item--current"));0==w.length&&(w=function(f,b){var n=[];f.find(".ui-tabs-nav > li > a, .widget-tabs-panel").each(function(t,r){t=a(this).data("url-path");-1==a.inArray(t,n)&&n.push(t)});f=new RegExp("\\/("+n.join("|")+")/?$");var h=location.pathname.match(f);if(h){var u=!1;b.each(function(){var t=a(this);if(t.find("a").data("url-path")==h[1])return u=t,!1});if(u)return u}return a()}(c,e));var D=w.index(),z,A,B={},H="1"==e.parent().data("allow-history"),
C=new vBulletin.history.instance(H);-1==D&&(D=0,w=e.first());var I=w.find("> a").attr("href");function l(f,b,n,h){if(C.isEnabled()){var u=C.getState();(h||!u||a.isEmptyObject(u.data))&&C.setDefaultState({from:f,tab:b,page:"undefined"==typeof n?void 0:n},document.title,location.href)}}var J=function(f,b){b.setOption("context",f);"undefined"!=typeof b.lastFilters&&0<a(".conversation-empty:not(.h-hide)",f).length&&delete b.lastFilters},K=function(f,b,n,h,u){var t=a(".conversation-list",f);return d.newTab(f,
null,!1,!1,b,t,h,u,n)};function y(f){const b=a(".js-profile-responsive-button-container");let n=!1,h=!1;"#activities-tab"!=f&&("#subscribed-tab"==f?n=!0:"#about-tab"!=f&&"#media-tab"==f&&(h=!0));b.toggleClass("media",h);b.toggleClass("subscribed",n)}d.initTabs(c,C,e,H,D,I,[z,A],!1,function(f,b,n){var h=a(n);b="#"+h.attr("id");f=I==b;b in B||(B[b]=d.tabAllowHistory(h));y(b);if("#activities-tab"==b)z?J(h,z):(n=function(){vBulletin.upload&&vBulletin.upload.initializePhotoUpload(h)},z=K(h,f,B[b],n,n).filter),
z.applyFilters(!1,!0);else if("#subscribed-tab"==b)A?J(h,A):A=K(h,f,B[b],null,null).filter,A.applyFilters(!1,!0);else if("#about-tab"==b)if(f)l("tabs","about");else{var u=a(".js-profile-about-container",n);0==a(".section",u).length&&m.render({call:"/profile/fetchAbout",data:{userid:u.data("user-id")},success:function(r){u.html(r.template)}})}else if("#media-tab"==b){let r=a(".js-profile-media-container",n);f?l("media_filter","media",v.getCurrentPage(r),!0):0==a(".item-album",r).length?m.render({call:"/profile/fetchMedia",
data:{userid:r.data("user-id"),perpage:r.data("perpage"),allowHistory:1,includeJs:"undefined"==typeof vBulletin.contentEntryBox?1:0},success:function(E){r.html(E.template);r.trigger("vb-instrument");h.data("media-statechange-set",!0);"function"==typeof vBulletin.Responsive.ChannelContent.cloneAndMoveToolbarButtons&&vBulletin.Responsive.ChannelContent.cloneAndMoveToolbarButtons()}}):h.data("media-statechange-set")||(l("media_filter","media",pageNum,!0),h.data("media-statechange-set",!0))}else if("#infractions-tab"==
b){b=Number(a(".pagenav-form .js-pagenum",n).val())||1;let r=vBulletin.infraction;f?(a(".pagenav-form",n).length&&!h.data("pagination-instance")&&(new vBulletin.pagination({context:h,tabParamAsQueryString:!1,allowHistory:1==h.find(".conversation-toolbar-wrapper").data("allow-history"),onPageChanged:function(E,P){r.loadUserInfractions({container:h,userid:h.data("userid"),pageNumber:E,replaceState:!0})}}),h.data("pagination-instance",!0)),l("infraction_filter","infractions",b,!0),r.setHistoryStateChange(),
h.data("infraction-statechange-set",!0)):0==a(".infraction-list",n).length?(l("infraction_filter","infractions",b,!0),r.loadUserInfractions({container:h,userid:h.data("userid"),pageNumber:b,callback:function(){r.setHistoryStateChange();h.data("infraction-statechange-set",!0)}})):h.data("infraction-statechange-set")||(l("infraction_filter","infractions",b,!0),r.setHistoryStateChange(),h.data("infraction-statechange-set",!0))}else if("#ipaddress-tab"==b)if(f)l("tabs","ipaddress");else{var t=a(".js-profile-ipaddress-container",
n);0==t.children().length&&m.render({template:"profile_ipaddress",data:{userid:t.closest(".tabs").data("userid")},success:function(r){t.html(r.template).trigger("vb-instrument")}})}});a(".customize-theme").off("click").on("click",function(f){var b=a(".profile_custom_edit");if(b.is(":hidden")){var n=function(){b.removeClass("h-hide");vBulletin.animateScrollTop(b.offset().top,{duration:"slow"})};0<a(".profileNavTabs",b).length?n():vBulletin.AJAX({call:"/ajax/render/profile_custom_edit",userid:b.data("page-userid"),
success:function(h){b.html(h);b.prependTo("#content");window.setTimeout(function(){var u=b.find(".tab:hidden").css("display","block"),t=b.find(".h-hide").removeClass("h-hide");b.find("select").selectBox();t.addClass("h-hide");u.css("display","none")},0);n()},error_phrase:"unable_to_contact_server_please_try_again"})}else vBulletin.animateScrollTop(b.offset().top,{duration:"slow"})})}else a(".customize-theme").addClass("h-hide-imp");a(".profileDetailTabs").tabs().trigger("vb-tabinit");a(".toggle_customizations").off("click").on("click",
function(l){l="show"==a(this).attr("data-action")?1:0;vBulletin.AJAX({call:"/profile/toggle-profile-customizations",data:{showusercss:l},complete:function(){a("body").css("cursor","auto")},success:function(y){window.location.reload()}})});0<c.length&&(a(document).off("click",".profileTabs .action_button").on("click",".profileTabs .action_button",function(){if(!a(this).hasClass("subscribepending_button")){var l=a(this),y=parseInt(l.attr("data-userid")),f="";l.hasClass("subscribe_button")?f="add":l.hasClass("unsubscribe_button")&&
(f="delete");"number"==typeof y&&f&&vBulletin.AJAX({call:"/profile/follow-button",data:{"do":f,follower:y,type:"follow_members"},success:function(b){if(1==b||2==b){if("add"==f){var n=1==b?"subscribed":"subscribepending";b=1==b?"following":"following_pending";l.removeClass("subscribe_button").addClass(n+"_button b-button").find(".js-button__text-primary").text(vBulletin.phrase.get(b))}else"delete"==f&&l.removeClass("subscribed_button unsubscribe_button b-button b-button--special").addClass("subscribe_button b-button b-button--secondary").find(".js-button__text-primary").text(vBulletin.phrase.get("follow"));
location.reload()}},title_phrase:"profile_guser"})}}),a(document).off("mouseover",".profileTabs .action_button.subscribed_button").on("mouseover",".profileTabs .action_button.subscribed_button",function(l){a(this).html(vBulletin.phrase.get("following_remove")).addClass("b-button").toggleClass("subscribed_button unsubscribe_button b-button--special b-button--secondary")}),a(document).off("mouseout",".profileTabs .action_button.unsubscribe_button").on("mouseout",".profileTabs .action_button.unsubscribe_button",
function(l){a(this).html(vBulletin.phrase.get("following")).addClass("b-button").toggleClass("subscribed_button unsubscribe_button b-button--special b-button--secondary")}),a(document).offon("click",".js-update-status-btn",q),vBulletin.conversation.bindEditFormEventHandlers("all"),vBulletin.conversation.initPollEvents(g),vBulletin.conversation.initContentEvents(g),g.off("click",".js-comment-entry__post").on("click",".js-comment-entry__post",function(l){vBulletin.conversation.postComment.apply(this,
[l,function(){location.reload()}])}));g=a(".js-bookmarks-wrapper");c=g.find(".conversation-toolbar-wrapper");if(g.length&&(e=a(".js-bookmarks-container"),vBulletin.truncatePostContent(e),a(".pagenav-form",c).length&&!c.data("pagination-instance"))){const l=g.data("perpage");vBulletin.pagination({context:c,allowHistory:c.data("allowHistory"),onPageChanged(y){m.render({template:"widget_subscription__bookmarks_tab",data:{currentPage:y,perPage:l},success:f=>{let b=a(".js-bookmarks-container");f=a(f.template);
b.replaceWith(f);vBulletin.truncatePostContent(f)}});console.log({pageNumber:y,perpage:l})}});c.data("pagination-instance",!0)}a("body").is(".view-mode")&&(a(".js-edit-profile").off("click").on("click",M),a("#btnProfilePhotoSave").off("click").on("click",N));a("#btnProfilePhotoContinue").off("click").on("click",function(){var l=a("[name=profile-img-option]:checked").val();switch(parseInt(l)){case 2:l=a("#profilePhotoUrl").val();if(!l){vBulletin.error("edit_avatar","upload_invalid_url");break}initIAS();
a("#profilePicImgCrop").attr("src",l);case 1:a("div#cropFrame").removeClass("h-hide");a("#btnProfilePhotoSave").removeClass("h-hide-imp");a("#btnProfilePhotoContinue").addClass("h-hide-imp");a("div#uploadFrame").addClass("h-hide");a("#btnProfilePhotoClose").focus();break;case 4:L()}});a("#btnProfilePhotoClose").off("click").on("click",function(){closeUploader();F();a("div#uploadFrame").removeClass("h-hide");a("div#cropFrame").addClass("h-hide");a("#btnProfilePhotoSave").addClass("h-hide-imp");a("#btnProfilePhotoContinue").removeClass("h-hide-imp");
a("#editProfilePhotoDlg").dialog("close").find("form").trigger("reset")});a(document).off("click",".gallery-upload-form .files a:not([target^=_blank])").on("click",".gallery-upload-form .files a:not([target^=_blank])",function(l){l.preventDefault();a('<iframe style="display:none;"></iframe>').prop("src",this.href).appendTo("body")})});a(()=>{O();G(a(document));a(document).on("vb-instrument",d=>{G(a(d.target))})})})(jQuery,vBulletin,vBulletin.ajaxtools,vBulletin.dialogtools,vBulletin.media);
var ias=null;
initIAS=function(){var a=!1,k=$("#profilePicImgCrop"),m=$(".js-edit-profile"),p=m.data("avatarmaxwidth"),v=m.data("avatarmaxheight");k.off("load").on("load",function(){if(!a){k[0].style.setProperty("max-width","none","important");k[0].style.setProperty("max-height","none","important");var q=k.width(),x=k.height();k[0].style.setProperty("max-width","");k[0].style.setProperty("max-height","");q>p||x>v?(a=!0,q=k.width(),x=k.height(),q=Math.min(p,v,q,x),ias=k.imgAreaSelect({aspectRatio:"1:1",handles:!0,
zIndex:1012,enable:!0,show:!0,x1:0,y1:0,x2:q,y2:q,onSelectChange:setDimensions,resizeMargin:"ontouchstart"in document?30:15,instance:!0,keys:!0,persistent:!0}),modifyIasForTouch("enable"),resizeAvatarEditDialog()):$("#btnProfilePhotoSave").trigger("click")}})};
function resizeAvatarEditDialog(){var a=$("#editProfilePhotoDlg");a.dialog("option","position",{my:"center",at:"center",of:window,collision:"flipfit"});var k=$(".profile-photo-wrapper",a);k.height("auto");var m=$(window).height(),p=a.closest(".edit-profile-photo-dialog-container").height(),v=k.height();a=$("#profilePicImgCrop");var q=a.imgAreaSelect({instance:!0});p>m&&(k.height(v-(p-m)),m=$(".js-edit-profile"),k=m.data("avatarmaxwidth"),m=m.data("avatarmaxheight"),p=a.width(),v=a.height(),k=Math.min(k,
m,p,v),a.imgAreaSelect({x1:0,y1:0,x2:k,y2:k}));q.update()}
function modifyIasForTouch(a){function k(m){var p=m.originalEvent.touches;if(!(1<p.length)){var v={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",touchcancel:"mouseout"};if("undefined"!=typeof v[m.type]){var q=p[0];p={bubbles:!0,cancelable:!1,view:window,detail:1,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,buttons:0,relatedTarget:null};try{p.screenX=q.screenX,p.screenY=q.screenY,p.clientX=q.clientX,p.clientY=q.clientY}catch(x){}"touchstart"==
m.type&&(p.buttons=0,q=new MouseEvent("mousemove",p),m.target.dispatchEvent(q));p.buttons=1;v=new MouseEvent(v[m.type],p);m.target.dispatchEvent(v);if(m.target.className.match(/imgareaselect-/))return m.preventDefault(),!1}}}"ontouchstart"in document&&("enable"==a?($(document).off(".iastouch").on("touchstart.iastouch touchmove.iastouch touchend.iastouch touchcancel.iastouch",k),$("#editProfilePhotoDlg").css("-webkit-touch-callout","none"),$("body, html").addClass("h-prevent-scroll-v")):($(document).off(".iastouch"),
$("#editProfilePhotoDlg").css("-webkit-touch-callout","default"),$("body, html").removeClass("h-prevent-scroll-v")))}setDimensions=function(a,k){$("#x1").val(k.x1);$("#y1").val(k.y1);$("#x2").val(k.x2);$("#y2").val(k.y2);$("#width").val(k.width);$("#height").val(k.height)};closeUploader=function(){modifyIasForTouch("disable");$("#profilePicImgCrop").imgAreaSelect({remove:!0});null!=ias&&(ias=null);$("#profilePhotoFile").removeData(["fileupload","blueimp.fileupload.form"])};
