diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 82fdf3a..f3a3ae2 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -21,9 +21,9 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: false - tag_name: v4.2.32 - name: 4.2.32 - body: '- 优化:Opquests验证任务流程' + tag_name: v4.2.33 + name: 4.2.33 + body: '- 修复:Opquests验证任务报错' files: |- dist/auto-task-v4-for-giveawaysu.user.js dist/auto-task-v4.compatibility.user.js diff --git a/dist/auto-task-v4-for-giveawaysu.all.user.js b/dist/auto-task-v4-for-giveawaysu.all.user.js index 2b0361d..395fafd 100644 --- a/dist/auto-task-v4-for-giveawaysu.all.user.js +++ b/dist/auto-task-v4-for-giveawaysu.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.2.32 +// @version 4.2.33 // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -104,4 +104,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+error.stack)}async function httpRequest_httpRequest(options){var times=1{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest_httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError_throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}}const tools_httpRequest=httpRequest_httpRequest;function delay(){let time=0{setTimeout(()=>{resolve(!0)},time)})}const scripts_echoLog=_ref=>{let{type,text,html,id}=_ref;const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{var _ele$;let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ - ${null===text||void 0===text?void 0:text.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),null!==(_ele$=ele[0])&&void 0!==_ele$&&_ele$.scrollIntoView(),{font:ele.find("font"),success(){var _this$font,_this$font3,text=0{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(data=>{data=data.data;return null!=data&&data.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null})}catch(error){return throwError_throwError(error,"getRedirectLink"),null}};const defaultGlobalOptions={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,officialGroups:!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,officialGroups:!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,debug:!1,receivePreview:!0}};for_giveawaysu=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,for_giveawaysu);const languages={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凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%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:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",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:"远程数据格式错误",updateHistory:'历史更新记录点此查看',groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",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:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",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",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",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时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",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",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",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",updateHistory:'Click here to view the historical update record.',groups:"Group",officialGroups:"Official 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",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official 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",gettingCuratorId:"Getting Steam Curator Id",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",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",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",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",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",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",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!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",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..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=function(key){for(var _languages$language,_len=arguments.length,argvs=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)argvs[_key-1]=arguments[_key];return null!==(_languages$language=languages[language])&&void 0!==_languages$language&&_languages$language[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key};for_giveawaysu=class{constructor(){var obj,key,value;value=void 0,(key="tasks")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=null===(auth=GM_getValue("discordAuth"))||void 0===auth?void 0:auth.auth;auth?(_classPrivateFieldSet(this,_auth,{auth:auth}),logStatus.success(),resolve(await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this))):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async function _joinServer2(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var _data$response,_data$response$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:_classPrivateFieldGet(this,_auth).auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(null===(_data$response=data.response)||void 0===_data$response||null===(_data$response$guild=_data$response.guild)||void 0===_data$response$guild?void 0:_data$response$guild.id);return guild&&(_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async function _leaveServer2(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await _classPrivateMethodGet(this,_getGuild,_getGuild2).call(this,inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:_classPrivateFieldGet(this,_auth).auth}});return"Success"===result&&204===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async function _getGuild2(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=_classPrivateFieldGet(this,_cache)[inviteId];if(guild)return logStatus.success(),guild;var _data$response2,_data$response2$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=null===(_data$response2=data.response)||void 0===_data$response2||null===(_data$response2$guild=_data$response2.guild)||void 0===_data$response2$guild?void 0:_data$response2$guild.id;return guild?(logStatus.success(),_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}function _setCache2(inviteId,guild){try{_classPrivateFieldGet(this,_cache)[inviteId]=guild,GM_setValue("discordCache",_classPrivateFieldGet(this,_cache))}catch(error){throwError_throwError(error,"Discord.setCache")}}const social_Discord=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),_classPrivateMethodInitSpec(this,_setCache),_classPrivateMethodInitSpec(this,_getGuild),_classPrivateMethodInitSpec(this,_leaveServer),_classPrivateMethodInitSpec(this,_joinServer),_classPrivateMethodInitSpec(this,_updateAuth),_classPrivateMethodInitSpec(this,_verifyAuth),Discord_defineProperty(this,"tasks",JSON.parse(defaultTasks)),Discord_defineProperty(this,"whiteList",{...JSON.parse(defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.discord}),_classPrivateFieldInitSpec(this,_auth,{writable:!0,value:GM_getValue("discordAuth")||{}}),_classPrivateFieldInitSpec(this,_cache,{writable:!0,value:GM_getValue("discordCache")||{}}),_classPrivateFieldInitSpec(this,_initialized,{writable:!0,value:!1})}async init(){try{if(!GM_getValue("dontRemindDiscordAgain"))if(!await external_Swal_default().fire({title:i18n("discordImportantNotice"),text:i18n("discordImportantNoticeText"),showCancelButton:!0,showDenyButton:!0,confirmButtonText:i18n("continue"),cancelButtonText:i18n("skipDiscordTask"),denyButtonText:i18n("continueAndDontRemindAgain")}).then(isDenied=>{var{isConfirmed,isDenied}=isDenied;return!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)}))return _classPrivateFieldSet(this,_initialized,!1),"skip";return globalOptions.doTask.discord.servers||globalOptions.undoTask.discord.servers?!!_classPrivateFieldGet(this,_initialized)||(_classPrivateFieldGet(this,_auth).auth?await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(GM_setValue("discordAuth",{auth:null}),await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)&&(_classPrivateFieldSet(this,_initialized,!0),!0)):(_classPrivateFieldSet(this,_initialized,!1),"skip")}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async toggle(serverLinks){var{doTask=!0,serverLinks=[]}=serverLinks;try{if(!_classPrivateFieldGet(this,_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/invite\/(.+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}};function Instagram_classPrivateMethodInitSpec(obj,privateSet){Instagram_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Instagram_classPrivateFieldInitSpec(obj,privateMap,value){Instagram_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Instagram_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Instagram_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Instagram_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Instagram_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Instagram_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Instagram_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Instagram_defaultTasks=JSON.stringify({users:[]});var Instagram_cache=new WeakMap,Instagram_auth=new WeakMap,Instagram_initialized=new WeakMap,_getUserInfo=new WeakSet,_followUser=new WeakSet,_unfollowUser=new WeakSet,Instagram_setCache=new WeakSet;async function _getUserInfo2(){var name=0{return null===(_link$match=_link$match.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}};function Reddit_classPrivateMethodInitSpec(obj,privateSet){Reddit_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Reddit_classPrivateFieldInitSpec(obj,privateMap,value){Reddit_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Reddit_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Reddit_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Reddit_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Reddit_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Reddit_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Reddit_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Reddit_defaultTasks=JSON.stringify({reddits:[]});var Reddit_auth=new WeakMap,Reddit_initialized=new WeakMap,_useBeta=new WeakSet,Reddit_updateAuth=new WeakSet;async function _useBeta2(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await Reddit_classPrivateMethodGet(this,Reddit_updateAuth,Reddit_updateAuth2).call(this,!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async function Reddit_updateAuth2(){var _data$responseText$ma,beta=0{var name=null===(name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===name?void 0:name[1],userName=null===(userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===userName?void 0:userName[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};function Twitch_classPrivateMethodInitSpec(obj,privateSet){Twitch_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Twitch_classPrivateFieldInitSpec(obj,privateMap,value){Twitch_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Twitch_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Twitch_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Twitch_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Twitch_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Twitch_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Twitch_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Twitch_defaultTasks=JSON.stringify({channels:[]});var Twitch_auth=new WeakMap,Twitch_cache=new WeakMap,Twitch_initialized=new WeakMap,_integrityToken=new WeakMap,Twitch_verifyAuth=new WeakSet,_integrity=new WeakSet,Twitch_updateAuth=new WeakSet,_toggleChannel=new WeakSet,_getChannelId=new WeakSet,Twitch_setCache=new WeakSet;async function Twitch_verifyAuth2(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var _data$response,_data$response$,_data$response$$data,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response=data.response)&&void 0!==_data$response&&null!==(_data$response$=_data$response[0])&&void 0!==_data$response$&&null!==(_data$response$$data=_data$response$.data)&&void 0!==_data$response$$data&&_data$response$$data.currentUser?(await Twitch_classPrivateMethodGet(this,_integrity,_integrity2).call(this,isFirst),logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async function _integrity2(){var isFirst=!(0{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(Twitch_classPrivateFieldSet(this,Twitch_auth,auth),logStatus.success(),resolve(await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async function _toggleChannel2(doTask){var{name,doTask=!0}=doTask;try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await Twitch_classPrivateMethodGet(this,_getChannelId,_getChannelId2).call(this,name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var _data$response3,_data$response4,_data$response4$0$err,_data$response4$0$err2,followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId,"Client-Version":Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion,"X-Device-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId,"Client-Session-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId,"Client-Integrity":Twitch_classPrivateFieldGet(this,_integrityToken)},data:doTask?followData:unfollowData});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response3=data.response)&&void 0!==_data$response3&&_data$response3[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+((null==data||null===(_data$response4=data.response)||void 0===_data$response4||null===(_data$response4$0$err=_data$response4[0].errors)||void 0===_data$response4$0$err||null===(_data$response4$0$err2=_data$response4$0$err[0])||void 0===_data$response4$0$err2?void 0:_data$response4$0$err2.message)||`${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async function _getChannelId2(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=Twitch_classPrivateFieldGet(this,Twitch_cache)[name];if(channelId)return logStatus.success(),channelId;var _data$response5,_data$response5$,_data$response5$$data,_data$response5$$data2,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const channelId=null===(_data$response5=data.response)||void 0===_data$response5||null===(_data$response5$=_data$response5[0])||void 0===_data$response5$||null===(_data$response5$$data=_data$response5$.data)||void 0===_data$response5$$data||null===(_data$response5$$data2=_data$response5$$data.user)||void 0===_data$response5$$data2?void 0:_data$response5$$data2.id;return channelId?(Twitch_classPrivateMethodGet(this,Twitch_setCache,Twitch_setCache2).call(this,name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}function Twitch_setCache2(name,id){try{Twitch_classPrivateFieldGet(this,Twitch_cache)[name]=id,GM_setValue("twitchCache",Twitch_classPrivateFieldGet(this,Twitch_cache))}catch(error){throwError_throwError(error,"Twitch.setCache")}}const social_Twitch=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Twitch_classPrivateMethodInitSpec(this,Twitch_setCache),Twitch_classPrivateMethodInitSpec(this,_getChannelId),Twitch_classPrivateMethodInitSpec(this,_toggleChannel),Twitch_classPrivateMethodInitSpec(this,Twitch_updateAuth),Twitch_classPrivateMethodInitSpec(this,_integrity),Twitch_classPrivateMethodInitSpec(this,Twitch_verifyAuth),Twitch_defineProperty(this,"tasks",JSON.parse(Twitch_defaultTasks)),Twitch_defineProperty(this,"whiteList",{...JSON.parse(Twitch_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.twitch}),Twitch_classPrivateFieldInitSpec(this,Twitch_auth,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_cache,{writable:!0,value:GM_getValue("twitchCache")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_initialized,{writable:!0,value:!1}),Twitch_classPrivateFieldInitSpec(this,_integrityToken,{writable:!0,value:void 0})}async init(){try{return Twitch_classPrivateFieldGet(this,Twitch_initialized)?!0:Twitch_classPrivateFieldGet(this,Twitch_auth).authToken&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion&&Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId?await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(GM_setValue("twitchAuth",null),await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)&&(Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async toggle(channelLinks){var{doTask=!0,channelLinks=[]}=channelLinks;try{if(!Twitch_classPrivateFieldGet(this,Twitch_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===_link$match?void 0:_link$match[2]});if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}};function Vk_classPrivateMethodInitSpec(obj,privateSet){Vk_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Vk_classPrivateFieldInitSpec(obj,privateMap,value){Vk_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Vk_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vk_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Vk_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Vk_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Vk_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Vk_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Vk_defaultTasks=JSON.stringify({names:[]});var _username=new WeakMap,Vk_cache=new WeakMap,Vk_initialized=new WeakMap,Vk_verifyAuth=new WeakSet,_toggleGroup=new WeakSet,_togglePublic=new WeakSet,_sendWall=new WeakSet,_deleteWall=new WeakSet,_getId=new WeakSet,_toggleVk=new WeakSet,Vk_setCache=new WeakSet;async function Vk_verifyAuth2(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});var _data$responseText$ma;return"Success"===result?null!==data&&void 0!==data&&data.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===(null===data||void 0===data?void 0:data.status)?(Vk_classPrivateFieldSet(this,_username,(null===(_data$responseText$ma=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1])||""),logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async function _toggleGroup2(name,dataParam){var doTask=!(2{return null===(_link$match=_link$match.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}};function Youtube_classPrivateMethodInitSpec(obj,privateSet){Youtube_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Youtube_classPrivateFieldInitSpec(obj,privateMap,value){Youtube_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Youtube_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Youtube_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Youtube_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Youtube_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Youtube_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Youtube_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Youtube_defaultTasks=JSON.stringify({channels:[],likes:[]}),getInfo=async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};{var _data$responseText$ma,_ref;if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=null===(_data$responseText$ma=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1],context=(null===(_ref=data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===_ref?void 0:_ref[1])||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var _data$responseText$ma2,channelId=null===(_data$responseText$ma2=data.responseText.match(//))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var _data$responseText$ma3,_data$responseText$ma4,videoId=null===(_data$responseText$ma3=data.responseText.match(//))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],likeParams=null===(_data$responseText$ma4=data.responseText.match(/"likeParams":"(.*?)"/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}};var Youtube_auth=new WeakMap,Youtube_initialized=new WeakMap,_verifyChannel=new WeakMap,Youtube_verifyAuth=new WeakSet,Youtube_updateAuth=new WeakSet,_getInfo=new WeakSet,Youtube_toggleChannel=new WeakSet,_toggleLikeVideo=new WeakSet;class Youtube extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Youtube_classPrivateMethodInitSpec(this,_toggleLikeVideo),Youtube_classPrivateMethodInitSpec(this,Youtube_toggleChannel),Youtube_classPrivateMethodInitSpec(this,_getInfo),Youtube_classPrivateMethodInitSpec(this,Youtube_updateAuth),Youtube_classPrivateMethodInitSpec(this,Youtube_verifyAuth),Youtube_defineProperty(this,"tasks",JSON.parse(Youtube_defaultTasks)),Youtube_defineProperty(this,"whiteList",{...JSON.parse(Youtube_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.youtube}),Youtube_classPrivateFieldInitSpec(this,Youtube_auth,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Youtube_classPrivateFieldInitSpec(this,Youtube_initialized,{writable:!0,value:!1}),Youtube_classPrivateFieldInitSpec(this,_verifyChannel,{writable:!0,value:"https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel})}async init(){try{return Youtube_classPrivateFieldGet(this,Youtube_initialized)?!0:Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID?await Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(GM_setValue("youtubeAuth",null),await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)&&(Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async toggle(videoLinks){var{doTask=!0,channelLinks=[],videoLinks=[]}=videoLinks;try{if(!Youtube_classPrivateFieldGet(this,Youtube_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>{var _link$match;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match?void 0:_link$match[1]:link});if(0{var _link$match2;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match2=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match2?void 0:_link$match2[1]:link});if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}async function Youtube_verifyAuth2(){try{return await Youtube_classPrivateMethodGet(this,Youtube_toggleChannel,Youtube_toggleChannel2).call(this,{link:Youtube_classPrivateFieldGet(this,_verifyChannel),doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async function Youtube_updateAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("youtubeAuth");auth?(Youtube_classPrivateFieldSet(this,Youtube_auth,auth),logStatus.success(),Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this).then(result=>{resolve(result)})):(logStatus.error("Error: Update youtube auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}function _getInfo2(link,type){return getInfo(link,type)}async function Youtube_toggleChannel2(verify){var{link,doTask=!0,verify=!1}=verify;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==client?void 0:client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:null==request?void 0:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&(/"subscribed": true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed": false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async function _toggleLikeVideo2(doTask){var{link,doTask=!0}=doTask;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}function Steam_classPrivateMethodInitSpec(obj,privateSet){Steam_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Steam_classPrivateFieldInitSpec(obj,privateMap,value){Steam_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Steam_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Steam_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Steam_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Steam_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Steam_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Steam_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Steam_defaultTasks=JSON.stringify({groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var Steam_cache=new WeakMap,Steam_auth=new WeakMap,_storeInitialized=new WeakMap,_communityInitialized=new WeakMap,_area=new WeakMap,_areaStatus=new WeakMap,_refreshStoreToken=new WeakSet,_setStoreToken=new WeakSet,_updateStoreAuth=new WeakSet,_updateCommunityAuth=new WeakSet,_getAreaInfo=new WeakSet,_changeArea=new WeakSet,_joinGroup=new WeakSet,_leaveGroup=new WeakSet,_getGroupId=new WeakSet,_joinOfficialGroup=new WeakSet,_leaveOfficialGroup=new WeakSet,_getOfficialGroupId=new WeakSet,_addToWishlist=new WeakSet,_removeFromWishlist=new WeakSet,_toggleFollowGame=new WeakSet,_isFollowedGame=new WeakSet,_toggleForum=new WeakSet,_getForumId=new WeakSet,_toggleFavoriteWorkshop=new WeakSet,_getWorkshopAppId=new WeakSet,_voteUpWorkshop=new WeakSet,_toggleCurator=new WeakSet,_toggleCuratorLike=new WeakSet,_getAnnouncementParams=new WeakSet,_likeAnnouncement=new WeakSet,_appid2subid=new WeakSet,_getLicenses=new WeakSet,_addLicense=new WeakSet,_addFreeLicense=new WeakSet,_requestPlayTestAccess=new WeakSet,Steam_setCache=new WeakSet;async function _refreshStoreToken2(){try{const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n("steamStore"))}),formData=new FormData;formData.append("redir","https://store.steampowered.com/");var _data$response,{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/"},data:formData});return"Success"===result?null!=data&&null!==(_data$response=data.response)&&void 0!==_data$response&&_data$response.success?await Steam_classPrivateMethodGet(this,_setStoreToken,_setStoreToken2).call(this,data.response)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshStoreToken"),!1}}async function _setStoreToken2(param){try{const logStatus=scripts_echoLog({text:i18n("settingToken",i18n("steamStore"))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/login/settoken",method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/login"},data:formData});return"Success"===result?200===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async function _updateStoreAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma2;if(!data.responseText.includes("data-miniprofile="))return await Steam_classPrivateMethodGet(this,_refreshStoreToken,_refreshStoreToken2).call(this),logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1;var storeSessionID=null===(_data$responseText$ma2=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return storeSessionID?(Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async function _updateCommunityAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma3,_data$responseText$ma4,_data$responseText$ma5;if(data.responseText.includes('href="https://steamcommunity.com/login/home/'))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=null===(_data$responseText$ma3=data.responseText.match(/g_steamID = "(.+?)";/))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],communitySessionID=null===(_data$responseText$ma4=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1],userName=null===(_data$responseText$ma5=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===_data$responseText$ma5?void 0:_data$responseText$ma5[1];return(steam64Id&&(Steam_classPrivateFieldGet(this,Steam_auth).steam64Id=steam64Id),userName&&(Steam_classPrivateFieldGet(this,Steam_auth).userName=userName),communitySessionID)?(Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async function _getAreaInfo2(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};var _data$responseText$ma6,currentArea=null===(_data$responseText$ma6=data.responseText.match(//g)].map(search=>search[1]);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==Steam_classPrivateFieldGet(this,_areaStatus)&&(clearInterval(checker),resolve(!0))})}),Steam_classPrivateFieldGet(this,_area)===area||!area&&"CN"!==Steam_classPrivateFieldGet(this,_area))return!0;Steam_classPrivateFieldSet(this,_areaStatus,"waiting");let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this);if(!currentArea||!areas)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),!1;if("CN"!==currentArea)return Steam_classPrivateFieldSet(this,_areaStatus,"skip"),scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return Steam_classPrivateFieldSet(this,_areaStatus,"noAnotherArea"),scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID})});if("Success"!==result)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==(null==data?void 0:data.status)||"true"!==data.responseText)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),"CN";var currentArea=(await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this))["currentArea"];return currentArea===aimedArea?(Steam_classPrivateFieldSet(this,_areaStatus,"success"),logStatus.success(),currentArea):(Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error("Error: change country filed"),"CN")}catch(error){return Steam_classPrivateFieldSet(this,_areaStatus,"error"),throwError_throwError(error,"Steam.changeArea"),!1}}async function _joinGroup2(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async function _leaveGroup2(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getGroupId,_getGroupId2).call(this,groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async function _getGroupId2(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var _data$responseText$ma7,groupId=Steam_classPrivateFieldGet(this,Steam_cache).group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma7=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===_data$responseText$ma7?void 0:_data$responseText$ma7[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _joinOfficialGroup2(gameId){try{const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma8;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=null===(_data$responseText$ma8=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma8?void 0:_data$responseText$ma8[1];return groupId&&Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async function _leaveOfficialGroup2(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getOfficialGroupId,_getOfficialGroupId2).call(this,gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async function _getOfficialGroupId2(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var _data$responseText$ma9,groupId=Steam_classPrivateFieldGet(this,Steam_cache).officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma9=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma9?void 0:_data$responseText$ma9[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _addToWishlist2(gameId){try{var _data$response2;const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response2=data.response)||void 0===_data$response2?void 0:_data$response2.success))return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)?"CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_addToWishlist,_addToWishlist2).call(this,gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async function _removeFromWishlist2(gameId){try{var _data$response3;if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response3=data.response)||void 0===_data$response3?void 0:_data$response3.success))return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==(null===dataR||void 0===dataR?void 0:dataR.status))return logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1;if("CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this);return result&&"CN"!==result&&"skip"!==result?await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async function _toggleFollowGame2(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===(null==data?void 0:data.status)&&"true"===data.responseText)return logStatus.success(),!0;var followed=await Steam_classPrivateMethodGet(this,_isFollowedGame,_isFollowedGame2).call(this,gameId);return"CN"===Steam_classPrivateFieldGet(this,_area)&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async function _isFollowedGame2(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&("CN"===Steam_classPrivateFieldGet(this,_area)&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async function _toggleForum2(gameId){var doTask=!(1/))||void 0===_data$responseText$ma11?void 0:_data$responseText$ma11[1];return appId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async function _voteUpWorkshop2(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var _data$response6,{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?(200===(null==data?void 0:data.status)&&1===(null===(_data$response6=data.response)||void 0===_data$response6?void 0:_data$response6.success)?logStatus.success():logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async function _toggleCurator2(curatorId){var doTask=!(1{return null===(_link$match=_link$match.match(/groups\/(.+)\/?/))||void 0===_link$match?void 0:_link$match[1]});if(0{return null===(_link$match2=_link$match2.match(/games\/(.+)\/?/))||void 0===_link$match2?void 0:_link$match2[1]});if(0{return null===(_link$match3=_link$match3.match(/app\/([\d]+)/))||void 0===_link$match3?void 0:_link$match3[1]});if(0{return null===(_link$match4=_link$match4.match(/app\/([\d]+)/))||void 0===_link$match4?void 0:_link$match4[1]});if(0{return null===(_link$match5=_link$match5.match(/app\/([\d]+)/))||void 0===_link$match5?void 0:_link$match5[1]});if(0{return null===(_link$match6=_link$match6.match(/\?id=([\d]+)/))||void 0===_link$match6?void 0:_link$match6[1]});if(0{return null===(_link$match7=_link$match7.match(/\?id=([\d]+)/))||void 0===_link$match7?void 0:_link$match7[1]});if(doTask&&0{return null===(_link$match8=_link$match8.match(/curator\/([\d]+)/))||void 0===_link$match8?void 0:_link$match8[1]}),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,_link$match9=>{return null===(_link$match9=_link$match9.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===_link$match9?void 0:_link$match9.slice(1,3).join("/")});if(0{var _link$match10;return _link$match11.includes("store.steampowered.com")?null===(_link$match10=_link$match11.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===_link$match10?void 0:_link$match10.slice(1,3).join("/"):null===(_link$match11=_link$match11.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===_link$match11?void 0:_link$match11.slice(1,3).join("/")});if(doTask&&0{return null===(_link$match12=_link$match12.match(/app\/([\d]+)/))||void 0===_link$match12?void 0:_link$match12[1]});if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==Steam_classPrivateFieldGet(this,_area)&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this,"CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}};function Giveawaysu_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Giveawaysu_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Giveawaysu_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const Giveawaysu_defaultTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};var _classifyTask=new WeakSet,_checkLogin=new WeakSet,_checkLeftKey=new WeakSet,_getGiveawayId=new WeakSet,_bind=new WeakSet,_initSocial=new WeakSet,_uniqueTasks=new WeakSet,_toggleTask=new WeakSet;async function _classifyTask2(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#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 task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=Giveawaysu_classPrivateMethodGet(this,_uniqueTasks,_uniqueTasks2).call(this,this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}function _checkLogin2(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async function _checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}function _getGiveawayId2(){var giveawayId=null===(giveawayId=window.location.href.match(/\/view\/([\d]+)/))||void 0===giveawayId?void 0:giveawayId[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async function _bind2(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async function _initSocial2(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"discord",this.social.discord.init()))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0{var _tasks$steam,_tasks$steam$type;return["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&(null===(_tasks$steam=tasks.steam)||void 0===_tasks$steam||null===(_tasks$steam$type=_tasks$steam[type])||void 0===_tasks$steam$type?void 0:_tasks$steam$type.length)||0}).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}function _uniqueTasks2(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async function _toggleTask2(){try{if(!this.initialized&&!this.init())return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_classifyTask,_classifyTask2).call(this))return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_initSocial,_initSocial2).call(this))return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}const Giveawaysu=class{constructor(){Giveawaysu_classPrivateMethodInitSpec(this,_toggleTask),Giveawaysu_classPrivateMethodInitSpec(this,_uniqueTasks),Giveawaysu_classPrivateMethodInitSpec(this,_initSocial),Giveawaysu_classPrivateMethodInitSpec(this,_bind),Giveawaysu_classPrivateMethodInitSpec(this,_getGiveawayId),Giveawaysu_classPrivateMethodInitSpec(this,_checkLeftKey),Giveawaysu_classPrivateMethodInitSpec(this,_checkLogin),Giveawaysu_classPrivateMethodInitSpec(this,_classifyTask),Giveawaysu_defineProperty(this,"undoneTasks",Giveawaysu_defaultTasks),Giveawaysu_defineProperty(this,"giveawayId",void 0),Giveawaysu_defineProperty(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0}),Giveawaysu_defineProperty(this,"initialized",!1),Giveawaysu_defineProperty(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Giveawaysu_classPrivateMethodGet(this,_checkLogin,_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await Giveawaysu_classPrivateMethodGet(this,_checkLeftKey,_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!Giveawaysu_classPrivateMethodGet(this,_getGiveawayId,_getGiveawayId2).call(this)&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await Giveawaysu_classPrivateMethodGet(this,_toggleTask,_toggleTask2).call(this)}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};var _LocalStorage$getItem2,for_giveawaysu=__webpack_require__(821);if(window.STYLE=GM_addStyle(for_giveawaysu.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;var discordAuth=null===LocalStorage||void 0===LocalStorage||null===(discordAuth=LocalStorage.getItem("token"))||void 0===discordAuth?void 0:discordAuth.replace(/^"|"$/g,"");discordAuth&&0{var _commonOptions,_commonOptions$header;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(_commonOptions=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:_commonOptions,clientId:null===(_commonOptions=commonOptions)||void 0===_commonOptions||null===(_commonOptions$header=_commonOptions.headers)||void 0===_commonOptions$header?void 0:_commonOptions$header["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${null===text||void 0===text?void 0:text.replace("u_","")}]...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),null!==(_ele$=ele[0])&&void 0!==_ele$&&_ele$.scrollIntoView(),{font:ele.find("font"),success(){var _this$font,_this$font3,text=0{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(data=>{data=data.data;return null!=data&&data.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null})}catch(error){return throwError_throwError(error,"getRedirectLink"),null}};const defaultGlobalOptions={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,officialGroups:!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,officialGroups:!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,debug:!1,receivePreview:!0}};for_giveawaysu=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,for_giveawaysu);const languages={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凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%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:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",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:"远程数据格式错误",updateHistory:'历史更新记录点此查看',groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",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:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",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",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",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时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",confirmingTask:"正在跳过警告页面..."},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",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",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",updateHistory:'Click here to view the historical update record.',groups:"Group",officialGroups:"Official 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",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official 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",gettingCuratorId:"Getting Steam Curator Id",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",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",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",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",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",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",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!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",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...",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=function(key){for(var _languages$language,_len=arguments.length,argvs=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)argvs[_key-1]=arguments[_key];return null!==(_languages$language=languages[language])&&void 0!==_languages$language&&_languages$language[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key};for_giveawaysu=class{constructor(){var obj,key,value;value=void 0,(key="tasks")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=null===(auth=GM_getValue("discordAuth"))||void 0===auth?void 0:auth.auth;auth?(_classPrivateFieldSet(this,_auth,{auth:auth}),logStatus.success(),resolve(await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this))):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async function _joinServer2(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var _data$response,_data$response$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:_classPrivateFieldGet(this,_auth).auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(null===(_data$response=data.response)||void 0===_data$response||null===(_data$response$guild=_data$response.guild)||void 0===_data$response$guild?void 0:_data$response$guild.id);return guild&&(_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async function _leaveServer2(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await _classPrivateMethodGet(this,_getGuild,_getGuild2).call(this,inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:_classPrivateFieldGet(this,_auth).auth}});return"Success"===result&&204===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async function _getGuild2(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=_classPrivateFieldGet(this,_cache)[inviteId];if(guild)return logStatus.success(),guild;var _data$response2,_data$response2$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=null===(_data$response2=data.response)||void 0===_data$response2||null===(_data$response2$guild=_data$response2.guild)||void 0===_data$response2$guild?void 0:_data$response2$guild.id;return guild?(logStatus.success(),_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}function _setCache2(inviteId,guild){try{_classPrivateFieldGet(this,_cache)[inviteId]=guild,GM_setValue("discordCache",_classPrivateFieldGet(this,_cache))}catch(error){throwError_throwError(error,"Discord.setCache")}}const social_Discord=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),_classPrivateMethodInitSpec(this,_setCache),_classPrivateMethodInitSpec(this,_getGuild),_classPrivateMethodInitSpec(this,_leaveServer),_classPrivateMethodInitSpec(this,_joinServer),_classPrivateMethodInitSpec(this,_updateAuth),_classPrivateMethodInitSpec(this,_verifyAuth),Discord_defineProperty(this,"tasks",JSON.parse(defaultTasks)),Discord_defineProperty(this,"whiteList",{...JSON.parse(defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.discord}),_classPrivateFieldInitSpec(this,_auth,{writable:!0,value:GM_getValue("discordAuth")||{}}),_classPrivateFieldInitSpec(this,_cache,{writable:!0,value:GM_getValue("discordCache")||{}}),_classPrivateFieldInitSpec(this,_initialized,{writable:!0,value:!1})}async init(){try{if(!GM_getValue("dontRemindDiscordAgain"))if(!await external_Swal_default().fire({title:i18n("discordImportantNotice"),text:i18n("discordImportantNoticeText"),showCancelButton:!0,showDenyButton:!0,confirmButtonText:i18n("continue"),cancelButtonText:i18n("skipDiscordTask"),denyButtonText:i18n("continueAndDontRemindAgain")}).then(isDenied=>{var{isConfirmed,isDenied}=isDenied;return!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)}))return _classPrivateFieldSet(this,_initialized,!1),"skip";return globalOptions.doTask.discord.servers||globalOptions.undoTask.discord.servers?!!_classPrivateFieldGet(this,_initialized)||(_classPrivateFieldGet(this,_auth).auth?await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(GM_setValue("discordAuth",{auth:null}),await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)&&(_classPrivateFieldSet(this,_initialized,!0),!0)):(_classPrivateFieldSet(this,_initialized,!1),"skip")}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async toggle(serverLinks){var{doTask=!0,serverLinks=[]}=serverLinks;try{if(!_classPrivateFieldGet(this,_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/invite\/(.+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}};function Instagram_classPrivateMethodInitSpec(obj,privateSet){Instagram_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Instagram_classPrivateFieldInitSpec(obj,privateMap,value){Instagram_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Instagram_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Instagram_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Instagram_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Instagram_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Instagram_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Instagram_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Instagram_defaultTasks=JSON.stringify({users:[]});var Instagram_cache=new WeakMap,Instagram_auth=new WeakMap,Instagram_initialized=new WeakMap,_getUserInfo=new WeakSet,_followUser=new WeakSet,_unfollowUser=new WeakSet,Instagram_setCache=new WeakSet;async function _getUserInfo2(){var name=0{return null===(_link$match=_link$match.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}};function Reddit_classPrivateMethodInitSpec(obj,privateSet){Reddit_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Reddit_classPrivateFieldInitSpec(obj,privateMap,value){Reddit_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Reddit_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Reddit_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Reddit_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Reddit_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Reddit_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Reddit_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Reddit_defaultTasks=JSON.stringify({reddits:[]});var Reddit_auth=new WeakMap,Reddit_initialized=new WeakMap,_useBeta=new WeakSet,Reddit_updateAuth=new WeakSet;async function _useBeta2(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await Reddit_classPrivateMethodGet(this,Reddit_updateAuth,Reddit_updateAuth2).call(this,!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async function Reddit_updateAuth2(){var _data$responseText$ma,beta=0{var name=null===(name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===name?void 0:name[1],userName=null===(userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===userName?void 0:userName[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};function Twitch_classPrivateMethodInitSpec(obj,privateSet){Twitch_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Twitch_classPrivateFieldInitSpec(obj,privateMap,value){Twitch_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Twitch_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Twitch_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Twitch_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Twitch_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Twitch_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Twitch_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Twitch_defaultTasks=JSON.stringify({channels:[]});var Twitch_auth=new WeakMap,Twitch_cache=new WeakMap,Twitch_initialized=new WeakMap,_integrityToken=new WeakMap,Twitch_verifyAuth=new WeakSet,_integrity=new WeakSet,Twitch_updateAuth=new WeakSet,_toggleChannel=new WeakSet,_getChannelId=new WeakSet,Twitch_setCache=new WeakSet;async function Twitch_verifyAuth2(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var _data$response,_data$response$,_data$response$$data,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response=data.response)&&void 0!==_data$response&&null!==(_data$response$=_data$response[0])&&void 0!==_data$response$&&null!==(_data$response$$data=_data$response$.data)&&void 0!==_data$response$$data&&_data$response$$data.currentUser?(await Twitch_classPrivateMethodGet(this,_integrity,_integrity2).call(this,isFirst),logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async function _integrity2(){var isFirst=!(0{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(Twitch_classPrivateFieldSet(this,Twitch_auth,auth),logStatus.success(),resolve(await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async function _toggleChannel2(doTask){var{name,doTask=!0}=doTask;try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await Twitch_classPrivateMethodGet(this,_getChannelId,_getChannelId2).call(this,name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var _data$response3,_data$response4,_data$response4$0$err,_data$response4$0$err2,followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId,"Client-Version":Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion,"X-Device-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId,"Client-Session-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId,"Client-Integrity":Twitch_classPrivateFieldGet(this,_integrityToken)},data:doTask?followData:unfollowData});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response3=data.response)&&void 0!==_data$response3&&_data$response3[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+((null==data||null===(_data$response4=data.response)||void 0===_data$response4||null===(_data$response4$0$err=_data$response4[0].errors)||void 0===_data$response4$0$err||null===(_data$response4$0$err2=_data$response4$0$err[0])||void 0===_data$response4$0$err2?void 0:_data$response4$0$err2.message)||`${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async function _getChannelId2(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=Twitch_classPrivateFieldGet(this,Twitch_cache)[name];if(channelId)return logStatus.success(),channelId;var _data$response5,_data$response5$,_data$response5$$data,_data$response5$$data2,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const channelId=null===(_data$response5=data.response)||void 0===_data$response5||null===(_data$response5$=_data$response5[0])||void 0===_data$response5$||null===(_data$response5$$data=_data$response5$.data)||void 0===_data$response5$$data||null===(_data$response5$$data2=_data$response5$$data.user)||void 0===_data$response5$$data2?void 0:_data$response5$$data2.id;return channelId?(Twitch_classPrivateMethodGet(this,Twitch_setCache,Twitch_setCache2).call(this,name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}function Twitch_setCache2(name,id){try{Twitch_classPrivateFieldGet(this,Twitch_cache)[name]=id,GM_setValue("twitchCache",Twitch_classPrivateFieldGet(this,Twitch_cache))}catch(error){throwError_throwError(error,"Twitch.setCache")}}const social_Twitch=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Twitch_classPrivateMethodInitSpec(this,Twitch_setCache),Twitch_classPrivateMethodInitSpec(this,_getChannelId),Twitch_classPrivateMethodInitSpec(this,_toggleChannel),Twitch_classPrivateMethodInitSpec(this,Twitch_updateAuth),Twitch_classPrivateMethodInitSpec(this,_integrity),Twitch_classPrivateMethodInitSpec(this,Twitch_verifyAuth),Twitch_defineProperty(this,"tasks",JSON.parse(Twitch_defaultTasks)),Twitch_defineProperty(this,"whiteList",{...JSON.parse(Twitch_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.twitch}),Twitch_classPrivateFieldInitSpec(this,Twitch_auth,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_cache,{writable:!0,value:GM_getValue("twitchCache")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_initialized,{writable:!0,value:!1}),Twitch_classPrivateFieldInitSpec(this,_integrityToken,{writable:!0,value:void 0})}async init(){try{return Twitch_classPrivateFieldGet(this,Twitch_initialized)?!0:Twitch_classPrivateFieldGet(this,Twitch_auth).authToken&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion&&Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId?await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(GM_setValue("twitchAuth",null),await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)&&(Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async toggle(channelLinks){var{doTask=!0,channelLinks=[]}=channelLinks;try{if(!Twitch_classPrivateFieldGet(this,Twitch_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===_link$match?void 0:_link$match[2]});if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}};function Vk_classPrivateMethodInitSpec(obj,privateSet){Vk_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Vk_classPrivateFieldInitSpec(obj,privateMap,value){Vk_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Vk_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vk_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Vk_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Vk_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Vk_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Vk_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Vk_defaultTasks=JSON.stringify({names:[]});var _username=new WeakMap,Vk_cache=new WeakMap,Vk_initialized=new WeakMap,Vk_verifyAuth=new WeakSet,_toggleGroup=new WeakSet,_togglePublic=new WeakSet,_sendWall=new WeakSet,_deleteWall=new WeakSet,_getId=new WeakSet,_toggleVk=new WeakSet,Vk_setCache=new WeakSet;async function Vk_verifyAuth2(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});var _data$responseText$ma;return"Success"===result?null!==data&&void 0!==data&&data.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===(null===data||void 0===data?void 0:data.status)?(Vk_classPrivateFieldSet(this,_username,(null===(_data$responseText$ma=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1])||""),logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async function _toggleGroup2(name,dataParam){var doTask=!(2{return null===(_link$match=_link$match.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}};function Youtube_classPrivateMethodInitSpec(obj,privateSet){Youtube_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Youtube_classPrivateFieldInitSpec(obj,privateMap,value){Youtube_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Youtube_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Youtube_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Youtube_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Youtube_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Youtube_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Youtube_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Youtube_defaultTasks=JSON.stringify({channels:[],likes:[]}),getInfo=async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};{var _data$responseText$ma,_ref;if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=null===(_data$responseText$ma=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1],context=(null===(_ref=data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===_ref?void 0:_ref[1])||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var _data$responseText$ma2,channelId=null===(_data$responseText$ma2=data.responseText.match(//))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var _data$responseText$ma3,_data$responseText$ma4,videoId=null===(_data$responseText$ma3=data.responseText.match(//))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],likeParams=null===(_data$responseText$ma4=data.responseText.match(/"likeParams":"(.*?)"/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}};var Youtube_auth=new WeakMap,Youtube_initialized=new WeakMap,_verifyChannel=new WeakMap,Youtube_verifyAuth=new WeakSet,Youtube_updateAuth=new WeakSet,_getInfo=new WeakSet,Youtube_toggleChannel=new WeakSet,_toggleLikeVideo=new WeakSet;class Youtube extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Youtube_classPrivateMethodInitSpec(this,_toggleLikeVideo),Youtube_classPrivateMethodInitSpec(this,Youtube_toggleChannel),Youtube_classPrivateMethodInitSpec(this,_getInfo),Youtube_classPrivateMethodInitSpec(this,Youtube_updateAuth),Youtube_classPrivateMethodInitSpec(this,Youtube_verifyAuth),Youtube_defineProperty(this,"tasks",JSON.parse(Youtube_defaultTasks)),Youtube_defineProperty(this,"whiteList",{...JSON.parse(Youtube_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.youtube}),Youtube_classPrivateFieldInitSpec(this,Youtube_auth,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Youtube_classPrivateFieldInitSpec(this,Youtube_initialized,{writable:!0,value:!1}),Youtube_classPrivateFieldInitSpec(this,_verifyChannel,{writable:!0,value:"https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel})}async init(){try{return Youtube_classPrivateFieldGet(this,Youtube_initialized)?!0:Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID?await Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(GM_setValue("youtubeAuth",null),await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)&&(Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async toggle(videoLinks){var{doTask=!0,channelLinks=[],videoLinks=[]}=videoLinks;try{if(!Youtube_classPrivateFieldGet(this,Youtube_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>{var _link$match;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match?void 0:_link$match[1]:link});if(0{var _link$match2;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match2=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match2?void 0:_link$match2[1]:link});if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}async function Youtube_verifyAuth2(){try{return await Youtube_classPrivateMethodGet(this,Youtube_toggleChannel,Youtube_toggleChannel2).call(this,{link:Youtube_classPrivateFieldGet(this,_verifyChannel),doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async function Youtube_updateAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("youtubeAuth");auth?(Youtube_classPrivateFieldSet(this,Youtube_auth,auth),logStatus.success(),Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this).then(result=>{resolve(result)})):(logStatus.error("Error: Update youtube auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}function _getInfo2(link,type){return getInfo(link,type)}async function Youtube_toggleChannel2(verify){var{link,doTask=!0,verify=!1}=verify;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==client?void 0:client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:null==request?void 0:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&(/"subscribed": true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed": false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async function _toggleLikeVideo2(doTask){var{link,doTask=!0}=doTask;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}function Steam_classPrivateMethodInitSpec(obj,privateSet){Steam_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Steam_classPrivateFieldInitSpec(obj,privateMap,value){Steam_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Steam_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Steam_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Steam_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Steam_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Steam_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Steam_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Steam_defaultTasks=JSON.stringify({groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var Steam_cache=new WeakMap,Steam_auth=new WeakMap,_storeInitialized=new WeakMap,_communityInitialized=new WeakMap,_area=new WeakMap,_areaStatus=new WeakMap,_refreshStoreToken=new WeakSet,_setStoreToken=new WeakSet,_updateStoreAuth=new WeakSet,_updateCommunityAuth=new WeakSet,_getAreaInfo=new WeakSet,_changeArea=new WeakSet,_joinGroup=new WeakSet,_leaveGroup=new WeakSet,_getGroupId=new WeakSet,_joinOfficialGroup=new WeakSet,_leaveOfficialGroup=new WeakSet,_getOfficialGroupId=new WeakSet,_addToWishlist=new WeakSet,_removeFromWishlist=new WeakSet,_toggleFollowGame=new WeakSet,_isFollowedGame=new WeakSet,_toggleForum=new WeakSet,_getForumId=new WeakSet,_toggleFavoriteWorkshop=new WeakSet,_getWorkshopAppId=new WeakSet,_voteUpWorkshop=new WeakSet,_toggleCurator=new WeakSet,_toggleCuratorLike=new WeakSet,_getAnnouncementParams=new WeakSet,_likeAnnouncement=new WeakSet,_appid2subid=new WeakSet,_getLicenses=new WeakSet,_addLicense=new WeakSet,_addFreeLicense=new WeakSet,_requestPlayTestAccess=new WeakSet,Steam_setCache=new WeakSet;async function _refreshStoreToken2(){try{const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n("steamStore"))}),formData=new FormData;formData.append("redir","https://store.steampowered.com/");var _data$response,{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/"},data:formData});return"Success"===result?null!=data&&null!==(_data$response=data.response)&&void 0!==_data$response&&_data$response.success?await Steam_classPrivateMethodGet(this,_setStoreToken,_setStoreToken2).call(this,data.response)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshStoreToken"),!1}}async function _setStoreToken2(param){try{const logStatus=scripts_echoLog({text:i18n("settingToken",i18n("steamStore"))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/login/settoken",method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/login"},data:formData});return"Success"===result?200===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async function _updateStoreAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma2;if(!data.responseText.includes("data-miniprofile="))return await Steam_classPrivateMethodGet(this,_refreshStoreToken,_refreshStoreToken2).call(this),logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1;var storeSessionID=null===(_data$responseText$ma2=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return storeSessionID?(Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async function _updateCommunityAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma3,_data$responseText$ma4,_data$responseText$ma5;if(data.responseText.includes('href="https://steamcommunity.com/login/home/'))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=null===(_data$responseText$ma3=data.responseText.match(/g_steamID = "(.+?)";/))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],communitySessionID=null===(_data$responseText$ma4=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1],userName=null===(_data$responseText$ma5=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===_data$responseText$ma5?void 0:_data$responseText$ma5[1];return(steam64Id&&(Steam_classPrivateFieldGet(this,Steam_auth).steam64Id=steam64Id),userName&&(Steam_classPrivateFieldGet(this,Steam_auth).userName=userName),communitySessionID)?(Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async function _getAreaInfo2(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};var _data$responseText$ma6,currentArea=null===(_data$responseText$ma6=data.responseText.match(//g)].map(search=>search[1]);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==Steam_classPrivateFieldGet(this,_areaStatus)&&(clearInterval(checker),resolve(!0))})}),Steam_classPrivateFieldGet(this,_area)===area||!area&&"CN"!==Steam_classPrivateFieldGet(this,_area))return!0;Steam_classPrivateFieldSet(this,_areaStatus,"waiting");let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this);if(!currentArea||!areas)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),!1;if("CN"!==currentArea)return Steam_classPrivateFieldSet(this,_areaStatus,"skip"),scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return Steam_classPrivateFieldSet(this,_areaStatus,"noAnotherArea"),scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID})});if("Success"!==result)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==(null==data?void 0:data.status)||"true"!==data.responseText)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),"CN";var currentArea=(await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this))["currentArea"];return currentArea===aimedArea?(Steam_classPrivateFieldSet(this,_areaStatus,"success"),logStatus.success(),currentArea):(Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error("Error: change country filed"),"CN")}catch(error){return Steam_classPrivateFieldSet(this,_areaStatus,"error"),throwError_throwError(error,"Steam.changeArea"),!1}}async function _joinGroup2(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async function _leaveGroup2(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getGroupId,_getGroupId2).call(this,groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async function _getGroupId2(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var _data$responseText$ma7,groupId=Steam_classPrivateFieldGet(this,Steam_cache).group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma7=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===_data$responseText$ma7?void 0:_data$responseText$ma7[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _joinOfficialGroup2(gameId){try{const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma8;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=null===(_data$responseText$ma8=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma8?void 0:_data$responseText$ma8[1];return groupId&&Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async function _leaveOfficialGroup2(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getOfficialGroupId,_getOfficialGroupId2).call(this,gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async function _getOfficialGroupId2(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var _data$responseText$ma9,groupId=Steam_classPrivateFieldGet(this,Steam_cache).officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma9=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma9?void 0:_data$responseText$ma9[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _addToWishlist2(gameId){try{var _data$response2;const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response2=data.response)||void 0===_data$response2?void 0:_data$response2.success))return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)?"CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_addToWishlist,_addToWishlist2).call(this,gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async function _removeFromWishlist2(gameId){try{var _data$response3;if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response3=data.response)||void 0===_data$response3?void 0:_data$response3.success))return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==(null===dataR||void 0===dataR?void 0:dataR.status))return logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1;if("CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this);return result&&"CN"!==result&&"skip"!==result?await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async function _toggleFollowGame2(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===(null==data?void 0:data.status)&&"true"===data.responseText)return logStatus.success(),!0;var followed=await Steam_classPrivateMethodGet(this,_isFollowedGame,_isFollowedGame2).call(this,gameId);return"CN"===Steam_classPrivateFieldGet(this,_area)&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async function _isFollowedGame2(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&("CN"===Steam_classPrivateFieldGet(this,_area)&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async function _toggleForum2(gameId){var doTask=!(1/))||void 0===_data$responseText$ma11?void 0:_data$responseText$ma11[1];return appId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async function _voteUpWorkshop2(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var _data$response6,{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?(200===(null==data?void 0:data.status)&&1===(null===(_data$response6=data.response)||void 0===_data$response6?void 0:_data$response6.success)?logStatus.success():logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async function _toggleCurator2(curatorId){var doTask=!(1{return null===(_link$match=_link$match.match(/groups\/(.+)\/?/))||void 0===_link$match?void 0:_link$match[1]});if(0{return null===(_link$match2=_link$match2.match(/games\/(.+)\/?/))||void 0===_link$match2?void 0:_link$match2[1]});if(0{return null===(_link$match3=_link$match3.match(/app\/([\d]+)/))||void 0===_link$match3?void 0:_link$match3[1]});if(0{return null===(_link$match4=_link$match4.match(/app\/([\d]+)/))||void 0===_link$match4?void 0:_link$match4[1]});if(0{return null===(_link$match5=_link$match5.match(/app\/([\d]+)/))||void 0===_link$match5?void 0:_link$match5[1]});if(0{return null===(_link$match6=_link$match6.match(/\?id=([\d]+)/))||void 0===_link$match6?void 0:_link$match6[1]});if(0{return null===(_link$match7=_link$match7.match(/\?id=([\d]+)/))||void 0===_link$match7?void 0:_link$match7[1]});if(doTask&&0{return null===(_link$match8=_link$match8.match(/curator\/([\d]+)/))||void 0===_link$match8?void 0:_link$match8[1]}),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,_link$match9=>{return null===(_link$match9=_link$match9.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===_link$match9?void 0:_link$match9.slice(1,3).join("/")});if(0{var _link$match10;return _link$match11.includes("store.steampowered.com")?null===(_link$match10=_link$match11.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===_link$match10?void 0:_link$match10.slice(1,3).join("/"):null===(_link$match11=_link$match11.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===_link$match11?void 0:_link$match11.slice(1,3).join("/")});if(doTask&&0{return null===(_link$match12=_link$match12.match(/app\/([\d]+)/))||void 0===_link$match12?void 0:_link$match12[1]});if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==Steam_classPrivateFieldGet(this,_area)&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this,"CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}};function Giveawaysu_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Giveawaysu_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Giveawaysu_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const Giveawaysu_defaultTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};var _classifyTask=new WeakSet,_checkLogin=new WeakSet,_checkLeftKey=new WeakSet,_getGiveawayId=new WeakSet,_bind=new WeakSet,_initSocial=new WeakSet,_uniqueTasks=new WeakSet,_toggleTask=new WeakSet;async function _classifyTask2(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#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 task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=Giveawaysu_classPrivateMethodGet(this,_uniqueTasks,_uniqueTasks2).call(this,this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}function _checkLogin2(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async function _checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}function _getGiveawayId2(){var giveawayId=null===(giveawayId=window.location.href.match(/\/view\/([\d]+)/))||void 0===giveawayId?void 0:giveawayId[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async function _bind2(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async function _initSocial2(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"discord",this.social.discord.init()))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0{var _tasks$steam,_tasks$steam$type;return["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&(null===(_tasks$steam=tasks.steam)||void 0===_tasks$steam||null===(_tasks$steam$type=_tasks$steam[type])||void 0===_tasks$steam$type?void 0:_tasks$steam$type.length)||0}).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}function _uniqueTasks2(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async function _toggleTask2(){try{if(!this.initialized&&!this.init())return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_classifyTask,_classifyTask2).call(this))return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_initSocial,_initSocial2).call(this))return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}const Giveawaysu=class{constructor(){Giveawaysu_classPrivateMethodInitSpec(this,_toggleTask),Giveawaysu_classPrivateMethodInitSpec(this,_uniqueTasks),Giveawaysu_classPrivateMethodInitSpec(this,_initSocial),Giveawaysu_classPrivateMethodInitSpec(this,_bind),Giveawaysu_classPrivateMethodInitSpec(this,_getGiveawayId),Giveawaysu_classPrivateMethodInitSpec(this,_checkLeftKey),Giveawaysu_classPrivateMethodInitSpec(this,_checkLogin),Giveawaysu_classPrivateMethodInitSpec(this,_classifyTask),Giveawaysu_defineProperty(this,"undoneTasks",Giveawaysu_defaultTasks),Giveawaysu_defineProperty(this,"giveawayId",void 0),Giveawaysu_defineProperty(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0}),Giveawaysu_defineProperty(this,"initialized",!1),Giveawaysu_defineProperty(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Giveawaysu_classPrivateMethodGet(this,_checkLogin,_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await Giveawaysu_classPrivateMethodGet(this,_checkLeftKey,_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!Giveawaysu_classPrivateMethodGet(this,_getGiveawayId,_getGiveawayId2).call(this)&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await Giveawaysu_classPrivateMethodGet(this,_toggleTask,_toggleTask2).call(this)}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};var _LocalStorage$getItem2,for_giveawaysu=__webpack_require__(821);if(window.STYLE=GM_addStyle(for_giveawaysu.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;var discordAuth=null===LocalStorage||void 0===LocalStorage||null===(discordAuth=LocalStorage.getItem("token"))||void 0===discordAuth?void 0:discordAuth.replace(/^"|"$/g,"");discordAuth&&0{var _commonOptions,_commonOptions$header;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(_commonOptions=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:_commonOptions,clientId:null===(_commonOptions=commonOptions)||void 0===_commonOptions||null===(_commonOptions$header=_commonOptions.headers)||void 0===_commonOptions$header?void 0:_commonOptions$header["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4-for-giveawaysu.user.js b/dist/auto-task-v4-for-giveawaysu.user.js index 53650b5..7483b2a 100644 --- a/dist/auto-task-v4-for-giveawaysu.user.js +++ b/dist/auto-task-v4-for-giveawaysu.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.2.32 +// @version 4.2.33 // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -84,4 +84,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+error.stack)}async function httpRequest_httpRequest(options){var times=1{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest_httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError_throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}}const tools_httpRequest=httpRequest_httpRequest;function delay(){let time=0{setTimeout(()=>{resolve(!0)},time)})}const scripts_echoLog=_ref=>{let{type,text,html,id}=_ref;const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{var _ele$;let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ - ${null===text||void 0===text?void 0:text.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),null!==(_ele$=ele[0])&&void 0!==_ele$&&_ele$.scrollIntoView(),{font:ele.find("font"),success(){var _this$font,_this$font3,text=0{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(data=>{data=data.data;return null!=data&&data.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null})}catch(error){return throwError_throwError(error,"getRedirectLink"),null}};const defaultGlobalOptions={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,officialGroups:!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,officialGroups:!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,debug:!1,receivePreview:!0}};for_giveawaysu=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,for_giveawaysu);const languages={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凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%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:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",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:"远程数据格式错误",updateHistory:'历史更新记录点此查看',groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",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:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",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",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",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时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",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",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",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",updateHistory:'Click here to view the historical update record.',groups:"Group",officialGroups:"Official 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",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official 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",gettingCuratorId:"Getting Steam Curator Id",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",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",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",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",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",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",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!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",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..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=function(key){for(var _languages$language,_len=arguments.length,argvs=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)argvs[_key-1]=arguments[_key];return null!==(_languages$language=languages[language])&&void 0!==_languages$language&&_languages$language[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key};for_giveawaysu=class{constructor(){var obj,key,value;value=void 0,(key="tasks")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=null===(auth=GM_getValue("discordAuth"))||void 0===auth?void 0:auth.auth;auth?(_classPrivateFieldSet(this,_auth,{auth:auth}),logStatus.success(),resolve(await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this))):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async function _joinServer2(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var _data$response,_data$response$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:_classPrivateFieldGet(this,_auth).auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(null===(_data$response=data.response)||void 0===_data$response||null===(_data$response$guild=_data$response.guild)||void 0===_data$response$guild?void 0:_data$response$guild.id);return guild&&(_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async function _leaveServer2(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await _classPrivateMethodGet(this,_getGuild,_getGuild2).call(this,inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:_classPrivateFieldGet(this,_auth).auth}});return"Success"===result&&204===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async function _getGuild2(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=_classPrivateFieldGet(this,_cache)[inviteId];if(guild)return logStatus.success(),guild;var _data$response2,_data$response2$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=null===(_data$response2=data.response)||void 0===_data$response2||null===(_data$response2$guild=_data$response2.guild)||void 0===_data$response2$guild?void 0:_data$response2$guild.id;return guild?(logStatus.success(),_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}function _setCache2(inviteId,guild){try{_classPrivateFieldGet(this,_cache)[inviteId]=guild,GM_setValue("discordCache",_classPrivateFieldGet(this,_cache))}catch(error){throwError_throwError(error,"Discord.setCache")}}const social_Discord=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),_classPrivateMethodInitSpec(this,_setCache),_classPrivateMethodInitSpec(this,_getGuild),_classPrivateMethodInitSpec(this,_leaveServer),_classPrivateMethodInitSpec(this,_joinServer),_classPrivateMethodInitSpec(this,_updateAuth),_classPrivateMethodInitSpec(this,_verifyAuth),Discord_defineProperty(this,"tasks",JSON.parse(defaultTasks)),Discord_defineProperty(this,"whiteList",{...JSON.parse(defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.discord}),_classPrivateFieldInitSpec(this,_auth,{writable:!0,value:GM_getValue("discordAuth")||{}}),_classPrivateFieldInitSpec(this,_cache,{writable:!0,value:GM_getValue("discordCache")||{}}),_classPrivateFieldInitSpec(this,_initialized,{writable:!0,value:!1})}async init(){try{if(!GM_getValue("dontRemindDiscordAgain"))if(!await external_Swal_default().fire({title:i18n("discordImportantNotice"),text:i18n("discordImportantNoticeText"),showCancelButton:!0,showDenyButton:!0,confirmButtonText:i18n("continue"),cancelButtonText:i18n("skipDiscordTask"),denyButtonText:i18n("continueAndDontRemindAgain")}).then(isDenied=>{var{isConfirmed,isDenied}=isDenied;return!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)}))return _classPrivateFieldSet(this,_initialized,!1),"skip";return globalOptions.doTask.discord.servers||globalOptions.undoTask.discord.servers?!!_classPrivateFieldGet(this,_initialized)||(_classPrivateFieldGet(this,_auth).auth?await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(GM_setValue("discordAuth",{auth:null}),await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)&&(_classPrivateFieldSet(this,_initialized,!0),!0)):(_classPrivateFieldSet(this,_initialized,!1),"skip")}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async toggle(serverLinks){var{doTask=!0,serverLinks=[]}=serverLinks;try{if(!_classPrivateFieldGet(this,_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/invite\/(.+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}};function Instagram_classPrivateMethodInitSpec(obj,privateSet){Instagram_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Instagram_classPrivateFieldInitSpec(obj,privateMap,value){Instagram_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Instagram_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Instagram_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Instagram_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Instagram_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Instagram_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Instagram_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Instagram_defaultTasks=JSON.stringify({users:[]});var Instagram_cache=new WeakMap,Instagram_auth=new WeakMap,Instagram_initialized=new WeakMap,_getUserInfo=new WeakSet,_followUser=new WeakSet,_unfollowUser=new WeakSet,Instagram_setCache=new WeakSet;async function _getUserInfo2(){var name=0{return null===(_link$match=_link$match.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}};function Reddit_classPrivateMethodInitSpec(obj,privateSet){Reddit_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Reddit_classPrivateFieldInitSpec(obj,privateMap,value){Reddit_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Reddit_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Reddit_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Reddit_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Reddit_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Reddit_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Reddit_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Reddit_defaultTasks=JSON.stringify({reddits:[]});var Reddit_auth=new WeakMap,Reddit_initialized=new WeakMap,_useBeta=new WeakSet,Reddit_updateAuth=new WeakSet;async function _useBeta2(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await Reddit_classPrivateMethodGet(this,Reddit_updateAuth,Reddit_updateAuth2).call(this,!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async function Reddit_updateAuth2(){var _data$responseText$ma,beta=0{var name=null===(name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===name?void 0:name[1],userName=null===(userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===userName?void 0:userName[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};function Twitch_classPrivateMethodInitSpec(obj,privateSet){Twitch_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Twitch_classPrivateFieldInitSpec(obj,privateMap,value){Twitch_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Twitch_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Twitch_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Twitch_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Twitch_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Twitch_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Twitch_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Twitch_defaultTasks=JSON.stringify({channels:[]});var Twitch_auth=new WeakMap,Twitch_cache=new WeakMap,Twitch_initialized=new WeakMap,_integrityToken=new WeakMap,Twitch_verifyAuth=new WeakSet,_integrity=new WeakSet,Twitch_updateAuth=new WeakSet,_toggleChannel=new WeakSet,_getChannelId=new WeakSet,Twitch_setCache=new WeakSet;async function Twitch_verifyAuth2(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var _data$response,_data$response$,_data$response$$data,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response=data.response)&&void 0!==_data$response&&null!==(_data$response$=_data$response[0])&&void 0!==_data$response$&&null!==(_data$response$$data=_data$response$.data)&&void 0!==_data$response$$data&&_data$response$$data.currentUser?(await Twitch_classPrivateMethodGet(this,_integrity,_integrity2).call(this,isFirst),logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async function _integrity2(){var isFirst=!(0{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(Twitch_classPrivateFieldSet(this,Twitch_auth,auth),logStatus.success(),resolve(await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async function _toggleChannel2(doTask){var{name,doTask=!0}=doTask;try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await Twitch_classPrivateMethodGet(this,_getChannelId,_getChannelId2).call(this,name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var _data$response3,_data$response4,_data$response4$0$err,_data$response4$0$err2,followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId,"Client-Version":Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion,"X-Device-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId,"Client-Session-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId,"Client-Integrity":Twitch_classPrivateFieldGet(this,_integrityToken)},data:doTask?followData:unfollowData});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response3=data.response)&&void 0!==_data$response3&&_data$response3[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+((null==data||null===(_data$response4=data.response)||void 0===_data$response4||null===(_data$response4$0$err=_data$response4[0].errors)||void 0===_data$response4$0$err||null===(_data$response4$0$err2=_data$response4$0$err[0])||void 0===_data$response4$0$err2?void 0:_data$response4$0$err2.message)||`${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async function _getChannelId2(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=Twitch_classPrivateFieldGet(this,Twitch_cache)[name];if(channelId)return logStatus.success(),channelId;var _data$response5,_data$response5$,_data$response5$$data,_data$response5$$data2,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const channelId=null===(_data$response5=data.response)||void 0===_data$response5||null===(_data$response5$=_data$response5[0])||void 0===_data$response5$||null===(_data$response5$$data=_data$response5$.data)||void 0===_data$response5$$data||null===(_data$response5$$data2=_data$response5$$data.user)||void 0===_data$response5$$data2?void 0:_data$response5$$data2.id;return channelId?(Twitch_classPrivateMethodGet(this,Twitch_setCache,Twitch_setCache2).call(this,name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}function Twitch_setCache2(name,id){try{Twitch_classPrivateFieldGet(this,Twitch_cache)[name]=id,GM_setValue("twitchCache",Twitch_classPrivateFieldGet(this,Twitch_cache))}catch(error){throwError_throwError(error,"Twitch.setCache")}}const social_Twitch=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Twitch_classPrivateMethodInitSpec(this,Twitch_setCache),Twitch_classPrivateMethodInitSpec(this,_getChannelId),Twitch_classPrivateMethodInitSpec(this,_toggleChannel),Twitch_classPrivateMethodInitSpec(this,Twitch_updateAuth),Twitch_classPrivateMethodInitSpec(this,_integrity),Twitch_classPrivateMethodInitSpec(this,Twitch_verifyAuth),Twitch_defineProperty(this,"tasks",JSON.parse(Twitch_defaultTasks)),Twitch_defineProperty(this,"whiteList",{...JSON.parse(Twitch_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.twitch}),Twitch_classPrivateFieldInitSpec(this,Twitch_auth,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_cache,{writable:!0,value:GM_getValue("twitchCache")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_initialized,{writable:!0,value:!1}),Twitch_classPrivateFieldInitSpec(this,_integrityToken,{writable:!0,value:void 0})}async init(){try{return Twitch_classPrivateFieldGet(this,Twitch_initialized)?!0:Twitch_classPrivateFieldGet(this,Twitch_auth).authToken&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion&&Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId?await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(GM_setValue("twitchAuth",null),await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)&&(Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async toggle(channelLinks){var{doTask=!0,channelLinks=[]}=channelLinks;try{if(!Twitch_classPrivateFieldGet(this,Twitch_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===_link$match?void 0:_link$match[2]});if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}};function Vk_classPrivateMethodInitSpec(obj,privateSet){Vk_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Vk_classPrivateFieldInitSpec(obj,privateMap,value){Vk_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Vk_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vk_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Vk_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Vk_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Vk_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Vk_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Vk_defaultTasks=JSON.stringify({names:[]});var _username=new WeakMap,Vk_cache=new WeakMap,Vk_initialized=new WeakMap,Vk_verifyAuth=new WeakSet,_toggleGroup=new WeakSet,_togglePublic=new WeakSet,_sendWall=new WeakSet,_deleteWall=new WeakSet,_getId=new WeakSet,_toggleVk=new WeakSet,Vk_setCache=new WeakSet;async function Vk_verifyAuth2(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});var _data$responseText$ma;return"Success"===result?null!==data&&void 0!==data&&data.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===(null===data||void 0===data?void 0:data.status)?(Vk_classPrivateFieldSet(this,_username,(null===(_data$responseText$ma=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1])||""),logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async function _toggleGroup2(name,dataParam){var doTask=!(2{return null===(_link$match=_link$match.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}};function Youtube_classPrivateMethodInitSpec(obj,privateSet){Youtube_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Youtube_classPrivateFieldInitSpec(obj,privateMap,value){Youtube_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Youtube_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Youtube_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Youtube_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Youtube_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Youtube_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Youtube_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Youtube_defaultTasks=JSON.stringify({channels:[],likes:[]}),getInfo=async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};{var _data$responseText$ma,_ref;if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=null===(_data$responseText$ma=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1],context=(null===(_ref=data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===_ref?void 0:_ref[1])||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var _data$responseText$ma2,channelId=null===(_data$responseText$ma2=data.responseText.match(//))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var _data$responseText$ma3,_data$responseText$ma4,videoId=null===(_data$responseText$ma3=data.responseText.match(//))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],likeParams=null===(_data$responseText$ma4=data.responseText.match(/"likeParams":"(.*?)"/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}};var Youtube_auth=new WeakMap,Youtube_initialized=new WeakMap,_verifyChannel=new WeakMap,Youtube_verifyAuth=new WeakSet,Youtube_updateAuth=new WeakSet,_getInfo=new WeakSet,Youtube_toggleChannel=new WeakSet,_toggleLikeVideo=new WeakSet;class Youtube extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Youtube_classPrivateMethodInitSpec(this,_toggleLikeVideo),Youtube_classPrivateMethodInitSpec(this,Youtube_toggleChannel),Youtube_classPrivateMethodInitSpec(this,_getInfo),Youtube_classPrivateMethodInitSpec(this,Youtube_updateAuth),Youtube_classPrivateMethodInitSpec(this,Youtube_verifyAuth),Youtube_defineProperty(this,"tasks",JSON.parse(Youtube_defaultTasks)),Youtube_defineProperty(this,"whiteList",{...JSON.parse(Youtube_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.youtube}),Youtube_classPrivateFieldInitSpec(this,Youtube_auth,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Youtube_classPrivateFieldInitSpec(this,Youtube_initialized,{writable:!0,value:!1}),Youtube_classPrivateFieldInitSpec(this,_verifyChannel,{writable:!0,value:"https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel})}async init(){try{return Youtube_classPrivateFieldGet(this,Youtube_initialized)?!0:Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID?await Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(GM_setValue("youtubeAuth",null),await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)&&(Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async toggle(videoLinks){var{doTask=!0,channelLinks=[],videoLinks=[]}=videoLinks;try{if(!Youtube_classPrivateFieldGet(this,Youtube_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>{var _link$match;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match?void 0:_link$match[1]:link});if(0{var _link$match2;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match2=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match2?void 0:_link$match2[1]:link});if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}async function Youtube_verifyAuth2(){try{return await Youtube_classPrivateMethodGet(this,Youtube_toggleChannel,Youtube_toggleChannel2).call(this,{link:Youtube_classPrivateFieldGet(this,_verifyChannel),doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async function Youtube_updateAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("youtubeAuth");auth?(Youtube_classPrivateFieldSet(this,Youtube_auth,auth),logStatus.success(),Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this).then(result=>{resolve(result)})):(logStatus.error("Error: Update youtube auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}function _getInfo2(link,type){return getInfo(link,type)}async function Youtube_toggleChannel2(verify){var{link,doTask=!0,verify=!1}=verify;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==client?void 0:client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:null==request?void 0:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&(/"subscribed": true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed": false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async function _toggleLikeVideo2(doTask){var{link,doTask=!0}=doTask;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}function Steam_classPrivateMethodInitSpec(obj,privateSet){Steam_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Steam_classPrivateFieldInitSpec(obj,privateMap,value){Steam_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Steam_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Steam_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Steam_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Steam_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Steam_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Steam_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Steam_defaultTasks=JSON.stringify({groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var Steam_cache=new WeakMap,Steam_auth=new WeakMap,_storeInitialized=new WeakMap,_communityInitialized=new WeakMap,_area=new WeakMap,_areaStatus=new WeakMap,_refreshStoreToken=new WeakSet,_setStoreToken=new WeakSet,_updateStoreAuth=new WeakSet,_updateCommunityAuth=new WeakSet,_getAreaInfo=new WeakSet,_changeArea=new WeakSet,_joinGroup=new WeakSet,_leaveGroup=new WeakSet,_getGroupId=new WeakSet,_joinOfficialGroup=new WeakSet,_leaveOfficialGroup=new WeakSet,_getOfficialGroupId=new WeakSet,_addToWishlist=new WeakSet,_removeFromWishlist=new WeakSet,_toggleFollowGame=new WeakSet,_isFollowedGame=new WeakSet,_toggleForum=new WeakSet,_getForumId=new WeakSet,_toggleFavoriteWorkshop=new WeakSet,_getWorkshopAppId=new WeakSet,_voteUpWorkshop=new WeakSet,_toggleCurator=new WeakSet,_toggleCuratorLike=new WeakSet,_getAnnouncementParams=new WeakSet,_likeAnnouncement=new WeakSet,_appid2subid=new WeakSet,_getLicenses=new WeakSet,_addLicense=new WeakSet,_addFreeLicense=new WeakSet,_requestPlayTestAccess=new WeakSet,Steam_setCache=new WeakSet;async function _refreshStoreToken2(){try{const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n("steamStore"))}),formData=new FormData;formData.append("redir","https://store.steampowered.com/");var _data$response,{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/"},data:formData});return"Success"===result?null!=data&&null!==(_data$response=data.response)&&void 0!==_data$response&&_data$response.success?await Steam_classPrivateMethodGet(this,_setStoreToken,_setStoreToken2).call(this,data.response)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshStoreToken"),!1}}async function _setStoreToken2(param){try{const logStatus=scripts_echoLog({text:i18n("settingToken",i18n("steamStore"))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/login/settoken",method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/login"},data:formData});return"Success"===result?200===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async function _updateStoreAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma2;if(!data.responseText.includes("data-miniprofile="))return await Steam_classPrivateMethodGet(this,_refreshStoreToken,_refreshStoreToken2).call(this),logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1;var storeSessionID=null===(_data$responseText$ma2=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return storeSessionID?(Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async function _updateCommunityAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma3,_data$responseText$ma4,_data$responseText$ma5;if(data.responseText.includes('href="https://steamcommunity.com/login/home/'))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=null===(_data$responseText$ma3=data.responseText.match(/g_steamID = "(.+?)";/))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],communitySessionID=null===(_data$responseText$ma4=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1],userName=null===(_data$responseText$ma5=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===_data$responseText$ma5?void 0:_data$responseText$ma5[1];return(steam64Id&&(Steam_classPrivateFieldGet(this,Steam_auth).steam64Id=steam64Id),userName&&(Steam_classPrivateFieldGet(this,Steam_auth).userName=userName),communitySessionID)?(Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async function _getAreaInfo2(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};var _data$responseText$ma6,currentArea=null===(_data$responseText$ma6=data.responseText.match(//g)].map(search=>search[1]);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==Steam_classPrivateFieldGet(this,_areaStatus)&&(clearInterval(checker),resolve(!0))})}),Steam_classPrivateFieldGet(this,_area)===area||!area&&"CN"!==Steam_classPrivateFieldGet(this,_area))return!0;Steam_classPrivateFieldSet(this,_areaStatus,"waiting");let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this);if(!currentArea||!areas)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),!1;if("CN"!==currentArea)return Steam_classPrivateFieldSet(this,_areaStatus,"skip"),scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return Steam_classPrivateFieldSet(this,_areaStatus,"noAnotherArea"),scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID})});if("Success"!==result)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==(null==data?void 0:data.status)||"true"!==data.responseText)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),"CN";var currentArea=(await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this))["currentArea"];return currentArea===aimedArea?(Steam_classPrivateFieldSet(this,_areaStatus,"success"),logStatus.success(),currentArea):(Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error("Error: change country filed"),"CN")}catch(error){return Steam_classPrivateFieldSet(this,_areaStatus,"error"),throwError_throwError(error,"Steam.changeArea"),!1}}async function _joinGroup2(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async function _leaveGroup2(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getGroupId,_getGroupId2).call(this,groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async function _getGroupId2(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var _data$responseText$ma7,groupId=Steam_classPrivateFieldGet(this,Steam_cache).group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma7=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===_data$responseText$ma7?void 0:_data$responseText$ma7[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _joinOfficialGroup2(gameId){try{const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma8;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=null===(_data$responseText$ma8=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma8?void 0:_data$responseText$ma8[1];return groupId&&Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async function _leaveOfficialGroup2(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getOfficialGroupId,_getOfficialGroupId2).call(this,gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async function _getOfficialGroupId2(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var _data$responseText$ma9,groupId=Steam_classPrivateFieldGet(this,Steam_cache).officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma9=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma9?void 0:_data$responseText$ma9[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _addToWishlist2(gameId){try{var _data$response2;const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response2=data.response)||void 0===_data$response2?void 0:_data$response2.success))return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)?"CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_addToWishlist,_addToWishlist2).call(this,gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async function _removeFromWishlist2(gameId){try{var _data$response3;if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response3=data.response)||void 0===_data$response3?void 0:_data$response3.success))return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==(null===dataR||void 0===dataR?void 0:dataR.status))return logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1;if("CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this);return result&&"CN"!==result&&"skip"!==result?await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async function _toggleFollowGame2(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===(null==data?void 0:data.status)&&"true"===data.responseText)return logStatus.success(),!0;var followed=await Steam_classPrivateMethodGet(this,_isFollowedGame,_isFollowedGame2).call(this,gameId);return"CN"===Steam_classPrivateFieldGet(this,_area)&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async function _isFollowedGame2(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&("CN"===Steam_classPrivateFieldGet(this,_area)&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async function _toggleForum2(gameId){var doTask=!(1/))||void 0===_data$responseText$ma11?void 0:_data$responseText$ma11[1];return appId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async function _voteUpWorkshop2(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var _data$response6,{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?(200===(null==data?void 0:data.status)&&1===(null===(_data$response6=data.response)||void 0===_data$response6?void 0:_data$response6.success)?logStatus.success():logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async function _toggleCurator2(curatorId){var doTask=!(1{return null===(_link$match=_link$match.match(/groups\/(.+)\/?/))||void 0===_link$match?void 0:_link$match[1]});if(0{return null===(_link$match2=_link$match2.match(/games\/(.+)\/?/))||void 0===_link$match2?void 0:_link$match2[1]});if(0{return null===(_link$match3=_link$match3.match(/app\/([\d]+)/))||void 0===_link$match3?void 0:_link$match3[1]});if(0{return null===(_link$match4=_link$match4.match(/app\/([\d]+)/))||void 0===_link$match4?void 0:_link$match4[1]});if(0{return null===(_link$match5=_link$match5.match(/app\/([\d]+)/))||void 0===_link$match5?void 0:_link$match5[1]});if(0{return null===(_link$match6=_link$match6.match(/\?id=([\d]+)/))||void 0===_link$match6?void 0:_link$match6[1]});if(0{return null===(_link$match7=_link$match7.match(/\?id=([\d]+)/))||void 0===_link$match7?void 0:_link$match7[1]});if(doTask&&0{return null===(_link$match8=_link$match8.match(/curator\/([\d]+)/))||void 0===_link$match8?void 0:_link$match8[1]}),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,_link$match9=>{return null===(_link$match9=_link$match9.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===_link$match9?void 0:_link$match9.slice(1,3).join("/")});if(0{var _link$match10;return _link$match11.includes("store.steampowered.com")?null===(_link$match10=_link$match11.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===_link$match10?void 0:_link$match10.slice(1,3).join("/"):null===(_link$match11=_link$match11.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===_link$match11?void 0:_link$match11.slice(1,3).join("/")});if(doTask&&0{return null===(_link$match12=_link$match12.match(/app\/([\d]+)/))||void 0===_link$match12?void 0:_link$match12[1]});if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==Steam_classPrivateFieldGet(this,_area)&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this,"CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}};function Giveawaysu_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Giveawaysu_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Giveawaysu_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const Giveawaysu_defaultTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};var _classifyTask=new WeakSet,_checkLogin=new WeakSet,_checkLeftKey=new WeakSet,_getGiveawayId=new WeakSet,_bind=new WeakSet,_initSocial=new WeakSet,_uniqueTasks=new WeakSet,_toggleTask=new WeakSet;async function _classifyTask2(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#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 task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=Giveawaysu_classPrivateMethodGet(this,_uniqueTasks,_uniqueTasks2).call(this,this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}function _checkLogin2(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async function _checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}function _getGiveawayId2(){var giveawayId=null===(giveawayId=window.location.href.match(/\/view\/([\d]+)/))||void 0===giveawayId?void 0:giveawayId[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async function _bind2(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async function _initSocial2(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"discord",this.social.discord.init()))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0{var _tasks$steam,_tasks$steam$type;return["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&(null===(_tasks$steam=tasks.steam)||void 0===_tasks$steam||null===(_tasks$steam$type=_tasks$steam[type])||void 0===_tasks$steam$type?void 0:_tasks$steam$type.length)||0}).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}function _uniqueTasks2(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async function _toggleTask2(){try{if(!this.initialized&&!this.init())return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_classifyTask,_classifyTask2).call(this))return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_initSocial,_initSocial2).call(this))return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}const Giveawaysu=class{constructor(){Giveawaysu_classPrivateMethodInitSpec(this,_toggleTask),Giveawaysu_classPrivateMethodInitSpec(this,_uniqueTasks),Giveawaysu_classPrivateMethodInitSpec(this,_initSocial),Giveawaysu_classPrivateMethodInitSpec(this,_bind),Giveawaysu_classPrivateMethodInitSpec(this,_getGiveawayId),Giveawaysu_classPrivateMethodInitSpec(this,_checkLeftKey),Giveawaysu_classPrivateMethodInitSpec(this,_checkLogin),Giveawaysu_classPrivateMethodInitSpec(this,_classifyTask),Giveawaysu_defineProperty(this,"undoneTasks",Giveawaysu_defaultTasks),Giveawaysu_defineProperty(this,"giveawayId",void 0),Giveawaysu_defineProperty(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0}),Giveawaysu_defineProperty(this,"initialized",!1),Giveawaysu_defineProperty(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Giveawaysu_classPrivateMethodGet(this,_checkLogin,_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await Giveawaysu_classPrivateMethodGet(this,_checkLeftKey,_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!Giveawaysu_classPrivateMethodGet(this,_getGiveawayId,_getGiveawayId2).call(this)&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await Giveawaysu_classPrivateMethodGet(this,_toggleTask,_toggleTask2).call(this)}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};var _LocalStorage$getItem2,for_giveawaysu=__webpack_require__(821);if(window.STYLE=GM_addStyle(for_giveawaysu.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;var discordAuth=null===LocalStorage||void 0===LocalStorage||null===(discordAuth=LocalStorage.getItem("token"))||void 0===discordAuth?void 0:discordAuth.replace(/^"|"$/g,"");discordAuth&&0{var _commonOptions,_commonOptions$header;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(_commonOptions=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:_commonOptions,clientId:null===(_commonOptions=commonOptions)||void 0===_commonOptions||null===(_commonOptions$header=_commonOptions.headers)||void 0===_commonOptions$header?void 0:_commonOptions$header["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${null===text||void 0===text?void 0:text.replace("u_","")}]...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),null!==(_ele$=ele[0])&&void 0!==_ele$&&_ele$.scrollIntoView(),{font:ele.find("font"),success(){var _this$font,_this$font3,text=0{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(data=>{data=data.data;return null!=data&&data.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null})}catch(error){return throwError_throwError(error,"getRedirectLink"),null}};const defaultGlobalOptions={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,officialGroups:!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,officialGroups:!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,debug:!1,receivePreview:!0}};for_giveawaysu=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,for_giveawaysu);const languages={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凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%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:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",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:"远程数据格式错误",updateHistory:'历史更新记录点此查看',groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",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:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",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",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",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时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",confirmingTask:"正在跳过警告页面..."},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",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",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",updateHistory:'Click here to view the historical update record.',groups:"Group",officialGroups:"Official 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",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official 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",gettingCuratorId:"Getting Steam Curator Id",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",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",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",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",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",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",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!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",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...",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=function(key){for(var _languages$language,_len=arguments.length,argvs=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)argvs[_key-1]=arguments[_key];return null!==(_languages$language=languages[language])&&void 0!==_languages$language&&_languages$language[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key};for_giveawaysu=class{constructor(){var obj,key,value;value=void 0,(key="tasks")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=null===(auth=GM_getValue("discordAuth"))||void 0===auth?void 0:auth.auth;auth?(_classPrivateFieldSet(this,_auth,{auth:auth}),logStatus.success(),resolve(await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this))):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async function _joinServer2(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var _data$response,_data$response$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:_classPrivateFieldGet(this,_auth).auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(null===(_data$response=data.response)||void 0===_data$response||null===(_data$response$guild=_data$response.guild)||void 0===_data$response$guild?void 0:_data$response$guild.id);return guild&&(_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async function _leaveServer2(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await _classPrivateMethodGet(this,_getGuild,_getGuild2).call(this,inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:_classPrivateFieldGet(this,_auth).auth}});return"Success"===result&&204===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async function _getGuild2(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=_classPrivateFieldGet(this,_cache)[inviteId];if(guild)return logStatus.success(),guild;var _data$response2,_data$response2$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=null===(_data$response2=data.response)||void 0===_data$response2||null===(_data$response2$guild=_data$response2.guild)||void 0===_data$response2$guild?void 0:_data$response2$guild.id;return guild?(logStatus.success(),_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}function _setCache2(inviteId,guild){try{_classPrivateFieldGet(this,_cache)[inviteId]=guild,GM_setValue("discordCache",_classPrivateFieldGet(this,_cache))}catch(error){throwError_throwError(error,"Discord.setCache")}}const social_Discord=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),_classPrivateMethodInitSpec(this,_setCache),_classPrivateMethodInitSpec(this,_getGuild),_classPrivateMethodInitSpec(this,_leaveServer),_classPrivateMethodInitSpec(this,_joinServer),_classPrivateMethodInitSpec(this,_updateAuth),_classPrivateMethodInitSpec(this,_verifyAuth),Discord_defineProperty(this,"tasks",JSON.parse(defaultTasks)),Discord_defineProperty(this,"whiteList",{...JSON.parse(defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.discord}),_classPrivateFieldInitSpec(this,_auth,{writable:!0,value:GM_getValue("discordAuth")||{}}),_classPrivateFieldInitSpec(this,_cache,{writable:!0,value:GM_getValue("discordCache")||{}}),_classPrivateFieldInitSpec(this,_initialized,{writable:!0,value:!1})}async init(){try{if(!GM_getValue("dontRemindDiscordAgain"))if(!await external_Swal_default().fire({title:i18n("discordImportantNotice"),text:i18n("discordImportantNoticeText"),showCancelButton:!0,showDenyButton:!0,confirmButtonText:i18n("continue"),cancelButtonText:i18n("skipDiscordTask"),denyButtonText:i18n("continueAndDontRemindAgain")}).then(isDenied=>{var{isConfirmed,isDenied}=isDenied;return!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)}))return _classPrivateFieldSet(this,_initialized,!1),"skip";return globalOptions.doTask.discord.servers||globalOptions.undoTask.discord.servers?!!_classPrivateFieldGet(this,_initialized)||(_classPrivateFieldGet(this,_auth).auth?await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(GM_setValue("discordAuth",{auth:null}),await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)&&(_classPrivateFieldSet(this,_initialized,!0),!0)):(_classPrivateFieldSet(this,_initialized,!1),"skip")}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async toggle(serverLinks){var{doTask=!0,serverLinks=[]}=serverLinks;try{if(!_classPrivateFieldGet(this,_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/invite\/(.+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}};function Instagram_classPrivateMethodInitSpec(obj,privateSet){Instagram_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Instagram_classPrivateFieldInitSpec(obj,privateMap,value){Instagram_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Instagram_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Instagram_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Instagram_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Instagram_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Instagram_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Instagram_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Instagram_defaultTasks=JSON.stringify({users:[]});var Instagram_cache=new WeakMap,Instagram_auth=new WeakMap,Instagram_initialized=new WeakMap,_getUserInfo=new WeakSet,_followUser=new WeakSet,_unfollowUser=new WeakSet,Instagram_setCache=new WeakSet;async function _getUserInfo2(){var name=0{return null===(_link$match=_link$match.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}};function Reddit_classPrivateMethodInitSpec(obj,privateSet){Reddit_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Reddit_classPrivateFieldInitSpec(obj,privateMap,value){Reddit_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Reddit_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Reddit_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Reddit_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Reddit_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Reddit_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Reddit_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Reddit_defaultTasks=JSON.stringify({reddits:[]});var Reddit_auth=new WeakMap,Reddit_initialized=new WeakMap,_useBeta=new WeakSet,Reddit_updateAuth=new WeakSet;async function _useBeta2(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await Reddit_classPrivateMethodGet(this,Reddit_updateAuth,Reddit_updateAuth2).call(this,!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async function Reddit_updateAuth2(){var _data$responseText$ma,beta=0{var name=null===(name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===name?void 0:name[1],userName=null===(userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===userName?void 0:userName[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};function Twitch_classPrivateMethodInitSpec(obj,privateSet){Twitch_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Twitch_classPrivateFieldInitSpec(obj,privateMap,value){Twitch_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Twitch_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Twitch_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Twitch_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Twitch_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Twitch_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Twitch_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Twitch_defaultTasks=JSON.stringify({channels:[]});var Twitch_auth=new WeakMap,Twitch_cache=new WeakMap,Twitch_initialized=new WeakMap,_integrityToken=new WeakMap,Twitch_verifyAuth=new WeakSet,_integrity=new WeakSet,Twitch_updateAuth=new WeakSet,_toggleChannel=new WeakSet,_getChannelId=new WeakSet,Twitch_setCache=new WeakSet;async function Twitch_verifyAuth2(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var _data$response,_data$response$,_data$response$$data,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response=data.response)&&void 0!==_data$response&&null!==(_data$response$=_data$response[0])&&void 0!==_data$response$&&null!==(_data$response$$data=_data$response$.data)&&void 0!==_data$response$$data&&_data$response$$data.currentUser?(await Twitch_classPrivateMethodGet(this,_integrity,_integrity2).call(this,isFirst),logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async function _integrity2(){var isFirst=!(0{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(Twitch_classPrivateFieldSet(this,Twitch_auth,auth),logStatus.success(),resolve(await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async function _toggleChannel2(doTask){var{name,doTask=!0}=doTask;try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await Twitch_classPrivateMethodGet(this,_getChannelId,_getChannelId2).call(this,name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var _data$response3,_data$response4,_data$response4$0$err,_data$response4$0$err2,followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId,"Client-Version":Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion,"X-Device-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId,"Client-Session-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId,"Client-Integrity":Twitch_classPrivateFieldGet(this,_integrityToken)},data:doTask?followData:unfollowData});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response3=data.response)&&void 0!==_data$response3&&_data$response3[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+((null==data||null===(_data$response4=data.response)||void 0===_data$response4||null===(_data$response4$0$err=_data$response4[0].errors)||void 0===_data$response4$0$err||null===(_data$response4$0$err2=_data$response4$0$err[0])||void 0===_data$response4$0$err2?void 0:_data$response4$0$err2.message)||`${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async function _getChannelId2(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=Twitch_classPrivateFieldGet(this,Twitch_cache)[name];if(channelId)return logStatus.success(),channelId;var _data$response5,_data$response5$,_data$response5$$data,_data$response5$$data2,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const channelId=null===(_data$response5=data.response)||void 0===_data$response5||null===(_data$response5$=_data$response5[0])||void 0===_data$response5$||null===(_data$response5$$data=_data$response5$.data)||void 0===_data$response5$$data||null===(_data$response5$$data2=_data$response5$$data.user)||void 0===_data$response5$$data2?void 0:_data$response5$$data2.id;return channelId?(Twitch_classPrivateMethodGet(this,Twitch_setCache,Twitch_setCache2).call(this,name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}function Twitch_setCache2(name,id){try{Twitch_classPrivateFieldGet(this,Twitch_cache)[name]=id,GM_setValue("twitchCache",Twitch_classPrivateFieldGet(this,Twitch_cache))}catch(error){throwError_throwError(error,"Twitch.setCache")}}const social_Twitch=class extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Twitch_classPrivateMethodInitSpec(this,Twitch_setCache),Twitch_classPrivateMethodInitSpec(this,_getChannelId),Twitch_classPrivateMethodInitSpec(this,_toggleChannel),Twitch_classPrivateMethodInitSpec(this,Twitch_updateAuth),Twitch_classPrivateMethodInitSpec(this,_integrity),Twitch_classPrivateMethodInitSpec(this,Twitch_verifyAuth),Twitch_defineProperty(this,"tasks",JSON.parse(Twitch_defaultTasks)),Twitch_defineProperty(this,"whiteList",{...JSON.parse(Twitch_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.twitch}),Twitch_classPrivateFieldInitSpec(this,Twitch_auth,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_cache,{writable:!0,value:GM_getValue("twitchCache")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_initialized,{writable:!0,value:!1}),Twitch_classPrivateFieldInitSpec(this,_integrityToken,{writable:!0,value:void 0})}async init(){try{return Twitch_classPrivateFieldGet(this,Twitch_initialized)?!0:Twitch_classPrivateFieldGet(this,Twitch_auth).authToken&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion&&Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId?await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(GM_setValue("twitchAuth",null),await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)&&(Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async toggle(channelLinks){var{doTask=!0,channelLinks=[]}=channelLinks;try{if(!Twitch_classPrivateFieldGet(this,Twitch_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===_link$match?void 0:_link$match[2]});if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}};function Vk_classPrivateMethodInitSpec(obj,privateSet){Vk_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Vk_classPrivateFieldInitSpec(obj,privateMap,value){Vk_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Vk_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vk_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Vk_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Vk_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Vk_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Vk_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Vk_defaultTasks=JSON.stringify({names:[]});var _username=new WeakMap,Vk_cache=new WeakMap,Vk_initialized=new WeakMap,Vk_verifyAuth=new WeakSet,_toggleGroup=new WeakSet,_togglePublic=new WeakSet,_sendWall=new WeakSet,_deleteWall=new WeakSet,_getId=new WeakSet,_toggleVk=new WeakSet,Vk_setCache=new WeakSet;async function Vk_verifyAuth2(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});var _data$responseText$ma;return"Success"===result?null!==data&&void 0!==data&&data.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===(null===data||void 0===data?void 0:data.status)?(Vk_classPrivateFieldSet(this,_username,(null===(_data$responseText$ma=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1])||""),logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async function _toggleGroup2(name,dataParam){var doTask=!(2{return null===(_link$match=_link$match.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}};function Youtube_classPrivateMethodInitSpec(obj,privateSet){Youtube_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Youtube_classPrivateFieldInitSpec(obj,privateMap,value){Youtube_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Youtube_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Youtube_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Youtube_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Youtube_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Youtube_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Youtube_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Youtube_defaultTasks=JSON.stringify({channels:[],likes:[]}),getInfo=async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};{var _data$responseText$ma,_ref;if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=null===(_data$responseText$ma=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1],context=(null===(_ref=data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===_ref?void 0:_ref[1])||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var _data$responseText$ma2,channelId=null===(_data$responseText$ma2=data.responseText.match(//))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var _data$responseText$ma3,_data$responseText$ma4,videoId=null===(_data$responseText$ma3=data.responseText.match(//))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],likeParams=null===(_data$responseText$ma4=data.responseText.match(/"likeParams":"(.*?)"/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}};var Youtube_auth=new WeakMap,Youtube_initialized=new WeakMap,_verifyChannel=new WeakMap,Youtube_verifyAuth=new WeakSet,Youtube_updateAuth=new WeakSet,_getInfo=new WeakSet,Youtube_toggleChannel=new WeakSet,_toggleLikeVideo=new WeakSet;class Youtube extends for_giveawaysu{constructor(){var _GM_getValue;super(...arguments),Youtube_classPrivateMethodInitSpec(this,_toggleLikeVideo),Youtube_classPrivateMethodInitSpec(this,Youtube_toggleChannel),Youtube_classPrivateMethodInitSpec(this,_getInfo),Youtube_classPrivateMethodInitSpec(this,Youtube_updateAuth),Youtube_classPrivateMethodInitSpec(this,Youtube_verifyAuth),Youtube_defineProperty(this,"tasks",JSON.parse(Youtube_defaultTasks)),Youtube_defineProperty(this,"whiteList",{...JSON.parse(Youtube_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.youtube}),Youtube_classPrivateFieldInitSpec(this,Youtube_auth,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Youtube_classPrivateFieldInitSpec(this,Youtube_initialized,{writable:!0,value:!1}),Youtube_classPrivateFieldInitSpec(this,_verifyChannel,{writable:!0,value:"https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel})}async init(){try{return Youtube_classPrivateFieldGet(this,Youtube_initialized)?!0:Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID?await Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(GM_setValue("youtubeAuth",null),await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)&&(Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async toggle(videoLinks){var{doTask=!0,channelLinks=[],videoLinks=[]}=videoLinks;try{if(!Youtube_classPrivateFieldGet(this,Youtube_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>{var _link$match;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match?void 0:_link$match[1]:link});if(0{var _link$match2;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match2=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match2?void 0:_link$match2[1]:link});if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}async function Youtube_verifyAuth2(){try{return await Youtube_classPrivateMethodGet(this,Youtube_toggleChannel,Youtube_toggleChannel2).call(this,{link:Youtube_classPrivateFieldGet(this,_verifyChannel),doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async function Youtube_updateAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("youtubeAuth");auth?(Youtube_classPrivateFieldSet(this,Youtube_auth,auth),logStatus.success(),Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this).then(result=>{resolve(result)})):(logStatus.error("Error: Update youtube auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}function _getInfo2(link,type){return getInfo(link,type)}async function Youtube_toggleChannel2(verify){var{link,doTask=!0,verify=!1}=verify;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==client?void 0:client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:null==request?void 0:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&(/"subscribed": true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed": false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async function _toggleLikeVideo2(doTask){var{link,doTask=!0}=doTask;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}function Steam_classPrivateMethodInitSpec(obj,privateSet){Steam_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Steam_classPrivateFieldInitSpec(obj,privateMap,value){Steam_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Steam_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Steam_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Steam_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Steam_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Steam_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Steam_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Steam_defaultTasks=JSON.stringify({groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var Steam_cache=new WeakMap,Steam_auth=new WeakMap,_storeInitialized=new WeakMap,_communityInitialized=new WeakMap,_area=new WeakMap,_areaStatus=new WeakMap,_refreshStoreToken=new WeakSet,_setStoreToken=new WeakSet,_updateStoreAuth=new WeakSet,_updateCommunityAuth=new WeakSet,_getAreaInfo=new WeakSet,_changeArea=new WeakSet,_joinGroup=new WeakSet,_leaveGroup=new WeakSet,_getGroupId=new WeakSet,_joinOfficialGroup=new WeakSet,_leaveOfficialGroup=new WeakSet,_getOfficialGroupId=new WeakSet,_addToWishlist=new WeakSet,_removeFromWishlist=new WeakSet,_toggleFollowGame=new WeakSet,_isFollowedGame=new WeakSet,_toggleForum=new WeakSet,_getForumId=new WeakSet,_toggleFavoriteWorkshop=new WeakSet,_getWorkshopAppId=new WeakSet,_voteUpWorkshop=new WeakSet,_toggleCurator=new WeakSet,_toggleCuratorLike=new WeakSet,_getAnnouncementParams=new WeakSet,_likeAnnouncement=new WeakSet,_appid2subid=new WeakSet,_getLicenses=new WeakSet,_addLicense=new WeakSet,_addFreeLicense=new WeakSet,_requestPlayTestAccess=new WeakSet,Steam_setCache=new WeakSet;async function _refreshStoreToken2(){try{const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n("steamStore"))}),formData=new FormData;formData.append("redir","https://store.steampowered.com/");var _data$response,{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/"},data:formData});return"Success"===result?null!=data&&null!==(_data$response=data.response)&&void 0!==_data$response&&_data$response.success?await Steam_classPrivateMethodGet(this,_setStoreToken,_setStoreToken2).call(this,data.response)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshStoreToken"),!1}}async function _setStoreToken2(param){try{const logStatus=scripts_echoLog({text:i18n("settingToken",i18n("steamStore"))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/login/settoken",method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/login"},data:formData});return"Success"===result?200===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async function _updateStoreAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma2;if(!data.responseText.includes("data-miniprofile="))return await Steam_classPrivateMethodGet(this,_refreshStoreToken,_refreshStoreToken2).call(this),logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1;var storeSessionID=null===(_data$responseText$ma2=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return storeSessionID?(Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async function _updateCommunityAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma3,_data$responseText$ma4,_data$responseText$ma5;if(data.responseText.includes('href="https://steamcommunity.com/login/home/'))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=null===(_data$responseText$ma3=data.responseText.match(/g_steamID = "(.+?)";/))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],communitySessionID=null===(_data$responseText$ma4=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1],userName=null===(_data$responseText$ma5=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===_data$responseText$ma5?void 0:_data$responseText$ma5[1];return(steam64Id&&(Steam_classPrivateFieldGet(this,Steam_auth).steam64Id=steam64Id),userName&&(Steam_classPrivateFieldGet(this,Steam_auth).userName=userName),communitySessionID)?(Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async function _getAreaInfo2(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};var _data$responseText$ma6,currentArea=null===(_data$responseText$ma6=data.responseText.match(//g)].map(search=>search[1]);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==Steam_classPrivateFieldGet(this,_areaStatus)&&(clearInterval(checker),resolve(!0))})}),Steam_classPrivateFieldGet(this,_area)===area||!area&&"CN"!==Steam_classPrivateFieldGet(this,_area))return!0;Steam_classPrivateFieldSet(this,_areaStatus,"waiting");let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this);if(!currentArea||!areas)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),!1;if("CN"!==currentArea)return Steam_classPrivateFieldSet(this,_areaStatus,"skip"),scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return Steam_classPrivateFieldSet(this,_areaStatus,"noAnotherArea"),scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID})});if("Success"!==result)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==(null==data?void 0:data.status)||"true"!==data.responseText)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),"CN";var currentArea=(await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this))["currentArea"];return currentArea===aimedArea?(Steam_classPrivateFieldSet(this,_areaStatus,"success"),logStatus.success(),currentArea):(Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error("Error: change country filed"),"CN")}catch(error){return Steam_classPrivateFieldSet(this,_areaStatus,"error"),throwError_throwError(error,"Steam.changeArea"),!1}}async function _joinGroup2(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async function _leaveGroup2(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getGroupId,_getGroupId2).call(this,groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async function _getGroupId2(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var _data$responseText$ma7,groupId=Steam_classPrivateFieldGet(this,Steam_cache).group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma7=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===_data$responseText$ma7?void 0:_data$responseText$ma7[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _joinOfficialGroup2(gameId){try{const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma8;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=null===(_data$responseText$ma8=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma8?void 0:_data$responseText$ma8[1];return groupId&&Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async function _leaveOfficialGroup2(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getOfficialGroupId,_getOfficialGroupId2).call(this,gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async function _getOfficialGroupId2(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var _data$responseText$ma9,groupId=Steam_classPrivateFieldGet(this,Steam_cache).officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma9=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma9?void 0:_data$responseText$ma9[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async function _addToWishlist2(gameId){try{var _data$response2;const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response2=data.response)||void 0===_data$response2?void 0:_data$response2.success))return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)?"CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_addToWishlist,_addToWishlist2).call(this,gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async function _removeFromWishlist2(gameId){try{var _data$response3;if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response3=data.response)||void 0===_data$response3?void 0:_data$response3.success))return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==(null===dataR||void 0===dataR?void 0:dataR.status))return logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1;if("CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this);return result&&"CN"!==result&&"skip"!==result?await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async function _toggleFollowGame2(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===(null==data?void 0:data.status)&&"true"===data.responseText)return logStatus.success(),!0;var followed=await Steam_classPrivateMethodGet(this,_isFollowedGame,_isFollowedGame2).call(this,gameId);return"CN"===Steam_classPrivateFieldGet(this,_area)&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async function _isFollowedGame2(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&("CN"===Steam_classPrivateFieldGet(this,_area)&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async function _toggleForum2(gameId){var doTask=!(1/))||void 0===_data$responseText$ma11?void 0:_data$responseText$ma11[1];return appId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async function _voteUpWorkshop2(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var _data$response6,{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?(200===(null==data?void 0:data.status)&&1===(null===(_data$response6=data.response)||void 0===_data$response6?void 0:_data$response6.success)?logStatus.success():logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async function _toggleCurator2(curatorId){var doTask=!(1{return null===(_link$match=_link$match.match(/groups\/(.+)\/?/))||void 0===_link$match?void 0:_link$match[1]});if(0{return null===(_link$match2=_link$match2.match(/games\/(.+)\/?/))||void 0===_link$match2?void 0:_link$match2[1]});if(0{return null===(_link$match3=_link$match3.match(/app\/([\d]+)/))||void 0===_link$match3?void 0:_link$match3[1]});if(0{return null===(_link$match4=_link$match4.match(/app\/([\d]+)/))||void 0===_link$match4?void 0:_link$match4[1]});if(0{return null===(_link$match5=_link$match5.match(/app\/([\d]+)/))||void 0===_link$match5?void 0:_link$match5[1]});if(0{return null===(_link$match6=_link$match6.match(/\?id=([\d]+)/))||void 0===_link$match6?void 0:_link$match6[1]});if(0{return null===(_link$match7=_link$match7.match(/\?id=([\d]+)/))||void 0===_link$match7?void 0:_link$match7[1]});if(doTask&&0{return null===(_link$match8=_link$match8.match(/curator\/([\d]+)/))||void 0===_link$match8?void 0:_link$match8[1]}),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,_link$match9=>{return null===(_link$match9=_link$match9.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===_link$match9?void 0:_link$match9.slice(1,3).join("/")});if(0{var _link$match10;return _link$match11.includes("store.steampowered.com")?null===(_link$match10=_link$match11.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===_link$match10?void 0:_link$match10.slice(1,3).join("/"):null===(_link$match11=_link$match11.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===_link$match11?void 0:_link$match11.slice(1,3).join("/")});if(doTask&&0{return null===(_link$match12=_link$match12.match(/app\/([\d]+)/))||void 0===_link$match12?void 0:_link$match12[1]});if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==Steam_classPrivateFieldGet(this,_area)&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this,"CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}};function Giveawaysu_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Giveawaysu_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Giveawaysu_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const Giveawaysu_defaultTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};var _classifyTask=new WeakSet,_checkLogin=new WeakSet,_checkLeftKey=new WeakSet,_getGiveawayId=new WeakSet,_bind=new WeakSet,_initSocial=new WeakSet,_uniqueTasks=new WeakSet,_toggleTask=new WeakSet;async function _classifyTask2(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#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 task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=Giveawaysu_classPrivateMethodGet(this,_uniqueTasks,_uniqueTasks2).call(this,this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}function _checkLogin2(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async function _checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}function _getGiveawayId2(){var giveawayId=null===(giveawayId=window.location.href.match(/\/view\/([\d]+)/))||void 0===giveawayId?void 0:giveawayId[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async function _bind2(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async function _initSocial2(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"discord",this.social.discord.init()))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0{var _tasks$steam,_tasks$steam$type;return["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&(null===(_tasks$steam=tasks.steam)||void 0===_tasks$steam||null===(_tasks$steam$type=_tasks$steam[type])||void 0===_tasks$steam$type?void 0:_tasks$steam$type.length)||0}).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(Giveawaysu_classPrivateMethodGet(this,_bind,_bind2).call(this,"steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}function _uniqueTasks2(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async function _toggleTask2(){try{if(!this.initialized&&!this.init())return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_classifyTask,_classifyTask2).call(this))return!1;if(!await Giveawaysu_classPrivateMethodGet(this,_initSocial,_initSocial2).call(this))return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}const Giveawaysu=class{constructor(){Giveawaysu_classPrivateMethodInitSpec(this,_toggleTask),Giveawaysu_classPrivateMethodInitSpec(this,_uniqueTasks),Giveawaysu_classPrivateMethodInitSpec(this,_initSocial),Giveawaysu_classPrivateMethodInitSpec(this,_bind),Giveawaysu_classPrivateMethodInitSpec(this,_getGiveawayId),Giveawaysu_classPrivateMethodInitSpec(this,_checkLeftKey),Giveawaysu_classPrivateMethodInitSpec(this,_checkLogin),Giveawaysu_classPrivateMethodInitSpec(this,_classifyTask),Giveawaysu_defineProperty(this,"undoneTasks",Giveawaysu_defaultTasks),Giveawaysu_defineProperty(this,"giveawayId",void 0),Giveawaysu_defineProperty(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0}),Giveawaysu_defineProperty(this,"initialized",!1),Giveawaysu_defineProperty(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Giveawaysu_classPrivateMethodGet(this,_checkLogin,_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await Giveawaysu_classPrivateMethodGet(this,_checkLeftKey,_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!Giveawaysu_classPrivateMethodGet(this,_getGiveawayId,_getGiveawayId2).call(this)&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await Giveawaysu_classPrivateMethodGet(this,_toggleTask,_toggleTask2).call(this)}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};var _LocalStorage$getItem2,for_giveawaysu=__webpack_require__(821);if(window.STYLE=GM_addStyle(for_giveawaysu.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;var discordAuth=null===LocalStorage||void 0===LocalStorage||null===(discordAuth=LocalStorage.getItem("token"))||void 0===discordAuth?void 0:discordAuth.replace(/^"|"$/g,"");discordAuth&&0{var _commonOptions,_commonOptions$header;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(_commonOptions=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:_commonOptions,clientId:null===(_commonOptions=commonOptions)||void 0===_commonOptions||null===(_commonOptions$header=_commonOptions.headers)||void 0===_commonOptions$header?void 0:_commonOptions$header["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.all.user.js b/dist/auto-task-v4.all.user.js index 884d309..f6f3086 100644 --- a/dist/auto-task-v4.all.user.js +++ b/dist/auto-task-v4.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4 // @namespace auto-task-v4 -// @version 4.2.32 +// @version 4.2.33 // @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 @@ -1445,7 +1445,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); giveeClubVerifyNotice: '正在验证任务...', giveeClubVerifyFinished: '请等待验证完成后自行加入赠Key', doingKeyhubTask: '正在做Keyhub任务...', - SweepWidgetNotice: '正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...' + SweepWidgetNotice: '正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...', + confirmingTask: '正在跳过警告页面...' }; const zh_CN = data; const en_US_data = { @@ -1715,7 +1716,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); giveeClubVerifyNotice: 'Verifying task...', giveeClubVerifyFinished: 'Wait for the verification to complete and join it by yourself', doingKeyhubTask: 'Doing Keyhub Task...', - 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...' + 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...', + confirmingTask: 'Confirming task...' }; const en_US = en_US_data; const languages = { @@ -9733,6 +9735,9 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); } async verifyTask() { try { + if (!this.initialized) { + this.init(); + } const tasks = $.makeArray($('div.w-full').find('.items-center').has('button.submit-loader')).map(ele => ({ token: $(ele).find('input[name="_token"]').val(), taskId: $(ele).find('input[name="task_id"]').val(), @@ -9807,7 +9812,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); data } = await tools_httpRequest({ url: `https://opquests.com/quests/${this.giveawayId}?confirm=1`, - method: 'POST', + method: 'GET', nochche: true, headers: { origin: 'https://opquests.com', diff --git a/dist/auto-task-v4.compatibility.all.user.js b/dist/auto-task-v4.compatibility.all.user.js index 6068d5b..dda4fc4 100644 --- a/dist/auto-task-v4.compatibility.all.user.js +++ b/dist/auto-task-v4.compatibility.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.2.32 +// @version 4.2.33 // @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 @@ -120,7 +120,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); ${text}]...`);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ ${null===text||void 0===text?void 0:text.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),null!==(_ele$=ele[0])&&void 0!==_ele$&&_ele$.scrollIntoView(),{font:ele.find("font"),success(){var _this$font,_this$font3,text=0{try{return[...new Set(array)]}catch(error){return throwError(error,"unique"),[]}},getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(data=>{data=data.data;return null!=data&&data.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null})}catch(error){return throwError(error,"getRedirectLink"),null}},visitLink=async(link,options)=>{try{const logStatus=scripts_echoLog({type:"visitLink",text:link});return await tools_httpRequest({url:link,method:"GET",...options}).then(status=>{var{result,statusText,status}=status;return"Success"===result?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)})}catch(error){return throwError(error,"visitLink"),!1}};const stringToColour=str=>{try{let hash=0;for(let i=0;i>8*i&255;colour+=("00"+value.toString(16)).slice(-2)}return colour}catch(error){return throwError(error,"stringToColour"),"#fff"}},defaultGlobalOptions={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,officialGroups:!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,officialGroups:!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,debug:!1,receivePreview:!0}};var external_keyboardJS_namespaceObject=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,external_keyboardJS_namespaceObject),saveData=()=>{try{const data={};$("#globalOptionsForm").serializeArray().map(value=>(data[value.name]=value.value,value)),$.makeArray($("#globalOptionsForm input")).map(element=>{const name=$(element).attr("name");var keys=name.split(".");return 3===keys.length?globalOptions[keys[0]][keys[1]][keys[2]]=!!data[name]&&("on"===data[name]||data[name]):2===keys.length&&(globalOptions[keys[0]][keys[1]]=!!data[name]&&("on"===data[name]||data[name])),element}),GM_setValue("globalOptions",globalOptions),external_Swal_default().fire({title:i18n("changeGlobalOptionsSuccess"),icon:"success"})}catch(error){throwError(error,"saveData")}},changeGlobalOptions=showType=>{try{let globalOptionsForm=`
    - `;for(const[type,data1]of Object.entries(globalOptions))for(var[option,data2]of Object.entries(data1))if(["other","position","hotKey"].includes(type))"boolean"==typeof data2?globalOptionsForm+=`${0===Object.keys(data1).indexOf(option)?``:""}`:globalOptionsForm+=`${0===Object.keys(data1).indexOf(option)?``:""}`;else for(var[socialType,data3]of Object.entries(data2))globalOptionsForm+=`${0===Object.keys(data1).indexOf(option)?``:""}`;globalOptionsForm+="
    ${i18n("type")}${i18n("option")}${i18n("value")}
    ${i18n(type)}${i18n(option)}
    ${i18n(type)}${i18n(option)}
    ${i18n(type)}${option}.${i18n(socialType)}
    ","swal"===showType?external_Swal_default().fire({title:i18n("globalOptions"),html:globalOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(isConfirmed=>{isConfirmed=isConfirmed.isConfirmed;isConfirmed&&saveData()}):$("body").append(`

    ${i18n("globalOptions")}

    `+globalOptionsForm)}catch(error){throwError(error,"changeGlobalOptions")}};const languages={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凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%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:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",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:"远程数据格式错误",updateHistory:'历史更新记录点此查看',groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",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:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",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",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",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时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",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",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",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",updateHistory:'Click here to view the historical update record.',groups:"Group",officialGroups:"Official 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",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official 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",gettingCuratorId:"Getting Steam Curator Id",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",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",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",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",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",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",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!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",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..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=function(key){for(var _languages$language,_len=arguments.length,argvs=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)argvs[_key-1]=arguments[_key];return null!==(_languages$language=languages[language])&&void 0!==_languages$language&&_languages$language[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key};function throwError(error,name){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue"),external_Swal_default().fire({title:i18n("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:i18n("toGithub"),showDenyButton:!0,denyButtonText:i18n("toKeylol"),cancelButtonText:i18n("close")}).then(isConfirmed=>{var{isDenied:text,isConfirmed}=isConfirmed;isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] + `;for(const[type,data1]of Object.entries(globalOptions))for(var[option,data2]of Object.entries(data1))if(["other","position","hotKey"].includes(type))"boolean"==typeof data2?globalOptionsForm+=`${0===Object.keys(data1).indexOf(option)?``:""}`:globalOptionsForm+=`${0===Object.keys(data1).indexOf(option)?``:""}`;else for(var[socialType,data3]of Object.entries(data2))globalOptionsForm+=`${0===Object.keys(data1).indexOf(option)?``:""}`;globalOptionsForm+="
    ${i18n("type")}${i18n("option")}${i18n("value")}
    ${i18n(type)}${i18n(option)}
    ${i18n(type)}${i18n(option)}
    ${i18n(type)}${option}.${i18n(socialType)}
    ","swal"===showType?external_Swal_default().fire({title:i18n("globalOptions"),html:globalOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(isConfirmed=>{isConfirmed=isConfirmed.isConfirmed;isConfirmed&&saveData()}):$("body").append(`

    ${i18n("globalOptions")}

    `+globalOptionsForm)}catch(error){throwError(error,"changeGlobalOptions")}};const languages={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凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%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:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",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:"远程数据格式错误",updateHistory:'历史更新记录点此查看',groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",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:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",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",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",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时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",confirmingTask:"正在跳过警告页面..."},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",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",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",updateHistory:'Click here to view the historical update record.',groups:"Group",officialGroups:"Official 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",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official 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",gettingCuratorId:"Getting Steam Curator Id",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",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",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",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",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",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",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!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",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...",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=function(key){for(var _languages$language,_len=arguments.length,argvs=new Array(1<_len?_len-1:0),_key=1;_key<_len;_key++)argvs[_key-1]=arguments[_key];return null!==(_languages$language=languages[language])&&void 0!==_languages$language&&_languages$language[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key};function throwError(error,name){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue"),external_Swal_default().fire({title:i18n("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:i18n("toGithub"),showDenyButton:!0,denyButtonText:i18n("toKeylol"),cancelButtonText:i18n("close")}).then(isConfirmed=>{var{isDenied:text,isConfirmed}=isConfirmed;isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -134,7 +134,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); 执行日志: [code]${$.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")}[/code]`,GM_setClipboard(text),external_Swal_default().fire({title:i18n("copySuccess"),icon:"success",confirmButtonText:i18n("ok")}).then(()=>{window.open("https://keylol.com/forum.php?mod=post&action=reply&fid=319&tid=777450","_blank")}))}),console.log("%c%s","color:white;background:red",`Auto-Task[Error]: ${name} -`+error.stack)}var website_Opquests=class{constructor(){var obj,key,value;value=void 0,(key="tasks")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=null===(auth=GM_getValue("discordAuth"))||void 0===auth?void 0:auth.auth;auth?(_classPrivateFieldSet(this,_auth,{auth:auth}),logStatus.success(),resolve(await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this))):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError(error,"Discord.updateAuth"),!1}}async function _joinServer2(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var _data$response,_data$response$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:_classPrivateFieldGet(this,_auth).auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(null===(_data$response=data.response)||void 0===_data$response||null===(_data$response$guild=_data$response.guild)||void 0===_data$response$guild?void 0:_data$response$guild.id);return guild&&(_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError(error,"Discord.joinServer"),!1}}async function _leaveServer2(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await _classPrivateMethodGet(this,_getGuild,_getGuild2).call(this,inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:_classPrivateFieldGet(this,_auth).auth}});return"Success"===result&&204===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Discord.leaveServer"),!1}}async function _getGuild2(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=_classPrivateFieldGet(this,_cache)[inviteId];if(guild)return logStatus.success(),guild;var _data$response2,_data$response2$guild,{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==(null==data?void 0:data.status))return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=null===(_data$response2=data.response)||void 0===_data$response2||null===(_data$response2$guild=_data$response2.guild)||void 0===_data$response2$guild?void 0:_data$response2$guild.id;return guild?(logStatus.success(),_classPrivateMethodGet(this,_setCache,_setCache2).call(this,inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError(error,"Discord.getGuild"),!1}}function _setCache2(inviteId,guild){try{_classPrivateFieldGet(this,_cache)[inviteId]=guild,GM_setValue("discordCache",_classPrivateFieldGet(this,_cache))}catch(error){throwError(error,"Discord.setCache")}}const social_Discord=class extends website_Opquests{constructor(){var _GM_getValue;super(...arguments),_classPrivateMethodInitSpec(this,_setCache),_classPrivateMethodInitSpec(this,_getGuild),_classPrivateMethodInitSpec(this,_leaveServer),_classPrivateMethodInitSpec(this,_joinServer),_classPrivateMethodInitSpec(this,_updateAuth),_classPrivateMethodInitSpec(this,_verifyAuth),Discord_defineProperty(this,"tasks",JSON.parse(defaultTasks)),Discord_defineProperty(this,"whiteList",{...JSON.parse(defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.discord}),_classPrivateFieldInitSpec(this,_auth,{writable:!0,value:GM_getValue("discordAuth")||{}}),_classPrivateFieldInitSpec(this,_cache,{writable:!0,value:GM_getValue("discordCache")||{}}),_classPrivateFieldInitSpec(this,_initialized,{writable:!0,value:!1})}async init(){try{if(!GM_getValue("dontRemindDiscordAgain"))if(!await external_Swal_default().fire({title:i18n("discordImportantNotice"),text:i18n("discordImportantNoticeText"),showCancelButton:!0,showDenyButton:!0,confirmButtonText:i18n("continue"),cancelButtonText:i18n("skipDiscordTask"),denyButtonText:i18n("continueAndDontRemindAgain")}).then(isDenied=>{var{isConfirmed,isDenied}=isDenied;return!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)}))return _classPrivateFieldSet(this,_initialized,!1),"skip";return globalOptions.doTask.discord.servers||globalOptions.undoTask.discord.servers?!!_classPrivateFieldGet(this,_initialized)||(_classPrivateFieldGet(this,_auth).auth?await _classPrivateMethodGet(this,_verifyAuth,_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(GM_setValue("discordAuth",{auth:null}),await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),_classPrivateFieldSet(this,_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await _classPrivateMethodGet(this,_updateAuth,_updateAuth2).call(this)&&(_classPrivateFieldSet(this,_initialized,!0),!0)):(_classPrivateFieldSet(this,_initialized,!1),"skip")}catch(error){return throwError(error,"Discord.init"),!1}}async toggle(serverLinks){var{doTask=!0,serverLinks=[]}=serverLinks;try{if(!_classPrivateFieldGet(this,_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/invite\/(.+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError(error,"Discord.toggleServers"),!1}}};function Instagram_classPrivateMethodInitSpec(obj,privateSet){Instagram_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Instagram_classPrivateFieldInitSpec(obj,privateMap,value){Instagram_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Instagram_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Instagram_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Instagram_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Instagram_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Instagram_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Instagram_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Instagram_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Instagram_defaultTasks=JSON.stringify({users:[]});var Instagram_cache=new WeakMap,Instagram_auth=new WeakMap,Instagram_initialized=new WeakMap,_getUserInfo=new WeakSet,_followUser=new WeakSet,_unfollowUser=new WeakSet,Instagram_setCache=new WeakSet;async function _getUserInfo2(){var name=0{return null===(_link$match=_link$match.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError(error,"Instagram.toggleUsers"),!1}}};function Reddit_classPrivateMethodInitSpec(obj,privateSet){Reddit_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Reddit_classPrivateFieldInitSpec(obj,privateMap,value){Reddit_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Reddit_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Reddit_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Reddit_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Reddit_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Reddit_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Reddit_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Reddit_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Reddit_defaultTasks=JSON.stringify({reddits:[]});var Reddit_auth=new WeakMap,Reddit_initialized=new WeakMap,_useBeta=new WeakSet,Reddit_updateAuth=new WeakSet;async function _useBeta2(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await Reddit_classPrivateMethodGet(this,Reddit_updateAuth,Reddit_updateAuth2).call(this,!0))}})}catch(error){return throwError(error,"Reddit.useBeta"),!1}}async function Reddit_updateAuth2(){var _data$responseText$ma,beta=0{var name=null===(name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===name?void 0:name[1],userName=null===(userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===userName?void 0:userName[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError(error,"Reddit.toggle"),!1}}};function Twitch_classPrivateMethodInitSpec(obj,privateSet){Twitch_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Twitch_classPrivateFieldInitSpec(obj,privateMap,value){Twitch_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Twitch_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Twitch_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Twitch_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Twitch_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Twitch_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Twitch_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Twitch_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Twitch_defaultTasks=JSON.stringify({channels:[]});var Twitch_auth=new WeakMap,Twitch_cache=new WeakMap,Twitch_initialized=new WeakMap,_integrityToken=new WeakMap,Twitch_verifyAuth=new WeakSet,_integrity=new WeakSet,Twitch_updateAuth=new WeakSet,_toggleChannel=new WeakSet,_getChannelId=new WeakSet,Twitch_setCache=new WeakSet;async function Twitch_verifyAuth2(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var _data$response,_data$response$,_data$response$$data,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response=data.response)&&void 0!==_data$response&&null!==(_data$response$=_data$response[0])&&void 0!==_data$response$&&null!==(_data$response$$data=_data$response$.data)&&void 0!==_data$response$$data&&_data$response$$data.currentUser?(await Twitch_classPrivateMethodGet(this,_integrity,_integrity2).call(this,isFirst),logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Twitch.verifyAuth"),!1}}async function _integrity2(){var isFirst=!(0{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(Twitch_classPrivateFieldSet(this,Twitch_auth,auth),logStatus.success(),resolve(await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError(error,"Twitch.updateAuth"),!1}}async function _toggleChannel2(doTask){var{name,doTask=!0}=doTask;try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await Twitch_classPrivateMethodGet(this,_getChannelId,_getChannelId2).call(this,name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var _data$response3,_data$response4,_data$response4$0$err,_data$response4$0$err2,followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId,"Client-Version":Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion,"X-Device-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId,"Client-Session-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId,"Client-Integrity":Twitch_classPrivateFieldGet(this,_integrityToken)},data:doTask?followData:unfollowData});return"Success"===result?200===(null==data?void 0:data.status)&&null!==(_data$response3=data.response)&&void 0!==_data$response3&&_data$response3[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+((null==data||null===(_data$response4=data.response)||void 0===_data$response4||null===(_data$response4$0$err=_data$response4[0].errors)||void 0===_data$response4$0$err||null===(_data$response4$0$err2=_data$response4$0$err[0])||void 0===_data$response4$0$err2?void 0:_data$response4$0$err2.message)||`${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Twitch.toggleChannel"),!1}}async function _getChannelId2(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=Twitch_classPrivateFieldGet(this,Twitch_cache)[name];if(channelId)return logStatus.success(),channelId;var _data$response5,_data$response5$,_data$response5$$data,_data$response5$$data2,{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Twitch_classPrivateFieldGet(this,Twitch_auth).authToken,"Client-Id":Twitch_classPrivateFieldGet(this,Twitch_auth).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const channelId=null===(_data$response5=data.response)||void 0===_data$response5||null===(_data$response5$=_data$response5[0])||void 0===_data$response5$||null===(_data$response5$$data=_data$response5$.data)||void 0===_data$response5$$data||null===(_data$response5$$data2=_data$response5$$data.user)||void 0===_data$response5$$data2?void 0:_data$response5$$data2.id;return channelId?(Twitch_classPrivateMethodGet(this,Twitch_setCache,Twitch_setCache2).call(this,name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError(error,"Twitch.getChannelId"),!1}}function Twitch_setCache2(name,id){try{Twitch_classPrivateFieldGet(this,Twitch_cache)[name]=id,GM_setValue("twitchCache",Twitch_classPrivateFieldGet(this,Twitch_cache))}catch(error){throwError(error,"Twitch.setCache")}}const social_Twitch=class extends website_Opquests{constructor(){var _GM_getValue;super(...arguments),Twitch_classPrivateMethodInitSpec(this,Twitch_setCache),Twitch_classPrivateMethodInitSpec(this,_getChannelId),Twitch_classPrivateMethodInitSpec(this,_toggleChannel),Twitch_classPrivateMethodInitSpec(this,Twitch_updateAuth),Twitch_classPrivateMethodInitSpec(this,_integrity),Twitch_classPrivateMethodInitSpec(this,Twitch_verifyAuth),Twitch_defineProperty(this,"tasks",JSON.parse(Twitch_defaultTasks)),Twitch_defineProperty(this,"whiteList",{...JSON.parse(Twitch_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.twitch}),Twitch_classPrivateFieldInitSpec(this,Twitch_auth,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_cache,{writable:!0,value:GM_getValue("twitchCache")||{}}),Twitch_classPrivateFieldInitSpec(this,Twitch_initialized,{writable:!0,value:!1}),Twitch_classPrivateFieldInitSpec(this,_integrityToken,{writable:!0,value:void 0})}async init(){try{return Twitch_classPrivateFieldGet(this,Twitch_initialized)?!0:Twitch_classPrivateFieldGet(this,Twitch_auth).authToken&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientVersion&&Twitch_classPrivateFieldGet(this,Twitch_auth).deviceId&&Twitch_classPrivateFieldGet(this,Twitch_auth).clientSessionId?await Twitch_classPrivateMethodGet(this,Twitch_verifyAuth,Twitch_verifyAuth2).call(this,!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(GM_setValue("twitchAuth",null),await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await Twitch_classPrivateMethodGet(this,Twitch_updateAuth,Twitch_updateAuth2).call(this)&&(Twitch_classPrivateFieldSet(this,Twitch_initialized,!0),!0)}catch(error){return throwError(error,"Twitch.init"),!1}}async toggle(channelLinks){var{doTask=!0,channelLinks=[]}=channelLinks;try{if(!Twitch_classPrivateFieldGet(this,Twitch_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===_link$match?void 0:_link$match[2]});if(0!0)}catch(error){return throwError(error,"Twitch.toggle"),!1}}};function Twitter_classPrivateMethodInitSpec(obj,privateSet){Twitter_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Twitter_classPrivateFieldInitSpec(obj,privateMap,value){Twitter_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Twitter_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Twitter_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Twitter_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Twitter_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Twitter_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Twitter_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Twitter_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Twitter_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Twitter_defaultTasks=JSON.stringify({users:[],retweets:[],likes:[]});var _verifyId=new WeakMap,Twitter_auth=new WeakMap,Twitter_cache=new WeakMap,Twitter_initialized=new WeakMap,Twitter_verifyAuth=new WeakSet,Twitter_updateAuth=new WeakSet,_toggleUser=new WeakSet,_toggleRetweet=new WeakSet,Twitter_setCache=new WeakSet;async function Twitter_verifyAuth2(){try{return await Twitter_classPrivateMethodGet(this,_toggleUser,_toggleUser2).call(this,{name:"verify",doTask:!0,verify:!0})}catch(error){return throwError(error,"Twitter.verifyAuth"),!1}}async function Twitter_updateAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitter")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://twitter.com/settings/account?k#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitterAuth");auth?(Twitter_classPrivateFieldSet(this,Twitter_auth,auth),logStatus.success(),resolve(await Twitter_classPrivateMethodGet(this,Twitter_verifyAuth,Twitter_verifyAuth2).call(this))):(logStatus.error("Error: Update twitter auth failed!"),resolve(!1))}})}catch(error){return throwError(error,"Twitter.updateToken"),!1}}async function _toggleUser2(verify){var{name,doTask=!0,verify=!1}=verify;try{if(!doTask&&!verify&&this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitter.unfollowUser",id:name}),!0;var userId=verify?Twitter_classPrivateFieldGet(this,_verifyId):await this.userName2id(name);if(!userId)return!1;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Twitter")}):scripts_echoLog({type:`${doTask?"":"un"}followingTwitterUser`,text:name});var _data$response,_data$response$errors,_data$response$errors2,{result,statusText,status,data}=await tools_httpRequest({url:`https://api.twitter.com/1.1/friendships/${doTask?"create":"destroy"}.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":Twitter_classPrivateFieldGet(this,Twitter_auth).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:userId})});return"Success"===result?200===(null==data?void 0:data.status)?(logStatus.success(),doTask&&!verify&&(this.tasks.users=unique([...this.tasks.users,name])),!0):verify&&403===(null==data?void 0:data.status)&&158===(null===(_data$response=data.response)||void 0===_data$response||null===(_data$response$errors=_data$response.errors)||void 0===_data$response$errors||null===(_data$response$errors2=_data$response$errors[0])||void 0===_data$response$errors2?void 0:_data$response$errors2.code)?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Twitter.toggleUser"),!1}}async function _toggleRetweet2(doTask){var{retweetId,doTask=!0}=doTask;try{if(!doTask&&this.whiteList.retweets.includes(retweetId))return scripts_echoLog({type:"whiteList",text:"Twitter.unretweet",id:retweetId}),!0;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}retweetting`,text:retweetId});var _data$response2,_data$response2$error,_data$response2$error2,{result,statusText,status,data}=await tools_httpRequest({url:`https://api.twitter.com/1.1/statuses/${doTask?"":"un"}retweet.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":Twitter_classPrivateFieldGet(this,Twitter_auth).ct0},data:$.param({tweet_mode:"extended",id:retweetId}),responseType:"json"});return"Success"===result?200===(null==data?void 0:data.status)||403===(null==data?void 0:data.status)&&327===(null===(_data$response2=data.response)||void 0===_data$response2||null===(_data$response2$error=_data$response2.errors)||void 0===_data$response2$error||null===(_data$response2$error2=_data$response2$error[0])||void 0===_data$response2$error2?void 0:_data$response2$error2.code)?(logStatus.success(),doTask&&(this.tasks.retweets=unique([...this.tasks.retweets,retweetId])),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Twitter.toggleRetweet"),!1}}function Twitter_setCache2(name,id){try{Twitter_classPrivateFieldGet(this,Twitter_cache)[name]=id,GM_setValue("twitterCache",Twitter_classPrivateFieldGet(this,Twitter_cache))}catch(error){throwError(error,"Twitter.setCache")}}const social_Twitter=class extends website_Opquests{constructor(){var _GM_getValue;super(...arguments),Twitter_classPrivateMethodInitSpec(this,Twitter_setCache),Twitter_classPrivateMethodInitSpec(this,_toggleRetweet),Twitter_classPrivateMethodInitSpec(this,_toggleUser),Twitter_classPrivateMethodInitSpec(this,Twitter_updateAuth),Twitter_classPrivateMethodInitSpec(this,Twitter_verifyAuth),Twitter_defineProperty(this,"tasks",JSON.parse(Twitter_defaultTasks)),Twitter_defineProperty(this,"whiteList",{...JSON.parse(Twitter_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.twitter}),Twitter_classPrivateFieldInitSpec(this,_verifyId,{writable:!0,value:globalOptions.other.twitterVerifyId}),Twitter_classPrivateFieldInitSpec(this,Twitter_auth,{writable:!0,value:GM_getValue("twitterAuth")||{}}),Twitter_classPrivateFieldInitSpec(this,Twitter_cache,{writable:!0,value:GM_getValue("twitterCache")||{}}),Twitter_classPrivateFieldInitSpec(this,Twitter_initialized,{writable:!0,value:!1})}async init(){try{return Twitter_classPrivateFieldGet(this,Twitter_initialized)?!0:Twitter_classPrivateFieldGet(this,Twitter_auth).ct0?await Twitter_classPrivateMethodGet(this,Twitter_verifyAuth,Twitter_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitter")),Twitter_classPrivateFieldSet(this,Twitter_initialized,!0),!0):(GM_setValue("twitterAuth",null),await Twitter_classPrivateMethodGet(this,Twitter_updateAuth,Twitter_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Twitter")),Twitter_classPrivateFieldSet(this,Twitter_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Twitter")),!1)):!!await Twitter_classPrivateMethodGet(this,Twitter_updateAuth,Twitter_updateAuth2).call(this)&&(Twitter_classPrivateFieldSet(this,Twitter_initialized,!0),!0)}catch(error){return throwError(error,"Twitter.init"),!1}}async userName2id(name){try{const logStatus=scripts_echoLog({type:"gettingTwitterUserId",text:name});var userId=Twitter_classPrivateFieldGet(this,Twitter_cache)[name];if(userId)return logStatus.success(),userId;var _response,_response$data,_response$data$user,_response$data$user$r,{result,statusText,status,data}=await tools_httpRequest({url:"https://api.twitter.com/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${name}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json",referer:"https://twitter.com/"+name,"x-csrf-token":Twitter_classPrivateFieldGet(this,Twitter_auth).ct0},responseType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{let response=data.response||("object"==typeof data.responseText?data.responseText:null);if(!response)try{response=JSON.parse(data.responseText)}catch(error){response=null}const userId=String(null===(_response=response)||void 0===_response||null===(_response$data=_response.data)||void 0===_response$data||null===(_response$data$user=_response$data.user)||void 0===_response$data$user||null===(_response$data$user$r=_response$data$user.result)||void 0===_response$data$user$r?void 0:_response$data$user$r.rest_id);return userId?(Twitter_classPrivateMethodGet(this,Twitter_setCache,Twitter_setCache2).call(this,name,userId),logStatus.success(),userId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError(error,"Twitter.getUserId"),!1}}async toggle(retweetLinks){var{doTask=!0,userLinks=[],retweetLinks=[]}=retweetLinks;try{if(!Twitter_classPrivateFieldGet(this,Twitter_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitter.users||!doTask&&!globalOptions.undoTask.twitter.users)scripts_echoLog({type:"globalOptionsSkip",text:"twitter.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,_link$match=>{return null===(_link$match=_link$match.match(/https:\/\/twitter\.com\/(.+)/))||void 0===_link$match?void 0:_link$match[1]});if(0{return null===(_link$match2=_link$match2.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===_link$match2?void 0:_link$match2[1]});if(0!0)}catch(error){return throwError(error,"Twitter.toggle"),!1}}};function Vk_classPrivateMethodInitSpec(obj,privateSet){Vk_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Vk_classPrivateFieldInitSpec(obj,privateMap,value){Vk_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Vk_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vk_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Vk_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Vk_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Vk_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Vk_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Vk_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Vk_defaultTasks=JSON.stringify({names:[]});var _username=new WeakMap,Vk_cache=new WeakMap,Vk_initialized=new WeakMap,Vk_verifyAuth=new WeakSet,_toggleGroup=new WeakSet,_togglePublic=new WeakSet,_sendWall=new WeakSet,_deleteWall=new WeakSet,_getId=new WeakSet,_toggleVk=new WeakSet,Vk_setCache=new WeakSet;async function Vk_verifyAuth2(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});var _data$responseText$ma;return"Success"===result?null!==data&&void 0!==data&&data.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===(null===data||void 0===data?void 0:data.status)?(Vk_classPrivateFieldSet(this,_username,(null===(_data$responseText$ma=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1])||""),logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Vk.verifyAuth"),!1}}async function _toggleGroup2(name,dataParam){var doTask=!(2{return null===(_link$match=_link$match.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===_link$match?void 0:_link$match[1]});if(0!0)}catch(error){return throwError(error,"Vk.toggle"),!1}}};function Youtube_classPrivateMethodInitSpec(obj,privateSet){Youtube_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Youtube_classPrivateFieldInitSpec(obj,privateMap,value){Youtube_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Youtube_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Youtube_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Youtube_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Youtube_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Youtube_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Youtube_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Youtube_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Youtube_defaultTasks=JSON.stringify({channels:[],likes:[]}),getInfo=async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};{var _data$responseText$ma,_ref;if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=null===(_data$responseText$ma=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1],context=(null===(_ref=data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===_ref?void 0:_ref[1])||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var _data$responseText$ma2,channelId=null===(_data$responseText$ma2=data.responseText.match(//))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var _data$responseText$ma3,_data$responseText$ma4,videoId=null===(_data$responseText$ma3=data.responseText.match(//))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],likeParams=null===(_data$responseText$ma4=data.responseText.match(/"likeParams":"(.*?)"/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError(error,"Youtube.getInfo"),{}}};var Youtube_auth=new WeakMap,Youtube_initialized=new WeakMap,_verifyChannel=new WeakMap,Youtube_verifyAuth=new WeakSet,Youtube_updateAuth=new WeakSet,_getInfo=new WeakSet,Youtube_toggleChannel=new WeakSet,_toggleLikeVideo=new WeakSet;class Youtube extends website_Opquests{constructor(){var _GM_getValue;super(...arguments),Youtube_classPrivateMethodInitSpec(this,_toggleLikeVideo),Youtube_classPrivateMethodInitSpec(this,Youtube_toggleChannel),Youtube_classPrivateMethodInitSpec(this,_getInfo),Youtube_classPrivateMethodInitSpec(this,Youtube_updateAuth),Youtube_classPrivateMethodInitSpec(this,Youtube_verifyAuth),Youtube_defineProperty(this,"tasks",JSON.parse(Youtube_defaultTasks)),Youtube_defineProperty(this,"whiteList",{...JSON.parse(Youtube_defaultTasks),...null===(_GM_getValue=GM_getValue("whiteList"))||void 0===_GM_getValue?void 0:_GM_getValue.youtube}),Youtube_classPrivateFieldInitSpec(this,Youtube_auth,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),Youtube_classPrivateFieldInitSpec(this,Youtube_initialized,{writable:!0,value:!1}),Youtube_classPrivateFieldInitSpec(this,_verifyChannel,{writable:!0,value:"https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel})}async init(){try{return Youtube_classPrivateFieldGet(this,Youtube_initialized)?!0:Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID?await Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(GM_setValue("youtubeAuth",null),await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await Youtube_classPrivateMethodGet(this,Youtube_updateAuth,Youtube_updateAuth2).call(this)&&(Youtube_classPrivateFieldSet(this,Youtube_initialized,!0),!0)}catch(error){return throwError(error,"Youtube.init"),!1}}async toggle(videoLinks){var{doTask=!0,channelLinks=[],videoLinks=[]}=videoLinks;try{if(!Youtube_classPrivateFieldGet(this,Youtube_initialized))return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>{var _link$match;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match?void 0:_link$match[1]:link});if(0{var _link$match2;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?null===(_link$match2=link.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===_link$match2?void 0:_link$match2[1]:link});if(0!0)}catch(error){return throwError(error,"Youtube.toggle"),!1}}}async function Youtube_verifyAuth2(){try{return await Youtube_classPrivateMethodGet(this,Youtube_toggleChannel,Youtube_toggleChannel2).call(this,{link:Youtube_classPrivateFieldGet(this,_verifyChannel),doTask:!0,verify:!0})}catch(error){return throwError(error,"Youtube.verifyAuth"),!1}}async function Youtube_updateAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("youtubeAuth");auth?(Youtube_classPrivateFieldSet(this,Youtube_auth,auth),logStatus.success(),Youtube_classPrivateMethodGet(this,Youtube_verifyAuth,Youtube_verifyAuth2).call(this).then(result=>{resolve(result)})):(logStatus.error("Error: Update youtube auth failed!"),resolve(!1))}})}catch(error){return throwError(error,"Discord.updateAuth"),!1}}function _getInfo2(link,type){return getInfo(link,type)}async function Youtube_toggleChannel2(verify){var{link,doTask=!0,verify=!1}=verify;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==client?void 0:client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:null==request?void 0:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&(/"subscribed": true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed": false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Youtube.toggleChannel"),!1}}async function _toggleLikeVideo2(doTask){var{link,doTask=!0}=doTask;try{var{params,needLogin}=await Youtube_classPrivateMethodGet(this,_getInfo,_getInfo2).call(this,link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${Youtube_classPrivateFieldGet(this,Youtube_auth).PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Youtube.toggleLikeVideo"),!1}}function Steam_classPrivateMethodInitSpec(obj,privateSet){Steam_checkPrivateRedeclaration(obj,privateSet),privateSet.add(obj)}function Steam_classPrivateFieldInitSpec(obj,privateMap,value){Steam_checkPrivateRedeclaration(obj,privateMap),privateMap.set(obj,value)}function Steam_checkPrivateRedeclaration(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Steam_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Steam_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}function Steam_classPrivateFieldSet(receiver,privateMap,value){return function(receiver,descriptor,value){if(descriptor.set)descriptor.set.call(receiver,value);else{if(!descriptor.writable)throw new TypeError("attempted to set read only private field");descriptor.value=value}}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"set"),value),value}function Steam_classPrivateFieldGet(receiver,privateMap){return function(receiver,descriptor){if(descriptor.get)return descriptor.get.call(receiver);return descriptor.value}(receiver,Steam_classExtractFieldDescriptor(receiver,privateMap,"get"))}function Steam_classExtractFieldDescriptor(receiver,privateMap,action){if(!privateMap.has(receiver))throw new TypeError("attempted to "+action+" private field on non-instance");return privateMap.get(receiver)}const Steam_defaultTasks=JSON.stringify({groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]});var Steam_cache=new WeakMap,Steam_auth=new WeakMap,_storeInitialized=new WeakMap,_communityInitialized=new WeakMap,_area=new WeakMap,_areaStatus=new WeakMap,_refreshStoreToken=new WeakSet,_setStoreToken=new WeakSet,_updateStoreAuth=new WeakSet,_updateCommunityAuth=new WeakSet,_getAreaInfo=new WeakSet,_changeArea=new WeakSet,_joinGroup=new WeakSet,_leaveGroup=new WeakSet,_getGroupId=new WeakSet,_joinOfficialGroup=new WeakSet,_leaveOfficialGroup=new WeakSet,_getOfficialGroupId=new WeakSet,_addToWishlist=new WeakSet,_removeFromWishlist=new WeakSet,_toggleFollowGame=new WeakSet,_isFollowedGame=new WeakSet,_toggleForum=new WeakSet,_getForumId=new WeakSet,_toggleFavoriteWorkshop=new WeakSet,_getWorkshopAppId=new WeakSet,_voteUpWorkshop=new WeakSet,_toggleCurator=new WeakSet,_toggleCuratorLike=new WeakSet,_getAnnouncementParams=new WeakSet,_likeAnnouncement=new WeakSet,_appid2subid=new WeakSet,_getLicenses=new WeakSet,_addLicense=new WeakSet,_addFreeLicense=new WeakSet,_requestPlayTestAccess=new WeakSet,Steam_setCache=new WeakSet;async function _refreshStoreToken2(){try{const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n("steamStore"))}),formData=new FormData;formData.append("redir","https://store.steampowered.com/");var _data$response,{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/"},data:formData});return"Success"===result?null!=data&&null!==(_data$response=data.response)&&void 0!==_data$response&&_data$response.success?await Steam_classPrivateMethodGet(this,_setStoreToken,_setStoreToken2).call(this,data.response)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Steam.refreshStoreToken"),!1}}async function _setStoreToken2(param){try{const logStatus=scripts_echoLog({text:i18n("settingToken",i18n("steamStore"))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/login/settoken",method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/login"},data:formData});return"Success"===result?200===(null==data?void 0:data.status)?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Steam.setStoreToken"),!1}}async function _updateStoreAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma2;if(!data.responseText.includes("data-miniprofile="))return await Steam_classPrivateMethodGet(this,_refreshStoreToken,_refreshStoreToken2).call(this),logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1;var storeSessionID=null===(_data$responseText$ma2=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma2?void 0:_data$responseText$ma2[1];return storeSessionID?(Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError(error,"Steam.updateStoreAuth"),!1}}async function _updateCommunityAuth2(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma3,_data$responseText$ma4,_data$responseText$ma5;if(data.responseText.includes('href="https://steamcommunity.com/login/home/'))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=null===(_data$responseText$ma3=data.responseText.match(/g_steamID = "(.+?)";/))||void 0===_data$responseText$ma3?void 0:_data$responseText$ma3[1],communitySessionID=null===(_data$responseText$ma4=data.responseText.match(/g_sessionID = "(.+?)";/))||void 0===_data$responseText$ma4?void 0:_data$responseText$ma4[1],userName=null===(_data$responseText$ma5=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===_data$responseText$ma5?void 0:_data$responseText$ma5[1];return(steam64Id&&(Steam_classPrivateFieldGet(this,Steam_auth).steam64Id=steam64Id),userName&&(Steam_classPrivateFieldGet(this,Steam_auth).userName=userName),communitySessionID)?(Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError(error,"Steam.updateCommunityAuth"),!1}}async function _getAreaInfo2(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),{};var _data$responseText$ma6,currentArea=null===(_data$responseText$ma6=data.responseText.match(//g)].map(search=>search[1]);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==Steam_classPrivateFieldGet(this,_areaStatus)&&(clearInterval(checker),resolve(!0))})}),Steam_classPrivateFieldGet(this,_area)===area||!area&&"CN"!==Steam_classPrivateFieldGet(this,_area))return!0;Steam_classPrivateFieldSet(this,_areaStatus,"waiting");let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this);if(!currentArea||!areas)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),!1;if("CN"!==currentArea)return Steam_classPrivateFieldSet(this,_areaStatus,"skip"),scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return Steam_classPrivateFieldSet(this,_areaStatus,"noAnotherArea"),scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID})});if("Success"!==result)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==(null==data?void 0:data.status)||"true"!==data.responseText)return Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),"CN";var currentArea=(await Steam_classPrivateMethodGet(this,_getAreaInfo,_getAreaInfo2).call(this))["currentArea"];return currentArea===aimedArea?(Steam_classPrivateFieldSet(this,_areaStatus,"success"),logStatus.success(),currentArea):(Steam_classPrivateFieldSet(this,_areaStatus,"error"),logStatus.error("Error: change country filed"),"CN")}catch(error){return Steam_classPrivateFieldSet(this,_areaStatus,"error"),throwError(error,"Steam.changeArea"),!1}}async function _joinGroup2(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Steam.joinGroup"),!1}}async function _leaveGroup2(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getGroupId,_getGroupId2).call(this,groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Steam.leaveGroup"),!1}}async function _getGroupId2(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var _data$responseText$ma7,groupId=Steam_classPrivateFieldGet(this,Steam_cache).group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma7=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===_data$responseText$ma7?void 0:_data$responseText$ma7[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError(error,"Steam.getGroupID"),!1}}async function _joinOfficialGroup2(gameId){try{const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status)||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;var _data$responseText$ma8;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=null===(_data$responseText$ma8=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma8?void 0:_data$responseText$ma8[1];return groupId&&Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),!0}catch(error){return throwError(error,"Steam.joinOfficialGroup"),!1}}async function _leaveOfficialGroup2(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;var groupId=await Steam_classPrivateMethodGet(this,_getOfficialGroupId,_getOfficialGroupId2).call(this,gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${Steam_classPrivateFieldGet(this,Steam_auth).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null==data?void 0:data.status))return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError(error,"Steam.leaveOfficialGroup"),!1}}async function _getOfficialGroupId2(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var _data$responseText$ma9,groupId=Steam_classPrivateFieldGet(this,Steam_cache).officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==(null===data||void 0===data?void 0:data.status))return logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`),!1;{const groupId=null===(_data$responseText$ma9=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/))||void 0===_data$responseText$ma9?void 0:_data$responseText$ma9[1];return groupId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError(error,"Steam.getGroupID"),!1}}async function _addToWishlist2(gameId){try{var _data$response2;const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response2=data.response)||void 0===_data$response2?void 0:_data$response2.success))return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===(null===dataR||void 0===dataR?void 0:dataR.status)?"CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_addToWishlist,_addToWishlist2).call(this,gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError(error,"Steam.addToWishlist"),!1}}async function _removeFromWishlist2(gameId){try{var _data$response3;if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===(null==data?void 0:data.status)&&!0===(null===(_data$response3=data.response)||void 0===_data$response3?void 0:_data$response3.success))return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==(null===dataR||void 0===dataR?void 0:dataR.status))return logStatus.error(`Error:${null===dataR||void 0===dataR?void 0:dataR.statusText}(${null===dataR||void 0===dataR?void 0:dataR.status})`),!1;if("CN"===Steam_classPrivateFieldGet(this,_area)&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this);return result&&"CN"!==result&&"skip"!==result?await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError(error,"Steam.removeFromWishlist"),!1}}async function _toggleFollowGame2(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:Steam_classPrivateFieldGet(this,Steam_auth).storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===(null==data?void 0:data.status)&&"true"===data.responseText)return logStatus.success(),!0;var followed=await Steam_classPrivateMethodGet(this,_isFollowedGame,_isFollowedGame2).call(this,gameId);return"CN"===Steam_classPrivateFieldGet(this,_area)&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this)&&await Steam_classPrivateMethodGet(this,_removeFromWishlist,_removeFromWishlist2).call(this,gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1)}catch(error){return throwError(error,"Steam.toggleFollowGame"),!1}}async function _isFollowedGame2(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===(null===data||void 0===data?void 0:data.status)&&("CN"===Steam_classPrivateFieldGet(this,_area)&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError(error,"Steam.isFollowedGame"),!1}}async function _toggleForum2(gameId){var doTask=!(1/))||void 0===_data$responseText$ma11?void 0:_data$responseText$ma11[1];return appId?(Steam_classPrivateMethodGet(this,Steam_setCache,Steam_setCache2).call(this,"workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError(error,"Steam.getWorkshopAppId"),!1}}async function _voteUpWorkshop2(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var _data$response6,{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:Steam_classPrivateFieldGet(this,Steam_auth).communitySessionID})});return"Success"===result?(200===(null==data?void 0:data.status)&&1===(null===(_data$response6=data.response)||void 0===_data$response6?void 0:_data$response6.success)?logStatus.success():logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError(error,"Steam.voteupWorkshop"),!0}}async function _toggleCurator2(curatorId){var doTask=!(1{return null===(_link$match=_link$match.match(/groups\/(.+)\/?/))||void 0===_link$match?void 0:_link$match[1]});if(0{return null===(_link$match2=_link$match2.match(/games\/(.+)\/?/))||void 0===_link$match2?void 0:_link$match2[1]});if(0{return null===(_link$match3=_link$match3.match(/app\/([\d]+)/))||void 0===_link$match3?void 0:_link$match3[1]});if(0{return null===(_link$match4=_link$match4.match(/app\/([\d]+)/))||void 0===_link$match4?void 0:_link$match4[1]});if(0{return null===(_link$match5=_link$match5.match(/app\/([\d]+)/))||void 0===_link$match5?void 0:_link$match5[1]});if(0{return null===(_link$match6=_link$match6.match(/\?id=([\d]+)/))||void 0===_link$match6?void 0:_link$match6[1]});if(0{return null===(_link$match7=_link$match7.match(/\?id=([\d]+)/))||void 0===_link$match7?void 0:_link$match7[1]});if(doTask&&0{return null===(_link$match8=_link$match8.match(/curator\/([\d]+)/))||void 0===_link$match8?void 0:_link$match8[1]}),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,_link$match9=>{return null===(_link$match9=_link$match9.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===_link$match9?void 0:_link$match9.slice(1,3).join("/")});if(0{var _link$match10;return _link$match11.includes("store.steampowered.com")?null===(_link$match10=_link$match11.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===_link$match10?void 0:_link$match10.slice(1,3).join("/"):null===(_link$match11=_link$match11.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===_link$match11?void 0:_link$match11.slice(1,3).join("/")});if(doTask&&0{return null===(_link$match12=_link$match12.match(/app\/([\d]+)/))||void 0===_link$match12?void 0:_link$match12[1]});if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==Steam_classPrivateFieldGet(this,_area)&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await Steam_classPrivateMethodGet(this,_changeArea,_changeArea2).call(this,"CN")),!0))}catch(error){return throwError(error,"Steam.toggle"),!1}}};function Website_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Website_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Website_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}var _bind=new WeakSet;async function _bind2(name,init){try{return{name:name,result:await init}}catch(error){return throwError(error,"Website.bind"),{name:name,result:!1}}}var website_Website=class{constructor(){Website_classPrivateMethodInitSpec(this,_bind),Website_defineProperty(this,"undoneTasks",void 0),Website_defineProperty(this,"socialTasks",void 0),Website_defineProperty(this,"giveawayId",void 0),Website_defineProperty(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1}),Website_defineProperty(this,"initialized",!1),Website_defineProperty(this,"social",{})}async initSocial(action){try{const pro=[],tasks="do"===action?this.undoneTasks:this.socialTasks;var steamLength,steamCommunityLength;return tasks.discord&&(!(0[...total,...arr]).length)||this.socialInitialized.discord&&this.social.discord||(this.social.discord=new social_Discord,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"discord",this.social.discord.init())))),tasks.instagram&&(!(0[...total,...arr]).length)||this.socialInitialized.instagram&&this.social.instagram||(this.social.instagram=new social_Instagram,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"instagram",this.social.instagram.init())))),tasks.reddit&&(!(0[...total,...arr]).length)||this.socialInitialized.reddit&&this.social.reddit||(this.social.reddit=new social_Reddit,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"reddit",this.social.reddit.init())))),tasks.twitch&&(!(0[...total,...arr]).length)||this.socialInitialized.twitch&&this.social.twitch||(this.social.twitch=new social_Twitch,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"twitch",this.social.twitch.init())))),tasks.twitter&&(!(0[...total,...arr]).length)||this.socialInitialized.twitter&&this.social.twitter||(this.social.twitter=new social_Twitter,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"twitter",this.social.twitter.init())))),tasks.vk&&(!(0[...total,...arr]).length)||this.socialInitialized.vk&&this.social.vk||(this.social.vk=new social_Vk,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"vk",this.social.vk.init())))),tasks.youtube&&(!(0[...total,...arr]).length)||this.socialInitialized.youtube&&this.social.youtube||(this.social.youtube=new Youtube,pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"youtube",this.social.youtube.init())))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0{var _tasks$steam,_tasks$steam$type;return["groupLinks","officialGroupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&(null===(_tasks$steam=tasks.steam)||void 0===_tasks$steam||null===(_tasks$steam$type=_tasks$steam[type])||void 0===_tasks$steam$type?void 0:_tasks$steam$type.length)||0}).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(Website_classPrivateMethodGet(this,_bind,_bind2).call(this,"steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError(error,"Website.initSocial"),!1}}uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async toggleTask(action){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask(action))return!1;if(!await this.initSocial(action))return!1;const pro=[];var doTask="do"===action,tasks=doTask?this.undoneTasks:this.socialTasks;if("skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:doTask,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:doTask,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:doTask,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:doTask,...tasks.twitch})),this.social.twitter&&pro.push(this.social.twitter.toggle({doTask:doTask,...tasks.twitter})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:doTask,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:doTask,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:doTask,...tasks.steam})),this.social.visitLink&&tasks.links&&doTask)for(const link of tasks.links)pro.push(this.social.visitLink(link));return doTask&&tasks.extra&&this.extraDoTask&&0[...total,...arr]).length&&pro.push(this.extraDoTask(tasks.extra)),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError(error,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(error){return throwError(error,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(error){return throwError(error,"Website.undoTask"),!1}}};function FreeAnyWhere_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function FreeAnyWhere_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function FreeAnyWhere_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const FreeAnyWhere_defaultTasks=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}});var _getGiveawayId=new WeakSet,_verify=new WeakSet,_checkLeftKey=new WeakSet;function _getGiveawayId2(){try{var _window$location$href2,giveawayId=null===(_window$location$href2=window.location.href.match(/\/giveaway\/([\d]+)/))||void 0===_window$location$href2?void 0:_window$location$href2[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({}).error(i18n("getFailed","GiveawayId")),!1)}catch(error){throwError(error,"FreeAnyWhere.getGiveawayId")}}async function _verify2(task){try{const logStatus=scripts_echoLog({html:`
  • ${i18n("verifyingTask")}${task.title.trim()}...
  • `});var _data$response3,{result,statusText,status,data}=await tools_httpRequest({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/challenge-status/${task.id}/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":external_Cookies_namespaceObject.get("csrftoken")}});return"Success"===result?null!=data&&null!==(_data$response3=data.response)&&void 0!==_data$response3&&_data$response3.status?(logStatus.success(),!0):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Freeanywhere.verify"),!1}}async function _checkLeftKey2(){try{var _data$response4;if(!globalOptions.other.checkLeftKey)return!0;var data=(await tools_httpRequest({url:"https://freeanywhere.net/api/v1/widget/?format=json",method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token")}}))["data"];return null!=data&&null!==(_data$response4=data.response)&&void 0!==_data$response4&&_data$response4.giveaways.find(giveaway=>""+(null==giveaway?void 0:giveaway.id)===this.giveawayId)?!0:(await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0)}catch(error){return throwError(error,"Giveawaysu.checkLeftKey"),!1}}var website_FreeAnyWhere=class extends website_Website{constructor(){super(...arguments),FreeAnyWhere_classPrivateMethodInitSpec(this,_checkLeftKey),FreeAnyWhere_classPrivateMethodInitSpec(this,_verify),FreeAnyWhere_classPrivateMethodInitSpec(this,_getGiveawayId),FreeAnyWhere_defineProperty(this,"name","FreeAnyWhere"),FreeAnyWhere_defineProperty(this,"tasks",[]),FreeAnyWhere_defineProperty(this,"socialTasks",JSON.parse(FreeAnyWhere_defaultTasks)),FreeAnyWhere_defineProperty(this,"undoneTasks",JSON.parse(FreeAnyWhere_defaultTasks)),FreeAnyWhere_defineProperty(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}async init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),logStatus.warning(i18n("needLogin")),!1;if(window.location.href.includes("/login"))return logStatus.warning(i18n("needLogin")),!1;if(!/^https?:\/\/freeanywhere\.net\/#\/giveaway\/[\d]+/.test(window.location.href)){var _window$location$href,id=null===(_window$location$href=window.location.href.match(/https?:\/\/freeanywhere\.net\/.*?#\/giveaway\/([\d]+)/))||void 0===_window$location$href?void 0:_window$location$href[1];if(!id)return logStatus.error(i18n("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+id}return FreeAnyWhere_classPrivateMethodGet(this,_getGiveawayId,_getGiveawayId2).call(this)?(await FreeAnyWhere_classPrivateMethodGet(this,_checkLeftKey,_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed")),this.initialized=!0,logStatus.success(),!0):!1}catch(error){return throwError(error,"Freeanywhere.init"),!1}}async classifyTask(action){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")});var _GM_getValue;"undo"===action&&(this.socialTasks=(null===(_GM_getValue=GM_getValue("fawTasks-"+this.giveawayId))||void 0===_GM_getValue?void 0:_GM_getValue.tasks)||JSON.parse(FreeAnyWhere_defaultTasks));var{result,statusText,status,data}=await tools_httpRequest({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/?format=json`,method:"GET",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":external_Cookies_namespaceObject.get("csrftoken")},responseType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;var _data$response,tasks=null==data||null===(_data$response=data.response)||void 0===_data$response?void 0:_data$response.challenges;if(tasks){"verify"===action&&(this.tasks=[]);for(const task of tasks){var type=task.challenge,social=task.challenge_provider;const taskInfo={id:task.id,title:task.title};if("verify"!==action||task.is_success)switch(social){case"steam":switch(taskInfo.social="steam",type){case"WL":"undo"===action&&this.socialTasks.steam.wishlistLinks.push(task.link),"do"!==action||task.is_success||this.undoneTasks.steam.wishlistLinks.push(task.link);break;case"JTG":"undo"===action&&this.socialTasks.steam.groupLinks.push(task.link),"do"!==action||task.is_success||this.undoneTasks.steam.groupLinks.push(task.link);break;case"STC":"undo"===action&&this.socialTasks.steam.curatorLinks.push(task.link),"do"!==action||task.is_success||this.undoneTasks.steam.curatorLinks.push(task.link);break;case"GF":"undo"===action&&this.socialTasks.steam.followLinks.push(task.link),"do"!==action||task.is_success||this.undoneTasks.steam.followLinks.push(task.link)}break;case"vk-oauth2":"undo"===action&&this.socialTasks.vk.nameLinks.push(task.link),"do"!==action||task.is_success||this.undoneTasks.vk.nameLinks.push(task.link);break;case"website":break;default:scripts_echoLog({}).warning(i18n("unKnownTaskType")+": "+social)}else this.tasks.push(taskInfo)}return logStatus.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("fawTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}return logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1}catch(error){return throwError(error,"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 pro=[];for(const task of this.tasks)pro.push(FreeAnyWhere_classPrivateMethodGet(this,_verify,_verify2).call(this,task)),await delay(1e3);return await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!!await this.getKey(!0)}catch(error){return throwError(error,"Freeanywhere.verifyTask"),!1}}async getKey(initialized){try{if(!initialized&&!this.initialized&&!this.init())return!1;const logStatus=scripts_echoLog({text:i18n("gettingKey")});var _data$response2,{result,statusText,status,data}=await tools_httpRequest({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"===result?null!=data&&null!==(_data$response2=data.response)&&void 0!==_data$response2&&_data$response2.reward?(logStatus.success(),scripts_echoLog({}).success(data.response.reward),data.response.reward):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"FreeAnyWhere.getGiveawayId"),!1}}};function GiveawaySu_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function GiveawaySu_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function GiveawaySu_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const GiveawaySu_defaultTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};var _checkLogin=new WeakSet,GiveawaySu_checkLeftKey=new WeakSet,GiveawaySu_getGiveawayId=new WeakSet;class GiveawaySu extends website_Website{constructor(){super(...arguments),GiveawaySu_classPrivateMethodInitSpec(this,GiveawaySu_getGiveawayId),GiveawaySu_classPrivateMethodInitSpec(this,GiveawaySu_checkLeftKey),GiveawaySu_classPrivateMethodInitSpec(this,_checkLogin),GiveawaySu_defineProperty(this,"name","GiveawaySu"),GiveawaySu_defineProperty(this,"socialTasks",GiveawaySu_defaultTasks),GiveawaySu_defineProperty(this,"undoneTasks",GiveawaySu_defaultTasks),GiveawaySu_defineProperty(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{GiveawaySu_classPrivateMethodGet(this,_checkLogin,_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await GiveawaySu_classPrivateMethodGet(this,GiveawaySu_checkLeftKey,GiveawaySu_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed")),scripts_echoLog({}).warning(i18n("gsNotice"))}catch(error){throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!GiveawaySu_classPrivateMethodGet(this,GiveawaySu_getGiveawayId,GiveawaySu_getGiveawayId2).call(this)&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError(error,"Giveawaysu.init"),!1}}async classifyTask(action){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")});var _GM_getValue;if("undo"===action)return this.socialTasks=(null===(_GM_getValue=GM_getValue("gasTasks-"+this.giveawayId))||void 0===_GM_getValue?void 0:_GM_getValue.tasks)||GiveawaySu_defaultTasks,!0;const pro=[];var tasks=$("#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 task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(error){return throwError(error,"Giveawaysu.classifyTask"),!1}}}function _checkLogin2(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError(error,"Giveawaysu.checkLogin"),!1}}async function GiveawaySu_checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&0===$(".giveaway-key").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError(error,"Giveawaysu.checkLeftKey"),!1}}function GiveawaySu_getGiveawayId2(){var giveawayId=null===(giveawayId=window.location.href.match(/\/view\/([\d]+)/))||void 0===giveawayId?void 0:giveawayId[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}function Indiedb_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Indiedb_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Indiedb_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}var _join=new WeakSet,_do=new WeakSet,Indiedb_checkLogin=new WeakSet,Indiedb_checkLeftKey=new WeakSet;async function _join2(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return scripts_echoLog({}).error(i18n("needLogin")),!1;const currentoption=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(currentoption.text())){const logStatus=scripts_echoLog({text:i18n("joiningGiveaway")+"..."});var _data$response,_data$response4,_data$response5,_data$response2,_data$response3,{result,statusText,status,data}=await tools_httpRequest({url:currentoption.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"===result?200===(null==data?void 0:data.status)?null!==(_data$response=data.response)&&void 0!==_data$response&&_data$response.success?(currentoption.addClass("buttonentered").text("Success - Giveaway joined"),$("#giveawaysjoined").slideDown(),$("#giveawaysrecommend").slideDown(),logStatus.success("Success"+(null!==(_data$response2=data.response)&&void 0!==_data$response2&&_data$response2.text?":"+(null===(_data$response3=data.response)||void 0===_data$response3?void 0:_data$response3.text):"")),!0):(logStatus.error("Error"+(null!==(_data$response4=data.response)&&void 0!==_data$response4&&_data$response4.text?":"+(null===(_data$response5=data.response)||void 0===_data$response5?void 0:_data$response5.text):"")),!1):(logStatus.error(`Error:${null==data?void 0:data.statusText}(${null==data?void 0:data.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}return/success/gim.test($("a.buttonenter.buttongiveaway").text())?!0:(scripts_echoLog({}).warning(i18n("needJoinGiveaway")),!1)}catch(error){return throwError(error,"Indiedb.init"),!1}}async function _do2(){try{const id=$("script").map((index,_script$innerHTML$mat4)=>{var _script$innerHTML$mat,_script$innerHTML$mat2,_script$innerHTML$mat3,_script$innerHTML$mat5,_script$innerHTML$mat6;return/\$\(document\)/gim.test(_script$innerHTML$mat4.innerHTML)?[null===(_script$innerHTML$mat=_script$innerHTML$mat4.innerHTML.match(/"\/[\d]+"/gim))||void 0===_script$innerHTML$mat||null===(_script$innerHTML$mat2=_script$innerHTML$mat[0])||void 0===_script$innerHTML$mat2||null===(_script$innerHTML$mat3=_script$innerHTML$mat2.match(/[\d]+/))||void 0===_script$innerHTML$mat3?void 0:_script$innerHTML$mat3[0],null===(_script$innerHTML$mat4=_script$innerHTML$mat4.innerHTML.match(/"\/newsletter\/ajax\/subscribeprofile\/optin\/[\d]+"/gim))||void 0===_script$innerHTML$mat4||null===(_script$innerHTML$mat5=_script$innerHTML$mat4[0])||void 0===_script$innerHTML$mat5||null===(_script$innerHTML$mat6=_script$innerHTML$mat5.match(/[\d]+/))||void 0===_script$innerHTML$mat6?void 0:_script$innerHTML$mat6[0]]:null});if(2!==id.length)return scripts_echoLog({}).error(i18n("getFailed","TaskId")),!1;{const pro=[];for(const task of $("#giveawaysjoined a[class*=promo]")){const promo=$(task);if(!promo.hasClass("buttonentered")){const status=scripts_echoLog({text:`${i18n("doing")}:${promo.parents("p").text()}...`});if(/facebookpromo|twitterpromo|visitpromo/gim.test(task.className)){let text="";text=promo.hasClass("facebookpromo")?"facebookpromo":promo.hasClass("twitterpromo")?"twitterpromo":"visitpromo",pro.push(new Promise(resolve=>{$.ajax({type:"POST",url:urlPath(`/giveaways/ajax/${text}/`+id[0]),timeout:6e4,dataType:"json",data:{ajax:"t"},error(response,error,exception){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:response,error:error,exception:exception}),status.error("Error:An error has occurred performing the action requested. Please try again shortly."),resolve(!0)},success(response){response.success?(status.success("Success:"+response.text),promo.addClass("buttonentered").closest("p").html(promo.closest("p").find("span").html())):status.error("Error:"+response.text),resolve(!0)}})}))}else promo.hasClass("emailoptinpromo")?pro.push(new Promise(resolve=>{$.ajax({type:"POST",url:urlPath("/newsletter/ajax/subscribeprofile/optin/"+id[1]),timeout:6e4,dataType:"json",data:{ajax:"t",emailsystoggle:4},error(response,error,exception){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:response,error:error,exception:exception}),status.error("Error:An error has occurred performing the action requested. Please try again shortly."),resolve(!0)},success(response){response.success?(status.success("Success:"+response.text),promo.toggleClass("buttonentered").closest("p").html(promo.closest("p").find("span").html())):status.error("Error:"+response.text),resolve(!0)}})})):promo.hasClass("watchingpromo")?pro.push(new Promise(resolve=>{var _promo$attr;const data=(url=>{try{const query={};return url?url.includes("?")&&url.split("?")[1].replace(/([^?&=]+)=([^&]+)/g,(str,key,value)=>(query[key]=value,str)):window.location.search.replace(/([^?&=]+)=([^&]+)/g,(str,key,value)=>(query[key]=value,str)),query}catch(error){return throwError(error,"getUrlQuery"),{}}})(promo.attr("href"));data.ajax="t",$.ajax({type:"POST",url:urlPath(null===(_promo$attr=promo.attr("href"))||void 0===_promo$attr?void 0:_promo$attr.split(/[?#]/)[0]),timeout:6e4,dataType:"json",data:data,error(response,error,exception){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:response,error:error,exception:exception}),status.error("Error:An error has occurred performing the action requested. Please try again shortly."),resolve(!0)},success(response){response.success?(status.success("Success:"+response.text),promo.toggleClass("buttonentered").closest("p").html(promo.closest("p").find("span").html())):status.error("Error:"+response.text),resolve(!0)}})})):/the-challenge-of-adblock/gim.test(promo.attr("href"))?status.error("Error:"+i18n("unKnownTaskType")):pro.push(new Promise(resolve=>{$.ajax({type:"POST",url:urlPath(promo.attr("href")),timeout:6e4,dataType:"json",data:{ajax:"t"},error(response,error,exception){window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:red",{response:response,error:error,exception:exception}),status.error("Error:An error has occurred performing the action requested. Please try again shortly."),resolve(!0)},success(response){response.success?(status.success("Success:"+response.text),promo.toggleClass("buttonentered").closest("p").html(promo.closest("p").find("span").html())):status.error("Error:"+response.text),resolve(!0)}})}))}}return await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}}catch(error){return throwError(error,"Indiedb.classifyTask"),!1}}function Indiedb_checkLogin2(){try{return globalOptions.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(error){return throwError(error,"Indiedb.checkLogin"),!1}}async function Indiedb_checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$('a.buttonenter:contains("next time"),a.buttonenter:contains("Giveaway is closed")').length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("giveawayEnded"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError(error,"Indiedb.checkLeftKey"),!1}}var website_Indiedb=class{constructor(){Indiedb_classPrivateMethodInitSpec(this,Indiedb_checkLeftKey),Indiedb_classPrivateMethodInitSpec(this,Indiedb_checkLogin),Indiedb_classPrivateMethodInitSpec(this,_do),Indiedb_classPrivateMethodInitSpec(this,_join),Indiedb_defineProperty(this,"name","Indiedb"),Indiedb_defineProperty(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{Indiedb_classPrivateMethodGet(this,Indiedb_checkLogin,Indiedb_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await Indiedb_classPrivateMethodGet(this,Indiedb_checkLeftKey,Indiedb_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError(error,"Indiedb.after")}}async doTask(){try{return await Indiedb_classPrivateMethodGet(this,_join,_join2).call(this)?await Indiedb_classPrivateMethodGet(this,_do,_do2).call(this):!1}catch(error){return throwError(error,"Indiedb.doTask"),!1}}};function Keyhub_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Keyhub_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Keyhub_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const Keyhub_defaultTasks=JSON.stringify({steam:{groupLinks:[],officialGroupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},extra:{videoTasks:[]},links:[]});var _doScriptTask=new WeakSet,Keyhub_getGiveawayId=new WeakSet,Keyhub_checkLeftKey=new WeakSet,Keyhub_checkLogin=new WeakSet;async function _doScriptTask2(data){try{const logStatus=scripts_echoLog({text:i18n("doingKeyhubTask")});var{result,statusText,status,data:response}=await tools_httpRequest({url:"/away?data="+data,method:"GET",headers:{origin:"https://key-hub.eu",referer:"https://key-hub.eu/"}});return"Success"===result?200===(null==response?void 0:response.status)?(logStatus.success(),!0):(logStatus.error(`Error:${null==response?void 0:response.statusText}(${null==response?void 0:response.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError(error,"Keyhub.doScriptTask"),!1}}function Keyhub_getGiveawayId2(){try{var _window$location$href,giveawayId=null===(_window$location$href=window.location.href.match(/giveaway\/([\d]+)/))||void 0===_window$location$href?void 0:_window$location$href[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({}).error(i18n("getFailed","GiveawayId")),!1)}catch(error){return throwError(error,"Keyhub.getGiveawayId"),!1}}async function Keyhub_checkLeftKey2(){try{return globalOptions.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError(error,"Keyhub.checkLeftKey"),!1}}function Keyhub_checkLogin2(){try{return globalOptions.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(error){return throwError(error,"Keyhub.checkLogin"),!1}}var website_Keyhub=class extends website_Website{constructor(){super(...arguments),Keyhub_classPrivateMethodInitSpec(this,Keyhub_checkLogin),Keyhub_classPrivateMethodInitSpec(this,Keyhub_checkLeftKey),Keyhub_classPrivateMethodInitSpec(this,Keyhub_getGiveawayId),Keyhub_classPrivateMethodInitSpec(this,_doScriptTask),Keyhub_defineProperty(this,"name","Keyhub"),Keyhub_defineProperty(this,"socialTasks",JSON.parse(Keyhub_defaultTasks)),Keyhub_defineProperty(this,"undoneTasks",JSON.parse(Keyhub_defaultTasks)),Keyhub_defineProperty(this,"buttons",["doTask","undoTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{Keyhub_classPrivateMethodGet(this,Keyhub_checkLogin,Keyhub_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await Keyhub_classPrivateMethodGet(this,Keyhub_checkLeftKey,Keyhub_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed")),$(".NSFW").hide()}catch(error){throwError(error,"Keyhub.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),logStatus.warning(i18n("needLogin")),!1):!!Keyhub_classPrivateMethodGet(this,Keyhub_getGiveawayId,Keyhub_getGiveawayId2).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError(error,"Keyhub.init"),!1}}async classifyTask(action){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")});var _GM_getValue;"undo"===action&&(this.socialTasks=(null===(_GM_getValue=GM_getValue("khTasks-"+this.giveawayId))||void 0===_GM_getValue?void 0:_GM_getValue.tasks)||JSON.parse(Keyhub_defaultTasks));for(const task of $('.task:not(".googleads")').filter((index,element)=>"do"!==action||0===$(element).find("i.fa-check-circle:visible").length).find("a")){let link=$(task).attr("href");var _link$match,taskData,taskDes=$(task).text().trim();link&&((/\/away\?data=/.test(link)||/steamcommunity\.com\/gid\//.test(link))&&(link=await getRedirectLink(link)||link),/https?:\/\/key-hub\.eu\/connect\/discord/.test(link)?window.open(link,"_blank"):/steamcommunity\.com\/groups\//.test(link)?("undo"===action&&this.socialTasks.steam.groupLinks.push(link),"do"===action&&this.undoneTasks.steam.groupLinks.push(link)):/steamcommunity\.com\/games\/[\d]+/.test(link)?("undo"===action&&this.socialTasks.steam.officialGroupLinks.push(link),"do"===action&&this.undoneTasks.steam.officialGroupLinks.push(link)):/store\.steampowered\.com\/app\//.test(link)&&/wishlist/gim.test(taskDes)?("undo"===action&&this.socialTasks.steam.wishlistLinks.push(link),"do"===action&&this.undoneTasks.steam.wishlistLinks.push(link)):/store\.steampowered\.com\/curator\//.test(link)?("undo"===action&&this.socialTasks.steam.curatorLinks.push(link),"do"===action&&this.undoneTasks.steam.curatorLinks.push(link)):/^https?:\/\/discord\.com\/invite\//.test(link)?("undo"===action&&this.socialTasks.discord.serverLinks.push(link),"do"===action&&this.undoneTasks.discord.serverLinks.push(link)):/^javascript:videoTask.+/.test(link)?"do"!==action||(taskData=null===(_link$match=link.match(/javascript:videoTask\('.+?','(.+?)'/))||void 0===_link$match?void 0:_link$match[1])&&this.undoneTasks.extra.videoTasks.push(taskData):/^https?:\/\/www\.instagram\.com\/.*/.test(link)||/^https?:\/\/twitter\.com\/.*/.test(link)||/^https?:\/\/www\.twitch\.tv\/.*/.test(link)||/^https?:\/\/www\.facebook\.com\/.*/.test(link)||/^https?:\/\/www\.youtube\.com\/.*/.test(link)||/^https?:\/\/store\.steampowered\.com\/developer\//.test(link)||/^https?:\/\/.*?\.itch\.io\/.*/.test(link)||/^https?:\/\/key-hub\.eu.*/.test(link)||/^https?:\/\/store\.steampowered\.com\/app\/.*/.test(link)||/^https?:\/\/qr\.streamelements\.com\/.*/.test(link)||/^https?:\/\/store\.steampowered\.com\/news\/app\/.*/.test(link)||scripts_echoLog({}).warning(`${i18n("unKnownTaskType")}: ${taskDes}(${link})`))}return logStatus.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(error){return throwError(error,"Keyhub.classifyTask"),!1}}async extraDoTask(videoTasks){videoTasks=videoTasks.videoTasks;try{const pro=[];for(const data of videoTasks)pro.push(Keyhub_classPrivateMethodGet(this,_doScriptTask,_doScriptTask2).call(this,data));return Promise.all(pro).then(()=>!0)}catch(error){return throwError(error,"Keyhub.extraDoTask"),!1}}};function Givekey_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function Givekey_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function Givekey_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const Givekey_defaultTasks=JSON.stringify({steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}});var Givekey_verify=new WeakSet,Givekey_getGiveawayId=new WeakSet,Givekey_checkLeftKey=new WeakSet;async function Givekey_verify2(task){try{const logStatus=scripts_echoLog({html:`
  • ${i18n("verifyingTask")}${task}...
  • `});return await new Promise(resolve=>{$.ajax({url:"https://givekey.ru/giveaway/task",method:"POST",data:`id=${task}&user_id=`+this.userId,dataType:"json",headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:data=>{data.btn&&$(`button[data-id=${this.userId}]`).html(data.btn),"ok"===data.status?($(".task_check_"+data.id).html(``),logStatus.success(),resolve(!0)):"end"===data.status?(logStatus.success(),scripts_echoLog({}).success(data.key),resolve(!0)):(logStatus.error("Error:"+data.msg),resolve(!1))},error:xhr=>{logStatus.error(`Error:${xhr.statusText}(${xhr.status})`),resolve(!1)}})})}catch(error){return throwError(error,"Givekey.verify"),!1}}function Givekey_getGiveawayId2(){try{var _window$location$href,giveawayId=null===(_window$location$href=window.location.href.match(/giveaway\/([\d]+)/))||void 0===_window$location$href?void 0:_window$location$href[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}catch(error){return throwError(error,"Givekey.getGiveawayId"),!1}}async function Givekey_checkLeftKey2(){try{return globalOptions.other.checkLeftKey?($("#keys_count").text()||await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError(error,"Givekey.checkLeftKey"),!1}}var website_Givekey=class extends website_Website{constructor(){super(...arguments),Givekey_classPrivateMethodInitSpec(this,Givekey_checkLeftKey),Givekey_classPrivateMethodInitSpec(this,Givekey_getGiveawayId),Givekey_classPrivateMethodInitSpec(this,Givekey_verify),Givekey_defineProperty(this,"name","Givekey"),Givekey_defineProperty(this,"tasks",[]),Givekey_defineProperty(this,"socialTasks",JSON.parse(Givekey_defaultTasks)),Givekey_defineProperty(this,"undoneTasks",JSON.parse(Givekey_defaultTasks)),Givekey_defineProperty(this,"userId",void 0),Givekey_defineProperty(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"givekey.ru"===window.location.host}async after(){try{await new Promise(resolve=>{const checker=setInterval(()=>{0<$("#navbarDropdown").length&&(clearInterval(checker),resolve(!0))})}),await Givekey_classPrivateMethodGet(this,Givekey_checkLeftKey,Givekey_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){return throwError(error,"Givekey.after"),!1}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),logStatus.warning(i18n("needLogin")),!1;if(!Givekey_classPrivateMethodGet(this,Givekey_getGiveawayId,Givekey_getGiveawayId2).call(this))return!1;var userId=$('meta[name="user-id"]').attr("content");return userId?(this.userId=userId,this.initialized=!0,logStatus.success(),!0):(logStatus.error(i18n("getFailed",i18n("userId"))),!1)}catch(error){return throwError(error,"Givekey.init"),!1}}async classifyTask(action){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")});var _GM_getValue;"undo"===action&&(this.socialTasks=(null===(_GM_getValue=GM_getValue("gkTasks-"+this.giveawayId))||void 0===_GM_getValue?void 0:_GM_getValue.tasks)||JSON.parse(Givekey_defaultTasks));for(const task of $('.card-body:has("button") .row')){const taskEle=$(task);var isSuccess=/Complete/i.test(taskEle.find("button").text().trim());if(!isSuccess||"undo"===action){const checkButton=taskEle.find("#task_check");var taskId=checkButton.attr("data-id");if(taskId&&this.tasks.push(taskId),"verify"!==action){let href=taskEle.find("a").attr("href")||null;var text=taskEle.find("a").text().trim();const icon=taskEle.find("i");href&&text&&(/^https?:\/\/givekey\.ru\/giveaway\/[\d]+\/execution_task/.test(href)&&(href=await getRedirectLink(href)),href&&(/^https?:\/\/vk\.com\//.test(href)?(this.socialTasks.vk.nameLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.vk.nameLinks.push(href)):/^https?:\/\/steamcommunity\.com\/groups/.test(href)?(this.socialTasks.steam.groupLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.steam.groupLinks.push(href)):/^https?:\/\/store\.steampowered\.com\/app\//.test(href)?(this.socialTasks.steam.wishlistLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.steam.wishlistLinks.push(href)):/Subscribe/gi.test(text)&&icon.hasClass("fa-steam-square")?/^https?:\/\/store\.steampowered\.com\/curator\//.test(href)?(this.socialTasks.steam.curatorLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.steam.curatorLinks.push(href)):(this.socialTasks.steam.curatorLikeLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.steam.curatorLikeLinks.push(href)):/^https?:\/\/twitter\.com\//.test(href)&&/Subscribe/gi.test(text)?(this.socialTasks.twitter.userLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.twitter.userLinks.push(href)):icon.hasClass("fa-discord")||/^https?:\/\/discord\.com\/invite\//.test(href)?(this.socialTasks.discord.serverLinks.push(href),"do"!==action||isSuccess||this.undoneTasks.discord.serverLinks.push(href)):scripts_echoLog({}).warning(`${i18n("unKnownTaskType")}: ${text}(${href})`)))}}}return logStatus.success(),this.tasks=unique(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(error){return throwError(error,"Givekey.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;scripts_echoLog({}).warning(i18n("giveKeyNoticeBefore"));var taskLength=this.tasks.length;for(let i=0;i${i18n("giveKeyNoticeAfter")}`}),!0}catch(error){return throwError(error,"Givekey.verifyTask"),!1}}};function GiveeClub_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function GiveeClub_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function GiveeClub_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}var GiveeClub_checkLogin=new WeakSet,GiveeClub_getGiveawayId=new WeakSet,GiveeClub_checkLeftKey=new WeakSet;function GiveeClub_checkLogin2(){try{return globalOptions.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(error){return throwError(error,"GiveeClub.checkLogin"),!1}}function GiveeClub_getGiveawayId2(){var giveawayId=null===(giveawayId=window.location.href.match(/\/event\/([\d]+)/))||void 0===giveawayId?void 0:giveawayId[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async function GiveeClub_checkLeftKey2(){try{return globalOptions.other.checkLeftKey?(0<$(".event-ended").length&&0===$(".event-winner").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("giveawayEnded"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(value=>{value=value.value;value&&window.close()}),!0):!0}catch(error){return throwError(error,"Giveawaysu.checkLeftKey"),!1}}var website_GiveeClub=class extends GiveawaySu{constructor(){super(...arguments),GiveeClub_classPrivateMethodInitSpec(this,GiveeClub_checkLeftKey),GiveeClub_classPrivateMethodInitSpec(this,GiveeClub_getGiveawayId),GiveeClub_classPrivateMethodInitSpec(this,GiveeClub_checkLogin),GiveeClub_defineProperty(this,"name","GiveeClub"),GiveeClub_defineProperty(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{GiveeClub_classPrivateMethodGet(this,GiveeClub_checkLogin,GiveeClub_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await GiveeClub_classPrivateMethodGet(this,GiveeClub_checkLeftKey,GiveeClub_checkLeftKey2).call(this)||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError(error,"GiveeClub.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return GiveeClub_classPrivateMethodGet(this,GiveeClub_checkLogin,GiveeClub_checkLogin2).call(this)?!!GiveeClub_classPrivateMethodGet(this,GiveeClub_getGiveawayId,GiveeClub_getGiveawayId2).call(this)&&(this.initialized=!0,logStatus.success(),!0):(logStatus.warning(i18n("needLogin")),!1)}catch(error){return throwError(error,"GiveeClub.init"),!1}}async classifyTask(action){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")});var _GM_getValue;if("undo"===action)return this.socialTasks=(null===(_GM_getValue=GM_getValue("gcTasks-"+this.giveawayId))||void 0===_GM_getValue?void 0:_GM_getValue.tasks)||GiveawaySu_defaultTasks,!0;const pro=[];for(const task of $(".event-actions tr"))pro.push(new Promise(resolve=>{const taskDes=$(task).find(".event-action-label a"),taskIcon=$(task).find(".event-action-icon i").attr("class")||"",taskName=taskDes.text().trim(),taskType=null===(taskFinished=$(task).find("button[data-type]"))||void 0===taskFinished?void 0:taskFinished.attr("data-type");var taskFinished=null===(taskFinished=$(task).find(".event-action-buttons .btn-success"))||void 0===taskFinished?void 0:taskFinished.length;if(taskIcon.includes("ban")||/AdBlock/i.test(taskName)||taskIcon.includes("envelope")||taskFinished)return resolve(!0);getRedirectLink(taskDes.attr("href")).then(taskLink=>taskLink?("steam.group.join"===taskType&&/^https?:\/\/steamcommunity\.com\/groups/.test(taskLink)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):"steam.game.wishlist"===taskType&&/^https?:\/\/store\.steampowered\.com\/app\//.test(taskLink)?this.undoneTasks.steam.wishlistLinks.push(taskLink):"steam.game.wishlist"===taskType&&taskDes.attr("data-steam-wishlist-appid")?this.undoneTasks.steam.wishlistLinks.push("https://store.steampowered.com/app/"+taskDes.attr("data-steam-wishlist-appid")):"steam.game.follow"===taskType&&/^https?:\/\/store\.steampowered\.com\/app\//.test(taskLink)?this.undoneTasks.steam.followLinks.push(taskLink):/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("discord")?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):taskIcon.includes("twitter")?/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)?this.undoneTasks.twitter.userLinks.push(taskLink):/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)&&this.undoneTasks.twitter.retweetLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink),void resolve(!0)):resolve(!1)).catch(error=>(throwError(error,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,window.DEBUG&&console.log("%cAuto-Task[Debug]:","color:blue",JSON.stringify(this)),GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(error){return throwError(error,"GiveeClub.classifyTask"),!1}}async verifyTask(){try{const logStatus=scripts_echoLog({text:i18n("giveeClubVerifyNotice")});for(const button of $(".event-actions tr button").has("i.glyphicon-refresh").not('[data-type="user.adblock"]'))button.click(),"steam.game.wishlist"!==$(button).attr("data-type")&&await delay(1e3);return logStatus.warning(i18n("giveeClubVerifyFinished")),!0}catch(error){return throwError(error,"Givekey.verifyTask"),!1}}};function OpiumPulses_classPrivateMethodInitSpec(obj,privateSet){!function(obj,privateCollection){if(privateCollection.has(obj))throw new TypeError("Cannot initialize the same private elements twice on an object")}(obj,privateSet),privateSet.add(obj)}function OpiumPulses_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function OpiumPulses_classPrivateMethodGet(receiver,privateSet,fn){if(!privateSet.has(receiver))throw new TypeError("attempted to get private field on non-instance");return fn}const defaultOptions={maxPoint:"99999999"};var _toggleTask=new WeakSet,OpiumPulses_checkLogin=new WeakSet;async function _toggleTask2(type){try{for(const item of $(`.giveaways-page-item:contains('${type}'):not(:contains('ENTERED'))`)){var _$$find$text$match,_aElement$attr,_aElement$attr2,_aElement$attr2$match,giveawayId,_data$responseText$ma,points,needPoints=parseInt((null===(_$$find$text$match=$(item).find(".giveaways-page-item-header-points").text().match(/[\d]+/gim))||void 0===_$$find$text$match?void 0:_$$find$text$match[0])||"999999",10),name=$(item).find(".giveaways-page-item-footer-name").text().trim();if("points"===type&&needPoints>this.myPoints)scripts_echoLog({}).warning(i18n("noPoints")+": "+name);else if("points"!==type||needPoints){if(!("points"===type&&needPoints>this.maxPoints)){const logStatus=scripts_echoLog({text:`${i18n("joiningLottery")}${name}...`}),aElement=$(item).find("a.giveaways-page-item-img-btn-enter:contains('enter')");if(null===aElement||void 0===aElement||null===(_aElement$attr=aElement.attr("onclick"))||void 0===_aElement$attr||!_aElement$attr.includes("checkUser")||(giveawayId=null===(_aElement$attr2=aElement.attr("onclick"))||void 0===_aElement$attr2||null===(_aElement$attr2$match=_aElement$attr2.match(/[\d]+/))||void 0===_aElement$attr2$match?void 0:_aElement$attr2$match[0])&&checkUser(giveawayId),aElement.attr("href")){const{result,statusText,status,data}=await tools_httpRequest({url:aElement.attr("href"),method:"GET"});"Success"===result?null!==data&&void 0!==data&&data.responseText&&/You've entered this giveaway/gim.test(data.responseText)?(logStatus.success(),points=null===(_data$responseText$ma=data.responseText.match(/Points:[\s]*?([\d]+)/))||void 0===_data$responseText$ma?void 0:_data$responseText$ma[1],"points"===type&&points&&(this.myPoints=parseInt(points,10))):logStatus.error(`Error:${null===data||void 0===data?void 0:data.statusText}(${null===data||void 0===data?void 0:data.status})`):logStatus.error(result+`:${statusText}(${status})`)}else logStatus.error('Error: No "href".')}}else scripts_echoLog({}).warning(i18n("getNeedPointsFailed")+": "+name)}scripts_echoLog({text:"-----END-----"})}catch(error){throwError(error,"OpiumPulses.toggleTask")}}function OpiumPulses_checkLogin2(){try{return globalOptions.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(error){return throwError(error,"OpiumPulses.checkLogin"),!1}}var website_OpiumPulses=class{constructor(){OpiumPulses_classPrivateMethodInitSpec(this,OpiumPulses_checkLogin),OpiumPulses_classPrivateMethodInitSpec(this,_toggleTask),OpiumPulses_defineProperty(this,"name","OpiumPulses"),OpiumPulses_defineProperty(this,"options",{...defaultOptions,...GM_getValue("OpiumPulsesOptions")}),OpiumPulses_defineProperty(this,"maxPoints",99999999),OpiumPulses_defineProperty(this,"myPoints",0),OpiumPulses_defineProperty(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{OpiumPulses_classPrivateMethodGet(this,OpiumPulses_checkLogin,OpiumPulses_checkLogin2).call(this)||scripts_echoLog({}).warning(i18n("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(error){throwError(error,"OpiumPulses.after")}}async doFreeTask(){try{OpiumPulses_classPrivateMethodGet(this,_toggleTask,_toggleTask2).call(this,"FREE")}catch(error){throwError(error,"OpiumPulses.doFreeTask")}}async doPointTask(){try{var _$$text$match;this.myPoints=parseInt((null===(_$$text$match=$(".page-header__nav-func-user-nav-items.points-items").text().match(/[\d]+/gim))||void 0===_$$text$match?void 0:_$$text$match[0])||"0",10),OpiumPulses_classPrivateMethodGet(this,_toggleTask,_toggleTask2).call(this,"points")}catch(error){throwError(error,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}},dayjs_min=__webpack_require__(698),dayjs_min_default=__webpack_require__.n(dayjs_min);const website_leftKeyChecker={async classify(link){try{return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(link)?await this.giveawaySu(link):/^https?:\/\/givee\.club\/[\w]+?\/event\/[\d]+/.test(link)?await this.giveeClub(link):/^https?:\/\/gleam\.io\/.+?\/.+/.test(link)?await this.gleam(link):/^https?:\/\/www\.indiedb\.com\/giveaways\/.+/.test(link)?await this.indieDb(link):/^https?:\/\/key-hub\.eu\/giveaway\/[\d]+/.test(link)?await this.keyhub(link):/^https?:\/\/opquests\.com\/quests\/[\d]+/.test(link)?await this.opquests(link):!!/^https?:\/\/itch\.io\/s\/[\d]+?\/.*/.test(link)&&await this.itch(link)}catch(error){return throwError(error,"leftKeyChecker.classify"),!1}},async giveawaySu(link){try{const{result,data}=await tools_httpRequest({url:link,method:"GET"});return"Success"===result&&200===(null===data||void 0===data?void 0:data.status)?!data.responseText.includes('class="steam-login"')&&(data.responseText.includes('class="giveaway-ended"')?"Ended":"Active"):!1}catch(error){return throwError(error,"leftKeyChecker.giveawaySu"),!1}},async giveeClub(link){try{const{result,data}=await tools_httpRequest({url:link,method:"GET"});return"Success"===result&&200===(null===data||void 0===data?void 0:data.status)?data.responseText.includes('class="event-winner"')?"Won":data.responseText.includes('class="event-ended"')?"Ended":"Active":!1}catch(error){return throwError(error,"leftKeyChecker.giveeClub"),!1}},async gleam(link){try{const{result,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result||200!==(null===data||void 0===data?void 0:data.status))return!1;var _data$responseText$ma,_$$attr,_$$attr$match;if(/incentives":{"[\d]+?":\[".+?"\]/.test(data.responseText))return"Won";var campaignDiv=null===(_data$responseText$ma=data.responseText.match(/