diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index d3c5fd1..487b15a 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -18,12 +18,9 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: true - tag_name: v4.1.20-beta - name: 4.1.20-beta - body: |- - - Givekey任务识别优化 - - 修复Discord退组失败的BUG - - 数据同步功能优化 + tag_name: v4.1.21-beta + name: 4.1.21-beta + body: '- Sub入库功能优化' files: |- dist/auto-task-v4-for-giveawaysu.user.js dist/auto-task-v4.compatibility.user.js diff --git a/README.md b/README.md index eab0d1a..9015d32 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ [![License](https://img.shields.io/github/license/HCLonely/auto-task-v4?label=License)](https://github.com/HCLonely/auto-task-v4/blob/main/LICENSE) [![Release](https://img.shields.io/github/v/release/HCLonely/auto-task-v4?include_prereleases)](https://github.com/HCLonely/auto-task-v4/releases) +[![Checks](https://badgen.net/github/checks/HCLonely/auto-task-v4)](https://github.com/HCLonely/auto-task-v4/actions) +[![Status](https://badgen.net/github/status/HCLonely/auto-task-v4)](https://github.com/HCLonely/auto-task-v4/actions) + +[![GitHub file size in bytes](https://img.shields.io/github/size/HCLonely/auto-task-v4/dist/auto-task-v4.user.js?label=auto-task-v4.user.js)](https://github.com/HCLonely/auto-task-v4/raw/main/dist/auto-task-v4.user.js) +[![GitHub file size in bytes](https://img.shields.io/github/size/HCLonely/auto-task-v4/dist/auto-task-v4.compatibility.user.js?label=auto-task-v4.compatibility.user.js)](https://github.com/HCLonely/auto-task-v4/raw/main/dist/auto-task-v4.compatibility.user.js) +[![GitHub file size in bytes](https://img.shields.io/github/size/HCLonely/auto-task-v4/dist/auto-task-v4-for-giveawaysu.user.js?label=auto-task-v4-for-giveawaysu.user.js)](https://github.com/HCLonely/auto-task-v4/raw/main/dist/auto-task-v4-for-giveawaysu.user.js) 自动完成 Key 站任务。 diff --git a/dist/auto-task-v4-for-giveawaysu.user.js b/dist/auto-task-v4-for-giveawaysu.user.js index 389a87d..ac3d17d 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.1.20-beta +// @version 4.1.21-beta // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -84,4 +84,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+s.stack)}async function i(s){var t=1{s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return V(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const I=i;function W(){let e=0{setTimeout(()=>{t(!0)},e)})}const O=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${F(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${F(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${F(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":t=$(`
  • ${F(e)}${s}...
  • `);break;case"addingFreeLicenseSubid":t=$(`
  • ${F("addingFreeLicense")}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${F(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${F(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${F(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${F(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${F("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${F(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${F(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${F(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${F(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${F(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${F(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${F(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${F(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${F(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${F("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${F(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${F("skipTask")}[${s}(${n})](${F("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${F("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${F("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${F(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return V(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return V(t,"getRedirectLink"),null}};const r={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return V(t,"assignObject"),r}},U=u(r,t);const c={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},d=["zh","en"].includes(U.other.language)?U.other.language:"en";const F=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=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{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return V(t,"Discord.toggleServers"),!1}}}async function E(){try{const n=O({text:F("verifyingAuth","Discord")});var{result:t,statusText:e,status:s,data:i}=await I({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:f(this,k).auth}});return"Success"===t?200===(null==i?void 0:i.status)?(n.success(),!0):(n.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1):(n.error(t+`:${e}(${s})`),!1)}catch(t){return V(t,"Discord.verifyAuth"),!1}}async function P(){try{const s=O({text:F("updatingAuth","Discord")});return await new Promise(e=>{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?(g(this,k,{auth:t}),s.success(),e(await w(this,T,E).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return V(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=O({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await I({url:"https://discord.com/api/v9/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});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&&(w(this,C,R).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return V(t,"Discord.joinServer"),!1}}async function j(t){try{if(this.whiteList.servers.includes(t))return O({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,_,N).call(this,t);if(!e)return!1;const o=O({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await I({url:"https://discord.com/api/v9/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return V(t,"Discord.leaveServer"),!1}}async function N(t){try{const u=O({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return u.success(),e;var{result:s,statusText:i,status:n,data:a}=await I({url:"https://discord.com/api/v9/invites/"+t,responseType:"json",method:"GET"});if("Success"!==s||200!==(null==a?void 0:a.status))return u.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?(u.success(),w(this,C,R).call(this,t,l),l):(u.error(s+`:${i}(${n})`),!1)}catch(t){return V(t,"Discord.getGuild"),!1}}function R(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){V(t,"Discord.setCache")}}const M=unsafeWindow.Discord=A;function Y(t,e){B(t,e),e.add(t)}function K(t,e,s){B(t,e),e.set(t,s)}function B(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function q(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,X(t,e,"set"),s),s}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function H(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,X(t,e,"get"))}function X(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Q=JSON.stringify({users:[]});var Z=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakSet,it=new WeakSet,nt=new WeakSet,at=new WeakSet;async function ot(){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 V(t,"Instagram.toggleUsers"),!1}}};function dt(t,e){pt(t,e),e.add(t)}function ht(t,e,s){pt(t,e),e.set(t,s)}function pt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(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,vt(t,e,"set"),s),s}function ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function mt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,vt(t,e,"get"))}function vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const kt=JSON.stringify({reddits:[]});var yt=new WeakMap,bt=new WeakMap,Tt=new WeakSet,St=new WeakSet;async function xt(){try{const s=O({text:F("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 ft(this,St,$t).call(this,!0))}})}catch(t){return V(t,"Reddit.useBeta"),!1}}async function $t(){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 V(t,"Reddit.toggle"),!1}}};function Lt(t,e){_t(t,e),e.add(t)}function Gt(t,e,s){_t(t,e),e.set(t,s)}function _t(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ct(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function At(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,Vt(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 Pt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Vt(t,e,"get"))}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Wt=JSON.stringify({channels:[]});var Ot=new WeakMap,Ut=new WeakMap,Ft=new WeakMap,Dt=new WeakSet,jt=new WeakSet,Nt=new WeakSet,Rt=new WeakSet,Mt=new WeakSet;async function Yt(){try{const r=O({text:F("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Pt(this,Ot).authToken,"Client-Id":Pt(this,Ot).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 V(t,"Twitch.verifyAuth"),!1}}async function Kt(){try{const s=O({text:F("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?(At(this,Ot,t),s.success(),e(await Et(this,Dt,Yt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return V(t,"Twitch.updateAuth"),!1}}async function Bt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return O({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Et(this,Rt,zt).call(this,e);if(!s)return!1;const u=O({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 I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Pt(this,Ot).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}catch(t){return V(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=O({type:"gettingTwitchChannelId",text:t});var e=Pt(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Pt(this,Ot).authToken,"Client-Id":Pt(this,Ot).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,u,c=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Et(this,Mt,qt).call(this,t,c),d.success(),c):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return V(t,"Twitch.getChannelId"),!1}}function qt(t,e){try{Pt(this,Ut)[t]=e,GM_setValue("twitchCache",Pt(this,Ut))}catch(t){V(t,"Twitch.setCache")}}const Jt=class extends t{constructor(){var t;super(...arguments),Lt(this,Mt),Lt(this,Rt),Lt(this,Nt),Lt(this,jt),Lt(this,Dt),Ct(this,"tasks",JSON.parse(Wt)),Ct(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||JSON.parse(Wt)),Gt(this,Ot,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Gt(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),Gt(this,Ft,{writable:!0,value:!1})}async init(){try{return Pt(this,Ft)?!0:Pt(this,Ot).authToken?await Et(this,Dt,Yt).call(this)?(O({}).success(F("initSuccess","Twitch")),At(this,Ft,!0),!0):(GM_setValue("twitchAuth",null),await Et(this,jt,Kt).call(this)?(O({}).success(F("initSuccess","Twitch")),At(this,Ft,!0),!0):(O({}).error(F("initFailed","Twitch")),!1)):!!await Et(this,jt,Kt).call(this)&&(At(this,Ft,!0),!0)}catch(t){return V(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Pt(this,Ft))return O({text:F("needInit")}),!1;const i=[];if(e&&!U.doTask.twitch.channels||!e&&!U.undoTask.twitch.channels)O({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 V(t,"Twitch.toggle"),!1}}};function Ht(t,e){Qt(t,e),e.add(t)}function Xt(t,e,s){Qt(t,e),e.set(t,s)}function Qt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function te(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,ie(t,e,"set"),s),s}function ee(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function se(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ie(t,e,"get"))}function ie(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ne=JSON.stringify({names:[]});var ae=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,pe=new WeakSet,ge=new WeakSet,we=new WeakSet;async function fe(){try{const e=O({text:F("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await I({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:"+F("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(te(this,ae,(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 V(t,"Vk.verifyAuth"),!1}}async function me(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 V(t,"Vk.toggle"),!1}}};function $e(t,e){Le(t,e),e.add(t)}function Ie(t,e,s){Le(t,e),e.set(t,s)}function Le(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function _e(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 Ae(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 Pe=JSON.stringify({channels:[],likes:[]}),Ve=async function(t,e){try{const h=O({text:F("gettingYtbToken")}),{result:p,statusText:g,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${g}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+F("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.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=f.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,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return V(t,"Youtube.getInfo"),{}}};var We=new WeakMap,Oe=new WeakMap,Ue=new WeakMap,Fe=new WeakSet,De=new WeakSet,je=new WeakSet,Ne=new WeakSet,Re=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),$e(this,Re),$e(this,Ne),$e(this,je),$e(this,De),$e(this,Fe),Ge(this,"tasks",JSON.parse(Pe)),Ge(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||JSON.parse(Pe)),Ie(this,We,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Ie(this,Oe,{writable:!0,value:!1}),Ie(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+U.other.youtubeVerifyChannel})}async init(){try{return Ae(this,Oe)?!0:Ae(this,We).PAPISID?await Ce(this,Fe,Ye).call(this)?(O({}).success(F("initSuccess","Youtube")),_e(this,Oe,!0),!0):(GM_setValue("youtubeAuth",null),await Ce(this,De,Ke).call(this)?(O({}).success(F("initSuccess","Youtube")),_e(this,Oe,!0),!0):(O({}).error(F("initFailed","Youtube")),!1)):!!await Ce(this,De,Ke).call(this)&&(_e(this,Oe,!0),!0)}catch(t){return V(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ae(this,Oe))return O({text:F("needInit")}),!1;const a=[];if(e&&!U.doTask.youtube.channels||!e&&!U.undoTask.youtube.channels)O({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 V(t,"Youtube.toggle"),!1}}}async function Ye(){try{return await Ce(this,Ne,ze).call(this,{link:Ae(this,Ue),doTask:!0,verify:!0})}catch(t){return V(t,"Youtube.verifyAuth"),!1}}async function Ke(){try{const s=O({text:F("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?(_e(this,We,t),s.success(),Ce(this,Fe,Ye).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return V(t,"Discord.updateAuth"),!1}}function Be(t,e){return Ve(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await Ce(this,je,Be).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return O({html:F("loginYtb")}),!1;if(!(a&&o&&r&&l))return O({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return O({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?O({text:F("verifyingAuth","Youtube")}):O({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:g}=await I({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 ${u}_`+sha1(`${u} ${Ae(this,We).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===g||void 0===g?void 0:g.status)?s&&(/"subscribed": true/.test(g.responseText)||g.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(g.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):t&&g.responseText.includes("You may not subscribe to yourself")?(c.success(),!0):(c.error(F("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),!1):(c.error(d+`:${h}(${p})`),!1)}catch(t){return V(t,"Youtube.toggleChannel"),!1}}async function qe(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await Ce(this,je,Be).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return O({html:""+F("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return O({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return O({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=O({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=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 c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:g,data:w}=await I({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 ${u}_`+sha1(`${u} ${Ae(this,We).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"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(F("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${p}(${g})`),!1)}catch(t){return V(t,"Youtube.toggleLikeVideo"),!1}}function Je(t,e){Xe(t,e),e.add(t)}function He(t,e,s){Xe(t,e),e.set(t,s)}function Xe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(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,ss(t,e,"set"),s),s}function es(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ss(t,e,"get"))}function ss(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const is=JSON.stringify({groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var ns=new WeakMap,as=new WeakMap,os=new WeakMap,rs=new WeakMap,ls=new WeakMap,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,ps=new WeakSet,gs=new WeakSet,ws=new WeakSet,fs=new WeakSet,ms=new WeakSet,vs=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet,Gs=new WeakSet,_s=new WeakSet,Cs=new WeakSet,As=new WeakSet,Es=new WeakSet,Ps=new WeakSet,Vs=new WeakSet;async function Ws(){try{const s=O({text:F("updatingAuth",F("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await I({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:"+F("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(es(this,as).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return V(t,"Steam.updateStoreAuth"),!1}}async function Os(){try{const o=O({text:F("updatingAuth",F("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return o.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+F("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(es(this,as).steam64Id=i),a&&(es(this,as).userName=a),n)?(es(this,as).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return V(t,"Steam.updateCommunityAuth"),!1}}async function Us(){try{const i=O({text:F("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await I({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&&0t&&"CN"!==t);if(!s||0===s.length)return O({text:"noAnotherArea"}),!1;[t]=s}const l=O({text:F("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await I({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:es(this,as).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await Ze(this,ds,Us).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return V(t,"Steam.changeArea"),!1}}async function Ds(t){try{const e=O({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:es(this,as).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=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return V(t,"Steam.joinGroup"),!1}}async function js(t){try{if(this.whiteList.groups.includes(t))return O({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,ws,Ns).call(this,t);if(!e)return!1;const s=O({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await I({url:`https://steamcommunity.com/id/${es(this,as).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:es(this,as).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 V(t,"Steam.leaveGroup"),!1}}async function Ns(t){try{const n=O({type:"gettingSteamGroupId",text:t});var e=es(this,ns).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await I({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?(Ze(this,Vs,oi).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return V(t,"Steam.getGroupID"),!1}}async function Rs(t){try{var e;const n=O({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:es(this,as).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=L([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===es(this,ls)&&l.responseText.includes('id="error_box"')?(n.warning(F("changeAreaNotice")),!!await Ze(this,hs,Fs).call(this)&&await Ze(this,fs,Rs).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=L([...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 V(t,"Steam.addToWishlist"),!1}}async function Ms(t){try{var e;if(this.whiteList.wishlists.includes(t))return O({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=O({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:es(this,as).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:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return a.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===es(this,ls)&&u.responseText.includes('id="error_box"')){a.warning(F("changeAreaNotice"));var n=await Ze(this,hs,Fs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ms,Ms).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return V(t,"Steam.removeFromWishlist"),!1}}async function Ys(t,e){try{if(!e&&this.whiteList.follows.includes(t))return O({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=O({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:es(this,as).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await I({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 Ze(this,ks,Ks).call(this,t);return"CN"===es(this,ls)&&"areaLocked"===n?(a.warning(F("changeAreaNotice")),!!await Ze(this,hs,Fs).call(this)&&await Ze(this,ms,Ms).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return V(t,"Steam.toggleFollowGame"),!1}}async function Ks(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===es(this,ls)&&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 V(t,"Steam.isFollowedGame"),!1}}async function Bs(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Vs,oi).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return V(t,"Steam.getWorkshopAppId"),!1}}async function Hs(t){try{const o=O({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await I({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:es(this,as).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 V(t,"Steam.voteupWorkshop"),!0}}async function Xs(t){var e=!(1t[1]).filter(t=>t)):(t.error(`Error:${null===n||void 0===n?void 0:n.statusText}(${null===n||void 0===n?void 0:n.status})`),!1):(t.error(e+`:${s}(${i})`),!1)}catch(t){return V(t,"Steam.getLicenses"),!1}}async function ii(t){try{const[i,n]=t.split("-");if("appid"===i){var e=await Ze(this,_s,ei).call(this,n);if(!e)return!1;const a=O({type:"addingFreeLicense",text:n});if(!await Ze(this,Es,ni).call(this,e,a))return!1;const{result:o,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+n,method:"GET"});return"Success"===o?200===(null===u||void 0===u?void 0:u.status)?u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes('class="already_in_library"')?(a.success(),!0):(a.error(`Error:${u.statusText}(${u.status})`),!1):(a.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1):(a.error(o+`:${r}(${l})`),!1)}if("subid"!==i)return!1;{const c={};for(const h of n.split(",")){var s=O({type:"addingFreeLicenseSubid",text:h});if(!await Ze(this,Es,ni).call(this,h,s))return!1;c[h]=s}const d=await Ze(this,Cs,si).call(this);if(!d)return!1;for(const p of n.split(","))d.includes(p)?c[p].success():c[p].error();return!0}}catch(t){return V(t,"Steam.addLicense"),!1}}async function ni(t,e){try{var{result:s,statusText:i,status:n,data:a}=await I({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:es(this,as).storeSessionID,subid:t}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)||(e.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return e.error(),V(t,"Steam.addFreeLicense"),!1}}async function ai(t){try{const o=O({type:"requestingPlayTestAccess",text:t});var e,{result:s,statusText:i,status:n,data:a}=await I({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+t},data:$.param({sessionid:es(this,as).storeSessionID}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)&&1===(null==a||null===(e=a.response)||void 0===e?void 0:e.success)?(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 V(t,"Steam.requestPlayTestAccess"),!1}}function oi(t,e,s){try{es(this,ns)[t][e]=s,GM_setValue("steamCache",es(this,ns))}catch(t){V(t,"Steam.setCache")}}const ri=class extends t{constructor(){var t;super(...arguments),Je(this,Vs),Je(this,Ps),Je(this,Es),Je(this,As),Je(this,Cs),Je(this,_s),Je(this,Gs),Je(this,Ls),Je(this,Is),Je(this,$s),Je(this,xs),Je(this,Ss),Je(this,Ts),Je(this,bs),Je(this,ys),Je(this,ks),Je(this,vs),Je(this,ms),Je(this,fs),Je(this,ws),Je(this,gs),Je(this,ps),Je(this,hs),Je(this,ds),Je(this,cs),Je(this,us),Qe(this,"tasks",JSON.parse(is)),Qe(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.steam)||JSON.parse(is)),He(this,ns,{writable:!0,value:GM_getValue("steamCache")||{group:{},forum:{},workshop:{},curator:{}}}),He(this,as,{writable:!0,value:{}}),He(this,os,{writable:!0,value:!1}),He(this,rs,{writable:!0,value:!1}),He(this,ls,{writable:!0,value:"CN"})}async init(){var t=0{return null===(t=t.match(/groups\/(.+)\/?/))||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]}),k=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&&U.doTask.steam.playtests&&0("CN"!==es(this,ls)&&(O({}).warning(F("steamFinishNotice")),await Ze(this,hs,Fs).call(this,"CN")),!0))}catch(t){return V(t,"Steam.toggle"),!1}}};function li(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 ui(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ci(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const di={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var hi=new WeakSet,pi=new WeakSet,gi=new WeakSet,wi=new WeakSet,fi=new WeakSet,mi=new WeakSet,vi=new WeakSet,ki=new WeakSet;async function yi(){try{const e=O({text:F("getTasksInfo")}),s=[];var t=$("#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 t)s.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=>(V(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=ci(this,vi,Ii).call(this,this.undoneTasks),!0}catch(t){return V(t,"Giveawaysu.classifyTask"),!1}}function bi(){try{return U.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return V(t,"Giveawaysu.checkLogin"),!1}}async function Ti(){try{return U.other.checkLeftKey?(0<$(".giveaway-ended").length&&await a().fire({icon:"warning",title:F("notice"),text:F("noKeysLeft"),confirmButtonText:F("confirm"),cancelButtonText:F("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return V(t,"Giveawaysu.checkLeftKey"),!1}}function Si(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(O({text:F("getFailed","GiveawayId")}),!1)}async function xi(e,t){try{return{name:e,result:await t}}catch(t){return V(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function $i(){try{const s=[],i=this.undoneTasks;var t,e;return i.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,s.push(ci(this,fi,xi).call(this,"discord",this.social.discord.init()))),i.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ct,s.push(ci(this,fi,xi).call(this,"instagram",this.social.instagram.init()))),i.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new It,s.push(ci(this,fi,xi).call(this,"reddit",this.social.reddit.init()))),i.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Jt,s.push(ci(this,fi,xi).call(this,"twitch",this.social.twitch.init()))),i.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new xe,s.push(ci(this,fi,xi).call(this,"vk",this.social.vk.init()))),i.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,s.push(ci(this,fi,xi).call(this,"youtube",this.social.youtube.init()))),!i.steam||0<(t=Object.values(i.steam).reduce((t,e)=>[...t,...e]).length)&&(this.social.steam||(this.social.steam=new ri),0{var e,s;return["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(t)&&(null===(e=i.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&&s.push(ci(this,fi,xi).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 V(t,"GiveawaySu.initSocial"),!1}}function Ii(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=L(a)}return e}async function Li(){try{if(!this.initialized&&!this.init())return!1;if(!await ci(this,hi,yi).call(this))return!1;if(!await ci(this,mi,$i).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),O({}).success(F("allTasksComplete")),!0}catch(t){return V(t,"GiveawaySu.toggleTask"),!1}}const Gi=class{constructor(){li(this,ki),li(this,vi),li(this,mi),li(this,fi),li(this,wi),li(this,gi),li(this,pi),li(this,hi),ui(this,"undoneTasks",di),ui(this,"giveawayId",void 0),ui(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1}),ui(this,"initialized",!1),ui(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{ci(this,pi,bi).call(this)||O({}).warning(F("checkLoginFailed")),await ci(this,gi,Ti).call(this)||O({}).warning(F("checkLeftKeyFailed"))}catch(t){V(t,"Giveawaysu.after")}}init(){try{const t=O({text:F("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(F("needLogin")),!1):!!ci(this,wi,Si).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return V(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await ci(this,ki,Li).call(this)}catch(t){return V(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await W(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){V(t,"GiveawaySu.verifyTask")}}};var _i,t=Ci(181);window.STYLE=GM_addStyle(t.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname&&(_i=null===(t=window.localStorage)||void 0===t||null===(_i=t.getItem("token"))||void 0===_i?void 0:_i.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:_i}),_i&&"#auth"===window.location.hash&&(window.close(),a().fire("",F("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=o.get("auth-token"),!!o.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),a().fire("",F("closePageNotice"))):a().fire("",F("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=o.get("ct0"),!!o.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),a().fire("",F("closePageNotice"))):a().fire("",F("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=o.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),a().fire("",F("closePageNotice"))):a().fire("",F("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${F(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${F(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${F(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${F("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${F(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${F("skipTask")}[${s}(${n})](${F("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${F("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${F("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${F(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return V(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return V(t,"getRedirectLink"),null}};const r={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return V(t,"assignObject"),r}},U=u(r,t);const c={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},d=["zh","en"].includes(U.other.language)?U.other.language:"en";const F=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=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{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return V(t,"Discord.toggleServers"),!1}}}async function E(){try{const n=O({text:F("verifyingAuth","Discord")});var{result:t,statusText:e,status:s,data:i}=await I({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:f(this,k).auth}});return"Success"===t?200===(null==i?void 0:i.status)?(n.success(),!0):(n.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1):(n.error(t+`:${e}(${s})`),!1)}catch(t){return V(t,"Discord.verifyAuth"),!1}}async function P(){try{const s=O({text:F("updatingAuth","Discord")});return await new Promise(e=>{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?(g(this,k,{auth:t}),s.success(),e(await w(this,T,E).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return V(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=O({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await I({url:"https://discord.com/api/v9/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});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&&(w(this,C,R).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return V(t,"Discord.joinServer"),!1}}async function N(t){try{if(this.whiteList.servers.includes(t))return O({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,G,j).call(this,t);if(!e)return!1;const o=O({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await I({url:"https://discord.com/api/v9/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return V(t,"Discord.leaveServer"),!1}}async function j(t){try{const u=O({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return u.success(),e;var{result:s,statusText:i,status:n,data:a}=await I({url:"https://discord.com/api/v9/invites/"+t,responseType:"json",method:"GET"});if("Success"!==s||200!==(null==a?void 0:a.status))return u.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?(u.success(),w(this,C,R).call(this,t,l),l):(u.error(s+`:${i}(${n})`),!1)}catch(t){return V(t,"Discord.getGuild"),!1}}function R(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){V(t,"Discord.setCache")}}const M=unsafeWindow.Discord=A;function Y(t,e){B(t,e),e.add(t)}function K(t,e,s){B(t,e),e.set(t,s)}function B(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function q(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,X(t,e,"set"),s),s}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function H(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,X(t,e,"get"))}function X(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Q=JSON.stringify({users:[]});var Z=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakSet,it=new WeakSet,nt=new WeakSet,at=new WeakSet;async function ot(){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 V(t,"Instagram.toggleUsers"),!1}}};function dt(t,e){pt(t,e),e.add(t)}function ht(t,e,s){pt(t,e),e.set(t,s)}function pt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(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,vt(t,e,"set"),s),s}function ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function mt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,vt(t,e,"get"))}function vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const kt=JSON.stringify({reddits:[]});var yt=new WeakMap,bt=new WeakMap,Tt=new WeakSet,St=new WeakSet;async function xt(){try{const s=O({text:F("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 ft(this,St,$t).call(this,!0))}})}catch(t){return V(t,"Reddit.useBeta"),!1}}async function $t(){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 V(t,"Reddit.toggle"),!1}}};function Lt(t,e){Gt(t,e),e.add(t)}function _t(t,e,s){Gt(t,e),e.set(t,s)}function Gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ct(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function At(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,Vt(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 Pt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Vt(t,e,"get"))}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Wt=JSON.stringify({channels:[]});var Ot=new WeakMap,Ut=new WeakMap,Ft=new WeakMap,Dt=new WeakSet,Nt=new WeakSet,jt=new WeakSet,Rt=new WeakSet,Mt=new WeakSet;async function Yt(){try{const r=O({text:F("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Pt(this,Ot).authToken,"Client-Id":Pt(this,Ot).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 V(t,"Twitch.verifyAuth"),!1}}async function Kt(){try{const s=O({text:F("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?(At(this,Ot,t),s.success(),e(await Et(this,Dt,Yt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return V(t,"Twitch.updateAuth"),!1}}async function Bt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return O({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Et(this,Rt,zt).call(this,e);if(!s)return!1;const u=O({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 I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Pt(this,Ot).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}catch(t){return V(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=O({type:"gettingTwitchChannelId",text:t});var e=Pt(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Pt(this,Ot).authToken,"Client-Id":Pt(this,Ot).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,u,c=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Et(this,Mt,qt).call(this,t,c),d.success(),c):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return V(t,"Twitch.getChannelId"),!1}}function qt(t,e){try{Pt(this,Ut)[t]=e,GM_setValue("twitchCache",Pt(this,Ut))}catch(t){V(t,"Twitch.setCache")}}const Jt=class extends t{constructor(){var t;super(...arguments),Lt(this,Mt),Lt(this,Rt),Lt(this,jt),Lt(this,Nt),Lt(this,Dt),Ct(this,"tasks",JSON.parse(Wt)),Ct(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||JSON.parse(Wt)),_t(this,Ot,{writable:!0,value:GM_getValue("twitchAuth")||{}}),_t(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),_t(this,Ft,{writable:!0,value:!1})}async init(){try{return Pt(this,Ft)?!0:Pt(this,Ot).authToken?await Et(this,Dt,Yt).call(this)?(O({}).success(F("initSuccess","Twitch")),At(this,Ft,!0),!0):(GM_setValue("twitchAuth",null),await Et(this,Nt,Kt).call(this)?(O({}).success(F("initSuccess","Twitch")),At(this,Ft,!0),!0):(O({}).error(F("initFailed","Twitch")),!1)):!!await Et(this,Nt,Kt).call(this)&&(At(this,Ft,!0),!0)}catch(t){return V(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Pt(this,Ft))return O({text:F("needInit")}),!1;const i=[];if(e&&!U.doTask.twitch.channels||!e&&!U.undoTask.twitch.channels)O({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 V(t,"Twitch.toggle"),!1}}};function Ht(t,e){Qt(t,e),e.add(t)}function Xt(t,e,s){Qt(t,e),e.set(t,s)}function Qt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function te(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,ie(t,e,"set"),s),s}function ee(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function se(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ie(t,e,"get"))}function ie(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ne=JSON.stringify({names:[]});var ae=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,pe=new WeakSet,ge=new WeakSet,we=new WeakSet;async function fe(){try{const e=O({text:F("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await I({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:"+F("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(te(this,ae,(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 V(t,"Vk.verifyAuth"),!1}}async function me(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 V(t,"Vk.toggle"),!1}}};function $e(t,e){Le(t,e),e.add(t)}function Ie(t,e,s){Le(t,e),e.set(t,s)}function Le(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 Ge(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 Ae(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 Pe=JSON.stringify({channels:[],likes:[]}),Ve=async function(t,e){try{const h=O({text:F("gettingYtbToken")}),{result:p,statusText:g,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${g}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+F("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.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=f.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,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return V(t,"Youtube.getInfo"),{}}};var We=new WeakMap,Oe=new WeakMap,Ue=new WeakMap,Fe=new WeakSet,De=new WeakSet,Ne=new WeakSet,je=new WeakSet,Re=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),$e(this,Re),$e(this,je),$e(this,Ne),$e(this,De),$e(this,Fe),_e(this,"tasks",JSON.parse(Pe)),_e(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||JSON.parse(Pe)),Ie(this,We,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Ie(this,Oe,{writable:!0,value:!1}),Ie(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+U.other.youtubeVerifyChannel})}async init(){try{return Ae(this,Oe)?!0:Ae(this,We).PAPISID?await Ce(this,Fe,Ye).call(this)?(O({}).success(F("initSuccess","Youtube")),Ge(this,Oe,!0),!0):(GM_setValue("youtubeAuth",null),await Ce(this,De,Ke).call(this)?(O({}).success(F("initSuccess","Youtube")),Ge(this,Oe,!0),!0):(O({}).error(F("initFailed","Youtube")),!1)):!!await Ce(this,De,Ke).call(this)&&(Ge(this,Oe,!0),!0)}catch(t){return V(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ae(this,Oe))return O({text:F("needInit")}),!1;const a=[];if(e&&!U.doTask.youtube.channels||!e&&!U.undoTask.youtube.channels)O({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 V(t,"Youtube.toggle"),!1}}}async function Ye(){try{return await Ce(this,je,ze).call(this,{link:Ae(this,Ue),doTask:!0,verify:!0})}catch(t){return V(t,"Youtube.verifyAuth"),!1}}async function Ke(){try{const s=O({text:F("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?(Ge(this,We,t),s.success(),Ce(this,Fe,Ye).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return V(t,"Discord.updateAuth"),!1}}function Be(t,e){return Ve(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await Ce(this,Ne,Be).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return O({html:F("loginYtb")}),!1;if(!(a&&o&&r&&l))return O({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return O({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?O({text:F("verifyingAuth","Youtube")}):O({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:g}=await I({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 ${u}_`+sha1(`${u} ${Ae(this,We).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===g||void 0===g?void 0:g.status)?s&&(/"subscribed": true/.test(g.responseText)||g.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(g.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):t&&g.responseText.includes("You may not subscribe to yourself")?(c.success(),!0):(c.error(F("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),!1):(c.error(d+`:${h}(${p})`),!1)}catch(t){return V(t,"Youtube.toggleChannel"),!1}}async function qe(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await Ce(this,Ne,Be).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return O({html:""+F("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return O({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return O({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=O({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=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 c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:g,data:w}=await I({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 ${u}_`+sha1(`${u} ${Ae(this,We).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"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(F("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${p}(${g})`),!1)}catch(t){return V(t,"Youtube.toggleLikeVideo"),!1}}function Je(t,e){Xe(t,e),e.add(t)}function He(t,e,s){Xe(t,e),e.set(t,s)}function Xe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(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,ss(t,e,"set"),s),s}function es(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ss(t,e,"get"))}function ss(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const is=JSON.stringify({groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var ns=new WeakMap,as=new WeakMap,os=new WeakMap,rs=new WeakMap,ls=new WeakMap,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,ps=new WeakSet,gs=new WeakSet,ws=new WeakSet,fs=new WeakSet,ms=new WeakSet,vs=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet,_s=new WeakSet,Gs=new WeakSet,Cs=new WeakSet,As=new WeakSet,Es=new WeakSet,Ps=new WeakSet,Vs=new WeakSet;async function Ws(){try{const s=O({text:F("updatingAuth",F("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await I({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:"+F("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(es(this,as).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return V(t,"Steam.updateStoreAuth"),!1}}async function Os(){try{const o=O({text:F("updatingAuth",F("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return o.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+F("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(es(this,as).steam64Id=i),a&&(es(this,as).userName=a),n)?(es(this,as).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return V(t,"Steam.updateCommunityAuth"),!1}}async function Us(){try{const i=O({text:F("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await I({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&&0t&&"CN"!==t);if(!s||0===s.length)return O({text:"noAnotherArea"}),!1;[t]=s}const l=O({text:F("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await I({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:es(this,as).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await Ze(this,ds,Us).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return V(t,"Steam.changeArea"),!1}}async function Ds(t){try{const e=O({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:es(this,as).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=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return V(t,"Steam.joinGroup"),!1}}async function Ns(t){try{if(this.whiteList.groups.includes(t))return O({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,ws,js).call(this,t);if(!e)return!1;const s=O({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await I({url:`https://steamcommunity.com/id/${es(this,as).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:es(this,as).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 V(t,"Steam.leaveGroup"),!1}}async function js(t){try{const n=O({type:"gettingSteamGroupId",text:t});var e=es(this,ns).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await I({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?(Ze(this,Vs,oi).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return V(t,"Steam.getGroupID"),!1}}async function Rs(t){try{var e;const n=O({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:es(this,as).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=L([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===es(this,ls)&&l.responseText.includes('id="error_box"')?(n.warning(F("changeAreaNotice")),!!await Ze(this,hs,Fs).call(this)&&await Ze(this,fs,Rs).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=L([...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 V(t,"Steam.addToWishlist"),!1}}async function Ms(t){try{var e;if(this.whiteList.wishlists.includes(t))return O({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=O({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:es(this,as).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:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return a.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===es(this,ls)&&u.responseText.includes('id="error_box"')){a.warning(F("changeAreaNotice"));var n=await Ze(this,hs,Fs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ms,Ms).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return V(t,"Steam.removeFromWishlist"),!1}}async function Ys(t,e){try{if(!e&&this.whiteList.follows.includes(t))return O({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=O({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:es(this,as).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await I({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 Ze(this,ks,Ks).call(this,t);return"CN"===es(this,ls)&&"areaLocked"===n?(a.warning(F("changeAreaNotice")),!!await Ze(this,hs,Fs).call(this)&&await Ze(this,ms,Ms).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return V(t,"Steam.toggleFollowGame"),!1}}async function Ks(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===es(this,ls)&&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 V(t,"Steam.isFollowedGame"),!1}}async function Bs(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Vs,oi).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return V(t,"Steam.getWorkshopAppId"),!1}}async function Hs(t){try{const o=O({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await I({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:es(this,as).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 V(t,"Steam.voteupWorkshop"),!0}}async function Xs(t){var e=!(1t[1]).filter(t=>t)):(t.error(`Error:${null===n||void 0===n?void 0:n.statusText}(${null===n||void 0===n?void 0:n.status})`),!1):(t.error(e+`:${s}(${i})`),!1)}catch(t){return V(t,"Steam.getLicenses"),!1}}async function ii(t){try{const[i,n]=t.split("-");if("appid"===i){var e=await Ze(this,Gs,ei).call(this,n);if(!e)return!1;const a=O({type:"addingFreeLicense",text:n});if(!await Ze(this,Es,ni).call(this,e,a))return!1;const{result:o,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+n,method:"GET"});return"Success"===o?200===(null===u||void 0===u?void 0:u.status)?u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes('class="already_in_library"')?(a.success(),!0):(a.error(`Error:${u.statusText}(${u.status})`),!1):(a.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1):(a.error(o+`:${r}(${l})`),!1)}if("subid"!==i)return!1;{const c={};for(const h of n.split(",")){var s=O({type:"addingFreeLicenseSubid",text:h});if(!await Ze(this,Es,ni).call(this,h,s))return!1;c[h]=s}const d=await Ze(this,Cs,si).call(this);if(!d)return!1;for(const p of n.split(","))d.includes(p)?c[p].success():c[p].error();return!0}}catch(t){return V(t,"Steam.addLicense"),!1}}async function ni(t,e){try{const i=e||O({type:"addingFreeLicenseSubid",text:t}),{result:n,statusText:a,status:o,data:r}=await I({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:es(this,as).storeSessionID,subid:t}),dataType:"json"});if("Success"!==n)return i.error(n+`:${a}(${o})`),!1;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})`),!1;if("CN"===es(this,ls)&&r.responseText.includes('id="error_box"')){i.warning(F("changeAreaNotice"));var s=await Ze(this,hs,Fs).call(this);return s&&"CN"!==s?await Ze(this,Es,ni).call(this,t):!1}return i.success(),!0}catch(t){return V(t,"Steam.addFreeLicense"),!1}}async function ai(t){try{const o=O({type:"requestingPlayTestAccess",text:t});var e,{result:s,statusText:i,status:n,data:a}=await I({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+t},data:$.param({sessionid:es(this,as).storeSessionID}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)&&1===(null==a||null===(e=a.response)||void 0===e?void 0:e.success)?(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 V(t,"Steam.requestPlayTestAccess"),!1}}function oi(t,e,s){try{es(this,ns)[t][e]=s,GM_setValue("steamCache",es(this,ns))}catch(t){V(t,"Steam.setCache")}}const ri=class extends t{constructor(){var t;super(...arguments),Je(this,Vs),Je(this,Ps),Je(this,Es),Je(this,As),Je(this,Cs),Je(this,Gs),Je(this,_s),Je(this,Ls),Je(this,Is),Je(this,$s),Je(this,xs),Je(this,Ss),Je(this,Ts),Je(this,bs),Je(this,ys),Je(this,ks),Je(this,vs),Je(this,ms),Je(this,fs),Je(this,ws),Je(this,gs),Je(this,ps),Je(this,hs),Je(this,ds),Je(this,cs),Je(this,us),Qe(this,"tasks",JSON.parse(is)),Qe(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.steam)||JSON.parse(is)),He(this,ns,{writable:!0,value:GM_getValue("steamCache")||{group:{},forum:{},workshop:{},curator:{}}}),He(this,as,{writable:!0,value:{}}),He(this,os,{writable:!0,value:!1}),He(this,rs,{writable:!0,value:!1}),He(this,ls,{writable:!0,value:"CN"})}async init(){var t=0{return null===(t=t.match(/groups\/(.+)\/?/))||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]}),k=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&&U.doTask.steam.playtests&&0("CN"!==es(this,ls)&&(O({}).warning(F("steamFinishNotice")),await Ze(this,hs,Fs).call(this,"CN")),!0))}catch(t){return V(t,"Steam.toggle"),!1}}};function li(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 ui(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ci(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const di={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var hi=new WeakSet,pi=new WeakSet,gi=new WeakSet,wi=new WeakSet,fi=new WeakSet,mi=new WeakSet,vi=new WeakSet,ki=new WeakSet;async function yi(){try{const e=O({text:F("getTasksInfo")}),s=[];var t=$("#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 t)s.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=>(V(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=ci(this,vi,Ii).call(this,this.undoneTasks),!0}catch(t){return V(t,"Giveawaysu.classifyTask"),!1}}function bi(){try{return U.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return V(t,"Giveawaysu.checkLogin"),!1}}async function Ti(){try{return U.other.checkLeftKey?(0<$(".giveaway-ended").length&&await a().fire({icon:"warning",title:F("notice"),text:F("noKeysLeft"),confirmButtonText:F("confirm"),cancelButtonText:F("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return V(t,"Giveawaysu.checkLeftKey"),!1}}function Si(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(O({text:F("getFailed","GiveawayId")}),!1)}async function xi(e,t){try{return{name:e,result:await t}}catch(t){return V(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function $i(){try{const s=[],i=this.undoneTasks;var t,e;return i.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,s.push(ci(this,fi,xi).call(this,"discord",this.social.discord.init()))),i.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ct,s.push(ci(this,fi,xi).call(this,"instagram",this.social.instagram.init()))),i.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new It,s.push(ci(this,fi,xi).call(this,"reddit",this.social.reddit.init()))),i.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Jt,s.push(ci(this,fi,xi).call(this,"twitch",this.social.twitch.init()))),i.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new xe,s.push(ci(this,fi,xi).call(this,"vk",this.social.vk.init()))),i.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,s.push(ci(this,fi,xi).call(this,"youtube",this.social.youtube.init()))),!i.steam||0<(t=Object.values(i.steam).reduce((t,e)=>[...t,...e]).length)&&(this.social.steam||(this.social.steam=new ri),0{var e,s;return["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(t)&&(null===(e=i.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&&s.push(ci(this,fi,xi).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 V(t,"GiveawaySu.initSocial"),!1}}function Ii(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=L(a)}return e}async function Li(){try{if(!this.initialized&&!this.init())return!1;if(!await ci(this,hi,yi).call(this))return!1;if(!await ci(this,mi,$i).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),O({}).success(F("allTasksComplete")),!0}catch(t){return V(t,"GiveawaySu.toggleTask"),!1}}const _i=class{constructor(){li(this,ki),li(this,vi),li(this,mi),li(this,fi),li(this,wi),li(this,gi),li(this,pi),li(this,hi),ui(this,"undoneTasks",di),ui(this,"giveawayId",void 0),ui(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1}),ui(this,"initialized",!1),ui(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{ci(this,pi,bi).call(this)||O({}).warning(F("checkLoginFailed")),await ci(this,gi,Ti).call(this)||O({}).warning(F("checkLeftKeyFailed"))}catch(t){V(t,"Giveawaysu.after")}}init(){try{const t=O({text:F("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(F("needLogin")),!1):!!ci(this,wi,Si).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return V(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await ci(this,ki,Li).call(this)}catch(t){return V(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await W(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){V(t,"GiveawaySu.verifyTask")}}};var Gi,t=Ci(181);window.STYLE=GM_addStyle(t.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname&&(Gi=null===(t=window.localStorage)||void 0===t||null===(Gi=t.getItem("token"))||void 0===Gi?void 0:Gi.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:Gi}),Gi&&"#auth"===window.location.hash&&(window.close(),a().fire("",F("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=o.get("auth-token"),!!o.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),a().fire("",F("closePageNotice"))):a().fire("",F("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=o.get("ct0"),!!o.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),a().fire("",F("closePageNotice"))):a().fire("",F("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=o.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),a().fire("",F("closePageNotice"))):a().fire("",F("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.compatibility.user.js b/dist/auto-task-v4.compatibility.user.js index d1a08c0..5516fc5 100644 --- a/dist/auto-task-v4.compatibility.user.js +++ b/dist/auto-task-v4.compatibility.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.1.20-beta +// @version 4.1.21-beta // @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 @@ -96,11 +96,11 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); -!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return F(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function P(){let e=0{setTimeout(()=>{t(!0)},e)})}const j=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":t=$(`
  • ${M(e)}${s}...
  • `);break;case"addingFreeLicenseSubid":t=$(`
  • ${M("addingFreeLicense")}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${M(e)} - ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${M(e)} - ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${M(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${M(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${M("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${M(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${M(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${M(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${M(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${M(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${M(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${M(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${M(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${M("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${M(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${M("skipTask")}[${s}(${n})](${M("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${M("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${M("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${M(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return F(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return F(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=j({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return F(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return F(t,"stringToColour"),"#fff"}},o={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};var s=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return F(t,"assignObject"),o}},W=r(o,s),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?W[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(W[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",W),p().fire({title:M("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){F(t,"saveData")}},h=e=>{try{let t=`
    - `;for(const[o,r]of Object.entries(W))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${M("type")}${M("option")}${M("value")}
    ${M(o)}${M(s)}
    ${M(o)}${M(s)}
    ${M(o)}${s}.${M(n)}
    ","swal"===e?p().fire({title:M("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:M("save"),showCancelButton:!0,cancelButtonText:M("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${M("globalOptions")}

    `+t)}catch(t){F(t,"changeGlobalOptions")}};const d={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},w=["zh","en"].includes(W.other.language)?W.other.language:"en";const M=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function F(s,i){p().fire({title:M("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:M("toGithub"),showDenyButton:!0,denyButtonText:M("toKeylol"),cancelButtonText:M("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+i)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,n.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(s.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")),"_blank"):e&&(e=`错误链接: [url=${window.location.href}]${window.location.href}[/url] +!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return R(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function P(){let e=0{setTimeout(()=>{t(!0)},e)})}const j=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":t=$(`
  • ${z(e)}${s}...
  • `);break;case"addingFreeLicenseSubid":t=$(`
  • ${z("addingFreeLicense")}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${z(e)} + ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${z(e)} + ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${z(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${z(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${z("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${z(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${z(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${z(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${z(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${z(e)} + ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${z(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${z(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${z(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${z("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${z(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${z("skipTask")}[${s}(${n})](${z("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${z("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${z("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${z(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return R(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return R(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=j({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return R(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return R(t,"stringToColour"),"#fff"}},o={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};var s=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return R(t,"assignObject"),o}},W=r(o,s),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?W[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(W[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",W),p().fire({title:z("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){R(t,"saveData")}},h=e=>{try{let t=`
    + `;for(const[o,r]of Object.entries(W))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${z("type")}${z("option")}${z("value")}
    ${z(o)}${z(s)}
    ${z(o)}${z(s)}
    ${z(o)}${s}.${z(n)}
    ","swal"===e?p().fire({title:z("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:z("save"),showCancelButton:!0,cancelButtonText:z("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${z("globalOptions")}

    `+t)}catch(t){R(t,"changeGlobalOptions")}};const d={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},w=["zh","en"].includes(W.other.language)?W.other.language:"en";const z=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function R(s,i){p().fire({title:z("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:z("toGithub"),showDenyButton:!0,denyButtonText:z("toKeylol"),cancelButtonText:z("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+i)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,n.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(s.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")),"_blank"):e&&(e=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -113,20 +113,20 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); [code]${s.stack}[/code] 执行日志: -[code]${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")}[/code]`,GM_setClipboard(e),p().fire({title:M("copySuccess"),icon:"success",confirmButtonText:M("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",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{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return F(t,"Discord.toggleServers"),!1}}}async function z(){try{const n=j({text:M("verifyingAuth","Discord")});var{result:t,statusText:e,status:s,data:i}=await L({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:x(this,C).auth}});return"Success"===t?200===(null==i?void 0:i.status)?(n.success(),!0):(n.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1):(n.error(t+`:${e}(${s})`),!1)}catch(t){return F(t,"Discord.verifyAuth"),!1}}async function R(){try{const s=j({text:M("updatingAuth","Discord")});return await new Promise(e=>{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?(b(this,C,{auth:t}),s.success(),e(await T(this,O,z).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return F(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=j({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:x(this,C).auth}});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&&(T(this,U,J).call(this,t,r),this.tasks.servers=_([...this.tasks.servers,t])),!0}catch(t){return F(t,"Discord.joinServer"),!1}}async function Y(t){try{if(this.whiteList.servers.includes(t))return j({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await T(this,N,q).call(this,t);if(!e)return!1;const o=j({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:x(this,C).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return F(t,"Discord.leaveServer"),!1}}async function q(t){try{const c=j({type:"gettingDiscordGuild",text:t});var e=x(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(),T(this,U,J).call(this,t,l),l):(c.error(s+`:${i}(${n})`),!1)}catch(t){return F(t,"Discord.getGuild"),!1}}function J(t,e){try{x(this,A)[t]=e,GM_setValue("discordCache",x(this,A))}catch(t){F(t,"Discord.setCache")}}const H=unsafeWindow.Discord=K;function X(t,e){Q(t,e),e.add(t)}function Z(t,e,s){Q(t,e),e.set(t,s)}function Q(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function et(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,nt(t,e,"set"),s),s}function st(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function it(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,nt(t,e,"get"))}function nt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const at=JSON.stringify({users:[]});var ot=new WeakMap,rt=new WeakMap,lt=new WeakMap,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet,ht=new WeakSet;async function pt(){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 F(t,"Instagram.toggleUsers"),!1}}};function vt(t,e){yt(t,e),e.add(t)}function kt(t,e,s){yt(t,e),e.set(t,s)}function yt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bt(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,St(t,e,"set"),s),s}function $t(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function xt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,St(t,e,"get"))}function St(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Lt=JSON.stringify({reddits:[]});var _t=new WeakMap,It=new WeakMap,Ct=new WeakSet,At=new WeakSet;async function Gt(){try{const s=j({text:M("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 $t(this,At,Ot).call(this,!0))}})}catch(t){return F(t,"Reddit.useBeta"),!1}}async function Ot(){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 F(t,"Reddit.toggle"),!1}}};function Pt(t,e){Wt(t,e),e.add(t)}function jt(t,e,s){Wt(t,e),e.set(t,s)}function Wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Vt(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,Nt(t,e,"set"),s),s}function Mt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Nt(t,e,"get"))}function Nt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ut=JSON.stringify({channels:[]});var Kt=new WeakMap,zt=new WeakMap,Rt=new WeakMap,Bt=new WeakSet,Yt=new WeakSet,qt=new WeakSet,Jt=new WeakSet,Ht=new WeakSet;async function Xt(){try{const r=j({text:M("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 "+Ft(this,Kt).authToken,"Client-Id":Ft(this,Kt).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 F(t,"Twitch.verifyAuth"),!1}}async function Zt(){try{const s=j({text:M("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?(Vt(this,Kt,t),s.success(),e(await Mt(this,Bt,Xt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return F(t,"Twitch.updateAuth"),!1}}async function Qt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return j({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Mt(this,Jt,te).call(this,e);if(!s)return!1;const c=j({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 "+Ft(this,Kt).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=_([...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 F(t,"Twitch.toggleChannel"),!1}}async function te(t){try{const d=j({type:"gettingTwitchChannelId",text:t});var e=Ft(this,zt)[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 "+Ft(this,Kt).authToken,"Client-Id":Ft(this,Kt).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?(Mt(this,Ht,ee).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return F(t,"Twitch.getChannelId"),!1}}function ee(t,e){try{Ft(this,zt)[t]=e,GM_setValue("twitchCache",Ft(this,zt))}catch(t){F(t,"Twitch.setCache")}}const se=class extends g{constructor(){var t;super(...arguments),Pt(this,Ht),Pt(this,Jt),Pt(this,qt),Pt(this,Yt),Pt(this,Bt),Dt(this,"tasks",JSON.parse(Ut)),Dt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||JSON.parse(Ut)),jt(this,Kt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),jt(this,zt,{writable:!0,value:GM_getValue("twitchCache")||{}}),jt(this,Rt,{writable:!0,value:!1})}async init(){try{return Ft(this,Rt)?!0:Ft(this,Kt).authToken?await Mt(this,Bt,Xt).call(this)?(j({}).success(M("initSuccess","Twitch")),Vt(this,Rt,!0),!0):(GM_setValue("twitchAuth",null),await Mt(this,Yt,Zt).call(this)?(j({}).success(M("initSuccess","Twitch")),Vt(this,Rt,!0),!0):(j({}).error(M("initFailed","Twitch")),!1)):!!await Mt(this,Yt,Zt).call(this)&&(Vt(this,Rt,!0),!0)}catch(t){return F(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Ft(this,Rt))return j({text:M("needInit")}),!1;const i=[];if(e&&!W.doTask.twitch.channels||!e&&!W.undoTask.twitch.channels)j({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 F(t,"Twitch.toggle"),!1}}};function ie(t,e){ae(t,e),e.add(t)}function ne(t,e,s){ae(t,e),e.set(t,s)}function ae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function re(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,ue(t,e,"set"),s),s}function le(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ue(t,e,"get"))}function ue(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({users:[],retweets:[],likes:[]});var he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakMap,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet,ye=new WeakSet;async function be(){try{return await le(this,ve,$e).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return F(t,"Twitter.verifyAuth"),!1}}async function Te(){try{const s=j({text:M("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?(re(this,pe,t),s.success(),e(await le(this,ge,be).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return F(t,"Twitter.updateToken"),!1}}async function $e(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return j({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?ce(this,he):await this.userName2id(e);if(!i)return!1;const d=t?j({text:M("verifyingAuth","Twitter")}):j({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":ce(this,pe).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=_([...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 F(t,"Twitter.toggleUser"),!1}}async function xe(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return j({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=j({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":ce(this,pe).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=_([...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 F(t,"Twitter.toggleRetweet"),!1}}function Se(t,e){try{ce(this,fe)[t]=e,GM_setValue("twitterCache",ce(this,fe))}catch(t){F(t,"Twitter.setCache")}}const Le=class extends g{constructor(){var t;super(...arguments),ie(this,ye),ie(this,ke),ie(this,ve),ie(this,me),ie(this,ge),oe(this,"tasks",JSON.parse(de)),oe(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter)||JSON.parse(de)),ne(this,he,{writable:!0,value:W.other.twitterVerifyId}),ne(this,pe,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ne(this,fe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ne(this,we,{writable:!0,value:!1})}async init(){try{return ce(this,we)?!0:ce(this,pe).ct0?await le(this,ge,be).call(this)?(j({}).success(M("initSuccess","Twitter")),re(this,we,!0),!0):(GM_setValue("twitterAuth",null),await le(this,me,Te).call(this)?(j({}).success(M("initSuccess","Twitter")),re(this,we,!0),!0):(j({}).error(M("initFailed","Twitter")),!1)):!!await le(this,me,Te).call(this)&&(re(this,we,!0),!0)}catch(t){return F(t,"Twitter.init"),!1}}async userName2id(t){try{const u=j({type:"gettingTwitterUserId",text:t});var e=ce(this,fe)[t];if(e)return u.success(),e;var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:"https://api.twitter.com/graphql/-xfUfZsnR_zqjFd-IfrN5A/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withHighlightedLabel%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json"},responseType:"json",anonymous:!0});if("Success"!==a)return u.error(a+`:${o}(${r})`),!1;if(200!==(null==l?void 0:l.status))return u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1;{let e=l.response||("object"==typeof l.responseText?l.responseText:null);if(!e)try{e=JSON.parse(l.responseText)}catch(t){e=null}var c=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n?void 0:n.rest_id);return c?(le(this,ye,Se).call(this,t,c),u.success(),c):(u.error(`Error:${l.statusText}(${l.status})`),!1)}}catch(t){return F(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!ce(this,we))return j({text:M("needInit")}),!1;const a=[];if(e&&!W.doTask.twitter.users||!e&&!W.undoTask.twitter.users)j({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 F(t,"Twitter.toggle"),!1}}};function _e(t,e){Ce(t,e),e.add(t)}function Ie(t,e,s){Ce(t,e),e.set(t,s)}function Ce(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 Ge(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,Pe(t,e,"set"),s),s}function Oe(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Pe(t,e,"get"))}function Pe(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const je=JSON.stringify({names:[]});var We=new WeakMap,De=new WeakMap,Ve=new WeakMap,Me=new WeakSet,Fe=new WeakSet,Ne=new WeakSet,Ue=new WeakSet,Ke=new WeakSet,ze=new WeakSet,Re=new WeakSet,Be=new WeakSet;async function Ye(){try{const e=j({text:M("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:"+M("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ge(this,We,(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 F(t,"Vk.verifyAuth"),!1}}async function qe(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 F(t,"Vk.toggle"),!1}}};function ss(t,e){ns(t,e),e.add(t)}function is(t,e,s){ns(t,e),e.set(t,s)}function ns(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function as(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function os(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,cs(t,e,"set"),s),s}function rs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ls(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,cs(t,e,"get"))}function cs(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const us=JSON.stringify({channels:[],likes:[]}),ds=async function(t,e){try{const h=j({text:M("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:"+M("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 F(t,"Youtube.getInfo"),{}}};var hs=new WeakMap,ps=new WeakMap,fs=new WeakMap,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet,ks=new WeakSet;class ys extends g{constructor(){var t;super(...arguments),ss(this,ks),ss(this,vs),ss(this,ms),ss(this,gs),ss(this,ws),as(this,"tasks",JSON.parse(us)),as(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||JSON.parse(us)),is(this,hs,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),is(this,ps,{writable:!0,value:!1}),is(this,fs,{writable:!0,value:"https://www.youtube.com/channel/"+W.other.youtubeVerifyChannel})}async init(){try{return ls(this,ps)?!0:ls(this,hs).PAPISID?await rs(this,ws,bs).call(this)?(j({}).success(M("initSuccess","Youtube")),os(this,ps,!0),!0):(GM_setValue("youtubeAuth",null),await rs(this,gs,Ts).call(this)?(j({}).success(M("initSuccess","Youtube")),os(this,ps,!0),!0):(j({}).error(M("initFailed","Youtube")),!1)):!!await rs(this,gs,Ts).call(this)&&(os(this,ps,!0),!0)}catch(t){return F(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!ls(this,ps))return j({text:M("needInit")}),!1;const a=[];if(e&&!W.doTask.youtube.channels||!e&&!W.undoTask.youtube.channels)j({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 F(t,"Youtube.toggle"),!1}}}async function bs(){try{return await rs(this,vs,xs).call(this,{link:ls(this,fs),doTask:!0,verify:!0})}catch(t){return F(t,"Youtube.verifyAuth"),!1}}async function Ts(){try{const s=j({text:M("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?(os(this,hs,t),s.success(),rs(this,ws,bs).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return F(t,"Discord.updateAuth"),!1}}function $s(t,e){return ds(t,e)}async function xs(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await rs(this,ms,$s).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return j({html:M("loginYtb")}),!1;if(!(a&&o&&r&&l))return j({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return j({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?j({text:M("verifyingAuth","Youtube")}):j({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} ${ls(this,hs).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=_([...this.tasks.channels,e])),!0):t&&f.responseText.includes("You may not subscribe to yourself")?(u.success(),!0):(u.error(M("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 F(t,"Youtube.toggleChannel"),!1}}async function Ss(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await rs(this,ms,$s).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return j({html:""+M("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return j({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return j({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=j({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} ${ls(this,hs).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=_([...this.tasks.likes,e])),!0):(u.error(M("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 F(t,"Youtube.toggleLikeVideo"),!1}}function Ls(t,e){Is(t,e),e.add(t)}function _s(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 Cs(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){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Gs(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,Es(t,e,"set"),s),s}function Os(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Es(t,e,"get"))}function Es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ps=JSON.stringify({groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var js=new WeakMap,Ws=new WeakMap,Ds=new WeakMap,Vs=new WeakMap,Ms=new WeakMap,Fs=new WeakSet,Ns=new WeakSet,Us=new WeakSet,Ks=new WeakSet,zs=new WeakSet,Rs=new WeakSet,Bs=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;async function hi(){try{const s=j({text:M("updatingAuth",M("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:"+M("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(Os(this,Ws).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return F(t,"Steam.updateStoreAuth"),!1}}async function pi(){try{const o=j({text:M("updatingAuth",M("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:"+M("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&&(Os(this,Ws).steam64Id=i),a&&(Os(this,Ws).userName=a),n)?(Os(this,Ws).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return F(t,"Steam.updateCommunityAuth"),!1}}async function fi(){try{const i=j({text:M("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&&0t&&"CN"!==t);if(!s||0===s.length)return j({text:"noAnotherArea"}),!1;[t]=s}const l=j({text:M("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:Os(this,Ws).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await As(this,Us,fi).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return F(t,"Steam.changeArea"),!1}}async function gi(t){try{const e=j({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:Os(this,Ws).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=_([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return F(t,"Steam.joinGroup"),!1}}async function mi(t){try{if(this.whiteList.groups.includes(t))return j({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await As(this,Bs,vi).call(this,t);if(!e)return!1;const s=j({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${Os(this,Ws).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Os(this,Ws).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 F(t,"Steam.leaveGroup"),!1}}async function vi(t){try{const n=j({type:"gettingSteamGroupId",text:t});var e=Os(this,js).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?(As(this,di,Di).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return F(t,"Steam.getGroupID"),!1}}async function ki(t){try{var e;const n=j({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:Os(this,Ws).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=_([...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"===Os(this,Ms)&&l.responseText.includes('id="error_box"')?(n.warning(M("changeAreaNotice")),!!await As(this,Ks,wi).call(this)&&await As(this,Ys,ki).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=_([...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 F(t,"Steam.addToWishlist"),!1}}async function yi(t){try{var e;if(this.whiteList.wishlists.includes(t))return j({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=j({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:Os(this,Ws).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"===Os(this,Ms)&&c.responseText.includes('id="error_box"')){a.warning(M("changeAreaNotice"));var n=await As(this,Ks,wi).call(this);return n&&"CN"!==n&&"skip"!==n?await As(this,qs,yi).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 F(t,"Steam.removeFromWishlist"),!1}}async function bi(t,e){try{if(!e&&this.whiteList.follows.includes(t))return j({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=j({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:Os(this,Ws).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 As(this,Hs,Ti).call(this,t);return"CN"===Os(this,Ms)&&"areaLocked"===n?(a.warning(M("changeAreaNotice")),!!await As(this,Ks,wi).call(this)&&await As(this,qs,yi).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=_([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return F(t,"Steam.toggleFollowGame"),!1}}async function Ti(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"===Os(this,Ms)&&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 F(t,"Steam.isFollowedGame"),!1}}async function $i(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(As(this,di,Di).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return F(t,"Steam.getWorkshopAppId"),!1}}async function _i(t){try{const o=j({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:Os(this,Ws).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 F(t,"Steam.voteupWorkshop"),!0}}async function Ii(t){var e=!(1t[1]).filter(t=>t)):(t.error(`Error:${null===n||void 0===n?void 0:n.statusText}(${null===n||void 0===n?void 0:n.status})`),!1):(t.error(e+`:${s}(${i})`),!1)}catch(t){return F(t,"Steam.getLicenses"),!1}}async function Pi(t){try{const[i,n]=t.split("-");if("appid"===i){var e=await As(this,oi,Oi).call(this,n);if(!e)return!1;const a=j({type:"addingFreeLicense",text:n});if(!await As(this,ci,ji).call(this,e,a))return!1;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+n,method:"GET"});return"Success"===o?200===(null===c||void 0===c?void 0:c.status)?c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes('class="already_in_library"')?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1):(a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1):(a.error(o+`:${r}(${l})`),!1)}if("subid"!==i)return!1;{const u={};for(const h of n.split(",")){var s=j({type:"addingFreeLicenseSubid",text:h});if(!await As(this,ci,ji).call(this,h,s))return!1;u[h]=s}const d=await As(this,ri,Ei).call(this);if(!d)return!1;for(const p of n.split(","))d.includes(p)?u[p].success():u[p].error();return!0}}catch(t){return F(t,"Steam.addLicense"),!1}}async function ji(t,e){try{var{result:s,statusText:i,status:n,data:a}=await L({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:Os(this,Ws).storeSessionID,subid:t}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)||(e.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return e.error(),F(t,"Steam.addFreeLicense"),!1}}async function Wi(t){try{const o=j({type:"requestingPlayTestAccess",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+t},data:$.param({sessionid:Os(this,Ws).storeSessionID}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)&&1===(null==a||null===(e=a.response)||void 0===e?void 0:e.success)?(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 F(t,"Steam.requestPlayTestAccess"),!1}}function Di(t,e,s){try{Os(this,js)[t][e]=s,GM_setValue("steamCache",Os(this,js))}catch(t){F(t,"Steam.setCache")}}const Vi=class extends g{constructor(){var t;super(...arguments),Ls(this,di),Ls(this,ui),Ls(this,ci),Ls(this,li),Ls(this,ri),Ls(this,oi),Ls(this,ai),Ls(this,ni),Ls(this,ii),Ls(this,si),Ls(this,ei),Ls(this,ti),Ls(this,Qs),Ls(this,Zs),Ls(this,Xs),Ls(this,Hs),Ls(this,Js),Ls(this,qs),Ls(this,Ys),Ls(this,Bs),Ls(this,Rs),Ls(this,zs),Ls(this,Ks),Ls(this,Us),Ls(this,Ns),Ls(this,Fs),Cs(this,"tasks",JSON.parse(Ps)),Cs(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.steam)||JSON.parse(Ps)),_s(this,js,{writable:!0,value:GM_getValue("steamCache")||{group:{},forum:{},workshop:{},curator:{}}}),_s(this,Ws,{writable:!0,value:{}}),_s(this,Ds,{writable:!0,value:!1}),_s(this,Vs,{writable:!0,value:!1}),_s(this,Ms,{writable:!0,value:"CN"})}async init(){var t=0{return null===(t=t.match(/groups\/(.+)\/?/))||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]}),k=this.getRealParams("curatorLikes",c,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&&W.doTask.steam.playtests&&0("CN"!==Os(this,Ms)&&(j({}).warning(M("steamFinishNotice")),await As(this,Ks,wi).call(this,"CN")),!0))}catch(t){return F(t,"Steam.toggle"),!1}}};function Mi(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 Fi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ni(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Ui=new WeakSet;async function Ki(e,t){try{return{name:e,result:await t}}catch(t){return F(t,"Website.bind"),{name:e,result:!1}}}var zi=class{constructor(){Mi(this,Ui),Fi(this,"undoneTasks",void 0),Fi(this,"socialTasks",void 0),Fi(this,"giveawayId",void 0),Fi(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1}),Fi(this,"initialized",!1),Fi(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 H,i.push(Ni(this,Ui,Ki).call(this,"discord",this.social.discord.init())))),n.instagram&&(!(0[...t,...e]).length)||this.socialInitialized.instagram&&this.social.instagram||(this.social.instagram=new mt,i.push(Ni(this,Ui,Ki).call(this,"instagram",this.social.instagram.init())))),n.reddit&&(!(0[...t,...e]).length)||this.socialInitialized.reddit&&this.social.reddit||(this.social.reddit=new Et,i.push(Ni(this,Ui,Ki).call(this,"reddit",this.social.reddit.init())))),n.twitch&&(!(0[...t,...e]).length)||this.socialInitialized.twitch&&this.social.twitch||(this.social.twitch=new se,i.push(Ni(this,Ui,Ki).call(this,"twitch",this.social.twitch.init())))),n.twitter&&(!(0[...t,...e]).length)||this.socialInitialized.twitter&&this.social.twitter||(this.social.twitter=new Le,i.push(Ni(this,Ui,Ki).call(this,"twitter",this.social.twitter.init())))),n.vk&&(!(0[...t,...e]).length)||this.socialInitialized.vk&&this.social.vk||(this.social.vk=new es,i.push(Ni(this,Ui,Ki).call(this,"vk",this.social.vk.init())))),n.youtube&&(!(0[...t,...e]).length)||this.socialInitialized.youtube&&this.social.youtube||(this.social.youtube=new ys,i.push(Ni(this,Ui,Ki).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 Vi),0{var e,s;return["groupLinks","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(Ni(this,Ui,Ki).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 F(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]=_(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(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),j({}).success(M("allTasksComplete")),!0}catch(t){return F(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return F(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return F(t,"Website.undoTask"),!1}}};function Ri(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 Bi(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}const qi=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}});var Ji=new WeakSet,Hi=new WeakSet;function Xi(){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):(j({}).error(M("getFailed","GiveawayId")),!1)}catch(t){F(t,"FreeAnyWhere.getGiveawayId")}}async function Zi(t){try{const o=j({html:`
  • ${M("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 F(t,"Freeanywhere.verify"),!1}}var Qi=class extends zi{constructor(){super(...arguments),Ri(this,Hi),Ri(this,Ji),Bi(this,"name","FreeAnyWhere"),Bi(this,"tasks",[]),Bi(this,"socialTasks",JSON.parse(qi)),Bi(this,"undoneTasks",JSON.parse(qi)),Bi(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=j({text:M("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(M("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(M("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(M("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Yi(this,Ji,Xi).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return F(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=j({text:M("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||JSON.parse(qi));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:j({}).warning(M("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),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})`),console.error(a),!1}catch(t){return F(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(Yi(this,Hi,Zi).call(this,e)),await P(1e3);return await Promise.all(t),j({}).success(M("allTasksComplete")),!!await this.getKey(!0)}catch(t){return F(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=j({text:M("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(),j({}).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 F(t,"FreeAnyWhere.getGiveawayId"),!1}}};function tn(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 en(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function sn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const nn={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var an=new WeakSet,on=new WeakSet,rn=new WeakSet;class ln extends zi{constructor(){super(...arguments),tn(this,rn),tn(this,on),tn(this,an),en(this,"name","GiveawaySu"),en(this,"socialTasks",nn),en(this,"undoneTasks",nn),en(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{sn(this,an,cn).call(this)||j({}).warning(M("checkLoginFailed")),await sn(this,on,un).call(this)||j({}).warning(M("checkLeftKeyFailed")),j({}).warning(M("gsNotice"))}catch(t){F(t,"Giveawaysu.after")}}init(){try{const t=j({text:M("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(M("needLogin")),!1):!!sn(this,rn,dn).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return F(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=j({text:M("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||nn,!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=>(F(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(t,"Giveawaysu.classifyTask"),!1}}}function cn(){try{return W.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return F(t,"Giveawaysu.checkLogin"),!1}}async function un(){try{return W.other.checkLeftKey?(0<$(".giveaway-ended").length&&0===$(".giveaway-key").length&&await p().fire({icon:"warning",title:M("notice"),text:M("noKeysLeft"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Giveawaysu.checkLeftKey"),!1}}function dn(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(j({text:M("getFailed","GiveawayId")}),!1)}function hn(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 pn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function fn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var wn=new WeakSet,gn=new WeakSet,mn=new WeakSet,vn=new WeakSet;async function kn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return j({}).error(M("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=j({text:M("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:(j({}).warning(M("needJoinGiveaway")),!1)}catch(t){return F(t,"Indiedb.init"),!1}}async function yn(){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 j({}).error(M("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=j({text:`${M("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){console.log({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){console.log(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){console.log({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){console.log(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 F(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){console.log({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){console.log(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:"+M("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){console.log({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){console.log(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),j({}).success(M("allTasksComplete")),!0}}catch(t){return F(t,"Indiedb.classifyTask"),!1}}function bn(){try{return W.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return F(t,"Indiedb.checkLogin"),!1}}async function Tn(){try{return W.other.checkLeftKey?(0<$('a.buttonenter:contains("next time"),a.buttonenter:contains("Giveaway is closed")').length&&await p().fire({icon:"warning",title:M("notice"),text:M("giveawayEnded"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Indiedb.checkLeftKey"),!1}}var $n=class{constructor(){hn(this,vn),hn(this,mn),hn(this,gn),hn(this,wn),pn(this,"name","Indiedb"),pn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{fn(this,mn,bn).call(this)||j({}).warning(M("checkLoginFailed")),await fn(this,vn,Tn).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){F(t,"Indiedb.after")}}async doTask(){try{return await fn(this,wn,kn).call(this)?await fn(this,gn,yn).call(this):!1}catch(t){return F(t,"Indiedb.doTask"),!1}}};function xn(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 Sn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ln(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const _n=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]});var In=new WeakSet,Cn=new WeakSet,An=new WeakSet;function Gn(){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):(j({}).error(M("getFailed","GiveawayId")),!1)}catch(t){return F(t,"Keyhub.getGiveawayId"),!1}}async function On(){try{return W.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:M("notice"),text:M("noKeysLeft"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Keyhub.checkLeftKey"),!1}}function En(){try{return W.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return F(t,"Keyhub.checkLogin"),!1}}var Pn=class extends zi{constructor(){super(...arguments),xn(this,An),xn(this,Cn),xn(this,In),Sn(this,"name","Keyhub"),Sn(this,"socialTasks",JSON.parse(_n)),Sn(this,"undoneTasks",JSON.parse(_n)),Sn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{Ln(this,An,En).call(this)||j({}).warning(M("checkLoginFailed")),await Ln(this,Cn,On).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){F(t,"Keyhub.after")}}init(){try{const t=j({text:M("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(M("needLogin")),!1):!!Ln(this,In,Gn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return F(t,"Keyhub.init"),!1}}async classifyTask(e){try{const i=j({text:M("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||JSON.parse(_n));for(const n of $(".task a")){let t=$(n).attr("href");var s=$(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"===e&&this.socialTasks.steam.groupLinks.push(t),"do"===e&&this.undoneTasks.steam.groupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(s)?("undo"===e&&this.socialTasks.steam.wishlistLinks.push(t),"do"===e&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===e&&this.socialTasks.steam.curatorLinks.push(t),"do"===e&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===e&&this.socialTasks.discord.serverLinks.push(t),"do"===e&&this.undoneTasks.discord.serverLinks.push(t)):/^https?:\/\/twitter\.com\/.*/.test(t)||/^https?:\/\/www\.twitch\.tv\/.*/.test(t)||j({}).warning(`${M("unKnownTaskType")}: ${s}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(t,"Keyhub.classifyTask"),!1}}verifyTask(){try{j({html:`
  • ${M("verifyingTask")}...
  • `}),$.get(window.location.href,t=>{VerifyTasks(t.match(/onclick="javascript:VerifyTasks\('(.*?)'\)"/)[1])})}catch(t){F(t,"keyhub.verifyTask")}}};function jn(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 Wn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Dn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Vn=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}});var Mn=new WeakSet,Fn=new WeakSet,Nn=new WeakSet;async function Un(t){try{const s=j({html:`
  • ${M("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(),j({}).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 F(t,"Givekey.verify"),!1}}function Kn(){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):(j({text:M("getFailed","GiveawayId")}),!1)}catch(t){return F(t,"Givekey.getGiveawayId"),!1}}async function zn(){try{return W.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:M("notice"),text:M("noKeysLeft"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Givekey.checkLeftKey"),!1}}var Rn=class extends zi{constructor(){super(...arguments),jn(this,Nn),jn(this,Fn),jn(this,Mn),Wn(this,"name","Givekey"),Wn(this,"tasks",[]),Wn(this,"socialTasks",JSON.parse(Vn)),Wn(this,"undoneTasks",JSON.parse(Vn)),Wn(this,"userId",void 0),Wn(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 Dn(this,Nn,zn).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){return F(t,"Givekey.after"),!1}}init(){try{const e=j({text:M("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(M("needLogin")),!1;if(!Dn(this,Fn,Kn).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(M("getFailed",M("userId"))),!1)}catch(t){return F(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=j({text:M("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||JSON.parse(Vn));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)):j({}).warning(`${M("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=_(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(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;j({}).warning(M("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${M("giveKeyNoticeAfter")}`}),!0}catch(t){return F(t,"Givekey.verifyTask"),!1}}};function Bn(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 Yn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function qn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Jn=new WeakSet,Hn=new WeakSet,Xn=new WeakSet;function Zn(){try{return W.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return F(t,"GiveeClub.checkLogin"),!1}}function Qn(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(j({text:M("getFailed","GiveawayId")}),!1)}async function ta(){try{return W.other.checkLeftKey?(0<$(".event-ended").length&&0===$(".event-winner").length&&await p().fire({icon:"warning",title:M("notice"),text:M("giveawayEnded"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Giveawaysu.checkLeftKey"),!1}}var ea=class extends ln{constructor(){super(...arguments),Bn(this,Xn),Bn(this,Hn),Bn(this,Jn),Yn(this,"name","GiveeClub"),Yn(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{qn(this,Jn,Zn).call(this)||j({}).warning(M("checkLoginFailed")),await qn(this,Xn,ta).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){F(t,"GiveeClub.after")}}init(){try{const t=j({text:M("initing")});return qn(this,Jn,Zn).call(this)?!!qn(this,Hn,Qn).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(M("needLogin")),!1)}catch(t){return F(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=j({text:M("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||nn,!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=>(F(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(t,"GiveeClub.classifyTask"),!1}}};function sa(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 ia(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function na(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const aa={maxPoint:"99999999"};var oa=new WeakSet,ra=new WeakSet;async function la(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)j({}).warning(M("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=j({text:`${M("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 j({}).warning(M("getNeedPointsFailed")+": "+c)}j({text:"-----END-----"})}catch(t){F(t,"OpiumPulses.toggleTask")}}function ca(){try{return W.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return F(t,"OpiumPulses.checkLogin"),!1}}var t=class{constructor(){sa(this,ra),sa(this,oa),ia(this,"name","OpiumPulses"),ia(this,"options",{...aa,...GM_getValue("OpiumPulsesOptions")}),ia(this,"maxPoints",99999999),ia(this,"myPoints",0),ia(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{na(this,ra,ca).call(this)||j({}).warning(M("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){F(t,"OpiumPulses.after")}}async doFreeTask(){try{na(this,oa,la).call(this,"FREE")}catch(t){F(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),na(this,oa,la).call(this,"points")}catch(t){F(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}},ua=_o(698),da=_o.n(ua);const ha={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 F(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 F(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 F(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(/`),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/page/dist/auto-task-v4.compatibility.user.js b/page/dist/auto-task-v4.compatibility.user.js index d1a08c0..5516fc5 100644 --- a/page/dist/auto-task-v4.compatibility.user.js +++ b/page/dist/auto-task-v4.compatibility.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.1.20-beta +// @version 4.1.21-beta // @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 @@ -96,11 +96,11 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); -!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return F(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function P(){let e=0{setTimeout(()=>{t(!0)},e)})}const j=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":t=$(`
  • ${M(e)}${s}...
  • `);break;case"addingFreeLicenseSubid":t=$(`
  • ${M("addingFreeLicense")}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${M(e)} - ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${M(e)} - ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${M(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${M(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${M("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${M(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${M(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${M(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${M(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${M(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${M(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${M(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${M(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${M(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${M("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${M(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${M("skipTask")}[${s}(${n})](${M("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${M("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${M("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${M(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return F(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return F(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=j({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return F(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return F(t,"stringToColour"),"#fff"}},o={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};var s=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return F(t,"assignObject"),o}},W=r(o,s),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?W[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(W[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",W),p().fire({title:M("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){F(t,"saveData")}},h=e=>{try{let t=`
    - `;for(const[o,r]of Object.entries(W))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${M("type")}${M("option")}${M("value")}
    ${M(o)}${M(s)}
    ${M(o)}${M(s)}
    ${M(o)}${s}.${M(n)}
    ","swal"===e?p().fire({title:M("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:M("save"),showCancelButton:!0,cancelButtonText:M("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${M("globalOptions")}

    `+t)}catch(t){F(t,"changeGlobalOptions")}};const d={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},w=["zh","en"].includes(W.other.language)?W.other.language:"en";const M=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function F(s,i){p().fire({title:M("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:M("toGithub"),showDenyButton:!0,denyButtonText:M("toKeylol"),cancelButtonText:M("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+i)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,n.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(s.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")),"_blank"):e&&(e=`错误链接: [url=${window.location.href}]${window.location.href}[/url] +!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return R(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function P(){let e=0{setTimeout(()=>{t(!0)},e)})}const j=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":t=$(`
  • ${z(e)}${s}...
  • `);break;case"addingFreeLicenseSubid":t=$(`
  • ${z("addingFreeLicense")}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${z(e)} + ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${z(e)} + ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${z(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${z(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${z("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${z(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${z(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${z(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${z(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${z(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${z(e)} + ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${z(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${z(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${z(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${z("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${z(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${z("skipTask")}[${s}(${n})](${z("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${z("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${z("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${z(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return R(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return R(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=j({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return R(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return R(t,"stringToColour"),"#fff"}},o={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};var s=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return R(t,"assignObject"),o}},W=r(o,s),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?W[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(W[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",W),p().fire({title:z("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){R(t,"saveData")}},h=e=>{try{let t=`
    + `;for(const[o,r]of Object.entries(W))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${z("type")}${z("option")}${z("value")}
    ${z(o)}${z(s)}
    ${z(o)}${z(s)}
    ${z(o)}${s}.${z(n)}
    ","swal"===e?p().fire({title:z("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:z("save"),showCancelButton:!0,cancelButtonText:z("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${z("globalOptions")}

    `+t)}catch(t){R(t,"changeGlobalOptions")}};const d={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},w=["zh","en"].includes(W.other.language)?W.other.language:"en";const z=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function R(s,i){p().fire({title:z("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:z("toGithub"),showDenyButton:!0,denyButtonText:z("toKeylol"),cancelButtonText:z("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+i)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,n.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(s.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")),"_blank"):e&&(e=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -113,20 +113,20 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); [code]${s.stack}[/code] 执行日志: -[code]${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")}[/code]`,GM_setClipboard(e),p().fire({title:M("copySuccess"),icon:"success",confirmButtonText:M("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",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{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return F(t,"Discord.toggleServers"),!1}}}async function z(){try{const n=j({text:M("verifyingAuth","Discord")});var{result:t,statusText:e,status:s,data:i}=await L({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:x(this,C).auth}});return"Success"===t?200===(null==i?void 0:i.status)?(n.success(),!0):(n.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1):(n.error(t+`:${e}(${s})`),!1)}catch(t){return F(t,"Discord.verifyAuth"),!1}}async function R(){try{const s=j({text:M("updatingAuth","Discord")});return await new Promise(e=>{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?(b(this,C,{auth:t}),s.success(),e(await T(this,O,z).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return F(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=j({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:x(this,C).auth}});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&&(T(this,U,J).call(this,t,r),this.tasks.servers=_([...this.tasks.servers,t])),!0}catch(t){return F(t,"Discord.joinServer"),!1}}async function Y(t){try{if(this.whiteList.servers.includes(t))return j({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await T(this,N,q).call(this,t);if(!e)return!1;const o=j({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:x(this,C).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return F(t,"Discord.leaveServer"),!1}}async function q(t){try{const c=j({type:"gettingDiscordGuild",text:t});var e=x(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(),T(this,U,J).call(this,t,l),l):(c.error(s+`:${i}(${n})`),!1)}catch(t){return F(t,"Discord.getGuild"),!1}}function J(t,e){try{x(this,A)[t]=e,GM_setValue("discordCache",x(this,A))}catch(t){F(t,"Discord.setCache")}}const H=unsafeWindow.Discord=K;function X(t,e){Q(t,e),e.add(t)}function Z(t,e,s){Q(t,e),e.set(t,s)}function Q(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function et(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,nt(t,e,"set"),s),s}function st(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function it(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,nt(t,e,"get"))}function nt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const at=JSON.stringify({users:[]});var ot=new WeakMap,rt=new WeakMap,lt=new WeakMap,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet,ht=new WeakSet;async function pt(){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 F(t,"Instagram.toggleUsers"),!1}}};function vt(t,e){yt(t,e),e.add(t)}function kt(t,e,s){yt(t,e),e.set(t,s)}function yt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bt(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,St(t,e,"set"),s),s}function $t(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function xt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,St(t,e,"get"))}function St(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Lt=JSON.stringify({reddits:[]});var _t=new WeakMap,It=new WeakMap,Ct=new WeakSet,At=new WeakSet;async function Gt(){try{const s=j({text:M("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 $t(this,At,Ot).call(this,!0))}})}catch(t){return F(t,"Reddit.useBeta"),!1}}async function Ot(){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 F(t,"Reddit.toggle"),!1}}};function Pt(t,e){Wt(t,e),e.add(t)}function jt(t,e,s){Wt(t,e),e.set(t,s)}function Wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Vt(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,Nt(t,e,"set"),s),s}function Mt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Nt(t,e,"get"))}function Nt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ut=JSON.stringify({channels:[]});var Kt=new WeakMap,zt=new WeakMap,Rt=new WeakMap,Bt=new WeakSet,Yt=new WeakSet,qt=new WeakSet,Jt=new WeakSet,Ht=new WeakSet;async function Xt(){try{const r=j({text:M("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 "+Ft(this,Kt).authToken,"Client-Id":Ft(this,Kt).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 F(t,"Twitch.verifyAuth"),!1}}async function Zt(){try{const s=j({text:M("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?(Vt(this,Kt,t),s.success(),e(await Mt(this,Bt,Xt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return F(t,"Twitch.updateAuth"),!1}}async function Qt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return j({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Mt(this,Jt,te).call(this,e);if(!s)return!1;const c=j({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 "+Ft(this,Kt).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=_([...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 F(t,"Twitch.toggleChannel"),!1}}async function te(t){try{const d=j({type:"gettingTwitchChannelId",text:t});var e=Ft(this,zt)[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 "+Ft(this,Kt).authToken,"Client-Id":Ft(this,Kt).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?(Mt(this,Ht,ee).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return F(t,"Twitch.getChannelId"),!1}}function ee(t,e){try{Ft(this,zt)[t]=e,GM_setValue("twitchCache",Ft(this,zt))}catch(t){F(t,"Twitch.setCache")}}const se=class extends g{constructor(){var t;super(...arguments),Pt(this,Ht),Pt(this,Jt),Pt(this,qt),Pt(this,Yt),Pt(this,Bt),Dt(this,"tasks",JSON.parse(Ut)),Dt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||JSON.parse(Ut)),jt(this,Kt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),jt(this,zt,{writable:!0,value:GM_getValue("twitchCache")||{}}),jt(this,Rt,{writable:!0,value:!1})}async init(){try{return Ft(this,Rt)?!0:Ft(this,Kt).authToken?await Mt(this,Bt,Xt).call(this)?(j({}).success(M("initSuccess","Twitch")),Vt(this,Rt,!0),!0):(GM_setValue("twitchAuth",null),await Mt(this,Yt,Zt).call(this)?(j({}).success(M("initSuccess","Twitch")),Vt(this,Rt,!0),!0):(j({}).error(M("initFailed","Twitch")),!1)):!!await Mt(this,Yt,Zt).call(this)&&(Vt(this,Rt,!0),!0)}catch(t){return F(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Ft(this,Rt))return j({text:M("needInit")}),!1;const i=[];if(e&&!W.doTask.twitch.channels||!e&&!W.undoTask.twitch.channels)j({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 F(t,"Twitch.toggle"),!1}}};function ie(t,e){ae(t,e),e.add(t)}function ne(t,e,s){ae(t,e),e.set(t,s)}function ae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function re(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,ue(t,e,"set"),s),s}function le(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ue(t,e,"get"))}function ue(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({users:[],retweets:[],likes:[]});var he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakMap,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet,ye=new WeakSet;async function be(){try{return await le(this,ve,$e).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return F(t,"Twitter.verifyAuth"),!1}}async function Te(){try{const s=j({text:M("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?(re(this,pe,t),s.success(),e(await le(this,ge,be).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return F(t,"Twitter.updateToken"),!1}}async function $e(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return j({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?ce(this,he):await this.userName2id(e);if(!i)return!1;const d=t?j({text:M("verifyingAuth","Twitter")}):j({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":ce(this,pe).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=_([...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 F(t,"Twitter.toggleUser"),!1}}async function xe(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return j({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=j({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":ce(this,pe).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=_([...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 F(t,"Twitter.toggleRetweet"),!1}}function Se(t,e){try{ce(this,fe)[t]=e,GM_setValue("twitterCache",ce(this,fe))}catch(t){F(t,"Twitter.setCache")}}const Le=class extends g{constructor(){var t;super(...arguments),ie(this,ye),ie(this,ke),ie(this,ve),ie(this,me),ie(this,ge),oe(this,"tasks",JSON.parse(de)),oe(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter)||JSON.parse(de)),ne(this,he,{writable:!0,value:W.other.twitterVerifyId}),ne(this,pe,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ne(this,fe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ne(this,we,{writable:!0,value:!1})}async init(){try{return ce(this,we)?!0:ce(this,pe).ct0?await le(this,ge,be).call(this)?(j({}).success(M("initSuccess","Twitter")),re(this,we,!0),!0):(GM_setValue("twitterAuth",null),await le(this,me,Te).call(this)?(j({}).success(M("initSuccess","Twitter")),re(this,we,!0),!0):(j({}).error(M("initFailed","Twitter")),!1)):!!await le(this,me,Te).call(this)&&(re(this,we,!0),!0)}catch(t){return F(t,"Twitter.init"),!1}}async userName2id(t){try{const u=j({type:"gettingTwitterUserId",text:t});var e=ce(this,fe)[t];if(e)return u.success(),e;var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:"https://api.twitter.com/graphql/-xfUfZsnR_zqjFd-IfrN5A/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withHighlightedLabel%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json"},responseType:"json",anonymous:!0});if("Success"!==a)return u.error(a+`:${o}(${r})`),!1;if(200!==(null==l?void 0:l.status))return u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1;{let e=l.response||("object"==typeof l.responseText?l.responseText:null);if(!e)try{e=JSON.parse(l.responseText)}catch(t){e=null}var c=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n?void 0:n.rest_id);return c?(le(this,ye,Se).call(this,t,c),u.success(),c):(u.error(`Error:${l.statusText}(${l.status})`),!1)}}catch(t){return F(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!ce(this,we))return j({text:M("needInit")}),!1;const a=[];if(e&&!W.doTask.twitter.users||!e&&!W.undoTask.twitter.users)j({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 F(t,"Twitter.toggle"),!1}}};function _e(t,e){Ce(t,e),e.add(t)}function Ie(t,e,s){Ce(t,e),e.set(t,s)}function Ce(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 Ge(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,Pe(t,e,"set"),s),s}function Oe(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Pe(t,e,"get"))}function Pe(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const je=JSON.stringify({names:[]});var We=new WeakMap,De=new WeakMap,Ve=new WeakMap,Me=new WeakSet,Fe=new WeakSet,Ne=new WeakSet,Ue=new WeakSet,Ke=new WeakSet,ze=new WeakSet,Re=new WeakSet,Be=new WeakSet;async function Ye(){try{const e=j({text:M("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:"+M("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ge(this,We,(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 F(t,"Vk.verifyAuth"),!1}}async function qe(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 F(t,"Vk.toggle"),!1}}};function ss(t,e){ns(t,e),e.add(t)}function is(t,e,s){ns(t,e),e.set(t,s)}function ns(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function as(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function os(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,cs(t,e,"set"),s),s}function rs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ls(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,cs(t,e,"get"))}function cs(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const us=JSON.stringify({channels:[],likes:[]}),ds=async function(t,e){try{const h=j({text:M("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:"+M("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 F(t,"Youtube.getInfo"),{}}};var hs=new WeakMap,ps=new WeakMap,fs=new WeakMap,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet,ks=new WeakSet;class ys extends g{constructor(){var t;super(...arguments),ss(this,ks),ss(this,vs),ss(this,ms),ss(this,gs),ss(this,ws),as(this,"tasks",JSON.parse(us)),as(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||JSON.parse(us)),is(this,hs,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),is(this,ps,{writable:!0,value:!1}),is(this,fs,{writable:!0,value:"https://www.youtube.com/channel/"+W.other.youtubeVerifyChannel})}async init(){try{return ls(this,ps)?!0:ls(this,hs).PAPISID?await rs(this,ws,bs).call(this)?(j({}).success(M("initSuccess","Youtube")),os(this,ps,!0),!0):(GM_setValue("youtubeAuth",null),await rs(this,gs,Ts).call(this)?(j({}).success(M("initSuccess","Youtube")),os(this,ps,!0),!0):(j({}).error(M("initFailed","Youtube")),!1)):!!await rs(this,gs,Ts).call(this)&&(os(this,ps,!0),!0)}catch(t){return F(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!ls(this,ps))return j({text:M("needInit")}),!1;const a=[];if(e&&!W.doTask.youtube.channels||!e&&!W.undoTask.youtube.channels)j({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 F(t,"Youtube.toggle"),!1}}}async function bs(){try{return await rs(this,vs,xs).call(this,{link:ls(this,fs),doTask:!0,verify:!0})}catch(t){return F(t,"Youtube.verifyAuth"),!1}}async function Ts(){try{const s=j({text:M("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?(os(this,hs,t),s.success(),rs(this,ws,bs).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return F(t,"Discord.updateAuth"),!1}}function $s(t,e){return ds(t,e)}async function xs(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await rs(this,ms,$s).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return j({html:M("loginYtb")}),!1;if(!(a&&o&&r&&l))return j({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return j({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?j({text:M("verifyingAuth","Youtube")}):j({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} ${ls(this,hs).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=_([...this.tasks.channels,e])),!0):t&&f.responseText.includes("You may not subscribe to yourself")?(u.success(),!0):(u.error(M("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 F(t,"Youtube.toggleChannel"),!1}}async function Ss(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await rs(this,ms,$s).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return j({html:""+M("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return j({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return j({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=j({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} ${ls(this,hs).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=_([...this.tasks.likes,e])),!0):(u.error(M("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 F(t,"Youtube.toggleLikeVideo"),!1}}function Ls(t,e){Is(t,e),e.add(t)}function _s(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 Cs(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){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Gs(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,Es(t,e,"set"),s),s}function Os(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Es(t,e,"get"))}function Es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ps=JSON.stringify({groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var js=new WeakMap,Ws=new WeakMap,Ds=new WeakMap,Vs=new WeakMap,Ms=new WeakMap,Fs=new WeakSet,Ns=new WeakSet,Us=new WeakSet,Ks=new WeakSet,zs=new WeakSet,Rs=new WeakSet,Bs=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;async function hi(){try{const s=j({text:M("updatingAuth",M("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:"+M("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(Os(this,Ws).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return F(t,"Steam.updateStoreAuth"),!1}}async function pi(){try{const o=j({text:M("updatingAuth",M("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:"+M("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&&(Os(this,Ws).steam64Id=i),a&&(Os(this,Ws).userName=a),n)?(Os(this,Ws).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return F(t,"Steam.updateCommunityAuth"),!1}}async function fi(){try{const i=j({text:M("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&&0t&&"CN"!==t);if(!s||0===s.length)return j({text:"noAnotherArea"}),!1;[t]=s}const l=j({text:M("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:Os(this,Ws).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await As(this,Us,fi).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return F(t,"Steam.changeArea"),!1}}async function gi(t){try{const e=j({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:Os(this,Ws).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=_([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return F(t,"Steam.joinGroup"),!1}}async function mi(t){try{if(this.whiteList.groups.includes(t))return j({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await As(this,Bs,vi).call(this,t);if(!e)return!1;const s=j({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${Os(this,Ws).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Os(this,Ws).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 F(t,"Steam.leaveGroup"),!1}}async function vi(t){try{const n=j({type:"gettingSteamGroupId",text:t});var e=Os(this,js).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?(As(this,di,Di).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return F(t,"Steam.getGroupID"),!1}}async function ki(t){try{var e;const n=j({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:Os(this,Ws).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=_([...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"===Os(this,Ms)&&l.responseText.includes('id="error_box"')?(n.warning(M("changeAreaNotice")),!!await As(this,Ks,wi).call(this)&&await As(this,Ys,ki).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=_([...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 F(t,"Steam.addToWishlist"),!1}}async function yi(t){try{var e;if(this.whiteList.wishlists.includes(t))return j({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=j({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:Os(this,Ws).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"===Os(this,Ms)&&c.responseText.includes('id="error_box"')){a.warning(M("changeAreaNotice"));var n=await As(this,Ks,wi).call(this);return n&&"CN"!==n&&"skip"!==n?await As(this,qs,yi).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 F(t,"Steam.removeFromWishlist"),!1}}async function bi(t,e){try{if(!e&&this.whiteList.follows.includes(t))return j({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=j({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:Os(this,Ws).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 As(this,Hs,Ti).call(this,t);return"CN"===Os(this,Ms)&&"areaLocked"===n?(a.warning(M("changeAreaNotice")),!!await As(this,Ks,wi).call(this)&&await As(this,qs,yi).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=_([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return F(t,"Steam.toggleFollowGame"),!1}}async function Ti(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"===Os(this,Ms)&&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 F(t,"Steam.isFollowedGame"),!1}}async function $i(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(As(this,di,Di).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return F(t,"Steam.getWorkshopAppId"),!1}}async function _i(t){try{const o=j({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:Os(this,Ws).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 F(t,"Steam.voteupWorkshop"),!0}}async function Ii(t){var e=!(1t[1]).filter(t=>t)):(t.error(`Error:${null===n||void 0===n?void 0:n.statusText}(${null===n||void 0===n?void 0:n.status})`),!1):(t.error(e+`:${s}(${i})`),!1)}catch(t){return F(t,"Steam.getLicenses"),!1}}async function Pi(t){try{const[i,n]=t.split("-");if("appid"===i){var e=await As(this,oi,Oi).call(this,n);if(!e)return!1;const a=j({type:"addingFreeLicense",text:n});if(!await As(this,ci,ji).call(this,e,a))return!1;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+n,method:"GET"});return"Success"===o?200===(null===c||void 0===c?void 0:c.status)?c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes('class="already_in_library"')?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1):(a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1):(a.error(o+`:${r}(${l})`),!1)}if("subid"!==i)return!1;{const u={};for(const h of n.split(",")){var s=j({type:"addingFreeLicenseSubid",text:h});if(!await As(this,ci,ji).call(this,h,s))return!1;u[h]=s}const d=await As(this,ri,Ei).call(this);if(!d)return!1;for(const p of n.split(","))d.includes(p)?u[p].success():u[p].error();return!0}}catch(t){return F(t,"Steam.addLicense"),!1}}async function ji(t,e){try{var{result:s,statusText:i,status:n,data:a}=await L({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:Os(this,Ws).storeSessionID,subid:t}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)||(e.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return e.error(),F(t,"Steam.addFreeLicense"),!1}}async function Wi(t){try{const o=j({type:"requestingPlayTestAccess",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+t},data:$.param({sessionid:Os(this,Ws).storeSessionID}),dataType:"json"});return"Success"===s?200===(null==a?void 0:a.status)&&1===(null==a||null===(e=a.response)||void 0===e?void 0:e.success)?(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 F(t,"Steam.requestPlayTestAccess"),!1}}function Di(t,e,s){try{Os(this,js)[t][e]=s,GM_setValue("steamCache",Os(this,js))}catch(t){F(t,"Steam.setCache")}}const Vi=class extends g{constructor(){var t;super(...arguments),Ls(this,di),Ls(this,ui),Ls(this,ci),Ls(this,li),Ls(this,ri),Ls(this,oi),Ls(this,ai),Ls(this,ni),Ls(this,ii),Ls(this,si),Ls(this,ei),Ls(this,ti),Ls(this,Qs),Ls(this,Zs),Ls(this,Xs),Ls(this,Hs),Ls(this,Js),Ls(this,qs),Ls(this,Ys),Ls(this,Bs),Ls(this,Rs),Ls(this,zs),Ls(this,Ks),Ls(this,Us),Ls(this,Ns),Ls(this,Fs),Cs(this,"tasks",JSON.parse(Ps)),Cs(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.steam)||JSON.parse(Ps)),_s(this,js,{writable:!0,value:GM_getValue("steamCache")||{group:{},forum:{},workshop:{},curator:{}}}),_s(this,Ws,{writable:!0,value:{}}),_s(this,Ds,{writable:!0,value:!1}),_s(this,Vs,{writable:!0,value:!1}),_s(this,Ms,{writable:!0,value:"CN"})}async init(){var t=0{return null===(t=t.match(/groups\/(.+)\/?/))||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]}),k=this.getRealParams("curatorLikes",c,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&&W.doTask.steam.playtests&&0("CN"!==Os(this,Ms)&&(j({}).warning(M("steamFinishNotice")),await As(this,Ks,wi).call(this,"CN")),!0))}catch(t){return F(t,"Steam.toggle"),!1}}};function Mi(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 Fi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ni(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Ui=new WeakSet;async function Ki(e,t){try{return{name:e,result:await t}}catch(t){return F(t,"Website.bind"),{name:e,result:!1}}}var zi=class{constructor(){Mi(this,Ui),Fi(this,"undoneTasks",void 0),Fi(this,"socialTasks",void 0),Fi(this,"giveawayId",void 0),Fi(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1}),Fi(this,"initialized",!1),Fi(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 H,i.push(Ni(this,Ui,Ki).call(this,"discord",this.social.discord.init())))),n.instagram&&(!(0[...t,...e]).length)||this.socialInitialized.instagram&&this.social.instagram||(this.social.instagram=new mt,i.push(Ni(this,Ui,Ki).call(this,"instagram",this.social.instagram.init())))),n.reddit&&(!(0[...t,...e]).length)||this.socialInitialized.reddit&&this.social.reddit||(this.social.reddit=new Et,i.push(Ni(this,Ui,Ki).call(this,"reddit",this.social.reddit.init())))),n.twitch&&(!(0[...t,...e]).length)||this.socialInitialized.twitch&&this.social.twitch||(this.social.twitch=new se,i.push(Ni(this,Ui,Ki).call(this,"twitch",this.social.twitch.init())))),n.twitter&&(!(0[...t,...e]).length)||this.socialInitialized.twitter&&this.social.twitter||(this.social.twitter=new Le,i.push(Ni(this,Ui,Ki).call(this,"twitter",this.social.twitter.init())))),n.vk&&(!(0[...t,...e]).length)||this.socialInitialized.vk&&this.social.vk||(this.social.vk=new es,i.push(Ni(this,Ui,Ki).call(this,"vk",this.social.vk.init())))),n.youtube&&(!(0[...t,...e]).length)||this.socialInitialized.youtube&&this.social.youtube||(this.social.youtube=new ys,i.push(Ni(this,Ui,Ki).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 Vi),0{var e,s;return["groupLinks","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(Ni(this,Ui,Ki).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 F(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]=_(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(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),j({}).success(M("allTasksComplete")),!0}catch(t){return F(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return F(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return F(t,"Website.undoTask"),!1}}};function Ri(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 Bi(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}const qi=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}});var Ji=new WeakSet,Hi=new WeakSet;function Xi(){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):(j({}).error(M("getFailed","GiveawayId")),!1)}catch(t){F(t,"FreeAnyWhere.getGiveawayId")}}async function Zi(t){try{const o=j({html:`
  • ${M("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 F(t,"Freeanywhere.verify"),!1}}var Qi=class extends zi{constructor(){super(...arguments),Ri(this,Hi),Ri(this,Ji),Bi(this,"name","FreeAnyWhere"),Bi(this,"tasks",[]),Bi(this,"socialTasks",JSON.parse(qi)),Bi(this,"undoneTasks",JSON.parse(qi)),Bi(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=j({text:M("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(M("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(M("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(M("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Yi(this,Ji,Xi).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return F(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=j({text:M("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||JSON.parse(qi));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:j({}).warning(M("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),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})`),console.error(a),!1}catch(t){return F(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(Yi(this,Hi,Zi).call(this,e)),await P(1e3);return await Promise.all(t),j({}).success(M("allTasksComplete")),!!await this.getKey(!0)}catch(t){return F(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=j({text:M("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(),j({}).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 F(t,"FreeAnyWhere.getGiveawayId"),!1}}};function tn(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 en(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function sn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const nn={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var an=new WeakSet,on=new WeakSet,rn=new WeakSet;class ln extends zi{constructor(){super(...arguments),tn(this,rn),tn(this,on),tn(this,an),en(this,"name","GiveawaySu"),en(this,"socialTasks",nn),en(this,"undoneTasks",nn),en(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{sn(this,an,cn).call(this)||j({}).warning(M("checkLoginFailed")),await sn(this,on,un).call(this)||j({}).warning(M("checkLeftKeyFailed")),j({}).warning(M("gsNotice"))}catch(t){F(t,"Giveawaysu.after")}}init(){try{const t=j({text:M("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(M("needLogin")),!1):!!sn(this,rn,dn).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return F(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=j({text:M("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||nn,!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=>(F(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(t,"Giveawaysu.classifyTask"),!1}}}function cn(){try{return W.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return F(t,"Giveawaysu.checkLogin"),!1}}async function un(){try{return W.other.checkLeftKey?(0<$(".giveaway-ended").length&&0===$(".giveaway-key").length&&await p().fire({icon:"warning",title:M("notice"),text:M("noKeysLeft"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Giveawaysu.checkLeftKey"),!1}}function dn(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(j({text:M("getFailed","GiveawayId")}),!1)}function hn(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 pn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function fn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var wn=new WeakSet,gn=new WeakSet,mn=new WeakSet,vn=new WeakSet;async function kn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return j({}).error(M("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=j({text:M("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:(j({}).warning(M("needJoinGiveaway")),!1)}catch(t){return F(t,"Indiedb.init"),!1}}async function yn(){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 j({}).error(M("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=j({text:`${M("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){console.log({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){console.log(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){console.log({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){console.log(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 F(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){console.log({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){console.log(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:"+M("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){console.log({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){console.log(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),j({}).success(M("allTasksComplete")),!0}}catch(t){return F(t,"Indiedb.classifyTask"),!1}}function bn(){try{return W.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return F(t,"Indiedb.checkLogin"),!1}}async function Tn(){try{return W.other.checkLeftKey?(0<$('a.buttonenter:contains("next time"),a.buttonenter:contains("Giveaway is closed")').length&&await p().fire({icon:"warning",title:M("notice"),text:M("giveawayEnded"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Indiedb.checkLeftKey"),!1}}var $n=class{constructor(){hn(this,vn),hn(this,mn),hn(this,gn),hn(this,wn),pn(this,"name","Indiedb"),pn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{fn(this,mn,bn).call(this)||j({}).warning(M("checkLoginFailed")),await fn(this,vn,Tn).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){F(t,"Indiedb.after")}}async doTask(){try{return await fn(this,wn,kn).call(this)?await fn(this,gn,yn).call(this):!1}catch(t){return F(t,"Indiedb.doTask"),!1}}};function xn(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 Sn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ln(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const _n=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]});var In=new WeakSet,Cn=new WeakSet,An=new WeakSet;function Gn(){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):(j({}).error(M("getFailed","GiveawayId")),!1)}catch(t){return F(t,"Keyhub.getGiveawayId"),!1}}async function On(){try{return W.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:M("notice"),text:M("noKeysLeft"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Keyhub.checkLeftKey"),!1}}function En(){try{return W.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return F(t,"Keyhub.checkLogin"),!1}}var Pn=class extends zi{constructor(){super(...arguments),xn(this,An),xn(this,Cn),xn(this,In),Sn(this,"name","Keyhub"),Sn(this,"socialTasks",JSON.parse(_n)),Sn(this,"undoneTasks",JSON.parse(_n)),Sn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{Ln(this,An,En).call(this)||j({}).warning(M("checkLoginFailed")),await Ln(this,Cn,On).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){F(t,"Keyhub.after")}}init(){try{const t=j({text:M("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(M("needLogin")),!1):!!Ln(this,In,Gn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return F(t,"Keyhub.init"),!1}}async classifyTask(e){try{const i=j({text:M("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||JSON.parse(_n));for(const n of $(".task a")){let t=$(n).attr("href");var s=$(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"===e&&this.socialTasks.steam.groupLinks.push(t),"do"===e&&this.undoneTasks.steam.groupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(s)?("undo"===e&&this.socialTasks.steam.wishlistLinks.push(t),"do"===e&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===e&&this.socialTasks.steam.curatorLinks.push(t),"do"===e&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===e&&this.socialTasks.discord.serverLinks.push(t),"do"===e&&this.undoneTasks.discord.serverLinks.push(t)):/^https?:\/\/twitter\.com\/.*/.test(t)||/^https?:\/\/www\.twitch\.tv\/.*/.test(t)||j({}).warning(`${M("unKnownTaskType")}: ${s}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(t,"Keyhub.classifyTask"),!1}}verifyTask(){try{j({html:`
  • ${M("verifyingTask")}...
  • `}),$.get(window.location.href,t=>{VerifyTasks(t.match(/onclick="javascript:VerifyTasks\('(.*?)'\)"/)[1])})}catch(t){F(t,"keyhub.verifyTask")}}};function jn(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 Wn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Dn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Vn=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}});var Mn=new WeakSet,Fn=new WeakSet,Nn=new WeakSet;async function Un(t){try{const s=j({html:`
  • ${M("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(),j({}).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 F(t,"Givekey.verify"),!1}}function Kn(){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):(j({text:M("getFailed","GiveawayId")}),!1)}catch(t){return F(t,"Givekey.getGiveawayId"),!1}}async function zn(){try{return W.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:M("notice"),text:M("noKeysLeft"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Givekey.checkLeftKey"),!1}}var Rn=class extends zi{constructor(){super(...arguments),jn(this,Nn),jn(this,Fn),jn(this,Mn),Wn(this,"name","Givekey"),Wn(this,"tasks",[]),Wn(this,"socialTasks",JSON.parse(Vn)),Wn(this,"undoneTasks",JSON.parse(Vn)),Wn(this,"userId",void 0),Wn(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 Dn(this,Nn,zn).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){return F(t,"Givekey.after"),!1}}init(){try{const e=j({text:M("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(M("needLogin")),!1;if(!Dn(this,Fn,Kn).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(M("getFailed",M("userId"))),!1)}catch(t){return F(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=j({text:M("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||JSON.parse(Vn));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)):j({}).warning(`${M("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=_(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(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;j({}).warning(M("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${M("giveKeyNoticeAfter")}`}),!0}catch(t){return F(t,"Givekey.verifyTask"),!1}}};function Bn(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 Yn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function qn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Jn=new WeakSet,Hn=new WeakSet,Xn=new WeakSet;function Zn(){try{return W.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return F(t,"GiveeClub.checkLogin"),!1}}function Qn(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(j({text:M("getFailed","GiveawayId")}),!1)}async function ta(){try{return W.other.checkLeftKey?(0<$(".event-ended").length&&0===$(".event-winner").length&&await p().fire({icon:"warning",title:M("notice"),text:M("giveawayEnded"),confirmButtonText:M("confirm"),cancelButtonText:M("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return F(t,"Giveawaysu.checkLeftKey"),!1}}var ea=class extends ln{constructor(){super(...arguments),Bn(this,Xn),Bn(this,Hn),Bn(this,Jn),Yn(this,"name","GiveeClub"),Yn(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{qn(this,Jn,Zn).call(this)||j({}).warning(M("checkLoginFailed")),await qn(this,Xn,ta).call(this)||j({}).warning(M("checkLeftKeyFailed"))}catch(t){F(t,"GiveeClub.after")}}init(){try{const t=j({text:M("initing")});return qn(this,Jn,Zn).call(this)?!!qn(this,Hn,Qn).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(M("needLogin")),!1)}catch(t){return F(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=j({text:M("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||nn,!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=>(F(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return F(t,"GiveeClub.classifyTask"),!1}}};function sa(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 ia(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function na(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const aa={maxPoint:"99999999"};var oa=new WeakSet,ra=new WeakSet;async function la(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)j({}).warning(M("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=j({text:`${M("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 j({}).warning(M("getNeedPointsFailed")+": "+c)}j({text:"-----END-----"})}catch(t){F(t,"OpiumPulses.toggleTask")}}function ca(){try{return W.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return F(t,"OpiumPulses.checkLogin"),!1}}var t=class{constructor(){sa(this,ra),sa(this,oa),ia(this,"name","OpiumPulses"),ia(this,"options",{...aa,...GM_getValue("OpiumPulsesOptions")}),ia(this,"maxPoints",99999999),ia(this,"myPoints",0),ia(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{na(this,ra,ca).call(this)||j({}).warning(M("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){F(t,"OpiumPulses.after")}}async doFreeTask(){try{na(this,oa,la).call(this,"FREE")}catch(t){F(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),na(this,oa,la).call(this,"points")}catch(t){F(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}},ua=_o(698),da=_o.n(ua);const ha={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 F(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 F(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 F(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(/