mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
1934 lines
2.5 MiB
JavaScript
1934 lines
2.5 MiB
JavaScript
|
|
// SUB_STORE_BACKEND_VERSION: 2.20.2
|
|||
|
|
var de=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ok=de((dke,Eoe)=>{Eoe.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Hk=de((gke,hA)=>{var CD=require("fs"),vD=require("path"),yoe=require("os"),Coe=require("crypto"),voe=Ok(),Mk=voe.version,Boe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Ioe(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|||
|
|
`);let n;for(;(n=Boe.exec(r))!=null;){let i=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
|
|||
|
|
`),s=s.replace(/\\r/g,"\r")),t[i]=s}return t}function woe(e){let t=Pk(e),r=Fs.configDotenv({path:t});if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw o.code="MISSING_DATA",o}let n=Lk(e).split(","),i=n.length,s;for(let o=0;o<i;o++)try{let u=n[o].trim(),l=Doe(r,u);s=Fs.decrypt(l.ciphertext,l.key);break}catch(u){if(o+1>=i)throw u}return Fs.parse(s)}function boe(e){console.log(`[dotenv@${Mk}][WARN] ${e}`)}function lm(e){console.log(`[dotenv@${Mk}][DEBUG] ${e}`)}function Lk(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Doe(e,t){let r;try{r=new URL(t)}catch(u){if(u.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw u}let n=r.password;if(!n){let u=new Error("INVALID_DOTENV_KEY: Missing key part");throw u.code="INVALID_DOTENV_KEY",u}let i=r.searchParams.get("environment");if(!i){let u=new Error("INVALID_DOTENV_KEY: Missing environment part");throw u.code="INVALID_DOTENV_KEY",u}let s=`DOTENV_VAULT_${i.toUpperCase()}`,o=e.parsed[s];if(!o){let u=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw u.code="NOT_FOUND_DOTENV_ENVIRONMENT",u}return{ciphertext:o,key:n}}function Pk(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)CD.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=vD.resolve(process.cwd(),".env.vault");return CD.existsSync(t)?t:null}function Uk(e){return e[0]==="~"?vD.join(yoe.homedir(),e.slice(1)):e}function xoe(e){!!(e&&e.debug)&&lm("Loading env from encrypted .env.vault");let r=Fs._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),Fs.populate(n,r,e),{parsed:r}}function Foe(e){let t=vD.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&lm("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[Uk(e.path)];else{i=[];for(let l of e.path)i.push(Uk(l))}let s,o={};for(let l of i)try{let p=Fs.parse(CD.readFileSync(l,{encoding:r}));Fs.populate(o,p,e)}catch(p){n&&lm(`Failed to load ${l} ${p.message}`),s=p}let u=process.env;return e&&e.processEnv!=null&&(u=e.processEnv),Fs.populate(u,o,e),s?{parsed:o,error:s}:{parsed:o}}function Soe(e){if(Lk(e).length===0)return Fs.configDotenv(e);let t=Pk(e);return t?Fs._configVault(e):(boe(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Fs.configDotenv(e))}function Qoe(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),s=n.subarray(-16);n=n.subarray(12,-16);try{let o=Coe.createDecipheriv("aes-256-gcm",r,i);return o.setAuthTag(s),`${o.update(n)}${o.final()}`}catch(o){let u=o instanceof RangeError,l=o.message==="Invalid key length",p=o.message==="Unsupported state or unable to authenticate data";if(u||l){let f=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw f.code="INVALID_DOTENV_KEY",f}else if(p){let f=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw f.code="DECRYPTION_FAILED",f}else throw o}}function Roe(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(i===!0&&(e[s]=t[s]),n&&lm(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):e[s]=t[s]}var Fs={configDotenv:Foe,_configVault:xoe,_parseVault:woe,config:Soe,decrypt:Qoe,parse:Ioe,populate:Roe};hA.exports.configDotenv=Fs.configDotenv;hA.exports._configVault=Fs._configVault;hA.exports._parseVault=Fs._parseVault;hA.exports.config=Fs.config;hA.export
|
|||
|
|
`)||e.includes("\r")||e.includes("\0"))===!1}function zue(e){let t=(e.headersList.get("referrer-policy",!0)??"").split(","),r="";if(t.length)for(let n=t.length;n!==0;n--){let i=t[n-1].trim();if(Tue.has(i)){r=i;break}}return r}function Kue(e,t){let r=zue(t);r!==""&&(e.referrerPolicy=r)}function Zue(){return"allowed"}function Xue(){return"success"}function ece(){return"success"}function tce(e){let t=null;t=e.mode,e.headersList.set("sec-fetch-mode",t,!0)}function rce(e){let t=e.origin;if(!(t==="client"||t===void 0)){if(e.responseTainting==="cors"||e.mode==="websocket")e.headersList.append("origin",t,!0);else if(e.method!=="GET"&&e.method!=="HEAD"){switch(e.referrerPolicy){case"no-referrer":t=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&Bx(e.origin)&&!Bx(Vf(e))&&(t=null);break;case"same-origin":Lm(e,Vf(e))||(t=null);break;default:}e.headersList.append("origin",t,!0)}}}function a0(e,t){return e}function nce(e,t,r){return!e?.startTime||e.startTime<t?{domainLookupStartTime:t,domainLookupEndTime:t,connectionStartTime:t,connectionEndTime:t,secureConnectionStartTime:t,ALPNNegotiatedProtocol:e?.ALPNNegotiatedProtocol}:{domainLookupStartTime:a0(e.domainLookupStartTime,r),domainLookupEndTime:a0(e.domainLookupEndTime,r),connectionStartTime:a0(e.connectionStartTime,r),connectionEndTime:a0(e.connectionEndTime,r),secureConnectionStartTime:a0(e.secureConnectionStartTime,r),ALPNNegotiatedProtocol:e.ALPNNegotiatedProtocol}}function ice(e){return a0(Pue.now(),e)}function sce(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function yN(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function oce(e){return{referrerPolicy:e.referrerPolicy}}function ace(e){let t=e.referrerPolicy;Jf(t);let r=null;if(e.referrer==="client"){let s=fN();if(!s||s.origin==="null")return"no-referrer";r=new URL(s)}else xp.is.URL(e.referrer)&&(r=e.referrer);let n=vx(r),i=vx(r,!0);switch(n.toString().length>4096&&(n=i),t){case"no-referrer":return"no-referrer";case"origin":return i??vx(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=Vf(e);return Yf(n)&&!Yf(s)?"no-referrer":i}case"strict-origin-when-cross-origin":{let s=Vf(e);return Lm(n,s)?n:Yf(n)&&!Yf(s)?"no-referrer":i}case"same-origin":return Lm(e,n)?n:"no-referrer";case"origin-when-cross-origin":return Lm(e,n)?n:i;case"no-referrer-when-downgrade":{let s=Vf(e);return Yf(n)&&!Yf(s)?"no-referrer":i}}}function vx(e,t=!1){return Jf(xp.is.URL(e)),e=new URL(e),wN(e)?"no-referrer":(e.username="",e.password="",e.hash="",t===!0&&(e.pathname="",e.search=""),e)}var uce=new RegExp("^(?:(?:127\\.)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){2}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9]))$"),cce=new RegExp("^(?:(?:(?:0{1,4}):){7}(?:(?:0{0,3}1))|(?:(?:0{1,4}):){1,6}(?::(?:0{0,3}1))|(?:::(?:0{0,3}1))|)$");function CN(e){return e.includes(":")?(e[0]==="["&&e[e.length-1]==="]"&&(e=e.slice(1,-1)),cce.test(e)):uce.test(e)}function lce(e){return e==null||e==="null"?!1:(e=new URL(e),!!(e.protocol==="https:"||e.protocol==="wss:"||CN(e.hostname)||e.hostname==="localhost"||e.hostname==="localhost."||e.hostname.endsWith(".localhost")||e.hostname.endsWith(".localhost.")||e.protocol==="file:"))}function Yf(e){return xp.is.URL(e)?e.href==="about:blank"||e.href==="about:srcdoc"||e.protocol==="data:"||e.protocol==="blob:"?!0:lce(e.origin):!1}function Ace(e,t){if(OC===void 0)return!0;let r=vN(t);if(r==="no metadata"||r.length===0)return!0;let n=fce(r),i=hce(r,n);for(let s of i){let o=s.algo,u=s.hash,l=OC.createHash(o).update(e).digest("base64");if(l[l.length-1]==="="&&(l[l.length-2]==="="?l=l.slice(0,-2):l=l.slice(0,-1)),dce(l,u))return!0}return!1}var pce=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function vN(e){let t=[],r=!0;for(let n of e.split(" ")){r=!1;
|
|||
|
|
`);function zce(e){for(let t=0;t<e.length;++t)if(e.charCodeAt(t)&-128)return!1;return!0}function Kce(e){let t=e.length;if(t<27||t>70)return!1;for(let r=0;r<t;++r){let n=e.charCodeAt(r);if(!(n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}function Zce(e,t){MC(t!=="failure"&&t.essence==="multipart/form-data");let r=t.parameters.get("boundary");if(r===void 0)throw xu("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),i=[],s={position:0};for(;e[s.position]===13&&e[s.position+1]===10;)s.position+=2;let o=e.length;for(;e[o-1]===10&&e[o-2]===13;)o-=2;for(o!==e.length&&(e=e.subarray(0,o));;){if(e.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw xu("expected a value starting with -- and the boundary");if(s.position===e.length-2&&LC(e,Jce,s)||s.position===e.length-4&&LC(e,Wce,s))return i;if(e[s.position]!==13||e[s.position+1]!==10)throw xu("expected CRLF");s.position+=2;let u=Xce(e,s),{name:l,filename:p,contentType:f,encoding:c}=u;s.position+=2;let m;{let C=e.indexOf(n.subarray(2),s.position);if(C===-1)throw xu("expected boundary after body");m=e.subarray(s.position,C-4),s.position+=m.length,c==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(e[s.position]!==13||e[s.position+1]!==10)throw xu("expected CRLF");s.position+=2;let B;p!==null?(f??="text/plain",zce(f)||(f=""),B=new Gce([m],p,{type:f})):B=Pce(Buffer.from(m)),MC(RN(l)),MC(typeof B=="string"&&RN(B)||qce.is.File(B)),i.push($ce(l,B,p))}}function Xce(e,t){let r=null,n=null,i=null,s=null;for(;;){if(e[t.position]===13&&e[t.position+1]===10){if(r===null)throw xu("header name is null");return{name:r,filename:n,contentType:i,encoding:s}}let o=vA(u=>u!==10&&u!==13&&u!==58,e,t);if(o=xx(o,!0,!0,u=>u===9||u===32),!Hce.test(o.toString()))throw xu("header name does not match the field-name token production");if(e[t.position]!==58)throw xu("expected :");switch(t.position++,vA(u=>u===32||u===9,e,t),Lce(o)){case"content-disposition":{if(r=n=null,!LC(e,Yce,t))throw xu('expected form-data; name=" for content-disposition header');if(t.position+=17,r=kN(e,t),e[t.position]===59&&e[t.position+1]===32){let u={position:t.position+2};if(LC(e,Vce,u))if(e[u.position+8]===42){u.position+=10,vA(p=>p===32||p===9,e,u);let l=vA(p=>p!==32&&p!==13&&p!==10,e,u);if(l[0]!==117&&l[0]!==85||l[1]!==116&&l[1]!==84||l[2]!==102&&l[2]!==70||l[3]!==45||l[4]!==56)throw xu("unknown encoding, expected utf-8''");n=decodeURIComponent(new TextDecoder().decode(l.subarray(7))),t.position=u.position}else t.position+=11,vA(l=>l===32||l===9,e,t),t.position++,n=kN(e,t)}break}case"content-type":{let u=vA(l=>l!==10&&l!==13,e,t);u=xx(u,!1,!0,l=>l===9||l===32),i=_N(u);break}case"content-transfer-encoding":{let u=vA(l=>l!==10&&l!==13,e,t);u=xx(u,!1,!0,l=>l===9||l===32),s=_N(u);break}default:vA(u=>u!==10&&u!==13,e,t)}if(e[t.position]!==13&&e[t.position+1]!==10)throw xu("expected CRLF");t.position+=2}}function kN(e,t){MC(e[t.position-1]===34);let r=vA(n=>n!==10&&n!==13&&n!==34,e,t);if(e[t.position]!==34)throw xu('expected "');return t.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,`
|
|||
|
|
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r}function vA(e,t,r){let n=r.position;for(;n<t.length&&e(t[n]);)++n;return t.subarray(r.position,r.position=n)}function xx(e,t,r,n){let i=0,s=e.length-1;if(t)for(;i<e.length&&n(e[i]);)i++;if(r)for(;s>0&&n(e[s]);)s--;return i===0&&s===e.length-1?e:e.subarray(i,s+1)}function LC(e,t,r){if(e.length<t.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[r.position+n])return!1;return!0}function xu(e){return new TypeError("Failed to parse body as FormData.",{cause:new TypeError(e)})}NN.exports={multipartFormDataParser:Zce,validateBoundary:Kce}});var l0=de((qke,$N)=>{"use strict";var HC=Yr(),{ReadableStreamFrom:ele,readableStreamClose:tle,createDeferredPromise:rle,fullyReadBody:nle,extractMimeType:ile,utf8DecodeBytes:MN}=ko(),{FormData:ON,setFormDataState:sle}=UC(),{webidl:BA}=no(),{Blob:ole}=require("node:buffer"),Fx=require("node:assert"),{isErrored:LN,isDisturbed:ale}=require("node:stream"),{isArrayBuffer:ule}=require("node:util/types"),{serializeAMimeType:cle}=Ha(),{multipartFormDataParser:lle}=TN(),Sx;try{let e=require("node:crypto");Sx=t=>e.randomInt(0,t)}catch{Sx=e=>Math.floor(Math.random()*e)}var PC=new TextEncoder;function Ale(){}var Qx=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,Rx;Qx&&(Rx=new FinalizationRegistry(e=>{let t=e.deref();t&&!t.locked&&!ale(t)&&!LN(t)&&t.cancel("Response object has been garbage collected").catch(Ale)}));function PN(e,t=!1){let r=null;BA.is.ReadableStream(e)?r=e:BA.is.Blob(e)?r=e.stream():r=new ReadableStream({async pull(l){let p=typeof i=="string"?PC.encode(i):i;p.byteLength&&l.enqueue(p),queueMicrotask(()=>tle(l))},start(){},type:"bytes"}),Fx(BA.is.ReadableStream(r));let n=null,i=null,s=null,o=null;if(typeof e=="string")i=e,o="text/plain;charset=UTF-8";else if(BA.is.URLSearchParams(e))i=e.toString(),o="application/x-www-form-urlencoded;charset=UTF-8";else if(ule(e))i=new Uint8Array(e.slice());else if(ArrayBuffer.isView(e))i=new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));else if(BA.is.FormData(e)){let l=`----formdata-undici-0${`${Sx(1e11)}`.padStart(11,"0")}`,p=`--${l}\r
|
|||
|
|
Content-Disposition: form-data`;let f=H=>H.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),c=H=>H.replace(/\r?\n|\r/g,`\r
|
|||
|
|
`),m=[],B=new Uint8Array([13,10]);s=0;let C=!1;for(let[H,q]of e)if(typeof q=="string"){let se=PC.encode(p+`; name="${f(c(H))}"\r
|
|||
|
|
\r
|
|||
|
|
${c(q)}\r
|
|||
|
|
`);m.push(se),s+=se.byteLength}else{let se=PC.encode(`${p}; name="${f(c(H))}"`+(q.name?`; filename="${f(q.name)}"`:"")+`\r
|
|||
|
|
Content-Type: ${q.type||"application/octet-stream"}\r
|
|||
|
|
\r
|
|||
|
|
`);m.push(se,q,B),typeof q.size=="number"?s+=se.byteLength+q.size+B.byteLength:C=!0}let F=PC.encode(`--${l}--\r
|
|||
|
|
`);m.push(F),s+=F.byteLength,C&&(s=null),i=e,n=async function*(){for(let H of m)H.stream?yield*H.stream():yield H},o=`multipart/form-data; boundary=${l}`}else if(BA.is.Blob(e))i=e,s=e.size,e.type&&(o=e.type);else if(typeof e[Symbol.asyncIterator]=="function"){if(t)throw new TypeError("keepalive");if(HC.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");r=BA.is.ReadableStream(e)?e:ele(e)}if((typeof i=="string"||HC.isBuffer(i))&&(s=Buffer.byteLength(i)),n!=null){let l;r=new ReadableStream({async start(){l=n(e)[Symbol.asyncIterator]()},async pull(p){let{value:f,done:c}=await l.next();if(c)queueMicrotask(()=>{p.close(),p.byobRequest?.respond(0)});else if(!LN(r)){let m=new Uint8Array(f);m.byteLength&&p.enqueue(m)}return p.desiredSize>0},async cancel(p){await l.return()},type:"bytes"})}return[{stream:r,source:i,length:s},o]}function ple(e,t=!1){return BA.is.ReadableStream(e)&&(Fx(!HC.isDisturbed(e),"The body has already been consumed."),Fx(!e.locked,"The stream is locked.")),PN(e,t)}function fle(e,t){let[r,n]=t.stream.tee();return Qx&&Rx.register(e,new WeakRef(r)),t.stream=r,{stream:n,length:t.length,source:t.source}}function hle(e){if(e.aborted)throw new DOMException("The operation was aborted.","AbortError")}function dle(e,t){return{blob(){return c0(this,n=>{let i=UN(t(this));return i===null?i="":i&&(i=cle(i)),new ole([n],{type:i})},e,t)},arrayBuffer(){return c0(this,n=>new Uint8Array(n).buffer,e,t)},text(){return c0(this,MN,e,t)},json(){return c0(this,mle,e,t)},formData(){return c0(this,n=>{let i=UN(t(this));if(i!==null)switch(i.essence){case"multipart/form-data":{let s=lle(n,i),o=new ON;return sle(o,s),o}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),o=new ON;for(let[u,l]of s)o.append(u,l);return o}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},e,t)},bytes(){return c0(this,n=>new Uint8Array(n),e,t)}}}function gle(e,t){Object.assign(e.prototype,dle(e,t))}async function c0(e,t,r,n){BA.brandCheck(e,r);let i=n(e);if(HN(i))throw new TypeError("Body is unusable: Body has already been read");hle(i);let s=rle(),o=l=>s.reject(l),u=l=>{try{s.resolve(t(l))}catch(p){o(p)}};return i.body==null?(u(Buffer.allocUnsafe(0)),s.promise):(nle(i.body,u,o),s.promise)}function HN(e){let t=e.body;return t!=null&&(t.stream.locked||HC.isDisturbed(t.stream))}function mle(e){return JSON.parse(MN(e))}function UN(e){let t=e.headersList,r=ile(t);return r==="failure"?null:r}$N.exports={extractBody:PN,safelyExtractBody:ple,cloneBody:fle,mixinBody:gle,streamRegistry:Rx,hasFinalizationRegistry:Qx,bodyUnusable:HN}});var XN=de((jke,ZN)=>{"use strict";var kr=require("node:assert"),Tr=Yr(),{channels:qN}=dA(),_x=ox(),{RequestContentLengthMismatchError:zf,ResponseContentLengthMismatchError:Ele,RequestAbortedError:WN,HeadersTimeoutError:yle,HeadersOverflowError:Cle,SocketError:Gm,InformationalError:A0,BodyTimeoutError:vle,HTTPParserError:Ble,ResponseExceededMaxSizeError:Ile}=dn(),{kUrl:zN,kReset:oa,kClient:Px,kParser:es,kBlocking:Vm,kRunning:lo,kPending:wle,kSize:jN,kWriting:Sp,kQueue:gc,kNoRef:Hm,kKeepAliveDefaultTimeout:ble,kHostHeader:Dle,kPendingIdx:xle,kRunningIdx:Fu,kError:Su,kPipelining:jC,kSocket:p0,kKeepAliveTimeoutValue:YC,kMaxHeadersSize:Fle,kKeepAliveMaxTimeout:Sle,kKeepAliveTimeoutThreshold:Qle,kHeadersTimeout:Rle,kBodyTimeout:_le,kStrictContentLength:Tx,kMaxRequests:GN,kCounter:kle,kMaxResponseSize:Nle,kOnError:Tle,kResume:Fp,kHTTPContext:KN,kClosed:Ox}=li(),Zc=j3(),Ole=Buffer.alloc(0),$C=Buffer[Symbol.species],Ule=Tr.removeAllListeners,kx;async function Mle(){let e=process.env.JEST_WORKER_ID?lx():void 0,t;try{t=await WebAssembly.compile(V3())}catch{t=await WebAssembly.compile(e||lx())}return await WebAssembly.instantiate(t,{env:{wasm_on_url:(r,n,i)=>0,wasm_on_status:(r,n,i)=>{kr(Ss.ptr===r);let s=n-nl+Xc.byteOffset;return Ss.onStatus(new $C(Xc.buffer,s,i))},wasm_on_message_begin:r=>(kr(Ss.ptr===r),Ss.onMessageBegin()),wasm_on_header_field:(r,n,i)=>{kr(Ss.ptr===r);let s=n-nl+Xc.byteOffset;return Ss.
|
|||
|
|
`;if(typeof i=="string"?F+=`host: ${i}\r
|
|||
|
|
`:F+=e[Dle],s?F+=`connection: upgrade\r
|
|||
|
|
upgrade: ${s}\r
|
|||
|
|
`:e[jC]&&!B[oa]?F+=`connection: keep-alive\r
|
|||
|
|
`:F+=`connection: close\r
|
|||
|
|
`,Array.isArray(p))for(let H=0;H<p.length;H+=2){let q=p[H+0],se=p[H+1];if(Array.isArray(se))for(let ce=0;ce<se.length;ce++)F+=`${q}: ${se[ce]}\r
|
|||
|
|
`;else F+=`${q}: ${se}\r
|
|||
|
|
`}return qN.sendHeaders.hasSubscribers&&qN.sendHeaders.publish({request:t,headers:F,socket:B}),!l||m===0?VN(C,null,e,t,B,f,F,c):Tr.isBuffer(l)?VN(C,l,e,t,B,f,F,c):Tr.isBlobLike(l)?typeof l.stream=="function"?JN(C,l.stream(),e,t,B,f,F,c):zle(C,l,e,t,B,f,F,c):Tr.isStream(l)?Wle(C,l,e,t,B,f,F,c):Tr.isIterable(l)?JN(C,l,e,t,B,f,F,c):kr(!1),!0}function Wle(e,t,r,n,i,s,o,u){kr(s!==0||r[lo]===0,"stream body cannot be pipelined");let l=!1,p=new VC({abort:e,socket:i,request:n,contentLength:s,client:r,expectsPayload:u,header:o}),f=function(C){if(!l)try{!p.write(C)&&this.pause&&this.pause()}catch(F){Tr.destroy(this,F)}},c=function(){l||t.resume&&t.resume()},m=function(){if(queueMicrotask(()=>{t.removeListener("error",B)}),!l){let C=new WN;queueMicrotask(()=>B(C))}},B=function(C){if(!l){if(l=!0,kr(i.destroyed||i[Sp]&&r[lo]<=1),i.off("drain",c).off("error",B),t.removeListener("data",f).removeListener("end",B).removeListener("close",m),!C)try{p.end()}catch(F){C=F}p.destroy(C),C&&(C.code!=="UND_ERR_INFO"||C.message!=="reset")?Tr.destroy(t,C):Tr.destroy(t)}};t.on("data",f).on("end",B).on("error",B).on("close",m),t.resume&&t.resume(),i.on("drain",c).on("error",B),t.errorEmitted??t.errored?setImmediate(()=>B(t.errored)):(t.endEmitted??t.readableEnded)&&setImmediate(()=>B(null)),(t.closeEmitted??t.closed)&&setImmediate(m)}function VN(e,t,r,n,i,s,o,u){try{t?Tr.isBuffer(t)&&(kr(s===t.byteLength,"buffer body must have content length"),i.cork(),i.write(`${o}content-length: ${s}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),i.write(t),i.uncork(),n.onBodySent(t),!u&&n.reset!==!1&&(i[oa]=!0)):s===0?i.write(`${o}content-length: 0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"):(kr(s===null,"no body must not have content length"),i.write(`${o}\r
|
|||
|
|
`,"latin1")),n.onRequestSent(),r[Fp]()}catch(l){e(l)}}async function zle(e,t,r,n,i,s,o,u){kr(s===t.size,"blob body must have content length");try{if(s!=null&&s!==t.size)throw new zf;let l=Buffer.from(await t.arrayBuffer());i.cork(),i.write(`${o}content-length: ${s}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),i.write(l),i.uncork(),n.onBodySent(l),n.onRequestSent(),!u&&n.reset!==!1&&(i[oa]=!0),r[Fp]()}catch(l){e(l)}}async function JN(e,t,r,n,i,s,o,u){kr(s!==0||r[lo]===0,"iterator body cannot be pipelined");let l=null;function p(){if(l){let m=l;l=null,m()}}let f=()=>new Promise((m,B)=>{kr(l===null),i[Su]?B(i[Su]):l=m});i.on("close",p).on("drain",p);let c=new VC({abort:e,socket:i,request:n,contentLength:s,client:r,expectsPayload:u,header:o});try{for await(let m of t){if(i[Su])throw i[Su];c.write(m)||await f()}c.end()}catch(m){c.destroy(m)}finally{i.off("close",p).off("drain",p)}}var VC=class{constructor({abort:t,socket:r,request:n,contentLength:i,client:s,expectsPayload:o,header:u}){this.socket=r,this.request=n,this.contentLength=i,this.client=s,this.bytesWritten=0,this.expectsPayload=o,this.header=u,this.abort=t,r[Sp]=!0}write(t){let{socket:r,request:n,contentLength:i,client:s,bytesWritten:o,expectsPayload:u,header:l}=this;if(r[Su])throw r[Su];if(r.destroyed)return!1;let p=Buffer.byteLength(t);if(!p)return!0;if(i!==null&&o+p>i){if(s[Tx])throw new zf;process.emitWarning(new zf)}r.cork(),o===0&&(!u&&n.reset!==!1&&(r[oa]=!0),i===null?r.write(`${l}transfer-encoding: chunked\r
|
|||
|
|
`,"latin1"):r.write(`${l}content-length: ${i}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1")),i===null&&r.write(`\r
|
|||
|
|
${p.toString(16)}\r
|
|||
|
|
`,"latin1"),this.bytesWritten+=p;let f=r.write(t);return r.uncork(),n.onBodySent(t),f||r[es].timeout&&r[es].timeoutType===f0&&r[es].timeout.refresh&&r[es].timeout.refresh(),f}end(){let{socket:t,contentLength:r,client:n,bytesWritten:i,expectsPayload:s,header:o,request:u}=this;if(u.onRequestSent(),t[Sp]=!1,t[Su])throw t[Su];if(!t.destroyed){if(i===0?s?t.write(`${o}content-length: 0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"):t.write(`${o}\r
|
|||
|
|
`,"latin1"):r===null&&t.write(`\r
|
|||
|
|
0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),r!==null&&i!==r){if(n[Tx])throw new zf;process.emitWarning(new zf)}t[es].timeout&&t[es].timeoutType===f0&&t[es].timeout.refresh&&t[es].timeout.refresh(),n[Fp]()}}destroy(t){let{socket:r,client:n,abort:i}=this;r[Sp]=!1,t&&(kr(n[lo]<=1,"pipeline should only contain this request"),i(t))}};ZN.exports=Ple});var oT=de((Gke,sT)=>{"use strict";var Ru=require("node:assert"),{pipeline:Kle}=require("node:stream"),In=Yr(),{RequestContentLengthMismatchError:Hx,RequestAbortedError:Zle,SocketError:Km,InformationalError:JC}=dn(),{kUrl:zC,kReset:KC,kClient:Kf,kRunning:ZC,kPending:Xle,kQueue:Qp,kPendingIdx:qx,kRunningIdx:mc,kError:Ec,kSocket:ls,kStrictContentLength:eAe,kOnError:XC,kMaxConcurrentStreams:iT,kHTTP2Session:ol,kResume:IA,kSize:tAe,kHTTPContext:jx,kClosed:$x,kBodyTimeout:rAe}=li(),{channels:eT}=dA(),Qu=Symbol("open streams"),tT,WC;try{WC=require("node:http2")}catch{WC={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:nAe,HTTP2_HEADER_METHOD:iAe,HTTP2_HEADER_PATH:sAe,HTTP2_HEADER_SCHEME:oAe,HTTP2_HEADER_CONTENT_LENGTH:aAe,HTTP2_HEADER_EXPECT:uAe,HTTP2_HEADER_STATUS:cAe}}=WC;function lAe(e){let t=[];for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let i of n)t.push(Buffer.from(r),Buffer.from(i));else t.push(Buffer.from(r),Buffer.from(n));return t}async function AAe(e,t){e[ls]=t;let r=WC.connect(e[zC],{createConnection:()=>t,peerMaxConcurrentStreams:e[iT],settings:{enablePush:!1}});return r[Qu]=0,r[Kf]=e,r[ls]=t,r[ol]=null,In.addListener(r,"error",fAe),In.addListener(r,"frameError",hAe),In.addListener(r,"end",dAe),In.addListener(r,"goaway",gAe),In.addListener(r,"close",mAe),r.unref(),e[ol]=r,t[ol]=r,In.addListener(t,"error",yAe),In.addListener(t,"end",CAe),In.addListener(t,"close",EAe),t[$x]=!1,t.on("close",vAe),{version:"h2",defaultPipelining:1/0,write(n){return IAe(e,n)},resume(){pAe(e)},destroy(n,i){t[$x]?queueMicrotask(i):t.destroy(n).on("close",i)},get destroyed(){return t.destroyed},busy(){return!1}}}function pAe(e){let t=e[ls];t?.destroyed===!1&&(e[tAe]===0||e[iT]===0?(t.unref(),e[ol].unref()):(t.ref(),e[ol].ref()))}function fAe(e){Ru(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[ls][Ec]=e,this[Kf][XC](e)}function hAe(e,t,r){if(r===0){let n=new JC(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[ls][Ec]=n,this[Kf][XC](n)}}function dAe(){let e=new Km("other side closed",In.getSocketInfo(this[ls]));this.destroy(e),In.destroy(this[ls],e)}function gAe(e){let t=this[Ec]||new Km(`HTTP/2: "GOAWAY" frame received with code ${e}`,In.getSocketInfo(this[ls])),r=this[Kf];if(r[ls]=null,r[jx]=null,this.close(),this[ol]=null,In.destroy(this[ls],t),r[mc]<r[Qp].length){let n=r[Qp][r[mc]];r[Qp][r[mc]++]=null,In.errorRequest(r,n,t),r[qx]=r[mc]}Ru(r[ZC]===0),r.emit("disconnect",r[zC],[r],t),r[IA]()}function mAe(){let{[Kf]:e}=this,{[ls]:t}=e,r=this[ls][Ec]||this[Ec]||new Km("closed",In.getSocketInfo(t));if(e[ls]=null,e[jx]=null,e.destroyed){Ru(e[Xle]===0);let n=e[Qp].splice(e[mc]);for(let i=0;i<n.length;i++){let s=n[i];In.errorRequest(e,s,r)}}}function EAe(){let e=this[Ec]||new Km("closed",In.getSocketInfo(this)),t=this[ol][Kf];t[ls]=null,t[jx]=null,this[ol]!==null&&this[ol].destroy(e),t[qx]=t[mc],Ru(t[ZC]===0),t.emit("disconnect",t[zC],[t],e),t[IA]()}function yAe(e){Ru(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Ec]=e,this[Kf][XC](e)}function CAe(){In.destroy(this,new Km("other side closed",In.getSocketInfo(this)))}function vAe(){this[$x]=!0}function BAe(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}function IAe(e,t){let r=t.bodyTimeout??e[rAe],n=e[ol],{method:i,path:s,host:o,upgrade:u,expectContinue:l,signal:p,headers:f}=t,{body:c}=t;if(u)return In.errorRequest(e,t,new Error("Upgrade not supported for H2")),!1;let m={};for(let pe=0;pe<f.length;pe+=2){let De=f[pe+0],me=f[pe+1];if(Array.isArray(me))for(let Ie=0;Ie<me.length;Ie++)m[De]?m[De]+=`,${me[Ie]}`:m[De]=me[Ie];else m[De]=me}let B=null,{hostname:C,port:F}=e[zC];m[nAe]=o||`${C}${F?`:${F}`:""}`,m[iAe]=i;let H=pe=>{t.aborted||t.completed||(pe=pe||new Zle,In.errorRequest(e,t,pe),B!=null&&(B.removeAllListeners("data"),B.close()
|
|||
|
|
`;eT.sendHeaders.publish({request:t,headers:pe,socket:n[ls]})}let ce=i==="GET"||i==="HEAD"||c===null;return l?(m[uAe]="100-continue",B=n.request(m,{endStream:ce,signal:p}),B.once("continue",Ce)):(B=n.request(m,{endStream:ce,signal:p}),Ce()),++n[Qu],B.setTimeout(r),B.once("response",pe=>{let{[cAe]:De,...me}=pe;if(t.onResponseStarted(),t.aborted){B.removeAllListeners("data");return}t.onHeaders(Number(De),lAe(me),B.resume.bind(B),"")===!1&&B.pause()}),B.on("data",pe=>{t.onData(pe)===!1&&B.pause()}),B.once("end",pe=>{B.removeAllListeners("data"),B.state?.state==null||B.state.state<6?(!t.aborted&&!t.completed&&t.onComplete({}),e[Qp][e[mc]++]=null,e[IA]()):(--n[Qu],n[Qu]===0&&n.unref(),H(pe??new JC("HTTP/2: stream half-closed (remote)")),e[Qp][e[mc]++]=null,e[qx]=e[mc],e[IA]())}),B.once("close",()=>{B.removeAllListeners("data"),n[Qu]-=1,n[Qu]===0&&n.unref()}),B.once("error",function(pe){B.removeAllListeners("data"),H(pe)}),B.once("frameError",(pe,De)=>{B.removeAllListeners("data"),H(new JC(`HTTP/2: "frameError" received - type ${pe}, code ${De}`))}),B.on("aborted",()=>{B.removeAllListeners("data")}),B.on("timeout",()=>{let pe=new JC(`HTTP/2: "stream timeout after ${r}"`);B.removeAllListeners("data"),n[Qu]-=1,n[Qu]===0&&n.unref(),H(pe)}),B.once("trailers",pe=>{t.aborted||t.completed||t.onComplete(pe)}),!0;function Ce(){!c||se===0?rT(H,B,null,e,t,e[ls],se,q):In.isBuffer(c)?rT(H,B,c,e,t,e[ls],se,q):In.isBlobLike(c)?typeof c.stream=="function"?nT(H,B,c.stream(),e,t,e[ls],se,q):bAe(H,B,c,e,t,e[ls],se,q):In.isStream(c)?wAe(H,e[ls],q,B,c,e,t,se):In.isIterable(c)?nT(H,B,c,e,t,e[ls],se,q):Ru(!1)}}function rT(e,t,r,n,i,s,o,u){try{r!=null&&In.isBuffer(r)&&(Ru(o===r.byteLength,"buffer body must have content length"),t.cork(),t.write(r),t.uncork(),t.end(),i.onBodySent(r)),u||(s[KC]=!0),i.onRequestSent(),n[IA]()}catch(l){e(l)}}function wAe(e,t,r,n,i,s,o,u){Ru(u!==0||s[ZC]===0,"stream body cannot be pipelined");let l=Kle(i,n,f=>{f?(In.destroy(l,f),e(f)):(In.removeAllListeners(l),o.onRequestSent(),r||(t[KC]=!0),s[IA]())});In.addListener(l,"data",p);function p(f){o.onBodySent(f)}}async function bAe(e,t,r,n,i,s,o,u){Ru(o===r.size,"blob body must have content length");try{if(o!=null&&o!==r.size)throw new Hx;let l=Buffer.from(await r.arrayBuffer());t.cork(),t.write(l),t.uncork(),t.end(),i.onBodySent(l),i.onRequestSent(),u||(s[KC]=!0),n[IA]()}catch(l){e(l)}}async function nT(e,t,r,n,i,s,o,u){Ru(o!==0||n[ZC]===0,"iterator body cannot be pipelined");let l=null;function p(){if(l){let c=l;l=null,c()}}let f=()=>new Promise((c,m)=>{Ru(l===null),s[Ec]?m(s[Ec]):l=c});t.on("close",p).on("drain",p);try{for await(let c of r){if(s[Ec])throw s[Ec];let m=t.write(c);i.onBodySent(c),m||await f()}t.end(),i.onRequestSent(),u||(s[KC]=!0),n[IA]()}catch(c){e(c)}finally{t.off("close",p).off("drain",p)}}sT.exports=AAe});var Q1=de((Yke,hT)=>{"use strict";var wA=require("node:assert"),lT=require("node:net"),Zm=require("node:http"),Zf=Yr(),{channels:h0}=dA(),DAe=D3(),xAe=i0(),{InvalidArgumentError:As,InformationalError:FAe,ClientDestroyedError:SAe}=dn(),QAe=km(),{kUrl:cl,kServerName:Rp,kClient:RAe,kBusy:Gx,kConnect:_Ae,kResuming:Xf,kRunning:I1,kPending:x1,kSize:B1,kQueue:yc,kConnected:kAe,kConnecting:d0,kNeedDrain:kp,kKeepAliveDefaultTimeout:aT,kHostHeader:NAe,kPendingIdx:Cc,kRunningIdx:DA,kError:TAe,kPipelining:rv,kKeepAliveTimeoutValue:OAe,kMaxHeadersSize:UAe,kKeepAliveMaxTimeout:MAe,kKeepAliveTimeoutThreshold:LAe,kHeadersTimeout:PAe,kBodyTimeout:HAe,kStrictContentLength:$Ae,kConnector:A1,kMaxRequests:Yx,kCounter:qAe,kClose:jAe,kDestroy:GAe,kDispatch:YAe,kLocalAddress:m1,kMaxResponseSize:VAe,kOnError:JAe,kHTTPContext:ps,kMaxConcurrentStreams:WAe,kResume:v1}=li(),zAe=XN(),KAe=oT(),_p=Symbol("kClosedResolve"),ZAe=Zm&&Zm.maxHeaderSize&&Number.isInteger(Zm.maxHeaderSize)&&Zm.maxHeaderSize>0?()=>Zm.maxHeaderSize:()=>{throw new As("http module not available or http.maxHeaderSize invalid")},uT=()=>{};function AT(e){return e[rv]??e[ps]?.defaultPipelining??1}var Vx=class extends xAe{constructor(t,{maxHeaderSize:r,headersTimeout:n,socketTimeout:i,requestTimeout:s,connectTimeout:o
|
|||
|
|
`,this[HAe]=u??3e5,this[PAe]=n??3e5,this[$Ae]=q??!0,this[Yx]=Ce,this[_p]=null,this[VAe]=De>-1?De:-1,this[WAe]=je??100,this[ps]=null,this[yc]=[],this[DA]=0,this[Cc]=0,this[v1]=he=>Jx(this,he),this[JAe]=he=>pT(this,he)}get pipelining(){return this[rv]}set pipelining(t){this[rv]=t,this[v1](!0)}get[x1](){return this[yc].length-this[Cc]}get[I1](){return this[Cc]-this[DA]}get[B1](){return this[yc].length-this[DA]}get[kAe](){return!!this[ps]&&!this[d0]&&!this[ps].destroyed}get[Gx](){return!!(this[ps]?.busy(null)||this[B1]>=(AT(this)||1)||this[x1]>0)}[_Ae](t){fT(this),this.once("connect",t)}[YAe](t,r){let n=t.origin||this[cl].origin,i=new DAe(n,t,r);return this[yc].push(i),this[Xf]||(Zf.bodyLength(i.body)==null&&Zf.isIterable(i.body)?(this[Xf]=1,queueMicrotask(()=>Jx(this))):this[v1](!0)),this[Xf]&&this[kp]!==2&&this[Gx]&&(this[kp]=2),this[kp]<2}async[jAe](){return new Promise(t=>{this[B1]?this[_p]=t:t(null)})}async[GAe](t){return new Promise(r=>{let n=this[yc].splice(this[Cc]);for(let s=0;s<n.length;s++){let o=n[s];Zf.errorRequest(this,o,t)}let i=()=>{this[_p]&&(this[_p](),this[_p]=null),r(null)};this[ps]?(this[ps].destroy(t,i),this[ps]=null):queueMicrotask(i),this[v1]()})}};function pT(e,t){if(e[I1]===0&&t.code!=="UND_ERR_INFO"&&t.code!=="UND_ERR_SOCKET"){wA(e[Cc]===e[DA]);let r=e[yc].splice(e[DA]);for(let n=0;n<r.length;n++){let i=r[n];Zf.errorRequest(e,i,t)}wA(e[B1]===0)}}async function fT(e){wA(!e[d0]),wA(!e[ps]);let{host:t,hostname:r,protocol:n,port:i}=e[cl];if(r[0]==="["){let s=r.indexOf("]");wA(s!==-1);let o=r.substring(1,s);wA(lT.isIPv6(o)),r=o}e[d0]=!0,h0.beforeConnect.hasSubscribers&&h0.beforeConnect.publish({connectParams:{host:t,hostname:r,protocol:n,port:i,version:e[ps]?.version,servername:e[Rp],localAddress:e[m1]},connector:e[A1]});try{let s=await new Promise((o,u)=>{e[A1]({host:t,hostname:r,protocol:n,port:i,servername:e[Rp],localAddress:e[m1]},(l,p)=>{l?u(l):o(p)})});if(e.destroyed){Zf.destroy(s.on("error",uT),new SAe);return}wA(s);try{e[ps]=s.alpnProtocol==="h2"?await KAe(e,s):await zAe(e,s)}catch(o){throw s.destroy().on("error",uT),o}e[d0]=!1,s[qAe]=0,s[Yx]=e[Yx],s[RAe]=e,s[TAe]=null,h0.connected.hasSubscribers&&h0.connected.publish({connectParams:{host:t,hostname:r,protocol:n,port:i,version:e[ps]?.version,servername:e[Rp],localAddress:e[m1]},connector:e[A1],socket:s}),e.emit("connect",e[cl],[e])}catch(s){if(e.destroyed)return;if(e[d0]=!1,h0.connectError.hasSubscribers&&h0.connectError.publish({connectParams:{host:t,hostname:r,protocol:n,port:i,version:e[ps]?.version,servername:e[Rp],localAddress:e[m1]},connector:e[A1],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(wA(e[I1]===0);e[x1]>0&&e[yc][e[Cc]].servername===e[Rp];){let o=e[yc][e[Cc]++];Zf.errorRequest(e,o,s)}else pT(e,s);e.emit("connectionError",e[cl],[e],s)}e[v1]()}function cT(e){e[kp]=0,e.emit("drain",e[cl],[e])}function Jx(e,t){e[Xf]!==2&&(e[Xf]=2,XAe(e,t),e[Xf]=0,e[DA]>256&&(e[yc].splice(0,e[DA]),e[Cc]-=e[DA],e[DA]=0))}function XAe(e,t){for(;;){if(e.destroyed){wA(e[x1]===0);return}if(e[_p]&&!e[B1]){e[_p](),e[_p]=null;return}if(e[ps]&&e[ps].resume(),e[Gx])e[kp]=2;else if(e[kp]===2){t?(e[kp]=1,queueMicrotask(()=>cT(e))):cT(e);continue}if(e[x1]===0||e[I1]>=(AT(e)||1))return;let r=e[yc][e[Cc]];if(e[cl].protocol==="https:"&&e[Rp]!==r.servername){if(e[I1]>0)return;e[Rp]=r.servername,e[ps]?.destroy(new FAe("servername changed"),()=>{e[ps]=null,Jx(e)})}if(e[d0])return;if(!e[ps]){fT(e);return}if(e[ps].destroyed||e[ps].busy(r))return;!r.aborted&&e[ps].write(r)?e[Cc]++:e[yc].splice(e[Cc],1)}}hT.exports=Vx});var Wx=de((Jke,dT)=>{"use strict";var nv=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048).fill(void 0),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(t){this.list[this.top]=t,this.top=this.top+1&2047}shift(){let t=this.list[this.bottom];return t===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,t)}};dT.exports=class{constructor(){this.head=this.tail=new nv}isEmpty(){return this.head.isEmpty()}push(t){this.head.isFull()&&(this.head=this.head.nex
|
|||
|
|
|
|||
|
|
${t.format(r)}`.trim():`${r.length} interceptors are pending:
|
|||
|
|
|
|||
|
|
${t.format(r)}`.trim())}};IU.exports=tS});var wv=de((v3e,FU)=>{"use strict";var bU=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Rhe}=dn(),_he=m0();xU()===void 0&&DU(new _he);function DU(e){if(!e||typeof e.dispatch!="function")throw new Rhe("Argument agent must implement Agent");Object.defineProperty(globalThis,bU,{value:e,writable:!0,enumerable:!1,configurable:!1})}function xU(){return globalThis[bU]}FU.exports={setGlobalDispatcher:DU,getGlobalDispatcher:xU}});var q1=de((I3e,SU)=>{"use strict";var SA=require("node:assert"),khe=bC();SU.exports=class{#e;#t=!1;#r=!1;#n=!1;constructor(t){if(typeof t!="object"||t===null)throw new TypeError("handler must be an object");this.#e=khe.wrap(t)}onRequestStart(...t){this.#e.onRequestStart?.(...t)}onRequestUpgrade(...t){return SA(!this.#t),SA(!this.#r),this.#e.onRequestUpgrade?.(...t)}onResponseStart(...t){return SA(!this.#t),SA(!this.#r),SA(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...t)}onResponseData(...t){return SA(!this.#t),SA(!this.#r),this.#e.onResponseData?.(...t)}onResponseEnd(...t){return SA(!this.#t),SA(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...t)}onResponseError(...t){return this.#r=!0,this.#e.onResponseError?.(...t)}onBodySent(){}}});var xS=de((w3e,NU)=>{"use strict";var Ga=Yr(),{kBodyUsed:j1}=li(),cS=require("node:assert"),{InvalidArgumentError:QU}=dn(),Nhe=require("node:events"),The=[300,301,302,303,307,308],RU=Symbol("body"),_U=()=>{},bv=class{constructor(t){this[RU]=t,this[j1]=!1}async*[Symbol.asyncIterator](){cS(!this[j1],"disturbed"),this[j1]=!0,yield*this[RU]}},rS=class e{static buildDispatch(t,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new QU("maxRedirections must be a positive number");let n=t.dispatch.bind(t);return(i,s)=>n(i,new e(n,r,i,s))}constructor(t,r,n,i){if(r!=null&&(!Number.isInteger(r)||r<0))throw new QU("maxRedirections must be a positive number");this.dispatch=t,this.location=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=i,this.history=[],Ga.isStream(this.opts.body)?(Ga.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){cS(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[j1]=!1,Nhe.prototype.on.call(this.opts.body,"data",function(){this[j1]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new bv(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&Ga.isIterable(this.opts.body)&&!Ga.isFormDataLike(this.opts.body)&&(this.opts.body=new bv(this.opts.body))}onRequestStart(t,r){this.handler.onRequestStart?.(t,{...r,history:this.history})}onRequestUpgrade(t,r,n,i){this.handler.onRequestUpgrade?.(t,r,n,i)}onResponseStart(t,r,n,i){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",Ga.isStream(this.opts.body)&&Ga.destroy(this.opts.body.on("error",_U)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",Ga.isStream(this.opts.body)&&Ga.destroy(this.opts.body.on("error",_U)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||Ga.isDisturbed(this.opts.body)||The.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(t,r,n,i);return}let{origin:s,pathname:o,search:u}=Ga.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),l=u?`${o}${u}`:o;this.opts.headers=Ohe(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=l,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null}onResponseData(t,r){this.location||this.handler.onResponseData?.(t,r)}onResponseEnd(t,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(t,r)}onResponseError(t,r){this.handler.onResponseError?.(t,r)}};function kU(e,t,r){if(e.length===4)return Ga.headerNameToString(e)==="host";if(t&&Ga.headerNameToString(e).startsWith("content-"))return!0;if(r&&(e.length===
|
|||
|
|
CREATE TABLE IF NOT EXISTS cacheInterceptorV${Mo} (
|
|||
|
|
-- Data specific to us
|
|||
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|||
|
|
url TEXT NOT NULL,
|
|||
|
|
method TEXT NOT NULL,
|
|||
|
|
|
|||
|
|
-- Data returned to the interceptor
|
|||
|
|
body BUF NULL,
|
|||
|
|
deleteAt INTEGER NOT NULL,
|
|||
|
|
statusCode INTEGER NOT NULL,
|
|||
|
|
statusMessage TEXT NOT NULL,
|
|||
|
|
headers TEXT NULL,
|
|||
|
|
cacheControlDirectives TEXT NULL,
|
|||
|
|
etag TEXT NULL,
|
|||
|
|
vary TEXT NULL,
|
|||
|
|
cachedAt INTEGER NOT NULL,
|
|||
|
|
staleAt INTEGER NOT NULL
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${Mo}_url ON cacheInterceptorV${Mo}(url);
|
|||
|
|
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${Mo}_method ON cacheInterceptorV${Mo}(method);
|
|||
|
|
CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${Mo}_deleteAt ON cacheInterceptorV${Mo}(deleteAt);
|
|||
|
|
`),this.#n=this.#r.prepare(`
|
|||
|
|
SELECT
|
|||
|
|
id,
|
|||
|
|
body,
|
|||
|
|
deleteAt,
|
|||
|
|
statusCode,
|
|||
|
|
statusMessage,
|
|||
|
|
headers,
|
|||
|
|
etag,
|
|||
|
|
cacheControlDirectives,
|
|||
|
|
vary,
|
|||
|
|
cachedAt,
|
|||
|
|
staleAt
|
|||
|
|
FROM cacheInterceptorV${Mo}
|
|||
|
|
WHERE
|
|||
|
|
url = ?
|
|||
|
|
AND method = ?
|
|||
|
|
ORDER BY
|
|||
|
|
deleteAt ASC
|
|||
|
|
`),this.#s=this.#r.prepare(`
|
|||
|
|
UPDATE cacheInterceptorV${Mo} SET
|
|||
|
|
body = ?,
|
|||
|
|
deleteAt = ?,
|
|||
|
|
statusCode = ?,
|
|||
|
|
statusMessage = ?,
|
|||
|
|
headers = ?,
|
|||
|
|
etag = ?,
|
|||
|
|
cacheControlDirectives = ?,
|
|||
|
|
cachedAt = ?,
|
|||
|
|
staleAt = ?
|
|||
|
|
WHERE
|
|||
|
|
id = ?
|
|||
|
|
`),this.#i=this.#r.prepare(`
|
|||
|
|
INSERT INTO cacheInterceptorV${Mo} (
|
|||
|
|
url,
|
|||
|
|
method,
|
|||
|
|
body,
|
|||
|
|
deleteAt,
|
|||
|
|
statusCode,
|
|||
|
|
statusMessage,
|
|||
|
|
headers,
|
|||
|
|
etag,
|
|||
|
|
cacheControlDirectives,
|
|||
|
|
vary,
|
|||
|
|
cachedAt,
|
|||
|
|
staleAt
|
|||
|
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|||
|
|
`),this.#o=this.#r.prepare(`DELETE FROM cacheInterceptorV${Mo} WHERE url = ?`),this.#a=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${Mo}`),this.#u=this.#r.prepare(`DELETE FROM cacheInterceptorV${Mo} WHERE deleteAt <= ?`),this.#c=this.#t===1/0?null:this.#r.prepare(`
|
|||
|
|
DELETE FROM cacheInterceptorV${Mo}
|
|||
|
|
WHERE id IN (
|
|||
|
|
SELECT
|
|||
|
|
id
|
|||
|
|
FROM cacheInterceptorV${Mo}
|
|||
|
|
ORDER BY cachedAt DESC
|
|||
|
|
LIMIT ?
|
|||
|
|
)
|
|||
|
|
`)}close(){this.#r.close()}get(t){VS(t);let r=this.#A(t);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(t,r){VS(t);let n=this.#l(t),i=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=i?.byteLength;if(s&&s>this.#e)return;let o=this.#A(t,!0);o?this.#s.run(i,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,o.id):(this.#p(),this.#i.run(n,t.method,i,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt))}createWriteStream(t,r){VS(t),Lde(r);let n=0,i=[],s=this;return new Mde({decodeStrings:!0,write(o,u,l){n+=o.byteLength,n<s.#e?i.push(o):this.destroy(),l()},final(o){s.set(t,{...r,body:i}),o()}})}delete(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);this.#o.run(this.#l(t))}#p(){if(this.size<=this.#t)return 0;{let t=this.#u.run(Date.now()).changes;if(t)return t}{let t=this.#c?.run(Math.max(Math.floor(this.#t*.1),1)).changes;if(t)return t}return 0}get size(){let{total:t}=this.#a.get();return t}#l(t){return`${t.origin}/${t.path}`}#A(t,r=!1){let n=this.#l(t),{headers:i,method:s}=t,o=this.#n.all(n,s);if(o.length===0)return;let u=Date.now();for(let l of o){if(u>=l.deleteAt&&!r)return;let p=!0;if(l.vary){let f=JSON.parse(l.vary);for(let c in f)if(!Pde(i[c],f[c])){p=!1;break}}if(p)return l}}};function Pde(e,t){return e==null&&t==null?!0:e==null&&t!=null||e!=null&&t==null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:e.every((r,n)=>r===t[n]):e===t}});var Ch=de((M3e,iM)=>{"use strict";var{kConstruct:Hde}=li(),{kEnumerableProperty:F0}=Yr(),{iteratorMixin:$de,isValidHeaderName:Y1,isValidHeaderValue:h7}=ko(),{webidl:hn}=no(),WS=require("node:assert"),xv=require("node:util");function f7(e){return e===10||e===13||e===9||e===32}function eM(e){let t=0,r=e.length;for(;r>t&&f7(e.charCodeAt(r-1));)--r;for(;r>t&&f7(e.charCodeAt(t));)++t;return t===0&&r===e.length?e:e.substring(t,r)}function tM(e,t){if(Array.isArray(t))for(let r=0;r<t.length;++r){let n=t[r];if(n.length!==2)throw hn.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${n.length}.`});zS(e,n[0],n[1])}else if(typeof t=="object"&&t!==null){let r=Object.keys(t);for(let n=0;n<r.length;++n)zS(e,r[n],t[r[n]])}else throw hn.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function zS(e,t,r){if(r=eM(r),Y1(t)){if(!h7(r))throw hn.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw hn.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(nM(e)==="immutable")throw new TypeError("immutable");return Sv(e).append(t,r,!1)}function qde(e){let t=Sv(e);if(!t)return[];if(t.sortedMap)return t.sortedMap;let r=[],n=t.toSortedArray(),i=t.cookies;if(i===null||i.length===1)return t.sortedMap=n;for(let s=0;s<n.length;++s){let{0:o,1:u}=n[s];if(o==="set-cookie")for(let l=0;l<i.length;++l)r.push([o,i[l]]);else r.push([o,u])}return t.sortedMap=r}function rM(e,t){return e[0]<t[0]?-1:1}var Fv=class e{cookies=null;sortedMap;headersMap;constructor(t){t instanceof e?(this.headersMap=new Map(t.headersMap),this.sortedMap=t.sortedMap,this.cookies=t.cookies===null?null:[...t.cookies]):(this.headersMap=new Map(t),this.sortedMap=null)}contains(t,r){return this.headersMap.has(r?t:t.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append
|
|||
|
|
${s}`;break;case"retry":iH(s)&&(r[i]=s);break;case"id":sH(s)&&(r[i]=s);break;case"event":s.length>0&&(r[i]=s);break}}processEvent(t){t.retry&&iH(t.retry)&&(this.state.reconnectionTime=parseInt(t.retry,10)),t.id&&sH(t.id)&&(this.state.lastEventId=t.id),t.data!==void 0&&this.push({type:t.event||"message",options:{data:t.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};oH.exports={EventSourceStream:kQ}});var dH=de((cNe,hH)=>{"use strict";var{pipeline:Z1e}=require("node:stream"),{fetching:X1e}=z1(),{makeRequest:eEe}=Q0(),{webidl:_A}=no(),{EventSourceStream:tEe}=aH(),{parseMIMEType:rEe}=Ha(),{createFastMessageEvent:nEe}=nB(),{isNetworkError:uH}=J1(),{delay:iEe}=RQ(),{kEnumerableProperty:Th}=Yr(),{environmentSettingsObject:cH}=ko(),lH=!1,AH=3e3,iE=0,pH=1,oE=2,sEe="anonymous",oEe="use-credentials",L0=class e extends EventTarget{#e={open:null,error:null,message:null};#t;#r=!1;#n=iE;#s=null;#i=null;#u;#o;constructor(t,r={}){super(),_A.util.markAsUncloneable(this);let n="EventSource constructor";_A.argumentLengthCheck(arguments,1,n),lH||(lH=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),t=_A.converters.USVString(t),r=_A.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#u=r.dispatcher,this.#o={lastEventId:"",reconnectionTime:AH};let i=cH,s;try{s=new URL(t,i.settingsObject.baseUrl),this.#o.origin=s.origin}catch(l){throw new DOMException(l,"SyntaxError")}this.#t=s.href;let o=sEe;r.withCredentials===!0&&(o=oEe,this.#r=!0);let u={redirect:"follow",keepalive:!0,mode:"cors",credentials:o==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};u.client=cH.settingsObject,u.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],u.cache="no-store",u.initiator="other",u.urlList=[new URL(this.#t)],this.#s=eEe(u),this.#a()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#a(){if(this.#n===oE)return;this.#n=iE;let t={request:this.#s,dispatcher:this.#u},r=n=>{uH(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#c()};t.processResponseEndOfBody=r,t.processResponse=n=>{if(uH(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#c();return}let i=n.headersList.get("content-type",!0),s=i!==null?rEe(i):"failure",o=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||o===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=pH,this.dispatchEvent(new Event("open")),this.#o.origin=n.urlList[n.urlList.length-1].origin;let u=new tEe({eventSourceSettings:this.#o,push:l=>{this.dispatchEvent(nEe(l.type,l.options))}});Z1e(n.body.stream,u,l=>{l?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#i=X1e(t)}async#c(){this.#n!==oE&&(this.#n=iE,this.dispatchEvent(new Event("error")),await iEe(this.#o.reconnectionTime),this.#n===iE&&(this.#o.lastEventId.length&&this.#s.headersList.set("last-event-id",this.#o.lastEventId,!0),this.#a()))}close(){_A.brandCheck(this,e),this.#n!==oE&&(this.#n=oE,this.#i.abort(),this.#s=null)}get onopen(){return this.#e.open}set onopen(t){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(t){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(t){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}},fH={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:iE,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:pH,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:oE,writable:!1}};Object.defineProperties(L0,fH);Object.defineProperties(L0.prototype,fH);Object.def
|
|||
|
|
at `+e[r].toString();return t}function qye(e){if(!e)throw new TypeError("argument namespace is required");var t=pI(),r=V0(t[1]),n=r[0];function i(s){AI.call(i,s)}return i._file=n,i._ignored=Gye(e),i._namespace=e,i._traced=Yye(e),i._warned=Object.create(null),i.function=zye,i.property=Kye,i}function jye(e,t){var r=typeof e.listenerCount!="function"?e.listeners(t).length:e.listenerCount(t);return r>0}function Gye(e){if(process.noDeprecation)return!0;var t=process.env.NO_DEPRECATION||"";return a$(t,e)}function Yye(e){if(process.traceDeprecation)return!0;var t=process.env.TRACE_DEPRECATION||"";return a$(t,e)}function AI(e,t){var r=jye(process,"deprecation");if(!(!r&&this._ignored)){var n,i,s,o,u=0,l=!1,p=pI(),f=this._file;for(t?(o=t,s=V0(p[1]),s.name=o.name,f=s[0]):(u=2,o=V0(p[u]),s=o);u<p.length;u++)if(n=V0(p[u]),i=n[0],i===f)l=!0;else if(i===this._file)f=this._file;else if(l)break;var c=n?o.join(":")+"__"+n.join(":"):void 0;if(!(c!==void 0&&c in this._warned)){this._warned[c]=!0;var m=e;if(m||(m=s===o||!s.name?o$(o):o$(s)),r){var B=u$(this._namespace,m,p.slice(u));process.emit("deprecation",B);return}var C=process.stderr.isTTY?Jye:Vye,F=C.call(this,m,n,p.slice(u));process.stderr.write(F+`
|
|||
|
|
`,"utf8")}}}function V0(e){var t=e.getFileName()||"<anonymous>",r=e.getLineNumber(),n=e.getColumnNumber();e.isEval()&&(t=e.getEvalOrigin()+", "+t);var i=[t,r,n];return i.callSite=e,i.name=e.getFunctionName(),i}function o$(e){var t=e.callSite,r=e.name;r||(r="<anonymous@"+r5(e)+">");var n=t.getThis(),i=n&&t.getTypeName();return i==="Object"&&(i=void 0),i==="Function"&&(i=n.name||i),i&&t.getMethodName()?i+"."+r:r}function Vye(e,t,r){var n=new Date().toUTCString(),i=n+" "+this._namespace+" deprecated "+e;if(this._traced){for(var s=0;s<r.length;s++)i+=`
|
|||
|
|
at `+r[s].toString();return i}return t&&(i+=" at "+r5(t)),i}function Jye(e,t,r){var n="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+e+"\x1B[39m";if(this._traced){for(var i=0;i<r.length;i++)n+=`
|
|||
|
|
\x1B[36mat `+r[i].toString()+"\x1B[39m";return n}return t&&(n+=" \x1B[36m"+r5(t)+"\x1B[39m"),n}function r5(e){return Mye(Lye,e[0])+":"+e[1]+":"+e[2]}function pI(){var e=Error.stackTraceLimit,t={},r=Error.prepareStackTrace;Error.prepareStackTrace=Wye,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(t);var n=t.stack.slice(1);return Error.prepareStackTrace=r,Error.stackTraceLimit=e,n}function Wye(e,t){return t}function zye(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");var r=Hye(e.length),n=pI(),i=V0(n[1]);i.name=e.name;var s=new Function("fn","log","deprecate","message","site",`"use strict"
|
|||
|
|
return function (`+r+`) {log.call(deprecate, message, site)
|
|||
|
|
return fn.apply(this, arguments)
|
|||
|
|
}`)(e,AI,this,t,i);return s}function Kye(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable");var i=this,s=pI(),o=V0(s[1]);o.name=t,"value"in n&&(n=Pye(e,t,r));var u=n.get,l=n.set;typeof u=="function"&&(n.get=function(){return AI.call(i,r,o),u.apply(this,arguments)}),typeof l=="function"&&(n.set=function(){return AI.call(i,r,o),l.apply(this,arguments)}),Object.defineProperty(e,t,n)}function u$(e,t,r){var n=new Error,i;return Object.defineProperty(n,"constructor",{value:u$}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return i!==void 0?i:i=$ye.call(this,r)},set:function(o){i=o}}),n}});var J0=de((RNe,fI)=>{"use strict";fI.exports=tCe;fI.exports.format=l$;fI.exports.parse=A$;var Zye=/\B(?=(\d{3})+(?!\d))/g,Xye=/(?:\.0*|(\.[^0]+)0+)$/,Pp={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},eCe=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function tCe(e,t){return typeof e=="string"?A$(e):typeof e=="number"?l$(e,t):null}function l$(e,t){if(!Number.isFinite(e))return null;var r=Math.abs(e),n=t&&t.thousandsSeparator||"",i=t&&t.unitSeparator||"",s=t&&t.decimalPlaces!==void 0?t.decimalPlaces:2,o=!!(t&&t.fixedDecimals),u=t&&t.unit||"";(!u||!Pp[u.toLowerCase()])&&(r>=Pp.pb?u="PB":r>=Pp.tb?u="TB":r>=Pp.gb?u="GB":r>=Pp.mb?u="MB":r>=Pp.kb?u="KB":u="B");var l=e/Pp[u.toLowerCase()],p=l.toFixed(s);return o||(p=p.replace(Xye,"$1")),n&&(p=p.split(".").map(function(f,c){return c===0?f.replace(Zye,n):f}).join(".")),p+i+u}function A$(e){if(typeof e=="number"&&!isNaN(e))return e;if(typeof e!="string")return null;var t=eCe.exec(e),r,n="b";return t?(r=parseFloat(t[1]),n=t[4].toLowerCase()):(r=parseInt(e,10),n="b"),isNaN(r)?null:Math.floor(Pp[n]*r)}});var lE=de(n5=>{"use strict";var p$=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,rCe=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,f$=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,nCe=/\\([\u000b\u0020-\u00ff])/g,iCe=/([\\"])/g,h$=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;n5.format=sCe;n5.parse=oCe;function sCe(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!h$.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var i,s=Object.keys(t).sort(),o=0;o<s.length;o++){if(i=s[o],!f$.test(i))throw new TypeError("invalid parameter name");n+="; "+i+"="+uCe(t[i])}return n}function oCe(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?aCe(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!h$.test(n))throw new TypeError("invalid media type");var i=new cCe(n.toLowerCase());if(r!==-1){var s,o,u;for(p$.lastIndex=r;o=p$.exec(t);){if(o.index!==r)throw new TypeError("invalid parameter format");r+=o[0].length,s=o[1].toLowerCase(),u=o[2],u.charCodeAt(0)===34&&(u=u.slice(1,-1),u.indexOf("\\")!==-1&&(u=u.replace(nCe,"$1"))),i.parameters[s]=u}if(r!==t.length)throw new TypeError("invalid parameter format")}return i}function aCe(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function uCe(e){var t=String(e);if(f$.test(t))return t;if(t.length>0&&!rCe.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(iCe,"\\$1")+'"'}funct
|
|||
|
|
`).map(function(t){return t.trim()}).join(" ")};Ys.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,mE.inspect(e,this.inspectOpts)};function PCe(e){var t=this.namespace,r=this.useColors;if(r){var n=this.color,i=" \x1B[3"+n+";1m"+t+" \x1B[0m";e[0]=i+e[0].split(`
|
|||
|
|
`).join(`
|
|||
|
|
`+i),e.push("\x1B[3"+n+"m+"+Ys.humanize(this.diff)+"\x1B[0m")}else e[0]=new Date().toUTCString()+" "+t+" "+e[0]}function HCe(){return MCe.write(mE.format.apply(mE,arguments)+`
|
|||
|
|
`)}function $Ce(e){e==null?delete process.env.DEBUG:process.env.DEBUG=e}function N$(){return process.env.DEBUG}function qCe(e){var t,r=process.binding("tty_wrap");switch(r.guessHandleType(e)){case"TTY":t=new k$.WriteStream(e),t._type="tty",t._handle&&t._handle.unref&&t._handle.unref();break;case"FILE":var n=require("fs");t=new n.SyncWriteStream(e,{autoClose:!1}),t._type="fs";break;case"PIPE":case"TCP":var i=require("net");t=new i.Socket({fd:e,readable:!1,writable:!0}),t.readable=!1,t.read=null,t._type="pipe",t._handle&&t._handle.unref&&t._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return t.fd=e,t._isStdio=!0,t}function jCe(e){e.inspectOpts={};for(var t=Object.keys(Ys.inspectOpts),r=0;r<t.length;r++)e.inspectOpts[t[r]]=Ys.inspectOpts[t[r]]}Ys.enable(N$())});var Ou=de((HNe,p5)=>{typeof process<"u"&&process.type==="renderer"?p5.exports=_$():p5.exports=O$()});var f5=de(($Ne,M$)=>{"use strict";var GCe=require("events").EventEmitter,YCe=require("fs").ReadStream,U$=require("stream"),jh=require("zlib");M$.exports=VCe;function VCe(e,t){return XCe(e)?JCe(e):eve(e)?zCe(e):KCe(e)&&e.destroy(),ZCe(e)&&t&&(e.removeAllListeners("error"),e.addListener("error",tve)),e}function JCe(e){e.destroy(),typeof e.close=="function"&&e.on("open",nve)}function WCe(e){if(e._hadError===!0){var t=e._binding===null?"_binding":"_handle";e[t]={close:function(){this[t]=null}}}e.close()}function zCe(e){typeof e.destroy=="function"?e._binding?(e.destroy(),e._processing?(e._needDrain=!0,e.once("drain",rve)):e._binding.clear()):e._destroy&&e._destroy!==U$.Transform.prototype._destroy?e.destroy():e._destroy&&typeof e.close=="function"?(e.destroyed=!0,e.close()):e.destroy():typeof e.close=="function"&&WCe(e)}function KCe(e){return e instanceof U$&&typeof e.destroy=="function"}function ZCe(e){return e instanceof GCe}function XCe(e){return e instanceof YCe}function eve(e){return e instanceof jh.Gzip||e instanceof jh.Gunzip||e instanceof jh.Deflate||e instanceof jh.DeflateRaw||e instanceof jh.Inflate||e instanceof jh.InflateRaw||e instanceof jh.Unzip}function tve(){}function rve(){this._binding.clear()}function nve(){typeof this.fd=="number"&&this.close()}});var Gh=de((qNe,L$)=>{"use strict";var gI=require("buffer"),K0=gI.Buffer,Uu={},Mu;for(Mu in gI)gI.hasOwnProperty(Mu)&&(Mu==="SlowBuffer"||Mu==="Buffer"||(Uu[Mu]=gI[Mu]));var Z0=Uu.Buffer={};for(Mu in K0)K0.hasOwnProperty(Mu)&&(Mu==="allocUnsafe"||Mu==="allocUnsafeSlow"||(Z0[Mu]=K0[Mu]));Uu.Buffer.prototype=K0.prototype;(!Z0.from||Z0.from===Uint8Array.from)&&(Z0.from=function(e,t,r){if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&typeof e.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return K0(e,t,r)});Z0.alloc||(Z0.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=K0(e);return!t||t.length===0?n.fill(0):typeof r=="string"?n.fill(t,r):n.fill(t),n});if(!Uu.kStringMaxLength)try{Uu.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Uu.constants||(Uu.constants={MAX_LENGTH:Uu.kMaxLength},Uu.kStringMaxLength&&(Uu.constants.MAX_STRING_LENGTH=Uu.kStringMaxLength));L$.exports=Uu});var H$=de(g5=>{"use strict";var P$="\uFEFF";g5.PrependBOM=h5;function h5(e,t){this.encoder=e,this.addBOM=!0}h5.prototype.write=function(e){return this.addBOM&&(e=P$+e,this.addBOM=!1),this.encoder.write(e)};h5.prototype.end=function(){return this.encoder.end()};g5.StripBOM=d5;function d5(e,t){this.decoder=e,this.pass=!1,this.options=t||{}}d5.prototype.write=function(e){var t=this.decoder.write(e);return this.pass||!t||(t[0]===P$&&(t=t.slice(1),typeof this.options.stripBOM=="function"&&this.options.stripBOM()),this.pass=!0),t};d5.prototype.end=function(){return this.decoder.end()}});var j$=de((GNe,q$)=>{"use strict";var EE=Gh(
|
|||
|
|
\v\f\r\x1B !"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE9
|
|||
|
|
\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0`},georgianacademy:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},georgianps:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},pt154:{type:"_sbcs",chars:"\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},viscii:{type:"_sbcs",chars:`\0\u1EB2\u1EB4\u1EAA\x07\b
|
|||
|
|
\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE`},iso646cn:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
|
\v\f\r\x1B !"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},iso646jp:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},hproman8:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD"},macintosh:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},ascii:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},tis620:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"}}});var nq=de(rq=>{"use strict";var eg=Gh().Buffer;rq._dbcs=OA;var fa=-1,tq=-2,Lu=-10,bl=-1e3,X0=new Array(256),CE=-1;for(wI=0;wI<256;wI++)X0[wI]=fa;var wI;function OA(e,t){if(this.encodingName=e.encodingName,!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var r=e.table();this.decodeTables=[],th
|
|||
|
|
`)>=0)return!1;return!0}function nIe(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Dl.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Dl.call(Array(t+1),r)}}function X5(e,t){if(e.length===0)return"";var r=`
|
|||
|
|
`+t.prev+t.base;return r+Dl.call(e,","+r)+`
|
|||
|
|
`+t.prev}function kI(e,t){var r=Z5(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=UA(e,i)?t(e[i],e):""}var s=typeof V5=="function"?V5(e):[],o;if(ig){o={};for(var u=0;u<s.length;u++)o["$"+s[u]]=s[u]}for(var l in e)UA(e,l)&&(r&&String(Number(l))===l&&l<e.length||ig&&o["$"+l]instanceof Symbol||(Ij.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof V5=="function")for(var p=0;p<s.length;p++)wj.call(e,s[p])&&n.push("["+t(s[p])+"]: "+t(e[s[p]],e));return n}});var _j=de((DTe,Rj)=>{"use strict";var iIe=_E(),sIe=Wh(),OI=function(e,t,r){for(var n=e,i;(i=n.next)!=null;n=i)if(i.key===t)return n.next=i.next,r||(i.next=e.next,e.next=i),i},oIe=function(e,t){if(e){var r=OI(e,t);return r&&r.value}},aIe=function(e,t,r){var n=OI(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},uIe=function(e,t){return e?!!OI(e,t):!1},cIe=function(e,t){if(e)return OI(e,t,!0)};Rj.exports=function(){var t,r={assert:function(n){if(!r.has(n))throw new sIe("Side channel does not contain "+iIe(n))},delete:function(n){var i=t&&t.next,s=cIe(t,n);return s&&i&&i===s&&(t=void 0),!!s},get:function(n){return oIe(t,n)},has:function(n){return uIe(t,n)},set:function(n,i){t||(t={next:void 0}),aIe(t,n,i)}};return r}});var n4=de((xTe,kj)=>{"use strict";kj.exports=Object});var Tj=de((FTe,Nj)=>{"use strict";Nj.exports=Error});var Uj=de((STe,Oj)=>{"use strict";Oj.exports=EvalError});var Lj=de((QTe,Mj)=>{"use strict";Mj.exports=RangeError});var Hj=de((RTe,Pj)=>{"use strict";Pj.exports=ReferenceError});var qj=de((_Te,$j)=>{"use strict";$j.exports=SyntaxError});var Gj=de((kTe,jj)=>{"use strict";jj.exports=URIError});var Vj=de((NTe,Yj)=>{"use strict";Yj.exports=Math.abs});var Wj=de((TTe,Jj)=>{"use strict";Jj.exports=Math.floor});var Kj=de((OTe,zj)=>{"use strict";zj.exports=Math.max});var Xj=de((UTe,Zj)=>{"use strict";Zj.exports=Math.min});var tG=de((MTe,eG)=>{"use strict";eG.exports=Math.pow});var nG=de((LTe,rG)=>{"use strict";rG.exports=Math.round});var sG=de((PTe,iG)=>{"use strict";iG.exports=Number.isNaN||function(t){return t!==t}});var aG=de((HTe,oG)=>{"use strict";var lIe=sG();oG.exports=function(t){return lIe(t)||t===0?t:t<0?-1:1}});var cG=de(($Te,uG)=>{"use strict";uG.exports=Object.getOwnPropertyDescriptor});var i4=de((qTe,lG)=>{"use strict";var UI=cG();if(UI)try{UI([],"length")}catch{UI=null}lG.exports=UI});var pG=de((jTe,AG)=>{"use strict";var MI=Object.defineProperty||!1;if(MI)try{MI({},"a",{value:1})}catch{MI=!1}AG.exports=MI});var hG=de((GTe,fG)=>{"use strict";fG.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(t,r);if(u.value!==i||u.enumerable!==!0)return!1}return!0}});var mG=de((YTe,gG)=>{"use strict";var dG=typeof Symbol<"u"&&Symbol,AIe=hG();gG.exports=function(){return typeof dG!="function"||typeof Symbol!="function"||typeof dG("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:AIe()}});var s4=de((VTe,EG)=>{"use strict";EG.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var o4=de((JTe,yG)=>{"use strict";var pIe=n4();yG.exports=pIe.getPrototypeOf||null});var BG=de((WTe,vG)=>{"use strict";var fIe="Function.prototype.bind called on incompatible ",hIe=Object.prototype.toString,dIe=Math.max,gIe="[object Function]",CG=function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},mIe=function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},EIe=function(
|
|||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>Error</title>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<pre>`+t+`</pre>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
`}MY.exports=_2e;function _2e(e,t,r){var n=r||{},i=n.env||process.env.NODE_ENV||"development",s=n.onerror;return function(o){var u,l,p;if(!o&&TY(t)){B4("cannot 404 after headers sent");return}if(o?(p=T2e(o),p===void 0?p=U2e(t):u=k2e(o),l=N2e(o,p,i)):(p=404,l="Cannot "+e.method+" "+I2e(O2e(e))),B4("default %s",p),o&&s&&S2e(s,o,e,t),TY(t)){B4("cannot %d after headers sent",p),e.socket&&e.socket.destroy();return}M2e(e,t,p,u,l)}}function k2e(e){if(!(!e.headers||typeof e.headers!="object")){for(var t=Object.create(null),r=Object.keys(e.headers),n=0;n<r.length;n++){var i=r[n];t[i]=e.headers[i]}return t}}function N2e(e,t,r){var n;return r!=="production"&&(n=e.stack,!n&&typeof e.toString=="function"&&(n=e.toString())),n||UY.message[t]}function T2e(e){if(typeof e.status=="number"&&e.status>=400&&e.status<600)return e.status;if(typeof e.statusCode=="number"&&e.statusCode>=400&&e.statusCode<600)return e.statusCode}function O2e(e){try{return b2e.original(e).pathname}catch{return"resource"}}function U2e(e){var t=e.statusCode;return(typeof t!="number"||t<400||t>599)&&(t=500),t}function TY(e){return typeof e.headersSent!="boolean"?!!e._header:e.headersSent}function M2e(e,t,r,n,i){function s(){var o=R2e(i);if(t.statusCode=r,e.httpVersionMajor<2&&(t.statusMessage=UY.message[r]),t.removeHeader("Content-Encoding"),t.removeHeader("Content-Language"),t.removeHeader("Content-Range"),L2e(t,n),t.setHeader("Content-Security-Policy","default-src 'none'"),t.setHeader("X-Content-Type-Options","nosniff"),t.setHeader("Content-Type","text/html; charset=utf-8"),t.setHeader("Content-Length",Buffer.byteLength(o,"utf8")),e.method==="HEAD"){t.end();return}t.end(o,"utf8")}if(Q2e(e)){s();return}D2e(e),OY(e,s),e.resume()}function L2e(e,t){if(t)for(var r=Object.keys(t),n=0;n<r.length;n++){var i=r[n];e.setHeader(i,t[i])}}});var ty=de((v9e,$Y)=>{"use strict";$Y.exports=P2e;function PY(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];r>0&&Array.isArray(i)?PY(i,t,r-1):t.push(i)}return t}function HY(e,t){for(var r=0;r<e.length;r++){var n=e[r];Array.isArray(n)?HY(n,t):t.push(n)}return t}function P2e(e,t){return t==null?HY(e,[]):PY(e,[],t)}});var YY=de((B9e,GY)=>{GY.exports=jY;var qY=/\\.|\((?:\?<(.*?)>)?(?!\?)/g;function jY(e,t,r){r=r||{},t=t||[];var n=r.strict,i=r.end!==!1,s=r.sensitive?"":"i",o=r.lookahead!==!1,u=0,l=t.length,p=0,f=0,c=0,m="",B;if(e instanceof RegExp){for(;B=qY.exec(e.source);)B[0][0]!=="\\"&&t.push({name:B[1]||f++,optional:!1,offset:B.index});return e}if(Array.isArray(e))return e=e.map(function(C){return jY(C,t,r).source}),new RegExp(e.join("|"),s);if(typeof e!="string")throw new TypeError("path must be a string, array of strings, or regular expression");for(e=e.replace(/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,function(C,F,H,q,se,ce,Ce,pe){if(C[0]==="\\")return m+=C,c+=2,C;if(C===".")return m+="\\.",u+=1,c+=1,"\\.";if(F||H?m="":m+=e.slice(c,pe),c=pe+C.length,C==="*")return u+=3,"(.*)";if(C==="/(")return m+="/",u+=2,"/(?:";F=F||"",H=H?"\\.":"",Ce=Ce||"",se=se?se.replace(/\\.|\*/,function(me){return me==="*"?"(.*)":me}):m?"((?:(?!/|"+m+").)+?)":"([^/"+H+"]+?)",t.push({name:q,optional:!!Ce,offset:pe+u});var De="(?:"+H+F+se+(ce?"((?:[/"+H+"].+?)?)":"")+")"+Ce;return u+=De.length-C.length,De});B=qY.exec(e);)B[0][0]!=="\\"&&((l+p===t.length||t[l+p].offset>B.index)&&t.splice(l+p,0,{name:f++,optional:!1,offset:B.index}),p++);return e+=n?"":e[e.length-1]==="/"?"?":"/?",i?e+="$":e[e.length-1]!=="/"&&(e+=o?"(?=/|$)":"(?:/|$)"),new RegExp("^"+e,s)}});var I4=de((I9e,JY)=>{"use strict";var H2e=YY(),$2e=Ou()("express:router:layer"),q2e=Object.prototype.hasOwnProperty;JY.exports=pg;function pg(e,t,r){if(!(this instanceof pg))return new pg(e,t,r);$2e("new %o",e);var n=t||{};this.handle=r,this.name=r.name||"<anonymous>",this.params=void 0,this.path=void 0,this.regexp=H2e(e,this.keys=[],n),this.regexp.fast_star=e==="*",this.regexp.fast_slash=e==="/"&&n.end===!1}pg.prototype.handle_error=function(t,r,n,i){var s=this.handle;if(s.length!==4)return i(t);try{s(t,r,n,i)}catch(o){i(o)}};pg.prototype.handle_request=function(t,r,n){var i=this.handle;if(i.length>3
|
|||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>`+e+`</title>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<pre>`+t+`</pre>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
`}function CDe(e,t){return t?t instanceof Error?N4(e,t,{expose:!1}):N4(e,t):N4(e)}function vDe(e){try{return decodeURIComponent(e)}catch{return-1}}function BDe(e){return typeof e.getHeaderNames!="function"?Object.keys(e._headers||{}):e.getHeaderNames()}function GV(e,t){var r=typeof e.listenerCount!="function"?e.listeners(t).length:e.listenerCount(t);return r>0}function IDe(e){return typeof e.headersSent!="boolean"?!!e._header:e.headersSent}function U4(e,t){for(var r=[].concat(e||[]),n=0;n<r.length;n++)if(typeof r[n]!="string")throw new TypeError(t+" must be array of strings or false");return r}function mw(e){var t=e&&Date.parse(e);return typeof t=="number"?t:NaN}function wDe(e){for(var t=0,r=[],n=0,i=0,s=e.length;i<s;i++)switch(e.charCodeAt(i)){case 32:n===t&&(n=t=i+1);break;case 44:n!==t&&r.push(e.substring(n,t)),n=t=i+1;break;default:t=i+1;break}return n!==t&&r.push(e.substring(n,t)),r}function bDe(e,t){for(var r=Object.keys(t),n=0;n<r.length;n++){var i=r[n];e.setHeader(i,t[i])}}});var VV=de((P9e,YV)=>{"use strict";YV.exports=DDe;function DDe(e){if(!e)throw new TypeError("argument req is required");var t=FDe(e.headers["x-forwarded-for"]||""),r=xDe(e),n=[r].concat(t);return n}function xDe(e){return e.socket?e.socket.remoteAddress:e.connection.remoteAddress}function FDe(e){for(var t=e.length,r=[],n=e.length,i=e.length-1;i>=0;i--)switch(e.charCodeAt(i)){case 32:n===t&&(n=t=i);break;case 44:n!==t&&r.push(e.substring(n,t)),n=t=i;break;default:n=i;break}return n!==t&&r.push(e.substring(n,t)),r}});var WV=de((JV,sy)=>{(function(){var e,t,r,n,i,s,o,u,l;t={},u=this,typeof sy<"u"&&sy!==null&&sy.exports?sy.exports=t:u.ipaddr=t,o=function(p,f,c,m){var B,C;if(p.length!==f.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(B=0;m>0;){if(C=c-m,C<0&&(C=0),p[B]>>C!==f[B]>>C)return!1;m-=c,B+=1}return!0},t.subnetMatch=function(p,f,c){var m,B,C,F,H;c==null&&(c="unicast");for(C in f)for(F=f[C],F[0]&&!(F[0]instanceof Array)&&(F=[F]),m=0,B=F.length;m<B;m++)if(H=F[m],p.kind()===H[0].kind()&&p.match.apply(p,H))return C;return c},t.IPv4=function(){function p(f){var c,m,B;if(f.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");for(c=0,m=f.length;c<m;c++)if(B=f[c],!(0<=B&&B<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=f}return p.prototype.kind=function(){return"ipv4"},p.prototype.toString=function(){return this.octets.join(".")},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.match=function(f,c){var m;if(c===void 0&&(m=f,f=m[0],c=m[1]),f.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return o(this.octets,f.octets,8,c)},p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]]},p.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},p.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:"+this.toString())},p.prototype.prefixLengthFromSubnetMask=function(){var f,c,m,B,C,F,H;for(H={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},f=0,C=!1,c=m=3;m>=0;c=m+=-1)if(B=this.octets[c],B in H){if(F=H[B],C&&F!==0)return null;F!==8&&(C=!0),f+=F}else return null;return 32-f},p}(),r="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp("^"+r+"\\."+r+"\\."+r+"\\."+r+"$","i"),longValue:new RegExp("^"+r+"$","i")},t.IPv4.parser=function(p){var f,c,m,B,C;if(c=function(F){return F[0]==="0"&&F[1]!=="x"?parseInt(F,8):parseInt(F)},f=p.match(n.fourOctet))return function(){var F,H,q,se;for(q=f.slice(1,6),se=[],F=0,H=q.length;F<H;F++)m=q[F],se.push(c(m));return se}();if(f=p.match(n.longValue))
|
|||
|
|
Please see the 3.x to 4.x migration guide for details on how to update your app.`)}})};Bs.lazyrouter=function(){this._router||(this._router=new zDe({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(ZDe(this.get("query parser fn"))),this._router.use(KDe.init(this)))};Bs.handle=function(t,r,n){var i=this._router,s=n||WDe(t,r,{env:this.get("env"),onerror:uxe.bind(this)});if(!i){Mw("no routes defined on app"),s();return}i.handle(t,r,s)};Bs.use=function(t){var r=0,n="/";if(typeof t!="function"){for(var i=t;Array.isArray(i)&&i.length!==0;)i=i[0];typeof i!="function"&&(r=1,n=t)}var s=sxe(j4.call(arguments,r));if(s.length===0)throw new TypeError("app.use() requires a middleware function");this.lazyrouter();var o=this._router;return s.forEach(function(u){if(!u||!u.handle||!u.set)return o.use(n,u);Mw(".use app under %s",n),u.mountpath=n,u.parent=this,o.use(n,function(p,f,c){var m=p.app;u.handle(p,f,function(B){yg(p,m.request),yg(f,m.response),c(B)})}),u.emit("mount",this)},this),this};Bs.route=function(t){return this.lazyrouter(),this._router.route(t)};Bs.engine=function(t,r){if(typeof r!="function")throw new Error("callback function required");var n=t[0]!=="."?"."+t:t;return this.engines[n]=r,this};Bs.param=function(t,r){if(this.lazyrouter(),Array.isArray(t)){for(var n=0;n<t.length;n++)this.param(t[n],r);return this}return this._router.param(t,r),this};Bs.set=function(t,r){if(arguments.length===1){for(var n=this.settings;n&&n!==Object.prototype;){if(axe.call(n,t))return n[t];n=Object.getPrototypeOf(n)}return}switch(Mw('set "%s" to %o',t,r),this.settings[t]=r,t){case"etag":this.set("etag fn",txe(r));break;case"query parser":this.set("query parser fn",rxe(r));break;case"trust proxy":this.set("trust proxy fn",nxe(r)),Object.defineProperty(this.settings,q4,{configurable:!0,value:!1});break}return this};Bs.path=function(){return this.parent?this.parent.path()+this.mountpath:""};Bs.enabled=function(t){return!!this.set(t)};Bs.disabled=function(t){return!this.set(t)};Bs.enable=function(t){return this.set(t,!0)};Bs.disable=function(t){return this.set(t,!1)};$4.forEach(function(e){Bs[e]=function(t){if(e==="get"&&arguments.length===1)return this.set(t);this.lazyrouter();var r=this._router.route(t);return r[e].apply(r,j4.call(arguments,1)),this}});Bs.all=function(t){this.lazyrouter();for(var r=this._router.route(t),n=j4.call(arguments,1),i=0;i<$4.length;i++)r[$4[i]].apply(r,n);return this};Bs.del=ixe.function(Bs.delete,"app.del: Use app.delete instead");Bs.render=function(t,r,n){var i=this.cache,s=n,o=this.engines,u=r,l={},p;if(typeof r=="function"&&(s=r,u={}),H4(l,this.locals),u._locals&&H4(l,u._locals),H4(l,u),l.cache==null&&(l.cache=this.enabled("view cache")),l.cache&&(p=i[t]),!p){var f=this.get("view");if(p=new f(t,{defaultEngine:this.get("view engine"),root:this.get("views"),engines:o}),!p.path){var c=Array.isArray(p.root)&&p.root.length>1?'directories "'+p.root.slice(0,-1).join('", "')+'" or "'+p.root[p.root.length-1]+'"':'directory "'+p.root+'"',m=new Error('Failed to lookup view "'+t+'" in views '+c);return m.view=p,s(m)}l.cache&&(i[t]=p)}cxe(p,l,s)};Bs.listen=function(){var t=exe.createServer(this);return t.listen.apply(t,arguments)};function uxe(e){this.get("env")!=="test"&&console.error(e.stack||e.toString())}function cxe(e,t,r){try{e.render(t,r)}catch(n){r(n)}}});var lJ=de((q9e,G4)=>{"use strict";G4.exports=cJ;G4.exports.preferredCharsets=cJ;var lxe=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Axe(e){for(var t=e.split(","),r=0,n=0;r<t.length;r++){var i=pxe(t[r].trim(),r);i&&(t[n++]=i)}return t.length=n,t}function pxe(e,t){var r=lxe.exec(e);if(!r)return null;var n=r[1],i=1;if(r[2])for(var s=r[2].split(";"),o=0;o<s.length;o++){var u=s[o].trim().split("=");if(u[0]==="q"){i=parseFloat(u[1]);break}}return{charset:n,q:i,i:t}}function fxe(e,t,r){for(var n={o:-1,q:0,s:0},i=0;i<t.length;i++){var s=hxe(e,t[i],r);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function hxe(e,t,r){var n=0;if(t.charset.toLowerCase()===e.toLowerCase())n|=1;else if(t.charset!=="*")return null;return{i:r,
|
|||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>`+e+`</title>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<pre>`+t+`</pre>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
`}function FFe(){return function(){this.error(404)}}function SFe(){return function(t){if(this.hasTrailingSlash()){this.error(404);return}var r=X4.original(this.req);r.path=null,r.pathname=DFe(r.pathname+"/");var n=vFe(wFe.format(r)),i=xFe("Redirecting","Redirecting to "+BFe(n));t.statusCode=301,t.setHeader("Content-Type","text/html; charset=UTF-8"),t.setHeader("Content-Length",Buffer.byteLength(i)),t.setHeader("Content-Security-Policy","default-src 'none'"),t.setHeader("X-Content-Type-Options","nosniff"),t.setHeader("Location",n),t.end(i)}}});var nW=de((ga,rW)=>{"use strict";var Gw=C4(),QFe=require("events").EventEmitter,ZJ=xY(),XJ=oJ(),RFe=w4(),_Fe=D4(),eW=_J(),tW=WJ();ga=rW.exports=kFe;function kFe(){var e=function(t,r,n){e.handle(t,r,n)};return ZJ(e,QFe.prototype,!1),ZJ(e,XJ,!1),e.request=Object.create(eW,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(tW,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}ga.application=XJ;ga.request=eW;ga.response=tW;ga.Route=RFe;ga.Router=_Fe;ga.json=Gw.json;ga.query=x4();ga.raw=Gw.raw;ga.static=KJ();ga.text=Gw.text;ga.urlencoded=Gw.urlencoded;var NFe=["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"];NFe.forEach(function(e){Object.defineProperty(ga,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})})});var Yw=de((tOe,iW)=>{"use strict";iW.exports=nW()});var Vw=de(t6=>{"use strict";Object.defineProperty(t6,"__esModule",{value:!0});var TFe=(e,t)=>e<<8|t,OFe=(e,t,r)=>e<<16|t<<8|r,UFe=(e,t,r,n)=>e<<24|t<<16|r<<8|n,MFe=`Maxmind v2 module has changed API.
|
|||
|
|
Upgrade instructions can be found here: https://github.com/runk/node-maxmind/wiki/Migration-guide
|
|||
|
|
If you want to use legacy library then explicitly install maxmind@1`,LFe=(e,t)=>{if(!e)throw new Error(t)};t6.default={assert:LFe,concat2:TFe,concat3:OFe,concat4:UFe,legacyErrorMessage:MFe}});var n6=de(uy=>{"use strict";var PFe=uy&&uy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(uy,"__esModule",{value:!0});var MA=PFe(Vw());MA.default.assert(typeof BigInt<"u","Apparently you are using old version of node. Please upgrade to node 10.4.x or above.");var mo;(function(e){e[e.Extended=0]="Extended",e[e.Pointer=1]="Pointer",e[e.Utf8String=2]="Utf8String",e[e.Double=3]="Double",e[e.Bytes=4]="Bytes",e[e.Uint16=5]="Uint16",e[e.Uint32=6]="Uint32",e[e.Map=7]="Map",e[e.Int32=8]="Int32",e[e.Uint64=9]="Uint64",e[e.Uint128=10]="Uint128",e[e.Array=11]="Array",e[e.Container=12]="Container",e[e.EndMarker=13]="EndMarker",e[e.Boolean=14]="Boolean",e[e.Float=15]="Float"})(mo||(mo={}));var HFe=[0,2048,526336,0],$Fe={get:()=>{},set:()=>{}},Js=(e,t)=>({value:e,offset:t}),r6=class{constructor(t,r=0,n=$Fe){this.telemetry={},MA.default.assert(!!t,"Database buffer is required"),this.db=t,this.baseOffset=r,this.cache=n}decode(t){let r,n=this.db[t++],i=n>>5;if(i===mo.Pointer)return r=this.decodePointer(n,t),Js(this.decodeFast(r.value).value,r.offset);if(i===mo.Extended){if(r=this.db[t]+7,r<8)throw new Error("Invalid Extended Type at offset "+t+" val "+r);i=r,t++}let s=this.sizeFromCtrlByte(n,t);return this.decodeByType(i,s.offset,s.value)}decodeFast(t){let r=this.cache.get(t);if(r)return r;let n=this.decode(t);return this.cache.set(t,n),n}decodeByType(t,r,n){let i=r+n;switch(t){case mo.Utf8String:return Js(this.decodeString(r,n),i);case mo.Map:return this.decodeMap(n,r);case mo.Uint32:return Js(this.decodeUint(r,n),i);case mo.Double:return Js(this.decodeDouble(r),i);case mo.Array:return this.decodeArray(n,r);case mo.Boolean:return Js(this.decodeBoolean(n),r);case mo.Float:return Js(this.decodeFloat(r),i);case mo.Bytes:return Js(this.decodeBytes(r,n),i);case mo.Uint16:return Js(this.decodeUint(r,n),i);case mo.Int32:return Js(this.decodeInt32(r,n),i);case mo.Uint64:return Js(this.decodeUint(r,n),i);case mo.Uint128:return Js(this.decodeUint(r,n),i)}throw new Error("Unknown type "+t+" at offset "+r)}sizeFromCtrlByte(t,r){let n=t&31;return n<29?Js(n,r):n===29?Js(29+this.db[r],r+1):n===30?Js(285+this.db.readUInt16BE(r),r+2):Js(65821+MA.default.concat3(this.db[r],this.db[r+1],this.db[r+2]),r+3)}decodeBytes(t,r){return this.db.slice(t,t+r)}decodePointer(t,r){let n=t>>3&3,i=this.baseOffset+HFe[n],s=0;return n===0?s=MA.default.concat2(t&7,this.db[r]):n===1?s=MA.default.concat3(t&7,this.db[r],this.db[r+1]):n===2?s=MA.default.concat4(t&7,this.db[r],this.db[r+1],this.db[r+2]):s=this.db.readUInt32BE(r),r+=n+1,Js(i+s,r)}decodeArray(t,r){let n,i=[];for(let s=0;s<t;s++)n=this.decode(r),r=n.offset,i.push(n.value);return Js(i,r)}decodeBoolean(t){return t!==0}decodeDouble(t){return this.db.readDoubleBE(t)}decodeFloat(t){return this.db.readFloatBE(t)}decodeMap(t,r){let n,i,s={};for(let o=0;o<t;o++)n=this.decode(r),i=n.value,n=this.decode(n.offset),r=n.offset,s[i]=n.value;return Js(s,r)}decodeInt32(t,r){return r===0?0:this.db.readInt32BE(t)}decodeUint(t,r){switch(r){case 0:return 0;case 1:return this.db[t];case 2:return MA.default.concat2(this.db[t+0],this.db[t+1]);case 3:return MA.default.concat3(this.db[t+0],this.db[t+1],this.db[t+2]);case 4:return MA.default.concat4(this.db[t+0],this.db[t+1],this.db[t+2],this.db[t+3]);case 8:return this.decodeBigUint(t,r);case 16:return this.decodeBigUint(t,r)}return 0}decodeString(t,r){return this.db.slice(t,t+r).toString()}decodeBigUint(t,r){let n=Buffer.alloc(r);this.db.copy(n,0,t,t+r);let i=BigInt(0),s=r/4;for(let o=0;o<s;o++)i=i*BigInt(4294967296)+BigInt(n.readUInt32BE(o<<2));return i.toString()}};uy.default=r6});var sW=de(cy=>{"use strict";var qFe=cy&&cy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cy,"__esModule",{value:!0});var jFe=qFe(require("net")),GFe=e=>{let t=e.split(".",4),r=parseInt(t[0]),n=parseInt(t[1]),i=parseInt(t[2]),s=parseInt(t
|
|||
|
|
Upgrade instructions can be found here: https://github.com/runk/node-maxmind/wiki/Migration-guide
|
|||
|
|
If you want to use legacy libary then explicitly install maxmind@1`;c6.default={concat2:BSe,concat3:ISe,concat4:wSe,legacyErrorMessage:bSe}});var r2=de(qi=>{"use strict";var DSe=qi&&qi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xSe=qi&&qi.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&DSe(t,e,r)},fy=qi&&qi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qi,"__esModule",{value:!0});qi.Reader=qi.validate=qi.init=qi.openSync=qi.open=void 0;var FSe=fy(require("assert")),vW=o6();Object.defineProperty(qi,"Reader",{enumerable:!0,get:function(){return vW.Reader}});var SSe=hW(),l6=fy(gW()),BW=fy(mW()),QSe=fy(EW()),A6=fy(yW()),CW=async e=>new Promise((t,r)=>{let n=[],i=l6.default.createReadStream(e,{highWaterMark:67108864});i.on("data",s=>{n.push(s)}),i.on("end",()=>{t(Buffer.concat(n))}),i.on("error",s=>{r(s)})}),RSe=async(e,t,r)=>{var n;(0,FSe.default)(!r,A6.default.legacyErrorMessage);let i=await CW(e);if((0,QSe.default)(i))throw new Error("Looks like you are passing in a file in gzip format, please use mmdb database instead.");let s=(0,SSe.lru)(((n=t?.cache)===null||n===void 0?void 0:n.max)||1e4),o=new vW.Reader(i,{cache:s});if(t&&t.watchForUpdates){if(t.watchForUpdatesHook&&typeof t.watchForUpdatesHook!="function")throw new Error("opts.watchForUpdatesHook should be a function");let u={persistent:t.watchForUpdatesNonPersistent!==!0};l6.default.watchFile(e,u,async()=>{if(!await(async()=>{for(let f=0;f<3;f++){if(l6.default.existsSync(e))return!0;await new Promise(c=>setTimeout(c,500))}return!1})())return;let p=await CW(e);s.clear(),o.load(p),t.watchForUpdatesHook&&t.watchForUpdatesHook()})}return o};qi.open=RSe;var _Se=()=>{throw new Error(A6.default.legacyErrorMessage)};qi.openSync=_Se;var kSe=()=>{throw new Error(A6.default.legacyErrorMessage)};qi.init=kSe;qi.validate=BW.default.validate;xSe(o6(),qi);qi.default={init:qi.init,open:qi.open,openSync:qi.openSync,validate:BW.default.validate}});var i2=de(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.ValueError=Ql.InvalidDbBufferError=Ql.BadMethodCallError=Ql.AddressNotFoundError=void 0;var p6=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};Ql.AddressNotFoundError=p6;var f6=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};Ql.BadMethodCallError=f6;var h6=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};Ql.InvalidDbBufferError=h6;var d6=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};Ql.ValueError=d6});var a2=de((gOe,wW)=>{var s2=require("assert"),NSe=require("stream").Stream,TSe=require("util"),OSe=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function g6(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Wp(e,t,r,n,i){throw new s2.AssertionError({message:TSe.format("%s (%s) is required",e,t),actual:i===void 0?typeof n:i(n),expected:t,operator:r||"===",stackStartFunction:Wp.caller})}function m6(e){return Object.prototype.toString.call(e).slice(8,-1)}function Cg(){}var hy={bool:{check:function(e){return typeof e=="boolean"}},func:{check:function(e){return typeof e=="function"}},string:{check:function(e){return typeof e=="string"}},object:{check:function(e){return typeof e=="object"&&e!==null}},number:{check:function(e){return typeof e=="number"&&!isNaN(e)}},finite:{check:function(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}},buffer:{check:function(e){return Buffer.isBuffer(e)},operator:"Buffer.isBuffer"},array:{check:function(e){return Array.isArray(e)},operator:"Array.isArray"},stream:{check:function(e){return e instanceof NSe},operator:"instanceof",actual:m6},date:{check:function(e){return e instanceof Date},operator:"instanceof",actual:m6},regexp:{ch
|
|||
|
|
Caused by: `+DW(r))}return t}});var xW=de(Eo=>{function PSe(e){return Array.isArray?Array.isArray(e):f2(e)==="[object Array]"}Eo.isArray=PSe;function HSe(e){return typeof e=="boolean"}Eo.isBoolean=HSe;function $Se(e){return e===null}Eo.isNull=$Se;function qSe(e){return e==null}Eo.isNullOrUndefined=qSe;function jSe(e){return typeof e=="number"}Eo.isNumber=jSe;function GSe(e){return typeof e=="string"}Eo.isString=GSe;function YSe(e){return typeof e=="symbol"}Eo.isSymbol=YSe;function VSe(e){return e===void 0}Eo.isUndefined=VSe;function JSe(e){return f2(e)==="[object RegExp]"}Eo.isRegExp=JSe;function WSe(e){return typeof e=="object"&&e!==null}Eo.isObject=WSe;function zSe(e){return f2(e)==="[object Date]"}Eo.isDate=zSe;function KSe(e){return f2(e)==="[object Error]"||e instanceof Error}Eo.isError=KSe;function ZSe(e){return typeof e=="function"}Eo.isFunction=ZSe;function XSe(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}Eo.isPrimitive=XSe;Eo.isBuffer=Buffer.isBuffer;function f2(e){return Object.prototype.toString.call(e)}});var SW=de((yOe,FW)=>{var Is=a2(),h2=require("util"),eQe=C6(),Sc=xW().isError,tQe=eQe.sprintf;FW.exports=wn;wn.VError=wn;wn.SError=dy;wn.WError=zp;wn.MultiError=vg;function v6(e){var t,r,n,i,s;if(Is.object(e,"args"),Is.bool(e.strict,"args.strict"),Is.array(e.argv,"args.argv"),t=e.argv,t.length===0)r={},n=[];else if(Sc(t[0]))r={cause:t[0]},n=t.slice(1);else if(typeof t[0]=="object"){r={};for(s in t[0])r[s]=t[0][s];n=t.slice(1)}else Is.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},n=t;return Is.object(r),!r.strict&&!e.strict&&(n=n.map(function(o){return o===null?"null":o===void 0?"undefined":o})),n.length===0?i="":i=tQe.apply(null,n),{options:r,shortmessage:i}}function wn(){var e,t,r,n,i,s,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof wn))return t=Object.create(wn.prototype),wn.apply(t,arguments),t;if(r=v6({argv:e,strict:!1}),r.options.name&&(Is.string(r.options.name,`error's "name" must be a string`),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,s=r.shortmessage,n=r.options.cause,n&&(Is.ok(Sc(n),"cause is not an Error"),this.jse_cause=n,r.options.skipCauseMessage||(s+=": "+n.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=s,Error.call(this,s),Error.captureStackTrace&&(i=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,i)),this}h2.inherits(wn,Error);wn.prototype.name="VError";wn.prototype.toString=function(){var t=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t+=": "+this.message),t};wn.prototype.cause=function(){var t=wn.cause(this);return t===null?void 0:t};wn.cause=function(e){return Is.ok(Sc(e),"err must be an Error"),Sc(e.jse_cause)?e.jse_cause:null};wn.info=function(e){var t,r,n;if(Is.ok(Sc(e),"err must be an Error"),r=wn.cause(e),r!==null?t=wn.info(r):t={},typeof e.jse_info=="object"&&e.jse_info!==null)for(n in e.jse_info)t[n]=e.jse_info[n];return t};wn.findCauseByName=function(e,t){var r;for(Is.ok(Sc(e),"err must be an Error"),Is.string(t,"name"),Is.ok(t.length>0,"name cannot be empty"),r=e;r!==null;r=wn.cause(r))if(Is.ok(Sc(r)),r.name==t)return r;return null};wn.hasCauseWithName=function(e,t){return wn.findCauseByName(e,t)!==null};wn.fullStack=function(e){Is.ok(Sc(e),"err must be an Error");var t=wn.cause(e);return t?e.stack+`
|
|||
|
|
caused by: `+wn.fullStack(t):e.stack};wn.errorFromList=function(e){return Is.arrayOfObject(e,"errors"),e.length===0?null:(e.forEach(function(t){Is.ok(Sc(t))}),e.length==1?e[0]:new vg(e))};wn.errorForEach=function(e,t){Is.ok(Sc(e),"err must be an Error"),Is.func(t,"func"),e instanceof vg?e.errors().forEach(function(n){t(n)}):t(e)};function dy(){var e,t,r,n;return e=Array.prototype.slice.call(arguments,0),this instanceof dy?(r=v6({argv:e,strict:!0}),n=r.options,wn.call(this,n,"%s",r.shortmessage),this):(t=Object.create(dy.prototype),dy.apply(t,arguments),t)}h2.inherits(dy,wn);function vg(e){Is.array(e,"list of errors"),Is.ok(e.length>0,"must be at least one error"),this.ase_errors=e,wn.call(this,{cause:e[0]},"first of %d error%s",e.length,e.length==1?"":"s")}h2.inherits(vg,wn);vg.prototype.name="MultiError";vg.prototype.errors=function(){return this.ase_errors.slice(0)};function zp(){var e,t,r,n;return e=Array.prototype.slice.call(arguments,0),this instanceof zp?(r=v6({argv:e,strict:!1}),n=r.options,n.skipCauseMessage=!0,wn.call(this,n,"%s",r.shortmessage),this):(t=Object.create(zp.prototype),zp.apply(t,e),t)}h2.inherits(zp,wn);zp.prototype.name="WError";zp.prototype.toString=function(){var t=this.hasOwnProperty("name")&&this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t+=": "+this.message),this.jse_cause&&this.jse_cause.message&&(t+="; caused by "+this.jse_cause.toString()),t};zp.prototype.cause=function(t){return Sc(t)&&(this.jse_cause=t),this.jse_cause}});var RW=de((QW,d2)=>{(function(e,t){typeof define=="function"&&define.amd?define([],function(){return t()}):typeof d2=="object"&&d2.exports?d2.exports=t():e.jsonSchema=t()})(QW,function(){var e=r;e.Integer={type:"integer"};var t={String,Boolean,Number,Object,Array,Date};e.validate=r;function r(n,i){return r(n,i,{changing:!1})}e.checkPropertyChange=function(n,i,s){return r(n,i,{changing:s||"property"})};var r=e._validate=function(n,i,s){s||(s={});var o=s.changing;function u(c){return c.type||t[c.name]==c&&c.name.toLowerCase()}var l=[];function p(c,m,B,C){var F;B+=B?typeof C=="number"?"["+C+"]":typeof C>"u"?"":"."+C:C;function H(me){l.push({property:B,message:me})}if((typeof m!="object"||m instanceof Array)&&(B||typeof m!="function")&&!(m&&u(m)))return typeof m=="function"?c instanceof m||H("is not an instance of the class/constructor "+m.name):m&&H("Invalid schema/property definition "+m),null;o&&m.readonly&&H("is a readonly field, it can not be changed"),m.extends&&p(c,m.extends,B,C);function q(me,Ie){if(me){if(typeof me=="string"&&me!="any"&&(me=="null"?Ie!==null:typeof Ie!=me)&&!(Ie instanceof Array&&me=="array")&&!(Ie instanceof Date&&me=="date")&&!(me=="integer"&&Ie%1===0))return[{property:B,message:Ie+" - "+typeof Ie+" value found, but a "+me+" is required"}];if(me instanceof Array){for(var je=[],et=0;et<me.length&&(je=q(me[et],Ie)).length;et++);if(je.length)return je}else if(typeof me=="object"){var he=l;l=[],p(Ie,me,B);var $e=l;return l=he,$e}}return[]}if(c===void 0)m.required&&H("is missing and it is required");else if(l=l.concat(q(u(m),c)),m.disallow&&!q(m.disallow,c).length&&H(" disallowed value was matched"),c!==null){if(c instanceof Array){if(m.items){var se=m.items instanceof Array,ce=m.items;for(C=0,F=c.length;C<F;C+=1)se&&(ce=m.items[C]),s.coerce&&(c[C]=s.coerce(c[C],ce)),l.concat(p(c[C],ce,B,C))}m.minItems&&c.length<m.minItems&&H("There must be a minimum of "+m.minItems+" in the array"),m.maxItems&&c.length>m.maxItems&&H("There must be a maximum of "+m.maxItems+" in the array")}else(m.properties||m.additionalProperties)&&l.concat(f(c,m.properties,B,m.additionalProperties));if(m.pattern&&typeof c=="string"&&!c.match(m.pattern)&&H("does not match the regex pattern "+m.pattern),m.maxLength&&typeof c=="string"&&c.length>m.maxLength&&H("may only be "+m.maxLength+" characters long"),m.minLength&&typeof c=="string"&&c.length<m.minLength&&H("must be at least "+m.minLength+" characters long"),typeof m.minimum<"u"&&typeof c==typeof m.minimum&&m.minimum>c&&H("must have a minimum value of "+m.minimum),typeof m.maximum<"u"&&typ
|
|||
|
|
`))},e})});var $W=de(pi=>{var Yn=a2(),COe=require("util"),kW=C6(),rQe=SW(),nQe=RW();pi.deepCopy=B6;pi.deepEqual=NW;pi.isEmpty=iQe;pi.hasKey=I6;pi.forEachKey=sQe;pi.pluck=oQe;pi.flattenObject=UW;pi.flattenIter=aQe;pi.validateJsonObject=MW;pi.validateJsonObjectJS=MW;pi.randElt=MQe;pi.extraProperties=qQe;pi.mergeObjects=HW;pi.startsWith=uQe;pi.endsWith=cQe;pi.parseInteger=TQe;pi.iso8601=lQe;pi.rfc1123=fQe;pi.parseDateTime=hQe;pi.hrtimediff=LW;pi.hrtimeDiff=LW;pi.hrtimeAccum=PW;pi.hrtimeAdd=$Qe;pi.hrtimeNanosec=LQe;pi.hrtimeMicrosec=PQe;pi.hrtimeMillisec=HQe;function B6(e){var t,r,n="__deepCopy";if(e&&e[n])throw new Error("attempted deep copy of cyclic object");if(e&&e.constructor==Object){t={},e[n]=!0;for(r in e)r!=n&&(t[r]=B6(e[r]));return delete e[n],t}if(e&&e.constructor==Array){for(t=[],e[n]=!0,r=0;r<e.length;r++)t.push(B6(e[r]));return delete e[n],t}return e}function NW(e,t){if(typeof e!=typeof t)return!1;if(e===null||t===null||typeof e!="object")return e===t;if(e.constructor!=t.constructor)return!1;var r;for(r in e)if(!(r in t)||!NW(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}function iQe(e){var t;for(t in e)return!1;return!0}function I6(e,t){return Yn.equal(typeof t,"string"),Object.prototype.hasOwnProperty.call(e,t)}function sQe(e,t){for(var r in e)I6(e,r)&&t(r,e[r])}function oQe(e,t){return Yn.equal(typeof t,"string"),TW(e,t)}function TW(e,t){if(!(e===null||typeof e!="object")){if(e.hasOwnProperty(t))return e[t];var r=t.indexOf(".");if(r!=-1){var n=t.substr(0,r);if(e.hasOwnProperty(n))return TW(e[n],t.substr(r+1))}}}function aQe(e,t,r){OW(e,t,[],r)}function OW(e,t,r,n){var i,s;if(t===0){i=r.slice(0),i.push(e),n(i);return}Yn.ok(e!==null),Yn.equal(typeof e,"object"),Yn.equal(typeof t,"number"),Yn.ok(t>=0);for(s in e)i=r.slice(0),i.push(s),OW(e[s],t-1,i,n)}function UW(e,t){if(t===0)return[e];Yn.ok(e!==null),Yn.equal(typeof e,"object"),Yn.equal(typeof t,"number"),Yn.ok(t>=0);var r=[],n;for(n in e)UW(e[n],t-1).forEach(function(i){r.push([n].concat(i))});return r}function uQe(e,t){return e.substr(0,t.length)==t}function cQe(e,t){return e.substr(e.length-t.length,t.length)==t}function lQe(e){return typeof e=="number"&&(e=new Date(e)),Yn.ok(e.constructor===Date),kW.sprintf("%4d-%02d-%02dT%02d:%02d:%02d.%03dZ",e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())}var AQe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],pQe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function fQe(e){return kW.sprintf("%s, %02d %s %04d %02d:%02d:%02d GMT",pQe[e.getUTCDay()],e.getUTCDate(),AQe[e.getUTCMonth()],e.getUTCFullYear(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}function hQe(e){var t=+e;return isNaN(t)?new Date(e):new Date(t)}var dQe=Number.MAX_SAFE_INTEGER||9007199254740991,gQe=Number.MIN_SAFE_INTEGER||-9007199254740991,mQe={base:10,allowSign:!0,allowPrefix:!1,allowTrailing:!1,allowImprecise:!1,trimWhitespace:!1,leadingZeroIsOctal:!1},EQe=48,yQe=57,CQe=65,vQe=66,BQe=79,IQe=84,wQe=88,bQe=90,DQe=97,xQe=98,FQe=111,SQe=116,QQe=120,RQe=122,_Qe=48,kQe=55,NQe=87;function TQe(e,t){Yn.string(e,"str"),Yn.optionalObject(t,"options");var r=!1,n=mQe;t&&(r=I6(t,"base"),n=HW(n,t),Yn.number(n.base,"options.base"),Yn.ok(n.base>=2,"options.base >= 2"),Yn.ok(n.base<=36,"options.base <= 36"),Yn.bool(n.allowSign,"options.allowSign"),Yn.bool(n.allowPrefix,"options.allowPrefix"),Yn.bool(n.allowTrailing,"options.allowTrailing"),Yn.bool(n.allowImprecise,"options.allowImprecise"),Yn.bool(n.trimWhitespace,"options.trimWhitespace"),Yn.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&Yn.ok(!r,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var i,s=-1,o=n.base,u,l=1,p=0,f=0,c=e.length;if(n.trimWhitespace)for(;f<c&&_W(e.charCodeAt(f));)++f;for(n.allowSign&&(e[f]==="-"?(f+=1,l=-1):e[f]==="+"&&(f+=1)),e[f]==="0"&&(n.allowPrefix&&(s=UQe(e.charCodeAt(f+1)),s!==-1&&(!r||s===o)&&(o=s,f+=2)),s===-1&&n.leadingZeroIsOctal&&(o=8)),u=f;f<c&&(i=OQe(e.charCodeAt(f)),i!==-1&&i<o);++f)p*=o,p+=i;if(u===f)return new
|
|||
|
|
Please provide the following string if you would like to help debug:
|
|||
|
|
Time Zone: ${(n=r?.toString())!==null&&n!==void 0?n:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${i.offset} - current Date: ${_l.DateTime.local().toString()}`);if(!(i.month in this.month)&&Object.keys(this.month).length!==12){if(i=i.plus({months:1}),i=i.set({day:1,hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,i)){let[l,p]=this._findPreviousDSTJump(i);if(i=p,l)break}continue}if(!(i.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!(this._getWeekDay(i)in this.dayOfWeek&&Object.keys(this.dayOfWeek).length!==7)){if(i=i.plus({days:1}),i=i.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,i)){let[l,p]=this._findPreviousDSTJump(i);if(i=p,l)break}continue}if(!(this._getWeekDay(i)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!(i.day in this.dayOfMonth&&Object.keys(this.dayOfMonth).length!==31)){if(i=i.plus({days:1}),i=i.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,i)){let[l,p]=this._findPreviousDSTJump(i);if(i=p,l)break}continue}if(!(i.hour in this.hour)&&Object.keys(this.hour).length!==24){let l=i.hour===23&&u>864e5?0:i.hour+1,p=i.minute;if(i=i.set({hour:l}),i=i.set({minute:0,second:0}),this._forwardDSTJump(l,p,i)){let[f,c]=this._findPreviousDSTJump(i);if(i=c,f)break}continue}if(!(i.minute in this.minute)&&Object.keys(this.minute).length!==60){let l=i.minute===59&&u>36e5?0:i.minute+1,p=i.hour+(l===60?1:0);if(i=i.set({minute:l}),i=i.set({second:0}),this._forwardDSTJump(p,l,i)){let[f,c]=this._findPreviousDSTJump(i);if(i=c,f)break}continue}if(!(i.second in this.second)&&Object.keys(this.second).length!==60){let l=i.second===59&&u>6e4?0:i.second+1,p=i.minute+(l===60?1:0),f=i.hour+(p===60?1:0);if(i=i.set({second:l}),this._forwardDSTJump(f,p,i)){let[c,m]=this._findPreviousDSTJump(i);if(i=m,c)break}continue}if(i.toMillis()===s){let l=i.second+1,p=i.minute+(l===60?1:0),f=i.hour+(p===60?1:0);if(i=i.set({second:l}),this._forwardDSTJump(f,p,i)){let[c,m]=this._findPreviousDSTJump(i);if(i=m,c)break}continue}break}return i}_findPreviousDSTJump(t){var r;let n,i,s,o,u=t,l=60*24,p=0;do{if(++p>l)throw new Co.CronError(`ERROR: This DST checking related function assumes the input DateTime (${(r=t.toISO())!==null&&r!==void 0?r:t.toMillis()}) is within 24 hours of a DST jump.`);n=u.minute-1,i=u.hour,n<0&&(n+=60,i=(i+24-1)%24),u=u.minus({minute:1}),s=u.minute,o=u.hour}while(n===s&&i===o);let f=u.plus({minute:1}).set({second:0,millisecond:0}),c=f.minus({second:1});return t.month in this.month&&t.day in this.dayOfMonth&&this._getWeekDay(t)in this.dayOfWeek?[this._checkTimeInSkippedRange(c,f),f]:[!1,f]}_checkTimeInSkippedRange(t,r){let n=(t.minute+1)%60,i=(t.hour+(n===0?1:0))%24,s=r.hour-i+1,o=n===0&&r.minute===0;return s===2&&o?i in this.hour:s===1?i in this.hour&&this._checkTimeInSkippedRangeSingleHour(n,r.minute):this._checkTimeInSkippedRangeMultiHour(i,n,r.hour,r.minute)}_checkTimeInSkippedRangeSingleHour(t,r){for(let n=t;n<r;++n)if(n in this.minute)return!0;return r in this.minute&&0 in this.second}_checkTimeInSkippedRangeMultiHour(t,r,n,i){if(t>=n)throw new Co.CronError(`ERROR: This DST checking related function assumes the forward jump starting hour (${t}) is less than the end hour (${n})`);let s=Array.from({length:60-r},(p,f)=>r+f),o=Array.from({length:i},(p,f)=>f),u=Array.from({length:60},(p,f)=>f),l=p=>p===t?s:p===n?o:u;for(let p=t;p<=n;++p){if(!(p in this.hour))continue;let f=l(p);for(let c of f)if(c in this.minute)return!0}return n in this.hour&&i in this.minute&&0 in this.second}_forwardDSTJump(t,r,n){let i=n.hour,s=n.minute,o=t%24<i,u=r%60<s;return o||u}_wcOrAll(t){if(this._hasAll(t))return"*";let r=[];for(let n in this[t])r.push(n);return r.join(",")}_hasAll(t){let r=yo.CONSTRAINTS[t],n=r[0],i=t===yo.TIME_UNITS_MAP.DAY_OF_WEEK?r[1]-1:r[1];for(let s=n,o=i;s<o;s++)if(!(s in this[t]))return!1;return!0}_parse(t){var r;t=t.toLowerCase(),Object.keys(yo.PRESETS).includes(t)&&(t=yo.PRESETS[t]),t=t.replace(/[a-z]{1,3}/gi,s=>{if(Object.keys(yo.ALIASES).includes(s))return yo.ALIASES[s].toString();throw new Co.CronError(`Unknown alias: ${s}`)});let n=t.trim().split(/\s+/
|
|||
|
|
`).join(`
|
|||
|
|
`+s),e.push(i+"m+"+sb.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=uRe()+t+" "+e[0]}function uRe(){return Ks.inspectOpts.hideDate?"":new Date().toISOString()+" "}function cRe(...e){return process.stderr.write(ib.formatWithOptions(Ks.inspectOpts,...e)+`
|
|||
|
|
`)}function lRe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function ARe(){return process.env.DEBUG}function pRe(e){e.inspectOpts={};let t=Object.keys(Ks.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Ks.inspectOpts[t[r]]}sb.exports=KR()(Ks);var{formatters:CZ}=sb.exports;CZ.o=function(e){return this.inspectOpts.colors=this.useColors,ib.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(t=>t.trim()).join(" ")};CZ.O=function(e){return this.inspectOpts.colors=this.useColors,ib.inspect(e,this.inspectOpts)}});var e8=de((tUe,XR)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?XR.exports=hZ():XR.exports=vZ()});var IZ=de((rUe,BZ)=>{var Ry;BZ.exports=function(){if(!Ry){try{Ry=e8()("follow-redirects")}catch{}typeof Ry!="function"&&(Ry=function(){})}Ry.apply(null,arguments)}});var FZ=de((nUe,p8)=>{var ky=require("url"),_y=ky.URL,fRe=require("http"),hRe=require("https"),s8=require("stream").Writable,o8=require("assert"),wZ=IZ();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",n=pd(Error.captureStackTrace);!t&&(r||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var a8=!1;try{o8(new _y(""))}catch(e){a8=e.code==="ERR_INVALID_URL"}var dRe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],u8=["abort","aborted","connect","error","socket","timeout"],c8=Object.create(null);u8.forEach(function(e){c8[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var r8=Ny("ERR_INVALID_URL","Invalid URL",TypeError),n8=Ny("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),gRe=Ny("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",n8),mRe=Ny("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),ERe=Ny("ERR_STREAM_WRITE_AFTER_END","write after end"),yRe=s8.prototype.destroy||DZ;function ya(e,t){s8.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof n8?i:new n8({cause:i}))}},this._performRequest()}ya.prototype=Object.create(s8.prototype);ya.prototype.abort=function(){A8(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};ya.prototype.destroy=function(e){return A8(this._currentRequest,e),yRe.call(this,e),this};ya.prototype.write=function(e,t,r){if(this._ending)throw new ERe;if(!ld(e)&&!BRe(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(pd(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new mRe),this.abort())};ya.prototype.end=function(e,t,r){if(pd(e)?(r=e,e=t=null):pd(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,i=this._currentRequest;this.write(e,t,function(){n._ended=!0,i.end(null,null,r)}),this._ending=!0}};ya.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};ya.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};ya.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},e),n(o)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){ya.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(ya.prototype,e,{get:function(){return this._currentRequest[e]}})});ya.prototype._sanitizeOptions=function(e){if(e
|
|||
|
|
`)+`\r
|
|||
|
|
\r
|
|||
|
|
`};Mg.setupSocket(r),i&&i.length&&r.unshift(i);var l=(Mg.isSSL.test(n.target.protocol)?SRe:FRe).request(Mg.setupOutgoing(n.ssl||{},n,t));return s&&s.emit("proxyReqWs",l,t,r,n,i),l.on("error",p),l.on("response",function(f){f.upgrade||(r.write(u("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(r))}),l.on("upgrade",function(f,c,m){c.on("error",p),c.on("end",function(){s.emit("close",f,c,m)}),r.on("error",function(){c.end()}),Mg.setupSocket(c),m&&m.length&&c.unshift(m),r.write(u("HTTP/1.1 101 Switching Protocols",f.headers)),c.pipe(r).pipe(c),s.emit("open",c),s.emit("proxySocket",c)}),l.end();function p(f){o?o(f,t,r):s.emit("error",f,t,r),r.end()}}}});var MZ=de((oUe,UZ)=>{var TZ=UZ.exports,QRe=require("url").parse,OZ=sZ(),RRe=require("http"),_Re=require("https"),kZ=QZ(),NZ=_Z();TZ.Server=fd;function f8(e){return function(t){return function(r,n){var i=e==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,u,l;typeof s[o]=="function"&&(l=s[o],o--);var p=t;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(p=Object.assign({},t),Object.assign(p,s[o]),o--),s[o]instanceof Buffer&&(u=s[o]),["target","forward"].forEach(function(c){typeof p[c]=="string"&&(p[c]=QRe(p[c]))}),!p.target&&!p.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<i.length&&!i[f](r,n,p,u,this,l);f++);}}}TZ.createRightProxy=f8;function fd(e){OZ.call(this),e=e||{},e.prependPath=e.prependPath!==!1,this.web=this.proxyRequest=f8("web")(e),this.ws=this.proxyWebsocketRequest=f8("ws")(e),this.options=e,this.webPasses=Object.keys(kZ).map(function(t){return kZ[t]}),this.wsPasses=Object.keys(NZ).map(function(t){return NZ[t]}),this.on("error",this.onError,this)}require("util").inherits(fd,OZ);fd.prototype.onError=function(e){if(this.listeners("error").length===1)throw e};fd.prototype.listen=function(e,t){var r=this,n=function(i,s){r.web(i,s)};return this._server=this.options.ssl?_Re.createServer(this.options.ssl,n):RRe.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){r.ws(i,s,o)}),this._server.listen(e,t),this};fd.prototype.close=function(e){var t=this;this._server&&this._server.close(r);function r(){t._server=null,e&&e.apply(null,arguments)}};fd.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var n=e==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===t&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,r)};fd.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var n=e==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===t&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,r)}});var PZ=de((aUe,LZ)=>{var Oy=MZ().Server;function h8(e){return new Oy(e)}Oy.createProxyServer=h8;Oy.createServer=h8;Oy.createProxy=h8;LZ.exports=Oy});var $Z=de((uUe,HZ)=>{HZ.exports=PZ()});var ub=de(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});ab.ERRORS=void 0;var qZ;(function(e){e.ERR_CONFIG_FACTORY_TARGET_MISSING='[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',e.ERR_CONTEXT_MATCHER_GENERIC='[HPM] Invalid pathFilter. Expecting something like: "/api" or ["/api", "/ajax"]',e.ERR_CONTEXT_MATCHER_INVALID_ARRAY='[HPM] Invalid pathFilter. Plain paths (e.g. "/api") can not be mixed with globs (e.g. "/api/**"). Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"].',e.ERR_PATH_REWRITER_CONFIG="[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function"})(qZ||(ab.ERRORS=qZ={}))});var jZ=de(d8=>{"use strict";Object.defineProperty(d8,"__esModule",{value:!0});d8.verifyConfig=NRe;var kRe=ub();function NRe(e){if(!e.target&&!e.router)throw new Error(kRe.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING)}});var ep=de(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});cb.Debug=void 0;var TRe=e8();cb.Debug=TRe("http-proxy-middleware")});var GZ=de(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});lb.deb
|
|||
|
|
%O`,t)}),e.on("proxyReq",(t,r,n)=>{n.on("error",i=>{hd(`Socket error in proxyReq event:
|
|||
|
|
%O`,i)})}),e.on("proxyRes",(t,r,n)=>{n.on("close",()=>{n.writableEnded||(hd("Destroying proxyRes in proxyRes close event"),t.destroy())})}),e.on("proxyReqWs",(t,r,n)=>{n.on("error",i=>{hd(`Socket error in proxyReqWs event:
|
|||
|
|
%O`,i)})}),e.on("open",t=>{t.on("error",r=>{hd(`Socket error in open event:
|
|||
|
|
%O`,r)})}),e.on("close",(t,r,n)=>{r.on("error",i=>{hd(`Socket error in close event:
|
|||
|
|
%O`,i)})}),e.on("econnreset",(t,r,n,i)=>{hd(`http-proxy econnreset event:
|
|||
|
|
%O`,t)})};lb.debugProxyErrorsPlugin=URe});var YZ=de(g8=>{"use strict";Object.defineProperty(g8,"__esModule",{value:!0});g8.getStatusCode=MRe;function MRe(e){let t;if(/HPE_INVALID/.test(e))t=502;else switch(e){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":t=504;break;default:t=500;break}return t}});var VZ=de(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});Ab.errorResponsePlugin=void 0;var LRe=YZ(),PRe=(e,t)=>{e.on("error",(r,n,i,s)=>{if(!n&&!i)throw r;if("writeHead"in i&&!i.headersSent){let u=(0,LRe.getStatusCode)(r.code);i.writeHead(u)}let o=n.headers&&n.headers.host;i.end(`Error occurred while trying to proxy: ${o}${n.url}`)})};Ab.errorResponsePlugin=PRe});var pb=de(m8=>{"use strict";Object.defineProperty(m8,"__esModule",{value:!0});m8.getLogger=$Re;var HRe={info:()=>{},warn:()=>{},error:()=>{}};function $Re(e){return e.logger||HRe}});var JZ=de(E8=>{"use strict";Object.defineProperty(E8,"__esModule",{value:!0});E8.getPort=qRe;function qRe(e){return Object.keys(e||{})?.[0]?.split(":")[1]}});var zZ=de(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});fb.loggerPlugin=void 0;var WZ=require("url"),jRe=pb(),GRe=JZ(),YRe=(e,t)=>{let r=(0,jRe.getLogger)(t);e.on("error",(n,i,s,o)=>{let l=`${i?.headers?.host}${i?.url}`,p=`${o?.href}`;r.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",l,p,n.code||n,"https://nodejs.org/api/errors.html#errors_common_system_errors")}),e.on("proxyRes",(n,i,s)=>{let o=i.originalUrl??`${i.baseUrl||""}${i.url}`,u;try{let f=(0,GRe.getPort)(n.req?.agent?.sockets),c={protocol:n.req.protocol,host:n.req.host,pathname:n.req.path};u=new WZ.URL(`${c.protocol}//${c.host}${c.pathname}`),f&&(u.port=f)}catch{u=new WZ.URL(t.target),u.pathname=n.req.path}let l=u.toString(),p=`[HPM] ${i.method} ${o} -> ${l} [${n.statusCode}]`;r.info(p)}),e.on("open",n=>{r.info("[HPM] Client connected: %o",n.address())}),e.on("close",(n,i,s)=>{r.info("[HPM] Client disconnected: %o",i.address())})};fb.loggerPlugin=YRe});var hb=de(y8=>{"use strict";Object.defineProperty(y8,"__esModule",{value:!0});y8.getFunctionName=VRe;function VRe(e){return e.name||"[anonymous Function]"}});var KZ=de(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});db.proxyEventsPlugin=void 0;var JRe=ep(),WRe=hb(),zRe=JRe.Debug.extend("proxy-events-plugin"),KRe=(e,t)=>{Object.entries(t.on||{}).forEach(([r,n])=>{zRe(`register event handler: "${r}" -> "${(0,WRe.getFunctionName)(n)}"`),e.on(r,n)})};db.proxyEventsPlugin=KRe});var C8=de(Nl=>{"use strict";var ZRe=Nl&&Nl.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),gb=Nl&&Nl.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ZRe(t,e,r)};Object.defineProperty(Nl,"__esModule",{value:!0});gb(GZ(),Nl);gb(VZ(),Nl);gb(zZ(),Nl);gb(KZ(),Nl)});var ZZ=de(v8=>{"use strict";Object.defineProperty(v8,"__esModule",{value:!0});v8.getPlugins=XRe;var mb=C8();function XRe(e){let t=e.on?.error?[]:[mb.errorResponsePlugin],r=e.ejectPlugins?[]:[mb.debugProxyErrorsPlugin,mb.proxyEventsPlugin,mb.loggerPlugin,...t],n=e.plugins??[];return[...r,...n]}});var eX=de((BUe,XZ)=>{XZ.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var nX=de((IUe,rX)=>{var e8e=eX(),tX={"{":"}","(":")","[":"]"},t8e=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,i=-2,s=-2,o=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(o===-1||o>n||(o=e.indexOf("\\",t),o===-1||o>n)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(o=e.indexOf("\\",t),o===-1||o>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(o=e.indexOf("\\"
|
|||
|
|
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var OX=de((_Ue,TX)=>{"use strict";var B8e=yb(),{MAX_LENGTH:_X,CHAR_BACKSLASH:D8,CHAR_BACKTICK:I8e,CHAR_COMMA:w8e,CHAR_DOT:b8e,CHAR_LEFT_PARENTHESES:D8e,CHAR_RIGHT_PARENTHESES:x8e,CHAR_LEFT_CURLY_BRACE:F8e,CHAR_RIGHT_CURLY_BRACE:S8e,CHAR_LEFT_SQUARE_BRACKET:kX,CHAR_RIGHT_SQUARE_BRACKET:NX,CHAR_DOUBLE_QUOTE:Q8e,CHAR_SINGLE_QUOTE:R8e,CHAR_NO_BREAK_SPACE:_8e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:k8e}=RX(),N8e=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(_X,r.maxLength):_X;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let i={type:"root",input:e,nodes:[]},s=[i],o=i,u=i,l=0,p=e.length,f=0,c=0,m,B=()=>e[f++],C=F=>{if(F.type==="text"&&u.type==="dot"&&(u.type="text"),u&&u.type==="text"&&F.type==="text"){u.value+=F.value;return}return o.nodes.push(F),F.parent=o,F.prev=u,u=F,F};for(C({type:"bos"});f<p;)if(o=s[s.length-1],m=B(),!(m===k8e||m===_8e)){if(m===D8){C({type:"text",value:(t.keepEscaping?m:"")+B()});continue}if(m===NX){C({type:"text",value:"\\"+m});continue}if(m===kX){l++;let F;for(;f<p&&(F=B());){if(m+=F,F===kX){l++;continue}if(F===D8){m+=B();continue}if(F===NX&&(l--,l===0))break}C({type:"text",value:m});continue}if(m===D8e){o=C({type:"paren",nodes:[]}),s.push(o),C({type:"text",value:m});continue}if(m===x8e){if(o.type!=="paren"){C({type:"text",value:m});continue}o=s.pop(),C({type:"text",value:m}),o=s[s.length-1];continue}if(m===Q8e||m===R8e||m===I8e){let F=m,H;for(t.keepQuotes!==!0&&(m="");f<p&&(H=B());){if(H===D8){m+=H+B();continue}if(H===F){t.keepQuotes===!0&&(m+=H);break}m+=H}C({type:"text",value:m});continue}if(m===F8e){c++;let H={type:"brace",open:!0,close:!1,dollar:u.value&&u.value.slice(-1)==="$"||o.dollar===!0,depth:c,commas:0,ranges:0,nodes:[]};o=C(H),s.push(o),C({type:"open",value:m});continue}if(m===S8e){if(o.type!=="brace"){C({type:"text",value:m});continue}let F="close";o=s.pop(),o.close=!0,C({type:F,value:m}),c--,o=s[s.length-1];continue}if(m===w8e&&c>0){if(o.ranges>0){o.ranges=0;let F=o.nodes.shift();o.nodes=[F,{type:"text",value:B8e(o)}]}C({type:"comma",value:m}),o.commas++;continue}if(m===b8e&&c>0&&o.commas===0){let F=o.nodes;if(c===0||F.length===0){C({type:"text",value:m});continue}if(u.type==="dot"){if(o.range=[],u.value+=m,u.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,u.type="text";continue}o.ranges++,o.args=[];continue}if(u.type==="range"){F.pop();let H=F[F.length-1];H.value+=u.value+m,u=H,o.ranges--;continue}C({type:"dot",value:m});continue}C({type:"text",value:m})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(q=>{q.nodes||(q.type==="open"&&(q.isOpen=!0),q.type==="close"&&(q.isClose=!0),q.nodes||(q.type="text"),q.invalid=!0)});let F=s[s.length-1],H=F.nodes.indexOf(o);F.nodes.splice(H,1,...o.nodes)}while(s.length>0);return C({type:"eos"}),i};TX.exports=N8e});var LX=de((kUe,MX)=>{"use strict";var UX=yb(),T8e=DX(),O8e=SX(),U8e=OX(),cu=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let i=cu.create(n,t);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(cu.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};cu.parse=(e,t={})=>U8e(e,t);cu.stringify=(e,t={})=>UX(typeof e=="string"?cu.parse(e,t):e,t);cu.compile=(e,t={})=>(typeof e=="string"&&(e=cu.parse(e,t)),T8e(e,t));cu.expand=(e,t={})=>{typeof e=="string"&&(e=cu.parse(e,t));let r=O8e(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};cu.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?cu.compile(e,t):cu.expand(e,t);MX.exports=cu});var My=de((NUe,jX)=>{"use strict";var M8e=require("path"),Tl="\\\\/",PX=`[^${Tl}]`,lp="\\.",L8e="\\+",P8e="\\?",Bb="\\/",H8e="(?=.)",HX="[^/]",x8=`(?:${Bb}|$)`,$X=`(?:^|${Bb}
|
|||
|
|
Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.
|
|||
|
|
|
|||
|
|
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-shorthand-usage
|
|||
|
|
`);e&&t?(Hy("map legacy context/filter to options.pathFilter"),r={...t,pathFilter:e},n=z8(r),n.warn(`[http-proxy-middleware] Legacy "context" argument is deprecated. Migrate your "context" to "options.pathFilter":
|
|||
|
|
|
|||
|
|
const options = {
|
|||
|
|
pathFilter: '${e}',
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-context-argument
|
|||
|
|
`)):e&&!t?(r={...e},n=z8(r)):n=z8({}),Object.entries(ike).forEach(([o,u])=>{r[o]&&(r.on={...r.on},r.on[u]=r[o],Hy('map legacy event "%s" to "on.%s"',o,u),n.warn(`[http-proxy-middleware] Legacy "${o}" is deprecated. Migrate to "options.on.${u}":
|
|||
|
|
|
|||
|
|
const options = {
|
|||
|
|
on: {
|
|||
|
|
${u}: () => {},
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#refactored-proxy-events
|
|||
|
|
`))});let i=r.logProvider&&r.logProvider(),s=r.logLevel;return Hy("legacy logLevel",s),Hy("legacy logProvider: %O",i),typeof s=="string"&&s!=="silent"&&(Hy('map "logProvider" to "logger"'),n.warn(`[http-proxy-middleware] Legacy "logLevel" and "logProvider" are deprecated. Migrate to "options.logger":
|
|||
|
|
|
|||
|
|
const options = {
|
|||
|
|
logger: console,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
More details: https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md#removed-logprovider-and-loglevel-options
|
|||
|
|
`)),r}function z8(e){let t=e.logProvider&&e.logProvider();return t&&(e.logger=t),(0,nke.getLogger)(e)}});var _ee=de(Z8=>{"use strict";Object.defineProperty(Z8,"__esModule",{value:!0});Z8.legacyCreateProxyMiddleware=cke;var oke=Y8(),ake=ep(),uke=Qee(),Ree=ake.Debug.extend("legacy-create-proxy-middleware");function cke(e,t){Ree("init");let r=(0,uke.legacyOptionsAdapter)(e,t),n=(0,oke.createProxyMiddleware)(r);return Ree("add marker for patching req.url (old behavior)"),n.__LEGACY_HTTP_PROXY_MIDDLEWARE__=!0,n}});var kee=de(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});Db.legacyCreateProxyMiddleware=void 0;var lke=_ee();Object.defineProperty(Db,"legacyCreateProxyMiddleware",{enumerable:!0,get:function(){return lke.legacyCreateProxyMiddleware}})});var Nee=de(Ed=>{"use strict";var Ake=Ed&&Ed.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),pke=Ed&&Ed.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ake(t,e,r)};Object.defineProperty(Ed,"__esModule",{value:!0});pke(kee(),Ed)});var Tee=de(Ml=>{"use strict";var fke=Ml&&Ml.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xb=Ml&&Ml.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&fke(t,e,r)};Object.defineProperty(Ml,"__esModule",{value:!0});xb(Y8(),Ml);xb(See(),Ml);xb(C8(),Ml);xb(Nee(),Ml)});(()=>{var nS=Object.create,pm=Object.defineProperty,iS=Object.getOwnPropertyDescriptor,sS=Object.getOwnPropertyNames,uS=Object.getPrototypeOf,aS=Object.prototype.hasOwnProperty,Ba=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sS(t))!aS.call(e,i)&&i!==r&&pm(e,i,{get:()=>t[i],enumerable:!(n=iS(t,i))||n.enumerable});return e},Zr=(e,t,r)=>(r=e!=null?nS(uS(e)):{},oS(t||!e||!e.__esModule?pm(r,"default",{value:e,enumerable:!0}):r,e)),xc=Se((e,t)=>{(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",u="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",p=500,f="__lodash_placeholder__",c=1,m=2,B=4,C=1,F=2,H=1,q=2,se=4,ce=8,Ce=16,pe=32,De=64,me=128,Ie=256,je=512,et=30,he="...",$e=800,He=16,At=1,Te=2,xe=3,rt=1/0,Qt=9007199254740991,ut=17976931348623157e292,Ze=NaN,gt=4294967295,Pt=gt-1,rn=gt>>>1,cr=[["ary",me],["bind",H],["bindKey",q],["curry",ce],["curryRight",Ce],["flip",je],["partial",pe],["partialRight",De],["rearg",Ie]],Jt="[object Arguments]",St="[object Array]",Wr="[object AsyncFunction]",rr="[object Boolean]",yt="[object Date]",sr="[object DOMException]",Dt="[object Error]",Wt="[object Function]",K="[object GeneratorFunction]",T="[object Map]",J="[object Number]",Ue="[object Null]",Xe="[object Object]",jt="[object Promise]",Cr="[object Proxy]",dr="[object RegExp]",er="[object Set]",Zt="[object String]",Vn="[object Symbol]",Oi="[object Undefined]",Jn="[object WeakMap]",U="[object WeakSet]",x="[object ArrayBuffer]",M="[object DataView]",ee="[object Float32Array]",ye="[object Float64Array]",Qe="[object Int8Array]",re="[object Int16Array]",Oe="[object Int32Array]",Re="[object Uint8Array]",dt="[object Uint8ClampedArray]",st="[object Uint16Array]",nt="[object Uint32Array]",Et=/\b__p \+= '';/g,Bt=/\b(__p \+=) '' \+/g,Lt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ar=/&(
|
|||
|
|
/* [wrapped with `+g+`] */
|
|||
|
|
`)}function zte(A){return $r(A)||Hf(A)||!!(k&&A&&A[k])}function Kl(A,g){var I=typeof A;return g=g??Qt,!!g&&(I=="number"||I!="symbol"&&zn.test(A))&&A>-1&&A%1==0&&A<g}function Qo(A,g,I){if(!Li(I))return!1;var G=typeof g;return(G=="number"?ta(I)&&Kl(g,I.length):G=="string"&&g in I)?hc(I[g],A):!1}function tD(A,g){if($r(A))return!1;var I=typeof A;return I=="number"||I=="symbol"||I=="boolean"||A==null||Ua(A)?!0:Ia.test(A)||!pu.test(A)||g!=null&&A in kn(g)}function Kte(A){var g=typeof A;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?A!=="__proto__":A===null}function rD(A){var g=eC(A),I=ge[g];if(typeof I!="function"||!(g in jr.prototype))return!1;if(A===I)return!0;var G=Zb(I);return!!G&&A===G[0]}function Zte(A){return!!a&&a in A}var Xte=Yl?Zl:yD;function am(A){var g=A&&A.constructor,I=typeof g=="function"&&g.prototype||Na;return A===I}function V_(A){return A===A&&!Li(A)}function J_(A,g){return function(I){return I==null?!1:I[A]===g&&(g!==r||A in kn(I))}}function ere(A){var g=lC(A,function(G){return I.size===p&&I.clear(),G}),I=g.cache;return g}function tre(A,g){var I=A[1],G=g[1],le=I|G,Be=le<(H|q|me),Le=G==me&&I==ce||G==me&&I==Ie&&A[7].length<=g[8]||G==(me|Ie)&&g[7].length<=g[8]&&I==ce;if(!(Be||Le))return A;G&H&&(A[2]=g[2],le|=I&H?0:se);var qe=g[3];if(qe){var Ke=A[3];A[3]=Ke?Q_(Ke,qe,g[4]):qe,A[4]=Ke?ao(A[3],f):g[4]}return qe=g[5],qe&&(Ke=A[5],A[5]=Ke?R_(Ke,qe,g[6]):qe,A[6]=Ke?ao(A[5],f):g[6]),qe=g[7],qe&&(A[7]=qe),G&me&&(A[8]=A[8]==null?g[8]:fe(A[8],g[8])),A[9]==null&&(A[9]=g[9]),A[0]=g[0],A[1]=le,A}function rre(A){var g=[];if(A!=null)for(var I in kn(A))g.push(I);return g}function nre(A){return d.call(A)}function W_(A,g,I){return g=j(g===r?A.length-1:g,0),function(){for(var G=arguments,le=-1,Be=j(G.length-g,0),Le=at(Be);++le<Be;)Le[le]=G[g+le];le=-1;for(var qe=at(g+1);++le<g;)qe[le]=G[le];return qe[g]=I(Le),eo(A,this,qe)}}function z_(A,g){return g.length<2?A:Mf(A,vu(g,0,-1))}function ire(A,g){for(var I=A.length,G=fe(g.length,I),le=ea(A);G--;){var Be=g[G];A[G]=Kl(Be,I)?le[Be]:r}return A}function nD(A,g){if(!(g==="constructor"&&typeof A[g]=="function")&&g!="__proto__")return A[g]}var K_=X_(y_),um=Ee||function(A,g){return Zi.setTimeout(A,g)},iD=X_(xte);function Z_(A,g,I){var G=g+"";return iD(A,Wte(G,sre(Yte(G),I)))}function X_(A){var g=0,I=0;return function(){var G=ve(),le=He-(G-I);if(I=G,le>0){if(++g>=$e)return arguments[0]}else g=0;return A.apply(r,arguments)}}function oC(A,g){var I=-1,G=A.length,le=G-1;for(g=g===r?G:g;++I<g;){var Be=Pb(I,le),Le=A[Be];A[Be]=A[I],A[I]=Le}return A.length=g,A}var ek=ere(function(A){var g=[];return A.charCodeAt(0)===46&&g.push(""),A.replace(fu,function(I,G,le,Be){g.push(le?Be.replace(Kr,"$1"):G||I)}),g});function Jc(A){if(typeof A=="string"||Ua(A))return A;var g=A+"";return g=="0"&&1/A==-rt?"-0":g}function Pf(A){if(A!=null){try{return qc.call(A)}catch{}try{return A+""}catch{}}return""}function sre(A,g){return It(cr,function(I){var G="_."+I[0];g&I[1]&&!uc(A,G)&&A.push(G)}),A.sort()}function tk(A){if(A instanceof jr)return A.clone();var g=new ui(A.__wrapped__,A.__chain__);return g.__actions__=ea(A.__actions__),g.__index__=A.__index__,g.__values__=A.__values__,g}function ore(A,g,I){(I?Qo(A,g,I):g===r)?g=1:g=j(Jr(g),0);var G=A==null?0:A.length;if(!G||g<1)return[];for(var le=0,Be=0,Le=at(be(G/g));le<G;)Le[Be++]=vu(A,le,le+=g);return Le}function are(A){for(var g=-1,I=A==null?0:A.length,G=0,le=[];++g<I;){var Be=A[g];Be&&(le[G++]=Be)}return le}function ure(){var A=arguments.length;if(!A)return[];for(var g=at(A-1),I=arguments[0],G=A;G--;)g[G-1]=arguments[G];return mu($r(I)?ea(I):[I],ro(g,1))}var cre=tn(function(A,g){return us(A)?rm(A,ro(g,1,us,!0)):[]}),lre=tn(function(A,g){var I=Iu(g);return us(I)&&(I=r),us(A)?rm(A,ro(g,1,us,!0),Br(I,2)):[]}),Are=tn(function(A,g){var I=Iu(g);return us(I)&&(I=r),us(A)?rm(A,ro(g,1,us,!0),r,I):[]});function pre(A,g,I){var G=A==null?0:A.length;return G?(g=I||g===r?1:Jr(g),vu(A,g<0?0:g,G)):[]}function fre(A,g,I){var G=A==null?0:A.length;return G?(g=I||g===r?1:Jr(g),g=G-g,vu(A,0,g<0?0:g)):[]}function hre(A,g){return A&&A.length?Jy(A,Br(g,3),!0,!0):[]}function dre(A,g)
|
|||
|
|
`;A.replace($t,function(xr,on,fn,Ma,_o,La){return fn||(fn=Ma),xt+=A.slice(Ct,La).replace(Io,kf),on&&(qe=!0,xt+=`' +
|
|||
|
|
__e(`+on+`) +
|
|||
|
|
'`),_o&&(Ke=!0,xt+=`';
|
|||
|
|
`+_o+`;
|
|||
|
|
__p += '`),fn&&(xt+=`' +
|
|||
|
|
((__t = (`+fn+`)) == null ? '' : __t) +
|
|||
|
|
'`),Ct=La+xr.length,xr}),xt+=`';
|
|||
|
|
`;var Dr=Ut.call(g,"variable")&&g.variable;if(!Dr)xt=`with (obj) {
|
|||
|
|
`+xt+`
|
|||
|
|
}
|
|||
|
|
`;else if(Or.test(Dr))throw new _r(u);xt=(Ke?xt.replace(Et,""):xt).replace(Bt,"$1").replace(Lt,"$1;"),xt="function("+(Dr||"obj")+`) {
|
|||
|
|
`+(Dr?"":`obj || (obj = {});
|
|||
|
|
`)+"var __t, __p = ''"+(qe?", __e = _.escape":"")+(Ke?`, __j = Array.prototype.join;
|
|||
|
|
function print() { __p += __j.call(arguments, '') }
|
|||
|
|
`:`;
|
|||
|
|
`)+xt+`return __p
|
|||
|
|
}`;var Xr=kk(function(){return un(Be,ar+"return "+xt).apply(r,Le)});if(Xr.source=xt,cD(Xr))throw Xr;return Xr}function bse(A){return qn(A).toLowerCase()}function Dse(A){return qn(A).toUpperCase()}function xse(A,g,I){if(A=qn(A),A&&(I||g===r))return Lc(A);if(!A||!(g=Oa(g)))return A;var G=ni(A),le=ni(g),Be=Sf(G,le),Le=Pd(G,le)+1;return bp(G,Be,Le).join("")}function Fse(A,g,I){if(A=qn(A),A&&(I||g===r))return A.slice(0,Gl(A)+1);if(!A||!(g=Oa(g)))return A;var G=ni(A),le=Pd(G,ni(g))+1;return bp(G,0,le).join("")}function Sse(A,g,I){if(A=qn(A),A&&(I||g===r))return A.replace(wa,"");if(!A||!(g=Oa(g)))return A;var G=ni(A),le=Sf(G,ni(g));return bp(G,le).join("")}function Qse(A,g){var I=et,G=he;if(Li(g)){var le="separator"in g?g.separator:le;I="length"in g?Jr(g.length):I,G="omission"in g?Oa(g.omission):G}A=qn(A);var Be=A.length;if(Fa(A)){var Le=ni(A);Be=Le.length}if(I>=Be)return A;var qe=I-Sa(G);if(qe<1)return G;var Ke=Le?bp(Le,0,qe).join(""):A.slice(0,qe);if(le===r)return Ke+G;if(Le&&(qe+=Ke.length-qe),lD(le)){if(A.slice(qe).search(le)){var Ct,vt=Ke;for(le.global||(le=Ac(le.source,qn(Wn.exec(le))+"g")),le.lastIndex=0;Ct=le.exec(vt);)var xt=Ct.index;Ke=Ke.slice(0,xt===r?qe:xt)}}else if(A.indexOf(Oa(le),qe)!=qe){var $t=Ke.lastIndexOf(le);$t>-1&&(Ke=Ke.slice(0,$t))}return Ke+G}function Rse(A){return A=qn(A),A&&Di.test(A)?A.replace(Ar,_a):A}var _se=Kd(function(A,g,I){return A+(I?" ":"")+g.toUpperCase()}),fD=N_("toUpperCase");function _k(A,g,I){return A=qn(A),g=I?r:g,g===r?mp(A)?Xg(A):tt(A):A.match(g)||[]}var kk=tn(function(A,g){try{return eo(A,r,g)}catch(I){return cD(I)?I:new _r(I)}}),kse=zl(function(A,g){return It(g,function(I){I=Jc(I),Jl(A,I,aD(A[I],A))}),A});function Nse(A){var g=A==null?0:A.length,I=Br();return A=g?ri(A,function(G){if(typeof G[1]!="function")throw new lt(o);return[I(G[0]),G[1]]}):[],tn(function(G){for(var le=-1;++le<g;){var Be=A[le];if(eo(Be[0],this,G))return eo(Be[1],this,G)}})}function Tse(A){return ote(Cu(A,c))}function hD(A){return function(){return A}}function Ose(A,g){return A==null||A!==A?g:A}var Use=O_(),Mse=O_(!0);function sa(A){return A}function dD(A){return A_(typeof A=="function"?A:Cu(A,c))}function Lse(A){return f_(Cu(A,c))}function Pse(A,g){return h_(A,Cu(g,c))}var Hse=tn(function(A,g){return function(I){return nm(I,A,g)}}),$se=tn(function(A,g){return function(I){return nm(A,I,g)}});function gD(A,g,I){var G=Ls(g),le=Gy(g,G);I==null&&!(Li(g)&&(le.length||!G.length))&&(I=g,g=A,A=this,le=Gy(g,Ls(g)));var Be=!(Li(I)&&"chain"in I)||!!I.chain,Le=Zl(A);return It(le,function(qe){var Ke=g[qe];A[qe]=Ke,Le&&(A.prototype[qe]=function(){var Ct=this.__chain__;if(Be||Ct){var vt=A(this.__wrapped__),xt=vt.__actions__=ea(this.__actions__);return xt.push({func:Ke,args:arguments,thisArg:A}),vt.__chain__=Ct,vt}return Ke.apply(A,mu([this.value()],arguments))})}),A}function qse(){return Zi._===this&&(Zi._=E),this}function mD(){}function jse(A){return A=Jr(A),tn(function(g){return d_(g,A)})}var Gse=Jb(ri),Yse=Jb(Cf),Vse=Jb(Zo);function Nk(A){return tD(A)?$l(Jc(A)):Ite(A)}function Jse(A){return function(g){return A==null?r:Mf(A,g)}}var Wse=M_(),zse=M_(!0);function ED(){return[]}function yD(){return!1}function Kse(){return{}}function Zse(){return""}function Xse(){return!0}function eoe(A,g){if(A=Jr(A),A<1||A>Qt)return[];var I=gt,G=fe(A,gt);g=Br(g),A-=gt;for(var le=Ts(G,g);++I<A;)g(I);return le}function toe(A){return $r(A)?ri(A,Jc):Ua(A)?[A]:ea(ek(qn(A)))}function roe(A){var g=++em;return qn(A)+g}var noe=Ky(function(A,g){return A+g},0),ioe=Wb("ceil"),soe=Ky(function(A,g){return A/g},1),ooe=Wb("floor");function aoe(A){return A&&A.length?jy(A,sa,Nb):r}function uoe(A,g){return A&&A.length?jy(A,Br(g,2),Nb):r}function coe(A){return Kg(A,sa)}function loe(A,g){return Kg(A,Br(g,2))}function Aoe(A){return A&&A.length?jy(A,sa,Mb):r}function poe(A,g){return A&&A.length?jy(A,Br(g,2),Mb):r}var foe=Ky(function(A,g){return A*g},1),hoe=Wb("round"),doe=Ky(function(A,g){return A-g},0);function goe(A){return A&&A.length?xf(A,sa):0}function moe(A,g){return A&&A.length?xf(A,Br(g,2)):0}return ge.after=Lne,ge.ary=Ak,ge.assign=Die,ge.assignIn=bk,ge.assi
|
|||
|
|
`,r:"\r",t:" "};function D(ne,N,k){return N?b[N]:String.fromCharCode(parseInt(k,16))}var S=new String(""),L="\\",P={"{":Object,"[":Array},te=Object.hasOwnProperty;return function(ne,N){var k=ne.match(E),z,O=k[0],Z=!1;O==="{"?z={}:O==="["?z=[]:(z=[],Z=!0);for(var V,ue=[z],Ee=1-Z,be=k.length;Ee<be;++Ee){O=k[Ee];var we;switch(O.charCodeAt(0)){default:we=ue[0],we[V||we.length]=+O,V=void 0;break;case 34:if(O=O.substring(1,O.length-1),O.indexOf(L)!==-1&&(O=O.replace(w,D)),we=ue[0],!V)if(we instanceof Array)V=we.length;else{V=O||S;break}we[V]=O,V=void 0;break;case 91:we=ue[0],ue.unshift(we[V||we.length]=[]),V=void 0;break;case 93:ue.shift();break;case 102:we=ue[0],we[V||we.length]=!1,V=void 0;break;case 110:we=ue[0],we[V||we.length]=null,V=void 0;break;case 116:we=ue[0],we[V||we.length]=!0,V=void 0;break;case 123:we=ue[0],ue.unshift(we[V||we.length]={}),V=void 0;break;case 125:ue.shift();break}}if(Z){if(ue.length!==1)throw new Error;z=z[0]}else if(ue.length)throw new Error;if(N){var We=function(it,y){var Q=it[y];if(Q&&typeof Q=="object"){var W=null;for(var j in Q)if(te.call(Q,j)&&Q!==it){var fe=We(Q,j);fe!==void 0?Q[j]=fe:(W||(W=[]),W.push(j))}if(W)for(var ve=W.length;--ve>=0;)delete Q[W[ve]]}return N.call(it,y,Q)};z=We({"":z},"")}return z}}();(typeof v>"u"||!v)&&(v={}),(typeof v.asn1>"u"||!v.asn1)&&(v.asn1={}),v.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var d=a.toString(16);return d.length%2==1&&(d="0"+d),d},this.bigIntToMinTwosComplementsHex=function(a){return at(a)},this.getPEMStringFromHex=function(a,d){return ct(a,d)},this.newObject=function(a){var d=v,h=d.asn1,E=h.ASN1Object,w=h.DERBoolean,b=h.DERInteger,D=h.DERBitString,S=h.DEROctetString,L=h.DERNull,P=h.DERObjectIdentifier,te=h.DEREnumerated,ne=h.DERUTF8String,N=h.DERNumericString,k=h.DERPrintableString,z=h.DERTeletexString,O=h.DERIA5String,Z=h.DERUTCTime,V=h.DERGeneralizedTime,ue=h.DERVisibleString,Ee=h.DERBMPString,be=h.DERSequence,we=h.DERSet,We=h.DERTaggedObject,it=h.ASN1Util.newObject;if(a instanceof h.ASN1Object)return a;var y=Object.keys(a);if(y.length!=1)throw new Error("key of param shall be only one.");var Q=y[0];if(":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+Q+":")==-1)throw new Error("undefined key: "+Q);if(Q=="bool")return new w(a[Q]);if(Q=="int")return new b(a[Q]);if(Q=="bitstr")return new D(a[Q]);if(Q=="octstr")return new S(a[Q]);if(Q=="null")return new L(a[Q]);if(Q=="oid")return new P(a[Q]);if(Q=="enum")return new te(a[Q]);if(Q=="utf8str")return new ne(a[Q]);if(Q=="numstr")return new N(a[Q]);if(Q=="prnstr")return new k(a[Q]);if(Q=="telstr")return new z(a[Q]);if(Q=="ia5str")return new O(a[Q]);if(Q=="utctime")return new Z(a[Q]);if(Q=="gentime")return new V(a[Q]);if(Q=="visstr")return new ue(a[Q]);if(Q=="bmpstr")return new Ee(a[Q]);if(Q=="asn1")return new E(a[Q]);if(Q=="seq"){for(var W=a[Q],j=[],fe=0;fe<W.length;fe++){var ve=it(W[fe]);j.push(ve)}return new be({array:j})}if(Q=="set"){for(var W=a[Q],j=[],fe=0;fe<W.length;fe++){var ve=it(W[fe]);j.push(ve)}return new we({array:j})}if(Q=="tag"){var _e=a[Q];if(Object.prototype.toString.call(_e)==="[object Array]"&&_e.length==3){var Ne=it(_e[2]);return new We({tag:_e[0],explicit:_e[1],obj:Ne})}else return new We(_e)}},this.jsonToASN1HEX=function(a){var d=this.newObject(a);return d.tohex()}},v.asn1.ASN1Util.oidHexToInt=function(a){for(var w="",d=parseInt(a.substr(0,2),16),h=Math.floor(d/40),E=d%40,w=h+"."+E,b="",D=2;D<a.length;D+=2){var S=parseInt(a.substr(D,2),16),L=("00000000"+S.toString(2)).slice(-8);if(b=b+L.substr(1,7),L.substr(0,1)=="0"){var P=new C(b,2);w=w+"."+P.toString(10),b=""}}return w},v.asn1.ASN1Util.oidIntToHex=function(a){var d=function(S){var L=S.toString(16);return L.length==1&&(L="0"+L),L},h=function(S){var L="",P=new C(S,10),te=P.toString(2),ne=7-te.length%7;ne==7&&(ne=0);for(var N="",k=0;k<ne;k++)N+="0";te=N+te;for(var k=0;k<te.length-1;k+=7){var z=te.substr(k,7);k!=te.length-7&&(z="1"+z),L+=d(parseInt(z,2))}return L};if(!a.match(/^[0-9.]+$/))throw"malformed oid string: "+a;var E=""
|
|||
|
|
`:E+`BOOLEAN TRUE
|
|||
|
|
`}if(we=="02"){var ne=b(L,h);return E+"INTEGER "+P(ne,te)+`
|
|||
|
|
`}if(we=="03"){var ne=b(L,h);if(w.isASN1HEX(ne.substr(2))){var N=E+`BITSTRING, encapsulates
|
|||
|
|
`;return N=N+D(ne.substr(2),d,0,E+" "),N}else return E+"BITSTRING "+P(ne,te)+`
|
|||
|
|
`}if(we=="04"){var ne=b(L,h);if(w.isASN1HEX(ne)){var N=E+`OCTETSTRING, encapsulates
|
|||
|
|
`;return N=N+D(ne,d,0,E+" "),N}else return E+"OCTETSTRING "+P(ne,te)+`
|
|||
|
|
`}if(we=="05")return E+`NULL
|
|||
|
|
`;if(we=="06"){var k=b(L,h),z=v.asn1.ASN1Util.oidHexToInt(k),O=v.asn1.x509.OID.oid2name(z),Z=z.replace(/\./g," ");return O!=""?E+"ObjectIdentifier "+O+" ("+Z+`)
|
|||
|
|
`:E+"ObjectIdentifier ("+Z+`)
|
|||
|
|
`}if(we=="0a")return E+"ENUMERATED "+parseInt(b(L,h))+`
|
|||
|
|
`;if(we=="0c")return E+"UTF8String '"+Er(b(L,h))+`'
|
|||
|
|
`;if(we=="13")return E+"PrintableString '"+Er(b(L,h))+`'
|
|||
|
|
`;if(we=="14")return E+"TeletexString '"+Er(b(L,h))+`'
|
|||
|
|
`;if(we=="16")return E+"IA5String '"+Er(b(L,h))+`'
|
|||
|
|
`;if(we=="17")return E+"UTCTime "+Er(b(L,h))+`
|
|||
|
|
`;if(we=="18")return E+"GeneralizedTime "+Er(b(L,h))+`
|
|||
|
|
`;if(we=="1a")return E+"VisualString '"+Er(b(L,h))+`'
|
|||
|
|
`;if(we=="1e")return E+"BMPString '"+Nf(b(L,h))+`'
|
|||
|
|
`;if(we=="30"){if(L.substr(h,4)=="3000")return E+`SEQUENCE {}
|
|||
|
|
`;var N=E+`SEQUENCE
|
|||
|
|
`,V=S(L,h),ue=d;if((V.length==2||V.length==3)&&L.substr(V[0],2)=="06"&&L.substr(V[V.length-1],2)=="04"){var O=w.oidname(b(L,V[0])),Ee=JSON.parse(JSON.stringify(d));Ee.x509ExtName=O,ue=Ee}for(var be=0;be<V.length;be++)N=N+D(L,ue,V[be],E+" ");return N}if(we=="31"){for(var N=E+`SET
|
|||
|
|
`,V=S(L,h),be=0;be<V.length;be++)N=N+D(L,d,V[be],E+" ");return N}var we=parseInt(we,16);if(we&128){var We=we&31;if(we&32){for(var N=E+"["+We+`]
|
|||
|
|
`,V=S(L,h),be=0;be<V.length;be++)N=N+D(L,d,V[be],E+" ");return N}else{var ne=b(L,h);if(It.isASN1HEX(ne)){var N=E+"["+We+`]
|
|||
|
|
`;return N=N+D(ne,d,0,E+" "),N}else(ne.substr(0,8)=="68747470"||d.x509ExtName==="subjectAltName"&&We==2)&&(ne=Er(ne));var N=E+"["+We+"] "+ne+`
|
|||
|
|
`;return N}}return E+"UNKNOWN("+we+") "+b(L,h)+`
|
|||
|
|
`},It.parse=function(a){var d=It,h=d.parse,E=d.isASN1HEX,w=d.getV,b=d.getTLV,D=d.getChildIdx,S=v.asn1,L=S.ASN1Util.oidHexToInt,P=S.x509.OID.oid2name,te=Er,ne=Nf,N=Kg,k={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},z=function(Q){for(var W=[],j=D(Q,0),fe=0;fe<j.length;fe++){var ve=j[fe],_e=b(Q,ve),Ne=h(_e);W.push(Ne)}return W},O=a.substr(0,2),Z={},V=w(a,0);if(O=="01")return a=="0101ff"?{bool:!0}:{bool:!1};if(O=="02")return{int:{hex:V}};if(O=="03")try{if(V.substr(0,2)!="00")throw"not encap";var ue=V.substr(2);if(!E(ue))throw"not encap";return{bitstr:{obj:h(ue)}}}catch{var Ee=null;return V.length<=10&&(Ee=Ei(V)),Ee==null?{bitstr:{hex:V}}:{bitstr:{bin:Ee}}}else if(O=="04")try{if(!E(V))throw"not encap";return{octstr:{obj:h(V)}}}catch{return{octstr:{hex:V}}}else{if(O=="05")return{null:""};if(O=="06"){var be=L(V),we=P(be);return we==""?{oid:be}:{oid:we}}else{if(O=="0a")return V.length>4?{enum:{hex:V}}:{enum:parseInt(V,16)};if(O=="30"||O=="31")return Z[k[O]]=z(a),Z;if(O=="14"){var We=N(V);return Z[k[O]]={str:We},Z}else if(O=="1e"){var We=ne(V);return Z[k[O]]={str:We},Z}else if(":0c:12:13:16:17:18:1a:".indexOf(O)!=-1){var We=te(V);return Z[k[O]]={str:We},Z}else if(O.match(/^8[0-9]$/)){var We=te(V);return We==null|We==""?{tag:{tag:O,explicit:!1,hex:V}}:We.match(/[\x00-\x1F\x7F-\x9F]/)!=null||We.match(/[\u0000-\u001F\u0080–\u009F]/)!=null?{tag:{tag:O,explicit:!1,hex:V}}:{tag:{tag:O,explicit:!1,str:We}}}else if(O.match(/^a[0-9]$/))try{if(!E(V))throw new Error("not encap");return{tag:{tag:O,explicit:!0,obj:h(V)}}}catch{return{tag:{tag:O,explicit:!0,hex:V}}}else{var it=new v.asn1.ASN1Object;it.hV=V;var y=it.getLengthHexFromValue();return{asn1:{tlv:O+y+V}}}}}},It.isContextTag=function(a,d){a=a.toLowerCase();var h,E;try{h=parseInt(a,16)}catch{return-1}if(d===void 0)return(h&192)==128;try{var w=d.match(/^\[[0-9]+\]$/);return w==null||(E=parseInt(d.substr(1,d.length-1),10),E>31)?!1:(h&192)==128&&(h&31)==E}catch{return!1}},It.isASN1HEX=function(a){var d=It;if(a.length%2==1)return!1;var h=d.getVblen(a,0),E=a.substr(0,2),w=d.getL(a,0),b=a.length-E.length-w.length;return b==h*2},It.checkStrictDER=function(a,d,h,E,w){var b=It;if(h===void 0){if(typeof a!="string")throw new Error("not hex string");if(a=a.toLowerCase(),!v.lang.String.isHex(a))throw new Error("not hex string");h=a.length,E=a.length/2,E<128?w=1:w=Math.ceil(E.toString(16))+1}var D=b.getL(a,d);if(D.length>w*2)throw new Error("L of TLV too long: idx="+d);var S=b.getVblen(a,d);if(S>E)throw new Error("value of L too long than hex: idx="+d);var L=b.getTLV(a,d),P=L.length-2-b.getL(a,d).length;if(P!==S*2)throw new Error("V string length and L's value not the same:"+P+"/"+S*2);if(d===0&&a.length!=L.length)throw new Error("total length and TLV length unmatch:"+a.length+"!="+L.length);var te=a.substr(d,2);if(te==="02"){var ne=b.getVidx(a,d);if(a.substr(ne,2)=="00"&&a.charCodeAt(ne+2)<56)throw new Error("not least zeros for DER INTEGER")}if(parseInt(te,16)&32){for(var N=b.getVblen(a,d),k=0,z=b.getChildIdx(a,d),O=0;O<z.length;O++){var Z=b.getTLV(a,z[O]);k+=Z.length,b.checkStrictDER(a,z[O],h,E,w)}if(N*2!=k)throw new Error("sum of children's TLV length and L unmatch: "+N*2+"!="+k)}},It.oidname=function(a){var d=v.asn1;v.lang.String.isHex(a)&&(a=d.ASN1Util.oidHexToInt(a));var h=d.x509.OID.oid2name(a);return h===""&&(h=a),h},(typeof v>"u"||!v)&&(v={}),(typeof v.asn1>"u"||!v.asn1)&&(v.asn1={}),(typeof v.asn1.x509>"u"||!v.asn1.x509)&&(v.asn1.x509={}),v.asn1.x509.Certificate=function(a){v.asn1.x509.Certificate.superclass.constructor.call(this);var d=v,h=d.asn1,E=h.DERBitString,w=h.DERSequence,b=h.x509,D=b.TBSCertificate,S=b.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(L){this.params=L},this.sign=function(){var L=this.params,P=L.sigalg;L.sigalg.name!=null&&(P=L.sigalg.name);var te=L.tbsobj.tohex(),ne=new v.crypto.Signature({alg:P});ne.init(L.cakey),ne.updateHex(te),L.sighex=ne.sign()},this.getPEM=function(){return ct(this.tohex(),"CERTIFICATE")},this.tohex=function(){var L=this.params;if((L.t
|
|||
|
|
`),a=a.replace(/\s+$/,""),a}function Ff(a){var d=a.replace(/[^0-9A-Za-z\/+=]*/g,""),h=p(d);return h}function Lc(a,d){return"-----BEGIN "+d+`-----\r
|
|||
|
|
`+Ts(a,64)+`\r
|
|||
|
|
-----END `+d+`-----\r
|
|||
|
|
`}function ct(a,d){return"-----BEGIN "+d+`-----\r
|
|||
|
|
`+Ts(Df(a),64)+`\r
|
|||
|
|
-----END `+d+`-----\r
|
|||
|
|
`}function Xn(a,d){if(a.indexOf("-----BEGIN ")==-1)throw new Error("can't find PEM header");return d!==void 0?(a=a.replace(new RegExp("^[^]*-----BEGIN "+d+"-----"),""),a=a.replace(new RegExp("-----END "+d+"-----[^]*$"),"")):(a=a.replace(/^[^]*-----BEGIN [^-]+-----/,""),a=a.replace(/-----END [^-]+-----[^]*$/,"")),Ff(a)}function Pc(a){return a.indexOf("-----BEGIN ")==-1||a.indexOf("-----END ")==-1?null:(a=a.replace(/^[\s\S]*?-----BEGIN [^-]+-----/m,""),a=a.replace(/-----END [\s\S]+$/m,""),a=a.replace(/\s+/g,""),a.match(/^[0-9a-zA-Z+/=]+$/)?a:null)}function Sf(a){if(a.length%2!=0)throw"input is not even length";if(a.match(/^[0-9A-Fa-f]+$/)==null)throw"input is not hexadecimal";for(var d=new ArrayBuffer(a.length/2),h=new DataView(d),E=0;E<a.length/2;E++)h.setUint8(E,parseInt(a.substr(E*2,2),16));return d}function Pd(a){for(var d="",h=new DataView(a),E=0;E<a.byteLength;E++)d+=("00"+h.getUint8(E).toString(16)).slice(-2);return d}function Qf(a){var d,h,E,w,b,D,S,L,P,te,ne,N;if(a=Fa(a),N=a.match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/),N)return d=parseInt(N[1]),h=parseInt(N[2])-1,E=parseInt(N[3]),w=parseInt(N[4]),b=parseInt(N[5]),D=parseInt(N[6]),S=0,te=N[7],te!==""&&(ne=(te.substr(1)+"00").substr(0,3),S=parseInt(ne)),Date.UTC(d,h,E,w,b,D,S);throw new Error("unsupported zulu format: "+a)}function Hd(a){var d=new Date(a),h=("0000"+d.getUTCFullYear()).slice(-4),E=("00"+(d.getUTCMonth()+1)).slice(-2),w=("00"+d.getUTCDate()).slice(-2),b=("00"+d.getUTCHours()).slice(-2),D=("00"+d.getUTCMinutes()).slice(-2),S=("00"+d.getUTCSeconds()).slice(-2),L=("000"+d.getUTCMilliseconds()).slice(-3);return L=L.replace(/0+$/,""),L=L!=""?"."+L:L,h+E+w+b+D+S+L+"Z"}function Rf(a){return Math.round(Qf(a)/1e3)}function kf(a){return new Date(Qf(a))}function Zg(a,d,h){var E,w=a.getUTCFullYear();if(d){if(w<1950||2049<w)throw"not proper year for UTCTime: "+w;E=(""+w).slice(-2)}else E=("000"+w).slice(-4);if(E+=("0"+(a.getUTCMonth()+1)).slice(-2),E+=("0"+a.getUTCDate()).slice(-2),E+=("0"+a.getUTCHours()).slice(-2),E+=("0"+a.getUTCMinutes()).slice(-2),E+=("0"+a.getUTCSeconds()).slice(-2),h){var b=a.getUTCMilliseconds();b!==0&&(b=("00"+b).slice(-3),b=b.replace(/0+$/g,""),E+="."+b)}return E+="Z",E}function Fa(a){return a.match(/^[0-9]{12}Z$/)||a.match(/^[0-9]{12}[.][0-9]*Z$/)?a.match(/^[0-4]/)?"20"+a:"19"+a:a}function mp(a){return a.replace(/%/g,"")}function ql(a){return a.replace(/(..)/g,"%$1")}function lc(a){var d="malformed IPv6 address";if(!a.match(/^[0-9A-Fa-f:]+$/))throw d;a=a.toLowerCase();var h=a.split(":").length-1;if(h<2)throw d;var E=":".repeat(7-h+2);a=a.replace("::",E);var w=a.split(":");if(w.length!=8)throw d;for(var b=0;b<8;b++)w[b]=("0000"+w[b]).slice(-4);return w.join("")}function Ep(a){if(!a.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+a);a=a.toLowerCase();var d=a.match(/.{1,4}/g);d=d.map(function(w){return w.replace(/^0+/,"")}),d=d.map(function(w){return w==""?"0":w}),a=":"+d.join(":")+":";var h=a.match(/:(0:){2,}/g);if(h==null)return a.slice(1,-1);var E=h.sort().slice(-1)[0];return a=a.replace(E.substr(0,E.length-1),":"),a.substr(0,2)!="::"&&(a=a.substr(1)),a.substr(-2,2)!="::"&&(a=a.substr(0,a.length-1)),a}function ao(a){var d=new Error("malformed hex value");if(!a.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw d;if(a.length==8){var h;try{return h=parseInt(a.substr(0,2),16)+"."+parseInt(a.substr(2,2),16)+"."+parseInt(a.substr(4,2),16)+"."+parseInt(a.substr(6,2),16),h}catch{throw d}}else if(a.length==16)try{return ao(a.substr(0,8))+"/"+jl(a.substr(8))}catch{throw d}else{if(a.length==32)return Ep(a);if(a.length==64){try{return Ep(a.substr(0,32))+"/"+jl(a.substr(32))}catch{throw d}return}else return a}}function jl(a){var d=new Error("malformed mask"),h;try{h=new C(a,16).toString(2)}catch{throw d}if(!h.match(/^1*0*$/))throw d;return h.replace(/0+$/,"").length}function yp(a){var d=new Error("malformed IP address");if(a=a.toLowerCase(a),!a.match(/^[0-9a-f.:/]+$/))throw d;if(a.match(/^[0-9.]+$/)){var h=a.split(".");if(h.length!==4)throw d;var E="";try{for(var w=0;w<4;w++){var b=parseInt(h[w]);E+=("0"+b.toString(16
|
|||
|
|
`),a}function Gl(a){return a=a.replace(/\r\n/mg,`
|
|||
|
|
`),a=a.replace(/\n/mg,`\r
|
|||
|
|
`),a}v.lang.String.isInteger=function(a){return a.match(/^[0-9]+$/)?!0:!!a.match(/^-[0-9]+$/)},v.lang.String.isHex=function(a){return _a(a)};function _a(a){return!!(a.length%2==0&&(a.match(/^[0-9a-f]+$/)||a.match(/^[0-9A-F]+$/)))}v.lang.String.isBase64=function(a){return a=a.replace(/\s+/g,""),!!(a.match(/^[0-9A-Za-z+\/]+={0,3}$/)&&a.length%4==0)},v.lang.String.isBase64URL=function(a){return a.match(/[+/=]/)?!1:(a=Zo(a),v.lang.String.isBase64(a))};function $c(a){return!!a.match(/^[0-9A-Za-z-_.]+$/)}v.lang.String.isIntegerArray=function(a){return a=a.replace(/\s+/g,""),!!a.match(/^\[[0-9,]+\]$/)},v.lang.String.isPrintable=function(a){return a.match(/^[0-9A-Za-z '()+,-./:=?]*$/)!==null},v.lang.String.isIA5=function(a){return a.match(/^[\x20-\x21\x23-\x7f]*$/)!==null},v.lang.String.isMail=function(a){return a.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};function Cp(a){return a.length%2==1?"0"+a:a.substr(0,1)>"7"?"00"+a:a}function Xg(a){a=a.replace(/^\s*\[\s*/,""),a=a.replace(/\s*\]\s*$/,""),a=a.replace(/\s*/g,"");try{var d=a.split(/,/).map(function(h,E,w){var b=parseInt(h);if(b<0||255<b)throw"integer not in range 0-255";var D=("00"+b.toString(16)).slice(-2);return D}).join("");return d}catch(h){throw"malformed integer array string: "+h}}var qd=function(a,d){var h=a.length;a.length>d.length&&(h=d.length);for(var E=0;E<h;E++)if(a.charCodeAt(E)!=d.charCodeAt(E))return E;return a.length!=d.length?h:-1};function Xo(a){var d=function(S){var L=S.toString(16);return L.length==1&&(L="0"+L),L},h=function(S){var L="",P=parseInt(S,10),te=P.toString(2),ne=7-te.length%7;ne==7&&(ne=0);for(var N="",k=0;k<ne;k++)N+="0";te=N+te;for(var k=0;k<te.length-1;k+=7){var z=te.substr(k,7);k!=te.length-7&&(z="1"+z),L+=d(parseInt(z,2))}return L};try{if(!a.match(/^[0-9.]+$/))return null;var E="",w=a.split("."),b=parseInt(w[0],10)*40+parseInt(w[1],10);E+=d(b),w.splice(0,2);for(var D=0;D<w.length;D++)E+=h(w[D]);return E}catch{return null}}function Je(a){if(!_a(a))return null;try{var d=[],h=a.substr(0,2),E=parseInt(h,16);d[0]=new String(Math.floor(E/40)),d[1]=new String(E%40);for(var w=a.substr(2),b=[],D=0;D<w.length/2;D++)b.push(parseInt(w.substr(D*2,2),16));for(var S=[],L="",D=0;D<b.length;D++)b[D]&128?L=L+Vt((b[D]&127).toString(2),7):(L=L+Vt((b[D]&127).toString(2),7),S.push(new String(parseInt(L,2))),L="");var P=d.join(".");return S.length>0&&(P=P+"."+S.join(".")),P}catch{return null}}function ht(a){var d=new C(String(a),10);return at(d)}function at(a){var d=a.toString(16);if(d.substr(0,1)!="-")return d.length%2==1?d="0"+d:d.match(/^[0-7]/)||(d="00"+d),d;var h=d.substr(1),E=h.length;E%2==1?E+=1:d.match(/^[0-7]/)||(E+=2);for(var w="",b=0;b<E;b++)w+="f";var D=new C(w,16),S=D.xor(a).add(C.ONE);return d=S.toString(16).replace(/^-/,""),d}var Vt=function(a,d,h){return h==null&&(h="0"),a.length>=d?a:new Array(d-a.length+1).join(h)+a};function _r(a){if(a.length%2!=0||(a=a.toLowerCase(),a.match(/^[0-9a-f]+$/)==null))return-1;try{var d=a.substr(0,2);if(d=="00")return parseInt(a.substr(2),16);var h=parseInt(d,16);if(h>7)return-1;var E=a.substr(2),w=parseInt(E,16).toString(2);w=="0"&&(w="00000000"),w=w.slice(0,0-h);var b=parseInt(w,2);return b==NaN?-1:b}catch{return-1}}function un(a){if(typeof a!="number"||a<0)return null;var d=Number(a).toString(2),h=8-d.length%8;h==8&&(h=0),d=d+Vt("",h,"0");var E=parseInt(d,2).toString(16);E.length%2==1&&(E="0"+E);var w="0"+h;return w+E}function Ei(a){if(typeof a!="string"||a.length%2!=0||!a.match(/^[0-9a-f]+$/))return null;try{var d=parseInt(a.substr(0,2),16);if(d<0||7<d)return null;for(var h=a.substr(2),E="",w=0;w<h.length;w+=2){var b=h.substr(w,2),D=parseInt(b,16).toString(2);D=("0000000"+D).slice(-8),E+=D}return E.substr(0,E.length-d)}catch{return null}}function kn(a){if(typeof a!="string"||a.match(/^[01]+$/)==null)return null;try{var d=parseInt(a,2);return un(d)}catch{return null}}function Ac(a,d){for(var h=0,E=0;E<a.length;E++)h|=1<<d[a[E]];for(var w=h.toString(2),b="",E=w.length-1;E>=0;E--)b+=w[E];return b}function Nn(a,d,h){if(typeof a=="object"){for(var d=String(d).split("."),E
|
|||
|
|
\r
|
|||
|
|
`)!=-1&&(Ee=O.indexOf(`\r
|
|||
|
|
\r
|
|||
|
|
`),be=2),O.indexOf(`
|
|||
|
|
|
|||
|
|
`)!=-1&&(Ee=O.indexOf(`
|
|||
|
|
|
|||
|
|
`),be=1);var we=O.indexOf("-----END");if(Ee!=-1&&we!=-1){var We=O.substring(Ee+be*2,we-be);We=We.replace(/\s+/g,""),Z.data=We}return Z},N=function(O,Z,V){for(var ue=V.substring(0,16),Ee=s.enc.Hex.parse(ue),be=s.enc.Utf8.parse(Z),we=L[O].keylen+L[O].ivlen,We="",it=null;;){var y=s.algo.MD5.create();if(it!=null&&y.update(it),y.update(be),y.update(Ee),it=y.finalize(),We=We+s.enc.Hex.stringify(it),We.length>=we*2)break}var Q={};return Q.keyhex=We.substr(0,L[O].keylen*2),Q.ivhex=We.substr(L[O].keylen*2,L[O].ivlen*2),Q},k=function(O,Z,V,ue){var Ee=s.enc.Base64.parse(O),be=s.enc.Hex.stringify(Ee),we=L[Z].proc,We=we(be,V,ue);return We},z=function(O,Z,V,ue){var Ee=L[Z].eproc,be=Ee(O,V,ue);return be};return{version:"1.0.0",parsePKCS5PEM:function(O){return ne(O)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(O,Z,V){return N(O,Z,V)},decryptKeyB64:function(O,Z,V,ue){return k(O,Z,V,ue)},getDecryptedKeyHex:function(O,Z){var V=ne(O),ue=V.type,Ee=V.cipher,be=V.ivsalt,we=V.data,We=N(Ee,Z,be),it=We.keyhex,y=k(we,Ee,it,be);return y},getEncryptedPKCS5PEMFromPrvKeyHex:function(O,Z,V,ue,Ee){var W="";if((typeof ue>"u"||ue==null)&&(ue="AES-256-CBC"),typeof L[ue]>"u")throw new Error("KEYUTIL unsupported algorithm: "+ue);if(typeof Ee>"u"||Ee==null){var be=L[ue].ivlen,we=te(be);Ee=we.toUpperCase()}var We=N(ue,V,Ee),it=We.keyhex,y=z(Z,ue,it,Ee),Q=y.replace(/(.{64})/g,`$1\r
|
|||
|
|
`),W="-----BEGIN "+O+` PRIVATE KEY-----\r
|
|||
|
|
`;return W+=`Proc-Type: 4,ENCRYPTED\r
|
|||
|
|
`,W+="DEK-Info: "+ue+","+Ee+`\r
|
|||
|
|
`,W+=`\r
|
|||
|
|
`,W+=Q,W+=`\r
|
|||
|
|
-----END `+O+` PRIVATE KEY-----\r
|
|||
|
|
`,W},getEncryptedPKCS8PEM:function(O,Z,V){var ue=this.getEncryptedPKCS8Hex(O,Z,V);return ct(ue,"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(O,Z,V){var ue;V==null||V==null?ue={}:ue=JSON.parse(JSON.stringify(V)),ue.plain=O,this.initPBES2Param(ue),this.encryptPBES2Param(ue,Z);var Ee=this.generatePBES2ASN1Param(ue);return v.asn1.ASN1Util.newObject(Ee).tohex()},initPBES2Param:function(O){if(Nn(O,"encalg")==null&&(O.encalg="aes256-CBC"),Nn(O,"iter")==null&&(O.iter=2048),Nn(O,"prf")==null&&(O.prf="hmacWithSHA256"),Nn(O,"salt")==null&&(O.salt=s.enc.Hex.stringify(s.lib.WordArray.random(8))),Nn(O,"enciv")==null){var Z;O.encalg=="des-EDE3-CBC"&&(Z=8),O.encalg=="aes128-CBC"&&(Z=16),O.encalg=="aes256-CBC"&&(Z=16),O.enciv=s.enc.Hex.stringify(s.lib.WordArray.random(Z))}},encryptPBES2Param:function(O,Z){var V=Nr.getDKFromPBES2Param(O,Z);try{var ue=v.crypto.Cipher.encrypt(O.plain,V,O.encalg,{iv:O.enciv})}catch{throw new Error("encrypt error: "+O.plain+" "+V+" "+O.encalg+" "+O.enciv)}O.enc=ue},generatePBES2ASN1Param:function(O){var Z={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:O.salt}},{int:{hex:ht(O.iter)}}]}]},{seq:[{oid:O.encalg},{octstr:{hex:O.enciv}}]}]}]},{octstr:{hex:O.enc}}]};return O.prf!="hmacWithSHA1"&&Z.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:O.prf},{null:""}]}),Z},parseHexOfEncryptedPKCS8:function(O){var Z=It,V=Z.getChildIdx,ue=Z.getV,Ee={},be=V(O,0);if(be.length!=2)throw new Error("malformed format: SEQUENCE(0).items != 2: "+be.length);Ee.ciphertext=ue(O,be[1]);var we=V(O,be[0]);if(we.length!=2)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+we.length);if(ue(O,we[0])!="2a864886f70d01050d")throw new Error("this only supports pkcs5PBES2");var We=V(O,we[1]);if(we.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+We.length);var it=V(O,We[1]);if(it.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+it.length);if(ue(O,it[0])!="2a864886f70d0307")throw"this only supports TripleDES";Ee.encryptionSchemeAlg="TripleDES",Ee.encryptionSchemeIV=ue(O,it[1]);var y=V(O,We[0]);if(y.length!=2)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+y.length);if(ue(O,y[0])!="2a864886f70d01050c")throw new Error("this only supports pkcs5PBKDF2");var Q=V(O,y[1]);if(Q.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+Q.length);Ee.pbkdf2Salt=ue(O,Q[0]);var W=ue(O,Q[1]);try{Ee.pbkdf2Iter=parseInt(W,16)}catch{throw new Error("malformed format pbkdf2Iter: "+W)}return Ee},getPBKDF2KeyHexFromParam:function(O,Z){var V=s.enc.Hex.parse(O.pbkdf2Salt),ue=O.pbkdf2Iter,Ee=s.PBKDF2(Z,V,{keySize:192/32,iterations:ue}),be=s.enc.Hex.stringify(Ee);return be},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(O,Z){var V=Xn(O,"ENCRYPTED PRIVATE KEY"),ue=this.parseHexOfEncryptedPKCS8(V),Ee=Nr.getPBKDF2KeyHexFromParam(ue,Z),be={};be.ciphertext=s.enc.Hex.parse(ue.ciphertext);var we=s.enc.Hex.parse(Ee),We=s.enc.Hex.parse(ue.encryptionSchemeIV),it=s.TripleDES.decrypt(be,we,{iv:We}),y=s.enc.Hex.stringify(it);return y},parsePBES2:function(O){var Z=It.parse(O);if(Nn(Z,"seq.0.seq.0.oid")!="pkcs5PBES2"||Nn(Z,"seq.0.seq.1.seq.0.seq.0.oid")!="pkcs5PBKDF2")throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var V=Nn(Z,"seq.0.seq.1.seq.0.seq.1.seq");if(V==null)throw new Error("PBKDF2 parameter not found");var ue=Nn(V,"0.octstr.hex"),Ee=Nn(V,"1.int.hex"),be=Nn(V,"2.seq.0.oid","hmacWithSHA1"),we=-1;try{we=parseInt(Ee,16)}catch{throw new Error("iter not proper value")}var We=Nn(Z,"seq.0.seq.1.seq.1.seq.0.oid"),it=Nn(Z,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),y=Nn(Z,"seq.1.octstr.hex");if(We==null||it==null||y==null)throw new Error("encalg, enciv or enc is undefined");var Q={salt:ue,iter:we,prf:be,encalg:We,enciv:it,enc:y};return Q},getDKFromPBES2Param:function(O,Z){var V={hmacWithSHA1:s.algo.SHA1,hmacWithSHA224:s.algo.SHA224,hmacWithSHA256:s.algo.SHA256,hmacWithSHA384:s.algo.SHA384,hmacWithSHA512:s.algo.SHA512},ue={"des-EDE3-CBC":192/32,"aes128-CBC":128/32,"aes256-CBC":256/32},Ee=V[O.prf];if(Ee==null)throw new Error("unsupported p
|
|||
|
|
`,ge=uo.array,Cs=0;Cs<ge.length;Cs++){var yn=ge[Cs];if(yn.dn!=null&&(pn+=yi+"dn: "+yn.dn.str+ai),yn.ip!=null&&(pn+=yi+"ip: "+yn.ip+ai),yn.rfc822!=null&&(pn+=yi+"rfc822: "+yn.rfc822+ai),yn.dns!=null&&(pn+=yi+"dns: "+yn.dns+ai),yn.uri!=null&&(pn+=yi+"uri: "+yn.uri+ai),yn.other!=null){var ui=yn.other.oid,jr=JSON.stringify(yn.other.value).replace(/\"/g,"");pn+=yi+"other: "+ui+"="+jr+ai}}return pn=pn.replace(/\n$/,""),pn},Q=function(uo){for(var pn="",yi=uo.array,ai=0;ai<yi.length;ai++){var ge=yi[ai];if(pn+=" policy oid: "+ge.policyoid+`
|
|||
|
|
`,ge.array!==void 0)for(var Cs=0;Cs<ge.array.length;Cs++){var yn=ge.array[Cs];yn.cps!==void 0&&(pn+=" cps: "+yn.cps+`
|
|||
|
|
`)}}return pn},W=function(uo){for(var pn="",yi=uo.array,ai=0;ai<yi.length;ai++){var ge=yi[ai];try{ge.dpname.full[0].uri!==void 0&&(pn+=" "+ge.dpname.full[0].uri+`
|
|||
|
|
`)}catch{}try{ge.dname.full[0].dn.hex!==void 0&&(pn+=" "+Ut.hex2dn(ge.dpname.full[0].dn.hex)+`
|
|||
|
|
`)}catch{}}return pn},j=function(uo){for(var pn="",yi=uo.array,ai=0;ai<yi.length;ai++){var ge=yi[ai];ge.caissuer!==void 0&&(pn+=" caissuer: "+ge.caissuer+`
|
|||
|
|
`),ge.ocsp!==void 0&&(pn+=" ocsp: "+ge.ocsp+`
|
|||
|
|
`)}return pn},fe=Ut,ve,_e,Ne;if(ve=`Basic Fields
|
|||
|
|
`,ve+=" serial number: "+this.getSerialNumberHex()+`
|
|||
|
|
`,ve+=" signature algorithm: "+this.getSignatureAlgorithmField()+`
|
|||
|
|
`,ve+=" issuer: "+this.getIssuerString()+`
|
|||
|
|
`,ve+=" notBefore: "+this.getNotBefore()+`
|
|||
|
|
`,ve+=" notAfter: "+this.getNotAfter()+`
|
|||
|
|
`,ve+=" subject: "+this.getSubjectString()+`
|
|||
|
|
`,ve+=` subject public key info:
|
|||
|
|
`,_e=this.getPublicKey(),ve+=" key algorithm: "+_e.type+`
|
|||
|
|
`,_e.type==="RSA"&&(ve+=" n="+Cp(_e.n.toString(16)).substr(0,16)+`...
|
|||
|
|
`,ve+=" e="+Cp(_e.e.toString(16))+`
|
|||
|
|
`),Ne=this.aExtInfo,Ne!=null){ve+=`X509v3 Extensions:
|
|||
|
|
`;for(var Ve=0;Ve<Ne.length;Ve++){var ot=Ne[Ve],ir=v.asn1.x509.OID.oid2name(ot.oid);ir===""&&(ir=ot.oid);var hr="";if(ot.critical===!0&&(hr="CRITICAL"),ve+=" "+ir+" "+hr+`:
|
|||
|
|
`,ir==="basicConstraints"){var nr=this.getExtBasicConstraints();nr.cA===void 0?ve+=` {}
|
|||
|
|
`:(ve+=" cA=true",nr.pathLen!==void 0&&(ve+=", pathLen="+nr.pathLen),ve+=`
|
|||
|
|
`)}else if(ir=="policyMappings"){var qr=this.getExtPolicyMappings().array,Hr=qr.map(function(uo){var pn=uo;return pn[0]+":"+pn[1]}).join(", ");ve+=" "+Hr+`
|
|||
|
|
`}else if(ir=="policyConstraints"){var On=this.getExtPolicyConstraints();ve+=" ",On.reqexp!=null&&(ve+=" reqexp="+On.reqexp),On.inhibit!=null&&(ve+=" inhibit="+On.inhibit),ve+=`
|
|||
|
|
`}else if(ir=="inhibitAnyPolicy"){var On=this.getExtInhibitAnyPolicy();ve+=" skip="+On.skip+`
|
|||
|
|
`}else if(ir=="keyUsage")ve+=" "+this.getExtKeyUsageString()+`
|
|||
|
|
`;else if(ir=="subjectKeyIdentifier")ve+=" "+this.getExtSubjectKeyIdentifier().kid.hex+`
|
|||
|
|
`;else if(ir=="authorityKeyIdentifier"){var An=this.getExtAuthorityKeyIdentifier();An.kid!==void 0&&(ve+=" kid="+An.kid.hex+`
|
|||
|
|
`)}else if(ir=="extKeyUsage"){var pc=this.getExtExtKeyUsage().array;ve+=" "+pc.join(", ")+`
|
|||
|
|
`}else if(ir=="subjectAltName"){var Do=y(this.getExtSubjectAltName());ve+=Do+`
|
|||
|
|
`}else if(ir=="cRLDistributionPoints"){var Os=this.getExtCRLDistributionPoints();ve+=W(Os)}else if(ir=="authorityInfoAccess"){var to=this.getExtAuthorityInfoAccess();ve+=j(to)}else ir=="certificatePolicies"&&(ve+=Q(this.getExtCertificatePolicies()))}}return ve+="signature algorithm: "+this.getSignatureAlgorithmName()+`
|
|||
|
|
`,ve+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
|
|||
|
|
`,ve},typeof a=="string"&&(a.indexOf("-----BEGIN")!=-1?this.readCertPEM(a):v.lang.String.isHex(a)&&this.readCertHex(a))}Ut.EXT_PARSER={},Ut.registExtParser=function(a,d){Ut.EXT_PARSER[a]=d},Ut.hex2dn=function(a,d){d===void 0&&(d=0);var h=new Ut,E=It.getTLV(a,d),w=h.getX500Name(a);return w.str},Ut.hex2rdn=function(a,d){if(d===void 0&&(d=0),a.substr(d,2)!=="31")throw new Error("malformed RDN");for(var h=new Array,E=It.getChildIdx(a,d),w=0;w<E.length;w++)h.push(Ut.hex2attrTypeValue(a,E[w]));return h=h.map(function(b){return b.replace("+","\\+")}),h.join("+")},Ut.hex2attrTypeValue=function(a,d){var h=It,E=h.getV;if(d===void 0&&(d=0),a.substr(d,2)!=="30")throw new Error("malformed attribute type and value");var w=h.getChildIdx(a,d);w.length!==2||a.substr(w[0],2);var b=E(a,w[0]),D=v.asn1.ASN1Util.oidHexToInt(b),S=v.asn1.x509.OID.oid2atype(D),L=E(a,w[1]),P=Kt(L);return S+"="+P},Ut.getPublicKeyFromCertHex=function(a){var d=new Ut;return d.readCertHex(a),d.getPublicKey()},Ut.getPublicKeyFromCertPEM=function(a){var d=new Ut;return d.readCertPEM(a),d.getPublicKey()},Ut.getPublicKeyInfoPropOfCertPEM=function(a){var d=It,h=d.getVbyList,E={},w,b,D;return E.algparam=null,w=new Ut,w.readCertPEM(a),b=w.getPublicKeyHex(),E.keyhex=h(b,0,[1],"03").substr(2),E.algoid=h(b,0,[0,0],"06"),E.algoid==="2a8648ce3d0201"&&(E.algparam=h(b,0,[0,1],"06")),E},Ut.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var em=function(a){var d=v,h=d.lang.String.isHex,E=It,w=E.getV,b=E.getTLV,D=E.getVbyList,S=E.getTLVbyList,L=E.getTLVbyListEx,P=E.getIdxbyList,te=E.getIdxbyListEx,ne=E.getChildIdx,N=new Ut;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var k=P(this.hex,0,[0,0]),z=this.hex.substr(k,2);if(z=="02")this.posSigAlg=1;else if(z=="30")this.posSigAlg=0;else throw new Error("malformed 1st item of TBSCertList: "+z);var O=P(this.hex,0,[0,this.posSigAlg+3]),Z=this.hex.substr(O,2);if(Z=="17"||Z=="18"){var V,ue;V=P(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,V!=-1&&(ue=this.hex.substr(V,2),ue=="30"&&(this.posRevCert=this.posSigAlg+4))}else if(Z=="30")this.posRevCert=this.posSigAlg+3;else if(Z=="a0")this.posRevCert=null;else throw new Error("malformed nextUpdate or revCert tag: "+Z)},this.getVersion=function(){return this.posSigAlg==0?null:parseInt(D(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var k=S(this.hex,0,[0,this.posSigAlg],"30");return N.getAlgorithmIdentifierName(k)},this.getIssuer=function(){return N.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return S(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var k=D(this.hex,0,[0,this.posSigAlg+2]);return result=Kt(k)},this.getNextUpdate=function(){var k=P(this.hex,0,[0,this.posSigAlg+3]),z=this.hex.substr(k,2);return z!="17"&&z!="18"?null:Kt(w(this.hex,k))},this.getRevCertArray=function(){if(this.posRevCert==null)return null;for(var k=[],z=P(this.hex,0,[0,this.posRevCert]),O=ne(this.hex,z),Z=0;Z<O.length;Z++){var V=b(this.hex,O[Z]);k.push(this.getRevCert(V))}return k},this.getRevCert=function(k){var z={},O=ne(k,0);return z.sn={hex:D(k,0,[0],"02")},z.date=Kt(D(k,0,[1])),O.length==3&&(z.ext=N.getExtParamArray(S(k,0,[2]))),z},this.findRevCert=function(k){var z=new Ut(k),O=z.getSerialNumberHex();return this.findRevCertBySN(O)},this.findRevCertBySN=function(k){if(this.parsed==null&&this.getParam(),this.parsed.revcert==null)return null;for(var z=this.parsed.revcert,O=0;O<z.length;O++)if(k==z[O].sn.hex)return z[O];return null},this.getSignatureValueHex=function(){return D(this.hex,0,[2],"03",!0)},this.verifySignature=function(k){var z=this.getSignatureAlgorithmField(),O=this.getSignatureValueHex(),Z=S(this.hex,0,[0],"30"),V=new v.crypto.Signature({alg:z});return V.init(k),V.updateHex(Z),V.verify(O)},this.getParam=function(k){var z={},O=this.getVersion();O!=null&&(z.version=O),z.sigalg=this.getSignatureAlgorithmField(),z.issuer=this.getIssuer(),z.thisupdate=this.getThisUpdate();var Z=thi
|
|||
|
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(u-1))===-1;)if(u-=1,this.position-u>s/2-1){o=" ... ",u+=5;break}for(l="",p=this.position;p<this.buffer.length&&`\0\r
|
|||
|
|
\x85\u2028\u2029`.indexOf(this.buffer.charAt(p))===-1;)if(p+=1,p-this.position>s/2-1){l=" ... ",p-=5;break}return f=this.buffer.slice(u,p),r.repeat(" ",i)+o+f+l+`
|
|||
|
|
`+r.repeat(" ",i+this.position-u+o.length)+"^"},n.prototype.toString=function(i){var s,o="";return this.name&&(o+='in "'+this.name+'" '),o+="at line "+(this.line+1)+", column "+(this.column+1),i||(s=this.getSnippet(),s&&(o+=`:
|
|||
|
|
`+s)),o},t.exports=n}),Gr=Se((e,t)=>{"use strict";var r=zo(),n=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];function s(u){var l={};return u!==null&&Object.keys(u).forEach(function(p){u[p].forEach(function(f){l[String(f)]=p})}),l}function o(u,l){if(l=l||{},Object.keys(l).forEach(function(p){if(n.indexOf(p)===-1)throw new r('Unknown option "'+p+'" is met in definition of "'+u+'" YAML type.')}),this.tag=u,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(p){return p},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.defaultStyle=l.defaultStyle||null,this.styleAliases=s(l.styleAliases||null),i.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+u+'" YAML type.')}t.exports=o}),Ka=Se((e,t)=>{"use strict";var r=qa(),n=zo(),i=Gr();function s(l,p,f){var c=[];return l.include.forEach(function(m){f=s(m,p,f)}),l[p].forEach(function(m){f.forEach(function(B,C){B.tag===m.tag&&B.kind===m.kind&&c.push(C)}),f.push(m)}),f.filter(function(m,B){return c.indexOf(B)===-1})}function o(){var l={scalar:{},sequence:{},mapping:{},fallback:{}},p,f;function c(m){l[m.kind][m.tag]=l.fallback[m.tag]=m}for(p=0,f=arguments.length;p<f;p+=1)arguments[p].forEach(c);return l}function u(l){this.include=l.include||[],this.implicit=l.implicit||[],this.explicit=l.explicit||[],this.implicit.forEach(function(p){if(p.loadKind&&p.loadKind!=="scalar")throw new n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=s(this,"implicit",[]),this.compiledExplicit=s(this,"explicit",[]),this.compiledTypeMap=o(this.compiledImplicit,this.compiledExplicit)}u.DEFAULT=null,u.create=function(){var l,p;switch(arguments.length){case 1:l=u.DEFAULT,p=arguments[0];break;case 2:l=arguments[0],p=arguments[1];break;default:throw new n("Wrong number of arguments for Schema.create function")}if(l=r.toArray(l),p=r.toArray(p),!l.every(function(f){return f instanceof u}))throw new n("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!p.every(function(f){return f instanceof i}))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new u({include:l,explicit:p})},t.exports=u}),Qv=Se((e,t)=>{"use strict";var r=Gr();t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(n){return n!==null?n:""}})}),t2=Se((e,t)=>{"use strict";var r=Gr();t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(n){return n!==null?n:[]}})}),n2=Se((e,t)=>{"use strict";var r=Gr();t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(n){return n!==null?n:{}}})}),Wf=Se((e,t)=>{"use strict";var r=Ka();t.exports=new r({explicit:[Qv(),t2(),n2()]})}),u2=Se((e,t)=>{"use strict";var r=Gr();function n(o){if(o===null)return!0;var u=o.length;return u===1&&o==="~"||u===4&&(o==="null"||o==="Null"||o==="NULL")}function i(){return null}function s(o){return o===null}t.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:s,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})}),o2=Se((e,t)=>{"use strict";var r=Gr();function n(o){if(o===null)return!1;var u=o.length;return u===4&&(o==="true"||o==="True"||o==="TRUE")||u===5&&(o==="false"||o==="False"||o==="FALSE")}function i(o){return o==="true"||o==="True"||o==="TRUE"}function s(o){return Object.prototype.toString.call(o)==="[object Boolean]"}t.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:s,represent:{lowercase:function(o){return o?"true":"false"},uppercase:function(o){return o?"TRUE":"FALSE"},camelcase:function(o){return o?"True":"False"}},defaultStyle:"lowercase"})}),l2=Se((e,t)=>{"use strict";var r=qa(),n=Gr();function i(f){return
|
|||
|
|
\r`;function o(f){if(f===null)return!1;var c,m,B=0,C=f.length,F=s;for(m=0;m<C;m++)if(c=F.indexOf(f.charAt(m)),!(c>64)){if(c<0)return!1;B+=6}return B%8===0}function u(f){var c,m,B=f.replace(/[\r\n=]/g,""),C=B.length,F=s,H=0,q=[];for(c=0;c<C;c++)c%4===0&&c&&(q.push(H>>16&255),q.push(H>>8&255),q.push(H&255)),H=H<<6|F.indexOf(B.charAt(c));return m=C%4*6,m===0?(q.push(H>>16&255),q.push(H>>8&255),q.push(H&255)):m===18?(q.push(H>>10&255),q.push(H>>2&255)):m===12&&q.push(H>>4&255),r?r.from?r.from(q):new r(q):q}function l(f){var c="",m=0,B,C,F=f.length,H=s;for(B=0;B<F;B++)B%3===0&&B&&(c+=H[m>>18&63],c+=H[m>>12&63],c+=H[m>>6&63],c+=H[m&63]),m=(m<<8)+f[B];return C=F%3,C===0?(c+=H[m>>18&63],c+=H[m>>12&63],c+=H[m>>6&63],c+=H[m&63]):C===2?(c+=H[m>>10&63],c+=H[m>>4&63],c+=H[m<<2&63],c+=H[64]):C===1&&(c+=H[m>>2&63],c+=H[m<<4&63],c+=H[64],c+=H[64]),c}function p(f){return r&&r.isBuffer(f)}t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:o,construct:u,predicate:p,represent:l})}),b2=Se((e,t)=>{"use strict";var r=Gr(),n=Object.prototype.hasOwnProperty,i=Object.prototype.toString;function s(u){if(u===null)return!0;var l=[],p,f,c,m,B,C=u;for(p=0,f=C.length;p<f;p+=1){if(c=C[p],B=!1,i.call(c)!=="[object Object]")return!1;for(m in c)if(n.call(c,m))if(!B)B=!0;else return!1;if(!B)return!1;if(l.indexOf(m)===-1)l.push(m);else return!1}return!0}function o(u){return u!==null?u:[]}t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:s,construct:o})}),I2=Se((e,t)=>{"use strict";var r=Gr(),n=Object.prototype.toString;function i(o){if(o===null)return!0;var u,l,p,f,c,m=o;for(c=new Array(m.length),u=0,l=m.length;u<l;u+=1){if(p=m[u],n.call(p)!=="[object Object]"||(f=Object.keys(p),f.length!==1))return!1;c[u]=[f[0],p[f[0]]]}return!0}function s(o){if(o===null)return[];var u,l,p,f,c,m=o;for(c=new Array(m.length),u=0,l=m.length;u<l;u+=1)p=m[u],f=Object.keys(p),c[u]=[f[0],p[f[0]]];return c}t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:s})}),$2=Se((e,t)=>{"use strict";var r=Gr(),n=Object.prototype.hasOwnProperty;function i(o){if(o===null)return!0;var u,l=o;for(u in l)if(n.call(l,u)&&l[u]!==null)return!1;return!0}function s(o){return o!==null?o:{}}t.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:s})}),Wo=Se((e,t)=>{"use strict";var r=Ka();t.exports=new r({include:[Zp()],implicit:[A2(),C2()],explicit:[D2(),b2(),I2(),$2()]})}),T2=Se((e,t)=>{"use strict";var r=Gr();function n(){return!0}function i(){}function s(){return""}function o(u){return typeof u>"u"}t.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:s})}),N2=Se((e,t)=>{"use strict";var r=Gr();function n(u){if(u===null||u.length===0)return!1;var l=u,p=/\/([gim]*)$/.exec(u),f="";return!(l[0]==="/"&&(p&&(f=p[1]),f.length>3||l[l.length-f.length-1]!=="/"))}function i(u){var l=u,p=/\/([gim]*)$/.exec(u),f="";return l[0]==="/"&&(p&&(f=p[1]),l=l.slice(1,l.length-f.length-1)),new RegExp(l,f)}function s(u){var l="/"+u.source+"/";return u.global&&(l+="g"),u.multiline&&(l+="m"),u.ignoreCase&&(l+="i"),l}function o(u){return Object.prototype.toString.call(u)==="[object RegExp]"}t.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:s})}),L2=Se((e,t)=>{"use strict";var r;try{n=Ba,r=n("esprima")}catch{typeof window<"u"&&(r=window.esprima)}var n,i=Gr();function s(p){if(p===null)return!1;try{var f="("+p+")",c=r.parse(f,{range:!0});return!(c.type!=="Program"||c.body.length!==1||c.body[0].type!=="ExpressionStatement"||c.body[0].expression.type!=="ArrowFunctionExpression"&&c.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function o(p){var f="("+p+")",c=r.parse(f,{range:!0}),m=[],B;if(c.type!=="Program"||c.body.length!==1||c.body[0].type!=="ExpressionStatement"||c.body[0].expression.type!=="ArrowFunctionExpression"&&c.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return c.body[0].expression.params.forEach(function(C){m.push(C.name)}),B=c.body[0].expression.body.range,c.body[0].e
|
|||
|
|
`:U===118?"\v":U===102?"\f":U===114?"\r":U===101?"\x1B":U===32?" ":U===34?'"':U===47?"/":U===92?"\\":U===78?"\x85":U===95?"\xA0":U===76?"\u2028":U===80?"\u2029":""}function He(U){return U<=65535?String.fromCharCode(U):String.fromCharCode((U-65536>>10)+55296,(U-65536&1023)+56320)}var At=new Array(256),Te=new Array(256);for(xe=0;xe<256;xe++)At[xe]=$e(xe)?1:0,Te[xe]=$e(xe);var xe;function rt(U,x){this.input=U,this.filename=x.filename||null,this.schema=x.schema||o,this.onWarning=x.onWarning||null,this.legacy=x.legacy||!1,this.json=x.json||!1,this.listener=x.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=U.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function Qt(U,x){return new n(x,new i(U.filename,U.input,U.position,U.line,U.position-U.lineStart))}function ut(U,x){throw Qt(U,x)}function Ze(U,x){U.onWarning&&U.onWarning.call(null,Qt(U,x))}var gt={YAML:function(U,x,M){var ee,ye,Qe;U.version!==null&&ut(U,"duplication of %YAML directive"),M.length!==1&&ut(U,"YAML directive accepts exactly one argument"),ee=/^([0-9]+)\.([0-9]+)$/.exec(M[0]),ee===null&&ut(U,"ill-formed argument of the YAML directive"),ye=parseInt(ee[1],10),Qe=parseInt(ee[2],10),ye!==1&&ut(U,"unacceptable YAML version of the document"),U.version=M[0],U.checkLineBreaks=Qe<2,Qe!==1&&Qe!==2&&Ze(U,"unsupported YAML version of the document")},TAG:function(U,x,M){var ee,ye;M.length!==2&&ut(U,"TAG directive accepts exactly two arguments"),ee=M[0],ye=M[1],se.test(ee)||ut(U,"ill-formed tag handle (first argument) of the TAG directive"),u.call(U.tagMap,ee)&&ut(U,'there is a previously declared suffix for "'+ee+'" tag handle'),ce.test(ye)||ut(U,"ill-formed tag prefix (second argument) of the TAG directive"),U.tagMap[ee]=ye}};function Pt(U,x,M,ee){var ye,Qe,re,Oe;if(x<M){if(Oe=U.input.slice(x,M),ee)for(ye=0,Qe=Oe.length;ye<Qe;ye+=1)re=Oe.charCodeAt(ye),re===9||32<=re&&re<=1114111||ut(U,"expected valid JSON character");else F.test(Oe)&&ut(U,"the stream contains non-printable characters");U.result+=Oe}}function rn(U,x,M,ee){var ye,Qe,re,Oe;for(r.isObject(M)||ut(U,"cannot merge mappings; the provided source object is unacceptable"),ye=Object.keys(M),re=0,Oe=ye.length;re<Oe;re+=1)Qe=ye[re],u.call(x,Qe)||(x[Qe]=M[Qe],ee[Qe]=!0)}function cr(U,x,M,ee,ye,Qe,re,Oe){var Re,dt;if(Array.isArray(ye))for(ye=Array.prototype.slice.call(ye),Re=0,dt=ye.length;Re<dt;Re+=1)Array.isArray(ye[Re])&&ut(U,"nested arrays are not supported inside keys"),typeof ye=="object"&&Ce(ye[Re])==="[object Object]"&&(ye[Re]="[object Object]");if(typeof ye=="object"&&Ce(ye)==="[object Object]"&&(ye="[object Object]"),ye=String(ye),x===null&&(x={}),ee==="tag:yaml.org,2002:merge")if(Array.isArray(Qe))for(Re=0,dt=Qe.length;Re<dt;Re+=1)rn(U,x,Qe[Re],M);else rn(U,x,Qe,M);else!U.json&&!u.call(M,ye)&&u.call(x,ye)&&(U.line=re||U.line,U.position=Oe||U.position,ut(U,"duplicated mapping key")),x[ye]=Qe,delete M[ye];return x}function Jt(U){var x;x=U.input.charCodeAt(U.position),x===10?U.position++:x===13?(U.position++,U.input.charCodeAt(U.position)===10&&U.position++):ut(U,"a line break is expected"),U.line+=1,U.lineStart=U.position}function St(U,x,M){for(var ee=0,ye=U.input.charCodeAt(U.position);ye!==0;){for(;De(ye);)ye=U.input.charCodeAt(++U.position);if(x&&ye===35)do ye=U.input.charCodeAt(++U.position);while(ye!==10&&ye!==13&&ye!==0);if(pe(ye))for(Jt(U),ye=U.input.charCodeAt(U.position),ee++,U.lineIndent=0;ye===32;)U.lineIndent++,ye=U.input.charCodeAt(++U.position);else break}return M!==-1&&ee!==0&&U.lineIndent<M&&Ze(U,"deficient indentation"),ee}function Wr(U){var x=U.position,M;return M=U.input.charCodeAt(x),!!((M===45||M===46)&&M===U.input.charCodeAt(x+1)&&M===U.input.charCodeAt(x+2)&&(x+=3,M=U.input.charCodeAt(x),M===0||me(M)))}function rr(U,x){x===1?U.result+=" ":x>1&&(U.result+=r.repeat(`
|
|||
|
|
`,x-1))}function yt(U,x,M){var ee,ye,Qe,re,Oe,Re,dt,st,nt=U.kind,Et=U.result,Bt;if(Bt=U.input.charCodeAt(U.position),me(Bt)||Ie(Bt)||Bt===35||Bt===38||Bt===42||Bt===33||Bt===124||Bt===62||Bt===39||Bt===34||Bt===37||Bt===64||Bt===96||(Bt===63||Bt===45)&&(ye=U.input.charCodeAt(U.position+1),me(ye)||M&&Ie(ye)))return!1;for(U.kind="scalar",U.result="",Qe=re=U.position,Oe=!1;Bt!==0;){if(Bt===58){if(ye=U.input.charCodeAt(U.position+1),me(ye)||M&&Ie(ye))break}else if(Bt===35){if(ee=U.input.charCodeAt(U.position-1),me(ee))break}else{if(U.position===U.lineStart&&Wr(U)||M&&Ie(Bt))break;if(pe(Bt))if(Re=U.line,dt=U.lineStart,st=U.lineIndent,St(U,!1,-1),U.lineIndent>=x){Oe=!0,Bt=U.input.charCodeAt(U.position);continue}else{U.position=re,U.line=Re,U.lineStart=dt,U.lineIndent=st;break}}Oe&&(Pt(U,Qe,re,!1),rr(U,U.line-Re),Qe=re=U.position,Oe=!1),De(Bt)||(re=U.position+1),Bt=U.input.charCodeAt(++U.position)}return Pt(U,Qe,re,!1),U.result?!0:(U.kind=nt,U.result=Et,!1)}function sr(U,x){var M,ee,ye;if(M=U.input.charCodeAt(U.position),M!==39)return!1;for(U.kind="scalar",U.result="",U.position++,ee=ye=U.position;(M=U.input.charCodeAt(U.position))!==0;)if(M===39)if(Pt(U,ee,U.position,!0),M=U.input.charCodeAt(++U.position),M===39)ee=U.position,U.position++,ye=U.position;else return!0;else pe(M)?(Pt(U,ee,ye,!0),rr(U,St(U,!1,x)),ee=ye=U.position):U.position===U.lineStart&&Wr(U)?ut(U,"unexpected end of the document within a single quoted scalar"):(U.position++,ye=U.position);ut(U,"unexpected end of the stream within a single quoted scalar")}function Dt(U,x){var M,ee,ye,Qe,re,Oe;if(Oe=U.input.charCodeAt(U.position),Oe!==34)return!1;for(U.kind="scalar",U.result="",U.position++,M=ee=U.position;(Oe=U.input.charCodeAt(U.position))!==0;){if(Oe===34)return Pt(U,M,U.position,!0),U.position++,!0;if(Oe===92){if(Pt(U,M,U.position,!0),Oe=U.input.charCodeAt(++U.position),pe(Oe))St(U,!1,x);else if(Oe<256&&At[Oe])U.result+=Te[Oe],U.position++;else if((re=et(Oe))>0){for(ye=re,Qe=0;ye>0;ye--)Oe=U.input.charCodeAt(++U.position),(re=je(Oe))>=0?Qe=(Qe<<4)+re:ut(U,"expected hexadecimal character");U.result+=He(Qe),U.position++}else ut(U,"unknown escape sequence");M=ee=U.position}else pe(Oe)?(Pt(U,M,ee,!0),rr(U,St(U,!1,x)),M=ee=U.position):U.position===U.lineStart&&Wr(U)?ut(U,"unexpected end of the document within a double quoted scalar"):(U.position++,ee=U.position)}ut(U,"unexpected end of the stream within a double quoted scalar")}function Wt(U,x){var M=!0,ee,ye=U.tag,Qe,re=U.anchor,Oe,Re,dt,st,nt,Et={},Bt,Lt,Ar,tr;if(tr=U.input.charCodeAt(U.position),tr===91)Re=93,nt=!1,Qe=[];else if(tr===123)Re=125,nt=!0,Qe={};else return!1;for(U.anchor!==null&&(U.anchorMap[U.anchor]=Qe),tr=U.input.charCodeAt(++U.position);tr!==0;){if(St(U,!0,x),tr=U.input.charCodeAt(U.position),tr===Re)return U.position++,U.tag=ye,U.anchor=re,U.kind=nt?"mapping":"sequence",U.result=Qe,!0;M||ut(U,"missed comma between flow collection entries"),Lt=Bt=Ar=null,dt=st=!1,tr===63&&(Oe=U.input.charCodeAt(U.position+1),me(Oe)&&(dt=st=!0,U.position++,St(U,!0,x))),ee=U.line,Cr(U,x,l,!1,!0),Lt=U.tag,Bt=U.result,St(U,!0,x),tr=U.input.charCodeAt(U.position),(st||U.line===ee)&&tr===58&&(dt=!0,tr=U.input.charCodeAt(++U.position),St(U,!0,x),Cr(U,x,l,!1,!0),Ar=U.result),nt?cr(U,Qe,Et,Lt,Bt,Ar):dt?Qe.push(cr(U,null,Et,Lt,Bt,Ar)):Qe.push(Bt),St(U,!0,x),tr=U.input.charCodeAt(U.position),tr===44?(M=!0,tr=U.input.charCodeAt(++U.position)):M=!1}ut(U,"unexpected end of the stream within a flow collection")}function K(U,x){var M,ee,ye=m,Qe=!1,re=!1,Oe=x,Re=0,dt=!1,st,nt;if(nt=U.input.charCodeAt(U.position),nt===124)ee=!1;else if(nt===62)ee=!0;else return!1;for(U.kind="scalar",U.result="";nt!==0;)if(nt=U.input.charCodeAt(++U.position),nt===43||nt===45)m===ye?ye=nt===43?C:B:ut(U,"repeat of a chomping mode identifier");else if((st=he(nt))>=0)st===0?ut(U,"bad explicit indentation width of a block scalar; it cannot be less than one"):re?ut(U,"repeat of an indentation width identifier"):(Oe=x+st-1,re=!0);else break;if(De(nt)){do nt=U.input.charCodeAt(++U.position);while(De(nt));if(nt===35)do nt=U.input.charCodeAt(++U.position);
|
|||
|
|
`,Qe?1+Re:Re):ye===m&&Qe&&(U.result+=`
|
|||
|
|
`);break}for(ee?De(nt)?(dt=!0,U.result+=r.repeat(`
|
|||
|
|
`,Qe?1+Re:Re)):dt?(dt=!1,U.result+=r.repeat(`
|
|||
|
|
`,Re+1)):Re===0?Qe&&(U.result+=" "):U.result+=r.repeat(`
|
|||
|
|
`,Re):U.result+=r.repeat(`
|
|||
|
|
`,Qe?1+Re:Re),Qe=!0,re=!0,Re=0,M=U.position;!pe(nt)&&nt!==0;)nt=U.input.charCodeAt(++U.position);Pt(U,M,U.position,!1)}return!0}function T(U,x){var M,ee=U.tag,ye=U.anchor,Qe=[],re,Oe=!1,Re;for(U.anchor!==null&&(U.anchorMap[U.anchor]=Qe),Re=U.input.charCodeAt(U.position);Re!==0&&!(Re!==45||(re=U.input.charCodeAt(U.position+1),!me(re)));){if(Oe=!0,U.position++,St(U,!0,-1)&&U.lineIndent<=x){Qe.push(null),Re=U.input.charCodeAt(U.position);continue}if(M=U.line,Cr(U,x,f,!1,!0),Qe.push(U.result),St(U,!0,-1),Re=U.input.charCodeAt(U.position),(U.line===M||U.lineIndent>x)&&Re!==0)ut(U,"bad indentation of a sequence entry");else if(U.lineIndent<x)break}return Oe?(U.tag=ee,U.anchor=ye,U.kind="sequence",U.result=Qe,!0):!1}function J(U,x,M){var ee,ye,Qe,re,Oe=U.tag,Re=U.anchor,dt={},st={},nt=null,Et=null,Bt=null,Lt=!1,Ar=!1,tr;for(U.anchor!==null&&(U.anchorMap[U.anchor]=dt),tr=U.input.charCodeAt(U.position);tr!==0;){if(ee=U.input.charCodeAt(U.position+1),Qe=U.line,re=U.position,(tr===63||tr===58)&&me(ee))tr===63?(Lt&&(cr(U,dt,st,nt,Et,null),nt=Et=Bt=null),Ar=!0,Lt=!0,ye=!0):Lt?(Lt=!1,ye=!0):ut(U,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),U.position+=1,tr=ee;else if(Cr(U,M,p,!1,!0))if(U.line===Qe){for(tr=U.input.charCodeAt(U.position);De(tr);)tr=U.input.charCodeAt(++U.position);if(tr===58)tr=U.input.charCodeAt(++U.position),me(tr)||ut(U,"a whitespace character is expected after the key-value separator within a block mapping"),Lt&&(cr(U,dt,st,nt,Et,null),nt=Et=Bt=null),Ar=!0,Lt=!1,ye=!1,nt=U.tag,Et=U.result;else if(Ar)ut(U,"can not read an implicit mapping pair; a colon is missed");else return U.tag=Oe,U.anchor=Re,!0}else if(Ar)ut(U,"can not read a block mapping entry; a multiline key may not be an implicit key");else return U.tag=Oe,U.anchor=Re,!0;else break;if((U.line===Qe||U.lineIndent>x)&&(Cr(U,x,c,!0,ye)&&(Lt?Et=U.result:Bt=U.result),Lt||(cr(U,dt,st,nt,Et,Bt,Qe,re),nt=Et=Bt=null),St(U,!0,-1),tr=U.input.charCodeAt(U.position)),U.lineIndent>x&&tr!==0)ut(U,"bad indentation of a mapping entry");else if(U.lineIndent<x)break}return Lt&&cr(U,dt,st,nt,Et,null),Ar&&(U.tag=Oe,U.anchor=Re,U.kind="mapping",U.result=dt),Ar}function Ue(U){var x,M=!1,ee=!1,ye,Qe,re;if(re=U.input.charCodeAt(U.position),re!==33)return!1;if(U.tag!==null&&ut(U,"duplication of a tag property"),re=U.input.charCodeAt(++U.position),re===60?(M=!0,re=U.input.charCodeAt(++U.position)):re===33?(ee=!0,ye="!!",re=U.input.charCodeAt(++U.position)):ye="!",x=U.position,M){do re=U.input.charCodeAt(++U.position);while(re!==0&&re!==62);U.position<U.length?(Qe=U.input.slice(x,U.position),re=U.input.charCodeAt(++U.position)):ut(U,"unexpected end of the stream within a verbatim tag")}else{for(;re!==0&&!me(re);)re===33&&(ee?ut(U,"tag suffix cannot contain exclamation marks"):(ye=U.input.slice(x-1,U.position+1),se.test(ye)||ut(U,"named tag handle cannot contain such characters"),ee=!0,x=U.position+1)),re=U.input.charCodeAt(++U.position);Qe=U.input.slice(x,U.position),q.test(Qe)&&ut(U,"tag suffix cannot contain flow indicator characters")}return Qe&&!ce.test(Qe)&&ut(U,"tag name cannot contain such characters: "+Qe),M?U.tag=Qe:u.call(U.tagMap,ye)?U.tag=U.tagMap[ye]+Qe:ye==="!"?U.tag="!"+Qe:ye==="!!"?U.tag="tag:yaml.org,2002:"+Qe:ut(U,'undeclared tag handle "'+ye+'"'),!0}function Xe(U){var x,M;if(M=U.input.charCodeAt(U.position),M!==38)return!1;for(U.anchor!==null&&ut(U,"duplication of an anchor property"),M=U.input.charCodeAt(++U.position),x=U.position;M!==0&&!me(M)&&!Ie(M);)M=U.input.charCodeAt(++U.position);return U.position===x&&ut(U,"name of an anchor node must contain at least one character"),U.anchor=U.input.slice(x,U.position),!0}function jt(U){var x,M,ee;if(ee=U.input.charCodeAt(U.position),ee!==42)return!1;for(ee=U.input.charCodeAt(++U.position),x=U.position;ee!==0&&!me(ee)&&!Ie(ee);)ee=U.input.charCodeAt(++U.position);return U.position===x&&ut(U,"name of an alias node must contain at least one character"),M=U.input.slice(x,U.position),u.call(U.anchorMap,M)||ut(U,'unidentified alias "'+M+'"'),U.result=U.anchorMap[M],St(U,!
|
|||
|
|
`),U.charCodeAt(0)===65279&&(U=U.slice(1)));var M=new rt(U,x),ee=U.indexOf("\0");for(ee!==-1&&(M.position=ee,ut(M,"null byte is not allowed in input")),M.input+="\0";M.input.charCodeAt(M.position)===32;)M.lineIndent+=1,M.position+=1;for(;M.position<M.length-1;)dr(M);return M.documents}function Zt(U,x,M){x!==null&&typeof x=="object"&&typeof M>"u"&&(M=x,x=null);var ee=er(U,M);if(typeof x!="function")return ee;for(var ye=0,Qe=ee.length;ye<Qe;ye+=1)x(ee[ye])}function Vn(U,x){var M=er(U,x);if(M.length!==0){if(M.length===1)return M[0];throw new n("expected a single document in the stream, but found more")}}function Oi(U,x,M){return typeof x=="object"&&x!==null&&typeof M>"u"&&(M=x,x=null),Zt(U,x,r.extend({schema:s},M))}function Jn(U,x){return Vn(U,r.extend({schema:s},x))}t.exports.loadAll=Zt,t.exports.load=Vn,t.exports.safeLoadAll=Oi,t.exports.safeLoad=Jn}),IE=Se((e,t)=>{"use strict";var r=qa(),n=zo(),i=Yc(),s=Wo(),o=Object.prototype.toString,u=Object.prototype.hasOwnProperty,l=9,p=10,f=13,c=32,m=33,B=34,C=35,F=37,H=38,q=39,se=42,ce=44,Ce=45,pe=58,De=61,me=62,Ie=63,je=64,et=91,he=93,$e=96,He=123,At=124,Te=125,xe={};xe[0]="\\0",xe[7]="\\a",xe[8]="\\b",xe[9]="\\t",xe[10]="\\n",xe[11]="\\v",xe[12]="\\f",xe[13]="\\r",xe[27]="\\e",xe[34]='\\"',xe[92]="\\\\",xe[133]="\\N",xe[160]="\\_",xe[8232]="\\L",xe[8233]="\\P";var rt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Qt(re,Oe){var Re,dt,st,nt,Et,Bt,Lt;if(Oe===null)return{};for(Re={},dt=Object.keys(Oe),st=0,nt=dt.length;st<nt;st+=1)Et=dt[st],Bt=String(Oe[Et]),Et.slice(0,2)==="!!"&&(Et="tag:yaml.org,2002:"+Et.slice(2)),Lt=re.compiledTypeMap.fallback[Et],Lt&&u.call(Lt.styleAliases,Bt)&&(Bt=Lt.styleAliases[Bt]),Re[Et]=Bt;return Re}function ut(re){var Oe,Re,dt;if(Oe=re.toString(16).toUpperCase(),re<=255)Re="x",dt=2;else if(re<=65535)Re="u",dt=4;else if(re<=4294967295)Re="U",dt=8;else throw new n("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+Re+r.repeat("0",dt-Oe.length)+Oe}function Ze(re){this.schema=re.schema||i,this.indent=Math.max(1,re.indent||2),this.noArrayIndent=re.noArrayIndent||!1,this.skipInvalid=re.skipInvalid||!1,this.flowLevel=r.isNothing(re.flowLevel)?-1:re.flowLevel,this.styleMap=Qt(this.schema,re.styles||null),this.sortKeys=re.sortKeys||!1,this.lineWidth=re.lineWidth||80,this.noRefs=re.noRefs||!1,this.noCompatMode=re.noCompatMode||!1,this.condenseFlow=re.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function gt(re,Oe){for(var Re=r.repeat(" ",Oe),dt=0,st=-1,nt="",Et,Bt=re.length;dt<Bt;)st=re.indexOf(`
|
|||
|
|
`,dt),st===-1?(Et=re.slice(dt),dt=Bt):(Et=re.slice(dt,st+1),dt=st+1),Et.length&&Et!==`
|
|||
|
|
`&&(nt+=Re),nt+=Et;return nt}function Pt(re,Oe){return`
|
|||
|
|
`+r.repeat(" ",re.indent*Oe)}function rn(re,Oe){var Re,dt,st;for(Re=0,dt=re.implicitTypes.length;Re<dt;Re+=1)if(st=re.implicitTypes[Re],st.resolve(Oe))return!0;return!1}function cr(re){return re===c||re===l}function Jt(re){return 32<=re&&re<=126||161<=re&&re<=55295&&re!==8232&&re!==8233||57344<=re&&re<=65533&&re!==65279||65536<=re&&re<=1114111}function St(re){return Jt(re)&&!cr(re)&&re!==65279&&re!==f&&re!==p}function Wr(re,Oe){return Jt(re)&&re!==65279&&re!==ce&&re!==et&&re!==he&&re!==He&&re!==Te&&re!==pe&&(re!==C||Oe&&St(Oe))}function rr(re){return Jt(re)&&re!==65279&&!cr(re)&&re!==Ce&&re!==Ie&&re!==pe&&re!==ce&&re!==et&&re!==he&&re!==He&&re!==Te&&re!==C&&re!==H&&re!==se&&re!==m&&re!==At&&re!==De&&re!==me&&re!==q&&re!==B&&re!==F&&re!==je&&re!==$e}function yt(re){var Oe=/^\n* /;return Oe.test(re)}var sr=1,Dt=2,Wt=3,K=4,T=5;function J(re,Oe,Re,dt,st){var nt,Et,Bt,Lt=!1,Ar=!1,tr=dt!==-1,Di=-1,mr=rr(re.charCodeAt(0))&&!cr(re.charCodeAt(re.length-1));if(Oe)for(nt=0;nt<re.length;nt++){if(Et=re.charCodeAt(nt),!Jt(Et))return T;Bt=nt>0?re.charCodeAt(nt-1):null,mr=mr&&Wr(Et,Bt)}else{for(nt=0;nt<re.length;nt++){if(Et=re.charCodeAt(nt),Et===p)Lt=!0,tr&&(Ar=Ar||nt-Di-1>dt&&re[Di+1]!==" ",Di=nt);else if(!Jt(Et))return T;Bt=nt>0?re.charCodeAt(nt-1):null,mr=mr&&Wr(Et,Bt)}Ar=Ar||tr&&nt-Di-1>dt&&re[Di+1]!==" "}return!Lt&&!Ar?mr&&!st(re)?sr:Dt:Re>9&&yt(re)?T:Ar?K:Wt}function Ue(re,Oe,Re,dt){re.dump=function(){if(Oe.length===0)return"''";if(!re.noCompatMode&&rt.indexOf(Oe)!==-1)return"'"+Oe+"'";var st=re.indent*Math.max(1,Re),nt=re.lineWidth===-1?-1:Math.max(Math.min(re.lineWidth,40),re.lineWidth-st),Et=dt||re.flowLevel>-1&&Re>=re.flowLevel;function Bt(Lt){return rn(re,Lt)}switch(J(Oe,Et,re.indent,nt,Bt)){case sr:return Oe;case Dt:return"'"+Oe.replace(/'/g,"''")+"'";case Wt:return"|"+Xe(Oe,re.indent)+jt(gt(Oe,st));case K:return">"+Xe(Oe,re.indent)+jt(gt(Cr(Oe,nt),st));case T:return'"'+er(Oe,nt)+'"';default:throw new n("impossible error: invalid scalar style")}}()}function Xe(re,Oe){var Re=yt(re)?String(Oe):"",dt=re[re.length-1]===`
|
|||
|
|
`,st=dt&&(re[re.length-2]===`
|
|||
|
|
`||re===`
|
|||
|
|
`),nt=st?"+":dt?"":"-";return Re+nt+`
|
|||
|
|
`}function jt(re){return re[re.length-1]===`
|
|||
|
|
`?re.slice(0,-1):re}function Cr(re,Oe){for(var Re=/(\n+)([^\n]*)/g,dt=function(){var Ar=re.indexOf(`
|
|||
|
|
`);return Ar=Ar!==-1?Ar:re.length,Re.lastIndex=Ar,dr(re.slice(0,Ar),Oe)}(),st=re[0]===`
|
|||
|
|
`||re[0]===" ",nt,Et;Et=Re.exec(re);){var Bt=Et[1],Lt=Et[2];nt=Lt[0]===" ",dt+=Bt+(!st&&!nt&&Lt!==""?`
|
|||
|
|
`:"")+dr(Lt,Oe),st=nt}return dt}function dr(re,Oe){if(re===""||re[0]===" ")return re;for(var Re=/ [^ ]/g,dt,st=0,nt,Et=0,Bt=0,Lt="";dt=Re.exec(re);)Bt=dt.index,Bt-st>Oe&&(nt=Et>st?Et:Bt,Lt+=`
|
|||
|
|
`+re.slice(st,nt),st=nt+1),Et=Bt;return Lt+=`
|
|||
|
|
`,re.length-st>Oe&&Et>st?Lt+=re.slice(st,Et)+`
|
|||
|
|
`+re.slice(Et+1):Lt+=re.slice(st),Lt.slice(1)}function er(re){for(var Oe="",Re,dt,st,nt=0;nt<re.length;nt++){if(Re=re.charCodeAt(nt),Re>=55296&&Re<=56319&&(dt=re.charCodeAt(nt+1),dt>=56320&&dt<=57343)){Oe+=ut((Re-55296)*1024+dt-56320+65536),nt++;continue}st=xe[Re],Oe+=!st&&Jt(Re)?re[nt]:st||ut(Re)}return Oe}function Zt(re,Oe,Re){var dt="",st=re.tag,nt,Et;for(nt=0,Et=Re.length;nt<Et;nt+=1)x(re,Oe,Re[nt],!1,!1)&&(nt!==0&&(dt+=","+(re.condenseFlow?"":" ")),dt+=re.dump);re.tag=st,re.dump="["+dt+"]"}function Vn(re,Oe,Re,dt){var st="",nt=re.tag,Et,Bt;for(Et=0,Bt=Re.length;Et<Bt;Et+=1)x(re,Oe+1,Re[Et],!0,!0)&&((!dt||Et!==0)&&(st+=Pt(re,Oe)),re.dump&&p===re.dump.charCodeAt(0)?st+="-":st+="- ",st+=re.dump);re.tag=nt,re.dump=st||"[]"}function Oi(re,Oe,Re){var dt="",st=re.tag,nt=Object.keys(Re),Et,Bt,Lt,Ar,tr;for(Et=0,Bt=nt.length;Et<Bt;Et+=1)tr="",Et!==0&&(tr+=", "),re.condenseFlow&&(tr+='"'),Lt=nt[Et],Ar=Re[Lt],x(re,Oe,Lt,!1,!1)&&(re.dump.length>1024&&(tr+="? "),tr+=re.dump+(re.condenseFlow?'"':"")+":"+(re.condenseFlow?"":" "),x(re,Oe,Ar,!1,!1)&&(tr+=re.dump,dt+=tr));re.tag=st,re.dump="{"+dt+"}"}function Jn(re,Oe,Re,dt){var st="",nt=re.tag,Et=Object.keys(Re),Bt,Lt,Ar,tr,Di,mr;if(re.sortKeys===!0)Et.sort();else if(typeof re.sortKeys=="function")Et.sort(re.sortKeys);else if(re.sortKeys)throw new n("sortKeys must be a boolean or a function");for(Bt=0,Lt=Et.length;Bt<Lt;Bt+=1)mr="",(!dt||Bt!==0)&&(mr+=Pt(re,Oe)),Ar=Et[Bt],tr=Re[Ar],x(re,Oe+1,Ar,!0,!0,!0)&&(Di=re.tag!==null&&re.tag!=="?"||re.dump&&re.dump.length>1024,Di&&(re.dump&&p===re.dump.charCodeAt(0)?mr+="?":mr+="? "),mr+=re.dump,Di&&(mr+=Pt(re,Oe)),x(re,Oe+1,tr,!0,Di)&&(re.dump&&p===re.dump.charCodeAt(0)?mr+=":":mr+=": ",mr+=re.dump,st+=mr));re.tag=nt,re.dump=st||"{}"}function U(re,Oe,Re){var dt,st,nt,Et,Bt,Lt;for(st=Re?re.explicitTypes:re.implicitTypes,nt=0,Et=st.length;nt<Et;nt+=1)if(Bt=st[nt],(Bt.instanceOf||Bt.predicate)&&(!Bt.instanceOf||typeof Oe=="object"&&Oe instanceof Bt.instanceOf)&&(!Bt.predicate||Bt.predicate(Oe))){if(re.tag=Re?Bt.tag:"?",Bt.represent){if(Lt=re.styleMap[Bt.tag]||Bt.defaultStyle,o.call(Bt.represent)==="[object Function]")dt=Bt.represent(Oe,Lt);else if(u.call(Bt.represent,Lt))dt=Bt.represent[Lt](Oe,Lt);else throw new n("!<"+Bt.tag+'> tag resolver accepts not "'+Lt+'" style');re.dump=dt}return!0}return!1}function x(re,Oe,Re,dt,st,nt){re.tag=null,re.dump=Re,U(re,Re,!1)||U(re,Re,!0);var Et=o.call(re.dump);dt&&(dt=re.flowLevel<0||re.flowLevel>Oe);var Bt=Et==="[object Object]"||Et==="[object Array]",Lt,Ar;if(Bt&&(Lt=re.duplicates.indexOf(Re),Ar=Lt!==-1),(re.tag!==null&&re.tag!=="?"||Ar||re.indent!==2&&Oe>0)&&(st=!1),Ar&&re.usedDuplicates[Lt])re.dump="*ref_"+Lt;else{if(Bt&&Ar&&!re.usedDuplicates[Lt]&&(re.usedDuplicates[Lt]=!0),Et==="[object Object]")dt&&Object.keys(re.dump).length!==0?(Jn(re,Oe,re.dump,st),Ar&&(re.dump="&ref_"+Lt+re.dump)):(Oi(re,Oe,re.dump),Ar&&(re.dump="&ref_"+Lt+" "+re.dump));else if(Et==="[object Array]"){var tr=re.noArrayIndent&&Oe>0?Oe-1:Oe;dt&&re.dump.length!==0?(Vn(re,tr,re.dump,st),Ar&&(re.dump="&ref_"+Lt+re.dump)):(Zt(re,tr,re.dump),Ar&&(re.dump="&ref_"+Lt+" "+re.dump))}else if(Et==="[object String]")re.tag!=="?"&&Ue(re,re.dump,Oe,nt);else{if(re.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+Et)}re.tag!==null&&re.tag!=="?"&&(re.dump="!<"+re.tag+"> "+re.dump)}return!0}function M(re,Oe){var Re=[],dt=[],st,nt;for(ee(re,Re,dt),st=0,nt=dt.length;st<nt;st+=1)Oe.duplicates.push(Re[dt[st]]);Oe.usedDuplicates=new Array(nt)}function ee(re,Oe,Re){var dt,st,nt;if(re!==null&&typeof re=="object")if(st=Oe.indexOf(re),st!==-1)Re.indexOf(st)===-1&&Re.push(st);else if(Oe.push(re),Array.isArray(re))for(st=0,nt=re.length;st<nt;st+=1)ee(re[st],Oe,Re);else for(dt=Object.keys(re),st=0,nt=dt.length;st<nt;st+=1)ee(re[dt[st]],Oe,Re)}function ye(re,Oe){Oe=Oe||{};var Re=new Ze(Oe);return Re.noRefs||M(re,Re),x(Re,0,re,!0,!0)?Re.dump+`
|
|||
|
|
`:""}function Qe(re,Oe){return ye(re,r.extend({schema:s},Oe))}t.exports.dump=ye,t.exports.safeDump=Qe}),$E=Se((e,t)=>{"use strict";var r=sE(),n=IE();function i(s){return function(){throw new Error("Function "+s+" is deprecated and cannot be used.")}}t.exports.Type=Gr(),t.exports.Schema=Ka(),t.exports.FAILSAFE_SCHEMA=Wf(),t.exports.JSON_SCHEMA=Xp(),t.exports.CORE_SCHEMA=Zp(),t.exports.DEFAULT_SAFE_SCHEMA=Wo(),t.exports.DEFAULT_FULL_SCHEMA=Yc(),t.exports.load=r.load,t.exports.loadAll=r.loadAll,t.exports.safeLoad=r.safeLoad,t.exports.safeLoadAll=r.safeLoadAll,t.exports.dump=n.dump,t.exports.safeDump=n.safeDump,t.exports.YAMLException=zo(),t.exports.MINIMAL_SCHEMA=Wf(),t.exports.SAFE_SCHEMA=Wo(),t.exports.DEFAULT_SCHEMA=Yc(),t.exports.scan=i("scan"),t.exports.parse=i("parse"),t.exports.compose=i("compose"),t.exports.addConstructor=i("addConstructor")}),RE=Se((e,t)=>{"use strict";var r=$E();t.exports=r}),OE=Se((e,t)=>{"use strict";var r=RE();t.exports={safeLoad:r.safeLoad,load:r.load,safeDump:r.safeDump,dump:r.dump}}),LE=Se(e=>{"use strict";e.toString=function(t){switch(t){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+t},e.toType=function(t){switch(t.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return t.toUpperCase().startsWith("UNKNOWN_")?parseInt(t.slice(8)):0}}),UE=Se(e=>{"use strict";e.toString=function(t){switch(t){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+t},e.toRcode=function(t){switch(t.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}}),HE=Se(e=>{"use strict";e.toString=function(t){switch(t){case 0:return"QUERY";case 1:return"IQUERY";case 2:re
|
|||
|
|
at `,this.location.source!==void 0&&this.location.source!==null&&(s+=`${this.location.source}:`),s+=`${this.location.start.line}:${this.location.start.column}`);for(let o of this.diagnostics)s+=`
|
|||
|
|
from `,o.location.source!==void 0&&o.location.source!==null&&(s+=`${o.location.source}:`),s+=`${o.location.start.line}:${o.location.start.column}: ${o.message}`;return s}format(s){let o=s.map(({source:p,text:f})=>({source:p,text:f.split(/\r\n|\n|\r/g)}));function u(p,f,c=""){let m="",B=o.find(({source:F})=>F===p.source),C=p.start;if(B){let F=p.end,H=B.text[C.line-1],q=(C.line===F.line?F.column:H.length+1)-C.column||1;c&&(m+=`
|
|||
|
|
note: ${c}`),m+=`
|
|||
|
|
--> ${p.source}:${C.line}:${C.column}
|
|||
|
|
${"".padEnd(f)} |
|
|||
|
|
${C.line.toString().padStart(f)} | ${H}
|
|||
|
|
${"".padEnd(f)} | ${"".padEnd(C.column-1)}${"".padEnd(q,"^")}`}else m+=`
|
|||
|
|
at ${p.source}:${C.line}:${C.column}`,c&&(m+=`: ${c}`);return m}function l(p,f,c,m=[]){let B;c?B=m.reduce((F,{location:H})=>Math.max(F,H.start.line),c.start.line):B=Math.max.apply(null,m.map(F=>F.location.start.line)),B=B.toString().length;let C=`${p}: ${f}`;c&&(C+=u(c,B));for(let F of m)C+=u(F.location,B,F.message);return C}return this.problems.filter(p=>p[0]!=="info").map(p=>l(...p)).join(`
|
|||
|
|
|
|||
|
|
`)}};t.exports=n}),zi=Se((e,t)=>{"use strict";var r={build(n){function i(p,...f){return n[p.type](p,...f)}function s(){}function o(p,...f){return i(p.expression,...f)}function u(p){return function(f,...c){f[p].forEach(m=>i(m,...c))}}let l={grammar(p,...f){p.topLevelInitializer&&i(p.topLevelInitializer,...f),p.initializer&&i(p.initializer,...f),p.rules.forEach(c=>i(c,...f))},top_level_initializer:s,initializer:s,rule:o,named:o,choice:u("alternatives"),action:o,sequence:u("elements"),labeled:o,text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o,semantic_and:s,semantic_not:s,rule_ref:s,literal:s,class:s,any:s};return Object.keys(l).forEach(p=>{Object.prototype.hasOwnProperty.call(n,p)||(n[p]=l[p])}),i}};t.exports=r}),ia=Se((e,t)=>{"use strict";var r=zi(),n={findRule(i,s){for(let o=0;o<i.rules.length;o++)if(i.rules[o].name===s)return i.rules[o]},indexOfRule(i,s){for(let o=0;o<i.rules.length;o++)if(i.rules[o].name===s)return o;return-1},alwaysConsumesOnSuccess(i,s){function o(){return!0}function u(){return!1}let l=r.build({choice(p){return p.alternatives.every(l)},sequence(p){return p.elements.some(l)},simple_and:u,simple_not:u,optional:u,zero_or_more:u,semantic_and:u,semantic_not:u,rule_ref(p){let f=n.findRule(i,p.name);return f?l(f):void 0},literal(p){return p.value!==""},class:o,any:o});return l(s)}};t.exports=n}),Id=Se((e,t)=>{"use strict";var r={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29};t.exports=r}),Bd=Se((e,t)=>{"use strict";var r=zi(),n=ia(),i=wh(),s=1,o=0,u=-1;function l(p){function f(F){return F.match=o}function c(F){return C(F.expression),F.match=s}function m(F){return F.match=C(F.expression)}function B(F,H){let q=F.length,se=0,ce=0;for(let Ce=0;Ce<q;++Ce){let pe=C(F[Ce]);pe===s&&++se,pe===u&&++ce}return se===q?s:H?ce===q?u:o:ce>0?u:o}let C=r.build({rule(F){let H,q=0;if(typeof F.match>"u"){F.match=o;do if(H=F.match,F.match=C(F.expression),++q>6)throw new i("Infinity cycle detected when trying to evaluate node match result",F.location);while(H!==F.match)}return F.match},named:m,choice(F){return F.match=B(F.alternatives,!0)},action:m,sequence(F){return F.match=B(F.elements,!1)},labeled:m,text:m,simple_and:m,simple_not(F){return F.match=-C(F.expression)},optional:c,zero_or_more:c,one_or_more:m,group:m,semantic_and:f,semantic_not:f,rule_ref(F){let H=n.findRule(p,F.name);return F.match=C(H)},literal(F){let H=F.value.length===0?s:o;return F.match=H},class(F){let H=F.parts.length===0?u:o;return F.match=H},any:f});C(p)}l.ALWAYS_MATCH=s,l.SOMETIMES_MATCH=o,l.NEVER_MATCH=u,t.exports=l}),AA=Se((e,t)=>{"use strict";var r=ia(),n=Id(),i=zi(),{ALWAYS_MATCH:s,SOMETIMES_MATCH:o,NEVER_MATCH:u}=Bd();function l(p){let f=[],c=[],m=[],B=[];function C(he){let $e=f.indexOf(he);return $e===-1?f.push(he)-1:$e}function F(he){let $e={value:he.parts,inverted:he.inverted,ignoreCase:he.ignoreCase},He=JSON.stringify($e),At=c.findIndex(Te=>JSON.stringify(Te)===He);return At===-1?c.push($e)-1:At}function H(he){let $e=JSON.stringify(he),He=m.findIndex(At=>JSON.stringify(At)===$e);return He===-1?m.push(he)-1:He}function q(he,$e,He){let At={predicate:he,params:$e,body:He.code,location:He.codeLocation},Te=JSON.stringify(At),xe=B.findIndex(rt=>JSON.stringify(rt)===Te);return xe===-1?B.push(At)-1:xe}function se(he){let $e={};return Object.keys(he).forEach(He=>{$e[He]=he[He]}),$e}function ce(he,...$e){return he.concat(...$e)}function Ce(he,$e,He,At){return he===s?He:he===u?At:$e.concat([He.length,At.length],He,At)}function pe(he,$e){return he.concat([$e.length],$e)}function De(he,$e,He,At){let Te=Object.keys(He).map(xe=>At-He[xe]);return[n.CALL,he,$e,Te.length].concat(Te)}function me(he,$e,He){let At=he.match|0;return ce([n.PUSH_CU
|
|||
|
|
`);return q.length===1?new l(F,H,B.source,m,C):new l(null,null,B.source,q.map((se,ce)=>new l(F+ce,ce===0?H:0,B.source,ce===q.length-1?se:[se,`
|
|||
|
|
`],C)))}function f(m,B,C,F,H){return C?new l(null,null,C.source,[m,p(B,C,H),new l(C.end.line,C.end.column-1,C.source,F)]):new l(null,null,null,[m,B,F])}function c(m,B){function C(he){return he instanceof l?he:he.replace(/^(.+)$/gm," $1")}function F(he){return"peg$c"+he}function H(he){return"peg$r"+he}function q(he){return"peg$e"+he}function se(he){return"peg$f"+he}function ce(he){return"peg$parse"+he}function Ce(){function he(Te){return'"'+o(Te)+'"'}function $e(Te){return"/^["+(Te.inverted?"^":"")+Te.value.map(xe=>Array.isArray(xe)?u(xe[0])+"-"+u(xe[1]):u(xe)).join("")+"]/"+(Te.ignoreCase?"i":"")}function He(Te){switch(Te.type){case"rule":return'peg$otherExpectation("'+o(Te.value)+'")';case"literal":return'peg$literalExpectation("'+o(Te.value)+'", '+Te.ignoreCase+")";case"class":return"peg$classExpectation(["+Te.value.map(xe=>Array.isArray(xe)?'["'+o(xe[0])+'", "'+o(xe[1])+'"]':'"'+o(xe)+'"').join(", ")+"], "+Te.inverted+", "+Te.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(Te)+")")}}function At(Te,xe){return f(`
|
|||
|
|
var ${se(xe)} = function(${Te.params.join(", ")}) {`,Te.body,Te.location,"};")}return new l(null,null,B.grammarSource,[m.literals.map((Te,xe)=>" var "+F(xe)+" = "+he(Te)+";").concat("",m.classes.map((Te,xe)=>" var "+H(xe)+" = "+$e(Te)+";")).concat("",m.expectations.map((Te,xe)=>" var "+q(xe)+" = "+He(Te)+";")).concat("").join(`
|
|||
|
|
`),m.functions.map(At)])}function pe(he,$e){let He=[];return He.push(""),B.trace&&He.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+he+","," location: peg$computeLocation(startPos, startPos)","});",""),B.cache&&(He.push("var key = peg$currPos * "+m.rules.length+" + "+$e+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),B.trace&&He.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+he+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+he+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),He.push(" return cached.result;","}","")),He}function De(he,$e){let He=[];return B.cache&&He.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+$e+" };"),B.trace&&He.push("","if ("+$e+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+he+","," result: "+$e+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+he+","," location: peg$computeLocation(startPos, startPos)"," });","}"),He.push("","return "+$e+";"),He}function me(he){let $e=[],He=new i(he.name,"s","var");function At(xe){let rt=0,Qt=xe.length,ut=[],Ze;function gt(cr,Jt){let St=Jt+3,Wr=xe[rt+St-2],rr=xe[rt+St-1],yt,sr;He.checkedIf(rt,()=>{rt+=St,yt=At(xe.slice(rt,rt+Wr)),rt+=Wr},rr>0?()=>{sr=At(xe.slice(rt,rt+rr)),rt+=rr}:null),ut.push("if ("+cr+") {"),ut.push(...yt.map(C)),rr>0&&(ut.push("} else {"),ut.push(...sr.map(C))),ut.push("}")}function Pt(cr){let Jt=xe[rt+2-1],St;He.checkedLoop(rt,()=>{rt+=2,St=At(xe.slice(rt,rt+Jt)),rt+=Jt}),ut.push("while ("+cr+") {"),ut.push(...St.map(C)),ut.push("}")}function rn(){let cr=xe[rt+4-1],Jt=se(xe[rt+1])+"("+xe.slice(rt+4,rt+4+cr).map(St=>He.index(St)).join(", ")+")";He.pop(xe[rt+2]),ut.push(He.push(Jt)),rt+=4+cr}for(;rt<Qt;)switch(xe[rt]){case n.PUSH_EMPTY_STRING:ut.push(He.push("''")),rt++;break;case n.PUSH_CURR_POS:ut.push(He.push("peg$currPos")),rt++;break;case n.PUSH_UNDEFINED:ut.push(He.push("undefined")),rt++;break;case n.PUSH_NULL:ut.push(He.push("null")),rt++;break;case n.PUSH_FAILED:ut.push(He.push("peg$FAILED")),rt++;break;case n.PUSH_EMPTY_ARRAY:ut.push(He.push("[]")),rt++;break;case n.POP:He.pop(),rt++;break;case n.POP_CURR_POS:ut.push("peg$currPos = "+He.pop()+";"),rt++;break;case n.POP_N:He.pop(xe[rt+1]),rt+=2;break;case n.NIP:Ze=He.pop(),He.pop(),ut.push(He.push(Ze)),rt++;break;case n.APPEND:Ze=He.pop(),ut.push(He.top()+".push("+Ze+");"),rt++;break;case n.WRAP:ut.push(He.push("["+He.pop(xe[rt+1]).join(", ")+"]")),rt+=2;break;case n.TEXT:ut.push(He.push("input.substring("+He.pop()+", peg$currPos)")),rt++;break;case n.PLUCK:{let cr=xe[rt+3-1],Jt=3+cr;Ze=xe.slice(rt+3,rt+Jt),Ze=cr===1?He.index(Ze[0]):`[ ${Ze.map(St=>He.index(St)).join(", ")} ]`,He.pop(xe[rt+1]),ut.push(He.push(Ze)),rt+=Jt;break}case n.IF:gt(He.top(),0);break;case n.IF_ERROR:gt(He.top()+" === peg$FAILED",0);break;case n.IF_NOT_ERROR:gt(He.top()+" !== peg$FAILED",0);break;case n.WHILE_NOT_ERROR:Pt(He.top()+" !== peg$FAILED");break;case n.MATCH_ANY:gt("input.length > peg$currPos",0);break;case n.MATCH_STRING:gt(m.literals[xe[rt+1]].length>1?"input.substr(peg$currPos, "+m.literals[xe[rt+1]].length+") === "+F(xe[rt+1]):"input.charCodeAt(peg$currPos) === "+m.literals[xe[rt+1]].charCodeAt(0),1);break;case n.MATCH_STRING_IC:gt("input.substr(peg$currPos, "+m.literals[xe[rt+1]].length+").toLowerCase() === "+F(xe[rt+1]),1);break;case n.MATCH_CHAR_CLASS:gt(H(xe[rt+1])+".test(input.charAt(peg$currPos))",1);break;case n.ACCEPT_N:ut.push(He.push(xe[rt+1]>1?"input.substr(peg$currPos, "+xe[rt+1]+")":"input.charAt(peg$currPos)")),ut.push(xe[rt+1]>1?"peg$currPos += "+xe[rt+1]+";":"peg$currPos++;"),rt+=2;break;case n.ACCEPT_STRING:ut.push(He.push(F(xe[rt+1]))),ut.push(m.literals[xe[rt+1]].length>1?"peg$currPos += "+m.literals[xe[rt+1]].length+";":"peg$currPos++;"),rt+=2;break;cas
|
|||
|
|
`,he.name)),B.trace&&$e.push(" var startPos = peg$currPos;"),$e.push(C(He.defines())),$e.push(...pe('"'+o(he.name)+'"',r.indexOfRule(m,he.name)).map(C)),$e.push(...Te.map(C)),$e.push(...De('"'+o(he.name)+'"',He.result()).map(C)),$e.push("}"),$e}function Ie(he){return he.codeLocation?p(he.code,he.codeLocation,"$"+he.type):he.code}function je(){let he=[];m.topLevelInitializer&&(he.push(Ie(m.topLevelInitializer)),he.push("")),he.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;",` var filler = peg$padEnd("", s.line.toString().length, ' ');`," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --> " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',` + filler + " | " + peg$padEnd("", s.column - 1, ' ')`,' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { retu
|
|||
|
|
`))}function et(he){function $e(){return[`// Generated by Peggy ${s}.`,"//","// https://peggyjs.org/"]}function He(){return B.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join(`
|
|||
|
|
`):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join(`
|
|||
|
|
`)}let At={bare(){return[...$e(),"(function() {",' "use strict";',"",he,"",C("return "+He()+";"),"})()"]},commonjs(){let Te=Object.keys(B.dependencies),xe=$e();return xe.push("",'"use strict";',""),Te.length>0&&(Te.forEach(rt=>{xe.push("var "+rt+' = require("'+o(B.dependencies[rt])+'");')}),xe.push("")),xe.push(he,"","module.exports = "+He()+";"),xe},es(){let Te=Object.keys(B.dependencies),xe=$e();return xe.push(""),Te.length>0&&(Te.forEach(rt=>{xe.push("import "+rt+' from "'+o(B.dependencies[rt])+'";')}),xe.push("")),xe.push(he,"","export {"," peg$SyntaxError as SyntaxError,",B.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),xe},amd(){let Te=Object.keys(B.dependencies),xe="["+Te.map(Qt=>B.dependencies[Qt]).map(Qt=>'"'+o(Qt)+'"').join(", ")+"]",rt=Te.join(", ");return[...$e(),"define("+xe+", function("+rt+") {",' "use strict";',"",he,"",C("return "+He()+";"),"});"]},globals(){return[...$e(),"(function(root) {",' "use strict";',"",he,"",C("root."+B.exportVar+" = "+He()+";"),"})(this);"]},umd(){let Te=Object.keys(B.dependencies),xe=Te.map(gt=>B.dependencies[gt]),rt="["+xe.map(gt=>'"'+o(gt)+'"').join(", ")+"]",Qt=xe.map(gt=>'require("'+o(gt)+'")').join(", "),ut=Te.join(", "),Ze=$e();return Ze.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+rt+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+Qt+");"),B.exportVar!==null&&Ze.push(" } else {"," root."+B.exportVar+" = factory();"),Ze.push(" }","})(this, function("+ut+") {",' "use strict";',"",he,"",C("return "+He()+";"),"});"),Ze}}[B.format]();return new l(null,null,B.grammarSource,At.map(Te=>Te instanceof l?Te:Te+`
|
|||
|
|
`))}m.code=et(je())}t.exports=c}),JA=Se((e,t)=>{"use strict";var r=ia(),n=zi();function i(s,o,u){function l(c){return c.type==="rule"&&c.expression.type==="rule_ref"}function p(c,m,B){n.build({rule_ref(C){C.name===m&&(C.name=B,u.info(`Proxy rule "${m}" replaced by the rule "${B}"`,C.location,[{message:"This rule will be used",location:r.findRule(c,B).nameLocation}]))}})(c)}let f=[];s.rules.forEach((c,m)=>{l(c)&&(p(s,c.name,c.expression.name),o.allowedStartRules.indexOf(c.name)===-1&&f.push(m))}),f.reverse(),f.forEach(c=>{s.rules.splice(c,1)})}t.exports=i}),ZA=Se((e,t)=>{"use strict";var r=zi();function n(i,s,o){function u(f){let c={};return Object.keys(f).forEach(m=>{c[m]=f[m]}),c}function l(f,c){p(f.expression,u(c))}let p=r.build({rule(f){p(f.expression,{})},choice(f,c){f.alternatives.forEach(m=>{p(m,u(c))})},action:l,labeled(f,c){let m=f.label;m&&Object.prototype.hasOwnProperty.call(c,m)&&o.error(`Label "${f.label}" is already defined`,f.labelLocation,[{message:"Original label location",location:c[m]}]),p(f.expression,c),c[f.label]=f.labelLocation},text:l,simple_and:l,simple_not:l,optional:l,zero_or_more:l,one_or_more:l,group:l});p(i)}t.exports=n}),ew=Se((e,t)=>{"use strict";var r=zi();function n(i,s,o){let u={};r.build({rule(l){if(Object.prototype.hasOwnProperty.call(u,l.name)){o.error(`Rule "${l.name}" is already defined`,l.nameLocation,[{message:"Original rule location",location:u[l.name]}]);return}u[l.name]=l.nameLocation}})(i)}t.exports=n}),nw=Se((e,t)=>{"use strict";var r=ia(),n=zi();function i(s,o,u){let l=[],p=[],f=n.build({rule(c){l.push(c.name),f(c.expression),l.pop()},sequence(c){c.elements.every(m=>(f(m),!r.alwaysConsumesOnSuccess(s,m)))},rule_ref(c){p.push(c);let m=r.findRule(s,c.name);if(l.indexOf(c.name)!==-1){l.push(c.name),u.error("Possible infinite loop when parsing (left recursion: "+l.join(" -> ")+")",m.nameLocation,p.map((B,C,F)=>({message:C+1!==F.length?`Step ${C+1}: call of the rule "${B.name}" without input consumption`:`Step ${C+1}: call itself without input consumption - left recursion`,location:B.location})));return}m&&f(m),p.pop()}});f(s)}t.exports=i}),uw=Se((e,t)=>{"use strict";var r=ia(),n=zi();function i(s,o,u){n.build({zero_or_more(l){r.alwaysConsumesOnSuccess(s,l.expression)||u.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",l.location)},one_or_more(l){r.alwaysConsumesOnSuccess(s,l.expression)||u.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",l.location)}})(s)}t.exports=i}),ow=Se((e,t)=>{"use strict";var r=ia(),n=zi();function i(s,o,u){n.build({rule_ref(l){r.findRule(s,l.name)||u.error(`Rule "${l.name}" is not defined`,l.location)}})(s)}t.exports=i}),lw=Se((e,t)=>{"use strict";var r=zi();function n(i,s,o){let u=r.build({action(l){u(l.expression,l)},labeled(l,p){l.pick&&p&&o.error('"@" cannot be used with an action block',l.labelLocation,[{message:"Action block location",location:p.codeLocation}]),u(l.expression)}});u(i)}t.exports=n}),hw=Se((e,t)=>{"use strict";var r=wh(),n=class{constructor(s){s=typeof s<"u"?s:{},typeof s.error=="function"&&(this.error=s.error),typeof s.warning=="function"&&(this.warning=s.warning),typeof s.info=="function"&&(this.info=s.info)}error(){}warning(){}info(){}},i=class{constructor(s){this._callbacks=new n(s),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...s){++this.errors,this._firstError===null&&(this._firstError=new r(...s),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...s]),this._callbacks.error(this.stage,...s)}warning(...s){this.problems.push(["warning",...s]),this._callbacks.warning(this.stage,...s)}info(...s){this.problems.push(["info",...s]),this._callbacks.info(this.stage,...s)}checkErrors(){if(this.errors!==0)throw this._firstError}};t.exports=i}),pw=Se((exports,module)=>{"use strict";var generateBytecode=AA(),generateJS=YA(),inferenceMatchResult=Bd(),removeProxyRules=JA(),reportDuplicateLabels=ZA(),reportDuplicateRules=ew(),reportInf
|
|||
|
|
--> `+C+`
|
|||
|
|
`+H+` |
|
|||
|
|
`+B.line+" | "+q+`
|
|||
|
|
`+H+" | "+u("",B.column-1," ")+u("",ce,"^")}else f+=`
|
|||
|
|
at `+C}return f},o.buildMessage=function(p,f){var c={literal:function(se){return'"'+B(se.text)+'"'},class:function(se){var ce=se.parts.map(function(Ce){return Array.isArray(Ce)?C(Ce[0])+"-"+C(Ce[1]):C(Ce)});return"["+(se.inverted?"^":"")+ce.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(se){return se.description}};function m(se){return se.charCodeAt(0).toString(16).toUpperCase()}function B(se){return se.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(ce){return"\\x0"+m(ce)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(ce){return"\\x"+m(ce)})}function C(se){return se.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(ce){return"\\x0"+m(ce)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(ce){return"\\x"+m(ce)})}function F(se){return c[se.type](se)}function H(se){var ce=se.map(F),Ce,pe;if(ce.sort(),ce.length>0){for(Ce=1,pe=1;Ce<ce.length;Ce++)ce[Ce-1]!==ce[Ce]&&(ce[pe]=ce[Ce],pe++);ce.length=pe}switch(ce.length){case 1:return ce[0];case 2:return ce[0]+" or "+ce[1];default:return ce.slice(0,-1).join(", ")+", or "+ce[ce.length-1]}}function q(se){return se?'"'+B(se)+'"':"end of input"}return"Expected "+H(p)+" but "+q(f)+" found."};function l(p,f){f=f!==void 0?f:{};var c={},m=f.grammarSource,B={Grammar:Sf},C=Sf,F="{",H="}",q="=",se="/",ce="@",Ce=":",pe="$",De="&",me="!",Ie="?",je="*",et="+",he="(",$e=")",He=" ",At="\v",Te="\f",xe=" ",rt="\xA0",Qt="\uFEFF",ut=`
|
|||
|
|
`,Ze=`\r
|
|||
|
|
`,gt="\r",Pt="\u2028",rn="\u2029",cr="/*",Jt="*/",St="//",Wr="_",rr="\\",yt="\u200C",sr="\u200D",Dt="i",Wt='"',K="'",T="[",J="^",Ue="]",Xe="-",jt="0",Cr="b",dr="f",er="n",Zt="r",Vn="t",Oi="v",Jn="x",U="u",x=".",M=";",ee=/^[\n\r\u2028\u2029]/,ye=/^[0-9]/,Qe=/^[0-9a-f]/i,re=/^[{}]/,Oe=/^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76
|
|||
|
|
`,"\r","\u2028","\u2029"],!1,!1),zn=Ts("end of line"),Zs=Kt(`
|
|||
|
|
`,!1),gs=Kt(`\r
|
|||
|
|
`,!1),Io=Kt("\r",!1),wo=Kt("\u2028",!1),nn=Kt("\u2029",!1),gi=Ts("comment"),yr=Kt("/*",!1),mn=Kt("*/",!1),ji=Kt("//",!1),Mr=Ts("identifier"),Xs=Kt("_",!1),Vr=Kt("\\",!1),Ns=Kt("\u200C",!1),ms=Kt("\u200D",!1),si=Ts("literal"),En=Kt("i",!1),Yi=Ts("string"),xn=Kt('"',!1),Vi=Kt("'",!1),mi=Ts("character class"),Ui=Kt("[",!1),Xu=Kt("^",!1),tc=Kt("]",!1),Jo=Kt("-",!1),du=Kt("0",!1),ba=Kt("b",!1),sc=Kt("f",!1),gu=Kt("n",!1),oo=Kt("r",!1),ie=Kt("t",!1),Ae=Kt("v",!1),R=Kt("x",!1),Y=Kt("u",!1),oe=Zn([["0","9"]],!1,!1),Fe=Zn([["0","9"],["a","f"]],!1,!0),Ye=Kt(".",!1),ze=Ts("code block"),wt=Zn(["{","}"],!1,!1),Tt=Zn([["a","z"],"\xB5",["\xDF","\xF6"],["\xF8","\xFF"],"\u0101","\u0103","\u0105","\u0107","\u0109","\u010B","\u010D","\u010F","\u0111","\u0113","\u0115","\u0117","\u0119","\u011B","\u011D","\u011F","\u0121","\u0123","\u0125","\u0127","\u0129","\u012B","\u012D","\u012F","\u0131","\u0133","\u0135",["\u0137","\u0138"],"\u013A","\u013C","\u013E","\u0140","\u0142","\u0144","\u0146",["\u0148","\u0149"],"\u014B","\u014D","\u014F","\u0151","\u0153","\u0155","\u0157","\u0159","\u015B","\u015D","\u015F","\u0161","\u0163","\u0165","\u0167","\u0169","\u016B","\u016D","\u016F","\u0171","\u0173","\u0175","\u0177","\u017A","\u017C",["\u017E","\u0180"],"\u0183","\u0185","\u0188",["\u018C","\u018D"],"\u0192","\u0195",["\u0199","\u019B"],"\u019E","\u01A1","\u01A3","\u01A5","\u01A8",["\u01AA","\u01AB"],"\u01AD","\u01B0","\u01B4","\u01B6",["\u01B9","\u01BA"],["\u01BD","\u01BF"],"\u01C6","\u01C9","\u01CC","\u01CE","\u01D0","\u01D2","\u01D4","\u01D6","\u01D8","\u01DA",["\u01DC","\u01DD"],"\u01DF","\u01E1","\u01E3","\u01E5","\u01E7","\u01E9","\u01EB","\u01ED",["\u01EF","\u01F0"],"\u01F3","\u01F5","\u01F9","\u01FB","\u01FD","\u01FF","\u0201","\u0203","\u0205","\u0207","\u0209","\u020B","\u020D","\u020F","\u0211","\u0213","\u0215","\u0217","\u0219","\u021B","\u021D","\u021F","\u0221","\u0223","\u0225","\u0227","\u0229","\u022B","\u022D","\u022F","\u0231",["\u0233","\u0239"],"\u023C",["\u023F","\u0240"],"\u0242","\u0247","\u0249","\u024B","\u024D",["\u024F","\u0293"],["\u0295","\u02AF"],"\u0371","\u0373","\u0377",["\u037B","\u037D"],"\u0390",["\u03AC","\u03CE"],["\u03D0","\u03D1"],["\u03D5","\u03D7"],"\u03D9","\u03DB","\u03DD","\u03DF","\u03E1","\u03E3","\u03E5","\u03E7","\u03E9","\u03EB","\u03ED",["\u03EF","\u03F3"],"\u03F5","\u03F8",["\u03FB","\u03FC"],["\u0430","\u045F"],"\u0461","\u0463","\u0465","\u0467","\u0469","\u046B","\u046D","\u046F","\u0471","\u0473","\u0475","\u0477","\u0479","\u047B","\u047D","\u047F","\u0481","\u048B","\u048D","\u048F","\u0491","\u0493","\u0495","\u0497","\u0499","\u049B","\u049D","\u049F","\u04A1","\u04A3","\u04A5","\u04A7","\u04A9","\u04AB","\u04AD","\u04AF","\u04B1","\u04B3","\u04B5","\u04B7","\u04B9","\u04BB","\u04BD","\u04BF","\u04C2","\u04C4","\u04C6","\u04C8","\u04CA","\u04CC",["\u04CE","\u04CF"],"\u04D1","\u04D3","\u04D5","\u04D7","\u04D9","\u04DB","\u04DD","\u04DF","\u04E1","\u04E3","\u04E5","\u04E7","\u04E9","\u04EB","\u04ED","\u04EF","\u04F1","\u04F3","\u04F5","\u04F7","\u04F9","\u04FB","\u04FD","\u04FF","\u0501","\u0503","\u0505","\u0507","\u0509","\u050B","\u050D","\u050F","\u0511","\u0513","\u0515","\u0517","\u0519","\u051B","\u051D","\u051F","\u0521","\u0523","\u0525","\u0527","\u0529","\u052B","\u052D","\u052F",["\u0561","\u0587"],["\u13F8","\u13FD"],["\u1D00","\u1D2B"],["\u1D6B","\u1D77"],["\u1D79","\u1D9A"],"\u1E01","\u1E03","\u1E05","\u1E07","\u1E09","\u1E0B","\u1E0D","\u1E0F","\u1E11","\u1E13","\u1E15","\u1E17","\u1E19","\u1E1B","\u1E1D","\u1E1F","\u1E21","\u1E23","\u1E25","\u1E27","\u1E29","\u1E2B","\u1E2D","\u1E2F","\u1E31","\u1E33","\u1E35","\u1E37","\u1E39","\u1E3B","\u1E3D","\u1E3F","\u1E41","\u1E43","\u1E45","\u1E47","\u1E49","\u1E4B","\u1E4D","\u1E4F","\u1E51","\u1E53","\u1E55","\u1E57","\u1E59","\u1E5B","\u1E5D","\u1E5F","\u1E61","\u1E63","\u1E65","\u1E67","\u1E69","\u1E6B","\u1E6D","\u1E6F","\u1E71","\u1E73","\u1E75","\u1E77","\u1E79","\u1E7B","\u1E7D","\u1E7F","\u1E81","\u1E83","\u1E85","\u1E87","\u1E89","\u1E8B","\u1E8D","\u1E8F","\u1E91","\u1E93",["\u1E95","\u1E9D"],"\u1E9F","\u1EA1","\u
|
|||
|
|
`},v=function(){return"\r"},Cf=function(){return" "},Da=function(){return"\v"},uc=function(y){return String.fromCharCode(parseInt(y,16))},Es=function(y){return String.fromCharCode(parseInt(y,16))},ri=function(){return{type:"any",location:Er()}},mu=function(y){return[y,Er()]},X=0,br=0,Zo=[{line:1,column:1}],Rn=0,Tn=[],tt=0,xs;if("startRule"in f){if(!(f.startRule in B))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');C=B[f.startRule]}function hp(){return p.substring(br,X)}function Hl(){return br}function bf(){return{source:m,start:br,end:X}}function Er(){return Lc(br,X)}function Kg(y,Q){throw Q=Q!==void 0?Q:Lc(br,X),Pc([Ts(y)],p.substring(br,X),Q)}function $l(y,Q){throw Q=Q!==void 0?Q:Lc(br,X),Xn(y,Q)}function Kt(y,Q){return{type:"literal",text:y,ignoreCase:Q}}function Zn(y,Q,W){return{type:"class",parts:y,inverted:Q,ignoreCase:W}}function Df(){return{type:"any"}}function xf(){return{type:"end"}}function Ts(y){return{type:"other",description:y}}function Ff(y){var Q=Zo[y],W;if(Q)return Q;for(W=y-1;!Zo[W];)W--;for(Q=Zo[W],Q={line:Q.line,column:Q.column};W<y;)p.charCodeAt(W)===10?(Q.line++,Q.column=1):Q.column++,W++;return Zo[y]=Q,Q}function Lc(y,Q){var W=Ff(y),j=Ff(Q);return{source:m,start:{offset:y,line:W.line,column:W.column},end:{offset:Q,line:j.line,column:j.column}}}function ct(y){X<Rn||(X>Rn&&(Rn=X,Tn=[]),Tn.push(y))}function Xn(y,Q){return new o(y,null,null,Q)}function Pc(y,Q,W){return new o(o.buildMessage(y,Q),y,Q,W)}function Sf(){var y,Q,W,j,fe,ve,_e,Ne;if(y=X,Q=Ee(),W=X,j=Pd(),j!==c?(fe=Ee(),W=j):(X=W,W=c),W===c&&(W=null),j=X,fe=Qf(),fe!==c?(ve=Ee(),j=fe):(X=j,j=c),j===c&&(j=null),fe=[],ve=X,_e=Hd(),_e!==c?(Ne=Ee(),ve=_e):(X=ve,ve=c),ve!==c)for(;ve!==c;)fe.push(ve),ve=X,_e=Hd(),_e!==c?(Ne=Ee(),ve=_e):(X=ve,ve=c);else fe=c;return fe!==c?(br=y,y=qg(W,j,fe)):(X=y,y=c),y}function Pd(){var y,Q,W,j,fe;return y=X,p.charCodeAt(X)===123?(Q=F,X++):(Q=c,tt===0&&ct(mr)),Q!==c?(W=b(),W!==c?(p.charCodeAt(X)===125?(j=H,X++):(j=c,tt===0&&ct(ds)),j!==c?(fe=we(),fe!==c?(br=y,y=jg(W)):(X=y,y=c)):(X=y,y=c)):(X=y,y=c)):(X=y,y=c),y}function Qf(){var y,Q,W;return y=X,Q=b(),Q!==c?(W=we(),W!==c?(br=y,y=Kn(Q)):(X=y,y=c)):(X=y,y=c),y}function Hd(){var y,Q,W,j,fe,ve,_e,Ne;return y=X,Q=Je(),Q!==c?(W=Ee(),j=X,fe=Ei(),fe!==c?(ve=Ee(),j=fe):(X=j,j=c),j===c&&(j=null),p.charCodeAt(X)===61?(fe=q,X++):(fe=c,tt===0&&ct(Yo)),fe!==c?(ve=Ee(),_e=Rf(),_e!==c?(Ne=we(),Ne!==c?(br=y,y=$n(Q,j,_e)):(X=y,y=c)):(X=y,y=c)):(X=y,y=c)):(X=y,y=c),y}function Rf(){var y,Q,W,j,fe,ve,_e,Ne;if(y=X,Q=kf(),Q!==c){for(W=[],j=X,fe=Ee(),p.charCodeAt(X)===47?(ve=se,X++):(ve=c,tt===0&&ct(va)),ve!==c?(_e=Ee(),Ne=kf(),Ne!==c?j=Ne:(X=j,j=c)):(X=j,j=c);j!==c;)W.push(j),j=X,fe=Ee(),p.charCodeAt(X)===47?(ve=se,X++):(ve=c,tt===0&&ct(va)),ve!==c?(_e=Ee(),Ne=kf(),Ne!==c?j=Ne:(X=j,j=c)):(X=j,j=c);br=y,y=Gg(Q,W)}else X=y,y=c;return y}function kf(){var y,Q,W,j,fe;return y=X,Q=Zg(),Q!==c?(W=X,j=Ee(),fe=b(),fe!==c?W=fe:(X=W,W=c),W===c&&(W=null),br=y,y=Yg(Q,W)):(X=y,y=c),y}function Zg(){var y,Q,W,j,fe,ve;if(y=X,Q=Fa(),Q!==c){for(W=[],j=X,fe=Ee(),ve=Fa(),ve!==c?j=ve:(X=j,j=c);j!==c;)W.push(j),j=X,fe=Ee(),ve=Fa(),ve!==c?j=ve:(X=j,j=c);br=y,y=Vg(Q,W)}else X=y,y=c;return y}function Fa(){var y,Q,W,j;return y=X,Q=mp(),Q!==c?(W=ql(),W===c&&(W=null),j=lc(),j!==c?(br=y,y=an(Q,W,j)):(X=y,y=c)):(X=y,y=c),y===c&&(y=X,Q=ql(),Q!==c?(W=Ee(),j=lc(),j!==c?(br=y,y=Jg(Q,j)):(X=y,y=c)):(X=y,y=c),y===c&&(y=lc())),y}function mp(){var y,Q;return y=X,p.charCodeAt(X)===64?(Q=ce,X++):(Q=c,tt===0&&ct(pu)),Q!==c&&(br=y,Q=Wg()),y=Q,y}function ql(){var y,Q,W,j;return y=X,Q=Je(),Q!==c?(W=Ee(),p.charCodeAt(X)===58?(j=Ce,X++):(j=c,tt===0&&ct(Ia)),j!==c?(br=y,y=vd(Q)):(X=y,y=c)):(X=y,y=c),y}function lc(){var y,Q,W,j;return y=X,Q=Ep(),Q!==c?(W=Ee(),j=ao(),j!==c?(br=y,y=zg(Q,j)):(X=y,y=c)):(X=y,y=c),y===c&&(y=ao()),y}function Ep(){var y;return p.charCodeAt(X)===36?(y=pe,X++):(y=c,tt===0&&ct(fu)),y===c&&(p.charCodeAt(X)===38?(y=De,X++):(y=c,tt===0&&ct(Vo)),y===c&&(p.charCodeAt(X)===33?(y=me,X++):(y=c,tt===0&&ct(hu)))),y}function ao(){var y,Q,W,j;return y=X,Q=yp(),Q!==c?(W=Ee(),j=jl(),j!==c?(br=y,y=Zi(Q,j)):(X
|
|||
|
|
`?(dr++,er=0):Ge?er+=Ge.length:er++,Ge&&(Cr+=Ge.length),Ge}var dt={default:function(){switch(Qe){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|||
|
|
`:case"\r":case"\u2028":case"\u2029":Re();return;case"/":Re(),x="comment";return;case void 0:return Re(),st("eof")}if(J.isSpaceSeparator(Qe)){Re();return}return dt[Xe]()},comment:function(){switch(Qe){case"*":Re(),x="multiLineComment";return;case"/":Re(),x="singleLineComment";return}throw mr(Re())},multiLineComment:function(){switch(Qe){case"*":Re(),x="multiLineCommentAsterisk";return;case void 0:throw mr(Re())}Re()},multiLineCommentAsterisk:function(){switch(Qe){case"*":Re();return;case"/":Re(),x="default";return;case void 0:throw mr(Re())}Re(),x="multiLineComment"},singleLineComment:function(){switch(Qe){case`
|
|||
|
|
`:case"\r":case"\u2028":case"\u2029":Re(),x="default";return;case void 0:return Re(),st("eof")}Re()},value:function(){switch(Qe){case"{":case"[":return st("punctuator",Re());case"n":return Re(),nt("ull"),st("null",null);case"t":return Re(),nt("rue"),st("boolean",!0);case"f":return Re(),nt("alse"),st("boolean",!1);case"-":case"+":Re()==="-"&&(ye=-1),x="sign";return;case".":M=Re(),x="decimalPointLeading";return;case"0":M=Re(),x="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":M=Re(),x="decimalInteger";return;case"I":return Re(),nt("nfinity"),st("numeric",1/0);case"N":return Re(),nt("aN"),st("numeric",NaN);case'"':case"'":ee=Re()==='"',M="",x="string";return}throw mr(Re())},identifierNameStartEscape:function(){if(Qe!=="u")throw mr(Re());Re();var Ge=Lt();switch(Ge){case"$":case"_":break;default:if(!J.isIdStartChar(Ge))throw Yo();break}M+=Ge,x="identifierName"},identifierName:function(){switch(Qe){case"$":case"_":case"\u200C":case"\u200D":M+=Re();return;case"\\":Re(),x="identifierNameEscape";return}if(J.isIdContinueChar(Qe)){M+=Re();return}return st("identifier",M)},identifierNameEscape:function(){if(Qe!=="u")throw mr(Re());Re();var Ge=Lt();switch(Ge){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!J.isIdContinueChar(Ge))throw Yo();break}M+=Ge,x="identifierName"},sign:function(){switch(Qe){case".":M=Re(),x="decimalPointLeading";return;case"0":M=Re(),x="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":M=Re(),x="decimalInteger";return;case"I":return Re(),nt("nfinity"),st("numeric",ye*(1/0));case"N":return Re(),nt("aN"),st("numeric",NaN)}throw mr(Re())},zero:function(){switch(Qe){case".":M+=Re(),x="decimalPoint";return;case"e":case"E":M+=Re(),x="decimalExponent";return;case"x":case"X":M+=Re(),x="hexadecimal";return}return st("numeric",ye*0)},decimalInteger:function(){switch(Qe){case".":M+=Re(),x="decimalPoint";return;case"e":case"E":M+=Re(),x="decimalExponent";return}if(J.isDigit(Qe)){M+=Re();return}return st("numeric",ye*Number(M))},decimalPointLeading:function(){if(J.isDigit(Qe)){M+=Re(),x="decimalFraction";return}throw mr(Re())},decimalPoint:function(){switch(Qe){case"e":case"E":M+=Re(),x="decimalExponent";return}if(J.isDigit(Qe)){M+=Re(),x="decimalFraction";return}return st("numeric",ye*Number(M))},decimalFraction:function(){switch(Qe){case"e":case"E":M+=Re(),x="decimalExponent";return}if(J.isDigit(Qe)){M+=Re();return}return st("numeric",ye*Number(M))},decimalExponent:function(){switch(Qe){case"+":case"-":M+=Re(),x="decimalExponentSign";return}if(J.isDigit(Qe)){M+=Re(),x="decimalExponentInteger";return}throw mr(Re())},decimalExponentSign:function(){if(J.isDigit(Qe)){M+=Re(),x="decimalExponentInteger";return}throw mr(Re())},decimalExponentInteger:function(){if(J.isDigit(Qe)){M+=Re();return}return st("numeric",ye*Number(M))},hexadecimal:function(){if(J.isHexDigit(Qe)){M+=Re(),x="hexadecimalInteger";return}throw mr(Re())},hexadecimalInteger:function(){if(J.isHexDigit(Qe)){M+=Re();return}return st("numeric",ye*Number(M))},string:function(){switch(Qe){case"\\":Re(),M+=Et();return;case'"':if(ee)return Re(),st("string",M);M+=Re();return;case"'":if(!ee)return Re(),st("string",M);M+=Re();return;case`
|
|||
|
|
`:case"\r":throw mr(Re());case"\u2028":case"\u2029":va(Qe);break;case void 0:throw mr(Re())}M+=Re()},start:function(){switch(Qe){case"{":case"[":return st("punctuator",Re())}x="value"},beforePropertyName:function(){switch(Qe){case"$":case"_":M=Re(),x="identifierName";return;case"\\":Re(),x="identifierNameStartEscape";return;case"}":return st("punctuator",Re());case'"':case"'":ee=Re()==='"',x="string";return}if(J.isIdStartChar(Qe)){M+=Re(),x="identifierName";return}throw mr(Re())},afterPropertyName:function(){if(Qe===":")return st("punctuator",Re());throw mr(Re())},beforePropertyValue:function(){x="value"},afterPropertyValue:function(){switch(Qe){case",":case"}":return st("punctuator",Re())}throw mr(Re())},beforeArrayValue:function(){if(Qe==="]")return st("punctuator",Re());x="value"},afterArrayValue:function(){switch(Qe){case",":case"]":return st("punctuator",Re())}throw mr(Re())},end:function(){throw mr(Re())}};function st(Ge,Ft){return{type:Ge,value:Ft,line:dr,column:er}}function nt(Ge){for(var Ft=0,Gt=Ge;Ft<Gt.length;Ft+=1){var pr=Gt[Ft],Xt=Oe();if(Xt!==pr)throw mr(Re());Re()}}function Et(){var Ge=Oe();switch(Ge){case"b":return Re(),"\b";case"f":return Re(),"\f";case"n":return Re(),`
|
|||
|
|
`;case"r":return Re(),"\r";case"t":return Re()," ";case"v":return Re(),"\v";case"0":if(Re(),J.isDigit(Oe()))throw mr(Re());return"\0";case"x":return Re(),Bt();case"u":return Re(),Lt();case`
|
|||
|
|
`:case"\u2028":case"\u2029":return Re(),"";case"\r":return Re(),Oe()===`
|
|||
|
|
`&&Re(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw mr(Re());case void 0:throw mr(Re())}return Re()}function Bt(){var Ge="",Ft=Oe();if(!J.isHexDigit(Ft)||(Ge+=Re(),Ft=Oe(),!J.isHexDigit(Ft)))throw mr(Re());return Ge+=Re(),String.fromCodePoint(parseInt(Ge,16))}function Lt(){for(var Ge="",Ft=4;Ft-- >0;){var Gt=Oe();if(!J.isHexDigit(Gt))throw mr(Re());Ge+=Re()}return String.fromCodePoint(parseInt(Ge,16))}var Ar={start:function(){if(Zt.type==="eof")throw ds();tr()},beforePropertyName:function(){switch(Zt.type){case"identifier":case"string":Vn=Zt.value,Xe="afterPropertyName";return;case"punctuator":Di();return;case"eof":throw ds()}},afterPropertyName:function(){if(Zt.type==="eof")throw ds();Xe="beforePropertyValue"},beforePropertyValue:function(){if(Zt.type==="eof")throw ds();tr()},beforeArrayValue:function(){if(Zt.type==="eof")throw ds();if(Zt.type==="punctuator"&&Zt.value==="]"){Di();return}tr()},afterPropertyValue:function(){if(Zt.type==="eof")throw ds();switch(Zt.value){case",":Xe="beforePropertyName";return;case"}":Di()}},afterArrayValue:function(){if(Zt.type==="eof")throw ds();switch(Zt.value){case",":Xe="beforeArrayValue";return;case"]":Di()}},end:function(){}};function tr(){var Ge;switch(Zt.type){case"punctuator":switch(Zt.value){case"{":Ge={};break;case"[":Ge=[];break}break;case"null":case"boolean":case"numeric":case"string":Ge=Zt.value;break}if(Oi===void 0)Oi=Ge;else{var Ft=jt[jt.length-1];Array.isArray(Ft)?Ft.push(Ge):Object.defineProperty(Ft,Vn,{value:Ge,writable:!0,enumerable:!0,configurable:!0})}if(Ge!==null&&typeof Ge=="object")jt.push(Ge),Array.isArray(Ge)?Xe="beforeArrayValue":Xe="beforePropertyName";else{var Gt=jt[jt.length-1];Gt==null?Xe="end":Array.isArray(Gt)?Xe="afterArrayValue":Xe="afterPropertyValue"}}function Di(){jt.pop();var Ge=jt[jt.length-1];Ge==null?Xe="end":Array.isArray(Ge)?Xe="afterArrayValue":Xe="afterPropertyValue"}function mr(Ge){return Ia(Ge===void 0?"JSON5: invalid end of input at "+dr+":"+er:"JSON5: invalid character '"+pu(Ge)+"' at "+dr+":"+er)}function ds(){return Ia("JSON5: invalid end of input at "+dr+":"+er)}function Yo(){return er-=5,Ia("JSON5: invalid identifier character at "+dr+":"+er)}function va(Ge){console.warn("JSON5: '"+pu(Ge)+"' in strings is not valid ECMAScript; consider escaping")}function pu(Ge){var Ft={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(Ft[Ge])return Ft[Ge];if(Ge<" "){var Gt=Ge.charCodeAt(0).toString(16);return"\\x"+("00"+Gt).substring(Gt.length)}return Ge}function Ia(Ge){var Ft=new SyntaxError(Ge);return Ft.lineNumber=dr,Ft.columnNumber=er,Ft}var fu=function(Ge,Ft,Gt){var pr=[],Xt="",Or,Kr,Hn="",Wn;if(Ft!=null&&typeof Ft=="object"&&!Array.isArray(Ft)&&(Gt=Ft.space,Wn=Ft.quote,Ft=Ft.replacer),typeof Ft=="function")Kr=Ft;else if(Array.isArray(Ft)){Or=[];for(var bs=0,Bo=Ft;bs<Bo.length;bs+=1){var xi=Bo[bs],Ds=void 0;typeof xi=="string"?Ds=xi:(typeof xi=="number"||xi instanceof String||xi instanceof Number)&&(Ds=String(xi)),Ds!==void 0&&Or.indexOf(Ds)<0&&Or.push(Ds)}}return Gt instanceof Number?Gt=Number(Gt):Gt instanceof String&&(Gt=String(Gt)),typeof Gt=="number"?Gt>0&&(Gt=Math.min(10,Math.floor(Gt)),Hn=" ".substr(0,Gt)):typeof Gt=="string"&&(Hn=Gt.substr(0,10)),zn("",{"":Ge});function zn(nn,gi){var yr=gi[nn];switch(yr!=null&&(typeof yr.toJSON5=="function"?yr=yr.toJSON5(nn):typeof yr.toJSON=="function"&&(yr=yr.toJSON(nn))),Kr&&(yr=Kr.call(gi,nn,yr)),yr instanceof Number?yr=Number(yr):yr instanceof String?yr=String(yr):yr instanceof Boolean&&(yr=yr.valueOf()),yr){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof yr=="string")return Zs(yr,!1);if(typeof yr=="number")return String(yr);if(typeof yr=="object")return Array.isArray(yr)?wo(yr):gs(yr)}function Zs(nn){for(var gi={"'":.1,'"':.2},yr={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},mn="",ji=0;ji<nn.length;ji++){var Mr=nn[ji];switch(Mr){
|
|||
|
|
`+Xt;si=mn.join(En),ms=`{
|
|||
|
|
`+Xt+si+`,
|
|||
|
|
`+gi+"}"}}return pr.pop(),Xt=gi,ms}function Io(nn){if(nn.length===0)return Zs(nn,!0);var gi=String.fromCodePoint(nn.codePointAt(0));if(!J.isIdStartChar(gi))return Zs(nn,!0);for(var yr=gi.length;yr<nn.length;yr++)if(!J.isIdContinueChar(String.fromCodePoint(nn.codePointAt(yr))))return Zs(nn,!0);return nn}function wo(nn){if(pr.indexOf(nn)>=0)throw TypeError("Converting circular structure to JSON5");pr.push(nn);var gi=Xt;Xt=Xt+Hn;for(var yr=[],mn=0;mn<nn.length;mn++){var ji=zn(String(mn),nn);yr.push(ji!==void 0?ji:"null")}var Mr;if(yr.length===0)Mr="[]";else if(Hn===""){var Xs=yr.join(",");Mr="["+Xs+"]"}else{var Vr=`,
|
|||
|
|
`+Xt,Ns=yr.join(Vr);Mr=`[
|
|||
|
|
`+Xt+Ns+`,
|
|||
|
|
`+gi+"]"}return pr.pop(),Xt=gi,Mr}},Vo={parse:Jn,stringify:fu},hu=Vo,wa=hu;return wa})}),d1=Se((e,t)=>{var r=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};t.exports=r}),g1=Se((e,t)=>{var r="2.0.0",n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=250,o=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:n,RELEASE_TYPES:o,SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),E1=Se((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=g1(),s=d1();e=t.exports={};var o=e.re=[],u=e.safeRe=[],l=e.src=[],p=e.t={},f=0,c="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[c,n]],B=F=>{for(let[H,q]of m)F=F.split(`${H}*`).join(`${H}{0,${q}}`).split(`${H}+`).join(`${H}{1,${q}}`);return F},C=(F,H,q)=>{let se=B(H),ce=f++;s(F,ce,H),p[F]=ce,l[ce]=H,o[ce]=new RegExp(H,q?"g":void 0),u[ce]=new RegExp(se,q?"g":void 0)};C("NUMERICIDENTIFIER","0|[1-9]\\d*"),C("NUMERICIDENTIFIERLOOSE","\\d+"),C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),C("MAINVERSION",`(${l[p.NUMERICIDENTIFIER]})\\.(${l[p.NUMERICIDENTIFIER]})\\.(${l[p.NUMERICIDENTIFIER]})`),C("MAINVERSIONLOOSE",`(${l[p.NUMERICIDENTIFIERLOOSE]})\\.(${l[p.NUMERICIDENTIFIERLOOSE]})\\.(${l[p.NUMERICIDENTIFIERLOOSE]})`),C("PRERELEASEIDENTIFIER",`(?:${l[p.NUMERICIDENTIFIER]}|${l[p.NONNUMERICIDENTIFIER]})`),C("PRERELEASEIDENTIFIERLOOSE",`(?:${l[p.NUMERICIDENTIFIERLOOSE]}|${l[p.NONNUMERICIDENTIFIER]})`),C("PRERELEASE",`(?:-(${l[p.PRERELEASEIDENTIFIER]}(?:\\.${l[p.PRERELEASEIDENTIFIER]})*))`),C("PRERELEASELOOSE",`(?:-?(${l[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[p.PRERELEASEIDENTIFIERLOOSE]})*))`),C("BUILDIDENTIFIER",`${c}+`),C("BUILD",`(?:\\+(${l[p.BUILDIDENTIFIER]}(?:\\.${l[p.BUILDIDENTIFIER]})*))`),C("FULLPLAIN",`v?${l[p.MAINVERSION]}${l[p.PRERELEASE]}?${l[p.BUILD]}?`),C("FULL",`^${l[p.FULLPLAIN]}$`),C("LOOSEPLAIN",`[v=\\s]*${l[p.MAINVERSIONLOOSE]}${l[p.PRERELEASELOOSE]}?${l[p.BUILD]}?`),C("LOOSE",`^${l[p.LOOSEPLAIN]}$`),C("GTLT","((?:<|>)?=?)"),C("XRANGEIDENTIFIERLOOSE",`${l[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),C("XRANGEIDENTIFIER",`${l[p.NUMERICIDENTIFIER]}|x|X|\\*`),C("XRANGEPLAIN",`[v=\\s]*(${l[p.XRANGEIDENTIFIER]})(?:\\.(${l[p.XRANGEIDENTIFIER]})(?:\\.(${l[p.XRANGEIDENTIFIER]})(?:${l[p.PRERELEASE]})?${l[p.BUILD]}?)?)?`),C("XRANGEPLAINLOOSE",`[v=\\s]*(${l[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[p.XRANGEIDENTIFIERLOOSE]})(?:${l[p.PRERELEASELOOSE]})?${l[p.BUILD]}?)?)?`),C("XRANGE",`^${l[p.GTLT]}\\s*${l[p.XRANGEPLAIN]}$`),C("XRANGELOOSE",`^${l[p.GTLT]}\\s*${l[p.XRANGEPLAINLOOSE]}$`),C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),C("COERCE",`${l[p.COERCEPLAIN]}(?:$|[^\\d])`),C("COERCEFULL",l[p.COERCEPLAIN]+`(?:${l[p.PRERELEASE]})?(?:${l[p.BUILD]})?(?:$|[^\\d])`),C("COERCERTL",l[p.COERCE],!0),C("COERCERTLFULL",l[p.COERCEFULL],!0),C("LONETILDE","(?:~>?)"),C("TILDETRIM",`(\\s*)${l[p.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",C("TILDE",`^${l[p.LONETILDE]}${l[p.XRANGEPLAIN]}$`),C("TILDELOOSE",`^${l[p.LONETILDE]}${l[p.XRANGEPLAINLOOSE]}$`),C("LONECARET","(?:\\^)"),C("CARETTRIM",`(\\s*)${l[p.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",C("CARET",`^${l[p.LONECARET]}${l[p.XRANGEPLAIN]}$`),C("CARETLOOSE",`^${l[p.LONECARET]}${l[p.XRANGEPLAINLOOSE]}$`),C("COMPARATORLOOSE",`^${l[p.GTLT]}\\s*(${l[p.LOOSEPLAIN]})$|^$`),C("COMPARATOR",`^${l[p.GTLT]}\\s*(${l[p.FULLPLAIN]})$|^$`),C("COMPARATORTRIM",`(\\s*)${l[p.GTLT]}\\s*(${l[p.LOOSEPLAIN]}|${l[p.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",C("HYPHENRANGE",`^\\s*(${l[p.XRANGEPLAIN]})\\s+-\\s+(${l[p.XRANGEPLAIN]})\\s*$`),C("HYPHENRANGELOOSE",`^\\s*(${l[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[p.XRANGEPLAINLOOSE]})\\s*$`),C("STAR","(<|>)?=?\\s*\\*"),C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}),Uw=Se((e,t)=>{var r=Object.freeze({loose:!0}),n=Object.freeze({}),i=s=>s?typeof s!="object"?r:s:n;t.exports=i}),qw=Se((e,t)=>
|
|||
|
|
\u591A\u5A92\u4F53:`+mediaURL:""}`,{url:openURL}),ou){let e={};openURL&&(e.openUrl=openURL),mediaURL&&(e.mediaUrl=mediaURL),JSON.stringify(e)==="{}"?$notification.post(title,subtitle,content):$notification.post(title,subtitle,content,e)}if(ys){let content_=content+(openURL?`
|
|||
|
|
\u70B9\u51FB\u8DF3\u8F6C: ${openURL}`:"")+(mediaURL?`
|
|||
|
|
\u591A\u5A92\u4F53: ${mediaURL}`:"");console.log(`${title}
|
|||
|
|
${subtitle}
|
|||
|
|
${content_}
|
|||
|
|
|
|||
|
|
`);let push=eval("process.env.SUB_STORE_PUSH_SERVICE");if(push){let e=push.replace("[\u63A8\u9001\u6807\u9898]",encodeURIComponent(title||"Sub-Store")).replace("[\u63A8\u9001\u5185\u5BB9]",encodeURIComponent([subtitle,content_].map(t=>t).join(`
|
|||
|
|
`)));rs().get({url:e}).then(t=>{console.log(`[Push Service] URL: ${e}
|
|||
|
|
RES: ${t.statusCode} ${t.body}`)}).catch(t=>{console.log(`[Push Service] URL: ${e}
|
|||
|
|
ERROR: ${t}`)})}}Gu&&$Plugins.Notify(title,subtitle+`
|
|||
|
|
`+content)}log(e){this.debug&&console.log(`[${this.name}] LOG: ${e}`)}info(e){console.log(`[${this.name}] INFO: ${e}`)}error(e){console.log(`[${this.name}] ERROR: ${e}`)}wait(e){return new Promise(t=>setTimeout(t,e))}done(e={}){Ku||ou||Vu||Gu?$done(e):ys&&typeof $context<"u"&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}};function Qr(){return{isQX:Ku,isLoon:ou,isSurge:Vu,isNode:ys,isStash:Rm,isShadowRocket:Tm,isEgern:wS,isLanceX:CS,isGUIforCores:Gu}}function rs(defaultOptions={baseURL:""}){let{isQX,isLoon,isSurge,isNode,isGUIforCores}=Qr(),methods=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],URL_REGEX=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;function send(method,options){options=typeof options=="string"?{url:options}:options;let baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options={...defaultOptions,...options};let timeout=options.timeout,events={onRequest:()=>{},onResponse:e=>e,onTimeout:()=>{},...options.events};if(events.onRequest(method,options),options.node&&isSurge){let e=$environment["surge-build"];e&&parseInt(e)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}let worker;isQX?worker=$task.fetch({method,url:options.url,headers:options.headers,body:options.body,opts:options.opts}):isLoon||isSurge||isNode?worker=new Promise(async(resolve,reject)=>{let body=options.body,opts=JSON.parse(JSON.stringify(options));if(opts.body=body,opts.timeout=opts.timeout||8e3,opts.timeout&&(opts.timeout++,isNaN(opts.timeout)&&(opts.timeout=8e3),!isNode)){let e="ms";(isSurge||Rm||Tm)&&(opts.timeout=Math.ceil(opts.timeout/1e3),e="s")}if(isNode){let undici=eI(),{socksDispatcher}=s$(),{ProxyAgent,EnvHttpProxyAgent,request,interceptors}=undici,agentOpts={connect:{rejectUnauthorized:!(opts.strictSSL===!1||opts.insecure===!0)},bodyTimeout:opts.timeout,headersTimeout:opts.timeout};try{let url=new URL(opts.url);(url.username||url.password)&&(opts.headers={...opts.headers||{},Authorization:`Basic ${Buffer.from(`${url.username||""}:${url.password||""}`).toString("base64")}`});let dispatcher;if(!opts.proxy){let allProxy=eval("process.env.all_proxy")||eval("process.env.ALL_PROXY");allProxy&&/^socks5:\/\//.test(allProxy)&&(opts.proxy=allProxy)}opts.proxy?/^socks5:\/\//.test(opts.proxy)?dispatcher=socksDispatcher(yS(opts.proxy),agentOpts):dispatcher=new ProxyAgent({...agentOpts,uri:opts.proxy}):dispatcher=new EnvHttpProxyAgent(agentOpts);let response=await request(opts.url,{...opts,method:method.toUpperCase(),dispatcher:dispatcher.compose(interceptors.redirect({maxRedirections:3,throwOnMaxRedirects:!0}))});resolve({statusCode:response.statusCode,headers:response.headers,body:opts.encoding===null?await response.body.arrayBuffer():await response.body.text()})}catch(e){reject(e)}}else $httpClient[method.toLowerCase()](opts,(e,t,r)=>{e?reject(e):resolve({statusCode:t.status||t.statusCode,headers:t.headers,body:r})})}):isGUIforCores&&(worker=new Promise(async(e,t)=>{try{let r=await $Plugins.Requests({method,url:options.url,headers:options.headers,body:options.body,autoTransformBody:!1,options:{Proxy:options.proxy,Timeout:options.timeout?options.timeout/1e3:15}});e({statusCode:r.status,headers:r.headers,body:r.body})}catch(r){t(r)}}));let timeoutid,timer=timeout?new Promise((e,t)=>{timeoutid=setTimeout(()=>(events.onTimeout(),t(`${method} URL: ${options.url} exceeds the timeout ${timeout} ms`)),timeout)}):null;return(timer?Promise.race([timer,worker]).then(e=>(typeof clearTimeout<"u"&&clearTimeout(timeoutid),e)):worker).then(e=>events.onResponse(e))}let http={};return methods.forEach(e=>http[e.toLowerCase()]=t=>send(e,t)),http}var FS=new df("sub-store"),_=FS,sp="schemaVersion",Mt="settings",zt="subs",Yt="collections",Nt="files",Fn="modules",_t="artifacts",Oc="rules",Mn="tokens",Om="Auto Generated Sub-Store Backup",gf="Sub-Store",$a="Sub-Store Artifacts Repository",Pa="#sub-store-cached-resource",Ra="#sub-store-cached-headers-resource",mf="#sub-
|
|||
|
|
if (input && (input.$files || input.$content)) {
|
|||
|
|
let { $content, $files, $options, $file } = input
|
|||
|
|
if($file.type === 'mihomoProfile') {
|
|||
|
|
${e}
|
|||
|
|
if(typeof main === 'function') {
|
|||
|
|
let config;
|
|||
|
|
if ($content) {
|
|||
|
|
try {
|
|||
|
|
config = ProxyUtils.yaml.safeLoad($content);
|
|||
|
|
} catch (e) {
|
|||
|
|
console.log(e.message ?? e);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$content = ProxyUtils.yaml.safeDump(await main(config || ($file.sourceType === 'none' ? {} : {
|
|||
|
|
proxies: await produceArtifact({
|
|||
|
|
type: $file.sourceType || 'collection',
|
|||
|
|
name: $file.sourceName,
|
|||
|
|
platform: 'mihomo',
|
|||
|
|
produceType: 'internal',
|
|||
|
|
produceOpts: {
|
|||
|
|
'delete-underscore-fields': true
|
|||
|
|
}
|
|||
|
|
}),
|
|||
|
|
})))
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
${e}
|
|||
|
|
}
|
|||
|
|
return { $content, $files, $options, $file }
|
|||
|
|
} else {
|
|||
|
|
let proxies = input
|
|||
|
|
let list = []
|
|||
|
|
for await (let $server of proxies) {
|
|||
|
|
${e}
|
|||
|
|
list.push($server)
|
|||
|
|
}
|
|||
|
|
return list
|
|||
|
|
}
|
|||
|
|
}`,r,i)(s,t,{source:n,...js})}(),o}}}function HB(e){let t,r;try{let n=e.split(":");r=parseInt(n[2],16);let i=parseInt(n[3],16),s=parseInt(n[4],16),o=i>>8,u=i&255,l=s>>8,p=s&255;if(t=`${o}.${u}.${l}.${p}`,r<=0||r>65535)throw new Error(`Invalid port number: ${r}`);if(!Lr(t))throw new Error(`Invalid IP address: ${t}`)}catch(n){_.error(`IP4P \u89E3\u6790\u5931\u8D25: ${n}`)}return{server:t,port:r}}var eA={Custom:async function(e,t,r,n,i,s){let o=Fi(`CUSTOM:${s}:${e}:${t}`),u=Ur.get(o);if(!r&&u)return u;let l=t==="IPv6"?"AAAA":"A",p=await rc({url:s,domain:e,type:l,timeout:n,edns:i}),{answers:f}=p;if(!Array.isArray(f)||f.length===0)throw new Error("No answers");let c=f.filter(m=>m?.type===l).map(m=>m?.data).filter(m=>m);if(c.length===0)throw new Error("No answers");return Ur.set(o,c),c},Google:async function(e,t,r,n,i){let s=Fi(`GOOGLE:${e}:${t}`),o=Ur.get(s);if(!r&&o)return o;let u=t==="IPv6"?"AAAA":"A",l=await rc({url:"https://8.8.4.4/dns-query",domain:e,type:u,timeout:n,edns:i}),{answers:p}=l;if(!Array.isArray(p)||p.length===0)throw new Error("No answers");let f=p.filter(c=>c?.type===u).map(c=>c?.data).filter(c=>c);if(f.length===0)throw new Error("No answers");return Ur.set(s,f),f},"IP-API":async function(e,t,r,n){if(["IPv6"].includes(t))throw new Error(`\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9 IP-API \u4E0D\u652F\u6301 ${t}`);let i=Fi(`IP-API:${e}`),s=Ur.get(i);if(!r&&s)return s;let o=await _.http.get({url:`http://ip-api.com/json/${encodeURIComponent(e)}?lang=zh-CN`,timeout:n}),u=JSON.parse(o.body);if(u.status!=="success")throw new Error(`Status is ${u.status}`);if(!u.query||u.query===0)throw new Error("No answers");let l=[u.query];if(l.length===0)throw new Error("No answers");return Ur.set(i,l),l},Cloudflare:async function(e,t,r,n,i){let s=Fi(`CLOUDFLARE:${e}:${t}`),o=Ur.get(s);if(!r&&o)return o;let u=t==="IPv6"?"AAAA":"A",l=await rc({url:"https://1.0.0.1/dns-query",domain:e,type:u,timeout:n,edns:i}),{answers:p}=l;if(!Array.isArray(p)||p.length===0)throw new Error("No answers");let f=p.filter(c=>c?.type===u).map(c=>c?.data).filter(c=>c);if(f.length===0)throw new Error("No answers");return Ur.set(s,f),f},Ali:async function(e,t,r,n,i){let s=Fi(`ALI:${e}:${t}`),o=Ur.get(s);if(!r&&o)return o;let u=await _.http.get({url:`http://223.6.6.6/resolve?edns_client_subnet=${i}/${Lr(i)?24:56}&name=${encodeURIComponent(e)}&type=${t==="IPv6"?"AAAA":"A"}&short=1`,headers:{accept:"application/dns-json"},timeout:n}),l=JSON.parse(u.body);if(!Array.isArray(l)||l.length===0)throw new Error("No answers");let p=l;if(p.length===0)throw new Error("No answers");return Ur.set(s,p),p},Tencent:async function(e,t,r,n,i){let s=Fi(`TENCENT:${e}:${t}`),o=Ur.get(s);if(!r&&o)return o;let u=(await _.http.get({url:`http://119.28.28.28/d?ip=${i}&type=${t==="IPv6"?"AAAA":"A"}&dn=${encodeURIComponent(e)}`,headers:{accept:"application/dns-json"},timeout:n})).body.split(";").map(p=>p.split(",")[0]);if(u.length===0||String(u)==="0")throw new Error("No answers");let l=u;if(l.length===0)throw new Error("No answers");return Ur.set(s,l),l}};function tA({provider:e,type:t,filter:r,cache:n,url:i,timeout:s,edns:o}){if(["IPv6","IP4P"].includes(t)&&["IP-API"].includes(e))throw new Error(`\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9 ${e} \u4E0D\u652F\u6301 ${t}`);let{defaultTimeout:u}=_.read(Mt),l=s||u||8e3,p=["IPv6","IP4P"].includes(t)?"IPv6":"IPv4",f=eA[e];if(!f)throw new Error(`\u627E\u4E0D\u5230\u57DF\u540D\u89E3\u6790\u670D\u52A1\u63D0\u4F9B\u65B9: ${e}`);let c=o||"223.6.6.6";if(!Xa(c))throw new Error("\u57DF\u540D\u89E3\u6790 EDNS \u5E94\u4E3A IP");return _.info(`Domain Resolver: [${t}] ${e} ${c||""} ${i||""}`),{name:"Resolve Domain Operator",func:async m=>{m.forEach((q,se)=>{!q["_no-resolve"]&&q["no-resolve"]&&(m[se]["_no-resolve"]=q["no-resolve"])});let B={},C=15,F=[...new Set(m.filter(q=>!Xa(q.server)&&!q["_no-resolve"]).map(q=>q.server))],H=Math.ceil(F.length/C);for(let q=0;q<H;q++){let se=[];for(let ce of F.splice(0,C))se.push(f(ce,p,n==="disabled",l,c,i).then(Ce=>{B[ce]=Ce,_.info(`Successfully resolved domain: ${ce}
|
|||
|
|
let proxies = input
|
|||
|
|
let list = []
|
|||
|
|
const fn = async ($server) => {
|
|||
|
|
${e}
|
|||
|
|
}
|
|||
|
|
for await (let $server of proxies) {
|
|||
|
|
list.push(await fn($server))
|
|||
|
|
}
|
|||
|
|
return list
|
|||
|
|
}`,r,i)(s,t,{source:n,...js})}(),o}}}var ph={"Useless Filter":rA,"Region Filter":jB,"Regex Filter":MB,"Type Filter":qB,"Script Filter":KB,"Conditional Filter":RB,"Quick Setting Operator":TB,"Flag Operator":OB,"Sort Operator":xB,"Regex Sort Operator":kB,"Regex Rename Operator":QE,"Regex Delete Operator":LB,"Script Operator":UB,"Handle Duplicate Operator":NB,"Resolve Domain Operator":tA};async function VB(e,t){let r=sh(t.length,!0);try{r=await e.func(t)}catch(n){let i="",s=`${n.message??n}`;s.includes("$server is not defined")?i="":(_.error(`Cannot apply filter ${e.name}(function filter)! Reason: ${n}`),i=`\u6267\u884C function filter \u5931\u8D25 ${s}; `);try{r=await e.nodeFunc(t)}catch(o){_.error(`Cannot apply filter ${e.name}(shortcut script)! Reason: ${o}`);let u="",l=`${o.message??o}`;throw i&&l===s?(u="",i=`\u6267\u884C\u5931\u8D25 ${s}`):u=`\u6267\u884C\u5FEB\u6377\u8FC7\u6EE4\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u8FC7\u6EE4 ${i}${u}`)}}return t.filter((n,i)=>r[i])}async function GB(e,t){let r=YB(t);try{let n=await e.func(r);n&&(r=n)}catch(n){let i="",s=`${n.message??n}`;s.includes("$server is not defined")||s.includes("$content is not defined")||s.includes("$files is not defined")||r?.$files||r?.$content?i="":(_.error(`Cannot apply operator ${e.name}(function operator)! Reason: ${n}`),i=`\u6267\u884C function operator \u5931\u8D25 ${s}; `);try{let o=await e.nodeFunc(r);o&&(r=o)}catch(o){_.error(`Cannot apply operator ${e.name}(shortcut script)! Reason: ${o}`);let u="",l=`${o.message??o}`;throw i&&l===s?(u="",i=`\u6267\u884C\u5931\u8D25 ${s}`):u=`\u6267\u884C\u5FEB\u6377\u811A\u672C \u5931\u8D25 ${l}`,new Error(`\u811A\u672C\u64CD\u4F5C ${i}${u}`)}}return r}async function nA(e,t){if(e.name.indexOf("Filter")!==-1)return VB(e,t);if(e.name.indexOf("Operator")!==-1)return GB(e,t)}function zB(e){let t=e.length,r,n;for(;t!==0;)n=Math.floor(Math.random()*t),t-=1,r=e[t],e[t]=e[n],e[n]=r;return e}function YB(e){return JSON.parse(JSON.stringify(e))}function hh(name,script,$arguments,$options){let flowUtils={getFlowField:To,getFlowHeaders:Bn,parseFlowHeaders:ka,flowTransfer:Hc,validCheck:Bf,getRmainingDays:$f,normalizeFlowHeader:Ju};return _.env.isLoon?new Function("$arguments","$options","$substore","lodash","$persistentStore","$httpClient","$notification","ProxyUtils","yaml","Buffer","b64d","b64e","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
|
|||
|
|
return ${name}`)($arguments,$options,_,wd.default,$persistentStore,$httpClient,$notification,Rt,Rt.yaml,Rt.Buffer,Rt.Base64.decode,Rt.Base64.encode,tl,flowUtils,sn,eval('typeof require !== "undefined"')?Ba:void 0):new Function("$arguments","$options","$substore","lodash","ProxyUtils","yaml","Buffer","b64d","b64e","scriptResourceCache","flowUtils","produceArtifact","require",`${script}
|
|||
|
|
return ${name}`)($arguments,$options,_,wd.default,Rt,Rt.yaml,Rt.Buffer,Rt.Base64.decode,Rt.Base64.encode,tl,flowUtils,sn,eval('typeof require !== "undefined"')?Ba:void 0)}function WB(){return{name:"HTML",test:e=>/^<!DOCTYPE html>/.test(e),parse:()=>""}}function JB(){let e="Base64 Pre-processor",t=["dm1lc3M","c3NyOi8v","c29ja3M6Ly","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c","dmxlc3M=","aHlzdGVyaWEy","aHkyOi8v","d2lyZWd1YXJkOi8v","d2c6Ly8=","dHVpYzovLw=="];return{name:e,test:function(r){return!/^\w+:\/\/\w+/im.test(r)&&t.some(n=>r.indexOf(n)!==-1)},parse:function(r){let n=pt.decode(r);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(n)?n:(_.error("Base64 Pre-processor error: decoded line does not start with protocol"),r)}}}function XB(){return{name:"Fallback Base64 Pre-processor",test:function(e){return!0},parse:function(e){let t=pt.decode(e);return/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(t)?t:(_.error("Fallback Base64 Pre-processor error: decoded line does not start with protocol"),e)}}}function ZB(){return{name:"Clash Pre-processor",test:function(e){if(!/proxies/.test(e))return!1;let t=Qc(e);return t.proxies&&Array.isArray(t.proxies)},parse:function(e,t){let r=e.replace(/short-id:([ \t]*[^#\n,}]*)/g,(s,o)=>{let u=o.trim();return!u||u===""?'short-id: ""':/^(['"]).*\1$/.test(u)?`short-id: ${u}`:["null"].includes(u)?`short-id: ${u}`:`short-id: "${u}"`}),{proxies:n,"global-client-fingerprint":i}=Qc(r);return(t?`proxies:
|
|||
|
|
`:"")+n.map(s=>(i&&!s["client-fingerprint"]&&(s["client-fingerprint"]=i),`${t?" - ":""}${JSON.stringify(s)}
|
|||
|
|
`)).join("")}}}function QB(){return{name:"SSD Pre-processor",test:function(e){return e.indexOf("ssd://")===0},parse:function(e){let t=[],r=JSON.parse(pt.decode(e.split("ssd://")[1])),n=r.port,i=r.encryption,s=r.password,o=r.servers;for(let u=0;u<o.length;u++){let l=o[u];i=l.encryption?l.encryption:i,s=l.password?l.password:s;let p=pt.encode(i+":"+s),f=l.server;n=l.port?l.port:n;let c=l.remarks?l.remarks:u,m=l.plugin_options?"/?plugin="+encodeURIComponent(l.plugin+";"+l.plugin_options):"";t[u]="ss://"+p+"@"+f+":"+n+m+"#"+c}return t.join(`
|
|||
|
|
`)}}}function e9(){return{name:"Full Config Preprocessor",test:function(e){return/^(\[server_local\]|\[Proxy\])/gm.test(e)},parse:function(e){return e.match(/^\[server_local|Proxy\]([\s\S]+?)^\[.+?\](\r?\n|$)/im)?.[1]||e}}}var dh=[WB(),ZB(),JB(),QB(),e9(),XB()],iA=Zr(xc()),mt=class{constructor(e){this.proxy=e,this.output=[]}append(e){if(typeof e>"u")throw new Error("required field is missing");this.output.push(e)}appendIfPresent(e,t){ae(this.proxy,t)&&this.append(e)}toString(){return this.output.join("")}};function ae(e,t){let r=iA.default.get(e,t);return typeof r<"u"&&r!==null}var t9="Surge",Gi={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function nc(){return{produce:(e,t,r={})=>{switch(e.name=e.name.replace(/=|,/g,""),e.ports&&(e.ports=String(e.ports)),e.type){case"ss":return r9(e,r["include-unsupported-proxy"]);case"trojan":return n9(e);case"vmess":return i9(e,r["include-unsupported-proxy"]);case"http":return u9(e);case"direct":return a9(e);case"socks5":return o9(e);case"snell":return c9(e);case"tuic":return l9(e);case"wireguard-surge":return h9(e);case"hysteria2":return p9(e);case"ssh":return s9(e)}if(r["include-unsupported-proxy"]&&e.type==="wireguard")return f9(e);throw new Error(`Platform ${t9} does not support proxy type: ${e.type}`)}}}function r9(e){let t=new mt(e);if(t.append(`${e.name}=${e.type},${e.server},${e.port}`),e.cipher||(e.cipher="none"),!["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","cast5-cfb","des-cfb","idea-cfb","rc2-cfb","seed-cfb","salsa20","chacha20","chacha20-ietf","none","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);t.append(`,encrypt-method=${e.cipher}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=Gi[e["ip-version"]]||e["ip-version"];if(t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),ae(e,"plugin")){if(e.plugin==="obfs")t.append(`,obfs=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else if(!["shadow-tls"].includes(e.plugin))throw new Error(`plugin ${e.plugin} is not supported`)}if(t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,i=e["plugin-opts"].host,s=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),i&&t.append(`,shadow-tls-sni=${i}`),s){if(s<2)throw new Error(`shadow-tls version ${s} is not supported`);t.append(`,shadow-tls-version=${s}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}return t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function n9(e){let t=new mt(e);t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password");let r=Gi[e["ip-ve
|
|||
|
|
# ${e.name}=wireguard`),e["section-name"]=ur(e["section-name"],e.name),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert");let r=Gi[e["ip-version"]]||e["ip-version"];t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.append(`
|
|||
|
|
# > WireGuard Section ${e.name}
|
|||
|
|
[WireGuard ${e["section-name"]}]
|
|||
|
|
private-key = ${e["private-key"]}`),t.appendIfPresent(`
|
|||
|
|
self-ip = ${e.ip}`,"ip"),t.appendIfPresent(`
|
|||
|
|
self-ip-v6 = ${e.ipv6}`,"ipv6"),e.dns&&(Array.isArray(e.dns)&&(e.dns=e.dns.join(", ")),t.append(`
|
|||
|
|
dns-server = ${e.dns}`)),t.appendIfPresent(`
|
|||
|
|
mtu = ${e.mtu}`,"mtu"),r==="prefer-v6"&&t.append(`
|
|||
|
|
prefer-ipv6 = true`);let n=Array.isArray(e["allowed-ips"])?e["allowed-ips"].join(","):e["allowed-ips"],i=Array.isArray(e.reserved)?e.reserved.join("/"):e.reserved,s=e["preshared-key"]??e["pre-shared-key"];s&&(s=`,preshared-key="${s}"`);let o={"public-key":e["public-key"],"allowed-ips":n?`"${n}"`:void 0,endpoint:`${e.server}:${e.port}`,keepalive:e["persistent-keepalive"]||e.keepalive,"client-id":i,"preshared-key":s};return t.append(`
|
|||
|
|
peer = (${Object.keys(o).filter(u=>o[u]!=null).map(u=>`${u} = ${o[u]}`).join(", ")})`),t.toString()}function h9(e){let t=new mt(e);t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert");let r=Gi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.toString()}function p9(e){if(e.obfs||e["obfs-password"])throw new Error("obfs is unsupported");let t=new mt(e);t.append(`${e.name}=hysteria2,${e.server},${e.port}`),t.appendIfPresent(`,password="${e.password}"`,"password"),ae(e,"ports")&&t.append(`,port-hopping="${e.ports.replace(/,/g,";")}"`),t.appendIfPresent(`,port-hopping-interval=${e["hop-interval"]}`,"hop-interval");let r=Gi[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-version=${r}`,"ip-version"),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,server-cert-fingerprint-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,test-timeout=${e["test-timeout"]}`,"test-timeout"),t.appendIfPresent(`,test-udp=${e["test-udp"]}`,"test-udp"),t.appendIfPresent(`,hybrid=${e.hybrid}`,"hybrid"),t.appendIfPresent(`,tos=${e.tos}`,"tos"),t.appendIfPresent(`,allow-other-interface=${e["allow-other-interface"]}`,"allow-other-interface"),t.appendIfPresent(`,interface=${e["interface-name"]}`,"interface-name"),ae(e,"shadow-tls-password")&&(t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni")),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.appendIfPresent(`,underlying-proxy=${e["underlying-proxy"]}`,"underlying-proxy"),t.appendIfPresent(`,download-bandwidth=${`${e.down}`.match(/\d+/)?.[0]||0}`,"down"),t.appendIfPresent(`,ecn=${e.ecn}`,"ecn"),t.toString()}function sA(e,t,r){if(ae(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),ae(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),ae(t,"ws-opts.headers"))){let n=t["ws-opts"].headers,i=Object.keys(n).map(s=>{let o=n[s];return["Host"].includes(s)&&(o=`"${o}"`),`${s}:${o}`}).join("|");_s(i)&&e.append(`,ws-headers=${i}`)}}else if(r&&["http"].includes(t.network))_.info(`Include Unsupported Proxy: nework ${t.network} -> tcp`);else throw new Error(`network ${t.network} is unsupported`)}var d9={dual:"dual","v4-only":"ipv4","v6-only":"ipv6","prefer-v4":"ipv4-prefer","prefer-v6":"ipv6-prefer"};function Ii(){return{type:"ALL",produce:(e,t,r={})=>{let n=e.filter(i=>r["include-unsupported-proxy"]?!0:i.type==="snell"&&i.version>=4||["juicity"].includes(i.type)?!1:!(["ss"].includes(i.type)&&!["aes-128-ctr","aes-192-ctr","aes-256-ctr","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-ccm",
|
|||
|
|
`+n.map(i=>" - "+JSON.stringify(i)+`
|
|||
|
|
`).join("")}}}var uA="SurgeMac",g9=nc();function yd(){return{produce:(e,t,r={})=>{switch(e.type){case"external":return aA(e);default:try{return g9.produce(e,t,r)}catch{if(r.useMihomoExternal)return _.log(`${e.name} is not supported on ${uA}, try to use Mihomo(SurgeMac - External Proxy Program) instead`),m9(e,t,r);throw new Error("Surge for macOS \u53EF\u624B\u52A8\u6307\u5B9A\u94FE\u63A5\u53C2\u6570 target=SurgeMac \u6216\u5728 \u540C\u6B65\u914D\u7F6E \u4E2D\u6307\u5B9A SurgeMac \u6765\u542F\u7528 mihomo \u652F\u63F4 Surge \u672C\u8EAB\u4E0D\u652F\u6301\u7684\u534F\u8BAE")}}}}}function aA(e){let t=new mt(e);if(!e.exec||!e["local-port"])throw new Error(`${e.type}: exec and local-port are required`);return t.append(`${e.name}=external,exec="${e.exec}",local-port=${e["local-port"]}`),Array.isArray(e.args)&&e.args.map(r=>{t.append(`,args="${r}"`)}),Array.isArray(e.addresses)&&e.addresses.map(r=>{t.append(`,addresses=${r}`)}),t.appendIfPresent(`,no-error-alert=${e["no-error-alert"]}`,"no-error-alert"),ae(e,"tfo")?t.append(`,tfo=${e.tfo}`):ae(e,"fast-open")&&t.append(`,tfo=${e["fast-open"]}`),t.appendIfPresent(`,test-url=${e["test-url"]}`,"test-url"),t.appendIfPresent(`,block-quic=${e["block-quic"]}`,"block-quic"),t.toString()}function m9(e,t,r){let n=Ii().produce([e],"internal")?.[0];if(n){let i=r?.localPort||e._localPort||65535,s=!["ipv4","v4-only"].includes(e["ip-version"]),o={name:e.name,type:"external",exec:e._exec||"/usr/local/bin/mihomo","local-port":i,args:["-config",pt.encode(JSON.stringify({"mixed-port":i,ipv6:s,mode:"global",dns:{enable:!0,ipv6:s,"default-nameserver":r?.defaultNameserver||e._defaultNameserver||["180.76.76.76","52.80.52.52","119.28.28.28","223.6.6.6"],nameserver:r?.nameserver||e._nameserver||["https://doh.pub/dns-query","https://dns.alidns.com/dns-query","https://doh-pure.onedns.net/dns-query"]},proxies:[{...n,name:"proxy"}],"proxy-groups":[{name:"GLOBAL",type:"select",proxies:["proxy"]}]}))],addresses:[]};return v9(e.server)?o.addresses.push(e.server):_.log(`Platform ${uA}, proxy type ${e.type}: addresses should be an IP address, but got ${e.server}`),r.localPort=i-1,aA(o)}}function v9(e){return Lr(e)||Rr(e)}function Fd(){return{type:"ALL",produce:(e,t,r={})=>{let n=e.filter(i=>r["include-unsupported-proxy"]?!0:!["ss","ssr","vmess","vless","socks5","http","snell","trojan","wireguard"].includes(i.type)||i.type==="ss"&&!["aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","rc4-md5","chacha20-ietf","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305"].includes(i.cipher)||i.type==="snell"&&i.version>=4||i.type==="vless"&&(typeof i.flow<"u"||i["reality-opts"])?!1:i["underlying-proxy"]||i["dialer-proxy"]?(_.error(`Clash \u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${i.name}`),!1):!0).map(i=>{if(i.type==="vmess"?(ae(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),ae(i,"sni")&&(i.servername=i.sni,delete i.sni),ae(i,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(i.cipher)&&(i.cipher="auto")):i.type==="wireguard"?(i.keepalive=i.keepalive??i["persistent-keepalive"],i["persistent-keepalive"]=i.keepalive,i["preshared-key"]=i["preshared-key"]??i["pre-shared-key"],i["pre-shared-key"]=i["preshared-key"]):i.type==="snell"&&i.version<3?delete i.udp:i.type==="vless"&&ae(i,"sni")&&(i.servername=i.sni,delete i.sni),["vmess","vless"].includes(i.type)&&i.network==="http"){let s=i["http-opts"]?.path;ae(i,"http-opts.path")&&!Array.isArray(s)&&(i["http-opts"].path=[s]);let o=i["http-opts"]?.headers?.Host;ae(i,"http-opts.headers.Host")&&!Array.isArray(o)&&(i["http-opts"].headers.Host=[o])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let s=i["h2-opts"]?.path;ae(i,"h2-opts.path")&&Array.isArray(s)&&(i["h2-opts"].path=s[0]);let o=i["h2-opts"]?.headers?.host;ae(i,"h2-opts.headers.Host")&&!Array.isArray(o)&&(i["h2-opts"].headers.host=[o])}if(i.network==="ws"){let s=i["ws-opts"]?.path,o=/^(.*?)(?:\?ed=(\d+))?$/,[u,l="",p=""]=o.exec(s);i["ws-opts"].path=l,p!==""&&(i["ws-
|
|||
|
|
`+n.map(i=>" - "+JSON.stringify(i)+`
|
|||
|
|
`).join("")}}}function gh(){return{type:"ALL",produce:(e,t,r={})=>{let n=e.filter(i=>!["ss","ssr","vmess","socks5","http","snell","trojan","tuic","vless","wireguard","hysteria","hysteria2","ssh","juicity"].includes(i.type)||i.type==="ss"&&!["aes-128-gcm","aes-192-gcm","aes-256-gcm","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","rc4-md5","chacha20-ietf","xchacha20","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(i.cipher)||i.type==="snell"&&i.version>=4||i.type==="vless"&&i["reality-opts"]&&!["xtls-rprx-vision"].includes(i.flow)?!1:i["underlying-proxy"]||i["dialer-proxy"]?(_.error(`Stash \u6682\u4E0D\u652F\u6301\u524D\u7F6E\u4EE3\u7406\u5B57\u6BB5. \u5DF2\u8FC7\u6EE4\u8282\u70B9 ${i.name}. \u8BF7\u4F7F\u7528 \u4EE3\u7406\u7684\u8F6C\u53D1\u94FE https://stash.wiki/proxy-protocols/proxy-groups#relay`),!1):!0).map(i=>{if(i.type==="vmess"?(ae(i,"aead")&&(i.aead&&(i.alterId=0),delete i.aead),ae(i,"sni")&&(i.servername=i.sni,delete i.sni),ae(i,"cipher")&&!["auto","aes-128-gcm","chacha20-poly1305","none"].includes(i.cipher)&&(i.cipher="auto")):i.type==="tuic"?(ae(i,"alpn")?i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]:i.alpn=["h3"],ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),(!i.token||i.token.length===0)&&!ae(i,"version")&&(i.version=5)):i.type==="hysteria"?(ae(i,"auth_str")&&!ae(i,"auth-str")&&(i["auth-str"]=i.auth_str),ae(i,"alpn")&&(i.alpn=Array.isArray(i.alpn)?i.alpn:[i.alpn]),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),ae(i,"down")&&!ae(i,"down-speed")&&(i["down-speed"]=i.down,delete i.down),ae(i,"up")&&!ae(i,"up-speed")&&(i["up-speed"]=i.up,delete i.up),ae(i,"down-speed")&&(i["down-speed"]=`${i["down-speed"]}`.match(/\d+/)?.[0]||0),ae(i,"up-speed")&&(i["up-speed"]=`${i["up-speed"]}`.match(/\d+/)?.[0]||0)):i.type==="hysteria2"?(ae(i,"password")&&!ae(i,"auth")&&(i.auth=i.password,delete i.password),ae(i,"tfo")&&!ae(i,"fast-open")&&(i["fast-open"]=i.tfo,delete i.tfo),ae(i,"down")&&!ae(i,"down-speed")&&(i["down-speed"]=i.down,delete i.down),ae(i,"up")&&!ae(i,"up-speed")&&(i["up-speed"]=i.up,delete i.up),ae(i,"down-speed")&&(i["down-speed"]=`${i["down-speed"]}`.match(/\d+/)?.[0]||0),ae(i,"up-speed")&&(i["up-speed"]=`${i["up-speed"]}`.match(/\d+/)?.[0]||0)):i.type==="wireguard"?(i.keepalive=i.keepalive??i["persistent-keepalive"],i["persistent-keepalive"]=i.keepalive,i["preshared-key"]=i["preshared-key"]??i["pre-shared-key"],i["pre-shared-key"]=i["preshared-key"]):i.type==="snell"&&i.version<3?delete i.udp:i.type==="vless"&&ae(i,"sni")&&(i.servername=i.sni,delete i.sni),["vmess","vless"].includes(i.type)&&i.network==="http"){let s=i["http-opts"]?.path;ae(i,"http-opts.path")&&!Array.isArray(s)&&(i["http-opts"].path=[s]);let o=i["http-opts"]?.headers?.Host;ae(i,"http-opts.headers.Host")&&!Array.isArray(o)&&(i["http-opts"].headers.Host=[o])}if(["vmess","vless"].includes(i.type)&&i.network==="h2"){let s=i["h2-opts"]?.path;ae(i,"h2-opts.path")&&Array.isArray(s)&&(i["h2-opts"].path=s[0]);let o=i["h2-opts"]?.headers?.host;ae(i,"h2-opts.headers.Host")&&!Array.isArray(o)&&(i["h2-opts"].headers.host=[o])}if(i.network==="ws"){let s=i["ws-opts"]?.path,o=/^(.*?)(?:\?ed=(\d+))?$/,[u,l="",p=""]=o.exec(s);i["ws-opts"].path=l,p!==""&&(i["ws-opts"]["early-data-header-name"]="Sec-WebSocket-Protocol",i["ws-opts"]["max-early-data"]=parseInt(p,10))}if(i["plugin-opts"]?.tls&&ae(i,"skip-cert-verify")&&(i["plugin-opts"]["skip-cert-verify"]=i["skip-cert-verify"]),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(i.type)&&delete i.tls,i["tls-fingerprint"]&&(i["server-cert-fingerprint"]=i["tls-fingerprint"]),delete i["tls-fingerprint"],ae(i,"tls")&&typeof i.tls!="boolean"&&delete i.tls,i["test-url"]&&(i["benchmark-url"]=i["test-url"],delete i["test-url"]),i["test-timeout"]&&(i["benchmark-timeout"]=i["test-timeout"],delete i["test-timeout"]),delete i.subName,delete i.collectionName,delete i.id,delete i.resolved,delete i["no-resolve"],t!=="internal")for(let s in i)(i[s]==null||/^_/i.test(s
|
|||
|
|
`+n.map(i=>" - "+JSON.stringify(i)+`
|
|||
|
|
`).join("")}}}var E9="Loon",bu={dual:"dual",ipv4:"v4-only",ipv6:"v6-only","ipv4-prefer":"prefer-v4","ipv6-prefer":"prefer-v6"};function Dd(){return{produce:(e,t,r={})=>{switch(e.type){case"ss":return A9(e);case"ssr":return w9(e);case"trojan":return C9(e);case"vmess":return y9(e,r["include-unsupported-proxy"]);case"vless":return F9(e,r["include-unsupported-proxy"]);case"http":return D9(e);case"socks5":return S9(e);case"wireguard":return b9(e);case"hysteria2":return _9(e)}throw new Error(`Platform ${E9} does not support proxy type: ${e.type}`)}}}function A9(e){let t=new mt(e);if(!["rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","salsa20","chacha20","chacha20-ietf","aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(t.append(`${e.name}=shadowsocks,${e.server},${e.port},${e.cipher},"${e.password}"`),ae(e,"plugin")){if(e.plugin==="obfs")t.append(`,obfs-name=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else if(!["shadow-tls"].includes(e.plugin))throw new Error(`plugin ${e.plugin} is not supported`)}if(ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,i=e["plugin-opts"].host,s=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),i&&t.append(`,shadow-tls-sni=${i}`),s){if(s<2)throw new Error(`shadow-tls version ${s} is not supported`);t.append(`,shadow-tls-version=${s}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true");let r=bu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function w9(e){let t=new mt(e);if(t.append(`${e.name}=shadowsocksr,${e.server},${e.port},${e.cipher},"${e.password}"`),t.append(`,protocol=${e.protocol}`),t.appendIfPresent(`,protocol-param=${e["protocol-param"]}`,"protocol-param"),t.appendIfPresent(`,obfs=${e.obfs}`,"obfs"),t.appendIfPresent(`,obfs-param=${e["obfs-param"]}`,"obfs-param"),ae(e,"shadow-tls-password"))t.append(`,shadow-tls-password=${e["shadow-tls-password"]}`),t.appendIfPresent(`,shadow-tls-version=${e["shadow-tls-version"]}`,"shadow-tls-version"),t.appendIfPresent(`,shadow-tls-sni=${e["shadow-tls-sni"]}`,"shadow-tls-sni"),t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port");else if(["shadow-tls"].includes(e.plugin)&&e["plugin-opts"]){let n=e["plugin-opts"].password,i=e["plugin-opts"].host,s=e["plugin-opts"].version;if(n){if(t.append(`,shadow-tls-password=${n}`),i&&t.append(`,shadow-tls-sni=${i}`),s){if(s<2)throw new Error(`shadow-tls version ${s} is not supported`);t.append(`,shadow-tls-version=${s}`)}t.appendIfPresent(`,udp-port=${e["udp-port"]}`,"udp-port")}}t.appendIfPresent(`,fast-open=${e.tfo}`,"tfo"),e["block-quic"]==="on"?t.append(",block-quic=true"):e["block-quic"]==="off"&&t.append(",block-quic=false"),e.udp&&t.append(",udp=true");let r=bu[e["ip-version"]]||e["ip-version"];return t.appendIfPresent(`,ip-mode=${r}`,"ip-version"),t.toString()}function C9(e){let t=new mt(e);if(t.append(`${e.name}=trojan,${e.server},${e.port},"${e.password}"`),e.network==="tcp"&&delete e.network,ae(e,"network"))if(e.network==="ws")t.append(",transport=ws"),t.appendIfPresent(`,path=${e["ws-opts"]?.path}`,"ws-opts.path"),t.appendIfPresent(`,host=${e["ws-opts"]?.headers?.Host
|
|||
|
|
Reason: ${n}`)}}),pt.encode(t.join(`
|
|||
|
|
`))}}}var B9="QX";function ul(){return{produce:(e,t,r={})=>{switch(e.type){case"ss":return $9(e);case"ssr":return P9(e);case"trojan":return R9(e);case"vmess":return T9(e);case"http":return N9(e);case"socks5":return x9(e);case"vless":return O9(e)}throw new Error(`Platform ${B9} does not support proxy type: ${e.type}`)}}}function $9(e){let t=new mt(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(e.cipher||(e.cipher="none"),!["none","rc4-md5","rc4-md5-6","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","cast5-cfb","des-cfb","rc2-cfb","salsa20","chacha20","chacha20-ietf","aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(r(`shadowsocks=${e.server}:${e.port}`),r(`,method=${e.cipher}`),r(`,password=${e.password}`),Bi(e)&&(e.tls=!0),ae(e,"plugin")){if(e.plugin==="obfs"){let i=e["plugin-opts"];r(`,obfs=${i.mode}`)}else if(e.plugin==="v2ray-plugin"&&e["plugin-opts"].mode==="websocket")e["plugin-opts"].tls?r(",obfs=wss"):r(",obfs=ws");else throw new Error("plugin is not supported");n(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),n(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path")}return Bi(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),e._ssr_python_uot?r(",udp-over-tcp=true"):e["udp-over-tcp"]&&(!e["udp-over-tcp-version"]||e["udp-over-tcp-version"]===1?r(",udp-over-tcp=sp.v1"):e["udp-over-tcp-version"]===2&&r(",udp-over-tcp=sp.v2")),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function P9(e){let t=new mt(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);return r(`shadowsocks=${e.server}:${e.port}`),r(`,method=${e.cipher}`),r(`,password=${e.password}`),r(`,ssr-protocol=${e.protocol}`),n(`,ssr-protocol-param=${e["protocol-param"]}`,"protocol-param"),n(`,obfs=${e.obfs}`,"obfs"),n(`,obfs-host=${e["obfs-param"]}`,"obfs-param"),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function R9(e){let t=new mt(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);if(r(`trojan=${e.server}:${e.port}`),r(`,password=${e.password}`),ae(e,"network"))if(e.network==="ws")Bi(e)?r(",obfs=wss"):r(",obfs=ws"),n(`,obfs-uri=${e["ws-opts"]?.path}`,"ws-opts.path"),n(`,obfs-host=${e["ws-opts"]?.headers?.Host}`,"ws-opts.headers.Host");else throw new Error(`network ${e.network} is unsupported`);return e.network!=="ws"&&Bi(e)&&r(",over-tls=true"),Bi(e)&&(n(`,tls-pubkey-sha256=${e["tls-pubkey-sha256"]}`,"tls-pubkey-sha256"),n(`,tls-alpn=${e["tls-alpn"]}`,"tls-alpn"),n(`,tls-no-session-ticket=${e["tls-no-session-ticket"]}`,"tls-no-session-ticket"),n(`,tls-no-session-reuse=${e["tls-no-session-reuse"]}`,"tls-no-session-reuse"),n(`,tls-cert-sha256=${e["tls-fingerprint"]}`,"tls-fingerprint"),n(`,tls-verification=${!e["skip-cert-verify"]}`,"skip-cert-verify"),n(`,tls-host=${e.sni}`,"sni")),n(`,fast-open=${e.tfo}`,"tfo"),n(`,udp-relay=${e.udp}`,"udp"),t.appendIfPresent(`,server_check_url=${e["test-url"]}`,"test-url"),r(`,tag=${e.name}`),t.toString()}function T9(e){let t=new mt(e),r=t.append.bind(t),n=t.appendIfPresent.bind(t);r(`vmess=${e.server}:${e.port}`);let i;if(e.cipher==="auto"?i="chacha20-ietf-poly1305":i=e.cipher,r(`,method=${i}`),r(`,password=${e.uuid}`),Bi(e)&&(e.tls=!0),ae(e,"network")){if(e.network==="ws")e.tls?r(",obfs=wss"):r(",obfs=ws");else if(e.network==="http")r(",obfs=http");else throw new Error(`network
|
|||
|
|
`+n.map(i=>" - "+JSON.stringify(i)+`
|
|||
|
|
`).join("")}}}var k9="Surfboard";function mh(){return{produce:e=>{switch(e.name=e.name.replace(/=|,/g,""),e.type){case"ss":return L9(e);case"trojan":return U9(e);case"vmess":return H9(e);case"http":return j9(e);case"socks5":return M9(e);case"wireguard-surge":return q9(e)}throw new Error(`Platform ${k9} does not support proxy type: ${e.type}`)}}}function L9(e){let t=new mt(e);if(t.append(`${e.name}=${e.type},${e.server},${e.port}`),!["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","xchacha20-ietf-poly1305","rc4","rc4-md5","aes-128-cfb","aes-192-cfb","aes-256-cfb","aes-128-ctr","aes-192-ctr","aes-256-ctr","bf-cfb","camellia-128-cfb","camellia-192-cfb","camellia-256-cfb","salsa20","chacha20","chacha20-ietf"].includes(e.cipher))throw new Error(`cipher ${e.cipher} is not supported`);if(t.append(`,encrypt-method=${e.cipher}`),t.appendIfPresent(`,password=${e.password}`,"password"),ae(e,"plugin"))if(e.plugin==="obfs")t.append(`,obfs=${e["plugin-opts"].mode}`),t.appendIfPresent(`,obfs-host=${e["plugin-opts"].host}`,"plugin-opts.host"),t.appendIfPresent(`,obfs-uri=${e["plugin-opts"].path}`,"plugin-opts.path");else throw new Error(`plugin ${e.plugin} is not supported`);return t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function U9(e){let t=new mt(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,password=${e.password}`,"password"),oA(t,e),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,tfo=${e.tfo}`,"tfo"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function H9(e){let t=new mt(e);return t.append(`${e.name}=${e.type},${e.server},${e.port}`),t.appendIfPresent(`,username=${e.uuid}`,"uuid"),oA(t,e),ae(e,"aead")?t.append(`,vmess-aead=${e.aead}`):t.append(`,vmess-aead=${e.alterId===0}`),t.appendIfPresent(`,tls=${e.tls}`,"tls"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function j9(e){let t=new mt(e),r=e.tls?"https":"http";return t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,${e.password}`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function M9(e){let t=new mt(e),r=e.tls?"socks5-tls":"socks5";return t.append(`${e.name}=${r},${e.server},${e.port}`),t.appendIfPresent(`,${e.username}`,"username"),t.appendIfPresent(`,${e.password}`,"password"),t.appendIfPresent(`,sni=${e.sni}`,"sni"),t.appendIfPresent(`,skip-cert-verify=${e["skip-cert-verify"]}`,"skip-cert-verify"),t.appendIfPresent(`,udp-relay=${e.udp}`,"udp"),t.toString()}function q9(e){let t=new mt(e);return t.append(`${e.name}=wireguard`),t.appendIfPresent(`,section-name=${e["section-name"]}`,"section-name"),t.toString()}function oA(e,t){if(ae(t,"network"))if(t.network==="ws"){if(e.append(",ws=true"),ae(t,"ws-opts")&&(e.appendIfPresent(`,ws-path=${t["ws-opts"].path}`,"ws-opts.path"),ae(t,"ws-opts.headers"))){let r=t["ws-opts"].headers,n=Object.keys(r).map(i=>{let s=r[i];return["Host"].includes(i)&&(s=`"${s}"`),`${i}:${s}`}).join("|");_s(n)&&e.append(`,ws-headers=${n}`)}}else throw new Error(`network ${t.network} is unsupported`)}var K9={ipv4:"ipv4_only",ipv6:"ipv6_only","v4-only":"ipv4_only","v6-only":"ipv6_only","ipv4-prefer":"prefer_ipv4","ipv6-prefer":"prefer_ipv6","prefer-v4":"prefer_ipv4","prefer-v6":"prefer_ipv6"},fi=(e,t)=>{let r=K9[e["ip-version"]];e._dns_server&&r&&(t.domain_resolver={server:e._dns_server,strategy:r})},hi=(e,t)=>{t.detour=e["dialer-proxy"]||e.detour},_u=(e,t)=>{["tcp","udp"].includes(e._network)&&(t.network=e._network)},$i=(e,t)=>{t.tcp_fast_open=!1,e.tfo&&(t.tcp_fast_open=!0),e.tcp_fast_open&&(t.tcp_fast_open=!0),e["tcp-fast-open"]&&(t.tcp_fast_open=!0),t.tcp_fast_open||delete t.tcp_fas
|
|||
|
|
`)){let[f,c]=p.split(":");c.trim()!==""&&(u[f.trim()]=c.trim().split(","))}r.headers=u}}if(e["ws-headers"]){let n={};for(let s of Object.keys(e["ws-headers"])){let o=e["ws-headers"][s];o!==""&&(Array.isArray(o)||(o=[`${o}`]),o.length>0&&(n[s]=o))}let{Host:i}=n;if(i.length===1)for(let s of`Host:${i[0]}`.split(`
|
|||
|
|
`)){let[o,u]=s.split(":");u.trim()!==""&&(n[o.trim()]=u.trim().split(","))}for(let s of Object.keys(n))r.headers[s]=n[s]}if(e["ws-path"]&&e["ws-path"]!==""&&(r.path=`${e["ws-path"]}`),r.path){let n=/^(.*?)(?:\?ed=(\d+))?$/,[i,s="",o=""]=n.exec(r.path);r.path=s,o!==""&&(r.early_data_header_name="Sec-WebSocket-Protocol",r.max_early_data=parseInt(o,10))}t.tls.insecure&&(t.tls.server_name=r.headers.Host[0]),e["ws-opts"]&&e["ws-opts"]["v2ray-http-upgrade"]&&(r.type="httpupgrade",r.headers.Host&&(r.host=r.headers.Host[0],delete r.headers.Host),r.max_early_data&&delete r.max_early_data,r.early_data_header_name&&delete r.early_data_header_name);for(let n of Object.keys(r.headers)){let i=r.headers[n];i.length===1&&(r.headers[n]=i[0])}t.transport=r},cA=(e,t)=>{let r={type:"http",headers:{}};if(e["http-opts"]){let{method:n="",path:i="",headers:s={}}=e["http-opts"];n!==""&&(r.method=n),Array.isArray(i)?r.path=`${i[0]}`:i!==""&&(r.path=`${i}`);for(let o of Object.keys(s)){let u=s[o];if(u!==""){if(o.toLowerCase()==="host"){let l=u;Array.isArray(l)||(l=`${l}`.split(",").map(p=>p.trim())),l.length>0&&(r.host=l);continue}Array.isArray(u)||(u=`${u}`.split(",").map(l=>l.trim())),u.length>0&&(r.headers[o]=u)}}}if(e["http-host"]&&e["http-host"]!==""){let n=e["http-host"];Array.isArray(n)||(n=`${n}`.split(",").map(i=>i.trim())),n.length>0&&(r.host=n)}if(e["http-path"]&&e["http-path"]!==""){let n=e["http-path"];Array.isArray(n)?r.path=`${n[0]}`:n!==""&&(r.path=`${n}`)}t.tls.insecure&&(t.tls.server_name=r.host[0]),r.host?.length===1&&(r.host=r.host[0]);for(let n of Object.keys(r.headers)){let i=r.headers[n];i.length===1&&(r.headers[n]=i[0])}t.transport=r},lA=(e,t)=>{let r={type:"http"};if(e["h2-opts"]){let{host:n="",path:i=""}=e["h2-opts"];i!==""&&(r.path=`${i}`),n!==""&&(Array.isArray(n)||(n=`${n}`.split(",").map(s=>s.trim())),n.length>0&&(r.host=n))}if(e["h2-host"]&&e["h2-host"]!==""){let n=e["h2-host"];Array.isArray(n)||(n=`${n}`.split(",").map(i=>i.trim())),n.length>0&&(r.host=n)}e["h2-path"]&&e["h2-path"]!==""&&(r.path=`${e["h2-path"]}`),t.tls.enabled=!0,t.tls.insecure&&(t.tls.server_name=r.host[0]),r.host.length===1&&(r.host=r.host[0]),t.transport=r},bd=(e,t)=>{let r={type:"grpc"};if(e["grpc-opts"]){let n=e["grpc-opts"]["grpc-service-name"];n!=null&&n!==""&&(r.service_name=`${n}`)}t.transport=r},na=(e,t)=>{e.tls&&(t.tls.enabled=!0),e.servername&&e.servername!==""&&(t.tls.server_name=e.servername),e.peer&&e.peer!==""&&(t.tls.server_name=e.peer),e.sni&&e.sni!==""&&(t.tls.server_name=e.sni),e["skip-cert-verify"]&&(t.tls.insecure=!0),e.insecure&&(t.tls.insecure=!0),e["disable-sni"]&&(t.tls.disable_sni=!0),typeof e.alpn=="string"?t.tls.alpn=[e.alpn]:Array.isArray(e.alpn)&&(t.tls.alpn=e.alpn),e.ca&&(t.tls.certificate_path=`${e.ca}`),e.ca_str&&(t.tls.certificate=[e.ca_str]),e["ca-str"]&&(t.tls.certificate=[e["ca-str"]]),e["reality-opts"]&&(t.tls.reality={enabled:!0},e["reality-opts"]["public-key"]&&(t.tls.reality.public_key=e["reality-opts"]["public-key"]),e["reality-opts"]["short-id"]&&(t.tls.reality.short_id=e["reality-opts"]["short-id"]),t.tls.utls={enabled:!0}),!["hysteria","hysteria2","tuic"].includes(e.type)&&e["client-fingerprint"]&&e["client-fingerprint"]!==""&&(t.tls.utls={enabled:!0,fingerprint:e["client-fingerprint"]}),t.tls.enabled||delete t.tls},V9=(e={})=>{let t={tag:e.name,type:"ssh",server:e.server,server_port:parseInt(`${e.port}`,10)};if(t.server_port<0||t.server_port>65535)throw"invalid port";return e.username&&(t.user=e.username),e.password&&(t.password=e.password),e.privateKey&&(t.private_key_path=e.privateKey),e["private-key"]&&(t.private_key_path=e["private-key"]),e["private-key-passphrase"]&&(t.private_key_passphrase=e["private-key-passphrase"]),e["server-fingerprint"]&&(t.host_key=[e["server-fingerprint"]],t.host_key_algorithms=[e["server-fingerprint"].split(" ")[0]]),e["host-key"]&&(t.host_key=e["host-key"]),e["host-key-algorithms"]&&(t.host_key_algorithms=e["host-key-algorithms"]),e["fast-open"]&&(t.udp_fragment=!0),$i(e,t),hi(e,t),fi(e,t),t},G9=(e={})=>{let t={tag:e.name,type:"http",server:e.server,server_port:parseIn
|
|||
|
|
`+r.map(n=>" - "+JSON.stringify(n)+`
|
|||
|
|
`).join("")}}}function fA(){return{type:"ALL",produce:(e,t)=>t==="internal"?e:JSON.stringify(e,null,2)}}var Ah={qx:ul(),QX:ul(),QuantumultX:ul(),surge:nc(),Surge:nc(),SurgeMac:yd(),Loon:Dd(),Clash:Fd(),meta:Ii(),clashmeta:Ii(),"clash.meta":Ii(),"Clash.Meta":Ii(),ClashMeta:Ii(),mihomo:Ii(),Mihomo:Ii(),uri:ic(),URI:ic(),v2:sl(),v2ray:sl(),V2Ray:sl(),json:fA(),JSON:fA(),stash:gh(),Stash:gh(),shadowrocket:al(),Shadowrocket:al(),ShadowRocket:al(),surfboard:mh(),Surfboard:mh(),singbox:vh(),"sing-box":vh(),egern:Eh(),Egern:Eh()},vw=Zr(dl()),p7=String.raw`
|
|||
|
|
// global initializer
|
|||
|
|
{{
|
|||
|
|
function $set(obj, path, value) {
|
|||
|
|
if (Object(obj) !== obj) return obj;
|
|||
|
|
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
|
|||
|
|
path
|
|||
|
|
.slice(0, -1)
|
|||
|
|
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
|||
|
|
path[path.length - 1]
|
|||
|
|
] = value;
|
|||
|
|
return obj;
|
|||
|
|
}
|
|||
|
|
}}
|
|||
|
|
|
|||
|
|
// per-parser initializer
|
|||
|
|
{
|
|||
|
|
const proxy = {};
|
|||
|
|
const obfs = {};
|
|||
|
|
const $ = {};
|
|||
|
|
|
|||
|
|
function handleWebsocket() {
|
|||
|
|
if (obfs.type === "ws") {
|
|||
|
|
proxy.network = "ws";
|
|||
|
|
$set(proxy, "ws-opts.path", obfs.path);
|
|||
|
|
$set(proxy, "ws-opts.headers", obfs['ws-headers']);
|
|||
|
|
if (proxy['ws-opts'] && proxy['ws-opts']['headers'] && proxy['ws-opts']['headers'].Host) {
|
|||
|
|
proxy['ws-opts']['headers'].Host = proxy['ws-opts']['headers'].Host.replace(/^"(.*)"$/, '$1')
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
function handleShadowTLS() {
|
|||
|
|
if (proxy['shadow-tls-password'] && !proxy['shadow-tls-version']) {
|
|||
|
|
proxy['shadow-tls-version'] = 2;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
start = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls/tuic/tuic_v5/wireguard/hysteria2/ssh/direct) {
|
|||
|
|
return proxy;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/udp_port/others)* {
|
|||
|
|
proxy.type = "ss";
|
|||
|
|
// handle obfs
|
|||
|
|
if (obfs.type == "http" || obfs.type === "tls") {
|
|||
|
|
proxy.plugin = "obfs";
|
|||
|
|
$set(proxy, "plugin-opts.mode", obfs.type);
|
|||
|
|
$set(proxy, "plugin-opts.host", obfs.host);
|
|||
|
|
$set(proxy, "plugin-opts.path", obfs.path);
|
|||
|
|
}
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "vmess";
|
|||
|
|
proxy.cipher = proxy.cipher || "none";
|
|||
|
|
// Surfboard 与 Surge 默认不一致, 不管 Surfboard https://getsurfboard.com/docs/profile-format/proxy/external-proxy/vmess
|
|||
|
|
if (proxy.aead) {
|
|||
|
|
proxy.alterId = 0;
|
|||
|
|
} else {
|
|||
|
|
proxy.alterId = 1;
|
|||
|
|
}
|
|||
|
|
handleWebsocket();
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
trojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "trojan";
|
|||
|
|
handleWebsocket();
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
https = tag equals "https" address (username password)? (usernamek passwordk)? (sni/tls_fingerprint/tls_verification/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "http";
|
|||
|
|
proxy.tls = true;
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
http = tag equals "http" address (username password)? (usernamek passwordk)? (ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "http";
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
ssh = tag equals "ssh" address (username password)? (usernamek passwordk)? (server_fingerprint/idle_timeout/private_key/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "ssh";
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
snell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/udp_relay/reuse/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "snell";
|
|||
|
|
// handle obfs
|
|||
|
|
if (obfs.type == "http" || obfs.type === "tls") {
|
|||
|
|
$set(proxy, "obfs-opts.mode", obfs.type);
|
|||
|
|
$set(proxy, "obfs-opts.host", obfs.host);
|
|||
|
|
$set(proxy, "obfs-opts.path", obfs.path);
|
|||
|
|
}
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
tuic = tag equals "tuic" address (alpn/token/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
|
|||
|
|
proxy.type = "tuic";
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
tuic_v5 = tag equals "tuic-v5" address (alpn/passwordk/uuidk/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
|
|||
|
|
proxy.type = "tuic";
|
|||
|
|
proxy.version = 5;
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
wireguard = tag equals "wireguard" (section_name/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "wireguard-surge";
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
|
|||
|
|
proxy.type = "hysteria2";
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "socks5";
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_fingerprint/tls_verification/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
|
|||
|
|
proxy.type = "socks5";
|
|||
|
|
proxy.tls = true;
|
|||
|
|
handleShadowTLS();
|
|||
|
|
}
|
|||
|
|
direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {
|
|||
|
|
proxy.type = "direct";
|
|||
|
|
}
|
|||
|
|
address = comma server:server comma port:port {
|
|||
|
|
proxy.server = server;
|
|||
|
|
proxy.port = port;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
server = ip/domain
|
|||
|
|
|
|||
|
|
ip = & {
|
|||
|
|
const start = peg$currPos;
|
|||
|
|
let j = start;
|
|||
|
|
while (j < input.length) {
|
|||
|
|
if (input[j] === ",") break;
|
|||
|
|
j++;
|
|||
|
|
}
|
|||
|
|
peg$currPos = j;
|
|||
|
|
$.ip = input.substring(start, j).trim();
|
|||
|
|
return true;
|
|||
|
|
} { return $.ip; }
|
|||
|
|
|
|||
|
|
domain = match:[0-9a-zA-z-_.]+ {
|
|||
|
|
const domain = match.join("");
|
|||
|
|
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
|
|||
|
|
return domain;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
port = digits:[0-9]+ {
|
|||
|
|
const port = parseInt(digits.join(""), 10);
|
|||
|
|
if (port >= 0 && port <= 65535) {
|
|||
|
|
return port;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
port_hopping_interval = comma "port-hopping-interval" equals match:$[0-9]+ { proxy["hop-interval"] = parseInt(match.trim()); }
|
|||
|
|
|
|||
|
|
username = & {
|
|||
|
|
let j = peg$currPos;
|
|||
|
|
let start, end;
|
|||
|
|
let first = true;
|
|||
|
|
while (j < input.length) {
|
|||
|
|
if (input[j] === ',') {
|
|||
|
|
if (first) {
|
|||
|
|
start = j + 1;
|
|||
|
|
first = false;
|
|||
|
|
} else {
|
|||
|
|
end = j;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
j++;
|
|||
|
|
}
|
|||
|
|
const match = input.substring(start, end);
|
|||
|
|
if (match.indexOf("=") === -1) {
|
|||
|
|
$.username = match;
|
|||
|
|
peg$currPos = end;
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
} { proxy.username = $.username.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
|||
|
|
password = comma match:[^,]+ { proxy.password = match.join("").replace(/^"(.*)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
|||
|
|
|
|||
|
|
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
|
|||
|
|
sni = comma "sni" equals sni:("off"/domain) {
|
|||
|
|
if (sni === "off") {
|
|||
|
|
proxy["disable-sni"] = true;
|
|||
|
|
} else {
|
|||
|
|
proxy.sni = sni;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
|
|||
|
|
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
|
|||
|
|
|
|||
|
|
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
|
|||
|
|
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
|
|||
|
|
|
|||
|
|
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
|||
|
|
passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
|||
|
|
vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }
|
|||
|
|
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
|
|||
|
|
|
|||
|
|
method = comma "encrypt-method" equals cipher:cipher {
|
|||
|
|
proxy.cipher = cipher;
|
|||
|
|
}
|
|||
|
|
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"idea-cfb"/"none"/"rc2-cfb"/"rc4-md5"/"rc4"/"salsa20"/"seed-cfb"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
|
|||
|
|
|
|||
|
|
ws = comma "ws" equals flag:bool { obfs.type = "ws"; }
|
|||
|
|
ws_headers = comma "ws-headers" equals headers:$[^,]+ {
|
|||
|
|
const pairs = headers.split("|");
|
|||
|
|
const result = {};
|
|||
|
|
pairs.forEach(pair => {
|
|||
|
|
const [key, value] = pair.trim().split(":");
|
|||
|
|
result[key.trim()] = value.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1');
|
|||
|
|
})
|
|||
|
|
obfs["ws-headers"] = result;
|
|||
|
|
}
|
|||
|
|
ws_path = comma "ws-path" equals path:uri { obfs.path = path.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
|||
|
|
|
|||
|
|
obfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }
|
|||
|
|
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };
|
|||
|
|
obfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }
|
|||
|
|
uri = $[^,]+
|
|||
|
|
|
|||
|
|
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
|
|||
|
|
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
|
|||
|
|
reuse = comma "reuse" equals flag:bool { proxy.reuse = flag; }
|
|||
|
|
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
|
|||
|
|
tfo = comma "tfo" equals flag:bool { proxy.tfo = flag; }
|
|||
|
|
ip_version = comma "ip-version" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
|
|||
|
|
section_name = comma "section-name" equals match:[^,]+ { proxy["section-name"] = match.join(""); }
|
|||
|
|
no_error_alert = comma "no-error-alert" equals match:[^,]+ { proxy["no-error-alert"] = match.join(""); }
|
|||
|
|
underlying_proxy = comma "underlying-proxy" equals match:[^,]+ { proxy["underlying-proxy"] = match.join(""); }
|
|||
|
|
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
|
|||
|
|
test_url = comma "test-url" equals match:[^,]+ { proxy["test-url"] = match.join(""); }
|
|||
|
|
test_udp = comma "test-udp" equals match:[^,]+ { proxy["test-udp"] = match.join(""); }
|
|||
|
|
test_timeout = comma "test-timeout" equals match:$[0-9]+ { proxy["test-timeout"] = parseInt(match.trim()); }
|
|||
|
|
tos = comma "tos" equals match:$[0-9]+ { proxy.tos = parseInt(match.trim()); }
|
|||
|
|
interface = comma "interface" equals match:[^,]+ { proxy.interface = match.join(""); }
|
|||
|
|
allow_other_interface = comma "allow-other-interface" equals flag:bool { proxy["allow-other-interface"] = flag; }
|
|||
|
|
hybrid = comma "hybrid" equals flag:bool { proxy.hybrid = flag; }
|
|||
|
|
idle_timeout = comma "idle-timeout" equals match:$[0-9]+ { proxy["idle-timeout"] = parseInt(match.trim()); }
|
|||
|
|
private_key = comma "private-key" equals match:[^,]+ { proxy["keystore-private-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
server_fingerprint = comma "server-fingerprint" equals match:[^,]+ { proxy["server-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
block_quic = comma "block-quic" equals match:[^,]+ { proxy["block-quic"] = match.join(""); }
|
|||
|
|
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
|
|||
|
|
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
|
|||
|
|
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
|
|||
|
|
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
|
|||
|
|
token = comma "token" equals match:[^,]+ { proxy.token = match.join(""); }
|
|||
|
|
alpn = comma "alpn" equals match:[^,]+ { proxy.alpn = match.join(""); }
|
|||
|
|
uuidk = comma "uuid" equals match:[^,]+ { proxy.uuid = match.join(""); }
|
|||
|
|
|
|||
|
|
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
|
|||
|
|
comma = _ "," _
|
|||
|
|
equals = _ "=" _
|
|||
|
|
_ = [ \r\t]*
|
|||
|
|
bool = b:("true"/"false") { return b === "true" }
|
|||
|
|
others = comma [^=,]+ equals [^=,]+
|
|||
|
|
`,Gd;function Ri(){return Gd||(Gd=vw.generate(p7)),Gd}var Ew=Zr(dl()),d7=String.raw`
|
|||
|
|
// global initializer
|
|||
|
|
{{
|
|||
|
|
function $set(obj, path, value) {
|
|||
|
|
if (Object(obj) !== obj) return obj;
|
|||
|
|
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
|
|||
|
|
path
|
|||
|
|
.slice(0, -1)
|
|||
|
|
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
|||
|
|
path[path.length - 1]
|
|||
|
|
] = value;
|
|||
|
|
return obj;
|
|||
|
|
}
|
|||
|
|
}}
|
|||
|
|
|
|||
|
|
// per-parser initializer
|
|||
|
|
{
|
|||
|
|
const proxy = {};
|
|||
|
|
const obfs = {};
|
|||
|
|
const transport = {};
|
|||
|
|
const $ = {};
|
|||
|
|
|
|||
|
|
function handleTransport() {
|
|||
|
|
if (transport.type === "tcp") { /* do nothing */ }
|
|||
|
|
else if (transport.type === "ws") {
|
|||
|
|
proxy.network = "ws";
|
|||
|
|
$set(proxy, "ws-opts.path", transport.path);
|
|||
|
|
$set(proxy, "ws-opts.headers.Host", transport.host);
|
|||
|
|
} else if (transport.type === "http") {
|
|||
|
|
proxy.network = "http";
|
|||
|
|
$set(proxy, "http-opts.path", transport.path);
|
|||
|
|
$set(proxy, "http-opts.headers.Host", transport.host);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
start = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http/socks5/hysteria2) {
|
|||
|
|
return proxy;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)*{
|
|||
|
|
proxy.type = "ssr";
|
|||
|
|
// handle ssr obfs
|
|||
|
|
proxy.obfs = obfs.type;
|
|||
|
|
}
|
|||
|
|
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)* {
|
|||
|
|
proxy.type = "ss";
|
|||
|
|
// handle ss obfs
|
|||
|
|
if (obfs.type == "http" || obfs.type === "tls") {
|
|||
|
|
proxy.plugin = "obfs";
|
|||
|
|
$set(proxy, "plugin-opts.mode", obfs.type);
|
|||
|
|
$set(proxy, "plugin-opts.host", obfs.host);
|
|||
|
|
$set(proxy, "plugin-opts.path", obfs.path);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/block_quic/others)* {
|
|||
|
|
proxy.type = "vmess";
|
|||
|
|
proxy.cipher = proxy.cipher || "none";
|
|||
|
|
proxy.alterId = proxy.alterId || 0;
|
|||
|
|
handleTransport();
|
|||
|
|
}
|
|||
|
|
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/flow/public_key/short_id/block_quic/others)* {
|
|||
|
|
proxy.type = "vless";
|
|||
|
|
handleTransport();
|
|||
|
|
}
|
|||
|
|
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
|
|||
|
|
proxy.type = "trojan";
|
|||
|
|
handleTransport();
|
|||
|
|
}
|
|||
|
|
hysteria2 = tag equals "hysteria2"i address password (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/block_quic/others)* {
|
|||
|
|
proxy.type = "hysteria2";
|
|||
|
|
}
|
|||
|
|
https = tag equals "https"i address (username password)? (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
|
|||
|
|
proxy.type = "http";
|
|||
|
|
proxy.tls = true;
|
|||
|
|
}
|
|||
|
|
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/block_quic/others)* {
|
|||
|
|
proxy.type = "http";
|
|||
|
|
}
|
|||
|
|
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
|
|||
|
|
proxy.type = "socks5";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
address = comma server:server comma port:port {
|
|||
|
|
proxy.server = server;
|
|||
|
|
proxy.port = port;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
server = ip/domain
|
|||
|
|
|
|||
|
|
ip = & {
|
|||
|
|
const start = peg$currPos;
|
|||
|
|
let j = start;
|
|||
|
|
while (j < input.length) {
|
|||
|
|
if (input[j] === ",") break;
|
|||
|
|
j++;
|
|||
|
|
}
|
|||
|
|
peg$currPos = j;
|
|||
|
|
$.ip = input.substring(start, j).trim();
|
|||
|
|
return true;
|
|||
|
|
} { return $.ip; }
|
|||
|
|
|
|||
|
|
domain = match:[0-9a-zA-z-_.]+ {
|
|||
|
|
const domain = match.join("");
|
|||
|
|
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
|
|||
|
|
return domain;
|
|||
|
|
}
|
|||
|
|
throw new Error("Invalid domain: " + domain);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
port = digits:[0-9]+ {
|
|||
|
|
const port = parseInt(digits.join(""), 10);
|
|||
|
|
if (port >= 0 && port <= 65535) {
|
|||
|
|
return port;
|
|||
|
|
}
|
|||
|
|
throw new Error("Invalid port number: " + port);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
method = comma cipher:cipher {
|
|||
|
|
proxy.cipher = cipher;
|
|||
|
|
}
|
|||
|
|
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"auto"/"bf-cfb"/"camellia-128-cfb"/"camellia-192-cfb"/"camellia-256-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"rc4-md5"/"rc4"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
|
|||
|
|
|
|||
|
|
username = & {
|
|||
|
|
let j = peg$currPos;
|
|||
|
|
let start, end;
|
|||
|
|
let first = true;
|
|||
|
|
while (j < input.length) {
|
|||
|
|
if (input[j] === ',') {
|
|||
|
|
if (first) {
|
|||
|
|
start = j + 1;
|
|||
|
|
first = false;
|
|||
|
|
} else {
|
|||
|
|
end = j;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
j++;
|
|||
|
|
}
|
|||
|
|
const match = input.substring(start, end);
|
|||
|
|
if (match.indexOf("=") === -1) {
|
|||
|
|
$.username = match;
|
|||
|
|
peg$currPos = end;
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
} { proxy.username = $.username; }
|
|||
|
|
password = comma '"' match:[^"]* '"' { proxy.password = match.join(""); }
|
|||
|
|
uuid = comma '"' match:[^"]+ '"' { proxy.uuid = match.join(""); }
|
|||
|
|
|
|||
|
|
obfs_typev = comma type:("http"/"tls") { obfs.type = type; }
|
|||
|
|
obfs_hostv = comma match:[^,]+ { obfs.host = match.join(""); }
|
|||
|
|
|
|||
|
|
obfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }
|
|||
|
|
|
|||
|
|
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }
|
|||
|
|
obfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }
|
|||
|
|
|
|||
|
|
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }
|
|||
|
|
obfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }
|
|||
|
|
uri = $[^,]+
|
|||
|
|
|
|||
|
|
transport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }
|
|||
|
|
transport_host = comma "host" equals host:domain { transport.host = host; }
|
|||
|
|
transport_path = comma "path" equals path:uri { transport.path = path; }
|
|||
|
|
|
|||
|
|
ssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }
|
|||
|
|
ssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }
|
|||
|
|
|
|||
|
|
vmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); }
|
|||
|
|
|
|||
|
|
udp_port = comma "udp-port" equals match:$[0-9]+ { proxy["udp-port"] = parseInt(match.trim()); }
|
|||
|
|
shadow_tls_version = comma "shadow-tls-version" equals match:$[0-9]+ { proxy["shadow-tls-version"] = parseInt(match.trim()); }
|
|||
|
|
shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-sni"] = match.join(""); }
|
|||
|
|
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
|
|||
|
|
|
|||
|
|
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
|
|||
|
|
tls_name = comma sni:("tls-name") equals host:domain { proxy.sni = host; }
|
|||
|
|
sni = comma sni:("sni") equals host:domain { proxy.sni = host; }
|
|||
|
|
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
|
|||
|
|
tls_cert_sha256 = comma "tls-cert-sha256" equals match:[^,]+ { proxy["tls-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals match:[^,]+ { proxy["tls-pubkey-sha256"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
|
|||
|
|
flow = comma "flow" equals match:[^,]+ { proxy["flow"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
public_key = comma "public-key" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["public-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
short_id = comma "short-id" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["short-id"] = match.join("").replace(/^"(.*)"$/, '$1'); }
|
|||
|
|
|
|||
|
|
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
|
|||
|
|
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
|
|||
|
|
ip_mode = comma "ip-mode" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
|
|||
|
|
|
|||
|
|
ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
|
|||
|
|
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
|
|||
|
|
salamander_password = comma "salamander-password" equals match:[^,]+ { proxy['obfs-password'] = match.join(""); proxy.obfs = 'salamander'; }
|
|||
|
|
|
|||
|
|
block_quic = comma "block-quic" equals flag:bool { if(flag) proxy["block-quic"] = "on"; else proxy["block-quic"] = "off"; }
|
|||
|
|
|
|||
|
|
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
|
|||
|
|
comma = _ "," _
|
|||
|
|
equals = _ "=" _
|
|||
|
|
_ = [ \r\t]*
|
|||
|
|
bool = b:("true"/"false") { return b === "true" }
|
|||
|
|
others = comma [^=,]+ equals [^=,]+
|
|||
|
|
`,zd;function qs(){return zd||(zd=Ew.generate(d7)),zd}var Aw=Zr(dl()),g7=String.raw`
|
|||
|
|
// global initializer
|
|||
|
|
{{
|
|||
|
|
function $set(obj, path, value) {
|
|||
|
|
if (Object(obj) !== obj) return obj;
|
|||
|
|
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
|
|||
|
|
path
|
|||
|
|
.slice(0, -1)
|
|||
|
|
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
|||
|
|
path[path.length - 1]
|
|||
|
|
] = value;
|
|||
|
|
return obj;
|
|||
|
|
}
|
|||
|
|
}}
|
|||
|
|
|
|||
|
|
// per-parse initializer
|
|||
|
|
{
|
|||
|
|
const proxy = {};
|
|||
|
|
const obfs = {};
|
|||
|
|
const $ = {};
|
|||
|
|
|
|||
|
|
function handleObfs() {
|
|||
|
|
if (obfs.type === "ws" || obfs.type === "wss") {
|
|||
|
|
proxy.network = "ws";
|
|||
|
|
if (obfs.type === 'wss') {
|
|||
|
|
proxy.tls = true;
|
|||
|
|
}
|
|||
|
|
$set(proxy, "ws-opts.path", obfs.path);
|
|||
|
|
$set(proxy, "ws-opts.headers.Host", obfs.host);
|
|||
|
|
} else if (obfs.type === "over-tls") {
|
|||
|
|
proxy.tls = true;
|
|||
|
|
} else if (obfs.type === "http") {
|
|||
|
|
proxy.network = "http";
|
|||
|
|
$set(proxy, "http-opts.path", obfs.path);
|
|||
|
|
$set(proxy, "http-opts.headers.Host", obfs.host);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
start = (trojan/shadowsocks/vmess/vless/http/socks5) {
|
|||
|
|
return proxy
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
trojan = "trojan" equals address
|
|||
|
|
(password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/server_check_url/others)* {
|
|||
|
|
proxy.type = "trojan";
|
|||
|
|
handleObfs();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
shadowsocks = "shadowsocks" equals address
|
|||
|
|
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp_new/fast_open/tag/server_check_url/others)* {
|
|||
|
|
if (proxy.protocol || proxy.type === "ssr") {
|
|||
|
|
proxy.type = "ssr";
|
|||
|
|
if (!proxy.protocol) {
|
|||
|
|
proxy.protocol = "origin";
|
|||
|
|
}
|
|||
|
|
// handle ssr obfs
|
|||
|
|
if (obfs.host) proxy["obfs-param"] = obfs.host;
|
|||
|
|
if (obfs.type) proxy.obfs = obfs.type;
|
|||
|
|
} else {
|
|||
|
|
proxy.type = "ss";
|
|||
|
|
// handle ss obfs
|
|||
|
|
if (obfs.type == "http" || obfs.type === "tls") {
|
|||
|
|
proxy.plugin = "obfs";
|
|||
|
|
$set(proxy, "plugin-opts", {
|
|||
|
|
mode: obfs.type
|
|||
|
|
});
|
|||
|
|
} else if (obfs.type === "ws" || obfs.type === "wss") {
|
|||
|
|
proxy.plugin = "v2ray-plugin";
|
|||
|
|
$set(proxy, "plugin-opts.mode", "websocket");
|
|||
|
|
if (obfs.type === "wss") {
|
|||
|
|
$set(proxy, "plugin-opts.tls", true);
|
|||
|
|
}
|
|||
|
|
} else if (obfs.type === 'over-tls') {
|
|||
|
|
throw new Error('ss over-tls is not supported');
|
|||
|
|
}
|
|||
|
|
if (obfs.type) {
|
|||
|
|
$set(proxy, "plugin-opts.host", obfs.host);
|
|||
|
|
$set(proxy, "plugin-opts.path", obfs.path);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
vmess = "vmess" equals address
|
|||
|
|
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
|
|||
|
|
proxy.type = "vmess";
|
|||
|
|
proxy.cipher = proxy.cipher || "none";
|
|||
|
|
if (proxy.aead === false) {
|
|||
|
|
proxy.alterId = 1;
|
|||
|
|
} else {
|
|||
|
|
proxy.alterId = 0;
|
|||
|
|
}
|
|||
|
|
handleObfs();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
vless = "vless" equals address
|
|||
|
|
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
|
|||
|
|
proxy.type = "vless";
|
|||
|
|
proxy.cipher = proxy.cipher || "none";
|
|||
|
|
handleObfs();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
http = "http" equals address
|
|||
|
|
(username/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)*{
|
|||
|
|
proxy.type = "http";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
socks5 = "socks5" equals address
|
|||
|
|
(username/password/password/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/server_check_url/others)* {
|
|||
|
|
proxy.type = "socks5";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
address = server:server ":" port:port {
|
|||
|
|
proxy.server = server;
|
|||
|
|
proxy.port = port;
|
|||
|
|
}
|
|||
|
|
server = ip/domain
|
|||
|
|
|
|||
|
|
domain = match:[0-9a-zA-z-_.]+ {
|
|||
|
|
const domain = match.join("");
|
|||
|
|
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
|
|||
|
|
return domain;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ip = & {
|
|||
|
|
const start = peg$currPos;
|
|||
|
|
let end;
|
|||
|
|
let j = start;
|
|||
|
|
while (j < input.length) {
|
|||
|
|
if (input[j] === ",") break;
|
|||
|
|
if (input[j] === ":") end = j;
|
|||
|
|
j++;
|
|||
|
|
}
|
|||
|
|
peg$currPos = end || j;
|
|||
|
|
$.ip = input.substring(start, end).trim();
|
|||
|
|
return true;
|
|||
|
|
} { return $.ip; }
|
|||
|
|
|
|||
|
|
port = digits:[0-9]+ {
|
|||
|
|
const port = parseInt(digits.join(""), 10);
|
|||
|
|
if (port >= 0 && port <= 65535) {
|
|||
|
|
return port;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
username = comma "username" equals username:[^,]+ { proxy.username = username.join("").trim(); }
|
|||
|
|
password = comma "password" equals password:[^,]+ { proxy.password = password.join("").trim(); }
|
|||
|
|
uuid = comma "password" equals uuid:[^,]+ { proxy.uuid = uuid.join("").trim(); }
|
|||
|
|
|
|||
|
|
method = comma "method" equals cipher:cipher {
|
|||
|
|
proxy.cipher = cipher;
|
|||
|
|
};
|
|||
|
|
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
|
|||
|
|
aead = comma "aead" equals flag:bool { proxy.aead = flag; }
|
|||
|
|
|
|||
|
|
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
|
|||
|
|
udp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }
|
|||
|
|
udp_over_tcp_new = comma "udp-over-tcp" equals param:$[^=,]+ { if (param === "sp.v1") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 1; } else if (param === "sp.v2") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 2; } else if (param === "true") { proxy["_ssr_python_uot"] = true; } else { throw new Error("Invalid value for udp-over-tcp"); } }
|
|||
|
|
|
|||
|
|
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
|
|||
|
|
|
|||
|
|
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
|
|||
|
|
tls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }
|
|||
|
|
tls_verification = comma "tls-verification" equals flag:bool {
|
|||
|
|
proxy["skip-cert-verify"] = !flag;
|
|||
|
|
}
|
|||
|
|
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
|
|||
|
|
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals param:$[^=,]+ { proxy["tls-pubkey-sha256"] = param; }
|
|||
|
|
tls_alpn = comma "tls-alpn" equals param:$[^=,]+ { proxy["tls-alpn"] = param; }
|
|||
|
|
tls_no_session_ticket = comma "tls-no-session-ticket" equals flag:bool {
|
|||
|
|
proxy["tls-no-session-ticket"] = flag;
|
|||
|
|
}
|
|||
|
|
tls_no_session_reuse = comma "tls-no-session-reuse" equals flag:bool {
|
|||
|
|
proxy["tls-no-session-reuse"] = flag;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
obfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }
|
|||
|
|
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { proxy.type = "ssr"; obfs.type = type; return type; }
|
|||
|
|
obfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };
|
|||
|
|
|
|||
|
|
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }
|
|||
|
|
obfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }
|
|||
|
|
|
|||
|
|
ssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }
|
|||
|
|
ssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }
|
|||
|
|
|
|||
|
|
server_check_url = comma "server_check_url" equals param:$[^=,]+ { proxy["test-url"] = param; }
|
|||
|
|
|
|||
|
|
uri = $[^,]+
|
|||
|
|
|
|||
|
|
tag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }
|
|||
|
|
others = comma [^=,]+ equals [^=,]+
|
|||
|
|
comma = _ "," _
|
|||
|
|
equals = _ "=" _
|
|||
|
|
_ = [ \r\t]*
|
|||
|
|
bool = b:("true"/"false") { return b === "true" }
|
|||
|
|
`,Yd;function Bu(){return Yd||(Yd=Aw.generate(g7)),Yd}var ww=Zr(dl()),m7=String.raw`
|
|||
|
|
// global initializer
|
|||
|
|
{{
|
|||
|
|
function $set(obj, path, value) {
|
|||
|
|
if (Object(obj) !== obj) return obj;
|
|||
|
|
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || [];
|
|||
|
|
path
|
|||
|
|
.slice(0, -1)
|
|||
|
|
.reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
|||
|
|
path[path.length - 1]
|
|||
|
|
] = value;
|
|||
|
|
return obj;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function toBool(str) {
|
|||
|
|
if (typeof str === 'undefined' || str === null) return undefined;
|
|||
|
|
return /(TRUE)|1/i.test(str);
|
|||
|
|
}
|
|||
|
|
}}
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
const proxy = {};
|
|||
|
|
const obfs = {};
|
|||
|
|
const $ = {};
|
|||
|
|
const params = {};
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
start = (trojan) {
|
|||
|
|
return proxy
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
trojan = "trojan://" password:password "@" server:server ":" port:port "/"? params? name:name?{
|
|||
|
|
proxy.type = "trojan";
|
|||
|
|
proxy.password = password;
|
|||
|
|
proxy.server = server;
|
|||
|
|
proxy.port = port;
|
|||
|
|
proxy.name = name;
|
|||
|
|
|
|||
|
|
// name may be empty
|
|||
|
|
if (!proxy.name) {
|
|||
|
|
proxy.name = server + ":" + port;
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
password = match:$[^@]+ {
|
|||
|
|
return decodeURIComponent(match);
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
server = ip/domain;
|
|||
|
|
|
|||
|
|
domain = match:[0-9a-zA-z-_.]+ {
|
|||
|
|
const domain = match.join("");
|
|||
|
|
if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {
|
|||
|
|
return domain;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ip = & {
|
|||
|
|
const start = peg$currPos;
|
|||
|
|
let end;
|
|||
|
|
let j = start;
|
|||
|
|
while (j < input.length) {
|
|||
|
|
if (input[j] === ",") break;
|
|||
|
|
if (input[j] === ":") end = j;
|
|||
|
|
j++;
|
|||
|
|
}
|
|||
|
|
peg$currPos = end || j;
|
|||
|
|
$.ip = input.substring(start, end).trim();
|
|||
|
|
return true;
|
|||
|
|
} { return $.ip; }
|
|||
|
|
|
|||
|
|
port = digits:[0-9]+ {
|
|||
|
|
const port = parseInt(digits.join(""), 10);
|
|||
|
|
if (port >= 0 && port <= 65535) {
|
|||
|
|
return port;
|
|||
|
|
} else {
|
|||
|
|
throw new Error("Invalid port: " + port);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
params = "?" head:param tail:("&"@param)* {
|
|||
|
|
for (const [key, value] of Object.entries(params)) {
|
|||
|
|
params[key] = decodeURIComponent(value);
|
|||
|
|
}
|
|||
|
|
proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);
|
|||
|
|
proxy.sni = params["sni"] || params["peer"];
|
|||
|
|
proxy['client-fingerprint'] = params.fp;
|
|||
|
|
proxy.alpn = params.alpn ? decodeURIComponent(params.alpn).split(',') : undefined;
|
|||
|
|
|
|||
|
|
if (toBool(params["ws"])) {
|
|||
|
|
proxy.network = "ws";
|
|||
|
|
$set(proxy, "ws-opts.path", params["wspath"]);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (params["type"]) {
|
|||
|
|
let httpupgrade
|
|||
|
|
proxy.network = params["type"]
|
|||
|
|
if(proxy.network === 'httpupgrade') {
|
|||
|
|
proxy.network = 'ws'
|
|||
|
|
httpupgrade = true
|
|||
|
|
}
|
|||
|
|
if (['grpc'].includes(proxy.network)) {
|
|||
|
|
proxy[proxy.network + '-opts'] = {
|
|||
|
|
'grpc-service-name': params["serviceName"],
|
|||
|
|
'_grpc-type': params["mode"],
|
|||
|
|
'_grpc-authority': params["authority"],
|
|||
|
|
};
|
|||
|
|
} else {
|
|||
|
|
if (params["path"]) {
|
|||
|
|
$set(proxy, proxy.network+"-opts.path", decodeURIComponent(params["path"]));
|
|||
|
|
}
|
|||
|
|
if (params["host"]) {
|
|||
|
|
$set(proxy, proxy.network+"-opts.headers.Host", decodeURIComponent(params["host"]));
|
|||
|
|
}
|
|||
|
|
if (httpupgrade) {
|
|||
|
|
$set(proxy, proxy.network+"-opts.v2ray-http-upgrade", true);
|
|||
|
|
$set(proxy, proxy.network+"-opts.v2ray-http-upgrade-fast-open", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (['reality'].includes(params.security)) {
|
|||
|
|
const opts = {};
|
|||
|
|
if (params.pbk) {
|
|||
|
|
opts['public-key'] = params.pbk;
|
|||
|
|
}
|
|||
|
|
if (params.sid) {
|
|||
|
|
opts['short-id'] = params.sid;
|
|||
|
|
}
|
|||
|
|
if (params.spx) {
|
|||
|
|
opts['_spider-x'] = params.spx;
|
|||
|
|
}
|
|||
|
|
if (params.mode) {
|
|||
|
|
proxy._mode = params.mode;
|
|||
|
|
}
|
|||
|
|
if (params.extra) {
|
|||
|
|
proxy._extra = params.extra;
|
|||
|
|
}
|
|||
|
|
if (Object.keys(opts).length > 0) {
|
|||
|
|
$set(proxy, params.security+"-opts", opts);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
proxy.udp = toBool(params["udp"]);
|
|||
|
|
proxy.tfo = toBool(params["tfo"]);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
param = kv/single;
|
|||
|
|
|
|||
|
|
kv = key:$[a-z]i+ "=" value:$[^&#]i* {
|
|||
|
|
params[key] = value;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
single = key:$[a-z]i+ {
|
|||
|
|
params[key] = true;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
name = "#" + match:$.* {
|
|||
|
|
return decodeURIComponent(match);
|
|||
|
|
}
|
|||
|
|
`,Wd;function Jd(){return Wd||(Wd=ww.generate(m7)),Wd}var e1=Zr(Qd());function Cw(e){let[t,r]=e.match(/,\s*?port-hopping\s*?=\s*?["']?\s*?((\d+(-\d+)?)([,;]\d+(-\d+)?)*)\s*?["']?\s*?/)||[];return{port_hopping:r?r.replace(/;/g,","):void 0,line:t?e.replace(t,""):e}}function v7(){return{name:"URI PROXY Parser",test:e=>/^(socks5\+tls|socks5|http|https):\/\//.test(e),parse:e=>{let[t,r,n,i,s,o,u,l,p]=e.match(/^(socks5|http|http)(\+tls|s)?:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(u)u=parseInt(u,10);else{if(n)u=443;else if(r==="http")u=80;else throw _.error(`port is not present in line: ${e}`),new Error(`port is not present in line: ${e}`);_.info(`port is not present in line: ${e}, set to ${u}`)}return{name:p!=null?decodeURIComponent(p):`${r} ${o}:${u}`,type:r,tls:!!n,server:o,port:u,username:i!=null?decodeURIComponent(i):void 0,password:s!=null?decodeURIComponent(s):void 0}}}}function E7(){return{name:"URI SOCKS Parser",test:e=>/^socks:\/\//.test(e),parse:e=>{let[t,r,n,i,s,o,u]=e.match(/^(socks)?:\/\/(?:(.*)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/);if(s)s=parseInt(s,10);else throw _.error(`port is not present in line: ${e}`),new Error(`port is not present in line: ${e}`);let l,p;if(n){let f=pt.decode(decodeURIComponent(n)).split(":");l=f[0],p=f[1]}return{name:u!=null?decodeURIComponent(u):`${r} ${i}:${s}`,type:"socks5",server:i,port:s,username:l,password:p}}}}function A7(){return{name:"URI SS Parser",test:e=>/^ss:\/\//.test(e),parse:e=>{let t=e.split("ss://")[1],r=e.split("#")[1],n={type:"ss"};t=t.split("#")[0];let i=t.match(/@([^/?]*)(\/|\?|$)/),s=decodeURIComponent(t.split("@")[0]),o;s?.startsWith("2022-blake3-")?o=s:o=pt.decode(s);let u="";if(i)t.includes("?")&&(u=t.match(/(\?.*)$/)[1]);else{if(t.includes("?")){let B=t.match(/^(.*)(\?.*)$/);t=B[1],u=B[2]}if(t=pt.decode(t),u){if(/(&|\?)v2ray-plugin=/.test(u)){let B=u.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/)[2];B&&(n.plugin="v2ray-plugin",n["plugin-opts"]=JSON.parse(pt.decode(B)))}t=`${t}${u}`}o=t.match(/(^.*)@/)?.[1],i=t.match(/@([^/@]*)(\/|$)/)}let l=i[1],p=l.lastIndexOf(":");n.server=l.substring(0,p),n.port=`${l.substring(p+1)}`.match(/\d+/)?.[0];let f=o.match(/(^.*?):(.*$)/);n.cipher=f?.[1],n.password=f?.[2];let c=t.match(/[?&]plugin=([^&]+)/),m=t.match(/[?&]shadow-tls=([^&]+)/);if(c){let B=("plugin="+decodeURIComponent(c[1])).split(";"),C={};for(let F of B){let[H,q]=F.split("=");H&&(C[H]=q||!0)}switch(C.plugin){case"obfs-local":case"simple-obfs":n.plugin="obfs",n["plugin-opts"]={mode:C.obfs,host:ur(C["obfs-host"])};break;case"v2ray-plugin":n.plugin="v2ray-plugin",n["plugin-opts"]={mode:"websocket",host:ur(C["obfs-host"]),path:ur(C.path),tls:Ro(C.tls)};break;case"shadow-tls":{n.plugin="shadow-tls";let F=ur(C.version);n["plugin-opts"]={host:ur(C.host),password:ur(C.password),version:F?parseInt(F,10):void 0};break}default:throw new Error(`Unsupported plugin option: ${C.plugin}`)}}if(m){let B=JSON.parse(pt.decode(m[1])),C=ur(B.version),F=ur(B.address),H=ur(B.port);n.plugin="shadow-tls",n["plugin-opts"]={host:ur(B.host),password:ur(B.password),version:C?parseInt(C,10):void 0},F&&(n.server=F),H&&(n.port=parseInt(H,10))}return/(&|\?)uot=(1|true)/i.test(u)&&(n["udp-over-tcp"]=!0),/(&|\?)tfo=(1|true)/i.test(u)&&(n.tfo=!0),r!=null&&(r=decodeURIComponent(r)),n.name=r??`SS ${n.server}:${n.port}`,n}}}function w7(){return{name:"URI SSR Parser",test:e=>/^ssr:\/\//.test(e),parse:e=>{e=pt.decode(e.split("ssr://")[1]);let t=e.indexOf(":origin");t===-1&&(t=e.indexOf(":auth_"));let r=e.substring(0,t),n=r.substring(0,r.lastIndexOf(":")),i=r.substring(r.lastIndexOf(":")+1),s=e.substring(t+1).split("/?")[0].split(":"),o={type:"ssr",server:n,port:i,protocol:s[0],cipher:s[1],obfs:s[2],password:pt.decode(s[3])},u={};if(e=e.split("/?")[1].split("&"),e.length>1)for(let l of e){let[p,f]=l.split("=");f=f.trim(),f.length>0&&f!=="(null)"&&(u[p]=f)}return o={...o,name:u.remarks?pt.decode(u.remarks):o.server,"protocol-param":ur(pt.decode(u.protoparam||"").replace(/\s/g,"")),"obfs-param":ur(pt.decode(u.obfsparam||"").replace(/\s/g,""))},o}}}function C7(){return{name:"URI VMess Parser
|
|||
|
|
Reason: ${r}`)}return e}function uP(e){e=sP(e);let t=e.split(`
|
|||
|
|
`),r=[],n;for(let i of t){if(i=i.trim(),i.length===0)continue;let s=!1;if(n){let[o,u]=Fw(n,i);u||(r.push(Sw(o)),s=!0)}if(!s)for(let o of yw){let[u,l]=Fw(o,i);if(!l){r.push(Sw(u)),n=o,s=!0,_.info(`${o.name} is activated`);break}}s||_.error(`Failed to parse line: ${i}`)}return r.filter(i=>(["vless","vmess"].includes(i.type)&&(If(i.uuid)||_.error(`UUID may be invalid: ${i.name} ${i.uuid}`)),!0))}async function aP(e,t=[],r,n,i){for(let s of t){if(s.disabled){_.log(`Skipping disabled operator: "${s.type}" with arguments:
|
|||
|
|
>>> ${JSON.stringify(s.args,null,2)||"None"}`);continue}let o,u={};if(s.type.indexOf("Script")!==-1){let{mode:p,content:f}=s.args;if(p==="link"){let c=f||"",m=c.split("#");if(m.length>1)try{u=JSON.parse(decodeURIComponent(m[1]))}catch{for(let C of m[1].split("&")){let F=C.split("=")[0],H=C.split("=")[1];u[F]=H==null||H===""?!0:decodeURIComponent(H)}}c=`${c.split("#")[0]}${m[2]?`#${m[2]}`:u?.noCache!=null||u?.insecure!=null?`#${m[1]}`:""}`;let B=c.split("#")[0].match(/^\/api\/(file|module)\/(.+)/);if(B){let C="";try{C=B?.[1];let F=B?.[2];if(F==null)throw new Error(`\u672C\u5730 ${C} URL \u65E0\u6548: ${c}`);F=decodeURIComponent(F);let H=C==="module"?Fn:Nt,q=ft(_.read(H),F);if(!q)throw new Error(`\u627E\u4E0D\u5230 ${C}: ${F}`);C==="module"?o=q.content:o=await sn({type:"file",name:F})}catch(F){throw _.error(`Error when loading ${C}: ${s.args.content}.
|
|||
|
|
Reason: ${F}`),new Error(`\u65E0\u6CD5\u52A0\u8F7D ${C}: ${c}`)}}else if(c?.startsWith("/"))try{o=require("fs").readFileSync(c.split("#")[0],"utf8")}catch(C){throw _.error(`Error when reading local script: ${s.args.content}.
|
|||
|
|
Reason: ${C}`),new Error(`\u65E0\u6CD5\u4ECE\u8BE5\u8DEF\u5F84\u8BFB\u53D6\u811A\u672C\u6587\u4EF6: ${c}`)}else try{o=await zr(c)}catch(C){throw _.error(`Error when downloading remote script: ${s.args.content}.
|
|||
|
|
Reason: ${C}`),new Error(`\u65E0\u6CD5\u4E0B\u8F7D\u811A\u672C: ${c}`)}}else o=f,u=s.args.arguments||{}}if(!ph[s.type]){_.error(`Unknown operator: "${s.type}"`);continue}_.log(`Applying "${s.type}" with arguments:
|
|||
|
|
>>> ${JSON.stringify(s.args,null,2)||"None"}`);let l;s.type.indexOf("Script")!==-1?l=ph[s.type](o,r,u,n,i):l=ph[s.type](s.args||{}),e=await nA(l,e)}return e}function oP(e,t,r,n={}){let i=Ah[t];if(!i)throw new Error(`Target platform: ${t} is not supported!`);let s=/Surge|SurgeMac|Shadowrocket/i.test(t);if(e=e.filter(o=>o.supported&&o.supported[t]===!1?!1:(["vless","vmess"].includes(o.type)&&(If(o.uuid)||_.error(`UUID may be invalid: ${o.name} ${o.uuid}`)),!0)),e=e.map(o=>(o._resolved=o.resolved,_s(o.name)||(o.name=`${o.type} ${o.server}:${o.port}`),o["disable-sni"]&&(s?o.sni="off":["tuic"].includes(o.type)||(_.error(`Target platform ${t} does not support sni off. Proxy's fields (sni, tls-fingerprint and skip-cert-verify) will be modified.`),o.sni="",o["skip-cert-verify"]=!0,delete o["tls-fingerprint"])),o.ports&&(o.ports=String(o.ports),["ClashMeta"].includes(t)||(o.ports=o.ports.replace(/\//g,",")),o.port||(o.port=Uc(o.ports))),o)),_.log(`Producing proxies for target: ${t}`),typeof i.type>"u"||i.type==="SINGLE"){let o=e.map(u=>{try{return i.produce(u,r,n)}catch(l){return _.error(`Cannot produce proxy: ${JSON.stringify(u,null,2)}
|
|||
|
|
Reason: ${l}`),""}}).filter(u=>u.length>0);return o=r==="internal"?o:o.join(`
|
|||
|
|
`),t.startsWith("Surge")&&e.length>0&&e.every(u=>u.type==="wireguard")&&(o=`#!name=${e[0]?._subName}
|
|||
|
|
#!desc=${e[0]?._desc??""}
|
|||
|
|
#!category=${e[0]?._category??""}
|
|||
|
|
${o}`),o}else if(i.type==="ALL")return i.produce(e,r,n)}var Rt={parse:uP,process:aP,produce:oP,ipAddress:_f,getRandomPort:Uc,isIPv4:Lr,isIPv6:Rr,isIP:t1,yaml:Rs,getFlag:ec,removeFlag:rl,getISO:ah,MMDB:uh,Gist:Wi,download:zr,downloadFile:gl,isValidUUID:If,doh:rc,Buffer:Ih.Buffer,Base64:pt,JSON5:bw.default};function Fw(e,t){if(!cP(e,t))return[null,new Error("Parser mismatch")];try{return[e.parse(t),null]}catch(r){return[null,r]}}function cP(e,t){try{return e.test(t)}catch{return!1}}function Dw(e){if(typeof e=="string"||typeof e=="number"){if(e=String(e).trim(),e==="")return"/";if(!e.startsWith("/"))return"/"+e}return e}function Sw(e){typeof e.cipher=="string"&&(e.cipher=e.cipher.toLowerCase()),typeof e.password=="number"&&(e.password=Jm(e.password)),["ss"].includes(e.type)&&e.cipher==="none"&&!e.password&&(e.password=""),e.interface&&(e["interface-name"]=e.interface,delete e.interface),Wm(e.port)&&(e.port=parseInt(e.port,10)),e.server&&(e.server=`${e.server}`.trim().replace(/^\[/,"").replace(/\]$/,"")),e.network==="ws"&&(!e["ws-opts"]&&(e["ws-path"]||e["ws-headers"])&&(e["ws-opts"]={},e["ws-path"]&&(e["ws-opts"].path=e["ws-path"]),e["ws-headers"]&&(e["ws-opts"].headers=e["ws-headers"])),delete e["ws-path"],delete e["ws-headers"]);let t=e[`${e.network}-opts`]?.path;if(Array.isArray(t)?e[`${e.network}-opts`].path=t.map(n=>Dw(n)):t!=null&&(e[`${e.network}-opts`].path=Dw(t)),e.type==="trojan"&&e.network==="tcp"&&delete e.network,["vless"].includes(e.type)&&(e.network||(e.network="tcp")),["trojan","tuic","hysteria","hysteria2","juicity","anytls"].includes(e.type)&&(e.tls=!0),e.network){let n=e[`${e.network}-opts`]?.headers?.Host,i=e[`${e.network}-opts`]?.headers?.host;e.network==="h2"?!i&&n&&(e[`${e.network}-opts`].headers.host=n,delete e[`${e.network}-opts`].headers.Host):i&&!n&&(e[`${e.network}-opts`].headers.Host=i,delete e[`${e.network}-opts`].headers.host)}if(e.network==="h2"){let n=e["h2-opts"]?.headers?.host,i=e["h2-opts"]?.path;n&&!Array.isArray(n)&&(e["h2-opts"].headers.host=[n]),Array.isArray(i)&&(e["h2-opts"].path=i[0])}if(!e.tls&&["ws","http"].includes(e.network)&&!e[`${e.network}-opts`]?.headers?.Host&&!t1(e.server)&&(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].headers=e[`${e.network}-opts`].headers||{},e[`${e.network}-opts`].headers.Host=["vmess","vless"].includes(e.type)&&e.network==="http"?[e.server]:e.server),["vmess","vless"].includes(e.type)&&e.network==="http"){let n=e[`${e.network}-opts`]?.path,i=e[`${e.network}-opts`]?.headers?.Host;i&&!Array.isArray(i)&&(e[`${e.network}-opts`].headers.Host=[i]),n&&!Array.isArray(n)&&(e[`${e.network}-opts`].path=[n])}if(e.tls&&!e.sni&&(t1(e.server)||(e.sni=e.server),!e.sni&&e.network)){let n=e[`${e.network}-opts`]?.headers?.Host;n=Array.isArray(n)?n[0]:n,n&&(e.sni=n)}if(e.ports?e.ports=String(e.ports).replace(/\//g,","):delete e.ports,["hysteria2"].includes(e.type)&&e.obfs&&!["salamander"].includes(e.obfs)&&!e["obfs-password"]&&(e["obfs-password"]=e.obfs,e.obfs="salamander"),["hysteria2"].includes(e.type)&&!e["obfs-password"]&&e.obfs_password&&(e["obfs-password"]=e.obfs_password,delete e.obfs_password),["vless"].includes(e.type)&&(e["reality-opts"]&&Object.keys(e["reality-opts"]).length===0&&delete e["reality-opts"],e["grpc-opts"]&&Object.keys(e["grpc-opts"]).length===0&&delete e["grpc-opts"],!e["reality-opts"]&&!e.flow&&delete e.flow,["http"].includes(e.network)&&(e[`${e.network}-opts`]?.path||(e[`${e.network}-opts`]||(e[`${e.network}-opts`]={}),e[`${e.network}-opts`].path=["/"]))),typeof e.name!="string")if(/^\d+$/.test(e.name))e.name=`${e.name}`;else try{e.name?.data?e.name=Ih.Buffer.from(e.name.data).toString("utf8"):e.name=Ih.Buffer.from(e.name).toString("utf8")}catch(n){_.error(`proxy.name decode failed
|
|||
|
|
Reason: ${n}`),e.name=`${e.type} ${e.server}:${e.port}`}["ws","http","h2"].includes(e.network)&&(["ws","h2"].includes(e.network)&&!e[`${e.network}-opts`]?.path?(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].path="/"):e.network==="http"&&(!Array.isArray(e[`${e.network}-opts`]?.path)||e[`${e.network}-opts`]?.path.every(n=>!n))&&(e[`${e.network}-opts`]=e[`${e.network}-opts`]||{},e[`${e.network}-opts`].path=["/"])),["","off"].includes(e.sni)&&(e["disable-sni"]=!0);let r=e.ca_str;e["ca-str"]?r=e["ca-str"]:r&&(delete e.ca_str,e["ca-str"]=r);try{_.env.isNode&&!r&&e._ca&&(r=_.node.fs.readFileSync(e._ca,{encoding:"utf8"}))}catch(n){_.error(`Read ca file failed
|
|||
|
|
Reason: ${n}`)}return!e["tls-fingerprint"]&&r&&(e["tls-fingerprint"]=Mv.generateFingerprint(r)),["ss"].includes(e.type)&&ae(e,"shadow-tls-password")&&(e.plugin="shadow-tls",e["plugin-opts"]={host:e["shadow-tls-sni"],password:e["shadow-tls-password"],version:e["shadow-tls-version"]},delete e["shadow-tls-sni"],delete e["shadow-tls-password"],delete e["shadow-tls-version"]),e}function t1(e){return Lr(e)||Rr(e)}function lP(){return{name:"HTML",test:e=>/^<!DOCTYPE html>/.test(e),parse:()=>""}}function fP(){return{name:"Clash Provider",test:e=>/^payload:/gm.exec(e).index>=0,parse:e=>e.replace("payload:","").replace(/^\s*-\s*/gm,"")}}var _w=[lP(),fP()];function hP(){return{type:"SINGLE",func:e=>["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL","GEOSITE","GEOIP"].indexOf(e.type)!==-1?null:`${{"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[e.type]||e.type},${e.content},SUB-STORE`}}function Iw(){return{type:"SINGLE",func:e=>{if(["GEOSITE","GEOIP"].indexOf(e.type)!==-1)return null;let t=`${e.type},${e.content}`;return["IP-CIDR","IP-CIDR6"].includes(e.type)&&(t+=e.options?.length>0?`,${e.options.join(",")}`:""),t}}}function pP(){return{type:"SINGLE",func:e=>["SRC-IP","GEOSITE","GEOIP"].indexOf(e.type)!==-1?null:(["IP-CIDR","IP-CIDR6"].includes(e.type)&&e.options&&(e.options=e.options.filter(t=>["no-resolve"].includes(t))),Iw().func(e))}}function dP(){return{type:"ALL",func:e=>{let t={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},r={payload:e.map(n=>{let i=`${t[n.type]||n.type},${n.content}`;return["IP-CIDR","IP-CIDR6","GEOIP"].includes(n.type)&&(n.options&&(n.options=n.options.filter(s=>["no-resolve"].includes(s))),i+=n.options?.length>0?`,${n.options.join(",")}`:""),i})};return Rs.dump(r)}}}var Bw={QX:hP(),Surge:Iw(),Loon:pP(),Clash:dP()},gP=[[/^(DOMAIN|host|HOST)$/,"DOMAIN"],[/^(DOMAIN-KEYWORD|host-keyword|HOST-KEYWORD)$/,"DOMAIN-KEYWORD"],[/^(DOMAIN-SUFFIX|host-suffix|HOST-SUFFIX)$/,"DOMAIN-SUFFIX"],[/^USER-AGENT$/i,"USER-AGENT"],[/^PROCESS-NAME$/,"PROCESS-NAME"],[/^(DEST-PORT|DST-PORT)$/,"DST-PORT"],[/^SRC-IP(-CIDR)?$/,"SRC-IP"],[/^(IN|SRC)-PORT$/,"IN-PORT"],[/^PROTOCOL$/,"PROTOCOL"],[/^IP-CIDR$/i,"IP-CIDR"],[/^(IP-CIDR6|ip6-cidr|IP6-CIDR)$/,"IP-CIDR6"],[/^GEOIP$/i,"GEOIP"],[/^GEOSITE$/i,"GEOSITE"]];function mP(){return{name:"Universal Rule Parser",test:()=>!0,parse:e=>{let t=e.split(`
|
|||
|
|
`),r=[];for(let n of t)if(n=n.trim(),n.length!==0&&!/\s*#/.test(n))try{let i=n.split(",").map(u=>u.trim()),s=i[0],o=!1;for(let u of gP)if(u[0].test(s)){o=!0;let l={type:u[1],content:i[1]};["IP-CIDR","IP-CIDR6","GEOIP"].includes(l.type)&&(l.options=i.slice(2)),r.push(l)}if(!o)throw new Error("Invalid rule type: "+s)}catch(i){console.log(`Failed to parse line: ${n}
|
|||
|
|
Reason: ${i}`)}return r}}}var $w=[mP()],Qa=function(){function e(n){for(let i of _w)try{if(i.test(n))return _.info(`Pre-processor [${i.name}] activated`),i.parse(n)}catch(s){_.error(`Parser [${i.name}] failed
|
|||
|
|
Reason: ${s}`)}return n}function t(n){n=e(n);for(let i of $w){let s;try{s=i.test(n)}catch{s=!1}if(s)return _.info(`Rule parser [${i.name}] is activated!`),i.parse(n)}}function r(n,i){let s=Bw[i];if(!s)throw new Error(`Target platform: ${i} is not supported!`);if(typeof s.type>"u"||s.type==="SINGLE")return n.map(o=>{try{return s.func(o)}catch(u){return console.log(`ERROR: cannot produce rule: ${JSON.stringify(o)}
|
|||
|
|
Reason: ${u}`),""}}).filter(o=>o.length>0).join(`
|
|||
|
|
`);if(s.type==="ALL")return s.func(n)}return{parse:t,produce:r}}();function r1(e){_.read(_t)||_.write({},_t),e.get("/api/artifacts/restore",vP),e.route("/api/artifacts").get(EP).post(CP).put(AP),e.route("/api/artifact/:name").get(wP).patch(yP).delete(FP)}async function vP(e,t){_.info("\u5F00\u59CB\u6062\u590D\u8FDC\u7A0B\u914D\u7F6E...");try{let{gistToken:r,syncPlatform:n}=_.read(Mt);if(!r)return Promise.reject("\u672A\u8BBE\u7F6E GitHub Token\uFF01");let i=new Wi({token:r,key:$a,syncPlatform:n});try{let s=await i.locate();if(!s?.files)throw new Error("\u627E\u4E0D\u5230 Sub-Store Gist \u6587\u4EF6\u5217\u8868");let o=_.read(_t),u=[];Object.keys(s.files).map(l=>{let p=s.files[l]?.filename;if(p)if(encodeURIComponent(p)!==p)_.error(`\u6587\u4EF6\u540D ${p} \u672A\u7F16\u7801 \u4E0D\u4FDD\u5B58`),u.push(p);else{let f=ft(o,p);f?is(o,p,{...f,url:s.files[l]?.raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")}):o.push({name:`${p}`,url:s.files[l]?.raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")})}}),_.write(o,_t)}catch(s){throw _.error(`\u67E5\u627E Sub-Store Gist \u65F6\u53D1\u751F\u9519\u8BEF: ${s.message??s}`),s}Me(t)}catch(r){_.error(`\u6062\u590D\u8FDC\u7A0B\u914D\u7F6E\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${r.message??r}`),ke(t,new or("FAILED_TO_RESTORE_ARTIFACTS","Failed to restore artifacts",`Reason: ${r.message??r}`))}}function EP(e,t){let r=_.read(_t);Me(t,r)}function AP(e,t){let r=e.body;_.write(r,_t),Me(t)}async function wP(e,t){let{name:r}=e.params,n=_.read(_t),i=ft(n,r);i?Me(t,i):ke(t,new gr("RESOURCE_NOT_FOUND",`Artifact ${r} does not exist!`),404)}function CP(e,t){let r=e.body;if(!Pw(r.name)){ke(t,new kt("INVALID_ARTIFACT_NAME",`Artifact name ${r.name} is invalid.`));return}_.info(`\u6B63\u5728\u521B\u5EFA\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r.name}`);let n=_.read(_t);ft(n,r.name)?ke(t,new kt("DUPLICATE_KEY",`Artifact ${r.name} already exists.`)):(n.push(r),_.write(n,_t),Me(t,r,201))}function yP(e,t){let r=_.read(_t),n=e.params.name,i=ft(r,n);if(i){_.info(`\u6B63\u5728\u66F4\u65B0\u8FDC\u7A0B\u914D\u7F6E\uFF1A${i.name}`);let s={...i,...e.body};if(!Pw(s.name)){ke(t,new kt("INVALID_ARTIFACT_NAME",`Artifact name ${s.name} is invalid.`));return}is(r,n,s),_.write(r,_t),Me(t,s)}else ke(t,new kt("DUPLICATE_KEY",`Artifact ${n} already exists.`))}async function FP(e,t){let{name:r}=e.params;_.info(`\u6B63\u5728\u5220\u9664\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r}`);let n=_.read(_t);try{let i=ft(n,r);if(!i)throw new Error(`\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r}\u4E0D\u5B58\u5728\uFF01`);if(i.updated){let s={};s[encodeURIComponent(i.name)]={content:""},encodeURIComponent(i.name)!==i.name&&(s[i.name]={content:""});try{await Bh(s)}catch(o){_.error(`Function syncToGist: ${r} : ${o}`)}}Mi(n,r),_.write(n,_t),Me(t)}catch(i){_.error(`\u65E0\u6CD5\u5220\u9664\u8FDC\u7A0B\u914D\u7F6E\uFF1A${r}\uFF0C\u539F\u56E0\uFF1A${i}`),ke(t,new or("FAILED_TO_DELETE_ARTIFACT",`Failed to delete artifact ${r}`,`Reason: ${i}`))}}function Pw(e){return/^[a-zA-Z0-9._-]*$/.test(e)}async function Bh(e){let{gistToken:t,syncPlatform:r}=_.read(Mt);if(!t)return Promise.reject("\u672A\u8BBE\u7F6E GitHub Token\uFF01");let n=await new Wi({token:t,key:$a,syncPlatform:r}).upload(e),i={};try{i=JSON.parse(n.body)}catch{}let s=i?.html_url??i?.web_url,o=_.read(Mt);return s?(_.log(`\u540C\u6B65 Gist \u540E, \u627E\u5230 Sub-Store Gist: ${s}`),o.artifactStore=s,o.artifactStoreStatus="VALID"):(_.error("\u540C\u6B65 Gist \u540E, \u627E\u4E0D\u5230 Sub-Store Gist"),o.artifactStoreStatus="NOT FOUND"),_.write(o,Mt),n}function n1(e){_.read(_t)||_.write({},_t),e.get("/api/sync/artifacts",DP),e.get("/api/sync/artifact/:name",SP)}async function sn({type:e,name:t,platform:r,url:n,ua:i,content:s,mergeSources:o,ignoreFailedRemoteSub:u,ignoreFailedRemoteFile:l,produceType:p,produceOpts:f={},subscription:c,awaitCustomCache:m,$options:B,proxy:C,noCache:F,all:H}){if(r=r||"JSON",["subscription","sub"].includes(e)){let q;if(t){let pe=_.read(zt);if(q=ft(pe,t),!q)throw new Error(`\u627E\u4E0D\u5230\u8BA2\u9605 ${t}`)}else if(c)q=c;else throw new Error("\u672A\u63D0\u4F9B\u8BA2\u9605\u540D\u79F0\u6216\u8BA2\u9
|
|||
|
|
`),De=Array.isArray(se.process)&&se.process.length>0?await Rt.process({$files:Ce,$content:pe,$options:B,$file:se},se.process):{$content:pe,$files:Ce,$options:B};return(H?De:De?.$content)??""}}async function i1(){_.info("\u5F00\u59CB\u540C\u6B65\u6240\u6709\u8FDC\u7A0B\u914D\u7F6E...");let e=_.read(_t),t={};try{let r=[],n=[],i=_.read(zt),s=_.read(Yt),o=[],u=0;if(e.map(f=>{if(f.sync&&f.source){if(u++,f.type==="subscription"){let c=f.source,m=ft(i,c);m&&m.url&&!o.includes(c)&&o.push(c)}else if(f.type==="collection"){let c=ft(s,f.source);c&&Array.isArray(c.subscriptions)&&c.subscriptions.map(m=>{let B=ft(i,m);B&&B.url&&!o.includes(m)&&o.push(m)})}}}),u===0){_.info(`\u9700\u540C\u6B65\u7684\u914D\u7F6E: ${u}, \u603B\u6570: ${e.length}`);return}if(o.length>0&&await Promise.all(o.map(async f=>{try{await sn({type:"subscription",name:f,awaitCustomCache:!0})}catch{}})),await Promise.all(e.map(async f=>{try{if(f.sync&&f.source){_.info(`\u6B63\u5728\u540C\u6B65\u4E91\u914D\u7F6E\uFF1A${f.name}...`);let c=f.platform==="SurgeMac";c&&_.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External");let m=await sn({type:f.type,name:f.source,platform:f.platform,produceOpts:{"include-unsupported-proxy":f.includeUnsupportedProxy,useMihomoExternal:c}});t[encodeURIComponent(f.name)]={content:m},r.push(f.name)}}catch(c){_.error(`\u751F\u6210\u540C\u6B65\u914D\u7F6E ${f.name} \u53D1\u751F\u9519\u8BEF: ${c.message??c}`),n.push(f.name)}})),_.info(`${r.length} \u4E2A\u540C\u6B65\u914D\u7F6E\u751F\u6210\u6210\u529F: ${r.join(", ")}`),_.info(`${n.length} \u4E2A\u540C\u6B65\u914D\u7F6E\u751F\u6210\u5931\u8D25: ${n.join(", ")}`),r.length===0)throw new Error(`\u540C\u6B65\u914D\u7F6E ${n.join(", ")} \u751F\u6210\u5931\u8D25 \u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7`);let l=await Bh(t),p=JSON.parse(l.body);delete p.history,delete p.forks,delete p.owner,Object.values(p.files).forEach(f=>{delete f.content}),_.info("\u4E0A\u4F20\u914D\u7F6E\u54CD\u5E94:"),_.info(JSON.stringify(p,null,2));for(let f of e)if(f.sync&&f.source&&r.includes(f.name)){f.updated=new Date().getTime();let c=p.files,m;Array.isArray(c)&&(m=!0,c=Object.fromEntries(c.map(F=>[F.path,F])));let B=c[encodeURIComponent(f.name)]?.raw_url,C=m?B:B?.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1");_.info(`\u4E0A\u4F20\u914D\u7F6E\u5B8C\u6210
|
|||
|
|
\u6587\u4EF6\u5217\u8868: ${Object.keys(c).join(", ")}
|
|||
|
|
\u5F53\u524D\u6587\u4EF6: ${encodeURIComponent(f.name)}
|
|||
|
|
\u54CD\u5E94\u8FD4\u56DE\u7684\u539F\u59CB\u94FE\u63A5: ${B}
|
|||
|
|
\u5904\u7406\u5B8C\u7684\u65B0\u94FE\u63A5: ${C}`),f.url=C}if(_.write(e,_t),_.info("\u4E0A\u4F20\u914D\u7F6E\u6210\u529F"),n.length>0)throw new Error(`\u540C\u6B65\u914D\u7F6E\u6210\u529F ${r.length} \u4E2A, \u5931\u8D25 ${n.length} \u4E2A, \u8BE6\u60C5\u8BF7\u67E5\u770B\u65E5\u5FD7`);_.info(`\u540C\u6B65\u914D\u7F6E\u6210\u529F ${r.length} \u4E2A`)}catch(r){throw _.error(`\u540C\u6B65\u914D\u7F6E\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${r.message??r}`),r}}async function DP(e,t){_.info("\u5F00\u59CB\u540C\u6B65\u6240\u6709\u8FDC\u7A0B\u914D\u7F6E...");try{await i1(),Me(t)}catch(r){_.error(`\u540C\u6B65\u914D\u7F6E\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${r.message??r}`),ke(t,new or("FAILED_TO_SYNC_ARTIFACTS","Failed to sync all artifacts",`Reason: ${r.message??r}`))}}async function SP(e,t){let{name:r}=e.params;_.info(`\u5F00\u59CB\u540C\u6B65\u8FDC\u7A0B\u914D\u7F6E ${r}...`);let n=_.read(_t),i=ft(n,r);if(!i){_.error(`\u627E\u4E0D\u5230\u8FDC\u7A0B\u914D\u7F6E ${r}`),ke(t,new gr("RESOURCE_NOT_FOUND",`\u627E\u4E0D\u5230\u8FDC\u7A0B\u914D\u7F6E ${r}`),404);return}if(!i.source){_.error(`\u8FDC\u7A0B\u914D\u7F6E ${r} \u672A\u8BBE\u7F6E\u6765\u6E90`),ke(t,new gr("RESOURCE_HAS_NO_SOURCE",`\u8FDC\u7A0B\u914D\u7F6E ${r} \u672A\u8BBE\u7F6E\u6765\u6E90`),404);return}try{let s=i.platform==="SurgeMac";s&&_.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External");let o=await sn({type:i.type,name:i.source,platform:i.platform,produceOpts:{"include-unsupported-proxy":i.includeUnsupportedProxy,useMihomoExternal:s}});_.info(`\u6B63\u5728\u4E0A\u4F20\u914D\u7F6E\uFF1A${i.name}
|
|||
|
|
>>>${JSON.stringify(i,null,2)}`);let u=await Bh({[encodeURIComponent(i.name)]:{content:o}});i.updated=new Date().getTime();let l=JSON.parse(u.body);delete l.history,delete l.forks,delete l.owner,Object.values(l.files).forEach(B=>{delete B.content}),_.info("\u4E0A\u4F20\u914D\u7F6E\u54CD\u5E94:"),_.info(JSON.stringify(l,null,2));let p=l.files,f;Array.isArray(p)&&(f=!0,p=Object.fromEntries(p.map(B=>[B.path,B])));let c=p[encodeURIComponent(i.name)]?.raw_url,m=f?c:c?.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1");_.info(`\u4E0A\u4F20\u914D\u7F6E\u5B8C\u6210
|
|||
|
|
\u6587\u4EF6\u5217\u8868: ${Object.keys(p).join(", ")}
|
|||
|
|
\u5F53\u524D\u6587\u4EF6: ${encodeURIComponent(i.name)}
|
|||
|
|
\u54CD\u5E94\u8FD4\u56DE\u7684\u539F\u59CB\u94FE\u63A5: ${c}
|
|||
|
|
\u5904\u7406\u5B8C\u7684\u65B0\u94FE\u63A5: ${m}`),i.url=m,_.write(n,_t),Me(t,i)}catch(s){_.error(`\u8FDC\u7A0B\u914D\u7F6E ${i.name} \u53D1\u751F\u9519\u8BEF: ${s.message??s}`),ke(t,new or("FAILED_TO_SYNC_ARTIFACT",`Failed to sync artifact ${r}`,`Reason: ${s}`))}}var Rw=dh.find(e=>e.name==="Clash Pre-processor"),s1=new Map;async function zr(rawUrl="",ua,timeout,customProxy,skipCustomCache,awaitCustomCache,noCache,preprocess){let $arguments={},url=rawUrl.replace(/#noFlow$/,""),rawArgs=url.split("#");if(url=url.split("#")[0],rawArgs.length>1)try{$arguments=JSON.parse(decodeURIComponent(rawArgs[1]))}catch{for(let e of rawArgs[1].split("&")){let t=e.split("=")[0],r=e.split("=")[1];$arguments[t]=r==null||r===""?!0:decodeURIComponent(r)}}let{isNode,isStash,isLoon,isShadowRocket,isQX}=Qr(),{defaultProxy,defaultUserAgent,defaultTimeout,cacheThreshold:defaultCacheThreshold}=_.read(Mt),cacheThreshold=defaultCacheThreshold||1024,proxy=customProxy||defaultProxy;_.env.isNode&&(proxy=proxy||eval("process.env.SUB_STORE_BACKEND_DEFAULT_PROXY"));let userAgent=ua||defaultUserAgent||"clash.meta",requestTimeout=timeout||defaultTimeout||8e3,id=Fi(userAgent+url);$arguments?.cacheKey===!0&&(_.error("\u4F7F\u7528\u81EA\u5B9A\u4E49\u7F13\u5B58\u65F6 cacheKey \u7684\u503C\u4E0D\u80FD\u4E3A\u7A7A"),$arguments.cacheKey=void 0);let customCacheKey=$arguments?.cacheKey?`#sub-store-cached-custom-${$arguments?.cacheKey}`:void 0;if(customCacheKey&&!skipCustomCache){let e=_.read(customCacheKey),t=Ur.get(id);if(!noCache&&!$arguments?.noCache&&t)return _.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
|
|||
|
|
\u5B58\u5728\u6709\u6548\u7684\u5E38\u89C4\u7F13\u5B58
|
|||
|
|
\u4F7F\u7528\u5E38\u89C4\u7F13\u5B58\u4EE5\u907F\u514D\u91CD\u590D\u8BF7\u6C42`),t;if(e){if(awaitCustomCache){_.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
|
|||
|
|
\u672C\u6B21\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u66F4\u65B0\u7F13\u5B58`);try{await zr(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess)}catch(r){_.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`),_.info("\u4F7F\u7528\u4E50\u89C2\u7F13\u5B58\u7684\u6570\u636E\u5237\u65B0\u7F13\u5B58, \u9632\u6B62\u540E\u7EED\u8BF7\u6C42"),Ur.set(id,e)}}else _.info(`\u4E50\u89C2\u7F13\u5B58: URL ${url}
|
|||
|
|
\u672C\u6B21\u8FD4\u56DE\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}
|
|||
|
|
\u5E76\u8FDB\u884C\u8BF7\u6C42 \u5C1D\u8BD5\u5F02\u6B65\u66F4\u65B0\u7F13\u5B58`),zr(rawUrl.replace(/(\?|&)cacheKey=.*?(&|$)/,""),ua,timeout,proxy,!0,void 0,void 0,preprocess).catch(r=>{_.error(`\u4E50\u89C2\u7F13\u5B58: URL ${url} \u5F02\u6B65\u66F4\u65B0\u7F13\u5B58\u53D1\u751F\u9519\u8BEF ${r.message??r}`)});return e}}let downloadUrlMatch=url.split("#")[0].match(/^\/api\/(file|module)\/(.+)/);if(downloadUrlMatch){let e="";try{e=downloadUrlMatch?.[1];let t=downloadUrlMatch?.[2];if(t==null)throw new Error(`\u672C\u5730 ${e} URL \u65E0\u6548: ${url}`);t=decodeURIComponent(t);let r=e==="module"?Fn:Nt,n=ft(_.read(r),t);if(!n)throw new Error(`\u627E\u4E0D\u5230 ${e}: ${t}`);return e==="module"?n.content:await sn({type:"file",name:t})}catch(t){throw _.error(`Error when loading ${e}: ${url.split("#")[0]}.
|
|||
|
|
Reason: ${t}`),new Error(`\u65E0\u6CD5\u52A0\u8F7D ${e}: ${url}`)}}else if(url?.startsWith("/"))try{return require("fs").readFileSync(url.split("#")[0],"utf8")}catch(e){throw _.error(`Error when reading local file: ${url.split("#")[0]}.
|
|||
|
|
Reason: ${e}`),new Error(`\u65E0\u6CD5\u4ECE\u8BE5\u8DEF\u5F84\u8BFB\u53D6\u6587\u672C\u5185\u5BB9: ${url}`)}if(!isNode&&s1.has(id))return s1.get(id);let http=rs({headers:{"User-Agent":userAgent,...isStash&&proxy?{"X-Stash-Selected-Proxy":encodeURIComponent(proxy)}:{},...isShadowRocket&&proxy?{"X-Surge-Policy":proxy}:{}},timeout:requestTimeout}),result,cached=Ur.get(id);if(!noCache&&!$arguments?.noCache&&cached)_.info(`\u4F7F\u7528\u7F13\u5B58: ${url}, ${userAgent}`),result=cached,customCacheKey&&(_.info(`URL ${url}
|
|||
|
|
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),_.write(cached,customCacheKey));else{let e=$arguments?.insecure?isNode?{strictSSL:!1}:{insecure:!0}:void 0;_.info(`Downloading...
|
|||
|
|
User-Agent: ${userAgent}
|
|||
|
|
Timeout: ${requestTimeout}
|
|||
|
|
Proxy: ${proxy}
|
|||
|
|
Insecure: ${!!e}
|
|||
|
|
Preprocess: ${preprocess}
|
|||
|
|
URL: ${url}`);try{let{body:t,headers:r,statusCode:n}=await http.get({url,...proxy?{proxy}:{},...isLoon&&proxy?{node:proxy}:{},...isQX&&proxy?{opts:{policy:proxy}}:{},...proxy?lu(proxy):{},...e||{}});if(_.info(`statusCode: ${n}`),n<200||n>=400)throw new Error(`statusCode: ${n}`);if(r){let s=To(r);s&&xa.set(id,s)}if(t.replace(/\s/g,"").length===0)throw new Error(new Error("\u8FDC\u7A0B\u8D44\u6E90\u5185\u5BB9\u4E3A\u7A7A"));if(preprocess)try{Rw.test(t)&&(t=Rw.parse(t,!0))}catch(s){_.error(`Clash Pre-processor error: ${s}`)}let i=!0;if(cacheThreshold){let s=t.length/1024;s>cacheThreshold&&(_.info(`\u8D44\u6E90\u5927\u5C0F ${s.toFixed(2)} KB \u8D85\u8FC7\u4E86 ${cacheThreshold} KB, \u4E0D\u7F13\u5B58`),i=!1)}if(preprocess)try{let s=Rt.parse(t);(!Array.isArray(s)||s.length===0)&&(_.error(`URL ${url} \u4E0D\u5305\u542B\u6709\u6548\u8282\u70B9, \u4E0D\u7F13\u5B58`),i=!1)}catch(s){_.error(`URL ${url} \u5C1D\u8BD5\u89E3\u6790\u8282\u70B9\u5931\u8D25 ${s.message??s}, \u4E0D\u7F13\u5B58`),i=!1}i&&(Ur.set(id,t),customCacheKey&&(_.info(`URL ${url}
|
|||
|
|
\u5199\u5165\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),_.write(t,customCacheKey))),result=t}catch(t){if(customCacheKey){let r=_.read(customCacheKey);if(r)return _.info(`\u65E0\u6CD5\u4E0B\u8F7D URL ${url}: ${t.message??t}
|
|||
|
|
\u4F7F\u7528\u81EA\u5B9A\u4E49\u7F13\u5B58 ${$arguments?.cacheKey}`),r}throw new Error(`\u65E0\u6CD5\u4E0B\u8F7D URL ${url}: ${t.message??t}`)}}return $arguments?.validCheck&&await Bf(ka(await Bn(url,$arguments.flowUserAgent,void 0,proxy,$arguments.flowUrl))),isNode||s1.set(id,result),result}async function gl(e,t){let r=eI(),n=require("fs"),{pipeline:i}=require("stream/promises"),{Agent:s,interceptors:o,request:u}=r;_.info(`Downloading file...
|
|||
|
|
URL: ${e}
|
|||
|
|
File: ${t}`);let{body:l,statusCode:p}=await u(e,{dispatcher:new s().compose(o.redirect({maxRedirections:3,throwOnRedirect:!0}))});if(p!==200)throw new Error(`Failed to download file from ${e}`);let f=n.createWriteStream(t);return await i(l,f),_.info(`File downloaded from ${e} to ${t}`),t}var a1=Zr(xc());function u1(e){_.read(Mt)||_.write({},Mt),e.route("/api/settings").get(bP).patch(_P)}async function bP(e,t){try{let r=_.read(Mt);r||(r={},_.write(r,Mt)),r.avatarUrl||await $h(),r.artifactStore||await Ph(),Me(t,r)}catch(r){_.error(`Failed to get settings: ${r.message??r}`),ke(t,new or("FAILED_TO_GET_SETTINGS","Failed to get settings",`Reason: ${r.message??r}`))}}async function _P(e,t){try{let r={..._.read(Mt),...e.body};_.write(r,Mt),await $h(),await Ph(),Me(t,r)}catch(r){_.error(`Failed to update settings: ${r.message??r}`),ke(t,new or("FAILED_TO_UPDATE_SETTINGS","Failed to update settings",`Reason: ${r.message??r}`))}}async function $h(){let e=_.read(Mt),{githubUser:t,syncPlatform:r,githubProxy:n}=e;if(t)if(r==="gitlab")try{let i=await _.http.get({url:`https://gitlab.com/api/v4/users?username=${encodeURIComponent(t)}`,headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then(s=>JSON.parse(s.body));e.avatarUrl=i[0].avatar_url.replace(/(\?|&)s=\d+(&|$)/,"$1s=160$2"),_.write(e,Mt)}catch(i){_.error(`Failed to fetch GitLab avatar for User: ${t}. Reason: ${i.message??i}`)}else try{let i=await _.http.get({url:`${n?`${n}/`:""}https://api.github.com/users/${encodeURIComponent(t)}`,headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then(s=>JSON.parse(s.body));e.avatarUrl=i.avatar_url,_.write(e,Mt)}catch(i){_.error(`Failed to fetch GitHub avatar for User: ${t}. Reason: ${i.message??i}`)}}async function Ph(){_.log("Updating artifact store");let e=_.read(Mt),{gistToken:t,syncPlatform:r}=e;if(t){let n=new Wi({token:t,key:$a,syncPlatform:r});try{let i=await n.locate(),s=i?.html_url??i?.web_url;s?(_.log(`\u627E\u5230 Sub-Store Gist: ${s}`),e.artifactStore=s,e.artifactStoreStatus="VALID"):(_.error(`\u627E\u4E0D\u5230 Sub-Store Gist (${$a})`),e.artifactStoreStatus="NOT FOUND")}catch(i){_.error(`\u67E5\u627E Sub-Store Gist (${$a}) \u65F6\u53D1\u751F\u9519\u8BEF: ${i.message??i}`),e.artifactStoreStatus="ERROR"}_.write(e,Mt)}}function o1(e){e.get("/api/utils/env",Tw),e.get("/api/utils/backup",BP),e.get("/api/utils/refresh",IP),e.route("/api/storage").get((t,r)=>{r.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_data_${Wu(new Date)}.json`)}"`).send(_.env.isNode?JSON.stringify(_.cache):_.read("#sub-store"))}).post((t,r)=>{let{content:n}=t.body;try{if(n=JSON.parse(pt.decode(n)),Object.keys(n.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch{try{if(n=JSON.parse(n),Object.keys(n.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch(i){throw _.error(`\u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F
|
|||
|
|
Reason: ${i.message??i}`),new Error("\u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F")}}_.write(JSON.stringify(n,null," "),"#sub-store"),_.env.isNode&&(_.cache=n,_.persistCache()),zu(),Me(r)}),Qr().isNode?e.get("/",Tw):e.get("/",async(t,r)=>{r.set("location","https://sub-store.vercel.app/").status(302).end()}),Qr().isQX&&e.options("/",async(t,r)=>{r.status(200).end()}),e.all("/",(t,r)=>{r.send("Hello from sub-store, made with \u2764\uFE0F by Peng-YM")})}function Tw(e,t){e.query.share&&(js.feature.share=!0),t.set("Content-Type","application/json;charset=UTF-8").send(JSON.stringify({status:"success",data:{guide:"\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F \u60A8\u5F53\u524D\u770B\u5230\u7684\u662F\u540E\u7AEF\u7684\u54CD\u5E94. \u82E5\u60F3\u914D\u5408\u524D\u7AEF\u4F7F\u7528, \u53EF\u8BBF\u95EE\u5B98\u65B9\u524D\u7AEF https://sub-store.vercel.app \u540E\u81EA\u884C\u914D\u7F6E\u540E\u7AEF\u5730\u5740, \u6216\u4E00\u952E\u914D\u7F6E\u540E\u7AEF https://sub-store.vercel.app?api=https://a.com/xxx (\u5047\u8BBE https://a.com \u662F\u4F60\u540E\u7AEF\u7684\u57DF\u540D, /xxx \u662F\u81EA\u5B9A\u4E49\u8DEF\u5F84). \u9700\u6CE8\u610F HTTPS \u524D\u7AEF\u65E0\u6CD5\u8BF7\u6C42\u975E\u672C\u5730\u7684 HTTP \u540E\u7AEF(\u90E8\u5206\u6D4F\u89C8\u5668\u4E0A\u4E5F\u65E0\u6CD5\u8BBF\u95EE\u672C\u5730 HTTP \u540E\u7AEF). \u8BF7\u914D\u7F6E\u53CD\u4EE3\u6216\u5728\u5C40\u57DF\u7F51\u81EA\u5EFA HTTP \u524D\u7AEF. \u5982\u679C\u8FD8\u6709\u95EE\u9898, \u53EF\u67E5\u770B\u6B64\u6392\u67E5\u8BF4\u660E: https://t.me/zhetengsha/1068",...js}},null,2))}async function IP(e,t){await $h(),await Ph(),Ur.revokeAll(),tl.revokeAll(),xa.revokeAll(),Me(t)}async function Rh(e,t,r){let{gistToken:n,syncPlatform:i}=_.read(Mt);if(!n)throw new Error("GitHub Token is required for backup!");let s=new Wi({token:n,key:Om,syncPlatform:i}),o=_.read("#sub-store");o=o?JSON.parse(o):{},_.env.isNode&&(o=JSON.parse(JSON.stringify(_.cache)));let u,l=_.read(Mt),p=l.syncTime;switch(e){case"upload":try{if(u=_.read("#sub-store"),u=u?JSON.parse(u):{},_.env.isNode&&(u=JSON.parse(JSON.stringify(_.cache))),r==="plaintext"?(u.settings.gistToken="\u6062\u590D\u540E\u8BF7\u91CD\u65B0\u8BBE\u7F6E GitHub Token",u=JSON.stringify(u,null," ")):u=pt.encode(JSON.stringify(u,null," ")),_.info("\u4E0B\u8F7D\u5907\u4EFD, \u4E0E\u672C\u5730\u5185\u5BB9\u5BF9\u6BD4..."),await s.download(gf)===u){_.info("\u5185\u5BB9\u4E00\u81F4, \u65E0\u9700\u4E0A\u4F20\u5907\u4EFD");return}}catch(f){_.error(`${f.message??f}`)}l.syncTime=new Date().getTime(),_.write(l,Mt),u=_.read("#sub-store"),u=u?JSON.parse(u):{},_.env.isNode&&(u=JSON.parse(JSON.stringify(_.cache))),r==="plaintext"?(u.settings.gistToken="\u6062\u590D\u540E\u8BF7\u91CD\u65B0\u8BBE\u7F6E GitHub Token",u=JSON.stringify(u,null," ")):u=pt.encode(JSON.stringify(u,null," ")),_.info("\u4E0A\u4F20\u5907\u4EFD\u4E2D...");try{await s.upload({[gf]:{content:u}}),_.info("\u4E0A\u4F20\u5907\u4EFD\u5B8C\u6210")}catch(f){throw l.syncTime=p,_.write(l,Mt),f}break;case"download":_.info("\u8FD8\u539F\u5907\u4EFD\u4E2D..."),u=await s.download(gf);try{if(u=JSON.parse(pt.decode(u)),Object.keys(u.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch{try{if(u=JSON.parse(u),Object.keys(u.settings).length===0)throw new Error("\u5907\u4EFD\u6587\u4EF6\u5E94\u8BE5\u81F3\u5C11\u5305\u542B settings \u5B57\u6BB5")}catch(f){throw _.error(`Gist \u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F
|
|||
|
|
Reason: ${f.message??f}`),new Error("Gist \u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F")}}t&&(_.info(`\u4FDD\u7559\u539F\u6709\u8BBE\u7F6E ${t}`),t.split(",").forEach(f=>{a1.default.set(u,f,a1.default.get(o,f))})),_.write(JSON.stringify(u,null," "),"#sub-store"),_.env.isNode&&(_.cache=u,_.persistCache()),_.info("perform migration after restoring from gist..."),zu(),_.info("migration completed"),_.info("\u8FD8\u539F\u5907\u4EFD\u5B8C\u6210");break}}async function BP(e,t){let{action:r,keep:n,encode:i}=e.query,{gistToken:s}=_.read(Mt);if(!s)ke(t,new kt("GIST_TOKEN_NOT_FOUND","GitHub Token is required for backup!"));else try{await Rh(r,n,i),Me(t)}catch(o){_.error(`Failed to ${r} gist data.
|
|||
|
|
Reason: ${o.message??o}`),ke(t,new or("BACKUP_FAILED",`Failed to ${r} gist data!`,`Reason: ${o.message??o}`))}}_.read(zt)||_.write({},zt);function c1(e){e.get("/api/sub/flow/:name",$P),e.route("/api/sub/:name").get(RP).patch(TP).delete(OP),e.route("/api/subs").get(NP).post(PP).put(xP)}async function $P(e,t){let{name:r}=e.params,{url:n}=e.query;n&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605 URL: ${n}`);let i=_.read(zt),s=ft(i,r);if(!s){ke(t,new gr("RESOURCE_NOT_FOUND",`Subscription ${r} does not exist!`),404);return}if(s.source==="local"&&!["localFirst","remoteFirst"].includes(s.mergeSources)){if(s.subUserinfo){let o;if(/^https?:\/\//.test(s.subUserinfo))try{o=await Bn(void 0,void 0,void 0,s.proxy,s.subUserinfo)}catch(u){_.error(`\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${s.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(u)}`)}else o=s.subUserinfo;try{Me(t,{...ka(o)})}catch(u){_.error(`Failed to parse flow info for local subscription ${r}: ${u.message??u}`),ke(t,new kt("NO_FLOW_INFO","N/A","Failed to parse flow info"))}}else ke(t,new kt("NO_FLOW_INFO","N/A",`Local subscription ${r} has no flow information!`));return}try{n=`${n||s.url}`.split(/[\r\n]+/).map(p=>p.trim()).filter(p=>p.length)?.[0]||"";let o={},u=n.split("#");if(n=n.split("#")[0],u.length>1)try{o=JSON.parse(decodeURIComponent(u[1]))}catch{for(let p of u[1].split("&")){let f=p.split("=")[0],c=p.split("=")[1];o[f]=c==null||c===""?!0:decodeURIComponent(c)}}if(o.noFlow||!/^https?/.test(n)){ke(t,new kt("NO_FLOW_INFO","N/A",`Subscription ${r}: noFlow`));return}let l=await Bn(o?.insecure?`${n}#insecure`:n,o.flowUserAgent,void 0,s.proxy,o.flowUrl);if(!l&&!s.subUserinfo){ke(t,new or("NO_FLOW_INFO","No flow info","Failed to fetch flow headers"));return}try{let p=$f({resetDay:o.resetDay,startDate:o.startDate,cycleDays:o.cycleDays}),f;if(/^https?:\/\//.test(s.subUserinfo))try{f=await Bn(void 0,void 0,void 0,s.proxy,s.subUserinfo)}catch(m){_.error(`\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${s.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(m)}`)}else f=s.subUserinfo;let c={...ka([f,l].filter(m=>m).join("; "))};p!=null&&(c.remainingDays=p),Me(t,c)}catch(p){_.error(`Failed to parse flow info for local subscription ${r}: ${p.message??p}`),ke(t,new kt("NO_FLOW_INFO","N/A","Failed to parse flow info"))}}catch{ke(t,new No("URL_NOT_ACCESSIBLE",`The URL for subscription ${r} is inaccessible.`))}}function PP(e,t){let r=e.body;if(delete r.subscriptions,_.info(`\u6B63\u5728\u521B\u5EFA\u8BA2\u9605\uFF1A ${r.name}`),/\//.test(r.name)){ke(t,new kt("INVALID_NAME",`Subscription ${r.name} is invalid`));return}let n=_.read(zt);if(ft(n,r.name)){ke(t,new kt("DUPLICATE_KEY",`Subscription ${r.name} already exists.`));return}n.push(r),_.write(n,zt),Me(t,r,201)}function RP(e,t){let{name:r}=e.params,{raw:n}=e.query,i=_.read(zt),s=ft(i,r);delete s.subscriptions,s?n?t.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_subscription_${r}_${Wu(new Date)}.json`)}"`).send(JSON.stringify(s)):Me(t,s):ke(t,new gr("SUBSCRIPTION_NOT_FOUND",`Subscription ${r} does not exist`,404))}function TP(e,t){let{name:r}=e.params,n=e.body;delete n.subscriptions;let i=_.read(zt),s=ft(i,r);if(s){let o={...s,...n};if(_.info(`\u6B63\u5728\u66F4\u65B0\u8BA2\u9605\uFF1A ${r}`),r!==n.name){let u=_.read(Yt)||[];for(let f of u){let c=f.subscriptions.indexOf(r);c!==-1&&(f.subscriptions[c]=n.name)}let l=_.read(_t)||[];for(let f of l)f.type==="subscription"&&f.source==r&&(f.source=n.name);let p=_.read(Nt)||[];for(let f of p)f.sourceType==="subscription"&&f.sourceName==r&&(f.sourceName=n.name);_.write(u,Yt),_.write(l,_t),_.write(p,Nt)}is(i,r,o),_.write(i,zt),Me(t,o)}else ke(t,new gr("RESOURCE_NOT_FOUND",`Subscription ${r} does not exist!`),404)}function OP(e,t){let{name:r}=e.params;_.info(`\u5220\u9664\u8BA2\u9605\uFF1A${r}...`);let n=_.read(zt);Mi(n,r),_.write(n,zt);let i=_.read(Yt);for(let s of i)s.su
|
|||
|
|
\u8BF7\u6C42 User-Agent: ${n}`);let{url:i,subInfoUrl:s,subInfoUserAgent:o,ua:u,content:l,mergeSources:p,ignoreFailedRemoteFile:f,proxy:c,noCache:m,produceType:B}=e.query,C={_req:{method:e.method,url:e.url,path:e.path,query:e.query,params:e.params,headers:e.headers,body:e.body}};if(e.query.$options){try{C=JSON.parse(decodeURIComponent(e.query.$options))}catch{for(let q of e.query.$options.split("&")){let se=q.split("=")[0],ce=q.split("=")[1];C[se]=ce==null||ce===""?!0:decodeURIComponent(ce)}}_.info(`\u4F20\u5165 $options: ${JSON.stringify(C)}`)}i&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u6587\u4EF6 URL: ${i}`),c&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605\u4F7F\u7528\u4EE3\u7406/\u7B56\u7565 proxy: ${c}`),u&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u6587\u4EF6 User-Agent: ${u}`),s&&_.info(`\u6307\u5B9A\u83B7\u53D6\u6D41\u91CF\u7684 subInfoUrl: ${s}`),o&&_.info(`\u6307\u5B9A\u83B7\u53D6\u6D41\u91CF\u7684 subInfoUserAgent: ${o}`),l&&_.info(`\u6307\u5B9A\u672C\u5730\u6587\u4EF6: ${l}`),p&&_.info(`\u6307\u5B9A\u5408\u5E76\u6765\u6E90: ${p}`),f!=null&&f!==""&&_.info(`\u6307\u5B9A\u5FFD\u7565\u5931\u8D25\u7684\u8FDC\u7A0B\u6587\u4EF6: ${f}`),m&&_.info(`\u6307\u5B9A\u4E0D\u4F7F\u7528\u7F13\u5B58: ${m}`),B&&_.info(`\u6307\u5B9A\u751F\u4EA7\u7C7B\u578B: ${B}`);let F=_.read(Nt),H=ft(F,r);if(H)try{let q=await sn({type:"file",name:r,url:i,ua:u,content:l,mergeSources:p,ignoreFailedRemoteFile:f,$options:C,proxy:c,noCache:m,produceType:B,all:!0});try{if(s=s||H.subInfoUrl,s){let se=await Bn(s,o||H.subInfoUserAgent,void 0,c||H.proxy);se&&t.set("subscription-userinfo",Ju(se))}}catch(se){_.error(`\u6587\u4EF6 ${r} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(se)}`)}H.download&&t.set("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(H.displayName||H.name)}`),t.set("Content-Type","text/plain; charset=utf-8"),q?.$options?._res?.headers&&Object.entries(q.$options._res.headers).forEach(([se,ce])=>{t.set(se,ce)}),t.send(q?.$content??"")}catch(q){_.notify("\u{1F30D} Sub-Store \u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25",`\u274C \u65E0\u6CD5\u4E0B\u8F7D\u6587\u4EF6\uFF1A${r}\uFF01`,`\u{1F914} \u539F\u56E0\uFF1A${q.message??q}`),_.error(q.message??q),ke(t,new or("INTERNAL_SERVER_ERROR",`Failed to download file: ${r}`,`Reason: ${q.message??q}`))}else _.error(`\u{1F30D} Sub-Store \u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25
|
|||
|
|
\u274C \u672A\u627E\u5230\u6587\u4EF6\uFF1A${r}\uFF01`),ke(t,new gr("RESOURCE_NOT_FOUND",`File ${r} does not exist!`),404)}function KP(e,t){let{name:r}=e.params,{raw:n}=e.query,i=_.read(Nt),s=ft(i,r);s?n?t.set("content-type","application/json").set("content-disposition",`attachment; filename="${encodeURIComponent(`sub-store_file_${r}_${Wu(new Date)}.json`)}"`).send(JSON.stringify(s)):Me(t,s):ke(t,new gr("FILE_NOT_FOUND",`File ${r} does not exist`,404))}function VP(e,t){let{name:r}=e.params,n=e.body,i=_.read(Nt),s=ft(i,r);if(s){let o={...s,...n};if(_.info(`\u6B63\u5728\u66F4\u65B0\u6587\u4EF6\uFF1A${r}...`),r!==o.name){let u=_.read(_t)||[];for(let l of u)l.type==="file"&&l.source===s.name&&(l.source=o.name);_.write(u,_t)}is(i,r,o),_.write(i,Nt),Me(t,o)}else ke(t,new gr("RESOURCE_NOT_FOUND",`File ${r} does not exist!`),404)}function GP(e,t){let{name:r}=e.params;_.info(`\u6B63\u5728\u5220\u9664\u6587\u4EF6\uFF1A${r}`);let n=_.read(Nt);Mi(n,r),_.write(n,Nt),Me(t)}function zP(e,t){let r=_.read(Nt);Me(t,r.map(({content:n,...i})=>i))}function YP(e,t){let r=_.read(Nt);Me(t,r)}function WP(e,t){let r=e.body;_.write(r,Nt),Me(t)}function h1(e){_.read(Mn)||_.write([],Mn),e.post("/api/token",ZP),e.route("/api/token/:token").delete(JP),e.route("/api/tokens").get(XP)}function JP(e,t){let{token:r}=e.params;_.info(`\u6B63\u5728\u5220\u9664\uFF1A${r}`);let n=_.read(Mn);Mi(n,r,"token"),_.write(n,Mn),Me(t)}function XP(e,t){let{type:r,name:n}=e.query,i=_.read(Mn)||[];Me(t,r||n?i.filter(s=>(r?s.type===r:!0)&&(n?s.name===n:!0)):i)}async function ZP(e,t){if(!Qr().isNode)return ke(t,new kt("INVALID_ENV","This endpoint is only available in Node.js environment"));try{let{payload:r,options:n}=e.body,i=cw(),s=r?.type,o=r?.name;if(!s||!o)return ke(t,new kt("INVALID_PAYLOAD","payload type and name are required"));let u=r?.token;if(u!=null){if(typeof u!="string"||u.length<1)return ke(t,new kt("INVALID_CUSTOM_TOKEN",`Invalid custom token: ${u}`));if((_.read(Mn)||[]).find(c=>c.token===u&&c.type===s&&c.name===o))return ke(t,new kt("DUPLICATE_TOKEN",`Token ${u} already exists`))}if(s==="col"){if(!(_.read(Yt)||[]).find(c=>c.name===o))return ke(t,new kt("INVALID_COLLECTION",`collection ${o} not found`))}else if(s==="file"){if(!(_.read(Nt)||[]).find(c=>c.name===o))return ke(t,new kt("INVALID_FILE",`file ${o} not found`))}else if(s==="sub"){if(!(_.read(zt)||[]).find(c=>c.name===o))return ke(t,new kt("INVALID_SUB",`sub ${o} not found`))}else return ke(t,new kt("INVALID_TYPE",`type ${o} not supported`));let l=n?.expiresIn;if(n?.expiresIn!=null&&(l=i(n.expiresIn),l==null||isNaN(l)||l<=0))return ke(t,new kt("INVALID_EXPIRES_IN",`Invalid expiresIn option: ${n.expiresIn}`));let p=vz(),f=_.read(Mn)||[];if(!u)do u=p.customAlphabet(p.urlAlphabet)();while(f.find(c=>c.token===u&&c.type===s&&c.name===o));return f.push({...r,token:u,createdAt:Date.now(),expiresIn:l>0?n?.expiresIn:void 0,exp:l>0?Date.now()+l:void 0}),_.write(f,Mn),Me(t,{token:u})}catch(r){return ke(t,new or("TOKEN_SIGN_FAILED","Failed to sign token",`Reason: ${r.message??r}`))}}function p1(e){_.read(Fn)||_.write([],Fn),e.route("/api/module/:name").get(eR).patch(tR).delete(rR),e.route("/api/modules").get(nR).post(QP).put(iR)}function QP(e,t){let r=e.body;r.name=`${r.name??Fi(JSON.stringify(r))}`,_.info(`\u6B63\u5728\u521B\u5EFA\u6A21\u5757\uFF1A${r.name}`);let n=_.read(Fn);if(ft(n,r.name))return ke(t,new kt("DUPLICATE_KEY",e.body.name?`\u5DF2\u5B58\u5728 name \u4E3A ${r.name} \u7684\u6A21\u5757`:"\u5DF2\u5B58\u5728\u76F8\u540C\u7684\u6A21\u5757 \u8BF7\u52FF\u91CD\u590D\u6DFB\u52A0"));n.push(r),_.write(n,Fn),Me(t,r,201)}function eR(e,t){let{name:r}=e.params,n=_.read(Fn),i=ft(n,r);i?t.set("Content-Type","text/plain; charset=utf-8").send(i.content):ke(t,new gr("MODULE_NOT_FOUND",`Module ${r} does not exist`,404))}function tR(e,t){let{name:r}=e.params,n=e.body,i=_.read(Fn),s=ft(i,r);if(s){let o={...s,...n};_.info(`\u6B63\u5728\u66F4\u65B0\u6A21\u5757\uFF1A${r}...`),is(i,r,o),_.write(i,Fn),Me(t,o)}else ke(t,new gr("RESOURCE_NOT_FOUND",`Module ${r} does not exist!`),404)}function rR(e,t){let{name:r}=e.params;_.inf
|
|||
|
|
\u8BF7\u6C42 User-Agent: ${o}
|
|||
|
|
\u8BF7\u6C42 target: ${e.query.target}
|
|||
|
|
\u5B9E\u9645\u8F93\u51FA: ${s}`);let{url:u,ua:l,content:p,mergeSources:f,ignoreFailedRemoteSub:c,produceType:m,includeUnsupportedProxy:B,resultFormat:C,proxy:F,noCache:H}=e.query,q={_req:{method:e.method,url:e.url,path:e.path,query:e.query,params:e.params,headers:e.headers,body:e.body}};if(e.query.$options){try{q=JSON.parse(decodeURIComponent(e.query.$options))}catch{for(let Ce of e.query.$options.split("&")){let pe=Ce.split("=")[0],De=Ce.split("=")[1];q[pe]=De==null||De===""?!0:decodeURIComponent(De)}}_.info(`\u4F20\u5165 $options: ${JSON.stringify(q)}`)}u&&(_.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605 URL: ${u}`),/^https?:\/\//.test(u)||(p=u,_.info("URL \u4E0D\u662F\u94FE\u63A5\uFF0C\u89C6\u4E3A\u672C\u5730\u8BA2\u9605"))),p&&_.info(`\u6307\u5B9A\u672C\u5730\u8BA2\u9605: ${p}`),F&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605\u4F7F\u7528\u4EE3\u7406/\u7B56\u7565 proxy: ${F}`),l&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605 User-Agent: ${l}`),f&&_.info(`\u6307\u5B9A\u5408\u5E76\u6765\u6E90: ${f}`),c!=null&&c!==""&&_.info(`\u6307\u5B9A\u5FFD\u7565\u5931\u8D25\u7684\u8FDC\u7A0B\u8BA2\u9605: ${c}`),m&&_.info(`\u6307\u5B9A\u751F\u4EA7\u7C7B\u578B: ${m}`),B&&_.info(`\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${B}`),!B&&C1(s,o)&&(B=!0,_.info(`\u5F53\u524D\u5BA2\u6237\u7AEF\u53EF\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${B}`)),i&&_.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External"),H&&_.info(`\u6307\u5B9A\u4E0D\u4F7F\u7528\u7F13\u5B58: ${H}`);let se=_.read(zt),ce=ft(se,r);if(ce)try{ce.passThroughUA&&(_.info(`\u8BA2\u9605\u5F00\u542F\u4E86\u900F\u4F20 User-Agent, \u4F7F\u7528\u8BF7\u6C42\u7684 User-Agent: ${o}`),l=o);let Ce=await sn({type:"subscription",name:r,platform:s,url:u,ua:l,content:p,mergeSources:f,ignoreFailedRemoteSub:c,produceType:m,produceOpts:{"include-unsupported-proxy":B,useMihomoExternal:i},$options:q,proxy:F,noCache:H}),pe;if(ce.source!=="local"||["localFirst","remoteFirst"].includes(ce.mergeSources))try{u=`${u||ce.url}`.split(/[\r\n]+/).map(Ie=>Ie.trim()).filter(Ie=>Ie.length)?.[0]||"";let De={},me=u.split("#");if(u=u.split("#")[0],me.length>1)try{De=JSON.parse(decodeURIComponent(me[1]))}catch{for(let Ie of me[1].split("&")){let je=Ie.split("=")[0],et=Ie.split("=")[1];De[je]=et==null||et===""?!0:decodeURIComponent(et)}}!De.noFlow&&/^https?/.test(u)&&(pe=await Bn(De?.insecure?`${u}#insecure`:u,De.flowUserAgent,void 0,F||ce.proxy,De.flowUrl),pe&&t.set("subscription-userinfo",Ju(pe)))}catch(De){_.error(`\u8BA2\u9605 ${r} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(De)}`)}if(ce.subUserinfo){let De;if(/^https?:\/\//.test(ce.subUserinfo))try{De=await Bn(void 0,void 0,void 0,F||ce.proxy,ce.subUserinfo)}catch(me){_.error(`\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${ce.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(me)}`)}else De=ce.subUserinfo;t.set("subscription-userinfo",Ju([De,pe].filter(me=>me).join(";")))}s==="JSON"?(C==="nezha"?Ce=sC(Ce):C==="nezha-monitor"&&(n=/^\d+$/.test(n)?parseInt(n,10):Ce.findIndex(De=>De.name===n),Ce=await iC(Ce[n],n,e.query)),t.set("Content-Type","application/json;charset=utf-8").send(Ce)):t.send(Ce)}catch(Ce){_.notify("\u{1F30D} Sub-Store \u4E0B\u8F7D\u8BA2\u9605\u5931\u8D25",`\u274C \u65E0\u6CD5\u4E0B\u8F7D\u8BA2\u9605\uFF1A${r}\uFF01`,`\u{1F914} \u539F\u56E0\uFF1A${Ce.message??Ce}`),_.error(Ce.message??Ce),ke(t,new or("INTERNAL_SERVER_ERROR",`Failed to download subscription: ${r}`,`Reason: ${Ce.message??Ce}`))}else _.error(`\u{1F30D} Sub-Store \u4E0B\u8F7D\u8BA2\u9605\u5931\u8D25
|
|||
|
|
\u274C \u672A\u627E\u5230\u8BA2\u9605\uFF1A${r}\uFF01`),ke(t,new gr("RESOURCE_NOT_FOUND",`Subscription ${r} does not exist!`),404)}async function cc(e,t){let{name:r,nezhaIndex:n}=e.params,i=e.query.target==="SurgeMac",s=e.query.target||w1(e.headers)||"JSON",o=_.read(Yt),u=ft(o,r),l=e.headers["user-agent"]||e.headers["User-Agent"];_.info(`\u6B63\u5728\u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\uFF1A${r}
|
|||
|
|
\u8BF7\u6C42 User-Agent: ${l}
|
|||
|
|
\u8BF7\u6C42 target: ${e.query.target}
|
|||
|
|
\u5B9E\u9645\u8F93\u51FA: ${s}`);let{ignoreFailedRemoteSub:p,produceType:f,includeUnsupportedProxy:c,resultFormat:m,proxy:B,noCache:C}=e.query,F={_req:{method:e.method,url:e.url,path:e.path,query:e.query,params:e.params,headers:e.headers,body:e.body}};if(e.query.$options){try{F=JSON.parse(decodeURIComponent(e.query.$options))}catch{for(let H of e.query.$options.split("&")){let q=H.split("=")[0],se=H.split("=")[1];F[q]=se==null||se===""?!0:decodeURIComponent(se)}}_.info(`\u4F20\u5165 $options: ${JSON.stringify(F)}`)}if(B&&_.info(`\u6307\u5B9A\u8FDC\u7A0B\u8BA2\u9605\u4F7F\u7528\u4EE3\u7406/\u7B56\u7565 proxy: ${B}`),p!=null&&p!==""&&_.info(`\u6307\u5B9A\u5FFD\u7565\u5931\u8D25\u7684\u8FDC\u7A0B\u8BA2\u9605: ${p}`),f&&_.info(`\u6307\u5B9A\u751F\u4EA7\u7C7B\u578B: ${f}`),c&&_.info(`\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${c}`),!c&&C1(s,l)&&(c=!0,_.info(`\u5F53\u524D\u5BA2\u6237\u7AEF\u53EF\u5305\u542B\u5B98\u65B9/\u5546\u5E97\u7248/\u672A\u7EED\u8D39\u8BA2\u9605\u4E0D\u652F\u6301\u7684\u534F\u8BAE: ${c}`)),i&&_.info("\u624B\u52A8\u6307\u5B9A\u4E86 target \u4E3A SurgeMac, \u5C06\u4F7F\u7528 Mihomo External"),C&&_.info(`\u6307\u5B9A\u4E0D\u4F7F\u7528\u7F13\u5B58: ${C}`),u)try{let H=await sn({type:"collection",name:r,platform:s,ignoreFailedRemoteSub:p,produceType:f,produceOpts:{"include-unsupported-proxy":c,useMihomoExternal:i},$options:F,proxy:B,noCache:C,ua:l}),q,se=_.read(zt),ce=u.subscriptions;if(ce.length>0){let De=ft(se,ce[0]);if(De.source!=="local"||["localFirst","remoteFirst"].includes(De.mergeSources))try{let me=`${De.url}`.split(/[\r\n]+/).map(et=>et.trim()).filter(et=>et.length)?.[0]||"",Ie={},je=me.split("#");if(me=me.split("#")[0],je.length>1)try{Ie=JSON.parse(decodeURIComponent(je[1]))}catch{for(let et of je[1].split("&")){let he=et.split("=")[0],$e=et.split("=")[1];Ie[he]=$e==null||$e===""?!0:decodeURIComponent($e)}}!Ie.noFlow&&/^https?:/.test(me)&&(q=await Bn(Ie?.insecure?`${me}#insecure`:me,Ie.flowUserAgent,void 0,B||De.proxy||u.proxy,Ie.flowUrl))}catch(me){_.error(`\u7EC4\u5408\u8BA2\u9605 ${r} \u4E2D\u7684\u5B50\u8BA2\u9605 ${De.name} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${me.message??me}`)}if(De.subUserinfo){let me;if(/^https?:\/\//.test(De.subUserinfo))try{me=await Bn(void 0,void 0,void 0,B||De.proxy,De.subUserinfo)}catch(Ie){_.error(`\u7EC4\u5408\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${De.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(Ie)}`)}else me=De.subUserinfo;q=[me,q].filter(Ie=>Ie).join("; ")}}_.info(`\u7EC4\u5408\u8BA2\u9605 ${r} \u900F\u4F20\u7684\u7684\u6D41\u91CF\u4FE1\u606F: ${q}`);let Ce;if(/^https?:\/\//.test(u.subUserinfo))try{Ce=await Bn(void 0,void 0,void 0,B||u.proxy,u.subUserinfo)}catch(De){_.error(`\u7EC4\u5408\u8BA2\u9605 ${r} \u4F7F\u7528\u81EA\u5B9A\u4E49\u6D41\u91CF\u94FE\u63A5 ${u.subUserinfo} \u83B7\u53D6\u6D41\u91CF\u4FE1\u606F\u65F6\u53D1\u751F\u9519\u8BEF: ${JSON.stringify(De)}`)}else Ce=u.subUserinfo;let pe=[Ce,q].filter(De=>De).join("; ");pe&&t.set("subscription-userinfo",Ju(pe)),s==="JSON"?(m==="nezha"?H=sC(H):m==="nezha-monitor"&&(n=/^\d+$/.test(n)?parseInt(n,10):H.findIndex(De=>De.name===n),H=await iC(H[n],n,e.query)),t.set("Content-Type","application/json;charset=utf-8").send(H)):t.send(H)}catch(H){_.notify("\u{1F30D} Sub-Store \u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C \u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\u9519\u8BEF\uFF1A${r}\uFF01`,`\u{1F914} \u539F\u56E0\uFF1A${H}`),ke(t,new or("INTERNAL_SERVER_ERROR",`Failed to download collection: ${r}`,`Reason: ${H.message??H}`))}else _.error("\u{1F30D} Sub-Store \u4E0B\u8F7D\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C \u672A\u627E\u5230\u7EC4\u5408\u8BA2\u9605\uFF1A${r}\uFF01`),ke(t,new gr("RESOURCE_NOT_FOUND",`Collection ${r} does not exist!`),404)}async function iC(e,t,r){let n={code:0,message:"success",result:[]};try{let{isLoon:i,isSurge:s}=_.env;if(!i&&!s)throw new Error("\u4EC5\u652F\u6301 Loon \u548C Surge(ability=http-cli
|
|||
|
|
`),o=Array.isArray(r.process)&&r.process.length>0?await Rt.process({$files:i,$content:s,$file:r},r.process):{$content:s,$files:i};Me(t,{original:s,processed:o?.$content??""})}catch(r){_.error(r.message??r),ke(t,new or("INTERNAL_SERVER_ERROR","Failed to preview file",`Reason: ${r.message??r}`))}}async function OR(e,t){try{let r=e.body,n=e.query.target||"JSON",i;if(r.source==="local"&&!["localFirst","remoteFirst"].includes(r.mergeSources))i=r.content;else{let u={};if(i=await Promise.all(r.url.split(/[\r\n]+/).map(l=>l.trim()).filter(l=>l.length).map(async l=>{try{return await zr(l,r.ua,void 0,r.proxy,void 0,void 0,void 0,!0)}catch(p){return u[l]=p,_.error(`\u8BA2\u9605 ${r.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${l} \u53D1\u751F\u9519\u8BEF: ${p}`),""}})),Object.keys(u).length>0)if(r.ignoreFailedRemoteSub)r.ignoreFailedRemoteSub==="enabled"&&_.notify("\u{1F30D} Sub-Store \u9884\u89C8\u8BA2\u9605\u5931\u8D25",`\u274C ${r.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(u).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u8BA2\u9605 ${r.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(u).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);r.mergeSources==="localFirst"?i.unshift(r.content):r.mergeSources==="remoteFirst"&&i.push(r.content)}let s=(Array.isArray(i)?i:[i]).map(u=>Rt.parse(u)).flat();s.forEach((u,l)=>{u.id=l,u._subName=r.name,u._subDisplayName=r.displayName});let o=await Rt.process(s,r.process||[],n,{[r.name]:r});Me(t,{original:s,processed:o})}catch(r){_.error(r.message??r),ke(t,new or("INTERNAL_SERVER_ERROR","Failed to preview subscription",`Reason: ${r.message??r}`))}}async function NR(e,t){try{let r=_.read(zt),n=e.body,i=[...n.subscriptions],s=n.subscriptionTags;Array.isArray(s)&&s.length>0&&r.forEach(f=>{Array.isArray(f.tag)&&f.tag.length>0&&!i.includes(f.name)&&f.tag.some(c=>s.includes(c))&&i.push(f.name)});let o={},u={};if(await Promise.all(i.map(async f=>{let c=ft(r,f);try{let m;if(c.source==="local"&&!["localFirst","remoteFirst"].includes(c.mergeSources))m=c.content;else{let C={};if(m=await Promise.all(c.url.split(/[\r\n]+/).map(F=>F.trim()).filter(F=>F.length).map(async F=>{try{return await zr(F,c.ua,void 0,c.proxy,void 0,void 0,void 0,!0)}catch(H){return C[F]=H,_.error(`\u8BA2\u9605 ${c.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${F} \u53D1\u751F\u9519\u8BEF: ${H}`),""}})),Object.keys(C).length>0)if(c.ignoreFailedRemoteSub)c.ignoreFailedRemoteSub==="enabled"&&_.notify("\u{1F30D} Sub-Store \u9884\u89C8\u8BA2\u9605\u5931\u8D25",`\u274C ${c.name}`,`\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(C).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u8BA2\u9605 ${c.name} \u7684\u8FDC\u7A0B\u8BA2\u9605 ${Object.keys(C).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);c.mergeSources==="localFirst"?m.unshift(c.content):c.mergeSources==="remoteFirst"&&m.push(c.content)}let B=(Array.isArray(m)?m:[m]).map(C=>Rt.parse(C)).flat();B.forEach(C=>{C._subName=c.name,C._subDisplayName=c.displayName,C._collectionName=n.name,C._collectionDisplayName=n.displayName}),B=await Rt.process(B,c.process||[],"JSON",{[c.name]:c,_collection:n}),o[f]=B}catch(m){u[f]=m,_.error(`\u274C \u5904\u7406\u7EC4\u5408\u8BA2\u9605 ${n.name} \u4E2D\u7684\u5B50\u8BA2\u9605: ${c.name} \u65F6\u51FA\u73B0\u9519\u8BEF\uFF1A${m}\uFF01`)}})),Object.keys(u).length>0)if(n.ignoreFailedRemoteSub)n.ignoreFailedRemoteSub==="enabled"&&_.notify("\u{1F30D} Sub-Store \u9884\u89C8\u7EC4\u5408\u8BA2\u9605\u5931\u8D25",`\u274C ${n.name}`,`\u5B50\u8BA2\u9605 ${Object.keys(u).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);else throw new Error(`\u7EC4\u5408\u8BA2\u9605 ${n.name} \u7684\u5B50\u8BA2\u9605 ${Object.keys(u).join(", ")} \u53D1\u751F\u9519\u8BEF, \u8BF7\u67E5\u770B\u65E5\u5FD7`);let l=Array.prototype.concat.apply([],i.map(f=>o[f]||[]));l.forEach((f,c)=>{f.id=c,f._collectionName=n.name,f._collectionDisplayName=n.displayName});let p=await Rt.process(l,n.process||[],"JSON",{_collection:n});Me(t,{original:l,processed:p})}catch(r
|
|||
|
|
Reason: ${t.message??t}`),new Error("Gist \u5907\u4EFD\u6587\u4EF6\u6821\u9A8C\u5931\u8D25, \u65E0\u6CD5\u8FD8\u539F")}}data_url_post&&(_.info("[BACKEND] executing post-processing script"),eval(data_url_post)),_.write(JSON.stringify(content,null," "),"#sub-store"),_.cache=content,_.persistCache(),zu(),_.info(`[BACKEND] restored data from ${data_url}`)}).catch(e=>{throw _.error("[BACKEND] restore data failed"),console.error(e),e}))}}console.log(`
|
|||
|
|
\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505
|
|||
|
|
Sub-Store -- v${lf}
|
|||
|
|
\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505\u2505
|
|||
|
|
`),zu(),_1()})();
|
|||
|
|
/*! Bundled license information:
|
|||
|
|
|
|||
|
|
lodash/lodash.js:
|
|||
|
|
(**
|
|||
|
|
* @license
|
|||
|
|
* Lodash <https://lodash.com/>
|
|||
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|||
|
|
* Released under MIT license <https://lodash.com/license>
|
|||
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|||
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
ieee754/index.js:
|
|||
|
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|
|||
|
|
buffer/index.js:
|
|||
|
|
(*!
|
|||
|
|
* The buffer module from node.js, for the browser.
|
|||
|
|
*
|
|||
|
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|||
|
|
* @license MIT
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
jsrsasign/lib/jsrsasign.js:
|
|||
|
|
(*! CryptoJS v3.1.2 core-fix.js
|
|||
|
|
* code.google.com/p/crypto-js
|
|||
|
|
* (c) 2009-2013 by Jeff Mott. All rights reserved.
|
|||
|
|
* code.google.com/p/crypto-js/wiki/License
|
|||
|
|
* THIS IS FIX of 'core.js' to fix Hmac issue.
|
|||
|
|
* https://code.google.com/p/crypto-js/issues/detail?id=84
|
|||
|
|
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
|
|||
|
|
*)
|
|||
|
|
(*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|||
|
|
*)
|
|||
|
|
(*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|||
|
|
*)
|
|||
|
|
(*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
|
|||
|
|
*)
|
|||
|
|
(*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|||
|
|
*)
|
|||
|
|
*/
|
|||
|
|
/*! Bundled license information:
|
|||
|
|
|
|||
|
|
undici/lib/web/fetch/body.js:
|
|||
|
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|||
|
|
|
|||
|
|
undici/lib/web/websocket/frame.js:
|
|||
|
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|||
|
|
|
|||
|
|
depd/index.js:
|
|||
|
|
(*!
|
|||
|
|
* depd
|
|||
|
|
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
bytes/index.js:
|
|||
|
|
(*!
|
|||
|
|
* bytes
|
|||
|
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015 Jed Watson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
content-type/index.js:
|
|||
|
|
(*!
|
|||
|
|
* content-type
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
statuses/index.js:
|
|||
|
|
(*!
|
|||
|
|
* statuses
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
toidentifier/index.js:
|
|||
|
|
(*!
|
|||
|
|
* toidentifier
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
http-errors/index.js:
|
|||
|
|
(*!
|
|||
|
|
* http-errors
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
destroy/index.js:
|
|||
|
|
(*!
|
|||
|
|
* destroy
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
unpipe/index.js:
|
|||
|
|
(*!
|
|||
|
|
* unpipe
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
raw-body/index.js:
|
|||
|
|
(*!
|
|||
|
|
* raw-body
|
|||
|
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
ee-first/index.js:
|
|||
|
|
(*!
|
|||
|
|
* ee-first
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
on-finished/index.js:
|
|||
|
|
(*!
|
|||
|
|
* on-finished
|
|||
|
|
* Copyright(c) 2013 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/read.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
media-typer/index.js:
|
|||
|
|
(*!
|
|||
|
|
* media-typer
|
|||
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
mime-db/index.js:
|
|||
|
|
(*!
|
|||
|
|
* mime-db
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
mime-types/index.js:
|
|||
|
|
(*!
|
|||
|
|
* mime-types
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
type-is/index.js:
|
|||
|
|
(*!
|
|||
|
|
* type-is
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/json.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/raw.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/text.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/urlencoded.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/index.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
merge-descriptors/index.js:
|
|||
|
|
(*!
|
|||
|
|
* merge-descriptors
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
encodeurl/index.js:
|
|||
|
|
(*!
|
|||
|
|
* encodeurl
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
escape-html/index.js:
|
|||
|
|
(*!
|
|||
|
|
* escape-html
|
|||
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|||
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
parseurl/index.js:
|
|||
|
|
(*!
|
|||
|
|
* parseurl
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
finalhandler/index.js:
|
|||
|
|
(*!
|
|||
|
|
* finalhandler
|
|||
|
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/router/layer.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
methods/index.js:
|
|||
|
|
(*!
|
|||
|
|
* methods
|
|||
|
|
* Copyright(c) 2013-2014 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/router/route.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/router/index.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/middleware/init.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/middleware/query.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/view.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
safe-buffer/index.js:
|
|||
|
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|
|||
|
|
content-disposition/index.js:
|
|||
|
|
(*!
|
|||
|
|
* content-disposition
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
encodeurl/index.js:
|
|||
|
|
(*!
|
|||
|
|
* encodeurl
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
etag/index.js:
|
|||
|
|
(*!
|
|||
|
|
* etag
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
fresh/index.js:
|
|||
|
|
(*!
|
|||
|
|
* fresh
|
|||
|
|
* Copyright(c) 2012 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2016-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
range-parser/index.js:
|
|||
|
|
(*!
|
|||
|
|
* range-parser
|
|||
|
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
send/index.js:
|
|||
|
|
(*!
|
|||
|
|
* send
|
|||
|
|
* Copyright(c) 2012 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
forwarded/index.js:
|
|||
|
|
(*!
|
|||
|
|
* forwarded
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
proxy-addr/index.js:
|
|||
|
|
(*!
|
|||
|
|
* proxy-addr
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/utils.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/application.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
negotiator/index.js:
|
|||
|
|
(*!
|
|||
|
|
* negotiator
|
|||
|
|
* Copyright(c) 2012 Federico Romero
|
|||
|
|
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
accepts/index.js:
|
|||
|
|
(*!
|
|||
|
|
* accepts
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/request.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
cookie/index.js:
|
|||
|
|
(*!
|
|||
|
|
* cookie
|
|||
|
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
vary/index.js:
|
|||
|
|
(*!
|
|||
|
|
* vary
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/response.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
serve-static/index.js:
|
|||
|
|
(*!
|
|||
|
|
* serve-static
|
|||
|
|
* Copyright(c) 2010 Sencha Inc.
|
|||
|
|
* Copyright(c) 2011 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/express.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/index.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
tiny-lru/dist/tiny-lru.cjs:
|
|||
|
|
(**
|
|||
|
|
* tiny-lru
|
|||
|
|
*
|
|||
|
|
* @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|||
|
|
* @license BSD-3-Clause
|
|||
|
|
* @version 11.2.11
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
http-proxy/lib/http-proxy/passes/web-outgoing.js:
|
|||
|
|
(*!
|
|||
|
|
* Array of passes.
|
|||
|
|
*
|
|||
|
|
* A `pass` is just a function that is executed on `req, res, options`
|
|||
|
|
* so that you can easily add new checks while still keeping the base
|
|||
|
|
* flexible.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
http-proxy/lib/http-proxy/passes/web-incoming.js:
|
|||
|
|
(*!
|
|||
|
|
* Array of passes.
|
|||
|
|
*
|
|||
|
|
* A `pass` is just a function that is executed on `req, res, options`
|
|||
|
|
* so that you can easily add new checks while still keeping the base
|
|||
|
|
* flexible.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
http-proxy/lib/http-proxy/passes/ws-incoming.js:
|
|||
|
|
(*!
|
|||
|
|
* Array of passes.
|
|||
|
|
*
|
|||
|
|
* A `pass` is just a function that is executed on `req, socket, options`
|
|||
|
|
* so that you can easily add new checks while still keeping the base
|
|||
|
|
* flexible.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
http-proxy/index.js:
|
|||
|
|
(*!
|
|||
|
|
* Caron dimonio, con occhi di bragia
|
|||
|
|
* loro accennando, tutte le raccoglie;
|
|||
|
|
* batte col remo qualunque s’adagia
|
|||
|
|
*
|
|||
|
|
* Charon the demon, with the eyes of glede,
|
|||
|
|
* Beckoning to them, collects them all together,
|
|||
|
|
* Beats with his oar whoever lags behind
|
|||
|
|
*
|
|||
|
|
* Dante - The Divine Comedy (Canto III)
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-extglob/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|||
|
|
* Licensed under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-glob/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-number/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
to-regex-range/index.js:
|
|||
|
|
(*!
|
|||
|
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
fill-range/index.js:
|
|||
|
|
(*!
|
|||
|
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
|
* Licensed under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-plain-object/dist/is-plain-object.js:
|
|||
|
|
(*!
|
|||
|
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
*/
|