diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 53ad680..4226389 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -20,11 +20,11 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: false - tag_name: v4.2.13 - name: 4.2.13 + tag_name: v4.2.14 + name: 4.2.14 body: |- - - Keyhub可识别任务增加(itch) - - 移除Keyhub验证任务功能 + - Keyhub可识别任务增加(Check out our other giveaways) + - Keyhub可识别任务增加(Claim this free game on Steam) files: |- dist/auto-task-v4-for-giveawaysu.user.js dist/auto-task-v4.compatibility.user.js diff --git a/dist/auto-task-v4-for-giveawaysu.all.user.js b/dist/auto-task-v4-for-giveawaysu.all.user.js index 2b4e032..c7c67a4 100644 --- a/dist/auto-task-v4-for-giveawaysu.all.user.js +++ b/dist/auto-task-v4-for-giveawaysu.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.2.13 +// @version 4.2.14 // @description 赠Key站自动任务 // @author HCLonely // @license MIT diff --git a/dist/auto-task-v4-for-giveawaysu.user.js b/dist/auto-task-v4-for-giveawaysu.user.js index 72cf00e..29f7dcc 100644 --- a/dist/auto-task-v4-for-giveawaysu.user.js +++ b/dist/auto-task-v4-for-giveawaysu.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.2.13 +// @version 4.2.14 // @description 赠Key站自动任务 // @author HCLonely // @license MIT diff --git a/dist/auto-task-v4.all.user.js b/dist/auto-task-v4.all.user.js index 08ac93f..621d835 100644 --- a/dist/auto-task-v4.all.user.js +++ b/dist/auto-task-v4.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4 // @namespace auto-task-v4 -// @version 4.2.13 +// @version 4.2.14 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -7963,7 +7963,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); if (action === 'do') { this.undoneTasks.discord.serverLinks.push(link); } - } else if (/^https?:\/\/twitter\.com\/.*/.test(link) || /^https?:\/\/www\.twitch\.tv\/.*/.test(link) || /^https?:\/\/www\.facebook\.com\/.*/.test(link) || /^https?:\/\/www\.youtube\.com\/.*/.test(link) || /^https?:\/\/store\.steampowered\.com\/developer\//.test(link) || /^https?:\/\/.*?\.itch\.io\/.*/.test(link)) {} else { + } else if (/^https?:\/\/twitter\.com\/.*/.test(link) || /^https?:\/\/www\.twitch\.tv\/.*/.test(link) || /^https?:\/\/www\.facebook\.com\/.*/.test(link) || /^https?:\/\/www\.youtube\.com\/.*/.test(link) || /^https?:\/\/store\.steampowered\.com\/developer\//.test(link) || /^https?:\/\/.*?\.itch\.io\/.*/.test(link) || /^https?:\/\/.*?\.itch\.io\/.*/.test(link) || /^https?:\/\/key-hub\.eu.*/.test(link) || /^https?:\/\/store\.steampowered\.com\/app\/.*/.test(link)) {} else { scripts_echoLog({}).warning(`${i18n('unKnownTaskType')}: ${taskDes}(${link})`); } } diff --git a/dist/auto-task-v4.compatibility.all.user.js b/dist/auto-task-v4.compatibility.all.user.js index 59ef3f1..048d66f 100644 --- a/dist/auto-task-v4.compatibility.all.user.js +++ b/dist/auto-task-v4.compatibility.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.2.13 +// @version 4.2.14 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -133,7 +133,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); 执行日志: [code]${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")}[/code]`,GM_setClipboard(e),p().fire({title:R("copySuccess"),icon:"success",confirmButtonText:R("ok")}).then(()=>{window.open("https://keylol.com/forum.php?mod=post&action=reply&fid=319&tid=777450","_blank")}))}),console.log("%c%s","color:white;background:red",`Auto-Task[Error]: ${i} -`+s.stack)}var g=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(x(this,_,{auth:t}),s.success(),e(await b(this,O,M).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return K(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=N({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://discord.com/api/v9/invites/"+t,method:"POST",dataType:"json",headers:{authorization:T(this,_).auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+t}});if("Success"!==i||200!==(null==o?void 0:o.status))return l.error(i+`:${n}(${a})`),!1;l.success();var r=String(null===(e=o.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(b(this,F,q).call(this,t,r),this.tasks.servers=I([...this.tasks.servers,t])),!0}catch(t){return K(t,"Discord.joinServer"),!1}}async function z(t){try{if(this.whiteList.servers.includes(t))return N({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await b(this,P,Y).call(this,t);if(!e)return!1;const o=N({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await L({url:"https://discord.com/api/v9/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:T(this,_).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return K(t,"Discord.leaveServer"),!1}}async function Y(t){try{const c=N({type:"gettingDiscordGuild",text:t});var e=T(this,A)[t];if(e)return c.success(),e;var{result:s,statusText:i,status:n,data:a}=await L({url:"https://discord.com/api/v9/invites/"+t,responseType:"json",method:"GET"});if("Success"!==s||200!==(null==a?void 0:a.status))return c.error(s+`:${i}(${n})`),!1;var o,r,l=null===(o=a.response)||void 0===o||null===(r=o.guild)||void 0===r?void 0:r.id;return l?(c.success(),b(this,F,q).call(this,t,l),l):(c.error(s+`:${i}(${n})`),!1)}catch(t){return K(t,"Discord.getGuild"),!1}}function q(t,e){try{T(this,A)[t]=e,GM_setValue("discordCache",T(this,A))}catch(t){K(t,"Discord.setCache")}}const J=class extends g{constructor(){var t;super(...arguments),m(this,F),m(this,P),m(this,j),m(this,D),m(this,E),m(this,O),y(this,"tasks",JSON.parse(G)),y(this,"whiteList",{...JSON.parse(G),...null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord}),v(this,_,{writable:!0,value:GM_getValue("discordAuth")||{}}),v(this,A,{writable:!0,value:GM_getValue("discordCache")||{}}),v(this,C,{writable:!0,value:!1})}async init(){try{if(!GM_getValue("dontRemindDiscordAgain"))if(!await p().fire({title:R("discordImportantNotice"),text:R("discordImportantNoticeText"),showCancelButton:!0,showDenyButton:!0,confirmButtonText:R("continue"),cancelButtonText:R("skipDiscordTask"),denyButtonText:R("continueAndDontRemindAgain")}).then(t=>{var{isConfirmed:e,isDenied:t}=t;return!!e||!!t&&(GM_setValue("dontRemindDiscordAgain",!0),!0)}))return x(this,C,!1),"skip";return T(this,C)?!0:T(this,_).auth?await b(this,O,M).call(this)?(N({}).success(R("initSuccess","Discord")),x(this,C,!0),!0):(GM_setValue("discordAuth",{auth:null}),await b(this,E,U).call(this)?(N({}).success(R("initSuccess","Discord")),x(this,C,!0),!0):(N({}).error(R("initFailed","Discord")),!1)):!!await b(this,E,U).call(this)&&(x(this,C,!0),!0)}catch(t){return K(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!T(this,C))return N({text:R("needInit")}),!1;const i=[];if(e&&!V.doTask.discord.servers||!e&&!V.undoTask.discord.servers)N({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return K(t,"Discord.toggleServers"),!1}}};function H(t,e){Z(t,e),e.add(t)}function X(t,e,s){Z(t,e),e.set(t,s)}function Z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function tt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,it(t,e,"set"),s),s}function et(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function st(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,it(t,e,"get"))}function it(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const nt=JSON.stringify({users:[]});var at=new WeakMap,ot=new WeakMap,rt=new WeakMap,lt=new WeakSet,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet;async function ht(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return K(t,"Instagram.toggleUsers"),!1}}};function mt(t,e){kt(t,e),e.add(t)}function vt(t,e,s){kt(t,e),e.set(t,s)}function kt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function bt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,xt(t,e,"set"),s),s}function Tt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function $t(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,xt(t,e,"get"))}function xt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const St=JSON.stringify({reddits:[]});var Lt=new WeakMap,It=new WeakMap,Gt=new WeakSet,_t=new WeakSet;async function At(){try{const s=N({text:R("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await Tt(this,_t,Ct).call(this,!0))}})}catch(t){return K(t,"Reddit.useBeta"),!1}}async function Ct(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return K(t,"Reddit.toggle"),!1}}};function Et(t,e){jt(t,e),e.add(t)}function Dt(t,e,s){jt(t,e),e.set(t,s)}function jt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Wt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ft(t,e,"set"),s),s}function Nt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Vt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ft(t,e,"get"))}function Ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Mt=JSON.stringify({channels:[]});var Ut=new WeakMap,Bt=new WeakMap,Rt=new WeakMap,Kt=new WeakSet,zt=new WeakSet,Yt=new WeakSet,qt=new WeakSet,Jt=new WeakSet;async function Ht(){try{const r=N({text:R("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Vt(this,Ut).authToken,"Client-Id":Vt(this,Ut).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==o?void 0:o.status)&&null!==(t=o.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1):(r.error(i+`:${n}(${a})`),!1)}catch(t){return K(t,"Twitch.verifyAuth"),!1}}async function Xt(){try{const s=N({text:R("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Wt(this,Ut,t),s.success(),e(await Nt(this,Kt,Ht).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return K(t,"Twitch.updateAuth"),!1}}async function Zt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return N({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Nt(this,qt,Qt).call(this,e);if(!s)return!1;const c=N({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:a,statusText:o,status:r,data:l}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Vt(this,Ut).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=I([...this.tasks.channels,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return K(t,"Twitch.toggleChannel"),!1}}async function Qt(t){try{const d=N({type:"gettingTwitchChannelId",text:t});var e=Vt(this,Bt)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await L({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Vt(this,Ut).authToken,"Client-Id":Vt(this,Ut).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==a?void 0:a.status))return d.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1;var o,r,l,c,u=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(c=l.user)||void 0===c?void 0:c.id);return u?(Nt(this,Jt,te).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return K(t,"Twitch.getChannelId"),!1}}function te(t,e){try{Vt(this,Bt)[t]=e,GM_setValue("twitchCache",Vt(this,Bt))}catch(t){K(t,"Twitch.setCache")}}const ee=class extends g{constructor(){var t;super(...arguments),Et(this,Jt),Et(this,qt),Et(this,Yt),Et(this,zt),Et(this,Kt),Pt(this,"tasks",JSON.parse(Mt)),Pt(this,"whiteList",{...JSON.parse(Mt),...null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch}),Dt(this,Ut,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Dt(this,Bt,{writable:!0,value:GM_getValue("twitchCache")||{}}),Dt(this,Rt,{writable:!0,value:!1})}async init(){try{return Vt(this,Rt)?!0:Vt(this,Ut).authToken?await Nt(this,Kt,Ht).call(this)?(N({}).success(R("initSuccess","Twitch")),Wt(this,Rt,!0),!0):(GM_setValue("twitchAuth",null),await Nt(this,zt,Xt).call(this)?(N({}).success(R("initSuccess","Twitch")),Wt(this,Rt,!0),!0):(N({}).error(R("initFailed","Twitch")),!1)):!!await Nt(this,zt,Xt).call(this)&&(Wt(this,Rt,!0),!0)}catch(t){return K(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Vt(this,Rt))return N({text:R("needInit")}),!1;const i=[];if(e&&!V.doTask.twitch.channels||!e&&!V.undoTask.twitch.channels)N({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return K(t,"Twitch.toggle"),!1}}};function se(t,e){ne(t,e),e.add(t)}function ie(t,e,s){ne(t,e),e.set(t,s)}function ne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ae(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function oe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ce(t,e,"set"),s),s}function re(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function le(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ce(t,e,"get"))}function ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ue=JSON.stringify({users:[],retweets:[],likes:[]});var de=new WeakMap,he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakSet,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet;async function ye(){try{return await re(this,me,Te).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return K(t,"Twitter.verifyAuth"),!1}}async function be(){try{const s=N({text:R("updatingAuth","Twitter")});return await new Promise(e=>{const t=GM_openInTab("https://twitter.com/settings/account?k#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitterAuth");t?(oe(this,he,t),s.success(),e(await re(this,we,ye).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return K(t,"Twitter.updateToken"),!1}}async function Te(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return N({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?le(this,de):await this.userName2id(e);if(!i)return!1;const d=t?N({text:R("verifyingAuth","Twitter")}):N({type:`${s?"":"un"}followingTwitterUser`,text:e});var n,a,o,{result:r,statusText:l,status:c,data:u}=await L({url:`https://api.twitter.com/1.1/friendships/${s?"create":"destroy"}.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},responseType:"json",data:$.param({include_profile_interstitial_type:1,include_blocking:1,include_blocked_by:1,include_followed_by:1,include_want_retweets:1,include_mute_edge:1,include_can_dm:1,include_can_media_tag:1,skip_status:1,id:i})});return"Success"===r?200===(null==u?void 0:u.status)?(d.success(),s&&!t&&(this.tasks.users=I([...this.tasks.users,e])),!0):t&&403===(null==u?void 0:u.status)&&158===(null===(n=u.response)||void 0===n||null===(a=n.errors)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.code)?(d.success(),!0):(d.error(`Error:${null==u?void 0:u.statusText}(${null==u?void 0:u.status})`),!1):(d.error(r+`:${l}(${c})`),!1)}catch(t){return K(t,"Twitter.toggleUser"),!1}}async function $e(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return N({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=N({type:`${t?"":"un"}retweetting`,text:e});var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:`https://api.twitter.com/1.1/statuses/${t?"":"un"}retweet.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},data:$.param({tweet_mode:"extended",id:e}),responseType:"json"});return"Success"===a?200===(null==l?void 0:l.status)||403===(null==l?void 0:l.status)&&327===(null===(s=l.response)||void 0===s||null===(i=s.errors)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.code)?(c.success(),t&&(this.tasks.retweets=I([...this.tasks.retweets,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return K(t,"Twitter.toggleRetweet"),!1}}function xe(t,e){try{le(this,pe)[t]=e,GM_setValue("twitterCache",le(this,pe))}catch(t){K(t,"Twitter.setCache")}}const Se=class extends g{constructor(){var t;super(...arguments),se(this,ke),se(this,ve),se(this,me),se(this,ge),se(this,we),ae(this,"tasks",JSON.parse(ue)),ae(this,"whiteList",{...JSON.parse(ue),...null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter}),ie(this,de,{writable:!0,value:V.other.twitterVerifyId}),ie(this,he,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ie(this,pe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ie(this,fe,{writable:!0,value:!1})}async init(){try{return le(this,fe)?!0:le(this,he).ct0?await re(this,we,ye).call(this)?(N({}).success(R("initSuccess","Twitter")),oe(this,fe,!0),!0):(GM_setValue("twitterAuth",null),await re(this,ge,be).call(this)?(N({}).success(R("initSuccess","Twitter")),oe(this,fe,!0),!0):(N({}).error(R("initFailed","Twitter")),!1)):!!await re(this,ge,be).call(this)&&(oe(this,fe,!0),!0)}catch(t){return K(t,"Twitter.init"),!1}}async userName2id(t){try{const d=N({type:"gettingTwitterUserId",text:t});var e=le(this,pe)[t];if(e)return d.success(),e;var s,i,n,a,{result:o,statusText:r,status:l,data:c}=await L({url:"https://api.twitter.com/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json",referer:"https://twitter.com/"+t,"x-csrf-token":le(this,he).ct0},responseType:"json"});if("Success"!==o)return d.error(o+`:${r}(${l})`),!1;if(200!==(null==c?void 0:c.status))return d.error(`Error:${null==c?void 0:c.statusText}(${null==c?void 0:c.status})`),!1;{let e=c.response||("object"==typeof c.responseText?c.responseText:null);if(!e)try{e=JSON.parse(c.responseText)}catch(t){e=null}var u=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n||null===(a=n.result)||void 0===a?void 0:a.rest_id);return u?(re(this,ke,xe).call(this,t,u),d.success(),u):(d.error(`Error:${c.statusText}(${c.status})`),!1)}}catch(t){return K(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!le(this,fe))return N({text:R("needInit")}),!1;const a=[];if(e&&!V.doTask.twitter.users||!e&&!V.undoTask.twitter.users)N({type:"globalOptionsSkip",text:"twitter.users"});else{var i=this.getRealParams("users",s,e,t=>{return null===(t=t.match(/https:\/\/twitter\.com\/(.+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return K(t,"Twitter.toggle"),!1}}};function Le(t,e){Ge(t,e),e.add(t)}function Ie(t,e,s){Ge(t,e),e.set(t,s)}function Ge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _e(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ae(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ee(t,e,"set"),s),s}function Ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Oe(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ee(t,e,"get"))}function Ee(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const De=JSON.stringify({names:[]});var je=new WeakMap,Pe=new WeakMap,We=new WeakMap,Ne=new WeakSet,Ve=new WeakSet,Fe=new WeakSet,Me=new WeakSet,Ue=new WeakSet,Be=new WeakSet,Re=new WeakSet,Ke=new WeakSet;async function ze(){try{const e=N({text:R("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==a&&void 0!==a&&a.finalUrl.includes("vk.com/login")?(e.error("Error:"+R("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ae(this,je,(null===(t=a.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return K(t,"Vk.verifyAuth"),!1}}async function Ye(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return K(t,"Vk.toggle"),!1}}};function es(t,e){is(t,e),e.add(t)}function ss(t,e,s){is(t,e),e.set(t,s)}function is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ns(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function as(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ls(t,e,"set"),s),s}function os(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function rs(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ls(t,e,"get"))}function ls(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const cs=JSON.stringify({channels:[],likes:[]}),us=async function(t,e){try{const h=N({text:R("gettingYtbToken")}),{result:p,statusText:f,status:w,data:g}=await L({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${f}(${w})`),{};if(200!==(null===g||void 0===g?void 0:g.status))return h.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),{};{var s,i;if(g.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+R("loginYtb"),!0),{needLogin:!0};var n=null===(s=g.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=g.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||g.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(a);if(n&&m&&v){if(m.hl="en","channel"===e){var o,r=null===(o=g.responseText.match(//))||void 0===o?void 0:o[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,c,u=null===(l=g.responseText.match(//))||void 0===l?void 0:l[1],d=null===(c=g.responseText.match(/"likeParams":"(.*?)"/))||void 0===c?void 0:c[1];return u?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:u,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return K(t,"Youtube.getInfo"),{}}};var ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,fs=new WeakSet,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet;class ks extends g{constructor(){var t;super(...arguments),es(this,vs),es(this,ms),es(this,gs),es(this,ws),es(this,fs),ns(this,"tasks",JSON.parse(cs)),ns(this,"whiteList",{...JSON.parse(cs),...null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube}),ss(this,ds,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),ss(this,hs,{writable:!0,value:!1}),ss(this,ps,{writable:!0,value:"https://www.youtube.com/channel/"+V.other.youtubeVerifyChannel})}async init(){try{return rs(this,hs)?!0:rs(this,ds).PAPISID?await os(this,fs,ys).call(this)?(N({}).success(R("initSuccess","Youtube")),as(this,hs,!0),!0):(GM_setValue("youtubeAuth",null),await os(this,ws,bs).call(this)?(N({}).success(R("initSuccess","Youtube")),as(this,hs,!0),!0):(N({}).error(R("initFailed","Youtube")),!1)):!!await os(this,ws,bs).call(this)&&(as(this,hs,!0),!0)}catch(t){return K(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!rs(this,hs))return N({text:R("needInit")}),!1;const a=[];if(e&&!V.doTask.youtube.channels||!e&&!V.undoTask.youtube.channels)N({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return K(t,"Youtube.toggle"),!1}}}async function ys(){try{return await os(this,ms,$s).call(this,{link:rs(this,ps),doTask:!0,verify:!0})}catch(t){return K(t,"Youtube.verifyAuth"),!1}}async function bs(){try{const s=N({text:R("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(as(this,ds,t),s.success(),os(this,fs,ys).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return K(t,"Discord.updateAuth"),!1}}function Ts(t,e){return us(t,e)}async function $s(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await os(this,gs,Ts).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return N({html:R("loginYtb")}),!1;if(!(a&&o&&r&&l))return N({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return N({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?N({text:R("verifyingAuth","Youtube")}):N({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var c=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:f}=await L({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+a,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==o?void 0:o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:o,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===f||void 0===f?void 0:f.status)?s&&(/"subscribed": true/.test(f.responseText)||f.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(f.responseText)?(u.success(),s&&!t&&(this.tasks.channels=I([...this.tasks.channels,e])),!0):t&&f.responseText.includes("You may not subscribe to yourself")?(u.success(),!0):(u.error(R("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),!1):(u.error(d+`:${h}(${p})`),!1)}catch(t){return K(t,"Youtube.toggleChannel"),!1}}async function xs(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await os(this,gs,Ts).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return N({html:""+R("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return N({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return N({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=N({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var c=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:a,request:{sessionId:o.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return u.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:f,data:w}=await L({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(u.success(),t&&(this.tasks.likes=I([...this.tasks.likes,e])),!0):(u.error(R("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(u.error(h+`:${p}(${f})`),!1)}catch(t){return K(t,"Youtube.toggleLikeVideo"),!1}}function Ss(t,e){Is(t,e),e.add(t)}function Ls(t,e,s){Is(t,e),e.set(t,s)}function Is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gs(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function _s(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function As(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Os(t,e,"set"),s),s}function Cs(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Os(t,e,"get"))}function Os(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Es=JSON.stringify({groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var Ds=new WeakMap,js=new WeakMap,Ps=new WeakMap,Ws=new WeakMap,Ns=new WeakMap,Vs=new WeakMap,Fs=new WeakSet,Ms=new WeakSet,Us=new WeakSet,Bs=new WeakSet,Rs=new WeakSet,Ks=new WeakSet,zs=new WeakSet,Ys=new WeakSet,qs=new WeakSet,Js=new WeakSet,Hs=new WeakSet,Xs=new WeakSet,Zs=new WeakSet,Qs=new WeakSet,ti=new WeakSet,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet,ai=new WeakSet,oi=new WeakSet,ri=new WeakSet,li=new WeakSet,ci=new WeakSet,ui=new WeakSet,di=new WeakSet,hi=new WeakSet,pi=new WeakSet,fi=new WeakSet;async function wi(){try{const s=N({text:R("updatingAuth",R("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${a})`),!1;if(200!==(null===o||void 0===o?void 0:o.status))return s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1;var t;if(o.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+R("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(Cs(this,js).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return K(t,"Steam.updateStoreAuth"),!1}}async function gi(){try{const o=N({text:R("updatingAuth",R("steamCommunity"))}),{result:r,statusText:l,status:c,data:u}=await L({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${c})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;var t,e,s;if(u.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+R("needLoginSteamCommunity"),!0),!1;var i=null===(t=u.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=u.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=u.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(Cs(this,js).steam64Id=i),a&&(Cs(this,js).userName=a),n)?(Cs(this,js).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return K(t,"Steam.updateCommunityAuth"),!1}}async function mi(){try{const i=N({text:R("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await L({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0{const e=setInterval(()=>{"waiting"!==Cs(this,Vs)&&(clearInterval(e),t(!0))})}),Cs(this,Ns)===e||!e&&"CN"!==Cs(this,Ns))return!0;As(this,Vs,"waiting");let t=e;if(!t){const{currentArea:c,areas:u}=await _s(this,Us,mi).call(this);if(!c||!u)return As(this,Vs,"error"),!1;if("CN"!==c)return As(this,Vs,"skip"),N({text:"notNeededChangeArea"}),"skip";var s=u.filter(t=>t&&"CN"!==t);if(!s||0===s.length)return As(this,Vs,"noAnotherArea"),N({text:"noAnotherArea"}),!1;[t]=s}const l=N({text:R("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:Cs(this,js).storeSessionID})});if("Success"!==i)return As(this,Vs,"error"),l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return As(this,Vs,"error"),l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await _s(this,Us,mi).call(this))["currentArea"];return r===t?(As(this,Vs,"success"),l.success(),r):(As(this,Vs,"error"),l.error("Error: change country filed"),"CN")}catch(t){return As(this,Vs,"error"),K(t,"Steam.changeArea"),!1}}async function ki(t){try{const e=N({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Cs(this,js).communitySessionID})});return"Success"===s?200!==(null===a||void 0===a?void 0:a.status)||a.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.success(),this.tasks.groups=I([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return K(t,"Steam.joinGroup"),!1}}async function yi(t){try{if(this.whiteList.groups.includes(t))return N({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await _s(this,zs,bi).call(this,t);if(!e)return!1;const s=N({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${Cs(this,js).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Cs(this,js).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===o||void 0===o?void 0:o.status)&&o.finalUrl.includes("groups")&&0===$(o.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(s.error(i+`:${n}(${a})`),!1)}catch(t){return K(t,"Steam.leaveGroup"),!1}}async function bi(t){try{const n=N({type:"gettingSteamGroupId",text:t});var e=Cs(this,Ds).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return n.error(a+`:${o}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(_s(this,fi,Bi).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return K(t,"Steam.getGroupID"),!1}}async function Ti(t){try{const i=N({type:"joiningSteamOfficialGroup",text:t}),{result:n,statusText:a,status:o,data:r}=await L({url:`https://steamcommunity.com/games/${t}?action=join&sessionID=`+Cs(this,js).communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==n)return i.error(n+`:${a}(${o})`),!1;if(200!==(null===r||void 0===r?void 0:r.status)||r.responseText.includes('id="publicGroupJoin"'))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),!1;var e;i.success(),this.tasks.officialGroups=I([...this.tasks.officialGroups,t]);var s=null===(e=r.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===e?void 0:e[1];return s&&_s(this,fi,Bi).call(this,"officialGroup",t,s),!0}catch(t){return K(t,"Steam.joinOfficialGroup"),!1}}async function $i(t){try{if(this.whiteList.officialGroups.includes(t))return N({type:"whiteList",text:"Steam.leaveOfficialGroup",id:t}),!0;var e=await _s(this,Js,xi).call(this,t);if(!e)return!1;const o=N({type:"leavingSteamOfficialGroup",text:t});var{result:s,statusText:i,status:n,data:a}=await L({url:`https://steamcommunity.com/id/${Cs(this,js).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Cs(this,js).communitySessionID,action:"leaveGroup",groupId:e})});if("Success"!==s)return o.error(s+`:${i}(${n})`),!1;if(200!==(null==a?void 0:a.status))return o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1;{const{result:r,statusText:l,status:c,data:u}=await L({url:"https://steamcommunity.com/games/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===r?200===(null===u||void 0===u?void 0:u.status)&&u.responseText.includes('id="publicGroupJoin"')?(o.success(),!0):(o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1):(o.error(r+`:${l}(${c})`),!1)}}catch(t){return K(t,"Steam.leaveOfficialGroup"),!1}}async function xi(t){try{const n=N({type:"gettingSteamOfficialGroupId",text:t});var e=Cs(this,Ds).officialGroup[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://steamcommunity.com/games/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return n.error(a+`:${o}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===s?void 0:s[1];return i?(_s(this,fi,Bi).call(this,"officialGroup",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return K(t,"Steam.getGroupID"),!1}}async function Si(t){try{var e;const n=N({type:"addingToWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Cs(this,js).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=I([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===Cs(this,Ns)&&l.responseText.includes('id="error_box"')?(n.warning(R("changeAreaNotice")),!!await _s(this,Bs,vi).call(this)&&await _s(this,Hs,Si).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=I([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(a+`:${o}(${r})`),!1)}catch(t){return K(t,"Steam.addToWishlist"),!1}}async function Li(t){try{var e;if(this.whiteList.wishlists.includes(t))return N({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=N({type:"removingFromWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Cs(this,js).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return a.success(),!0;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;if("CN"===Cs(this,Ns)&&c.responseText.includes('id="error_box"')){a.warning(R("changeAreaNotice"));var n=await _s(this,Bs,vi).call(this);return n&&"CN"!==n&&"skip"!==n?await _s(this,Xs,Li).call(this,t):!1}return c.responseText.includes('class="queue_actions_ctn"')&&(c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1)}catch(t){return K(t,"Steam.removeFromWishlist"),!1}}async function Ii(t,e){try{if(!e&&this.whiteList.follows.includes(t))return N({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=N({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:Cs(this,js).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await L({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(o)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return a.success(),!0;var n=await _s(this,Qs,Gi).call(this,t);return"CN"===Cs(this,Ns)&&"areaLocked"===n?(a.warning(R("changeAreaNotice")),!!await _s(this,Bs,vi).call(this)&&await _s(this,Xs,Li).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=I([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return K(t,"Steam.toggleFollowGame"),!1}}async function Gi(t){try{const{result:e,data:s}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===Cs(this,Ns)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return K(t,"Steam.isFollowedGame"),!1}}async function _i(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(_s(this,fi,Bi).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return K(t,"Steam.getWorkshopAppId"),!1}}async function Ei(t){try{const o=N({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:Cs(this,js).communitySessionID})});return"Success"===s?(200===(null==a?void 0:a.status)&&1===(null===(e=a.response)||void 0===e?void 0:e.success)?o.success():o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!0):(o.error(s+`:${i}(${n})`),!0)}catch(t){return K(t,"Steam.voteupWorkshop"),!0}}async function Di(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/games\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),b=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(e&&V.doTask.steam.playtests&&0<$.length)for(const P of $)x.push(_s(this,pi,Ui).call(this,P)),await W(1e3)}return Promise.all(x).then(async()=>("CN"!==Cs(this,Ns)&&(N({}).warning(R("steamFinishNotice")),await _s(this,Bs,vi).call(this,"CN")),!0))}catch(t){return K(t,"Steam.toggle"),!1}}};function Ki(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function zi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Yi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var qi=new WeakSet;async function Ji(e,t){try{return{name:e,result:await t}}catch(t){return K(t,"Website.bind"),{name:e,result:!1}}}var Hi=class{constructor(){Ki(this,qi),zi(this,"undoneTasks",void 0),zi(this,"socialTasks",void 0),zi(this,"giveawayId",void 0),zi(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1}),zi(this,"initialized",!1),zi(this,"social",{})}async initSocial(t){try{const i=[],n="do"===t?this.undoneTasks:this.socialTasks;var e,s;return n.discord&&(!(0[...t,...e]).length)||this.socialInitialized.discord&&this.social.discord||(this.social.discord=new J,i.push(Yi(this,qi,Ji).call(this,"discord",this.social.discord.init())))),n.instagram&&(!(0[...t,...e]).length)||this.socialInitialized.instagram&&this.social.instagram||(this.social.instagram=new gt,i.push(Yi(this,qi,Ji).call(this,"instagram",this.social.instagram.init())))),n.reddit&&(!(0[...t,...e]).length)||this.socialInitialized.reddit&&this.social.reddit||(this.social.reddit=new Ot,i.push(Yi(this,qi,Ji).call(this,"reddit",this.social.reddit.init())))),n.twitch&&(!(0[...t,...e]).length)||this.socialInitialized.twitch&&this.social.twitch||(this.social.twitch=new ee,i.push(Yi(this,qi,Ji).call(this,"twitch",this.social.twitch.init())))),n.twitter&&(!(0[...t,...e]).length)||this.socialInitialized.twitter&&this.social.twitter||(this.social.twitter=new Se,i.push(Yi(this,qi,Ji).call(this,"twitter",this.social.twitter.init())))),n.vk&&(!(0[...t,...e]).length)||this.socialInitialized.vk&&this.social.vk||(this.social.vk=new ts,i.push(Yi(this,qi,Ji).call(this,"vk",this.social.vk.init())))),n.youtube&&(!(0[...t,...e]).length)||this.socialInitialized.youtube&&this.social.youtube||(this.social.youtube=new ks,i.push(Yi(this,qi,Ji).call(this,"youtube",this.social.youtube.init())))),!n.steam||0<(e=Object.values(n.steam).reduce((t,e)=>[...t,...e]).length)&&(this.social.steam||(this.social.steam=new Ri),0{var e,s;return["groupLinks","officialGroupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(t)&&(null===(e=n.steam)||void 0===e||null===(s=e[t])||void 0===s?void 0:s.length)||0}).reduce((t,e)=>t+e,0))&&!this.socialInitialized.steamStore&&i.push(Yi(this,qi,Ji).call(this,"steamStore",this.social.steam.init("store"))),0{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return K(t,"Website.initSocial"),!1}}uniqueTasks(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=I(a)}return e}async toggleTask(t){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask(t))return!1;if(!await this.initSocial(t))return!1;const i=[];var e="do"===t,s=e?this.undoneTasks:this.socialTasks;if("skip"!==this.socialInitialized.discord&&this.social.discord&&i.push(this.social.discord.toggle({doTask:e,...s.discord})),this.social.instagram&&i.push(this.social.instagram.toggle({doTask:e,...s.instagram})),this.social.reddit&&i.push(this.social.reddit.toggle({doTask:e,...s.reddit})),this.social.twitch&&i.push(this.social.twitch.toggle({doTask:e,...s.twitch})),this.social.twitter&&i.push(this.social.twitter.toggle({doTask:e,...s.twitter})),this.social.vk&&i.push(this.social.vk.toggle({doTask:e,...s.vk})),this.social.youtube&&i.push(this.social.youtube.toggle({doTask:e,...s.youtube})),this.social.steam&&i.push(this.social.steam.toggle({doTask:e,...s.steam})),this.social.visitLink&&s.links&&e)for(const n of s.links)i.push(this.social.visitLink(n));return e&&s.extra&&this.extraDoTask&&0[...t,...e]).length&&i.push(this.extraDoTask(s.extra)),await Promise.all(i),N({}).success(R("allTasksComplete")),!0}catch(t){return K(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return K(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return K(t,"Website.undoTask"),!1}}};function Xi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Zi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const tn=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}});var en=new WeakSet,sn=new WeakSet;function nn(){try{var t,e=null===(t=window.location.href.match(/\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(N({}).error(R("getFailed","GiveawayId")),!1)}catch(t){K(t,"FreeAnyWhere.getGiveawayId")}}async function an(t){try{const o=N({html:`
  • ${R("verifyingTask")}${t.title.trim()}...
  • `});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/challenge-status/${t.id}/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.status?(o.success(),!0):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return K(t,"Freeanywhere.verify"),!1}}var on=class extends Hi{constructor(){super(...arguments),Xi(this,sn),Xi(this,en),Zi(this,"name","FreeAnyWhere"),Zi(this,"tasks",[]),Zi(this,"socialTasks",JSON.parse(tn)),Zi(this,"undoneTasks",JSON.parse(tn)),Zi(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=N({text:R("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(R("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(R("needLogin")),!1;if(!/^https?:\/\/freeanywhere\.net\/#\/giveaway\/[\d]+/.test(window.location.href)){var t,e=null===(t=window.location.href.match(/https?:\/\/freeanywhere\.net\/.*?#\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];if(!e)return s.error(R("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Qi(this,en,nn).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return K(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=N({text:R("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||JSON.parse(tn));var{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/?format=json`,method:"GET",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")},responseType:"json"});if("Success"!==s)return u.error(s+`:${i}(${n})`),!1;var o,r=null==a||null===(o=a.response)||void 0===o?void 0:o.challenges;if(r){"verify"===t&&(this.tasks=[]);for(const d of r){var l=d.challenge,c=d.challenge_provider;const h={id:d.id,title:d.title};if("verify"!==t||d.is_success)switch(c){case"steam":switch(h.social="steam",l){case"WL":"undo"===t&&this.socialTasks.steam.wishlistLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.wishlistLinks.push(d.link);break;case"JTG":"undo"===t&&this.socialTasks.steam.groupLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.groupLinks.push(d.link);break;case"STC":"undo"===t&&this.socialTasks.steam.curatorLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.curatorLinks.push(d.link);break;case"GF":"undo"===t&&this.socialTasks.steam.followLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.followLinks.push(d.link)}break;case"vk-oauth2":"undo"===t&&this.socialTasks.vk.nameLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.vk.nameLinks.push(d.link);break;case"website":break;default:N({}).warning(R("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("fawTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}return u.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1}catch(t){return K(t,"Freeanywhere.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;const t=[];for(const e of this.tasks)t.push(Qi(this,sn,an).call(this,e)),await W(1e3);return await Promise.all(t),N({}).success(R("allTasksComplete")),!!await this.getKey(!0)}catch(t){return K(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=N({text:R("gettingKey")});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/reward/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.reward?(o.success(),N({}).success(a.response.reward),a.response.reward):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return K(t,"FreeAnyWhere.getGiveawayId"),!1}}};function rn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ln(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function cn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const un={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var dn=new WeakSet,hn=new WeakSet,pn=new WeakSet;class fn extends Hi{constructor(){super(...arguments),rn(this,pn),rn(this,hn),rn(this,dn),ln(this,"name","GiveawaySu"),ln(this,"socialTasks",un),ln(this,"undoneTasks",un),ln(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{cn(this,dn,wn).call(this)||N({}).warning(R("checkLoginFailed")),await cn(this,hn,gn).call(this)||N({}).warning(R("checkLeftKeyFailed")),N({}).warning(R("gsNotice"))}catch(t){K(t,"Giveawaysu.after")}}init(){try{const t=N({text:R("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(R("needLogin")),!1):!!cn(this,pn,mn).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return K(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=N({text:R("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||un,!0;const n=[];var s=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const r of s)n.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(a.includes("steam")&&/join/gi.test(o)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(o)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(o)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):a.includes("steam")&&/follow|subscribe/gim.test(o)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(o)?this.undoneTasks.steam.forumLinks.push(t):a.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):a.includes("plus")&&/request.*playtest/gim.test(o)?this.undoneTasks.steam.playtestLinks.push(t):a.includes("discord")||/join.*discord/gim.test(o)?this.undoneTasks.discord.serverLinks.push(t):a.includes("instagram")||/follow.*instagram/gim.test(o)?this.undoneTasks.instagram.userLinks.push(t):a.includes("twitch")||/follow.*twitch.*channel/gim.test(o)?this.undoneTasks.twitch.channelLinks.push(t):a.includes("reddit")||/subscribe.*subreddit/gim.test(o)||/follow.*reddit/gim.test(o)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(o)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(o)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(o)||(a.includes("youtube")||a.includes("thumbs-up"))&&/(watch|like).*video/gim.test(o)?this.undoneTasks.youtube.likeLinks.push(t):a.includes("vk")||/join.*vk.*group/gim.test(o)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(o)||(/wishlist.*game|add.*wishlist/gim.test(o)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(o)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(K(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return K(t,"Giveawaysu.classifyTask"),!1}}}function wn(){try{return V.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return K(t,"Giveawaysu.checkLogin"),!1}}async function gn(){try{return V.other.checkLeftKey?(0<$(".giveaway-ended").length&&0===$(".giveaway-key").length&&await p().fire({icon:"warning",title:R("notice"),text:R("noKeysLeft"),confirmButtonText:R("confirm"),cancelButtonText:R("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return K(t,"Giveawaysu.checkLeftKey"),!1}}function mn(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(N({text:R("getFailed","GiveawayId")}),!1)}function vn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function kn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function yn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var bn=new WeakSet,Tn=new WeakSet,$n=new WeakSet,xn=new WeakSet;async function Sn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return N({}).error(R("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=N({text:R("joiningGiveaway")+"..."});var t,e,s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:c.attr("href"),method:"POST",data:"ajax=t",dataType:"json",headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8",accept:"application/json, text/javascript, */*; q=0.01",origin:window.location.origin}});return"Success"===a?200===(null==l?void 0:l.status)?null!==(t=l.response)&&void 0!==t&&t.success?(c.addClass("buttonentered").text("Success - Giveaway joined"),$("#giveawaysjoined").slideDown(),$("#giveawaysrecommend").slideDown(),u.success("Success"+(null!==(i=l.response)&&void 0!==i&&i.text?":"+(null===(n=l.response)||void 0===n?void 0:n.text):"")),!0):(u.error("Error"+(null!==(e=l.response)&&void 0!==e&&e.text?":"+(null===(s=l.response)||void 0===s?void 0:s.text):"")),!1):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}return/success/gim.test($("a.buttonenter.buttongiveaway").text())?!0:(N({}).warning(R("needJoinGiveaway")),!1)}catch(t){return K(t,"Indiedb.init"),!1}}async function Ln(){try{const e=$("script").map((t,e)=>{var s,i,n,a,o;return/\$\(document\)/gim.test(e.innerHTML)?[null===(s=e.innerHTML.match(/"\/[\d]+"/gim))||void 0===s||null===(i=s[0])||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0],null===(e=e.innerHTML.match(/"\/newsletter\/ajax\/subscribeprofile\/optin\/[\d]+"/gim))||void 0===e||null===(a=e[0])||void 0===a||null===(o=a.match(/[\d]+/))||void 0===o?void 0:o[0]]:null});if(2!==e.length)return N({}).error(R("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=N({text:`${R("doing")}:${n.parents("p").text()}...`});if(/facebookpromo|twitterpromo|visitpromo/gim.test(t.className)){let t="";t=n.hasClass("facebookpromo")?"facebookpromo":n.hasClass("twitterpromo")?"twitterpromo":"visitpromo",s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(`/giveaways/ajax/${t}/`+e[0]),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){t.success?(a.success("Success:"+t.text),n.addClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}else n.hasClass("emailoptinpromo")?s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath("/newsletter/ajax/subscribeprofile/optin/"+e[1]),timeout:6e4,dataType:"json",data:{ajax:"t",emailsystoggle:4},error(t,e,s){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):n.hasClass("watchingpromo")?s.push(new Promise(i=>{var t;const e=(t=>{try{const i={};return t?t.includes("?")&&t.split("?")[1].replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)):window.location.search.replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)),i}catch(t){return K(t,"getUrlQuery"),{}}})(n.attr("href"));e.ajax="t",$.ajax({type:"POST",url:urlPath(null===(t=n.attr("href"))||void 0===t?void 0:t.split(/[?#]/)[0]),timeout:6e4,dataType:"json",data:e,error(t,e,s){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):/the-challenge-of-adblock/gim.test(n.attr("href"))?a.error("Error:"+R("unKnownTaskType")):s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(n.attr("href")),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}}return await Promise.all(s),N({}).success(R("allTasksComplete")),!0}}catch(t){return K(t,"Indiedb.classifyTask"),!1}}function In(){try{return V.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return K(t,"Indiedb.checkLogin"),!1}}async function Gn(){try{return V.other.checkLeftKey?(0<$('a.buttonenter:contains("next time"),a.buttonenter:contains("Giveaway is closed")').length&&await p().fire({icon:"warning",title:R("notice"),text:R("giveawayEnded"),confirmButtonText:R("confirm"),cancelButtonText:R("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return K(t,"Indiedb.checkLeftKey"),!1}}var _n=class{constructor(){vn(this,xn),vn(this,$n),vn(this,Tn),vn(this,bn),kn(this,"name","Indiedb"),kn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{yn(this,$n,In).call(this)||N({}).warning(R("checkLoginFailed")),await yn(this,xn,Gn).call(this)||N({}).warning(R("checkLeftKeyFailed"))}catch(t){K(t,"Indiedb.after")}}async doTask(){try{return await yn(this,bn,Sn).call(this)?await yn(this,Tn,Ln).call(this):!1}catch(t){return K(t,"Indiedb.doTask"),!1}}};function An(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Cn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function On(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const En=JSON.stringify({steam:{groupLinks:[],officialGroupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]});var Dn=new WeakSet,jn=new WeakSet,Pn=new WeakSet;function Wn(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(N({}).error(R("getFailed","GiveawayId")),!1)}catch(t){return K(t,"Keyhub.getGiveawayId"),!1}}async function Nn(){try{return V.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:R("notice"),text:R("noKeysLeft"),confirmButtonText:R("confirm"),cancelButtonText:R("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return K(t,"Keyhub.checkLeftKey"),!1}}function Vn(){try{return V.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return K(t,"Keyhub.checkLogin"),!1}}var Fn=class extends Hi{constructor(){super(...arguments),An(this,Pn),An(this,jn),An(this,Dn),Cn(this,"name","Keyhub"),Cn(this,"socialTasks",JSON.parse(En)),Cn(this,"undoneTasks",JSON.parse(En)),Cn(this,"buttons",["doTask","undoTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{On(this,Pn,Vn).call(this)||N({}).warning(R("checkLoginFailed")),await On(this,jn,Nn).call(this)||N({}).warning(R("checkLeftKeyFailed")),$(".NSFW").hide()}catch(t){K(t,"Keyhub.after")}}init(){try{const t=N({text:R("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(R("needLogin")),!1):!!On(this,Dn,Wn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return K(t,"Keyhub.init"),!1}}async classifyTask(s){try{const i=N({text:R("getTasksInfo")});var t;"undo"===s&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||JSON.parse(En));for(const n of $('.task:not(".googleads")').filter((t,e)=>"do"!==s||0===$(e).find("i.fa-check-circle:visible").length).find("a")){let t=$(n).attr("href");var e=$(n).text().trim();t&&((/\/away\?data=/.test(t)||/steamcommunity\.com\/gid\//.test(t))&&(t=await u(t)||t),/https?:\/\/key-hub\.eu\/connect\/discord/.test(t)?window.open(t,"_blank"):/steamcommunity\.com\/groups\//.test(t)?("undo"===s&&this.socialTasks.steam.groupLinks.push(t),"do"===s&&this.undoneTasks.steam.groupLinks.push(t)):/steamcommunity\.com\/games\/[\d]+/.test(t)?("undo"===s&&this.socialTasks.steam.officialGroupLinks.push(t),"do"===s&&this.undoneTasks.steam.officialGroupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(e)?("undo"===s&&this.socialTasks.steam.wishlistLinks.push(t),"do"===s&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===s&&this.socialTasks.steam.curatorLinks.push(t),"do"===s&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===s&&this.socialTasks.discord.serverLinks.push(t),"do"===s&&this.undoneTasks.discord.serverLinks.push(t)):/^https?:\/\/twitter\.com\/.*/.test(t)||/^https?:\/\/www\.twitch\.tv\/.*/.test(t)||/^https?:\/\/www\.facebook\.com\/.*/.test(t)||/^https?:\/\/www\.youtube\.com\/.*/.test(t)||/^https?:\/\/store\.steampowered\.com\/developer\//.test(t)||/^https?:\/\/.*?\.itch\.io\/.*/.test(t)||N({}).warning(`${R("unKnownTaskType")}: ${e}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return K(t,"Keyhub.classifyTask"),!1}}};function Mn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Un(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Bn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Rn=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}});var Kn=new WeakSet,zn=new WeakSet,Yn=new WeakSet;async function qn(t){try{const s=N({html:`
  • ${R("verifyingTask")}${t}...
  • `});return await new Promise(e=>{$.ajax({url:"https://givekey.ru/giveaway/task",method:"POST",data:`id=${t}&user_id=`+this.userId,dataType:"json",headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:t=>{t.btn&&$(`button[data-id=${this.userId}]`).html(t.btn),"ok"===t.status?($(".task_check_"+t.id).html(``),s.success(),e(!0)):"end"===t.status?(s.success(),N({}).success(t.key),e(!0)):(s.error("Error:"+t.msg),e(!1))},error:t=>{s.error(`Error:${t.statusText}(${t.status})`),e(!1)}})})}catch(t){return K(t,"Givekey.verify"),!1}}function Jn(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(N({text:R("getFailed","GiveawayId")}),!1)}catch(t){return K(t,"Givekey.getGiveawayId"),!1}}async function Hn(){try{return V.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:R("notice"),text:R("noKeysLeft"),confirmButtonText:R("confirm"),cancelButtonText:R("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return K(t,"Givekey.checkLeftKey"),!1}}var Xn=class extends Hi{constructor(){super(...arguments),Mn(this,Yn),Mn(this,zn),Mn(this,Kn),Un(this,"name","Givekey"),Un(this,"tasks",[]),Un(this,"socialTasks",JSON.parse(Rn)),Un(this,"undoneTasks",JSON.parse(Rn)),Un(this,"userId",void 0),Un(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"givekey.ru"===window.location.host}async after(){try{await new Promise(t=>{const e=setInterval(()=>{0<$("#navbarDropdown").length&&(clearInterval(e),t(!0))})}),await Bn(this,Yn,Hn).call(this)||N({}).warning(R("checkLeftKeyFailed"))}catch(t){return K(t,"Givekey.after"),!1}}init(){try{const e=N({text:R("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(R("needLogin")),!1;if(!Bn(this,zn,Jn).call(this))return!1;var t=$('meta[name="user-id"]').attr("content");return t?(this.userId=t,this.initialized=!0,e.success(),!0):(e.error(R("getFailed",R("userId"))),!1)}catch(t){return K(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=N({text:R("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||JSON.parse(Rn));for(const o of $('.card-body:has("button") .row')){const r=$(o);var s=/Complete/i.test(r.find("button").text().trim());if(!s||"undo"===e){const l=r.find("#task_check");var i=l.attr("data-id");if(i&&this.tasks.push(i),"verify"!==e){let t=r.find("a").attr("href")||null;var n=r.find("a").text().trim();const c=r.find("i");t&&n&&(/^https?:\/\/givekey\.ru\/giveaway\/[\d]+\/execution_task/.test(t)&&(t=await u(t)),t&&(/^https?:\/\/vk\.com\//.test(t)?(this.socialTasks.vk.nameLinks.push(t),"do"!==e||s||this.undoneTasks.vk.nameLinks.push(t)):/^https?:\/\/steamcommunity\.com\/groups/.test(t)?(this.socialTasks.steam.groupLinks.push(t),"do"!==e||s||this.undoneTasks.steam.groupLinks.push(t)):/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?(this.socialTasks.steam.wishlistLinks.push(t),"do"!==e||s||this.undoneTasks.steam.wishlistLinks.push(t)):/Subscribe/gi.test(n)&&c.hasClass("fa-steam-square")?/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?(this.socialTasks.steam.curatorLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLinks.push(t)):(this.socialTasks.steam.curatorLikeLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLikeLinks.push(t)):/^https?:\/\/twitter\.com\//.test(t)&&/Subscribe/gi.test(n)?(this.socialTasks.twitter.userLinks.push(t),"do"!==e||s||this.undoneTasks.twitter.userLinks.push(t)):c.hasClass("fa-discord")||/^https?:\/\/discord\.com\/invite\//.test(t)?(this.socialTasks.discord.serverLinks.push(t),"do"!==e||s||this.undoneTasks.discord.serverLinks.push(t)):N({}).warning(`${R("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=I(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return K(t,"Givekey.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;N({}).warning(R("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${R("giveKeyNoticeAfter")}`}),!0}catch(t){return K(t,"Givekey.verifyTask"),!1}}};function Zn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Qn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ta(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var ea=new WeakSet,sa=new WeakSet,ia=new WeakSet;function na(){try{return V.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return K(t,"GiveeClub.checkLogin"),!1}}function aa(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(N({text:R("getFailed","GiveawayId")}),!1)}async function oa(){try{return V.other.checkLeftKey?(0<$(".event-ended").length&&0===$(".event-winner").length&&await p().fire({icon:"warning",title:R("notice"),text:R("giveawayEnded"),confirmButtonText:R("confirm"),cancelButtonText:R("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return K(t,"Giveawaysu.checkLeftKey"),!1}}var ra=class extends fn{constructor(){super(...arguments),Zn(this,ia),Zn(this,sa),Zn(this,ea),Qn(this,"name","GiveeClub"),Qn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{ta(this,ea,na).call(this)||N({}).warning(R("checkLoginFailed")),await ta(this,ia,oa).call(this)||N({}).warning(R("checkLeftKeyFailed"))}catch(t){K(t,"GiveeClub.after")}}init(){try{const t=N({text:R("initing")});return ta(this,ea,na).call(this)?!!ta(this,sa,aa).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(R("needLogin")),!1)}catch(t){return K(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=N({text:R("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||un,!0;const i=[];for(const a of $(".event-actions tr"))i.push(new Promise(e=>{const s=$(a).find(".event-action-label a"),i=$(a).find(".event-action-icon i").attr("class")||"",n=s.text().trim();if(i.includes("ban")||/AdBlock/i.test(n)||i.includes("envelope"))return e(!0);u(s.attr("href")).then(t=>t?(/^https?:\/\/steamcommunity\.com\/groups/.test(t)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(n)?this.undoneTasks.steam.announcementLinks.push(t):i.includes("plus")&&/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?this.undoneTasks.steam.wishlistLinks.push(t):i.includes("plus")&&s.attr("data-steam-wishlist-appid")?this.undoneTasks.steam.wishlistLinks.push("https://store.steampowered.com/app/"+s.attr("data-steam-wishlist-appid")):/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):i.includes("steam")&&/follow|subscribe/gim.test(n)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(n)?this.undoneTasks.steam.forumLinks.push(t):i.includes("discord")?this.undoneTasks.discord.serverLinks.push(t):i.includes("instagram")?this.undoneTasks.instagram.userLinks.push(t):i.includes("twitch")?this.undoneTasks.twitch.channelLinks.push(t):i.includes("reddit")?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(n)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(n)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(n)||(i.includes("youtube")||i.includes("thumbs-up"))&&/(watch|like).*video/gim.test(n)?this.undoneTasks.youtube.likeLinks.push(t):i.includes("vk")||/join.*vk.*group/gim.test(n)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(n)||/follow.*button/gim.test(n)&&this.undoneTasks.steam.followLinks.push(t),void e(!0)):e(!1)).catch(t=>(K(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return K(t,"GiveeClub.classifyTask"),!1}}async verifyTask(){try{const t=N({text:R("giveeClubVerifyNotice")});for(const e of $(".event-actions tr button").has("i.glyphicon-refresh").not('[data-type="user.adblock"]'))e.click(),"steam.game.wishlist"!==$(e).attr("data-type")&&await W(1e3);return t.warning(R("giveeClubVerifyFinished")),!0}catch(t){return K(t,"Givekey.verifyTask"),!1}}};function la(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ca(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ua(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const da={maxPoint:"99999999"};var ha=new WeakSet,pa=new WeakSet;async function fa(t){try{for(const u of $(`.giveaways-page-item:contains('${t}'):not(:contains('ENTERED'))`)){var e,s,i,n,a,o,r,l=parseInt((null===(e=$(u).find(".giveaways-page-item-header-points").text().match(/[\d]+/gim))||void 0===e?void 0:e[0])||"999999",10),c=$(u).find(".giveaways-page-item-footer-name").text().trim();if("points"===t&&l>this.myPoints)N({}).warning(R("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=N({text:`${R("joiningLottery")}${c}...`}),h=$(u).find("a.giveaways-page-item-img-btn-enter:contains('enter')");if(null===h||void 0===h||null===(s=h.attr("onclick"))||void 0===s||!s.includes("checkUser")||(a=null===(i=h.attr("onclick"))||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0])&&checkUser(a),h.attr("href")){const{result:p,statusText:f,status:w,data:g}=await L({url:h.attr("href"),method:"GET"});"Success"===p?null!==g&&void 0!==g&&g.responseText&&/You've entered this giveaway/gim.test(g.responseText)?(d.success(),r=null===(o=g.responseText.match(/Points:[\s]*?([\d]+)/))||void 0===o?void 0:o[1],"points"===t&&r&&(this.myPoints=parseInt(r,10))):d.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`):d.error(p+`:${f}(${w})`)}else d.error('Error: No "href".')}}else N({}).warning(R("getNeedPointsFailed")+": "+c)}N({text:"-----END-----"})}catch(t){K(t,"OpiumPulses.toggleTask")}}function wa(){try{return V.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return K(t,"OpiumPulses.checkLogin"),!1}}var t=class{constructor(){la(this,pa),la(this,ha),ca(this,"name","OpiumPulses"),ca(this,"options",{...da,...GM_getValue("OpiumPulsesOptions")}),ca(this,"maxPoints",99999999),ca(this,"myPoints",0),ca(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{ua(this,pa,wa).call(this)||N({}).warning(R("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){K(t,"OpiumPulses.after")}}async doFreeTask(){try{ua(this,ha,fa).call(this,"FREE")}catch(t){K(t,"OpiumPulses.doFreeTask")}}async doPointTask(){try{var t;this.myPoints=parseInt((null===(t=$(".page-header__nav-func-user-nav-items.points-items").text().match(/[\d]+/gim))||void 0===t?void 0:t[0])||"0",10),ua(this,ha,fa).call(this,"points")}catch(t){K(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}},ga=Eo(698),ma=Eo.n(ga);const va={async classify(t){try{return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(t)?await this.giveawaySu(t):/^https?:\/\/givee\.club\/[\w]+?\/event\/[\d]+/.test(t)?await this.giveeClub(t):/^https?:\/\/gleam\.io\/.+?\/.+/.test(t)?await this.gleam(t):/^https?:\/\/www\.indiedb\.com\/giveaways\/.+/.test(t)?await this.indieDb(t):/^https?:\/\/key-hub\.eu\/giveaway\/[\d]+/.test(t)?await this.keyhub(t):/^https?:\/\/opquests\.com\/quests\/[\d]+/.test(t)?await this.opquests(t):!!/^https?:\/\/itch\.io\/s\/[\d]+?\/.*/.test(t)&&await this.itch(t)}catch(t){return K(t,"leftKeyChecker.classify"),!1}},async giveawaySu(t){try{const{result:e,data:s}=await L({url:t,method:"GET"});return"Success"===e&&200===(null===s||void 0===s?void 0:s.status)?!s.responseText.includes('class="steam-login"')&&(s.responseText.includes('class="giveaway-ended"')?"Ended":"Active"):!1}catch(t){return K(t,"leftKeyChecker.giveawaySu"),!1}},async giveeClub(t){try{const{result:e,data:s}=await L({url:t,method:"GET"});return"Success"===e&&200===(null===s||void 0===s?void 0:s.status)?s.responseText.includes('class="event-winner"')?"Won":s.responseText.includes('class="event-ended"')?"Ended":"Active":!1}catch(t){return K(t,"leftKeyChecker.giveeClub"),!1}},async gleam(t){try{const{result:r,data:l}=await L({url:t,method:"GET"});if("Success"!==r||200!==(null===l||void 0===l?void 0:l.status))return!1;var e,s,i;if(/incentives":{"[\d]+?":\[".+?"\]/.test(l.responseText))return"Won";var n=null===(e=l.responseText.match(/