/*
粉丝福利红包
活动链接：https://wqs.jd.com/sns/202109/22/fansactiveall/index.html?qwer=<活动id>
环境变量：jd_fansDraw_activityUrl // 活动链接
        jd_fansDraw_Notify // 是否推送通知（true/false），默认不推送

注：活动非百分百中奖，请勿重复运行

cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#粉丝福利红包
1 1 1 1 * jd_fansDraw.js, tag=粉丝福利红包, enabled=true

*/

const $ = new Env('粉丝福利红包')
var version_='jsjiami.com.v7';const iIIili=iii1II;(function(Ii1iil,Ilil1i,iili1,II11ii,Iil1iI,II11il,iIIil1){return Ii1iil=Ii1iil>>0x1,II11il='hs',iIIil1='hs',function(IlllII,I1il1I,II111,lI1l1I,lill11){const Il1i1i=iii1II;lI1l1I='tfi',II11il=lI1l1I+II11il,lill11='up',iIIil1+=lill11,II11il=II111(II11il),iIIil1=II111(iIIil1),II111=0x0;const liI1i1=IlllII();while(!![]&&--II11ii+I1il1I){try{lI1l1I=parseInt(Il1i1i(0x25d,'KdtI'))/0x1+-parseInt(Il1i1i(0x217,'YBZM'))/0x2*(parseInt(Il1i1i(0x1d6,'$NU2'))/0x3)+-parseInt(Il1i1i(0x1bb,'ffZ$'))/0x4*(parseInt(Il1i1i(0x246,'@[IB'))/0x5)+-parseInt(Il1i1i(0x25e,'o8n)'))/0x6*(parseInt(Il1i1i(0x220,'Setj'))/0x7)+parseInt(Il1i1i(0x256,'wn(%'))/0x8+-parseInt(Il1i1i(0x208,'Ng4&'))/0x9*(parseInt(Il1i1i(0x1c3,']Ijb'))/0xa)+parseInt(Il1i1i(0x1f3,'f&Gm'))/0xb;}catch(I11i11){lI1l1I=II111;}finally{lill11=liI1i1[II11il]();if(Ii1iil<=II11ii)II111?Iil1iI?lI1l1I=lill11:Iil1iI=lill11:II111=lill11;else{if(II111==Iil1iI['replace'](/[GHdruwWEhlMDAPRpKqNQ=]/g,'')){if(lI1l1I===I1il1I){liI1i1['un'+II11il](lill11);break;}liI1i1[iIIil1](lill11);}}}}}(iili1,Ilil1i,function(I1llII,Iil1il,I11i1i,l1l1iI,I1llI1,I11i1l,il1il){return Iil1il='\x73\x70\x6c\x69\x74',I1llII=arguments[0x0],I1llII=I1llII[Iil1il](''),I11i1i='\x72\x65\x76\x65\x72\x73\x65',I1llII=I1llII[I11i1i]('\x76'),l1l1iI='\x6a\x6f\x69\x6e',(0x13b11b,I1llII[l1l1iI](''));});}(0x182,0xdef05,Iii11l,0xc3),Iii11l)&&(version_=Iii11l);const IlIlil=require('./jdCookie'),lIli1I=require('./function/jdCommon'),II1il=require('./function/sendJDNotify'),lllI11=process[iIIili(0x25c,'wn(%')][iIIili(0x1c0,'HTE6')]||'',I1lIll=process[iIIili(0x1a4,'CeAa')][iIIili(0x241,')djJ')]==='true',I1lIli=iIIili(0x255,'WS0V');let II1ii='';const IIIIII=Object['keys'](IlIlil)[iIIili(0x1c1,')djJ')](IlIliI=>IlIlil[IlIliI])['filter'](l1iII1=>l1iII1);!IIIIII[0x0]&&($['msg']($[iIIili(0x165,'9SC6')],iIIili(0x24b,'BtY9')),process['exit'](0x1));!(async()=>{const Ii1iiI=iIIili,iiill1={'gGdQy':function(I1lIlI,ii1ill){return I1lIlI<ii1ill;},'oXPZc':Ii1iiI(0x151,'H0(b'),'nOILw':Ii1iiI(0x1e1,'z[!t'),'jTPDj':function(II1iI,llI1II){return II1iI===llI1II;},'lrpmM':Ii1iiI(0x1f9,'JV(K'),'pxRbU':'❖\x20远程获取数据中...\x0a❖\x20数据获取正常...\x0a','RfYGg':function(lIli1l,lillIi){return lIli1l+lillIi;},'OLENa':Ii1iiI(0x1fc,'Tef2'),'LqzCI':Ii1iiI(0x1d4,'WS0V'),'GWjRW':Ii1iiI(0x193,'OjVI'),'CLwlL':Ii1iiI(0x1a3,'LeXp'),'xMUat':Ii1iiI(0x261,'u)8Q'),'iCOnu':function(illIi1,ii1ili){return illIi1+ii1ili;},'vbTOO':Ii1iiI(0x221,'Tmh#'),'ILDbx':function(liil1i,lI1lil){return liil1i<lI1lil;},'vmyLf':function(i1l1iI,liil1l){return i1l1iI!==liil1l;},'rOjNT':Ii1iiI(0x161,'dF6K'),'KqqnW':'4|6|5|7|0|3|2|1','CHdAP':function(lI1lii){return lI1lii();},'cuJRQ':function(Iiili1,Iil1l1){return Iiili1+Iil1l1;},'gJFnh':'pt_pin'};authorCodeList=await liil1I(iiill1[Ii1iiI(0x18a,'Tef2')]);if(authorCodeList){if(iiill1[Ii1iiI(0x1d7,'PcZ$')](iiill1[Ii1iiI(0x1a9,'LeXp')],iiill1[Ii1iiI(0x248,'h]AA')])){console['log'](iiill1['pxRbU']);for(let i1i11I=0x0;iiill1['gGdQy'](i1i11I,authorCodeList[Ii1iiI(0x199,'pFtY')]);i1i11I++){console[Ii1iiI(0x1da,'KScv')](Ii1iiI(0x267,'Ng4&')+iiill1['RfYGg'](i1i11I,0x1)+Ii1iiI(0x15b,'Tef2')+authorCodeList[i1i11I]+'\x22');}}else{i1l1l1[Ii1iiI(0x20d,'$NU2')](Ii1iiI(0x1c6,'Ng4&'));for(let iii1ii=0x0;iiill1['gGdQy'](iii1ii,IlI11[Ii1iiI(0x270,'KScv')]);iii1ii++){lilIlI['log'](Ii1iiI(0x1d0,'KScv')+(iii1ii+0x1)+Ii1iiI(0x15b,'Tef2')+iIIIIi[iii1ii]+'\x22');}}}else console[Ii1iiI(0x1a6,'ffZ$')](iiill1[Ii1iiI(0x23c,'OjVI')]);if(!lllI11){console[Ii1iiI(0x1bc,'CeAa')](iiill1['LqzCI']);return;}const lIli1i=lIli1I[Ii1iiI(0x1de,'*S8W')](lllI11);if(!lIli1i){console['log'](Ii1iiI(0x1db,'pFtY'));return;}$[Ii1iiI(0x1bf,'FYcP')]=lllI11;const IIIII1=lIli1i[Ii1iiI(0x1ff,'dF6K')];if(!IIIII1[Ii1iiI(0x1b0,'$NU2')](iiill1['GWjRW'])){$['activityId']=lIli1I['getUrlParameter'](lllI11,iiill1[Ii1iiI(0x15e,'RgQG')]);if(!$['activityId']){console[Ii1iiI(0x155,'FYcP')](iiill1['xMUat']);return;}}II1il[Ii1iiI(0x1b5,'G3fB')]({'title':$['name']}),console[Ii1iiI(0x24c,'z[!t')](iiill1[Ii1iiI(0x1b6,'h]AA')](iiill1['vbTOO'],lllI11));for(let il1iIi=0x0;iiill1['ILDbx'](il1iIi,IIIIII[Ii1iiI(0x198,'ffZ$')]);il1iIi++){if(iiill1['vmyLf'](iiill1['rOjNT'],iiill1[Ii1iiI(0x184,'BtY9')]))l1lIll[Ii1iiI(0x260,'c09W')](iiill1[Ii1iiI(0x26b,'6QZY')]),I1l1II[Ii1iiI(0x191,'@[IB')][Ii1iiI(0x14e,'c09W')](iiill1[Ii1iiI(0x164,'HTE6')]);else{const II11li=iiill1[Ii1iiI(0x1f0,'B#7@')][Ii1iiI(0x1d3,'BtY9')]('|');let I1l11i=0x0;while(!![]){switch(II11li[I1l11i++]){case'0':$[Ii1iiI(0x1e4,')nsc')]=II1il[Ii1iiI(0x253,'^fzy')]($['index'],$['UserName']);continue;case'1':await iiill1[Ii1iiI(0x1ef,'KdtI')](lillII);continue;case'2':console[Ii1iiI(0x1ce,'YBZM')](Ii1iiI(0x268,'$NU2')+$[Ii1iiI(0x21b,']*%(')]+'】'+($[Ii1iiI(0x228,'Tmh#')]||$[Ii1iiI(0x1f1,'f5j8')])+Ii1iiI(0x17c,')nsc'));continue;case'3':$[Ii1iiI(0x1a7,'o8n)')]='';continue;case'4':$[Ii1iiI(0x19b,'RgQG')]=iiill1[Ii1iiI(0x21f,'FYcP')](il1iIi,0x1);continue;case'5':$['UserName']=decodeURIComponent(lIli1I[Ii1iiI(0x21d,'@bEE')](II1ii,iiill1[Ii1iiI(0x23e,'6QZY')]));continue;case'6':II1ii=IIIIII[il1iIi];continue;case'7':$['UA']=lIli1I[Ii1iiI(0x175,'Setj')]($[Ii1iiI(0x238,'9SC6')]);continue;}break;}}}I1lIll&&II1il[Ii1iiI(0x168,'vwVM')]()&&(II1il[Ii1iiI(0x179,'$NU2')](iiill1[Ii1iiI(0x258,'@bEE')](II1il[Ii1iiI(0x201,']*%(')],Ii1iiI(0x264,'B#7@')+$['activityUrl'])),await II1il['push']());})()['catch'](iIIiiI=>$[iIIili(0x18c,'PcZ$')](iIIiiI))['finally'](()=>$[iIIili(0x19f,'RgQG')]());function iii1II(_0x33d772,_0x498509){const _0x186cd9=Iii11l();return iii1II=function(_0x378e4d,_0x51d3c3){_0x378e4d=_0x378e4d-0x14d;let _0x2b27c3=_0x186cd9[_0x378e4d];if(iii1II['DUHtCd']===undefined){var _0x329b25=function(_0x422a5d){const _0x530b72='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x530eed='',_0x3e8e7c='';for(let _0x4487ff=0x0,_0x41072e,_0x1f79e2,_0x5e7060=0x0;_0x1f79e2=_0x422a5d['charAt'](_0x5e7060++);~_0x1f79e2&&(_0x41072e=_0x4487ff%0x4?_0x41072e*0x40+_0x1f79e2:_0x1f79e2,_0x4487ff++%0x4)?_0x530eed+=String['fromCharCode'](0xff&_0x41072e>>(-0x2*_0x4487ff&0x6)):0x0){_0x1f79e2=_0x530b72['indexOf'](_0x1f79e2);}for(let _0x2a9235=0x0,_0xba4467=_0x530eed['length'];_0x2a9235<_0xba4467;_0x2a9235++){_0x3e8e7c+='%'+('00'+_0x530eed['charCodeAt'](_0x2a9235)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e8e7c);};const _0x14bb32=function(_0x40c938,_0x10010b){let _0x45a901=[],_0x23aa3c=0x0,_0x2d4dc3,_0x129896='';_0x40c938=_0x329b25(_0x40c938);let _0x19e34c;for(_0x19e34c=0x0;_0x19e34c<0x100;_0x19e34c++){_0x45a901[_0x19e34c]=_0x19e34c;}for(_0x19e34c=0x0;_0x19e34c<0x100;_0x19e34c++){_0x23aa3c=(_0x23aa3c+_0x45a901[_0x19e34c]+_0x10010b['charCodeAt'](_0x19e34c%_0x10010b['length']))%0x100,_0x2d4dc3=_0x45a901[_0x19e34c],_0x45a901[_0x19e34c]=_0x45a901[_0x23aa3c],_0x45a901[_0x23aa3c]=_0x2d4dc3;}_0x19e34c=0x0,_0x23aa3c=0x0;for(let _0x3316de=0x0;_0x3316de<_0x40c938['length'];_0x3316de++){_0x19e34c=(_0x19e34c+0x1)%0x100,_0x23aa3c=(_0x23aa3c+_0x45a901[_0x19e34c])%0x100,_0x2d4dc3=_0x45a901[_0x19e34c],_0x45a901[_0x19e34c]=_0x45a901[_0x23aa3c],_0x45a901[_0x23aa3c]=_0x2d4dc3,_0x129896+=String['fromCharCode'](_0x40c938['charCodeAt'](_0x3316de)^_0x45a901[(_0x45a901[_0x19e34c]+_0x45a901[_0x23aa3c])%0x100]);}return _0x129896;};iii1II['UpXEqi']=_0x14bb32,_0x33d772=arguments,iii1II['DUHtCd']=!![];}const _0x1f6207=_0x186cd9[0x0],_0x3f71aa=_0x378e4d+_0x1f6207,_0x3675f3=_0x33d772[_0x3f71aa];return!_0x3675f3?(iii1II['yKcNbM']===undefined&&(iii1II['yKcNbM']=!![]),_0x2b27c3=iii1II['UpXEqi'](_0x2b27c3,_0x51d3c3),_0x33d772[_0x3f71aa]=_0x2b27c3):_0x2b27c3=_0x3675f3,_0x2b27c3;},iii1II(_0x33d772,_0x498509);}async function lillII(){const Ilil1I=iIIili,liiI1i={'Uandl':function(ililIi,lilIIl){return ililIi(lilIIl);},'yzWxU':function(ililIl){return ililIl();},'xLdCJ':function(liiI1l,i1l1II){return liiI1l===i1l1II;},'FhSXF':function(i1ill,I1l11l){return i1ill!==I1l11l;},'zusLm':Ilil1I(0x1a2,'PcZ$'),'NsEUl':Ilil1I(0x1dc,'KdtI'),'AOZGH':function(lilIIi,i1l1Il){return lilIIi(i1l1Il);},'oFxTh':Ilil1I(0x17a,'9SC6'),'jUgGi':function(llIli,i1i11l){return llIli(i1i11l);},'wjtkr':Ilil1I(0x21e,'o8n)'),'oyuCt':Ilil1I(0x19e,'@[IB')};$[Ilil1I(0x26a,'wraa')]=![],await liiI1i['yzWxU'](iIiI1);if($['skipRun'])return;if($[Ilil1I(0x20f,'FYcP')]){liiI1i[Ilil1I(0x26f,')djJ')]($[Ilil1I(0x24a,'JV(K')],0x1)&&(liiI1i[Ilil1I(0x157,'u)8Q')](liiI1i['zusLm'],liiI1i[Ilil1I(0x20a,'K^Ji')])?(llIlli[Ilil1I(0x22d,'HTE6')](liiI1i[Ilil1I(0x1ca,']*%(')](llIlll,lliii1)),Iiii1[Ilil1I(0x18d,'wraa')](lIIili[Ilil1I(0x22f,'JV(K')]+Ilil1I(0x271,'PcZ$'))):await liiI1i[Ilil1I(0x176,'B#7@')](ii1ilI,liiI1i[Ilil1I(0x251,'HTE6')]));await liiI1i[Ilil1I(0x23d,'KScv')](ii1ilI,liiI1i[Ilil1I(0x242,'^fzy')]);if($['skipRun'])return;await liiI1i[Ilil1I(0x226,'ioz7')](ii1ilI,liiI1i[Ilil1I(0x21a,'6QZY')]);}else await ii1ilI(liiI1i[Ilil1I(0x25a,'^fzy')]);}async function ii1ilI(II11l1){const iliIiI=iIIili,Iil1lI={'gJadG':iliIiI(0x239,'^fzy'),'QCRZf':iliIiI(0x233,'K^Ji'),'DAHiL':function(iii1iI,llIll){return iii1iI===llIll;},'PFzKk':function(il1iII,iilli){return il1iII!==iilli;},'aySmM':iliIiI(0x219,'BtY9'),'pkowS':iliIiI(0x16c,'10j)'),'MSXpc':function(IlllIl,II11lI){return IlllIl(II11lI);},'BVqUN':function(lI1IIi,I1l11I){return lI1IIi(I1l11I);},'TghdI':iliIiI(0x181,'H0(b'),'weJoA':'query_tempactivconfig','jKEqV':iliIiI(0x212,'o8n)'),'BDdBg':iliIiI(0x24e,'YBZM'),'pFQBr':'已抽过','aVzLE':iliIiI(0x245,'10j)'),'FHixe':'ORPxb','Krvmt':'💨\x20空气','Yhzca':iliIiI(0x23f,'Tef2'),'kkAeA':'领取失败','xyhIi':function(Ilil1l,iIIiii){return Ilil1l===iIIiii;},'ILywK':iliIiI(0x254,'WS0V'),'wZBKa':function(iilll,il1iI1){return iilll-il1iI1;},'mGoNd':iliIiI(0x249,'u)8Q'),'FPhRW':function(IlllIi,iIIiil){return IlllIi+iIIiil;},'ZebjG':iliIiI(0x1ea,'CeAa'),'DsYlQ':'领取成功','mXqtf':iliIiI(0x205,')nsc'),'BFYDU':iliIiI(0x173,'KdtI'),'kNrKU':iliIiI(0x1f7,'@[IB'),'sdacq':iliIiI(0x210,'YBZM'),'yUXmb':iliIiI(0x19d,'HTE6'),'YMAfe':iliIiI(0x1e5,'o8n)'),'yghMm':iliIiI(0x1cb,'Tmh#'),'kNZAF':iliIiI(0x1bd,'FYcP'),'CIVto':'no-cors','HlqbR':iliIiI(0x1e0,'f&Gm'),'fcBSF':'keep-alive'},IiiliI={'url':'https://wq.jd.com/activet2/looktreasure/'+II11l1+iliIiI(0x190,'KdtI')+($['activityId']||'')+iliIiI(0x237,']*%(')+($[iliIiI(0x257,'OjVI')]||'')+iliIiI(0x22b,'Setj')+Date[iliIiI(0x234,'YBZM')]()+iliIiI(0x159,'YBZM')+II11l1+iliIiI(0x154,'Ng4&')+I1lIli,'headers':{'Accept':Iil1lI[iliIiI(0x259,'LeXp')],'Accept-Encoding':Iil1lI['YMAfe'],'Accept-Language':Iil1lI[iliIiI(0x20b,'z[!t')],'Sec-Fetch-Site':Iil1lI['kNZAF'],'Sec-Fetch-Mode':Iil1lI[iliIiI(0x15a,'OjVI')],'Sec-Fetch-Dest':Iil1lI[iliIiI(0x17b,'CeAa')],'Connection':Iil1lI['fcBSF'],'Cookie':II1ii,'Host':iliIiI(0x1e7,'10j)'),'Referer':iliIiI(0x197,'pFtY'),'User-Agent':$['UA']}};return new Promise(async i1l1Ii=>{const II11iI=iliIiI,I1iIIi={'sythq':II11iI(0x24d,'B#7@'),'RJKcc':Iil1lI[II11iI(0x250,'f5j8')]};$['get'](IiiliI,(I1iIIl,lI1IIl,i1ilI)=>{const Il1i1l=II11iI,iii1lI={'GIrcP':Iil1lI['gJadG'],'JAzVc':Iil1lI[Il1i1l(0x1df,'h]AA')]};if(Iil1lI[Il1i1l(0x231,'OjVI')](Il1i1l(0x150,'YBZM'),Il1i1l(0x17e,']*%(')))IIII11[Il1i1l(0x1d1,'@[IB')](Il1i1l(0x224,'Tmh#')+i1illi[Il1i1l(0x211,'wn(%')]['sPrizeDesc']),i1illl['message'][Il1i1l(0x202,'ffZ$')](I1llil['prize'][Il1i1l(0x21c,'RgQG')]);else try{if(Iil1lI[Il1i1l(0x20c,'FYcP')](Iil1lI['aySmM'],Iil1lI[Il1i1l(0x1f5,'ioz7')])){if(I1iIIl)console[Il1i1l(0x222,'u)8Q')](Iil1lI[Il1i1l(0x177,'o8n)')](String,I1iIIl));else{const Iiilii=Iil1lI['BVqUN'](lI1ll1,i1ilI);if(Iiilii){if(Iil1lI[Il1i1l(0x216,'c09W')](Iil1lI['TghdI'],Iil1lI['TghdI']))switch(II11l1){case Iil1lI['weJoA']:$[Il1i1l(0x204,'VsoY')]=Iiilii[Il1i1l(0x1ac,')nsc')],$[Il1i1l(0x1c2,'10j)')]=Iiilii['frontEnd'];break;case Iil1lI['jKEqV']:Iil1lI['DAHiL'](Iiilii[Il1i1l(0x166,'Tef2')],0x1)&&(console[Il1i1l(0x24c,'z[!t')](Iil1lI[Il1i1l(0x265,'6QZY')]),$[Il1i1l(0x207,'f&Gm')][Il1i1l(0x17f,'LeXp')](Iil1lI[Il1i1l(0x188,'H0(b')]),$[Il1i1l(0x18f,')djJ')]=!![]);break;case Iil1lI['aVzLE']:if(Iil1lI['DAHiL'](Iiilii['ret'],0x0)){if(Iiilii?.[Il1i1l(0x20e,')nsc')]?.[Il1i1l(0x269,']Ijb')])Iil1lI[Il1i1l(0x215,'T%kS')]===Il1i1l(0x196,'dF6K')?(console[Il1i1l(0x155,'FYcP')](Il1i1l(0x266,'BtY9')+Iiilii[Il1i1l(0x230,'G3fB')][Il1i1l(0x18b,'T%kS')]),$[Il1i1l(0x19c,'Tef2')]['fix'](Iiilii[Il1i1l(0x1e6,'PcZ$')]['sPrizeDesc'])):IlI1Ii=i11I1I[Il1i1l(0x26c,'z[!t')](l1il1i);else Iiilii?.[Il1i1l(0x19a,'f&Gm')]?console[Il1i1l(0x1d5,'Ng4&')](Iiilii?.[Il1i1l(0x22c,'JV(K')]):(console['log'](Iil1lI[Il1i1l(0x1fd,'h]AA')]),$[Il1i1l(0x1b2,'wraa')][Il1i1l(0x252,'KScv')]('空气'));}else Iil1lI['DAHiL'](Iil1lI['Yhzca'],Il1i1l(0x1ab,'10j)'))?(console['log'](Iil1lI['kkAeA']),$[Il1i1l(0x23b,'ffZ$')]['fix'](Iil1lI[Il1i1l(0x1d2,'BtY9')])):(i11I11[Il1i1l(0x1b4,'KScv')](l1llIl,ii1I1l),ii1I1i=null);break;case Il1i1l(0x218,'6QZY'):if(Iiilii[Il1i1l(0x25b,'Setj')]){if($[Il1i1l(0x1af,']Ijb')]===0x1){let Iil1ll='';for(let iillI=0x0;iillI<Iiilii[Il1i1l(0x1c5,'Tmh#')]['length'];iillI++){if(Iil1lI[Il1i1l(0x1fa,'LeXp')](Iil1lI[Il1i1l(0x16d,'PcZ$')],Iil1lI[Il1i1l(0x200,'WS0V')])){const lI1III=Iiilii['prize'][iillI][Il1i1l(0x229,'pFtY')];iillI!=Iil1lI['wZBKa'](Iiilii['prize']['length'],0x1)?Iil1ll+=lI1III+'，':'oScbW'===Iil1lI[Il1i1l(0x156,'H0(b')]?Iil1ll+=''+lI1III:iI1llI[Il1i1l(0x1ec,']*%(')](iii1lI[Il1i1l(0x169,'VsoY')]);}else{let i1il1=null;try{const I1l111=/(\w+)\(([\s\S]*?)\);/,IIii1l=lliil1[Il1i1l(0x16a,'FYcP')](I1l111);IIii1l&&(i1il1=lliilI[Il1i1l(0x26c,'z[!t')](IIii1l[0x2]));}catch(I1iIII){ll1l1[Il1i1l(0x1ad,'T%kS')](I1iIII);}return i1il1;}}console[Il1i1l(0x213,'K^Ji')](Il1i1l(0x247,']*%(')+Iil1ll+'\x0a'),II1il[Il1i1l(0x24f,'pFtY')](Iil1lI['FPhRW'](II1il[Il1i1l(0x186,'vwVM')],Il1i1l(0x170,'wn(%')+Iil1ll));}console[Il1i1l(0x1fe,'OjVI')](Iil1lI[Il1i1l(0x195,'VsoY')]),$['message']['fix'](Iil1lI[Il1i1l(0x180,'h]AA')]);}else console[Il1i1l(0x1c4,'Tef2')](Il1i1l(0x26d,'K^Ji')),$[Il1i1l(0x1cc,'HTE6')][Il1i1l(0x158,']Ijb')](Iil1lI['mXqtf']);break;}else lIIiii+=''+iI1lli;}else{if(Iil1lI['PFzKk'](Iil1lI[Il1i1l(0x272,')djJ')],Il1i1l(0x173,'KdtI'))){if(Ii1iIl?.['prize']?.[Il1i1l(0x1fb,'f5j8')])i1IIi[Il1i1l(0x1a6,'ffZ$')](Il1i1l(0x162,')nsc')+IIII1I[Il1i1l(0x227,']Ijb')]['sPrizeDesc']),Iii111[Il1i1l(0x1b9,'wn(%')][Il1i1l(0x174,'pFtY')](l1l1II[Il1i1l(0x1aa,'*S8W')][Il1i1l(0x269,']Ijb')]);else li1Ii?.[Il1i1l(0x172,'CeAa')]?Iil1I1[Il1i1l(0x18e,'f5j8')](Ii1iII?.['prize']):(l1i11I[Il1i1l(0x1d5,'Ng4&')](I1iIIi['sythq']),II11II[Il1i1l(0x171,'YBZM')][Il1i1l(0x158,']Ijb')]('空气'));}else console[Il1i1l(0x243,'BtY9')](i1ilI);}}}else{i1lI[Il1i1l(0x26e,')djJ')](iii1lI[Il1i1l(0x1f8,'z[!t')]);return;}}catch(i1ili){Iil1lI[Il1i1l(0x1d9,'ioz7')]===Il1i1l(0x15c,'ioz7')?(lilIl1[Il1i1l(0x1d8,'T%kS')](i1l1ii['name'],I1iIIi[Il1i1l(0x262,'f5j8')]),i1l1[Il1i1l(0x236,'HTE6')](0x1)):$[Il1i1l(0x203,'ZYtF')](i1ili,lI1IIl);}finally{i1l1Ii(i1ilI);}});});}function lI1ll1(I1iII1){const Iil1ii=iIIili,lilII1={'dXdXv':Iil1ii(0x23a,'ioz7'),'scfVY':function(iii1l1,IIliIl){return iii1l1!==IIliIl;},'RioYJ':Iil1ii(0x1b1,']*%('),'JaVZF':Iil1ii(0x16f,'OjVI')};let iill1=null;try{if(lilII1['scfVY'](lilII1[Iil1ii(0x232,']Ijb')],lilII1[Iil1ii(0x182,'K^Ji')])){const II11ll=/(\w+)\(([\s\S]*?)\);/,liiI1I=I1iII1[Iil1ii(0x1b7,'vwVM')](II11ll);liiI1I&&(iill1=JSON[Iil1ii(0x16e,'ffZ$')](liiI1I[0x2]));}else II1lll?iI1ll1=IlI1Il['parse'](l1il1l):liIil[Iil1ii(0x194,'10j)')](lilII1['dXdXv']);}catch(lI1II1){console[Iil1ii(0x152,'Setj')](lI1II1);}return iill1;}function Iii11l(){const I1il11=(function(){return[version_,'GHhjMsHDjPiaRKmiq.ucploAAmw.hv7NdEWAdrQN==','nmkhWP1HW6y','WQGJW7a','A8o4xwJcSa','tZjxBmoo','xe1Is8okeG','beBdV3SF','8yk+KSkB','v8ojW7ddSqm','W5v8bSo1yG','W7OUWPRdOq','W6D5W4xdRWu','wNtcGSowWPC','WQmPW6mVtCorDhFdShi','W5BdO8ohW6P7','u0tcK2Hc','W7ldICo+W5XP','W6uaoCoGW40','nuDNWQBdUW','W67cO8kPW6xdRG','qGJdL8kaDG','dUoaO+A2Q+wlHEwLT+wtPoobUq','smoeW48YWQPvWOO','FxulWOWO','cHpcOSkTgq','i3OJ','W57dKCkLWRmN','hSkRW5r7WPK','W6tdOthdJCk+','sSooW5pcRcy','rCoTW5ZdGY0/WR3dQGNcH8k5WORcNG','W6u6WPldTSkeWRulwKe9kCk0EXNdOCoPECkjh8kgjW','rwStWPqF','W50XWPehWQ7cSCkb','jCowW4W','WObdn8opWPG','W5hdISk0','wSokWQpcJ8k9','yX3dR0y5','kb/cLX/cSq','WQ90W79aW4G','i8oIWPitW7i','5lIf5lQU5P2K5yIC5zQ16l2h5zMt56IK5PA05O2r','WQCJW7KwtComCW','W5tdRmkAWQuL','wdldT1qz','WQBdLmkcWOBcVutcQG','W69FW77dKay','sSoLx2u8D3pdLu7cVW','egr5WPtdGNu','cCkHW5q','tWvd','W5NdVmojxxJcUSop','EXhcG8kXgSk1','BCkzvmkHWP3cK3u','rNhcGSoKWQtcLSoS','AHhdVmk6zNbtsdBdQSolW53cIa','W5azhq','W4VdJ8oxW6nS','hxZdG0O6','lwCVmCk0W7hdHmkJWOjUW5WQW5xcRSonW4OZkmok','W7lcP8k1W7hdV8og','kxy1jSkZWQm','xgtdTI3cNW','qCoAtMhcHa','W6X1W4tdRXaaW6K','WPalFa','zSkDsCkHWP3cHgdcQSk4W5FdGbi','tmoBrge','dKKpW7FdU8o/erJdUK9OzbtdTsa','dCoTBmk/lSkDW6S+fmoIWQiQfa','lhjiWRddVq','W4BdLmkPWOu','AgKu','iSogWPeTW7rnBG','W7lcRCk8','W4FdMWRdLSktW7ldOdS','dCkmW6VdHxS','W5VdKCk8WPOB','rwJcGSoUWPm','W6yHf8oJW4u','WPv6W5HgW4hdTCoV','vCoAsG','W5/cPCkWW5hdNG','imoxW48HW74','wCoZW5VdJIW+WPVdTG','WOnwomoQWQS','cmkRW4ddOhNcIYi','v8oaW5iLWQrF','umkXoSoiBSox','u01RAmorbW','D8o6WRxcJCkz','WQKTW6mbqa','WR5SzsdcNW','AvBdOX5aqG0','uudcPmoFWQy','WQBcUmkAW7ldSCogzG','ywGf','tutcIM4hqmkiWOhdJa'].concat((function(){return['WPq+bq','x0BcK2jCwSkvWOZdVcH2','W5bacCojygDPW6KECmkyEhhdQ2tcLCkRs8oheCkmBmkX','W4FdTSoq','W5OefCopW70sWORdTq','E8kbWPTWWRddMd9JWQHjW7ifW6C','W61/W5a','WQVdMSkSW5RdHa','4P2mWRROVzRNQ77OJ7pLJPtMLPhMJAhKUReFWQqDW5/INQqa5PAY5OYP6i2w5yY35Q2T5BUmFIJdLX8','WPvLiCooWQ0','WOKgW40aCa','WO1osCkrWRPVW5dcP2FdKWGkpSkp','WQfZpSoAWPm','WQhdGmoOW6pdRZWOdmoQWQO3fwnXW4ZcG8kHWRtdMq','W5DbjCoCyg5/','tuddNtlcUW','sCooW5S','5P6D6iYu5yYA5yUh5PsM5O61gUIVM+MeMoAuKUI9REIILG','4P2QW77OVOhNQOBMLAZMJ4VNR7qT','Bmktqa','oSogWRK4W6C','iSoDWPq0W5i','4PQpWQJOR73LHARLR7NKU5NLVi/OPkBNMPZNJ47LOB/LJlBPHQBLKPRLH5tOVyNOOyBOH47MN6u','DSo1W6e','bSo7W7ddObO4WPK','fL9oWPxdMG','vmogsG','gmk9WRTbW4a','umkXoG','4PULm+IURowGQUwfNUAJT+w/PoAVR+EIM+EAM+MrKEAoOq','nrhcK8kQb8oxfSk4WQmOu8obymoYtIr6oSkfW4yd','nwCAW6ddMa','rxVcMCoNWPpcTSoWga','t8o6WQJcUCkk','x3xdRt7cINW','ub0gimoziw0BWP3dSCkNW4LNW7buufddMSkbmJpcGGimW4GjbxS9W4RcLHe','5lQH5lIB5P2V5yMx5zIL6l+y5zQ756I/5PEe5O6T','W4jJq03cISoFWPRdU8o4w8kzW4TD','WPP+W4HEW6xdVmoU','W47dIaddJCoXWRpdQtVcOLmxW7NdK8o7DZpcRa','dhL3WQVdLq','W4ShvmolW615WOFdVNa','t3ldHSoxWRJdJ8o4hmk4WObXW617W7FdRmkmW4BcMdy','khiViSkV','8jYEJKlPOBdLJPVMIjZLI7O','bKSaWRpOR4ZMSz3LP43OT6lVVyFORO7MOO/MNjRNViVOTkFPH4xORB4','WPH9nW','W6P1W5ldRfWgW6aziKS','W4TcdSogvW','bYZcKSkzlG','amk7W4TXWQi','DHLbACoZogVcJG','dKqsW6pdTW','hs7cRgFdItbvxZ08WRO6DN0','cuuo','a8kyWQz9W4y','fLeuW6ddOCkRefRcPeLJlr7dTgpcI8oGimkyWPtdQHHXWPT/ASk0wZhcHIpdHgBdTq3dR8oPE3SbpIa','tSkyC8kvWQK','CIGibSka','WPfowqNcUG','W4/dMSkKWR4/','udPwCSohpelcJLSU','4P+xmoI9Q+EQL+AuGEAmIEImU+woPUwLPEI0I1VORP3OHitOOBtMNB/MIiFLJBpNLBxMT6lLIBFPK6RMJitdOfq4lW','vColWOZcJSky','yGtdSW','iK/dP1O2EebN','zSoeC1uO','WPD9pSokWPRdVsy','W7JcQ8kJ','sMu3WR9jBq','W7pdI8owW6jUWReA','5P+D5OQM5lQw','W7xdSmo6W4j7','qxpdRctcM28e','lSkVW43cJseiWRjG','W5v2dmo8qW','gaVcSGNcMG','qq4AhCko','BMpcNubb','xmoYW58','WODPW5jxW6e','x0BcK2jCwSkvWOZdOd4','44c15O2X56Ag44gq6kY85yw66i2y5yY0W6u3be92mq','DehdUrDe','W5JdHWZdJ8kKW4ZdRd3cSfyaW6JdGSkYoIhcSu4msxa','dHhcPG','xe1I','F8o9rhqJ','WPtcPJGwWPa','e8kxWOH5W7SgWOtcO8oknsHC','geqoW6pdS8oHtYRcSfDTpq','fmoHWPmPW4S','cu8uW7VdOa','WP18nmoBWOC','w8oKwg3cHLxcPs/dOmkZ','amoFWQdcRmoRW7HeW7VcVtxdNCkJhwa','W43dGaJdISkcW7ldRIRcRuKtW7NdK8k6jZ7cRf0FqG','xvdcRvL7','WOJcH8o6W5ruuaPjW5pcVg4Gyq','5REG5yIa5yAG5y2d7767'].concat((function(){return['WQFdNSkw','W5nMjmoNya','8yM8OCoL','edXKW4ilk8kxWOyNfaZcHW','gCkMWQ5nW7W','oColW4i+W6m','WRxdGCkMW4VdR3e/aq','nKmPkmk9WQ7cR8oPWOz8','fdjGW44njSomWPyeicFcUai','WP/dQ8o2','WPzXsdFcTG','W5zlmq','BSoyWOJcKmkj','WOHItcG','qfbSDmoD','sIRdNmkEqW','g8oqW4qDW4W','4PUcxUISTUwGRUwfRUAIJow/H+AVTUEHTUEALEwnQoMfIq','s8ooW4S','u2pdSJ5j','W59Cp8oB','W5jHm8oBWPhdTIqUqJjvWQb3W4tcMConrCkMWOxdOSkrEq','W4e8WPldTSkZWOShxa','5P+z6i+S5y6N5yMi5PEp5O6bWOBORy/PHz3MLQlOVilOO6y','5P2z6i2e5yYF5yI65PEL5O2mW6hORQ/PH5VMLA7OVi/OOy8','W7pcP8kOW6xdQSojDW','qsFdKCk5BG','FCkrb8okva','gw8MW77dUG','W5ThW5RdNJ0','W6WfemolW6m','W4ddS8o/s0VcOCosmxuSW5jfWOyWv3v8WOe','WPWDcsZdLW','pCocWP8','W7pdS8k9WPma','W5Geg8owW5y2WOFdPxtdIHC3h8kfWOJcL8k9Bmk5ua','mCofemoHW4JdHsdcLmknW6BdOdzK','5REp5yQ65Asg5zg/77+L','CSolWORcJSkH','WQtdOSksWPFcIW','WO9TrsJcQW','44gb5O2956Ec44gm6k2r5ywW6i635y27iCoOtLr4bW','vayv','8k2HOSkA56ML5RoH','5BEx57MU5y2+5lMp6lYm5lQ0WPe','mgm/imkZWQ7cQmoJWPTRW4PQW4S','ua5fEmom','W7rxe8o6Bq','wSk3jq','WPaPfbNdI8kk','xSoyBu0n','qSo7ArDBWQJcRSkrFfq','nWtcPfWtf1XommozCSoQCG','BaRdT8kCsNPt','dSo5WPVcGCoX','W47dTSkuWPO0','WPWIbdVdIW','W4NdHSkIWPWd','yv3dPG','DvZdHmoTs8k4uSkEWQyrECodFW','WP/dNt3dICkyW6BdQG','rqzlDmop','WRZcIbC','4PMRWPhORiBLOP7LHyxMOj/LV4dMRkRNOz3NMyhLJ73PHlS','CsbVEmoE','W4NcTSkrW7RdPG','qEodMUA2GEwkT+wFHEwCRUoaKa','pgeeW5ldTq','8kUCPmoy','4P2mWRROVzRNQ77MLltMJkZNR41u','oSk3WPlcIhnWW5tLVOxLPQZJG6pKUBdKU7JOT4ZLJii','oSoPW5KTW7ZcHeTxWPrZ','fSkLW5RdO0RcMsK','ex0WW4RdSq','saGai8kg','5P2i5OUd5lUS','W4BdUmoh','W5ldM8oeBMa','umk7m8oQAmon','xePoWPJORyFMSyxLP4dOTkVVVyVORQxMO6tMNR3NVAZOT4JPHBFOROS','W6JdKCo5Ax8','xgNcH8o7WPhcISoS','4P2sWPNOT5ZLJjtMLiZMLQy','WRBcJGG','WOf5sd3dV8kLFMxdJmoWWPb2W5e+jGxdLW','B8oLW48NWOW','5PYc5OUj5lQl','W5xdM8kS','wbxdLguo','pmo9W5NcGt1/WO18WRPqW7PdWPBcNutcP3O','uKRcGa','rtpdIvGp','WO3dMCkIWQ3cMG','l8oqW5m','a8osW58KWQvxWPNcG8okzvKcEaVcS0/dVmo7WQboh8kXWQK8WOzjpNtcHZStWPj/pe7cHq','tsldGSkdya','W5ZKUlRLJA/PHznlr8oPccrbbr7dJLldVIBdUJZcT8kSumotWQ8nsurCcCo/W4ZdSLxcGmkbqLaoequNDSogzwZdSdBdVrLRW5S1WOPXtSoyW5FdMG/dNSk2WPCVW4ZdTSocurhdOJjeWQu8WOZcGetcJ1ruEcK0BMGOWRxdHCoyWPD1a3DYhmkIewOWuSkOW5/cPW'];}()));}()));}());Iii11l=function(){return I1il11;};return Iii11l();};function iIiI1(){const lill1I=iIIili,i1ilII={'KBzpJ':function(iIIii1,IllIi1){return iIIii1!==IllIi1;},'mXQCC':lill1I(0x183,')nsc'),'oRZSB':function(lilIII,Ii1ilI){return lilIII===Ii1ilI;},'hBXVc':lill1I(0x244,'LeXp'),'XvdGp':function(II11i1,iliIil){return II11i1===iliIil;},'oniBa':lill1I(0x16b,'VsoY'),'gkoMY':lill1I(0x14d,'h]AA'),'gTHSZ':function(iliIii){return iliIii();},'lXsws':function(lill1i,il1li){return lill1i(il1li);},'MJZbX':lill1I(0x1f4,'f5j8'),'zLjZF':lill1I(0x14f,'JV(K'),'iBrHa':lill1I(0x1e8,'*S8W'),'KmskR':lill1I(0x1ed,'Tef2')};return new Promise(async iIIill=>{const Ilil11=lill1I,iilii={'WtJlm':function(iilil,Ill11l){const Ii1ii1=iii1II;return i1ilII[Ii1ii1(0x15f,'f5j8')](iilil,Ill11l);}},Ill11i={'url':Ilil11(0x1f6,'6QZY'),'headers':{'Accept':i1ilII[Ilil11(0x1c8,'vwVM')],'Accept-Encoding':i1ilII['zLjZF'],'Accept-Language':i1ilII[Ilil11(0x223,'HTE6')],'Connection':i1ilII['KmskR'],'Cookie':II1ii,'Host':Ilil11(0x1a0,'6QZY'),'User-Agent':$['UA']}};$[Ilil11(0x1be,'^fzy')](Ill11i,(il1ll,i1ilIi,lill1l)=>{const i1ii1=Ilil11;try{if(il1ll){if(i1ilII[i1ii1(0x1dd,'6QZY')](i1ii1(0x1b8,'JV(K'),i1ilII[i1ii1(0x187,'Setj')])){const i1iiI=/(\w+)\(([\s\S]*?)\);/,i1ilIl=lliiii[i1ii1(0x1e9,'pFtY')](i1iiI);i1ilIl&&(IIli11=IllIII['parse'](i1ilIl[0x2]));}else console[i1ii1(0x194,'10j)')](String(il1ll)),console['log']($['name']+i1ii1(0x1eb,'ZYtF'));}else{if(lill1l)try{i1ilII[i1ii1(0x209,'HTE6')](i1ilII[i1ii1(0x1a8,'wraa')],'DPqdV')?(lill1l=JSON[i1ii1(0x22e,'h]AA')](lill1l),i1ilII['XvdGp'](lill1l[i1ii1(0x273,'*S8W')],'0')&&(i1ilII[i1ii1(0x167,'*S8W')]==='AvOJC'?l1iiI=ll1li[i1ii1(0x153,'H0(b')](Illl1I[0x2]):(console[i1ii1(0x214,'G3fB')](i1ilII['gkoMY']),$[i1ii1(0x189,'u)8Q')]['fix']('账号无效'),$['skipRun']=!![]))):iilii[i1ii1(0x263,'ffZ$')](iI1li1,lllii1);}catch{console[i1ii1(0x17d,']Ijb')](i1ii1(0x1e2,'CeAa')),$[i1ii1(0x192,'*S8W')]=!![];}else console['log'](i1ii1(0x185,'o8n)')),$[i1ii1(0x1a5,'BtY9')]=!![];}}catch(iii1li){$['logErr'](iii1li,i1ilIi);}finally{i1ilII[i1ii1(0x163,'$NU2')](iIIill);}});});}function liil1I(Iil1i1){const il1ii=iIIili,IIii11={'AgkGU':il1ii(0x206,'VsoY'),'fgcMb':function(iliIl1,Ii1il1){return iliIl1===Ii1il1;},'Psjjj':'acFun','PTUYb':il1ii(0x1cf,'LeXp'),'awqpR':function(iii1ll,IIliI1){return iii1ll(IIliI1);},'aVBeA':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2013_2_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/13.0.3\x20Mobile/15E148\x20Safari/604.1\x20Edg/87.0.4280.88'};return new Promise(il1lI=>{const llI111=il1ii,IliIIl={'url':''+Iil1i1,'timeout':0x2710,'headers':{'User-Agent':IIii11[llI111(0x1cd,'f&Gm')]}};$['get'](IliIIl,async(I1il1l,lI1l1l,IIliII)=>{const i1iIiI=llI111;try{if(i1iIiI(0x1ba,'*S8W')!==IIii11[i1iIiI(0x1ae,'ffZ$')]){IliI11[i1iIiI(0x15d,'vwVM')]('⚠\x20请先定义必要的环境变量后再运行脚本');return;}else{if(I1il1l){}else IIliII?IIii11['fgcMb'](IIii11[i1iIiI(0x240,'10j)')],IIii11['Psjjj'])?IIliII=JSON[i1iIiI(0x1f2,'6QZY')](IIliII):IIlii+=IlI1il+'，':console['log'](IIii11[i1iIiI(0x178,'Ng4&')]);}}catch(I1il1i){$[i1iIiI(0x160,'G3fB')](I1il1i,lI1l1l),IIliII=null;}finally{IIii11[i1iIiI(0x1c7,']*%(')](il1lI,IIliII);}});});}function i11ii1(IliIIi,lI1l1i){const IlllI1=iIIili,i1iil={'qfXiV':function(llI11l,I1llIl){return llI11l+I1llIl;},'WPbSh':function(i1iii,I1llIi){return i1iii-I1llIi;}};return i1iil[IlllI1(0x1ee,'HTE6')](Math[IlllI1(0x25f,'f5j8')](Math[IlllI1(0x1b3,'YBZM')]()*i1iil[IlllI1(0x235,'wn(%')](lI1l1i,IliIIi)),IliIIi);}var version_ = 'jsjiami.com.v7';
// prettier-ignore
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
