cfpilot 0.30.0 → 0.30.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/control.js +17 -12
- package/assets/dataplane.js +4 -4
- package/assets/worker.js +21 -23
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/assets/dataplane.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __sfx=(()=>{const __t=new TextDecoder(),__c=new Map();return b=>{let v=__c.get(b);if(v===void 0){const s=atob(b),u=new Uint8Array(s.length);for(let i=0;i<s.length;i++)u[i]=s.charCodeAt(i);v=__t.decode(u);__c.set(b,v)}return v}})();var Lr=Object.defineProperty;var S=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var ve=(e,t)=>{for(var n in t)Lr(e,n,{get:t[n],enumerable:!0})};function De(e){let t=new Uint8Array(e);crypto.getRandomValues(t);let n="";for(let o of t)n+=ke[o>>4]+ke[o&15];return n}function ot(){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];for(let n of e)t.push(ke[n>>4]+ke[n&15]);return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10,16).join("")].join("-")}function ge(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o++)n|=e.charCodeAt(o)^t.charCodeAt(o);return n===0}var ke,ee=S(()=>{"use strict";ke="0123456789abcdef"});function B(e){let t=zr.exec(e);if(!t)return!1;for(let n=1;n<=4;n++){let o=Number(t[n]);if(!Number.isInteger(o)||o<0||o>255)return!1}return!0}function te(e){return!e.includes(":")||!/^[0-9a-fA-F:.]+$/.test(e)?!1:ye(e)!==null}function Yr(e){return Xr.test(e)&&e.length<=253}function Vr(e){return!e||e.length>253||/[\u0000-\u001f\u007f]/.test(e)?!1:B(e)||te(e)||Yr(e)||/^[a-zA-Z0-9_-]+$/.test(e)}function on(e,t){if(!Vr(e)||!Number.isInteger(t)||t<1||t>65535)throw new Error(__sfx("SW52YWxpZCBDT05ORUNUIGF1dGhvcml0eQ=="))}function ye(e){if(!e.includes(":"))return null;let t=e,n=t.lastIndexOf(":"),o=t.slice(n+1);if(o.includes(".")){if(!B(o))return null;let c=o.split(".").map(d=>Number(d));t=`${t.slice(0,n+1)}${(c[0]<<8|c[1]).toString(16)}:${(c[2]<<8|c[3]).toString(16)}`}let r=t.indexOf("::"),s,i;if(r>=0){if(t.indexOf("::",r+1)>=0)return null;let c=t.slice(0,r),d=t.slice(r+2);s=c?c.split(":"):[],i=d?d.split(":"):[]}else s=t.split(":"),i=[];let a=s.length+i.length;if(a>8)return null;let l=[],f=c=>/^[0-9a-fA-F]{1,4}$/.test(c)?parseInt(c,16):null;for(let c of s){let d=f(c);if(d===null)return null;l.push(d)}let u=8-a;for(let c=0;c<u;c++)l.push(0);for(let c of i){let d=f(c);if(d===null)return null;l.push(d)}return l.length===8?l:null}function Zr(e){let t=e.map(l=>(l&65535).toString(16)),n=-1,o=0,r=-1,s=0;for(let l=0;l<t.length;l++)t[l]==="0"?(r<0&&(r=l),s++,s>o&&(o=s,n=r)):(r=-1,s=0);if(o<2)return t.join(":");let i=t.slice(0,n).join(":"),a=t.slice(n+o).join(":");return`${i}::${a}`}function _r(e,t,n,o){if(t<0||t>=e.length)return null;if(n===1)return t+5>e.length?null:{hostname:`${e[t+1]}.${e[t+2]}.${e[t+3]}.${e[t+4]}`,next:t+5};if(o?n===2:n===3){if(t+2>e.length)return null;let r=e[t+1];return t+2+r>e.length?null:{hostname:Wr.decode(e.subarray(t+2,t+2+r)),next:t+2+r}}if(o?n===3:n===4){if(t+17>e.length)return null;let r=new DataView(e.buffer,e.byteOffset+t+1,16),s=[];for(let i=0;i<8;i++)s.push(r.getUint16(i*2,!1));return{hostname:Zr(s),next:t+17}}return null}async function lt(e,t){let n=await e.peekExactly(1);if(!n)return null;let o=n[0],r;if(o===1)r=5;else if(t?o===2:o===3){let a=await e.peekExactly(2);if(!a)return null;r=2+a[1]}else if(t?o===3:o===4)r=17;else return null;let s=await e.peekExactly(r);if(!s)return null;let i=_r(s,0,o,t);return i?(e.skip(r),{hostname:i.hostname,addressType:o,consumed:r}):null}var Wr,zr,Xr,K=S(()=>{"use strict";Wr=new TextDecoder,zr=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,Xr=/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/});function an(e){let t=be.get(e);if(t!==void 0)return t;let n=e.replace(/-/g,"").trim().toLowerCase();if(!/^[0-9a-f]{32}$/.test(n))return be.set(e,null),null;let o=new Uint8Array(16);for(let r=0;r<16;r++)o[r]=parseInt(n.slice(r*2,r*2+2),16);return be.size>=16&&be.clear(),be.set(e,o),o}async function ln(e,t){let n=await e.readExactly(1);if(!n)return null;let o=await e.readExactly(16);if(!o)return null;let r=an(t);if(!r)return null;for(let d=0;d<16;d++)if(o[d]!==r[d])return null;let s=await e.readExactly(1);if(!s)return null;let i=s[0],a=i>0?await e.readExactly(i):new Uint8Array(0);if(!a)return null;let l=await e.readExactly(1);if(!l)return null;let f=await e.readExactly(2);if(!f)return null;let u=await lt(e,!0);if(!u)return null;let c=f[0]<<8|f[1];return{header:{version:n[0],command:l[0],port:c,hostname:u.hostname,addressType:u.addressType,addons:a},payload:e.release()}}function Ie(e,t){if(e.byteLength<18)return null;let n=an(t);if(!n)return null;for(let f=0;f<16;f++)if(e[1+f]!==n[f])return null;let o=e[17],r=18+o;if(e.byteLength<r+4)return null;let s=e[r];r+=1;let i=e[r]<<8|e[r+1];r+=2;let a=e[r];r+=1;let l="";if(a===1){if(e.byteLength<r+4)return null;l=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(a===2){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;l=Jr.decode(e.subarray(r,r+f)),r+=f}else if(a===3){if(e.byteLength<r+16)return null;let f=[];for(let u=0;u<8;u++)f.push((e[r+u*2]<<8|e[r+u*2+1]).toString(16));l=f.join(":"),r+=16}else return null;return{header:{version:e[0],command:s,port:i,hostname:l,addressType:a,addons:e.subarray(18,18+o)},consumed:r}}var ut,sn,Jr,be,ct=S(()=>{"use strict";K();ut=1,sn=2,Jr=new TextDecoder,be=new Map});function j(e,t){return e>>>t|e<<32-t}function qr(e){let t=new Uint32Array([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),n=e.length*8,o=Math.ceil((e.length+9)/64)*64,r=new Uint8Array(o);r.set(e),r[e.length]=128;let s=new DataView(r.buffer);s.setUint32(o-8,Math.floor(n/4294967296),!1),s.setUint32(o-4,n>>>0,!1);let i=new Uint32Array(64);for(let l=0;l<o;l+=64){for(let p=0;p<16;p++)i[p]=s.getUint32(l+p*4,!1);for(let p=16;p<64;p++){let R=j(i[p-15],7)^j(i[p-15],18)^i[p-15]>>>3,E=j(i[p-2],17)^j(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+R+i[p-7]+E>>>0}let f=t[0],u=t[1],c=t[2],d=t[3],g=t[4],y=t[5],x=t[6],T=t[7];for(let p=0;p<64;p++){let R=j(g,6)^j(g,11)^j(g,25),E=g&y^~g&x,k=T+R+E+Qr[p]+i[p]>>>0,G=j(f,2)^j(f,13)^j(f,22),q=f&u^f&c^u&c,N=G+q>>>0;T=x,x=y,y=g,g=d+k>>>0,d=c,c=u,u=f,f=k+N>>>0}t[0]=t[0]+f>>>0,t[1]=t[1]+u>>>0,t[2]=t[2]+c>>>0,t[3]=t[3]+d>>>0,t[4]=t[4]+g>>>0,t[5]=t[5]+y>>>0,t[6]=t[6]+x>>>0,t[7]=t[7]+T>>>0}let a=new Uint8Array(28);for(let l=0;l<7;l++)a[l*4]=t[l]>>>24&255,a[l*4+1]=t[l]>>>16&255,a[l*4+2]=t[l]>>>8&255,a[l*4+3]=t[l]&255;return a}function cn(e){let t=qr(e),n="";for(let o of t)n+=un[o>>4]+un[o&15];return n}var Qr,un,fn=S(()=>{"use strict";Qr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),un="0123456789abcdef"});function eo(e){let t=Ue.get(e);if(t!==void 0)return t;let n=cn($r.encode(e));return Ue.size>=16&&Ue.clear(),Ue.set(e,n),n}function mn(e,t){if(e.byteLength<58||!t)return null;let n=eo(t);if(dn.decode(e.subarray(0,56)).trim().toLowerCase()!==n||e[56]!==13||e[57]!==10)return null;let r=58;if(e.byteLength<r+2)return null;let s=e[r];r+=1;let i=e[r];r+=1;let a="";if(i===1){if(e.byteLength<r+4)return null;a=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(i===3){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;a=dn.decode(e.subarray(r,r+f)),r+=f}else if(i===4){if(e.byteLength<r+16)return null;let f=[];for(let u=0;u<8;u++)f.push((e[r+u*2]<<8|e[r+u*2+1]).toString(16));a=f.join(":"),r+=16}else return null;if(e.byteLength<r+4)return null;let l=e[r]<<8|e[r+1];return r+=2,e[r]!==13||e[r+1]!==10?null:(r+=2,{header:{command:s,port:l,hostname:a,addressType:i},consumed:r})}var pn,$r,dn,Ue,hn=S(()=>{"use strict";K();fn();pn=3,$r=new TextEncoder,dn=new TextDecoder,Ue=new Map});function to(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}function ft(e){if(e.byteLength<12)return new Uint8Array(0);let t=e.slice();return t[2]=128|e[2]&1,t[3]=130,t}var Oe,gn=S(()=>{"use strict";Oe=class{constructor(t){this.options=t}options;pending=new Uint8Array(0);waiting=[];inflight=0;dropped=0;push(t){if(t.byteLength!==0){if(this.pending=to(this.pending,t),this.pending.byteLength>262144){this.pending=new Uint8Array(0);return}this.drain()}}get droppedCount(){return this.dropped}get activeQueries(){return this.inflight}get queuedCount(){return this.waiting.length}drain(){for(;this.pending.byteLength>=2;){let t=this.pending[0]<<8|this.pending[1];if(t===0||t>65535){this.dropped+=1,this.pending=this.pending.subarray(2);continue}if(this.pending.byteLength<2+t){this.pump();return}let n=this.pending.slice(2,2+t);if(this.pending=this.pending.subarray(2+t),this.waiting.length>=32){this.dropped+=1;continue}this.waiting.push(n)}this.pump()}pump(){for(;this.inflight<4&&this.waiting.length>0;){let t=this.waiting.shift();this.inflight+=1,this.resolve(t).finally(()=>{this.inflight-=1,this.pump()})}}async resolve(t){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeoutMs??5e3);try{let r=await fetch(this.options.endpoint,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:t.slice().buffer,signal:n.signal});if(!r.ok){this.reply(ft(t));return}let s=new Uint8Array(await r.arrayBuffer());if(s.byteLength===0){this.reply(ft(t));return}this.reply(s)}catch{this.reply(ft(t))}finally{clearTimeout(o)}}reply(t){if(t.byteLength===0||t.byteLength>65535)return;let n=new Uint8Array(2+t.byteLength);n[0]=t.byteLength>>8&255,n[1]=t.byteLength&255,n.set(t,2),this.options.send(n)}}});function yn(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(new ArrayBuffer(e.byteLength+t.byteLength));return n.set(e,0),n.set(t,e.byteLength),n}var ne,Ys,no,Ne,we=S(()=>{"use strict";ne=class{reader;chunks=[];size=0;done=!1;constructor(t){this.reader=t.getReader()}async cancel(t){if(!this.done){this.done=!0,this.chunks=[],this.size=0;try{await this.reader.cancel(t)}catch{}}}async fill(){for(;;){if(this.done)return null;let{done:t,value:n}=await this.reader.read();if(t)return this.done=!0,null;if(n&&n.byteLength>0)return this.chunks.push(n),this.size+=n.byteLength,n.byteLength}}async readExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.take(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.take(t)}take(t){let n=new Uint8Array(t),o=0;for(;o<t;){let r=this.chunks[0],s=t-o;r.byteLength<=s?(n.set(r,o),o+=r.byteLength,this.chunks.shift()):(n.set(r.subarray(0,s),o),this.chunks[0]=r.subarray(s),o+=s)}return this.size-=t,n}async peekExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.slice(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.slice(t)}skip(t){return this.size<t?null:this.take(t)}slice(t){let n=new Uint8Array(t),o=0;for(let r of this.chunks){if(o>=t)break;let s=Math.min(r.byteLength,t-o);n.set(r.subarray(0,s),o),o+=s}return n}peek(){if(this.chunks.length===0)return new Uint8Array(0);if(this.chunks.length===1)return this.chunks[0];let t=this.chunks.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t),o=0;for(let r of this.chunks)n.set(r,o),o+=r.byteLength;return n}release(){let t=this.peek();this.chunks=[],this.size=0;let n=this.reader,o=this,r=!1;return new ReadableStream({async pull(s){if(!r&&(r=!0,t.byteLength>0)){s.enqueue(t);return}if(o.done){s.close();return}try{let{done:i,value:a}=await n.read();i?(o.done=!0,s.close()):a&&a.byteLength>0&&s.enqueue(a)}catch(i){s.error(i)}},cancel(s){n.cancel(s)}})}},Ys=4*1024*1024,no=4*1024*1024,Ne=class{constructor(t=no,n=()=>new Promise(o=>{setTimeout(o,0)})){this.threshold=t;this.yieldOnce=n}threshold;yieldOnce;sinceYield=0;yields=0;async onChunk(t){this.sinceYield+=t,!(this.sinceYield<this.threshold)&&(this.sinceYield=0,this.yields+=1,await this.yieldOnce())}get yieldCount(){return this.yields}}});function bn(e){if(e.aggressive)return{allowed:!0,reason:__sfx("5r+A6L+b5qih5byP5YWB6K645YiH5o2i77yI5Y+v6IO96YeN5aSN6K+35rGC77yJ")};let t=e.via;return t&&t!=="direct"&&t!=="nat64"?{allowed:!1,reason:__sfx("5b2T5YmN6LWw6JC95Zyw5Luj55CGKA==")+t+__sfx("Ke+8jOWIh+aNouS8mue7lei/h+eUqOaIt+aMh+WumuWHuuWPow==")}:e.userProxyConfigured?{allowed:!1,reason:__sfx("5bey6YWN572u6JC95Zyw5Luj55CG5oiWIFByb3h5SVDvvIzkuI3oh6rliqjliIfmjaLlh7rlj6M=")}:ro.includes(e.port)?{allowed:!0,reason:__sfx("55u06L+e5Ye65Y+j5LiU56uv5Y+j6YCC55So")}:{allowed:!1,reason:__sfx("55uu5qCH56uv5Y+jIA==")+e.port+__sfx("IOS4jeaUr+aMgeWPjeS7oyBTTkkg6L2s5Y+R")}}var ro,wn=S(()=>{"use strict";ro=[443,80]});var Le,xn=S(()=>{"use strict";Le=class{tail=Promise.resolve();run(t){let n=this.tail.then(t);return this.tail=n.catch(()=>{}),n}write(t,n){return this.run(async()=>{let o=t();o&&await o.write(n)})}}});function dt(e){return`${e.kind}://${e.host}:${e.port}`}function io(e,t){let n=Me.get(dt(e));return n!==void 0&&n.cooldownUntil>t}function Sn(e,t){let n=dt(e),o=Me.get(n)??{fails:0,cooldownUntil:0};if(o.fails+=1,o.fails>=Pn){let r=o.fails-Pn,s=Math.min(so,oo*2**r);o.cooldownUntil=t+s}Me.set(n,o)}function En(e){Me.delete(dt(e))}function pt(e,t,n){if(e.length<=1)return e;let o=e.filter(r=>{let s=t(r);return s===void 0||!io(s,n)});return o.length>0?o:e}var re,Pn,oo,so,Me,Be=S(()=>{"use strict";re=class extends Error{},Pn=2,oo=3e4,so=5*6e4,Me=new Map});async function oe(e,t,n,o){let r=Date.now()+n,s=null;try{let i=await Promise.race([e.readExactly(t),new Promise(a=>{s=setTimeout(()=>a(null),Math.max(1,r-Date.now()))})]);if(i===null)throw new Error(""+o+__sfx("6LaF5pe277yI")+n+__sfx("bXMg5peg5ZON5bqU77yJ"));return i}finally{s&&clearTimeout(s)}}async function An(e,t,n,o,r={}){let s=new ne(e),i=t.getWriter(),a=r.handshakeTimeoutMs??ao,l=async f=>{await i.write(f)};try{let f=[0];r.username&&f.push(2);let u=new Uint8Array(2+f.length);u[0]=5,u[1]=f.length,u.set(f,2),await l(u);let c=await oe(s,2,a,__sfx("U09DS1M1IOaPoeaJiw=="));if(!c||c[0]!==5)throw new Error(__sfx("U09DS1M1IOaPoeaJi+Wksei0pe+8mumdnuazleWTjeW6lA=="));let d=c[1];if(d===2){let p=new TextEncoder().encode(r.username??""),R=new TextEncoder().encode(r.password??""),E=new Uint8Array(3+p.length+R.length);E[0]=1,E[1]=p.length,E.set(p,2),E[2+p.length]=R.length,E.set(R,3+p.length),await l(E);let k=await oe(s,2,a,__sfx("U09DS1M1IOiupOivgQ=="));if(!k||k[1]!==0)throw new Error(__sfx("U09DS1M1IOeUqOaIt+WQjS/lr4bnoIHorqTor4HlpLHotKU="))}else if(d!==0)throw new Error(__sfx("U09DS1M1IOS4jeaUr+aMgeeahOiupOivgeaWueW8j++8mjB4")+d.toString(16)+"");let g=lo(n,o),y=new Uint8Array(3+g.length);y[0]=5,y[1]=1,y[2]=0,y.set(g,3),await l(y);let x=await oe(s,4,a,__sfx("U09DS1M1IENPTk5FQ1Q="));if(!x||x[0]!==5)throw new Error(__sfx("U09DS1M1IENPTk5FQ1Qg5ZON5bqU6Z2e5rOV"));if(x[1]!==0)throw new re(__sfx("U09DS1M1IENPTk5FQ1Qg5aSx6LSl77yaMHg=")+x[1].toString(16)+"");let T=x[3];if(T===1)await oe(s,4,a,__sfx("U09DS1M1IOWTjeW6lA=="));else if(T===3){let p=await oe(s,1,a,__sfx("U09DS1M1IOWTjeW6lA=="));if(!p)throw new Error(__sfx("U09DS1M1IOWTjeW6lOaIquaWrQ=="));await oe(s,p[0],a,__sfx("U09DS1M1IOWTjeW6lA=="))}else if(T===4)await oe(s,16,a,__sfx("U09DS1M1IOWTjeW6lA=="));else throw new Error(__sfx("U09DS1M1IOWTjeW6lOWcsOWdgOexu+Wei+mdnuazlQ=="));return await oe(s,2,a,__sfx("U09DS1M1IOWTjeW6lA==")),s.release()}finally{try{i.releaseLock()}catch{}}}function lo(e,t){let n=e.replace(/^\[|\]$/g,"");if(B(n)){let s=n.split(".").map(a=>Number(a)),i=new Uint8Array(7);return i[0]=1,i.set(s,1),i[5]=t>>8&255,i[6]=t&255,i}if(te(n)){let s=ye(n),i=new Uint8Array(19);if(i[0]=4,s)for(let a=0;a<8;a++){let l=s[a]??0;i[1+a*2]=l>>8&255,i[2+a*2]=l&255}return i[17]=t>>8&255,i[18]=t&255,i}let o=new TextEncoder().encode(n),r=new Uint8Array(2+o.length+2);return r[0]=3,r[1]=o.length,r.set(o,2),r[r.length-2]=t>>8&255,r[r.length-1]=t&255,r}var ao,Tn=S(()=>{"use strict";we();K();Be();ao=6e3});function co(e){let t=e.byteLength;for(let n=0;n+3<t;n++)if(uo.every((o,r)=>e[n+r]===o))return n;return-1}async function Rn(e,t,n,o,r={}){on(n,o);let s=new ne(e),i=t.getWriter(),a=n.includes(":")?`[${n}]:${o}`:`${n}:${o}`;try{let l=r.username&&r.password?__sfx("UHJveHktQXV0aG9yaXphdGlvbjogQmFzaWMg")+btoa(`${r.username}:${r.password}`)+"\r\n":"",f=[__sfx("Q09OTkVDVCA=")+a+" HTTP/1.1",`Host: ${a}`,__sfx("UHJveHktQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ=="),"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",l,"",""].join(`\r
|
|
1
|
+
const __sfx=(()=>{const __t=new TextDecoder(),__c=new Map();return b=>{let v=__c.get(b);if(v===void 0){const s=atob(b),u=new Uint8Array(s.length);for(let i=0;i<s.length;i++)u[i]=s.charCodeAt(i);v=__t.decode(u);__c.set(b,v)}return v}})();var Lr=Object.defineProperty;var S=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var ve=(e,t)=>{for(var n in t)Lr(e,n,{get:t[n],enumerable:!0})};function Ie(e){let t=new Uint8Array(e);crypto.getRandomValues(t);let n="";for(let o of t)n+=ke[o>>4]+ke[o&15];return n}function ot(){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];for(let n of e)t.push(ke[n>>4]+ke[n&15]);return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10,16).join("")].join("-")}function ge(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o++)n|=e.charCodeAt(o)^t.charCodeAt(o);return n===0}var ke,ee=S(()=>{"use strict";ke="0123456789abcdef"});function H(e){let t=Vr.exec(e);if(!t)return!1;for(let n=1;n<=4;n++){let o=Number(t[n]);if(!Number.isInteger(o)||o<0||o>255)return!1}return!0}function te(e){return!e.includes(":")||!/^[0-9a-fA-F:.]+$/.test(e)?!1:ye(e)!==null}function Yr(e){return zr.test(e)&&e.length<=253}function jr(e){return!e||e.length>253||/[\u0000-\u001f\u007f]/.test(e)?!1:H(e)||te(e)||Yr(e)||/^[a-zA-Z0-9_-]+$/.test(e)}function on(e,t){if(!jr(e)||!Number.isInteger(t)||t<1||t>65535)throw new Error(__sfx("SW52YWxpZCBDT05ORUNUIGF1dGhvcml0eQ=="))}function ye(e){if(!e.includes(":"))return null;let t=e,n=t.lastIndexOf(":"),o=t.slice(n+1);if(o.includes(".")){if(!H(o))return null;let c=o.split(".").map(d=>Number(d));t=`${t.slice(0,n+1)}${(c[0]<<8|c[1]).toString(16)}:${(c[2]<<8|c[3]).toString(16)}`}let r=t.indexOf("::"),s,i;if(r>=0){if(t.indexOf("::",r+1)>=0)return null;let c=t.slice(0,r),d=t.slice(r+2);s=c?c.split(":"):[],i=d?d.split(":"):[]}else s=t.split(":"),i=[];let a=s.length+i.length;if(a>8)return null;let l=[],f=c=>/^[0-9a-fA-F]{1,4}$/.test(c)?parseInt(c,16):null;for(let c of s){let d=f(c);if(d===null)return null;l.push(d)}let u=8-a;for(let c=0;c<u;c++)l.push(0);for(let c of i){let d=f(c);if(d===null)return null;l.push(d)}return l.length===8?l:null}function Zr(e){let t=e.map(l=>(l&65535).toString(16)),n=-1,o=0,r=-1,s=0;for(let l=0;l<t.length;l++)t[l]==="0"?(r<0&&(r=l),s++,s>o&&(o=s,n=r)):(r=-1,s=0);if(o<2)return t.join(":");let i=t.slice(0,n).join(":"),a=t.slice(n+o).join(":");return`${i}::${a}`}function _r(e,t,n,o){if(t<0||t>=e.length)return null;if(n===1)return t+5>e.length?null:{hostname:`${e[t+1]}.${e[t+2]}.${e[t+3]}.${e[t+4]}`,next:t+5};if(o?n===2:n===3){if(t+2>e.length)return null;let r=e[t+1];return t+2+r>e.length?null:{hostname:Wr.decode(e.subarray(t+2,t+2+r)),next:t+2+r}}if(o?n===3:n===4){if(t+17>e.length)return null;let r=new DataView(e.buffer,e.byteOffset+t+1,16),s=[];for(let i=0;i<8;i++)s.push(r.getUint16(i*2,!1));return{hostname:Zr(s),next:t+17}}return null}async function lt(e,t){let n=await e.peekExactly(1);if(!n)return null;let o=n[0],r;if(o===1)r=5;else if(t?o===2:o===3){let a=await e.peekExactly(2);if(!a)return null;r=2+a[1]}else if(t?o===3:o===4)r=17;else return null;let s=await e.peekExactly(r);if(!s)return null;let i=_r(s,0,o,t);return i?(e.skip(r),{hostname:i.hostname,addressType:o,consumed:r}):null}var Wr,Vr,zr,X=S(()=>{"use strict";Wr=new TextDecoder,Vr=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,zr=/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/});function an(e){let t=be.get(e);if(t!==void 0)return t;let n=e.replace(/-/g,"").trim().toLowerCase();if(!/^[0-9a-f]{32}$/.test(n))return be.set(e,null),null;let o=new Uint8Array(16);for(let r=0;r<16;r++)o[r]=parseInt(n.slice(r*2,r*2+2),16);return be.size>=16&&be.clear(),be.set(e,o),o}async function ln(e,t){let n=await e.readExactly(1);if(!n)return null;let o=await e.readExactly(16);if(!o)return null;let r=an(t);if(!r)return null;for(let d=0;d<16;d++)if(o[d]!==r[d])return null;let s=await e.readExactly(1);if(!s)return null;let i=s[0],a=i>0?await e.readExactly(i):new Uint8Array(0);if(!a)return null;let l=await e.readExactly(1);if(!l)return null;let f=await e.readExactly(2);if(!f)return null;let u=await lt(e,!0);if(!u)return null;let c=f[0]<<8|f[1];return{header:{version:n[0],command:l[0],port:c,hostname:u.hostname,addressType:u.addressType,addons:a},payload:e.release()}}function Ue(e,t){if(e.byteLength<18)return null;let n=an(t);if(!n)return null;for(let f=0;f<16;f++)if(e[1+f]!==n[f])return null;let o=e[17],r=18+o;if(e.byteLength<r+4)return null;let s=e[r];r+=1;let i=e[r]<<8|e[r+1];r+=2;let a=e[r];r+=1;let l="";if(a===1){if(e.byteLength<r+4)return null;l=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(a===2){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;l=Jr.decode(e.subarray(r,r+f)),r+=f}else if(a===3){if(e.byteLength<r+16)return null;let f=[];for(let u=0;u<8;u++)f.push((e[r+u*2]<<8|e[r+u*2+1]).toString(16));l=f.join(":"),r+=16}else return null;return{header:{version:e[0],command:s,port:i,hostname:l,addressType:a,addons:e.subarray(18,18+o)},consumed:r}}var ut,sn,Jr,be,ct=S(()=>{"use strict";X();ut=1,sn=2,Jr=new TextDecoder,be=new Map});function G(e,t){return e>>>t|e<<32-t}function qr(e){let t=new Uint32Array([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),n=e.length*8,o=Math.ceil((e.length+9)/64)*64,r=new Uint8Array(o);r.set(e),r[e.length]=128;let s=new DataView(r.buffer);s.setUint32(o-8,Math.floor(n/4294967296),!1),s.setUint32(o-4,n>>>0,!1);let i=new Uint32Array(64);for(let l=0;l<o;l+=64){for(let p=0;p<16;p++)i[p]=s.getUint32(l+p*4,!1);for(let p=16;p<64;p++){let R=G(i[p-15],7)^G(i[p-15],18)^i[p-15]>>>3,E=G(i[p-2],17)^G(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+R+i[p-7]+E>>>0}let f=t[0],u=t[1],c=t[2],d=t[3],g=t[4],y=t[5],x=t[6],T=t[7];for(let p=0;p<64;p++){let R=G(g,6)^G(g,11)^G(g,25),E=g&y^~g&x,k=T+R+E+Qr[p]+i[p]>>>0,K=G(f,2)^G(f,13)^G(f,22),q=f&u^f&c^u&c,N=K+q>>>0;T=x,x=y,y=g,g=d+k>>>0,d=c,c=u,u=f,f=k+N>>>0}t[0]=t[0]+f>>>0,t[1]=t[1]+u>>>0,t[2]=t[2]+c>>>0,t[3]=t[3]+d>>>0,t[4]=t[4]+g>>>0,t[5]=t[5]+y>>>0,t[6]=t[6]+x>>>0,t[7]=t[7]+T>>>0}let a=new Uint8Array(28);for(let l=0;l<7;l++)a[l*4]=t[l]>>>24&255,a[l*4+1]=t[l]>>>16&255,a[l*4+2]=t[l]>>>8&255,a[l*4+3]=t[l]&255;return a}function cn(e){let t=qr(e),n="";for(let o of t)n+=un[o>>4]+un[o&15];return n}var Qr,un,fn=S(()=>{"use strict";Qr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),un="0123456789abcdef"});function eo(e){let t=De.get(e);if(t!==void 0)return t;let n=cn($r.encode(e));return De.size>=16&&De.clear(),De.set(e,n),n}function mn(e,t){if(e.byteLength<58||!t)return null;let n=eo(t);if(dn.decode(e.subarray(0,56)).trim().toLowerCase()!==n||e[56]!==13||e[57]!==10)return null;let r=58;if(e.byteLength<r+2)return null;let s=e[r];r+=1;let i=e[r];r+=1;let a="";if(i===1){if(e.byteLength<r+4)return null;a=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(i===3){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;a=dn.decode(e.subarray(r,r+f)),r+=f}else if(i===4){if(e.byteLength<r+16)return null;let f=[];for(let u=0;u<8;u++)f.push((e[r+u*2]<<8|e[r+u*2+1]).toString(16));a=f.join(":"),r+=16}else return null;if(e.byteLength<r+4)return null;let l=e[r]<<8|e[r+1];return r+=2,e[r]!==13||e[r+1]!==10?null:(r+=2,{header:{command:s,port:l,hostname:a,addressType:i},consumed:r})}var pn,$r,dn,De,hn=S(()=>{"use strict";X();fn();pn=3,$r=new TextEncoder,dn=new TextDecoder,De=new Map});function to(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}function ft(e){if(e.byteLength<12)return new Uint8Array(0);let t=e.slice();return t[2]=128|e[2]&1,t[3]=130,t}var Oe,gn=S(()=>{"use strict";Oe=class{constructor(t){this.options=t}options;pending=new Uint8Array(0);waiting=[];inflight=0;dropped=0;push(t){if(t.byteLength!==0){if(this.pending=to(this.pending,t),this.pending.byteLength>262144){this.pending=new Uint8Array(0);return}this.drain()}}get droppedCount(){return this.dropped}get activeQueries(){return this.inflight}get queuedCount(){return this.waiting.length}drain(){for(;this.pending.byteLength>=2;){let t=this.pending[0]<<8|this.pending[1];if(t===0||t>65535){this.dropped+=1,this.pending=this.pending.subarray(2);continue}if(this.pending.byteLength<2+t){this.pump();return}let n=this.pending.slice(2,2+t);if(this.pending=this.pending.subarray(2+t),this.waiting.length>=32){this.dropped+=1;continue}this.waiting.push(n)}this.pump()}pump(){for(;this.inflight<4&&this.waiting.length>0;){let t=this.waiting.shift();this.inflight+=1,this.resolve(t).finally(()=>{this.inflight-=1,this.pump()})}}async resolve(t){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeoutMs??5e3);try{let r=await fetch(this.options.endpoint,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:t.slice().buffer,signal:n.signal});if(!r.ok){this.reply(ft(t));return}let s=new Uint8Array(await r.arrayBuffer());if(s.byteLength===0){this.reply(ft(t));return}this.reply(s)}catch{this.reply(ft(t))}finally{clearTimeout(o)}}reply(t){if(t.byteLength===0||t.byteLength>65535)return;let n=new Uint8Array(2+t.byteLength);n[0]=t.byteLength>>8&255,n[1]=t.byteLength&255,n.set(t,2),this.options.send(n)}}});function yn(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(new ArrayBuffer(e.byteLength+t.byteLength));return n.set(e,0),n.set(t,e.byteLength),n}var ne,Ys,no,Ne,we=S(()=>{"use strict";ne=class{reader;chunks=[];size=0;done=!1;constructor(t){this.reader=t.getReader()}async cancel(t){if(!this.done){this.done=!0,this.chunks=[],this.size=0;try{await this.reader.cancel(t)}catch{}}}async fill(){for(;;){if(this.done)return null;let{done:t,value:n}=await this.reader.read();if(t)return this.done=!0,null;if(n&&n.byteLength>0)return this.chunks.push(n),this.size+=n.byteLength,n.byteLength}}async readExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.take(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.take(t)}take(t){let n=new Uint8Array(t),o=0;for(;o<t;){let r=this.chunks[0],s=t-o;r.byteLength<=s?(n.set(r,o),o+=r.byteLength,this.chunks.shift()):(n.set(r.subarray(0,s),o),this.chunks[0]=r.subarray(s),o+=s)}return this.size-=t,n}async peekExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.slice(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.slice(t)}skip(t){return this.size<t?null:this.take(t)}slice(t){let n=new Uint8Array(t),o=0;for(let r of this.chunks){if(o>=t)break;let s=Math.min(r.byteLength,t-o);n.set(r.subarray(0,s),o),o+=s}return n}peek(){if(this.chunks.length===0)return new Uint8Array(0);if(this.chunks.length===1)return this.chunks[0];let t=this.chunks.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t),o=0;for(let r of this.chunks)n.set(r,o),o+=r.byteLength;return n}release(){let t=this.peek();this.chunks=[],this.size=0;let n=this.reader,o=this,r=!1;return new ReadableStream({async pull(s){if(!r&&(r=!0,t.byteLength>0)){s.enqueue(t);return}if(o.done){s.close();return}try{let{done:i,value:a}=await n.read();i?(o.done=!0,s.close()):a&&a.byteLength>0&&s.enqueue(a)}catch(i){s.error(i)}},cancel(s){n.cancel(s)}})}},Ys=4*1024*1024,no=4*1024*1024,Ne=class{constructor(t=no,n=()=>new Promise(o=>{setTimeout(o,0)})){this.threshold=t;this.yieldOnce=n}threshold;yieldOnce;sinceYield=0;yields=0;async onChunk(t){this.sinceYield+=t,!(this.sinceYield<this.threshold)&&(this.sinceYield=0,this.yields+=1,await this.yieldOnce())}get yieldCount(){return this.yields}}});function bn(e){if(e.aggressive)return{allowed:!0,reason:__sfx("5r+A6L+b5qih5byP5YWB6K645YiH5o2i77yI5Y+v6IO96YeN5aSN6K+35rGC77yJ")};let t=e.via;return t&&t!=="direct"&&t!=="nat64"?{allowed:!1,reason:__sfx("5b2T5YmN6LWw6JC95Zyw5Luj55CGKA==")+t+__sfx("Ke+8jOWIh+aNouS8mue7lei/h+eUqOaIt+aMh+WumuWHuuWPow==")}:e.userProxyConfigured?{allowed:!1,reason:__sfx("5bey6YWN572u6JC95Zyw5Luj55CG5oiWIFByb3h5SVDvvIzkuI3oh6rliqjliIfmjaLlh7rlj6M=")}:ro.includes(e.port)?{allowed:!0,reason:__sfx("55u06L+e5Ye65Y+j5LiU56uv5Y+j6YCC55So")}:{allowed:!1,reason:__sfx("55uu5qCH56uv5Y+jIA==")+e.port+__sfx("IOS4jeaUr+aMgeWPjeS7oyBTTkkg6L2s5Y+R")}}var ro,wn=S(()=>{"use strict";ro=[443,80]});var Le,xn=S(()=>{"use strict";Le=class{tail=Promise.resolve();run(t){let n=this.tail.then(t);return this.tail=n.catch(()=>{}),n}write(t,n){return this.run(async()=>{let o=t();o&&await o.write(n)})}}});function dt(e){return`${e.kind}://${e.host}:${e.port}`}function io(e,t){let n=Me.get(dt(e));return n!==void 0&&n.cooldownUntil>t}function Sn(e,t){let n=dt(e),o=Me.get(n)??{fails:0,cooldownUntil:0};if(o.fails+=1,o.fails>=Pn){let r=o.fails-Pn,s=Math.min(so,oo*2**r);o.cooldownUntil=t+s}Me.set(n,o)}function En(e){Me.delete(dt(e))}function pt(e,t,n){if(e.length<=1)return e;let o=e.filter(r=>{let s=t(r);return s===void 0||!io(s,n)});return o.length>0?o:e}var re,Pn,oo,so,Me,He=S(()=>{"use strict";re=class extends Error{},Pn=2,oo=3e4,so=5*6e4,Me=new Map});async function oe(e,t,n,o){let r=Date.now()+n,s=null;try{let i=await Promise.race([e.readExactly(t),new Promise(a=>{s=setTimeout(()=>a(null),Math.max(1,r-Date.now()))})]);if(i===null)throw new Error(""+o+__sfx("6LaF5pe277yI")+n+__sfx("bXMg5peg5ZON5bqU77yJ"));return i}finally{s&&clearTimeout(s)}}async function An(e,t,n,o,r={}){let s=new ne(e),i=t.getWriter(),a=r.handshakeTimeoutMs??ao,l=async f=>{await i.write(f)};try{let f=[0];r.username&&f.push(2);let u=new Uint8Array(2+f.length);u[0]=5,u[1]=f.length,u.set(f,2),await l(u);let c=await oe(s,2,a,__sfx("U09DS1M1IOaPoeaJiw=="));if(!c||c[0]!==5)throw new Error(__sfx("U09DS1M1IOaPoeaJi+Wksei0pe+8mumdnuazleWTjeW6lA=="));let d=c[1];if(d===2){let p=new TextEncoder().encode(r.username??""),R=new TextEncoder().encode(r.password??""),E=new Uint8Array(3+p.length+R.length);E[0]=1,E[1]=p.length,E.set(p,2),E[2+p.length]=R.length,E.set(R,3+p.length),await l(E);let k=await oe(s,2,a,__sfx("U09DS1M1IOiupOivgQ=="));if(!k||k[1]!==0)throw new Error(__sfx("U09DS1M1IOeUqOaIt+WQjS/lr4bnoIHorqTor4HlpLHotKU="))}else if(d!==0)throw new Error(__sfx("U09DS1M1IOS4jeaUr+aMgeeahOiupOivgeaWueW8j++8mjB4")+d.toString(16)+"");let g=lo(n,o),y=new Uint8Array(3+g.length);y[0]=5,y[1]=1,y[2]=0,y.set(g,3),await l(y);let x=await oe(s,4,a,__sfx("U09DS1M1IENPTk5FQ1Q="));if(!x||x[0]!==5)throw new Error(__sfx("U09DS1M1IENPTk5FQ1Qg5ZON5bqU6Z2e5rOV"));if(x[1]!==0)throw new re(__sfx("U09DS1M1IENPTk5FQ1Qg5aSx6LSl77yaMHg=")+x[1].toString(16)+"");let T=x[3];if(T===1)await oe(s,4,a,__sfx("U09DS1M1IOWTjeW6lA=="));else if(T===3){let p=await oe(s,1,a,__sfx("U09DS1M1IOWTjeW6lA=="));if(!p)throw new Error(__sfx("U09DS1M1IOWTjeW6lOaIquaWrQ=="));await oe(s,p[0],a,__sfx("U09DS1M1IOWTjeW6lA=="))}else if(T===4)await oe(s,16,a,__sfx("U09DS1M1IOWTjeW6lA=="));else throw new Error(__sfx("U09DS1M1IOWTjeW6lOWcsOWdgOexu+Wei+mdnuazlQ=="));return await oe(s,2,a,__sfx("U09DS1M1IOWTjeW6lA==")),s.release()}finally{try{i.releaseLock()}catch{}}}function lo(e,t){let n=e.replace(/^\[|\]$/g,"");if(H(n)){let s=n.split(".").map(a=>Number(a)),i=new Uint8Array(7);return i[0]=1,i.set(s,1),i[5]=t>>8&255,i[6]=t&255,i}if(te(n)){let s=ye(n),i=new Uint8Array(19);if(i[0]=4,s)for(let a=0;a<8;a++){let l=s[a]??0;i[1+a*2]=l>>8&255,i[2+a*2]=l&255}return i[17]=t>>8&255,i[18]=t&255,i}let o=new TextEncoder().encode(n),r=new Uint8Array(2+o.length+2);return r[0]=3,r[1]=o.length,r.set(o,2),r[r.length-2]=t>>8&255,r[r.length-1]=t&255,r}var ao,Tn=S(()=>{"use strict";we();X();He();ao=6e3});function co(e){let t=e.byteLength;for(let n=0;n+3<t;n++)if(uo.every((o,r)=>e[n+r]===o))return n;return-1}async function Rn(e,t,n,o,r={}){on(n,o);let s=new ne(e),i=t.getWriter(),a=n.includes(":")?`[${n}]:${o}`:`${n}:${o}`;try{let l=r.username&&r.password?__sfx("UHJveHktQXV0aG9yaXphdGlvbjogQmFzaWMg")+btoa(`${r.username}:${r.password}`)+"\r\n":"",f=[__sfx("Q09OTkVDVCA=")+a+" HTTP/1.1",`Host: ${a}`,__sfx("UHJveHktQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ=="),"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",l,"",""].join(`\r
|
|
2
2
|
`);await i.write(new TextEncoder().encode(f));let u=Date.now()+mt,c="";for(;;){let x=s.peek(),T=co(x);if(T>=0){c=new TextDecoder().decode(x.subarray(0,T)),s.skip(T+4);break}if(x.byteLength>8192)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTlpLTotoXov4cgODE5MiDlrZfoioI="));let p=u-Date.now();if(p<=0)throw new Error(__sfx("SFRUUCDku6PnkIbmj6HmiYvotoXml7bvvIg=")+mt+__sfx("bXMg5peg5ZON5bqU77yJ"));let R=null,E;try{E=await Promise.race([s.fill(),new Promise(k=>{R=setTimeout(()=>k("timeout"),p)})])}finally{R&&clearTimeout(R)}if(E==="timeout")throw new Error(__sfx("SFRUUCDku6PnkIbmj6HmiYvotoXml7bvvIg=")+mt+__sfx("bXMg5peg5ZON5bqU77yJ"));if(E===null)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTkuI3lrozmlbTvvIjov57mjqXooqvmj5DliY3lhbPpl63vvIk="))}let g=c.split(`\r
|
|
3
|
-
`)[0]??"",y=/^HTTP\/1\.[01]\s+(\d{3})/.exec(g);if(!y)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTpnZ7ms5U="));if(y[1]!=="200")throw new re(__sfx("SFRUUCDku6PnkIYgQ09OTkVDVCDlpLHotKXvvJo=")+y[1]+"");return s.release()}finally{try{i.releaseLock()}catch{}}}var uo,mt,Cn=S(()=>{"use strict";K();we();Be();uo=[13,10,13,10];mt=6e3});function gt(e){if(e instanceof le||(e instanceof Error?e.message:String(e)).includes(kn))return!0;let n=e instanceof Error?e.cause:void 0;return n!==void 0&&n!==e&>(n)}function vn(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function He(e){let t=vn(e);if(t===null)return null;for(let[n,o,r,s]of fo){let i=vn(n);if(i===null)continue;let a=o===0?0:4294967295<<32-o>>>0;if((t&a)===(i&a))return{kind:r,reason:s}}return null}function ht(e){let t=e[6]??0,n=e[7]??0;return`${t>>>8}.${t&255}.${n>>>8}.${n&255}`}function po(e){let t=(e.split("%")[0]??"").toLowerCase();if(!t.includes(":"))return null;let n=ye(t);if(!n)return null;let o=n[0]===0&&n[1]===0&&n[2]===0&&n[3]===0&&n[4]===0;if(o&&n[5]===65535)return He(ht(n))??null;if(o&&n[5]===0&&n[6]===0&&(n[7]===0||n[7]===1))return n[7]===1?{kind:"loopback",reason:__sfx("546v5Zue5Zyw5Z2A")}:{kind:"unspecified",reason:__sfx("5pyq5oyH5a6a5Zyw5Z2A")};if(o&&n[5]===0)return He(ht(n))??null;if(n[0]===100&&n[1]===65435&&n[2]===0&&n[3]===0&&n[4]===0&&n[5]===0){let s=He(ht(n));if(s)return s}let r=n[0]??0;return(r&65024)===64512?{kind:"ula",reason:__sfx("SVB2NiDllK/kuIDmnKzlnLDlnLDlnYA=")}:(r&65472)===65152?{kind:"link-local",reason:__sfx("SVB2NiDpk77ot6/mnKzlnLDlnLDlnYA=")}:(r&65280)===65280?{kind:"multicast",reason:__sfx("SVB2NiDnu4Tmkq3lnLDlnYA=")}:null}function yt(e){let t=e.trim().toLowerCase().replace(/^\[|\]$/g,"");if(t==="")return null;if(t.includes(":"))return po(t);if(/^\d{1,3}(?:\.\d{1,3}){3}$/.test(t))return He(t);if(t==="localhost"||t.endsWith(".localhost"))return{kind:"loopback",reason:__sfx("546v5Zue5Li75py65ZCN")};for(let n of mo)if(t.endsWith(n))return{kind:"internal-name",reason:__sfx("5YaF572R5Z+f5ZCN5ZCO57yA")};return null}var kn,Dn,le,fo,mo,bt=S(()=>{"use strict";K();kn=__sfx("55uu5qCH5Zyw5Z2A6KKr562W55Wl5oum5oiq"),Dn={kind:"ipv6-direct-unsupported",reason:__sfx("55u06L+e5LiO5Y+N5Luj6YCa6YGT5LiN5pSv5oyBIElQdjYg55uu5qCH77yM5Y+v5pS555So6JC95Zyw5Luj55CG6L2s5Y+R")},le=class extends Error{kind;constructor(t,n){super(`${kn}\uFF1A${t}\uFF08${n.reason}\uFF09`),this.name="TargetBlockedError",this.kind=n.kind}};fo=[[__sfx("MC4wLjAuMA=="),8,"unspecified",__sfx("5pyq5oyH5a6a5Zyw5Z2A")],[__sfx("MTAuMC4wLjA="),8,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MTAwLjY0LjAuMA=="),10,"cgnat",__sfx("6L+Q6JCl5ZWG57qnIE5BVCDnvZHmrrU=")],[__sfx("MTI3LjAuMC4w"),8,"loopback",__sfx("546v5Zue5Zyw5Z2A")],[__sfx("MTY5LjI1NC4wLjA="),16,"link-local",__sfx("6ZO+6Lev5pys5ZywIC8g5LqR5YWD5pWw5o2u5Zyw5Z2A")],[__sfx("MTcyLjE2LjAuMA=="),12,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MTkyLjE2OC4wLjA="),16,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MjI0LjAuMC4w"),4,"multicast",__sfx("57uE5pKt5Zyw5Z2A")],[__sfx("MjQwLjAuMC4w"),4,"reserved",__sfx("5L+d55WZ5Zyw5Z2A")]];mo=[".local",".internal"]});function yo(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)?!0:e.includes(":")&&/^[0-9a-fA-F:.]+$/.test(e)}function wt(e,t){let n=e.trim(),o=/^\[([^\]]+)\](?::(\d+))?$/.exec(n);if(o)return{host:o[1],port:Number(o[2]??t)};if(n.includes(":")&&n.split(":").length>2)return{host:n,port:t};let r=n.lastIndexOf(":");if(r<0)return{host:n,port:t};let s=n.slice(0,r),i=Number(n.slice(r+1));return s?{host:s,port:Number.isInteger(i)&&i>0?i:t}:{host:n,port:t}}async function bo(e,t,n,o=Nn){try{let r=`${e}?name=${encodeURIComponent(t)}&type=${n}`,s=await fetch(r,{headers:{accept:"application/dns-json"},signal:AbortSignal.timeout(o)});if(!s.ok)return null;let i=await s.json();if(!i||i.Status!==0&&i.Status!==3)return null;if(!Array.isArray(i.Answer))return[];let a=n==="TXT"?16:n==="A"?1:28;return i.Answer.filter(l=>l.type===a).map(l=>String(l.data))}catch{return null}}async function Un(e,t,n={}){for(let o of ho){if(n.deadline!==void 0&&Date.now()>=n.deadline)break;let r=n.timeoutMs??Nn,s=n.deadline!==void 0?n.deadline-Date.now():Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")],i=Math.max(50,Math.min(r,s)),a=await bo(o,e,t,i);if(a!==null)return a}return[]}function wo(e,t){let n=[],o=String(e).replace(/^"|"$/g,"").replace(/\\010/g,",").replace(/\\n/g,",").trim();if(!o||o===On)return n;let r=o.split(/[,;\s]+/).filter(Boolean);if(r.length===0)return n;for(let s of r){let i=s.trim();if(!i)continue;let{host:a,port:l}=wt(i,t);if(!B(a)&&!te(a))return[];n.push({hostname:a,port:l})}return n}async function Fe(e,t,n={}){let o=e.trim();if(!o)return[];if(yo(o))return[{hostname:o,port:t}];let r=`${o}:${t}`,s=_.get(r);if(s&&Date.now()-s.at<In)return _.delete(r),_.set(r,s),s.ips;let i=[],[a,l]=await Promise.all([n.skipTxt?Promise.resolve([]):Un(o,"TXT",n),Un(o,"A",n)]);if(!n.skipTxt)for(let c of a){let d=wo(c,t);if(d.length>0){i.push(...d);break}if(String(c).replace(/^"|"$/g,"").replace(/\\010/g,",").trim()===On)break}if(i.length===0)for(let c of l)B(c)&&i.push({hostname:c,port:t});let f=[],u=new Set;for(let c of i){let d=`${c.hostname}:${c.port}`;u.has(d)||(u.add(d),f.push(c))}if(f.length>0){let c=Date.now();for(let[d,g]of _)c-g.at>=In&&_.delete(d);for(;_.size>=go;){let d=_.keys().next().value;if(d===void 0)break;_.delete(d)}_.set(r,{at:c,ips:f})}return f}var On,ho,Nn,In,go,_,Ge=S(()=>{"use strict";K();On=__sfx("QGVkZ2V0dW5uZWw="),ho=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve","https://dns.alidns.com/resolve","https://doh.pub/dns-query"],Nn=4e3,In=300*1e3,go=1e3,_=new Map});var St={};ve(St,{[__sfx("QlVJTFRJTl9SRUxBWV9ET01BSU5T")]:()=>Ln,[__sfx("Q09MT19UT19DT1VOVFJZ")]:()=>Mn,[__sfx("UkVMQVlfQkFUQ0hfU0laRQ==")]:()=>Ke,[__sfx("UkVMQVlfRE9NQUlOX0xJTUlU")]:()=>Pt,clearRelayCache:()=>Eo,collectRelayEndpoints:()=>xe,coloToCountry:()=>xo,relayCacheSize:()=>Ao,resolveRelayEntry:()=>xt,selectRelayDomains:()=>Fn});function xo(e){let t=String(e??"").toUpperCase();return t?Mn[t]??(/^[A-Z]{2}$/.test(t)?t:"US"):"US"}function So(e){for(let[t,n]of J)e-n.at>=Hn&&J.delete(t);for(;J.size>=Po;){let t=J.keys().next().value;if(t===void 0)break;J.delete(t)}}async function xt(e,t=443,n=Bn,o={}){let r=e.trim();if(!r)return[];let s=`${r}:${t}:${n}`,i=J.get(s);if(i&&Date.now()-i.at<Hn)return i.ips;let a=r,l=t,f=(r.match(/:/g)??[]).length;if(f===1){let c=/^(.*):(\d{1,5})$/.exec(r);c&&(a=c[1],l=Number(c[2]))}else if(f>1&&r.startsWith("[")){let c=/^\[([^\]]+)\]:(\d{1,5})$/.exec(r);c&&(a=c[1],l=Number(c[2]))}let u=[];if(B(a)||te(a))u=[{ip:a,port:Number.isInteger(l)&&l>0?l:t,label:r}];else try{u=(await Fe(a,l,{skipTxt:o.skipTxt,deadline:o.deadline,timeoutMs:o.timeoutMs})).slice(0,n).map(d=>({ip:d.hostname,port:d.port,label:`${a} \u2192 ${d.hostname}`}))}catch{u=[]}if(u.length>0){let c=Date.now();So(c),J.set(s,{at:c,ips:u})}return u}function Fn(e=Pt,t=Ln){return t.slice(0,Math.max(0,e))}async function xe(e={}){let t=e.perDomain??Bn,n=[],o=new Set,r=d=>{for(let g of d){let y=`${g.ip}:${g.port}`;o.has(y)||(o.add(y),n.push(g))}},s=(e.userEntries??"").trim(),i=s?s.split(/[\n,;]+/).map(d=>d.trim()).filter(Boolean):[],a=e.domainLimit??Pt,l=e.useBuiltin!==!1?Fn(a):[],f=await Promise.all([...i.map(d=>xt(d,443,t,{deadline:e.deadline,timeoutMs:e.timeoutMs})),...l.map(d=>xt(d,443,t,{skipTxt:!0,deadline:e.deadline,timeoutMs:e.timeoutMs}))]);for(let d=0;d<i.length;d++)r(f[d]);let u=f.slice(i.length),c=u.reduce((d,g)=>Math.max(d,g.length),0);for(let d=0;d<c;d++)for(let g of u)d<g.length&&r([g[d]]);return n}function Eo(){J.clear()}function Ao(){return J.size}var Ln,Mn,Bn,Ke,Pt,Hn,Po,J,Pe=S(()=>{"use strict";K();Ge();Ln=[__sfx("MTkyLjE4LjEzNi4yNTU="),__sfx("MTI4LjEyMS4zMS4yNTI="),__sfx("MTI5LjE1OS4zNy4xMzY="),__sfx("MjMuMTQ0LjEyLjYz"),__sfx("MjE2LjM2Ljg2LjYy"),__sfx("NDUuMTMzLjExNy4xODU="),__sfx("MzguODQuMjAxLjIyOA=="),__sfx("MTA5LjEyMC4xNDIuMjE5"),__sfx("NDUuMTQwLjE2Ny40Mw=="),__sfx("NS4yNTMuMTg4LjEzOQ=="),__sfx("MjE2LjM2LjgyLjMx"),__sfx("MTY3LjI1My45Ni45MA=="),__sfx("MTk0Ljg3LjYyLjEzOQ=="),__sfx("MjMuMTQ0LjIwLjE4NA=="),__sfx("MTI4LjEyMS4zMS41OA=="),__sfx("MTA0LjIzOC4xNTQuNzc="),__sfx("MzguMjQ0LjE1MC4xMTM="),__sfx("MTU1LjI0OC4xODEuMTg5"),__sfx("MjE2LjM2LjgyLjE0MQ=="),__sfx("NjQuMTgxLjI1NS4yMTU="),__sfx("MzEuMjUuMjM5LjY2"),__sfx("NDUuNzYuMjQ2LjE5Mg=="),__sfx("MjMuOTUuMTEzLjYx"),__sfx("MTUxLjI0NC4yMDEuMjA3")],Mn={[__sfx("SEtH")]:"HK",[__sfx("U1lE")]:"AU",[__sfx("TUVM")]:"AU",[__sfx("Qk5F")]:"AU",[__sfx("UEVS")]:"AU",[__sfx("QURM")]:"AU",[__sfx("Q0JS")]:"AU",[__sfx("U0lO")]:"SG",[__sfx("TlJU")]:"JP",[__sfx("SE5E")]:"JP",[__sfx("S0lY")]:"JP",[__sfx("VFlP")]:"JP",[__sfx("T1NB")]:"JP",[__sfx("TkdP")]:"JP",[__sfx("Q1RT")]:"JP",[__sfx("RlVL")]:"JP",[__sfx("T0tB")]:"JP",[__sfx("SUNO")]:"KR",[__sfx("U0VM")]:"KR",[__sfx("UFVT")]:"KR",[__sfx("RlJB")]:"DE",[__sfx("TVVD")]:"DE",[__sfx("RFVT")]:"DE",[__sfx("QkVS")]:"DE",[__sfx("SEFN")]:"DE",[__sfx("U1RS")]:"DE",[__sfx("VklF")]:"DE",[__sfx("WlJI")]:"DE",[__sfx("Q0RH")]:"FR",[__sfx("TUFE")]:"ES",[__sfx("TVhQ")]:"IT",[__sfx("RkNP")]:"IT",[__sfx("UFJH")]:"CZ",[__sfx("V0FX")]:"PL",[__sfx("QVJO")]:"SE",[__sfx("QU1T")]:"NL",[__sfx("SEVM")]:"FI",[__sfx("TEhS")]:"GB",[__sfx("TEdX")]:"GB",[__sfx("TUFO")]:"GB",[__sfx("RURJ")]:"GB",[__sfx("TEFY")]:"US",[__sfx("U0pD")]:"US",[__sfx("U0ZP")]:"US",[__sfx("U0VB")]:"US",[__sfx("UERY")]:"US",[__sfx("U0FO")]:"US",[__sfx("TEFT")]:"US",[__sfx("UEhY")]:"US",[__sfx("U0xD")]:"US",[__sfx("REVO")]:"US",[__sfx("REZX")]:"US",[__sfx("SUFI")]:"US",[__sfx("QVVT")]:"US",[__sfx("T1JE")]:"US",[__sfx("TVNQ")]:"US",[__sfx("RFRX")]:"US",[__sfx("U1RM")]:"US",[__sfx("TUNJ")]:"US",[__sfx("QVRM")]:"US",[__sfx("TUlB")]:"US",[__sfx("TUNP")]:"US",[__sfx("Qk5B")]:"US",[__sfx("Q0xU")]:"US",[__sfx("SUFE")]:"US",[__sfx("Qk9T")]:"US",[__sfx("RVdS")]:"US",[__sfx("SkZL")]:"US",[__sfx("UEhM")]:"US",[__sfx("WVla")]:"CA",[__sfx("WVZS")]:"CA",[__sfx("WVVM")]:"CA",[__sfx("TUVY")]:"MX",[__sfx("R1JV")]:"BR",[__sfx("VFBF")]:"TW",[__sfx("S0hI")]:"TW",[__sfx("VFNB")]:"TW",[__sfx("Uk1R")]:"TW"};Bn=4,Ke=6,Pt=6,Hn=30*1e3,Po=256,J=new Map});function Et(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function Gn(e){return e.map(([t,n])=>{let o=Et(t)??0,r=n===0?0:4294967295<<32-n>>>0;return[(o&r)>>>0,r]})}function Kn(e){let t=Et(e);if(t===null)return!1;for(let[n,o]of Do)if((t&o)>>>0===n)return!0;return!1}function se(e){let t=Et(e);if(t===null)return!1;for(let[n,o]of ko)if((t&o)>>>0===n)return!0;return!1}function jn(e){let t=[],n=new Set,o=u=>{let c=`${u.source}|${u.host}|${u.port}`;n.has(c)||(n.add(c),t.push(u))};for(let u of e.proxies??[])u.kind==="direct"?o({source:"proxy",host:u.host,port:u.port,label:__sfx("UHJveHlJUCA=")+u.host+":"+u.port+"",via:{kind:"direct",host:u.host,port:u.port}}):o({source:"proxy",host:u.host,port:u.port,label:`${u.kind.toUpperCase()} ${u.host}:${u.port}`,via:{kind:u.kind,host:u.host,port:u.port,username:u.username,password:u.password,serverName:u.serverName}});let s=se(e.targetHost)||e.deprioritizeDirect===!0;o({source:"direct",host:e.targetHost,port:e.targetPort,label:__sfx("55u06L+eIA==")+e.targetHost+":"+e.targetPort+"",deprioritized:s});let i=e.optimizedIps??[],a=i.filter(u=>!se(u.ip)),l=i.filter(u=>se(u.ip));for(let u of a)o({source:"optimized",host:u.ip,port:u.port,label:__sfx("5LyY6YCJIA==")+u.ip+":"+u.port+""});for(let u of l)o({source:"optimized",host:u.ip,port:u.port,label:__sfx("5LyY6YCJIA==")+u.ip+":"+u.port+__sfx("77yIQ2xvdWRmbGFyZSDnvZHmrrXvvIzlj6/og73kuI3lj6/ovr7vvIk="),deprioritized:!0});let f=e.relay??[];for(let u of f)o({source:"relay",host:u.ip,port:u.port,label:__sfx("5Y+N5LujIA==")+u.label+"",deprioritized:!0});return t.map((u,c)=>({candidate:u,index:c})).sort((u,c)=>{let d=+!!u.candidate.deprioritized-+!!c.candidate.deprioritized;return d!==0?d:u.index-c.index}).map(u=>u.candidate)}function Wn(e){let t=e.filter(o=>!o.deprioritized),n=t.filter(o=>o.source==="proxy");return{landing:n.filter(o=>o.via?.kind!=="direct"),[__sfx("cHJveHlJcA==")]:n.filter(o=>o.via?.kind==="direct"),direct:t.filter(o=>o.source!=="proxy"),fallback:e.filter(o=>o.deprioritized)}}function zn(e,t){let n=e instanceof Error?e.message:String(e);return gt(e)?{kind:"policy",message:n,candidate:t}:/proxy request failed|cannot connect to the specified address|TCP Loop/i.test(n)?{kind:"blocked",message:n,candidate:t}:/timeout|超时|timed out|abort/i.test(n)?{kind:"timeout",message:n,candidate:t}:{kind:"other",message:n,candidate:t}}function Xn(e){switch(e.kind){case"blocked":return __sfx("5Ye656uZ6KKrIENsb3VkZmxhcmUg5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg5bi46KeB5Y6f5Zug77ya55uu5qCH5Zyw5Z2A5ZyoIENsb3VkZmxhcmUg6Ieq5a62572R5q6177yIV29ya2VyIOS4jeiDveS4u+WKqOi/nuWbniBDRiDoh6rlt7HnmoTlhaXlj6PvvInjgIIKICDihpIg5o2i5LiA5Liq56ys5LiJ5pa5IElQ77yM5oiW5pS555So5Luj55CG6JC95Zyw44CC");case"policy":return __sfx("5Ye656uZ6KKr562W55Wl5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg55uu5qCH5bGe5LqO546v5ZueIC8g5YaF572RIC8g6ZO+6Lev5pys5ZywIC8g5L+d55WZ5Zyw5Z2A77yMV29ya2VyIOebtOi/nuaXoOazleWIsOi+vuOAggogIOKGkiDopoHorr/pl67lsYDln5/nvZHorr7lpIfvvIzor7fphY3nva7okL3lnLDku6PnkIbvvIjnlLHku6PnkIbkvqflu7rov57vvInjgII=");case"timeout":return __sfx("5Ye656uZ6LaF5pe277yI")+e.candidate+"):"+e.message+__sfx("CiAg4oaSIOivpeWcsOWdgOW9k+WJjeS4jeWPr+i+vu+8jOWPr+aNouS4gOadoeWAmemAieaIluWQr+eUqOS7o+eQhuiQveWcsOOAgg==");default:return __sfx("5Ye656uZ5aSx6LSl77yI")+e.candidate+"):"+e.message+""}}var To,Ro,Co,vo,ko,Do,At=S(()=>{"use strict";bt();To=[[__sfx("MTAzLjIxLjI0NC4w"),22],[__sfx("MTAzLjIyLjIwMC4w"),22],[__sfx("MTAzLjMxLjQuMA=="),22],[__sfx("MTA0LjE2LjAuMA=="),13],[__sfx("MTA0LjI0LjAuMA=="),14],[__sfx("MTA4LjE2Mi4xOTIuMA=="),18],[__sfx("MTMxLjAuNzIuMA=="),22],[__sfx("MTQxLjEwMS42NC4w"),18],[__sfx("MTYyLjE1OC4wLjA="),15],[__sfx("MTcyLjY0LjAuMA=="),13],[__sfx("MTczLjI0NS40OC4w"),20],[__sfx("MTg4LjExNC45Ni4w"),20],[__sfx("MTkwLjkzLjI0MC4w"),20],[__sfx("MTk3LjIzNC4yNDAuMA=="),22],[__sfx("MTk4LjQxLjEyOC4w"),17]],Ro=[[__sfx("MTA0LjMxLjAuMA=="),15],[__sfx("MTkyLjAuMC4w"),24],[__sfx("MTkyLjAuMi4w"),24],[__sfx("MTkyLjg4Ljk5LjA="),24],[__sfx("MTk5LjI3LjEyOC4w"),21],[__sfx("MS4wLjAuMA=="),24],[__sfx("MS4xLjEuMA=="),24]],Co=[[__sfx("MjIzLjUuNS4w"),24]],vo=[...To,...Ro];ko=Gn(vo),Do=Gn(Co)});function Yn(e,t="direct"){let n=e.trim();if(!n)return null;let o=t,r=n,s=/^([a-z0-9+.-]+):\/\//i.exec(n);if(s){let d=s[1].toLowerCase();r=n.slice(s[0].length),d===__sfx("c29ja3M1")||d===__sfx("c29ja3M=")||d===__sfx("c29ja3M1aA==")?o=__sfx("c29ja3M1"):d==="https"?o="https":d==="http"&&(o="http")}let i=r.lastIndexOf("@"),a={};if(i>=0){let d=r.slice(0,i);r=r.slice(i+1);let g=d.indexOf(":");g>=0?a={username:d.slice(0,g),password:d.slice(g+1)}:a={username:d}}let l,f=/#sni=([^/#]+)/i.exec(r);f&&(l=f[1].trim(),r=r.slice(0,f.index)+r.slice(f.index+f[0].length));let{host:u,port:c}=wt(r,0);return!u||!Number.isInteger(c)||c<=0||c>65535?null:(!l&&o==="https"&&!Io(u)&&(l=u),{host:u,port:c,kind:o,...a,...l?{serverName:l}:{}})}function Io(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)}function Se(e,t="direct"){let n=[];for(let o of e.split(/[\n,;]+/)){let r=o.trim();if(!r)continue;let s=Yn(r,t);s&&n.push(s)}return n}var Tt=S(()=>{"use strict";Ge()});async function Uo(){return Rt||(Rt=(async()=>(await import("cloudflare:sockets")).connect)()),await Rt}function No(e,t){if(!B(e))return null;let n=e.split(".").map(i=>Number(i)),o=(n[0]<<8|n[1]).toString(16),r=(n[2]<<8|n[3]).toString(16);return`${t.replace(/:+$/,"")}::${o}:${r}`}async function je(e,t,n,o,r){let i=(await Uo())({hostname:e,port:t},o?{secureTransport:o}:void 0),a=async(f,u)=>{let c,d=new Promise((g,y)=>{c=setTimeout(()=>y(new Error(""+u+__sfx("6LaF5pe277ya")+e+":"+t+"")),n)});try{return await Promise.race([f,d])}finally{c&&clearTimeout(c)}},l;try{if(await a(i.opened,__sfx("6L+e5o6l")),o==="starttls"){if(l=i.startTls?.(r?{expectedServerHostname:r}:void 0),!l)throw new Error(__sfx("5b2T5YmN6L+Q6KGM5pe25LiN5pSv5oyBIHN0YXJ0VGxz"));return await a(l.opened,__sfx("VExTIOaPoeaJiw==")),l}return i}catch(f){try{await(l??i).close()}catch{}throw f}}async function Lo(e){let t=e.timeoutMs??kt;try{let n=await je(e.hostname,e.port,t);return{readable:n.readable,writable:n.writable,via:"direct",endpoint:`${e.hostname}:${e.port}`,close:()=>{try{n.close()}catch{}}}}catch(n){if(e.nat64&&B(e.hostname)){let o=No(e.hostname,e.nat64);if(o){let r=await je(o,e.port,t);return{readable:r.readable,writable:r.writable,via:"nat64",endpoint:`${o}:${e.port}`,close:()=>{try{r.close()}catch{}}}}}throw n}}function Mo(e){return e.includes(":")}function Bo(e){return e.source==="proxy"&&e.via!==void 0&&e.via.kind!=="direct"}async function Ho(e,t){let n=e.timeoutMs??kt;if(t.kind==="direct"){let s=await je(t.host,t.port,n);return{readable:s.readable,writable:s.writable,via:"direct",endpoint:`${t.host}:${t.port}`,close:()=>{try{s.close()}catch{}}}}let o=t.kind==="https"?"starttls":void 0,r=await je(t.host,t.port,n,o,t.kind==="https"?t.serverName:void 0);try{return t.kind==="http"||t.kind==="https"?{readable:await Rn(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:t.kind,endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}:{readable:await An(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:__sfx("c29ja3M1"),endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}}catch(s){try{await r.close()}catch{}throw s}}function Zn(e){return e instanceof Error?e.message:typeof e=="string"?e:String(e)}function Go(e){if(e.length===0)return __sfx("5pyq55+l5Y6f5Zug");let t=e.map(Zn),n=t.slice(-Fo),o=t.length-n.length;return`${o>0?`\uFF08\u5171 ${t.length} \u6761\uFF0C\u7701\u7565\u524D ${o} \u6761\uFF09`:""}${n.join("\uFF1B")}`}function Ko(e){return e.length===0?Promise.reject(new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"))):new Promise((t,n)=>{let o=e.length,r=!1,s=[];for(let i of e)i().then(a=>{if(r){try{let l=a.close;Promise.resolve(l?l():a.writable.close()).catch(()=>{})}catch{}return}r=!0,t(a)},a=>{s.push(a),o-=1,o===0&&!r&&(r=!0,n(new Error(__sfx("5pys5om5IA==")+e.length+__sfx("IOS4quWAmemAieWFqOmDqOWksei0pe+8mg==")+Go(s)+"")))})})}async function vt(e,t){if(e.length===0)throw new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"));if(!t||e.length<=1){let s=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let i of e)try{return await i()}catch(a){s=a}throw s}let n=[],o=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let s=0;s<e.length;s+=Ct){let i=e.slice(s,s+Ct);try{return await Ko(i)}catch(a){o=a,n.push(Zn(a))}}throw new Error(__sfx("5YWo6YOoIA==")+e.length+__sfx("IOS4quWAmemAieWdh+Wksei0pe+8iOWIhiA=")+n.length+__sfx("IOaJue+8jOavj+aJueacgOWkmiA=")+Ct+__sfx("IOS4quW5tuWPke+8ie+8mgo=")+n.join(`
|
|
4
|
-
`),{cause:o})}async function
|
|
5
|
-
`):__sfx("5Ye656uZ6L+e5o6l5aSx6LSl77ya")+String(H)+"";Q(`${m.hostname}:${m.port}`,P,C),I(1011,C);return}let M=d.writable.getWriter();g=M,er(`${m.hostname}:${m.port}`,d,"initial");let U=l.byteLength>m.headerLength?l.subarray(m.headerLength):new Uint8Array(0);l=new Uint8Array(0);try{await y.run(async()=>{U.byteLength>0&&(et(U),await M.write(U)),await _t(M)})}catch(C){Q(`${m.hostname}:${m.port}`,[],__sfx("5LiK6KGM6aaW5YyF5YaZ5YWl5aSx6LSl77ya")+String(C)+""),h()}r?.waitUntil(Yt())},Qt=async m=>{if(G||R)return;let b=N;if(!b){I(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55uu5qCH5pyq6Kej5p6Q"));return}if(V>=It){I(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55u06L+e5LiO5Y+N5Luj5YWl5Y+j5Z2H5peg5ZON5bqU"));return}R=!0;let P=bn({via:d?.via,port:b.port,userProxyConfigured:o.length>0||!!n[__sfx("cHJveHlJcA==")],aggressive:n.aggressiveRedial===!0});if(!P.allowed){de.guardedRedials++,Q(`${b.hostname}:${b.port}`,[],__sfx("5Ye656uZ5peg5pWw5o2u77ya")+P.reason+__sfx("77yb5pyq5YiH5o2i5Y+N5Luj77yI5Y+v5byA5ZCvIGFnZ3Jlc3NpdmVSZWRpYWzvvIk=")),I(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya")+P.reason+"");return}V++,m==="stall"?de.stallRedials++:de.eofRedials++,Q(`${b.hostname}:${b.port}`,[],m==="stall"?__sfx("55u06L+eIA==")+Qn+__sfx("bXMg5peg5LiL6KGM5pWw5o2u77yM5pS56LWw5Y+N5Luj5YWl5Y+j"):__sfx("5Ye656uZ6Zu25LiL6KGM5Y2zIEVPRi9SZXNldO+8jOeri+WNs+aUuei1sOWPjeS7o+WFpeWPow=="));let H=[];try{H=await xe({userEntries:n.relayPool||void 0,useBuiltin:n.useBuiltinRelay})}catch{H=[]}let M=H.filter(U=>!v.has(`${U.ip}:${U.port}`));if(M.length===0){I(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5peg5Y+N5Luj5YWl5Y+j5Y+v55So"));return}for(let U of M.slice(0,It)){if(v.add(`${U.ip}:${U.port}`),Ir(),d){let C=d;if(C.close)try{C.close()}catch{}}g=null,ae=0;try{let C=await fe({hostname:U.ip,port:U.port,timeoutMs:Jn,resolvePreferred:!1,skipTargetPolicy:!0,proxies:n.aggressiveRedial?o:void 0,proxyMode:n.aggressiveRedial?n.proxyMode:void 0});if(!C)continue;d=C,er(`${b.hostname}:${b.port}`,C,"redial");let he=C.writable.getWriter();g=he;let $t=0;for(let Ce of O)$t+=Ce.byteLength;let rt=new Uint8Array($t),en=0;for(let Ce of O)rt.set(Ce,en),en+=Ce.byteLength;await y.run(async()=>{rt.byteLength>0&&await he.write(rt),await _t(he)}),Q(`${b.hostname}:${b.port}`,[],__sfx("5bey5YiH5o2i5Y+N5Luj5YWl5Y+jIA==")+U.ip+":"+U.port+""),r?.waitUntil(Yt());return}catch(C){Q(`${b.hostname}:${b.port}`,[],__sfx("5Y+N5Luj5YWl5Y+jIA==")+U.ip+":"+U.port+__sfx("IOWksei0pe+8mg==")+String(C)+"")}}I(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5omA5pyJ5Y+N5Luj5YWl5Y+j5Z2H5aSx6LSl"))};a.addEventListener("message",m=>{(async()=>{let b=m.data,P=typeof b=="string"?new TextEncoder().encode(b):new Uint8Array(b);if(P.byteLength!==0){if(p(),Vt.add(P.byteLength)){Zt();return}if(!c){if(l=yn(l,P),l.byteLength>Wo){I(1009,__sfx("5o+h5omL5aS06LaF6L+HIDY0S0I="));return}await nt();return}if(Y){Y.push(P);return}if(!g){if(f.push(P),u+=P.byteLength,u>qn){I(1009,__sfx("5ouo5Y+35pyf6Ze05pWw5o2u6L+H5aSa"));return}return}et(P),await Ur(P)}})()});let qt=()=>{h()};a.addEventListener("close",qt),a.addEventListener("error",qt),l.byteLength>0?nt().catch(m=>I(1011,String(m))):T=setTimeout(()=>{T=null,!(G||c||l.byteLength>0)&&(de.firstPacketTimeouts++,I(1008,__sfx("6aaW5YyF6LaF5pe277ya5pyq5pS25Yiw5Y2P6K6u5aS0")))},_o);try{return new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:i})}catch(m){return console.error(__sfx("W+iHqueglOaVsOaNrumdol0gMTAxIOWTjeW6lOaehOmAoOWksei0pe+8mg=="),m),new Response(null,{status:200})}}var Jn,Qn,It,Wo,qn,zo,ze,Xe,$n,de,Ye,Zo,_o,Ut=S(()=>{"use strict";ct();hn();gn();we();wn();xn();Dt();We();At();Pe();Jn=5e3,Qn=2500,It=2,Wo=64*1024,qn=8*1024*1024,zo=32*1024*1024,ze=0;Xe=[],$n=20,de={stallRedials:0,eofRedials:0,guardedRedials:0,firstPacketTimeouts:0,downlinkYields:0};Ye=[];Zo=2e3,_o=8e3});var fr={};ve(fr,{[__sfx("Y2xlYXJYaHR0cFNlc3Npb25z")]:()=>rs,[__sfx("aGFuZGxlWGh0dHA=")]:()=>Mt,[__sfx("aXNYaHR0cFBhdGg=")]:()=>Lt,[__sfx("cGFyc2VYaHR0cFJvdXRl")]:()=>Nt,[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:()=>$o,[__sfx("cmVjb3JkWGh0dHBEaWFnbm9zdGljcw==")]:()=>X});function qo(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}function X(e,t,n){Ze.unshift({at:Date.now(),target:e,...t,summary:n}),Ze.length>20&&(Ze.length=20)}function $o(){return Ze}function es(e){return String(e||"").trim().replace(/\/+$/,"")||"/"}function Nt(e,t){let n=es(t??__sfx("L3hodHRw"));if(e===n||e===`${n}/`)return{kind:"stream-one"};let o=`${n}/`;if(!e.startsWith(o))return null;let r=e.slice(o.length);if(!r)return null;let s=r.split("/");if(s.length===1&&s[0])return/[\s\u0000-\u001f]/.test(s[0])?null:{kind:"session",sessionId:s[0]};if(s.length===2&&s[0]&&/^\d+$/.test(s[1])){if(/[\s\u0000-\u001f]/.test(s[0]))return null;let i=Number(s[1]);return!Number.isSafeInteger(i)||i<0||i>1e6?null:{kind:__sfx("cGFja2V0LXVw"),sessionId:s[0],seq:i}}return null}function Lt(e,t){return Nt(e,t)!==null}function lr(e){if(e.reservedBytes<=0){e.reservedBytes=0;return}Ee=Math.max(0,Ee-e.reservedBytes),e.reservedBytes=0}function ir(e,t){return t<=0?!0:Ee+t>ns?!1:(Ee+=t,e.reservedBytes+=t,!0)}function rs(){for(let[e,t]of W)z(e,t);W.clear(),Ee=0}function os(e,t){return t-e.lastUploadAt>Ot&&t-e.lastDownlinkAt>Ot&&t-e.lastActivityAt>Ot}function ss(e,t){return e.closed?!0:e.header||e.dialResult||e.downlinkStarted?!1:t-e.createdAt>ar}function ur(e,t,n,o){let r=Date.now();for(let[a,l]of W)(l.closed||os(l,r)||r-l.createdAt>30*6e4)&&z(a,l);let s=W.get(e);if(s)return cr(s,n,r),s;if(W.size>=rr){for(let[a,l]of W)ss(l,r)&&z(a,l);if(W.size>=rr)return null}if(!o){let a=0;for(let l of W.values())l.header||(a+=1);if(a>=ts)return null}let i={id:e,createdAt:r,lastUploadAt:r,lastDownlinkAt:r,lastActivityAt:r,header:void 0,headerWaiters:[],dialPromise:null,dialResult:null,pending:new Map,reservedBytes:0,nextPumpSeq:0,pumpStarted:!1,signalResolve:null,traffic:new ue(t),downlinkStarted:!1,closed:!1,targetLabel:""};return W.set(e,i),i}function cr(e,t,n){t==="upload"?e.lastUploadAt=n:e.lastDownlinkAt=n,e.lastActivityAt=n}function z(e,t){if(!t.closed){t.closed=!0;for(let n of t.headerWaiters)try{n(null)}catch{}if(t.headerWaiters=[],t.signalResolve?.(),t.signalResolve=null,t.dialResult?.close)try{t.dialResult.close()}catch{}lr(t),t.pending.clear(),W.delete(e)}}function is(e){let t=e.signalResolve;e.signalResolve=null,t?.()}function as(e,t){return e.header?Promise.resolve(e.header):e.closed?Promise.resolve(null):new Promise(n=>{let o=s=>{clearTimeout(r),n(s)},r=setTimeout(()=>{let s=e.headerWaiters.indexOf(o);s>=0&&e.headerWaiters.splice(s,1),n(null)},t);e.headerWaiters.push(o)})}function ls(e,t){e.header=t;let n=e.headerWaiters;e.headerWaiters=[];for(let o of n)try{o(t)}catch{}}function L(e){let t=100+Math.floor(Math.random()*900);return{"Content-Type":"text/event-stream","Cache-Control":"no-store","X-Accel-Buffering":"no","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST","X-Padding":"X".repeat(t),...e}}function us(e){let t=e.addons,n=new Uint8Array(2+t.byteLength);return n[0]=e.version,n[1]=t.byteLength,n.set(t,2),n}async function cs(e,t,n){if(e.dialResult)return e.dialResult;if(!e.dialPromise){let o=e.header;if(!o)throw new Error(__sfx("VkxFU1Mg5aS05pyq5Yiw6L6+"));e.targetLabel=`${o.hostname}:${o.port}`,e.dialPromise=fe({hostname:o.hostname,port:o.port,proxies:n,nat64:t.nat64,concurrent:t.concurrentDial,proxyMode:t.proxyMode,resolvePreferred:t.resolvePreferred,relayPool:{userEntries:t.relayPool||void 0,useBuiltin:t.useBuiltinRelay},onFailure:r=>{X(e.targetLabel,r,__sfx("WEhUVFAg5Ye656uZ5aSx6LSl77yI")+r.candidate+"):"+r.message+"")}}).then(r=>(e.dialResult=r,r)).catch(r=>{throw X(e.targetLabel,{kind:"dial",message:String(r),candidate:"all"},__sfx("WEhUVFAg5Ye656uZ5YWo6YOo5aSx6LSl77ya")+String(r)+""),r})}return await e.dialPromise}async function fs(e,t){let n=t.writable.getWriter();try{for(;!e.closed;){let o=e.pending.get(e.nextPumpSeq);if(o){if(e.pending.delete(e.nextPumpSeq),e.nextPumpSeq+=1,lr(e),o.byteLength===0)continue;if(e.traffic.add(o.byteLength)){X(e.targetLabel,{kind:"budget",message:__sfx("5rWB6YeP6LaF6ZmQ"),candidate:"traffic"},__sfx("WEhUVFAg5LiK6KGM5rWB6YeP6LaF6ZmQ"));break}try{await n.write(o)}catch(i){X(e.targetLabel,{kind:"relay-write",message:String(i),candidate:t.endpoint},__sfx("WEhUVFAg5YaZ5YWl55uu5qCH5aSx6LSl77ya")+String(i)+"");break}continue}let r=null,s=new Promise(i=>{r=i});if(e.signalResolve=r,e.pending.has(e.nextPumpSeq)||e.closed){e.signalResolve=null;continue}await s}}finally{try{n.releaseLock()}catch{}}}async function ds(e,t,n,o,r){let s=(t.dataBudgetMB||0)*1024*1024,i=ur(o,s,"upload",r===0);if(!i)return new Response(__sfx("5Lya6K+d5pWw5bey6L6+5LiK6ZmQ77yM6K+356iN5ZCO6YeN6K+V"),{status:503,headers:L()});if(i.closed)return null;let a=Number(e.headers.get("content-length")??"");if(Number.isFinite(a)&&a>or)return new Response(__sfx("5YiG5YyF6LaF5Ye65LiK6ZmQ"),{status:413,headers:L()});let l;try{let f=await e.arrayBuffer();l=new Uint8Array(f)}catch{return new Response(__sfx("6K+35rGC5L2T6K+75Y+W5aSx6LSl"),{status:400,headers:L()})}if(l.byteLength>or)return new Response(__sfx("5YiG5YyF6LaF5Ye65LiK6ZmQ"),{status:413,headers:L()});if(r===0&&!i.header){let f=Ie(l,t.uuid);if(!f)return z(o,i),new Response(__sfx("VkxFU1Mg5aS06Kej5p6Q5aSx6LSl"),{status:400,headers:L()});if(f.header.command!==ut)return z(o,i),new Response(__sfx("WEhUVFAg5pqC5LiN5pSv5oyBIFVEUA=="),{status:400,headers:L()});ls(i,f.header),i.targetLabel=`${f.header.hostname}:${f.header.port}`;let u=l.subarray(f.consumed);if(r>=i.nextPumpSeq&&!i.pending.has(r)){if(i.pending.size>=sr)return z(o,i),new Response(__sfx("5YiG5YyF57yT5a2Y5bey5ruh"),{status:503,headers:L()});if(!ir(i,u.byteLength))return z(o,i),new Response(__sfx("5pqC5a2Y6LaF6ZmQ"),{status:503,headers:L()});i.pending.set(r,u.slice())}}else{if(r<i.nextPumpSeq||i.pending.has(r))return new Response(null,{status:200,headers:L()});if(i.pending.size>=sr)return z(o,i),new Response(__sfx("5YiG5YyF57yT5a2Y5bey5ruh"),{status:503,headers:L()});if(!ir(i,l.byteLength))return z(o,i),new Response(__sfx("5pqC5a2Y6LaF6ZmQ"),{status:503,headers:L()});i.pending.set(r,l.slice())}return is(i),new Response(null,{status:200,headers:L()})}async function ps(e,t,n,o){let r=(t.dataBudgetMB||0)*1024*1024,s=ur(o,r,"downlink",!1);if(!s)return new Response(__sfx("5Lya6K+d5pWw5bey6L6+5LiK6ZmQ77yM6K+356iN5ZCO6YeN6K+V"),{status:503,headers:L()});if(s.closed||s.downlinkStarted)return null;s.downlinkStarted=!0;let i=as(s,ar),a=!1,l=null,f=null,u=!1,c=null,d=()=>{z(o,s)},g=new ReadableStream({start(y){f=y},async pull(y){if(!a)try{if(!u){let p=await i;if(a)return;if(!p){d(),y.close();return}try{c=await cs(s,t,n)}catch{d(),y.close();return}if(a)return;s.pumpStarted||(s.pumpStarted=!0,fs(s,c).catch(()=>{}));try{y.enqueue(us(p))}catch{}u=!0;return}if(!c)return;l||(l=c.readable.getReader());let{done:x,value:T}=await l.read();if(a)return;if(x){d();try{y.close()}catch{}return}if(T&&T.byteLength>0){if(cr(s,"downlink",Date.now()),s.traffic.add(T.byteLength)){X(s.targetLabel,{kind:"budget",message:__sfx("5rWB6YeP6LaF6ZmQ"),candidate:"traffic"},__sfx("WEhUVFAg5LiL6KGM5rWB6YeP6LaF6ZmQ")),d();try{y.close()}catch{}return}y.enqueue(T)}}catch(x){if(a)return;d();try{y.error(x)}catch{}}},cancel(y){if(a=!0,c)try{c.readable.cancel(y)}catch{}d()}});return new Response(g,{status:200,headers:L()})}async function Mt(e,t,n){let o=__sfx("L3hodHRw");try{o=new URL(e.url).pathname}catch{o=__sfx("L3hodHRw")}let r=Nt(o,t[__sfx("eGh0dHBQYXRo")]);return r?r.kind==="stream-one"?e.method!=="POST"?null:await ms(e,t,n):r.kind===__sfx("cGFja2V0LXVw")?e.method!=="POST"?null:await ds(e,t,n,r.sessionId,r.seq):e.method==="GET"?await ps(e,t,n,r.sessionId):null:null}async function ms(e,t,n){let o=e.body;if(!o)return new Response(__sfx("57y65bCR6K+35rGC5L2T"),{status:400});let r=new ne(o),s=await qo(ln(r,t.uuid),Qo);if(!s)return await r.cancel("header timeout"),new Response(__sfx("VkxFU1Mg5aS06Kej5p6Q5aSx6LSl"),{status:400});if(s.header.command!==ut)return await s.payload.cancel("unsupported UDP"),new Response(__sfx("WEhUVFAg5pqC5LiN5pSv5oyBIFVEUA=="),{status:400});let i;try{i=await fe({hostname:s.header.hostname,port:s.header.port,proxies:n,nat64:t.nat64,concurrent:t.concurrentDial,proxyMode:t.proxyMode,resolvePreferred:t.resolvePreferred,relayPool:{userEntries:t.relayPool||void 0,useBuiltin:t.useBuiltinRelay},onFailure:p=>{X(`${s.header.hostname}:${s.header.port}`,p,__sfx("WEhUVFAg5Ye656uZ5aSx6LSl77yI")+p.candidate+"):"+p.message+"")}})}catch(p){X(`${s.header.hostname}:${s.header.port}`,{kind:"dial",message:String(p),candidate:"all"},__sfx("WEhUVFAg5Ye656uZ5YWo6YOo5aSx6LSl77ya")+String(p)+"");try{s.payload.cancel("dial failed").catch(()=>{})}catch{}return new Response(__sfx("5Ye656uZ5LiN5Y+v55So"),{status:502})}let a=s.header.addons;if(a.byteLength>255)return new Response(__sfx("QWRkb25zIOmVv+W6pui2heWHuiBWTEVTUyDljY/orq7kuIrpmZA="),{status:400});let l=new Uint8Array(2+a.byteLength);l[0]=s.header.version,l[1]=a.byteLength,l.set(a,2);let f=!1,u=null,c=!1,d=new ue((t.dataBudgetMB||0)*1024*1024),g=null,y=()=>{if(c)return;c=!0;let p=__sfx("5Y2V6L+e5o6l5rWB6YeP6LaF6L+HIA==")+t.dataBudgetMB+__sfx("TUIg5LiK6ZmQ");if(X(`${s.header.hostname}:${s.header.port}`,{kind:"budget",message:p,candidate:"traffic"},p),i.close)try{i.close()}catch{}try{g?.close()}catch{}},x=p=>d.add(p)?(y(),!0):!1;_n(s.payload,i.writable,void 0,!1,x,(p,R)=>{let E=p instanceof Error?p.message:String(p),k=`relay-${R}`;/cancel|abort|closed/i.test(E)?k=`relay-${R}-client-cancel`:/reset|broken pipe/i.test(E)&&(k=`relay-${R}-upstream-reset`),X(`${s.header.hostname}:${s.header.port}`,{kind:k,message:E.slice(0,200),candidate:i.endpoint},__sfx("WEhUVFAg5Lit57un")+R==="read"?"\u8BFB\u4E0A\u6E38":"\u5199\u76EE\u6807"+__sfx("5aSx6LSl77yI")+k+"):"+E.slice(0,120)+"")}).catch(()=>{});let T=new ReadableStream({start(p){g=p,p.enqueue(l),f=!0},async pull(p){if(!(c||!f)){u||(u=i.readable.getReader());try{let{done:R,value:E}=await u.read();if(c)return;if(R){if(i.close)try{i.close()}catch{}p.close();return}if(E&&E.byteLength>0){if(d.add(E.byteLength)){y();return}p.enqueue(E)}}catch(R){if(c)return;if(i.close)try{i.close()}catch{}try{p.error(R)}catch{}}}},cancel(p){c=!0;try{i.readable.cancel(p)}catch{}if(i.close)try{i.close()}catch{}}});return new Response(T,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-store","X-Accel-Buffering":"no"}})}var Qo,Ze,W,ar,rr,ts,Ot,or,sr,ns,Ee,Bt=S(()=>{"use strict";we();ct();We();Dt();Qo=2e3;Ze=[];W=new Map,ar=3e4,rr=100,ts=20,Ot=10*6e4,or=10*1024*1024,sr=30,ns=32*1024*1024,Ee=0});function Je(){return new Response(JSON.stringify({build:Ht,version:hs,ts:Date.now()}),{status:200,headers:{"Content-Type":"application/json","Cache-Control":"no-store","Access-Control-Allow-Origin":"*"}})}var Ht,hs,_e,Ft=S(()=>{"use strict";Ht="df07e58-d3daa12e",hs=__sfx("MC4zMC4w"),_e=__sfx("L19fY2ZwX3ZlcnNpb24=")});function dr(e){return e[__sfx("S1Y=")]?new pe(e[__sfx("S1Y=")]):new Gt}var pe,Gt,Qe=S(()=>{"use strict";pe=class{constructor(t){this.kv=t}kv;async get(t){return await this.kv.get(t)}async put(t,n,o){o&&o>=60?await this.kv.put(t,n,{expirationTtl:o}):await this.kv.put(t,n)}async delete(t){await this.kv.delete(t)}async list(t){let n=[],o;do{let r=await this.kv.list({prefix:t,cursor:o});for(let s of r.keys)n.push(s.name);o=r.list_complete?void 0:r.cursor}while(o);return n}},Gt=class{data=new Map;async get(t){let n=this.data.get(t);return n?n.expiresAt>0&&n.expiresAt<=Date.now()?(this.data.delete(t),null):n.value:null}async put(t,n,o){let r=o?Date.now()+o*1e3:0;this.data.set(t,{value:n,expiresAt:r})}async delete(t){this.data.delete(t)}async list(t){return[...this.data.keys()].filter(n=>n.startsWith(t))}}});function ce(e,t){if(e==null)return t;let n=String(e).trim();if(n==="")return t;let o=Number(n);return Number.isFinite(o)?o:t}function F(e,t){if(e==null||e==="")return t;let n=String(e).trim().toLowerCase();return["1","true","yes","on"].includes(n)?!0:["0","false","no","off"].includes(n)?!1:t}function gs(e){let t=e.trim().toLowerCase();return t==="global"||t==="fallback"||t==="smart"?t:"only"}function mr(e){return e.trim().toLowerCase()==="signed"?"signed":"legacy"}function hr(e){return e.trim().toLowerCase()==="doh"?"doh":"off"}function D(e,t){return e==null?t:String(e)}function ys(e){return{uuid:D(e[__sfx("VVVJRA==")],""),[__sfx("dHJvamFuUGFzc3dvcmQ=")]:D(e[__sfx("VFJPSkFOX1BBU1NXT1JE")],""),wsPath:D(e[__sfx("V1NfUEFUSA==")]||e[__sfx("UEFUSA==")],A.wsPath),[__sfx("dHJvamFuUGF0aA==")]:A[__sfx("dHJvamFuUGF0aA==")],[__sfx("eGh0dHBQYXRo")]:A[__sfx("eGh0dHBQYXRo")],add:D(e[__sfx("QURE")],""),addApi:D(e[__sfx("QUREQVBJ")],""),addCsv:D(e[__sfx("QUREX0NTVg==")],""),poolOfficial:F(e[__sfx("T0ZGSUNJQUxfSVA=")],A.poolOfficial),officialCount:ce(e[__sfx("T0ZGSUNJQUxfSVBfQ09VTlQ=")],A.officialCount),poolDomain:F(e[__sfx("UFJFRkVSUkVEX0RPTUFJTg==")],A.poolDomain),domainCount:ce(e[__sfx("UFJFRkVSUkVEX0RPTUFJTl9DT1VOVA==")],A.domainCount),poolManual:F(e[__sfx("TUFOVUFMX0lQ")],A.poolManual),poolCountries:D(e[__sfx("UE9PTF9DT1VOVFJJRVM=")],A.poolCountries),dls:ce(e[__sfx("RExT")],0),maxLatency:ce(e[__sfx("TUFYX0xBVEVOQ1k=")],0),maxNodes:0,[__sfx("cHJveHlJcA==")]:D(e[__sfx("UFJPWFlJUA==")],""),[__sfx("c29ja3M1")]:D(e[__sfx("U09DS1M1")],""),httpProxy:D(e[__sfx("SFRUUF9QUk9YWQ==")],""),proxyMode:gs(D(e[__sfx("UFJPWFlfTU9ERQ==")],"")),nat64:D(e[__sfx("TkFUNjQ=")],""),concurrentDial:F(e[__sfx("VENQX0NPTkNVUlJFTlRfRElBTA==")],!0),dataBudgetMB:ce(e[__sfx("REFUQV9CVURHRVRfTUI=")],A.dataBudgetMB),resolvePreferred:F(e[__sfx("UkVTT0xWRV9QUkVGRVJSRUQ=")],A.resolvePreferred),aggressiveRedial:F(e[__sfx("QUdHUkVTU0lWRV9SRURJQUw=")],A.aggressiveRedial),relayPool:D(e[__sfx("UkVMQVlfUE9PTA==")],""),useBuiltinRelay:F(e[__sfx("VVNFX0JVSUxUSU5fUkVMQVk=")],A.useBuiltinRelay),[__sfx("ZW5hYmxlVHJvamFu")]:F(e[__sfx("RU5BQkxFX1RST0pBTg==")]??e[__sfx("VFJPSkFO")],A[__sfx("ZW5hYmxlVHJvamFu")]),[__sfx("ZW5hYmxlWGh0dHA=")]:F(e[__sfx("RU5BQkxFX1hIVFRQ")]??e[__sfx("WEhUVFA=")],A[__sfx("ZW5hYmxlWGh0dHA=")]),subDomain:"",subProtocol:"both",subTransport:"both",subVariants:D(e[__sfx("U1VCX1ZBUklBTlRT")],A.subVariants),subName:D(e[__sfx("U1VCX05BTUU=")],A.subName).trim()||A.subName,subPorts:D(e[__sfx("U1VCX1BPUlRT")],A.subPorts),clientFingerprint:A.clientFingerprint,ech:F(e[__sfx("RUNI")],A.ech),echHost:D(e[__sfx("RUNIX0hPU1Q=")],A.echHost),echDns:D(e[__sfx("RUNIX0ROUw==")],A.echDns),tlsFragment:!1,tlsFragmentSize:A.tlsFragmentSize,tlsFragmentDelay:A.tlsFragmentDelay,subToken:mr(D(e[__sfx("U1VCX1RPS0VOX01PREU=")],"")),subTokenTtlDays:ce(e[__sfx("U1VCX1RPS0VOX1RUTF9EQVlT")],A.subTokenTtlDays),unlockProbe:F(e[__sfx("VU5MT0NLX1BST0JF")],A.unlockProbe),udpDns:hr(D(e[__sfx("VURQX0ROUw==")],"")),udpDnsEndpoint:D(e[__sfx("VURQX0ROU19FTkRQT0lOVA==")],A.udpDnsEndpoint)}}function bs(e,t){let n={...e};for(let[o,r]of Object.entries(t))if(r!=null)if(o==="dls"||o==="maxLatency"||o==="maxNodes"||o==="officialCount"||o==="domainCount"||o==="dataBudgetMB"||o==="subTokenTtlDays")n[o]=ce(r,0);else if(o==="concurrentDial"||o==="resolvePreferred"||o==="aggressiveRedial"||o==="useBuiltinRelay"||o===__sfx("ZW5hYmxlVHJvamFu")||o===__sfx("ZW5hYmxlWGh0dHA=")||o==="tlsFragment"||o==="ech"||o==="poolOfficial"||o==="poolDomain"||o==="poolManual"||o==="unlockProbe")n[o]=F(r,!1);else if(o==="subProtocol"){let s=String(r);n[o]=s===__sfx("dmxlc3M=")||s===__sfx("dHJvamFu")||s==="both"?s:"both"}else if(o==="subTransport"){let s=String(r);n[o]=s==="ws"||s===__sfx("eGh0dHA=")||s==="both"?s:"both"}else o==="subToken"?n[o]=mr(String(r)):o==="udpDns"?n[o]=hr(String(r)):n[o]=String(r);return n}async function gr(e,t){let n=ys(t),o=await e.get(pr),r={};if(o)try{r=JSON.parse(o)}catch{r={}}let s=bs(n,r),i=!1,a=e instanceof pe,l=Date.now();o?Ae=0:Ae===0&&(Ae=l);let f=l-Ae>ws;return a&&f&&(s.uuid||(s.uuid=ot(),i=!0),s[__sfx("dHJvamFuUGFzc3dvcmQ=")]||(s[__sfx("dHJvamFuUGFzc3dvcmQ=")]=ot().replace(/-/g,"").slice(0,16),i=!0),Ae=0),o&&(s.officialCount<1||s.domainCount<1)&&(s.officialCount<1&&(s.officialCount=A.officialCount,i=!0),s.domainCount<1&&(s.domainCount=A.domainCount,i=!0)),i&&await xs(e,s),s}async function xs(e,t){await e.put(pr,JSON.stringify(t))}var pr,A,Ae,ws,qe=S(()=>{"use strict";ee();Qe();pr="CONFIG",A={uuid:"",[__sfx("dHJvamFuUGFzc3dvcmQ=")]:"",wsPath:__sfx("L3ZsZXNz"),[__sfx("dHJvamFuUGF0aA==")]:__sfx("L3Ryb2phbg=="),[__sfx("eGh0dHBQYXRo")]:__sfx("L3hodHRw"),add:"",addApi:"",addCsv:"",poolOfficial:!0,officialCount:20,poolDomain:!0,domainCount:10,poolManual:!0,poolCountries:"",dls:0,maxLatency:0,maxNodes:0,[__sfx("cHJveHlJcA==")]:"",[__sfx("c29ja3M1")]:"",httpProxy:"",proxyMode:"only",nat64:"",concurrentDial:!0,dataBudgetMB:0,resolvePreferred:!0,aggressiveRedial:!1,relayPool:"",useBuiltinRelay:!0,[__sfx("ZW5hYmxlVHJvamFu")]:!0,[__sfx("ZW5hYmxlWGh0dHA=")]:!0,subDomain:"",subProtocol:__sfx("dmxlc3M="),subTransport:"ws",subVariants:__sfx("dmxlc3Mtd3M="),subName:__sfx("Q0ZQaWxvdA=="),subPorts:"443",clientFingerprint:"chrome",ech:!1,echHost:__sfx("Y2xvdWRmbGFyZS1lY2guY29t"),echDns:"",tlsFragment:!1,tlsFragmentSize:"10-20",tlsFragmentDelay:"10-20",subToken:"legacy",subTokenTtlDays:0,unlockProbe:!1,udpDns:"off",udpDnsEndpoint:"https://dns.google/dns-query"};Ae=0,ws=9e4});var yr,Ps,Yi,Ss,Vi,br=S(()=>{"use strict";yr={[__sfx("SEs=")]:["HKG"],[__sfx("VFc=")]:["TPE","KHH"],[__sfx("SlA=")]:["NRT","KIX","CTS","FUK"],[__sfx("S1I=")]:["ICN","PUS"],[__sfx("U0c=")]:["SIN"],[__sfx("TVk=")]:["KUL"],[__sfx("VEg=")]:["BKK"],[__sfx("Vk4=")]:["SGN","HAN"],[__sfx("SUQ=")]:["CGK","DPS"],[__sfx("UEg=")]:["MNL"],[__sfx("SU4=")]:["BOM","MAA","DEL"],[__sfx("QVU=")]:["SYD","MEL","BNE","PER"],[__sfx("Tlo=")]:["AKL"],[__sfx("VVM=")]:["LAX","SJC","SEA","ORD","DFW","IAD","EWR","ATL","MIA","DEN","PHX","BOS"],[__sfx("Q0E=")]:["YYZ","YVR","YYC"],[__sfx("R0I=")]:["LHR","MAN"],[__sfx("REU=")]:["FRA","MUC","BER"],[__sfx("RlI=")]:["CDG","MRS"],[__sfx("Tkw=")]:["AMS"],[__sfx("SVQ=")]:["MXP","FCO"],[__sfx("RVM=")]:["MAD","BCN"],[__sfx("U0U=")]:["ARN"],[__sfx("Q0g=")]:["ZRH"],[__sfx("QVQ=")]:["VIE"],[__sfx("UEw=")]:["WAW"],[__sfx("UlU=")]:["DME","SVO"],[__sfx("VFI=")]:["IST"],[__sfx("QUU=")]:["DXB"],[__sfx("SUw=")]:["TLV"],[__sfx("WkE=")]:["JNB"],[__sfx("QlI=")]:["GRU","GIG"],[__sfx("QVI=")]:["EZE"],[__sfx("Q0w=")]:["SCL"],[__sfx("TVg=")]:["MEX"]},Ps=__sfx("SEtH6aaZ5rivLFRQReWPsOWMlyxOUlTkuJzkuqwsS0lY5aSn6ZiqLElDTummluWwlCxTSU7mlrDliqDlnaEsS1VM5ZCJ6ZqG5Z2hLEJLS+abvOiwtyxTR07og6Hlv5fmmI7luIIsTU5M6ams5bC85ouJLFNZROaCieWwvCxNRUzloqjlsJTmnKwsTEFY5rSb5p2J55+2LFNKQ+Wco+S9leWhnixTRUHopb/pm4Xlm74sT1JE6Iqd5Yqg5ZOlLElBROWNjuebm+mhvyxFV1Lnur3nk6blhYssWVla5aSa5Lym5aSaLFlWUua4qeWTpeWNjixMSFLkvKbmlaYsRlJB5rOV5YWw5YWL56aPLENER+W3tOm7jixBTVPpmL/lp4bmlq/nibnkuLksTUFE6ams5b636YeMLEFSTuaWr+W+t+WTpeWwlOaRqSxJU1TkvIrmlq/lnabluIPlsJQsRFhC6L+q5ouc"),Yi=(()=>{let e={};for(let t of Ps.split(","))t.length>3&&(e[t.slice(0,3)]=t.slice(3));return e})(),Ss=new Map;for(let[e,t]of Object.entries(yr))for(let n of t)Ss.set(n,e);Vi=Object.keys(yr)});var _i,wr=S(()=>{"use strict";_i=new Set("GEOSITE GEOIP GEOIP-CIDR DOMAIN DOMAIN-SUFFIX DOMAIN-KEYWORD IP-CIDR IP-CIDR6 SRC-IP-CIDR DST-PORT SRC-PORT PROCESS-NAME MATCH".split(" "))});var fa,xr=S(()=>{"use strict";K();ee();br();wr();fa=".cn,qq.com,tencent.com,weixin.qq.com,baidu.com,bdstatic.com,bilibili.com,hdslb.com,taobao.com,tmall.com,jd.com,aliyun.com,alicdn.com,alipay.com,163.com,126.net,zhihu.com,weibo.com,sina.com.cn,youku.com,iqiyi.com,douyin.com,xiaohongshu.com,mi.com,huawei.com,csdn.net,gitee.com,cnblogs.com".split(",")});var ha,Pr=S(()=>{"use strict";Qe();ee();ha=new TextEncoder});var Ua,Sr=S(()=>{"use strict";qe();ee();Ua=3600*24});function Er(e){return dr(e)}async function Ar(e,t){if(Te.config&&Date.now()-Te.configAt<Es)return Te.config;let n=await gr(e,t);return Te.config=n,Te.configAt=Date.now(),n}var Es,Te,jt=S(()=>{"use strict";Qe();qe();Sr();Es=15e3,Te={config:null,configAt:0,auth:null,authAt:0}});var Rr={};ve(Rr,{clearUnlockCache:()=>Us,runUnlockProbe:()=>Is});function ks(e,t,n){return e===200?"ok":e===404?t==="status"?"region":"unknown":e===403||e===451?"blocked":t==="trace"&&/\bloc=[A-Z]{2}\b/.test(n)?"ok":"unknown"}async function Ds(e){let t=Date.now(),n=new AbortController,o=setTimeout(()=>n.abort(),Rs);try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:n.signal,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",Accept:"text/html,application/xhtml+xml,*/*"}}),s="";e.mode==="trace"&&(s=(await r.text()).slice(0,512));let i=/\bloc=([A-Z]{2})\b/.exec(s)?.[1];return{id:e.id,status:r.status,verdict:ks(r.status,e.mode,s),ms:Date.now()-t,...i?{loc:i}:{}}}catch(r){let s=r instanceof Error?r.message:String(r);return{id:e.id,status:0,verdict:"unknown",ms:Date.now()-t,error:/abort/i.test(s)?"timeout":"fetch-failed"}}finally{clearTimeout(o)}}async function Is(e,t){let n=e||"UNK",o=Date.now(),r=me.get(n);if(r&&o-r.at<Cs)return{...r.data,cached:!0};let s=await Promise.all(Ts.map(a=>Ds(a))),i={colo:n,region:t,cached:!1,at:o,targets:s};if(me.size>=vs){let a="",l=Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")];for(let[f,u]of me)u.at<l&&(l=u.at,a=f);a&&me.delete(a)}return me.set(n,{at:o,data:i}),i}function Us(){me.clear()}var Ts,Rs,Cs,vs,me,Cr=S(()=>{"use strict";Ts=[{id:"netflix",url:"https://www.netflix.com/title/81215567",mode:"status"},{id:"youtube",url:"https://www.youtube.com/premium",mode:"status"},{id:"gemini",url:"https://gemini.google.com/",mode:"status"}],Rs=4e3,Cs=600*1e3,vs=16,me=new Map});ee();var Mr=8*1024*1024,Br=2*1024*1024,nn=600*1e3,Hr=6*1024*1024*1024,st=Date.now(),it=0;function rn(e){e-st>=nn&&(st=e,it=0)}function Fr(e,t=Date.now()){rn(t),it+=e}function tn(e){return rn(e),Hr-it}var Gr=(()=>{let e=new Uint8Array(65536),t=2654435769;for(let n=0;n<e.length;n++)t^=t<<13,t^=t>>>17,t^=t<<5,e[n]=t&255;return e})(),Kr=5e3;function jr(e,t=Kr){let n=!1,o=setTimeout(()=>{if(!n){n=!0;try{e(1e3,"Probe idle timeout")}catch{}}},t),r=o;return typeof r?.unref=="function"&&r.unref(),{cancel:()=>{n||(n=!0,clearTimeout(o))}}}async function at(e){let t=new URL(e.url);if(e.headers.get("Upgrade")?.toLowerCase()===__sfx("d2Vic29ja2V0")){let f=new WebSocketPair,[u,c]=Object.values(f);c.accept();let d=jr((g,y)=>c.close(g,y));return c.addEventListener("message",g=>{let y=typeof g.data=="string"?g.data:"";if(y==="PING"||y==="ping"){d.cancel(),c.send(JSON.stringify({pong:!0,colo:e.cf?.colo??"UNK",clientIp:e.headers.get("CF-Connecting-IP")??""}));try{c.close(1e3,"Probe complete")}catch{}return}d.cancel();try{c.close(1e3,"Probe aborted")}catch{}}),c.addEventListener("close",()=>d.cancel()),c.addEventListener("error",()=>d.cancel()),new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:u})}let o=Number.parseInt(t.searchParams.get("bytes")??"",10),r=Number.isFinite(o)&&o>0?Math.min(o,Mr):Br,s=Date.now();if(tn(s)<=0){let f=Math.max(1e3,st+nn-s);return new Response(JSON.stringify({ok:!1,error:"probe budget exhausted"}),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(f/1e3))}})}let i=Gr,a=0,l=new ReadableStream({pull(f){let u=tn(Date.now());if(a>=r||u<=0){f.close();return}let c=Math.min(i.byteLength,r-a,u);f.enqueue(i.subarray(0,c)),a+=c,Fr(c)}});return new Response(l,{status:200,headers:{"Content-Type":"application/octet-stream","Content-Encoding":"identity","Cache-Control":"no-store","Access-Control-Allow-Origin":"*","X-Probe-Bytes":String(r),"X-Probe-Nonce":De(4)}})}Ut();Bt();Tt();Ft();ee();qe();We();xr();Pr();ee();function Kt(e){let t=e===200?"Welcome":e===404?"Not Found":"Service Unavailable",n=`<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${t}</title><style>body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f7f8fa;color:#333;font-family:-apple-system,"Segoe UI","PingFang SC",sans-serif}.c{text-align:center}h1{font-size:22px;font-weight:600;margin:0 0 10px}p{color:#888;font-size:14px;margin:0}</style></head><body><div class="c"><h1>${t}</h1><p>This site is up and running.</p></div></body></html>`;return new Response(n,{status:e,headers:{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}})}jt();jt();async function Tr(e){let t=Er(e);return await Ar(t,e)}function Wt(e){let t=[];return t.push(...Se(e[__sfx("cHJveHlJcA==")],"direct")),t.push(...Se(e[__sfx("c29ja3M1")],__sfx("c29ja3M1"))),t.push(...Se(e.httpProxy,"http")),t}var zt=6e4,Os=10,Re=0,$e=0;function vr(e){return e>=$e?(Re=0,$e=e+zt,!1):Re>=Os}function kr(e,t){if(!t)return!1;let n=(e.headers.get(__sfx("eC1jZnBpbG90LXRva2Vu"))??"").trim();if(!n)return!1;let o=Date.now();return ge(n,t)?(Re=0,!0):(o>=$e&&($e=o+zt,Re=0),Re+=1,!1)}async function Dr(e,t,n){let o=new URL(e.url);if(o.pathname===__sfx("L19fZWRnZV9wcm9iZQ=="))return at(e);if(o.pathname===_e||o.pathname===__sfx("L19fdmVyc2lvbg=="))return Je();if(o.pathname==="/region"&&e.method==="GET"){let{coloToCountry:i}=await Promise.resolve().then(()=>(Pe(),St)),a=e.cf?.colo??"",l=a?i(a):"";return new Response(JSON.stringify({ok:!0,colo:a,region:l,timestamp:new Date().toISOString()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8"}})}let r=await Tr(t);if(o.pathname===__sfx("L19fZGlhZw==")){if(vr(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(zt/1e3))}});if(!kr(e,r.uuid))return null;let{recentDiagnostics:i,diagnosticCounters:a,recentRoutes:l}=await Promise.resolve().then(()=>(Ut(),nr)),{[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:f}=await Promise.resolve().then(()=>(Bt(),fr));return new Response(JSON.stringify({ok:!0,impl:"self",build:Ht,recent:i(),[__sfx("eGh0dHA=")]:f(),counters:a(),routes:l()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}if(o.pathname==="/__unlock_probe"){if(!r.unlockProbe)return null;if(vr(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}});if(!kr(e,r.uuid))return null;let{coloToCountry:i}=await Promise.resolve().then(()=>(Pe(),St)),{runUnlockProbe:a}=await Promise.resolve().then(()=>(Cr(),Rr)),l=e.cf?.colo??"",f=l?i(l):"",u=await a(l,f);return new Response(JSON.stringify({ok:!0,...u},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}let s=e.headers.get("Upgrade")?.toLowerCase();return o.pathname===r.wsPath?s!==__sfx("d2Vic29ja2V0")?null:await Ve(e,__sfx("dmxlc3M="),r,Wt(r),n):r[__sfx("ZW5hYmxlVHJvamFu")]&&o.pathname===r[__sfx("dHJvamFuUGF0aA==")]?s!==__sfx("d2Vic29ja2V0")?null:await Ve(e,__sfx("dHJvamFu"),r,Wt(r),n):r[__sfx("ZW5hYmxlWGh0dHA=")]&&Lt(o.pathname,r[__sfx("eGh0dHBQYXRo")])?await Mt(e,r,Wt(r)):null}Ft();var Al={async fetch(e,t,n){try{return new URL(e.url).pathname===_e?Je():await Dr(e,t,n)??Kt(200)}catch{return Kt(500)}}};export{Al as default};
|
|
3
|
+
`)[0]??"",y=/^HTTP\/1\.[01]\s+(\d{3})/.exec(g);if(!y)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTpnZ7ms5U="));if(y[1]!=="200")throw new re(__sfx("SFRUUCDku6PnkIYgQ09OTkVDVCDlpLHotKXvvJo=")+y[1]+"");return s.release()}finally{try{i.releaseLock()}catch{}}}var uo,mt,Cn=S(()=>{"use strict";X();we();He();uo=[13,10,13,10];mt=6e3});function gt(e){if(e instanceof le||(e instanceof Error?e.message:String(e)).includes(kn))return!0;let n=e instanceof Error?e.cause:void 0;return n!==void 0&&n!==e&>(n)}function vn(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function Be(e){let t=vn(e);if(t===null)return null;for(let[n,o,r,s]of fo){let i=vn(n);if(i===null)continue;let a=o===0?0:4294967295<<32-o>>>0;if((t&a)===(i&a))return{kind:r,reason:s}}return null}function ht(e){let t=e[6]??0,n=e[7]??0;return`${t>>>8}.${t&255}.${n>>>8}.${n&255}`}function po(e){let t=(e.split("%")[0]??"").toLowerCase();if(!t.includes(":"))return null;let n=ye(t);if(!n)return null;let o=n[0]===0&&n[1]===0&&n[2]===0&&n[3]===0&&n[4]===0;if(o&&n[5]===65535)return Be(ht(n))??null;if(o&&n[5]===0&&n[6]===0&&(n[7]===0||n[7]===1))return n[7]===1?{kind:"loopback",reason:__sfx("546v5Zue5Zyw5Z2A")}:{kind:"unspecified",reason:__sfx("5pyq5oyH5a6a5Zyw5Z2A")};if(o&&n[5]===0)return Be(ht(n))??null;if(n[0]===100&&n[1]===65435&&n[2]===0&&n[3]===0&&n[4]===0&&n[5]===0){let s=Be(ht(n));if(s)return s}let r=n[0]??0;return(r&65024)===64512?{kind:"ula",reason:__sfx("SVB2NiDllK/kuIDmnKzlnLDlnLDlnYA=")}:(r&65472)===65152?{kind:"link-local",reason:__sfx("SVB2NiDpk77ot6/mnKzlnLDlnLDlnYA=")}:(r&65280)===65280?{kind:"multicast",reason:__sfx("SVB2NiDnu4Tmkq3lnLDlnYA=")}:null}function yt(e){let t=e.trim().toLowerCase().replace(/^\[|\]$/g,"");if(t==="")return null;if(t.includes(":"))return po(t);if(/^\d{1,3}(?:\.\d{1,3}){3}$/.test(t))return Be(t);if(t==="localhost"||t.endsWith(".localhost"))return{kind:"loopback",reason:__sfx("546v5Zue5Li75py65ZCN")};for(let n of mo)if(t.endsWith(n))return{kind:"internal-name",reason:__sfx("5YaF572R5Z+f5ZCN5ZCO57yA")};return null}var kn,In,le,fo,mo,bt=S(()=>{"use strict";X();kn=__sfx("55uu5qCH5Zyw5Z2A6KKr562W55Wl5oum5oiq"),In={kind:"ipv6-direct-unsupported",reason:__sfx("55u06L+e5LiO5Y+N5Luj6YCa6YGT5LiN5pSv5oyBIElQdjYg55uu5qCH77yM5Y+v5pS555So6JC95Zyw5Luj55CG6L2s5Y+R")},le=class extends Error{kind;constructor(t,n){super(`${kn}\uFF1A${t}\uFF08${n.reason}\uFF09`),this.name="TargetBlockedError",this.kind=n.kind}};fo=[[__sfx("MC4wLjAuMA=="),8,"unspecified",__sfx("5pyq5oyH5a6a5Zyw5Z2A")],[__sfx("MTAuMC4wLjA="),8,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MTAwLjY0LjAuMA=="),10,"cgnat",__sfx("6L+Q6JCl5ZWG57qnIE5BVCDnvZHmrrU=")],[__sfx("MTI3LjAuMC4w"),8,"loopback",__sfx("546v5Zue5Zyw5Z2A")],[__sfx("MTY5LjI1NC4wLjA="),16,"link-local",__sfx("6ZO+6Lev5pys5ZywIC8g5LqR5YWD5pWw5o2u5Zyw5Z2A")],[__sfx("MTcyLjE2LjAuMA=="),12,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MTkyLjE2OC4wLjA="),16,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MjI0LjAuMC4w"),4,"multicast",__sfx("57uE5pKt5Zyw5Z2A")],[__sfx("MjQwLjAuMC4w"),4,"reserved",__sfx("5L+d55WZ5Zyw5Z2A")]];mo=[".local",".internal"]});function yo(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)?!0:e.includes(":")&&/^[0-9a-fA-F:.]+$/.test(e)}function wt(e,t){let n=e.trim(),o=/^\[([^\]]+)\](?::(\d+))?$/.exec(n);if(o)return{host:o[1],port:Number(o[2]??t)};if(n.includes(":")&&n.split(":").length>2)return{host:n,port:t};let r=n.lastIndexOf(":");if(r<0)return{host:n,port:t};let s=n.slice(0,r),i=Number(n.slice(r+1));return s?{host:s,port:Number.isInteger(i)&&i>0?i:t}:{host:n,port:t}}async function bo(e,t,n,o=Nn){try{let r=`${e}?name=${encodeURIComponent(t)}&type=${n}`,s=await fetch(r,{headers:{accept:"application/dns-json"},signal:AbortSignal.timeout(o)});if(!s.ok)return null;let i=await s.json();if(!i||i.Status!==0&&i.Status!==3)return null;if(!Array.isArray(i.Answer))return[];let a=n==="TXT"?16:n==="A"?1:28;return i.Answer.filter(l=>l.type===a).map(l=>String(l.data))}catch{return null}}async function Dn(e,t,n={}){for(let o of ho){if(n.deadline!==void 0&&Date.now()>=n.deadline)break;let r=n.timeoutMs??Nn,s=n.deadline!==void 0?n.deadline-Date.now():Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")],i=Math.max(50,Math.min(r,s)),a=await bo(o,e,t,i);if(a!==null)return a}return[]}function wo(e,t){let n=[],o=String(e).replace(/^"|"$/g,"").replace(/\\010/g,",").replace(/\\n/g,",").trim();if(!o||o===On)return n;let r=o.split(/[,;\s]+/).filter(Boolean);if(r.length===0)return n;for(let s of r){let i=s.trim();if(!i)continue;let{host:a,port:l}=wt(i,t);if(!H(a)&&!te(a))return[];n.push({hostname:a,port:l})}return n}async function Fe(e,t,n={}){let o=e.trim();if(!o)return[];if(yo(o))return[{hostname:o,port:t}];let r=`${o}:${t}`,s=_.get(r);if(s&&Date.now()-s.at<Un)return _.delete(r),_.set(r,s),s.ips;let i=[],[a,l]=await Promise.all([n.skipTxt?Promise.resolve([]):Dn(o,"TXT",n),Dn(o,"A",n)]);if(!n.skipTxt)for(let c of a){let d=wo(c,t);if(d.length>0){i.push(...d);break}if(String(c).replace(/^"|"$/g,"").replace(/\\010/g,",").trim()===On)break}if(i.length===0)for(let c of l)H(c)&&i.push({hostname:c,port:t});let f=[],u=new Set;for(let c of i){let d=`${c.hostname}:${c.port}`;u.has(d)||(u.add(d),f.push(c))}if(f.length>0){let c=Date.now();for(let[d,g]of _)c-g.at>=Un&&_.delete(d);for(;_.size>=go;){let d=_.keys().next().value;if(d===void 0)break;_.delete(d)}_.set(r,{at:c,ips:f})}return f}var On,ho,Nn,Un,go,_,Ke=S(()=>{"use strict";X();On=__sfx("QGVkZ2V0dW5uZWw="),ho=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve","https://dns.alidns.com/resolve","https://doh.pub/dns-query"],Nn=4e3,Un=300*1e3,go=1e3,_=new Map});var St={};ve(St,{[__sfx("QlVJTFRJTl9SRUxBWV9ET01BSU5T")]:()=>Ln,[__sfx("Q09MT19UT19DT1VOVFJZ")]:()=>Mn,[__sfx("UkVMQVlfQkFUQ0hfU0laRQ==")]:()=>Xe,[__sfx("UkVMQVlfRE9NQUlOX0xJTUlU")]:()=>Pt,clearRelayCache:()=>Eo,collectRelayEndpoints:()=>xe,coloToCountry:()=>xo,relayCacheSize:()=>Ao,resolveRelayEntry:()=>xt,selectRelayDomains:()=>Fn});function xo(e){let t=String(e??"").toUpperCase();return t?Mn[t]??(/^[A-Z]{2}$/.test(t)?t:"US"):"US"}function So(e){for(let[t,n]of J)e-n.at>=Bn&&J.delete(t);for(;J.size>=Po;){let t=J.keys().next().value;if(t===void 0)break;J.delete(t)}}async function xt(e,t=443,n=Hn,o={}){let r=e.trim();if(!r)return[];let s=`${r}:${t}:${n}`,i=J.get(s);if(i&&Date.now()-i.at<Bn)return i.ips;let a=r,l=t,f=(r.match(/:/g)??[]).length;if(f===1){let c=/^(.*):(\d{1,5})$/.exec(r);c&&(a=c[1],l=Number(c[2]))}else if(f>1&&r.startsWith("[")){let c=/^\[([^\]]+)\]:(\d{1,5})$/.exec(r);c&&(a=c[1],l=Number(c[2]))}let u=[];if(H(a)||te(a))u=[{ip:a,port:Number.isInteger(l)&&l>0?l:t,label:r}];else try{u=(await Fe(a,l,{skipTxt:o.skipTxt,deadline:o.deadline,timeoutMs:o.timeoutMs})).slice(0,n).map(d=>({ip:d.hostname,port:d.port,label:`${a} \u2192 ${d.hostname}`}))}catch{u=[]}if(u.length>0){let c=Date.now();So(c),J.set(s,{at:c,ips:u})}return u}function Fn(e=Pt,t=Ln){return t.slice(0,Math.max(0,e))}async function xe(e={}){let t=e.perDomain??Hn,n=[],o=new Set,r=d=>{for(let g of d){let y=`${g.ip}:${g.port}`;o.has(y)||(o.add(y),n.push(g))}},s=(e.userEntries??"").trim(),i=s?s.split(/[\n,;]+/).map(d=>d.trim()).filter(Boolean):[],a=e.domainLimit??Pt,l=e.useBuiltin!==!1?Fn(a):[],f=await Promise.all([...i.map(d=>xt(d,443,t,{deadline:e.deadline,timeoutMs:e.timeoutMs})),...l.map(d=>xt(d,443,t,{skipTxt:!0,deadline:e.deadline,timeoutMs:e.timeoutMs}))]);for(let d=0;d<i.length;d++)r(f[d]);let u=f.slice(i.length),c=u.reduce((d,g)=>Math.max(d,g.length),0);for(let d=0;d<c;d++)for(let g of u)d<g.length&&r([g[d]]);return n}function Eo(){J.clear()}function Ao(){return J.size}var Ln,Mn,Hn,Xe,Pt,Bn,Po,J,Pe=S(()=>{"use strict";X();Ke();Ln=[__sfx("MTkyLjE4LjEzNi4yNTU="),__sfx("MTI4LjEyMS4zMS4yNTI="),__sfx("MTI5LjE1OS4zNy4xMzY="),__sfx("MjMuMTQ0LjEyLjYz"),__sfx("MjE2LjM2Ljg2LjYy"),__sfx("NDUuMTMzLjExNy4xODU="),__sfx("MzguODQuMjAxLjIyOA=="),__sfx("MTA5LjEyMC4xNDIuMjE5"),__sfx("NDUuMTQwLjE2Ny40Mw=="),__sfx("NS4yNTMuMTg4LjEzOQ=="),__sfx("MjE2LjM2LjgyLjMx"),__sfx("MTY3LjI1My45Ni45MA=="),__sfx("MTk0Ljg3LjYyLjEzOQ=="),__sfx("MjMuMTQ0LjIwLjE4NA=="),__sfx("MTI4LjEyMS4zMS41OA=="),__sfx("MTA0LjIzOC4xNTQuNzc="),__sfx("MzguMjQ0LjE1MC4xMTM="),__sfx("MTU1LjI0OC4xODEuMTg5"),__sfx("MjE2LjM2LjgyLjE0MQ=="),__sfx("NjQuMTgxLjI1NS4yMTU="),__sfx("MzEuMjUuMjM5LjY2"),__sfx("NDUuNzYuMjQ2LjE5Mg=="),__sfx("MjMuOTUuMTEzLjYx"),__sfx("MTUxLjI0NC4yMDEuMjA3")],Mn={[__sfx("SEtH")]:"HK",[__sfx("U1lE")]:"AU",[__sfx("TUVM")]:"AU",[__sfx("Qk5F")]:"AU",[__sfx("UEVS")]:"AU",[__sfx("QURM")]:"AU",[__sfx("Q0JS")]:"AU",[__sfx("U0lO")]:"SG",[__sfx("TlJU")]:"JP",[__sfx("SE5E")]:"JP",[__sfx("S0lY")]:"JP",[__sfx("VFlP")]:"JP",[__sfx("T1NB")]:"JP",[__sfx("TkdP")]:"JP",[__sfx("Q1RT")]:"JP",[__sfx("RlVL")]:"JP",[__sfx("T0tB")]:"JP",[__sfx("SUNO")]:"KR",[__sfx("U0VM")]:"KR",[__sfx("UFVT")]:"KR",[__sfx("RlJB")]:"DE",[__sfx("TVVD")]:"DE",[__sfx("RFVT")]:"DE",[__sfx("QkVS")]:"DE",[__sfx("SEFN")]:"DE",[__sfx("U1RS")]:"DE",[__sfx("VklF")]:"DE",[__sfx("WlJI")]:"DE",[__sfx("Q0RH")]:"FR",[__sfx("TUFE")]:"ES",[__sfx("TVhQ")]:"IT",[__sfx("RkNP")]:"IT",[__sfx("UFJH")]:"CZ",[__sfx("V0FX")]:"PL",[__sfx("QVJO")]:"SE",[__sfx("QU1T")]:"NL",[__sfx("SEVM")]:"FI",[__sfx("TEhS")]:"GB",[__sfx("TEdX")]:"GB",[__sfx("TUFO")]:"GB",[__sfx("RURJ")]:"GB",[__sfx("TEFY")]:"US",[__sfx("U0pD")]:"US",[__sfx("U0ZP")]:"US",[__sfx("U0VB")]:"US",[__sfx("UERY")]:"US",[__sfx("U0FO")]:"US",[__sfx("TEFT")]:"US",[__sfx("UEhY")]:"US",[__sfx("U0xD")]:"US",[__sfx("REVO")]:"US",[__sfx("REZX")]:"US",[__sfx("SUFI")]:"US",[__sfx("QVVT")]:"US",[__sfx("T1JE")]:"US",[__sfx("TVNQ")]:"US",[__sfx("RFRX")]:"US",[__sfx("U1RM")]:"US",[__sfx("TUNJ")]:"US",[__sfx("QVRM")]:"US",[__sfx("TUlB")]:"US",[__sfx("TUNP")]:"US",[__sfx("Qk5B")]:"US",[__sfx("Q0xU")]:"US",[__sfx("SUFE")]:"US",[__sfx("Qk9T")]:"US",[__sfx("RVdS")]:"US",[__sfx("SkZL")]:"US",[__sfx("UEhM")]:"US",[__sfx("WVla")]:"CA",[__sfx("WVZS")]:"CA",[__sfx("WVVM")]:"CA",[__sfx("TUVY")]:"MX",[__sfx("R1JV")]:"BR",[__sfx("VFBF")]:"TW",[__sfx("S0hI")]:"TW",[__sfx("VFNB")]:"TW",[__sfx("Uk1R")]:"TW"};Hn=4,Xe=6,Pt=6,Bn=30*1e3,Po=256,J=new Map});function Et(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function Kn(e){return e.map(([t,n])=>{let o=Et(t)??0,r=n===0?0:4294967295<<32-n>>>0;return[(o&r)>>>0,r]})}function Xn(e){let t=Et(e);if(t===null)return!1;for(let[n,o]of Io)if((t&o)>>>0===n)return!0;return!1}function se(e){let t=Et(e);if(t===null)return!1;for(let[n,o]of ko)if((t&o)>>>0===n)return!0;return!1}function Gn(e){let t=[],n=new Set,o=u=>{let c=`${u.source}|${u.host}|${u.port}`;n.has(c)||(n.add(c),t.push(u))};for(let u of e.proxies??[])u.kind==="direct"?o({source:"proxy",host:u.host,port:u.port,label:__sfx("UHJveHlJUCA=")+u.host+":"+u.port+"",via:{kind:"direct",host:u.host,port:u.port}}):o({source:"proxy",host:u.host,port:u.port,label:`${u.kind.toUpperCase()} ${u.host}:${u.port}`,via:{kind:u.kind,host:u.host,port:u.port,username:u.username,password:u.password,serverName:u.serverName}});let s=se(e.targetHost)||e.deprioritizeDirect===!0;o({source:"direct",host:e.targetHost,port:e.targetPort,label:__sfx("55u06L+eIA==")+e.targetHost+":"+e.targetPort+"",deprioritized:s});let i=e.optimizedIps??[],a=i.filter(u=>!se(u.ip)),l=i.filter(u=>se(u.ip));for(let u of a)o({source:"optimized",host:u.ip,port:u.port,label:__sfx("5LyY6YCJIA==")+u.ip+":"+u.port+""});for(let u of l)o({source:"optimized",host:u.ip,port:u.port,label:__sfx("5LyY6YCJIA==")+u.ip+":"+u.port+__sfx("77yIQ2xvdWRmbGFyZSDnvZHmrrXvvIzlj6/og73kuI3lj6/ovr7vvIk="),deprioritized:!0});let f=e.relay??[];for(let u of f)o({source:"relay",host:u.ip,port:u.port,label:__sfx("5Y+N5LujIA==")+u.label+"",deprioritized:!0});return t.map((u,c)=>({candidate:u,index:c})).sort((u,c)=>{let d=+!!u.candidate.deprioritized-+!!c.candidate.deprioritized;return d!==0?d:u.index-c.index}).map(u=>u.candidate)}function Wn(e){let t=e.filter(o=>!o.deprioritized),n=t.filter(o=>o.source==="proxy");return{landing:n.filter(o=>o.via?.kind!=="direct"),[__sfx("cHJveHlJcA==")]:n.filter(o=>o.via?.kind==="direct"),direct:t.filter(o=>o.source!=="proxy"),fallback:e.filter(o=>o.deprioritized)}}function Vn(e,t){let n=e instanceof Error?e.message:String(e);return gt(e)?{kind:"policy",message:n,candidate:t}:/proxy request failed|cannot connect to the specified address|TCP Loop/i.test(n)?{kind:"blocked",message:n,candidate:t}:/timeout|超时|timed out|abort/i.test(n)?{kind:"timeout",message:n,candidate:t}:{kind:"other",message:n,candidate:t}}function zn(e){switch(e.kind){case"blocked":return __sfx("5Ye656uZ6KKrIENsb3VkZmxhcmUg5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg5bi46KeB5Y6f5Zug77ya55uu5qCH5Zyw5Z2A5ZyoIENsb3VkZmxhcmUg6Ieq5a62572R5q6177yIV29ya2VyIOS4jeiDveS4u+WKqOi/nuWbniBDRiDoh6rlt7HnmoTlhaXlj6PvvInjgIIKICDihpIg5o2i5LiA5Liq56ys5LiJ5pa5IElQ77yM5oiW5pS555So5Luj55CG6JC95Zyw44CC");case"policy":return __sfx("5Ye656uZ6KKr562W55Wl5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg55uu5qCH5bGe5LqO546v5ZueIC8g5YaF572RIC8g6ZO+6Lev5pys5ZywIC8g5L+d55WZ5Zyw5Z2A77yMV29ya2VyIOebtOi/nuaXoOazleWIsOi+vuOAggogIOKGkiDopoHorr/pl67lsYDln5/nvZHorr7lpIfvvIzor7fphY3nva7okL3lnLDku6PnkIbvvIjnlLHku6PnkIbkvqflu7rov57vvInjgII=");case"timeout":return __sfx("5Ye656uZ6LaF5pe277yI")+e.candidate+"):"+e.message+__sfx("CiAg4oaSIOivpeWcsOWdgOW9k+WJjeS4jeWPr+i+vu+8jOWPr+aNouS4gOadoeWAmemAieaIluWQr+eUqOS7o+eQhuiQveWcsOOAgg==");default:return __sfx("5Ye656uZ5aSx6LSl77yI")+e.candidate+"):"+e.message+""}}var To,Ro,Co,vo,ko,Io,At=S(()=>{"use strict";bt();To=[[__sfx("MTAzLjIxLjI0NC4w"),22],[__sfx("MTAzLjIyLjIwMC4w"),22],[__sfx("MTAzLjMxLjQuMA=="),22],[__sfx("MTA0LjE2LjAuMA=="),13],[__sfx("MTA0LjI0LjAuMA=="),14],[__sfx("MTA4LjE2Mi4xOTIuMA=="),18],[__sfx("MTMxLjAuNzIuMA=="),22],[__sfx("MTQxLjEwMS42NC4w"),18],[__sfx("MTYyLjE1OC4wLjA="),15],[__sfx("MTcyLjY0LjAuMA=="),13],[__sfx("MTczLjI0NS40OC4w"),20],[__sfx("MTg4LjExNC45Ni4w"),20],[__sfx("MTkwLjkzLjI0MC4w"),20],[__sfx("MTk3LjIzNC4yNDAuMA=="),22],[__sfx("MTk4LjQxLjEyOC4w"),17]],Ro=[[__sfx("MTA0LjMxLjAuMA=="),15],[__sfx("MTkyLjAuMC4w"),24],[__sfx("MTkyLjAuMi4w"),24],[__sfx("MTkyLjg4Ljk5LjA="),24],[__sfx("MTk5LjI3LjEyOC4w"),21],[__sfx("MS4wLjAuMA=="),24],[__sfx("MS4xLjEuMA=="),24]],Co=[[__sfx("MjIzLjUuNS4w"),24]],vo=[...To,...Ro];ko=Kn(vo),Io=Kn(Co)});function Yn(e,t="direct"){let n=e.trim();if(!n)return null;let o=t,r=n,s=/^([a-z0-9+.-]+):\/\//i.exec(n);if(s){let d=s[1].toLowerCase();r=n.slice(s[0].length),d===__sfx("c29ja3M1")||d===__sfx("c29ja3M=")||d===__sfx("c29ja3M1aA==")?o=__sfx("c29ja3M1"):d==="https"?o="https":d==="http"&&(o="http")}let i=r.lastIndexOf("@"),a={};if(i>=0){let d=r.slice(0,i);r=r.slice(i+1);let g=d.indexOf(":");g>=0?a={username:d.slice(0,g),password:d.slice(g+1)}:a={username:d}}let l,f=/#sni=([^/#]+)/i.exec(r);f&&(l=f[1].trim(),r=r.slice(0,f.index)+r.slice(f.index+f[0].length));let{host:u,port:c}=wt(r,0);return!u||!Number.isInteger(c)||c<=0||c>65535?null:(!l&&o==="https"&&!Uo(u)&&(l=u),{host:u,port:c,kind:o,...a,...l?{serverName:l}:{}})}function Uo(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)}function Se(e,t="direct"){let n=[];for(let o of e.split(/[\n,;]+/)){let r=o.trim();if(!r)continue;let s=Yn(r,t);s&&n.push(s)}return n}var Tt=S(()=>{"use strict";Ke()});async function Do(){return Rt||(Rt=(async()=>(await import("cloudflare:sockets")).connect)()),await Rt}function No(e,t){if(!H(e))return null;let n=e.split(".").map(i=>Number(i)),o=(n[0]<<8|n[1]).toString(16),r=(n[2]<<8|n[3]).toString(16);return`${t.replace(/:+$/,"")}::${o}:${r}`}async function Ge(e,t,n,o,r){let i=(await Do())({hostname:e,port:t},o?{secureTransport:o}:void 0),a=async(f,u)=>{let c,d=new Promise((g,y)=>{c=setTimeout(()=>y(new Error(""+u+__sfx("6LaF5pe277ya")+e+":"+t+"")),n)});try{return await Promise.race([f,d])}finally{c&&clearTimeout(c)}},l;try{if(await a(i.opened,__sfx("6L+e5o6l")),o==="starttls"){if(l=i.startTls?.(r?{expectedServerHostname:r}:void 0),!l)throw new Error(__sfx("5b2T5YmN6L+Q6KGM5pe25LiN5pSv5oyBIHN0YXJ0VGxz"));return await a(l.opened,__sfx("VExTIOaPoeaJiw==")),l}return i}catch(f){try{await(l??i).close()}catch{}throw f}}async function Lo(e){let t=e.timeoutMs??kt;try{let n=await Ge(e.hostname,e.port,t);return{readable:n.readable,writable:n.writable,via:"direct",endpoint:`${e.hostname}:${e.port}`,close:()=>{try{n.close()}catch{}}}}catch(n){if(e.nat64&&H(e.hostname)){let o=No(e.hostname,e.nat64);if(o){let r=await Ge(o,e.port,t);return{readable:r.readable,writable:r.writable,via:"nat64",endpoint:`${o}:${e.port}`,close:()=>{try{r.close()}catch{}}}}}throw n}}function Mo(e){return e.includes(":")}function Ho(e){return e.source==="proxy"&&e.via!==void 0&&e.via.kind!=="direct"}async function Bo(e,t){let n=e.timeoutMs??kt;if(t.kind==="direct"){let s=await Ge(t.host,t.port,n);return{readable:s.readable,writable:s.writable,via:"direct",endpoint:`${t.host}:${t.port}`,close:()=>{try{s.close()}catch{}}}}let o=t.kind==="https"?"starttls":void 0,r=await Ge(t.host,t.port,n,o,t.kind==="https"?t.serverName:void 0);try{return t.kind==="http"||t.kind==="https"?{readable:await Rn(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:t.kind,endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}:{readable:await An(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:__sfx("c29ja3M1"),endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}}catch(s){try{await r.close()}catch{}throw s}}function Zn(e){return e instanceof Error?e.message:typeof e=="string"?e:String(e)}function Ko(e){if(e.length===0)return __sfx("5pyq55+l5Y6f5Zug");let t=e.map(Zn),n=t.slice(-Fo),o=t.length-n.length;return`${o>0?`\uFF08\u5171 ${t.length} \u6761\uFF0C\u7701\u7565\u524D ${o} \u6761\uFF09`:""}${n.join("\uFF1B")}`}function Xo(e){return e.length===0?Promise.reject(new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"))):new Promise((t,n)=>{let o=e.length,r=!1,s=[];for(let i of e)i().then(a=>{if(r){try{let l=a.close;Promise.resolve(l?l():a.writable.close()).catch(()=>{})}catch{}return}r=!0,t(a)},a=>{s.push(a),o-=1,o===0&&!r&&(r=!0,n(new Error(__sfx("5pys5om5IA==")+e.length+__sfx("IOS4quWAmemAieWFqOmDqOWksei0pe+8mg==")+Ko(s)+"")))})})}async function vt(e,t){if(e.length===0)throw new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"));if(!t||e.length<=1){let s=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let i of e)try{return await i()}catch(a){s=a}throw s}let n=[],o=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let s=0;s<e.length;s+=Ct){let i=e.slice(s,s+Ct);try{return await Xo(i)}catch(a){o=a,n.push(Zn(a))}}throw new Error(__sfx("5YWo6YOoIA==")+e.length+__sfx("IOS4quWAmemAieWdh+Wksei0pe+8iOWIhiA=")+n.length+__sfx("IOaJue+8jOavj+aJueacgOWkmiA=")+Ct+__sfx("IOS4quW5tuWPke+8ie+8mgo=")+n.join(`
|
|
4
|
+
`),{cause:o})}async function jn(e,t){let n=[...e];if(!t)return n;try{let o=await xe(t),r=new Set(n.map(s=>`${s.ip}:${s.port}`));for(let s of o){let i=`${s.ip}:${s.port}`;r.has(i)||(r.add(i),n.push(s))}}catch{}return n}async function Go(e,t,n){if(e.length===0)return null;for(let o=0;o<e.length;o+=Xe){let s=e.slice(o,o+Xe).map(i=>t({source:"relay",host:i.ip,port:i.port,label:__sfx("5Y+N5LujIA==")+i.label+""}));try{return await vt(s,n)}catch{}}return null}async function fe(e){let t=e.proxies??[],n=e.concurrent??!0;if(!e.skipTargetPolicy&&t.length===0){let h=yt(e.hostname);if(h)throw new le(e.hostname,h)}let o=e.budgetMs??Oo,r=Date.now()+o,s=[...e.optimizedIps??[]],i=!1;if(e.resolvePreferred)try{let h=await Fe(e.hostname,e.port,{deadline:r});if(h.length>0){i=!0;for(let w of h)s.push({ip:w.hostname,port:w.port})}}catch{}let a=se(e.hostname),l=i&&s.length>0&&s.every(h=>se(h.ip)),f=[...e.relay??[]];(l||a)&&e.relayPool&&(f=await jn(f,{...e.relayPool,deadline:r}));let c=f,d=Gn({targetHost:e.hostname,targetPort:e.port,optimizedIps:s,proxies:t,deprioritizeDirect:a,relay:[]});if(d.length===0)throw new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"));let g=h=>async()=>{let w=r-Date.now();if(w<=0)throw new Error(__sfx("5ouo5Y+36aKE566X5bey55So5bC977yI")+o+"ms):"+e.hostname+":"+e.port+"");let v=Math.max(200,Math.min(e.timeoutMs??kt,w)),j={...e,timeoutMs:v};try{if(!Ho(h)&&Mo(e.hostname))throw new le(e.hostname,In);if(!e.skipTargetPolicy&&h.source!=="proxy"&&h.source!=="relay"){let O=yt(h.host);if(O)throw new le(h.host,O)}if(h.source==="proxy"&&h.via)try{let O=await Bo(j,{host:h.via.host,port:h.via.port,kind:h.via.kind,username:h.via.username,password:h.via.password,serverName:h.via.serverName});return En(h.via),O}catch(O){throw O instanceof re||Sn(h.via,Date.now()),O}return await Lo({...j,hostname:h.host,port:h.port})}catch(O){let Z=Vn(O,h.label);throw e.onFailure?.(Z),O}},y=Wn(d),{landing:x,[__sfx("cHJveHlJcA==")]:T,direct:p,fallback:R}=y,E=x.length>0||T.length>0,k=async()=>{if(x.length===0)throw new Error(__sfx("5pyq6YWN572u6JC95Zyw5Luj55CG"));let h,w=pt(x,v=>v.via,Date.now());for(let v of w)try{return await g(v)()}catch(j){h=j}throw h??new Error(__sfx("6JC95Zyw5Luj55CG5YWo6YOo5aSx6LSl"))},K=async()=>{if(T.length===0)throw new Error(__sfx("5pyq6YWN572uIFByb3h5SVA="));let h=Date.now(),w=pt(T,v=>v.via,h);return await vt(w.map(g),!0)},q=async()=>{let h;if(x.length>0)try{return await k()}catch(w){h=w}if(T.length>0)try{return await K()}catch(w){h=w}throw h??new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Luj55CG"))},N=async()=>await vt(p.map(g),n),Y=async()=>{let h=c;return h.length===0&&e.relayPool&&(h=await jn([],{...e.relayPool,deadline:r})),await Go(h,g,n)},$=async()=>{for(let h of R)try{return await g(h)()}catch{}return null};if(!E)try{return await N()}catch(h){let w=await Y();if(w)return w;let v=await $();if(v)return v;throw h}let ie=e.proxyMode??"only",U=a||l;if(ie==="only")try{return await q()}catch(h){let w=await Y();if(w)return w;let v=await $();if(v)return v;throw h}if(ie==="global"||ie==="smart"&&U)try{return await q()}catch(h){if(ie==="global")try{return await N()}catch{}let w=await Y();if(w)return w;let v=await $();if(v)return v;throw h}try{return await N()}catch(h){try{return await q()}catch{}let w=await Y();if(w)return w;let v=await $();if(v)return v;throw h}}var Rt,kt,Oo,Ct,Fo,It=S(()=>{"use strict";Tn();Cn();bt();He();X();Ke();Pe();At();Tt();Rt=null;kt=8e3,Oo=15e3;Ct=6,Fo=8});async function _n(e,t,n,o=!0,r,s){let i=e.getReader(),a=t.getWriter();try{for(;!n?.exhausted;){let l;try{l=await i.read()}catch(u){s?.(u,"read");break}if(l.done)break;let f=l.value;if(!(!f||f.byteLength===0)){if(r?.(f.byteLength))break;try{await a.write(f)}catch(u){s?.(u,"write");break}}}}finally{if(o)try{await a.close()}catch{}else try{a.releaseLock()}catch{}try{i.releaseLock()}catch{}}}var ue,We=S(()=>{"use strict";ue=class{constructor(t){this.limitBytes=t}limitBytes;total=0;get enabled(){return this.limitBytes>0}get bytes(){return this.total}add(t){return this.limitBytes<=0||t<=0?!1:(this.total+=t,this.total>this.limitBytes)}}});var nr={};ve(nr,{diagnosticCounters:()=>zo,[__sfx("aGFuZGxlV2ViU29ja2V0")]:()=>je,recentDiagnostics:()=>jo,recentRoutes:()=>Yo,recordDiagnostics:()=>Q,truncateCloseReason:()=>tr});function tr(e,t=123){let n=new TextEncoder;if(n.encode(e).length<=t)return e;let o=e.slice(0,t);for(;n.encode(o).length>t;)o=o.slice(0,-1);o=o.replace(/\uFFFD+$/,"");let r="\u2026";for(;o.length>0&&n.encode(o+r).length>t;)o=o.slice(0,-1);return o+r}function zo(){return{...de}}function Yo(){return Ye}function er(e,t,n){Ye.unshift({at:Date.now(),target:e,via:t.via,endpoint:t.endpoint,cfTarget:se(e.split(":")[0]??""),publicDns:Xn(e.split(":")[0]??""),phase:n}),Ye.length>20&&(Ye.length=20)}function Q(e,t,n){ze.unshift({at:Date.now(),target:e,failures:t,summary:n}),ze.length>$n&&(ze.length=$n)}function jo(){return ze}function Jo(e){if(!e)return new Uint8Array(0);let t=e.trim();if(!t||t.length>16384)return new Uint8Array(0);try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),o=n.length%4===0?"":"=".repeat(4-n.length%4),r=atob(n+o);if(r.length<17||r.length>8192)return new Uint8Array(0);let s=new Uint8Array(r.length);for(let i=0;i<r.length;i++)s[i]=r.charCodeAt(i);return s}catch{return new Uint8Array(0)}}async function je(e,t,n,o,r,s){let[i,a]=Object.values(new WebSocketPair);try{a.accept({allowHalfOpen:!0})}catch{a.accept()}a.binaryType="arraybuffer";let l=Jo(e.headers.get(__sfx("c2VjLXdlYnNvY2tldC1wcm90b2NvbA=="))),f=[],u=0,c=!1,d=null,g=null,y=new Le,x=null,T=null,p=()=>{T&&(clearTimeout(T),T=null)},R=!1,E=new Ne,k=null,K=!1,q=!1,N=null,Y=null,$=m=>{try{a.send(m)}catch{}},ie=m=>{let b=new Uint8Array(2+m.byteLength);b[0]=0,b[1]=m.byteLength,b.set(m,2),$(b)},U=(m,b)=>{K=!0;try{a.close(m,tr(b))}catch{}h()},h=()=>{if(!q){if(q=!0,zt(),f=[],u=0,p(),x&&(clearTimeout(x),x=null),w&&(clearTimeout(w),w=null),k){let m=k;k=null;try{m.cancel()}catch{}}if(d){let m=d.close;if(m)try{m()}catch{}else try{d.writable.close()}catch{}}}},w=null,v=new Set,j=0,O=[],Z=0,et=m=>{if(!(m.byteLength===0||ae>0)){if(Z+m.byteLength>qn){U(1009,__sfx("5pyq56Gu6K6k6YCa6Lev55qE5LiK6KGM5pWw5o2u6L+H5aSa"));return}if(Ve+m.byteLength>Vo){U(1009,__sfx("5a6e5L6L5YaF5a2Y6aKE566X5bey5ruh77yM6K+36YeN6K+V"));return}O.push(m),Z+=m.byteLength,Ve+=m.byteLength}},zt=()=>{Ve=Math.max(0,Ve-Z),O=[],Z=0},tt=0,Ur=()=>{tt+=1},Yt=async()=>{if(!d)return;let m=++tt,b=d.readable.getReader();k=b,w&&clearTimeout(w);let P=setTimeout(()=>{w===P&&(w=null),!(ae>0)&&Z!==0&&Qt("stall")},Qn);w=P;try{for(;;){let{done:B,value:M}=await b.read();if(B)break;if(M&&M.byteLength>0){let D=ae===0;if(ae+=M.byteLength,D&&zt(),jt.add(M.byteLength)){Zt();return}let C=E.yieldCount;await E.onChunk(M.byteLength),E.yieldCount>C&&de.downlinkYields++,$(M)}}}catch{}finally{try{b.releaseLock()}catch{}if(clearTimeout(P),w===P&&(w=null),k===b&&(k=null),m!==tt||K)return;if(ae===0&&Z>0&&j<Ut&&!R){Qt("eof");return}let B=d;U(1e3,B?`done via=${B.via} ep=${B.endpoint} dl=${ae} ret=${Z} rd=${j}`:"done")}},ae=0,jt=new ue((n.dataBudgetMB||0)*1024*1024),Zt=()=>{let m=__sfx("5Y2V6L+e5o6l5rWB6YeP6LaF6L+HIA==")+n.dataBudgetMB+__sfx("TUIg5LiK6ZmQ");Q(N?`${N.hostname}:${N.port}`:__sfx("5pyq5bu656uL5Ye656uZ"),[],m),U(1009,m)},Dr=async m=>{let b=g;if(b)try{await y.write(()=>g===b?b:null,m)}catch(P){Q(N?`${N.hostname}:${N.port}`:__sfx("5pyq5bu656uL5Ye656uZ"),[],__sfx("5LiK6KGM5YaZ5YWl5aSx6LSl77ya")+String(P)+""),h()}},_t=async m=>{if(f.length===0)return;let b=f;f=[],u=0;for(let P of b)et(P),await m.write(P)},Jt=m=>{if(t===__sfx("dmxlc3M=")){let P=Ue(m,n.uuid);return P?{command:P.header.command,port:P.header.port,hostname:P.header.hostname,headerLength:P.consumed}:null}let b=mn(m,n[__sfx("dHJvamFuUGFzc3dvcmQ=")]);return b?{command:b.header.command,port:b.header.port,hostname:b.header.hostname,headerLength:b.consumed}:null},Or=()=>{x&&(clearTimeout(x),x=null)},Nr=async()=>{if(!(K||c)){if(Jt(l)){await nt();return}U(1008,l.byteLength===0?__sfx("5o+h5omL6LaF5pe277ya5pyq5pS25Yiw5Y2P6K6u5aS0"):__sfx("5o+h5omL6LaF5pe277ya5Y2P6K6u5aS05LiN5a6M5pW05oiW6K6k6K+B5aSx6LSl"))}},nt=async()=>{if(K||c)return;let m=Jt(l);if(!m){l.byteLength>0&&!x&&(x=setTimeout(()=>{x=null,Nr().catch(C=>U(1011,String(C)))},Zo));return}if(Or(),p(),c)return;c=!0,N=m;let b=t===__sfx("dmxlc3M=")?sn:pn;if(m.command===b){if(t===__sfx("dmxlc3M=")&&n.udpDns==="doh"&&m.port===53){ie(new Uint8Array(0)),Y=new Oe({endpoint:n.udpDnsEndpoint,send:$});let C=l.subarray(m.headerLength);C.byteLength>0&&Y.push(C);return}U(1002,n.udpDns==="doh"?__sfx("VURQIOS7heaUr+aMgSBETlPvvIg1MyDnq6/lj6PvvIk="):__sfx("VURQIOacquWQr+eUqO+8iOmdouadv+WPr+W8gOWQryBETlMgb3ZlciBEb0jvvIk="));return}t===__sfx("dmxlc3M=")&&ie(new Uint8Array(0));let P=[],B=null;try{d=await fe({hostname:m.hostname,port:m.port,proxies:o,timeoutMs:Jn,concurrent:n.concurrentDial,nat64:n.nat64||void 0,proxyMode:n.proxyMode,resolvePreferred:n.resolvePreferred,relayPool:{userEntries:n.relayPool||void 0,useBuiltin:n.useBuiltinRelay},onFailure:C=>{P.push(C),s?.failures.push(C)}})}catch(C){B=C}if(!d){let C=P.length>0?P.map(he=>zn(he)).join(`
|
|
5
|
+
`):__sfx("5Ye656uZ6L+e5o6l5aSx6LSl77ya")+String(B)+"";Q(`${m.hostname}:${m.port}`,P,C),U(1011,C);return}let M=d.writable.getWriter();g=M,er(`${m.hostname}:${m.port}`,d,"initial");let D=l.byteLength>m.headerLength?l.subarray(m.headerLength):new Uint8Array(0);l=new Uint8Array(0);try{await y.run(async()=>{D.byteLength>0&&(et(D),await M.write(D)),await _t(M)})}catch(C){Q(`${m.hostname}:${m.port}`,[],__sfx("5LiK6KGM6aaW5YyF5YaZ5YWl5aSx6LSl77ya")+String(C)+""),h()}r?.waitUntil(Yt())},Qt=async m=>{if(K||R)return;let b=N;if(!b){U(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55uu5qCH5pyq6Kej5p6Q"));return}if(j>=Ut){U(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55u06L+e5LiO5Y+N5Luj5YWl5Y+j5Z2H5peg5ZON5bqU"));return}R=!0;let P=bn({via:d?.via,port:b.port,userProxyConfigured:o.length>0||!!n[__sfx("cHJveHlJcA==")],aggressive:n.aggressiveRedial===!0});if(!P.allowed){de.guardedRedials++,Q(`${b.hostname}:${b.port}`,[],__sfx("5Ye656uZ5peg5pWw5o2u77ya")+P.reason+__sfx("77yb5pyq5YiH5o2i5Y+N5Luj77yI5Y+v5byA5ZCvIGFnZ3Jlc3NpdmVSZWRpYWzvvIk=")),U(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya")+P.reason+"");return}j++,m==="stall"?de.stallRedials++:de.eofRedials++,Q(`${b.hostname}:${b.port}`,[],m==="stall"?__sfx("55u06L+eIA==")+Qn+__sfx("bXMg5peg5LiL6KGM5pWw5o2u77yM5pS56LWw5Y+N5Luj5YWl5Y+j"):__sfx("5Ye656uZ6Zu25LiL6KGM5Y2zIEVPRi9SZXNldO+8jOeri+WNs+aUuei1sOWPjeS7o+WFpeWPow=="));let B=[];try{B=await xe({userEntries:n.relayPool||void 0,useBuiltin:n.useBuiltinRelay})}catch{B=[]}let M=B.filter(D=>!v.has(`${D.ip}:${D.port}`));if(M.length===0){U(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5peg5Y+N5Luj5YWl5Y+j5Y+v55So"));return}for(let D of M.slice(0,Ut)){if(v.add(`${D.ip}:${D.port}`),Ur(),d){let C=d;if(C.close)try{C.close()}catch{}}g=null,ae=0;try{let C=await fe({hostname:D.ip,port:D.port,timeoutMs:Jn,resolvePreferred:!1,skipTargetPolicy:!0,proxies:n.aggressiveRedial?o:void 0,proxyMode:n.aggressiveRedial?n.proxyMode:void 0});if(!C)continue;d=C,er(`${b.hostname}:${b.port}`,C,"redial");let he=C.writable.getWriter();g=he;let $t=0;for(let Ce of O)$t+=Ce.byteLength;let rt=new Uint8Array($t),en=0;for(let Ce of O)rt.set(Ce,en),en+=Ce.byteLength;await y.run(async()=>{rt.byteLength>0&&await he.write(rt),await _t(he)}),Q(`${b.hostname}:${b.port}`,[],__sfx("5bey5YiH5o2i5Y+N5Luj5YWl5Y+jIA==")+D.ip+":"+D.port+""),r?.waitUntil(Yt());return}catch(C){Q(`${b.hostname}:${b.port}`,[],__sfx("5Y+N5Luj5YWl5Y+jIA==")+D.ip+":"+D.port+__sfx("IOWksei0pe+8mg==")+String(C)+"")}}U(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5omA5pyJ5Y+N5Luj5YWl5Y+j5Z2H5aSx6LSl"))};a.addEventListener("message",m=>{(async()=>{let b=m.data,P=typeof b=="string"?new TextEncoder().encode(b):new Uint8Array(b);if(P.byteLength!==0){if(p(),jt.add(P.byteLength)){Zt();return}if(!c){if(l=yn(l,P),l.byteLength>Wo){U(1009,__sfx("5o+h5omL5aS06LaF6L+HIDY0S0I="));return}await nt();return}if(Y){Y.push(P);return}if(!g){if(f.push(P),u+=P.byteLength,u>qn){U(1009,__sfx("5ouo5Y+35pyf6Ze05pWw5o2u6L+H5aSa"));return}return}et(P),await Dr(P)}})()});let qt=()=>{h()};a.addEventListener("close",qt),a.addEventListener("error",qt),l.byteLength>0?nt().catch(m=>U(1011,String(m))):T=setTimeout(()=>{T=null,!(K||c||l.byteLength>0)&&(de.firstPacketTimeouts++,U(1008,__sfx("6aaW5YyF6LaF5pe277ya5pyq5pS25Yiw5Y2P6K6u5aS0")))},_o);try{return new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:i})}catch(m){return console.error(__sfx("W+iHqueglOaVsOaNrumdol0gMTAxIOWTjeW6lOaehOmAoOWksei0pe+8mg=="),m),new Response(null,{status:200})}}var Jn,Qn,Ut,Wo,qn,Vo,Ve,ze,$n,de,Ye,Zo,_o,Dt=S(()=>{"use strict";ct();hn();gn();we();wn();xn();It();We();At();Pe();Jn=5e3,Qn=2500,Ut=2,Wo=64*1024,qn=8*1024*1024,Vo=32*1024*1024,Ve=0;ze=[],$n=20,de={stallRedials:0,eofRedials:0,guardedRedials:0,firstPacketTimeouts:0,downlinkYields:0};Ye=[];Zo=2e3,_o=8e3});var fr={};ve(fr,{[__sfx("Y2xlYXJYaHR0cFNlc3Npb25z")]:()=>rs,[__sfx("aGFuZGxlWGh0dHA=")]:()=>Mt,[__sfx("aXNYaHR0cFBhdGg=")]:()=>Lt,[__sfx("cGFyc2VYaHR0cFJvdXRl")]:()=>Nt,[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:()=>$o,[__sfx("cmVjb3JkWGh0dHBEaWFnbm9zdGljcw==")]:()=>z});function qo(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}function z(e,t,n){Ze.unshift({at:Date.now(),target:e,...t,summary:n}),Ze.length>20&&(Ze.length=20)}function $o(){return Ze}function es(e){return String(e||"").trim().replace(/\/+$/,"")||"/"}function Nt(e,t){let n=es(t??__sfx("L3hodHRw"));if(e===n||e===`${n}/`)return{kind:"stream-one"};let o=`${n}/`;if(!e.startsWith(o))return null;let r=e.slice(o.length);if(!r)return null;let s=r.split("/");if(s.length===1&&s[0])return/[\s\u0000-\u001f]/.test(s[0])?null:{kind:"session",sessionId:s[0]};if(s.length===2&&s[0]&&/^\d+$/.test(s[1])){if(/[\s\u0000-\u001f]/.test(s[0]))return null;let i=Number(s[1]);return!Number.isSafeInteger(i)||i<0||i>1e6?null:{kind:__sfx("cGFja2V0LXVw"),sessionId:s[0],seq:i}}return null}function Lt(e,t){return Nt(e,t)!==null}function lr(e){if(e.reservedBytes<=0){e.reservedBytes=0;return}Ee=Math.max(0,Ee-e.reservedBytes),e.reservedBytes=0}function ir(e,t){return t<=0?!0:Ee+t>ns?!1:(Ee+=t,e.reservedBytes+=t,!0)}function rs(){for(let[e,t]of W)V(e,t);W.clear(),Ee=0}function os(e,t){return t-e.lastUploadAt>Ot&&t-e.lastDownlinkAt>Ot&&t-e.lastActivityAt>Ot}function ss(e,t){return e.closed?!0:e.header||e.dialResult||e.downlinkStarted?!1:t-e.createdAt>ar}function ur(e,t,n,o){let r=Date.now();for(let[a,l]of W)(l.closed||os(l,r)||r-l.createdAt>30*6e4)&&V(a,l);let s=W.get(e);if(s)return cr(s,n,r),s;if(W.size>=rr){for(let[a,l]of W)ss(l,r)&&V(a,l);if(W.size>=rr)return null}if(!o){let a=0;for(let l of W.values())l.header||(a+=1);if(a>=ts)return null}let i={id:e,createdAt:r,lastUploadAt:r,lastDownlinkAt:r,lastActivityAt:r,header:void 0,headerWaiters:[],dialPromise:null,dialResult:null,pending:new Map,reservedBytes:0,nextPumpSeq:0,pumpStarted:!1,signalResolve:null,traffic:new ue(t),downlinkStarted:!1,closed:!1,targetLabel:""};return W.set(e,i),i}function cr(e,t,n){t==="upload"?e.lastUploadAt=n:e.lastDownlinkAt=n,e.lastActivityAt=n}function V(e,t){if(!t.closed){t.closed=!0;for(let n of t.headerWaiters)try{n(null)}catch{}if(t.headerWaiters=[],t.signalResolve?.(),t.signalResolve=null,t.dialResult?.close)try{t.dialResult.close()}catch{}lr(t),t.pending.clear(),W.delete(e)}}function is(e){let t=e.signalResolve;e.signalResolve=null,t?.()}function as(e,t){return e.header?Promise.resolve(e.header):e.closed?Promise.resolve(null):new Promise(n=>{let o=s=>{clearTimeout(r),n(s)},r=setTimeout(()=>{let s=e.headerWaiters.indexOf(o);s>=0&&e.headerWaiters.splice(s,1),n(null)},t);e.headerWaiters.push(o)})}function ls(e,t){e.header=t;let n=e.headerWaiters;e.headerWaiters=[];for(let o of n)try{o(t)}catch{}}function L(e){let t=100+Math.floor(Math.random()*900);return{"Content-Type":"text/event-stream","Cache-Control":"no-store","X-Accel-Buffering":"no","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST","X-Padding":"X".repeat(t),...e}}function us(e){let t=e.addons,n=new Uint8Array(2+t.byteLength);return n[0]=e.version,n[1]=t.byteLength,n.set(t,2),n}async function cs(e,t,n){if(e.dialResult)return e.dialResult;if(!e.dialPromise){let o=e.header;if(!o)throw new Error(__sfx("VkxFU1Mg5aS05pyq5Yiw6L6+"));e.targetLabel=`${o.hostname}:${o.port}`,e.dialPromise=fe({hostname:o.hostname,port:o.port,proxies:n,nat64:t.nat64,concurrent:t.concurrentDial,proxyMode:t.proxyMode,resolvePreferred:t.resolvePreferred,relayPool:{userEntries:t.relayPool||void 0,useBuiltin:t.useBuiltinRelay},onFailure:r=>{z(e.targetLabel,r,__sfx("WEhUVFAg5Ye656uZ5aSx6LSl77yI")+r.candidate+"):"+r.message+"")}}).then(r=>(e.dialResult=r,r)).catch(r=>{throw z(e.targetLabel,{kind:"dial",message:String(r),candidate:"all"},__sfx("WEhUVFAg5Ye656uZ5YWo6YOo5aSx6LSl77ya")+String(r)+""),r})}return await e.dialPromise}async function fs(e,t){let n=t.writable.getWriter();try{for(;!e.closed;){let o=e.pending.get(e.nextPumpSeq);if(o){if(e.pending.delete(e.nextPumpSeq),e.nextPumpSeq+=1,lr(e),o.byteLength===0)continue;if(e.traffic.add(o.byteLength)){z(e.targetLabel,{kind:"budget",message:__sfx("5rWB6YeP6LaF6ZmQ"),candidate:"traffic"},__sfx("WEhUVFAg5LiK6KGM5rWB6YeP6LaF6ZmQ"));break}try{await n.write(o)}catch(i){z(e.targetLabel,{kind:"relay-write",message:String(i),candidate:t.endpoint},__sfx("WEhUVFAg5YaZ5YWl55uu5qCH5aSx6LSl77ya")+String(i)+"");break}continue}let r=null,s=new Promise(i=>{r=i});if(e.signalResolve=r,e.pending.has(e.nextPumpSeq)||e.closed){e.signalResolve=null;continue}await s}}finally{try{n.releaseLock()}catch{}}}async function ds(e,t,n,o,r){let s=(t.dataBudgetMB||0)*1024*1024,i=ur(o,s,"upload",r===0);if(!i)return new Response(__sfx("5Lya6K+d5pWw5bey6L6+5LiK6ZmQ77yM6K+356iN5ZCO6YeN6K+V"),{status:503,headers:L()});if(i.closed)return null;let a=Number(e.headers.get("content-length")??"");if(Number.isFinite(a)&&a>or)return new Response(__sfx("5YiG5YyF6LaF5Ye65LiK6ZmQ"),{status:413,headers:L()});let l;try{let f=await e.arrayBuffer();l=new Uint8Array(f)}catch{return new Response(__sfx("6K+35rGC5L2T6K+75Y+W5aSx6LSl"),{status:400,headers:L()})}if(l.byteLength>or)return new Response(__sfx("5YiG5YyF6LaF5Ye65LiK6ZmQ"),{status:413,headers:L()});if(r===0&&!i.header){let f=Ue(l,t.uuid);if(!f)return V(o,i),new Response(__sfx("VkxFU1Mg5aS06Kej5p6Q5aSx6LSl"),{status:400,headers:L()});if(f.header.command!==ut)return V(o,i),new Response(__sfx("WEhUVFAg5pqC5LiN5pSv5oyBIFVEUA=="),{status:400,headers:L()});ls(i,f.header),i.targetLabel=`${f.header.hostname}:${f.header.port}`;let u=l.subarray(f.consumed);if(r>=i.nextPumpSeq&&!i.pending.has(r)){if(i.pending.size>=sr)return V(o,i),new Response(__sfx("5YiG5YyF57yT5a2Y5bey5ruh"),{status:503,headers:L()});if(!ir(i,u.byteLength))return V(o,i),new Response(__sfx("5pqC5a2Y6LaF6ZmQ"),{status:503,headers:L()});i.pending.set(r,u.slice())}}else{if(r<i.nextPumpSeq||i.pending.has(r))return new Response(null,{status:200,headers:L()});if(i.pending.size>=sr)return V(o,i),new Response(__sfx("5YiG5YyF57yT5a2Y5bey5ruh"),{status:503,headers:L()});if(!ir(i,l.byteLength))return V(o,i),new Response(__sfx("5pqC5a2Y6LaF6ZmQ"),{status:503,headers:L()});i.pending.set(r,l.slice())}return is(i),new Response(null,{status:200,headers:L()})}async function ps(e,t,n,o){let r=(t.dataBudgetMB||0)*1024*1024,s=ur(o,r,"downlink",!1);if(!s)return new Response(__sfx("5Lya6K+d5pWw5bey6L6+5LiK6ZmQ77yM6K+356iN5ZCO6YeN6K+V"),{status:503,headers:L()});if(s.closed||s.downlinkStarted)return null;s.downlinkStarted=!0;let i=as(s,ar),a=!1,l=null,f=null,u=!1,c=null,d=()=>{V(o,s)},g=new ReadableStream({start(y){f=y},async pull(y){if(!a)try{if(!u){let p=await i;if(a)return;if(!p){d(),y.close();return}try{c=await cs(s,t,n)}catch{d(),y.close();return}if(a)return;s.pumpStarted||(s.pumpStarted=!0,fs(s,c).catch(()=>{}));try{y.enqueue(us(p))}catch{}u=!0;return}if(!c)return;l||(l=c.readable.getReader());let{done:x,value:T}=await l.read();if(a)return;if(x){d();try{y.close()}catch{}return}if(T&&T.byteLength>0){if(cr(s,"downlink",Date.now()),s.traffic.add(T.byteLength)){z(s.targetLabel,{kind:"budget",message:__sfx("5rWB6YeP6LaF6ZmQ"),candidate:"traffic"},__sfx("WEhUVFAg5LiL6KGM5rWB6YeP6LaF6ZmQ")),d();try{y.close()}catch{}return}y.enqueue(T)}}catch(x){if(a)return;d();try{y.error(x)}catch{}}},cancel(y){if(a=!0,c)try{c.readable.cancel(y)}catch{}d()}});return new Response(g,{status:200,headers:L()})}async function Mt(e,t,n){let o=__sfx("L3hodHRw");try{o=new URL(e.url).pathname}catch{o=__sfx("L3hodHRw")}let r=Nt(o,t[__sfx("eGh0dHBQYXRo")]);return r?r.kind==="stream-one"?e.method!=="POST"?null:await ms(e,t,n):r.kind===__sfx("cGFja2V0LXVw")?e.method!=="POST"?null:await ds(e,t,n,r.sessionId,r.seq):e.method==="GET"?await ps(e,t,n,r.sessionId):null:null}async function ms(e,t,n){let o=e.body;if(!o)return new Response(__sfx("57y65bCR6K+35rGC5L2T"),{status:400});let r=new ne(o),s=await qo(ln(r,t.uuid),Qo);if(!s)return await r.cancel("header timeout"),new Response(__sfx("VkxFU1Mg5aS06Kej5p6Q5aSx6LSl"),{status:400});if(s.header.command!==ut)return await s.payload.cancel("unsupported UDP"),new Response(__sfx("WEhUVFAg5pqC5LiN5pSv5oyBIFVEUA=="),{status:400});let i;try{i=await fe({hostname:s.header.hostname,port:s.header.port,proxies:n,nat64:t.nat64,concurrent:t.concurrentDial,proxyMode:t.proxyMode,resolvePreferred:t.resolvePreferred,relayPool:{userEntries:t.relayPool||void 0,useBuiltin:t.useBuiltinRelay},onFailure:p=>{z(`${s.header.hostname}:${s.header.port}`,p,__sfx("WEhUVFAg5Ye656uZ5aSx6LSl77yI")+p.candidate+"):"+p.message+"")}})}catch(p){z(`${s.header.hostname}:${s.header.port}`,{kind:"dial",message:String(p),candidate:"all"},__sfx("WEhUVFAg5Ye656uZ5YWo6YOo5aSx6LSl77ya")+String(p)+"");try{s.payload.cancel("dial failed").catch(()=>{})}catch{}return new Response(__sfx("5Ye656uZ5LiN5Y+v55So"),{status:502})}let a=s.header.addons;if(a.byteLength>255)return new Response(__sfx("QWRkb25zIOmVv+W6pui2heWHuiBWTEVTUyDljY/orq7kuIrpmZA="),{status:400});let l=new Uint8Array(2+a.byteLength);l[0]=s.header.version,l[1]=a.byteLength,l.set(a,2);let f=!1,u=null,c=!1,d=new ue((t.dataBudgetMB||0)*1024*1024),g=null,y=()=>{if(c)return;c=!0;let p=__sfx("5Y2V6L+e5o6l5rWB6YeP6LaF6L+HIA==")+t.dataBudgetMB+__sfx("TUIg5LiK6ZmQ");if(z(`${s.header.hostname}:${s.header.port}`,{kind:"budget",message:p,candidate:"traffic"},p),i.close)try{i.close()}catch{}try{g?.close()}catch{}},x=p=>d.add(p)?(y(),!0):!1;_n(s.payload,i.writable,void 0,!1,x,(p,R)=>{let E=p instanceof Error?p.message:String(p),k=`relay-${R}`;/cancel|abort|closed/i.test(E)?k=`relay-${R}-client-cancel`:/reset|broken pipe/i.test(E)&&(k=`relay-${R}-upstream-reset`),z(`${s.header.hostname}:${s.header.port}`,{kind:k,message:E.slice(0,200),candidate:i.endpoint},__sfx("WEhUVFAg5Lit57un")+R==="read"?"\u8BFB\u4E0A\u6E38":"\u5199\u76EE\u6807"+__sfx("5aSx6LSl77yI")+k+"):"+E.slice(0,120)+"")}).catch(()=>{});let T=new ReadableStream({start(p){g=p,p.enqueue(l),f=!0},async pull(p){if(!(c||!f)){u||(u=i.readable.getReader());try{let{done:R,value:E}=await u.read();if(c)return;if(R){if(i.close)try{i.close()}catch{}p.close();return}if(E&&E.byteLength>0){if(d.add(E.byteLength)){y();return}p.enqueue(E)}}catch(R){if(c)return;if(i.close)try{i.close()}catch{}try{p.error(R)}catch{}}}},cancel(p){c=!0;try{i.readable.cancel(p)}catch{}if(i.close)try{i.close()}catch{}}});return new Response(T,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-store","X-Accel-Buffering":"no"}})}var Qo,Ze,W,ar,rr,ts,Ot,or,sr,ns,Ee,Ht=S(()=>{"use strict";we();ct();We();It();Qo=2e3;Ze=[];W=new Map,ar=3e4,rr=100,ts=20,Ot=10*6e4,or=10*1024*1024,sr=30,ns=32*1024*1024,Ee=0});function Je(){return new Response(JSON.stringify({build:Bt,version:hs,ts:Date.now()}),{status:200,headers:{"Content-Type":"application/json","Cache-Control":"no-store","Access-Control-Allow-Origin":"*"}})}var Bt,hs,_e,Ft=S(()=>{"use strict";Bt="39ad808-82ab544c",hs=__sfx("MC4zMC4z"),_e=__sfx("L19fY2ZwX3ZlcnNpb24=")});function dr(e){return e[__sfx("S1Y=")]?new pe(e[__sfx("S1Y=")]):new Kt}var pe,Kt,Qe=S(()=>{"use strict";pe=class{constructor(t){this.kv=t}kv;async get(t){return await this.kv.get(t)}async put(t,n,o){o&&o>=60?await this.kv.put(t,n,{expirationTtl:o}):await this.kv.put(t,n)}async delete(t){await this.kv.delete(t)}async list(t){let n=[],o;do{let r=await this.kv.list({prefix:t,cursor:o});for(let s of r.keys)n.push(s.name);o=r.list_complete?void 0:r.cursor}while(o);return n}},Kt=class{data=new Map;async get(t){let n=this.data.get(t);return n?n.expiresAt>0&&n.expiresAt<=Date.now()?(this.data.delete(t),null):n.value:null}async put(t,n,o){let r=o?Date.now()+o*1e3:0;this.data.set(t,{value:n,expiresAt:r})}async delete(t){this.data.delete(t)}async list(t){return[...this.data.keys()].filter(n=>n.startsWith(t))}}});function ce(e,t){if(e==null)return t;let n=String(e).trim();if(n==="")return t;let o=Number(n);return Number.isFinite(o)?o:t}function F(e,t){if(e==null||e==="")return t;let n=String(e).trim().toLowerCase();return["1","true","yes","on"].includes(n)?!0:["0","false","no","off"].includes(n)?!1:t}function gs(e){let t=e.trim().toLowerCase();return t==="global"||t==="fallback"||t==="smart"?t:"only"}function mr(e){return e.trim().toLowerCase()==="signed"?"signed":"legacy"}function hr(e){return e.trim().toLowerCase()==="doh"?"doh":"off"}function I(e,t){return e==null?t:String(e)}function ys(e){return{uuid:I(e[__sfx("VVVJRA==")],""),[__sfx("dHJvamFuUGFzc3dvcmQ=")]:I(e[__sfx("VFJPSkFOX1BBU1NXT1JE")],""),wsPath:I(e[__sfx("V1NfUEFUSA==")]||e[__sfx("UEFUSA==")],A.wsPath),[__sfx("dHJvamFuUGF0aA==")]:A[__sfx("dHJvamFuUGF0aA==")],[__sfx("eGh0dHBQYXRo")]:A[__sfx("eGh0dHBQYXRo")],add:I(e[__sfx("QURE")],""),addApi:I(e[__sfx("QUREQVBJ")],""),addCsv:I(e[__sfx("QUREX0NTVg==")],""),poolOfficial:F(e[__sfx("T0ZGSUNJQUxfSVA=")],A.poolOfficial),officialCount:ce(e[__sfx("T0ZGSUNJQUxfSVBfQ09VTlQ=")],A.officialCount),poolDomain:F(e[__sfx("UFJFRkVSUkVEX0RPTUFJTg==")],A.poolDomain),domainCount:ce(e[__sfx("UFJFRkVSUkVEX0RPTUFJTl9DT1VOVA==")],A.domainCount),poolManual:F(e[__sfx("TUFOVUFMX0lQ")],A.poolManual),poolCountries:I(e[__sfx("UE9PTF9DT1VOVFJJRVM=")],A.poolCountries),dls:ce(e[__sfx("RExT")],0),maxLatency:ce(e[__sfx("TUFYX0xBVEVOQ1k=")],0),maxNodes:0,[__sfx("cHJveHlJcA==")]:I(e[__sfx("UFJPWFlJUA==")],""),[__sfx("c29ja3M1")]:I(e[__sfx("U09DS1M1")],""),httpProxy:I(e[__sfx("SFRUUF9QUk9YWQ==")],""),proxyMode:gs(I(e[__sfx("UFJPWFlfTU9ERQ==")],"")),nat64:I(e[__sfx("TkFUNjQ=")],""),concurrentDial:F(e[__sfx("VENQX0NPTkNVUlJFTlRfRElBTA==")],!0),dataBudgetMB:ce(e[__sfx("REFUQV9CVURHRVRfTUI=")],A.dataBudgetMB),resolvePreferred:F(e[__sfx("UkVTT0xWRV9QUkVGRVJSRUQ=")],A.resolvePreferred),aggressiveRedial:F(e[__sfx("QUdHUkVTU0lWRV9SRURJQUw=")],A.aggressiveRedial),relayPool:I(e[__sfx("UkVMQVlfUE9PTA==")],""),useBuiltinRelay:F(e[__sfx("VVNFX0JVSUxUSU5fUkVMQVk=")],A.useBuiltinRelay),[__sfx("ZW5hYmxlVHJvamFu")]:F(e[__sfx("RU5BQkxFX1RST0pBTg==")]??e[__sfx("VFJPSkFO")],A[__sfx("ZW5hYmxlVHJvamFu")]),[__sfx("ZW5hYmxlWGh0dHA=")]:F(e[__sfx("RU5BQkxFX1hIVFRQ")]??e[__sfx("WEhUVFA=")],A[__sfx("ZW5hYmxlWGh0dHA=")]),subDomain:"",subProtocol:"both",subTransport:"both",subVariants:I(e[__sfx("U1VCX1ZBUklBTlRT")],A.subVariants),subName:I(e[__sfx("U1VCX05BTUU=")],A.subName).trim()||A.subName,subPorts:I(e[__sfx("U1VCX1BPUlRT")],A.subPorts),clientFingerprint:A.clientFingerprint,ech:F(e[__sfx("RUNI")],A.ech),echHost:I(e[__sfx("RUNIX0hPU1Q=")],A.echHost),echDns:I(e[__sfx("RUNIX0ROUw==")],A.echDns),tlsFragment:!1,tlsFragmentSize:A.tlsFragmentSize,tlsFragmentDelay:A.tlsFragmentDelay,subToken:mr(I(e[__sfx("U1VCX1RPS0VOX01PREU=")],"")),subTokenTtlDays:ce(e[__sfx("U1VCX1RPS0VOX1RUTF9EQVlT")],A.subTokenTtlDays),unlockProbe:F(e[__sfx("VU5MT0NLX1BST0JF")],A.unlockProbe),udpDns:hr(I(e[__sfx("VURQX0ROUw==")],"")),udpDnsEndpoint:I(e[__sfx("VURQX0ROU19FTkRQT0lOVA==")],A.udpDnsEndpoint)}}function bs(e,t){let n={...e};for(let[o,r]of Object.entries(t))if(r!=null)if(o==="dls"||o==="maxLatency"||o==="maxNodes"||o==="officialCount"||o==="domainCount"||o==="dataBudgetMB"||o==="subTokenTtlDays")n[o]=ce(r,0);else if(o==="concurrentDial"||o==="resolvePreferred"||o==="aggressiveRedial"||o==="useBuiltinRelay"||o===__sfx("ZW5hYmxlVHJvamFu")||o===__sfx("ZW5hYmxlWGh0dHA=")||o==="tlsFragment"||o==="ech"||o==="poolOfficial"||o==="poolDomain"||o==="poolManual"||o==="unlockProbe")n[o]=F(r,!1);else if(o==="subProtocol"){let s=String(r);n[o]=s===__sfx("dmxlc3M=")||s===__sfx("dHJvamFu")||s==="both"?s:"both"}else if(o==="subTransport"){let s=String(r);n[o]=s==="ws"||s===__sfx("eGh0dHA=")||s==="both"?s:"both"}else o==="subToken"?n[o]=mr(String(r)):o==="udpDns"?n[o]=hr(String(r)):n[o]=String(r);return n}async function gr(e,t){let n=ys(t),o=await e.get(pr),r={};if(o)try{r=JSON.parse(o)}catch{r={}}let s=bs(n,r),i=!1,a=e instanceof pe,l=Date.now();o?Ae=0:Ae===0&&(Ae=l);let f=l-Ae>ws;return a&&f&&(s.uuid||(s.uuid=ot(),i=!0),s[__sfx("dHJvamFuUGFzc3dvcmQ=")]||(s[__sfx("dHJvamFuUGFzc3dvcmQ=")]=ot().replace(/-/g,"").slice(0,16),i=!0),Ae=0),o&&(s.officialCount<1||s.domainCount<1)&&(s.officialCount<1&&(s.officialCount=A.officialCount,i=!0),s.domainCount<1&&(s.domainCount=A.domainCount,i=!0)),i&&await xs(e,s),s}async function xs(e,t){await e.put(pr,JSON.stringify(t))}var pr,A,Ae,ws,qe=S(()=>{"use strict";ee();Qe();pr="CONFIG",A={uuid:"",[__sfx("dHJvamFuUGFzc3dvcmQ=")]:"",wsPath:__sfx("L3ZsZXNz"),[__sfx("dHJvamFuUGF0aA==")]:__sfx("L3Ryb2phbg=="),[__sfx("eGh0dHBQYXRo")]:__sfx("L3hodHRw"),add:"",addApi:"",addCsv:"",poolOfficial:!0,officialCount:20,poolDomain:!0,domainCount:10,poolManual:!0,poolCountries:"",dls:0,maxLatency:0,maxNodes:0,[__sfx("cHJveHlJcA==")]:"",[__sfx("c29ja3M1")]:"",httpProxy:"",proxyMode:"only",nat64:"",concurrentDial:!0,dataBudgetMB:0,resolvePreferred:!0,aggressiveRedial:!1,relayPool:"",useBuiltinRelay:!0,[__sfx("ZW5hYmxlVHJvamFu")]:!0,[__sfx("ZW5hYmxlWGh0dHA=")]:!0,subDomain:"",subProtocol:__sfx("dmxlc3M="),subTransport:"ws",subVariants:__sfx("dmxlc3Mtd3M="),subName:__sfx("Q0ZQaWxvdA=="),subPorts:"443",clientFingerprint:"chrome",ech:!1,echHost:__sfx("Y2xvdWRmbGFyZS1lY2guY29t"),echDns:"",tlsFragment:!1,tlsFragmentSize:"10-20",tlsFragmentDelay:"10-20",subToken:"legacy",subTokenTtlDays:0,unlockProbe:!1,udpDns:"off",udpDnsEndpoint:"https://dns.google/dns-query"};Ae=0,ws=9e4});var yr,Ps,Yi,Ss,ji,br=S(()=>{"use strict";yr={[__sfx("SEs=")]:["HKG"],[__sfx("VFc=")]:["TPE","KHH"],[__sfx("SlA=")]:["NRT","KIX","CTS","FUK"],[__sfx("S1I=")]:["ICN","PUS"],[__sfx("U0c=")]:["SIN"],[__sfx("TVk=")]:["KUL"],[__sfx("VEg=")]:["BKK"],[__sfx("Vk4=")]:["SGN","HAN"],[__sfx("SUQ=")]:["CGK","DPS"],[__sfx("UEg=")]:["MNL"],[__sfx("SU4=")]:["BOM","MAA","DEL"],[__sfx("QVU=")]:["SYD","MEL","BNE","PER"],[__sfx("Tlo=")]:["AKL"],[__sfx("VVM=")]:["LAX","SJC","SEA","ORD","DFW","IAD","EWR","ATL","MIA","DEN","PHX","BOS"],[__sfx("Q0E=")]:["YYZ","YVR","YYC"],[__sfx("R0I=")]:["LHR","MAN"],[__sfx("REU=")]:["FRA","MUC","BER"],[__sfx("RlI=")]:["CDG","MRS"],[__sfx("Tkw=")]:["AMS"],[__sfx("SVQ=")]:["MXP","FCO"],[__sfx("RVM=")]:["MAD","BCN"],[__sfx("U0U=")]:["ARN"],[__sfx("Q0g=")]:["ZRH"],[__sfx("QVQ=")]:["VIE"],[__sfx("UEw=")]:["WAW"],[__sfx("UlU=")]:["DME","SVO"],[__sfx("VFI=")]:["IST"],[__sfx("QUU=")]:["DXB"],[__sfx("SUw=")]:["TLV"],[__sfx("WkE=")]:["JNB"],[__sfx("QlI=")]:["GRU","GIG"],[__sfx("QVI=")]:["EZE"],[__sfx("Q0w=")]:["SCL"],[__sfx("TVg=")]:["MEX"]},Ps=__sfx("SEtH6aaZ5rivLFRQReWPsOWMlyxOUlTkuJzkuqwsS0lY5aSn6ZiqLElDTummluWwlCxTSU7mlrDliqDlnaEsS1VM5ZCJ6ZqG5Z2hLEJLS+abvOiwtyxTR07og6Hlv5fmmI7luIIsTU5M6ams5bC85ouJLFNZROaCieWwvCxNRUzloqjlsJTmnKwsTEFY5rSb5p2J55+2LFNKQ+Wco+S9leWhnixTRUHopb/pm4Xlm74sT1JE6Iqd5Yqg5ZOlLElBROWNjuebm+mhvyxFV1Lnur3nk6blhYssWVla5aSa5Lym5aSaLFlWUua4qeWTpeWNjixMSFLkvKbmlaYsRlJB5rOV5YWw5YWL56aPLENER+W3tOm7jixBTVPpmL/lp4bmlq/nibnkuLksTUFE6ams5b636YeMLEFSTuaWr+W+t+WTpeWwlOaRqSxJU1TkvIrmlq/lnabluIPlsJQsRFhC6L+q5ouc"),Yi=(()=>{let e={};for(let t of Ps.split(","))t.length>3&&(e[t.slice(0,3)]=t.slice(3));return e})(),Ss=new Map;for(let[e,t]of Object.entries(yr))for(let n of t)Ss.set(n,e);ji=Object.keys(yr)});var _i,wr=S(()=>{"use strict";_i=new Set("GEOSITE GEOIP GEOIP-CIDR DOMAIN DOMAIN-SUFFIX DOMAIN-KEYWORD IP-CIDR IP-CIDR6 SRC-IP-CIDR DST-PORT SRC-PORT PROCESS-NAME MATCH".split(" "))});var fa,xr=S(()=>{"use strict";X();ee();br();wr();fa=".cn,qq.com,tencent.com,weixin.qq.com,baidu.com,bdstatic.com,bilibili.com,hdslb.com,taobao.com,tmall.com,jd.com,aliyun.com,alicdn.com,alipay.com,163.com,126.net,zhihu.com,weibo.com,sina.com.cn,youku.com,iqiyi.com,douyin.com,xiaohongshu.com,mi.com,huawei.com,csdn.net,gitee.com,cnblogs.com".split(",")});var ha,Pr=S(()=>{"use strict";Qe();ee();ha=new TextEncoder});var Da,Sr=S(()=>{"use strict";qe();ee();Da=3600*24});function Er(e){return dr(e)}async function Ar(e,t){if(Te.config&&Date.now()-Te.configAt<Es)return Te.config;let n=await gr(e,t);return Te.config=n,Te.configAt=Date.now(),n}var Es,Te,Gt=S(()=>{"use strict";Qe();qe();Sr();Es=15e3,Te={config:null,configAt:0,auth:null,authAt:0}});var Rr={};ve(Rr,{clearUnlockCache:()=>Ds,runUnlockProbe:()=>Us});function ks(e,t,n){return e===200?"ok":e===404?t==="status"?"region":"unknown":e===403||e===451?"blocked":t==="trace"&&/\bloc=[A-Z]{2}\b/.test(n)?"ok":"unknown"}async function Is(e){let t=Date.now(),n=new AbortController,o=setTimeout(()=>n.abort(),Rs);try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:n.signal,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",Accept:"text/html,application/xhtml+xml,*/*"}}),s="";e.mode==="trace"&&(s=(await r.text()).slice(0,512));let i=/\bloc=([A-Z]{2})\b/.exec(s)?.[1];return{id:e.id,status:r.status,verdict:ks(r.status,e.mode,s),ms:Date.now()-t,...i?{loc:i}:{}}}catch(r){let s=r instanceof Error?r.message:String(r);return{id:e.id,status:0,verdict:"unknown",ms:Date.now()-t,error:/abort/i.test(s)?"timeout":"fetch-failed"}}finally{clearTimeout(o)}}async function Us(e,t){let n=e||"UNK",o=Date.now(),r=me.get(n);if(r&&o-r.at<Cs)return{...r.data,cached:!0};let s=await Promise.all(Ts.map(a=>Is(a))),i={colo:n,region:t,cached:!1,at:o,targets:s};if(me.size>=vs){let a="",l=Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")];for(let[f,u]of me)u.at<l&&(l=u.at,a=f);a&&me.delete(a)}return me.set(n,{at:o,data:i}),i}function Ds(){me.clear()}var Ts,Rs,Cs,vs,me,Cr=S(()=>{"use strict";Ts=[{id:"netflix",url:"https://www.netflix.com/title/81215567",mode:"status"},{id:"youtube",url:"https://www.youtube.com/premium",mode:"status"},{id:"gemini",url:"https://gemini.google.com/",mode:"status"}],Rs=4e3,Cs=600*1e3,vs=16,me=new Map});ee();var Mr=8*1024*1024,Hr=2*1024*1024,nn=600*1e3,Br=6*1024*1024*1024,st=Date.now(),it=0;function rn(e){e-st>=nn&&(st=e,it=0)}function Fr(e,t=Date.now()){rn(t),it+=e}function tn(e){return rn(e),Br-it}var Kr=(()=>{let e=new Uint8Array(65536),t=2654435769;for(let n=0;n<e.length;n++)t^=t<<13,t^=t>>>17,t^=t<<5,e[n]=t&255;return e})(),Xr=5e3;function Gr(e,t=Xr){let n=!1,o=setTimeout(()=>{if(!n){n=!0;try{e(1e3,"Probe idle timeout")}catch{}}},t),r=o;return typeof r?.unref=="function"&&r.unref(),{cancel:()=>{n||(n=!0,clearTimeout(o))}}}async function at(e){let t=new URL(e.url);if(e.headers.get("Upgrade")?.toLowerCase()===__sfx("d2Vic29ja2V0")){let f=new WebSocketPair,[u,c]=Object.values(f);c.accept();let d=Gr((g,y)=>c.close(g,y));return c.addEventListener("message",g=>{let y=typeof g.data=="string"?g.data:"";if(y==="PING"||y==="ping"){d.cancel(),c.send(JSON.stringify({pong:!0,colo:e.cf?.colo??"UNK",clientIp:e.headers.get("CF-Connecting-IP")??""}));try{c.close(1e3,"Probe complete")}catch{}return}d.cancel();try{c.close(1e3,"Probe aborted")}catch{}}),c.addEventListener("close",()=>d.cancel()),c.addEventListener("error",()=>d.cancel()),new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:u})}let o=Number.parseInt(t.searchParams.get("bytes")??"",10),r=Number.isFinite(o)&&o>0?Math.min(o,Mr):Hr,s=Date.now();if(tn(s)<=0){let f=Math.max(1e3,st+nn-s);return new Response(JSON.stringify({ok:!1,error:"probe budget exhausted"}),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(f/1e3))}})}let i=Kr,a=0,l=new ReadableStream({pull(f){let u=tn(Date.now());if(a>=r||u<=0){f.close();return}let c=Math.min(i.byteLength,r-a,u);f.enqueue(i.subarray(0,c)),a+=c,Fr(c)}});return new Response(l,{status:200,headers:{"Content-Type":"application/octet-stream","Content-Encoding":"identity","Cache-Control":"no-store","Access-Control-Allow-Origin":"*","X-Probe-Bytes":String(r),"X-Probe-Nonce":Ie(4)}})}Dt();Ht();Tt();Ft();ee();qe();We();xr();Pr();ee();function Xt(e){let t=e===200?"Welcome":e===404?"Not Found":"Service Unavailable",n=`<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${t}</title><style>body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f7f8fa;color:#333;font-family:-apple-system,"Segoe UI","PingFang SC",sans-serif}.c{text-align:center}h1{font-size:22px;font-weight:600;margin:0 0 10px}p{color:#888;font-size:14px;margin:0}</style></head><body><div class="c"><h1>${t}</h1><p>This site is up and running.</p></div></body></html>`;return new Response(n,{status:e,headers:{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}})}Gt();Gt();async function Tr(e){let t=Er(e);return await Ar(t,e)}function Wt(e){let t=[];return t.push(...Se(e[__sfx("cHJveHlJcA==")],"direct")),t.push(...Se(e[__sfx("c29ja3M1")],__sfx("c29ja3M1"))),t.push(...Se(e.httpProxy,"http")),t}var Vt=6e4,Os=10,Re=0,$e=0;function vr(e){return e>=$e?(Re=0,$e=e+Vt,!1):Re>=Os}function kr(e,t){if(!t)return!1;let n=(e.headers.get(__sfx("eC1jZnBpbG90LXRva2Vu"))??"").trim();if(!n)return!1;let o=Date.now();return ge(n,t)?(Re=0,!0):(o>=$e&&($e=o+Vt,Re=0),Re+=1,!1)}async function Ir(e,t,n){let o=new URL(e.url);if(o.pathname===__sfx("L19fZWRnZV9wcm9iZQ=="))return at(e);if(o.pathname===_e||o.pathname===__sfx("L19fdmVyc2lvbg=="))return Je();if(o.pathname==="/region"&&e.method==="GET"){let{coloToCountry:i}=await Promise.resolve().then(()=>(Pe(),St)),a=e.cf?.colo??"",l=a?i(a):"";return new Response(JSON.stringify({ok:!0,colo:a,region:l,timestamp:new Date().toISOString()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8"}})}let r=await Tr(t);if(o.pathname===__sfx("L19fZGlhZw==")){if(vr(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(Vt/1e3))}});if(!kr(e,r.uuid))return null;let{recentDiagnostics:i,diagnosticCounters:a,recentRoutes:l}=await Promise.resolve().then(()=>(Dt(),nr)),{[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:f}=await Promise.resolve().then(()=>(Ht(),fr));return new Response(JSON.stringify({ok:!0,impl:"self",build:Bt,recent:i(),[__sfx("eGh0dHA=")]:f(),counters:a(),routes:l()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}if(o.pathname==="/__unlock_probe"){if(!r.unlockProbe)return null;if(vr(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}});if(!kr(e,r.uuid))return null;let{coloToCountry:i}=await Promise.resolve().then(()=>(Pe(),St)),{runUnlockProbe:a}=await Promise.resolve().then(()=>(Cr(),Rr)),l=e.cf?.colo??"",f=l?i(l):"",u=await a(l,f);return new Response(JSON.stringify({ok:!0,...u},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}let s=e.headers.get("Upgrade")?.toLowerCase();return o.pathname===r.wsPath?s!==__sfx("d2Vic29ja2V0")?null:await je(e,__sfx("dmxlc3M="),r,Wt(r),n):r[__sfx("ZW5hYmxlVHJvamFu")]&&o.pathname===r[__sfx("dHJvamFuUGF0aA==")]?s!==__sfx("d2Vic29ja2V0")?null:await je(e,__sfx("dHJvamFu"),r,Wt(r),n):r[__sfx("ZW5hYmxlWGh0dHA=")]&&Lt(o.pathname,r[__sfx("eGh0dHBQYXRo")])?await Mt(e,r,Wt(r)):null}Ft();var Al={async fetch(e,t,n){try{return new URL(e.url).pathname===_e?Je():await Ir(e,t,n)??Xt(200)}catch{return Xt(500)}}};export{Al as default};
|