/*
909

每天抽奖一次

cron:35 23 9 9 *
============Quantumultx===============
[task_local]
#909
35 13 9-20 9 * jd_909.js, tag=909, enabled=true
*/

const $ = new Env('909');
var version_='jsjiami.com.v7';function I1liIII(_0x2775a7,_0x3b0256){const _0x557463=iI1ii1li();return I1liIII=function(_0x265ef5,_0x3bc3f0){_0x265ef5=_0x265ef5-0x9c;let _0x533002=_0x557463[_0x265ef5];if(I1liIII['BCHBrg']===undefined){var _0x5f4810=function(_0xd29764){const _0x59f4e0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x201936='',_0x33328d='';for(let _0x5e69f8=0x0,_0x2694ca,_0x57ba7a,_0x533da4=0x0;_0x57ba7a=_0xd29764['charAt'](_0x533da4++);~_0x57ba7a&&(_0x2694ca=_0x5e69f8%0x4?_0x2694ca*0x40+_0x57ba7a:_0x57ba7a,_0x5e69f8++%0x4)?_0x201936+=String['fromCharCode'](0xff&_0x2694ca>>(-0x2*_0x5e69f8&0x6)):0x0){_0x57ba7a=_0x59f4e0['indexOf'](_0x57ba7a);}for(let _0x509eb0=0x0,_0x5bb227=_0x201936['length'];_0x509eb0<_0x5bb227;_0x509eb0++){_0x33328d+='%'+('00'+_0x201936['charCodeAt'](_0x509eb0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x33328d);};const _0x3674ad=function(_0x412c24,_0x5a77c2){let _0x3b28a4=[],_0x3ccda4=0x0,_0x3a6e21,_0x3dc0a2='';_0x412c24=_0x5f4810(_0x412c24);let _0x5452f2;for(_0x5452f2=0x0;_0x5452f2<0x100;_0x5452f2++){_0x3b28a4[_0x5452f2]=_0x5452f2;}for(_0x5452f2=0x0;_0x5452f2<0x100;_0x5452f2++){_0x3ccda4=(_0x3ccda4+_0x3b28a4[_0x5452f2]+_0x5a77c2['charCodeAt'](_0x5452f2%_0x5a77c2['length']))%0x100,_0x3a6e21=_0x3b28a4[_0x5452f2],_0x3b28a4[_0x5452f2]=_0x3b28a4[_0x3ccda4],_0x3b28a4[_0x3ccda4]=_0x3a6e21;}_0x5452f2=0x0,_0x3ccda4=0x0;for(let _0x297b31=0x0;_0x297b31<_0x412c24['length'];_0x297b31++){_0x5452f2=(_0x5452f2+0x1)%0x100,_0x3ccda4=(_0x3ccda4+_0x3b28a4[_0x5452f2])%0x100,_0x3a6e21=_0x3b28a4[_0x5452f2],_0x3b28a4[_0x5452f2]=_0x3b28a4[_0x3ccda4],_0x3b28a4[_0x3ccda4]=_0x3a6e21,_0x3dc0a2+=String['fromCharCode'](_0x412c24['charCodeAt'](_0x297b31)^_0x3b28a4[(_0x3b28a4[_0x5452f2]+_0x3b28a4[_0x3ccda4])%0x100]);}return _0x3dc0a2;};I1liIII['NGderK']=_0x3674ad,_0x2775a7=arguments,I1liIII['BCHBrg']=!![];}const _0x57558f=_0x557463[0x0],_0x542e19=_0x265ef5+_0x57558f,_0x577fd4=_0x2775a7[_0x542e19];return!_0x577fd4?(I1liIII['LinCMy']===undefined&&(I1liIII['LinCMy']=!![]),_0x533002=I1liIII['NGderK'](_0x533002,_0x3bc3f0),_0x2775a7[_0x542e19]=_0x533002):_0x533002=_0x577fd4,_0x533002;},I1liIII(_0x2775a7,_0x3b0256);}const lI1lIl1i=I1liIII;(function(iIiill1i,Il1111iI,iiIll1il,iII1I1l,li11i111,lIIl1lli,iIii11Ii){return iIiill1i=iIiill1i>>0x1,lIIl1lli='hs',iIii11Ii='hs',function(lilli1i1,IIlll1lI,IiilIIIi,I1I1l1l,ll1lI1li){const i1ii1I1l=I1liIII;I1I1l1l='tfi',lIIl1lli=I1I1l1l+lIIl1lli,ll1lI1li='up',iIii11Ii+=ll1lI1li,lIIl1lli=IiilIIIi(lIIl1lli),iIii11Ii=IiilIIIi(iIii11Ii),IiilIIIi=0x0;const I11lI1iI=lilli1i1();while(!![]&&--iII1I1l+IIlll1lI){try{I1I1l1l=-parseInt(i1ii1I1l(0xd9,'GkwV'))/0x1+parseInt(i1ii1I1l(0xf4,'GkwV'))/0x2+-parseInt(i1ii1I1l(0x157,'Sb2d'))/0x3+parseInt(i1ii1I1l(0xae,'#r6%'))/0x4+parseInt(i1ii1I1l(0xbd,'d(c5'))/0x5*(parseInt(i1ii1I1l(0xea,'9[9p'))/0x6)+parseInt(i1ii1I1l(0x14b,'O*JM'))/0x7+-parseInt(i1ii1I1l(0x12f,'lf%#'))/0x8*(-parseInt(i1ii1I1l(0x18a,'O*JM'))/0x9);}catch(iliIIliI){I1I1l1l=IiilIIIi;}finally{ll1lI1li=I11lI1iI[lIIl1lli]();if(iIiill1i<=iII1I1l)IiilIIIi?li11i111?I1I1l1l=ll1lI1li:li11i111=ll1lI1li:IiilIIIi=ll1lI1li;else{if(IiilIIIi==li11i111['replace'](/[kYuFfVDTMtIryhBCQlOb=]/g,'')){if(I1I1l1l===IIlll1lI){I11lI1iI['un'+lIIl1lli](ll1lI1li);break;}I11lI1iI[iIii11Ii](ll1lI1li);}}}}}(iiIll1il,Il1111iI,function(I1liI11I,Ii1Illil,lII111lI,l1IlIl1l,Ili11iIi,IliliiIl,il1IlIi1){return Ii1Illil='\x73\x70\x6c\x69\x74',I1liI11I=arguments[0x0],I1liI11I=I1liI11I[Ii1Illil](''),lII111lI=`\x72\x65\x76\x65\x72\x73\x65`,I1liI11I=I1liI11I[lII111lI]('\x76'),l1IlIl1l=`\x6a\x6f\x69\x6e`,(0x13d73d,I1liI11I[l1IlIl1l](''));});}(0x17c,0x9c3dc,iI1ii1li,0xc0),iI1ii1li)&&(version_=iI1ii1li);const III1iII=$[lI1lIl1i(0xff,'wI2f')]()?require(lI1lIl1i(0xe3,'R*ZC')):'',lII1iII=$['isNode']()?require(lI1lIl1i(0xc9,'z3JE')):'',iliiIiii=require(lI1lIl1i(0x15d,'4&h8')),iIii1Il=require(lI1lIl1i(0xf6,'gYL*'));let IIl1I1I=lI1lIl1i(0x119,'Sb2d'),ii1il11l=lI1lIl1i(0xe4,'Ko6o'),Il1l1iii=[],Iii1i1lI='',i1II1lIi='',il1il1I1='';if($[lI1lIl1i(0xa3,'Brm2')]()){if(process['env']['jd_szxyun_teamId'])$[lI1lIl1i(0xe9,'!NjI')]=process[lI1lIl1i(0x9f,'mx^s')][lI1lIl1i(0x179,'fk6[')];if(JSON[lI1lIl1i(0xcd,'*sFV')](process[lI1lIl1i(0x191,'!NjI')])['indexOf']('GITHUB')>-0x1)process[lI1lIl1i(0xb6,'EH^D')](0x0);Object[lI1lIl1i(0xf2,'qwBz')](lII1iII)[lI1lIl1i(0x147,'a18l')](ilIIiii=>{const Ii11l1il=lI1lIl1i;Il1l1iii[Ii11l1il(0x167,'mTJd')](lII1iII[ilIIiii]);});if(process[lI1lIl1i(0x136,'PSg^')][lI1lIl1i(0xb0,'mTJd')]&&process[lI1lIl1i(0xe5,'WW^5')][lI1lIl1i(0x1ac,'mx^s')]===lI1lIl1i(0x171,'Uf)r'))console['log']=()=>{};}else Il1l1iii=[$['getdata'](lI1lIl1i(0x15c,'or4y')),$['getdata']('CookieJD2'),...$[lI1lIl1i(0xdb,'WW^5')]($[lI1lIl1i(0x187,'d(c5')](lI1lIl1i(0x195,'@PO!'))||'[]')[lI1lIl1i(0x197,'r*uL')](IlillilI=>IlillilI[lI1lIl1i(0xd3,'QJg)')])][lI1lIl1i(0x169,'gXpV')](IiIl1iI=>!!IiIl1iI);let i1Iii1I=lI1lIl1i(0xc0,'gXpV'),ili1IIIl=typeof $request!==lI1lIl1i(0x1a1,'mx^s');ili1IIIl&&(GetCookie(),$[lI1lIl1i(0x121,'O*JM')]());!(async()=>{const lIII1l1=lI1lIl1i,lII1lIl={'KRSVv':lIII1l1(0x15c,'or4y'),'vlCBb':lIII1l1(0x11d,'@69S'),'eYKaP':lIII1l1(0x183,'ZLjm'),'bVdKb':function(l1lli11l){return l1lli11l();},'JKKvV':lIII1l1(0x173,'eYRe'),'BGSYX':lIII1l1(0x14c,'or4y'),'VmrnN':function(Iliiii1,lIi1lII1){return Iliiii1<lIi1lII1;},'VUdOZ':function(lIil1Ii,iiI1l1ii){return lIil1Ii===iiI1l1ii;},'VBcTr':lIII1l1(0x15f,'9[9p'),'TqyRY':'glQsm','dkavX':function(IIllii1I,Iillil1l){return IIllii1I(Iillil1l);},'WNzjm':function(i11Iil11,i1liII1I){return i11Iil11+i1liII1I;},'rUrOG':function(i11IilIl,l1I11Ii1){return i11IilIl+l1I11Ii1;},'fjfrP':function(lIi11iiI,I1ili11I){return lIi11iiI+I1ili11I;},'SSRba':function(IlI1lI,Il1iIill){return IlI1lI!==Il1iIill;},'fdnTr':lIII1l1(0xab,'or4y'),'msHlI':lIII1l1(0x16a,'qwBz'),'obDum':'【提示】cookie已失效','beIjQ':function(IiIl1iI1,I11l1IIl){return IiIl1iI1+I11l1IIl;},'JueRN':function(IlIllIl,lliII1){return IlIllIl+lliII1;},'gPAIQ':'京东账号','Cmmvy':'\x0a请重新登录获取\x0ahttps://bean.m.jd.com/','UEjsc':function(i11Il,ll1l1i){return i11Il+ll1l1i;},'Pmkzy':function(liIilI1l,i11IlIli){return liIilI1l+i11IlIli;},'tAmMs':function(I1iil1i1,lllII1Ii){return I1iil1i1+lllII1Ii;},'sVPSu':function(IililIli,IIllIIi1){return IililIli+IIllIIi1;},'VUigB':function(l11I1iI,II11IiII){return l11I1iI+II11IiII;},'zrTsN':function(l1l1iiI1,Ili1li11){return l1l1iiI1+Ili1li11;},'XILzF':function(IlI1iliI,i1l1iiil,IiIiIii1){return IlI1iliI(i1l1iiil,IiIiIii1);},'bmROa':function(Ii1lIi,liI11l1I){return Ii1lIi*liI11l1I;},'MxzyS':function(I1iiII1l,lll1I1II){return I1iiII1l!==lll1I1II;}};if(!Il1l1iii[0x0]){$[lIII1l1(0x12c,'fZSl')]($[lIII1l1(0xc7,'EH^D')],lII1lIl[lIII1l1(0xd7,'9[9p')],lII1lIl[lIII1l1(0x162,'lf%#')],{'open-url':lII1lIl[lIII1l1(0x15a,'ZLjm')]});return;}for(let IiiIiI1i=0x0;lII1lIl['VmrnN'](IiiIiI1i,Il1l1iii['length']);IiiIiI1i++){if(lII1lIl['VUdOZ'](lII1lIl[lIII1l1(0x9c,'gXpV')],lII1lIl[lIII1l1(0x1a2,'eYRe')]))I111llli=[I1ilI1[lIII1l1(0x186,'%*Xd')](lII1lIl[lIII1l1(0xaf,'%sj5')]),lIii1iiI[lIII1l1(0x1a7,'%sj5')](lII1lIl[lIII1l1(0x18b,'DpQf')]),...IlI1iIIi['toObj'](il1il1il[lIII1l1(0xee,'fZSl')](lII1lIl[lIII1l1(0x10a,'EH^D')])||'[]')[lIII1l1(0x10f,'gYL*')](IiIlil1i=>IiIlil1i['cookie'])]['filter'](I11lIllI=>!!I11lIllI);else{if(Il1l1iii[IiiIiI1i]){Iii1i1lI=Il1l1iii[IiiIiI1i],$[lIII1l1(0x130,'@PO!')]=Il1l1iii[IiiIiI1i],$[lIII1l1(0x172,'wI2f')]=lII1lIl[lIII1l1(0xfd,'a18l')](decodeURIComponent,Iii1i1lI[lIII1l1(0x132,'r*uL')](/pt_pin=(.+?);/)&&Iii1i1lI[lIII1l1(0x14a,'@PO!')](/pt_pin=(.+?);/)[0x1]),$[lIII1l1(0x154,'(WI!')]=IiiIiI1i+0x1,$[lIII1l1(0x182,'@PO!')]=!![],$[lIII1l1(0xa6,'GkwV')]='',console[lIII1l1(0x108,'mTJd')](lII1lIl[lIII1l1(0xd4,'@PO!')](lII1lIl[lIII1l1(0x139,'J6U5')](lII1lIl[lIII1l1(0xb5,'*sFV')](lIII1l1(0x14f,'A@EX'),$[lIII1l1(0xb4,'WW^5')]),'】'),$[lIII1l1(0x1b4,'ZLjm')]||$[lIII1l1(0x1ad,'ngDz')])+'\x0a');if(!$['isLogin']){if(lII1lIl[lIII1l1(0x105,'Sb2d')](lII1lIl[lIII1l1(0x1a0,'fZSl')],lII1lIl[lIII1l1(0x137,'mTJd')])){$[lIII1l1(0x170,'sm23')]($[lIII1l1(0xf9,'azvF')],lII1lIl['obDum'],lII1lIl[lIII1l1(0x1b7,'Brm2')](lII1lIl['JueRN'](lII1lIl['rUrOG'](lII1lIl[lIII1l1(0xa7,'MWLF')](lII1lIl[lIII1l1(0x180,'qwBz')],$[lIII1l1(0x189,'ngDz')]),'\x20'),$[lIII1l1(0x134,'or4y')]||$[lIII1l1(0x128,'DpQf')]),lII1lIl['Cmmvy']),{'open-url':lIII1l1(0xad,'mx^s')});$['isNode']()&&await III1iII[lIII1l1(0x1b1,'gYL*')](lII1lIl[lIII1l1(0x11f,'%*Xd')](lII1lIl['Pmkzy']($[lIII1l1(0x12a,'LVs9')],'cookie已失效\x20-\x20'),$[lIII1l1(0x12d,'n47]')]),lII1lIl[lIII1l1(0xa8,'qwBz')](lII1lIl[lIII1l1(0xe6,'!NjI')](lII1lIl[lIII1l1(0x142,'azvF')](lII1lIl[lIII1l1(0x114,'WW^5')](lIII1l1(0xce,'@PO!'),$[lIII1l1(0x161,'GkwV')]),'\x20'),$[lIII1l1(0x113,'ZLjm')]),'\x0a请重新登录获取cookie'));continue;}else Il1iI1I1[lIII1l1(0xe0,'EH^D')](I1iliIiI[lIII1l1(0x145,'*sFV')]),llii1lIl=!![];}$['UA']=await lII1lIl[lIII1l1(0x15e,'QJg)')](iIii1Il,$[lIII1l1(0x124,'d(c5')]),await lII1lIl[lIII1l1(0x1a3,'lf%#')](lIliIiIl),await $[lIII1l1(0x177,'azvF')](lII1lIl[lIII1l1(0xe2,'G3]5')](parseInt,lII1lIl[lIII1l1(0x151,'A@EX')](lII1lIl[lIII1l1(0x17a,'4&h8')](Math[lIII1l1(0x104,'GkwV')](),0x3e8),0x7d0),0xa));if($[lIII1l1(0x11a,'zew!')]||$['activityEnd']){if(lII1lIl['MxzyS'](lIII1l1(0x117,'or4y'),'wyyAG'))break;else lII1lIl['bVdKb'](liliIIIi);}}}}})()[lI1lIl1i(0x118,'DpQf')](lil1Ilil=>{const llI1llll=lI1lIl1i;$['log']('','\x20'+$[llI1llll(0x18f,'@PO!')]+llI1llll(0x18c,'9[9p')+lil1Ilil+'!','');})[lI1lIl1i(0x135,'@69S')](()=>{const iI1I1i11=lI1lIl1i;$[iI1I1i11(0xf0,'gXpV')]();});async function lIliIiIl(){const lI1iliI=lI1lIl1i,i1IiIIIl={'MyWMC':function(iilllii,iliIl1,IilIIl1i){return iilllii(iliIl1,IilIIl1i);},'OyKil':function(IIlliiII,I1IIiii1){return IIlliiII==I1IIiii1;},'mYoKE':function(I1IiiIli){return I1IiiIli();},'PVAnP':function(ll1ilIi){return ll1ilIi();},'cvIiJ':function(Ii1IiiiI){return Ii1IiiiI();},'YsYBM':function(I1i1IlIi,ilIi1iII){return I1i1IlIi<=ilIi1iII;},'Wojwf':function(l1Ii11iI,iil1ll1I){return l1Ii11iI(iil1ll1I);},'oRLzF':function(iilliII,Ii11IIIl){return iilliII*Ii11IIIl;}};$[lI1iliI(0x159,'9Gjl')]='',krhot=![],kruser=![],$['token']=await i1IiIIIl[lI1iliI(0xcf,'J6U5')](iliiIiii,Iii1i1lI,IIl1I1I);if(i1IiIIIl[lI1iliI(0x116,'Uf)r')]($[lI1iliI(0x112,'n47]')],'')){console['log']('获取[token]失败！');return;}await i1IiIIIl[lI1iliI(0x165,'QJg)')](ii11ilIl);if(!krhot){await IiI1ilIi();if(!kruser){await i1IiIIIl['PVAnP'](IiI1ilIi),console[lI1iliI(0x129,'Uf)r')]('抽奖次数为'+$[lI1iliI(0xfc,'muy@')]+'次');for(m=0x1;$[lI1iliI(0x17b,'G3]5')]--;m++){await i1IiIIIl[lI1iliI(0x133,'a18l')](iIl1lIi1);if(i1IiIIIl['YsYBM'](i1IiIIIl['Wojwf'](Number,$['coins']),0x0))break;if(m>=0x5){console['log'](lI1iliI(0xd5,'%sj5'));break;}await $[lI1iliI(0xbe,'ZLjm')](i1IiIIIl['MyWMC'](parseInt,i1IiIIIl[lI1iliI(0x127,'ZLjm')](Math['random'](),0x3e8)+0x3e8,0xa));}}}}function ii11ilIl(){const IIlliIII=lI1lIl1i,IIilIll1={'JYXYL':function(ii1illli,ilIl1ilI){return ii1illli==ilIl1ilI;},'whDmV':IIlliIII(0x1a5,'mx^s'),'zhHvU':IIlliIII(0xa2,'*sFV'),'JxcNe':function(IillliII,lilII11){return IillliII===lilII11;},'oOIKc':'MMNJh','eLfef':function(IiliI1II){return IiliI1II();},'uRIHN':IIlliIII(0xb8,'d(c5'),'KxmYd':IIlliIII(0xfe,'muy@'),'YtQWR':IIlliIII(0x19c,'sm23'),'wjPIM':IIlliIII(0xf8,'A@EX'),'JvHuu':IIlliIII(0x140,'zew!'),'Wnwfy':IIlliIII(0x193,'@PO!'),'qheAC':'keep-alive','pwQWV':function(I1lllil,Ilili11){return I1lllil*Ilili11;}};return new Promise(IIiIliIi=>{const I1ii1111=IIlliIII,ill1Il1i={'url':IIl1I1I+I1ii1111(0x13c,'#r6%')+$[I1ii1111(0x15b,'WW^5')]+I1ii1111(0x11b,'qwBz'),'headers':{'Host':IIilIll1[I1ii1111(0x148,'wI2f')],'Accept':'application/json,\x20text/plain,\x20*/*','App-Key':i1Iii1I,'Accept-Language':IIilIll1[I1ii1111(0x110,'gYL*')],'Accept-Encoding':IIilIll1[I1ii1111(0x123,'Sb2d')],'Content-Type':I1ii1111(0x185,'zew!'),'X-Requested-With':IIilIll1[I1ii1111(0xcc,'mx^s')],'Sec-Fetch-Site':'cross-site','Sec-Fetch-Mode':IIilIll1[I1ii1111(0xa4,'muy@')],'Sec-Fetch-Dest':IIilIll1['Wnwfy'],'Origin':IIl1I1I,'User-Agent':$['UA'],'Referer':ii1il11l,'Cookie':Iii1i1lI,'Connection':IIilIll1['qheAC']},'timeout':IIilIll1[I1ii1111(0x141,'EH^D')](0xa,0x3e8)};$[I1ii1111(0x17d,'lf%#')](ill1Il1i,async(I1111ll,IIIllli1,i1Ilili1)=>{const iilII1II=I1ii1111;try{i1Ilili1=JSON[iilII1II(0xa5,'%*Xd')](i1Ilili1);if(i1Ilili1){if(IIilIll1['JYXYL'](i1Ilili1['status'],0x0)){if(IIilIll1[iilII1II(0xb7,'Sb2d')]===IIilIll1[iilII1II(0x163,'DpQf')]){let IIilli=lIIIII11?.['body']?.[iilII1II(0x1aa,'%sj5')]===null?'空气':lIli1III[iilII1II(0xc2,'G3]5')](iI1IiIIl);I11i1[iilII1II(0xbb,'wI2f')](iilII1II(0xa1,'A@EX')+IIilli);}else $[iilII1II(0xb3,'@PO!')]=i1Ilili1?.[iilII1II(0x11c,'%sj5')]?.[iilII1II(0x10e,'lf%#')];}else console[iilII1II(0x100,'mx^s')](i1Ilili1[iilII1II(0x131,'n47]')]),krhot=!![];}}catch(l1iil11l){$['logErr'](l1iil11l,IIIllli1);}finally{if(IIilIll1['JxcNe'](IIilIll1['oOIKc'],iilII1II(0xf7,'gYL*'))){if(typeof I1l1llil[iilII1II(0x10d,'d(c5')](IIlIIilI)==iilII1II(0xeb,'MWLF'))return!![];}else IIilIll1[iilII1II(0x19f,'gYL*')](IIiIliIi);}});});}async function IiI1ilIi(){const ii1llII=lI1lIl1i,IIiII11i={'gLiVN':function(ilI11liI,IIl1il1i){return ilI11liI==IIl1il1i;},'QitQm':function(ii1Ii11,lIIilli){return ii1Ii11===lIIilli;},'GPJtH':function(l11Il1Il,il1II1ll){return l11Il1Il!==il1II1ll;},'xpJCa':'tvGVc','gmbHw':ii1llII(0xcb,'r*uL'),'ULMZa':function(lIiIilIi,i1IIili){return lIiIilIi+i1IIili;},'Lksbo':ii1llII(0xbc,'%*Xd'),'dOdcp':'com.jingdong.app.mall','RBGNf':'cross-site','CVVFt':ii1llII(0xd2,'qwBz'),'aclKC':ii1llII(0x12e,'or4y'),'URjiR':function(il11ii1I,IilliIl1){return il11ii1I*IilliIl1;}};let iI1l1i1={'url':IIl1I1I+ii1llII(0x194,'9Gjl'),'headers':{'Host':IIiII11i[ii1llII(0x138,'sm23')],'Accept':ii1llII(0x1ae,'sm23'),'App-Key':i1Iii1I,'Accept-Language':'zh-CN,zh-Hans;q=0.9','Accept-Encoding':ii1llII(0x18e,'9Gjl'),'Content-Type':'application/json','Authorization':IIiII11i['ULMZa'](IIiII11i[ii1llII(0x16e,'#r6%')],$[ii1llII(0x1a6,'LVs9')]),'Origin':ii1llII(0x150,'@PO!'),'X-Requested-With':IIiII11i['dOdcp'],'Sec-Fetch-Site':IIiII11i['RBGNf'],'Sec-Fetch-Mode':IIiII11i[ii1llII(0x103,'ZLjm')],'Sec-Fetch-Dest':IIiII11i['aclKC'],'User-Agent':$['UA'],'Referer':ii1il11l,'Cookie':Iii1i1lI,'Connection':ii1llII(0x13d,'%*Xd')},'timeout':IIiII11i['URjiR'](0xa,0x3e8)};return new Promise(Il1llIli=>{const i1i1IIII=ii1llII;IIiII11i['GPJtH'](IIiII11i['xpJCa'],'tvGVc')?(i1ll1ii1=IlIiiiI1[i1i1IIII(0x115,'zew!')](iI1Illi1),liIIi1ll&&(liI1lI1l[i1i1IIII(0x176,'gXpV')]==0x0?lil1lI1i[i1i1IIII(0x160,'@69S')]=II1iII11?.['body']?.['user']?.['coins']||0x0:(i1iil[i1i1IIII(0xaa,'a18l')](lI11lil1[i1i1IIII(0x16d,'z3JE')]),iliII1li=!![]))):$[i1i1IIII(0x168,'Brm2')](iI1l1i1,async(IilliilI,iI1iiI1,IIi1Ili1)=>{const Iiii1ii=i1i1IIII;try{IIi1Ili1=JSON['parse'](IIi1Ili1);if(IIi1Ili1){if(IIiII11i[Iiii1ii(0xbf,'*sFV')](IIi1Ili1[Iiii1ii(0xf3,'J6U5')],0x0)){if(IIiII11i[Iiii1ii(0xf5,'azvF')](Iiii1ii(0x152,'Sb2d'),Iiii1ii(0x196,'or4y')))return IIIilII[Iiii1ii(0x107,'@PO!')](iIiIIi),![];else $[Iiii1ii(0x19e,'%sj5')]=IIi1Ili1?.['body']?.[Iiii1ii(0x10c,'R*ZC')]?.[Iiii1ii(0x17c,'zew!')]||0x0;}else console[Iiii1ii(0x102,'sm23')](IIi1Ili1['message']),kruser=!![];}}catch(I1IiII1){$[Iiii1ii(0xef,'DpQf')](I1IiII1);}finally{Il1llIli();}});});}async function iIl1lIi1(){const i1iliIl1=lI1lIl1i,Iilll1l1={'dyRQS':'string','sTjsH':function(lIIlI1II,iIIIl1i){return lIIlI1II==iIIIl1i;},'amdUW':'IUUuO','Bjpxg':function(llI1i1il,I11lII1I){return llI1i1il==I11lII1I;},'RNAyr':function(liIlIill,illil1i){return liIlIill===illil1i;},'EHWbQ':'DxcYW','zxKuJ':i1iliIl1(0x143,'(WI!'),'ocSdX':i1iliIl1(0x17e,'!NjI'),'HgRKR':i1iliIl1(0xed,'fZSl'),'CaDio':i1iliIl1(0x126,'EH^D'),'dJLCh':i1iliIl1(0x1a4,'fZSl'),'LPRsn':function(l11IllIl,lilI1lI1){return l11IllIl+lilI1lI1;},'PUvIh':i1iliIl1(0x184,'9[9p'),'jfePY':i1iliIl1(0xde,'Uf)r'),'BzxGT':'cross-site','QySCL':'cors','rgtaW':i1iliIl1(0x14e,'z3JE'),'VLJFF':'keep-alive','uuODp':function(i1iIlii,IIl1l1l1){return i1iIlii*IIl1l1l1;}};let lI1iI1iI={'url':IIl1I1I+i1iliIl1(0x122,'9Gjl'),'body':'','headers':{'Host':Iilll1l1['ocSdX'],'Accept':Iilll1l1[i1iliIl1(0xe1,'MWLF')],'App-Key':i1Iii1I,'Accept-Language':Iilll1l1[i1iliIl1(0xec,'z3JE')],'Accept-Encoding':Iilll1l1['dJLCh'],'Content-Type':'application/json','Authorization':Iilll1l1[i1iliIl1(0x1a9,'MWLF')]('Bearer\x20',$[i1iliIl1(0x14d,'Brm2')]),'Origin':Iilll1l1[i1iliIl1(0x13b,'or4y')],'X-Requested-With':Iilll1l1['jfePY'],'Sec-Fetch-Site':Iilll1l1[i1iliIl1(0xb1,'O*JM')],'Sec-Fetch-Mode':Iilll1l1[i1iliIl1(0x1b5,'EH^D')],'Sec-Fetch-Dest':Iilll1l1[i1iliIl1(0x9d,'#r6%')],'User-Agent':$['UA'],'Referer':ii1il11l,'Cookie':Iii1i1lI,'Connection':Iilll1l1[i1iliIl1(0x125,'Sb2d')]},'timeout':Iilll1l1[i1iliIl1(0x19a,'R*ZC')](0xa,0x3e8)};return new Promise(lIIl1ilI=>{const lI11iiI=i1iliIl1;if(Iilll1l1['EHWbQ']===Iilll1l1[lI11iiI(0x174,'or4y')]){if(typeof iI1lIII==Iilll1l1[lI11iiI(0x10b,'sm23')])try{return ii1II1Ii[lI11iiI(0x1b3,'Brm2')](IlIlIIIl);}catch(i11IIii){return llIIiIi1[lI11iiI(0x1b0,'muy@')](i11IIii),IIiIlI1i['msg'](I11lii11['name'],'',lI11iiI(0x153,'4&h8')),[];}}else $[lI11iiI(0xd0,'EH^D')](lI1iI1iI,async(illiilII,l1IIllii,liI1i11)=>{const lliIlII=lI11iiI;try{liI1i11=JSON['parse'](liI1i11);if(liI1i11){if(Iilll1l1[lliIlII(0x188,'MWLF')](liI1i11?.['status'],0x0)){if(Iilll1l1[lliIlII(0xc6,'muy@')]!=='IUUuO')i11I1Il[lliIlII(0x178,'n47]')]('','\x20'+IlIilll1['name']+lliIlII(0x1a8,'mTJd')+i1IlII+'!','');else{if(Iilll1l1[lliIlII(0xe8,'4&h8')](liI1i11?.[lliIlII(0x146,'O*JM')]?.[lliIlII(0xa0,'G3]5')]?.[lliIlII(0xac,'gXpV')],0x1))console['log'](lliIlII(0xfb,'a18l')+liI1i11?.[lliIlII(0x17f,'mTJd')]?.[lliIlII(0xe7,'Ko6o')]?.[lliIlII(0x144,'mx^s')][lliIlII(0xfa,'GkwV')]+'\x20'+liI1i11?.[lliIlII(0x19d,'sm23')]?.[lliIlII(0x158,'#r6%')]?.[lliIlII(0xa9,'LVs9')]+']');else{let iliIIl11=Iilll1l1[lliIlII(0x13e,'G3]5')](liI1i11?.[lliIlII(0xdd,'G3]5')]?.['user_prize'],null)?'空气':JSON[lliIlII(0xc1,'%*Xd')](liI1i11);console[lliIlII(0x101,'WW^5')](lliIlII(0x1b2,'eYRe')+iliIIl11);}}}else console[lliIlII(0x100,'mx^s')](liI1i11[lliIlII(0x1ab,'%sj5')]);}}catch(i1l1111i){$['log'](i1l1111i);}finally{lIIl1ilI();}});});}function l11IIlIi(l11I1l11){const l1lI1lI1=lI1lIl1i,l1illlIl={'oMhBa':function(Iil1iIll,iilli1i1){return Iil1iIll||iilli1i1;},'KCkpC':l1lI1lI1(0xb2,'A@EX'),'CfxSp':function(i1liIlII,iIiiI1){return i1liIlII<iIiiI1;},'DQpxh':function(lIi11iI,IIliIl1){return lIi11iI*IIliIl1;}};l11I1l11=l1illlIl[l1lI1lI1(0xda,'QJg)')](l11I1l11,0x20);let Iii11=l1illlIl['KCkpC'],li1il1i=Iii11[l1lI1lI1(0x192,'r*uL')],lII1l1lI='';for(i=0x0;l1illlIl[l1lI1lI1(0x11e,'Uf)r')](i,l11I1l11);i++)lII1l1lI+=Iii11[l1lI1lI1(0xdc,'muy@')](Math[l1lI1lI1(0x156,'or4y')](l1illlIl[l1lI1lI1(0x164,'!NjI')](Math[l1lI1lI1(0xdf,'G3]5')](),li1il1i)));return lII1l1lI;}function IiI11111(Ii1lil){const IiIiil=lI1lIl1i,lii1IllI={'AbKtt':function(lliiIIi1,IIil11il){return lliiIIi1!==IIil11il;},'QdTAD':IiIiil(0xba,'fZSl'),'lOBZC':function(IIlll1l1,I1llil1l){return IIlll1l1==I1llil1l;}};if(!Ii1lil)return console[IiIiil(0xef,'DpQf')](IiIiil(0xd1,'GkwV')),![];try{if(lii1IllI[IiIiil(0x19b,'EH^D')](IiIiil(0x13a,'mx^s'),lii1IllI['QdTAD'])){if(lii1IllI[IiIiil(0x1af,'MWLF')](typeof JSON[IiIiil(0x149,'!NjI')](Ii1lil),'object'))return!![];}else ll1liil1['log'](IiIiil(0x16c,'muy@')+IIlIi1i?.[IiIiil(0x109,'n47]')]?.['user_prize']?.[IiIiil(0x1b6,'DpQf')]['quota']+'\x20'+iIilI?.[IiIiil(0x16f,'lf%#')]?.[IiIiil(0x175,'!NjI')]?.['prize_name']+']');}catch(IiIIIlil){return console[IiIiil(0x120,'or4y')](IiIIIlil),![];}}function liIiiIlI(ll1I1li1){const il11liI1=lI1lIl1i,iIlilI1={'JQTxS':function(iIIII,iI1ilIIi){return iIIII==iI1ilIIi;},'NVpYX':'string','Bcssa':il11liI1(0x155,'a18l'),'iIldT':il11liI1(0xc4,'%*Xd'),'YGeqC':'MqQFb'};if(iIlilI1[il11liI1(0x16b,'%*Xd')](typeof ll1I1li1,iIlilI1[il11liI1(0x166,'n47]')])){if(iIlilI1[il11liI1(0x106,'J6U5')]!==il11liI1(0x12b,'gXpV'))try{if(iIlilI1[il11liI1(0xc5,'ZLjm')]!==iIlilI1['YGeqC'])return JSON[il11liI1(0x18d,'%sj5')](ll1I1li1);else IlIii1ll();}catch(iliIiIlI){return console[il11liI1(0x129,'Uf)r')](iliIiIlI),$[il11liI1(0xca,'z3JE')]($[il11liI1(0x111,'4&h8')],'',il11liI1(0x190,'*sFV')),[];}else IIill1il(),IliI1iiI[il11liI1(0x198,'qwBz')]();}}function Il1ill(Il1l11lI,ilIlIl){const iiIli11i=lI1lIl1i,lII1lIil={'ouXZX':function(IlIIIIli,i11ill1){return IlIIIIli-i11ill1;}};return Math[iiIli11i(0xc3,'@PO!')](Math[iiIli11i(0x181,'or4y')]()*lII1lIil[iiIli11i(0xb9,'MWLF')](ilIlIl,Il1l11lI))+Il1l11lI;}function iI1ii1li(){const i1iIIlll=(function(){return[...[version_,'VQtjsDjhCilaumDiMT.OcBokhmYrI.uyvFbB7ukf==','W7dcMCkI','W6OSrmkh','td8TW6lcPmkPmmo0oxLpna','W6jTtue','gXnrwrvR','C8oneSkUW74wFb9NzSo4tq','WRfnWPahW5S','vcvYWQldV8o8nSozmLOen8kFW5VdP1/dM0q','lejgWRpdLW','mmk4sCoxWR/dLCoJmSkNDqxdKeFcN8o0oYWgvvLw','WO5fWOKZ','oSkit8oPWQS','5OQt5lQl776/W4q','jCoeW7NcTCon','sSonW4tdQCos','pmodWR3cMmoWW7VdLX4mrSoSW40qWOjmW7H3W6/cRW','CKH4vw7dIG','WO8Vkq','rSopW5y','vSkzWRe','W5mef2z0','oCkCtSo5WQvd','kt8wcSoB','kGrdxGe','kCoBWOC','W5RdGuK','BCkYW5mR','A8k2WQ0pWPC','xSkpWOtcVCkL','qmohjmkB','W4/dGZtdRNS','W4FdU2fMkLVdLdSoaCoazq','f2TK','mxj5WO7dTq','W63dGSk2oG','E8kYW5W3WQm','W4uHjfjoasVcIW','umosW6xdH0K','z8klWOeJW68','l8o/uGRcPG','WORdHmk6Cd4','W7/cL8kXWQnz','eHGWgmojhCoXlSk5WRZcKNZcGmk9mmo2ksj5W4LTW7CnrSoopNFcUSoWWPW0mq','F8klWOavW6tcQa','WQ9Iug3dHGRdV8k8W6W9WOrPW58bW5vVW4JcTmoLWQZcGZ7dOSkQWOaIWP85WQ1FCSolhmkOAbK','WPj4CSkd','WRniW7VcHstcNCoQW7/cTW','i8oGytdcUG','WRpcGc7dKCk7','WQxdVCkz','W7fEW686','rCogewzfW65RWQVdI1eeh19uitzDqe/dRNZdQ0XQWOVcO8o/W5JcSZ3dJmkXWQWXE8oAumklWOVcQIhcVrdcGIpcKWjvzexdK8oYW4tdRvCHWOrC','iXGvp8oO','W6RdKspdR1ddSJHM','lcaolSo8','DmkhW4STWONdUvCCrmkiuCkEwCoKW4pcH8oyW6OO','W78advPg','W4NcHCkGWRj/W5RcK0K','dmoPFG','gIHJCG','W6mxwmknWRm','xmk5CW','wSkUW5iGWOpdIYC1','WQZdV8kovW8','WPxcQtS2ybRdRGOfbmolxq','kSodWO7dU8kLpmkBurO','ySk4W4qHWQZdJs8','WONcOhXXWP0','tCoqW6ZdTSoa','WQFdU8kDsdGRWQ9j','WPzoW7RcJYhcLmoz','imocfG','W5VdNwBcQu8','xCkBWRtcPmkb','gJjcyIC','WQWfbNBcRa','WPNdH8kiAH4','nCkEW4W5WQBdSMeYAmoJsqtdQ346W5i','WO3cOchdKSo1uCkyW6NdTfO','emkxW7uGpq','WOpcNH3dTthcG8o6WOa2wqJcUW4','DmkfWOeJ','FSkyWRC5WPe','WRzXWO0XW7q','WP3dTKFcUW8','WPmYj1xcOgJcM8kSf1u','WQitWQBcGmosW5au','W7DEW6uM','smojW5FdMSoRW53cGq','BML/CKq','W6fxW455WOO','kmovWPtdM8kI','WQabWRjVeHBdI37dGCkUW4tcLCk3','WQhdPSkkuWvWW60dW4/dGSkOW7myl0BcKYNcV8kyWOpdMxa'],...(function(){return[...['W5LoWRNdTCkfomoikSonfCkfW7yW','FqPwhWm','wEw/L+wNR+odQEs5UEs6OoI2Q+woOG','lCoaWPtdImk5ACoFfW/dRCoYfgzSW6/cV8onWRnzW44','iCkcvSk2WPi','mJK3kCoZ','6k205yMC6zMu5Owq5z6eW7tdQxhdR8k+6l6d5yE45QoP5l6m5PwZ5ywO5A+NEUw4LEIUS+MdQoI/G+IhLEACUowpPoImKUwpJmohvmkHWQRcQuK','WQddU3hcKYi','ECopW6/dSSoS','WQ/dVSkrtaq','svXZx8koeSoVs8kZWRBcU0lcGa','B8kmW5W/WPhcRxK0yCk5','hSodhI5y','W5iveNLy','xSopW5RdKwK','WORdVCkrsb8VWOHO','WQ3cJmk9kSocW5xdSMddISkJp8o2W50fl8kzcH/cHhJcNa','WOicgSoKta','W6hdVgjpAq','WPniW73cGd4','iSktrmo4WRi','W6tdN1fAaq','W6BcNSknWRzK','W5vNW4XYWOC','WOSWfmozuq','qCklW4ClWPu','W4BdM13cRq','W79EWRK','W6GQrSkwWPHC','W4TME3pdVq','WQZcLbddMSkl','5OU75lQg776kWOa','DqjvgbSlwW','vSkuW4OVWQe','W4tdT2z6','v8kfWRe','bSoNDrdcRW','tKHtsetdJSoOW54','44g/5O6b56E844ks6kYF5yEM6i+t5yYj5lMg5lUa6lw15yYD5lIqWPtdRCoZW6ldTmk8W6tNM47MJR/KVkVNL4ddG3hdOCoCWPhdGoEyTUs5Oos4GoEVGowiIoInGEwoVW','WRpdQSk1vJW','W6rfW5L4WRbZW5/dRmoPWQm','W703s8kwWOHD','WPDfWO0I','y8kYW5a','vf7dQdPwaYvEWQvhW7/cMSkIW7tdMSoM','W6hdJSkjemon','iCk2W503pa','DmkfWPO+W7K','W5BdT3f3','W6LFW5j4WPPQWOddRmoGWRddVCkJptrzWPhcRCoAW7vWW7TqWQSf','W5tdGuRcVa','W65yDxVdPa','WRVdS8kqrXKN','lmohWQZdL8kToSkE','W5m9lKTPbtxcPfy','W6ldMNHDtuRdK8kGW6iTwCoEW6ShWO7dPSoTimkmdG','DSkAWOm8W6pcR17cQ8kWoSkFiZFdKmoWgW','WOhcOdddHSk5rmkv','W5JdHZldUx/dPZq','qaTXbqu','ccdcIXWT','WQXbW5G4rhdcTq','W6RcMSkgWOjt','WQBcJUwKVEI0Ib9q5y2J5zMVWQH/','WOb2zmkjpq','dCowhdSAWQ1NWQhdGLfigvuxBhLo','k8ovWO3dNq','6kY45yQj6zMA5OE85z6BW7uEfSkhx+I8OowfOUAHVUs8P+AwKowfKUwUP8ky5BMK6k+76ycl6l+46iwD5PYo5y6S6i2v5y2semk0W57cHCkqEq','W7ryW4O','WOJcPgz1WOez','imozWPddJmkZ','rCogewzfW65RWQVdI1eeh19uitzDqe/dRNZdQ0XQWPlcV8oWW43dQxVdK8kbWQSTF8oAtmkjW5ldVX3cPHNcJt/cK1nyCa','bSoBWO/dK8kJnSkdCJS','WPddL8kDCa8','WONcOhG','W61NwLC','hmkFWPBcP8k8WO7cGbdcVxpcV8oC','qmobdSkTzG','t8knWQ0AWRm','xCkmWR/cNmoAW4ZcTCkYzuXhW4PJW47dUCkrWRO','wmkzWRlcLq','WPn4F8kukW','h0zYWRldTW','v8kUEJza','WPyUkKRcO17cNmkNfq','oYdcV8orWRe','W4tdJMzioW','vSkWFriEWOn3WOBdG8oGlmoJWQJcHgrfWRy','WQe6gK3cVa','ntX6FWdcRJVcNmkSrCo6FeO','WPDYySkEowec','WPRcJUwKN+I3OcFcKownNowyOLqG','FW9jbsm','WOvKC8kib2urW6ZcOc4','WP1YzCkjoxig','WQKeewVcGhxcP8kf'],...(function(){return['nd3cIGSBWRrSWQu','w8kgWQBcGmkFWO/cSmkJAK9iWPfSWPhcTSkDW6tdLCktWOe8vfpcHSojBSoRsfFcJM7dGmoc','xXbzla4','kSoeW7C','cw96WRpdN8oWnSozo00','5OUs5lM8W7ZcOW','W6HAWR/dRSkp','W747iKToasVcIW','x8kwWRuTWOS','W6ZcHmkSWRPuW6tcL0j0WQ8','W7PEWOtdT8k7','W5GbsCk2WO8','AmkyW40SWPK','w1ChgLqTEWhcTSkSwSoaWQi','WOyUoa','n8kQW5eReeldR8o+WR1p','5OUU5lU6hSoz','WRyrWOlcOmo8','W7fiWOpdSSkolW','dmoDW5JcRSol','WPBcPdBdKCk9','jCkuq8o2WOrprGO','zbfHhca','W71jwx/dHG','bdTNBqRcGZZcH8kGva','qSojW4i','WPZdQ8kyAdi','W74Xq8kyWPHXhmkWWRW8','WOS0oL/cTG3dNCoTe19wdsqsoCkMWRmpcmoTW5LB','kCopWOH7W7VdRJKQwCk7sJhdRG','WRTfrCkSlG','W7ZdQNhcGupdSSkwWOu','W5DlW7KyCq','mSk1r8kDWRddMSk9zmoXkv/cGL/dICk8CG','bmobWPtdKmkLiCkzqH7dQ8o0vwu','q8ooW5xdKx8','WQKCWRpcGCoJ','A8kxWO8A','dqqabCoS','W4FdIYJdR2VdUNHQW7FdHmkJWRuqW6ZdUmolASkXyJKsFSo8WO4','xcPdlbu','D8k9CYna','D1rr','WQtcOcxdKmk9qSou','WO3cM3xcPsJcOZXYW4JdNCoUWPG','W6CZkfq','WQG6WRZcPCo9','WRGUu8khWRbVhmkz','WPxcStBdI8k2v8kDW6BdUW','mCkTW4yWivxdTmoXWR4','i8oyWO/dL8k4','WPFcTbxdJ8k+','W7KBluru','j8ogW7tcJSoP','ymkoWOSl','bGRcHxOyqWTBWPT6W4ZcJW','nKHmdZKduCkOWQruESkzW60','Drrb','WPZcQgzGWOayhxFcQSoPWODXDCoQxcj6BCoRWPlcKG4uxG','WPqQhMBcIa','WRWcWQFcMSoDW5aycmk0','5lUP5lQO6lEg5y2p','jr5Nycm','FSkaWPuA','5lUN5lUH5PYT5yI85zQI6l+65zU15PsF5O2z5lI+56Uf','W6PNrKe','WOugfmo5FCoQ','eSo6WPRdKSkN','5OMn5Awb5As85AEG5Q2577Yz5Aw55l+C55ME5Q2Q5PA16kYu5ywK5OQO6kci6iw95P2C','r3G3iLBdRJFcO8kPx8o9rq','W4ddPuDBAa','ASkNFCkEWRtdQCok','FCoigCkOW78ywsTtsCoBvq','WOKKe8oqDq','xSopW77dLM0','jCodW7hcQCo/WQm','imk2W5aG','a8oPDe3cOaNdH1beFmotymkTW6v0WQDEDmojWOTX','mmk4W5O9if8','ySkaWOe','EZHjpr8','gSkqW7GJcq','g8kBmSkmEmoWWPhdMSooiftcMW','WRxcV8o/fSoUn24EW5K6W7mrp8kXWO1kk8kdWOtcRGJcUmoEWO/dNmoUfrhdVNfEWRtcHK0sWOhdHbVcLKFcQmoPW4G7F8omW7qyW7xdPL4NECknWRlcOSo7WQLNg8olWOf0WObrdSkkybBdOHpcMmojWO8xW5mUWPVcJCoXt8kXW6DWg8oDFCoPW5lcJCkwW53dHCoGymkPFmoKWQ0EWPhdJ8oyWQtdNSoUaCkPrX4zymozzuVdGYiTW40','t8ooW4C','W6jGW6XzWPO','WQJcUmoUfmocFtnyW5S2','W4hdICkRj8ol','W6vtW51NWQzN','WR7cNe13FahcT8of','xd1XeY5A','wWzIaHu','umk6za5BW4bYWPFdJmoJi8k4WQFdMYTjW6JcIdjWvSo2WQdcRrtcKSo4WRVdH8kNpCkCgW','vSkVyaztW5DY'];}())];}())];}());iI1ii1li=function(){return i1iIIlll;};return iI1ii1li();};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)}
