diff --git a/backend/dist/sub-store-parser.loon.min.js b/backend/dist/sub-store-parser.loon.min.js index a02f64f..c058682 100644 --- a/backend/dist/sub-store-parser.loon.min.js +++ b/backend/dist/sub-store-parser.loon.min.js @@ -6,11 +6,11 @@ * ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗ * ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ * Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket! - * @updated: 2022/5/25 下午10:33:28 + * @updated: 2022/5/25 下午10:59:51 * @version: 1.6 * @author: Peng-YM * @github: https://github.com/Peng-YM/Sub-Store * @documentation: https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46 */ -!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|c(e,n),i=t(o),a=i.write(e,n);return a!==o&&(i=i.slice(0,a)),i}(e,n);if(ArrayBuffer.isView(e))return a(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function c(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||P(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return k(t).length;default:if(i)return o?-1:I(t).length;e=(""+e).toLowerCase(),i=!0}}function u(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:l(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):l(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function l(t,e,r,n,o){var i,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var p=-1;for(i=r;is&&(r=s-c),i=r;i>=0;i--){for(var l=!0,f=0;fo&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function g(t,e,r){return 0===e&&r===t.length?_$base64Js_1.fromByteArray(t):_$base64Js_1.fromByteArray(t.slice(e,r))}function v(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:u>223?3:u>191?2:1;if(o+l<=r)switch(l){case 1:u<128&&(p=u);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)>127&&(p=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(p=c)}null===p?(p=65533,l=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),o+=l}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return b(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return g(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===r.compare(this,t)},r.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),""},r.prototype.compare=function(t,e,n,o,i){if(P(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),c=Math.min(a,s),u=this.slice(o,i),p=t.slice(e,n),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return f(this,t,e,r);case"utf8":case"utf-8":return h(this,t,e,r);case"ascii":return d(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return y(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function b(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,o,i,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),_$ieee754_3.write(t,e,r,n,52,8),r+8}r.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},r.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},r.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),_$ieee754_3.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},r.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},r.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},r.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},r.prototype.copy=function(t,e,n,o){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e=0;--a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return i},r.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!r.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){var i=t.charCodeAt(0);("utf8"===o&&i<128||"latin1"===o)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function P(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$common_7={};function isNothing(t){return null==t}_$common_7.isNothing=isNothing,_$common_7.isObject=function(t){return"object"==typeof t&&null!==t},_$common_7.toArray=function(t){return Array.isArray(t)?t:isNothing(t)?[]:[t]},_$common_7.repeat=function(t,e){var r,n="";for(r=0;r0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(n-1));)if(n-=1,this.position-n>e/2-1){r=" ... ",n+=5;break}for(o="",i=this.position;ie/2-1){o=" ... ",i-=5;break}return a=this.buffer.slice(n,i),_$common_7.repeat(" ",t)+r+a+o+"\n"+_$common_7.repeat(" ",t+this.position-n+r.length)+"^"},Mark.prototype.toString=function(t){var e,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(r+=":\n"+e),r},_$mark_11=Mark;var TYPE_CONSTRUCTOR_OPTIONS=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"],_$type_18=function(t,e){var r,n;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(e))throw new _$exception_9('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(r=e.styleAliases||null,n={},null!==r&&Object.keys(r).forEach((function(t){r[t].forEach((function(e){n[String(e)]=t}))})),n),-1===YAML_NODE_KINDS.indexOf(this.kind))throw new _$exception_9('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')},_$schema_12={};function compileList(t,e,r){var n=[];return t.include.forEach((function(t){r=compileList(t,e,r)})),t[e].forEach((function(t){r.forEach((function(e,r){e.tag===t.tag&&e.kind===t.kind&&n.push(r)})),r.push(t)})),r.filter((function(t,e){return-1===n.indexOf(e)}))}function Schema(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach((function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new _$exception_9("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=compileList(this,"implicit",[]),this.compiledExplicit=compileList(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{}};function n(t){r[t.kind][t.tag]=r.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/,_$float_21=new _$type_18("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!YAML_FLOAT_PATTERN.test(t)||"_"===t[t.length-1])},construct:function(t){var e,r,n,o;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach((function(t){o.unshift(parseFloat(t,10))})),e=0,n=1,o.forEach((function(t){e+=t*n,n*=60})),r*e):r*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||_$common_7.isNegativeZero(t))},represent:function(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_$common_7.isNegativeZero(t))return"-0.0";return r=t.toString(10),SCIENTIFIC_WITHOUT_DOT.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),_$json_17=new _$schema_12({include:[_$failsafe_16],implicit:[_$null_28,_$bool_20,_$int_22,_$float_21]}),_$core_13=new _$schema_12({include:[_$json_17]}),YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),_$timestamp_34=new _$type_18("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==YAML_DATE_REGEXP.exec(t)||null!==YAML_TIMESTAMP_REGEXP.exec(t))},construct:function(t){var e,r,n,o,i,a,s,c,u=0,p=null;if(null===(e=YAML_DATE_REGEXP.exec(t))&&(e=YAML_TIMESTAMP_REGEXP.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,o=+e[3],!e[4])return new Date(Date.UTC(r,n,o));if(i=+e[4],a=+e[5],s=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(p=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(p=-p)),c=new Date(Date.UTC(r,n,o,i,a,s,u)),p&&c.setTime(c.getTime()-p),c},instanceOf:Date,represent:function(t){return t.toISOString()}}),_$merge_27=new _$type_18("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),NodeBuffer;try{var _require=require;NodeBuffer=_require("buffer").Buffer}catch(__){}var BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",_$binary_19=new _$type_18("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,r,n=0,o=t.length,i=BASE64_MAP;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8==0},construct:function(t){var e,r,n=t.replace(/[\r\n=]/g,""),o=n.length,i=BASE64_MAP,a=0,s=[];for(e=0;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|i.indexOf(n.charAt(e));return 0==(r=o%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===r?(s.push(a>>10&255),s.push(a>>2&255)):12===r&&s.push(a>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(s):new NodeBuffer(s):s},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,i=t.length,a=BASE64_MAP;for(e=0;e>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]),o=(o<<8)+t[e];return 0==(r=i%3)?(n+=a[o>>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]):2===r?(n+=a[o>>10&63],n+=a[o>>4&63],n+=a[o<<2&63],n+=a[64]):1===r&&(n+=a[o>>2&63],n+=a[o<<4&63],n+=a[64],n+=a[64]),n}}),_hasOwnProperty=Object.prototype.hasOwnProperty,_toString=Object.prototype.toString,_$omap_29=new _$type_18("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,r,n,o,i,a=[],s=t;for(e=0,r=s.length;e3)return!1;if("/"!==e[e.length-n.length-1])return!1}return!0},construct:function(t){var e=t,r=/\/([gim]*)$/.exec(t),n="";return"/"===e[0]&&(r&&(n=r[1]),e=e.slice(1,e.length-n.length-1)),new RegExp(e,n)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}}),esprima;try{var ___require_23=require;esprima=___require_23("esprima")}catch(_){"undefined"!=typeof window&&(esprima=window.esprima)}var _$function_23=new _$type_18("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",r=esprima.parse(e,{range:!0});return"Program"===r.type&&1===r.body.length&&"ExpressionStatement"===r.body[0].type&&("ArrowFunctionExpression"===r.body[0].expression.type||"FunctionExpression"===r.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,r="("+t+")",n=esprima.parse(r,{range:!0}),o=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"ArrowFunctionExpression"!==n.body[0].expression.type&&"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach((function(t){o.push(t.name)})),e=n.body[0].expression.body.range,"BlockStatement"===n.body[0].expression.body.type?new Function(o,r.slice(e[0]+1,e[1]-1)):new Function(o,"return "+r.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}}),_$default_full_14=_$schema_12.DEFAULT=new _$schema_12({include:[_$default_safe_15],explicit:[_$undefined_25,_$regexp_24,_$function_23]}),_$loader_10={},___hasOwnProperty_10=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(t){return Object.prototype.toString.call(t)}function is_EOL(t){return 10===t||13===t}function is_WHITE_SPACE(t){return 9===t||32===t}function is_WS_OR_EOL(t){return 9===t||32===t||10===t||13===t}function is_FLOW_INDICATOR(t){return 44===t||91===t||93===t||123===t||125===t}function fromHexCode(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function simpleEscapeSequence(t){return 48===t?"\0":97===t?"\x07":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"\x1b":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"\x85":95===t?"\xa0":76===t?"\u2028":80===t?"\u2029":""}function charFromCodepoint(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256),i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||_$default_full_14,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function generateError(t,e){return new _$exception_9(e,new _$mark_11(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function throwError(t,e){throw generateError(t,e)}function throwWarning(t,e){t.onWarning&&t.onWarning.call(null,generateError(t,e))}var directiveHandlers={YAML:function(t,e,r){var n,o,i;null!==t.version&&throwError(t,"duplication of %YAML directive"),1!==r.length&&throwError(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&throwError(t,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),i=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,1!==i&&2!==i&&throwWarning(t,"unsupported YAML version of the document")},TAG:function(t,e,r){var n,o;2!==r.length&&throwError(t,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],PATTERN_TAG_HANDLE.test(n)||throwError(t,"ill-formed tag handle (first argument) of the TAG directive"),___hasOwnProperty_10.call(t.tagMap,n)&&throwError(t,'there is a previously declared suffix for "'+n+'" tag handle'),PATTERN_TAG_URI.test(o)||throwError(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[n]=o}};function captureSegment(t,e,r,n){var o,i,a,s;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,i=t.anchor,a=[],s=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)a.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),a.push(t.result),skipSeparationSpace(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)throwError(t,"bad indentation of a sequence entry");else if(t.lineIndente?h=1:t.lineIndent===e?h=0:t.lineIndente?h=1:t.lineIndent===e?h=0:t.lineIndente)&&(composeNode(t,e,CONTEXT_BLOCK_OUT,!0,o)&&(_?h=t.result:d=t.result),_||(storeMappingPair(t,p,l,f,h,d,i,a),f=h=d=null),skipSeparationSpace(t,!0,-1),s=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==s)throwError(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===o?throwError(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?throwError(t,"repeat of an indentation width identifier"):(p=e+o-1,u=!0)}if(is_WHITE_SPACE(i)){do{i=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(i));if(35===i)do{i=t.input.charCodeAt(++t.position)}while(!is_EOL(i)&&0!==i)}for(;0!==i;){for(readLineBreak(t),t.lineIndent=0,i=t.input.charCodeAt(t.position);(!u||t.lineIndentp&&(p=t.lineIndent),is_EOL(i))l++;else{if(t.lineIndent0){for(o=a,i=0;o>0;o--)(a=fromHexCode(s=t.input.charCodeAt(++t.position)))>=0?i=(i<<4)+a:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(i),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(s)?(captureSegment(t,r,n,!0),writeFoldedLines(t,skipSeparationSpace(t,!1,e)),r=n=t.position):t.position===t.lineStart&&testDocumentSeparator(t)?throwError(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}throwError(t,"unexpected end of the stream within a double quoted scalar")}(t,l)?_=!0:function(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&throwError(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),___hasOwnProperty_10.call(t.anchorMap,r)||throwError(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],skipSeparationSpace(t,!0,-1),!0}(t)?(_=!0,null===t.tag&&null===t.anchor||throwError(t,"alias node should not have any properties")):function(t,e,r){var n,o,i,a,s,c,u,p,l=t.kind,f=t.result;if(is_WS_OR_EOL(p=t.input.charCodeAt(t.position))||is_FLOW_INDICATOR(p)||35===p||38===p||42===p||33===p||124===p||62===p||39===p||34===p||37===p||64===p||96===p)return!1;if((63===p||45===p)&&(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n)))return!1;for(t.kind="scalar",t.result="",o=i=t.position,a=!1;0!==p;){if(58===p){if(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n))break}else if(35===p){if(is_WS_OR_EOL(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&testDocumentSeparator(t)||r&&is_FLOW_INDICATOR(p))break;if(is_EOL(p)){if(s=t.line,c=t.lineStart,u=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){a=!0,p=t.input.charCodeAt(t.position);continue}t.position=i,t.line=s,t.lineStart=c,t.lineIndent=u;break}}a&&(captureSegment(t,o,i,!1),writeFoldedLines(t,t.line-s),o=i=t.position,a=!1),is_WHITE_SPACE(p)||(i=t.position+1),p=t.input.charCodeAt(++t.position)}return captureSegment(t,o,i,!1),!!t.result||(t.kind=l,t.result=f,!1)}(t,l,CONTEXT_FLOW_IN===r)&&(_=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===h&&(_=s&&readBlockSequence(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&throwError(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),c=0,u=t.implicitTypes.length;c tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result)?(t.result=p.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):throwError(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):throwError(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||_}function readDocument(t){var e,r,n,o,i=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(o=t.input.charCodeAt(t.position))&&(skipSeparationSpace(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==o));){for(a=!0,o=t.input.charCodeAt(++t.position),e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&throwError(t,"directive name must not be less than one character in length");0!==o;){for(;is_WHITE_SPACE(o);)o=t.input.charCodeAt(++t.position);if(35===o){do{o=t.input.charCodeAt(++t.position)}while(0!==o&&!is_EOL(o));break}if(is_EOL(o))break;for(e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==o&&readLineBreak(t),___hasOwnProperty_10.call(directiveHandlers,r)?directiveHandlers[r](t,r,n):throwWarning(t,'unknown document directive "'+r+'"')}skipSeparationSpace(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,skipSeparationSpace(t,!0,-1)):a&&throwError(t,"directives end mark is expected"),composeNode(t,t.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(t,!0,-1),t.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(t.input.slice(i,t.position))&&throwWarning(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&testDocumentSeparator(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,skipSeparationSpace(t,!0,-1)):t.position0?t.charCodeAt(i-1):null,h=h&&isPlainSafe(a,s)}else{for(i=0;in&&" "!==t[f+1],f=i);else if(!isPrintable(a))return STYLE_DOUBLE;s=i>0?t.charCodeAt(i-1):null,h=h&&isPlainSafe(a,s)}p=p||l&&i-f-1>n&&" "!==t[f+1]}return u||p?r>9&&needIndentIndicator(t)?STYLE_DOUBLE:p?STYLE_FOLDED:STYLE_LITERAL:h&&!o(t)?STYLE_PLAIN:STYLE_SINGLE}function writeScalar(t,e,r,n){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,r),i=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,a,t.indent,i,(function(e){return function(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r"+blockHeader(e,t.indent)+dropEndingNewline(indentString(function(t,e){for(var r,n,o,i=/(\n+)([^\n]*)/g,a=(o=-1!==(o=t.indexOf("\n"))?o:t.length,i.lastIndex=o,foldLine(t.slice(0,o),e)),s="\n"===t[0]||" "===t[0];n=i.exec(t);){var c=n[1],u=n[2];r=" "===u[0],a+=c+(s||r||""===u?"":"\n")+foldLine(u,e),s=r}return a}(e,i),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",i=0;i=55296&&e<=56319&&(r=t.charCodeAt(i+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),i++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[i]:n||encodeHex(e);return o}(e)+'"';default:throw new _$exception_9("impossible error: invalid scalar style")}}()}function blockHeader(t,e){var r=needIndentIndicator(t)?String(e):"",n="\n"===t[t.length-1];return r+(!n||"\n"!==t[t.length-2]&&"\n"!==t?n?"":"-":"+")+"\n"}function dropEndingNewline(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function foldLine(t,e){if(""===t||" "===t[0])return t;for(var r,n,o=/ [^ ]/g,i=0,a=0,s=0,c="";r=o.exec(t);)(s=r.index)-i>e&&(n=a>i?a:s,c+="\n"+t.slice(i,n),i=n+1),a=s;return c+="\n",t.length-i>e&&a>i?c+=t.slice(i,a)+"\n"+t.slice(a+1):c+=t.slice(i),c.slice(1)}function detectType(t,e,r){var n,o,i,a,s,c;for(i=0,a=(o=r?t.explicitTypes:t.implicitTypes).length;i tag resolver accepts not "'+c+'" style');n=s.represent[c](e,c)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,i){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var a=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(o=!1),c&&t.usedDuplicates[s])t.dump="*ref_"+s;else{if(u&&c&&!t.usedDuplicates[s]&&(t.usedDuplicates[s]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,i,a,s,c,u,p="",l=t.tag,f=Object.keys(r);if(!0===t.sortKeys)f.sort();else if("function"==typeof t.sortKeys)f.sort(t.sortKeys);else if(t.sortKeys)throw new _$exception_9("sortKeys must be a boolean or a function");for(o=0,i=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+="?":u+="? "),u+=t.dump,c&&(u+=generateNextLine(t,e)),writeNode(t,e+1,s,!0,c)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=t.dump));t.tag=l,t.dump=p||"{}"}(t,e,t.dump,o),c&&(t.dump="&ref_"+s+t.dump)):(function(t,e,r){var n,o,i,a,s,c="",u=t.tag,p=Object.keys(r);for(n=0,o=p.length;n1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,a,!1,!1)&&(c+=s+=t.dump));t.tag=u,t.dump="{"+c+"}"}(t,e,t.dump),c&&(t.dump="&ref_"+s+" "+t.dump));else if("[object Array]"===a){var p=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,i,a="",s=t.tag;for(o=0,i=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],i=[];for(function t(e,r,n){var o,i,a;if(null!==e&&"object"==typeof e)if(-1!==(i=r.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,a=e.length;i0?o-4:o;for(r=0;r>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===i&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,a[s++]=255&e),1===i&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,a=r-n;ia?a:i+16383));return 1===n?(e=t[r-1],o.push(lookup[e>>2]+lookup[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),o.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",__i_1=0,len=code.length;__i_10)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function encodeChunk(t,e,r){for(var n,o,i=[],a=e;a>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return i.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,p=-7,l=r?o-1:0,f=r?-1:1,h=t[e+l];for(l+=f,i=h&(1<<-p)-1,h>>=-p,p+=s;p>0;i=256*i+t[e+l],l+=f,p-=8);for(a=i&(1<<-p)-1,i>>=-p,p+=n;p>0;a=256*a+t[e+l],l+=f,p-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var a,s,c,u=8*i-o-1,p=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=p?(s=0,a=p):a+l>=1?(s=(e*c-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=d,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,u-=8);t[r+h-d]|=128*_}},_$base64_4={exports:{}};(function(t,e){(function(){!function(t,e){var r,n;"object"==typeof _$base64_4.exports?_$base64_4.exports=e():"function"==typeof define&&define.amd?define(e):(r=t.Base64,(n=e()).noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:this,(function(){"use strict";var t,r="function"==typeof atob,n="function"==typeof btoa,o="function"==typeof e,i="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),c=(t={},s.forEach((function(e,r){return t[e]=r})),t),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,p=String.fromCharCode.bind(String),l="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t,e){return void 0===e&&(e=function(t){return t}),new Uint8Array(Array.prototype.slice.call(t,0).map(e))},f=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"}))},h=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(t){for(var e,r,n,o,i="",a=t.length%3,c=0;c255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");i+=s[(e=r<<16|n<<8|o)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return a?i.slice(0,a-3)+"===".substring(a):i},_=n?function(t){return btoa(t)}:o?function(t){return e.from(t,"binary").toString("base64")}:d,y=o?function(t){return e.from(t).toString("base64")}:function(t){for(var e=[],r=0,n=t.length;r>>6)+p(128|63&e):p(224|e>>>12&15)+p(128|e>>>6&63)+p(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return p(240|e>>>18&7)+p(128|e>>>12&63)+p(128|e>>>6&63)+p(128|63&e)},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,w=function(t){return t.replace(v,g)},b=o?function(t){return e.from(t,"utf8").toString("base64")}:a?function(t){return y(a.encode(t))}:function(t){return _(w(t))},E=function(t,e){return void 0===e&&(e=!1),e?f(b(t)):b(t)},S=function(t){return E(t,!0)},A=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return p(55296+(e>>>10))+p(56320+(1023&e));case 3:return p((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return p((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},R=function(t){return t.replace(A,O)},L=function(t){if(t=t.replace(/\s+/g,""),!u.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",i=0;i>16&255):64===n?p(e>>16&255,e>>8&255):p(e>>16&255,e>>8&255,255&e);return o},C=r?function(t){return atob(h(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:L,T=o?function(t){return l(e.from(t,"base64"))}:function(t){return l(C(t),(function(t){return t.charCodeAt(0)}))},x=function(t){return T(k(t))},I=o?function(t){return e.from(t,"base64").toString("utf8")}:i?function(t){return i.decode(T(t))}:function(t){return R(C(t))},k=function(t){return h(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},N=function(t){return I(k(t))},P=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},$=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,P(e))};t("fromBase64",(function(){return N(this)})),t("toBase64",(function(t){return E(this,t)})),t("toBase64URI",(function(){return E(this,!0)})),t("toBase64URL",(function(){return E(this,!0)})),t("toUint8Array",(function(){return x(this)}))},F=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,P(e))};t("toBase64",(function(t){return m(this,t)})),t("toBase64URI",(function(){return m(this,!0)})),t("toBase64URL",(function(){return m(this,!0)}))},j={version:"3.7.2",VERSION:"3.7.2",atob:C,atobPolyfill:L,btoa:_,btoaPolyfill:d,fromBase64:N,toBase64:E,encode:E,encodeURI:S,encodeURL:S,utob:w,btou:R,decode:N,isValid:function(t){if("string"!=typeof t)return!1;var e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:m,toUint8Array:x,extendString:$,extendUint8Array:F,extendBuiltins:function(){$(),F()},Base64:{}};return Object.keys(j).forEach((function(t){return j.Base64[t]=j[t]})),j}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_$buffer_2({}).Buffer),_$base64_4=_$base64_4.exports;var _$logical_42={};function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,s,"next",t)}function s(t){asyncGeneratorStep(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"untitled",debug=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_classCallCheck(this,OpenAPI),this.name=name,this.debug=debug,this.http=HTTP(),this.env=ENV(),this.node=function(){if(isNode){var fs=eval("require('fs')");return{fs:fs}}return null}(),this.initCache();var delay=function(t,e){return new Promise((function(r){setTimeout(r.bind(null,e),t)}))},_ref;Promise.prototype.delay=(_ref=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this;case 2:return r=t.sent,t.next=5,delay(e,r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return _ref.apply(this,arguments)})}return _createClass(OpenAPI,[{key:"initCache",value:function(){if(isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(isLoon||isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),isNode){var t="root.json";this.node.fs.existsSync(t)||this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.root={},t="".concat(this.name,".json"),this.node.fs.existsSync(t)?this.cache=JSON.parse(this.node.fs.readFileSync("".concat(this.name,".json"))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.cache={})}}},{key:"persistCache",value:function(){var t=JSON.stringify(this.cache,null,2);isQX&&$prefs.setValueForKey(t,this.name),(isLoon||isSurge)&&$persistentStore.write(t,this.name),isNode&&(this.node.fs.writeFileSync("".concat(this.name,".json"),t,{flag:"w"},(function(t){return console.log(t)})),this.node.fs.writeFileSync("root.json",JSON.stringify(this.root,null,2),{flag:"w"},(function(t){return console.log(t)})))}},{key:"write",value:function(t,e){if(this.log("SET ".concat(e)),-1!==e.indexOf("#")){if(e=e.substr(1),isSurge||isLoon)return $persistentStore.write(t,e);if(isQX)return $prefs.setValueForKey(t,e);isNode&&(this.root[e]=t)}else this.cache[e]=t;this.persistCache()}},{key:"read",value:function(t){return this.log("READ ".concat(t)),-1===t.indexOf("#")?this.cache[t]:(t=t.substr(1),isSurge||isLoon?$persistentStore.read(t):isQX?$prefs.valueForKey(t):isNode?this.root[t]:void 0)}},{key:"delete",value:function(t){if(this.log("DELETE ".concat(t)),-1!==t.indexOf("#")){if(t=t.substr(1),isSurge||isLoon)return $persistentStore.write(null,t);if(isQX)return $prefs.removeValueForKey(t);isNode&&delete this.root[t]}else delete this.cache[t];this.persistCache()}},{key:"notify",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n["open-url"],i=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(i?"\n\u591a\u5a92\u4f53:"+i:""),{url:o}),isLoon){var a={};o&&(a.openUrl=o),i&&(a.mediaUrl=i),"{}"===JSON.stringify(a)?$notification.post(t,e,r):$notification.post(t,e,r,a)}if(isNode){var s=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(i?"\n\u591a\u5a92\u4f53: ".concat(i):"");console.log("".concat(t,"\n").concat(e,"\n").concat(s,"\n\n"))}}},{key:"log",value:function(t){this.debug&&console.log("[".concat(this.name,"] LOG: ").concat(t))}},{key:"info",value:function(t){console.log("[".concat(this.name,"] INFO: ").concat(t))}},{key:"error",value:function(t){console.log("[".concat(this.name,"] ERROR: ").concat(t))}},{key:"wait",value:function(t){return new Promise((function(e){return setTimeout(e,t)}))}},{key:"done",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};isQX||isLoon||isSurge?$done(t):isNode&&"undefined"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}]),OpenAPI}();function ENV(){return{isQX:isQX,isLoon:isLoon,isSurge:isSurge,isNode:isNode}}function HTTP(){var defaultOptions=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{baseURL:""},_ENV=ENV(),isQX=_ENV.isQX,isLoon=_ENV.isLoon,isSurge=_ENV.isSurge,isNode=_ENV.isNode,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="string"==typeof options?{url:options}:options;var baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options=_objectSpread(_objectSpread({},defaultOptions),options);var timeout=options.timeout,events=_objectSpread(_objectSpread({},{onRequest:function(){},onResponse:function(t){return t},onTimeout:function(){}}),options.events),worker,timeoutid;events.onRequest(method,options),isQX?worker=$task.fetch({method:method,url:options.url,headers:options.headers,body:options.body}):(isLoon||isSurge||isNode)&&(worker=new Promise((function(resolve,reject){var request=isNode?eval("require('request')"):$httpClient;request[method.toLowerCase()](options,(function(t,e,r){t?reject(t):resolve({statusCode:e.status||e.statusCode,headers:e.headers,body:r})}))})));var timer=timeout?new Promise((function(t,e){timeoutid=setTimeout((function(){return events.onTimeout(),e("".concat(method," URL: ").concat(options.url," exceeds the timeout ").concat(timeout," ms"))}),timeout)})):null;return(timer?Promise.race([timer,worker]).then((function(t){return clearTimeout(timeoutid),t})):worker).then((function(t){return events.onResponse(t)}))}var http={};return methods.forEach((function(t){return http[t.toLowerCase()]=function(e){return send(t,e)}})),http}_$openApi_43.OpenAPI=OpenAPI;var _$download_40={};function ___typeof_40(t){return(___typeof_40="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ___regeneratorRuntime_40(){___regeneratorRuntime_40=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(R){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(R){return{type:"throw",arg:R}}}t.wrap=c;var p={};function l(){}function f(){}function h(){}var d={};s(d,o,(function(){return this}));var _=Object.getPrototypeOf,y=_&&_(_(A([])));y&&y!==e&&r.call(y,o)&&(d=y);var m=h.prototype=l.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==___typeof_40(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function __asyncGeneratorStep_40(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}Object.defineProperty(_$download_40,"__esModule",{value:!0}),_$download_40.default=function(t,e){return _download.apply(this,arguments)};var cache=new Map;function _download(){var t;return t=___regeneratorRuntime_40().mark((function t(e,r){var n,o,i;return ___regeneratorRuntime_40().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)")+e,!cache.has(n)){t.next=4;break}return t.abrupt("return",cache.get(n));case 4:return o=(0,_$openApi_43.HTTP)({headers:{"User-Agent":r}}),i=new Promise((function(t,r){o.get(e).then((function(e){var n=e.body;0===n.replace(/\s/g,"").length?r(new Error("\u8ba2\u9605\u5185\u5bb9\u4e3a\u7a7a\uff01")):t(n)}))})),cache.set(n,i),t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_40(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_40(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}var _$geo_41={};Object.defineProperty(_$geo_41,"__esModule",{value:!0}),_$geo_41.getFlag=function(t){for(var e={"\ud83c\udde6\ud83c\uddff":["\u963f\u585e\u62dc\u7586"],"\ud83c\udde6\ud83c\uddf9":["\u5965\u5730\u5229","\u5967\u5730\u5229","Austria","\u7ef4\u4e5f\u7eb3"],"\ud83c\udde6\ud83c\uddfa":["AU","Australia","Sydney","\u6fb3\u5927\u5229\u4e9a","\u6fb3\u6d32","\u58a8\u5c14\u672c","\u6089\u5c3c","\u571f\u6fb3","\u4eac\u6fb3","\u5ee3\u6fb3","\u6eec\u6fb3","\u6caa\u6fb3","\u5e7f\u6fb3"],"\ud83c\udde7\ud83c\uddea":["BE","\u6bd4\u5229\u6642","\u6bd4\u5229\u65f6"],"\ud83c\udde7\ud83c\uddec":["\u4fdd\u52a0\u5229\u4e9a","\u4fdd\u52a0\u5229\u4e9e","Bulgaria"],"\ud83c\udde7\ud83c\udded":["BH","\u5df4\u6797"],"\ud83c\udde7\ud83c\udde9":["BD","\u5b5f\u52a0\u62c9"],"\ud83c\uddf5\ud83c\uddf0":["\u5df4\u57fa\u65af\u5766"],"\ud83c\uddf0\ud83c\udded":["\u67ec\u57d4\u5be8"],"\ud83c\uddfa\ud83c\udde6":["\u70cf\u514b\u862d","\u4e4c\u514b\u5170"],"\ud83c\udded\ud83c\uddf7":["\u514b\u7f57\u5730\u4e9a","HR","\u514b\u7f85\u5730\u4e9e"],"\ud83c\udde8\ud83c\udde6":["Canada","CANADA","CAN","Waterloo","\u52a0\u62ff\u5927","\u8499\u7279\u5229\u5c14","\u6e29\u54e5\u534e","\u6953\u8449","\u67ab\u53f6","\u6ed1\u94c1\u5362","\u591a\u4f26\u591a","CA"],"\ud83c\udde8\ud83c\udded":["\u745e\u58eb","\u82cf\u9ece\u4e16","Switzerland","Zurich"],"\ud83c\uddf3\ud83c\uddec":["\u5c3c\u65e5\u5229\u4e9a","NG","\u5c3c\u65e5\u5229\u4e9e"],"\ud83c\udde8\ud83c\uddff":["Czechia","\u6377\u514b"],"\ud83c\uddf8\ud83c\uddf0":["\u65af\u6d1b\u4f10\u514b","SK"],"\ud83c\uddf7\ud83c\uddf8":["RS","\u585e\u5c14\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\udde9":["\u6469\u723e\u591a\u74e6","MD","\u6469\u5c14\u591a\u74e6"],"\ud83c\udde9\ud83c\uddea":["DE","German","GERMAN","\u5fb7\u56fd","\u5fb7\u570b","\u6cd5\u5170\u514b\u798f","\u4eac\u5fb7","\u6eec\u5fb7","\u5ee3\u5fb7","\u6caa\u5fb7","\u5e7f\u5fb7","Frankfurt"],"\ud83c\udde9\ud83c\uddf0":["DK","DNK","\u4e39\u9ea6","\u4e39\u9ea5"],"\ud83c\uddea\ud83c\uddf8":["ES","\u897f\u73ed\u7259","Spain"],"\ud83c\uddea\ud83c\uddfa":["EU","\u6b27\u76df","\u6b27\u7f57\u5df4"],"\ud83c\uddeb\ud83c\uddee":["Finland","\u82ac\u5170","\u82ac\u862d","\u8d6b\u5c14\u8f9b\u57fa"],"\ud83c\uddeb\ud83c\uddf7":["FR","France","\u6cd5\u56fd","\u6cd5\u570b","\u5df4\u9ece"],"\ud83c\uddec\ud83c\udde7":["UK","GB","England","United Kingdom","\u82f1\u56fd","\u4f26\u6566","\u82f1","London"],"\ud83c\uddf2\ud83c\uddf4":["MO","Macao","\u6fb3\u95e8","\u6fb3\u9580","CTM"],"\ud83c\uddf0\ud83c\uddff":["\u54c8\u8428\u514b\u65af\u5766","\u54c8\u8428\u514b"],"\ud83c\udded\ud83c\uddfa":["\u5308\u7259\u5229","Hungary"],"\ud83c\udded\ud83c\uddf0":["HK","Hongkong","Hong Kong","HongKong","HONG KONG","\u9999\u6e2f","\u6df1\u6e2f","\u6caa\u6e2f","\u547c\u6e2f","HKT","HKBN","HGC","WTT","CMI","\u7a57\u6e2f","\u4eac\u6e2f","\u6e2f"],"\ud83c\uddee\ud83c\udde9":["Indonesia","\u5370\u5c3c","\u5370\u5ea6\u5c3c\u897f\u4e9a","\u96c5\u52a0\u8fbe"],"\ud83c\uddee\ud83c\uddea":["Ireland","IRELAND","\u7231\u5c14\u5170","\u611b\u723e\u862d","\u90fd\u67cf\u6797"],"\ud83c\uddee\ud83c\uddf1":["Israel","\u4ee5\u8272\u5217"],"\ud83c\uddee\ud83c\uddf3":["India","IND","INDIA","\u5370\u5ea6","\u5b5f\u4e70","MFumbai"],"\ud83c\uddee\ud83c\uddf8":["IS","ISL","\u51b0\u5c9b","\u51b0\u5cf6"],"\ud83c\uddf0\ud83c\uddf5":["KP","\u671d\u9c9c"],"\ud83c\uddf0\ud83c\uddf7":["KR","Korea","KOR","\u97e9\u56fd","\u9996\u5c14","\u97e9","\u97d3","\u6625\u5ddd","Chuncheon","Seoul"],"\ud83c\uddf1\ud83c\uddfa":["\u5362\u68ee\u5821"],"\ud83c\uddf1\ud83c\uddfb":["Latvia","Latvija","\u62c9\u8131\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\uddfd":["MEX","MX","\u58a8\u897f\u54e5"],"\ud83c\uddf2\ud83c\uddfe":["MY","Malaysia","MALAYSIA","\u9a6c\u6765\u897f\u4e9a","\u5927\u99ac","\u99ac\u4f86\u897f\u4e9e","\u5409\u9686\u5761"],"\ud83c\uddf3\ud83c\uddf1":["NL","Netherlands","\u8377\u5170","\u8377\u862d","\u5c3c\u5fb7\u862d","\u963f\u59c6\u65af\u7279\u4e39"],"\ud83c\uddf3\ud83c\uddf5":["\u5c3c\u6cca\u5c14"],"\ud83c\uddf5\ud83c\udded":["PH","Philippines","\u83f2\u5f8b\u5bbe","\u83f2\u5f8b\u8cd3"],"\ud83c\uddf5\ud83c\uddf7":["PR","\u6ce2\u591a\u9ece\u5404"],"\ud83c\uddf7\ud83c\uddf4":["RO","\u7f57\u9a6c\u5c3c\u4e9a"],"\ud83c\uddf7\ud83c\uddfa":["RU","Russia","\u4fc4\u7f57\u65af","\u4fc4\u56fd","\u4fc4\u7f85\u65af","\u4f2f\u529b","\u83ab\u65af\u79d1","\u5723\u5f7c\u5f97\u5821","\u897f\u4f2f\u5229\u4e9a","\u65b0\u897f\u4f2f\u5229\u4e9a","\u4eac\u4fc4","\u676d\u4fc4","\u5ee3\u4fc4","\u6eec\u4fc4","\u5e7f\u4fc4","\u6caa\u4fc4","Moscow"],"\ud83c\uddf8\ud83c\udde6":["\u6c99\u7279"],"\ud83c\uddf8\ud83c\uddea":["SE","Sweden","\u745e\u5178"],"\ud83c\uddf2\ud83c\uddf9":["\u9a6c\u8033\u4ed6"],"\ud83c\uddf2\ud83c\udde6":["MA","\u6469\u6d1b\u54e5"],"\ud83c\uddf8\ud83c\uddec":["SG","Singapore","SINGAPORE","\u65b0\u52a0\u5761","\u72ee\u57ce","\u6caa\u65b0","\u4eac\u65b0","\u6cc9\u65b0","\u7a57\u65b0","\u6df1\u65b0","\u676d\u65b0","\u5e7f\u65b0","\u5ee3\u65b0","\u6eec\u65b0"],"\ud83c\uddf9\ud83c\udded":["TH","Thailand","\u6cf0\u56fd","\u6cf0\u570b","\u66fc\u8c37"],"\ud83c\uddf9\ud83c\uddf7":["TR","Turkey","\u571f\u8033\u5176","\u4f0a\u65af\u5766\u5e03\u5c14"],"\ud83c\uddf9\ud83c\uddfc":["TW","Taiwan","TAIWAN","\u53f0\u6e7e","\u53f0\u5317","\u53f0\u4e2d","\u65b0\u5317","\u5f70\u5316","CHT","\u53f0","HINET","Taipei"],"\ud83c\uddfa\ud83c\uddf8":["US","USA","America","United States","\u7f8e\u56fd","\u7f8e","\u4eac\u7f8e","\u6ce2\u7279\u5170","\u8fbe\u62c9\u65af","\u4fc4\u52d2\u5188","\u51e4\u51f0\u57ce","\u8d39\u5229\u8499","\u7845\u8c37","\u77fd\u8c37","\u62c9\u65af\u7ef4\u52a0\u65af","\u6d1b\u6749\u77f6","\u5723\u4f55\u585e","\u5723\u514b\u62c9\u62c9","\u897f\u96c5\u56fe","\u829d\u52a0\u54e5","\u6caa\u7f8e","\u54e5\u4f26\u5e03","\u7ebd\u7ea6","Los Angeles","San Jose","Sillicon Valley","Michigan"],"\ud83c\uddfb\ud83c\uddf3":["VN","\u8d8a\u5357","\u80e1\u5fd7\u660e\u5e02"],"\ud83c\uddfb\ud83c\uddea":["VE","\u59d4\u5185\u745e\u62c9"],"\ud83c\uddee\ud83c\uddf9":["Italy","IT","Nachash","\u610f\u5927\u5229","\u7c73\u5170","\u7fa9\u5927\u5229"],"\ud83c\uddff\ud83c\udde6":["South Africa","\u5357\u975e"],"\ud83c\udde6\ud83c\uddea":["United Arab Emirates","\u963f\u8054\u914b","\u8fea\u62dc","AE"],"\ud83c\udde7\ud83c\uddf7":["BR","Brazil","\u5df4\u897f","\u5723\u4fdd\u7f57"],"\ud83c\uddef\ud83c\uddf5":["JP","Japan","JAPAN","\u65e5\u672c","\u4e1c\u4eac","\u5927\u962a","\u57fc\u7389","\u6caa\u65e5","\u7a57\u65e5","\u5ddd\u65e5","\u4e2d\u65e5","\u6cc9\u65e5","\u676d\u65e5","\u6df1\u65e5","\u8fbd\u65e5","\u5e7f\u65e5","\u5927\u5742","Osaka","Tokyo"],"\ud83c\udde6\ud83c\uddf7":["AR","\u963f\u6839\u5ef7"],"\ud83c\uddf3\ud83c\uddf4":["Norway","\u632a\u5a01","NO"],"\ud83c\udde8\ud83c\uddf3":["CN","China","\u56de\u56fd","\u4e2d\u56fd","\u4e2d\u570b","\u6c5f\u82cf","\u5317\u4eac","\u4e0a\u6d77","\u5e7f\u5dde","\u6df1\u5733","\u676d\u5dde","\u5f90\u5dde","\u9752\u5c9b","\u5b81\u6ce2","\u9547\u6c5f","back"],"\ud83c\uddf5\ud83c\uddf1":["PL","POL","\u6ce2\u5170","\u6ce2\u862d"],"\ud83c\udde8\ud83c\uddf1":["\u667a\u5229"],"\ud83c\uddf3\ud83c\uddff":["\u65b0\u897f\u862d","\u65b0\u897f\u5170"],"\ud83c\uddec\ud83c\uddf7":["\u5e0c\u814a","\u5e0c\u81d8"],"\ud83c\uddea\ud83c\uddec":["\u57c3\u53ca"],"\ud83c\udde8\ud83c\uddfe":["CY","\u585e\u6d66\u8def\u65af"],"\ud83c\udde8\ud83c\uddf7":["CR","\u54e5\u65af\u8fbe\u9ece\u52a0"],"\ud83c\uddf8\ud83c\uddee":["SI","\u65af\u6d1b\u6587\u5c3c\u4e9a"],"\ud83c\uddf1\ud83c\uddf9":["LT","\u7acb\u9676\u5b9b"],"\ud83c\uddf5\ud83c\udde6":["PA","\u5df4\u62ff\u9a6c"],"\ud83c\uddf9\ud83c\uddf3":["TN","\u7a81\u5c3c\u65af"],"\ud83c\uddee\ud83c\uddf2":["\u9a6c\u6069\u5c9b","\u99ac\u6069\u5cf6"],"\ud83c\udde7\ud83c\uddfe":["BY","\u767d\u4fc4","\u767d\u4fc4\u7f57\u65af"],"\ud83c\uddf5\ud83c\uddf9":["\u8461\u8404\u7259"],"\ud83c\uddf0\ud83c\uddea":["KE","\u80af\u5c3c\u4e9a"],"\ud83c\uddf0\ud83c\uddec":["KG","\u5409\u5c14\u5409\u65af\u5766"],"\ud83c\uddef\ud83c\uddf4":["JO","\u7ea6\u65e6"],"\ud83c\uddfa\ud83c\uddfe":["UY","\u4e4c\u62c9\u572d"],"\ud83c\uddf2\ud83c\uddf3":["\u8499\u53e4"],"\ud83c\uddee\ud83c\uddf7":["IR","\u4f0a\u6717"],"\ud83c\uddf5\ud83c\uddea":["\u79d8\u9c81","\u7955\u9b6f"],"\ud83c\udde8\ud83c\uddf4":["\u54e5\u4f26\u6bd4\u4e9a"],"\ud83c\uddea\ud83c\uddea":["\u7231\u6c99\u5c3c\u4e9a"],"\ud83c\uddea\ud83c\udde8":["EC","\u5384\u74dc\u591a\u5c14"],"\ud83c\uddf2\ud83c\uddf0":["\u9a6c\u5176\u987f","\u99ac\u5176\u9813"],"\ud83c\udde7\ud83c\udde6":["\u6ce2\u9ed1\u5171\u548c\u56fd","\u6ce2\u9ed1"],"\ud83c\uddec\ud83c\uddea":["\u683c\u9b6f\u5409\u4e9e","\u683c\u9c81\u5409\u4e9a"],"\ud83c\udde6\ud83c\uddf1":["\u963f\u723e\u5df4\u5c3c\u4e9e","\u963f\u5c14\u5df4\u5c3c\u4e9a"],"\ud83c\udff3\ufe0f\u200d\ud83c\udf08":["\u6d41\u91cf","\u65f6\u95f4","\u5e94\u6025","\u8fc7\u671f","Bandwidth","expire"]},r=0,n=Object.keys(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function __asyncGeneratorStep_37(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___asyncToGenerator_37(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_37(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_37(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(c){s=!0,o=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function __ownKeys_37(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_37(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_37(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_37(t,e):void 0}}function ___arrayLikeToArray_37(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},(keys=["dm1lc3M","c3NyOi8v","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c"],{name:"Base64 Pre-processor",test:function(t){return keys.some((function(e){return-1!==t.indexOf(e)}))},parse:function(t){return _$base64_4.Base64.decode(t)}}),{name:"Clash Pre-processor",test:function(t){return/proxies/.test(t)},parse:function(t){return(0,_$staticJsYaml_35.safeLoad)(t).proxies.map((function(t){return JSON.stringify(t)})).join("\n")}},{name:"SSD Pre-processor",test:function(t){return 0===t.indexOf("ssd://")},parse:function(t){for(var e=[],r=JSON.parse(_$base64_4.Base64.decode(t.split("ssd://")[1])),n=r.port,o=r.encryption,i=r.password,a=r.servers,s=0;s1){var u,p=_createForOfIteratorHelper(t);try{for(p.s();!(u=p.n()).done;){var l=_slicedToArray(u.value.split("="),2),f=l[0],h=l[1];c[f]=h.trim()}}catch(d){p.e(d)}finally{p.f()}}return ___objectSpread_37(___objectSpread_37({},s),{},{name:c.remarks?_$base64_4.Base64.decode(c.remarks):s.server,"protocol-param":_$base64_4.Base64.decode(c.protoparam||"").replace(/\s/g,""),"obfs-param":_$base64_4.Base64.decode(c.obfsparam||"").replace(/\s/g,"")})}}),{name:"URI VMess Parser",test:function(t){return/^vmess:\/\//.test(t)},parse:function(t){t=t.split("vmess://")[1];var e=_$base64_4.Base64.decode(t);if(/=\s*vmess/.test(e)){var r,n=e.split(",").map((function(t){return t.trim()})),o={},i=_createForOfIteratorHelper(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(-1!==a.indexOf("=")){var s=_slicedToArray(a.split("="),2),c=s[0],u=s[1];o[c.trim()]=u.trim()}}}catch(d){i.e(d)}finally{i.f()}var p={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:n[3],uuid:n[4].match(/^"(.*)"$/)[1],tls:"over-tls"===o.obfs||"wss"===o.obfs};if(void 0!==o["udp-relay"]&&(p.udp=JSON.parse(o["udp-relay"])),void 0!==o["fast-open"]&&(p.udp=JSON.parse(o["fast-open"])),"ws"===o.obfs||"wss"===o.obfs){p.network="ws",p["ws-opts"].path=(o["obfs-path"]||'"/"').match(/^"(.*)"$/)[1];var l=o["obfs-header"];l&&-1!==l.indexOf("Host")&&(l=l.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),p["ws-opts"].headers={Host:l||p.server}}return p.tls&&"false"===o['"tls-verification"']&&(p["skip-cert-verify"]=!0),p.tls&&o["obfs-host"]&&(p.sni=o["obfs-host"]),p}var f=JSON.parse(e),h={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:f.aid||0,tls:"tls"===f.tls||!0===f.tls,supported:{}};return"ws"===f.net&&(h.network="ws",h["ws-opts"]={path:f.path,headers:{Host:f.host||f.add}},h.tls&&f.host&&(h.sni=f.host)),!1===f.verify_cert&&(h["skip-cert-verify"]=!0),h}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){var e=_slicedToArray((t=t.split("trojan://")[1]).split("@")[1].split("?")[0].split(":"),2),r=e[0],n=e[1],o=decodeURIComponent(t.split("#")[1].trim()),i=t.split("?"),a=null;return i.length>1&&(i=i[1].split("#")[0].split("&"),a=new Map(i.map((function(t){return t.split("=")}))).get("sni")),{name:o||"[Trojan] ".concat(r),type:"trojan",server:r,port:n,password:t.split("@")[0],sni:a,supported:{}}}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){return JSON.parse(t)}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){var e=r(t),n={name:e.name,type:"ss",server:e.server,port:e.port,cipher:e["encrypt-method"],password:e.password,tfo:JSON.parse(e.tfo||"false"),udp:JSON.parse(e["udp-relay"]||"false")};return e.obfs&&(n.plugin="obfs",n["plugin-opts"]={mode:e.obfs,host:e["obfs-host"]}),n}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){var e=r(t),n={name:e.name,type:"vmess",server:e.server,port:e.port,uuid:e.username,alterId:0,cipher:"none",tls:JSON.parse(e.tls||"false"),tfo:JSON.parse(e.tfo||"false")};if(n.tls&&(void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n.sni=e.sni||e.server),JSON.parse(e.ws||"false")){n.network="ws",n["ws-opts"]={path:e["ws-path"]};var o=e["ws-headers"].match(/(,|^|\s)*HOST:\s*(.*?)(,|$)/),i=o?o[2]:n.server;n["ws-opts"].headers={Host:i||e.server}}return n}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])&&-1!==t.indexOf("sni")},parse:function(t){var e=r(t),n={name:e.name,type:"trojan",server:e.server,port:e.port,password:e.password,sni:e.sni||e.server,tfo:JSON.parse(e.tfo||"false")};return void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*http/.test(t.split(",")[0])&&!e().test(t)},parse:function(t){var e=r(t),n={name:e.name,type:"http",server:e.server,port:e.port,tls:JSON.parse(e.tls||"false"),tfo:JSON.parse(e.tfo||"false")};return n.tls&&(void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n.sni=e.sni||e.server),e.username&&"none"!==e.username&&(n.username=e.username),e.password&&"none"!==e.password&&(n.password=e.password),n}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"ss",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,"")};return e.length>5&&(r.plugin="obfs",r["plugin-opts"]={mode:e[5],host:e[6]}),r}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(",");return{name:t.split("=")[0].trim(),type:"ssr",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,""),protocol:e[5],"protocol-param":e[6].match(/{(.*)}/)[1],supported:{Surge:!1},obfs:e[7],"obfs-param":e[8].match(/{(.*)}/)[1]}}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){var e,r=t.split("=")[1].split(","),n={name:t.split("=")[0].trim(),type:"vmess",server:r[1],port:r[2],cipher:r[3]||"none",uuid:r[4].replace(/"/g,""),alterId:0},o=_createForOfIteratorHelper(r=r.splice(5));try{for(o.s();!(e=o.n()).done;){var i=_slicedToArray(e.value.split(":"),2),a=i[0],s=i[1];r[a]=s}}catch(c){o.e(c)}finally{o.f()}switch(n.tls=JSON.parse(r["over-tls"]||"false"),n.tls&&(n.sni=r["tls-name"]||n.server,n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),r.transport){case"tcp":break;case"ws":n.network=r.transport,n["ws-opts"]={path:r.path,headers:{Host:r.host}}}return n.tls&&(n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),n}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])&&-1===t.indexOf("password")},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"trojan",server:e[1],port:e[2],password:e[3].replace(/"/g,""),sni:e[1],"skip-cert-verify":JSON.parse(e["skip-cert-verify"]||"false")};if(e.length>4){var n=_slicedToArray(e[4].split(":"),2),o=n[0],i=n[1];if("tls-name"!==o)throw new Error("Unknown option ".concat(o," for line: \n").concat(t));r.sni=i}return r}},e(),{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ss",server:r.server,port:r.port,cipher:r.method,password:r.password,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{}};if(r.obfs)switch(n["plugin-opts"]={host:r["obfs-host"]||n.server},r.obfs){case"http":case"tls":n.plugin="obfs",n["plugin-opts"].mode=r.obfs;break;case"ws":case"wss":n["plugin-opts"]=___objectSpread_37(___objectSpread_37({},n["plugin-opts"]),{},{mode:"websocket",path:r["obfs-uri"]||"/",tls:"wss"===r.obfs}),n["plugin-opts"].tls&&void 0!==r["tls-verification"]&&(n["plugin-opts"]["skip-cert-verify"]=r["tls-verification"]),n.plugin="v2ray-plugin",n.supported.Surge=!1,n.supported.Loon=!1}return n}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ssr",server:r.server,port:r.port,cipher:r.method,password:r.password,protocol:r["ssr-protocol"],obfs:"plain","protocol-param":r["ssr-protocol-param"],udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{Surge:!1}};return r.obfs&&(n.obfs=r.obfs,n["obfs-param"]=r["obfs-host"]),n}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"vmess",name:r.tag,server:r.server,port:r.port,cipher:r.method||"none",uuid:r.password,alterId:0,tls:"over-tls"===r.obfs||"wss"===r.obfs,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n.tls&&(n.sni=r["obfs-host"]||r.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),"ws"!==r.obfs&&"wss"!==r.obfs||(n.network="ws",n["ws-opts"]={path:r["obfs-uri"],headers:{Host:r["obfs-host"]||r.server}}),n}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"trojan",name:r.tag,server:r.server,port:r.port,password:r.password,sni:r["tls-host"]||r.server,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true"),n}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"http",name:r.tag,server:r.server,port:r.port,tls:JSON.parse(r["over-tls"]||"false"),udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return r.username&&"none"!==r.username&&(n.username=r.username),r.password&&"none"!==r.password&&(n.password=r.password),n.tls&&(n.sni=r["tls-host"]||n.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),n}}];var n}(),PROXY_PROCESSORS=function(){function SetPropertyOperator(t){var e=t.key,r=t.value;return{name:"Set Property Operator",func:function(t){return t.map((function(t){return t[e]=r,t}))}}}function FlagOperator(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{name:"Flag Operator",func:function(e){return e.map((function(e){if(t){var r=(0,_$geo_41.getFlag)(e.name);e.name=removeFlag(e.name),e.name=r+" "+e.name,e.name=e.name.replace(/\ud83c\uddf9\ud83c\uddfc/g,"\ud83c\udde8\ud83c\uddf3")}else e.name=removeFlag(e.name);return e}))}}}function HandleDuplicateOperator(t){var e=___objectSpread_37(___objectSpread_37({},{action:"rename",template:"0 1 2 3 4 5 6 7 8 9",link:"-",position:"back"}),t),r=e.action,n=e.template,o=e.link,i=e.position;return{name:"Handle Duplicate Operator",func:function(t){if("delete"===r){var e={};return t.filter((function(t){return!e[t.name]&&(e[t.name]=!0,!0)}))}if("rename"===r){var a=n.split(" "),s={},c=0;t.forEach((function(t){void 0===s[t.name]?s[t.name]=1:s[t.name]++,c=Math.max(s[t.name].toString().length,c)}));var u={};return t.map((function(t){if(s[t.name]>1){void 0===u[t.name]&&(u[t.name]=1);for(var e="",r=u[t.name]++,n=0;r>0;)e=a[r%10]+e,r=parseInt(r/10),n++;for(;n++0&&void 0!==arguments[0]?arguments[0]:"asc";return{name:"Sort Operator",func:function(e){switch(t){case"asc":case"desc":return e.sort((function(e,r){return(e.name>r.name?1:-1)*("desc"===t?-1:1)}));case"random":return shuffle(e);default:throw new Error("Unknown sort option: "+t)}}}}function RegexSortOperator(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return buildRegex(t)})),e.sort((function(e,r){var n=getRegexOrder(t,e.name),o=getRegexOrder(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1?e-1:0),n=1;n1&&void 0!==w[1]?w[1]:[],n=w.length>2?w[2]:void 0,o=_createForOfIteratorHelper(r),t.prev=3,o.s();case 5:if((i=o.n()).done){t.next=38;break}if(a=i.value,s=void 0,c={},-1===a.type.indexOf("Script")){t.next=29;break}if(u=a.args,p=u.mode,l=u.content,"link"!==p){t.next=28;break}if((h=(f=l).split("#")).length>1){d=_createForOfIteratorHelper(h[1].split("&"));try{for(d.s();!(_=d.n()).done;)y=_.value,m=y.split("=")[0],g=y.split("=")[1]||!0,c[m]=g}catch(b){d.e(b)}finally{d.f()}}return t.prev=15,t.next=18,(0,___download_37.default)(f.split("#")[0]);case 18:s=t.sent,_app.default.info("Script loaded: >>>\n ".concat(s)),t.next=26;break;case 22:return t.prev=22,t.t0=t.catch(15),_app.default.error("Error when downloading remote script: ".concat(a.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",36);case 26:t.next=29;break;case 28:s=l;case 29:if(PROXY_PROCESSORS[a.type]){t.next=32;break}return _app.default.error('Unknown operator: "'.concat(a.type,'"')),t.abrupt("continue",36);case 32:_app.default.info('Applying "'.concat(a.type,'" with arguments:\n >>> ').concat(JSON.stringify(a.args,null,2)||"None")),v=void 0,v=-1!==a.type.indexOf("Script")?PROXY_PROCESSORS[a.type](s,n,c):PROXY_PROCESSORS[a.type](a.args),e=ApplyProcessor(v,e);case 36:t.next=5;break;case 38:t.next=43;break;case 40:t.prev=40,t.t1=t.catch(3),o.e(t.t1);case 43:return t.prev=43,o.f(),t.finish(43);case 46:return t.abrupt("return",e);case 47:case"end":return t.stop()}}),t,null,[[3,40,43,46],[15,22]])})))).apply(this,arguments)}return{parse:function(e){e=function(t){var e,r=_createForOfIteratorHelper(PROXY_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return _app.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){_app.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(e);var r,n,o=[],i=_createForOfIteratorHelper(e.split("\n"));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(0!==(a=a.trim()).length){var s=r&&t(r,a);if(!s){var c,u=_createForOfIteratorHelper(PROXY_PARSERS);try{for(u.s();!(c=u.n()).done;){var p=c.value;if(t(p,a)){r=p,s=!0,_app.default.info("Proxy parser: ".concat(p.name," is activated"));break}}}catch(f){u.e(f)}finally{u.f()}}if(s)try{var l=r.parse(a);l||_app.default.error("Parser ".concat(r.name," return nothing for \n").concat(a,"\n")),o.push(l)}catch(f){_app.default.error("Failed to parse line: \n ".concat(a,"\n Reason: ").concat(f.stack))}else _app.default.error("Failed to find a rule to parse line: \n".concat(a,"\n"))}}}catch(f){i.e(f)}finally{i.f()}return o},process:function(t){return e.apply(this,arguments)},produce:function(t,e){var r=PROXY_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return t=t.filter((function(t){return!(t.supported&&!1===t.supported[e])})),_app.default.info("Producing proxies for target: ".concat(e)),void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.produce(t)}catch(e){return _app.default.error("Cannot produce proxy: ".concat(JSON.stringify(t,null,2),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.produce(t):void 0}}}(),keys;function ApplyProcessor(t,e){return-1!==t.name.indexOf("Filter")?function(t,e){var r=(0,_$logical_42.FULL)(e.length,!0);try{r=(0,_$logical_42.AND)(r,t.func(e))}catch(n){console.log("Cannot apply filter ".concat(t.name,"\n Reason: ").concat(n))}return e.filter((function(t,e){return r[e]}))}(t,e):-1!==t.name.indexOf("Operator")?function(t,e){var r=clone(e);try{var n=t.func(r);n&&(r=n)}catch(o){console.log("Cannot apply operator ".concat(t.name,"! Reason: ").concat(o))}return r}(t,e):void 0}function shuffle(t){for(var e,r,n=t.length;0!==n;)r=Math.floor(Math.random()*n),e=t[n-=1],t[n]=t[r],t[r]=e;return t}function clone(t){return JSON.parse(JSON.stringify(t))}function removeFlag(t){return t.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/g,"").trim()}_$proxyUtils_37.ProxyUtils=ProxyUtils;var _$ruleUtils_38={};function ___typeof_38(t){return(___typeof_38="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(_$ruleUtils_38,"__esModule",{value:!0}),_$ruleUtils_38.RuleUtils=void 0;var ___staticJsYaml_38=___interopRequireDefault_38(_$staticJsYaml_35),___app_38=___interopRequireDefault_38(_$app_36);function ___interopRequireDefault_38(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_38(){___regeneratorRuntime_38=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(R){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(R){return{type:"throw",arg:R}}}t.wrap=c;var p={};function l(){}function f(){}function h(){}var d={};s(d,o,(function(){return this}));var _=Object.getPrototypeOf,y=_&&_(_(A([])));y&&y!==e&&r.call(y,o)&&(d=y);var m=h.prototype=l.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==___typeof_38(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function __asyncGeneratorStep_38(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___createForOfIteratorHelper_38(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_38(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_38(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ___arrayLikeToArray_38(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},{name:"Clash Provider",test:function(t){return 0===t.indexOf("payload:")},parse:function(t){return t.replace("payload:","").replace(/^\s*-\s*/gm,"")}}],RULE_PARSERS=[{name:"Universal Rule Parser",test:function(){return!0},parse:function(t){var e,r=[],n=___createForOfIteratorHelper_38(t.split("\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(0!==(o=o.trim()).length&&!/\s*#/.test(o))try{var i,a=o.split(",").map((function(t){return t.trim()})),s=a[0],c=!1,u=___createForOfIteratorHelper_38(RULE_TYPES_MAPPING);try{for(u.s();!(i=u.n()).done;){var p=i.value;if(p[0].test(s)){c=!0;var l={type:p[1],content:a[1]};"IP-CIDR"!==l.type&&"IP-CIDR6"!==l.type||(l.options=a.slice(2)),r.push(l)}}}catch(f){u.e(f)}finally{u.f()}if(!c)throw new Error("Invalid rule type: "+s)}catch(h){console.error("Failed to parse line: ".concat(o,"\n Reason: ").concat(h))}}}catch(f){n.e(f)}finally{n.f()}return r}}],RULE_PROCESSORS={"Regex Filter":function(t){var e=t.regex,r=void 0===e?[]:e,n=t.keep,o=void 0===n||n;return{name:"Regex Filter",func:function(t){return t.map((function(t){var e=r.some((function(e){return(e=new RegExp(e)).test(t)}));return o?e:!e}))}}},"Remove Duplicate Filter":function(){return{name:"Remove Duplicate Filter",func:function(t){var e=new Set,r=[];return t.forEach((function(t){var n=t.options||[];n.sort();var o="".concat(t.type,",").concat(t.content,",").concat(JSON.stringify(n));e.has(o)||(r.push(t),e.add(o))})),r}}},"Type Filter":function(t){return{name:"Type Filter",func:function(e){return e.map((function(e){return t.some((function(t){return e.type===t}))}))}}},"Regex Replace Operator":function(t){return{name:"Regex Rename Operator",func:function(e){return e.map((function(e){var r,n=___createForOfIteratorHelper_38(t);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=o.expr,a=o.now;e.content=e.content.replace(new RegExp(i,"g"),a).trim()}}catch(s){n.e(s)}finally{n.f()}return e}))}}}},RULE_PRODUCERS={QX:{type:"SINGLE",func:function(t){return-1!==["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:"".concat({"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[t.type]||t.type,",").concat(t.content,",SUB-STORE")}},Surge:{type:"SINGLE",func:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}},Loon:{type:"SINGLE",func:function(t){return-1!==["DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}(t)}},Clash:{type:"ALL",func:function(t){var e={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},r={payload:t.map((function(t){var r="".concat(e[t.type]||t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(r+=t.options?",".concat(t.options[0]):""),r}))};return ___staticJsYaml_38.default.dump(r)}}},RuleUtils=function(){function t(){var e;return e=___regeneratorRuntime_38().mark((function t(e,r){var n,o,i,a;return ___regeneratorRuntime_38().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=___createForOfIteratorHelper_38(r),t.prev=1,n.s();case 3:if((o=n.n()).done){t.next=13;break}if(i=o.value,RULE_PROCESSORS[i.type]){t.next=8;break}return console.error("Unknown operator: ".concat(i.type,"!")),t.abrupt("continue",11);case 8:a=RULE_PROCESSORS[i.type](i.args),___app_38.default.info('Applying "'.concat(i.type,'" with arguments: \n >>> ').concat(JSON.stringify(i.args)||"None")),e=(0,_$proxyUtils_37.ApplyProcessor)(a,e);case 11:t.next=3;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),n.e(t.t0);case 18:return t.prev=18,n.f(),t.finish(18);case 21:return t.abrupt("return",e);case 22:case"end":return t.stop()}}),t,null,[[1,15,18,21]])})),(t=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){__asyncGeneratorStep_38(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_38(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}return{parse:function(t){t=function(t){var e,r=___createForOfIteratorHelper_38(RULE_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return ___app_38.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){___app_38.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(t);var e,r=___createForOfIteratorHelper_38(RULE_PARSERS);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=void 0;try{o=n.test(t)}catch(i){o=!1}if(o)return ___app_38.default.info("Rule parser [".concat(n.name,"] is activated!")),n.parse(t)}}catch(i){r.e(i)}finally{r.f()}},process:function(e,r){return t.apply(this,arguments)},produce:function(t,e){var r=RULE_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.func(t)}catch(e){return console.log("ERROR: cannot produce rule: ".concat(JSON.stringify(t),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.func(t):void 0}}}();_$ruleUtils_38.RuleUtils=RuleUtils;var _$resourceParserLoon_39={},RESOURCE_TYPE_RULE=2,result=$resource;if(1===$resourceType){var proxies=_$proxyUtils_37.ProxyUtils.parse($resource);result=_$proxyUtils_37.ProxyUtils.produce(proxies,"Loon")}else if($resourceType===RESOURCE_TYPE_RULE){var rules=_$ruleUtils_38.RuleUtils.parse($resource);result=_$ruleUtils_38.RuleUtils.produce(rules,"Loon")}$done(result)}(); \ No newline at end of file +!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|c(e,n),i=t(o),a=i.write(e,n);return a!==o&&(i=i.slice(0,a)),i}(e,n);if(ArrayBuffer.isView(e))return a(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function c(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||P(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return k(t).length;default:if(i)return o?-1:I(t).length;e=(""+e).toLowerCase(),i=!0}}function u(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:l(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):l(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function l(t,e,r,n,o){var i,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var p=-1;for(i=r;is&&(r=s-c),i=r;i>=0;i--){for(var l=!0,f=0;fo&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function g(t,e,r){return 0===e&&r===t.length?_$base64Js_1.fromByteArray(t):_$base64Js_1.fromByteArray(t.slice(e,r))}function v(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:u>223?3:u>191?2:1;if(o+l<=r)switch(l){case 1:u<128&&(p=u);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)>127&&(p=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(p=c)}null===p?(p=65533,l=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),o+=l}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return b(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return g(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===r.compare(this,t)},r.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),""},r.prototype.compare=function(t,e,n,o,i){if(P(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),c=Math.min(a,s),u=this.slice(o,i),p=t.slice(e,n),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return f(this,t,e,r);case"utf8":case"utf-8":return h(this,t,e,r);case"ascii":return d(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return y(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function b(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,o,i,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),_$ieee754_3.write(t,e,r,n,52,8),r+8}r.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},r.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},r.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),_$ieee754_3.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},r.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},r.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);R(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},r.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},r.prototype.copy=function(t,e,n,o){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e=0;--a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return i},r.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!r.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){var i=t.charCodeAt(0);("utf8"===o&&i<128||"latin1"===o)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function P(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$common_7={};function isNothing(t){return null==t}_$common_7.isNothing=isNothing,_$common_7.isObject=function(t){return"object"==typeof t&&null!==t},_$common_7.toArray=function(t){return Array.isArray(t)?t:isNothing(t)?[]:[t]},_$common_7.repeat=function(t,e){var r,n="";for(r=0;r0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(n-1));)if(n-=1,this.position-n>e/2-1){r=" ... ",n+=5;break}for(o="",i=this.position;ie/2-1){o=" ... ",i-=5;break}return a=this.buffer.slice(n,i),_$common_7.repeat(" ",t)+r+a+o+"\n"+_$common_7.repeat(" ",t+this.position-n+r.length)+"^"},Mark.prototype.toString=function(t){var e,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(r+=":\n"+e),r},_$mark_11=Mark;var TYPE_CONSTRUCTOR_OPTIONS=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"],_$type_18=function(t,e){var r,n;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(e))throw new _$exception_9('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(r=e.styleAliases||null,n={},null!==r&&Object.keys(r).forEach((function(t){r[t].forEach((function(e){n[String(e)]=t}))})),n),-1===YAML_NODE_KINDS.indexOf(this.kind))throw new _$exception_9('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')},_$schema_12={};function compileList(t,e,r){var n=[];return t.include.forEach((function(t){r=compileList(t,e,r)})),t[e].forEach((function(t){r.forEach((function(e,r){e.tag===t.tag&&e.kind===t.kind&&n.push(r)})),r.push(t)})),r.filter((function(t,e){return-1===n.indexOf(e)}))}function Schema(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach((function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new _$exception_9("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=compileList(this,"implicit",[]),this.compiledExplicit=compileList(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{}};function n(t){r[t.kind][t.tag]=r.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/,_$float_21=new _$type_18("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!YAML_FLOAT_PATTERN.test(t)||"_"===t[t.length-1])},construct:function(t){var e,r,n,o;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach((function(t){o.unshift(parseFloat(t,10))})),e=0,n=1,o.forEach((function(t){e+=t*n,n*=60})),r*e):r*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||_$common_7.isNegativeZero(t))},represent:function(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_$common_7.isNegativeZero(t))return"-0.0";return r=t.toString(10),SCIENTIFIC_WITHOUT_DOT.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),_$json_17=new _$schema_12({include:[_$failsafe_16],implicit:[_$null_28,_$bool_20,_$int_22,_$float_21]}),_$core_13=new _$schema_12({include:[_$json_17]}),YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),_$timestamp_34=new _$type_18("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==YAML_DATE_REGEXP.exec(t)||null!==YAML_TIMESTAMP_REGEXP.exec(t))},construct:function(t){var e,r,n,o,i,a,s,c,u=0,p=null;if(null===(e=YAML_DATE_REGEXP.exec(t))&&(e=YAML_TIMESTAMP_REGEXP.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,o=+e[3],!e[4])return new Date(Date.UTC(r,n,o));if(i=+e[4],a=+e[5],s=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(p=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(p=-p)),c=new Date(Date.UTC(r,n,o,i,a,s,u)),p&&c.setTime(c.getTime()-p),c},instanceOf:Date,represent:function(t){return t.toISOString()}}),_$merge_27=new _$type_18("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),NodeBuffer;try{var _require=require;NodeBuffer=_require("buffer").Buffer}catch(__){}var BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",_$binary_19=new _$type_18("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,r,n=0,o=t.length,i=BASE64_MAP;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8==0},construct:function(t){var e,r,n=t.replace(/[\r\n=]/g,""),o=n.length,i=BASE64_MAP,a=0,s=[];for(e=0;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|i.indexOf(n.charAt(e));return 0==(r=o%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===r?(s.push(a>>10&255),s.push(a>>2&255)):12===r&&s.push(a>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(s):new NodeBuffer(s):s},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,i=t.length,a=BASE64_MAP;for(e=0;e>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]),o=(o<<8)+t[e];return 0==(r=i%3)?(n+=a[o>>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]):2===r?(n+=a[o>>10&63],n+=a[o>>4&63],n+=a[o<<2&63],n+=a[64]):1===r&&(n+=a[o>>2&63],n+=a[o<<4&63],n+=a[64],n+=a[64]),n}}),_hasOwnProperty=Object.prototype.hasOwnProperty,_toString=Object.prototype.toString,_$omap_29=new _$type_18("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,r,n,o,i,a=[],s=t;for(e=0,r=s.length;e3)return!1;if("/"!==e[e.length-n.length-1])return!1}return!0},construct:function(t){var e=t,r=/\/([gim]*)$/.exec(t),n="";return"/"===e[0]&&(r&&(n=r[1]),e=e.slice(1,e.length-n.length-1)),new RegExp(e,n)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}}),esprima;try{var ___require_23=require;esprima=___require_23("esprima")}catch(_){"undefined"!=typeof window&&(esprima=window.esprima)}var _$function_23=new _$type_18("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",r=esprima.parse(e,{range:!0});return"Program"===r.type&&1===r.body.length&&"ExpressionStatement"===r.body[0].type&&("ArrowFunctionExpression"===r.body[0].expression.type||"FunctionExpression"===r.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,r="("+t+")",n=esprima.parse(r,{range:!0}),o=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"ArrowFunctionExpression"!==n.body[0].expression.type&&"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach((function(t){o.push(t.name)})),e=n.body[0].expression.body.range,"BlockStatement"===n.body[0].expression.body.type?new Function(o,r.slice(e[0]+1,e[1]-1)):new Function(o,"return "+r.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}}),_$default_full_14=_$schema_12.DEFAULT=new _$schema_12({include:[_$default_safe_15],explicit:[_$undefined_25,_$regexp_24,_$function_23]}),_$loader_10={},___hasOwnProperty_10=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(t){return Object.prototype.toString.call(t)}function is_EOL(t){return 10===t||13===t}function is_WHITE_SPACE(t){return 9===t||32===t}function is_WS_OR_EOL(t){return 9===t||32===t||10===t||13===t}function is_FLOW_INDICATOR(t){return 44===t||91===t||93===t||123===t||125===t}function fromHexCode(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function simpleEscapeSequence(t){return 48===t?"\0":97===t?"\x07":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"\x1b":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"\x85":95===t?"\xa0":76===t?"\u2028":80===t?"\u2029":""}function charFromCodepoint(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256),i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||_$default_full_14,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function generateError(t,e){return new _$exception_9(e,new _$mark_11(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function throwError(t,e){throw generateError(t,e)}function throwWarning(t,e){t.onWarning&&t.onWarning.call(null,generateError(t,e))}var directiveHandlers={YAML:function(t,e,r){var n,o,i;null!==t.version&&throwError(t,"duplication of %YAML directive"),1!==r.length&&throwError(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&throwError(t,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),i=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,1!==i&&2!==i&&throwWarning(t,"unsupported YAML version of the document")},TAG:function(t,e,r){var n,o;2!==r.length&&throwError(t,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],PATTERN_TAG_HANDLE.test(n)||throwError(t,"ill-formed tag handle (first argument) of the TAG directive"),___hasOwnProperty_10.call(t.tagMap,n)&&throwError(t,'there is a previously declared suffix for "'+n+'" tag handle'),PATTERN_TAG_URI.test(o)||throwError(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[n]=o}};function captureSegment(t,e,r,n){var o,i,a,s;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,i=t.anchor,a=[],s=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)a.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),a.push(t.result),skipSeparationSpace(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)throwError(t,"bad indentation of a sequence entry");else if(t.lineIndente?h=1:t.lineIndent===e?h=0:t.lineIndente?h=1:t.lineIndent===e?h=0:t.lineIndente)&&(composeNode(t,e,CONTEXT_BLOCK_OUT,!0,o)&&(_?h=t.result:d=t.result),_||(storeMappingPair(t,p,l,f,h,d,i,a),f=h=d=null),skipSeparationSpace(t,!0,-1),s=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==s)throwError(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===o?throwError(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?throwError(t,"repeat of an indentation width identifier"):(p=e+o-1,u=!0)}if(is_WHITE_SPACE(i)){do{i=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(i));if(35===i)do{i=t.input.charCodeAt(++t.position)}while(!is_EOL(i)&&0!==i)}for(;0!==i;){for(readLineBreak(t),t.lineIndent=0,i=t.input.charCodeAt(t.position);(!u||t.lineIndentp&&(p=t.lineIndent),is_EOL(i))l++;else{if(t.lineIndent0){for(o=a,i=0;o>0;o--)(a=fromHexCode(s=t.input.charCodeAt(++t.position)))>=0?i=(i<<4)+a:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(i),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(s)?(captureSegment(t,r,n,!0),writeFoldedLines(t,skipSeparationSpace(t,!1,e)),r=n=t.position):t.position===t.lineStart&&testDocumentSeparator(t)?throwError(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}throwError(t,"unexpected end of the stream within a double quoted scalar")}(t,l)?_=!0:function(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&throwError(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),___hasOwnProperty_10.call(t.anchorMap,r)||throwError(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],skipSeparationSpace(t,!0,-1),!0}(t)?(_=!0,null===t.tag&&null===t.anchor||throwError(t,"alias node should not have any properties")):function(t,e,r){var n,o,i,a,s,c,u,p,l=t.kind,f=t.result;if(is_WS_OR_EOL(p=t.input.charCodeAt(t.position))||is_FLOW_INDICATOR(p)||35===p||38===p||42===p||33===p||124===p||62===p||39===p||34===p||37===p||64===p||96===p)return!1;if((63===p||45===p)&&(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n)))return!1;for(t.kind="scalar",t.result="",o=i=t.position,a=!1;0!==p;){if(58===p){if(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n))break}else if(35===p){if(is_WS_OR_EOL(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&testDocumentSeparator(t)||r&&is_FLOW_INDICATOR(p))break;if(is_EOL(p)){if(s=t.line,c=t.lineStart,u=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){a=!0,p=t.input.charCodeAt(t.position);continue}t.position=i,t.line=s,t.lineStart=c,t.lineIndent=u;break}}a&&(captureSegment(t,o,i,!1),writeFoldedLines(t,t.line-s),o=i=t.position,a=!1),is_WHITE_SPACE(p)||(i=t.position+1),p=t.input.charCodeAt(++t.position)}return captureSegment(t,o,i,!1),!!t.result||(t.kind=l,t.result=f,!1)}(t,l,CONTEXT_FLOW_IN===r)&&(_=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===h&&(_=s&&readBlockSequence(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&throwError(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),c=0,u=t.implicitTypes.length;c tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result)?(t.result=p.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):throwError(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):throwError(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||_}function readDocument(t){var e,r,n,o,i=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(o=t.input.charCodeAt(t.position))&&(skipSeparationSpace(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==o));){for(a=!0,o=t.input.charCodeAt(++t.position),e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&throwError(t,"directive name must not be less than one character in length");0!==o;){for(;is_WHITE_SPACE(o);)o=t.input.charCodeAt(++t.position);if(35===o){do{o=t.input.charCodeAt(++t.position)}while(0!==o&&!is_EOL(o));break}if(is_EOL(o))break;for(e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==o&&readLineBreak(t),___hasOwnProperty_10.call(directiveHandlers,r)?directiveHandlers[r](t,r,n):throwWarning(t,'unknown document directive "'+r+'"')}skipSeparationSpace(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,skipSeparationSpace(t,!0,-1)):a&&throwError(t,"directives end mark is expected"),composeNode(t,t.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(t,!0,-1),t.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(t.input.slice(i,t.position))&&throwWarning(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&testDocumentSeparator(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,skipSeparationSpace(t,!0,-1)):t.position0?t.charCodeAt(i-1):null,h=h&&isPlainSafe(a,s)}else{for(i=0;in&&" "!==t[f+1],f=i);else if(!isPrintable(a))return STYLE_DOUBLE;s=i>0?t.charCodeAt(i-1):null,h=h&&isPlainSafe(a,s)}p=p||l&&i-f-1>n&&" "!==t[f+1]}return u||p?r>9&&needIndentIndicator(t)?STYLE_DOUBLE:p?STYLE_FOLDED:STYLE_LITERAL:h&&!o(t)?STYLE_PLAIN:STYLE_SINGLE}function writeScalar(t,e,r,n){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,r),i=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,a,t.indent,i,(function(e){return function(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r"+blockHeader(e,t.indent)+dropEndingNewline(indentString(function(t,e){for(var r,n,o,i=/(\n+)([^\n]*)/g,a=(o=-1!==(o=t.indexOf("\n"))?o:t.length,i.lastIndex=o,foldLine(t.slice(0,o),e)),s="\n"===t[0]||" "===t[0];n=i.exec(t);){var c=n[1],u=n[2];r=" "===u[0],a+=c+(s||r||""===u?"":"\n")+foldLine(u,e),s=r}return a}(e,i),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",i=0;i=55296&&e<=56319&&(r=t.charCodeAt(i+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),i++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[i]:n||encodeHex(e);return o}(e)+'"';default:throw new _$exception_9("impossible error: invalid scalar style")}}()}function blockHeader(t,e){var r=needIndentIndicator(t)?String(e):"",n="\n"===t[t.length-1];return r+(!n||"\n"!==t[t.length-2]&&"\n"!==t?n?"":"-":"+")+"\n"}function dropEndingNewline(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function foldLine(t,e){if(""===t||" "===t[0])return t;for(var r,n,o=/ [^ ]/g,i=0,a=0,s=0,c="";r=o.exec(t);)(s=r.index)-i>e&&(n=a>i?a:s,c+="\n"+t.slice(i,n),i=n+1),a=s;return c+="\n",t.length-i>e&&a>i?c+=t.slice(i,a)+"\n"+t.slice(a+1):c+=t.slice(i),c.slice(1)}function detectType(t,e,r){var n,o,i,a,s,c;for(i=0,a=(o=r?t.explicitTypes:t.implicitTypes).length;i tag resolver accepts not "'+c+'" style');n=s.represent[c](e,c)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,i){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var a=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(o=!1),c&&t.usedDuplicates[s])t.dump="*ref_"+s;else{if(u&&c&&!t.usedDuplicates[s]&&(t.usedDuplicates[s]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,i,a,s,c,u,p="",l=t.tag,f=Object.keys(r);if(!0===t.sortKeys)f.sort();else if("function"==typeof t.sortKeys)f.sort(t.sortKeys);else if(t.sortKeys)throw new _$exception_9("sortKeys must be a boolean or a function");for(o=0,i=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+="?":u+="? "),u+=t.dump,c&&(u+=generateNextLine(t,e)),writeNode(t,e+1,s,!0,c)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=t.dump));t.tag=l,t.dump=p||"{}"}(t,e,t.dump,o),c&&(t.dump="&ref_"+s+t.dump)):(function(t,e,r){var n,o,i,a,s,c="",u=t.tag,p=Object.keys(r);for(n=0,o=p.length;n1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,a,!1,!1)&&(c+=s+=t.dump));t.tag=u,t.dump="{"+c+"}"}(t,e,t.dump),c&&(t.dump="&ref_"+s+" "+t.dump));else if("[object Array]"===a){var p=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,i,a="",s=t.tag;for(o=0,i=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],i=[];for(function t(e,r,n){var o,i,a;if(null!==e&&"object"==typeof e)if(-1!==(i=r.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,a=e.length;i0?o-4:o;for(r=0;r>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===i&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,a[s++]=255&e),1===i&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,a=r-n;ia?a:i+16383));return 1===n?(e=t[r-1],o.push(lookup[e>>2]+lookup[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),o.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",__i_1=0,len=code.length;__i_10)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function encodeChunk(t,e,r){for(var n,o,i=[],a=e;a>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return i.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,p=-7,l=r?o-1:0,f=r?-1:1,h=t[e+l];for(l+=f,i=h&(1<<-p)-1,h>>=-p,p+=s;p>0;i=256*i+t[e+l],l+=f,p-=8);for(a=i&(1<<-p)-1,i>>=-p,p+=n;p>0;a=256*a+t[e+l],l+=f,p-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var a,s,c,u=8*i-o-1,p=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=p?(s=0,a=p):a+l>=1?(s=(e*c-1)*Math.pow(2,o),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=d,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,u-=8);t[r+h-d]|=128*_}},_$base64_4={exports:{}};(function(t,e){(function(){!function(t,e){var r,n;"object"==typeof _$base64_4.exports?_$base64_4.exports=e():"function"==typeof define&&define.amd?define(e):(r=t.Base64,(n=e()).noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:this,(function(){"use strict";var t,r="function"==typeof atob,n="function"==typeof btoa,o="function"==typeof e,i="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),c=(t={},s.forEach((function(e,r){return t[e]=r})),t),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,p=String.fromCharCode.bind(String),l="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t,e){return void 0===e&&(e=function(t){return t}),new Uint8Array(Array.prototype.slice.call(t,0).map(e))},f=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"}))},h=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(t){for(var e,r,n,o,i="",a=t.length%3,c=0;c255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");i+=s[(e=r<<16|n<<8|o)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return a?i.slice(0,a-3)+"===".substring(a):i},_=n?function(t){return btoa(t)}:o?function(t){return e.from(t,"binary").toString("base64")}:d,y=o?function(t){return e.from(t).toString("base64")}:function(t){for(var e=[],r=0,n=t.length;r>>6)+p(128|63&e):p(224|e>>>12&15)+p(128|e>>>6&63)+p(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return p(240|e>>>18&7)+p(128|e>>>12&63)+p(128|e>>>6&63)+p(128|63&e)},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,w=function(t){return t.replace(v,g)},b=o?function(t){return e.from(t,"utf8").toString("base64")}:a?function(t){return y(a.encode(t))}:function(t){return _(w(t))},E=function(t,e){return void 0===e&&(e=!1),e?f(b(t)):b(t)},S=function(t){return E(t,!0)},A=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return p(55296+(e>>>10))+p(56320+(1023&e));case 3:return p((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return p((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},R=function(t){return t.replace(A,O)},L=function(t){if(t=t.replace(/\s+/g,""),!u.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",i=0;i>16&255):64===n?p(e>>16&255,e>>8&255):p(e>>16&255,e>>8&255,255&e);return o},C=r?function(t){return atob(h(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:L,T=o?function(t){return l(e.from(t,"base64"))}:function(t){return l(C(t),(function(t){return t.charCodeAt(0)}))},x=function(t){return T(k(t))},I=o?function(t){return e.from(t,"base64").toString("utf8")}:i?function(t){return i.decode(T(t))}:function(t){return R(C(t))},k=function(t){return h(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},N=function(t){return I(k(t))},P=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},$=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,P(e))};t("fromBase64",(function(){return N(this)})),t("toBase64",(function(t){return E(this,t)})),t("toBase64URI",(function(){return E(this,!0)})),t("toBase64URL",(function(){return E(this,!0)})),t("toUint8Array",(function(){return x(this)}))},F=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,P(e))};t("toBase64",(function(t){return m(this,t)})),t("toBase64URI",(function(){return m(this,!0)})),t("toBase64URL",(function(){return m(this,!0)}))},j={version:"3.7.2",VERSION:"3.7.2",atob:C,atobPolyfill:L,btoa:_,btoaPolyfill:d,fromBase64:N,toBase64:E,encode:E,encodeURI:S,encodeURL:S,utob:w,btou:R,decode:N,isValid:function(t){if("string"!=typeof t)return!1;var e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:m,toUint8Array:x,extendString:$,extendUint8Array:F,extendBuiltins:function(){$(),F()},Base64:{}};return Object.keys(j).forEach((function(t){return j.Base64[t]=j[t]})),j}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_$buffer_2({}).Buffer),_$base64_4=_$base64_4.exports;var _$logical_42={};function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,s,"next",t)}function s(t){asyncGeneratorStep(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"untitled",debug=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_classCallCheck(this,OpenAPI),this.name=name,this.debug=debug,this.http=HTTP(),this.env=ENV(),this.node=function(){if(isNode){var fs=eval("require('fs')");return{fs:fs}}return null}(),this.initCache();var delay=function(t,e){return new Promise((function(r){setTimeout(r.bind(null,e),t)}))},_ref;Promise.prototype.delay=(_ref=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this;case 2:return r=t.sent,t.next=5,delay(e,r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return _ref.apply(this,arguments)})}return _createClass(OpenAPI,[{key:"initCache",value:function(){if(isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(isLoon||isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),isNode){var t="root.json";this.node.fs.existsSync(t)||this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.root={},t="".concat(this.name,".json"),this.node.fs.existsSync(t)?this.cache=JSON.parse(this.node.fs.readFileSync("".concat(this.name,".json"))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.cache={})}}},{key:"persistCache",value:function(){var t=JSON.stringify(this.cache,null,2);isQX&&$prefs.setValueForKey(t,this.name),(isLoon||isSurge)&&$persistentStore.write(t,this.name),isNode&&(this.node.fs.writeFileSync("".concat(this.name,".json"),t,{flag:"w"},(function(t){return console.log(t)})),this.node.fs.writeFileSync("root.json",JSON.stringify(this.root,null,2),{flag:"w"},(function(t){return console.log(t)})))}},{key:"write",value:function(t,e){if(this.log("SET ".concat(e)),-1!==e.indexOf("#")){if(e=e.substr(1),isSurge||isLoon)return $persistentStore.write(t,e);if(isQX)return $prefs.setValueForKey(t,e);isNode&&(this.root[e]=t)}else this.cache[e]=t;this.persistCache()}},{key:"read",value:function(t){return this.log("READ ".concat(t)),-1===t.indexOf("#")?this.cache[t]:(t=t.substr(1),isSurge||isLoon?$persistentStore.read(t):isQX?$prefs.valueForKey(t):isNode?this.root[t]:void 0)}},{key:"delete",value:function(t){if(this.log("DELETE ".concat(t)),-1!==t.indexOf("#")){if(t=t.substr(1),isSurge||isLoon)return $persistentStore.write(null,t);if(isQX)return $prefs.removeValueForKey(t);isNode&&delete this.root[t]}else delete this.cache[t];this.persistCache()}},{key:"notify",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n["open-url"],i=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(i?"\n\u591a\u5a92\u4f53:"+i:""),{url:o}),isLoon){var a={};o&&(a.openUrl=o),i&&(a.mediaUrl=i),"{}"===JSON.stringify(a)?$notification.post(t,e,r):$notification.post(t,e,r,a)}if(isNode){var s=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(i?"\n\u591a\u5a92\u4f53: ".concat(i):"");console.log("".concat(t,"\n").concat(e,"\n").concat(s,"\n\n"))}}},{key:"log",value:function(t){this.debug&&console.log("[".concat(this.name,"] LOG: ").concat(t))}},{key:"info",value:function(t){console.log("[".concat(this.name,"] INFO: ").concat(t))}},{key:"error",value:function(t){console.log("[".concat(this.name,"] ERROR: ").concat(t))}},{key:"wait",value:function(t){return new Promise((function(e){return setTimeout(e,t)}))}},{key:"done",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};isQX||isLoon||isSurge?$done(t):isNode&&"undefined"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}]),OpenAPI}();function ENV(){return{isQX:isQX,isLoon:isLoon,isSurge:isSurge,isNode:isNode}}function HTTP(){var defaultOptions=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{baseURL:""},_ENV=ENV(),isQX=_ENV.isQX,isLoon=_ENV.isLoon,isSurge=_ENV.isSurge,isNode=_ENV.isNode,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="string"==typeof options?{url:options}:options;var baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options=_objectSpread(_objectSpread({},defaultOptions),options);var timeout=options.timeout,events=_objectSpread(_objectSpread({},{onRequest:function(){},onResponse:function(t){return t},onTimeout:function(){}}),options.events),worker,timeoutid;events.onRequest(method,options),isQX?worker=$task.fetch({method:method,url:options.url,headers:options.headers,body:options.body}):(isLoon||isSurge||isNode)&&(worker=new Promise((function(resolve,reject){var request=isNode?eval("require('request')"):$httpClient;request[method.toLowerCase()](options,(function(t,e,r){t?reject(t):resolve({statusCode:e.status||e.statusCode,headers:e.headers,body:r})}))})));var timer=timeout?new Promise((function(t,e){timeoutid=setTimeout((function(){return events.onTimeout(),e("".concat(method," URL: ").concat(options.url," exceeds the timeout ").concat(timeout," ms"))}),timeout)})):null;return(timer?Promise.race([timer,worker]).then((function(t){return clearTimeout(timeoutid),t})):worker).then((function(t){return events.onResponse(t)}))}var http={};return methods.forEach((function(t){return http[t.toLowerCase()]=function(e){return send(t,e)}})),http}_$openApi_43.OpenAPI=OpenAPI;var _$download_40={};function ___typeof_40(t){return(___typeof_40="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ___regeneratorRuntime_40(){___regeneratorRuntime_40=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(R){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(R){return{type:"throw",arg:R}}}t.wrap=c;var p={};function l(){}function f(){}function h(){}var d={};s(d,o,(function(){return this}));var _=Object.getPrototypeOf,y=_&&_(_(A([])));y&&y!==e&&r.call(y,o)&&(d=y);var m=h.prototype=l.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==___typeof_40(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function __asyncGeneratorStep_40(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}Object.defineProperty(_$download_40,"__esModule",{value:!0}),_$download_40.default=function(t,e){return _download.apply(this,arguments)};var cache=new Map;function _download(){var t;return t=___regeneratorRuntime_40().mark((function t(e,r){var n,o,i;return ___regeneratorRuntime_40().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)")+e,!cache.has(n)){t.next=4;break}return t.abrupt("return",cache.get(n));case 4:return o=(0,_$openApi_43.HTTP)({headers:{"User-Agent":r}}),i=new Promise((function(t,r){o.get(e).then((function(e){var n=e.body;0===n.replace(/\s/g,"").length?r(new Error("\u8ba2\u9605\u5185\u5bb9\u4e3a\u7a7a\uff01")):t(n)}))})),cache.set(n,i),t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_40(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_40(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}var _$geo_41={};Object.defineProperty(_$geo_41,"__esModule",{value:!0}),_$geo_41.getFlag=function(t){for(var e={"\ud83c\udde6\ud83c\uddff":["\u963f\u585e\u62dc\u7586"],"\ud83c\udde6\ud83c\uddf9":["\u5965\u5730\u5229","\u5967\u5730\u5229","Austria","\u7ef4\u4e5f\u7eb3"],"\ud83c\udde6\ud83c\uddfa":["AU","Australia","Sydney","\u6fb3\u5927\u5229\u4e9a","\u6fb3\u6d32","\u58a8\u5c14\u672c","\u6089\u5c3c","\u571f\u6fb3","\u4eac\u6fb3","\u5ee3\u6fb3","\u6eec\u6fb3","\u6caa\u6fb3","\u5e7f\u6fb3"],"\ud83c\udde7\ud83c\uddea":["BE","\u6bd4\u5229\u6642","\u6bd4\u5229\u65f6"],"\ud83c\udde7\ud83c\uddec":["\u4fdd\u52a0\u5229\u4e9a","\u4fdd\u52a0\u5229\u4e9e","Bulgaria"],"\ud83c\udde7\ud83c\udded":["BH","\u5df4\u6797"],"\ud83c\udde7\ud83c\udde9":["BD","\u5b5f\u52a0\u62c9"],"\ud83c\uddf5\ud83c\uddf0":["\u5df4\u57fa\u65af\u5766"],"\ud83c\uddf0\ud83c\udded":["\u67ec\u57d4\u5be8"],"\ud83c\uddfa\ud83c\udde6":["\u70cf\u514b\u862d","\u4e4c\u514b\u5170"],"\ud83c\udded\ud83c\uddf7":["\u514b\u7f57\u5730\u4e9a","HR","\u514b\u7f85\u5730\u4e9e"],"\ud83c\udde8\ud83c\udde6":["Canada","CANADA","CAN","Waterloo","\u52a0\u62ff\u5927","\u8499\u7279\u5229\u5c14","\u6e29\u54e5\u534e","\u6953\u8449","\u67ab\u53f6","\u6ed1\u94c1\u5362","\u591a\u4f26\u591a","CA"],"\ud83c\udde8\ud83c\udded":["\u745e\u58eb","\u82cf\u9ece\u4e16","Switzerland","Zurich"],"\ud83c\uddf3\ud83c\uddec":["\u5c3c\u65e5\u5229\u4e9a","NG","\u5c3c\u65e5\u5229\u4e9e"],"\ud83c\udde8\ud83c\uddff":["Czechia","\u6377\u514b"],"\ud83c\uddf8\ud83c\uddf0":["\u65af\u6d1b\u4f10\u514b","SK"],"\ud83c\uddf7\ud83c\uddf8":["RS","\u585e\u5c14\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\udde9":["\u6469\u723e\u591a\u74e6","MD","\u6469\u5c14\u591a\u74e6"],"\ud83c\udde9\ud83c\uddea":["DE","German","GERMAN","\u5fb7\u56fd","\u5fb7\u570b","\u6cd5\u5170\u514b\u798f","\u4eac\u5fb7","\u6eec\u5fb7","\u5ee3\u5fb7","\u6caa\u5fb7","\u5e7f\u5fb7","Frankfurt"],"\ud83c\udde9\ud83c\uddf0":["DK","DNK","\u4e39\u9ea6","\u4e39\u9ea5"],"\ud83c\uddea\ud83c\uddf8":["ES","\u897f\u73ed\u7259","Spain"],"\ud83c\uddea\ud83c\uddfa":["EU","\u6b27\u76df","\u6b27\u7f57\u5df4"],"\ud83c\uddeb\ud83c\uddee":["Finland","\u82ac\u5170","\u82ac\u862d","\u8d6b\u5c14\u8f9b\u57fa"],"\ud83c\uddeb\ud83c\uddf7":["FR","France","\u6cd5\u56fd","\u6cd5\u570b","\u5df4\u9ece"],"\ud83c\uddec\ud83c\udde7":["UK","GB","England","United Kingdom","\u82f1\u56fd","\u4f26\u6566","\u82f1","London"],"\ud83c\uddf2\ud83c\uddf4":["MO","Macao","\u6fb3\u95e8","\u6fb3\u9580","CTM"],"\ud83c\uddf0\ud83c\uddff":["\u54c8\u8428\u514b\u65af\u5766","\u54c8\u8428\u514b"],"\ud83c\udded\ud83c\uddfa":["\u5308\u7259\u5229","Hungary"],"\ud83c\udded\ud83c\uddf0":["HK","Hongkong","Hong Kong","HongKong","HONG KONG","\u9999\u6e2f","\u6df1\u6e2f","\u6caa\u6e2f","\u547c\u6e2f","HKT","HKBN","HGC","WTT","CMI","\u7a57\u6e2f","\u4eac\u6e2f","\u6e2f"],"\ud83c\uddee\ud83c\udde9":["Indonesia","\u5370\u5c3c","\u5370\u5ea6\u5c3c\u897f\u4e9a","\u96c5\u52a0\u8fbe"],"\ud83c\uddee\ud83c\uddea":["Ireland","IRELAND","\u7231\u5c14\u5170","\u611b\u723e\u862d","\u90fd\u67cf\u6797"],"\ud83c\uddee\ud83c\uddf1":["Israel","\u4ee5\u8272\u5217"],"\ud83c\uddee\ud83c\uddf3":["India","IND","INDIA","\u5370\u5ea6","\u5b5f\u4e70","MFumbai"],"\ud83c\uddee\ud83c\uddf8":["IS","ISL","\u51b0\u5c9b","\u51b0\u5cf6"],"\ud83c\uddf0\ud83c\uddf5":["KP","\u671d\u9c9c"],"\ud83c\uddf0\ud83c\uddf7":["KR","Korea","KOR","\u97e9\u56fd","\u9996\u5c14","\u97e9","\u97d3","\u6625\u5ddd","Chuncheon","Seoul"],"\ud83c\uddf1\ud83c\uddfa":["\u5362\u68ee\u5821"],"\ud83c\uddf1\ud83c\uddfb":["Latvia","Latvija","\u62c9\u8131\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\uddfd":["MEX","MX","\u58a8\u897f\u54e5"],"\ud83c\uddf2\ud83c\uddfe":["MY","Malaysia","MALAYSIA","\u9a6c\u6765\u897f\u4e9a","\u5927\u99ac","\u99ac\u4f86\u897f\u4e9e","\u5409\u9686\u5761"],"\ud83c\uddf3\ud83c\uddf1":["NL","Netherlands","\u8377\u5170","\u8377\u862d","\u5c3c\u5fb7\u862d","\u963f\u59c6\u65af\u7279\u4e39"],"\ud83c\uddf3\ud83c\uddf5":["\u5c3c\u6cca\u5c14"],"\ud83c\uddf5\ud83c\udded":["PH","Philippines","\u83f2\u5f8b\u5bbe","\u83f2\u5f8b\u8cd3"],"\ud83c\uddf5\ud83c\uddf7":["PR","\u6ce2\u591a\u9ece\u5404"],"\ud83c\uddf7\ud83c\uddf4":["RO","\u7f57\u9a6c\u5c3c\u4e9a"],"\ud83c\uddf7\ud83c\uddfa":["RU","Russia","\u4fc4\u7f57\u65af","\u4fc4\u56fd","\u4fc4\u7f85\u65af","\u4f2f\u529b","\u83ab\u65af\u79d1","\u5723\u5f7c\u5f97\u5821","\u897f\u4f2f\u5229\u4e9a","\u65b0\u897f\u4f2f\u5229\u4e9a","\u4eac\u4fc4","\u676d\u4fc4","\u5ee3\u4fc4","\u6eec\u4fc4","\u5e7f\u4fc4","\u6caa\u4fc4","Moscow"],"\ud83c\uddf8\ud83c\udde6":["\u6c99\u7279"],"\ud83c\uddf8\ud83c\uddea":["SE","Sweden","\u745e\u5178"],"\ud83c\uddf2\ud83c\uddf9":["\u9a6c\u8033\u4ed6"],"\ud83c\uddf2\ud83c\udde6":["MA","\u6469\u6d1b\u54e5"],"\ud83c\uddf8\ud83c\uddec":["SG","Singapore","SINGAPORE","\u65b0\u52a0\u5761","\u72ee\u57ce","\u6caa\u65b0","\u4eac\u65b0","\u6cc9\u65b0","\u7a57\u65b0","\u6df1\u65b0","\u676d\u65b0","\u5e7f\u65b0","\u5ee3\u65b0","\u6eec\u65b0"],"\ud83c\uddf9\ud83c\udded":["TH","Thailand","\u6cf0\u56fd","\u6cf0\u570b","\u66fc\u8c37"],"\ud83c\uddf9\ud83c\uddf7":["TR","Turkey","\u571f\u8033\u5176","\u4f0a\u65af\u5766\u5e03\u5c14"],"\ud83c\uddf9\ud83c\uddfc":["TW","Taiwan","TAIWAN","\u53f0\u6e7e","\u53f0\u5317","\u53f0\u4e2d","\u65b0\u5317","\u5f70\u5316","CHT","\u53f0","HINET","Taipei"],"\ud83c\uddfa\ud83c\uddf8":["US","USA","America","United States","\u7f8e\u56fd","\u7f8e","\u4eac\u7f8e","\u6ce2\u7279\u5170","\u8fbe\u62c9\u65af","\u4fc4\u52d2\u5188","\u51e4\u51f0\u57ce","\u8d39\u5229\u8499","\u7845\u8c37","\u77fd\u8c37","\u62c9\u65af\u7ef4\u52a0\u65af","\u6d1b\u6749\u77f6","\u5723\u4f55\u585e","\u5723\u514b\u62c9\u62c9","\u897f\u96c5\u56fe","\u829d\u52a0\u54e5","\u6caa\u7f8e","\u54e5\u4f26\u5e03","\u7ebd\u7ea6","Los Angeles","San Jose","Sillicon Valley","Michigan"],"\ud83c\uddfb\ud83c\uddf3":["VN","\u8d8a\u5357","\u80e1\u5fd7\u660e\u5e02"],"\ud83c\uddfb\ud83c\uddea":["VE","\u59d4\u5185\u745e\u62c9"],"\ud83c\uddee\ud83c\uddf9":["Italy","IT","Nachash","\u610f\u5927\u5229","\u7c73\u5170","\u7fa9\u5927\u5229"],"\ud83c\uddff\ud83c\udde6":["South Africa","\u5357\u975e"],"\ud83c\udde6\ud83c\uddea":["United Arab Emirates","\u963f\u8054\u914b","\u8fea\u62dc","AE"],"\ud83c\udde7\ud83c\uddf7":["BR","Brazil","\u5df4\u897f","\u5723\u4fdd\u7f57"],"\ud83c\uddef\ud83c\uddf5":["JP","Japan","JAPAN","\u65e5\u672c","\u4e1c\u4eac","\u5927\u962a","\u57fc\u7389","\u6caa\u65e5","\u7a57\u65e5","\u5ddd\u65e5","\u4e2d\u65e5","\u6cc9\u65e5","\u676d\u65e5","\u6df1\u65e5","\u8fbd\u65e5","\u5e7f\u65e5","\u5927\u5742","Osaka","Tokyo"],"\ud83c\udde6\ud83c\uddf7":["AR","\u963f\u6839\u5ef7"],"\ud83c\uddf3\ud83c\uddf4":["Norway","\u632a\u5a01","NO"],"\ud83c\udde8\ud83c\uddf3":["CN","China","\u56de\u56fd","\u4e2d\u56fd","\u4e2d\u570b","\u6c5f\u82cf","\u5317\u4eac","\u4e0a\u6d77","\u5e7f\u5dde","\u6df1\u5733","\u676d\u5dde","\u5f90\u5dde","\u9752\u5c9b","\u5b81\u6ce2","\u9547\u6c5f","back"],"\ud83c\uddf5\ud83c\uddf1":["PL","POL","\u6ce2\u5170","\u6ce2\u862d"],"\ud83c\udde8\ud83c\uddf1":["\u667a\u5229"],"\ud83c\uddf3\ud83c\uddff":["\u65b0\u897f\u862d","\u65b0\u897f\u5170"],"\ud83c\uddec\ud83c\uddf7":["\u5e0c\u814a","\u5e0c\u81d8"],"\ud83c\uddea\ud83c\uddec":["\u57c3\u53ca"],"\ud83c\udde8\ud83c\uddfe":["CY","\u585e\u6d66\u8def\u65af"],"\ud83c\udde8\ud83c\uddf7":["CR","\u54e5\u65af\u8fbe\u9ece\u52a0"],"\ud83c\uddf8\ud83c\uddee":["SI","\u65af\u6d1b\u6587\u5c3c\u4e9a"],"\ud83c\uddf1\ud83c\uddf9":["LT","\u7acb\u9676\u5b9b"],"\ud83c\uddf5\ud83c\udde6":["PA","\u5df4\u62ff\u9a6c"],"\ud83c\uddf9\ud83c\uddf3":["TN","\u7a81\u5c3c\u65af"],"\ud83c\uddee\ud83c\uddf2":["\u9a6c\u6069\u5c9b","\u99ac\u6069\u5cf6"],"\ud83c\udde7\ud83c\uddfe":["BY","\u767d\u4fc4","\u767d\u4fc4\u7f57\u65af"],"\ud83c\uddf5\ud83c\uddf9":["\u8461\u8404\u7259"],"\ud83c\uddf0\ud83c\uddea":["KE","\u80af\u5c3c\u4e9a"],"\ud83c\uddf0\ud83c\uddec":["KG","\u5409\u5c14\u5409\u65af\u5766"],"\ud83c\uddef\ud83c\uddf4":["JO","\u7ea6\u65e6"],"\ud83c\uddfa\ud83c\uddfe":["UY","\u4e4c\u62c9\u572d"],"\ud83c\uddf2\ud83c\uddf3":["\u8499\u53e4"],"\ud83c\uddee\ud83c\uddf7":["IR","\u4f0a\u6717"],"\ud83c\uddf5\ud83c\uddea":["\u79d8\u9c81","\u7955\u9b6f"],"\ud83c\udde8\ud83c\uddf4":["\u54e5\u4f26\u6bd4\u4e9a"],"\ud83c\uddea\ud83c\uddea":["\u7231\u6c99\u5c3c\u4e9a"],"\ud83c\uddea\ud83c\udde8":["EC","\u5384\u74dc\u591a\u5c14"],"\ud83c\uddf2\ud83c\uddf0":["\u9a6c\u5176\u987f","\u99ac\u5176\u9813"],"\ud83c\udde7\ud83c\udde6":["\u6ce2\u9ed1\u5171\u548c\u56fd","\u6ce2\u9ed1"],"\ud83c\uddec\ud83c\uddea":["\u683c\u9b6f\u5409\u4e9e","\u683c\u9c81\u5409\u4e9a"],"\ud83c\udde6\ud83c\uddf1":["\u963f\u723e\u5df4\u5c3c\u4e9e","\u963f\u5c14\u5df4\u5c3c\u4e9a"],"\ud83c\udff3\ufe0f\u200d\ud83c\udf08":["\u6d41\u91cf","\u65f6\u95f4","\u5e94\u6025","\u8fc7\u671f","Bandwidth","expire"]},r=0,n=Object.keys(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function __asyncGeneratorStep_37(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___asyncToGenerator_37(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_37(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_37(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(c){s=!0,o=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function __ownKeys_37(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_37(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_37(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_37(t,e):void 0}}function ___arrayLikeToArray_37(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},(keys=["dm1lc3M","c3NyOi8v","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c"],{name:"Base64 Pre-processor",test:function(t){return keys.some((function(e){return-1!==t.indexOf(e)}))},parse:function(t){return _$base64_4.Base64.decode(t)}}),{name:"Clash Pre-processor",test:function(t){return/proxies/.test(t)},parse:function(t){return(0,_$staticJsYaml_35.safeLoad)(t).proxies.map((function(t){return JSON.stringify(t)})).join("\n")}},{name:"SSD Pre-processor",test:function(t){return 0===t.indexOf("ssd://")},parse:function(t){for(var e=[],r=JSON.parse(_$base64_4.Base64.decode(t.split("ssd://")[1])),n=r.port,o=r.encryption,i=r.password,a=r.servers,s=0;s1){var u,p=_createForOfIteratorHelper(t);try{for(p.s();!(u=p.n()).done;){var l=_slicedToArray(u.value.split("="),2),f=l[0],h=l[1];c[f]=h.trim()}}catch(d){p.e(d)}finally{p.f()}}return ___objectSpread_37(___objectSpread_37({},s),{},{name:c.remarks?_$base64_4.Base64.decode(c.remarks):s.server,"protocol-param":_$base64_4.Base64.decode(c.protoparam||"").replace(/\s/g,""),"obfs-param":_$base64_4.Base64.decode(c.obfsparam||"").replace(/\s/g,"")})}}),{name:"URI VMess Parser",test:function(t){return/^vmess:\/\//.test(t)},parse:function(t){t=t.split("vmess://")[1];var e=_$base64_4.Base64.decode(t);if(/=\s*vmess/.test(e)){var r,n=e.split(",").map((function(t){return t.trim()})),o={},i=_createForOfIteratorHelper(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(-1!==a.indexOf("=")){var s=_slicedToArray(a.split("="),2),c=s[0],u=s[1];o[c.trim()]=u.trim()}}}catch(d){i.e(d)}finally{i.f()}var p={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:n[3],uuid:n[4].match(/^"(.*)"$/)[1],tls:"over-tls"===o.obfs||"wss"===o.obfs};if(void 0!==o["udp-relay"]&&(p.udp=JSON.parse(o["udp-relay"])),void 0!==o["fast-open"]&&(p.udp=JSON.parse(o["fast-open"])),"ws"===o.obfs||"wss"===o.obfs){p.network="ws",p["ws-opts"].path=(o["obfs-path"]||'"/"').match(/^"(.*)"$/)[1];var l=o["obfs-header"];l&&-1!==l.indexOf("Host")&&(l=l.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),p["ws-opts"].headers={Host:l||p.server}}return p.tls&&"false"===o['"tls-verification"']&&(p["skip-cert-verify"]=!0),p.tls&&o["obfs-host"]&&(p.sni=o["obfs-host"]),p}var f=JSON.parse(e),h={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:f.aid||0,tls:"tls"===f.tls||!0===f.tls,supported:{}};return"ws"===f.net&&(h.network="ws",h["ws-opts"]={path:f.path,headers:{Host:f.host||f.add}},h.tls&&f.host&&(h.sni=f.host)),!1===f.verify_cert&&(h["skip-cert-verify"]=!0),h}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){var e=_slicedToArray((t=t.split("trojan://")[1]).split("@")[1].split("?")[0].split(":"),2),r=e[0],n=e[1],o=decodeURIComponent(t.split("#")[1].trim()),i=t.split("?"),a=null;return i.length>1&&(i=i[1].split("#")[0].split("&"),a=new Map(i.map((function(t){return t.split("=")}))).get("sni")),{name:o||"[Trojan] ".concat(r),type:"trojan",server:r,port:n,password:t.split("@")[0],sni:a,supported:{}}}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){return JSON.parse(t)}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){var e=r(t),n={name:e.name,type:"ss",server:e.server,port:e.port,cipher:e["encrypt-method"],password:e.password,tfo:JSON.parse(e.tfo||"false"),udp:JSON.parse(e["udp-relay"]||"false")};return e.obfs&&(n.plugin="obfs",n["plugin-opts"]={mode:e.obfs,host:e["obfs-host"]}),n}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){var e=r(t),n={name:e.name,type:"vmess",server:e.server,port:e.port,uuid:e.username,alterId:0,cipher:"none",tls:JSON.parse(e.tls||"false"),tfo:JSON.parse(e.tfo||"false")};if(n.tls&&(void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n.sni=e.sni||e.server),JSON.parse(e.ws||"false")){n.network="ws",n["ws-opts"]={path:e["ws-path"]};var o=e["ws-headers"].match(/(,|^|\s)*HOST:\s*(.*?)(,|$)/),i=o?o[2]:n.server;n["ws-opts"].headers={Host:i||e.server}}return n}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])&&-1!==t.indexOf("sni")},parse:function(t){var e=r(t),n={name:e.name,type:"trojan",server:e.server,port:e.port,password:e.password,sni:e.sni||e.server,tfo:JSON.parse(e.tfo||"false")};return void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])&&!e().test(t)},parse:function(t){var e=r(t),n=/^.*?=\s?https/.test(t),o={name:e.name,type:"http",server:e.server,port:e.port,tls:JSON.parse(n||"false"),tfo:JSON.parse(e.tfo||"false")};return o.tls&&(void 0!==e["skip-cert-verify"]&&(o["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),o.sni=e.sni||e.server),e.username&&"none"!==e.username&&(o.username=e.username),e.password&&"none"!==e.password&&(o.password=e.password),o}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"ss",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,"")};return e.length>5&&(r.plugin="obfs",r["plugin-opts"]={mode:e[5],host:e[6]}),r}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(",");return{name:t.split("=")[0].trim(),type:"ssr",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,""),protocol:e[5],"protocol-param":e[6].match(/{(.*)}/)[1],supported:{Surge:!1},obfs:e[7],"obfs-param":e[8].match(/{(.*)}/)[1]}}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){var e,r=t.split("=")[1].split(","),n={name:t.split("=")[0].trim(),type:"vmess",server:r[1],port:r[2],cipher:r[3]||"none",uuid:r[4].replace(/"/g,""),alterId:0},o=_createForOfIteratorHelper(r=r.splice(5));try{for(o.s();!(e=o.n()).done;){var i=_slicedToArray(e.value.split(":"),2),a=i[0],s=i[1];r[a]=s}}catch(c){o.e(c)}finally{o.f()}switch(n.tls=JSON.parse(r["over-tls"]||"false"),n.tls&&(n.sni=r["tls-name"]||n.server,n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),r.transport){case"tcp":break;case"ws":n.network=r.transport,n["ws-opts"]={path:r.path,headers:{Host:r.host}}}return n.tls&&(n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),n}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])&&-1===t.indexOf("password")},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"trojan",server:e[1],port:e[2],password:e[3].replace(/"/g,""),sni:e[1],"skip-cert-verify":JSON.parse(e["skip-cert-verify"]||"false")};if(e.length>4){var n=_slicedToArray(e[4].split(":"),2),o=n[0],i=n[1];if("tls-name"!==o)throw new Error("Unknown option ".concat(o," for line: \n").concat(t));r.sni=i}return r}},e(),{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ss",server:r.server,port:r.port,cipher:r.method,password:r.password,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{}};if(r.obfs)switch(n["plugin-opts"]={host:r["obfs-host"]||n.server},r.obfs){case"http":case"tls":n.plugin="obfs",n["plugin-opts"].mode=r.obfs;break;case"ws":case"wss":n["plugin-opts"]=___objectSpread_37(___objectSpread_37({},n["plugin-opts"]),{},{mode:"websocket",path:r["obfs-uri"]||"/",tls:"wss"===r.obfs}),n["plugin-opts"].tls&&void 0!==r["tls-verification"]&&(n["plugin-opts"]["skip-cert-verify"]=r["tls-verification"]),n.plugin="v2ray-plugin",n.supported.Surge=!1,n.supported.Loon=!1}return n}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ssr",server:r.server,port:r.port,cipher:r.method,password:r.password,protocol:r["ssr-protocol"],obfs:"plain","protocol-param":r["ssr-protocol-param"],udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{Surge:!1}};return r.obfs&&(n.obfs=r.obfs,n["obfs-param"]=r["obfs-host"]),n}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"vmess",name:r.tag,server:r.server,port:r.port,cipher:r.method||"none",uuid:r.password,alterId:0,tls:"over-tls"===r.obfs||"wss"===r.obfs,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n.tls&&(n.sni=r["obfs-host"]||r.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),"ws"!==r.obfs&&"wss"!==r.obfs||(n.network="ws",n["ws-opts"]={path:r["obfs-uri"],headers:{Host:r["obfs-host"]||r.server}}),n}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"trojan",name:r.tag,server:r.server,port:r.port,password:r.password,sni:r["tls-host"]||r.server,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true"),n}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"http",name:r.tag,server:r.server,port:r.port,tls:JSON.parse(r["over-tls"]||"false"),udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return r.username&&"none"!==r.username&&(n.username=r.username),r.password&&"none"!==r.password&&(n.password=r.password),n.tls&&(n.sni=r["tls-host"]||n.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),n}}];var n}(),PROXY_PROCESSORS=function(){function SetPropertyOperator(t){var e=t.key,r=t.value;return{name:"Set Property Operator",func:function(t){return t.map((function(t){return t[e]=r,t}))}}}function FlagOperator(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{name:"Flag Operator",func:function(e){return e.map((function(e){if(t){var r=(0,_$geo_41.getFlag)(e.name);e.name=removeFlag(e.name),e.name=r+" "+e.name,e.name=e.name.replace(/\ud83c\uddf9\ud83c\uddfc/g,"\ud83c\udde8\ud83c\uddf3")}else e.name=removeFlag(e.name);return e}))}}}function HandleDuplicateOperator(t){var e=___objectSpread_37(___objectSpread_37({},{action:"rename",template:"0 1 2 3 4 5 6 7 8 9",link:"-",position:"back"}),t),r=e.action,n=e.template,o=e.link,i=e.position;return{name:"Handle Duplicate Operator",func:function(t){if("delete"===r){var e={};return t.filter((function(t){return!e[t.name]&&(e[t.name]=!0,!0)}))}if("rename"===r){var a=n.split(" "),s={},c=0;t.forEach((function(t){void 0===s[t.name]?s[t.name]=1:s[t.name]++,c=Math.max(s[t.name].toString().length,c)}));var u={};return t.map((function(t){if(s[t.name]>1){void 0===u[t.name]&&(u[t.name]=1);for(var e="",r=u[t.name]++,n=0;r>0;)e=a[r%10]+e,r=parseInt(r/10),n++;for(;n++0&&void 0!==arguments[0]?arguments[0]:"asc";return{name:"Sort Operator",func:function(e){switch(t){case"asc":case"desc":return e.sort((function(e,r){return(e.name>r.name?1:-1)*("desc"===t?-1:1)}));case"random":return shuffle(e);default:throw new Error("Unknown sort option: "+t)}}}}function RegexSortOperator(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return buildRegex(t)})),e.sort((function(e,r){var n=getRegexOrder(t,e.name),o=getRegexOrder(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1?e-1:0),n=1;n1&&void 0!==w[1]?w[1]:[],n=w.length>2?w[2]:void 0,o=_createForOfIteratorHelper(r),t.prev=3,o.s();case 5:if((i=o.n()).done){t.next=38;break}if(a=i.value,s=void 0,c={},-1===a.type.indexOf("Script")){t.next=29;break}if(u=a.args,p=u.mode,l=u.content,"link"!==p){t.next=28;break}if((h=(f=l).split("#")).length>1){d=_createForOfIteratorHelper(h[1].split("&"));try{for(d.s();!(_=d.n()).done;)y=_.value,m=y.split("=")[0],g=y.split("=")[1]||!0,c[m]=g}catch(b){d.e(b)}finally{d.f()}}return t.prev=15,t.next=18,(0,___download_37.default)(f.split("#")[0]);case 18:s=t.sent,_app.default.info("Script loaded: >>>\n ".concat(s)),t.next=26;break;case 22:return t.prev=22,t.t0=t.catch(15),_app.default.error("Error when downloading remote script: ".concat(a.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",36);case 26:t.next=29;break;case 28:s=l;case 29:if(PROXY_PROCESSORS[a.type]){t.next=32;break}return _app.default.error('Unknown operator: "'.concat(a.type,'"')),t.abrupt("continue",36);case 32:_app.default.info('Applying "'.concat(a.type,'" with arguments:\n >>> ').concat(JSON.stringify(a.args,null,2)||"None")),v=void 0,v=-1!==a.type.indexOf("Script")?PROXY_PROCESSORS[a.type](s,n,c):PROXY_PROCESSORS[a.type](a.args),e=ApplyProcessor(v,e);case 36:t.next=5;break;case 38:t.next=43;break;case 40:t.prev=40,t.t1=t.catch(3),o.e(t.t1);case 43:return t.prev=43,o.f(),t.finish(43);case 46:return t.abrupt("return",e);case 47:case"end":return t.stop()}}),t,null,[[3,40,43,46],[15,22]])})))).apply(this,arguments)}return{parse:function(e){e=function(t){var e,r=_createForOfIteratorHelper(PROXY_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return _app.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){_app.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(e);var r,n,o=[],i=_createForOfIteratorHelper(e.split("\n"));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(0!==(a=a.trim()).length){var s=r&&t(r,a);if(!s){var c,u=_createForOfIteratorHelper(PROXY_PARSERS);try{for(u.s();!(c=u.n()).done;){var p=c.value;if(t(p,a)){r=p,s=!0,_app.default.info("Proxy parser: ".concat(p.name," is activated"));break}}}catch(f){u.e(f)}finally{u.f()}}if(s)try{var l=r.parse(a);l||_app.default.error("Parser ".concat(r.name," return nothing for \n").concat(a,"\n")),o.push(l)}catch(f){_app.default.error("Failed to parse line: \n ".concat(a,"\n Reason: ").concat(f.stack))}else _app.default.error("Failed to find a rule to parse line: \n".concat(a,"\n"))}}}catch(f){i.e(f)}finally{i.f()}return o},process:function(t){return e.apply(this,arguments)},produce:function(t,e){var r=PROXY_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return t=t.filter((function(t){return!(t.supported&&!1===t.supported[e])})),_app.default.info("Producing proxies for target: ".concat(e)),void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.produce(t)}catch(e){return _app.default.error("Cannot produce proxy: ".concat(JSON.stringify(t,null,2),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.produce(t):void 0}}}(),keys;function ApplyProcessor(t,e){return-1!==t.name.indexOf("Filter")?function(t,e){var r=(0,_$logical_42.FULL)(e.length,!0);try{r=(0,_$logical_42.AND)(r,t.func(e))}catch(n){console.log("Cannot apply filter ".concat(t.name,"\n Reason: ").concat(n))}return e.filter((function(t,e){return r[e]}))}(t,e):-1!==t.name.indexOf("Operator")?function(t,e){var r=clone(e);try{var n=t.func(r);n&&(r=n)}catch(o){console.log("Cannot apply operator ".concat(t.name,"! Reason: ").concat(o))}return r}(t,e):void 0}function shuffle(t){for(var e,r,n=t.length;0!==n;)r=Math.floor(Math.random()*n),e=t[n-=1],t[n]=t[r],t[r]=e;return t}function clone(t){return JSON.parse(JSON.stringify(t))}function removeFlag(t){return t.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/g,"").trim()}_$proxyUtils_37.ProxyUtils=ProxyUtils;var _$ruleUtils_38={};function ___typeof_38(t){return(___typeof_38="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(_$ruleUtils_38,"__esModule",{value:!0}),_$ruleUtils_38.RuleUtils=void 0;var ___staticJsYaml_38=___interopRequireDefault_38(_$staticJsYaml_35),___app_38=___interopRequireDefault_38(_$app_36);function ___interopRequireDefault_38(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_38(){___regeneratorRuntime_38=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(R){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(R){return{type:"throw",arg:R}}}t.wrap=c;var p={};function l(){}function f(){}function h(){}var d={};s(d,o,(function(){return this}));var _=Object.getPrototypeOf,y=_&&_(_(A([])));y&&y!==e&&r.call(y,o)&&(d=y);var m=h.prototype=l.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var p=c.arg,l=p.value;return l&&"object"==___typeof_38(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function __asyncGeneratorStep_38(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___createForOfIteratorHelper_38(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_38(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_38(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ___arrayLikeToArray_38(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},{name:"Clash Provider",test:function(t){return 0===t.indexOf("payload:")},parse:function(t){return t.replace("payload:","").replace(/^\s*-\s*/gm,"")}}],RULE_PARSERS=[{name:"Universal Rule Parser",test:function(){return!0},parse:function(t){var e,r=[],n=___createForOfIteratorHelper_38(t.split("\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(0!==(o=o.trim()).length&&!/\s*#/.test(o))try{var i,a=o.split(",").map((function(t){return t.trim()})),s=a[0],c=!1,u=___createForOfIteratorHelper_38(RULE_TYPES_MAPPING);try{for(u.s();!(i=u.n()).done;){var p=i.value;if(p[0].test(s)){c=!0;var l={type:p[1],content:a[1]};"IP-CIDR"!==l.type&&"IP-CIDR6"!==l.type||(l.options=a.slice(2)),r.push(l)}}}catch(f){u.e(f)}finally{u.f()}if(!c)throw new Error("Invalid rule type: "+s)}catch(h){console.error("Failed to parse line: ".concat(o,"\n Reason: ").concat(h))}}}catch(f){n.e(f)}finally{n.f()}return r}}],RULE_PROCESSORS={"Regex Filter":function(t){var e=t.regex,r=void 0===e?[]:e,n=t.keep,o=void 0===n||n;return{name:"Regex Filter",func:function(t){return t.map((function(t){var e=r.some((function(e){return(e=new RegExp(e)).test(t)}));return o?e:!e}))}}},"Remove Duplicate Filter":function(){return{name:"Remove Duplicate Filter",func:function(t){var e=new Set,r=[];return t.forEach((function(t){var n=t.options||[];n.sort();var o="".concat(t.type,",").concat(t.content,",").concat(JSON.stringify(n));e.has(o)||(r.push(t),e.add(o))})),r}}},"Type Filter":function(t){return{name:"Type Filter",func:function(e){return e.map((function(e){return t.some((function(t){return e.type===t}))}))}}},"Regex Replace Operator":function(t){return{name:"Regex Rename Operator",func:function(e){return e.map((function(e){var r,n=___createForOfIteratorHelper_38(t);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=o.expr,a=o.now;e.content=e.content.replace(new RegExp(i,"g"),a).trim()}}catch(s){n.e(s)}finally{n.f()}return e}))}}}},RULE_PRODUCERS={QX:{type:"SINGLE",func:function(t){return-1!==["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:"".concat({"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[t.type]||t.type,",").concat(t.content,",SUB-STORE")}},Surge:{type:"SINGLE",func:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}},Loon:{type:"SINGLE",func:function(t){return-1!==["DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}(t)}},Clash:{type:"ALL",func:function(t){var e={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},r={payload:t.map((function(t){var r="".concat(e[t.type]||t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(r+=t.options?",".concat(t.options[0]):""),r}))};return ___staticJsYaml_38.default.dump(r)}}},RuleUtils=function(){function t(){var e;return e=___regeneratorRuntime_38().mark((function t(e,r){var n,o,i,a;return ___regeneratorRuntime_38().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=___createForOfIteratorHelper_38(r),t.prev=1,n.s();case 3:if((o=n.n()).done){t.next=13;break}if(i=o.value,RULE_PROCESSORS[i.type]){t.next=8;break}return console.error("Unknown operator: ".concat(i.type,"!")),t.abrupt("continue",11);case 8:a=RULE_PROCESSORS[i.type](i.args),___app_38.default.info('Applying "'.concat(i.type,'" with arguments: \n >>> ').concat(JSON.stringify(i.args)||"None")),e=(0,_$proxyUtils_37.ApplyProcessor)(a,e);case 11:t.next=3;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),n.e(t.t0);case 18:return t.prev=18,n.f(),t.finish(18);case 21:return t.abrupt("return",e);case 22:case"end":return t.stop()}}),t,null,[[1,15,18,21]])})),(t=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){__asyncGeneratorStep_38(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_38(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}return{parse:function(t){t=function(t){var e,r=___createForOfIteratorHelper_38(RULE_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return ___app_38.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){___app_38.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(t);var e,r=___createForOfIteratorHelper_38(RULE_PARSERS);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=void 0;try{o=n.test(t)}catch(i){o=!1}if(o)return ___app_38.default.info("Rule parser [".concat(n.name,"] is activated!")),n.parse(t)}}catch(i){r.e(i)}finally{r.f()}},process:function(e,r){return t.apply(this,arguments)},produce:function(t,e){var r=RULE_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.func(t)}catch(e){return console.log("ERROR: cannot produce rule: ".concat(JSON.stringify(t),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.func(t):void 0}}}();_$ruleUtils_38.RuleUtils=RuleUtils;var _$resourceParserLoon_39={},RESOURCE_TYPE_RULE=2,result=$resource;if(1===$resourceType){var proxies=_$proxyUtils_37.ProxyUtils.parse($resource);result=_$proxyUtils_37.ProxyUtils.produce(proxies,"Loon")}else if($resourceType===RESOURCE_TYPE_RULE){var rules=_$ruleUtils_38.RuleUtils.parse($resource);result=_$ruleUtils_38.RuleUtils.produce(rules,"Loon")}$done(result)}(); \ No newline at end of file diff --git a/backend/src/core/proxy-utils.js b/backend/src/core/proxy-utils.js index 3dcf984..1906494 100644 --- a/backend/src/core/proxy-utils.js +++ b/backend/src/core/proxy-utils.js @@ -915,18 +915,19 @@ const PROXY_PARSERS = (function () { const name = 'Surge HTTP Parser'; const test = (line) => { return ( - /^.*=\s*http/.test(line.split(',')[0]) && + /^.*=\s*https?/.test(line.split(',')[0]) && !Loon_Http().test(line) ); }; const parse = (line) => { const params = getSurgeParams(line); + const tls = /^.*?=\s?https/.test(line); const proxy = { name: params.name, type: 'http', server: params.server, port: params.port, - tls: JSON.parse(params.tls || 'false'), + tls: JSON.parse(tls || 'false'), tfo: JSON.parse(params.tfo || 'false'), }; if (proxy.tls) { @@ -1624,13 +1625,14 @@ const PROXY_PRODUCERS = (function () { },udp-relay=${proxy.udp || 'false'}`; break; case 'http': - tls_opts = ', tls=false'; if (proxy.tls) { - tls_opts = `,tls=true,skip-cert-verify=${proxy['skip-cert-verify']},sni=${proxy.sni}`; + tls_opts = `,skip-cert-verify=${proxy['skip-cert-verify']},sni=${proxy.sni}`; } - result = `${proxy.name}=http, ${proxy.server}, ${ - proxy.port - }${proxy.username ? ',username=' + proxy.username : ''}${ + result = `${proxy.name}=${proxy.tls ? 'https' : 'http'},${ + proxy.server + },${proxy.port}${ + proxy.username ? ',username=' + proxy.username : '' + }${ proxy.password ? ',password=' + proxy.password : '' }${tls_opts},tfo=${proxy.tfo || 'false'}`; break; diff --git a/backend/sub-store.min.js b/backend/sub-store.min.js index 79c3c6d..87bdb8f 100644 --- a/backend/sub-store.min.js +++ b/backend/sub-store.min.js @@ -6,11 +6,11 @@ * ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗ * ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ * Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket! - * @updated: 2022/5/25 下午10:33:28 + * @updated: 2022/5/25 下午10:59:51 * @version: 1.6 * @author: Peng-YM * @github: https://github.com/Peng-YM/Sub-Store * @documentation: https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46 */ -!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|c(e,n),i=t(o),a=i.write(e,n);return a!==o&&(i=i.slice(0,a)),i}(e,n);if(ArrayBuffer.isView(e))return a(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function c(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return P(t).length;default:if(i)return o?-1:k(t).length;e=(""+e).toLowerCase(),i=!0}}function u(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),j(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:f(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):f(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function f(t,e,r,n,o){var i,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;is&&(r=s-c),i=r;i>=0;i--){for(var f=!0,p=0;po&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function v(t,e,r){return 0===e&&r===t.length?_$base64Js_1.fromByteArray(t):_$base64Js_1.fromByteArray(t.slice(e,r))}function g(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:u>223?3:u>191?2:1;if(o+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return g(this,e,r);case"ascii":return b(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return v(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===r.compare(this,t)},r.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),""},r.prototype.compare=function(t,e,n,o,i){if(N(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),c=Math.min(a,s),u=this.slice(o,i),l=t.slice(e,n),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return p(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return h(this,t,e,r);case"latin1":case"binary":return d(this,t,e,r);case"base64":return y(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function b(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,n,o,i,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),_$ieee754_3.write(t,e,r,n,52,8),r+8}r.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},r.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},r.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),_$ieee754_3.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},r.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},r.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},r.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},r.prototype.copy=function(t,e,n,o){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e=0;--a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return i},r.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!r.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){var i=t.charCodeAt(0);("utf8"===o&&i<128||"latin1"===o)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function P(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$constants_43={};Object.defineProperty(_$constants_43,"__esModule",{value:!0}),_$constants_43.SUBS_KEY=_$constants_43.SETTINGS_KEY=_$constants_43.GIST_BACKUP_KEY=_$constants_43.GIST_BACKUP_FILE_NAME=_$constants_43.COLLECTIONS_KEY=_$constants_43.ARTIFACT_REPOSITORY_KEY=_$constants_43.ARTIFACTS_KEY=void 0,_$constants_43.SETTINGS_KEY="settings",_$constants_43.SUBS_KEY="subs",_$constants_43.COLLECTIONS_KEY="collections",_$constants_43.ARTIFACTS_KEY="artifacts",_$constants_43.GIST_BACKUP_KEY="Auto Generated Sub-Store Backup",_$constants_43.GIST_BACKUP_FILE_NAME="Sub-Store",_$constants_43.ARTIFACT_REPOSITORY_KEY="Sub-Store Artifacts Repository";var _$openApi_53={};function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,s,"next",t)}function s(t){asyncGeneratorStep(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"untitled",debug=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_classCallCheck(this,OpenAPI),this.name=name,this.debug=debug,this.http=HTTP(),this.env=ENV(),this.node=function(){if(isNode){var fs=eval("require('fs')");return{fs:fs}}return null}(),this.initCache();var delay=function(t,e){return new Promise((function(r){setTimeout(r.bind(null,e),t)}))},_ref;Promise.prototype.delay=(_ref=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this;case 2:return r=t.sent,t.next=5,delay(e,r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return _ref.apply(this,arguments)})}return _createClass(OpenAPI,[{key:"initCache",value:function(){if(isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(isLoon||isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),isNode){var t="root.json";this.node.fs.existsSync(t)||this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.root={},t="".concat(this.name,".json"),this.node.fs.existsSync(t)?this.cache=JSON.parse(this.node.fs.readFileSync("".concat(this.name,".json"))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.cache={})}}},{key:"persistCache",value:function(){var t=JSON.stringify(this.cache,null,2);isQX&&$prefs.setValueForKey(t,this.name),(isLoon||isSurge)&&$persistentStore.write(t,this.name),isNode&&(this.node.fs.writeFileSync("".concat(this.name,".json"),t,{flag:"w"},(function(t){return console.log(t)})),this.node.fs.writeFileSync("root.json",JSON.stringify(this.root,null,2),{flag:"w"},(function(t){return console.log(t)})))}},{key:"write",value:function(t,e){if(this.log("SET ".concat(e)),-1!==e.indexOf("#")){if(e=e.substr(1),isSurge||isLoon)return $persistentStore.write(t,e);if(isQX)return $prefs.setValueForKey(t,e);isNode&&(this.root[e]=t)}else this.cache[e]=t;this.persistCache()}},{key:"read",value:function(t){return this.log("READ ".concat(t)),-1===t.indexOf("#")?this.cache[t]:(t=t.substr(1),isSurge||isLoon?$persistentStore.read(t):isQX?$prefs.valueForKey(t):isNode?this.root[t]:void 0)}},{key:"delete",value:function(t){if(this.log("DELETE ".concat(t)),-1!==t.indexOf("#")){if(t=t.substr(1),isSurge||isLoon)return $persistentStore.write(null,t);if(isQX)return $prefs.removeValueForKey(t);isNode&&delete this.root[t]}else delete this.cache[t];this.persistCache()}},{key:"notify",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n["open-url"],i=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(i?"\n\u591a\u5a92\u4f53:"+i:""),{url:o}),isLoon){var a={};o&&(a.openUrl=o),i&&(a.mediaUrl=i),"{}"===JSON.stringify(a)?$notification.post(t,e,r):$notification.post(t,e,r,a)}if(isNode){var s=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(i?"\n\u591a\u5a92\u4f53: ".concat(i):"");console.log("".concat(t,"\n").concat(e,"\n").concat(s,"\n\n"))}}},{key:"log",value:function(t){this.debug&&console.log("[".concat(this.name,"] LOG: ").concat(t))}},{key:"info",value:function(t){console.log("[".concat(this.name,"] INFO: ").concat(t))}},{key:"error",value:function(t){console.log("[".concat(this.name,"] ERROR: ").concat(t))}},{key:"wait",value:function(t){return new Promise((function(e){return setTimeout(e,t)}))}},{key:"done",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};isQX||isLoon||isSurge?$done(t):isNode&&"undefined"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}]),OpenAPI}();function ENV(){return{isQX:isQX,isLoon:isLoon,isSurge:isSurge,isNode:isNode}}function HTTP(){var defaultOptions=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{baseURL:""},_ENV=ENV(),isQX=_ENV.isQX,isLoon=_ENV.isLoon,isSurge=_ENV.isSurge,isNode=_ENV.isNode,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="string"==typeof options?{url:options}:options;var baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options=_objectSpread(_objectSpread({},defaultOptions),options);var timeout=options.timeout,events=_objectSpread(_objectSpread({},{onRequest:function(){},onResponse:function(t){return t},onTimeout:function(){}}),options.events),worker,timeoutid;events.onRequest(method,options),isQX?worker=$task.fetch({method:method,url:options.url,headers:options.headers,body:options.body}):(isLoon||isSurge||isNode)&&(worker=new Promise((function(resolve,reject){var request=isNode?eval("require('request')"):$httpClient;request[method.toLowerCase()](options,(function(t,e,r){t?reject(t):resolve({statusCode:e.status||e.statusCode,headers:e.headers,body:r})}))})));var timer=timeout?new Promise((function(t,e){timeoutid=setTimeout((function(){return events.onTimeout(),e("".concat(method," URL: ").concat(options.url," exceeds the timeout ").concat(timeout," ms"))}),timeout)})):null;return(timer?Promise.race([timer,worker]).then((function(t){return clearTimeout(timeoutid),t})):worker).then((function(t){return events.onResponse(t)}))}var http={};return methods.forEach((function(t){return http[t.toLowerCase()]=function(e){return send(t,e)}})),http}_$openApi_53.OpenAPI=OpenAPI;var _$browser_35={},cachedSetTimeout,cachedClearTimeout,process=_$browser_35={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch(e){try{return cachedSetTimeout.call(null,t,0)}catch(e){return cachedSetTimeout.call(this,t,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(t){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(t){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var e=queue.length;e;){for(currentQueue=queue,queue=[];++queueIndex1)for(var r=1;r1&&void 0!==arguments[1]?arguments[1]:0,n=e.method,o=e.url,i=e.headers,a=e.body;/json/i.test(i["Content-Type"])&&(a=JSON.parse(a)),n=n.toUpperCase();var s,c=extractURL(o),u=c.path,l=c.query,f=null,p=0;for(s=r;sp&&(f=handlers[s],p=_.split("/").length)}if(f){var h=function(){t(n,o,s)},d={method:n,url:o,path:u,query:l,params:extractPathParams(f.pattern,u),headers:i,body:a},y=Response(),m=f.callback,v=function(t){y.status(500).json({status:"failed",message:"Internal Server Error: ".concat(t)})};if("AsyncFunction"===m.constructor.name)m(d,y,h).catch(v);else try{m(d,y,h)}catch(g){v(g)}}else Response().status(404).json({status:"failed",message:"ERROR: 404 not found"})},app={};return METHODS_NAMES.forEach((function(t){app[t.toLowerCase()]=function(e,r){handlers.push({method:t,pattern:e,callback:r})}})),app.route=function(t){var e={};return METHODS_NAMES.forEach((function(r){e[r.toLowerCase()]=function(n){return handlers.push({method:r,pattern:t,callback:n}),e}})),e},app.start=function(){dispatch($request)},app;function rawBodySaver(t,e,r,n){r&&r.length&&(t.rawBody=r.toString(n||"utf8"))}function Response(){var t=200,e=(0,_$openApi_53.ENV)(),r=e.isQX,n=e.isLoon,o=e.isSurge,i=DEFAULT_HEADERS,a={200:"HTTP/1.1 200 OK",201:"HTTP/1.1 201 Created",302:"HTTP/1.1 302 Found",307:"HTTP/1.1 307 Temporary Redirect",308:"HTTP/1.1 308 Permanent Redirect",404:"HTTP/1.1 404 Not Found",500:"HTTP/1.1 500 Internal Server Error"};return new(function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"status",value:function(e){return t=e,this}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s={status:r?a[t]:t,body:e,headers:i};r?$done(s):(n||o)&&$done({response:s})}},{key:"end",value:function(){this.send()}},{key:"html",value:function(t){this.set("Content-Type","text/html;charset=UTF-8"),this.send(t)}},{key:"json",value:function(t){this.set("Content-Type","application/json;charset=UTF-8"),this.send(JSON.stringify(t))}},{key:"set",value:function(t,e){return i[t]=e,this}}]),e}())}}function patternMatched(t,e){if(t instanceof RegExp&&t.test(e))return!0;if("/"===t)return!0;if(-1===t.indexOf(":")){for(var r=e.split("/"),n=t.split("/"),o=0;o=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_50(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function _IP_API(){var t;return t=___regeneratorRuntime_50().mark((function t(e,r){var n,o,i;return ___regeneratorRuntime_50().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=decodeURIComponent(e.params.server),o=(0,_$openApi_53.HTTP)(),t.next=4,o.get("http://ip-api.com/json/".concat(n,"?lang=zh-CN")).then((function(t){return JSON.parse(t.body)}));case 4:i=t.sent,r.json(i);case 6:case"end":return t.stop()}}),t)})),(_IP_API=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_50(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_50(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}Object.defineProperty(_$ipApi_50,"__esModule",{value:!0}),_$ipApi_50.default=function(t,e){return _IP_API.apply(this,arguments)};var _$gist_49={};function ___typeof_49(t){return(___typeof_49="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ___regeneratorRuntime_49(){___regeneratorRuntime_49=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=c;var l={};function f(){}function p(){}function _(){}var h={};s(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=f.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==___typeof_49(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function _createForOfIteratorHelper(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(n-1));)if(n-=1,this.position-n>e/2-1){r=" ... ",n+=5;break}for(o="",i=this.position;ie/2-1){o=" ... ",i-=5;break}return a=this.buffer.slice(n,i),_$common_7.repeat(" ",t)+r+a+o+"\n"+_$common_7.repeat(" ",t+this.position-n+r.length)+"^"},Mark.prototype.toString=function(t){var e,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(r+=":\n"+e),r},_$mark_11=Mark;var TYPE_CONSTRUCTOR_OPTIONS=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"],_$type_18=function(t,e){var r,n;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(e))throw new _$exception_9('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(r=e.styleAliases||null,n={},null!==r&&Object.keys(r).forEach((function(t){r[t].forEach((function(e){n[String(e)]=t}))})),n),-1===YAML_NODE_KINDS.indexOf(this.kind))throw new _$exception_9('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')},_$schema_12={};function compileList(t,e,r){var n=[];return t.include.forEach((function(t){r=compileList(t,e,r)})),t[e].forEach((function(t){r.forEach((function(e,r){e.tag===t.tag&&e.kind===t.kind&&n.push(r)})),r.push(t)})),r.filter((function(t,e){return-1===n.indexOf(e)}))}function Schema(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach((function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new _$exception_9("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=compileList(this,"implicit",[]),this.compiledExplicit=compileList(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{}};function n(t){r[t.kind][t.tag]=r.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/,_$float_21=new _$type_18("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!YAML_FLOAT_PATTERN.test(t)||"_"===t[t.length-1])},construct:function(t){var e,r,n,o;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach((function(t){o.unshift(parseFloat(t,10))})),e=0,n=1,o.forEach((function(t){e+=t*n,n*=60})),r*e):r*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||_$common_7.isNegativeZero(t))},represent:function(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_$common_7.isNegativeZero(t))return"-0.0";return r=t.toString(10),SCIENTIFIC_WITHOUT_DOT.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),_$json_17=new _$schema_12({include:[_$failsafe_16],implicit:[_$null_28,_$bool_20,_$int_22,_$float_21]}),_$core_13=new _$schema_12({include:[_$json_17]}),YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),_$timestamp_34=new _$type_18("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==YAML_DATE_REGEXP.exec(t)||null!==YAML_TIMESTAMP_REGEXP.exec(t))},construct:function(t){var e,r,n,o,i,a,s,c,u=0,l=null;if(null===(e=YAML_DATE_REGEXP.exec(t))&&(e=YAML_TIMESTAMP_REGEXP.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,o=+e[3],!e[4])return new Date(Date.UTC(r,n,o));if(i=+e[4],a=+e[5],s=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),c=new Date(Date.UTC(r,n,o,i,a,s,u)),l&&c.setTime(c.getTime()-l),c},instanceOf:Date,represent:function(t){return t.toISOString()}}),_$merge_27=new _$type_18("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),NodeBuffer;try{var _require=require;NodeBuffer=_require("buffer").Buffer}catch(__){}var BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",_$binary_19=new _$type_18("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,r,n=0,o=t.length,i=BASE64_MAP;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8==0},construct:function(t){var e,r,n=t.replace(/[\r\n=]/g,""),o=n.length,i=BASE64_MAP,a=0,s=[];for(e=0;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|i.indexOf(n.charAt(e));return 0==(r=o%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===r?(s.push(a>>10&255),s.push(a>>2&255)):12===r&&s.push(a>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(s):new NodeBuffer(s):s},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,i=t.length,a=BASE64_MAP;for(e=0;e>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]),o=(o<<8)+t[e];return 0==(r=i%3)?(n+=a[o>>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]):2===r?(n+=a[o>>10&63],n+=a[o>>4&63],n+=a[o<<2&63],n+=a[64]):1===r&&(n+=a[o>>2&63],n+=a[o<<4&63],n+=a[64],n+=a[64]),n}}),_hasOwnProperty=Object.prototype.hasOwnProperty,_toString=Object.prototype.toString,_$omap_29=new _$type_18("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,r,n,o,i,a=[],s=t;for(e=0,r=s.length;e3)return!1;if("/"!==e[e.length-n.length-1])return!1}return!0},construct:function(t){var e=t,r=/\/([gim]*)$/.exec(t),n="";return"/"===e[0]&&(r&&(n=r[1]),e=e.slice(1,e.length-n.length-1)),new RegExp(e,n)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}}),esprima;try{var ___require_23=require;esprima=___require_23("esprima")}catch(_){"undefined"!=typeof window&&(esprima=window.esprima)}var _$function_23=new _$type_18("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",r=esprima.parse(e,{range:!0});return"Program"===r.type&&1===r.body.length&&"ExpressionStatement"===r.body[0].type&&("ArrowFunctionExpression"===r.body[0].expression.type||"FunctionExpression"===r.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,r="("+t+")",n=esprima.parse(r,{range:!0}),o=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"ArrowFunctionExpression"!==n.body[0].expression.type&&"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach((function(t){o.push(t.name)})),e=n.body[0].expression.body.range,"BlockStatement"===n.body[0].expression.body.type?new Function(o,r.slice(e[0]+1,e[1]-1)):new Function(o,"return "+r.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}}),_$default_full_14=_$schema_12.DEFAULT=new _$schema_12({include:[_$default_safe_15],explicit:[_$undefined_25,_$regexp_24,_$function_23]}),_$loader_10={},___hasOwnProperty_10=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(t){return Object.prototype.toString.call(t)}function is_EOL(t){return 10===t||13===t}function is_WHITE_SPACE(t){return 9===t||32===t}function is_WS_OR_EOL(t){return 9===t||32===t||10===t||13===t}function is_FLOW_INDICATOR(t){return 44===t||91===t||93===t||123===t||125===t}function fromHexCode(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function simpleEscapeSequence(t){return 48===t?"\0":97===t?"\x07":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"\x1b":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"\x85":95===t?"\xa0":76===t?"\u2028":80===t?"\u2029":""}function charFromCodepoint(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256),i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||_$default_full_14,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function generateError(t,e){return new _$exception_9(e,new _$mark_11(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function throwError(t,e){throw generateError(t,e)}function throwWarning(t,e){t.onWarning&&t.onWarning.call(null,generateError(t,e))}var directiveHandlers={YAML:function(t,e,r){var n,o,i;null!==t.version&&throwError(t,"duplication of %YAML directive"),1!==r.length&&throwError(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&throwError(t,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),i=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,1!==i&&2!==i&&throwWarning(t,"unsupported YAML version of the document")},TAG:function(t,e,r){var n,o;2!==r.length&&throwError(t,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],PATTERN_TAG_HANDLE.test(n)||throwError(t,"ill-formed tag handle (first argument) of the TAG directive"),___hasOwnProperty_10.call(t.tagMap,n)&&throwError(t,'there is a previously declared suffix for "'+n+'" tag handle'),PATTERN_TAG_URI.test(o)||throwError(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[n]=o}};function captureSegment(t,e,r,n){var o,i,a,s;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,i=t.anchor,a=[],s=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)a.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),a.push(t.result),skipSeparationSpace(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)throwError(t,"bad indentation of a sequence entry");else if(t.lineIndente?_=1:t.lineIndent===e?_=0:t.lineIndente?_=1:t.lineIndent===e?_=0:t.lineIndente)&&(composeNode(t,e,CONTEXT_BLOCK_OUT,!0,o)&&(d?_=t.result:h=t.result),d||(storeMappingPair(t,l,f,p,_,h,i,a),p=_=h=null),skipSeparationSpace(t,!0,-1),s=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==s)throwError(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===o?throwError(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,u=!0)}if(is_WHITE_SPACE(i)){do{i=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(i));if(35===i)do{i=t.input.charCodeAt(++t.position)}while(!is_EOL(i)&&0!==i)}for(;0!==i;){for(readLineBreak(t),t.lineIndent=0,i=t.input.charCodeAt(t.position);(!u||t.lineIndentl&&(l=t.lineIndent),is_EOL(i))f++;else{if(t.lineIndent0){for(o=a,i=0;o>0;o--)(a=fromHexCode(s=t.input.charCodeAt(++t.position)))>=0?i=(i<<4)+a:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(i),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(s)?(captureSegment(t,r,n,!0),writeFoldedLines(t,skipSeparationSpace(t,!1,e)),r=n=t.position):t.position===t.lineStart&&testDocumentSeparator(t)?throwError(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}throwError(t,"unexpected end of the stream within a double quoted scalar")}(t,f)?d=!0:function(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&throwError(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),___hasOwnProperty_10.call(t.anchorMap,r)||throwError(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],skipSeparationSpace(t,!0,-1),!0}(t)?(d=!0,null===t.tag&&null===t.anchor||throwError(t,"alias node should not have any properties")):function(t,e,r){var n,o,i,a,s,c,u,l,f=t.kind,p=t.result;if(is_WS_OR_EOL(l=t.input.charCodeAt(t.position))||is_FLOW_INDICATOR(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n)))return!1;for(t.kind="scalar",t.result="",o=i=t.position,a=!1;0!==l;){if(58===l){if(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n))break}else if(35===l){if(is_WS_OR_EOL(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&testDocumentSeparator(t)||r&&is_FLOW_INDICATOR(l))break;if(is_EOL(l)){if(s=t.line,c=t.lineStart,u=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){a=!0,l=t.input.charCodeAt(t.position);continue}t.position=i,t.line=s,t.lineStart=c,t.lineIndent=u;break}}a&&(captureSegment(t,o,i,!1),writeFoldedLines(t,t.line-s),o=i=t.position,a=!1),is_WHITE_SPACE(l)||(i=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,i,!1),!!t.result||(t.kind=f,t.result=p,!1)}(t,f,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=s&&readBlockSequence(t,p))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&throwError(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),c=0,u=t.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+t.kind+'"'),l.resolve(t.result)?(t.result=l.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):throwError(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):throwError(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||d}function readDocument(t){var e,r,n,o,i=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(o=t.input.charCodeAt(t.position))&&(skipSeparationSpace(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==o));){for(a=!0,o=t.input.charCodeAt(++t.position),e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&throwError(t,"directive name must not be less than one character in length");0!==o;){for(;is_WHITE_SPACE(o);)o=t.input.charCodeAt(++t.position);if(35===o){do{o=t.input.charCodeAt(++t.position)}while(0!==o&&!is_EOL(o));break}if(is_EOL(o))break;for(e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==o&&readLineBreak(t),___hasOwnProperty_10.call(directiveHandlers,r)?directiveHandlers[r](t,r,n):throwWarning(t,'unknown document directive "'+r+'"')}skipSeparationSpace(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,skipSeparationSpace(t,!0,-1)):a&&throwError(t,"directives end mark is expected"),composeNode(t,t.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(t,!0,-1),t.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(t.input.slice(i,t.position))&&throwWarning(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&testDocumentSeparator(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,skipSeparationSpace(t,!0,-1)):t.position0?t.charCodeAt(i-1):null,_=_&&isPlainSafe(a,s)}else{for(i=0;in&&" "!==t[p+1],p=i);else if(!isPrintable(a))return STYLE_DOUBLE;s=i>0?t.charCodeAt(i-1):null,_=_&&isPlainSafe(a,s)}l=l||f&&i-p-1>n&&" "!==t[p+1]}return u||l?r>9&&needIndentIndicator(t)?STYLE_DOUBLE:l?STYLE_FOLDED:STYLE_LITERAL:_&&!o(t)?STYLE_PLAIN:STYLE_SINGLE}function writeScalar(t,e,r,n){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,r),i=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,a,t.indent,i,(function(e){return function(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r"+blockHeader(e,t.indent)+dropEndingNewline(indentString(function(t,e){for(var r,n,o,i=/(\n+)([^\n]*)/g,a=(o=-1!==(o=t.indexOf("\n"))?o:t.length,i.lastIndex=o,foldLine(t.slice(0,o),e)),s="\n"===t[0]||" "===t[0];n=i.exec(t);){var c=n[1],u=n[2];r=" "===u[0],a+=c+(s||r||""===u?"":"\n")+foldLine(u,e),s=r}return a}(e,i),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",i=0;i=55296&&e<=56319&&(r=t.charCodeAt(i+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),i++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[i]:n||encodeHex(e);return o}(e)+'"';default:throw new _$exception_9("impossible error: invalid scalar style")}}()}function blockHeader(t,e){var r=needIndentIndicator(t)?String(e):"",n="\n"===t[t.length-1];return r+(!n||"\n"!==t[t.length-2]&&"\n"!==t?n?"":"-":"+")+"\n"}function dropEndingNewline(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function foldLine(t,e){if(""===t||" "===t[0])return t;for(var r,n,o=/ [^ ]/g,i=0,a=0,s=0,c="";r=o.exec(t);)(s=r.index)-i>e&&(n=a>i?a:s,c+="\n"+t.slice(i,n),i=n+1),a=s;return c+="\n",t.length-i>e&&a>i?c+=t.slice(i,a)+"\n"+t.slice(a+1):c+=t.slice(i),c.slice(1)}function detectType(t,e,r){var n,o,i,a,s,c;for(i=0,a=(o=r?t.explicitTypes:t.implicitTypes).length;i tag resolver accepts not "'+c+'" style');n=s.represent[c](e,c)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,i){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var a=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(o=!1),c&&t.usedDuplicates[s])t.dump="*ref_"+s;else{if(u&&c&&!t.usedDuplicates[s]&&(t.usedDuplicates[s]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,i,a,s,c,u,l="",f=t.tag,p=Object.keys(r);if(!0===t.sortKeys)p.sort();else if("function"==typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new _$exception_9("sortKeys must be a boolean or a function");for(o=0,i=p.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+="?":u+="? "),u+=t.dump,c&&(u+=generateNextLine(t,e)),writeNode(t,e+1,s,!0,c)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+=":":u+=": ",l+=u+=t.dump));t.tag=f,t.dump=l||"{}"}(t,e,t.dump,o),c&&(t.dump="&ref_"+s+t.dump)):(function(t,e,r){var n,o,i,a,s,c="",u=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,a,!1,!1)&&(c+=s+=t.dump));t.tag=u,t.dump="{"+c+"}"}(t,e,t.dump),c&&(t.dump="&ref_"+s+" "+t.dump));else if("[object Array]"===a){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,i,a="",s=t.tag;for(o=0,i=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],i=[];for(function t(e,r,n){var o,i,a;if(null!==e&&"object"==typeof e)if(-1!==(i=r.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,a=e.length;i0?o-4:o;for(r=0;r>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===i&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,a[s++]=255&e),1===i&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,a=r-n;ia?a:i+16383));return 1===n?(e=t[r-1],o.push(lookup[e>>2]+lookup[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),o.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",__i_1=0,len=code.length;__i_10)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function encodeChunk(t,e,r){for(var n,o,i=[],a=e;a>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return i.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,l=-7,f=r?o-1:0,p=r?-1:1,_=t[e+f];for(f+=p,i=_&(1<<-l)-1,_>>=-l,l+=s;l>0;i=256*i+t[e+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(_?-1:1);a+=Math.pow(2,n),i-=u}return(_?-1:1)*a*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var a,s,c,u=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:i-1,h=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*c-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+_]=255&s,_+=h,s/=256,o-=8);for(a=a<0;t[r+_]=255&a,_+=h,a/=256,u-=8);t[r+_-h]|=128*d}},_$base64_4={exports:{}};(function(t,e){(function(){!function(t,e){var r,n;"object"==typeof _$base64_4.exports?_$base64_4.exports=e():"function"==typeof define&&define.amd?define(e):(r=t.Base64,(n=e()).noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:this,(function(){"use strict";var t,r="function"==typeof atob,n="function"==typeof btoa,o="function"==typeof e,i="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),c=(t={},s.forEach((function(e,r){return t[e]=r})),t),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),f="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t,e){return void 0===e&&(e=function(t){return t}),new Uint8Array(Array.prototype.slice.call(t,0).map(e))},p=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,i="",a=t.length%3,c=0;c255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");i+=s[(e=r<<16|n<<8|o)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return a?i.slice(0,a-3)+"===".substring(a):i},d=n?function(t){return btoa(t)}:o?function(t){return e.from(t,"binary").toString("base64")}:h,y=o?function(t){return e.from(t).toString("base64")}:function(t){for(var e=[],r=0,n=t.length;r>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,w=function(t){return t.replace(g,v)},b=o?function(t){return e.from(t,"utf8").toString("base64")}:a?function(t){return y(a.encode(t))}:function(t){return d(w(t))},E=function(t,e){return void 0===e&&(e=!1),e?p(b(t)):b(t)},S=function(t){return E(t,!0)},O=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,A=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return l(55296+(e>>>10))+l(56320+(1023&e));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},x=function(t){return t.replace(O,A)},L=function(t){if(t=t.replace(/\s+/g,""),!u.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",i=0;i>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},T=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:L,R=o?function(t){return f(e.from(t,"base64"))}:function(t){return f(T(t),(function(t){return t.charCodeAt(0)}))},C=function(t){return R(P(t))},k=o?function(t){return e.from(t,"base64").toString("utf8")}:i?function(t){return i.decode(R(t))}:function(t){return x(T(t))},P=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},I=function(t){return k(P(t))},N=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},j=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,N(e))};t("fromBase64",(function(){return I(this)})),t("toBase64",(function(t){return E(this,t)})),t("toBase64URI",(function(){return E(this,!0)})),t("toBase64URL",(function(){return E(this,!0)})),t("toUint8Array",(function(){return C(this)}))},$=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,N(e))};t("toBase64",(function(t){return m(this,t)})),t("toBase64URI",(function(){return m(this,!0)})),t("toBase64URL",(function(){return m(this,!0)}))},F={version:"3.7.2",VERSION:"3.7.2",atob:T,atobPolyfill:L,btoa:d,btoaPolyfill:h,fromBase64:I,toBase64:E,encode:E,encodeURI:S,encodeURL:S,utob:w,btou:x,decode:I,isValid:function(t){if("string"!=typeof t)return!1;var e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:m,toUint8Array:C,extendString:j,extendUint8Array:$,extendBuiltins:function(){j(),$()},Base64:{}};return Object.keys(F).forEach((function(t){return F.Base64[t]=F[t]})),F}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_$buffer_2({}).Buffer),_$base64_4=_$base64_4.exports;var _$logical_51={};function ___arrayLikeToArray_51(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_47(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}Object.defineProperty(_$download_47,"__esModule",{value:!0}),_$download_47.default=function(t,e){return _download.apply(this,arguments)};var cache=new Map;function _download(){var t;return t=___regeneratorRuntime_47().mark((function t(e,r){var n,o,i;return ___regeneratorRuntime_47().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)")+e,!cache.has(n)){t.next=4;break}return t.abrupt("return",cache.get(n));case 4:return o=(0,_$openApi_53.HTTP)({headers:{"User-Agent":r}}),i=new Promise((function(t,r){o.get(e).then((function(e){var n=e.body;0===n.replace(/\s/g,"").length?r(new Error("\u8ba2\u9605\u5185\u5bb9\u4e3a\u7a7a\uff01")):t(n)}))})),cache.set(n,i),t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_47(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_47(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}var _$geo_48={};Object.defineProperty(_$geo_48,"__esModule",{value:!0}),_$geo_48.getFlag=function(t){for(var e={"\ud83c\udde6\ud83c\uddff":["\u963f\u585e\u62dc\u7586"],"\ud83c\udde6\ud83c\uddf9":["\u5965\u5730\u5229","\u5967\u5730\u5229","Austria","\u7ef4\u4e5f\u7eb3"],"\ud83c\udde6\ud83c\uddfa":["AU","Australia","Sydney","\u6fb3\u5927\u5229\u4e9a","\u6fb3\u6d32","\u58a8\u5c14\u672c","\u6089\u5c3c","\u571f\u6fb3","\u4eac\u6fb3","\u5ee3\u6fb3","\u6eec\u6fb3","\u6caa\u6fb3","\u5e7f\u6fb3"],"\ud83c\udde7\ud83c\uddea":["BE","\u6bd4\u5229\u6642","\u6bd4\u5229\u65f6"],"\ud83c\udde7\ud83c\uddec":["\u4fdd\u52a0\u5229\u4e9a","\u4fdd\u52a0\u5229\u4e9e","Bulgaria"],"\ud83c\udde7\ud83c\udded":["BH","\u5df4\u6797"],"\ud83c\udde7\ud83c\udde9":["BD","\u5b5f\u52a0\u62c9"],"\ud83c\uddf5\ud83c\uddf0":["\u5df4\u57fa\u65af\u5766"],"\ud83c\uddf0\ud83c\udded":["\u67ec\u57d4\u5be8"],"\ud83c\uddfa\ud83c\udde6":["\u70cf\u514b\u862d","\u4e4c\u514b\u5170"],"\ud83c\udded\ud83c\uddf7":["\u514b\u7f57\u5730\u4e9a","HR","\u514b\u7f85\u5730\u4e9e"],"\ud83c\udde8\ud83c\udde6":["Canada","CANADA","CAN","Waterloo","\u52a0\u62ff\u5927","\u8499\u7279\u5229\u5c14","\u6e29\u54e5\u534e","\u6953\u8449","\u67ab\u53f6","\u6ed1\u94c1\u5362","\u591a\u4f26\u591a","CA"],"\ud83c\udde8\ud83c\udded":["\u745e\u58eb","\u82cf\u9ece\u4e16","Switzerland","Zurich"],"\ud83c\uddf3\ud83c\uddec":["\u5c3c\u65e5\u5229\u4e9a","NG","\u5c3c\u65e5\u5229\u4e9e"],"\ud83c\udde8\ud83c\uddff":["Czechia","\u6377\u514b"],"\ud83c\uddf8\ud83c\uddf0":["\u65af\u6d1b\u4f10\u514b","SK"],"\ud83c\uddf7\ud83c\uddf8":["RS","\u585e\u5c14\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\udde9":["\u6469\u723e\u591a\u74e6","MD","\u6469\u5c14\u591a\u74e6"],"\ud83c\udde9\ud83c\uddea":["DE","German","GERMAN","\u5fb7\u56fd","\u5fb7\u570b","\u6cd5\u5170\u514b\u798f","\u4eac\u5fb7","\u6eec\u5fb7","\u5ee3\u5fb7","\u6caa\u5fb7","\u5e7f\u5fb7","Frankfurt"],"\ud83c\udde9\ud83c\uddf0":["DK","DNK","\u4e39\u9ea6","\u4e39\u9ea5"],"\ud83c\uddea\ud83c\uddf8":["ES","\u897f\u73ed\u7259","Spain"],"\ud83c\uddea\ud83c\uddfa":["EU","\u6b27\u76df","\u6b27\u7f57\u5df4"],"\ud83c\uddeb\ud83c\uddee":["Finland","\u82ac\u5170","\u82ac\u862d","\u8d6b\u5c14\u8f9b\u57fa"],"\ud83c\uddeb\ud83c\uddf7":["FR","France","\u6cd5\u56fd","\u6cd5\u570b","\u5df4\u9ece"],"\ud83c\uddec\ud83c\udde7":["UK","GB","England","United Kingdom","\u82f1\u56fd","\u4f26\u6566","\u82f1","London"],"\ud83c\uddf2\ud83c\uddf4":["MO","Macao","\u6fb3\u95e8","\u6fb3\u9580","CTM"],"\ud83c\uddf0\ud83c\uddff":["\u54c8\u8428\u514b\u65af\u5766","\u54c8\u8428\u514b"],"\ud83c\udded\ud83c\uddfa":["\u5308\u7259\u5229","Hungary"],"\ud83c\udded\ud83c\uddf0":["HK","Hongkong","Hong Kong","HongKong","HONG KONG","\u9999\u6e2f","\u6df1\u6e2f","\u6caa\u6e2f","\u547c\u6e2f","HKT","HKBN","HGC","WTT","CMI","\u7a57\u6e2f","\u4eac\u6e2f","\u6e2f"],"\ud83c\uddee\ud83c\udde9":["Indonesia","\u5370\u5c3c","\u5370\u5ea6\u5c3c\u897f\u4e9a","\u96c5\u52a0\u8fbe"],"\ud83c\uddee\ud83c\uddea":["Ireland","IRELAND","\u7231\u5c14\u5170","\u611b\u723e\u862d","\u90fd\u67cf\u6797"],"\ud83c\uddee\ud83c\uddf1":["Israel","\u4ee5\u8272\u5217"],"\ud83c\uddee\ud83c\uddf3":["India","IND","INDIA","\u5370\u5ea6","\u5b5f\u4e70","MFumbai"],"\ud83c\uddee\ud83c\uddf8":["IS","ISL","\u51b0\u5c9b","\u51b0\u5cf6"],"\ud83c\uddf0\ud83c\uddf5":["KP","\u671d\u9c9c"],"\ud83c\uddf0\ud83c\uddf7":["KR","Korea","KOR","\u97e9\u56fd","\u9996\u5c14","\u97e9","\u97d3","\u6625\u5ddd","Chuncheon","Seoul"],"\ud83c\uddf1\ud83c\uddfa":["\u5362\u68ee\u5821"],"\ud83c\uddf1\ud83c\uddfb":["Latvia","Latvija","\u62c9\u8131\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\uddfd":["MEX","MX","\u58a8\u897f\u54e5"],"\ud83c\uddf2\ud83c\uddfe":["MY","Malaysia","MALAYSIA","\u9a6c\u6765\u897f\u4e9a","\u5927\u99ac","\u99ac\u4f86\u897f\u4e9e","\u5409\u9686\u5761"],"\ud83c\uddf3\ud83c\uddf1":["NL","Netherlands","\u8377\u5170","\u8377\u862d","\u5c3c\u5fb7\u862d","\u963f\u59c6\u65af\u7279\u4e39"],"\ud83c\uddf3\ud83c\uddf5":["\u5c3c\u6cca\u5c14"],"\ud83c\uddf5\ud83c\udded":["PH","Philippines","\u83f2\u5f8b\u5bbe","\u83f2\u5f8b\u8cd3"],"\ud83c\uddf5\ud83c\uddf7":["PR","\u6ce2\u591a\u9ece\u5404"],"\ud83c\uddf7\ud83c\uddf4":["RO","\u7f57\u9a6c\u5c3c\u4e9a"],"\ud83c\uddf7\ud83c\uddfa":["RU","Russia","\u4fc4\u7f57\u65af","\u4fc4\u56fd","\u4fc4\u7f85\u65af","\u4f2f\u529b","\u83ab\u65af\u79d1","\u5723\u5f7c\u5f97\u5821","\u897f\u4f2f\u5229\u4e9a","\u65b0\u897f\u4f2f\u5229\u4e9a","\u4eac\u4fc4","\u676d\u4fc4","\u5ee3\u4fc4","\u6eec\u4fc4","\u5e7f\u4fc4","\u6caa\u4fc4","Moscow"],"\ud83c\uddf8\ud83c\udde6":["\u6c99\u7279"],"\ud83c\uddf8\ud83c\uddea":["SE","Sweden","\u745e\u5178"],"\ud83c\uddf2\ud83c\uddf9":["\u9a6c\u8033\u4ed6"],"\ud83c\uddf2\ud83c\udde6":["MA","\u6469\u6d1b\u54e5"],"\ud83c\uddf8\ud83c\uddec":["SG","Singapore","SINGAPORE","\u65b0\u52a0\u5761","\u72ee\u57ce","\u6caa\u65b0","\u4eac\u65b0","\u6cc9\u65b0","\u7a57\u65b0","\u6df1\u65b0","\u676d\u65b0","\u5e7f\u65b0","\u5ee3\u65b0","\u6eec\u65b0"],"\ud83c\uddf9\ud83c\udded":["TH","Thailand","\u6cf0\u56fd","\u6cf0\u570b","\u66fc\u8c37"],"\ud83c\uddf9\ud83c\uddf7":["TR","Turkey","\u571f\u8033\u5176","\u4f0a\u65af\u5766\u5e03\u5c14"],"\ud83c\uddf9\ud83c\uddfc":["TW","Taiwan","TAIWAN","\u53f0\u6e7e","\u53f0\u5317","\u53f0\u4e2d","\u65b0\u5317","\u5f70\u5316","CHT","\u53f0","HINET","Taipei"],"\ud83c\uddfa\ud83c\uddf8":["US","USA","America","United States","\u7f8e\u56fd","\u7f8e","\u4eac\u7f8e","\u6ce2\u7279\u5170","\u8fbe\u62c9\u65af","\u4fc4\u52d2\u5188","\u51e4\u51f0\u57ce","\u8d39\u5229\u8499","\u7845\u8c37","\u77fd\u8c37","\u62c9\u65af\u7ef4\u52a0\u65af","\u6d1b\u6749\u77f6","\u5723\u4f55\u585e","\u5723\u514b\u62c9\u62c9","\u897f\u96c5\u56fe","\u829d\u52a0\u54e5","\u6caa\u7f8e","\u54e5\u4f26\u5e03","\u7ebd\u7ea6","Los Angeles","San Jose","Sillicon Valley","Michigan"],"\ud83c\uddfb\ud83c\uddf3":["VN","\u8d8a\u5357","\u80e1\u5fd7\u660e\u5e02"],"\ud83c\uddfb\ud83c\uddea":["VE","\u59d4\u5185\u745e\u62c9"],"\ud83c\uddee\ud83c\uddf9":["Italy","IT","Nachash","\u610f\u5927\u5229","\u7c73\u5170","\u7fa9\u5927\u5229"],"\ud83c\uddff\ud83c\udde6":["South Africa","\u5357\u975e"],"\ud83c\udde6\ud83c\uddea":["United Arab Emirates","\u963f\u8054\u914b","\u8fea\u62dc","AE"],"\ud83c\udde7\ud83c\uddf7":["BR","Brazil","\u5df4\u897f","\u5723\u4fdd\u7f57"],"\ud83c\uddef\ud83c\uddf5":["JP","Japan","JAPAN","\u65e5\u672c","\u4e1c\u4eac","\u5927\u962a","\u57fc\u7389","\u6caa\u65e5","\u7a57\u65e5","\u5ddd\u65e5","\u4e2d\u65e5","\u6cc9\u65e5","\u676d\u65e5","\u6df1\u65e5","\u8fbd\u65e5","\u5e7f\u65e5","\u5927\u5742","Osaka","Tokyo"],"\ud83c\udde6\ud83c\uddf7":["AR","\u963f\u6839\u5ef7"],"\ud83c\uddf3\ud83c\uddf4":["Norway","\u632a\u5a01","NO"],"\ud83c\udde8\ud83c\uddf3":["CN","China","\u56de\u56fd","\u4e2d\u56fd","\u4e2d\u570b","\u6c5f\u82cf","\u5317\u4eac","\u4e0a\u6d77","\u5e7f\u5dde","\u6df1\u5733","\u676d\u5dde","\u5f90\u5dde","\u9752\u5c9b","\u5b81\u6ce2","\u9547\u6c5f","back"],"\ud83c\uddf5\ud83c\uddf1":["PL","POL","\u6ce2\u5170","\u6ce2\u862d"],"\ud83c\udde8\ud83c\uddf1":["\u667a\u5229"],"\ud83c\uddf3\ud83c\uddff":["\u65b0\u897f\u862d","\u65b0\u897f\u5170"],"\ud83c\uddec\ud83c\uddf7":["\u5e0c\u814a","\u5e0c\u81d8"],"\ud83c\uddea\ud83c\uddec":["\u57c3\u53ca"],"\ud83c\udde8\ud83c\uddfe":["CY","\u585e\u6d66\u8def\u65af"],"\ud83c\udde8\ud83c\uddf7":["CR","\u54e5\u65af\u8fbe\u9ece\u52a0"],"\ud83c\uddf8\ud83c\uddee":["SI","\u65af\u6d1b\u6587\u5c3c\u4e9a"],"\ud83c\uddf1\ud83c\uddf9":["LT","\u7acb\u9676\u5b9b"],"\ud83c\uddf5\ud83c\udde6":["PA","\u5df4\u62ff\u9a6c"],"\ud83c\uddf9\ud83c\uddf3":["TN","\u7a81\u5c3c\u65af"],"\ud83c\uddee\ud83c\uddf2":["\u9a6c\u6069\u5c9b","\u99ac\u6069\u5cf6"],"\ud83c\udde7\ud83c\uddfe":["BY","\u767d\u4fc4","\u767d\u4fc4\u7f57\u65af"],"\ud83c\uddf5\ud83c\uddf9":["\u8461\u8404\u7259"],"\ud83c\uddf0\ud83c\uddea":["KE","\u80af\u5c3c\u4e9a"],"\ud83c\uddf0\ud83c\uddec":["KG","\u5409\u5c14\u5409\u65af\u5766"],"\ud83c\uddef\ud83c\uddf4":["JO","\u7ea6\u65e6"],"\ud83c\uddfa\ud83c\uddfe":["UY","\u4e4c\u62c9\u572d"],"\ud83c\uddf2\ud83c\uddf3":["\u8499\u53e4"],"\ud83c\uddee\ud83c\uddf7":["IR","\u4f0a\u6717"],"\ud83c\uddf5\ud83c\uddea":["\u79d8\u9c81","\u7955\u9b6f"],"\ud83c\udde8\ud83c\uddf4":["\u54e5\u4f26\u6bd4\u4e9a"],"\ud83c\uddea\ud83c\uddea":["\u7231\u6c99\u5c3c\u4e9a"],"\ud83c\uddea\ud83c\udde8":["EC","\u5384\u74dc\u591a\u5c14"],"\ud83c\uddf2\ud83c\uddf0":["\u9a6c\u5176\u987f","\u99ac\u5176\u9813"],"\ud83c\udde7\ud83c\udde6":["\u6ce2\u9ed1\u5171\u548c\u56fd","\u6ce2\u9ed1"],"\ud83c\uddec\ud83c\uddea":["\u683c\u9b6f\u5409\u4e9e","\u683c\u9c81\u5409\u4e9a"],"\ud83c\udde6\ud83c\uddf1":["\u963f\u723e\u5df4\u5c3c\u4e9e","\u963f\u5c14\u5df4\u5c3c\u4e9a"],"\ud83c\udff3\ufe0f\u200d\ud83c\udf08":["\u6d41\u91cf","\u65f6\u95f4","\u5e94\u6025","\u8fc7\u671f","Bandwidth","expire"]},r=0,n=Object.keys(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_38(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___asyncToGenerator_38(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_38(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_38(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(c){s=!0,o=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function __ownKeys_38(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_38(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_38(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_38(t,e):void 0}}function ___arrayLikeToArray_38(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},(keys=["dm1lc3M","c3NyOi8v","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c"],{name:"Base64 Pre-processor",test:function(t){return keys.some((function(e){return-1!==t.indexOf(e)}))},parse:function(t){return _$base64_4.Base64.decode(t)}}),{name:"Clash Pre-processor",test:function(t){return/proxies/.test(t)},parse:function(t){return(0,_$staticJsYaml_36.safeLoad)(t).proxies.map((function(t){return JSON.stringify(t)})).join("\n")}},{name:"SSD Pre-processor",test:function(t){return 0===t.indexOf("ssd://")},parse:function(t){for(var e=[],r=JSON.parse(_$base64_4.Base64.decode(t.split("ssd://")[1])),n=r.port,o=r.encryption,i=r.password,a=r.servers,s=0;s1){var u,l=___createForOfIteratorHelper_38(t);try{for(l.s();!(u=l.n()).done;){var f=_slicedToArray(u.value.split("="),2),p=f[0],_=f[1];c[p]=_.trim()}}catch(h){l.e(h)}finally{l.f()}}return ___objectSpread_38(___objectSpread_38({},s),{},{name:c.remarks?_$base64_4.Base64.decode(c.remarks):s.server,"protocol-param":_$base64_4.Base64.decode(c.protoparam||"").replace(/\s/g,""),"obfs-param":_$base64_4.Base64.decode(c.obfsparam||"").replace(/\s/g,"")})}}),{name:"URI VMess Parser",test:function(t){return/^vmess:\/\//.test(t)},parse:function(t){t=t.split("vmess://")[1];var e=_$base64_4.Base64.decode(t);if(/=\s*vmess/.test(e)){var r,n=e.split(",").map((function(t){return t.trim()})),o={},i=___createForOfIteratorHelper_38(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(-1!==a.indexOf("=")){var s=_slicedToArray(a.split("="),2),c=s[0],u=s[1];o[c.trim()]=u.trim()}}}catch(h){i.e(h)}finally{i.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:n[3],uuid:n[4].match(/^"(.*)"$/)[1],tls:"over-tls"===o.obfs||"wss"===o.obfs};if(void 0!==o["udp-relay"]&&(l.udp=JSON.parse(o["udp-relay"])),void 0!==o["fast-open"]&&(l.udp=JSON.parse(o["fast-open"])),"ws"===o.obfs||"wss"===o.obfs){l.network="ws",l["ws-opts"].path=(o["obfs-path"]||'"/"').match(/^"(.*)"$/)[1];var f=o["obfs-header"];f&&-1!==f.indexOf("Host")&&(f=f.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),l["ws-opts"].headers={Host:f||l.server}}return l.tls&&"false"===o['"tls-verification"']&&(l["skip-cert-verify"]=!0),l.tls&&o["obfs-host"]&&(l.sni=o["obfs-host"]),l}var p=JSON.parse(e),_={name:p.ps,type:"vmess",server:p.add,port:p.port,cipher:"auto",uuid:p.id,alterId:p.aid||0,tls:"tls"===p.tls||!0===p.tls,supported:{}};return"ws"===p.net&&(_.network="ws",_["ws-opts"]={path:p.path,headers:{Host:p.host||p.add}},_.tls&&p.host&&(_.sni=p.host)),!1===p.verify_cert&&(_["skip-cert-verify"]=!0),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){var e=_slicedToArray((t=t.split("trojan://")[1]).split("@")[1].split("?")[0].split(":"),2),r=e[0],n=e[1],o=decodeURIComponent(t.split("#")[1].trim()),i=t.split("?"),a=null;return i.length>1&&(i=i[1].split("#")[0].split("&"),a=new Map(i.map((function(t){return t.split("=")}))).get("sni")),{name:o||"[Trojan] ".concat(r),type:"trojan",server:r,port:n,password:t.split("@")[0],sni:a,supported:{}}}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){return JSON.parse(t)}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){var e=r(t),n={name:e.name,type:"ss",server:e.server,port:e.port,cipher:e["encrypt-method"],password:e.password,tfo:JSON.parse(e.tfo||"false"),udp:JSON.parse(e["udp-relay"]||"false")};return e.obfs&&(n.plugin="obfs",n["plugin-opts"]={mode:e.obfs,host:e["obfs-host"]}),n}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){var e=r(t),n={name:e.name,type:"vmess",server:e.server,port:e.port,uuid:e.username,alterId:0,cipher:"none",tls:JSON.parse(e.tls||"false"),tfo:JSON.parse(e.tfo||"false")};if(n.tls&&(void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n.sni=e.sni||e.server),JSON.parse(e.ws||"false")){n.network="ws",n["ws-opts"]={path:e["ws-path"]};var o=e["ws-headers"].match(/(,|^|\s)*HOST:\s*(.*?)(,|$)/),i=o?o[2]:n.server;n["ws-opts"].headers={Host:i||e.server}}return n}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])&&-1!==t.indexOf("sni")},parse:function(t){var e=r(t),n={name:e.name,type:"trojan",server:e.server,port:e.port,password:e.password,sni:e.sni||e.server,tfo:JSON.parse(e.tfo||"false")};return void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*http/.test(t.split(",")[0])&&!e().test(t)},parse:function(t){var e=r(t),n={name:e.name,type:"http",server:e.server,port:e.port,tls:JSON.parse(e.tls||"false"),tfo:JSON.parse(e.tfo||"false")};return n.tls&&(void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n.sni=e.sni||e.server),e.username&&"none"!==e.username&&(n.username=e.username),e.password&&"none"!==e.password&&(n.password=e.password),n}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"ss",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,"")};return e.length>5&&(r.plugin="obfs",r["plugin-opts"]={mode:e[5],host:e[6]}),r}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(",");return{name:t.split("=")[0].trim(),type:"ssr",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,""),protocol:e[5],"protocol-param":e[6].match(/{(.*)}/)[1],supported:{Surge:!1},obfs:e[7],"obfs-param":e[8].match(/{(.*)}/)[1]}}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){var e,r=t.split("=")[1].split(","),n={name:t.split("=")[0].trim(),type:"vmess",server:r[1],port:r[2],cipher:r[3]||"none",uuid:r[4].replace(/"/g,""),alterId:0},o=___createForOfIteratorHelper_38(r=r.splice(5));try{for(o.s();!(e=o.n()).done;){var i=_slicedToArray(e.value.split(":"),2),a=i[0],s=i[1];r[a]=s}}catch(c){o.e(c)}finally{o.f()}switch(n.tls=JSON.parse(r["over-tls"]||"false"),n.tls&&(n.sni=r["tls-name"]||n.server,n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),r.transport){case"tcp":break;case"ws":n.network=r.transport,n["ws-opts"]={path:r.path,headers:{Host:r.host}}}return n.tls&&(n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),n}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])&&-1===t.indexOf("password")},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"trojan",server:e[1],port:e[2],password:e[3].replace(/"/g,""),sni:e[1],"skip-cert-verify":JSON.parse(e["skip-cert-verify"]||"false")};if(e.length>4){var n=_slicedToArray(e[4].split(":"),2),o=n[0],i=n[1];if("tls-name"!==o)throw new Error("Unknown option ".concat(o," for line: \n").concat(t));r.sni=i}return r}},e(),{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ss",server:r.server,port:r.port,cipher:r.method,password:r.password,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{}};if(r.obfs)switch(n["plugin-opts"]={host:r["obfs-host"]||n.server},r.obfs){case"http":case"tls":n.plugin="obfs",n["plugin-opts"].mode=r.obfs;break;case"ws":case"wss":n["plugin-opts"]=___objectSpread_38(___objectSpread_38({},n["plugin-opts"]),{},{mode:"websocket",path:r["obfs-uri"]||"/",tls:"wss"===r.obfs}),n["plugin-opts"].tls&&void 0!==r["tls-verification"]&&(n["plugin-opts"]["skip-cert-verify"]=r["tls-verification"]),n.plugin="v2ray-plugin",n.supported.Surge=!1,n.supported.Loon=!1}return n}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ssr",server:r.server,port:r.port,cipher:r.method,password:r.password,protocol:r["ssr-protocol"],obfs:"plain","protocol-param":r["ssr-protocol-param"],udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{Surge:!1}};return r.obfs&&(n.obfs=r.obfs,n["obfs-param"]=r["obfs-host"]),n}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"vmess",name:r.tag,server:r.server,port:r.port,cipher:r.method||"none",uuid:r.password,alterId:0,tls:"over-tls"===r.obfs||"wss"===r.obfs,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n.tls&&(n.sni=r["obfs-host"]||r.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),"ws"!==r.obfs&&"wss"!==r.obfs||(n.network="ws",n["ws-opts"]={path:r["obfs-uri"],headers:{Host:r["obfs-host"]||r.server}}),n}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"trojan",name:r.tag,server:r.server,port:r.port,password:r.password,sni:r["tls-host"]||r.server,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true"),n}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"http",name:r.tag,server:r.server,port:r.port,tls:JSON.parse(r["over-tls"]||"false"),udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return r.username&&"none"!==r.username&&(n.username=r.username),r.password&&"none"!==r.password&&(n.password=r.password),n.tls&&(n.sni=r["tls-host"]||n.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),n}}];var n}(),PROXY_PROCESSORS=function(){function SetPropertyOperator(t){var e=t.key,r=t.value;return{name:"Set Property Operator",func:function(t){return t.map((function(t){return t[e]=r,t}))}}}function FlagOperator(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{name:"Flag Operator",func:function(e){return e.map((function(e){if(t){var r=(0,_$geo_48.getFlag)(e.name);e.name=removeFlag(e.name),e.name=r+" "+e.name,e.name=e.name.replace(/\ud83c\uddf9\ud83c\uddfc/g,"\ud83c\udde8\ud83c\uddf3")}else e.name=removeFlag(e.name);return e}))}}}function HandleDuplicateOperator(t){var e=___objectSpread_38(___objectSpread_38({},{action:"rename",template:"0 1 2 3 4 5 6 7 8 9",link:"-",position:"back"}),t),r=e.action,n=e.template,o=e.link,i=e.position;return{name:"Handle Duplicate Operator",func:function(t){if("delete"===r){var e={};return t.filter((function(t){return!e[t.name]&&(e[t.name]=!0,!0)}))}if("rename"===r){var a=n.split(" "),s={},c=0;t.forEach((function(t){void 0===s[t.name]?s[t.name]=1:s[t.name]++,c=Math.max(s[t.name].toString().length,c)}));var u={};return t.map((function(t){if(s[t.name]>1){void 0===u[t.name]&&(u[t.name]=1);for(var e="",r=u[t.name]++,n=0;r>0;)e=a[r%10]+e,r=parseInt(r/10),n++;for(;n++0&&void 0!==arguments[0]?arguments[0]:"asc";return{name:"Sort Operator",func:function(e){switch(t){case"asc":case"desc":return e.sort((function(e,r){return(e.name>r.name?1:-1)*("desc"===t?-1:1)}));case"random":return shuffle(e);default:throw new Error("Unknown sort option: "+t)}}}}function RegexSortOperator(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return buildRegex(t)})),e.sort((function(e,r){var n=getRegexOrder(t,e.name),o=getRegexOrder(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1?e-1:0),n=1;n1&&void 0!==w[1]?w[1]:[],n=w.length>2?w[2]:void 0,o=___createForOfIteratorHelper_38(r),t.prev=3,o.s();case 5:if((i=o.n()).done){t.next=38;break}if(a=i.value,s=void 0,c={},-1===a.type.indexOf("Script")){t.next=29;break}if(u=a.args,l=u.mode,f=u.content,"link"!==l){t.next=28;break}if((_=(p=f).split("#")).length>1){h=___createForOfIteratorHelper_38(_[1].split("&"));try{for(h.s();!(d=h.n()).done;)y=d.value,m=y.split("=")[0],v=y.split("=")[1]||!0,c[m]=v}catch(b){h.e(b)}finally{h.f()}}return t.prev=15,t.next=18,(0,___download_38.default)(p.split("#")[0]);case 18:s=t.sent,_app.default.info("Script loaded: >>>\n ".concat(s)),t.next=26;break;case 22:return t.prev=22,t.t0=t.catch(15),_app.default.error("Error when downloading remote script: ".concat(a.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",36);case 26:t.next=29;break;case 28:s=f;case 29:if(PROXY_PROCESSORS[a.type]){t.next=32;break}return _app.default.error('Unknown operator: "'.concat(a.type,'"')),t.abrupt("continue",36);case 32:_app.default.info('Applying "'.concat(a.type,'" with arguments:\n >>> ').concat(JSON.stringify(a.args,null,2)||"None")),g=void 0,g=-1!==a.type.indexOf("Script")?PROXY_PROCESSORS[a.type](s,n,c):PROXY_PROCESSORS[a.type](a.args),e=ApplyProcessor(g,e);case 36:t.next=5;break;case 38:t.next=43;break;case 40:t.prev=40,t.t1=t.catch(3),o.e(t.t1);case 43:return t.prev=43,o.f(),t.finish(43);case 46:return t.abrupt("return",e);case 47:case"end":return t.stop()}}),t,null,[[3,40,43,46],[15,22]])})))).apply(this,arguments)}return{parse:function(e){e=function(t){var e,r=___createForOfIteratorHelper_38(PROXY_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return _app.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){_app.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(e);var r,n,o=[],i=___createForOfIteratorHelper_38(e.split("\n"));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(0!==(a=a.trim()).length){var s=r&&t(r,a);if(!s){var c,u=___createForOfIteratorHelper_38(PROXY_PARSERS);try{for(u.s();!(c=u.n()).done;){var l=c.value;if(t(l,a)){r=l,s=!0,_app.default.info("Proxy parser: ".concat(l.name," is activated"));break}}}catch(p){u.e(p)}finally{u.f()}}if(s)try{var f=r.parse(a);f||_app.default.error("Parser ".concat(r.name," return nothing for \n").concat(a,"\n")),o.push(f)}catch(p){_app.default.error("Failed to parse line: \n ".concat(a,"\n Reason: ").concat(p.stack))}else _app.default.error("Failed to find a rule to parse line: \n".concat(a,"\n"))}}}catch(p){i.e(p)}finally{i.f()}return o},process:function(t){return e.apply(this,arguments)},produce:function(t,e){var r=PROXY_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return t=t.filter((function(t){return!(t.supported&&!1===t.supported[e])})),_app.default.info("Producing proxies for target: ".concat(e)),void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.produce(t)}catch(e){return _app.default.error("Cannot produce proxy: ".concat(JSON.stringify(t,null,2),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.produce(t):void 0}}}(),keys;function ApplyProcessor(t,e){return-1!==t.name.indexOf("Filter")?function(t,e){var r=(0,_$logical_51.FULL)(e.length,!0);try{r=(0,_$logical_51.AND)(r,t.func(e))}catch(n){console.log("Cannot apply filter ".concat(t.name,"\n Reason: ").concat(n))}return e.filter((function(t,e){return r[e]}))}(t,e):-1!==t.name.indexOf("Operator")?function(t,e){var r=clone(e);try{var n=t.func(r);n&&(r=n)}catch(o){console.log("Cannot apply operator ".concat(t.name,"! Reason: ").concat(o))}return r}(t,e):void 0}function shuffle(t){for(var e,r,n=t.length;0!==n;)r=Math.floor(Math.random()*n),e=t[n-=1],t[n]=t[r],t[r]=e;return t}function clone(t){return JSON.parse(JSON.stringify(t))}function removeFlag(t){return t.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/g,"").trim()}_$proxyUtils_38.ProxyUtils=ProxyUtils;var _$ruleUtils_39={};function ___typeof_39(t){return(___typeof_39="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(_$ruleUtils_39,"__esModule",{value:!0}),_$ruleUtils_39.RuleUtils=void 0;var ___staticJsYaml_39=___interopRequireDefault_39(_$staticJsYaml_36),___app_39=___interopRequireDefault_39(_$app_37);function ___interopRequireDefault_39(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_39(){___regeneratorRuntime_39=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=c;var l={};function f(){}function p(){}function _(){}var h={};s(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=f.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==___typeof_39(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_39(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___createForOfIteratorHelper_39(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_39(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_39(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ___arrayLikeToArray_39(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},{name:"Clash Provider",test:function(t){return 0===t.indexOf("payload:")},parse:function(t){return t.replace("payload:","").replace(/^\s*-\s*/gm,"")}}],RULE_PARSERS=[{name:"Universal Rule Parser",test:function(){return!0},parse:function(t){var e,r=[],n=___createForOfIteratorHelper_39(t.split("\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(0!==(o=o.trim()).length&&!/\s*#/.test(o))try{var i,a=o.split(",").map((function(t){return t.trim()})),s=a[0],c=!1,u=___createForOfIteratorHelper_39(RULE_TYPES_MAPPING);try{for(u.s();!(i=u.n()).done;){var l=i.value;if(l[0].test(s)){c=!0;var f={type:l[1],content:a[1]};"IP-CIDR"!==f.type&&"IP-CIDR6"!==f.type||(f.options=a.slice(2)),r.push(f)}}}catch(p){u.e(p)}finally{u.f()}if(!c)throw new Error("Invalid rule type: "+s)}catch(_){console.error("Failed to parse line: ".concat(o,"\n Reason: ").concat(_))}}}catch(p){n.e(p)}finally{n.f()}return r}}],RULE_PROCESSORS={"Regex Filter":function(t){var e=t.regex,r=void 0===e?[]:e,n=t.keep,o=void 0===n||n;return{name:"Regex Filter",func:function(t){return t.map((function(t){var e=r.some((function(e){return(e=new RegExp(e)).test(t)}));return o?e:!e}))}}},"Remove Duplicate Filter":function(){return{name:"Remove Duplicate Filter",func:function(t){var e=new Set,r=[];return t.forEach((function(t){var n=t.options||[];n.sort();var o="".concat(t.type,",").concat(t.content,",").concat(JSON.stringify(n));e.has(o)||(r.push(t),e.add(o))})),r}}},"Type Filter":function(t){return{name:"Type Filter",func:function(e){return e.map((function(e){return t.some((function(t){return e.type===t}))}))}}},"Regex Replace Operator":function(t){return{name:"Regex Rename Operator",func:function(e){return e.map((function(e){var r,n=___createForOfIteratorHelper_39(t);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=o.expr,a=o.now;e.content=e.content.replace(new RegExp(i,"g"),a).trim()}}catch(s){n.e(s)}finally{n.f()}return e}))}}}},RULE_PRODUCERS={QX:{type:"SINGLE",func:function(t){return-1!==["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:"".concat({"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[t.type]||t.type,",").concat(t.content,",SUB-STORE")}},Surge:{type:"SINGLE",func:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}},Loon:{type:"SINGLE",func:function(t){return-1!==["DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}(t)}},Clash:{type:"ALL",func:function(t){var e={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},r={payload:t.map((function(t){var r="".concat(e[t.type]||t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(r+=t.options?",".concat(t.options[0]):""),r}))};return ___staticJsYaml_39.default.dump(r)}}},RuleUtils=function(){function t(){var e;return e=___regeneratorRuntime_39().mark((function t(e,r){var n,o,i,a;return ___regeneratorRuntime_39().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=___createForOfIteratorHelper_39(r),t.prev=1,n.s();case 3:if((o=n.n()).done){t.next=13;break}if(i=o.value,RULE_PROCESSORS[i.type]){t.next=8;break}return console.error("Unknown operator: ".concat(i.type,"!")),t.abrupt("continue",11);case 8:a=RULE_PROCESSORS[i.type](i.args),___app_39.default.info('Applying "'.concat(i.type,'" with arguments: \n >>> ').concat(JSON.stringify(i.args)||"None")),e=(0,_$proxyUtils_38.ApplyProcessor)(a,e);case 11:t.next=3;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),n.e(t.t0);case 18:return t.prev=18,n.f(),t.finish(18);case 21:return t.abrupt("return",e);case 22:case"end":return t.stop()}}),t,null,[[1,15,18,21]])})),(t=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){__asyncGeneratorStep_39(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_39(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}return{parse:function(t){t=function(t){var e,r=___createForOfIteratorHelper_39(RULE_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return ___app_39.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){___app_39.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(t);var e,r=___createForOfIteratorHelper_39(RULE_PARSERS);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=void 0;try{o=n.test(t)}catch(i){o=!1}if(o)return ___app_39.default.info("Rule parser [".concat(n.name,"] is activated!")),n.parse(t)}}catch(i){r.e(i)}finally{r.f()}},process:function(e,r){return t.apply(this,arguments)},produce:function(t,e){var r=RULE_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.func(t)}catch(e){return console.log("ERROR: cannot produce rule: ".concat(JSON.stringify(t),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.func(t):void 0}}}();_$ruleUtils_39.RuleUtils=RuleUtils;var _$artifacts_41={};function ___typeof_41(t){return(___typeof_41="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(_$artifacts_41,"__esModule",{value:!0}),_$artifacts_41.default=function(t){___app_41.default.read(_$constants_43.ARTIFACTS_KEY)||___app_41.default.write({},_$constants_43.ARTIFACTS_KEY),t.route("/api/artifacts").get(getAllArtifacts).post(createArtifact),t.route("/api/artifact/:name").get(getArtifact).patch(updateArtifact).delete(deleteArtifact),t.get("/api/cron/sync-artifacts",cronSyncArtifacts)},_$artifacts_41.produceArtifact=produceArtifact;var ___download_41=___interopRequireDefault_41(_$download_47),_gist=___interopRequireDefault_41(_$gist_49),___app_41=___interopRequireDefault_41(_$app_37);function ___interopRequireDefault_41(t){return t&&t.__esModule?t:{default:t}}function ___createForOfIteratorHelper_41(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_41(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_41(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ___arrayLikeToArray_41(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_41(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_41(t){for(var e=1;e>>")),console.log(JSON.stringify(a,null,2)),t.prev=25,t.next=28,syncArtifact(___defineProperty_41({},a.name,{content:c}));case 28:u=t.sent,a.updated=(new Date).getTime(),l=JSON.parse(u.body),a.url=l.files[a.name].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_41.default.write(i,_$constants_43.ARTIFACTS_KEY),r.json({status:"success"}),t.next=39;break;case 36:t.prev=36,t.t1=t.catch(25),r.status(500).json({status:"failed",message:t.t1});case 39:t.next=42;break;case 41:r.json({status:"success",data:a});case 42:t.next=45;break;case 44:r.status(404).json({status:"failed",message:"\u672a\u627e\u5230\u5bf9\u5e94\u7684\u914d\u7f6e\uff01"});case 45:case"end":return t.stop()}}),t,null,[[25,36]])})))).apply(this,arguments)}function createArtifact(t,e){var r=t.body;___app_41.default.info("\u6b63\u5728\u521b\u5efa\u8fdc\u7a0b\u914d\u7f6e\uff1a".concat(r.name));var n=___app_41.default.read(_$constants_43.ARTIFACTS_KEY);n[r.name]?e.status(500).json({status:"failed",message:"\u8fdc\u7a0b\u914d\u7f6e".concat(r.name,"\u5df2\u5b58\u5728\uff01")}):/^[\w-_.]*$/.test(r.name)?(n[r.name]=r,___app_41.default.write(n,_$constants_43.ARTIFACTS_KEY),e.status(201).json({status:"success",data:r})):e.status(500).json({status:"failed",message:"\u8fdc\u7a0b\u914d\u7f6e\u540d\u79f0 ".concat(r.name," \u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01\u540d\u79f0\u4e2d\u53ea\u80fd\u5305\u542b\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u6a2a\u6760\u3002")})}function updateArtifact(t,e){var r=___app_41.default.read(_$constants_43.ARTIFACTS_KEY),n=t.params.name,o=r[n];if(o){___app_41.default.info("\u6b63\u5728\u66f4\u65b0\u8fdc\u7a0b\u914d\u7f6e\uff1a".concat(o.name));var i=t.body;if(void 0===i.name||/^[\w-_.]*$/.test(i.name)){var a=___objectSpread_41(___objectSpread_41({},o),i);r[a.name]=a,a.name!==n&&delete r[n],___app_41.default.write(r,_$constants_43.ARTIFACTS_KEY),e.json({status:"success",data:a})}else e.status(500).json({status:"failed",message:"\u8fdc\u7a0b\u914d\u7f6e\u540d\u79f0 ".concat(i.name," \u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01\u540d\u79f0\u4e2d\u53ea\u80fd\u5305\u542b\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u6a2a\u6760\u3002")})}else e.status(404).json({status:"failed",message:"\u672a\u627e\u5230\u5bf9\u5e94\u7684\u8fdc\u7a0b\u914d\u7f6e\uff01"})}function cronSyncArtifacts(t,e){return _cronSyncArtifacts.apply(this,arguments)}function _cronSyncArtifacts(){return(_cronSyncArtifacts=___asyncToGenerator_41(___regeneratorRuntime_41().mark((function t(e,r){var n,o,i,a,s,c,u;return ___regeneratorRuntime_41().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ___app_41.default.info("\u5f00\u59cb\u540c\u6b65\u6240\u6709\u8fdc\u7a0b\u914d\u7f6e..."),n=___app_41.default.read(_$constants_43.ARTIFACTS_KEY),o={},t.prev=3,t.next=6,Promise.all(Object.values(n).map(function(){var t=___asyncToGenerator_41(___regeneratorRuntime_41().mark((function t(e){var r,n;return ___regeneratorRuntime_41().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sync){t.next=15;break}___app_41.default.info("\u6b63\u5728\u540c\u6b65\u4e91\u914d\u7f6e\uff1a".concat(e.name,"...")),t.t0=e.type,t.next="subscription"===t.t0?5:"collection"===t.t0?7:"rule"===t.t0?9:11;break;case 5:return r=___app_41.default.read(_$constants_43.SUBS_KEY)[e.source],t.abrupt("break",11);case 7:return r=___app_41.default.read(_$constants_43.COLLECTIONS_KEY)[e.source],t.abrupt("break",11);case 9:return r=___app_41.default.read(_$constants_43.RULES_KEY)[e.source],t.abrupt("break",11);case 11:return t.next=13,produceArtifact({type:e.type,item:r,platform:e.platform});case 13:n=t.sent,o[e.name]={content:n};case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return t.next=8,syncArtifact(o);case 8:for(i=t.sent,a=JSON.parse(i.body),s=0,c=Object.values(n);s=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_46(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_46(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_42(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_42(t){for(var e=1;e0)){t.next=15;break}if("local"===(f=u[l[0]]).source){t.next=15;break}return t.next=13,(0,_$subscriptions_46.getFlowHeaders)(f.url);case 13:(p=t.sent)&&r.set("subscription-userinfo",p);case 15:if(!c){t.next=29;break}return t.prev=16,t.next=19,(0,_$artifacts_41.produceArtifact)({type:"collection",item:c,platform:a,noProcessor:i});case 19:_=t.sent,"JSON"===a?r.set("Content-Type","application/json;charset=utf-8").send(_):r.send(_),t.next=27;break;case 23:t.prev=23,t.t0=t.catch(16),___app_42.default.notify("\ud83c\udf0d \u300e \ud835\udc7a\ud835\udc96\ud835\udc83-\ud835\udc7a\ud835\udc95\ud835\udc90\ud835\udc93\ud835\udc86 \u300f \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u9519\u8bef\uff1a".concat(n,"\uff01"),"\ud83e\udd14 \u539f\u56e0\uff1a".concat(t.t0)),r.status(500).json({status:"failed",message:t.t0});case 27:t.next=31;break;case 29:___app_42.default.notify("\ud83c\udf0d \u300e \ud835\udc7a\ud835\udc96\ud835\udc83-\ud835\udc7a\ud835\udc95\ud835\udc90\ud835\udc93\ud835\udc86 \u300f \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n,"\uff01")),r.status(404).json({status:"failed"});case 31:case"end":return t.stop()}}),t,null,[[16,23]])})),(_downloadCollection=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_42(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_42(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}function createCollection(t,e){var r=t.body;___app_42.default.info("\u6b63\u5728\u521b\u5efa\u7ec4\u5408\u8ba2\u9605\uff1a".concat(r.name));var n=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);n[r.name]&&e.status(500).json({status:"failed",message:"\u8ba2\u9605\u96c6".concat(r.name,"\u5df2\u5b58\u5728\uff01")}),/^[\w-_]*$/.test(r.name)?(n[r.name]=r,___app_42.default.write(n,_$constants_43.COLLECTIONS_KEY),e.status(201).json({status:"success",data:r})):e.status(500).json({status:"failed",message:"\u8ba2\u9605\u96c6\u540d\u79f0 ".concat(r.name," \u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01\u540d\u79f0\u4e2d\u53ea\u80fd\u5305\u542b\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u6a2a\u6760\u3002")})}function getCollection(t,e){var r=t.params.name,n=___app_42.default.read(_$constants_43.COLLECTIONS_KEY)[r];n?e.json({status:"success",data:n}):e.status(404).json({status:"failed",message:"\u672a\u627e\u5230\u8ba2\u9605\u96c6\uff1a".concat(r,"!")})}function updateCollection(t,e){var r=t.params.name,n=t.body,o=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);if(o[r]){var i=___objectSpread_42(___objectSpread_42({},o[r]),n);___app_42.default.info("\u6b63\u5728\u66f4\u65b0\u7ec4\u5408\u8ba2\u9605\uff1a".concat(r,"...")),delete o[r],o[n.name||r]=i,___app_42.default.write(o,_$constants_43.COLLECTIONS_KEY),e.json({status:"success",data:i})}else e.status(500).json({status:"failed",message:"\u8ba2\u9605\u96c6".concat(r,"\u4e0d\u5b58\u5728\uff0c\u65e0\u6cd5\u66f4\u65b0\uff01")})}function deleteCollection(t,e){var r=t.params.name;___app_42.default.info("\u6b63\u5728\u5220\u9664\u7ec4\u5408\u8ba2\u9605\uff1a".concat(r));var n=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);delete n[r],___app_42.default.write(n,_$constants_43.COLLECTIONS_KEY),e.json({status:"success"})}function getAllCollections(t,e){var r=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);e.json({status:"success",data:r})}var _$settings_45={};Object.defineProperty(_$settings_45,"__esModule",{value:!0}),_$settings_45.default=function(t){___app_45.default.read(_$constants_43.SETTINGS_KEY)||___app_45.default.write({},_$constants_43.SETTINGS_KEY),t.route("/api/settings").get(getSettings).patch(updateSettings)};var __obj_45,___app_45=(__obj_45=_$app_37)&&__obj_45.__esModule?__obj_45:{default:__obj_45};function __ownKeys_45(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_45(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_44(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___asyncToGenerator_44(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_44(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_44(i,n,o,a,s,"throw",t)}a(void 0)}))}}function getEnv(t,e){var r=(0,_$openApi_53.ENV)(),n="Node";r.isNode&&(n="Node"),r.isQX&&(n="QX"),r.isLoon&&(n="Loon"),r.isSurge&&(n="Surge"),e.json({backend:n})}function gistBackup(t,e){return _gistBackup.apply(this,arguments)}function _gistBackup(){return(_gistBackup=___asyncToGenerator_44(___regeneratorRuntime_44().mark((function t(e,r){var n,o,i,a,s,c,u;return ___regeneratorRuntime_44().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.query.action,o=___app_44.default.read(_$constants_43.SETTINGS_KEY),i=o.gistToken){t.next=6;break}r.status(500).json({status:"failed",message:"\u672a\u627e\u5230Gist\u5907\u4efdToken!"}),t.next=35;break;case 6:a=new ___gist_44.default({token:i,key:_$constants_43.GIST_BACKUP_KEY}),t.prev=7,c=___app_44.default.read(_$constants_43.SETTINGS_KEY),t.t0=n,t.next="upload"===t.t0?12:"download"===t.t0?20:27;break;case 12:return c.syncTime=(new Date).getTime(),___app_44.default.write(c,_$constants_43.SETTINGS_KEY),s=___app_44.default.read("#sub-store"),___app_44.default.env.isNode&&(s=JSON.stringify(___app_44.default.cache,null," ")),___app_44.default.info("\u4e0a\u4f20\u5907\u4efd\u4e2d..."),t.next=19,a.upload((l={},f=_$constants_43.GIST_BACKUP_FILE_NAME,p={content:s},f in l?Object.defineProperty(l,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[f]=p,l));case 19:return t.abrupt("break",27);case 20:return ___app_44.default.info("\u8fd8\u539f\u5907\u4efd\u4e2d..."),t.next=23,a.download(_$constants_43.GIST_BACKUP_FILE_NAME);case 23:return s=t.sent,___app_44.default.write(s,"#sub-store"),___app_44.default.env.isNode&&(s=JSON.parse(s),Object.keys(s).forEach((function(t){___app_44.default.write(s[t],t)}))),t.abrupt("break",27);case 27:r.json({status:"success"}),t.next=35;break;case 30:t.prev=30,t.t1=t.catch(7),u="".concat("upload"===n?"\u4e0a\u4f20":"\u4e0b\u8f7d","\u5907\u4efd\u5931\u8d25\uff01").concat(t.t1),___app_44.default.error(u),r.status(500).json({status:"failed",message:u});case 35:case"end":return t.stop()}var l,f,p}),t,null,[[7,30]])})))).apply(this,arguments)}var _$main_40={},__obj_40,_restful=(__obj_40=_$restful_44)&&__obj_40.__esModule?__obj_40:{default:__obj_40};console.log("\n\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\n \ud835\udc7a\ud835\udc96\ud835\udc83-\ud835\udc7a\ud835\udc95\ud835\udc90\ud835\udc93\ud835\udc86 \xa9 \ud835\udc77\ud835\udc86\ud835\udc8f\ud835\udc88-\ud835\udc80\ud835\udc74\n\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\n"),(0,_restful.default)()}(); \ No newline at end of file +!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|c(e,n),i=t(o),a=i.write(e,n);return a!==o&&(i=i.slice(0,a)),i}(e,n);if(ArrayBuffer.isView(e))return a(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function c(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return P(t).length;default:if(i)return o?-1:k(t).length;e=(""+e).toLowerCase(),i=!0}}function u(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),j(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:f(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):f(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function f(t,e,r,n,o){var i,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;is&&(r=s-c),i=r;i>=0;i--){for(var f=!0,p=0;po&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function v(t,e,r){return 0===e&&r===t.length?_$base64Js_1.fromByteArray(t):_$base64Js_1.fromByteArray(t.slice(e,r))}function g(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:u>223?3:u>191?2:1;if(o+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return g(this,e,r);case"ascii":return b(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return v(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===r.compare(this,t)},r.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),""},r.prototype.compare=function(t,e,n,o,i){if(N(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(n>>>=0)-(e>>>=0),c=Math.min(a,s),u=this.slice(o,i),l=t.slice(e,n),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return p(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return h(this,t,e,r);case"latin1":case"binary":return d(this,t,e,r);case"base64":return y(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function b(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,n,o,i,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),_$ieee754_3.write(t,e,r,n,52,8),r+8}r.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},r.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},r.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),_$ieee754_3.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},r.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},r.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},r.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},r.prototype.copy=function(t,e,n,o){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e=0;--a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return i},r.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!r.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){var i=t.charCodeAt(0);("utf8"===o&&i<128||"latin1"===o)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function P(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$constants_43={};Object.defineProperty(_$constants_43,"__esModule",{value:!0}),_$constants_43.SUBS_KEY=_$constants_43.SETTINGS_KEY=_$constants_43.GIST_BACKUP_KEY=_$constants_43.GIST_BACKUP_FILE_NAME=_$constants_43.COLLECTIONS_KEY=_$constants_43.ARTIFACT_REPOSITORY_KEY=_$constants_43.ARTIFACTS_KEY=void 0,_$constants_43.SETTINGS_KEY="settings",_$constants_43.SUBS_KEY="subs",_$constants_43.COLLECTIONS_KEY="collections",_$constants_43.ARTIFACTS_KEY="artifacts",_$constants_43.GIST_BACKUP_KEY="Auto Generated Sub-Store Backup",_$constants_43.GIST_BACKUP_FILE_NAME="Sub-Store",_$constants_43.ARTIFACT_REPOSITORY_KEY="Sub-Store Artifacts Repository";var _$openApi_53={};function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,s,"next",t)}function s(t){asyncGeneratorStep(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"untitled",debug=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_classCallCheck(this,OpenAPI),this.name=name,this.debug=debug,this.http=HTTP(),this.env=ENV(),this.node=function(){if(isNode){var fs=eval("require('fs')");return{fs:fs}}return null}(),this.initCache();var delay=function(t,e){return new Promise((function(r){setTimeout(r.bind(null,e),t)}))},_ref;Promise.prototype.delay=(_ref=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this;case 2:return r=t.sent,t.next=5,delay(e,r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return _ref.apply(this,arguments)})}return _createClass(OpenAPI,[{key:"initCache",value:function(){if(isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}")),(isLoon||isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||"{}")),isNode){var t="root.json";this.node.fs.existsSync(t)||this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.root={},t="".concat(this.name,".json"),this.node.fs.existsSync(t)?this.cache=JSON.parse(this.node.fs.readFileSync("".concat(this.name,".json"))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},(function(t){return console.log(t)})),this.cache={})}}},{key:"persistCache",value:function(){var t=JSON.stringify(this.cache,null,2);isQX&&$prefs.setValueForKey(t,this.name),(isLoon||isSurge)&&$persistentStore.write(t,this.name),isNode&&(this.node.fs.writeFileSync("".concat(this.name,".json"),t,{flag:"w"},(function(t){return console.log(t)})),this.node.fs.writeFileSync("root.json",JSON.stringify(this.root,null,2),{flag:"w"},(function(t){return console.log(t)})))}},{key:"write",value:function(t,e){if(this.log("SET ".concat(e)),-1!==e.indexOf("#")){if(e=e.substr(1),isSurge||isLoon)return $persistentStore.write(t,e);if(isQX)return $prefs.setValueForKey(t,e);isNode&&(this.root[e]=t)}else this.cache[e]=t;this.persistCache()}},{key:"read",value:function(t){return this.log("READ ".concat(t)),-1===t.indexOf("#")?this.cache[t]:(t=t.substr(1),isSurge||isLoon?$persistentStore.read(t):isQX?$prefs.valueForKey(t):isNode?this.root[t]:void 0)}},{key:"delete",value:function(t){if(this.log("DELETE ".concat(t)),-1!==t.indexOf("#")){if(t=t.substr(1),isSurge||isLoon)return $persistentStore.write(null,t);if(isQX)return $prefs.removeValueForKey(t);isNode&&delete this.root[t]}else delete this.cache[t];this.persistCache()}},{key:"notify",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n["open-url"],i=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(i?"\n\u591a\u5a92\u4f53:"+i:""),{url:o}),isLoon){var a={};o&&(a.openUrl=o),i&&(a.mediaUrl=i),"{}"===JSON.stringify(a)?$notification.post(t,e,r):$notification.post(t,e,r,a)}if(isNode){var s=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(i?"\n\u591a\u5a92\u4f53: ".concat(i):"");console.log("".concat(t,"\n").concat(e,"\n").concat(s,"\n\n"))}}},{key:"log",value:function(t){this.debug&&console.log("[".concat(this.name,"] LOG: ").concat(t))}},{key:"info",value:function(t){console.log("[".concat(this.name,"] INFO: ").concat(t))}},{key:"error",value:function(t){console.log("[".concat(this.name,"] ERROR: ").concat(t))}},{key:"wait",value:function(t){return new Promise((function(e){return setTimeout(e,t)}))}},{key:"done",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};isQX||isLoon||isSurge?$done(t):isNode&&"undefined"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}]),OpenAPI}();function ENV(){return{isQX:isQX,isLoon:isLoon,isSurge:isSurge,isNode:isNode}}function HTTP(){var defaultOptions=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{baseURL:""},_ENV=ENV(),isQX=_ENV.isQX,isLoon=_ENV.isLoon,isSurge=_ENV.isSurge,isNode=_ENV.isNode,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="string"==typeof options?{url:options}:options;var baseURL=defaultOptions.baseURL;baseURL&&!URL_REGEX.test(options.url||"")&&(options.url=baseURL?baseURL+options.url:options.url),options=_objectSpread(_objectSpread({},defaultOptions),options);var timeout=options.timeout,events=_objectSpread(_objectSpread({},{onRequest:function(){},onResponse:function(t){return t},onTimeout:function(){}}),options.events),worker,timeoutid;events.onRequest(method,options),isQX?worker=$task.fetch({method:method,url:options.url,headers:options.headers,body:options.body}):(isLoon||isSurge||isNode)&&(worker=new Promise((function(resolve,reject){var request=isNode?eval("require('request')"):$httpClient;request[method.toLowerCase()](options,(function(t,e,r){t?reject(t):resolve({statusCode:e.status||e.statusCode,headers:e.headers,body:r})}))})));var timer=timeout?new Promise((function(t,e){timeoutid=setTimeout((function(){return events.onTimeout(),e("".concat(method," URL: ").concat(options.url," exceeds the timeout ").concat(timeout," ms"))}),timeout)})):null;return(timer?Promise.race([timer,worker]).then((function(t){return clearTimeout(timeoutid),t})):worker).then((function(t){return events.onResponse(t)}))}var http={};return methods.forEach((function(t){return http[t.toLowerCase()]=function(e){return send(t,e)}})),http}_$openApi_53.OpenAPI=OpenAPI;var _$browser_35={},cachedSetTimeout,cachedClearTimeout,process=_$browser_35={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch(e){try{return cachedSetTimeout.call(null,t,0)}catch(e){return cachedSetTimeout.call(this,t,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(t){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(t){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var e=queue.length;e;){for(currentQueue=queue,queue=[];++queueIndex1)for(var r=1;r1&&void 0!==arguments[1]?arguments[1]:0,n=e.method,o=e.url,i=e.headers,a=e.body;/json/i.test(i["Content-Type"])&&(a=JSON.parse(a)),n=n.toUpperCase();var s,c=extractURL(o),u=c.path,l=c.query,f=null,p=0;for(s=r;sp&&(f=handlers[s],p=_.split("/").length)}if(f){var h=function(){t(n,o,s)},d={method:n,url:o,path:u,query:l,params:extractPathParams(f.pattern,u),headers:i,body:a},y=Response(),m=f.callback,v=function(t){y.status(500).json({status:"failed",message:"Internal Server Error: ".concat(t)})};if("AsyncFunction"===m.constructor.name)m(d,y,h).catch(v);else try{m(d,y,h)}catch(g){v(g)}}else Response().status(404).json({status:"failed",message:"ERROR: 404 not found"})},app={};return METHODS_NAMES.forEach((function(t){app[t.toLowerCase()]=function(e,r){handlers.push({method:t,pattern:e,callback:r})}})),app.route=function(t){var e={};return METHODS_NAMES.forEach((function(r){e[r.toLowerCase()]=function(n){return handlers.push({method:r,pattern:t,callback:n}),e}})),e},app.start=function(){dispatch($request)},app;function rawBodySaver(t,e,r,n){r&&r.length&&(t.rawBody=r.toString(n||"utf8"))}function Response(){var t=200,e=(0,_$openApi_53.ENV)(),r=e.isQX,n=e.isLoon,o=e.isSurge,i=DEFAULT_HEADERS,a={200:"HTTP/1.1 200 OK",201:"HTTP/1.1 201 Created",302:"HTTP/1.1 302 Found",307:"HTTP/1.1 307 Temporary Redirect",308:"HTTP/1.1 308 Permanent Redirect",404:"HTTP/1.1 404 Not Found",500:"HTTP/1.1 500 Internal Server Error"};return new(function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"status",value:function(e){return t=e,this}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s={status:r?a[t]:t,body:e,headers:i};r?$done(s):(n||o)&&$done({response:s})}},{key:"end",value:function(){this.send()}},{key:"html",value:function(t){this.set("Content-Type","text/html;charset=UTF-8"),this.send(t)}},{key:"json",value:function(t){this.set("Content-Type","application/json;charset=UTF-8"),this.send(JSON.stringify(t))}},{key:"set",value:function(t,e){return i[t]=e,this}}]),e}())}}function patternMatched(t,e){if(t instanceof RegExp&&t.test(e))return!0;if("/"===t)return!0;if(-1===t.indexOf(":")){for(var r=e.split("/"),n=t.split("/"),o=0;o=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_50(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function _IP_API(){var t;return t=___regeneratorRuntime_50().mark((function t(e,r){var n,o,i;return ___regeneratorRuntime_50().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=decodeURIComponent(e.params.server),o=(0,_$openApi_53.HTTP)(),t.next=4,o.get("http://ip-api.com/json/".concat(n,"?lang=zh-CN")).then((function(t){return JSON.parse(t.body)}));case 4:i=t.sent,r.json(i);case 6:case"end":return t.stop()}}),t)})),(_IP_API=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_50(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_50(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}Object.defineProperty(_$ipApi_50,"__esModule",{value:!0}),_$ipApi_50.default=function(t,e){return _IP_API.apply(this,arguments)};var _$gist_49={};function ___typeof_49(t){return(___typeof_49="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ___regeneratorRuntime_49(){___regeneratorRuntime_49=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=c;var l={};function f(){}function p(){}function _(){}var h={};s(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=f.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==___typeof_49(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function _createForOfIteratorHelper(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(n-1));)if(n-=1,this.position-n>e/2-1){r=" ... ",n+=5;break}for(o="",i=this.position;ie/2-1){o=" ... ",i-=5;break}return a=this.buffer.slice(n,i),_$common_7.repeat(" ",t)+r+a+o+"\n"+_$common_7.repeat(" ",t+this.position-n+r.length)+"^"},Mark.prototype.toString=function(t){var e,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(r+=":\n"+e),r},_$mark_11=Mark;var TYPE_CONSTRUCTOR_OPTIONS=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"],_$type_18=function(t,e){var r,n;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(e))throw new _$exception_9('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(r=e.styleAliases||null,n={},null!==r&&Object.keys(r).forEach((function(t){r[t].forEach((function(e){n[String(e)]=t}))})),n),-1===YAML_NODE_KINDS.indexOf(this.kind))throw new _$exception_9('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')},_$schema_12={};function compileList(t,e,r){var n=[];return t.include.forEach((function(t){r=compileList(t,e,r)})),t[e].forEach((function(t){r.forEach((function(e,r){e.tag===t.tag&&e.kind===t.kind&&n.push(r)})),r.push(t)})),r.filter((function(t,e){return-1===n.indexOf(e)}))}function Schema(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach((function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new _$exception_9("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=compileList(this,"implicit",[]),this.compiledExplicit=compileList(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{}};function n(t){r[t.kind][t.tag]=r.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/,_$float_21=new _$type_18("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!YAML_FLOAT_PATTERN.test(t)||"_"===t[t.length-1])},construct:function(t){var e,r,n,o;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach((function(t){o.unshift(parseFloat(t,10))})),e=0,n=1,o.forEach((function(t){e+=t*n,n*=60})),r*e):r*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||_$common_7.isNegativeZero(t))},represent:function(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_$common_7.isNegativeZero(t))return"-0.0";return r=t.toString(10),SCIENTIFIC_WITHOUT_DOT.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),_$json_17=new _$schema_12({include:[_$failsafe_16],implicit:[_$null_28,_$bool_20,_$int_22,_$float_21]}),_$core_13=new _$schema_12({include:[_$json_17]}),YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),_$timestamp_34=new _$type_18("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==YAML_DATE_REGEXP.exec(t)||null!==YAML_TIMESTAMP_REGEXP.exec(t))},construct:function(t){var e,r,n,o,i,a,s,c,u=0,l=null;if(null===(e=YAML_DATE_REGEXP.exec(t))&&(e=YAML_TIMESTAMP_REGEXP.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,o=+e[3],!e[4])return new Date(Date.UTC(r,n,o));if(i=+e[4],a=+e[5],s=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),c=new Date(Date.UTC(r,n,o,i,a,s,u)),l&&c.setTime(c.getTime()-l),c},instanceOf:Date,represent:function(t){return t.toISOString()}}),_$merge_27=new _$type_18("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),NodeBuffer;try{var _require=require;NodeBuffer=_require("buffer").Buffer}catch(__){}var BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",_$binary_19=new _$type_18("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,r,n=0,o=t.length,i=BASE64_MAP;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8==0},construct:function(t){var e,r,n=t.replace(/[\r\n=]/g,""),o=n.length,i=BASE64_MAP,a=0,s=[];for(e=0;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|i.indexOf(n.charAt(e));return 0==(r=o%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===r?(s.push(a>>10&255),s.push(a>>2&255)):12===r&&s.push(a>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(s):new NodeBuffer(s):s},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,i=t.length,a=BASE64_MAP;for(e=0;e>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]),o=(o<<8)+t[e];return 0==(r=i%3)?(n+=a[o>>18&63],n+=a[o>>12&63],n+=a[o>>6&63],n+=a[63&o]):2===r?(n+=a[o>>10&63],n+=a[o>>4&63],n+=a[o<<2&63],n+=a[64]):1===r&&(n+=a[o>>2&63],n+=a[o<<4&63],n+=a[64],n+=a[64]),n}}),_hasOwnProperty=Object.prototype.hasOwnProperty,_toString=Object.prototype.toString,_$omap_29=new _$type_18("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,r,n,o,i,a=[],s=t;for(e=0,r=s.length;e3)return!1;if("/"!==e[e.length-n.length-1])return!1}return!0},construct:function(t){var e=t,r=/\/([gim]*)$/.exec(t),n="";return"/"===e[0]&&(r&&(n=r[1]),e=e.slice(1,e.length-n.length-1)),new RegExp(e,n)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}}),esprima;try{var ___require_23=require;esprima=___require_23("esprima")}catch(_){"undefined"!=typeof window&&(esprima=window.esprima)}var _$function_23=new _$type_18("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",r=esprima.parse(e,{range:!0});return"Program"===r.type&&1===r.body.length&&"ExpressionStatement"===r.body[0].type&&("ArrowFunctionExpression"===r.body[0].expression.type||"FunctionExpression"===r.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,r="("+t+")",n=esprima.parse(r,{range:!0}),o=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"ArrowFunctionExpression"!==n.body[0].expression.type&&"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach((function(t){o.push(t.name)})),e=n.body[0].expression.body.range,"BlockStatement"===n.body[0].expression.body.type?new Function(o,r.slice(e[0]+1,e[1]-1)):new Function(o,"return "+r.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}}),_$default_full_14=_$schema_12.DEFAULT=new _$schema_12({include:[_$default_safe_15],explicit:[_$undefined_25,_$regexp_24,_$function_23]}),_$loader_10={},___hasOwnProperty_10=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(t){return Object.prototype.toString.call(t)}function is_EOL(t){return 10===t||13===t}function is_WHITE_SPACE(t){return 9===t||32===t}function is_WS_OR_EOL(t){return 9===t||32===t||10===t||13===t}function is_FLOW_INDICATOR(t){return 44===t||91===t||93===t||123===t||125===t}function fromHexCode(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function simpleEscapeSequence(t){return 48===t?"\0":97===t?"\x07":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"\x1b":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"\x85":95===t?"\xa0":76===t?"\u2028":80===t?"\u2029":""}function charFromCodepoint(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256),i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||_$default_full_14,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function generateError(t,e){return new _$exception_9(e,new _$mark_11(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function throwError(t,e){throw generateError(t,e)}function throwWarning(t,e){t.onWarning&&t.onWarning.call(null,generateError(t,e))}var directiveHandlers={YAML:function(t,e,r){var n,o,i;null!==t.version&&throwError(t,"duplication of %YAML directive"),1!==r.length&&throwError(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&throwError(t,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),i=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,1!==i&&2!==i&&throwWarning(t,"unsupported YAML version of the document")},TAG:function(t,e,r){var n,o;2!==r.length&&throwError(t,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],PATTERN_TAG_HANDLE.test(n)||throwError(t,"ill-formed tag handle (first argument) of the TAG directive"),___hasOwnProperty_10.call(t.tagMap,n)&&throwError(t,'there is a previously declared suffix for "'+n+'" tag handle'),PATTERN_TAG_URI.test(o)||throwError(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[n]=o}};function captureSegment(t,e,r,n){var o,i,a,s;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,i=t.anchor,a=[],s=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)a.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),a.push(t.result),skipSeparationSpace(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)throwError(t,"bad indentation of a sequence entry");else if(t.lineIndente?_=1:t.lineIndent===e?_=0:t.lineIndente?_=1:t.lineIndent===e?_=0:t.lineIndente)&&(composeNode(t,e,CONTEXT_BLOCK_OUT,!0,o)&&(d?_=t.result:h=t.result),d||(storeMappingPair(t,l,f,p,_,h,i,a),p=_=h=null),skipSeparationSpace(t,!0,-1),s=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==s)throwError(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===o?throwError(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,u=!0)}if(is_WHITE_SPACE(i)){do{i=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(i));if(35===i)do{i=t.input.charCodeAt(++t.position)}while(!is_EOL(i)&&0!==i)}for(;0!==i;){for(readLineBreak(t),t.lineIndent=0,i=t.input.charCodeAt(t.position);(!u||t.lineIndentl&&(l=t.lineIndent),is_EOL(i))f++;else{if(t.lineIndent0){for(o=a,i=0;o>0;o--)(a=fromHexCode(s=t.input.charCodeAt(++t.position)))>=0?i=(i<<4)+a:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(i),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(s)?(captureSegment(t,r,n,!0),writeFoldedLines(t,skipSeparationSpace(t,!1,e)),r=n=t.position):t.position===t.lineStart&&testDocumentSeparator(t)?throwError(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}throwError(t,"unexpected end of the stream within a double quoted scalar")}(t,f)?d=!0:function(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&throwError(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),___hasOwnProperty_10.call(t.anchorMap,r)||throwError(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],skipSeparationSpace(t,!0,-1),!0}(t)?(d=!0,null===t.tag&&null===t.anchor||throwError(t,"alias node should not have any properties")):function(t,e,r){var n,o,i,a,s,c,u,l,f=t.kind,p=t.result;if(is_WS_OR_EOL(l=t.input.charCodeAt(t.position))||is_FLOW_INDICATOR(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n)))return!1;for(t.kind="scalar",t.result="",o=i=t.position,a=!1;0!==l;){if(58===l){if(is_WS_OR_EOL(n=t.input.charCodeAt(t.position+1))||r&&is_FLOW_INDICATOR(n))break}else if(35===l){if(is_WS_OR_EOL(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&testDocumentSeparator(t)||r&&is_FLOW_INDICATOR(l))break;if(is_EOL(l)){if(s=t.line,c=t.lineStart,u=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){a=!0,l=t.input.charCodeAt(t.position);continue}t.position=i,t.line=s,t.lineStart=c,t.lineIndent=u;break}}a&&(captureSegment(t,o,i,!1),writeFoldedLines(t,t.line-s),o=i=t.position,a=!1),is_WHITE_SPACE(l)||(i=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,i,!1),!!t.result||(t.kind=f,t.result=p,!1)}(t,f,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=s&&readBlockSequence(t,p))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&throwError(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),c=0,u=t.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+t.kind+'"'),l.resolve(t.result)?(t.result=l.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):throwError(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):throwError(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||d}function readDocument(t){var e,r,n,o,i=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(o=t.input.charCodeAt(t.position))&&(skipSeparationSpace(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==o));){for(a=!0,o=t.input.charCodeAt(++t.position),e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&throwError(t,"directive name must not be less than one character in length");0!==o;){for(;is_WHITE_SPACE(o);)o=t.input.charCodeAt(++t.position);if(35===o){do{o=t.input.charCodeAt(++t.position)}while(0!==o&&!is_EOL(o));break}if(is_EOL(o))break;for(e=t.position;0!==o&&!is_WS_OR_EOL(o);)o=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==o&&readLineBreak(t),___hasOwnProperty_10.call(directiveHandlers,r)?directiveHandlers[r](t,r,n):throwWarning(t,'unknown document directive "'+r+'"')}skipSeparationSpace(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,skipSeparationSpace(t,!0,-1)):a&&throwError(t,"directives end mark is expected"),composeNode(t,t.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(t,!0,-1),t.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(t.input.slice(i,t.position))&&throwWarning(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&testDocumentSeparator(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,skipSeparationSpace(t,!0,-1)):t.position0?t.charCodeAt(i-1):null,_=_&&isPlainSafe(a,s)}else{for(i=0;in&&" "!==t[p+1],p=i);else if(!isPrintable(a))return STYLE_DOUBLE;s=i>0?t.charCodeAt(i-1):null,_=_&&isPlainSafe(a,s)}l=l||f&&i-p-1>n&&" "!==t[p+1]}return u||l?r>9&&needIndentIndicator(t)?STYLE_DOUBLE:l?STYLE_FOLDED:STYLE_LITERAL:_&&!o(t)?STYLE_PLAIN:STYLE_SINGLE}function writeScalar(t,e,r,n){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,r),i=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),a=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,a,t.indent,i,(function(e){return function(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r"+blockHeader(e,t.indent)+dropEndingNewline(indentString(function(t,e){for(var r,n,o,i=/(\n+)([^\n]*)/g,a=(o=-1!==(o=t.indexOf("\n"))?o:t.length,i.lastIndex=o,foldLine(t.slice(0,o),e)),s="\n"===t[0]||" "===t[0];n=i.exec(t);){var c=n[1],u=n[2];r=" "===u[0],a+=c+(s||r||""===u?"":"\n")+foldLine(u,e),s=r}return a}(e,i),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",i=0;i=55296&&e<=56319&&(r=t.charCodeAt(i+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),i++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[i]:n||encodeHex(e);return o}(e)+'"';default:throw new _$exception_9("impossible error: invalid scalar style")}}()}function blockHeader(t,e){var r=needIndentIndicator(t)?String(e):"",n="\n"===t[t.length-1];return r+(!n||"\n"!==t[t.length-2]&&"\n"!==t?n?"":"-":"+")+"\n"}function dropEndingNewline(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function foldLine(t,e){if(""===t||" "===t[0])return t;for(var r,n,o=/ [^ ]/g,i=0,a=0,s=0,c="";r=o.exec(t);)(s=r.index)-i>e&&(n=a>i?a:s,c+="\n"+t.slice(i,n),i=n+1),a=s;return c+="\n",t.length-i>e&&a>i?c+=t.slice(i,a)+"\n"+t.slice(a+1):c+=t.slice(i),c.slice(1)}function detectType(t,e,r){var n,o,i,a,s,c;for(i=0,a=(o=r?t.explicitTypes:t.implicitTypes).length;i tag resolver accepts not "'+c+'" style');n=s.represent[c](e,c)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,i){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var a=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||c||2!==t.indent&&e>0)&&(o=!1),c&&t.usedDuplicates[s])t.dump="*ref_"+s;else{if(u&&c&&!t.usedDuplicates[s]&&(t.usedDuplicates[s]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,i,a,s,c,u,l="",f=t.tag,p=Object.keys(r);if(!0===t.sortKeys)p.sort();else if("function"==typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new _$exception_9("sortKeys must be a boolean or a function");for(o=0,i=p.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+="?":u+="? "),u+=t.dump,c&&(u+=generateNextLine(t,e)),writeNode(t,e+1,s,!0,c)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?u+=":":u+=": ",l+=u+=t.dump));t.tag=f,t.dump=l||"{}"}(t,e,t.dump,o),c&&(t.dump="&ref_"+s+t.dump)):(function(t,e,r){var n,o,i,a,s,c="",u=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,a,!1,!1)&&(c+=s+=t.dump));t.tag=u,t.dump="{"+c+"}"}(t,e,t.dump),c&&(t.dump="&ref_"+s+" "+t.dump));else if("[object Array]"===a){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,i,a="",s=t.tag;for(o=0,i=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],i=[];for(function t(e,r,n){var o,i,a;if(null!==e&&"object"==typeof e)if(-1!==(i=r.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,a=e.length;i0?o-4:o;for(r=0;r>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===i&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,a[s++]=255&e),1===i&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,a=r-n;ia?a:i+16383));return 1===n?(e=t[r-1],o.push(lookup[e>>2]+lookup[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),o.join("")}},lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",__i_1=0,len=code.length;__i_10)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function encodeChunk(t,e,r){for(var n,o,i=[],a=e;a>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return i.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,l=-7,f=r?o-1:0,p=r?-1:1,_=t[e+f];for(f+=p,i=_&(1<<-l)-1,_>>=-l,l+=s;l>0;i=256*i+t[e+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(_?-1:1);a+=Math.pow(2,n),i-=u}return(_?-1:1)*a*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var a,s,c,u=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:i-1,h=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*c-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+_]=255&s,_+=h,s/=256,o-=8);for(a=a<0;t[r+_]=255&a,_+=h,a/=256,u-=8);t[r+_-h]|=128*d}},_$base64_4={exports:{}};(function(t,e){(function(){!function(t,e){var r,n;"object"==typeof _$base64_4.exports?_$base64_4.exports=e():"function"==typeof define&&define.amd?define(e):(r=t.Base64,(n=e()).noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:this,(function(){"use strict";var t,r="function"==typeof atob,n="function"==typeof btoa,o="function"==typeof e,i="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),c=(t={},s.forEach((function(e,r){return t[e]=r})),t),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),f="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t,e){return void 0===e&&(e=function(t){return t}),new Uint8Array(Array.prototype.slice.call(t,0).map(e))},p=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,i="",a=t.length%3,c=0;c255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");i+=s[(e=r<<16|n<<8|o)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return a?i.slice(0,a-3)+"===".substring(a):i},d=n?function(t){return btoa(t)}:o?function(t){return e.from(t,"binary").toString("base64")}:h,y=o?function(t){return e.from(t).toString("base64")}:function(t){for(var e=[],r=0,n=t.length;r>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,w=function(t){return t.replace(g,v)},b=o?function(t){return e.from(t,"utf8").toString("base64")}:a?function(t){return y(a.encode(t))}:function(t){return d(w(t))},E=function(t,e){return void 0===e&&(e=!1),e?p(b(t)):b(t)},S=function(t){return E(t,!0)},O=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,A=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return l(55296+(e>>>10))+l(56320+(1023&e));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},x=function(t){return t.replace(O,A)},L=function(t){if(t=t.replace(/\s+/g,""),!u.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",i=0;i>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},T=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:L,R=o?function(t){return f(e.from(t,"base64"))}:function(t){return f(T(t),(function(t){return t.charCodeAt(0)}))},C=function(t){return R(P(t))},k=o?function(t){return e.from(t,"base64").toString("utf8")}:i?function(t){return i.decode(R(t))}:function(t){return x(T(t))},P=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},I=function(t){return k(P(t))},N=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},j=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,N(e))};t("fromBase64",(function(){return I(this)})),t("toBase64",(function(t){return E(this,t)})),t("toBase64URI",(function(){return E(this,!0)})),t("toBase64URL",(function(){return E(this,!0)})),t("toUint8Array",(function(){return C(this)}))},$=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,N(e))};t("toBase64",(function(t){return m(this,t)})),t("toBase64URI",(function(){return m(this,!0)})),t("toBase64URL",(function(){return m(this,!0)}))},F={version:"3.7.2",VERSION:"3.7.2",atob:T,atobPolyfill:L,btoa:d,btoaPolyfill:h,fromBase64:I,toBase64:E,encode:E,encodeURI:S,encodeURL:S,utob:w,btou:x,decode:I,isValid:function(t){if("string"!=typeof t)return!1;var e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:m,toUint8Array:C,extendString:j,extendUint8Array:$,extendBuiltins:function(){j(),$()},Base64:{}};return Object.keys(F).forEach((function(t){return F.Base64[t]=F[t]})),F}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},_$buffer_2({}).Buffer),_$base64_4=_$base64_4.exports;var _$logical_51={};function ___arrayLikeToArray_51(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_47(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}Object.defineProperty(_$download_47,"__esModule",{value:!0}),_$download_47.default=function(t,e){return _download.apply(this,arguments)};var cache=new Map;function _download(){var t;return t=___regeneratorRuntime_47().mark((function t(e,r){var n,o,i;return ___regeneratorRuntime_47().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)")+e,!cache.has(n)){t.next=4;break}return t.abrupt("return",cache.get(n));case 4:return o=(0,_$openApi_53.HTTP)({headers:{"User-Agent":r}}),i=new Promise((function(t,r){o.get(e).then((function(e){var n=e.body;0===n.replace(/\s/g,"").length?r(new Error("\u8ba2\u9605\u5185\u5bb9\u4e3a\u7a7a\uff01")):t(n)}))})),cache.set(n,i),t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_47(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_47(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}var _$geo_48={};Object.defineProperty(_$geo_48,"__esModule",{value:!0}),_$geo_48.getFlag=function(t){for(var e={"\ud83c\udde6\ud83c\uddff":["\u963f\u585e\u62dc\u7586"],"\ud83c\udde6\ud83c\uddf9":["\u5965\u5730\u5229","\u5967\u5730\u5229","Austria","\u7ef4\u4e5f\u7eb3"],"\ud83c\udde6\ud83c\uddfa":["AU","Australia","Sydney","\u6fb3\u5927\u5229\u4e9a","\u6fb3\u6d32","\u58a8\u5c14\u672c","\u6089\u5c3c","\u571f\u6fb3","\u4eac\u6fb3","\u5ee3\u6fb3","\u6eec\u6fb3","\u6caa\u6fb3","\u5e7f\u6fb3"],"\ud83c\udde7\ud83c\uddea":["BE","\u6bd4\u5229\u6642","\u6bd4\u5229\u65f6"],"\ud83c\udde7\ud83c\uddec":["\u4fdd\u52a0\u5229\u4e9a","\u4fdd\u52a0\u5229\u4e9e","Bulgaria"],"\ud83c\udde7\ud83c\udded":["BH","\u5df4\u6797"],"\ud83c\udde7\ud83c\udde9":["BD","\u5b5f\u52a0\u62c9"],"\ud83c\uddf5\ud83c\uddf0":["\u5df4\u57fa\u65af\u5766"],"\ud83c\uddf0\ud83c\udded":["\u67ec\u57d4\u5be8"],"\ud83c\uddfa\ud83c\udde6":["\u70cf\u514b\u862d","\u4e4c\u514b\u5170"],"\ud83c\udded\ud83c\uddf7":["\u514b\u7f57\u5730\u4e9a","HR","\u514b\u7f85\u5730\u4e9e"],"\ud83c\udde8\ud83c\udde6":["Canada","CANADA","CAN","Waterloo","\u52a0\u62ff\u5927","\u8499\u7279\u5229\u5c14","\u6e29\u54e5\u534e","\u6953\u8449","\u67ab\u53f6","\u6ed1\u94c1\u5362","\u591a\u4f26\u591a","CA"],"\ud83c\udde8\ud83c\udded":["\u745e\u58eb","\u82cf\u9ece\u4e16","Switzerland","Zurich"],"\ud83c\uddf3\ud83c\uddec":["\u5c3c\u65e5\u5229\u4e9a","NG","\u5c3c\u65e5\u5229\u4e9e"],"\ud83c\udde8\ud83c\uddff":["Czechia","\u6377\u514b"],"\ud83c\uddf8\ud83c\uddf0":["\u65af\u6d1b\u4f10\u514b","SK"],"\ud83c\uddf7\ud83c\uddf8":["RS","\u585e\u5c14\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\udde9":["\u6469\u723e\u591a\u74e6","MD","\u6469\u5c14\u591a\u74e6"],"\ud83c\udde9\ud83c\uddea":["DE","German","GERMAN","\u5fb7\u56fd","\u5fb7\u570b","\u6cd5\u5170\u514b\u798f","\u4eac\u5fb7","\u6eec\u5fb7","\u5ee3\u5fb7","\u6caa\u5fb7","\u5e7f\u5fb7","Frankfurt"],"\ud83c\udde9\ud83c\uddf0":["DK","DNK","\u4e39\u9ea6","\u4e39\u9ea5"],"\ud83c\uddea\ud83c\uddf8":["ES","\u897f\u73ed\u7259","Spain"],"\ud83c\uddea\ud83c\uddfa":["EU","\u6b27\u76df","\u6b27\u7f57\u5df4"],"\ud83c\uddeb\ud83c\uddee":["Finland","\u82ac\u5170","\u82ac\u862d","\u8d6b\u5c14\u8f9b\u57fa"],"\ud83c\uddeb\ud83c\uddf7":["FR","France","\u6cd5\u56fd","\u6cd5\u570b","\u5df4\u9ece"],"\ud83c\uddec\ud83c\udde7":["UK","GB","England","United Kingdom","\u82f1\u56fd","\u4f26\u6566","\u82f1","London"],"\ud83c\uddf2\ud83c\uddf4":["MO","Macao","\u6fb3\u95e8","\u6fb3\u9580","CTM"],"\ud83c\uddf0\ud83c\uddff":["\u54c8\u8428\u514b\u65af\u5766","\u54c8\u8428\u514b"],"\ud83c\udded\ud83c\uddfa":["\u5308\u7259\u5229","Hungary"],"\ud83c\udded\ud83c\uddf0":["HK","Hongkong","Hong Kong","HongKong","HONG KONG","\u9999\u6e2f","\u6df1\u6e2f","\u6caa\u6e2f","\u547c\u6e2f","HKT","HKBN","HGC","WTT","CMI","\u7a57\u6e2f","\u4eac\u6e2f","\u6e2f"],"\ud83c\uddee\ud83c\udde9":["Indonesia","\u5370\u5c3c","\u5370\u5ea6\u5c3c\u897f\u4e9a","\u96c5\u52a0\u8fbe"],"\ud83c\uddee\ud83c\uddea":["Ireland","IRELAND","\u7231\u5c14\u5170","\u611b\u723e\u862d","\u90fd\u67cf\u6797"],"\ud83c\uddee\ud83c\uddf1":["Israel","\u4ee5\u8272\u5217"],"\ud83c\uddee\ud83c\uddf3":["India","IND","INDIA","\u5370\u5ea6","\u5b5f\u4e70","MFumbai"],"\ud83c\uddee\ud83c\uddf8":["IS","ISL","\u51b0\u5c9b","\u51b0\u5cf6"],"\ud83c\uddf0\ud83c\uddf5":["KP","\u671d\u9c9c"],"\ud83c\uddf0\ud83c\uddf7":["KR","Korea","KOR","\u97e9\u56fd","\u9996\u5c14","\u97e9","\u97d3","\u6625\u5ddd","Chuncheon","Seoul"],"\ud83c\uddf1\ud83c\uddfa":["\u5362\u68ee\u5821"],"\ud83c\uddf1\ud83c\uddfb":["Latvia","Latvija","\u62c9\u8131\u7ef4\u4e9a"],"\ud83c\uddf2\ud83c\uddfd":["MEX","MX","\u58a8\u897f\u54e5"],"\ud83c\uddf2\ud83c\uddfe":["MY","Malaysia","MALAYSIA","\u9a6c\u6765\u897f\u4e9a","\u5927\u99ac","\u99ac\u4f86\u897f\u4e9e","\u5409\u9686\u5761"],"\ud83c\uddf3\ud83c\uddf1":["NL","Netherlands","\u8377\u5170","\u8377\u862d","\u5c3c\u5fb7\u862d","\u963f\u59c6\u65af\u7279\u4e39"],"\ud83c\uddf3\ud83c\uddf5":["\u5c3c\u6cca\u5c14"],"\ud83c\uddf5\ud83c\udded":["PH","Philippines","\u83f2\u5f8b\u5bbe","\u83f2\u5f8b\u8cd3"],"\ud83c\uddf5\ud83c\uddf7":["PR","\u6ce2\u591a\u9ece\u5404"],"\ud83c\uddf7\ud83c\uddf4":["RO","\u7f57\u9a6c\u5c3c\u4e9a"],"\ud83c\uddf7\ud83c\uddfa":["RU","Russia","\u4fc4\u7f57\u65af","\u4fc4\u56fd","\u4fc4\u7f85\u65af","\u4f2f\u529b","\u83ab\u65af\u79d1","\u5723\u5f7c\u5f97\u5821","\u897f\u4f2f\u5229\u4e9a","\u65b0\u897f\u4f2f\u5229\u4e9a","\u4eac\u4fc4","\u676d\u4fc4","\u5ee3\u4fc4","\u6eec\u4fc4","\u5e7f\u4fc4","\u6caa\u4fc4","Moscow"],"\ud83c\uddf8\ud83c\udde6":["\u6c99\u7279"],"\ud83c\uddf8\ud83c\uddea":["SE","Sweden","\u745e\u5178"],"\ud83c\uddf2\ud83c\uddf9":["\u9a6c\u8033\u4ed6"],"\ud83c\uddf2\ud83c\udde6":["MA","\u6469\u6d1b\u54e5"],"\ud83c\uddf8\ud83c\uddec":["SG","Singapore","SINGAPORE","\u65b0\u52a0\u5761","\u72ee\u57ce","\u6caa\u65b0","\u4eac\u65b0","\u6cc9\u65b0","\u7a57\u65b0","\u6df1\u65b0","\u676d\u65b0","\u5e7f\u65b0","\u5ee3\u65b0","\u6eec\u65b0"],"\ud83c\uddf9\ud83c\udded":["TH","Thailand","\u6cf0\u56fd","\u6cf0\u570b","\u66fc\u8c37"],"\ud83c\uddf9\ud83c\uddf7":["TR","Turkey","\u571f\u8033\u5176","\u4f0a\u65af\u5766\u5e03\u5c14"],"\ud83c\uddf9\ud83c\uddfc":["TW","Taiwan","TAIWAN","\u53f0\u6e7e","\u53f0\u5317","\u53f0\u4e2d","\u65b0\u5317","\u5f70\u5316","CHT","\u53f0","HINET","Taipei"],"\ud83c\uddfa\ud83c\uddf8":["US","USA","America","United States","\u7f8e\u56fd","\u7f8e","\u4eac\u7f8e","\u6ce2\u7279\u5170","\u8fbe\u62c9\u65af","\u4fc4\u52d2\u5188","\u51e4\u51f0\u57ce","\u8d39\u5229\u8499","\u7845\u8c37","\u77fd\u8c37","\u62c9\u65af\u7ef4\u52a0\u65af","\u6d1b\u6749\u77f6","\u5723\u4f55\u585e","\u5723\u514b\u62c9\u62c9","\u897f\u96c5\u56fe","\u829d\u52a0\u54e5","\u6caa\u7f8e","\u54e5\u4f26\u5e03","\u7ebd\u7ea6","Los Angeles","San Jose","Sillicon Valley","Michigan"],"\ud83c\uddfb\ud83c\uddf3":["VN","\u8d8a\u5357","\u80e1\u5fd7\u660e\u5e02"],"\ud83c\uddfb\ud83c\uddea":["VE","\u59d4\u5185\u745e\u62c9"],"\ud83c\uddee\ud83c\uddf9":["Italy","IT","Nachash","\u610f\u5927\u5229","\u7c73\u5170","\u7fa9\u5927\u5229"],"\ud83c\uddff\ud83c\udde6":["South Africa","\u5357\u975e"],"\ud83c\udde6\ud83c\uddea":["United Arab Emirates","\u963f\u8054\u914b","\u8fea\u62dc","AE"],"\ud83c\udde7\ud83c\uddf7":["BR","Brazil","\u5df4\u897f","\u5723\u4fdd\u7f57"],"\ud83c\uddef\ud83c\uddf5":["JP","Japan","JAPAN","\u65e5\u672c","\u4e1c\u4eac","\u5927\u962a","\u57fc\u7389","\u6caa\u65e5","\u7a57\u65e5","\u5ddd\u65e5","\u4e2d\u65e5","\u6cc9\u65e5","\u676d\u65e5","\u6df1\u65e5","\u8fbd\u65e5","\u5e7f\u65e5","\u5927\u5742","Osaka","Tokyo"],"\ud83c\udde6\ud83c\uddf7":["AR","\u963f\u6839\u5ef7"],"\ud83c\uddf3\ud83c\uddf4":["Norway","\u632a\u5a01","NO"],"\ud83c\udde8\ud83c\uddf3":["CN","China","\u56de\u56fd","\u4e2d\u56fd","\u4e2d\u570b","\u6c5f\u82cf","\u5317\u4eac","\u4e0a\u6d77","\u5e7f\u5dde","\u6df1\u5733","\u676d\u5dde","\u5f90\u5dde","\u9752\u5c9b","\u5b81\u6ce2","\u9547\u6c5f","back"],"\ud83c\uddf5\ud83c\uddf1":["PL","POL","\u6ce2\u5170","\u6ce2\u862d"],"\ud83c\udde8\ud83c\uddf1":["\u667a\u5229"],"\ud83c\uddf3\ud83c\uddff":["\u65b0\u897f\u862d","\u65b0\u897f\u5170"],"\ud83c\uddec\ud83c\uddf7":["\u5e0c\u814a","\u5e0c\u81d8"],"\ud83c\uddea\ud83c\uddec":["\u57c3\u53ca"],"\ud83c\udde8\ud83c\uddfe":["CY","\u585e\u6d66\u8def\u65af"],"\ud83c\udde8\ud83c\uddf7":["CR","\u54e5\u65af\u8fbe\u9ece\u52a0"],"\ud83c\uddf8\ud83c\uddee":["SI","\u65af\u6d1b\u6587\u5c3c\u4e9a"],"\ud83c\uddf1\ud83c\uddf9":["LT","\u7acb\u9676\u5b9b"],"\ud83c\uddf5\ud83c\udde6":["PA","\u5df4\u62ff\u9a6c"],"\ud83c\uddf9\ud83c\uddf3":["TN","\u7a81\u5c3c\u65af"],"\ud83c\uddee\ud83c\uddf2":["\u9a6c\u6069\u5c9b","\u99ac\u6069\u5cf6"],"\ud83c\udde7\ud83c\uddfe":["BY","\u767d\u4fc4","\u767d\u4fc4\u7f57\u65af"],"\ud83c\uddf5\ud83c\uddf9":["\u8461\u8404\u7259"],"\ud83c\uddf0\ud83c\uddea":["KE","\u80af\u5c3c\u4e9a"],"\ud83c\uddf0\ud83c\uddec":["KG","\u5409\u5c14\u5409\u65af\u5766"],"\ud83c\uddef\ud83c\uddf4":["JO","\u7ea6\u65e6"],"\ud83c\uddfa\ud83c\uddfe":["UY","\u4e4c\u62c9\u572d"],"\ud83c\uddf2\ud83c\uddf3":["\u8499\u53e4"],"\ud83c\uddee\ud83c\uddf7":["IR","\u4f0a\u6717"],"\ud83c\uddf5\ud83c\uddea":["\u79d8\u9c81","\u7955\u9b6f"],"\ud83c\udde8\ud83c\uddf4":["\u54e5\u4f26\u6bd4\u4e9a"],"\ud83c\uddea\ud83c\uddea":["\u7231\u6c99\u5c3c\u4e9a"],"\ud83c\uddea\ud83c\udde8":["EC","\u5384\u74dc\u591a\u5c14"],"\ud83c\uddf2\ud83c\uddf0":["\u9a6c\u5176\u987f","\u99ac\u5176\u9813"],"\ud83c\udde7\ud83c\udde6":["\u6ce2\u9ed1\u5171\u548c\u56fd","\u6ce2\u9ed1"],"\ud83c\uddec\ud83c\uddea":["\u683c\u9b6f\u5409\u4e9e","\u683c\u9c81\u5409\u4e9a"],"\ud83c\udde6\ud83c\uddf1":["\u963f\u723e\u5df4\u5c3c\u4e9e","\u963f\u5c14\u5df4\u5c3c\u4e9a"],"\ud83c\udff3\ufe0f\u200d\ud83c\udf08":["\u6d41\u91cf","\u65f6\u95f4","\u5e94\u6025","\u8fc7\u671f","Bandwidth","expire"]},r=0,n=Object.keys(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_38(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___asyncToGenerator_38(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_38(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_38(i,n,o,a,s,"throw",t)}a(void 0)}))}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(c){s=!0,o=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function __ownKeys_38(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_38(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_38(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_38(t,e):void 0}}function ___arrayLikeToArray_38(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},(keys=["dm1lc3M","c3NyOi8v","dHJvamFu","c3M6Ly","c3NkOi8v","c2hhZG93","aHR0c"],{name:"Base64 Pre-processor",test:function(t){return keys.some((function(e){return-1!==t.indexOf(e)}))},parse:function(t){return _$base64_4.Base64.decode(t)}}),{name:"Clash Pre-processor",test:function(t){return/proxies/.test(t)},parse:function(t){return(0,_$staticJsYaml_36.safeLoad)(t).proxies.map((function(t){return JSON.stringify(t)})).join("\n")}},{name:"SSD Pre-processor",test:function(t){return 0===t.indexOf("ssd://")},parse:function(t){for(var e=[],r=JSON.parse(_$base64_4.Base64.decode(t.split("ssd://")[1])),n=r.port,o=r.encryption,i=r.password,a=r.servers,s=0;s1){var u,l=___createForOfIteratorHelper_38(t);try{for(l.s();!(u=l.n()).done;){var f=_slicedToArray(u.value.split("="),2),p=f[0],_=f[1];c[p]=_.trim()}}catch(h){l.e(h)}finally{l.f()}}return ___objectSpread_38(___objectSpread_38({},s),{},{name:c.remarks?_$base64_4.Base64.decode(c.remarks):s.server,"protocol-param":_$base64_4.Base64.decode(c.protoparam||"").replace(/\s/g,""),"obfs-param":_$base64_4.Base64.decode(c.obfsparam||"").replace(/\s/g,"")})}}),{name:"URI VMess Parser",test:function(t){return/^vmess:\/\//.test(t)},parse:function(t){t=t.split("vmess://")[1];var e=_$base64_4.Base64.decode(t);if(/=\s*vmess/.test(e)){var r,n=e.split(",").map((function(t){return t.trim()})),o={},i=___createForOfIteratorHelper_38(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(-1!==a.indexOf("=")){var s=_slicedToArray(a.split("="),2),c=s[0],u=s[1];o[c.trim()]=u.trim()}}}catch(h){i.e(h)}finally{i.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:n[3],uuid:n[4].match(/^"(.*)"$/)[1],tls:"over-tls"===o.obfs||"wss"===o.obfs};if(void 0!==o["udp-relay"]&&(l.udp=JSON.parse(o["udp-relay"])),void 0!==o["fast-open"]&&(l.udp=JSON.parse(o["fast-open"])),"ws"===o.obfs||"wss"===o.obfs){l.network="ws",l["ws-opts"].path=(o["obfs-path"]||'"/"').match(/^"(.*)"$/)[1];var f=o["obfs-header"];f&&-1!==f.indexOf("Host")&&(f=f.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),l["ws-opts"].headers={Host:f||l.server}}return l.tls&&"false"===o['"tls-verification"']&&(l["skip-cert-verify"]=!0),l.tls&&o["obfs-host"]&&(l.sni=o["obfs-host"]),l}var p=JSON.parse(e),_={name:p.ps,type:"vmess",server:p.add,port:p.port,cipher:"auto",uuid:p.id,alterId:p.aid||0,tls:"tls"===p.tls||!0===p.tls,supported:{}};return"ws"===p.net&&(_.network="ws",_["ws-opts"]={path:p.path,headers:{Host:p.host||p.add}},_.tls&&p.host&&(_.sni=p.host)),!1===p.verify_cert&&(_["skip-cert-verify"]=!0),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){var e=_slicedToArray((t=t.split("trojan://")[1]).split("@")[1].split("?")[0].split(":"),2),r=e[0],n=e[1],o=decodeURIComponent(t.split("#")[1].trim()),i=t.split("?"),a=null;return i.length>1&&(i=i[1].split("#")[0].split("&"),a=new Map(i.map((function(t){return t.split("=")}))).get("sni")),{name:o||"[Trojan] ".concat(r),type:"trojan",server:r,port:n,password:t.split("@")[0],sni:a,supported:{}}}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){return JSON.parse(t)}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){var e=r(t),n={name:e.name,type:"ss",server:e.server,port:e.port,cipher:e["encrypt-method"],password:e.password,tfo:JSON.parse(e.tfo||"false"),udp:JSON.parse(e["udp-relay"]||"false")};return e.obfs&&(n.plugin="obfs",n["plugin-opts"]={mode:e.obfs,host:e["obfs-host"]}),n}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){var e=r(t),n={name:e.name,type:"vmess",server:e.server,port:e.port,uuid:e.username,alterId:0,cipher:"none",tls:JSON.parse(e.tls||"false"),tfo:JSON.parse(e.tfo||"false")};if(n.tls&&(void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n.sni=e.sni||e.server),JSON.parse(e.ws||"false")){n.network="ws",n["ws-opts"]={path:e["ws-path"]};var o=e["ws-headers"].match(/(,|^|\s)*HOST:\s*(.*?)(,|$)/),i=o?o[2]:n.server;n["ws-opts"].headers={Host:i||e.server}}return n}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])&&-1!==t.indexOf("sni")},parse:function(t){var e=r(t),n={name:e.name,type:"trojan",server:e.server,port:e.port,password:e.password,sni:e.sni||e.server,tfo:JSON.parse(e.tfo||"false")};return void 0!==e["skip-cert-verify"]&&(n["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),n}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])&&!e().test(t)},parse:function(t){var e=r(t),n=/^.*?=\s?https/.test(t),o={name:e.name,type:"http",server:e.server,port:e.port,tls:JSON.parse(n||"false"),tfo:JSON.parse(e.tfo||"false")};return o.tls&&(void 0!==e["skip-cert-verify"]&&(o["skip-cert-verify"]=!0===e["skip-cert-verify"]||"1"===e["skip-cert-verify"]),o.sni=e.sni||e.server),e.username&&"none"!==e.username&&(o.username=e.username),e.password&&"none"!==e.password&&(o.password=e.password),o}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"ss",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,"")};return e.length>5&&(r.plugin="obfs",r["plugin-opts"]={mode:e[5],host:e[6]}),r}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){var e=t.split("=")[1].split(",");return{name:t.split("=")[0].trim(),type:"ssr",server:e[1],port:e[2],cipher:e[3],password:e[4].replace(/"/g,""),protocol:e[5],"protocol-param":e[6].match(/{(.*)}/)[1],supported:{Surge:!1},obfs:e[7],"obfs-param":e[8].match(/{(.*)}/)[1]}}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){var e,r=t.split("=")[1].split(","),n={name:t.split("=")[0].trim(),type:"vmess",server:r[1],port:r[2],cipher:r[3]||"none",uuid:r[4].replace(/"/g,""),alterId:0},o=___createForOfIteratorHelper_38(r=r.splice(5));try{for(o.s();!(e=o.n()).done;){var i=_slicedToArray(e.value.split(":"),2),a=i[0],s=i[1];r[a]=s}}catch(c){o.e(c)}finally{o.f()}switch(n.tls=JSON.parse(r["over-tls"]||"false"),n.tls&&(n.sni=r["tls-name"]||n.server,n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),r.transport){case"tcp":break;case"ws":n.network=r.transport,n["ws-opts"]={path:r.path,headers:{Host:r.host}}}return n.tls&&(n["skip-cert-verify"]=JSON.parse(r["skip-cert-verify"]||"false")),n}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])&&-1===t.indexOf("password")},parse:function(t){var e=t.split("=")[1].split(","),r={name:t.split("=")[0].trim(),type:"trojan",server:e[1],port:e[2],password:e[3].replace(/"/g,""),sni:e[1],"skip-cert-verify":JSON.parse(e["skip-cert-verify"]||"false")};if(e.length>4){var n=_slicedToArray(e[4].split(":"),2),o=n[0],i=n[1];if("tls-name"!==o)throw new Error("Unknown option ".concat(o," for line: \n").concat(t));r.sni=i}return r}},e(),{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ss",server:r.server,port:r.port,cipher:r.method,password:r.password,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{}};if(r.obfs)switch(n["plugin-opts"]={host:r["obfs-host"]||n.server},r.obfs){case"http":case"tls":n.plugin="obfs",n["plugin-opts"].mode=r.obfs;break;case"ws":case"wss":n["plugin-opts"]=___objectSpread_38(___objectSpread_38({},n["plugin-opts"]),{},{mode:"websocket",path:r["obfs-uri"]||"/",tls:"wss"===r.obfs}),n["plugin-opts"].tls&&void 0!==r["tls-verification"]&&(n["plugin-opts"]["skip-cert-verify"]=r["tls-verification"]),n.plugin="v2ray-plugin",n.supported.Surge=!1,n.supported.Loon=!1}return n}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(e){var r=t(e),n={name:r.tag,type:"ssr",server:r.server,port:r.port,cipher:r.method,password:r.password,protocol:r["ssr-protocol"],obfs:"plain","protocol-param":r["ssr-protocol-param"],udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false"),supported:{Surge:!1}};return r.obfs&&(n.obfs=r.obfs,n["obfs-param"]=r["obfs-host"]),n}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"vmess",name:r.tag,server:r.server,port:r.port,cipher:r.method||"none",uuid:r.password,alterId:0,tls:"over-tls"===r.obfs||"wss"===r.obfs,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n.tls&&(n.sni=r["obfs-host"]||r.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),"ws"!==r.obfs&&"wss"!==r.obfs||(n.network="ws",n["ws-opts"]={path:r["obfs-uri"],headers:{Host:r["obfs-host"]||r.server}}),n}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"trojan",name:r.tag,server:r.server,port:r.port,password:r.password,sni:r["tls-host"]||r.server,udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true"),n}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(e){var r=t(e),n={type:"http",name:r.tag,server:r.server,port:r.port,tls:JSON.parse(r["over-tls"]||"false"),udp:JSON.parse(r["udp-relay"]||"false"),tfo:JSON.parse(r["fast-open"]||"false")};return r.username&&"none"!==r.username&&(n.username=r.username),r.password&&"none"!==r.password&&(n.password=r.password),n.tls&&(n.sni=r["tls-host"]||n.server,n["skip-cert-verify"]=!JSON.parse(r["tls-verification"]||"true")),n}}];var n}(),PROXY_PROCESSORS=function(){function SetPropertyOperator(t){var e=t.key,r=t.value;return{name:"Set Property Operator",func:function(t){return t.map((function(t){return t[e]=r,t}))}}}function FlagOperator(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{name:"Flag Operator",func:function(e){return e.map((function(e){if(t){var r=(0,_$geo_48.getFlag)(e.name);e.name=removeFlag(e.name),e.name=r+" "+e.name,e.name=e.name.replace(/\ud83c\uddf9\ud83c\uddfc/g,"\ud83c\udde8\ud83c\uddf3")}else e.name=removeFlag(e.name);return e}))}}}function HandleDuplicateOperator(t){var e=___objectSpread_38(___objectSpread_38({},{action:"rename",template:"0 1 2 3 4 5 6 7 8 9",link:"-",position:"back"}),t),r=e.action,n=e.template,o=e.link,i=e.position;return{name:"Handle Duplicate Operator",func:function(t){if("delete"===r){var e={};return t.filter((function(t){return!e[t.name]&&(e[t.name]=!0,!0)}))}if("rename"===r){var a=n.split(" "),s={},c=0;t.forEach((function(t){void 0===s[t.name]?s[t.name]=1:s[t.name]++,c=Math.max(s[t.name].toString().length,c)}));var u={};return t.map((function(t){if(s[t.name]>1){void 0===u[t.name]&&(u[t.name]=1);for(var e="",r=u[t.name]++,n=0;r>0;)e=a[r%10]+e,r=parseInt(r/10),n++;for(;n++0&&void 0!==arguments[0]?arguments[0]:"asc";return{name:"Sort Operator",func:function(e){switch(t){case"asc":case"desc":return e.sort((function(e,r){return(e.name>r.name?1:-1)*("desc"===t?-1:1)}));case"random":return shuffle(e);default:throw new Error("Unknown sort option: "+t)}}}}function RegexSortOperator(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return buildRegex(t)})),e.sort((function(e,r){var n=getRegexOrder(t,e.name),o=getRegexOrder(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1?e-1:0),n=1;n1&&void 0!==w[1]?w[1]:[],n=w.length>2?w[2]:void 0,o=___createForOfIteratorHelper_38(r),t.prev=3,o.s();case 5:if((i=o.n()).done){t.next=38;break}if(a=i.value,s=void 0,c={},-1===a.type.indexOf("Script")){t.next=29;break}if(u=a.args,l=u.mode,f=u.content,"link"!==l){t.next=28;break}if((_=(p=f).split("#")).length>1){h=___createForOfIteratorHelper_38(_[1].split("&"));try{for(h.s();!(d=h.n()).done;)y=d.value,m=y.split("=")[0],v=y.split("=")[1]||!0,c[m]=v}catch(b){h.e(b)}finally{h.f()}}return t.prev=15,t.next=18,(0,___download_38.default)(p.split("#")[0]);case 18:s=t.sent,_app.default.info("Script loaded: >>>\n ".concat(s)),t.next=26;break;case 22:return t.prev=22,t.t0=t.catch(15),_app.default.error("Error when downloading remote script: ".concat(a.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",36);case 26:t.next=29;break;case 28:s=f;case 29:if(PROXY_PROCESSORS[a.type]){t.next=32;break}return _app.default.error('Unknown operator: "'.concat(a.type,'"')),t.abrupt("continue",36);case 32:_app.default.info('Applying "'.concat(a.type,'" with arguments:\n >>> ').concat(JSON.stringify(a.args,null,2)||"None")),g=void 0,g=-1!==a.type.indexOf("Script")?PROXY_PROCESSORS[a.type](s,n,c):PROXY_PROCESSORS[a.type](a.args),e=ApplyProcessor(g,e);case 36:t.next=5;break;case 38:t.next=43;break;case 40:t.prev=40,t.t1=t.catch(3),o.e(t.t1);case 43:return t.prev=43,o.f(),t.finish(43);case 46:return t.abrupt("return",e);case 47:case"end":return t.stop()}}),t,null,[[3,40,43,46],[15,22]])})))).apply(this,arguments)}return{parse:function(e){e=function(t){var e,r=___createForOfIteratorHelper_38(PROXY_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return _app.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){_app.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(e);var r,n,o=[],i=___createForOfIteratorHelper_38(e.split("\n"));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(0!==(a=a.trim()).length){var s=r&&t(r,a);if(!s){var c,u=___createForOfIteratorHelper_38(PROXY_PARSERS);try{for(u.s();!(c=u.n()).done;){var l=c.value;if(t(l,a)){r=l,s=!0,_app.default.info("Proxy parser: ".concat(l.name," is activated"));break}}}catch(p){u.e(p)}finally{u.f()}}if(s)try{var f=r.parse(a);f||_app.default.error("Parser ".concat(r.name," return nothing for \n").concat(a,"\n")),o.push(f)}catch(p){_app.default.error("Failed to parse line: \n ".concat(a,"\n Reason: ").concat(p.stack))}else _app.default.error("Failed to find a rule to parse line: \n".concat(a,"\n"))}}}catch(p){i.e(p)}finally{i.f()}return o},process:function(t){return e.apply(this,arguments)},produce:function(t,e){var r=PROXY_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return t=t.filter((function(t){return!(t.supported&&!1===t.supported[e])})),_app.default.info("Producing proxies for target: ".concat(e)),void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.produce(t)}catch(e){return _app.default.error("Cannot produce proxy: ".concat(JSON.stringify(t,null,2),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.produce(t):void 0}}}(),keys;function ApplyProcessor(t,e){return-1!==t.name.indexOf("Filter")?function(t,e){var r=(0,_$logical_51.FULL)(e.length,!0);try{r=(0,_$logical_51.AND)(r,t.func(e))}catch(n){console.log("Cannot apply filter ".concat(t.name,"\n Reason: ").concat(n))}return e.filter((function(t,e){return r[e]}))}(t,e):-1!==t.name.indexOf("Operator")?function(t,e){var r=clone(e);try{var n=t.func(r);n&&(r=n)}catch(o){console.log("Cannot apply operator ".concat(t.name,"! Reason: ").concat(o))}return r}(t,e):void 0}function shuffle(t){for(var e,r,n=t.length;0!==n;)r=Math.floor(Math.random()*n),e=t[n-=1],t[n]=t[r],t[r]=e;return t}function clone(t){return JSON.parse(JSON.stringify(t))}function removeFlag(t){return t.replace(/[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/g,"").trim()}_$proxyUtils_38.ProxyUtils=ProxyUtils;var _$ruleUtils_39={};function ___typeof_39(t){return(___typeof_39="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(_$ruleUtils_39,"__esModule",{value:!0}),_$ruleUtils_39.RuleUtils=void 0;var ___staticJsYaml_39=___interopRequireDefault_39(_$staticJsYaml_36),___app_39=___interopRequireDefault_39(_$app_37);function ___interopRequireDefault_39(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_39(){___regeneratorRuntime_39=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(x){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(x){return{type:"throw",arg:x}}}t.wrap=c;var l={};function f(){}function p(){}function _(){}var h={};s(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=f.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==___typeof_39(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_39(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___createForOfIteratorHelper_39(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_39(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_39(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ___arrayLikeToArray_39(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r/.test(t)},parse:function(){return""}},{name:"Clash Provider",test:function(t){return 0===t.indexOf("payload:")},parse:function(t){return t.replace("payload:","").replace(/^\s*-\s*/gm,"")}}],RULE_PARSERS=[{name:"Universal Rule Parser",test:function(){return!0},parse:function(t){var e,r=[],n=___createForOfIteratorHelper_39(t.split("\n"));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(0!==(o=o.trim()).length&&!/\s*#/.test(o))try{var i,a=o.split(",").map((function(t){return t.trim()})),s=a[0],c=!1,u=___createForOfIteratorHelper_39(RULE_TYPES_MAPPING);try{for(u.s();!(i=u.n()).done;){var l=i.value;if(l[0].test(s)){c=!0;var f={type:l[1],content:a[1]};"IP-CIDR"!==f.type&&"IP-CIDR6"!==f.type||(f.options=a.slice(2)),r.push(f)}}}catch(p){u.e(p)}finally{u.f()}if(!c)throw new Error("Invalid rule type: "+s)}catch(_){console.error("Failed to parse line: ".concat(o,"\n Reason: ").concat(_))}}}catch(p){n.e(p)}finally{n.f()}return r}}],RULE_PROCESSORS={"Regex Filter":function(t){var e=t.regex,r=void 0===e?[]:e,n=t.keep,o=void 0===n||n;return{name:"Regex Filter",func:function(t){return t.map((function(t){var e=r.some((function(e){return(e=new RegExp(e)).test(t)}));return o?e:!e}))}}},"Remove Duplicate Filter":function(){return{name:"Remove Duplicate Filter",func:function(t){var e=new Set,r=[];return t.forEach((function(t){var n=t.options||[];n.sort();var o="".concat(t.type,",").concat(t.content,",").concat(JSON.stringify(n));e.has(o)||(r.push(t),e.add(o))})),r}}},"Type Filter":function(t){return{name:"Type Filter",func:function(e){return e.map((function(e){return t.some((function(t){return e.type===t}))}))}}},"Regex Replace Operator":function(t){return{name:"Regex Rename Operator",func:function(e){return e.map((function(e){var r,n=___createForOfIteratorHelper_39(t);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=o.expr,a=o.now;e.content=e.content.replace(new RegExp(i,"g"),a).trim()}}catch(s){n.e(s)}finally{n.f()}return e}))}}}},RULE_PRODUCERS={QX:{type:"SINGLE",func:function(t){return-1!==["URL-REGEX","DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:"".concat({"DOMAIN-KEYWORD":"HOST-KEYWORD","DOMAIN-SUFFIX":"HOST-SUFFIX",DOMAIN:"HOST","IP-CIDR6":"IP6-CIDR"}[t.type]||t.type,",").concat(t.content,",SUB-STORE")}},Surge:{type:"SINGLE",func:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}},Loon:{type:"SINGLE",func:function(t){return-1!==["DEST-PORT","SRC-IP","IN-PORT","PROTOCOL"].indexOf(t.type)?null:function(t){var e="".concat(t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(e+=t.options?",".concat(t.options[0]):""),e}(t)}},Clash:{type:"ALL",func:function(t){var e={"DEST-PORT":"DST-PORT","SRC-IP":"SRC-IP-CIDR","IN-PORT":"SRC-PORT"},r={payload:t.map((function(t){var r="".concat(e[t.type]||t.type,",").concat(t.content);return"IP-CIDR"!==t.type&&"IP-CIDR6"!==t.type||(r+=t.options?",".concat(t.options[0]):""),r}))};return ___staticJsYaml_39.default.dump(r)}}},RuleUtils=function(){function t(){var e;return e=___regeneratorRuntime_39().mark((function t(e,r){var n,o,i,a;return ___regeneratorRuntime_39().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=___createForOfIteratorHelper_39(r),t.prev=1,n.s();case 3:if((o=n.n()).done){t.next=13;break}if(i=o.value,RULE_PROCESSORS[i.type]){t.next=8;break}return console.error("Unknown operator: ".concat(i.type,"!")),t.abrupt("continue",11);case 8:a=RULE_PROCESSORS[i.type](i.args),___app_39.default.info('Applying "'.concat(i.type,'" with arguments: \n >>> ').concat(JSON.stringify(i.args)||"None")),e=(0,_$proxyUtils_38.ApplyProcessor)(a,e);case 11:t.next=3;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),n.e(t.t0);case 18:return t.prev=18,n.f(),t.finish(18);case 21:return t.abrupt("return",e);case 22:case"end":return t.stop()}}),t,null,[[1,15,18,21]])})),(t=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){__asyncGeneratorStep_39(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_39(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}return{parse:function(t){t=function(t){var e,r=___createForOfIteratorHelper_39(RULE_PREPROCESSORS);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return ___app_39.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){___app_39.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(i){r.e(i)}finally{r.f()}return t}(t);var e,r=___createForOfIteratorHelper_39(RULE_PARSERS);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=void 0;try{o=n.test(t)}catch(i){o=!1}if(o)return ___app_39.default.info("Rule parser [".concat(n.name,"] is activated!")),n.parse(t)}}catch(i){r.e(i)}finally{r.f()}},process:function(e,r){return t.apply(this,arguments)},produce:function(t,e){var r=RULE_PRODUCERS[e];if(!r)throw new Error("Target platform: ".concat(e," is not supported!"));return void 0===r.type||"SINGLE"===r.type?t.map((function(t){try{return r.func(t)}catch(e){return console.log("ERROR: cannot produce rule: ".concat(JSON.stringify(t),"\nReason: ").concat(e)),""}})).filter((function(t){return t.length>0})).join("\n"):"ALL"===r.type?r.func(t):void 0}}}();_$ruleUtils_39.RuleUtils=RuleUtils;var _$artifacts_41={};function ___typeof_41(t){return(___typeof_41="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(_$artifacts_41,"__esModule",{value:!0}),_$artifacts_41.default=function(t){___app_41.default.read(_$constants_43.ARTIFACTS_KEY)||___app_41.default.write({},_$constants_43.ARTIFACTS_KEY),t.route("/api/artifacts").get(getAllArtifacts).post(createArtifact),t.route("/api/artifact/:name").get(getArtifact).patch(updateArtifact).delete(deleteArtifact),t.get("/api/cron/sync-artifacts",cronSyncArtifacts)},_$artifacts_41.produceArtifact=produceArtifact;var ___download_41=___interopRequireDefault_41(_$download_47),_gist=___interopRequireDefault_41(_$gist_49),___app_41=___interopRequireDefault_41(_$app_37);function ___interopRequireDefault_41(t){return t&&t.__esModule?t:{default:t}}function ___createForOfIteratorHelper_41(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_41(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?___arrayLikeToArray_41(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ___arrayLikeToArray_41(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_41(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_41(t){for(var e=1;e>>")),console.log(JSON.stringify(a,null,2)),t.prev=25,t.next=28,syncArtifact(___defineProperty_41({},a.name,{content:c}));case 28:u=t.sent,a.updated=(new Date).getTime(),l=JSON.parse(u.body),a.url=l.files[a.name].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_41.default.write(i,_$constants_43.ARTIFACTS_KEY),r.json({status:"success"}),t.next=39;break;case 36:t.prev=36,t.t1=t.catch(25),r.status(500).json({status:"failed",message:t.t1});case 39:t.next=42;break;case 41:r.json({status:"success",data:a});case 42:t.next=45;break;case 44:r.status(404).json({status:"failed",message:"\u672a\u627e\u5230\u5bf9\u5e94\u7684\u914d\u7f6e\uff01"});case 45:case"end":return t.stop()}}),t,null,[[25,36]])})))).apply(this,arguments)}function createArtifact(t,e){var r=t.body;___app_41.default.info("\u6b63\u5728\u521b\u5efa\u8fdc\u7a0b\u914d\u7f6e\uff1a".concat(r.name));var n=___app_41.default.read(_$constants_43.ARTIFACTS_KEY);n[r.name]?e.status(500).json({status:"failed",message:"\u8fdc\u7a0b\u914d\u7f6e".concat(r.name,"\u5df2\u5b58\u5728\uff01")}):/^[\w-_.]*$/.test(r.name)?(n[r.name]=r,___app_41.default.write(n,_$constants_43.ARTIFACTS_KEY),e.status(201).json({status:"success",data:r})):e.status(500).json({status:"failed",message:"\u8fdc\u7a0b\u914d\u7f6e\u540d\u79f0 ".concat(r.name," \u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01\u540d\u79f0\u4e2d\u53ea\u80fd\u5305\u542b\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u6a2a\u6760\u3002")})}function updateArtifact(t,e){var r=___app_41.default.read(_$constants_43.ARTIFACTS_KEY),n=t.params.name,o=r[n];if(o){___app_41.default.info("\u6b63\u5728\u66f4\u65b0\u8fdc\u7a0b\u914d\u7f6e\uff1a".concat(o.name));var i=t.body;if(void 0===i.name||/^[\w-_.]*$/.test(i.name)){var a=___objectSpread_41(___objectSpread_41({},o),i);r[a.name]=a,a.name!==n&&delete r[n],___app_41.default.write(r,_$constants_43.ARTIFACTS_KEY),e.json({status:"success",data:a})}else e.status(500).json({status:"failed",message:"\u8fdc\u7a0b\u914d\u7f6e\u540d\u79f0 ".concat(i.name," \u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01\u540d\u79f0\u4e2d\u53ea\u80fd\u5305\u542b\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u6a2a\u6760\u3002")})}else e.status(404).json({status:"failed",message:"\u672a\u627e\u5230\u5bf9\u5e94\u7684\u8fdc\u7a0b\u914d\u7f6e\uff01"})}function cronSyncArtifacts(t,e){return _cronSyncArtifacts.apply(this,arguments)}function _cronSyncArtifacts(){return(_cronSyncArtifacts=___asyncToGenerator_41(___regeneratorRuntime_41().mark((function t(e,r){var n,o,i,a,s,c,u;return ___regeneratorRuntime_41().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ___app_41.default.info("\u5f00\u59cb\u540c\u6b65\u6240\u6709\u8fdc\u7a0b\u914d\u7f6e..."),n=___app_41.default.read(_$constants_43.ARTIFACTS_KEY),o={},t.prev=3,t.next=6,Promise.all(Object.values(n).map(function(){var t=___asyncToGenerator_41(___regeneratorRuntime_41().mark((function t(e){var r,n;return ___regeneratorRuntime_41().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sync){t.next=15;break}___app_41.default.info("\u6b63\u5728\u540c\u6b65\u4e91\u914d\u7f6e\uff1a".concat(e.name,"...")),t.t0=e.type,t.next="subscription"===t.t0?5:"collection"===t.t0?7:"rule"===t.t0?9:11;break;case 5:return r=___app_41.default.read(_$constants_43.SUBS_KEY)[e.source],t.abrupt("break",11);case 7:return r=___app_41.default.read(_$constants_43.COLLECTIONS_KEY)[e.source],t.abrupt("break",11);case 9:return r=___app_41.default.read(_$constants_43.RULES_KEY)[e.source],t.abrupt("break",11);case 11:return t.next=13,produceArtifact({type:e.type,item:r,platform:e.platform});case 13:n=t.sent,o[e.name]={content:n};case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return t.next=8,syncArtifact(o);case 8:for(i=t.sent,a=JSON.parse(i.body),s=0,c=Object.values(n);s=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_46(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_46(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_42(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_42(t){for(var e=1;e0)){t.next=15;break}if("local"===(f=u[l[0]]).source){t.next=15;break}return t.next=13,(0,_$subscriptions_46.getFlowHeaders)(f.url);case 13:(p=t.sent)&&r.set("subscription-userinfo",p);case 15:if(!c){t.next=29;break}return t.prev=16,t.next=19,(0,_$artifacts_41.produceArtifact)({type:"collection",item:c,platform:a,noProcessor:i});case 19:_=t.sent,"JSON"===a?r.set("Content-Type","application/json;charset=utf-8").send(_):r.send(_),t.next=27;break;case 23:t.prev=23,t.t0=t.catch(16),___app_42.default.notify("\ud83c\udf0d \u300e \ud835\udc7a\ud835\udc96\ud835\udc83-\ud835\udc7a\ud835\udc95\ud835\udc90\ud835\udc93\ud835\udc86 \u300f \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u9519\u8bef\uff1a".concat(n,"\uff01"),"\ud83e\udd14 \u539f\u56e0\uff1a".concat(t.t0)),r.status(500).json({status:"failed",message:t.t0});case 27:t.next=31;break;case 29:___app_42.default.notify("\ud83c\udf0d \u300e \ud835\udc7a\ud835\udc96\ud835\udc83-\ud835\udc7a\ud835\udc95\ud835\udc90\ud835\udc93\ud835\udc86 \u300f \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n,"\uff01")),r.status(404).json({status:"failed"});case 31:case"end":return t.stop()}}),t,null,[[16,23]])})),(_downloadCollection=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_42(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_42(i,n,o,a,s,"throw",t)}a(void 0)}))}).apply(this,arguments)}function createCollection(t,e){var r=t.body;___app_42.default.info("\u6b63\u5728\u521b\u5efa\u7ec4\u5408\u8ba2\u9605\uff1a".concat(r.name));var n=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);n[r.name]&&e.status(500).json({status:"failed",message:"\u8ba2\u9605\u96c6".concat(r.name,"\u5df2\u5b58\u5728\uff01")}),/^[\w-_]*$/.test(r.name)?(n[r.name]=r,___app_42.default.write(n,_$constants_43.COLLECTIONS_KEY),e.status(201).json({status:"success",data:r})):e.status(500).json({status:"failed",message:"\u8ba2\u9605\u96c6\u540d\u79f0 ".concat(r.name," \u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01\u540d\u79f0\u4e2d\u53ea\u80fd\u5305\u542b\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u3001\u6a2a\u6760\u3002")})}function getCollection(t,e){var r=t.params.name,n=___app_42.default.read(_$constants_43.COLLECTIONS_KEY)[r];n?e.json({status:"success",data:n}):e.status(404).json({status:"failed",message:"\u672a\u627e\u5230\u8ba2\u9605\u96c6\uff1a".concat(r,"!")})}function updateCollection(t,e){var r=t.params.name,n=t.body,o=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);if(o[r]){var i=___objectSpread_42(___objectSpread_42({},o[r]),n);___app_42.default.info("\u6b63\u5728\u66f4\u65b0\u7ec4\u5408\u8ba2\u9605\uff1a".concat(r,"...")),delete o[r],o[n.name||r]=i,___app_42.default.write(o,_$constants_43.COLLECTIONS_KEY),e.json({status:"success",data:i})}else e.status(500).json({status:"failed",message:"\u8ba2\u9605\u96c6".concat(r,"\u4e0d\u5b58\u5728\uff0c\u65e0\u6cd5\u66f4\u65b0\uff01")})}function deleteCollection(t,e){var r=t.params.name;___app_42.default.info("\u6b63\u5728\u5220\u9664\u7ec4\u5408\u8ba2\u9605\uff1a".concat(r));var n=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);delete n[r],___app_42.default.write(n,_$constants_43.COLLECTIONS_KEY),e.json({status:"success"})}function getAllCollections(t,e){var r=___app_42.default.read(_$constants_43.COLLECTIONS_KEY);e.json({status:"success",data:r})}var _$settings_45={};Object.defineProperty(_$settings_45,"__esModule",{value:!0}),_$settings_45.default=function(t){___app_45.default.read(_$constants_43.SETTINGS_KEY)||___app_45.default.write({},_$constants_43.SETTINGS_KEY),t.route("/api/settings").get(getSettings).patch(updateSettings)};var __obj_45,___app_45=(__obj_45=_$app_37)&&__obj_45.__esModule?__obj_45:{default:__obj_45};function __ownKeys_45(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ___objectSpread_45(t){for(var e=1;e=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_44(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function ___asyncToGenerator_44(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){__asyncGeneratorStep_44(i,n,o,a,s,"next",t)}function s(t){__asyncGeneratorStep_44(i,n,o,a,s,"throw",t)}a(void 0)}))}}function getEnv(t,e){var r=(0,_$openApi_53.ENV)(),n="Node";r.isNode&&(n="Node"),r.isQX&&(n="QX"),r.isLoon&&(n="Loon"),r.isSurge&&(n="Surge"),e.json({backend:n})}function gistBackup(t,e){return _gistBackup.apply(this,arguments)}function _gistBackup(){return(_gistBackup=___asyncToGenerator_44(___regeneratorRuntime_44().mark((function t(e,r){var n,o,i,a,s,c,u;return ___regeneratorRuntime_44().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.query.action,o=___app_44.default.read(_$constants_43.SETTINGS_KEY),i=o.gistToken){t.next=6;break}r.status(500).json({status:"failed",message:"\u672a\u627e\u5230Gist\u5907\u4efdToken!"}),t.next=35;break;case 6:a=new ___gist_44.default({token:i,key:_$constants_43.GIST_BACKUP_KEY}),t.prev=7,c=___app_44.default.read(_$constants_43.SETTINGS_KEY),t.t0=n,t.next="upload"===t.t0?12:"download"===t.t0?20:27;break;case 12:return c.syncTime=(new Date).getTime(),___app_44.default.write(c,_$constants_43.SETTINGS_KEY),s=___app_44.default.read("#sub-store"),___app_44.default.env.isNode&&(s=JSON.stringify(___app_44.default.cache,null," ")),___app_44.default.info("\u4e0a\u4f20\u5907\u4efd\u4e2d..."),t.next=19,a.upload((l={},f=_$constants_43.GIST_BACKUP_FILE_NAME,p={content:s},f in l?Object.defineProperty(l,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[f]=p,l));case 19:return t.abrupt("break",27);case 20:return ___app_44.default.info("\u8fd8\u539f\u5907\u4efd\u4e2d..."),t.next=23,a.download(_$constants_43.GIST_BACKUP_FILE_NAME);case 23:return s=t.sent,___app_44.default.write(s,"#sub-store"),___app_44.default.env.isNode&&(s=JSON.parse(s),Object.keys(s).forEach((function(t){___app_44.default.write(s[t],t)}))),t.abrupt("break",27);case 27:r.json({status:"success"}),t.next=35;break;case 30:t.prev=30,t.t1=t.catch(7),u="".concat("upload"===n?"\u4e0a\u4f20":"\u4e0b\u8f7d","\u5907\u4efd\u5931\u8d25\uff01").concat(t.t1),___app_44.default.error(u),r.status(500).json({status:"failed",message:u});case 35:case"end":return t.stop()}var l,f,p}),t,null,[[7,30]])})))).apply(this,arguments)}var _$main_40={},__obj_40,_restful=(__obj_40=_$restful_44)&&__obj_40.__esModule?__obj_40:{default:__obj_40};console.log("\n\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\n \ud835\udc7a\ud835\udc96\ud835\udc83-\ud835\udc7a\ud835\udc95\ud835\udc90\ud835\udc93\ud835\udc86 \xa9 \ud835\udc77\ud835\udc86\ud835\udc8f\ud835\udc88-\ud835\udc80\ud835\udc74\n\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\n"),(0,_restful.default)()}(); \ No newline at end of file