-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
scm.min.js
1 lines (1 loc) · 23.5 KB
/
scm.min.js
1
function Init(e,t,r){const n="Social Club Utility Tool",o="SCUT",s="https://github.com/Senexis/Social-Club-Tool",a="https://github.com/Senexis/Social-Club-Tool/issues/new",i="https://"+window.location.host,c=localStorage.getItem("SCUT_CLIENT_VERSION"),l=1e3;try{console.log.apply(console,["%c "+n+" %cv31 by Senex %c "+s,"background:#000000;color:#f90","background:#000000;color:#ffffff",""])}catch(e){console.log(n+" v31 by Senex - "+s)}function u(e){var t=document.cookie.match("(^|;) ?"+e+"=([^;]*)(;|$)");return t?t[2]:null}function d(e,t){console.groupCollapsed("["+o+": INFO] "+e),console.log(t),console.groupEnd()}function h(e,t){console.groupCollapsed("["+o+": ERROR] "+e),console.error(t),console.groupEnd()}function p(e,t,r){console.groupCollapsed("["+o+": AJAX] "+e),console.group("Request"),console.log(t),console.groupEnd(),console.group("Response"),console.log(r),console.groupEnd(),console.groupEnd()}function g(e,t,r){return{type:e,title:t,text:r,allowEscapeKey:!1,cancelButtonText:"No",closeOnConfirm:!1,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes",html:!0,showCancelButton:!0,showLoaderOnConfirm:!0}}function w(e,t,r,n){return"success"===e&&(n=5e3),"error"===e&&(n=6e4),void 0===n&&(n=5e3),{type:e,title:t,text:r,allowOutsideClick:!0,html:!0,timer:n}}function m(e,t,r){return{type:e,title:t,text:r,allowEscapeKey:!1,allowOutsideClick:!1,html:!0}}void 0===e&&(e=""),e=e.replace(/\\\"/g,"").replace(/\"/g,"").replace(/\s\s+/g," ").trim(),void 0===t&&(t=1),void 0===r&&(r=0),1===r&&alert(n+" v31 started in debug mode. If you see this and don't want to, remove the last 1 from Init().");try{var f=document.createElement("script");f.id="nt-jqjs",f.src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.6.4/jquery.min.js",document.getElementsByTagName("head")[0].appendChild(f);var y=document.createElement("link");y.id="nt-sacss",y.rel="stylesheet",y.href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css",document.getElementsByTagName("head")[0].appendChild(y);var v=document.createElement("script");v.id="nt-sajs",v.src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js",document.getElementsByTagName("head")[0].appendChild(v)}catch(e){return void h("Something went wrong while trying to load the necessary scripts.",e)}setTimeout(function(){if("https:"===window.location.protocol&&window.location.host.endsWith("socialclub.rockstargames.com"))try{try{var o=$(siteMaster.aft)[0].value,f=siteMaster.authUserNickName,y=siteMaster.isLoggedIn}catch(e){return h("Could not fetch all necessary account data because something went wrong.",e),void swal(m("error","An error occured",'<p style="margin:12px 0!important">'+n+' was unable to retrieve the required account data. Please try clicking the bookmark again. If the problem persists, please <a href="'+a+'" target="_blank">submit an issue</a> with the details below.</p><p style="margin:12px 0!important">Error:</p><pre>'+e+"</pre>"))}if(""!=f&&y){function v(e){$.ajax({url:e.url,error:e.error,success:e.success,type:"GET",headers:{"Content-Type":"application/json",RequestVerificationToken:o},xhr:function(){var e=jQuery.ajaxSettings.xhr(),t=e.setRequestHeader;return e.setRequestHeader=function(e,r){"X-Requested-With"!=e&&t.call(this,e,r)},e}})}function b(e){$.ajax({url:e.url,data:JSON.stringify(e.data),error:e.error,success:e.success,complete:e.complete,type:e.type,headers:{"Content-Type":"application/json",RequestVerificationToken:o},xhr:function(){var e=jQuery.ajaxSettings.xhr(),t=e.setRequestHeader;return e.setRequestHeader=function(e,r){"X-Requested-With"!=e&&t.call(this,e,r)},e}})}function k(e){try{var t=u(siteMaster.scauth.tokenCookieName),r={method:e.method,credentials:"include",cache:"default",mode:"cors",headers:{authorization:`Bearer ${t}`,"x-requested-with":"XMLHttpRequest"}};fetch(e.url,r).then(e=>{if(!e.ok)throw e;return e.json()}).then(t=>e.success(t)).catch(t=>{t instanceof Error?e.error(t):t instanceof Response?401===t.status?function(e){try{if(e.triedRefresh)throw new Error("Could not refresh access.");e.triedRefresh=!0;var t=u(siteMaster.scauth.tokenCookieName),r={method:"POST",body:`accessToken=${t}`,credentials:"include",cache:"default",mode:"cors",headers:{"content-type":"application/x-www-form-urlencoded; charset=utf-8","x-requested-with":"XMLHttpRequest"}};fetch("https://socialclub.rockstargames.com/connect/refreshaccess",r).then(t=>{if(!t.ok)throw new Error("Could not refresh access.");k(e)}).catch(t=>e.error(t))}catch(t){e.error(t)}}(e):429===t.status?e.error(new Error("Rate limited.")):e.error(new Error(`Request failed: ${t.status} - ${t.statusText}`)):e.error(new Error("Something went wrong."))})}catch(t){e.error(t)}}function S(e,t){try{void 0===t&&(t=!1);var r=!1,n=function(){r?swal(w("error","Rate limited","Rockstar servers blocked a request to prevent spam. Please wait a couple minutes then try again.")):($(".nt-swal-progress-current").text(e.length),setTimeout(function(){if(e.length>0)S(e,t);else{var r="";r=t?"<p>One or more messages could not be deleted due to an error. Please try again or remove them manually.</p>":"<p>All messages in your inbox have been deleted.</p>",r+="<p>To view the changes to your inbox, please refresh the page.</p>",swal(w(t?"success":"warning","Messages removed",r))}},l))},o=e.pop();if(void 0===o)return h("An item has been skipped.","The current item is undefined, also I'm a teapot."),void n();d("Popped the items list in RemoveMessages().",o),b({url:i+"/Message/DeleteMessage",type:"POST",data:{messageid:o.ID,isAdmin:o.IsAdminMessage},error:function(e){p("Couldn't complete delete message "+o.ID+" in RemoveMessages().",this,e),429===e.status&&(r=!0),t=!0},success:function(e){p("Successfully completed deleted message "+o.ID+" in RemoveMessages().",this,e),1!=e.Status&&(t=!0)},complete:n})}catch(e){return void h("Something went wrong in RemoveMessages().",e)}}function x(e,t,n,o,s,a){try{if(void 0===e)throw new Error("No retrieve URL supplied.");if(void 0===t)throw new Error("No action URL supplied.");if(void 0===n)throw new Error("No action callback supplied.");void 0===o&&(o=[]),void 0===s&&(s=0),void 0===a&&(a=12),k({url:`${e}?onlineService=sc&nickname=&pageIndex=${s}&pageSize=${a}`,method:"GET",success:function(i){p("Successfully fetched the friends list in RetrieveRockstarAccounts().",this,i),1==i.status?i.rockstarAccountList.rockstarAccounts.forEach(function(e){void 0!==e&&o.push(e)}):swal(w("error","Something went wrong","Something went wrong while trying to fetch data from page "+s+".")),setTimeout(function(){o.length<i.rockstarAccountList.total?x(e,t,n,o,s+1,a):($(".nt-swal-retrieving").hide(),$(".nt-swal-progress").show(),function e(t,n,o,s){try{if(void 0===t)throw new Error("No action URL supplied.");if(void 0===n)throw new Error("No action callback supplied.");if(void 0===o)throw new Error("No rockstar accounts source supplied.");void 0===s&&(s=[]);var a=function(){$(".nt-swal-progress-current").text(o.length),setTimeout(function(){o.length>0?e(t,n,o,s):n(s)},l)},i=o.pop();if(void 0===i)return h("An item has been skipped.","The current item is undefined, also I'm a teapot."),void a();d("Popped the items list in ProcessRockstarAccounts().",i),1===r&&(i.rockstarId="x"),k({url:`${t}?rockstarId=${i.rockstarId}`,method:"POST",success:function(e){p("Successfully processed the popped item in ProcessRockstarAccounts().",this,e),1!=e.status&&s.push(i.name),a()},error:function(e){p("Couldn't process the popped item in ProcessRockstarAccounts().",this,e),e.message.includes("Rate limited.")?swal(w("error","Rate limited","Rockstar servers blocked a request to prevent spam. Please wait a couple minutes then try again.")):(s.push(i.name),a())}})}catch(e){return void h("Something went wrong in ProcessRockstarAccounts().",e)}}(t,n,o))},l)},error:function(e){p("Couldn't fetch the friends list in RetrieveRockstarAccounts().",this,e),swal(w("error","Something went wrong","Something went wrong while trying to fetch data from page "+s+"."))}})}catch(e){return void h("Something went wrong in RetrieveRockstarAccounts().",e)}}function T(t){try{b({url:i+"/friends/UpdateFriend",type:"PUT",data:{id:t.RockstarId,op:"addfriend",custommessage:e},error:function(e){p("Couldn't complete add "+t.Nickname+" in AddFriend().",this,e),swal(w("error","Something went wrong","Something went wrong trying to add <strong>"+t.Nickname+"</strong>."))},success:function(e){p("Successfully completed add "+t.Nickname+" in AddFriend().",this,e),1==e.Status?swal(w("success","User added","<p>A friend request has been sent to <strong>"+t.Nickname+"</strong>.</p><p>To view the changes to your friends list, please refresh the page.</p>")):swal(w("error","Something went wrong","Something went wrong trying to add <strong>"+t.Nickname+"</strong>."))}})}catch(e){return void h("Something went wrong in AddFriend().",e)}}$("<style>body{margin-bottom:99px}#nt-root{z-index:999;position:fixed;bottom:0;left:0;right:0;text-align:center;background-color:rgba(0,0,0,.9);padding:.5rem}#nt-cred{color:white;border-top:solid 1px #333;padding:.5rem 0;margin-top:.5rem}#nt-cred a{color:white}#nt-update{padding:.5em;width:100%;height:10em;border:2px solid #f90;text-align:center;resize:none;background:0 0;cursor:initial}.sweet-alert button,.sweet-alert button.cancel,.nt-button{background:linear-gradient(90deg,#f7931e,#fcaf17)!important;border-color:#fcaf17!important;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none!important;color:#fff!important;cursor:pointer;display:inline-block!important;font-family:-apple-system,BlinkMacSystemFont,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:1rem;font-weight:700;line-height:2.25rem;padding:0 1.25rem;margin-right:.5rem;text-align:center;text-decoration:none;text-shadow:0 1px 1px rgba(26,26,26,.2);vertical-align:bottom}.sweet-alert button.cancel{background:linear-gradient(90deg,#aaa,#ccc)!important;border-color:#ccc!important}.sweet-alert button:active:not(:disabled),.sweet-alert button:hover:not(:disabled),.nt-button:active:not(:disabled),.nt-button:hover:not(:disabled){background:#fcaf17!important}.sweet-alert button.cancel:active:not(:disabled),.sweet-alert button.cancel:hover:not(:disabled){background:#ccc!important}.sweet-alert{background-color:#333;color:white;box-shadow:0 2px 5px 0 rgba(0,0,0,.5);border-radius:.5rem}.sweet-alert p,.sweet-alert h2{color:white}.sweet-alert p{margin:12px 0!important}.sweet-alert strong{font-weight:700!important}.sweet-alert ul{list-style:outside}.sweet-alert fieldset{display:none}.sweet-alert.show-input fieldset{display:block}.sweet-alert input{background:#333!important;border:solid 3px white;border-radius:.5rem;color:white}.sweet-alert input:focus{outline:0;background:rgba(255,255,255,.1);border:solid 3px white;box-shadow:none!important}.sweet-alert .sa-input-error{top:27px}.sweet-alert .sa-error-container,.sweet-alert .sa-icon.sa-success .sa-fix,.sweet-alert .sa-icon.sa-success::before,.sweet-alert .sa-icon.sa-success::after{background:#333!important}.sweet-alert .sa-icon.sa-success .sa-fix{width:7px;height:92px}.la-ball-fall{color:rgba(255,255,255,.5)!important}</style>").appendTo("head"),document.getElementById("nt-root")&&$("#nt-root").remove(),document.getElementById("nt-dam")&&$("#nt-dam").remove(),document.getElementById("nt-daf")&&$("#nt-daf").remove(),document.getElementById("nt-raf")&&$("#nt-raf").remove(),document.getElementById("nt-qa")&&$("#nt-qa").remove(),document.getElementById("nt-cred")&&$("#nt-cred").remove(),$('<div id="nt-root"></div>').prependTo("body"),$('<a id="nt-dam" class="nt-button" href="javascript:void(0)">Delete all messages</a>').appendTo("#nt-root"),$('<a id="nt-daf" class="nt-button" href="javascript:void(0)">Delete all friends</a>').appendTo("#nt-root"),$('<a id="nt-raf" class="nt-button" href="javascript:void(0)">Reject all friend requests</a>').appendTo("#nt-root"),$('<a id="nt-qa" class="nt-button" href="javascript:void(0)">Quick-add user</a>').appendTo("#nt-root"),$('<div id="nt-cred"> // <a href="'+s+'" target="_blank"><span style="color:#f7931e">'+n+"</span> by Senex</a> // v31 // </div>").appendTo("#nt-root"),31!=c&&($("#nt-cred").append('<span style="color:#f7931e">Updated automatically!</span> //'),localStorage.setItem("SCUT_CLIENT_VERSION",31)),$("#nt-dam").click(function(e){e.preventDefault();try{swal(g("warning","Are you sure?",'<p>All messages will be deleted from your inbox.</p><p>This process may take up to several minutes. Please be patient for it to be completed before browsing away from this page.</p><p><strong class="nt-swal-retrieving" style="display:none;">Retrieving <span class="nt-swal-retrieving-text">conversation list</span>...</strong></p><p><strong class="nt-swal-progress" style="display:none;"><span class="nt-swal-progress-current">0</span> of <span class="nt-swal-progress-total">0</span> message(s) remaining...</strong></p>'),function(e){if(!e)return!1;v({url:i+"/Message/GetMessageCount",error:function(e){p("Couldn't fetch the total message count in #nt-dam_click.",this,e),swal(w("error","Something went wrong","Something went wrong while trying to fetch the total amount of messages."))},success:function(e){p("Successfully fetched the total message count in #nt-dam_click.",this,e),e.Total>0?($(".nt-swal-progress-current").text(e.Total),$(".nt-swal-progress-total").text(e.Total),$(".nt-swal-retrieving").show(),function e(t,r){try{void 0===r&&(r=0),setTimeout(function(){v({url:i+"/Message/GetConversationList?pageIndex="+r,error:function(e){p("Couldn't fetch the conversation list in RetrieveAllMessageUsers().",this,e),swal(w("error","Something went wrong","Something went wrong while trying to fetch the conversation list."))},success:function(r){p("Successfully fetched the conversation list in RetrieveAllMessageUsers().",this,r),r.Users.forEach(function(e){t.push(e)}),!0===r.HasMore?e(t,r.NextPageIndex):($(".nt-swal-retrieving-text").text("messages"),function e(t,r){try{void 0===r&&(r=[]),setTimeout(function(){var n=t.pop();void 0!==n?(d("Popped the items list in RetrieveAllMessages().",n),v({url:i+"/Message/GetMessages?rockstarId="+n.RockstarId,error:function(n){p("Couldn't fetch the messages list in RetrieveAllMessages().",this,n),t.length>0?e(t,r):r.length>0&&($(".nt-swal-retrieving").hide(),$(".nt-swal-progress").show(),S(r))},success:function(n){p("Successfully fetched the messages list in RetrieveAllMessages().",this,n),r=r.concat(n.Messages),t.length>0?e(t,r):r.length>0&&($(".nt-swal-retrieving").hide(),$(".nt-swal-progress").show(),S(r))}})):e(t,r)},l)}catch(e){return void h("Something went wrong in RetrieveAllMessages().",e)}}(t))}})},l)}catch(e){return void h("Something went wrong in RetrieveAllMessageUsers().",e)}}([])):swal(w("success","No messages","There were no messages to delete."))}})})}catch(e){return h("Something went wrong in #nt-dam_click.",e),!1}return!1}),$("#nt-raf").click(function(e){e.preventDefault();try{swal(g("warning","Are you sure?",'<p>All friend requests you have received will be rejected.</p><p>This process may take up to several minutes. Please be patient for it to be completed before browsing away from this page.</p><p><strong class="nt-swal-progress" style="display:none;"><span class="nt-swal-progress-current">0</span> of <span class="nt-swal-progress-total">0</span> friend request(s) remaining...</strong></p>'),function(e){if(!e)return!1;k({url:`${siteMaster.scApiBase}/friends/getInvites?onlineService=sc&nickname=&pageIndex=0&pageSize=12`,method:"GET",success:function(e){p("Successfully fetched the friend requests in #nt-raf_click.",this,e),1==e.status&&e.rockstarAccountList.total>0?($(".nt-swal-progress-current").text(e.rockstarAccountList.total),$(".nt-swal-progress-total").text(e.rockstarAccountList.total),$(".nt-swal-retrieving").show(),x(`${siteMaster.scApiBase}/friends/getInvites`,`${siteMaster.scApiBase}/friends/cancelInvite`,function(e){var t=e.length>0,r=t?"success":"warning",n="";n=t?"<p>"+e.length+" friend request(s) could not be cancelled due to an error. Please try again or remove them manually.</p>":"<p>All friend requests have been cancelled.</p>",n+="<p>To view the changes to your friend requests, please refresh the page.</p>",swal(w(r,"Friend requests cancelled",n))})):1==e.status&&0==e.rockstarAccountList.total?swal(w("success","No friend requests","There were no friend requests to cancel.")):swal(w("error","Something went wrong","Something went wrong while trying to fetch friend data."))},error:function(e){p("Couldn't fetch the friend requests in #nt-raf_click.",this,e),swal(w("error","Something went wrong","Something went wrong while trying to fetch the total amount of friend requests."))}})})}catch(e){return h("Something went wrong in #nt-raf_click.",e),!1}return!1}),$("#nt-daf").click(function(e){e.preventDefault();try{swal(g("warning","Are you sure?",'<p>All friends will be removed from your friend list.<p></p>This process may take up to several minutes. Please be patient for it to be completed before browsing away from this page.</p><p><strong class="nt-swal-retrieving" style="display:none;">Retrieving friends...</strong></p><p><strong class="nt-swal-progress" style="display:none;"><span class="nt-swal-progress-current">0</span> of <span class="nt-swal-progress-total">0</span> friend(s) remaining...</strong></p>'),function(e){if(!e)return!1;k({url:`${siteMaster.scApiBase}/friends/getFriendsFiltered?onlineService=sc&nickname=&pageIndex=0&pageSize=12`,method:"GET",success:function(e){p("Successfully fetched the friends list in #nt-daf_click.",this,e),1==e.status&&e.rockstarAccountList.total>0?($(".nt-swal-progress-current").text(e.rockstarAccountList.total),$(".nt-swal-progress-total").text(e.rockstarAccountList.total),$(".nt-swal-retrieving").show(),x(`${siteMaster.scApiBase}/friends/getFriendsFiltered`,`${siteMaster.scApiBase}/friends/remove`,function(e){var t=e.length>0,r=t?"success":"warning",n="";n=t?"<p>"+e.length+" friend(s) could not be removed due to an error. Please try again or remove them manually.</p>":"<p>All friends have been removed.</p>",n+="<p>To view the changes to your friends list, please refresh the page.</p>",swal(w(r,"Friends removed",n))})):1==e.status&&0==e.rockstarAccountList.total?swal(w("success","No friends","There were no friends to remove.")):swal(w("error","Something went wrong","Something went wrong while trying to fetch friend data."))},error:function(e){p("Couldn't fetch the friends list in #nt-daf_click.",this,e),swal(w("error","Something went wrong","Something went wrong while trying to fetch the total amount of friends."))}})})}catch(e){return h("Something went wrong in #nt-daf_click.",e),!1}return!1}),$("#nt-qa").click(function(r){r.preventDefault();try{swal({type:"input",title:"Enter username",text:'<p>Please enter the Social Club username you want to add. When you click "Add", the user will automatically be added if it exists.</p>'+(t?"":"<p><strong>Note:</strong> You have disabled the blocked users list check. If the user is on your blocked users list, they will be unblocked and sent a friend request.</p>")+(""==e?"":"<p><strong>Note:</strong> You have set a custom friend request message, which will get sent to the user.</p>"),allowEscapeKey:!1,closeOnConfirm:!1,confirmButtonText:"Add",html:!0,inputPlaceholder:"Social Club username",showCancelButton:!0,showLoaderOnConfirm:!0},e=>(function(e){if(!1===e)return!1;if(""===(e=e.trim()))return swal.showInputError("The username field can't be empty."),!1;if(e.match(new RegExp("([^A-Za-z0-9-_.])")))return swal.showInputError("The username field contains invalid characters."),!1;if(e.length<6)return swal.showInputError("The username field can't be shorter than 6 characters."),!1;if(e.length>16)return swal.showInputError("The username field can't be longer than 16 characters."),!1;if(e.toLowerCase()===f.toLowerCase())return swal.showInputError("You can't add yourself as a friend."),!1;v({url:i+"/Friends/GetAccountDetails?nickname="+e+"&full=false",error:function(t){p("Couldn't fetch the account details of "+e+" in #nt-qa_click.",this,t),swal(w("error","Something went wrong","Something went wrong while trying to check whether <strong>"+e+"</strong> exists or not."))},success:function(r){p("Successfully fetched the account details of "+e+" in #nt-qa_click.",this,r),1==r.Status?"Friend"==r.Relation?swal(w("success","Already added","<strong>"+e+"</strong> is already your friend.")):1==r.AllowAddFriend?t?function(e){try{var t=[];setTimeout(function(){v({url:i+"/friends/GetBlockedJson",error:function(e){p("Couldn't fetch blocked users list in RetrieveBlockedList().",this,e),swal(w("error","Something went wrong","Something went wrong while trying to retrieve blocked users."))},success:function(r){if(p("Successfully fetched blocked users list in RetrieveBlockedList().",this,r),1==r.Status){r.RockstarAccounts.forEach(function(e){void 0!==e&&t.push(e)});var n=t.filter(function(t){return t.Name.trim().toLowerCase()===e.Nickname.trim().toLowerCase()})[0];null==n?T(e):swal(w("error","User blocked","<strong>"+e.Nickname+"</strong> is on your blocked users list. To be able to send them a friend request, remove them from your blocked users list, then try again."))}else swal(w("error","Something went wrong","Something went wrong while trying to retrieve blocked users."))}})},l)}catch(e){return void h("Something went wrong in RetrieveBlockedList().",e)}}(r):T(r):1==r.AllowAcceptFriend?function(e){try{b({url:i+"/friends/UpdateFriend",type:"PUT",data:{id:e.RockstarId,op:"confirm",accept:"true"},error:function(t){p("Couldn't complete accept "+e.Nickname+"'s friend request in AcceptFriend().",this,t),swal(w("error","Something went wrong","Something went wrong trying to accept <strong>"+e.Nickname+"</strong>'s friend request."))},success:function(t){p("Successfully completed accept "+e.Nickname+"'s friend request in AcceptFriend().",this,t),1==t.Status?swal(w("success","User accepted","<p><strong>"+e.Nickname+"</strong> already sent you a friend request, and we accepted it instead of sending a new one.</p><p>To view the changes to your friends list, please refresh the page.</p>")):swal(w("error","Something went wrong","Something went wrong trying to accept <strong>"+e.Nickname+"</strong>'s friend request."))}})}catch(e){return void h("Something went wrong in AcceptFriend().",e)}}(r):swal(w("error","Can't send request","You can't send <strong>"+e+"</strong> a friend request. This might be because you already sent them a friend request, or because they blocked you.")):swal(w("error","User not found","The nickname <strong>"+e+"</strong> doesn't exist."))}})})(e))}catch(e){return h("Something went wrong in #nt-qa_click.",e),!1}return!1})}else h("In order to use "+n+", you must log into your Social Club account.",'userNickname == "" || isLoggedIn != true'),swal(m("error","Log in required",n+" requires you to log in to be able to apply changes to your account. Please log into the account you want to use with "+n+", then click the bookmark again."))}catch(e){return h("Something went wrong.",e),void swal(m("error","An error occured",'<p style="margin:12px 0!important">'+n+' was unable to complete your request. Please try clicking the bookmark again. If the problem persists, please <a href="'+a+'" target="_blank">submit an issue</a> with the details below.</p><p style="margin:12px 0!important">Error:</p><pre>'+e+"</pre>"))}else h("The current website is not a Social Club website and "+n+" can't continue.",'window.location.protocol !== "https:" || !window.location.host.endsWith("socialclub.rockstargames.com")'),swal({type:"warning",title:"Wrong site",text:"<p>Whoops, you accidentally activated "+n+" on a wrong web page. To use "+n+", first browse to the Social Club website, then click the bookmark again.</p><p>Do you want to go to the Social Club website now?</p>",allowOutsideClick:!0,cancelButtonText:"No",closeOnConfirm:!1,confirmButtonText:"Yes",html:!0,showCancelButton:!0},function(){window.location.href="http://socialclub.rockstargames.com/"})},l)}