From 6ee6a9b5e2bd6051e13060e7f202c01312c7a53a Mon Sep 17 00:00:00 2001 From: Peng-YM <1048217874pengym@gmail.com> Date: Fri, 9 Sep 2022 23:11:13 +0800 Subject: [PATCH] build: Split sub-store.min.js for better performance on iOS devices --- backend/dist/cron-sync-artifacts.min.js | 6 +- backend/dist/sub-store-0.min.js | 16 ++ backend/dist/sub-store-1.min.js | 16 ++ backend/dist/sub-store-parser.loon.min.js | 6 +- backend/gulpfile.babel.js | 81 ++++-- backend/package.json | 2 +- backend/src/products/cron-sync-artifacts.js | 3 +- backend/src/products/sub-store-0.js | 39 +++ backend/src/products/sub-store-1.js | 39 +++ backend/src/restful/artifacts.js | 279 +------------------ backend/src/restful/download.js | 2 +- backend/src/restful/index.js | 205 +------------- backend/src/restful/miscs.js | 144 ++++++++++ backend/src/restful/node-info.js | 56 ++++ backend/src/restful/preview.js | 2 +- backend/src/restful/sync.js | 284 ++++++++++++++++++++ backend/sub-store.min.js | 6 +- 17 files changed, 673 insertions(+), 513 deletions(-) create mode 100644 backend/dist/sub-store-0.min.js create mode 100644 backend/dist/sub-store-1.min.js create mode 100644 backend/src/products/sub-store-0.js create mode 100644 backend/src/products/sub-store-1.js create mode 100644 backend/src/restful/miscs.js create mode 100644 backend/src/restful/node-info.js create mode 100644 backend/src/restful/sync.js diff --git a/backend/dist/cron-sync-artifacts.min.js b/backend/dist/cron-sync-artifacts.min.js index 5e2abb2f9..f2a99f79f 100644 --- a/backend/dist/cron-sync-artifacts.min.js +++ b/backend/dist/cron-sync-artifacts.min.js @@ -6,11 +6,11 @@ * ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗ * ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ * Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket! - * @updated: 2022/9/9 21:06:45 - * @version: 2.12.9 + * @updated: 2022/9/9 23:06:30 + * @version: 2.13.0 * @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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_94),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),a=c(_$preprocessors_75),i=c(_$producers_78),u=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function _(){}function h(){}function d(){}var y={};s(y,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==e&&n.call(v,a)&&(y=v);var g=d.prototype=_.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||h(t,e)||function(){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 _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function h(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],a=x.length>2?x[2]:void 0,i=_(r),t.prev=3,i.s();case 5:if((u=i.n()).done){t.next=39;break}if(c=u.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(h=c.args,d=h.mode,y=h.content,"link"!==d){t.next=27;break}if((v=(m=y).split("#")).length>1){g=_(v[1].split("&"));try{for(g.s();!(A=g.n()).done;)b=A.value,E=b.split("=")[0],w=b.split("=")[1]||!0,f[E]=w}catch(l){g.e(l)}finally{g.f()}}return t.prev=15,t.next=18,(0,n.default)(m.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=y;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,a,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),i.e(t.t1);case 44:return t.prev=44,i.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(y=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){p(a,n,o,i,u,"next",t)}function u(t){p(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var m={parse:function(t){t=function(t){var e,r=_(a.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.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,n=[],o=_(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value;if(0!==(i=i.trim()).length){var c=!1;if(e){var l=f(v(e,i),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var h,d=_(u.default);try{for(d.s();!(h=d.n()).done;){var y=h.value,m=f(v(y,i),2),g=m[0];if(!m[1]){n.push(g),e=y,c=!0,s.default.info("".concat(y.name," is activated"));break}}}catch(A){d.e(A)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(i))}}}catch(A){o.e(A)}finally{o.f()}return n},process:function(t){return y.apply(this,arguments)},produce:function(t,e){var r=i.default[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])})),s.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 s.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}};function v(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=m})),_$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 a(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|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(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(L(e,ArrayBuffer)||e&&L(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(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 a=!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 I(t).length;default:if(a)return o?-1:k(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),T(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var a,i=1,u=t.length,s=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;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(a=r;au&&(r=u-s),a=r;a>=0;a--){for(var p=!0,f=0;fo&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i>8,o=r%256,a.push(o),a.push(n);return a}(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=t[o+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=A)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 w(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 C(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,a){if(L(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===a&&(a=this.length),e<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(o>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(i,u),c=this.slice(o,a),l=t.slice(e,n),p=0;p>>=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 a=!1;;)switch(n){case"hex":return f(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(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function b(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,n,o,a,i){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function $(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||$(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||$(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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);S(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a>0)-u&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);S(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return F(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;--i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return a},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 a=t.charCodeAt(0);("utf8"===o&&a<128||"latin1"===o)&&(t=a)}}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(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.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;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function I(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function L(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function T(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return I.apply(this,arguments)},e.default=void 0;var n=u(_$resourceCache_99),o=u(_$lodash_35),a=u(_$app_68),i=_$proxyUtils_69({});function u(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function _(){}function h(){}function d(){}var y={};c(y,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==e&&n.call(v,a)&&(y=v);var g=d.prototype=_.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){c(a,n,o,i,u,"next",t)}function u(t){c(a,n,o,i,u,"throw",t)}i(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function f(t,e){if(t){if("string"==typeof t)return _(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)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return S(t)})),e.sort((function(e,r){var n=m(t,e.name),o=m(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=i[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){asyncGeneratorStep(a,n,o,i,u,"next",t)}function u(t){asyncGeneratorStep(a,n,o,i,u,"throw",t)}i(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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],a=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(a?"\n\u591a\u5a92\u4f53:"+a:""),{url:o}),isLoon){var i={};o&&(i.openUrl=o),a&&(i.mediaUrl=a),"{}"===JSON.stringify(i)?$notification.post(t,e,r):$notification.post(t,e,r,i)}if(isNode){var u=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(a?"\n\u591a\u5a92\u4f53: ".concat(a):"");console.log("".concat(t,"\n").concat(e,"\n").concat(u,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_101.OpenAPI=OpenAPI;var _$md5_100={};Object.defineProperty(_$md5_100,"__esModule",{value:!0}),_$md5_100.any_hmac_md5=function(t,e,r){return rstr2any(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)),r)},_$md5_100.any_md5=function(t,e){return rstr2any(rstr_md5(str2rstr_utf8(t)),e)},_$md5_100.b64_hmac_md5=function(t,e){return rstr2b64(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))},_$md5_100.b64_md5=function(t){return rstr2b64(rstr_md5(str2rstr_utf8(t)))},_$md5_100.hex_hmac_md5=function(t,e){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))},_$md5_100.hex_md5=hex_md5;var hexcase=0,b64pad="";function hex_md5(t){return rstr2hex(rstr_md5(str2rstr_utf8(t)))}function rstr_md5(t){return binl2rstr(binl_md5(rstr2binl(t),8*t.length))}function rstr_hmac_md5(t,e){var r=rstr2binl(t);r.length>16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),a=0;a<16;a++)n[a]=909522486^r[a],o[a]=1549556828^r[a];var i=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(i),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return e}function rstr2any(t,e){var r,n,o,a,i,u=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(i[i.length]=o);l[n]=a,s=i}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i>>32-u,r);var i,u}function md5_ff(t,e,r,n,o,a,i){return md5_cmn(e&r|~e&n,t,e,o,a,i)}function md5_gg(t,e,r,n,o,a,i){return md5_cmn(e&n|r&~n,t,e,o,a,i)}function md5_hh(t,e,r,n,o,a,i){return md5_cmn(e^r^n,t,e,o,a,i)}function md5_ii(t,e,r,n,o,a,i){return md5_cmn(r^(e|~n),t,e,o,a,i)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_101.OpenAPI("sub-store");_$app_68.default=_default;var _$constants_67={};Object.defineProperty(_$constants_67,"__esModule",{value:!0}),_$constants_67.SUBS_KEY=_$constants_67.SETTINGS_KEY=_$constants_67.SCHEMA_VERSION_KEY=_$constants_67.RULES_KEY=_$constants_67.RESOURCE_CACHE_KEY=_$constants_67.GIST_BACKUP_KEY=_$constants_67.GIST_BACKUP_FILE_NAME=_$constants_67.COLLECTIONS_KEY=_$constants_67.CACHE_EXPIRATION_TIME_MS=_$constants_67.ARTIFACT_REPOSITORY_KEY=_$constants_67.ARTIFACTS_KEY=void 0,_$constants_67.SCHEMA_VERSION_KEY="schemaVersion",_$constants_67.SETTINGS_KEY="settings",_$constants_67.SUBS_KEY="subs",_$constants_67.COLLECTIONS_KEY="collections",_$constants_67.ARTIFACTS_KEY="artifacts",_$constants_67.RULES_KEY="rules",_$constants_67.GIST_BACKUP_KEY="Auto Generated Sub-Store Backup",_$constants_67.GIST_BACKUP_FILE_NAME="Sub-Store",_$constants_67.ARTIFACT_REPOSITORY_KEY="Sub-Store Artifacts Repository",_$constants_67.RESOURCE_CACHE_KEY="#sub-store-cached-resource",_$constants_67.CACHE_EXPIRATION_TIME_MS=36e5;var _$resourceCache_99={};Object.defineProperty(_$resourceCache_99,"__esModule",{value:!0}),_$resourceCache_99.default=void 0;var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(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(t,e):void 0}}(t,e)||function(){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 _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(_app.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){_app.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){_app.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?_app.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),_app.default.write(e,"#".concat(t))}}])&&___defineProperties_99(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_99.default=___default_99;var _$download_94={};Object.defineProperty(_$download_94,"__esModule",{value:!0}),_$download_94.default=function(t,e){return _download.apply(this,arguments)};var __obj_94,_resourceCache=(__obj_94=_$resourceCache_99)&&__obj_94.__esModule?__obj_94:{default:__obj_94};function ___typeof_94(t){return(___typeof_94="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_94(){___regeneratorRuntime_94=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=A(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=p.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_94(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function A(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,A(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=c(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_94(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_94().mark((function t(e,r){var n,o,a;return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_100.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_101.HTTP)({headers:{"User-Agent":r}}),a=new Promise((function(t,r){var a=_resourceCache.default.get(n);a?t(a):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,a),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_94(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_94(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$utils_97={};Object.defineProperty(_$utils_97,"__esModule",{value:!0}),_$utils_97.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_97.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_97.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_97.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_97.isNotBlank=isNotBlank,_$utils_97.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_98={};function ___arrayLikeToArray_98(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,L=RegExp(I.source),T=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,N=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,q=RegExp(H.source),G=/^\s+/,Y=/\s/,z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Q=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,at=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,it=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",_t="[a-z\\xdf-\\xf6\\xf8-\\xff]",ht="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",yt="[^\\ud800-\\udfff]",mt="(?:\\ud83c[\\udde6-\\uddff]){2}",vt="[\\ud800-\\udbff][\\udc00-\\udfff]",gt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+_t+"|"+ht+")",bt="(?:"+gt+"|"+ht+")",Et="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+Et+"(?:\\u200d(?:"+[yt,mt,vt].join("|")+")[\\ufe0e\\ufe0f]?"+Et+")*",Ct="(?:"+["[\\u2700-\\u27bf]",mt,vt].join("|")+")"+wt,xt="(?:"+[yt+pt+"?",pt,mt,vt,"[\\ud800-\\udfff]"].join("|")+")",St=RegExp("['\u2019]","g"),$t=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Ft=RegExp([gt+"?"+_t+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,gt,"$"].join("|")+")",bt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,gt+At,"$"].join("|")+")",gt+"?"+At+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",gt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,It=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,Lt={};Lt[b]=Lt[E]=Lt[w]=Lt[C]=Lt[x]=Lt[S]=Lt["[object Uint8ClampedArray]"]=Lt[$]=Lt[O]=!0,Lt[o]=Lt[a]=Lt[g]=Lt[i]=Lt[A]=Lt[u]=Lt[s]=Lt[c]=Lt[p]=Lt[f]=Lt[_]=Lt[h]=Lt[d]=Lt[y]=Lt[v]=!1;var Tt={};Tt[o]=Tt[a]=Tt[g]=Tt[A]=Tt[i]=Tt[u]=Tt[b]=Tt[E]=Tt[w]=Tt[C]=Tt[x]=Tt[p]=Tt[f]=Tt[_]=Tt[h]=Tt[d]=Tt[y]=Tt[m]=Tt[S]=Tt["[object Uint8ClampedArray]"]=Tt[$]=Tt[O]=!0,Tt[s]=Tt[c]=Tt[v]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bt=parseFloat,Dt=parseInt,Nt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Nt||Mt||Function("return this")(),Ht="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,qt=Ht&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,Gt=qt&&qt.exports===Ht,Yt=Gt&&Nt.process,zt=function(){try{return qt&&qt.require&&qt.require("util").types||Yt&&Yt.binding&&Yt.binding("util")}catch(t){}}(),Wt=zt&&zt.isArrayBuffer,Kt=zt&&zt.isDate,Vt=zt&&zt.isMap,Xt=zt&&zt.isRegExp,Jt=zt&&zt.isSet,Zt=zt&&zt.isTypedArray;function Qt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,a=null==t?0:t.length;++o-1}function ie(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Fe(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Pe=Ae({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),ke=Ae({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ie(t){return"\\"+jt[t]}function Re(t){return Pt.test(t)}function Le(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Te(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,a=0,i=[];++n",""":'"',"'":"'"}),qe=function t(Y){var st,ct=(Y=null==Y?Ut:qe.defaults(Ut.Object(),Y,qe.pick(Ut,It))).Array,lt=Y.Date,pt=Y.Error,ft=Y.Function,_t=Y.Math,ht=Y.Object,dt=Y.RegExp,yt=Y.String,mt=Y.TypeError,vt=ct.prototype,gt=ft.prototype,At=ht.prototype,bt=Y["__core-js_shared__"],Et=gt.toString,wt=At.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=At.toString,Pt=Et.call(ht),jt=Ut._,Nt=dt("^"+Et.call(wt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=Gt?Y.Buffer:void 0,Ht=Y.Symbol,qt=Y.Uint8Array,Yt=Mt?Mt.allocUnsafe:void 0,zt=Te(ht.getPrototypeOf,ht),fe=ht.create,Ae=At.propertyIsEnumerable,Ge=vt.splice,Ye=Ht?Ht.isConcatSpreadable:void 0,ze=Ht?Ht.iterator:void 0,We=Ht?Ht.toStringTag:void 0,Ke=function(){try{var t=Qo(ht,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=Y.clearTimeout!==Ut.clearTimeout&&Y.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=Y.setTimeout!==Ut.setTimeout&&Y.setTimeout,Ze=_t.ceil,Qe=_t.floor,tr=ht.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=Y.isFinite,nr=vt.join,or=Te(ht.keys,ht),ar=_t.max,ir=_t.min,ur=lt.now,sr=Y.parseInt,cr=_t.random,lr=vt.reverse,pr=Qo(Y,"DataView"),fr=Qo(Y,"Map"),_r=Qo(Y,"Promise"),hr=Qo(Y,"Set"),dr=Qo(Y,"WeakMap"),yr=Qo(ht,"create"),mr=dr&&new dr,vr={},gr=$a(pr),Ar=$a(fr),br=$a(_r),Er=$a(hr),wr=$a(dr),Cr=Ht?Ht.prototype:void 0,xr=Cr?Cr.valueOf:void 0,Sr=Cr?Cr.toString:void 0;function $r(t){if(Gi(t)&&!Ri(t)&&!(t instanceof kr)){if(t instanceof Pr)return t;if(wt.call(t,"__wrapped__"))return Oa(t)}return new Pr(t)}var Or=function(){function t(){}return function(e){if(!qi(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Fr(){}function Pr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function kr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ir(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,a,s){var v,F=1&e,P=2&e,k=4&e;if(r&&(v=a?r(t,n,a,s):r(t)),void 0!==v)return v;if(!qi(t))return t;var I=Ri(t);if(I){if(v=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!F)return mo(t,v)}else{var R=ra(t),L=R==c||R==l;if(Bi(t))return lo(t,F);if(R==_||R==o||L&&!a){if(v=P||L?{}:oa(t),!F)return P?function(t,e){return vo(t,ea(t),e)}(t,function(t,e){return t&&vo(e,bu(e),t)}(v,t)):function(t,e){return vo(t,ta(t),e)}(t,Yr(v,t))}else{if(!Tt[R])return a?t:{};v=function(t,e,r){var n,o,a,s=t.constructor;switch(e){case g:return po(t);case i:case u:return new s(+t);case A:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case b:case E:case w:case C:case x:case S:case"[object Uint8ClampedArray]":case $:case O:return fo(t,r);case p:return new s;case f:case y:return new s(t);case h:return(a=new(o=t).constructor(o.source,Q.exec(o))).lastIndex=o.lastIndex,a;case d:return new s;case m:return n=t,xr?ht(xr.call(n)):{}}}(t,R,F)}}s||(s=new jr);var T=s.get(t);if(T)return T;s.set(t,v),Vi(t)?t.forEach((function(n){v.add(Vr(n,e,r,n,t,s))})):Yi(t)&&t.forEach((function(n,o){v.set(o,Vr(n,e,r,o,t,s))}));var j=I?void 0:(k?P?zo:Yo:P?bu:Au)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Hr(v,o,Vr(n,e,r,o,t,s))})),v}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=ht(t);n--;){var o=r[n],a=e[o],i=t[o];if(void 0===i&&!(o in t)||!a(i))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new mt(e);return va((function(){t.apply(void 0,n)}),r)}function Zr(t,e,r,n){var o=-1,a=ae,i=!0,u=t.length,s=[],c=e.length;if(!u)return s;r&&(e=ue(e,xe(r))),n?(a=ie,i=!1):e.length>=200&&(a=$e,i=!1,e=new Tr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=qr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Lr.prototype.clear=function(){this.size=0,this.__data__={hash:new Ir,map:new(fr||Rr),string:new Ir}},Lr.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Lr.prototype.get=function(t){return Jo(this,t).get(t)},Lr.prototype.has=function(t){return Jo(this,t).has(t)},Lr.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Tr.prototype.add=Tr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Tr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Lr(n)}return r.set(t,e),this.size=r.size,this};var Qr=bo(sn),tn=bo(cn,!0);function en(t,e){var r=!0;return Qr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(u)?e>1?on(u,e-1,r,n,o):se(o,u):n||(o[o.length]=u)}return o}var an=Eo(),un=Eo(!0);function sn(t,e){return t&&an(t,e,Au)}function cn(t,e){return t&&un(t,e,Au)}function ln(t,e){return oe(e,(function(e){return Mi(t[e])}))}function pn(t,e){for(var r=0,n=(e=io(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function yn(t,e){return null!=t&&e in ht(t)}function mn(t,e,r){for(var n=r?ie:ae,o=t[0].length,a=t.length,i=a,u=ct(a),s=1/0,c=[];i--;){var l=t[i];i&&e&&(l=ue(l,xe(e))),s=ir(l.length,s),u[i]=!r&&(e||o>=120&&l.length>=120)?new Tr(i&&l):void 0}l=t[0];var p=-1,f=u[0];t:for(;++p=u?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}(Sn(t,(function(t,r,o){return{criteria:ue(e,(function(e){return e(t)})),index:++n,value:t}})))}function In(t,e,r){for(var n=-1,o=e.length,a={};++n-1;)u!==t&&Ge.call(u,s,1),Ge.call(t,s,1);return t}function Ln(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==a){var a=o;ia(o)?Ge.call(t,o,1):Zn(t,o)}}return t}function Tn(t,e){return t+Qe(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Qe(e/2))&&(t+=t)}while(e);return r}function Bn(t,e){return ga(ha(t,e,zu),t+"")}function Dn(t){return Dr(Fu(t))}function Nn(t,e){var r=Fu(t);return Ea(r,Kr(e,0,r.length))}function Mn(t,e,r,n){if(!qi(t))return t;for(var o=-1,a=(e=io(e,t)).length,i=a-1,u=t;null!=u&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=ct(o);++n>>1,i=t[a];null!==i&&!Ji(i)&&(r?i<=e:i=200){var c=e?null:Bo(t);if(c)return Be(c);i=!1,o=$e,s=new Tr}else s=e?[]:u;t:for(;++n=n?t:Gn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Yt?Yt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,a=Ji(t),i=void 0!==e,u=null===e,s=e==e,c=Ji(e);if(!u&&!c&&!a&&t>e||a&&i&&s&&!u&&!c||n&&i&&s||!r&&s||!o)return 1;if(!n&&!a&&!c&&t1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ua(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=ht(e);++n-1?o[a?e[i]:i]:void 0}}function $o(t){return Go((function(r){var n=r.length,o=n,a=Pr.prototype.thru;for(t&&r.reverse();o--;){var i=r[o];if("function"!=typeof i)throw new mt(e);if(a&&!u&&"wrapper"==Ko(i))var u=new Pr([],!0)}for(o=u?o:n;++o1&&v.reverse(),l&&su))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,_=2&r?new Tr:void 0;for(a.set(t,e),a.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(z,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ae(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(W);return e?e[1].split(K):[]}(o),r)))}function ba(t){var e=0,r=0;return function(){var n=ur(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ea(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Ka(t,r)}));function ei(t){var e=$r(t);return e.__chain__=!0,e}function ri(t,e){return e(t)}var ni=Go((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof kr&&ia(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new Pr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),oi=go((function(t,e,r){wt.call(t,r)?++t[r]:zr(t,r,1)})),ai=So(Ia),ii=So(Ra);function ui(t,e){return(Ri(t)?ee:Qr)(t,Xo(e,3))}function si(t,e){return(Ri(t)?re:tn)(t,Xo(e,3))}var ci=go((function(t,e,r){wt.call(t,r)?t[r].push(e):zr(t,r,[e])})),li=Bn((function(t,e,r){var n=-1,o="function"==typeof e,a=Ti(t)?ct(t.length):[];return Qr(t,(function(t){a[++n]=o?Qt(e,t,r):vn(t,e,r)})),a})),pi=go((function(t,e,r){zr(t,r,e)}));function fi(t,e){return(Ri(t)?ue:Sn)(t,Xo(e,3))}var _i=go((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),hi=Bn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ua(t,e[0],e[1])?e=[]:r>2&&ua(e[0],e[1],e[2])&&(e=[e[0]]),kn(t,on(e,1),[])})),di=Xe||function(){return Ut.Date.now()};function yi(t,e,r){return e=r?void 0:e,No(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function mi(t,r){var n;if("function"!=typeof r)throw new mt(e);return t=nu(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var vi=Bn((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(vi));n|=32}return No(t,n,e,r,o)})),gi=Bn((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(gi));n|=32}return No(e,n,t,r,o)}));function Ai(t,r,n){var o,a,i,u,s,c,l=0,p=!1,f=!1,_=!0;if("function"!=typeof t)throw new mt(e);function h(e){var r=o,n=a;return o=a=void 0,l=e,u=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function y(){var t=di();if(d(t))return m(t);s=va(y,function(t){var e=r-(t-c);return f?ir(e,i-(t-l)):e}(t))}function m(t){return s=void 0,_&&o?h(t):(o=a=void 0,u)}function v(){var t=di(),e=d(t);if(o=arguments,a=this,c=t,e){if(void 0===s)return function(t){return l=t,s=va(y,r),p?h(t):u}(c);if(f)return co(s),s=va(y,r),h(c)}return void 0===s&&(s=va(y,r)),u}return r=au(r)||0,qi(n)&&(p=!!n.leading,i=(f="maxWait"in n)?ar(au(n.maxWait)||0,r):i,_="trailing"in n?!!n.trailing:_),v.cancel=function(){void 0!==s&&co(s),l=0,o=c=a=s=void 0},v.flush=function(){return void 0===s?u:m(di())},v}var bi=Bn((function(t,e){return Jr(t,1,e)})),Ei=Bn((function(t,e,r){return Jr(t,au(e)||0,r)}));function wi(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new mt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,e);return n.cache=a.set(o,i)||a,i};return n.cache=new(wi.Cache||Lr),n}function Ci(t){if("function"!=typeof t)throw new mt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}wi.Cache=Lr;var xi=uo((function(t,e){var r=(e=1==e.length&&Ri(e[0])?ue(e[0],xe(Xo())):ue(on(e,1),xe(Xo()))).length;return Bn((function(n){for(var o=-1,a=ir(n.length,r);++o=e})),Ii=gn(function(){return arguments}())?gn:function(t){return Gi(t)&&wt.call(t,"callee")&&!Ae.call(t,"callee")},Ri=ct.isArray,Li=Wt?xe(Wt):function(t){return Gi(t)&&_n(t)==g};function Ti(t){return null!=t&&Hi(t.length)&&!Mi(t)}function ji(t){return Gi(t)&&Ti(t)}var Bi=er||as,Di=Kt?xe(Kt):function(t){return Gi(t)&&_n(t)==u};function Ni(t){if(!Gi(t))return!1;var e=_n(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Wi(t)}function Mi(t){if(!qi(t))return!1;var e=_n(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ui(t){return"number"==typeof t&&t==nu(t)}function Hi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function qi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Gi(t){return null!=t&&"object"==typeof t}var Yi=Vt?xe(Vt):function(t){return Gi(t)&&ra(t)==p};function zi(t){return"number"==typeof t||Gi(t)&&_n(t)==f}function Wi(t){if(!Gi(t)||_n(t)!=_)return!1;var e=zt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==Pt}var Ki=Xt?xe(Xt):function(t){return Gi(t)&&_n(t)==h},Vi=Jt?xe(Jt):function(t){return Gi(t)&&ra(t)==d};function Xi(t){return"string"==typeof t||!Ri(t)&&Gi(t)&&_n(t)==y}function Ji(t){return"symbol"==typeof t||Gi(t)&&_n(t)==m}var Zi=Zt?xe(Zt):function(t){return Gi(t)&&Hi(t.length)&&!!Lt[_n(t)]},Qi=Lo(xn),tu=Lo((function(t,e){return t<=e}));function eu(t){if(!t)return[];if(Ti(t))return Xi(t)?Me(t):mo(t);if(ze&&t[ze])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ze]());var e=ra(t);return(e==p?Le:e==d?Be:Fu)(t)}function ru(t){return t?(t=au(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function nu(t){var e=ru(t),r=e%1;return e==e?r?e-r:e:0}function ou(t){return t?Kr(nu(t),0,4294967295):0}function au(t){if("number"==typeof t)return t;if(Ji(t))return NaN;if(qi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=qi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Dt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function iu(t){return vo(t,bu(t))}function uu(t){return null==t?"":Xn(t)}var su=Ao((function(t,e){if(pa(e)||Ti(e))vo(e,Au(e),t);else for(var r in e)wt.call(e,r)&&Hr(t,r,e[r])})),cu=Ao((function(t,e){vo(e,bu(e),t)})),lu=Ao((function(t,e,r,n){vo(e,bu(e),t,n)})),pu=Ao((function(t,e,r,n){vo(e,Au(e),t,n)})),fu=Go(Wr),_u=Bn((function(t,e){t=ht(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&ua(e[0],e[1],o)&&(n=1);++r1),e})),vo(t,zo(t),r),n&&(r=Vr(r,7,Ho));for(var o=e.length;o--;)Zn(r,e[o]);return r})),xu=Go((function(t,e){return null==t?{}:function(t,e){return In(t,e,(function(e,r){return yu(t,r)}))}(t,e)}));function Su(t,e){if(null==t)return{};var r=ue(zo(t),(function(t){return[t]}));return e=Xo(e),In(t,r,(function(t,r){return e(t,r[0])}))}var $u=Do(Au),Ou=Do(bu);function Fu(t){return null==t?[]:Se(t,Au(t))}var Pu=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?ku(e):e)}));function ku(t){return Nu(uu(t).toLowerCase())}function Iu(t){return(t=uu(t))&&t.replace(at,Pe).replace($t,"")}var Ru=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Lu=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Tu=wo("toLowerCase"),ju=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Bu=Co((function(t,e,r){return t+(r?" ":"")+Nu(e)})),Du=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Nu=wo("toUpperCase");function Mu(t,e,r){return t=uu(t),void 0===(e=r?void 0:e)?function(t){return kt.test(t)}(t)?function(t){return t.match(Ft)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Uu=Bn((function(t,e){try{return Qt(t,void 0,e)}catch(r){return Ni(r)?r:new pt(r)}})),Hu=Go((function(t,e){return ee(e,(function(e){e=Sa(e),zr(t,e,vi(t[e],t))})),t}));function qu(t){return function(){return t}}var Gu=$o(),Yu=$o(!0);function zu(t){return t}function Wu(t){return wn("function"==typeof t?t:Vr(t,1))}var Ku=Bn((function(t,e){return function(r){return vn(r,t,e)}})),Vu=Bn((function(t,e){return function(r){return vn(t,r,e)}}));function Xu(t,e,r){var n=Au(e),o=ln(e,n);null!=r||qi(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,Au(e)));var a=!(qi(r)&&"chain"in r&&!r.chain),i=Mi(t);return ee(o,(function(r){var n=e[r];t[r]=n,i&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=mo(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Ju(){}var Zu=ko(ue),Qu=ko(ne),ts=ko(pe);function es(t){return sa(t)?ge(Sa(t)):function(t){return function(e){return pn(e,t)}}(t)}var rs=Ro(),ns=Ro(!0);function os(){return[]}function as(){return!1}var is,us=Po((function(t,e){return t+e}),0),ss=jo("ceil"),cs=Po((function(t,e){return t/e}),1),ls=jo("floor"),ps=Po((function(t,e){return t*e}),1),fs=jo("round"),_s=Po((function(t,e){return t-e}),0);return $r.after=function(t,r){if("function"!=typeof r)throw new mt(e);return t=nu(t),function(){if(--t<1)return r.apply(this,arguments)}},$r.ary=yi,$r.assign=su,$r.assignIn=cu,$r.assignInWith=lu,$r.assignWith=pu,$r.at=fu,$r.before=mi,$r.bind=vi,$r.bindAll=Hu,$r.bindKey=gi,$r.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ri(t)?t:[t]},$r.chain=ei,$r.chunk=function(t,e,r){e=(r?ua(t,e,r):void 0===e)?1:ar(nu(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,a=0,i=ct(Ze(n/e));oo?0:o+r),(n=void 0===n||n>o?o:nu(n))<0&&(n+=o),n=r>n?0:ou(n);r>>0)?(t=uu(t))&&("string"==typeof e||null!=e&&!Ki(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},$r.spread=function(t,r){if("function"!=typeof t)throw new mt(e);return r=null==r?0:ar(nu(r),0),Bn((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Qt(t,this,o)}))},$r.tail=function(t){var e=null==t?0:t.length;return e?Gn(t,1,e):[]},$r.take=function(t,e,r){return t&&t.length?Gn(t,0,(e=r||void 0===e?1:nu(e))<0?0:e):[]},$r.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Gn(t,(e=n-(e=r||void 0===e?1:nu(e)))<0?0:e,n):[]},$r.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},$r.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},$r.tap=function(t,e){return e(t),t},$r.throttle=function(t,r,n){var o=!0,a=!0;if("function"!=typeof t)throw new mt(e);return qi(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),Ai(t,r,{leading:o,maxWait:r,trailing:a})},$r.thru=ri,$r.toArray=eu,$r.toPairs=$u,$r.toPairsIn=Ou,$r.toPath=function(t){return Ri(t)?ue(t,Sa):Ji(t)?[t]:mo(xa(uu(t)))},$r.toPlainObject=iu,$r.transform=function(t,e,r){var n=Ri(t),o=n||Bi(t)||Zi(t);if(e=Xo(e,4),null==r){var a=t&&t.constructor;r=o?n?new a:[]:qi(t)&&Mi(a)?Or(zt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},$r.unary=function(t){return yi(t,1)},$r.union=Ga,$r.unionBy=Ya,$r.unionWith=za,$r.uniq=function(t){return t&&t.length?Jn(t):[]},$r.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},$r.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},$r.unset=function(t,e){return null==t||Zn(t,e)},$r.unzip=Wa,$r.unzipWith=Ka,$r.update=function(t,e,r){return null==t?t:Qn(t,e,ao(r))},$r.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Qn(t,e,ao(r),n)},$r.values=Fu,$r.valuesIn=function(t){return null==t?[]:Se(t,bu(t))},$r.without=Va,$r.words=Mu,$r.wrap=function(t,e){return Si(ao(e),t)},$r.xor=Xa,$r.xorBy=Ja,$r.xorWith=Za,$r.zip=Qa,$r.zipObject=function(t,e){return no(t||[],e||[],Hr)},$r.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},$r.zipWith=ti,$r.entries=$u,$r.entriesIn=Ou,$r.extend=cu,$r.extendWith=lu,Xu($r,$r),$r.add=us,$r.attempt=Uu,$r.camelCase=Pu,$r.capitalize=ku,$r.ceil=ss,$r.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=au(r))==r?r:0),void 0!==e&&(e=(e=au(e))==e?e:0),Kr(au(t),e,r)},$r.clone=function(t){return Vr(t,4)},$r.cloneDeep=function(t){return Vr(t,5)},$r.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},$r.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},$r.conformsTo=function(t,e){return null==e||Xr(t,e,Au(e))},$r.deburr=Iu,$r.defaultTo=function(t,e){return null==t||t!=t?e:t},$r.divide=cs,$r.endsWith=function(t,e,r){t=uu(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Kr(nu(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},$r.eq=Fi,$r.escape=function(t){return(t=uu(t))&&T.test(t)?t.replace(R,ke):t},$r.escapeRegExp=function(t){return(t=uu(t))&&q.test(t)?t.replace(H,"\\$&"):t},$r.every=function(t,e,r){var n=Ri(t)?ne:en;return r&&ua(t,e,r)&&(e=void 0),n(t,Xo(e,3))},$r.find=ai,$r.findIndex=Ia,$r.findKey=function(t,e){return _e(t,Xo(e,3),sn)},$r.findLast=ii,$r.findLastIndex=Ra,$r.findLastKey=function(t,e){return _e(t,Xo(e,3),cn)},$r.floor=ls,$r.forEach=ui,$r.forEachRight=si,$r.forIn=function(t,e){return null==t?t:an(t,Xo(e,3),bu)},$r.forInRight=function(t,e){return null==t?t:un(t,Xo(e,3),bu)},$r.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},$r.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},$r.get=du,$r.gt=Pi,$r.gte=ki,$r.has=function(t,e){return null!=t&&na(t,e,dn)},$r.hasIn=yu,$r.head=Ta,$r.identity=zu,$r.includes=function(t,e,r,n){t=Ti(t)?t:Fu(t),r=r&&!n?nu(r):0;var o=t.length;return r<0&&(r=ar(o+r,0)),Xi(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},$r.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:nu(r);return o<0&&(o=ar(n+o,0)),de(t,e,o)},$r.inRange=function(t,e,r){return e=ru(e),void 0===r?(r=e,e=0):r=ru(r),function(t,e,r){return t>=ir(e,r)&&t=-9007199254740991&&t<=9007199254740991},$r.isSet=Vi,$r.isString=Xi,$r.isSymbol=Ji,$r.isTypedArray=Zi,$r.isUndefined=function(t){return void 0===t},$r.isWeakMap=function(t){return Gi(t)&&ra(t)==v},$r.isWeakSet=function(t){return Gi(t)&&"[object WeakSet]"==_n(t)},$r.join=function(t,e){return null==t?"":nr.call(t,e)},$r.kebabCase=Ru,$r.last=Na,$r.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=nu(r))<0?ar(n+o,0):ir(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):he(t,me,o,!0)},$r.lowerCase=Lu,$r.lowerFirst=Tu,$r.lt=Qi,$r.lte=tu,$r.max=function(t){return t&&t.length?rn(t,zu,hn):void 0},$r.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),hn):void 0},$r.mean=function(t){return ve(t,zu)},$r.meanBy=function(t,e){return ve(t,Xo(e,2))},$r.min=function(t){return t&&t.length?rn(t,zu,xn):void 0},$r.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},$r.stubArray=os,$r.stubFalse=as,$r.stubObject=function(){return{}},$r.stubString=function(){return""},$r.stubTrue=function(){return!0},$r.multiply=ps,$r.nth=function(t,e){return t&&t.length?Pn(t,nu(e)):void 0},$r.noConflict=function(){return Ut._===this&&(Ut._=jt),this},$r.noop=Ju,$r.now=di,$r.pad=function(t,e,r){t=uu(t);var n=(e=nu(e))?Ne(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return Io(Qe(o),r)+t+Io(Ze(o),r)},$r.padEnd=function(t,e,r){t=uu(t);var n=(e=nu(e))?Ne(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ir(t+o*(e-t+Bt("1e-"+((o+"").length-1))),e)}return Tn(t,e)},$r.reduce=function(t,e,r){var n=Ri(t)?ce:be,o=arguments.length<3;return n(t,Xo(e,4),r,o,Qr)},$r.reduceRight=function(t,e,r){var n=Ri(t)?le:be,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},$r.repeat=function(t,e,r){return e=(r?ua(t,e,r):void 0===e)?1:nu(e),jn(uu(t),e)},$r.replace=function(){var t=arguments,e=uu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$r.result=function(t,e,r){var n=-1,o=(e=io(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ir(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=a)return t;var u=r-Ne(n);if(u<1)return n;var s=i?so(i,0,u).join(""):t.slice(0,u);if(void 0===o)return s+n;if(i&&(u+=s.length-u),Ki(o)){if(t.slice(u).search(o)){var c,l=s;for(o.global||(o=dt(o.source,uu(Q.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?u:p)}}else if(t.indexOf(Xn(o),u)!=u){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},$r.unescape=function(t){return(t=uu(t))&&L.test(t)?t.replace(I,He):t},$r.uniqueId=function(t){var e=++Ct;return uu(t)+e},$r.upperCase=Du,$r.upperFirst=Nu,$r.each=ui,$r.eachRight=si,$r.first=Ta,Xu($r,(is={},sn($r,(function(t,e){wt.call($r.prototype,e)||(is[e]=t)})),is),{chain:!1}),$r.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$r[t].placeholder=$r})),ee(["drop","take"],(function(t,e){kr.prototype[t]=function(r){r=void 0===r?1:ar(nu(r),0);var n=this.__filtered__&&!e?new kr(this):this.clone();return n.__filtered__?n.__takeCount__=ir(r,n.__takeCount__):n.__views__.push({size:ir(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},kr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;kr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");kr.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");kr.prototype[t]=function(){return this.__filtered__?new kr(this):this[r](1)}})),kr.prototype.compact=function(){return this.filter(zu)},kr.prototype.find=function(t){return this.filter(t).head()},kr.prototype.findLast=function(t){return this.reverse().find(t)},kr.prototype.invokeMap=Bn((function(t,e){return"function"==typeof t?new kr(this):this.map((function(r){return vn(r,t,e)}))})),kr.prototype.reject=function(t){return this.filter(Ci(Xo(t)))},kr.prototype.slice=function(t,e){t=nu(t);var r=this;return r.__filtered__&&(t>0||e<0)?new kr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=nu(e))<0?r.dropRight(-e):r.take(e-t)),r)},kr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},kr.prototype.toArray=function(){return this.take(4294967295)},sn(kr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=$r[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);o&&($r.prototype[e]=function(){var e=this.__wrapped__,i=n?[1]:arguments,u=e instanceof kr,s=i[0],c=u||Ri(e),l=function(t){var e=o.apply($r,se([t],i));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,_=a&&!p,h=u&&!f;if(!a&&c){e=h?e:new kr(this);var d=t.apply(e,i);return d.__actions__.push({func:ri,args:[l],thisArg:void 0}),new Pr(d,p)}return _&&h?t.apply(this,i):(d=this.thru(l),_?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=vt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);$r.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ri(o)?o:[],t)}return this[r]((function(r){return e.apply(Ri(r)?r:[],t)}))}})),sn(kr.prototype,(function(t,e){var r=$r[e];if(r){var n=r.name+"";wt.call(vr,n)||(vr[n]=[]),vr[n].push({name:e,func:r})}})),vr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],kr.prototype.clone=function(){var t=new kr(this.__wrapped__);return t.__actions__=mo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mo(this.__views__),t},kr.prototype.reverse=function(){if(this.__filtered__){var t=new kr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},kr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ri(t),n=e<0,o=r?t.length:0,a=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$r.prototype.plant=function(t){for(var e,r=this;r instanceof Fr;){var n=Oa(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},$r.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof kr){var e=t;return this.__actions__.length&&(e=new kr(this)),(e=e.reverse()).__actions__.push({func:ri,args:[qa],thisArg:void 0}),new Pr(e,this.__chain__)}return this.thru(qa)},$r.prototype.toJSON=$r.prototype.valueOf=$r.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},$r.prototype.first=$r.prototype.head,ze&&($r.prototype[ze]=function(){return this}),$r}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=qe,define((function(){return qe}))):qt?((qt.exports=qe)._=qe,Ht._=qe):Ut._=qe}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",a=this.position;ae/2-1){o=" ... ",a-=5;break}return i=this.buffer.slice(n,a),_$common_7.repeat(" ",t)+r+i+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,a,i,u,s,c=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(a=+e[4],i=+e[5],u=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,a,i,u,c)),l&&s.setTime(s.getTime()-l),s},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,a=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,a=BASE64_MAP,i=0,u=[];for(e=0;e>16&255),u.push(i>>8&255),u.push(255&i)),i=i<<6|a.indexOf(n.charAt(e));return 0==(r=o%4*6)?(u.push(i>>16&255),u.push(i>>8&255),u.push(255&i)):18===r?(u.push(i>>10&255),u.push(i>>2&255)):12===r&&u.push(i>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(u):new NodeBuffer(u):u},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,a=t.length,i=BASE64_MAP;for(e=0;e>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]),o=(o<<8)+t[e];return 0==(r=a%3)?(n+=i[o>>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]):2===r?(n+=i[o>>10&63],n+=i[o>>4&63],n+=i[o<<2&63],n+=i[64]):1===r&&(n+=i[o>>2&63],n+=i[o<<4&63],n+=i[64],n+=i[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,a,i=[],u=t;for(e=0,r=u.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,a;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),a=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&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,a,i,u;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,a=t.anchor,i=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=i),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)i.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),i.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,p,f,_,h,a,i),f=_=h=null),skipSeparationSpace(t,!0,-1),u=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==u)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(a)){do{a=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!is_EOL(a)&&0!==a)}for(;0!==a;){for(readLineBreak(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(a))p++;else{if(t.lineIndent0){for(o=i,a=0;o>0;o--)(i=fromHexCode(u=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+i:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(a),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(u)?(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,p)?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,a,i,u,s,c,l,p=t.kind,f=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=a=t.position,i=!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(u=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){i=!0,l=t.input.charCodeAt(t.position);continue}t.position=a,t.line=u,t.lineStart=s,t.lineIndent=c;break}}i&&(captureSegment(t,o,a,!1),writeFoldedLines(t,t.line-u),o=a=t.position,i=!1),is_WHITE_SPACE(l)||(a=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,a,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=u&&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+'"'),s=0,c=t.implicitTypes.length;s 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,a=t.position,i=!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(i=!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)):i&&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(a,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(a-1):null,_=_&&isPlainSafe(i,u)}else{for(a=0;an&&" "!==t[f+1],f=a);else if(!isPrintable(i))return STYLE_DOUBLE;u=a>0?t.charCodeAt(a-1):null,_=_&&isPlainSafe(i,u)}l=l||p&&a-f-1>n&&" "!==t[f+1]}return c||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),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),i=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,i,t.indent,a,(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,a=/(\n+)([^\n]*)/g,i=(o=-1!==(o=t.indexOf("\n"))?o:t.length,a.lastIndex=o,foldLine(t.slice(0,o),e)),u="\n"===t[0]||" "===t[0];n=a.exec(t);){var s=n[1],c=n[2];r=" "===c[0],i+=s+(u||r||""===c?"":"\n")+foldLine(c,e),u=r}return i}(e,a),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",a=0;a=55296&&e<=56319&&(r=t.charCodeAt(a+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),a++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[a]: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,a=0,i=0,u=0,s="";r=o.exec(t);)(u=r.index)-a>e&&(n=i>a?i:u,s+="\n"+t.slice(a,n),a=n+1),i=u;return s+="\n",t.length-a>e&&i>a?s+=t.slice(a,i)+"\n"+t.slice(i+1):s+=t.slice(a),s.slice(1)}function detectType(t,e,r){var n,o,a,i,u,s;for(a=0,i=(o=r?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+s+'" style');n=u.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,a){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var i=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var u,s,c="[object Object]"===i||"[object Array]"===i;if(c&&(s=-1!==(u=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(c&&s&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===i)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,a,i,u,s,c,l="",p=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,a=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,u,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+u+t.dump)):(function(t,e,r){var n,o,a,i,u,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,i,!1,!1)&&(s+=u+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===i){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,a,i="",u=t.tag;for(o=0,a=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],a=[];for(function t(e,r,n){var o,a,i;if(null!==e&&"object"==typeof e)if(-1!==(a=r.indexOf(e)))-1===n.indexOf(a)&&n.push(a);else if(r.push(e),Array.isArray(e))for(a=0,i=e.length;a0?o-4:o;for(r=0;r>16&255,i[u++]=e>>8&255,i[u++]=255&e;return 2===a&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,i[u++]=255&e),1===a&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,i[u++]=e>>8&255,i[u++]=255&e),i},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],a=0,i=r-n;ai?i:a+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,a=[],i=e;i>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return a.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var a,i,u=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,_=t[e+p];for(p+=f,a=_&(1<<-l)-1,_>>=-l,l+=u;l>0;a=256*a+t[e+p],p+=f,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+t[e+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(_?-1:1);i+=Math.pow(2,n),a-=c}return(_?-1:1)*i*Math.pow(2,a-n)},write:function(t,e,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-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?(u=isNaN(e)?1:0,i=l):(i=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-i))<1&&(i--,s*=2),(e+=i+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(i++,s/=2),i+p>=l?(u=0,i=l):i+p>=1?(u=(e*s-1)*Math.pow(2,o),i+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;t[r+_]=255&u,_+=h,u/=256,o-=8);for(i=i<0;t[r+_]=255&i,_+=h,i/=256,c-=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,a="function"==typeof TextDecoder?new TextDecoder:void 0,i="function"==typeof TextEncoder?new TextEncoder:void 0,u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},u.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,a="",i=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");a+=u[(e=r<<16|n<<8|o)>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}return i?a.slice(0,i-3)+"===".substring(i):a},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,A=function(t){return t.replace(g,v)},b=o?function(t){return e.from(t,"utf8").toString("base64")}:i?function(t){return y(i.encode(t))}:function(t){return d(A(t))},E=function(t,e){return void 0===e&&(e=!1),e?f(b(t)):b(t)},w=function(t){return E(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},S=function(t){return t.replace(C,x)},$=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",a=0;a>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:$,F=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},P=function(t){return F(I(t))},k=o?function(t){return e.from(t,"base64").toString("utf8")}:a?function(t){return a.decode(F(t))}:function(t){return S(O(t))},I=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return k(I(t))},L=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},T=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,L(e))};t("fromBase64",(function(){return R(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 P(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,L(e))};t("toBase64",(function(t){return m(this,t)})),t("toBase64URI",(function(){return m(this,!0)})),t("toBase64URL",(function(){return m(this,!0)}))},B={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:$,btoa:d,btoaPolyfill:h,fromBase64:R,toBase64:E,encode:E,encodeURI:w,encodeURL:w,utob:A,btou:S,decode:R,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:P,extendString:T,extendUint8Array:j,extendBuiltins:function(){T(),j()},Base64:{}};return Object.keys(B).forEach((function(t){return B.Base64[t]=B[t]})),B}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_75(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_65.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,a=r.password,i=r.servers,u=0;u({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const a=e.find(({source:e})=>e===t.source),i=t.start;if(a){const e=t.end,u=a.text[i.line-1],s=(i.line===e.line?e.column:u.length+1)-i.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${i.line}:${i.column}\n${"".padEnd(r)} |\n${i.line.toString().padStart(r)} | ${u}\n${"".padEnd(r)} | ${"".padEnd(i.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${i.line}:${i.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let a;a=(a=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let i=`${t}: ${e}`;n&&(i+=r(n,a));for(const u of o)i+=r(u.location,a,u.message);return i}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const a={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(a).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=a[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return a(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=a(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let i=0;i0?NEVER_MATCH:SOMETIMES_MATCH}const a=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=a(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-a(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=a(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});a(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function a(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function i(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},a=JSON.stringify(n),i=o.findIndex(t=>JSON.stringify(t)===a);return-1===i?o.push(n)-1:i}function u(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],h(t,{sp:r.sp+1,env:u(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=i(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function _(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const h=_$visitor_52.build({grammar(t){t.rules.forEach(h),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=h(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:a({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],h(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=h(e[0],{sp:r.sp,env:u(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=u(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=h(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),a=0|t.expression.match,p=n&&a!==__NEVER_MATCH_39?i(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(a,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(h(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=i(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=u(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),h(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],h(t.expression,{sp:e.sp+1,env:u(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(h(t.expression,{sp:e.sp,env:u(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,_(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(_(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>h(t.expression,{sp:e.sp,env:u(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?a({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?a({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?a({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});h(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const a=o.toString();return"absolute"===r?a:"scheme-relative"===r?a.slice(PROTOCOL.length):"path-absolute"===r?a.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,a)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(a){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&a>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const a=t.sourceContentFor(n);null!=a&&r.setSourceContent(n,a)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const a=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,i=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const u=e.source;null==u||a.has(u)||a.add(u);const s=e.name;null==s||i.has(s)||i.add(s)}),this),this._sources=a,this._names=i,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,a=1,i=0,u=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,_=p.length;f<_;f++){if(t="",(e=p[f]).generatedLine!==a)for(o=0;e.generatedLine!==a;)t+=";",a++;else if(f>0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-u),u=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-i),i=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let a=0;const i=function(){return t()+(t()||"");function t(){return a=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+i,0===i?o:0,e.source,i===a.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function a(t){return"peg$e"+t}function i(t){return"peg$f"+t}function u(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const a={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),a=n();return a.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{a.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),a.push("")),a.push(t,"","module.exports = "+o()+";"),a},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const a=Object.keys(e.dependencies),i="["+a.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",u=a.join(", ");return[...n(),"define("+i+", function("+u+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const a=Object.keys(e.dependencies),i=a.map(t=>e.dependencies[t]),u="["+i.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=i.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=a.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+u+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,a.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+u(t)).join(", ")+" }",p=u(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+a(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${i(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let _;function h(t,n){const o=n+3,a=s[c+o-2],i=s[c+o-1];let u,p;l.checkedIf(c,()=>{c+=o,u=e(s.slice(c,c+a)),c+=a},i>0?()=>{p=e(s.slice(c,c+i)),c+=i}:null),f.push("if ("+t+") {"),f.push(...u.map(r)),i>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function y(){const t=s[c+4-1],e=i(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(_)),c+=r;break}case _$opcodes_38.IF:h(l.top(),0);break;case _$opcodes_38.IF_ERROR:h(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:h(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:h("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:h(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:h("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:h(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+a(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:y();break;case _$opcodes_38.RULE:f.push(l.push(u(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",u(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,a)=>{var i;"rule"===(i=o).type&&"rule_ref"===i.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(a))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){a(t.expression,n(e))}const a=_$visitor_52.build({rule(t){a(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{a(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),a(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});a(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],a=_$visitor_52.build({rule(t){n.push(t.name),a(t.expression),n.pop()},sequence(e){e.elements.every(e=>(a(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const i=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",i.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));i&&a(i),o.pop()}});a(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eYt&&(Yt=Ht,zt=[]),zt.push(t))}function re(){var e,r,o,a,i,u;if(e=Ht,Re(),r=Ht,(o=function(){var e,r,o,a;return e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(E)),r!==n&&(o=Ie())!==n?(125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===Wt&&ee(w)),a!==n&&Le()!==n?(qt=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Kt()}}(o)):(Ht=e,e=n)):(Ht=e,e=n),e}())!==n?(a=Re(),r=o):(Ht=r,r=n),r===n&&(r=null),o=Ht,(a=function(){var t,e;return t=Ht,(e=Ie())!==n&&Le()!==n?(qt=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Kt()}}(e)):(Ht=t,t=n),t}())!==n?(i=Re(),o=a):(Ht=o,o=n),o===n&&(o=null),a=[],i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n);else a=n;return a!==n?(qt=e,e={type:"grammar",topLevelInitializer:r,initializer:o,rules:a,location:Kt()}):(Ht=e,e=n),e}function ne(){var e,r,o,a,i,u,s,c;return e=Ht,(r=ve())!==n?(Re(),o=Ht,(a=be())!==n?(Re(),o=a):(Ht=o,o=n),o===n&&(o=null),61===t.charCodeAt(Ht)?(a="=",Ht++):(a=n,0===Wt&&ee(C)),a!==n?(Re(),(i=oe())!==n&&Le()!==n?(qt=e,s=o,c=i,e={type:"rule",name:(u=r)[0],nameLocation:u[1],expression:null!==s?{type:"named",name:s,expression:c,location:Kt()}:c,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n),e}function oe(){var e,r,o,a,i,u,s,c;if(e=Ht,(r=ae())!==n){for(o=[],a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===Wt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);a!==n;)o.push(a),a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===Wt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);qt=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Kt()}:s}else Ht=e,e=n;return e}function ae(){var t,e,r,o;return t=Ht,(e=function(){var t,e,r,o,a,i,u;if(t=Ht,(e=ie())!==n){for(r=[],o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);o!==n;)r.push(o),o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);qt=t,i=e,t=(u=r).length>0||"labeled"===i.type&&i.pick?{type:"sequence",elements:[i].concat(u),location:Kt()}:i}else Ht=t,t=n;return t}())!==n?(r=Ht,Re(),(o=Ie())!==n?r=o:(Ht=r,r=n),r===n&&(r=null),qt=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Kt()}:t}(e,r)):(Ht=t,t=n),t}function ie(){var e,r,o,a,i,u,s;return e=Ht,(r=function(){var e,r;return e=Ht,64===t.charCodeAt(Ht)?(r="@",Ht++):(r=n,0===Wt&&ee(S)),r!==n&&(qt=e,r=Kt()),r}())!==n?((o=ue())===n&&(o=null),(a=se())!==n?(qt=e,i=r,u=o,(s=a).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',i),e={type:"labeled",label:null!==u?u[0]:null,labelLocation:null!==u?u[1]:i,pick:!0,expression:s,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=Ht,(r=ue())!==n?(o=Re(),(a=se())!==n?(qt=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Kt()}}(r,a)):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=se())),e}function ue(){var e,r,o,a;return e=Ht,(r=ve())!==n?(Re(),58===t.charCodeAt(Ht)?(o=":",Ht++):(o=n,0===Wt&&ee($)),o!==n?(qt=e,a=r,Te.indexOf(a[0])>=0&&Vt(`Label can't be a reserved word "${a[0]}"`,a[1]),e=a):(Ht=e,e=n)):(Ht=e,e=n),e}function se(){var e,r,o,a;return e=Ht,(r=function(){var e;return 36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P)))),e}())!==n?(Re(),(o=ce())!==n?(qt=e,a=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:a,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,a;return e=Ht,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Ht)?(e="?",Ht++):(e=n,0===Wt&&ee(k)),e===n&&(42===t.charCodeAt(Ht)?(e="*",Ht++):(e=n,0===Wt&&ee(I)),e===n&&(43===t.charCodeAt(Ht)?(e="+",Ht++):(e=n,0===Wt&&ee(R)))),e}())!==n?(qt=e,a=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:a,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,a,i;return(e=function(){var e,r,o;return Wt++,e=Ht,(r=be())!==n?(105===t.charCodeAt(Ht)?(o="i",Ht++):(o=n,0===Wt&&ee(ut)),o===n&&(o=null),qt=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Kt()}):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(it)),e}())===n&&(e=function(){var e,r,o,a,i,u,s,c;if(Wt++,e=Ht,91===t.charCodeAt(Ht)?(r="[",Ht++):(r=n,0===Wt&&ee(ft)),r!==n){for(94===t.charCodeAt(Ht)?(o="^",Ht++):(o=n,0===Wt&&ee(_t)),o===n&&(o=null),a=[],(i=Ce())===n&&(i=xe());i!==n;)a.push(i),(i=Ce())===n&&(i=xe());93===t.charCodeAt(Ht)?(i="]",Ht++):(i=n,0===Wt&&ee(ht)),i!==n?(105===t.charCodeAt(Ht)?(u="i",Ht++):(u=n,0===Wt&&ee(ut)),u===n&&(u=null),qt=e,s=o,c=u,e={type:"class",parts:a.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Kt()}):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Ht,46===t.charCodeAt(Ht)?(r=".",Ht++):(r=n,0===Wt&&ee($t)),r!==n&&(qt=e,r={type:"any",location:Kt()}),r}())===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,(r=ve())!==n?(o=Ht,Wt++,a=Ht,i=Re(),u=Ht,(s=be())!==n?u=s=[s,Re()]:(Ht=u,u=n),u===n&&(u=null),61===t.charCodeAt(Ht)?(s="=",Ht++):(s=n,0===Wt&&ee(C)),s!==n?a=i=[i,u,s]:(Ht=a,a=n),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e={type:"rule_ref",name:r[0],location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Ht,(r=function(){var e;return 38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P))),e}())!==n?(Re(),(o=Ie())!==n?(qt=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Kt()}}(r,o)):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Ht,40===t.charCodeAt(Ht)?(r="(",Ht++):(r=n,0===Wt&&ee(L)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Ht)?(a=")",Ht++):(a=n,0===Wt&&ee(T)),a!==n?(qt=e,e="labeled"===(i=o).type||"sequence"===i.type?{type:"group",expression:i,location:Kt()}:i):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n)),e}function pe(){var e;return t.length>Ht?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(j)),e}function fe(){var e;return Wt++,9===t.charCodeAt(Ht)?(e="\t",Ht++):(e=n,0===Wt&&ee(D)),e===n&&(11===t.charCodeAt(Ht)?(e="\v",Ht++):(e=n,0===Wt&&ee(N)),e===n&&(12===t.charCodeAt(Ht)?(e="\f",Ht++):(e=n,0===Wt&&ee(M)),e===n&&(32===t.charCodeAt(Ht)?(e=" ",Ht++):(e=n,0===Wt&&ee(U)),e===n&&(160===t.charCodeAt(Ht)?(e="\xa0",Ht++):(e=n,0===Wt&&ee(H)),e===n&&(65279===t.charCodeAt(Ht)?(e="\ufeff",Ht++):(e=n,0===Wt&&ee(q)),e===n&&(e=function(){var e;return b.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Mt)),e}())))))),Wt--,e===n&&0===Wt&&ee(B),e}function _e(){var e;return u.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(G)),e}function he(){var e;return Wt++,10===t.charCodeAt(Ht)?(e="\n",Ht++):(e=n,0===Wt&&ee(z)),e===n&&("\r\n"===t.substr(Ht,2)?(e="\r\n",Ht+=2):(e=n,0===Wt&&ee(W)),e===n&&(13===t.charCodeAt(Ht)?(e="\r",Ht++):(e=n,0===Wt&&ee(K)),e===n&&(8232===t.charCodeAt(Ht)?(e="\u2028",Ht++):(e=n,0===Wt&&ee(V)),e===n&&(8233===t.charCodeAt(Ht)?(e="\u2029",Ht++):(e=n,0===Wt&&ee(X)))))),Wt--,e===n&&0===Wt&&ee(Y),e}function de(){var e;return Wt++,(e=function(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===Wt&&ee(Q)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}())===n&&(e=me()),Wt--,e===n&&0===Wt&&ee(J),e}function ye(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u===n&&(u=_e()),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u===n&&(u=_e()),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===Wt&&ee(Q)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}function me(){var e,r,o,a,i,u;if(e=Ht,"//"===t.substr(Ht,2)?(r="//",Ht+=2):(r=n,0===Wt&&ee(tt)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,u=_e(),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,u=_e(),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);e=r=[r,o]}else Ht=e,e=n;return e}function ve(){var t,e,r,o;if(Wt++,t=Ht,(e=ge())!==n){for(r=[],o=Ae();o!==n;)r.push(o),o=Ae();qt=t,t=[e+r.join(""),Kt()]}else Ht=t,t=n;return Wt--,t===n&&(e=n,0===Wt&&ee(et)),t}function ge(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Lt)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Pt)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(kt)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(It)),e}())===n&&(e=function(){var e;return g.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Dt)),e}()),e}())===n&&(36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(95===t.charCodeAt(Ht)?(e="_",Ht++):(e=n,0===Wt&&ee(rt)),e===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Fe())!==n?e=o:(Ht=e,e=n)))),e}function Ae(){var e;return(e=ge())===n&&(e=function(){var e;return(e=function(){var e;return m.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(jt)),e}())===n&&(e=function(){var e;return y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Tt)),e}()),e}())===n&&(e=function(){var e;return v.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Bt)),e}())===n&&(e=function(){var e;return A.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Nt)),e}())===n&&(8204===t.charCodeAt(Ht)?(e="\u200c",Ht++):(e=n,0===Wt&&ee(ot)),e===n&&(8205===t.charCodeAt(Ht)?(e="\u200d",Ht++):(e=n,0===Wt&&ee(at)))),e}function be(){var e,r,o,a;if(Wt++,e=Ht,34===t.charCodeAt(Ht)?(r='"',Ht++):(r=n,0===Wt&&ee(ct)),r!==n){for(o=[],a=Ee();a!==n;)o.push(a),a=Ee();34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===Wt&&ee(ct)),a!==n?(qt=e,e=o.join("")):(Ht=e,e=n)}else Ht=e,e=n;if(e===n)if(e=Ht,39===t.charCodeAt(Ht)?(r="'",Ht++):(r=n,0===Wt&&ee(lt)),r!==n){for(o=[],a=we();a!==n;)o.push(a),a=we();39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===Wt&&ee(lt)),a!==n?(qt=e,e=function(t){return t.join("")}(o)):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(st)),e}function Ee(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===Wt&&ee(ct)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function we(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===Wt&&ee(lt)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Ce(){var e,r,o,a,i,u;return e=Ht,(r=xe())!==n?(45===t.charCodeAt(Ht)?(o="-",Ht++):(o=n,0===Wt&&ee(dt)),o!==n&&(a=xe())!==n?(qt=e,u=a,(i=r).charCodeAt(0)>u.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(qt,Ht)+"."),e=[i,u]):(Ht=e,e=n)):(Ht=e,e=n),e}function xe(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,93===t.charCodeAt(Ht)?(a="]",Ht++):(a=n,0===Wt&&ee(ht)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Se(){var e,r;return e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&he()!==n?(qt=e,e=""):(Ht=e,e=n),e}function $e(){var e,r,o,a;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,(a=function(){var e;return(e=Oe())===n&&(e=Pe())===n&&(120===t.charCodeAt(Ht)?(e="x",Ht++):(e=n,0===Wt&&ee(wt)),e===n&&(117===t.charCodeAt(Ht)?(e="u",Ht++):(e=n,0===Wt&&ee(Ct)))),e}())===n&&(a=_e()),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),r!==n?t.substring(e,Ht):r}()),e}())===n&&(e=Ht,48===t.charCodeAt(Ht)?(r="0",Ht++):(r=n,0===Wt&&ee(yt)),r!==n?(o=Ht,Wt++,a=Pe(),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e="\0"):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,120===t.charCodeAt(Ht)?(r="x",Ht++):(r=n,0===Wt&&ee(wt)),r!==n?(o=Ht,a=Ht,(i=ke())!==n&&(u=ke())!==n?a=i=[i,u]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(qt=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Fe())),e}function Oe(){var e,r;return 39===t.charCodeAt(Ht)?(e="'",Ht++):(e=n,0===Wt&&ee(lt)),e===n&&(34===t.charCodeAt(Ht)?(e='"',Ht++):(e=n,0===Wt&&ee(ct)),e===n&&(92===t.charCodeAt(Ht)?(e="\\",Ht++):(e=n,0===Wt&&ee(nt)),e===n&&(e=Ht,98===t.charCodeAt(Ht)?(r="b",Ht++):(r=n,0===Wt&&ee(mt)),r!==n&&(qt=e,r="\b"),(e=r)===n&&(e=Ht,102===t.charCodeAt(Ht)?(r="f",Ht++):(r=n,0===Wt&&ee(vt)),r!==n&&(qt=e,r="\f"),(e=r)===n&&(e=Ht,110===t.charCodeAt(Ht)?(r="n",Ht++):(r=n,0===Wt&&ee(gt)),r!==n&&(qt=e,r="\n"),(e=r)===n&&(e=Ht,114===t.charCodeAt(Ht)?(r="r",Ht++):(r=n,0===Wt&&ee(At)),r!==n&&(qt=e,r="\r"),(e=r)===n&&(e=Ht,116===t.charCodeAt(Ht)?(r="t",Ht++):(r=n,0===Wt&&ee(bt)),r!==n&&(qt=e,r="\t"),(e=r)===n&&(e=Ht,118===t.charCodeAt(Ht)?(r="v",Ht++):(r=n,0===Wt&&ee(Et)),r!==n&&(qt=e,r="\v"),e=r)))))))),e}function Fe(){var e,r,o,a,i,u,s,c,l;return e=Ht,117===t.charCodeAt(Ht)?(r="u",Ht++):(r=n,0===Wt&&ee(Ct)),r!==n?(o=Ht,a=Ht,(i=ke())!==n&&(u=ke())!==n&&(s=ke())!==n&&(c=ke())!==n?a=i=[i,u,s,c]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(qt=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Ht=e,e=n)):(Ht=e,e=n),e}function Pe(){var e;return s.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(xt)),e}function ke(){var e;return c.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(St)),e}function Ie(){var e,r,o,a;return Wt++,e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(E)),r!==n?(o=function(){var e,r;return e=Ht,r=function e(){var r,o,a,i,u,s;if(r=Ht,o=[],a=[],i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;for(a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===Wt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n));a!==n;){if(o.push(a),a=[],i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===Wt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n))}return t.substring(r,Ht)}(),qt=e,r=function(t){return[t,Kt()]}(r)}(),125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===Wt&&ee(w)),a!==n?e=o:(Ht=e,e=n)):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=he())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=he())===n&&(e=de());return t}function Le(){var e,r,o,a;return e=Ht,r=Re(),59===t.charCodeAt(Ht)?(o=";",Ht++):(o=n,0===Wt&&ee(Ut)),o!==n?e=r=[r,o]:(Ht=e,e=n),e===n&&(e=Ht,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=ye());e!==n;)t.push(e),(e=fe())===n&&(e=ye());return t}(),(o=me())===n&&(o=null),(a=he())!==n?e=r=[r,o,a]:(Ht=e,e=n),e===n&&(e=Ht,r=Re(),(o=function(){var e,r;return e=Ht,Wt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=n,0===Wt&&ee(j)),Wt--,r===n?e=void 0:(Ht=e,e=n),e}())!==n?e=r=[r,o]:(Ht=e,e=n))),e}const Te=e.reservedWords||[];if((r=i())!==n&&Ht===t.length)return r;throw r!==n&&Ht{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(u[p]=f)}}catch(_){c.e(_)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},i),{},{name:u.remarks?_$base64_4.Base64.decode(u.remarks):i.server,"protocol-param":(0,_$utils_97.getIfNotBlank)(_$base64_4.Base64.decode(u.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_97.getIfNotBlank)(_$base64_4.Base64.decode(u.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={},a=___createForOfIteratorHelper_70(n);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(-1!==i.indexOf("=")){var u=___slicedToArray_70(i.split("="),2),s=u[0],c=u[1];o[s.trim()]=c.trim()}}}catch(h){a.e(h)}finally{a.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_97.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_97.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_97.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_97.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_97.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_97.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_97.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),_={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_97.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_97.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(_.network="ws",_["ws-opts"]={path:(0,_$utils_97.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_97.getIfNotBlank)(f.host)}},_.tls&&f.host&&(_.sni=f.host)),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$gist_96={};function ___typeof_96(t){return(___typeof_96="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_96(){___regeneratorRuntime_96=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=A(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=p.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_96(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function A(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,A(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=c(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_96(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_96(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_96(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_96(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_90(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_90(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_90(t){for(var e=1;e>>").concat(JSON.stringify(a,null,2))),t.prev=11,t.next=14,syncToGist(___defineProperty_90({},encodeURIComponent(a.name),{content:i}));case 14:u=t.sent,a.updated=(new Date).getTime(),s=JSON.parse(u.body),a.url=s.files[encodeURIComponent(a.name)].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_90.default.write(o,_$constants_67.ARTIFACTS_KEY),(0,_$response_92.success)(r,a),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),(0,_$response_92.failed)(r,new _$errors_91.InternalServerError("FAILED_TO_SYNC_ARTIFACT","Failed to sync artifact ".concat(n),"Reason: ".concat(t.t0)));case 25:case"end":return t.stop()}}),t,null,[[11,22]])})))).apply(this,arguments)}function syncAllArtifacts(t,e){return _syncAllArtifacts.apply(this,arguments)}function _syncAllArtifacts(){return(_syncAllArtifacts=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e,r){var n,o,a,i,u,s,c;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ___app_90.default.info("\u5f00\u59cb\u540c\u6b65\u6240\u6709\u8fdc\u7a0b\u914d\u7f6e..."),n=___app_90.default.read(_$constants_67.ARTIFACTS_KEY),o={},t.prev=3,t.next=6,Promise.all(n.map(function(){var t=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sync){t.next=6;break}return ___app_90.default.info("\u6b63\u5728\u540c\u6b65\u4e91\u914d\u7f6e\uff1a".concat(e.name,"...")),t.next=4,produceArtifact({type:e.type,name:e.source,platform:e.platform});case 4:r=t.sent,o[e.name]={content:r};case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return t.next=8,syncToGist(o);case 8:a=t.sent,i=JSON.parse(a.body),u=___createForOfIteratorHelper_90(n);try{for(u.s();!(s=u.n()).done;)(c=s.value).updated=(new Date).getTime(),c.url=i.files[c.name].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")}catch(e){u.e(e)}finally{u.f()}___app_90.default.write(n,_$constants_67.ARTIFACTS_KEY),___app_90.default.info("\u5168\u90e8\u8ba2\u9605\u540c\u6b65\u6210\u529f\uff01"),(0,_$response_92.success)(r),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(3),(0,_$response_92.failed)(r,new _$errors_91.InternalServerError("FAILED_TO_SYNC_ARTIFACTS","Failed to sync all artifacts","Reason: ".concat(t.t0))),___app_90.default.info("\u540c\u6b65\u8ba2\u9605\u5931\u8d25\uff0c\u539f\u56e0\uff1a".concat(t.t0));case 21:case"end":return t.stop()}}),t,null,[[3,17]])})))).apply(this,arguments)}function syncToGist(t){return _syncToGist.apply(this,arguments)}function _syncToGist(){return(_syncToGist=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r,n,o;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=___app_90.default.read(_$constants_67.SETTINGS_KEY),n=r.gistToken){t.next=3;break}return t.abrupt("return",Promise.reject("\u672a\u8bbe\u7f6eGist Token\uff01"));case 3:return o=new _gist.default({token:n,key:_$constants_67.ARTIFACT_REPOSITORY_KEY}),t.abrupt("return",o.upload(e));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function produceArtifact(t){return _produceArtifact.apply(this,arguments)}function _produceArtifact(){return(_produceArtifact=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r,n,o,a,i,u,s,c,l,p,f,_,h,d,y,m,v,g,A,b,E,w,C,x,S,$,O,F,P,k;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.type,n=e.name,"ShadowRocket"===(o=(o=e.platform)||"JSON")&&(o="Clash"),"subscription"!==r){t.next=40;break}if(a=___app_90.default.read(_$constants_67.SUBS_KEY),"local"!==(i=(0,_$database_93.findByName)(a,n)).source){t.next=10;break}u=i.content,t.next=13;break;case 10:return t.next=12,(0,___download_90.default)(i.url,i.ua);case 12:u=t.sent;case 13:return s=_proxyUtils.ProxyUtils.parse(u),t.next=16,_proxyUtils.ProxyUtils.process(s,i.process||[],o);case 16:s=t.sent,c={},l=___createForOfIteratorHelper_90(s),t.prev=19,l.s();case 21:if((p=l.n()).done){t.next=29;break}if(f=p.value,!c[f.name]){t.next=26;break}return ___app_90.default.notify("\ud83c\udf0d Sub-Store","\u26a0\ufe0f \u8ba2\u9605\u5305\u542b\u91cd\u590d\u8282\u70b9\uff01","\u8bf7\u4ed4\u7ec6\u68c0\u6d4b\u914d\u7f6e\uff01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"}),t.abrupt("break",29);case 26:c[f.name]=!0;case 27:t.next=21;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(19),l.e(t.t0);case 34:return t.prev=34,l.f(),t.finish(34);case 37:return t.abrupt("return",_proxyUtils.ProxyUtils.produce(s,o));case 40:if("collection"!==r){t.next=78;break}return _=___app_90.default.read(_$constants_67.SUBS_KEY),h=___app_90.default.read(_$constants_67.COLLECTIONS_KEY),d=(0,_$database_93.findByName)(h,n),y=d.subscriptions,m={},v=0,t.next=49,Promise.all(y.map(function(){var t=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r,n,a;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,_$database_93.findByName)(_,e),t.prev=1,___app_90.default.info("\u6b63\u5728\u5904\u7406\u5b50\u8ba2\u9605\uff1a".concat(r.name,"...")),"local"!==r.source){t.next=7;break}n=r.content,t.next=10;break;case 7:return t.next=9,(0,___download_90.default)(r.url,r.ua);case 9:n=t.sent;case 10:return a=_proxyUtils.ProxyUtils.parse(n),t.next=13,_proxyUtils.ProxyUtils.process(a,r.process||[],o);case 13:a=t.sent,m[e]=a,v++,___app_90.default.info("\u2705 \u5b50\u8ba2\u9605\uff1a".concat(r.name,"\u52a0\u8f7d\u6210\u529f\uff0c\u8fdb\u5ea6--").concat(100*(v/y.length).toFixed(1),"% ")),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(1),v++,___app_90.default.error("\u274c \u5904\u7406\u7ec4\u5408\u8ba2\u9605\u4e2d\u7684\u5b50\u8ba2\u9605: ".concat(r.name,"\u65f6\u51fa\u73b0\u9519\u8bef\uff1a").concat(t.t0,"\uff0c\u8be5\u8ba2\u9605\u5df2\u88ab\u8df3\u8fc7\uff01\u8fdb\u5ea6--").concat(100*(v/y.length).toFixed(1),"%"));case 23:case"end":return t.stop()}}),t,null,[[1,19]])})));return function(e){return t.apply(this,arguments)}}()));case 49:return g=Array.prototype.concat.apply([],y.map((function(t){return m[t]}))),t.next=52,_proxyUtils.ProxyUtils.process(g,d.process||[],o);case 52:if(0!==(g=t.sent).length){t.next=55;break}throw new Error("\u7ec4\u5408\u8ba2\u9605\u4e2d\u4e0d\u542b\u6709\u6548\u8282\u70b9\uff01");case 55:A={},b=___createForOfIteratorHelper_90(g),t.prev=57,b.s();case 59:if((E=b.n()).done){t.next=67;break}if(w=E.value,!A[w.name]){t.next=64;break}return ___app_90.default.notify("\ud83c\udf0d Sub-Store","\u26a0\ufe0f \u8ba2\u9605\u5305\u542b\u91cd\u590d\u8282\u70b9\uff01","\u8bf7\u4ed4\u7ec6\u68c0\u6d4b\u914d\u7f6e\uff01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"}),t.abrupt("break",67);case 64:A[w.name]=!0;case 65:t.next=59;break;case 67:t.next=72;break;case 69:t.prev=69,t.t1=t.catch(57),b.e(t.t1);case 72:return t.prev=72,b.f(),t.finish(72);case 75:return t.abrupt("return",_proxyUtils.ProxyUtils.produce(g,o));case 78:if("rule"!==r){t.next=105;break}C=___app_90.default.read(_$constants_67.RULES_KEY),x=(0,_$database_93.findByName)(C,n),S=[],$=0;case 83:if(!($=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_89(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_89(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_89(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_89(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_89(a,n,o,i,u,"throw",t)}i(void 0)}))}}function doSync(){return _doSync.apply(this,arguments)}function _doSync(){return(_doSync=___asyncToGenerator_89(___regeneratorRuntime_89().mark((function t(){var e,r,n,o,a,i,u;return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return 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 Sub-Store Sync -- v".concat(_$package_66.version,"\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")),___app_89.default.info("\u5f00\u59cb\u540c\u6b65\u6240\u6709\u8fdc\u7a0b\u914d\u7f6e..."),e=___app_89.default.read(_$constants_67.ARTIFACTS_KEY),r={},t.prev=4,t.next=7,Promise.all(e.map(function(){var t=___asyncToGenerator_89(___regeneratorRuntime_89().mark((function t(e){var n;return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sync){t.next=6;break}return ___app_89.default.info("\u6b63\u5728\u540c\u6b65\u4e91\u914d\u7f6e\uff1a".concat(e.name,"...")),t.next=4,(0,_$artifacts_90.produceArtifact)({type:e.type,name:e.source,platform:e.platform});case 4:n=t.sent,r[e.name]={content:n};case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 7:return t.next=9,(0,_$artifacts_90.syncToGist)(r);case 9:n=t.sent,o=JSON.parse(n.body),a=___createForOfIteratorHelper_89(e);try{for(a.s();!(i=a.n()).done;)(u=i.value).updated=(new Date).getTime(),u.url=o.files[u.name].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")}catch(s){a.e(s)}finally{a.f()}___app_89.default.write(e,_$constants_67.ARTIFACTS_KEY),___app_89.default.notify("\ud83c\udf0d Sub-Store","\u5168\u90e8\u8ba2\u9605\u540c\u6b65\u6210\u529f\uff01"),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(4),___app_89.default.notify("\ud83c\udf0d Sub-Store","\u540c\u6b65\u8ba2\u9605\u5931\u8d25","\u539f\u56e0\uff1a".concat(t.t0)),___app_89.default.error("\u65e0\u6cd5\u540c\u6b65\u8ba2\u9605\u914d\u7f6e\u5230 Gist\uff0c\u539f\u56e0\uff1a".concat(t.t0));case 21:case"end":return t.stop()}}),t,null,[[4,17]])})))).apply(this,arguments)}___asyncToGenerator_89(___regeneratorRuntime_89().mark((function t(){var e,r;return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=___app_89.default.read(_$constants_67.SETTINGS_KEY)).githubUser&&e.gistToken){t.next=3;break}return t.abrupt("return");case 3:if((r=___app_89.default.read(_$constants_67.ARTIFACTS_KEY))&&0!==r.length){t.next=6;break}return t.abrupt("return");case 6:if(!r.some((function(t){return t.sync}))){t.next=10;break}return t.next=10,doSync();case 10:case"end":return t.stop()}}),t)})))().finally((function(){return ___app_89.default.done()}))}(); \ 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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_95),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),a=c(_$preprocessors_75),i=c(_$producers_78),u=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function _(){}function h(){}function d(){}var y={};s(y,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==e&&n.call(v,a)&&(y=v);var g=d.prototype=_.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||h(t,e)||function(){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 _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function h(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],a=x.length>2?x[2]:void 0,i=_(r),t.prev=3,i.s();case 5:if((u=i.n()).done){t.next=39;break}if(c=u.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(h=c.args,d=h.mode,y=h.content,"link"!==d){t.next=27;break}if((v=(m=y).split("#")).length>1){g=_(v[1].split("&"));try{for(g.s();!(A=g.n()).done;)b=A.value,E=b.split("=")[0],w=b.split("=")[1]||!0,f[E]=w}catch(l){g.e(l)}finally{g.f()}}return t.prev=15,t.next=18,(0,n.default)(m.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=y;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,a,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),i.e(t.t1);case 44:return t.prev=44,i.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(y=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){p(a,n,o,i,u,"next",t)}function u(t){p(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var m={parse:function(t){t=function(t){var e,r=_(a.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.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,n=[],o=_(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value;if(0!==(i=i.trim()).length){var c=!1;if(e){var l=f(v(e,i),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var h,d=_(u.default);try{for(d.s();!(h=d.n()).done;){var y=h.value,m=f(v(y,i),2),g=m[0];if(!m[1]){n.push(g),e=y,c=!0,s.default.info("".concat(y.name," is activated"));break}}}catch(A){d.e(A)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(i))}}}catch(A){o.e(A)}finally{o.f()}return n},process:function(t){return y.apply(this,arguments)},produce:function(t,e){var r=i.default[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])})),s.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 s.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}};function v(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=m})),_$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 a(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|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(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(L(e,ArrayBuffer)||e&&L(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(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 a=!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 I(t).length;default:if(a)return o?-1:k(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),T(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var a,i=1,u=t.length,s=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;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(a=r;au&&(r=u-s),a=r;a>=0;a--){for(var p=!0,f=0;fo&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i>8,o=r%256,a.push(o),a.push(n);return a}(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=t[o+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=A)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 w(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 C(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,a){if(L(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===a&&(a=this.length),e<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(o>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(i,u),c=this.slice(o,a),l=t.slice(e,n),p=0;p>>=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 a=!1;;)switch(n){case"hex":return f(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(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function b(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,n,o,a,i){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function $(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||$(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||$(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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);S(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a>0)-u&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);S(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return F(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;--i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return a},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 a=t.charCodeAt(0);("utf8"===o&&a<128||"latin1"===o)&&(t=a)}}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(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.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;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function I(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function L(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function T(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return I.apply(this,arguments)},e.default=void 0;var n=u(_$resourceCache_100),o=u(_$lodash_35),a=u(_$app_68),i=_$proxyUtils_69({});function u(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function _(){}function h(){}function d(){}var y={};c(y,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==e&&n.call(v,a)&&(y=v);var g=d.prototype=_.prototype=Object.create(y);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){c(a,n,o,i,u,"next",t)}function u(t){c(a,n,o,i,u,"throw",t)}i(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function f(t,e){if(t){if("string"==typeof t)return _(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)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return S(t)})),e.sort((function(e,r){var n=m(t,e.name),o=m(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=i[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){asyncGeneratorStep(a,n,o,i,u,"next",t)}function u(t){asyncGeneratorStep(a,n,o,i,u,"throw",t)}i(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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],a=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(a?"\n\u591a\u5a92\u4f53:"+a:""),{url:o}),isLoon){var i={};o&&(i.openUrl=o),a&&(i.mediaUrl=a),"{}"===JSON.stringify(i)?$notification.post(t,e,r):$notification.post(t,e,r,i)}if(isNode){var u=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(a?"\n\u591a\u5a92\u4f53: ".concat(a):"");console.log("".concat(t,"\n").concat(e,"\n").concat(u,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_102.OpenAPI=OpenAPI;var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_102.OpenAPI("sub-store");_$app_68.default=_default;var _$response_92={};Object.defineProperty(_$response_92,"__esModule",{value:!0}),_$response_92.failed=function(t,e,r){t.status(r||500).json({status:"failed",error:{code:e.code,type:e.type,message:e.message,details:e.details}})},_$response_92.success=function(t,e,r){t.status(r||200).json({status:"success",data:e})};var _$errors_91={};function ___typeof_91(t){return(___typeof_91="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 _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_getPrototypeOf(t);if(e){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===___typeof_91(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ___defineProperties_91(t,e){for(var r=0;r16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),a=0;a<16;a++)n[a]=909522486^r[a],o[a]=1549556828^r[a];var i=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(i),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return e}function rstr2any(t,e){var r,n,o,a,i,u=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(i[i.length]=o);l[n]=a,s=i}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i>>32-u,r);var i,u}function md5_ff(t,e,r,n,o,a,i){return md5_cmn(e&r|~e&n,t,e,o,a,i)}function md5_gg(t,e,r,n,o,a,i){return md5_cmn(e&n|r&~n,t,e,o,a,i)}function md5_hh(t,e,r,n,o,a,i){return md5_cmn(e^r^n,t,e,o,a,i)}function md5_ii(t,e,r,n,o,a,i){return md5_cmn(r^(e|~n),t,e,o,a,i)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$resourceCache_100={};Object.defineProperty(_$resourceCache_100,"__esModule",{value:!0}),_$resourceCache_100.default=void 0;var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(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(t,e):void 0}}(t,e)||function(){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 _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(_app.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){_app.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){_app.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?_app.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),_app.default.write(e,"#".concat(t))}}])&&___defineProperties_100(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_100.default=___default_100;var _$download_95={};Object.defineProperty(_$download_95,"__esModule",{value:!0}),_$download_95.default=function(t,e){return _download.apply(this,arguments)};var __obj_95,_resourceCache=(__obj_95=_$resourceCache_100)&&__obj_95.__esModule?__obj_95:{default:__obj_95};function ___typeof_95(t){return(___typeof_95="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_95(){___regeneratorRuntime_95=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=A(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=p.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_95(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function A(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,A(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=c(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_95(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_95().mark((function t(e,r){var n,o,a;return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_101.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_102.HTTP)({headers:{"User-Agent":r}}),a=new Promise((function(t,r){var a=_resourceCache.default.get(n);a?t(a):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,a),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_95(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_95(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$utils_98={};Object.defineProperty(_$utils_98,"__esModule",{value:!0}),_$utils_98.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_98.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_98.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_98.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_98.isNotBlank=isNotBlank,_$utils_98.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_99={};function ___arrayLikeToArray_99(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,L=RegExp(I.source),T=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,N=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,q=RegExp(H.source),G=/^\s+/,Y=/\s/,z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Q=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,at=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,it=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",_t="[a-z\\xdf-\\xf6\\xf8-\\xff]",ht="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",yt="[^\\ud800-\\udfff]",mt="(?:\\ud83c[\\udde6-\\uddff]){2}",vt="[\\ud800-\\udbff][\\udc00-\\udfff]",gt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+_t+"|"+ht+")",bt="(?:"+gt+"|"+ht+")",Et="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+Et+"(?:\\u200d(?:"+[yt,mt,vt].join("|")+")[\\ufe0e\\ufe0f]?"+Et+")*",Ct="(?:"+["[\\u2700-\\u27bf]",mt,vt].join("|")+")"+wt,xt="(?:"+[yt+pt+"?",pt,mt,vt,"[\\ud800-\\udfff]"].join("|")+")",St=RegExp("['\u2019]","g"),$t=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Ft=RegExp([gt+"?"+_t+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,gt,"$"].join("|")+")",bt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,gt+At,"$"].join("|")+")",gt+"?"+At+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",gt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,It=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,Lt={};Lt[b]=Lt[E]=Lt[w]=Lt[C]=Lt[x]=Lt[S]=Lt["[object Uint8ClampedArray]"]=Lt[$]=Lt[O]=!0,Lt[o]=Lt[a]=Lt[g]=Lt[i]=Lt[A]=Lt[u]=Lt[s]=Lt[c]=Lt[p]=Lt[f]=Lt[_]=Lt[h]=Lt[d]=Lt[y]=Lt[v]=!1;var Tt={};Tt[o]=Tt[a]=Tt[g]=Tt[A]=Tt[i]=Tt[u]=Tt[b]=Tt[E]=Tt[w]=Tt[C]=Tt[x]=Tt[p]=Tt[f]=Tt[_]=Tt[h]=Tt[d]=Tt[y]=Tt[m]=Tt[S]=Tt["[object Uint8ClampedArray]"]=Tt[$]=Tt[O]=!0,Tt[s]=Tt[c]=Tt[v]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bt=parseFloat,Dt=parseInt,Nt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Nt||Mt||Function("return this")(),Ht="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,qt=Ht&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,Gt=qt&&qt.exports===Ht,Yt=Gt&&Nt.process,zt=function(){try{return qt&&qt.require&&qt.require("util").types||Yt&&Yt.binding&&Yt.binding("util")}catch(t){}}(),Wt=zt&&zt.isArrayBuffer,Kt=zt&&zt.isDate,Vt=zt&&zt.isMap,Xt=zt&&zt.isRegExp,Jt=zt&&zt.isSet,Zt=zt&&zt.isTypedArray;function Qt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,a=null==t?0:t.length;++o-1}function ie(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Fe(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Pe=Ae({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),ke=Ae({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ie(t){return"\\"+jt[t]}function Re(t){return Pt.test(t)}function Le(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Te(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,a=0,i=[];++n",""":'"',"'":"'"}),qe=function t(Y){var st,ct=(Y=null==Y?Ut:qe.defaults(Ut.Object(),Y,qe.pick(Ut,It))).Array,lt=Y.Date,pt=Y.Error,ft=Y.Function,_t=Y.Math,ht=Y.Object,dt=Y.RegExp,yt=Y.String,mt=Y.TypeError,vt=ct.prototype,gt=ft.prototype,At=ht.prototype,bt=Y["__core-js_shared__"],Et=gt.toString,wt=At.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=At.toString,Pt=Et.call(ht),jt=Ut._,Nt=dt("^"+Et.call(wt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=Gt?Y.Buffer:void 0,Ht=Y.Symbol,qt=Y.Uint8Array,Yt=Mt?Mt.allocUnsafe:void 0,zt=Te(ht.getPrototypeOf,ht),fe=ht.create,Ae=At.propertyIsEnumerable,Ge=vt.splice,Ye=Ht?Ht.isConcatSpreadable:void 0,ze=Ht?Ht.iterator:void 0,We=Ht?Ht.toStringTag:void 0,Ke=function(){try{var t=Qo(ht,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=Y.clearTimeout!==Ut.clearTimeout&&Y.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=Y.setTimeout!==Ut.setTimeout&&Y.setTimeout,Ze=_t.ceil,Qe=_t.floor,tr=ht.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=Y.isFinite,nr=vt.join,or=Te(ht.keys,ht),ar=_t.max,ir=_t.min,ur=lt.now,sr=Y.parseInt,cr=_t.random,lr=vt.reverse,pr=Qo(Y,"DataView"),fr=Qo(Y,"Map"),_r=Qo(Y,"Promise"),hr=Qo(Y,"Set"),dr=Qo(Y,"WeakMap"),yr=Qo(ht,"create"),mr=dr&&new dr,vr={},gr=$a(pr),Ar=$a(fr),br=$a(_r),Er=$a(hr),wr=$a(dr),Cr=Ht?Ht.prototype:void 0,xr=Cr?Cr.valueOf:void 0,Sr=Cr?Cr.toString:void 0;function $r(t){if(Gi(t)&&!Ri(t)&&!(t instanceof kr)){if(t instanceof Pr)return t;if(wt.call(t,"__wrapped__"))return Oa(t)}return new Pr(t)}var Or=function(){function t(){}return function(e){if(!qi(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Fr(){}function Pr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function kr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ir(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,a,s){var v,F=1&e,P=2&e,k=4&e;if(r&&(v=a?r(t,n,a,s):r(t)),void 0!==v)return v;if(!qi(t))return t;var I=Ri(t);if(I){if(v=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!F)return mo(t,v)}else{var R=ra(t),L=R==c||R==l;if(Bi(t))return lo(t,F);if(R==_||R==o||L&&!a){if(v=P||L?{}:oa(t),!F)return P?function(t,e){return vo(t,ea(t),e)}(t,function(t,e){return t&&vo(e,bu(e),t)}(v,t)):function(t,e){return vo(t,ta(t),e)}(t,Yr(v,t))}else{if(!Tt[R])return a?t:{};v=function(t,e,r){var n,o,a,s=t.constructor;switch(e){case g:return po(t);case i:case u:return new s(+t);case A:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case b:case E:case w:case C:case x:case S:case"[object Uint8ClampedArray]":case $:case O:return fo(t,r);case p:return new s;case f:case y:return new s(t);case h:return(a=new(o=t).constructor(o.source,Q.exec(o))).lastIndex=o.lastIndex,a;case d:return new s;case m:return n=t,xr?ht(xr.call(n)):{}}}(t,R,F)}}s||(s=new jr);var T=s.get(t);if(T)return T;s.set(t,v),Vi(t)?t.forEach((function(n){v.add(Vr(n,e,r,n,t,s))})):Yi(t)&&t.forEach((function(n,o){v.set(o,Vr(n,e,r,o,t,s))}));var j=I?void 0:(k?P?zo:Yo:P?bu:Au)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Hr(v,o,Vr(n,e,r,o,t,s))})),v}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=ht(t);n--;){var o=r[n],a=e[o],i=t[o];if(void 0===i&&!(o in t)||!a(i))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new mt(e);return va((function(){t.apply(void 0,n)}),r)}function Zr(t,e,r,n){var o=-1,a=ae,i=!0,u=t.length,s=[],c=e.length;if(!u)return s;r&&(e=ue(e,xe(r))),n?(a=ie,i=!1):e.length>=200&&(a=$e,i=!1,e=new Tr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=qr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Lr.prototype.clear=function(){this.size=0,this.__data__={hash:new Ir,map:new(fr||Rr),string:new Ir}},Lr.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Lr.prototype.get=function(t){return Jo(this,t).get(t)},Lr.prototype.has=function(t){return Jo(this,t).has(t)},Lr.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Tr.prototype.add=Tr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Tr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Lr(n)}return r.set(t,e),this.size=r.size,this};var Qr=bo(sn),tn=bo(cn,!0);function en(t,e){var r=!0;return Qr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(u)?e>1?on(u,e-1,r,n,o):se(o,u):n||(o[o.length]=u)}return o}var an=Eo(),un=Eo(!0);function sn(t,e){return t&&an(t,e,Au)}function cn(t,e){return t&&un(t,e,Au)}function ln(t,e){return oe(e,(function(e){return Mi(t[e])}))}function pn(t,e){for(var r=0,n=(e=io(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function yn(t,e){return null!=t&&e in ht(t)}function mn(t,e,r){for(var n=r?ie:ae,o=t[0].length,a=t.length,i=a,u=ct(a),s=1/0,c=[];i--;){var l=t[i];i&&e&&(l=ue(l,xe(e))),s=ir(l.length,s),u[i]=!r&&(e||o>=120&&l.length>=120)?new Tr(i&&l):void 0}l=t[0];var p=-1,f=u[0];t:for(;++p=u?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}(Sn(t,(function(t,r,o){return{criteria:ue(e,(function(e){return e(t)})),index:++n,value:t}})))}function In(t,e,r){for(var n=-1,o=e.length,a={};++n-1;)u!==t&&Ge.call(u,s,1),Ge.call(t,s,1);return t}function Ln(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==a){var a=o;ia(o)?Ge.call(t,o,1):Zn(t,o)}}return t}function Tn(t,e){return t+Qe(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Qe(e/2))&&(t+=t)}while(e);return r}function Bn(t,e){return ga(ha(t,e,zu),t+"")}function Dn(t){return Dr(Fu(t))}function Nn(t,e){var r=Fu(t);return Ea(r,Kr(e,0,r.length))}function Mn(t,e,r,n){if(!qi(t))return t;for(var o=-1,a=(e=io(e,t)).length,i=a-1,u=t;null!=u&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=ct(o);++n>>1,i=t[a];null!==i&&!Ji(i)&&(r?i<=e:i=200){var c=e?null:Bo(t);if(c)return Be(c);i=!1,o=$e,s=new Tr}else s=e?[]:u;t:for(;++n=n?t:Gn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Yt?Yt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,a=Ji(t),i=void 0!==e,u=null===e,s=e==e,c=Ji(e);if(!u&&!c&&!a&&t>e||a&&i&&s&&!u&&!c||n&&i&&s||!r&&s||!o)return 1;if(!n&&!a&&!c&&t1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ua(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=ht(e);++n-1?o[a?e[i]:i]:void 0}}function $o(t){return Go((function(r){var n=r.length,o=n,a=Pr.prototype.thru;for(t&&r.reverse();o--;){var i=r[o];if("function"!=typeof i)throw new mt(e);if(a&&!u&&"wrapper"==Ko(i))var u=new Pr([],!0)}for(o=u?o:n;++o1&&v.reverse(),l&&su))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,_=2&r?new Tr:void 0;for(a.set(t,e),a.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(z,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ae(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(W);return e?e[1].split(K):[]}(o),r)))}function ba(t){var e=0,r=0;return function(){var n=ur(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ea(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Ka(t,r)}));function ei(t){var e=$r(t);return e.__chain__=!0,e}function ri(t,e){return e(t)}var ni=Go((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof kr&&ia(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new Pr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),oi=go((function(t,e,r){wt.call(t,r)?++t[r]:zr(t,r,1)})),ai=So(Ia),ii=So(Ra);function ui(t,e){return(Ri(t)?ee:Qr)(t,Xo(e,3))}function si(t,e){return(Ri(t)?re:tn)(t,Xo(e,3))}var ci=go((function(t,e,r){wt.call(t,r)?t[r].push(e):zr(t,r,[e])})),li=Bn((function(t,e,r){var n=-1,o="function"==typeof e,a=Ti(t)?ct(t.length):[];return Qr(t,(function(t){a[++n]=o?Qt(e,t,r):vn(t,e,r)})),a})),pi=go((function(t,e,r){zr(t,r,e)}));function fi(t,e){return(Ri(t)?ue:Sn)(t,Xo(e,3))}var _i=go((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),hi=Bn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ua(t,e[0],e[1])?e=[]:r>2&&ua(e[0],e[1],e[2])&&(e=[e[0]]),kn(t,on(e,1),[])})),di=Xe||function(){return Ut.Date.now()};function yi(t,e,r){return e=r?void 0:e,No(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function mi(t,r){var n;if("function"!=typeof r)throw new mt(e);return t=nu(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var vi=Bn((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(vi));n|=32}return No(t,n,e,r,o)})),gi=Bn((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(gi));n|=32}return No(e,n,t,r,o)}));function Ai(t,r,n){var o,a,i,u,s,c,l=0,p=!1,f=!1,_=!0;if("function"!=typeof t)throw new mt(e);function h(e){var r=o,n=a;return o=a=void 0,l=e,u=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function y(){var t=di();if(d(t))return m(t);s=va(y,function(t){var e=r-(t-c);return f?ir(e,i-(t-l)):e}(t))}function m(t){return s=void 0,_&&o?h(t):(o=a=void 0,u)}function v(){var t=di(),e=d(t);if(o=arguments,a=this,c=t,e){if(void 0===s)return function(t){return l=t,s=va(y,r),p?h(t):u}(c);if(f)return co(s),s=va(y,r),h(c)}return void 0===s&&(s=va(y,r)),u}return r=au(r)||0,qi(n)&&(p=!!n.leading,i=(f="maxWait"in n)?ar(au(n.maxWait)||0,r):i,_="trailing"in n?!!n.trailing:_),v.cancel=function(){void 0!==s&&co(s),l=0,o=c=a=s=void 0},v.flush=function(){return void 0===s?u:m(di())},v}var bi=Bn((function(t,e){return Jr(t,1,e)})),Ei=Bn((function(t,e,r){return Jr(t,au(e)||0,r)}));function wi(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new mt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,e);return n.cache=a.set(o,i)||a,i};return n.cache=new(wi.Cache||Lr),n}function Ci(t){if("function"!=typeof t)throw new mt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}wi.Cache=Lr;var xi=uo((function(t,e){var r=(e=1==e.length&&Ri(e[0])?ue(e[0],xe(Xo())):ue(on(e,1),xe(Xo()))).length;return Bn((function(n){for(var o=-1,a=ir(n.length,r);++o=e})),Ii=gn(function(){return arguments}())?gn:function(t){return Gi(t)&&wt.call(t,"callee")&&!Ae.call(t,"callee")},Ri=ct.isArray,Li=Wt?xe(Wt):function(t){return Gi(t)&&_n(t)==g};function Ti(t){return null!=t&&Hi(t.length)&&!Mi(t)}function ji(t){return Gi(t)&&Ti(t)}var Bi=er||as,Di=Kt?xe(Kt):function(t){return Gi(t)&&_n(t)==u};function Ni(t){if(!Gi(t))return!1;var e=_n(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Wi(t)}function Mi(t){if(!qi(t))return!1;var e=_n(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ui(t){return"number"==typeof t&&t==nu(t)}function Hi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function qi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Gi(t){return null!=t&&"object"==typeof t}var Yi=Vt?xe(Vt):function(t){return Gi(t)&&ra(t)==p};function zi(t){return"number"==typeof t||Gi(t)&&_n(t)==f}function Wi(t){if(!Gi(t)||_n(t)!=_)return!1;var e=zt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==Pt}var Ki=Xt?xe(Xt):function(t){return Gi(t)&&_n(t)==h},Vi=Jt?xe(Jt):function(t){return Gi(t)&&ra(t)==d};function Xi(t){return"string"==typeof t||!Ri(t)&&Gi(t)&&_n(t)==y}function Ji(t){return"symbol"==typeof t||Gi(t)&&_n(t)==m}var Zi=Zt?xe(Zt):function(t){return Gi(t)&&Hi(t.length)&&!!Lt[_n(t)]},Qi=Lo(xn),tu=Lo((function(t,e){return t<=e}));function eu(t){if(!t)return[];if(Ti(t))return Xi(t)?Me(t):mo(t);if(ze&&t[ze])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ze]());var e=ra(t);return(e==p?Le:e==d?Be:Fu)(t)}function ru(t){return t?(t=au(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function nu(t){var e=ru(t),r=e%1;return e==e?r?e-r:e:0}function ou(t){return t?Kr(nu(t),0,4294967295):0}function au(t){if("number"==typeof t)return t;if(Ji(t))return NaN;if(qi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=qi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Dt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function iu(t){return vo(t,bu(t))}function uu(t){return null==t?"":Xn(t)}var su=Ao((function(t,e){if(pa(e)||Ti(e))vo(e,Au(e),t);else for(var r in e)wt.call(e,r)&&Hr(t,r,e[r])})),cu=Ao((function(t,e){vo(e,bu(e),t)})),lu=Ao((function(t,e,r,n){vo(e,bu(e),t,n)})),pu=Ao((function(t,e,r,n){vo(e,Au(e),t,n)})),fu=Go(Wr),_u=Bn((function(t,e){t=ht(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&ua(e[0],e[1],o)&&(n=1);++r1),e})),vo(t,zo(t),r),n&&(r=Vr(r,7,Ho));for(var o=e.length;o--;)Zn(r,e[o]);return r})),xu=Go((function(t,e){return null==t?{}:function(t,e){return In(t,e,(function(e,r){return yu(t,r)}))}(t,e)}));function Su(t,e){if(null==t)return{};var r=ue(zo(t),(function(t){return[t]}));return e=Xo(e),In(t,r,(function(t,r){return e(t,r[0])}))}var $u=Do(Au),Ou=Do(bu);function Fu(t){return null==t?[]:Se(t,Au(t))}var Pu=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?ku(e):e)}));function ku(t){return Nu(uu(t).toLowerCase())}function Iu(t){return(t=uu(t))&&t.replace(at,Pe).replace($t,"")}var Ru=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Lu=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Tu=wo("toLowerCase"),ju=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Bu=Co((function(t,e,r){return t+(r?" ":"")+Nu(e)})),Du=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Nu=wo("toUpperCase");function Mu(t,e,r){return t=uu(t),void 0===(e=r?void 0:e)?function(t){return kt.test(t)}(t)?function(t){return t.match(Ft)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Uu=Bn((function(t,e){try{return Qt(t,void 0,e)}catch(r){return Ni(r)?r:new pt(r)}})),Hu=Go((function(t,e){return ee(e,(function(e){e=Sa(e),zr(t,e,vi(t[e],t))})),t}));function qu(t){return function(){return t}}var Gu=$o(),Yu=$o(!0);function zu(t){return t}function Wu(t){return wn("function"==typeof t?t:Vr(t,1))}var Ku=Bn((function(t,e){return function(r){return vn(r,t,e)}})),Vu=Bn((function(t,e){return function(r){return vn(t,r,e)}}));function Xu(t,e,r){var n=Au(e),o=ln(e,n);null!=r||qi(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,Au(e)));var a=!(qi(r)&&"chain"in r&&!r.chain),i=Mi(t);return ee(o,(function(r){var n=e[r];t[r]=n,i&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=mo(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Ju(){}var Zu=ko(ue),Qu=ko(ne),ts=ko(pe);function es(t){return sa(t)?ge(Sa(t)):function(t){return function(e){return pn(e,t)}}(t)}var rs=Ro(),ns=Ro(!0);function os(){return[]}function as(){return!1}var is,us=Po((function(t,e){return t+e}),0),ss=jo("ceil"),cs=Po((function(t,e){return t/e}),1),ls=jo("floor"),ps=Po((function(t,e){return t*e}),1),fs=jo("round"),_s=Po((function(t,e){return t-e}),0);return $r.after=function(t,r){if("function"!=typeof r)throw new mt(e);return t=nu(t),function(){if(--t<1)return r.apply(this,arguments)}},$r.ary=yi,$r.assign=su,$r.assignIn=cu,$r.assignInWith=lu,$r.assignWith=pu,$r.at=fu,$r.before=mi,$r.bind=vi,$r.bindAll=Hu,$r.bindKey=gi,$r.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ri(t)?t:[t]},$r.chain=ei,$r.chunk=function(t,e,r){e=(r?ua(t,e,r):void 0===e)?1:ar(nu(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,a=0,i=ct(Ze(n/e));oo?0:o+r),(n=void 0===n||n>o?o:nu(n))<0&&(n+=o),n=r>n?0:ou(n);r>>0)?(t=uu(t))&&("string"==typeof e||null!=e&&!Ki(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},$r.spread=function(t,r){if("function"!=typeof t)throw new mt(e);return r=null==r?0:ar(nu(r),0),Bn((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Qt(t,this,o)}))},$r.tail=function(t){var e=null==t?0:t.length;return e?Gn(t,1,e):[]},$r.take=function(t,e,r){return t&&t.length?Gn(t,0,(e=r||void 0===e?1:nu(e))<0?0:e):[]},$r.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Gn(t,(e=n-(e=r||void 0===e?1:nu(e)))<0?0:e,n):[]},$r.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},$r.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},$r.tap=function(t,e){return e(t),t},$r.throttle=function(t,r,n){var o=!0,a=!0;if("function"!=typeof t)throw new mt(e);return qi(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),Ai(t,r,{leading:o,maxWait:r,trailing:a})},$r.thru=ri,$r.toArray=eu,$r.toPairs=$u,$r.toPairsIn=Ou,$r.toPath=function(t){return Ri(t)?ue(t,Sa):Ji(t)?[t]:mo(xa(uu(t)))},$r.toPlainObject=iu,$r.transform=function(t,e,r){var n=Ri(t),o=n||Bi(t)||Zi(t);if(e=Xo(e,4),null==r){var a=t&&t.constructor;r=o?n?new a:[]:qi(t)&&Mi(a)?Or(zt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},$r.unary=function(t){return yi(t,1)},$r.union=Ga,$r.unionBy=Ya,$r.unionWith=za,$r.uniq=function(t){return t&&t.length?Jn(t):[]},$r.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},$r.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},$r.unset=function(t,e){return null==t||Zn(t,e)},$r.unzip=Wa,$r.unzipWith=Ka,$r.update=function(t,e,r){return null==t?t:Qn(t,e,ao(r))},$r.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Qn(t,e,ao(r),n)},$r.values=Fu,$r.valuesIn=function(t){return null==t?[]:Se(t,bu(t))},$r.without=Va,$r.words=Mu,$r.wrap=function(t,e){return Si(ao(e),t)},$r.xor=Xa,$r.xorBy=Ja,$r.xorWith=Za,$r.zip=Qa,$r.zipObject=function(t,e){return no(t||[],e||[],Hr)},$r.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},$r.zipWith=ti,$r.entries=$u,$r.entriesIn=Ou,$r.extend=cu,$r.extendWith=lu,Xu($r,$r),$r.add=us,$r.attempt=Uu,$r.camelCase=Pu,$r.capitalize=ku,$r.ceil=ss,$r.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=au(r))==r?r:0),void 0!==e&&(e=(e=au(e))==e?e:0),Kr(au(t),e,r)},$r.clone=function(t){return Vr(t,4)},$r.cloneDeep=function(t){return Vr(t,5)},$r.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},$r.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},$r.conformsTo=function(t,e){return null==e||Xr(t,e,Au(e))},$r.deburr=Iu,$r.defaultTo=function(t,e){return null==t||t!=t?e:t},$r.divide=cs,$r.endsWith=function(t,e,r){t=uu(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Kr(nu(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},$r.eq=Fi,$r.escape=function(t){return(t=uu(t))&&T.test(t)?t.replace(R,ke):t},$r.escapeRegExp=function(t){return(t=uu(t))&&q.test(t)?t.replace(H,"\\$&"):t},$r.every=function(t,e,r){var n=Ri(t)?ne:en;return r&&ua(t,e,r)&&(e=void 0),n(t,Xo(e,3))},$r.find=ai,$r.findIndex=Ia,$r.findKey=function(t,e){return _e(t,Xo(e,3),sn)},$r.findLast=ii,$r.findLastIndex=Ra,$r.findLastKey=function(t,e){return _e(t,Xo(e,3),cn)},$r.floor=ls,$r.forEach=ui,$r.forEachRight=si,$r.forIn=function(t,e){return null==t?t:an(t,Xo(e,3),bu)},$r.forInRight=function(t,e){return null==t?t:un(t,Xo(e,3),bu)},$r.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},$r.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},$r.get=du,$r.gt=Pi,$r.gte=ki,$r.has=function(t,e){return null!=t&&na(t,e,dn)},$r.hasIn=yu,$r.head=Ta,$r.identity=zu,$r.includes=function(t,e,r,n){t=Ti(t)?t:Fu(t),r=r&&!n?nu(r):0;var o=t.length;return r<0&&(r=ar(o+r,0)),Xi(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},$r.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:nu(r);return o<0&&(o=ar(n+o,0)),de(t,e,o)},$r.inRange=function(t,e,r){return e=ru(e),void 0===r?(r=e,e=0):r=ru(r),function(t,e,r){return t>=ir(e,r)&&t=-9007199254740991&&t<=9007199254740991},$r.isSet=Vi,$r.isString=Xi,$r.isSymbol=Ji,$r.isTypedArray=Zi,$r.isUndefined=function(t){return void 0===t},$r.isWeakMap=function(t){return Gi(t)&&ra(t)==v},$r.isWeakSet=function(t){return Gi(t)&&"[object WeakSet]"==_n(t)},$r.join=function(t,e){return null==t?"":nr.call(t,e)},$r.kebabCase=Ru,$r.last=Na,$r.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=nu(r))<0?ar(n+o,0):ir(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):he(t,me,o,!0)},$r.lowerCase=Lu,$r.lowerFirst=Tu,$r.lt=Qi,$r.lte=tu,$r.max=function(t){return t&&t.length?rn(t,zu,hn):void 0},$r.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),hn):void 0},$r.mean=function(t){return ve(t,zu)},$r.meanBy=function(t,e){return ve(t,Xo(e,2))},$r.min=function(t){return t&&t.length?rn(t,zu,xn):void 0},$r.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},$r.stubArray=os,$r.stubFalse=as,$r.stubObject=function(){return{}},$r.stubString=function(){return""},$r.stubTrue=function(){return!0},$r.multiply=ps,$r.nth=function(t,e){return t&&t.length?Pn(t,nu(e)):void 0},$r.noConflict=function(){return Ut._===this&&(Ut._=jt),this},$r.noop=Ju,$r.now=di,$r.pad=function(t,e,r){t=uu(t);var n=(e=nu(e))?Ne(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return Io(Qe(o),r)+t+Io(Ze(o),r)},$r.padEnd=function(t,e,r){t=uu(t);var n=(e=nu(e))?Ne(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ir(t+o*(e-t+Bt("1e-"+((o+"").length-1))),e)}return Tn(t,e)},$r.reduce=function(t,e,r){var n=Ri(t)?ce:be,o=arguments.length<3;return n(t,Xo(e,4),r,o,Qr)},$r.reduceRight=function(t,e,r){var n=Ri(t)?le:be,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},$r.repeat=function(t,e,r){return e=(r?ua(t,e,r):void 0===e)?1:nu(e),jn(uu(t),e)},$r.replace=function(){var t=arguments,e=uu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$r.result=function(t,e,r){var n=-1,o=(e=io(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ir(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=a)return t;var u=r-Ne(n);if(u<1)return n;var s=i?so(i,0,u).join(""):t.slice(0,u);if(void 0===o)return s+n;if(i&&(u+=s.length-u),Ki(o)){if(t.slice(u).search(o)){var c,l=s;for(o.global||(o=dt(o.source,uu(Q.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?u:p)}}else if(t.indexOf(Xn(o),u)!=u){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},$r.unescape=function(t){return(t=uu(t))&&L.test(t)?t.replace(I,He):t},$r.uniqueId=function(t){var e=++Ct;return uu(t)+e},$r.upperCase=Du,$r.upperFirst=Nu,$r.each=ui,$r.eachRight=si,$r.first=Ta,Xu($r,(is={},sn($r,(function(t,e){wt.call($r.prototype,e)||(is[e]=t)})),is),{chain:!1}),$r.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$r[t].placeholder=$r})),ee(["drop","take"],(function(t,e){kr.prototype[t]=function(r){r=void 0===r?1:ar(nu(r),0);var n=this.__filtered__&&!e?new kr(this):this.clone();return n.__filtered__?n.__takeCount__=ir(r,n.__takeCount__):n.__views__.push({size:ir(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},kr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;kr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");kr.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");kr.prototype[t]=function(){return this.__filtered__?new kr(this):this[r](1)}})),kr.prototype.compact=function(){return this.filter(zu)},kr.prototype.find=function(t){return this.filter(t).head()},kr.prototype.findLast=function(t){return this.reverse().find(t)},kr.prototype.invokeMap=Bn((function(t,e){return"function"==typeof t?new kr(this):this.map((function(r){return vn(r,t,e)}))})),kr.prototype.reject=function(t){return this.filter(Ci(Xo(t)))},kr.prototype.slice=function(t,e){t=nu(t);var r=this;return r.__filtered__&&(t>0||e<0)?new kr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=nu(e))<0?r.dropRight(-e):r.take(e-t)),r)},kr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},kr.prototype.toArray=function(){return this.take(4294967295)},sn(kr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=$r[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);o&&($r.prototype[e]=function(){var e=this.__wrapped__,i=n?[1]:arguments,u=e instanceof kr,s=i[0],c=u||Ri(e),l=function(t){var e=o.apply($r,se([t],i));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,_=a&&!p,h=u&&!f;if(!a&&c){e=h?e:new kr(this);var d=t.apply(e,i);return d.__actions__.push({func:ri,args:[l],thisArg:void 0}),new Pr(d,p)}return _&&h?t.apply(this,i):(d=this.thru(l),_?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=vt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);$r.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ri(o)?o:[],t)}return this[r]((function(r){return e.apply(Ri(r)?r:[],t)}))}})),sn(kr.prototype,(function(t,e){var r=$r[e];if(r){var n=r.name+"";wt.call(vr,n)||(vr[n]=[]),vr[n].push({name:e,func:r})}})),vr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],kr.prototype.clone=function(){var t=new kr(this.__wrapped__);return t.__actions__=mo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mo(this.__views__),t},kr.prototype.reverse=function(){if(this.__filtered__){var t=new kr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},kr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ri(t),n=e<0,o=r?t.length:0,a=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$r.prototype.plant=function(t){for(var e,r=this;r instanceof Fr;){var n=Oa(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},$r.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof kr){var e=t;return this.__actions__.length&&(e=new kr(this)),(e=e.reverse()).__actions__.push({func:ri,args:[qa],thisArg:void 0}),new Pr(e,this.__chain__)}return this.thru(qa)},$r.prototype.toJSON=$r.prototype.valueOf=$r.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},$r.prototype.first=$r.prototype.head,ze&&($r.prototype[ze]=function(){return this}),$r}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=qe,define((function(){return qe}))):qt?((qt.exports=qe)._=qe,Ht._=qe):Ut._=qe}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",a=this.position;ae/2-1){o=" ... ",a-=5;break}return i=this.buffer.slice(n,a),_$common_7.repeat(" ",t)+r+i+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,a,i,u,s,c=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(a=+e[4],i=+e[5],u=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,a,i,u,c)),l&&s.setTime(s.getTime()-l),s},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,a=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,a=BASE64_MAP,i=0,u=[];for(e=0;e>16&255),u.push(i>>8&255),u.push(255&i)),i=i<<6|a.indexOf(n.charAt(e));return 0==(r=o%4*6)?(u.push(i>>16&255),u.push(i>>8&255),u.push(255&i)):18===r?(u.push(i>>10&255),u.push(i>>2&255)):12===r&&u.push(i>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(u):new NodeBuffer(u):u},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,a=t.length,i=BASE64_MAP;for(e=0;e>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]),o=(o<<8)+t[e];return 0==(r=a%3)?(n+=i[o>>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]):2===r?(n+=i[o>>10&63],n+=i[o>>4&63],n+=i[o<<2&63],n+=i[64]):1===r&&(n+=i[o>>2&63],n+=i[o<<4&63],n+=i[64],n+=i[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,a,i=[],u=t;for(e=0,r=u.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,a;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),a=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&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,a,i,u;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,a=t.anchor,i=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=i),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)i.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),i.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,p,f,_,h,a,i),f=_=h=null),skipSeparationSpace(t,!0,-1),u=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==u)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(a)){do{a=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!is_EOL(a)&&0!==a)}for(;0!==a;){for(readLineBreak(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(a))p++;else{if(t.lineIndent0){for(o=i,a=0;o>0;o--)(i=fromHexCode(u=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+i:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(a),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(u)?(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,p)?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,a,i,u,s,c,l,p=t.kind,f=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=a=t.position,i=!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(u=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){i=!0,l=t.input.charCodeAt(t.position);continue}t.position=a,t.line=u,t.lineStart=s,t.lineIndent=c;break}}i&&(captureSegment(t,o,a,!1),writeFoldedLines(t,t.line-u),o=a=t.position,i=!1),is_WHITE_SPACE(l)||(a=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,a,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=u&&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+'"'),s=0,c=t.implicitTypes.length;s 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,a=t.position,i=!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(i=!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)):i&&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(a,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(a-1):null,_=_&&isPlainSafe(i,u)}else{for(a=0;an&&" "!==t[f+1],f=a);else if(!isPrintable(i))return STYLE_DOUBLE;u=a>0?t.charCodeAt(a-1):null,_=_&&isPlainSafe(i,u)}l=l||p&&a-f-1>n&&" "!==t[f+1]}return c||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),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),i=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,i,t.indent,a,(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,a=/(\n+)([^\n]*)/g,i=(o=-1!==(o=t.indexOf("\n"))?o:t.length,a.lastIndex=o,foldLine(t.slice(0,o),e)),u="\n"===t[0]||" "===t[0];n=a.exec(t);){var s=n[1],c=n[2];r=" "===c[0],i+=s+(u||r||""===c?"":"\n")+foldLine(c,e),u=r}return i}(e,a),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",a=0;a=55296&&e<=56319&&(r=t.charCodeAt(a+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),a++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[a]: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,a=0,i=0,u=0,s="";r=o.exec(t);)(u=r.index)-a>e&&(n=i>a?i:u,s+="\n"+t.slice(a,n),a=n+1),i=u;return s+="\n",t.length-a>e&&i>a?s+=t.slice(a,i)+"\n"+t.slice(i+1):s+=t.slice(a),s.slice(1)}function detectType(t,e,r){var n,o,a,i,u,s;for(a=0,i=(o=r?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+s+'" style');n=u.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,a){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var i=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var u,s,c="[object Object]"===i||"[object Array]"===i;if(c&&(s=-1!==(u=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(c&&s&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===i)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,a,i,u,s,c,l="",p=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,a=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,u,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+u+t.dump)):(function(t,e,r){var n,o,a,i,u,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,i,!1,!1)&&(s+=u+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===i){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,a,i="",u=t.tag;for(o=0,a=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],a=[];for(function t(e,r,n){var o,a,i;if(null!==e&&"object"==typeof e)if(-1!==(a=r.indexOf(e)))-1===n.indexOf(a)&&n.push(a);else if(r.push(e),Array.isArray(e))for(a=0,i=e.length;a0?o-4:o;for(r=0;r>16&255,i[u++]=e>>8&255,i[u++]=255&e;return 2===a&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,i[u++]=255&e),1===a&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,i[u++]=e>>8&255,i[u++]=255&e),i},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],a=0,i=r-n;ai?i:a+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,a=[],i=e;i>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return a.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var a,i,u=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,_=t[e+p];for(p+=f,a=_&(1<<-l)-1,_>>=-l,l+=u;l>0;a=256*a+t[e+p],p+=f,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+t[e+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(_?-1:1);i+=Math.pow(2,n),a-=c}return(_?-1:1)*i*Math.pow(2,a-n)},write:function(t,e,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-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?(u=isNaN(e)?1:0,i=l):(i=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-i))<1&&(i--,s*=2),(e+=i+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(i++,s/=2),i+p>=l?(u=0,i=l):i+p>=1?(u=(e*s-1)*Math.pow(2,o),i+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;t[r+_]=255&u,_+=h,u/=256,o-=8);for(i=i<0;t[r+_]=255&i,_+=h,i/=256,c-=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,a="function"==typeof TextDecoder?new TextDecoder:void 0,i="function"==typeof TextEncoder?new TextEncoder:void 0,u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},u.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,a="",i=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");a+=u[(e=r<<16|n<<8|o)>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}return i?a.slice(0,i-3)+"===".substring(i):a},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,A=function(t){return t.replace(g,v)},b=o?function(t){return e.from(t,"utf8").toString("base64")}:i?function(t){return y(i.encode(t))}:function(t){return d(A(t))},E=function(t,e){return void 0===e&&(e=!1),e?f(b(t)):b(t)},w=function(t){return E(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},S=function(t){return t.replace(C,x)},$=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",a=0;a>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:$,F=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},P=function(t){return F(I(t))},k=o?function(t){return e.from(t,"base64").toString("utf8")}:a?function(t){return a.decode(F(t))}:function(t){return S(O(t))},I=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return k(I(t))},L=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},T=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,L(e))};t("fromBase64",(function(){return R(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 P(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,L(e))};t("toBase64",(function(t){return m(this,t)})),t("toBase64URI",(function(){return m(this,!0)})),t("toBase64URL",(function(){return m(this,!0)}))},B={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:$,btoa:d,btoaPolyfill:h,fromBase64:R,toBase64:E,encode:E,encodeURI:w,encodeURL:w,utob:A,btou:S,decode:R,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:P,extendString:T,extendUint8Array:j,extendBuiltins:function(){T(),j()},Base64:{}};return Object.keys(B).forEach((function(t){return B.Base64[t]=B[t]})),B}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_75(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_65.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,a=r.password,i=r.servers,u=0;u({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const a=e.find(({source:e})=>e===t.source),i=t.start;if(a){const e=t.end,u=a.text[i.line-1],s=(i.line===e.line?e.column:u.length+1)-i.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${i.line}:${i.column}\n${"".padEnd(r)} |\n${i.line.toString().padStart(r)} | ${u}\n${"".padEnd(r)} | ${"".padEnd(i.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${i.line}:${i.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let a;a=(a=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let i=`${t}: ${e}`;n&&(i+=r(n,a));for(const u of o)i+=r(u.location,a,u.message);return i}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const a={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(a).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=a[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return a(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=a(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let i=0;i0?NEVER_MATCH:SOMETIMES_MATCH}const a=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=a(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-a(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=a(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});a(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function a(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function i(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},a=JSON.stringify(n),i=o.findIndex(t=>JSON.stringify(t)===a);return-1===i?o.push(n)-1:i}function u(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],h(t,{sp:r.sp+1,env:u(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=i(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function _(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const h=_$visitor_52.build({grammar(t){t.rules.forEach(h),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=h(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:a({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],h(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=h(e[0],{sp:r.sp,env:u(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=u(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=h(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),a=0|t.expression.match,p=n&&a!==__NEVER_MATCH_39?i(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(a,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(h(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=i(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=u(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),h(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],h(t.expression,{sp:e.sp+1,env:u(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(h(t.expression,{sp:e.sp,env:u(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,_(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(_(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>h(t.expression,{sp:e.sp,env:u(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?a({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?a({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?a({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});h(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const a=o.toString();return"absolute"===r?a:"scheme-relative"===r?a.slice(PROTOCOL.length):"path-absolute"===r?a.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,a)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(a){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&a>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const a=t.sourceContentFor(n);null!=a&&r.setSourceContent(n,a)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const a=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,i=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const u=e.source;null==u||a.has(u)||a.add(u);const s=e.name;null==s||i.has(s)||i.add(s)}),this),this._sources=a,this._names=i,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,a=1,i=0,u=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,_=p.length;f<_;f++){if(t="",(e=p[f]).generatedLine!==a)for(o=0;e.generatedLine!==a;)t+=";",a++;else if(f>0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-u),u=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-i),i=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let a=0;const i=function(){return t()+(t()||"");function t(){return a=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+i,0===i?o:0,e.source,i===a.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function a(t){return"peg$e"+t}function i(t){return"peg$f"+t}function u(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const a={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),a=n();return a.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{a.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),a.push("")),a.push(t,"","module.exports = "+o()+";"),a},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const a=Object.keys(e.dependencies),i="["+a.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",u=a.join(", ");return[...n(),"define("+i+", function("+u+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const a=Object.keys(e.dependencies),i=a.map(t=>e.dependencies[t]),u="["+i.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=i.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=a.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+u+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,a.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+u(t)).join(", ")+" }",p=u(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+a(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${i(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let _;function h(t,n){const o=n+3,a=s[c+o-2],i=s[c+o-1];let u,p;l.checkedIf(c,()=>{c+=o,u=e(s.slice(c,c+a)),c+=a},i>0?()=>{p=e(s.slice(c,c+i)),c+=i}:null),f.push("if ("+t+") {"),f.push(...u.map(r)),i>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function y(){const t=s[c+4-1],e=i(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(_)),c+=r;break}case _$opcodes_38.IF:h(l.top(),0);break;case _$opcodes_38.IF_ERROR:h(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:h(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:h("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:h(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:h("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:h(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+a(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:y();break;case _$opcodes_38.RULE:f.push(l.push(u(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",u(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,a)=>{var i;"rule"===(i=o).type&&"rule_ref"===i.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(a))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){a(t.expression,n(e))}const a=_$visitor_52.build({rule(t){a(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{a(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),a(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});a(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],a=_$visitor_52.build({rule(t){n.push(t.name),a(t.expression),n.pop()},sequence(e){e.elements.every(e=>(a(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const i=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",i.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));i&&a(i),o.pop()}});a(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eYt&&(Yt=Ht,zt=[]),zt.push(t))}function re(){var e,r,o,a,i,u;if(e=Ht,Re(),r=Ht,(o=function(){var e,r,o,a;return e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(E)),r!==n&&(o=Ie())!==n?(125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===Wt&&ee(w)),a!==n&&Le()!==n?(qt=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Kt()}}(o)):(Ht=e,e=n)):(Ht=e,e=n),e}())!==n?(a=Re(),r=o):(Ht=r,r=n),r===n&&(r=null),o=Ht,(a=function(){var t,e;return t=Ht,(e=Ie())!==n&&Le()!==n?(qt=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Kt()}}(e)):(Ht=t,t=n),t}())!==n?(i=Re(),o=a):(Ht=o,o=n),o===n&&(o=null),a=[],i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n);else a=n;return a!==n?(qt=e,e={type:"grammar",topLevelInitializer:r,initializer:o,rules:a,location:Kt()}):(Ht=e,e=n),e}function ne(){var e,r,o,a,i,u,s,c;return e=Ht,(r=ve())!==n?(Re(),o=Ht,(a=be())!==n?(Re(),o=a):(Ht=o,o=n),o===n&&(o=null),61===t.charCodeAt(Ht)?(a="=",Ht++):(a=n,0===Wt&&ee(C)),a!==n?(Re(),(i=oe())!==n&&Le()!==n?(qt=e,s=o,c=i,e={type:"rule",name:(u=r)[0],nameLocation:u[1],expression:null!==s?{type:"named",name:s,expression:c,location:Kt()}:c,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n),e}function oe(){var e,r,o,a,i,u,s,c;if(e=Ht,(r=ae())!==n){for(o=[],a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===Wt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);a!==n;)o.push(a),a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===Wt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);qt=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Kt()}:s}else Ht=e,e=n;return e}function ae(){var t,e,r,o;return t=Ht,(e=function(){var t,e,r,o,a,i,u;if(t=Ht,(e=ie())!==n){for(r=[],o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);o!==n;)r.push(o),o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);qt=t,i=e,t=(u=r).length>0||"labeled"===i.type&&i.pick?{type:"sequence",elements:[i].concat(u),location:Kt()}:i}else Ht=t,t=n;return t}())!==n?(r=Ht,Re(),(o=Ie())!==n?r=o:(Ht=r,r=n),r===n&&(r=null),qt=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Kt()}:t}(e,r)):(Ht=t,t=n),t}function ie(){var e,r,o,a,i,u,s;return e=Ht,(r=function(){var e,r;return e=Ht,64===t.charCodeAt(Ht)?(r="@",Ht++):(r=n,0===Wt&&ee(S)),r!==n&&(qt=e,r=Kt()),r}())!==n?((o=ue())===n&&(o=null),(a=se())!==n?(qt=e,i=r,u=o,(s=a).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',i),e={type:"labeled",label:null!==u?u[0]:null,labelLocation:null!==u?u[1]:i,pick:!0,expression:s,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=Ht,(r=ue())!==n?(o=Re(),(a=se())!==n?(qt=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Kt()}}(r,a)):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=se())),e}function ue(){var e,r,o,a;return e=Ht,(r=ve())!==n?(Re(),58===t.charCodeAt(Ht)?(o=":",Ht++):(o=n,0===Wt&&ee($)),o!==n?(qt=e,a=r,Te.indexOf(a[0])>=0&&Vt(`Label can't be a reserved word "${a[0]}"`,a[1]),e=a):(Ht=e,e=n)):(Ht=e,e=n),e}function se(){var e,r,o,a;return e=Ht,(r=function(){var e;return 36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P)))),e}())!==n?(Re(),(o=ce())!==n?(qt=e,a=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:a,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,a;return e=Ht,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Ht)?(e="?",Ht++):(e=n,0===Wt&&ee(k)),e===n&&(42===t.charCodeAt(Ht)?(e="*",Ht++):(e=n,0===Wt&&ee(I)),e===n&&(43===t.charCodeAt(Ht)?(e="+",Ht++):(e=n,0===Wt&&ee(R)))),e}())!==n?(qt=e,a=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:a,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,a,i;return(e=function(){var e,r,o;return Wt++,e=Ht,(r=be())!==n?(105===t.charCodeAt(Ht)?(o="i",Ht++):(o=n,0===Wt&&ee(ut)),o===n&&(o=null),qt=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Kt()}):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(it)),e}())===n&&(e=function(){var e,r,o,a,i,u,s,c;if(Wt++,e=Ht,91===t.charCodeAt(Ht)?(r="[",Ht++):(r=n,0===Wt&&ee(ft)),r!==n){for(94===t.charCodeAt(Ht)?(o="^",Ht++):(o=n,0===Wt&&ee(_t)),o===n&&(o=null),a=[],(i=Ce())===n&&(i=xe());i!==n;)a.push(i),(i=Ce())===n&&(i=xe());93===t.charCodeAt(Ht)?(i="]",Ht++):(i=n,0===Wt&&ee(ht)),i!==n?(105===t.charCodeAt(Ht)?(u="i",Ht++):(u=n,0===Wt&&ee(ut)),u===n&&(u=null),qt=e,s=o,c=u,e={type:"class",parts:a.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Kt()}):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Ht,46===t.charCodeAt(Ht)?(r=".",Ht++):(r=n,0===Wt&&ee($t)),r!==n&&(qt=e,r={type:"any",location:Kt()}),r}())===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,(r=ve())!==n?(o=Ht,Wt++,a=Ht,i=Re(),u=Ht,(s=be())!==n?u=s=[s,Re()]:(Ht=u,u=n),u===n&&(u=null),61===t.charCodeAt(Ht)?(s="=",Ht++):(s=n,0===Wt&&ee(C)),s!==n?a=i=[i,u,s]:(Ht=a,a=n),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e={type:"rule_ref",name:r[0],location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Ht,(r=function(){var e;return 38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P))),e}())!==n?(Re(),(o=Ie())!==n?(qt=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Kt()}}(r,o)):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Ht,40===t.charCodeAt(Ht)?(r="(",Ht++):(r=n,0===Wt&&ee(L)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Ht)?(a=")",Ht++):(a=n,0===Wt&&ee(T)),a!==n?(qt=e,e="labeled"===(i=o).type||"sequence"===i.type?{type:"group",expression:i,location:Kt()}:i):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n)),e}function pe(){var e;return t.length>Ht?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(j)),e}function fe(){var e;return Wt++,9===t.charCodeAt(Ht)?(e="\t",Ht++):(e=n,0===Wt&&ee(D)),e===n&&(11===t.charCodeAt(Ht)?(e="\v",Ht++):(e=n,0===Wt&&ee(N)),e===n&&(12===t.charCodeAt(Ht)?(e="\f",Ht++):(e=n,0===Wt&&ee(M)),e===n&&(32===t.charCodeAt(Ht)?(e=" ",Ht++):(e=n,0===Wt&&ee(U)),e===n&&(160===t.charCodeAt(Ht)?(e="\xa0",Ht++):(e=n,0===Wt&&ee(H)),e===n&&(65279===t.charCodeAt(Ht)?(e="\ufeff",Ht++):(e=n,0===Wt&&ee(q)),e===n&&(e=function(){var e;return b.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Mt)),e}())))))),Wt--,e===n&&0===Wt&&ee(B),e}function _e(){var e;return u.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(G)),e}function he(){var e;return Wt++,10===t.charCodeAt(Ht)?(e="\n",Ht++):(e=n,0===Wt&&ee(z)),e===n&&("\r\n"===t.substr(Ht,2)?(e="\r\n",Ht+=2):(e=n,0===Wt&&ee(W)),e===n&&(13===t.charCodeAt(Ht)?(e="\r",Ht++):(e=n,0===Wt&&ee(K)),e===n&&(8232===t.charCodeAt(Ht)?(e="\u2028",Ht++):(e=n,0===Wt&&ee(V)),e===n&&(8233===t.charCodeAt(Ht)?(e="\u2029",Ht++):(e=n,0===Wt&&ee(X)))))),Wt--,e===n&&0===Wt&&ee(Y),e}function de(){var e;return Wt++,(e=function(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===Wt&&ee(Q)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}())===n&&(e=me()),Wt--,e===n&&0===Wt&&ee(J),e}function ye(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u===n&&(u=_e()),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u===n&&(u=_e()),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===Wt&&ee(Q)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}function me(){var e,r,o,a,i,u;if(e=Ht,"//"===t.substr(Ht,2)?(r="//",Ht+=2):(r=n,0===Wt&&ee(tt)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,u=_e(),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,u=_e(),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);e=r=[r,o]}else Ht=e,e=n;return e}function ve(){var t,e,r,o;if(Wt++,t=Ht,(e=ge())!==n){for(r=[],o=Ae();o!==n;)r.push(o),o=Ae();qt=t,t=[e+r.join(""),Kt()]}else Ht=t,t=n;return Wt--,t===n&&(e=n,0===Wt&&ee(et)),t}function ge(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Lt)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Pt)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(kt)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(It)),e}())===n&&(e=function(){var e;return g.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Dt)),e}()),e}())===n&&(36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(95===t.charCodeAt(Ht)?(e="_",Ht++):(e=n,0===Wt&&ee(rt)),e===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Fe())!==n?e=o:(Ht=e,e=n)))),e}function Ae(){var e;return(e=ge())===n&&(e=function(){var e;return(e=function(){var e;return m.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(jt)),e}())===n&&(e=function(){var e;return y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Tt)),e}()),e}())===n&&(e=function(){var e;return v.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Bt)),e}())===n&&(e=function(){var e;return A.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Nt)),e}())===n&&(8204===t.charCodeAt(Ht)?(e="\u200c",Ht++):(e=n,0===Wt&&ee(ot)),e===n&&(8205===t.charCodeAt(Ht)?(e="\u200d",Ht++):(e=n,0===Wt&&ee(at)))),e}function be(){var e,r,o,a;if(Wt++,e=Ht,34===t.charCodeAt(Ht)?(r='"',Ht++):(r=n,0===Wt&&ee(ct)),r!==n){for(o=[],a=Ee();a!==n;)o.push(a),a=Ee();34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===Wt&&ee(ct)),a!==n?(qt=e,e=o.join("")):(Ht=e,e=n)}else Ht=e,e=n;if(e===n)if(e=Ht,39===t.charCodeAt(Ht)?(r="'",Ht++):(r=n,0===Wt&&ee(lt)),r!==n){for(o=[],a=we();a!==n;)o.push(a),a=we();39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===Wt&&ee(lt)),a!==n?(qt=e,e=function(t){return t.join("")}(o)):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(st)),e}function Ee(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===Wt&&ee(ct)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function we(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===Wt&&ee(lt)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Ce(){var e,r,o,a,i,u;return e=Ht,(r=xe())!==n?(45===t.charCodeAt(Ht)?(o="-",Ht++):(o=n,0===Wt&&ee(dt)),o!==n&&(a=xe())!==n?(qt=e,u=a,(i=r).charCodeAt(0)>u.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(qt,Ht)+"."),e=[i,u]):(Ht=e,e=n)):(Ht=e,e=n),e}function xe(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,93===t.charCodeAt(Ht)?(a="]",Ht++):(a=n,0===Wt&&ee(ht)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Se(){var e,r;return e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&he()!==n?(qt=e,e=""):(Ht=e,e=n),e}function $e(){var e,r,o,a;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,(a=function(){var e;return(e=Oe())===n&&(e=Pe())===n&&(120===t.charCodeAt(Ht)?(e="x",Ht++):(e=n,0===Wt&&ee(wt)),e===n&&(117===t.charCodeAt(Ht)?(e="u",Ht++):(e=n,0===Wt&&ee(Ct)))),e}())===n&&(a=_e()),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),r!==n?t.substring(e,Ht):r}()),e}())===n&&(e=Ht,48===t.charCodeAt(Ht)?(r="0",Ht++):(r=n,0===Wt&&ee(yt)),r!==n?(o=Ht,Wt++,a=Pe(),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e="\0"):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,120===t.charCodeAt(Ht)?(r="x",Ht++):(r=n,0===Wt&&ee(wt)),r!==n?(o=Ht,a=Ht,(i=ke())!==n&&(u=ke())!==n?a=i=[i,u]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(qt=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Fe())),e}function Oe(){var e,r;return 39===t.charCodeAt(Ht)?(e="'",Ht++):(e=n,0===Wt&&ee(lt)),e===n&&(34===t.charCodeAt(Ht)?(e='"',Ht++):(e=n,0===Wt&&ee(ct)),e===n&&(92===t.charCodeAt(Ht)?(e="\\",Ht++):(e=n,0===Wt&&ee(nt)),e===n&&(e=Ht,98===t.charCodeAt(Ht)?(r="b",Ht++):(r=n,0===Wt&&ee(mt)),r!==n&&(qt=e,r="\b"),(e=r)===n&&(e=Ht,102===t.charCodeAt(Ht)?(r="f",Ht++):(r=n,0===Wt&&ee(vt)),r!==n&&(qt=e,r="\f"),(e=r)===n&&(e=Ht,110===t.charCodeAt(Ht)?(r="n",Ht++):(r=n,0===Wt&&ee(gt)),r!==n&&(qt=e,r="\n"),(e=r)===n&&(e=Ht,114===t.charCodeAt(Ht)?(r="r",Ht++):(r=n,0===Wt&&ee(At)),r!==n&&(qt=e,r="\r"),(e=r)===n&&(e=Ht,116===t.charCodeAt(Ht)?(r="t",Ht++):(r=n,0===Wt&&ee(bt)),r!==n&&(qt=e,r="\t"),(e=r)===n&&(e=Ht,118===t.charCodeAt(Ht)?(r="v",Ht++):(r=n,0===Wt&&ee(Et)),r!==n&&(qt=e,r="\v"),e=r)))))))),e}function Fe(){var e,r,o,a,i,u,s,c,l;return e=Ht,117===t.charCodeAt(Ht)?(r="u",Ht++):(r=n,0===Wt&&ee(Ct)),r!==n?(o=Ht,a=Ht,(i=ke())!==n&&(u=ke())!==n&&(s=ke())!==n&&(c=ke())!==n?a=i=[i,u,s,c]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(qt=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Ht=e,e=n)):(Ht=e,e=n),e}function Pe(){var e;return s.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(xt)),e}function ke(){var e;return c.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(St)),e}function Ie(){var e,r,o,a;return Wt++,e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(E)),r!==n?(o=function(){var e,r;return e=Ht,r=function e(){var r,o,a,i,u,s;if(r=Ht,o=[],a=[],i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;for(a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===Wt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n));a!==n;){if(o.push(a),a=[],i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===Wt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n))}return t.substring(r,Ht)}(),qt=e,r=function(t){return[t,Kt()]}(r)}(),125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===Wt&&ee(w)),a!==n?e=o:(Ht=e,e=n)):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=he())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=he())===n&&(e=de());return t}function Le(){var e,r,o,a;return e=Ht,r=Re(),59===t.charCodeAt(Ht)?(o=";",Ht++):(o=n,0===Wt&&ee(Ut)),o!==n?e=r=[r,o]:(Ht=e,e=n),e===n&&(e=Ht,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=ye());e!==n;)t.push(e),(e=fe())===n&&(e=ye());return t}(),(o=me())===n&&(o=null),(a=he())!==n?e=r=[r,o,a]:(Ht=e,e=n),e===n&&(e=Ht,r=Re(),(o=function(){var e,r;return e=Ht,Wt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=n,0===Wt&&ee(j)),Wt--,r===n?e=void 0:(Ht=e,e=n),e}())!==n?e=r=[r,o]:(Ht=e,e=n))),e}const Te=e.reservedWords||[];if((r=i())!==n&&Ht===t.length)return r;throw r!==n&&Ht{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(u[p]=f)}}catch(_){c.e(_)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},i),{},{name:u.remarks?_$base64_4.Base64.decode(u.remarks):i.server,"protocol-param":(0,_$utils_98.getIfNotBlank)(_$base64_4.Base64.decode(u.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_98.getIfNotBlank)(_$base64_4.Base64.decode(u.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={},a=___createForOfIteratorHelper_70(n);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(-1!==i.indexOf("=")){var u=___slicedToArray_70(i.split("="),2),s=u[0],c=u[1];o[s.trim()]=c.trim()}}}catch(h){a.e(h)}finally{a.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_98.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_98.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_98.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_98.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_98.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_98.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_98.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),_={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_98.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_98.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(_.network="ws",_["ws-opts"]={path:(0,_$utils_98.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_98.getIfNotBlank)(f.host)}},_.tls&&f.host&&(_.sni=f.host)),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$gist_97={};function ___typeof_97(t){return(___typeof_97="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_97(){___regeneratorRuntime_97=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=A(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var m=_.prototype=p.prototype=Object.create(h);function v(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_97(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function A(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,A(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=c(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_97(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_97(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_97(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_97(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_90(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_90(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_93(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_93(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_93(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_93(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>").concat(JSON.stringify(a,null,2))),t.prev=11,t.next=14,(0,_$artifacts_90.syncToGist)((c={},l=encodeURIComponent(a.name),p={content:i},l in c?Object.defineProperty(c,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[l]=p,c));case 14:u=t.sent,a.updated=(new Date).getTime(),s=JSON.parse(u.body),a.url=s.files[encodeURIComponent(a.name)].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_93.default.write(o,_$constants_67.ARTIFACTS_KEY),(0,_$response_92.success)(r,a),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),(0,_$response_92.failed)(r,new _$errors_91.InternalServerError("FAILED_TO_SYNC_ARTIFACT","Failed to sync artifact ".concat(n),"Reason: ".concat(t.t0)));case 25:case"end":return t.stop()}var c,l,p}),t,null,[[11,22]])})))).apply(this,arguments)}var _$cronSyncArtifacts_89={};function ___typeof_89(t){return(___typeof_89="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)}var __obj_89,___app_89=(__obj_89=_$app_68)&&__obj_89.__esModule?__obj_89:{default:__obj_89};function ___createForOfIteratorHelper_89(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_89(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_89(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_89(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_89(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_89(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_89(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_89(a,n,o,i,u,"throw",t)}i(void 0)}))}}function doSync(){return _doSync.apply(this,arguments)}function _doSync(){return(_doSync=___asyncToGenerator_89(___regeneratorRuntime_89().mark((function t(){var e,r,n,o,a,i,u;return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return 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 Sub-Store Sync -- v".concat(_$package_66.version,"\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")),___app_89.default.info("\u5f00\u59cb\u540c\u6b65\u6240\u6709\u8fdc\u7a0b\u914d\u7f6e..."),e=___app_89.default.read(_$constants_67.ARTIFACTS_KEY),r={},t.prev=4,t.next=7,Promise.all(e.map(function(){var t=___asyncToGenerator_89(___regeneratorRuntime_89().mark((function t(e){var n;return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sync){t.next=6;break}return ___app_89.default.info("\u6b63\u5728\u540c\u6b65\u4e91\u914d\u7f6e\uff1a".concat(e.name,"...")),t.next=4,(0,_$sync_93.produceArtifact)({type:e.type,name:e.source,platform:e.platform});case 4:n=t.sent,r[e.name]={content:n};case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 7:return t.next=9,(0,_$artifacts_90.syncToGist)(r);case 9:n=t.sent,o=JSON.parse(n.body),a=___createForOfIteratorHelper_89(e);try{for(a.s();!(i=a.n()).done;)(u=i.value).updated=(new Date).getTime(),u.url=o.files[u.name].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")}catch(s){a.e(s)}finally{a.f()}___app_89.default.write(e,_$constants_67.ARTIFACTS_KEY),___app_89.default.notify("\ud83c\udf0d Sub-Store","\u5168\u90e8\u8ba2\u9605\u540c\u6b65\u6210\u529f\uff01"),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(4),___app_89.default.notify("\ud83c\udf0d Sub-Store","\u540c\u6b65\u8ba2\u9605\u5931\u8d25","\u539f\u56e0\uff1a".concat(t.t0)),___app_89.default.error("\u65e0\u6cd5\u540c\u6b65\u8ba2\u9605\u914d\u7f6e\u5230 Gist\uff0c\u539f\u56e0\uff1a".concat(t.t0));case 21:case"end":return t.stop()}}),t,null,[[4,17]])})))).apply(this,arguments)}___asyncToGenerator_89(___regeneratorRuntime_89().mark((function t(){var e,r;return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=___app_89.default.read(_$constants_67.SETTINGS_KEY)).githubUser&&e.gistToken){t.next=3;break}return t.abrupt("return");case 3:if((r=___app_89.default.read(_$constants_67.ARTIFACTS_KEY))&&0!==r.length){t.next=6;break}return t.abrupt("return");case 6:if(!r.some((function(t){return t.sync}))){t.next=10;break}return t.next=10,doSync();case 10:case"end":return t.stop()}}),t)})))().finally((function(){return ___app_89.default.done()}))}(); \ No newline at end of file diff --git a/backend/dist/sub-store-0.min.js b/backend/dist/sub-store-0.min.js new file mode 100644 index 000000000..401b370db --- /dev/null +++ b/backend/dist/sub-store-0.min.js @@ -0,0 +1,16 @@ +/** + * ███████╗██╗ ██╗██████╗ ███████╗████████╗ ██████╗ ██████╗ ███████╗ + * ██╔════╝██║ ██║██╔══██╗ ██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝ + * ███████╗██║ ██║██████╔╝█████╗███████╗ ██║ ██║ ██║██████╔╝█████╗ + * ╚════██║██║ ██║██╔══██╗╚════╝╚════██║ ██║ ██║ ██║██╔══██╗██╔══╝ + * ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗ + * ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + * Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket! + * @updated: 2022/9/9 23:06:30 + * @version: 2.13.0 + * @author: Peng-YM + * @github: https://github.com/Peng-YM/Sub-Store + * @documentation: https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46 + */ + +!function(){var _$package_1={version:"2.13.0"},_$constants_2={};Object.defineProperty(_$constants_2,"__esModule",{value:!0}),_$constants_2.SUBS_KEY=_$constants_2.SETTINGS_KEY=_$constants_2.SCHEMA_VERSION_KEY=_$constants_2.RULES_KEY=_$constants_2.RESOURCE_CACHE_KEY=_$constants_2.GIST_BACKUP_KEY=_$constants_2.GIST_BACKUP_FILE_NAME=_$constants_2.COLLECTIONS_KEY=_$constants_2.CACHE_EXPIRATION_TIME_MS=_$constants_2.ARTIFACT_REPOSITORY_KEY=_$constants_2.ARTIFACTS_KEY=void 0,_$constants_2.SCHEMA_VERSION_KEY="schemaVersion",_$constants_2.SETTINGS_KEY="settings",_$constants_2.SUBS_KEY="subs",_$constants_2.COLLECTIONS_KEY="collections",_$constants_2.ARTIFACTS_KEY="artifacts",_$constants_2.RULES_KEY="rules",_$constants_2.GIST_BACKUP_KEY="Auto Generated Sub-Store Backup",_$constants_2.GIST_BACKUP_FILE_NAME="Sub-Store",_$constants_2.ARTIFACT_REPOSITORY_KEY="Sub-Store Artifacts Repository",_$constants_2.RESOURCE_CACHE_KEY="#sub-store-cached-resource",_$constants_2.CACHE_EXPIRATION_TIME_MS=36e5;var _$openApi_19={};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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){asyncGeneratorStep(a,n,o,i,c,"next",t)}function c(t){asyncGeneratorStep(a,n,o,i,c,"throw",t)}i(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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],a=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(a?"\n\u591a\u5a92\u4f53:"+a:""),{url:o}),isLoon){var i={};o&&(i.openUrl=o),a&&(i.mediaUrl=a),"{}"===JSON.stringify(i)?$notification.post(t,e,r):$notification.post(t,e,r,i)}if(isNode){var c=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(a?"\n\u591a\u5a92\u4f53: ".concat(a):"");console.log("".concat(t,"\n").concat(e,"\n").concat(c,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_19.OpenAPI=OpenAPI;var _$app_3={};Object.defineProperty(_$app_3,"__esModule",{value:!0}),_$app_3.default=void 0;var _default=new _$openApi_19.OpenAPI("sub-store");_$app_3.default=_default;var _$migration_16={};Object.defineProperty(_$migration_16,"__esModule",{value:!0}),_$migration_16.default=function(){var t;(t=_app.default.read(_$constants_2.SCHEMA_VERSION_KEY))||function(){_app.default.info("Start migrating...");var t=_app.default.read(_$constants_2.SUBS_KEY)||{},e=Object.values(t).map((function(t){return t.source=t.source||"remote",s(t),u(t),t}));_app.default.write(e,_$constants_2.SUBS_KEY);var r=_app.default.read(_$constants_2.COLLECTIONS_KEY)||{},n=Object.values(r).map((function(t){return delete t.ua,s(t),u(t),t}));_app.default.write(n,_$constants_2.COLLECTIONS_KEY);var o=_app.default.read(_$constants_2.ARTIFACTS_KEY)||{},a=Object.values(o);_app.default.write(a,_$constants_2.ARTIFACTS_KEY);var i=_app.default.read(_$constants_2.RULES_KEY)||{},c=Object.values(i);function s(t){var e=t["display-name"];e&&(t.displayName=e,delete t["display-name"])}function u(t){var e=t.process;if(e&&0!==e.length){var r,n=[],o={type:"Quick Setting Operator",args:{udp:"DEFAULT",tfo:"DEFAULT",scert:"DEFAULT","vmess aead":"DEFAULT",useless:"DEFAULT"}},a=function(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))){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 a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i.type)if("Useless Filter"===i.type)o.args.useless="ENABLED";else if("Set Property Operator"===i.type){var c=i.args,s=c.key,u=c.value;switch(s){case"udp":o.args.udp=u?"ENABLED":"DISABLED";break;case"tfo":o.args.tfo=u?"ENABLED":"DISABLED";break;case"skip-cert-verify":o.args.scert=u?"ENABLED":"DISABLED";break;case"aead":o.args["vmess aead"]=u?"ENABLED":"DISABLED"}}else if(-1!==i.type.indexOf("Keyword"));else if("Flag Operator"===i.type){var _=void 0===i.args||i.args;i.args={mode:_?"add":"remove"},n.push(i)}else n.push(i)}}catch(f){a.e(f)}finally{a.f()}n.unshift(o),t.process=n}}_app.default.write(c,_$constants_2.RULES_KEY),delete _app.default.cache.builtin,_app.default.info("Migration complete!")}(),"2.0"!==t&&_app.default.write("2.0",_$constants_2.SCHEMA_VERSION_KEY)};var obj,_app=(obj=_$app_3)&&obj.__esModule?obj:{default:obj};function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,n=e.method,o=e.url,a=e.headers,i=e.body;a=formatHeaders(a),/json/i.test(a["content-type"])&&(i=JSON.parse(i)),n=n.toUpperCase();var c,s=extractURL(o),u=s.path,_=s.query,f=null,l=0;for(c=r;cl&&(f=handlers[c],l=p.split("/").length)}if(f){var h=function(){t(n,o,c)},d={method:n,url:o,path:u,query:_,params:extractPathParams(f.pattern,u),headers:a,body:i},y=Response(),v=f.callback,m=function(t){y.status(500).json({status:"failed",message:"Internal Server Error: ".concat(t)})};if("AsyncFunction"===v.constructor.name)v(d,y,h).catch(m);else try{v(d,y,h)}catch(g){m(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_19.ENV)(),r=e.isQX,n=e.isLoon,o=e.isSurge,a=DEFAULT_HEADERS,i={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_18(this,e)}return ___createClass_18(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]:"",c={status:r?i[t]:t,body:e,headers:a};r?$done(c):(n||o)&&$done({response:c})}},{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 a[t]=e,this}}]),e}())}}function formatHeaders(t){for(var e={},r=0,n=Object.keys(t);r=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 a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function ___arrayLikeToArray_6(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function __asyncGeneratorStep_14(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function _getFlowHeaders(){var t;return t=___regeneratorRuntime_14().mark((function t(e){var r,n,o,a;return ___regeneratorRuntime_14().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,_$openApi_19.HTTP)(),t.next=3,r.get({url:e,headers:{"User-Agent":"Quantumult%20X/1.0.30 (iPhone14,2; iOS 15.6)"}});case 3:return n=t.sent,o=n.headers,a=Object.keys(o).filter((function(t){return/SUBSCRIPTION-USERINFO/i.test(t)}))[0],t.abrupt("return",o[a]);case 7:case"end":return t.stop()}}),t)})),(_getFlowHeaders=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_14(a,n,o,i,c,"next",t)}function c(t){__asyncGeneratorStep_14(a,n,o,i,c,"throw",t)}i(void 0)}))}).apply(this,arguments)}Object.defineProperty(_$flow_14,"__esModule",{value:!0}),_$flow_14.getFlowHeaders=function(t){return _getFlowHeaders.apply(this,arguments)};var _$subscriptions_12={};function ___typeof_12(t){return(___typeof_12="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(_$subscriptions_12,"__esModule",{value:!0}),_$subscriptions_12.default=function(t){t.get("/api/sub/flow/:name",getFlowInfo),t.route("/api/sub/:name").get(getSubscription).patch(updateSubscription).delete(deleteSubscription),t.route("/api/subs").get(getAllSubscriptions).post(createSubscription)};var __obj_12,___app_12=(__obj_12=_$app_3)&&__obj_12.__esModule?__obj_12:{default:__obj_12};function ___regeneratorRuntime_12(){___regeneratorRuntime_12=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch($){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new S(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=b(i,r);if(c){if(c===_)continue;return c}}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 s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch($){return{type:"throw",arg:$}}}t.wrap=s;var _={};function f(){}function l(){}function p(){}var h={};c(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=p.prototype=f.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,c){var s=u(t[o],t,a);if("throw"!==s.type){var _=s.arg,f=_.value;return f&&"object"==___typeof_12(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(f).then((function(t){_.value=t,i(_)}),(function(t){return n("throw",t,i,c)}))}c(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return _;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,_;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,_):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function w(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(w,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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function ___createForOfIteratorHelper_12(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_12(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_12(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 a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function ___arrayLikeToArray_12(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function ___createForOfIteratorHelper_15(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_15(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_15(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 a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function ___arrayLikeToArray_15(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function __ownKeys_5(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_5(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function __asyncGeneratorStep_10(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_10(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_10(a,n,o,i,c,"next",t)}function c(t){__asyncGeneratorStep_10(a,n,o,i,c,"throw",t)}i(void 0)}))}}function getSettings(t,e){return _getSettings.apply(this,arguments)}function _getSettings(){return(_getSettings=___asyncToGenerator_10(___regeneratorRuntime_10().mark((function t(e,r){var n;return ___regeneratorRuntime_10().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=___app_10.default.read(_$constants_2.SETTINGS_KEY)).avatarUrl){t.next=4;break}return t.next=4,updateGitHubAvatar();case 4:if(n.artifactStore){t.next=7;break}return t.next=7,updateArtifactStore();case 7:(0,_$response_9.success)(r,n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function updateSettings(t,e){return _updateSettings.apply(this,arguments)}function _updateSettings(){return(_updateSettings=___asyncToGenerator_10(___regeneratorRuntime_10().mark((function t(e,r){var n,o;return ___regeneratorRuntime_10().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=___app_10.default.read(_$constants_2.SETTINGS_KEY),o=___objectSpread_10(___objectSpread_10({},n),e.body),___app_10.default.write(o,_$constants_2.SETTINGS_KEY),t.next=5,updateGitHubAvatar();case 5:return t.next=7,updateArtifactStore();case 7:(0,_$response_9.success)(r,o);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function updateGitHubAvatar(){return _updateGitHubAvatar.apply(this,arguments)}function _updateGitHubAvatar(){return(_updateGitHubAvatar=___asyncToGenerator_10(___regeneratorRuntime_10().mark((function t(){var e,r,n;return ___regeneratorRuntime_10().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=___app_10.default.read(_$constants_2.SETTINGS_KEY),!(r=e.githubUser)){t.next=14;break}return t.prev=3,t.next=6,___app_10.default.http.get({url:"https://api.github.com/users/".concat(r),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then((function(t){return JSON.parse(t.body)}));case 6:n=t.sent,e.avatarUrl=n.avatar_url,___app_10.default.write(e,_$constants_2.SETTINGS_KEY),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),___app_10.default.error("Failed to fetch GitHub avatar for User: "+r);case 14:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}function updateArtifactStore(){return _updateArtifactStore.apply(this,arguments)}function _updateArtifactStore(){return(_updateArtifactStore=___asyncToGenerator_10(___regeneratorRuntime_10().mark((function t(){var e,r,n,o,a;return ___regeneratorRuntime_10().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(___app_10.default.log("Updating artifact store"),e=___app_10.default.read(_$constants_2.SETTINGS_KEY),r=e.githubUser,n=e.gistToken,!r||!n){t.next=15;break}return o=new ___gist_10.default({token:n,key:_$constants_2.ARTIFACT_REPOSITORY_KEY}),t.prev=5,t.next=8,o.locate();case 8:-1!==(a=t.sent)&&(e.artifactStore="https://gist.github.com/".concat(r,"/").concat(a),___app_10.default.write(e,_$constants_2.SETTINGS_KEY)),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),___app_10.default.error("Failed to fetch artifact store for User: "+r);case 15:case"end":return t.stop()}}),t,null,[[5,12]])})))).apply(this,arguments)}var _$resourceCache_17={};Object.defineProperty(_$resourceCache_17,"__esModule",{value:!0}),_$resourceCache_17.default=void 0;var __obj_17,___app_17=(__obj_17=_$app_3)&&__obj_17.__esModule?__obj_17:{default:__obj_17};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,c=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){c=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_17(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_17(t,e):void 0}}(t,e)||function(){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 ___arrayLikeToArray_17(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(___app_17.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){___app_17.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){___app_17.default.write(JSON.stringify(this.resourceCache),_$constants_2.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?___app_17.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),___app_17.default.write(e,"#".concat(t))}}])&&___defineProperties_17(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_2.CACHE_EXPIRATION_TIME_MS);_$resourceCache_17.default=___default_17;var _$miscs_8={};function ___typeof_8(t){return(___typeof_8="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(_$miscs_8,"__esModule",{value:!0}),_$miscs_8.default=function(t){var e,r;t.get("/api/utils/env",getEnv),t.get("/api/utils/backup",gistBackup),t.get("/api/utils/refresh",refresh),t.route("/api/storage").get((function(t,e){e.json(___app_8.default.read("#sub-store"))})).post((function(t,e){var r=t.body;___app_8.default.write(JSON.stringify(r),"#sub-store"),e.end()})),t.get("/",(r=___asyncToGenerator_8(___regeneratorRuntime_8().mark((function t(e,r){return ___regeneratorRuntime_8().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.set("location","https://sub-store.vercel.app/").status(302).end();case 1:case"end":return t.stop()}}),t)}))),function(t,e){return r.apply(this,arguments)})),(0,_$openApi_19.ENV)().isQX&&t.options("/",(e=___asyncToGenerator_8(___regeneratorRuntime_8().mark((function t(e,r){return ___regeneratorRuntime_8().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.status(200).end();case 1:case"end":return t.stop()}}),t)}))),function(t,r){return e.apply(this,arguments)})),t.all("/",(function(t,e){e.send("Hello from sub-store, made with \u2764\ufe0f by Peng-YM")}))};var ___app_8=___interopRequireDefault_8(_$app_3),_resourceCache=___interopRequireDefault_8(_$resourceCache_17),___gist_8=___interopRequireDefault_8(_$gist_15),_migration=___interopRequireDefault_8(_$migration_16);function ___interopRequireDefault_8(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_8(){___regeneratorRuntime_8=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch($){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new S(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=b(i,r);if(c){if(c===_)continue;return c}}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 s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch($){return{type:"throw",arg:$}}}t.wrap=s;var _={};function f(){}function l(){}function p(){}var h={};c(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(O([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=p.prototype=f.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,c){var s=u(t[o],t,a);if("throw"!==s.type){var _=s.arg,f=_.value;return f&&"object"==___typeof_8(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(f).then((function(t){_.value=t,i(_)}),(function(t){return n("throw",t,i,c)}))}c(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return _;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,_;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,_):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function w(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(w,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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){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),_}},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),_}},t}function __asyncGeneratorStep_8(t,e,r,n,o,a,i){try{var c=t[a](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_8(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_8(a,n,o,i,c,"next",t)}function c(t){__asyncGeneratorStep_8(a,n,o,i,c,"throw",t)}i(void 0)}))}}function getEnv(t,e){var r=(0,_$openApi_19.ENV)(),n="Node";r.isNode&&(n="Node"),r.isQX&&(n="QX"),r.isLoon&&(n="Loon"),r.isSurge&&(n="Surge"),r.isStash&&(n="Stash"),r.isShadowRocket&&(n="ShadowRocket"),(0,_$response_9.success)(e,{backend:n,version:_$package_1.version})}function refresh(t,e){return _refresh.apply(this,arguments)}function _refresh(){return(_refresh=___asyncToGenerator_8(___regeneratorRuntime_8().mark((function t(e,r){return ___regeneratorRuntime_8().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_$settings_10.updateGitHubAvatar)();case 2:return t.next=4,(0,_$settings_10.updateArtifactStore)();case 4:_resourceCache.default.revokeAll(),(0,_$response_9.success)(r);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gistBackup(t,e){return _gistBackup.apply(this,arguments)}function _gistBackup(){return(_gistBackup=___asyncToGenerator_8(___regeneratorRuntime_8().mark((function t(e,r){var n,o,a,i,c,s,u;return ___regeneratorRuntime_8().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.query.action,o=___app_8.default.read(_$constants_2.SETTINGS_KEY),a=o.gistToken){t.next=6;break}(0,_$response_9.failed)(r,new _$errors_7.RequestInvalidError("GIST_TOKEN_NOT_FOUND","GitHub Token is required for backup!")),t.next=43;break;case 6:i=new ___gist_8.default({token:a,key:_$constants_2.GIST_BACKUP_KEY}),t.prev=7,s=___app_8.default.read(_$constants_2.SETTINGS_KEY),u=s.syncTime,t.t0=n,t.next="upload"===t.t0?13:"download"===t.t0?29:37;break;case 13:return s.syncTime=(new Date).getTime(),___app_8.default.write(s,_$constants_2.SETTINGS_KEY),c=___app_8.default.read("#sub-store"),___app_8.default.env.isNode&&(c=JSON.stringify(___app_8.default.cache,null," ")),___app_8.default.info("\u4e0a\u4f20\u5907\u4efd\u4e2d..."),t.prev=18,t.next=21,i.upload((_={},f=_$constants_2.GIST_BACKUP_FILE_NAME,l={content:c},f in _?Object.defineProperty(_,f,{value:l,enumerable:!0,configurable:!0,writable:!0}):_[f]=l,_));case 21:t.next=28;break;case 23:throw t.prev=23,t.t1=t.catch(18),s.syncTime=u,___app_8.default.write(s,_$constants_2.SETTINGS_KEY),t.t1;case 28:return t.abrupt("break",37);case 29:return ___app_8.default.info("\u8fd8\u539f\u5907\u4efd\u4e2d..."),t.next=32,i.download(_$constants_2.GIST_BACKUP_FILE_NAME);case 32:return c=t.sent,___app_8.default.write(c,"#sub-store"),___app_8.default.env.isNode&&(c=JSON.parse(c),___app_8.default.cache=c,___app_8.default.persistCache()),(0,_migration.default)(),t.abrupt("break",37);case 37:(0,_$response_9.success)(r),t.next=43;break;case 40:t.prev=40,t.t2=t.catch(7),(0,_$response_9.failed)(r,new _$errors_7.InternalServerError("BACKUP_FAILED","Failed to ".concat(n," data to gist!"),"Reason: ".concat(JSON.stringify(t.t2))));case 43:case"end":return t.stop()}var _,f,l}),t,null,[[7,40],[18,23]])})))).apply(this,arguments)}var _$sort_11={};Object.defineProperty(_$sort_11,"__esModule",{value:!0}),_$sort_11.default=function(t){t.post("/api/sort/subs",sortSubs),t.post("/api/sort/collections",sortCollections),t.post("/api/sort/artifacts",sortArtifacts)};var __obj_11,___app_11=(__obj_11=_$app_3)&&__obj_11.__esModule?__obj_11:{default:__obj_11};function sortSubs(t,e){var r=t.body,n=___app_11.default.read(_$constants_2.SUBS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_11.default.write(n,_$constants_2.SUBS_KEY),(0,_$response_9.success)(e,n)}function sortCollections(t,e){var r=t.body,n=___app_11.default.read(_$constants_2.COLLECTIONS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_11.default.write(n,_$constants_2.COLLECTIONS_KEY),(0,_$response_9.success)(e,n)}function sortArtifacts(t,e){var r=t.body,n=___app_11.default.read(_$constants_2.ARTIFACTS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_11.default.write(n,_$constants_2.ARTIFACTS_KEY),(0,_$response_9.success)(e,n)}var _$subStore0_4={},$app,___migration_4=___interopRequireDefault_4(_$migration_16),_express=___interopRequireDefault_4(_$express_18),___app_4=___interopRequireDefault_4(_$app_3),_collections=___interopRequireDefault_4(_$collections_6),_subscriptions=___interopRequireDefault_4(_$subscriptions_12),_artifacts=___interopRequireDefault_4(_$artifacts_5),___settings_4=___interopRequireDefault_4(_$settings_10),_miscs=___interopRequireDefault_4(_$miscs_8),_sort=___interopRequireDefault_4(_$sort_11);function ___interopRequireDefault_4(t){return t&&t.__esModule?t:{default:t}}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 Sub-Store -- v".concat(_$package_1.version,"\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,___migration_4.default)(),$app=(0,_express.default)({substore:___app_4.default}),(0,_collections.default)($app),(0,_subscriptions.default)($app),(0,_artifacts.default)($app),(0,___settings_4.default)($app),(0,_sort.default)($app),(0,_miscs.default)($app),$app.start()}(); \ No newline at end of file diff --git a/backend/dist/sub-store-1.min.js b/backend/dist/sub-store-1.min.js new file mode 100644 index 000000000..2ebdcebc4 --- /dev/null +++ b/backend/dist/sub-store-1.min.js @@ -0,0 +1,16 @@ +/** + * ███████╗██╗ ██╗██████╗ ███████╗████████╗ ██████╗ ██████╗ ███████╗ + * ██╔════╝██║ ██║██╔══██╗ ██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝ + * ███████╗██║ ██║██████╔╝█████╗███████╗ ██║ ██║ ██║██████╔╝█████╗ + * ╚════██║██║ ██║██╔══██╗╚════╝╚════██║ ██║ ██║ ██║██╔══██╗██╔══╝ + * ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗ + * ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ + * Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket! + * @updated: 2022/9/9 23:06:30 + * @version: 2.13.0 + * @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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_98),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),a=c(_$preprocessors_75),i=c(_$producers_78),u=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function _(){}function h(){}function d(){}var y={};s(y,a,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var g=d.prototype=_.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||h(t,e)||function(){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 _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function h(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],a=x.length>2?x[2]:void 0,i=_(r),t.prev=3,i.s();case 5:if((u=i.n()).done){t.next=39;break}if(c=u.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(h=c.args,d=h.mode,y=h.content,"link"!==d){t.next=27;break}if((m=(v=y).split("#")).length>1){g=_(m[1].split("&"));try{for(g.s();!(b=g.n()).done;)A=b.value,E=A.split("=")[0],w=A.split("=")[1]||!0,f[E]=w}catch(l){g.e(l)}finally{g.f()}}return t.prev=15,t.next=18,(0,n.default)(v.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=y;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,a,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),i.e(t.t1);case 44:return t.prev=44,i.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(y=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){p(a,n,o,i,u,"next",t)}function u(t){p(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var v={parse:function(t){t=function(t){var e,r=_(a.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.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,n=[],o=_(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value;if(0!==(i=i.trim()).length){var c=!1;if(e){var l=f(m(e,i),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var h,d=_(u.default);try{for(d.s();!(h=d.n()).done;){var y=h.value,v=f(m(y,i),2),g=v[0];if(!v[1]){n.push(g),e=y,c=!0,s.default.info("".concat(y.name," is activated"));break}}}catch(b){d.e(b)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(i))}}}catch(b){o.e(b)}finally{o.f()}return n},process:function(t){return y.apply(this,arguments)},produce:function(t,e){var r=i.default[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])})),s.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 s.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}};function m(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=v})),_$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 a(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|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(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(I(e,ArrayBuffer)||e&&I(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(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 a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(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(a)return o?-1:L(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),T(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var a,i=1,u=t.length,s=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;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(a=r;au&&(r=u-s),a=r;a>=0;a--){for(var p=!0,f=0;fo&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function m(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=t[o+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=b)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 w(this,e,r);case"utf8":case"utf-8":return g(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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,a){if(I(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===a&&(a=this.length),e<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(o>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(i,u),c=this.slice(o,a),l=t.slice(e,n),p=0;p>>=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 a=!1;;)switch(n){case"hex":return f(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 v(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,n,o,a,i){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function $(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||$(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||$(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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);S(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a>0)-u&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);S(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return P(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;--i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return a},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 a=t.charCodeAt(0);("utf8"===o&&a<128||"latin1"===o)&&(t=a)}}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(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.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;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function T(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return k.apply(this,arguments)},e.default=void 0;var n=u(_$resourceCache_106),o=u(_$lodash_35),a=u(_$app_68),i=_$proxyUtils_69({});function u(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function _(){}function h(){}function d(){}var y={};c(y,a,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var g=d.prototype=_.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){c(a,n,o,i,u,"next",t)}function u(t){c(a,n,o,i,u,"throw",t)}i(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function f(t,e){if(t){if("string"==typeof t)return _(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)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return S(t)})),e.sort((function(e,r){var n=v(t,e.name),o=v(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=i[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){asyncGeneratorStep(a,n,o,i,u,"next",t)}function u(t){asyncGeneratorStep(a,n,o,i,u,"throw",t)}i(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)}))};Promise.prototype.delay=function(){var t=_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)})));return function(e){return t.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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],a=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(a?"\n\u591a\u5a92\u4f53:"+a:""),{url:o}),isLoon){var i={};o&&(i.openUrl=o),a&&(i.mediaUrl=a),"{}"===JSON.stringify(i)?$notification.post(t,e,r):$notification.post(t,e,r,i)}if(isNode){var u=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(a?"\n\u591a\u5a92\u4f53: ".concat(a):"");console.log("".concat(t,"\n").concat(e,"\n").concat(u,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_109.OpenAPI=OpenAPI;var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_109.OpenAPI("sub-store");_$app_68.default=_default;var _$migration_104={};Object.defineProperty(_$migration_104,"__esModule",{value:!0}),_$migration_104.default=function(){var t;(t=_app.default.read(_$constants_67.SCHEMA_VERSION_KEY))||function(){_app.default.info("Start migrating...");var t=_app.default.read(_$constants_67.SUBS_KEY)||{},e=Object.values(t).map((function(t){return t.source=t.source||"remote",s(t),c(t),t}));_app.default.write(e,_$constants_67.SUBS_KEY);var r=_app.default.read(_$constants_67.COLLECTIONS_KEY)||{},n=Object.values(r).map((function(t){return delete t.ua,s(t),c(t),t}));_app.default.write(n,_$constants_67.COLLECTIONS_KEY);var o=_app.default.read(_$constants_67.ARTIFACTS_KEY)||{},a=Object.values(o);_app.default.write(a,_$constants_67.ARTIFACTS_KEY);var i=_app.default.read(_$constants_67.RULES_KEY)||{},u=Object.values(i);function s(t){var e=t["display-name"];e&&(t.displayName=e,delete t["display-name"])}function c(t){var e=t.process;if(e&&0!==e.length){var r,n=[],o={type:"Quick Setting Operator",args:{udp:"DEFAULT",tfo:"DEFAULT",scert:"DEFAULT","vmess aead":"DEFAULT",useless:"DEFAULT"}},a=function(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))){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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i.type)if("Useless Filter"===i.type)o.args.useless="ENABLED";else if("Set Property Operator"===i.type){var u=i.args,s=u.key,c=u.value;switch(s){case"udp":o.args.udp=c?"ENABLED":"DISABLED";break;case"tfo":o.args.tfo=c?"ENABLED":"DISABLED";break;case"skip-cert-verify":o.args.scert=c?"ENABLED":"DISABLED";break;case"aead":o.args["vmess aead"]=c?"ENABLED":"DISABLED"}}else if(-1!==i.type.indexOf("Keyword"));else if("Flag Operator"===i.type){var l=void 0===i.args||i.args;i.args={mode:l?"add":"remove"},n.push(i)}else n.push(i)}}catch(p){a.e(p)}finally{a.f()}n.unshift(o),t.process=n}}_app.default.write(u,_$constants_67.RULES_KEY),delete _app.default.cache.builtin,_app.default.info("Migration complete!")}(),"2.0"!==t&&_app.default.write("2.0",_$constants_67.SCHEMA_VERSION_KEY)};var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,n=e.method,o=e.url,a=e.headers,i=e.body;a=formatHeaders(a),/json/i.test(a["content-type"])&&(i=JSON.parse(i)),n=n.toUpperCase();var u,s=extractURL(o),c=s.path,l=s.query,p=null,f=0;for(u=r;uf&&(p=handlers[u],f=_.split("/").length)}if(p){var h=function(){t(n,o,u)},d={method:n,url:o,path:c,query:l,params:extractPathParams(p.pattern,c),headers:a,body:i},y=Response(),v=p.callback,m=function(t){y.status(500).json({status:"failed",message:"Internal Server Error: ".concat(t)})};if("AsyncFunction"===v.constructor.name)v(d,y,h).catch(m);else try{v(d,y,h)}catch(g){m(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_109.ENV)(),r=e.isQX,n=e.isLoon,o=e.isSurge,a=DEFAULT_HEADERS,i={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_107(this,e)}return ___createClass_107(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]:"",u={status:r?i[t]:t,body:e,headers:a};r?$done(u):(n||o)&&$done({response:u})}},{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 a[t]=e,this}}]),e}())}}function formatHeaders(t){for(var e={},r=0,n=Object.keys(t);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_99(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _getFlowHeaders(){var t;return t=___regeneratorRuntime_99().mark((function t(e){var r,n,o,a;return ___regeneratorRuntime_99().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,_$openApi_109.HTTP)(),t.next=3,r.get({url:e,headers:{"User-Agent":"Quantumult%20X/1.0.30 (iPhone14,2; iOS 15.6)"}});case 3:return n=t.sent,o=n.headers,a=Object.keys(o).filter((function(t){return/SUBSCRIPTION-USERINFO/i.test(t)}))[0],t.abrupt("return",o[a]);case 7:case"end":return t.stop()}}),t)})),(_getFlowHeaders=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_99(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_99(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}Object.defineProperty(_$flow_99,"__esModule",{value:!0}),_$flow_99.getFlowHeaders=function(t){return _getFlowHeaders.apply(this,arguments)};var _$response_95={};Object.defineProperty(_$response_95,"__esModule",{value:!0}),_$response_95.failed=function(t,e,r){t.status(r||500).json({status:"failed",error:{code:e.code,type:e.type,message:e.message,details:e.details}})},_$response_95.success=function(t,e,r){t.status(r||200).json({status:"success",data:e})};var _$errors_92={};function ___typeof_92(t){return(___typeof_92="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 _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_getPrototypeOf(t);if(e){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===___typeof_92(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ___defineProperties_92(t,e){for(var r=0;r16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),a=0;a<16;a++)n[a]=909522486^r[a],o[a]=1549556828^r[a];var i=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(i),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return e}function rstr2any(t,e){var r,n,o,a,i,u=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(i[i.length]=o);l[n]=a,s=i}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i>>32-u,r);var i,u}function md5_ff(t,e,r,n,o,a,i){return md5_cmn(e&r|~e&n,t,e,o,a,i)}function md5_gg(t,e,r,n,o,a,i){return md5_cmn(e&n|r&~n,t,e,o,a,i)}function md5_hh(t,e,r,n,o,a,i){return md5_cmn(e^r^n,t,e,o,a,i)}function md5_ii(t,e,r,n,o,a,i){return md5_cmn(r^(e|~n),t,e,o,a,i)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$resourceCache_106={};Object.defineProperty(_$resourceCache_106,"__esModule",{value:!0}),_$resourceCache_106.default=void 0;var __obj_106,___app_106=(__obj_106=_$app_68)&&__obj_106.__esModule?__obj_106:{default:__obj_106};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_106(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_106(t,e):void 0}}(t,e)||function(){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 ___arrayLikeToArray_106(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(___app_106.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){___app_106.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){___app_106.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?___app_106.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),___app_106.default.write(e,"#".concat(t))}}])&&___defineProperties_106(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_106.default=___default_106;var _$download_98={};Object.defineProperty(_$download_98,"__esModule",{value:!0}),_$download_98.default=function(t,e){return _download.apply(this,arguments)};var __obj_98,_resourceCache=(__obj_98=_$resourceCache_106)&&__obj_98.__esModule?__obj_98:{default:__obj_98};function ___typeof_98(t){return(___typeof_98="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_98(){___regeneratorRuntime_98=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_98(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_98(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_98().mark((function t(e,r){var n,o,a;return ___regeneratorRuntime_98().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_108.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_109.HTTP)({headers:{"User-Agent":r}}),a=new Promise((function(t,r){var a=_resourceCache.default.get(n);a?t(a):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,a),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_98(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_98(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$utils_102={};Object.defineProperty(_$utils_102,"__esModule",{value:!0}),_$utils_102.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_102.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_102.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_102.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_102.isNotBlank=isNotBlank,_$utils_102.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_103={};function ___arrayLikeToArray_103(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,I=RegExp(k.source),T=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,D=/<%([\s\S]+?)%>/g,B=/<%=([\s\S]+?)%>/g,N=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,G=RegExp(H.source),q=/^\s+/,Y=/\s/,z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Q=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,at=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,it=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",_t="[a-z\\xdf-\\xf6\\xf8-\\xff]",ht="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",yt="[^\\ud800-\\udfff]",vt="(?:\\ud83c[\\udde6-\\uddff]){2}",mt="[\\ud800-\\udbff][\\udc00-\\udfff]",gt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",bt="(?:"+_t+"|"+ht+")",At="(?:"+gt+"|"+ht+")",Et="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+Et+"(?:\\u200d(?:"+[yt,vt,mt].join("|")+")[\\ufe0e\\ufe0f]?"+Et+")*",Ct="(?:"+["[\\u2700-\\u27bf]",vt,mt].join("|")+")"+wt,xt="(?:"+[yt+pt+"?",pt,vt,mt,"[\\ud800-\\udfff]"].join("|")+")",St=RegExp("['\u2019]","g"),$t=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Pt=RegExp([gt+"?"+_t+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,gt,"$"].join("|")+")",At+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,gt+bt,"$"].join("|")+")",gt+"?"+bt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",gt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Ft=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,It={};It[A]=It[E]=It[w]=It[C]=It[x]=It[S]=It["[object Uint8ClampedArray]"]=It[$]=It[O]=!0,It[o]=It[a]=It[g]=It[i]=It[b]=It[u]=It[s]=It[c]=It[p]=It[f]=It[_]=It[h]=It[d]=It[y]=It[m]=!1;var Tt={};Tt[o]=Tt[a]=Tt[g]=Tt[b]=Tt[i]=Tt[u]=Tt[A]=Tt[E]=Tt[w]=Tt[C]=Tt[x]=Tt[p]=Tt[f]=Tt[_]=Tt[h]=Tt[d]=Tt[y]=Tt[v]=Tt[S]=Tt["[object Uint8ClampedArray]"]=Tt[$]=Tt[O]=!0,Tt[s]=Tt[c]=Tt[m]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Dt=parseFloat,Bt=parseInt,Nt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Nt||Mt||Function("return this")(),Ht="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,Gt=Ht&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,qt=Gt&&Gt.exports===Ht,Yt=qt&&Nt.process,zt=function(){try{return Gt&&Gt.require&&Gt.require("util").types||Yt&&Yt.binding&&Yt.binding("util")}catch(t){}}(),Wt=zt&&zt.isArrayBuffer,Kt=zt&&zt.isDate,Vt=zt&&zt.isMap,Xt=zt&&zt.isRegExp,Jt=zt&&zt.isSet,Zt=zt&&zt.isTypedArray;function Qt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,a=null==t?0:t.length;++o-1}function ie(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Pe(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Fe=be({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Le=be({"&":"&","<":"<",">":">",'"':""","'":"'"});function ke(t){return"\\"+jt[t]}function Re(t){return Ft.test(t)}function Ie(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Te(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,a=0,i=[];++n",""":'"',"'":"'"}),Ge=function t(Y){var st,ct=(Y=null==Y?Ut:Ge.defaults(Ut.Object(),Y,Ge.pick(Ut,kt))).Array,lt=Y.Date,pt=Y.Error,ft=Y.Function,_t=Y.Math,ht=Y.Object,dt=Y.RegExp,yt=Y.String,vt=Y.TypeError,mt=ct.prototype,gt=ft.prototype,bt=ht.prototype,At=Y["__core-js_shared__"],Et=gt.toString,wt=bt.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=bt.toString,Ft=Et.call(ht),jt=Ut._,Nt=dt("^"+Et.call(wt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=qt?Y.Buffer:void 0,Ht=Y.Symbol,Gt=Y.Uint8Array,Yt=Mt?Mt.allocUnsafe:void 0,zt=Te(ht.getPrototypeOf,ht),fe=ht.create,be=bt.propertyIsEnumerable,qe=mt.splice,Ye=Ht?Ht.isConcatSpreadable:void 0,ze=Ht?Ht.iterator:void 0,We=Ht?Ht.toStringTag:void 0,Ke=function(){try{var t=Qo(ht,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=Y.clearTimeout!==Ut.clearTimeout&&Y.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=Y.setTimeout!==Ut.setTimeout&&Y.setTimeout,Ze=_t.ceil,Qe=_t.floor,tr=ht.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=Y.isFinite,nr=mt.join,or=Te(ht.keys,ht),ar=_t.max,ir=_t.min,ur=lt.now,sr=Y.parseInt,cr=_t.random,lr=mt.reverse,pr=Qo(Y,"DataView"),fr=Qo(Y,"Map"),_r=Qo(Y,"Promise"),hr=Qo(Y,"Set"),dr=Qo(Y,"WeakMap"),yr=Qo(ht,"create"),vr=dr&&new dr,mr={},gr=$a(pr),br=$a(fr),Ar=$a(_r),Er=$a(hr),wr=$a(dr),Cr=Ht?Ht.prototype:void 0,xr=Cr?Cr.valueOf:void 0,Sr=Cr?Cr.toString:void 0;function $r(t){if(qi(t)&&!Ri(t)&&!(t instanceof Lr)){if(t instanceof Fr)return t;if(wt.call(t,"__wrapped__"))return Oa(t)}return new Fr(t)}var Or=function(){function t(){}return function(e){if(!Gi(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Pr(){}function Fr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Lr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,a,s){var m,P=1&e,F=2&e,L=4&e;if(r&&(m=a?r(t,n,a,s):r(t)),void 0!==m)return m;if(!Gi(t))return t;var k=Ri(t);if(k){if(m=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!P)return vo(t,m)}else{var R=ra(t),I=R==c||R==l;if(Di(t))return lo(t,P);if(R==_||R==o||I&&!a){if(m=F||I?{}:oa(t),!P)return F?function(t,e){return mo(t,ea(t),e)}(t,function(t,e){return t&&mo(e,Au(e),t)}(m,t)):function(t,e){return mo(t,ta(t),e)}(t,Yr(m,t))}else{if(!Tt[R])return a?t:{};m=function(t,e,r){var n,o,a,s=t.constructor;switch(e){case g:return po(t);case i:case u:return new s(+t);case b:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case A:case E:case w:case C:case x:case S:case"[object Uint8ClampedArray]":case $:case O:return fo(t,r);case p:return new s;case f:case y:return new s(t);case h:return(a=new(o=t).constructor(o.source,Q.exec(o))).lastIndex=o.lastIndex,a;case d:return new s;case v:return n=t,xr?ht(xr.call(n)):{}}}(t,R,P)}}s||(s=new jr);var T=s.get(t);if(T)return T;s.set(t,m),Vi(t)?t.forEach((function(n){m.add(Vr(n,e,r,n,t,s))})):Yi(t)&&t.forEach((function(n,o){m.set(o,Vr(n,e,r,o,t,s))}));var j=k?void 0:(L?F?zo:Yo:F?Au:bu)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Hr(m,o,Vr(n,e,r,o,t,s))})),m}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=ht(t);n--;){var o=r[n],a=e[o],i=t[o];if(void 0===i&&!(o in t)||!a(i))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new vt(e);return ma((function(){t.apply(void 0,n)}),r)}function Zr(t,e,r,n){var o=-1,a=ae,i=!0,u=t.length,s=[],c=e.length;if(!u)return s;r&&(e=ue(e,xe(r))),n?(a=ie,i=!1):e.length>=200&&(a=$e,i=!1,e=new Tr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=Gr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Ir.prototype.clear=function(){this.size=0,this.__data__={hash:new kr,map:new(fr||Rr),string:new kr}},Ir.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Ir.prototype.get=function(t){return Jo(this,t).get(t)},Ir.prototype.has=function(t){return Jo(this,t).has(t)},Ir.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Tr.prototype.add=Tr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Tr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ir(n)}return r.set(t,e),this.size=r.size,this};var Qr=Ao(sn),tn=Ao(cn,!0);function en(t,e){var r=!0;return Qr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(u)?e>1?on(u,e-1,r,n,o):se(o,u):n||(o[o.length]=u)}return o}var an=Eo(),un=Eo(!0);function sn(t,e){return t&&an(t,e,bu)}function cn(t,e){return t&&un(t,e,bu)}function ln(t,e){return oe(e,(function(e){return Mi(t[e])}))}function pn(t,e){for(var r=0,n=(e=io(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function yn(t,e){return null!=t&&e in ht(t)}function vn(t,e,r){for(var n=r?ie:ae,o=t[0].length,a=t.length,i=a,u=ct(a),s=1/0,c=[];i--;){var l=t[i];i&&e&&(l=ue(l,xe(e))),s=ir(l.length,s),u[i]=!r&&(e||o>=120&&l.length>=120)?new Tr(i&&l):void 0}l=t[0];var p=-1,f=u[0];t:for(;++p=u?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}(Sn(t,(function(t,r,o){return{criteria:ue(e,(function(e){return e(t)})),index:++n,value:t}})))}function kn(t,e,r){for(var n=-1,o=e.length,a={};++n-1;)u!==t&&qe.call(u,s,1),qe.call(t,s,1);return t}function In(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==a){var a=o;ia(o)?qe.call(t,o,1):Zn(t,o)}}return t}function Tn(t,e){return t+Qe(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Qe(e/2))&&(t+=t)}while(e);return r}function Dn(t,e){return ga(ha(t,e,zu),t+"")}function Bn(t){return Br(Pu(t))}function Nn(t,e){var r=Pu(t);return Ea(r,Kr(e,0,r.length))}function Mn(t,e,r,n){if(!Gi(t))return t;for(var o=-1,a=(e=io(e,t)).length,i=a-1,u=t;null!=u&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=ct(o);++n>>1,i=t[a];null!==i&&!Ji(i)&&(r?i<=e:i=200){var c=e?null:Do(t);if(c)return De(c);i=!1,o=$e,s=new Tr}else s=e?[]:u;t:for(;++n=n?t:qn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Yt?Yt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,a=Ji(t),i=void 0!==e,u=null===e,s=e==e,c=Ji(e);if(!u&&!c&&!a&&t>e||a&&i&&s&&!u&&!c||n&&i&&s||!r&&s||!o)return 1;if(!n&&!a&&!c&&t1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ua(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=ht(e);++n-1?o[a?e[i]:i]:void 0}}function $o(t){return qo((function(r){var n=r.length,o=n,a=Fr.prototype.thru;for(t&&r.reverse();o--;){var i=r[o];if("function"!=typeof i)throw new vt(e);if(a&&!u&&"wrapper"==Ko(i))var u=new Fr([],!0)}for(o=u?o:n;++o1&&m.reverse(),l&&su))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,_=2&r?new Tr:void 0;for(a.set(t,e),a.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(z,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ae(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(W);return e?e[1].split(K):[]}(o),r)))}function Aa(t){var e=0,r=0;return function(){var n=ur(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ea(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Ka(t,r)}));function ei(t){var e=$r(t);return e.__chain__=!0,e}function ri(t,e){return e(t)}var ni=qo((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Lr&&ia(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new Fr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),oi=go((function(t,e,r){wt.call(t,r)?++t[r]:zr(t,r,1)})),ai=So(ka),ii=So(Ra);function ui(t,e){return(Ri(t)?ee:Qr)(t,Xo(e,3))}function si(t,e){return(Ri(t)?re:tn)(t,Xo(e,3))}var ci=go((function(t,e,r){wt.call(t,r)?t[r].push(e):zr(t,r,[e])})),li=Dn((function(t,e,r){var n=-1,o="function"==typeof e,a=Ti(t)?ct(t.length):[];return Qr(t,(function(t){a[++n]=o?Qt(e,t,r):mn(t,e,r)})),a})),pi=go((function(t,e,r){zr(t,r,e)}));function fi(t,e){return(Ri(t)?ue:Sn)(t,Xo(e,3))}var _i=go((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),hi=Dn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ua(t,e[0],e[1])?e=[]:r>2&&ua(e[0],e[1],e[2])&&(e=[e[0]]),Ln(t,on(e,1),[])})),di=Xe||function(){return Ut.Date.now()};function yi(t,e,r){return e=r?void 0:e,No(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function vi(t,r){var n;if("function"!=typeof r)throw new vt(e);return t=nu(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var mi=Dn((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(mi));n|=32}return No(t,n,e,r,o)})),gi=Dn((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(gi));n|=32}return No(e,n,t,r,o)}));function bi(t,r,n){var o,a,i,u,s,c,l=0,p=!1,f=!1,_=!0;if("function"!=typeof t)throw new vt(e);function h(e){var r=o,n=a;return o=a=void 0,l=e,u=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function y(){var t=di();if(d(t))return v(t);s=ma(y,function(t){var e=r-(t-c);return f?ir(e,i-(t-l)):e}(t))}function v(t){return s=void 0,_&&o?h(t):(o=a=void 0,u)}function m(){var t=di(),e=d(t);if(o=arguments,a=this,c=t,e){if(void 0===s)return function(t){return l=t,s=ma(y,r),p?h(t):u}(c);if(f)return co(s),s=ma(y,r),h(c)}return void 0===s&&(s=ma(y,r)),u}return r=au(r)||0,Gi(n)&&(p=!!n.leading,i=(f="maxWait"in n)?ar(au(n.maxWait)||0,r):i,_="trailing"in n?!!n.trailing:_),m.cancel=function(){void 0!==s&&co(s),l=0,o=c=a=s=void 0},m.flush=function(){return void 0===s?u:v(di())},m}var Ai=Dn((function(t,e){return Jr(t,1,e)})),Ei=Dn((function(t,e,r){return Jr(t,au(e)||0,r)}));function wi(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new vt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,e);return n.cache=a.set(o,i)||a,i};return n.cache=new(wi.Cache||Ir),n}function Ci(t){if("function"!=typeof t)throw new vt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}wi.Cache=Ir;var xi=uo((function(t,e){var r=(e=1==e.length&&Ri(e[0])?ue(e[0],xe(Xo())):ue(on(e,1),xe(Xo()))).length;return Dn((function(n){for(var o=-1,a=ir(n.length,r);++o=e})),ki=gn(function(){return arguments}())?gn:function(t){return qi(t)&&wt.call(t,"callee")&&!be.call(t,"callee")},Ri=ct.isArray,Ii=Wt?xe(Wt):function(t){return qi(t)&&_n(t)==g};function Ti(t){return null!=t&&Hi(t.length)&&!Mi(t)}function ji(t){return qi(t)&&Ti(t)}var Di=er||as,Bi=Kt?xe(Kt):function(t){return qi(t)&&_n(t)==u};function Ni(t){if(!qi(t))return!1;var e=_n(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Wi(t)}function Mi(t){if(!Gi(t))return!1;var e=_n(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ui(t){return"number"==typeof t&&t==nu(t)}function Hi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Gi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qi(t){return null!=t&&"object"==typeof t}var Yi=Vt?xe(Vt):function(t){return qi(t)&&ra(t)==p};function zi(t){return"number"==typeof t||qi(t)&&_n(t)==f}function Wi(t){if(!qi(t)||_n(t)!=_)return!1;var e=zt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==Ft}var Ki=Xt?xe(Xt):function(t){return qi(t)&&_n(t)==h},Vi=Jt?xe(Jt):function(t){return qi(t)&&ra(t)==d};function Xi(t){return"string"==typeof t||!Ri(t)&&qi(t)&&_n(t)==y}function Ji(t){return"symbol"==typeof t||qi(t)&&_n(t)==v}var Zi=Zt?xe(Zt):function(t){return qi(t)&&Hi(t.length)&&!!It[_n(t)]},Qi=Io(xn),tu=Io((function(t,e){return t<=e}));function eu(t){if(!t)return[];if(Ti(t))return Xi(t)?Me(t):vo(t);if(ze&&t[ze])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ze]());var e=ra(t);return(e==p?Ie:e==d?De:Pu)(t)}function ru(t){return t?(t=au(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function nu(t){var e=ru(t),r=e%1;return e==e?r?e-r:e:0}function ou(t){return t?Kr(nu(t),0,4294967295):0}function au(t){if("number"==typeof t)return t;if(Ji(t))return NaN;if(Gi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Gi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Bt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function iu(t){return mo(t,Au(t))}function uu(t){return null==t?"":Xn(t)}var su=bo((function(t,e){if(pa(e)||Ti(e))mo(e,bu(e),t);else for(var r in e)wt.call(e,r)&&Hr(t,r,e[r])})),cu=bo((function(t,e){mo(e,Au(e),t)})),lu=bo((function(t,e,r,n){mo(e,Au(e),t,n)})),pu=bo((function(t,e,r,n){mo(e,bu(e),t,n)})),fu=qo(Wr),_u=Dn((function(t,e){t=ht(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&ua(e[0],e[1],o)&&(n=1);++r1),e})),mo(t,zo(t),r),n&&(r=Vr(r,7,Ho));for(var o=e.length;o--;)Zn(r,e[o]);return r})),xu=qo((function(t,e){return null==t?{}:function(t,e){return kn(t,e,(function(e,r){return yu(t,r)}))}(t,e)}));function Su(t,e){if(null==t)return{};var r=ue(zo(t),(function(t){return[t]}));return e=Xo(e),kn(t,r,(function(t,r){return e(t,r[0])}))}var $u=Bo(bu),Ou=Bo(Au);function Pu(t){return null==t?[]:Se(t,bu(t))}var Fu=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?Lu(e):e)}));function Lu(t){return Nu(uu(t).toLowerCase())}function ku(t){return(t=uu(t))&&t.replace(at,Fe).replace($t,"")}var Ru=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Iu=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Tu=wo("toLowerCase"),ju=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Du=Co((function(t,e,r){return t+(r?" ":"")+Nu(e)})),Bu=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Nu=wo("toUpperCase");function Mu(t,e,r){return t=uu(t),void 0===(e=r?void 0:e)?function(t){return Lt.test(t)}(t)?function(t){return t.match(Pt)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Uu=Dn((function(t,e){try{return Qt(t,void 0,e)}catch(r){return Ni(r)?r:new pt(r)}})),Hu=qo((function(t,e){return ee(e,(function(e){e=Sa(e),zr(t,e,mi(t[e],t))})),t}));function Gu(t){return function(){return t}}var qu=$o(),Yu=$o(!0);function zu(t){return t}function Wu(t){return wn("function"==typeof t?t:Vr(t,1))}var Ku=Dn((function(t,e){return function(r){return mn(r,t,e)}})),Vu=Dn((function(t,e){return function(r){return mn(t,r,e)}}));function Xu(t,e,r){var n=bu(e),o=ln(e,n);null!=r||Gi(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,bu(e)));var a=!(Gi(r)&&"chain"in r&&!r.chain),i=Mi(t);return ee(o,(function(r){var n=e[r];t[r]=n,i&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=vo(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Ju(){}var Zu=Lo(ue),Qu=Lo(ne),ts=Lo(pe);function es(t){return sa(t)?ge(Sa(t)):function(t){return function(e){return pn(e,t)}}(t)}var rs=Ro(),ns=Ro(!0);function os(){return[]}function as(){return!1}var is,us=Fo((function(t,e){return t+e}),0),ss=jo("ceil"),cs=Fo((function(t,e){return t/e}),1),ls=jo("floor"),ps=Fo((function(t,e){return t*e}),1),fs=jo("round"),_s=Fo((function(t,e){return t-e}),0);return $r.after=function(t,r){if("function"!=typeof r)throw new vt(e);return t=nu(t),function(){if(--t<1)return r.apply(this,arguments)}},$r.ary=yi,$r.assign=su,$r.assignIn=cu,$r.assignInWith=lu,$r.assignWith=pu,$r.at=fu,$r.before=vi,$r.bind=mi,$r.bindAll=Hu,$r.bindKey=gi,$r.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ri(t)?t:[t]},$r.chain=ei,$r.chunk=function(t,e,r){e=(r?ua(t,e,r):void 0===e)?1:ar(nu(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,a=0,i=ct(Ze(n/e));oo?0:o+r),(n=void 0===n||n>o?o:nu(n))<0&&(n+=o),n=r>n?0:ou(n);r>>0)?(t=uu(t))&&("string"==typeof e||null!=e&&!Ki(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},$r.spread=function(t,r){if("function"!=typeof t)throw new vt(e);return r=null==r?0:ar(nu(r),0),Dn((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Qt(t,this,o)}))},$r.tail=function(t){var e=null==t?0:t.length;return e?qn(t,1,e):[]},$r.take=function(t,e,r){return t&&t.length?qn(t,0,(e=r||void 0===e?1:nu(e))<0?0:e):[]},$r.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?qn(t,(e=n-(e=r||void 0===e?1:nu(e)))<0?0:e,n):[]},$r.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},$r.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},$r.tap=function(t,e){return e(t),t},$r.throttle=function(t,r,n){var o=!0,a=!0;if("function"!=typeof t)throw new vt(e);return Gi(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),bi(t,r,{leading:o,maxWait:r,trailing:a})},$r.thru=ri,$r.toArray=eu,$r.toPairs=$u,$r.toPairsIn=Ou,$r.toPath=function(t){return Ri(t)?ue(t,Sa):Ji(t)?[t]:vo(xa(uu(t)))},$r.toPlainObject=iu,$r.transform=function(t,e,r){var n=Ri(t),o=n||Di(t)||Zi(t);if(e=Xo(e,4),null==r){var a=t&&t.constructor;r=o?n?new a:[]:Gi(t)&&Mi(a)?Or(zt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},$r.unary=function(t){return yi(t,1)},$r.union=qa,$r.unionBy=Ya,$r.unionWith=za,$r.uniq=function(t){return t&&t.length?Jn(t):[]},$r.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},$r.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},$r.unset=function(t,e){return null==t||Zn(t,e)},$r.unzip=Wa,$r.unzipWith=Ka,$r.update=function(t,e,r){return null==t?t:Qn(t,e,ao(r))},$r.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Qn(t,e,ao(r),n)},$r.values=Pu,$r.valuesIn=function(t){return null==t?[]:Se(t,Au(t))},$r.without=Va,$r.words=Mu,$r.wrap=function(t,e){return Si(ao(e),t)},$r.xor=Xa,$r.xorBy=Ja,$r.xorWith=Za,$r.zip=Qa,$r.zipObject=function(t,e){return no(t||[],e||[],Hr)},$r.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},$r.zipWith=ti,$r.entries=$u,$r.entriesIn=Ou,$r.extend=cu,$r.extendWith=lu,Xu($r,$r),$r.add=us,$r.attempt=Uu,$r.camelCase=Fu,$r.capitalize=Lu,$r.ceil=ss,$r.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=au(r))==r?r:0),void 0!==e&&(e=(e=au(e))==e?e:0),Kr(au(t),e,r)},$r.clone=function(t){return Vr(t,4)},$r.cloneDeep=function(t){return Vr(t,5)},$r.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},$r.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},$r.conformsTo=function(t,e){return null==e||Xr(t,e,bu(e))},$r.deburr=ku,$r.defaultTo=function(t,e){return null==t||t!=t?e:t},$r.divide=cs,$r.endsWith=function(t,e,r){t=uu(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Kr(nu(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},$r.eq=Pi,$r.escape=function(t){return(t=uu(t))&&T.test(t)?t.replace(R,Le):t},$r.escapeRegExp=function(t){return(t=uu(t))&&G.test(t)?t.replace(H,"\\$&"):t},$r.every=function(t,e,r){var n=Ri(t)?ne:en;return r&&ua(t,e,r)&&(e=void 0),n(t,Xo(e,3))},$r.find=ai,$r.findIndex=ka,$r.findKey=function(t,e){return _e(t,Xo(e,3),sn)},$r.findLast=ii,$r.findLastIndex=Ra,$r.findLastKey=function(t,e){return _e(t,Xo(e,3),cn)},$r.floor=ls,$r.forEach=ui,$r.forEachRight=si,$r.forIn=function(t,e){return null==t?t:an(t,Xo(e,3),Au)},$r.forInRight=function(t,e){return null==t?t:un(t,Xo(e,3),Au)},$r.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},$r.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},$r.get=du,$r.gt=Fi,$r.gte=Li,$r.has=function(t,e){return null!=t&&na(t,e,dn)},$r.hasIn=yu,$r.head=Ta,$r.identity=zu,$r.includes=function(t,e,r,n){t=Ti(t)?t:Pu(t),r=r&&!n?nu(r):0;var o=t.length;return r<0&&(r=ar(o+r,0)),Xi(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},$r.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:nu(r);return o<0&&(o=ar(n+o,0)),de(t,e,o)},$r.inRange=function(t,e,r){return e=ru(e),void 0===r?(r=e,e=0):r=ru(r),function(t,e,r){return t>=ir(e,r)&&t=-9007199254740991&&t<=9007199254740991},$r.isSet=Vi,$r.isString=Xi,$r.isSymbol=Ji,$r.isTypedArray=Zi,$r.isUndefined=function(t){return void 0===t},$r.isWeakMap=function(t){return qi(t)&&ra(t)==m},$r.isWeakSet=function(t){return qi(t)&&"[object WeakSet]"==_n(t)},$r.join=function(t,e){return null==t?"":nr.call(t,e)},$r.kebabCase=Ru,$r.last=Na,$r.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=nu(r))<0?ar(n+o,0):ir(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):he(t,ve,o,!0)},$r.lowerCase=Iu,$r.lowerFirst=Tu,$r.lt=Qi,$r.lte=tu,$r.max=function(t){return t&&t.length?rn(t,zu,hn):void 0},$r.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),hn):void 0},$r.mean=function(t){return me(t,zu)},$r.meanBy=function(t,e){return me(t,Xo(e,2))},$r.min=function(t){return t&&t.length?rn(t,zu,xn):void 0},$r.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},$r.stubArray=os,$r.stubFalse=as,$r.stubObject=function(){return{}},$r.stubString=function(){return""},$r.stubTrue=function(){return!0},$r.multiply=ps,$r.nth=function(t,e){return t&&t.length?Fn(t,nu(e)):void 0},$r.noConflict=function(){return Ut._===this&&(Ut._=jt),this},$r.noop=Ju,$r.now=di,$r.pad=function(t,e,r){t=uu(t);var n=(e=nu(e))?Ne(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return ko(Qe(o),r)+t+ko(Ze(o),r)},$r.padEnd=function(t,e,r){t=uu(t);var n=(e=nu(e))?Ne(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ir(t+o*(e-t+Dt("1e-"+((o+"").length-1))),e)}return Tn(t,e)},$r.reduce=function(t,e,r){var n=Ri(t)?ce:Ae,o=arguments.length<3;return n(t,Xo(e,4),r,o,Qr)},$r.reduceRight=function(t,e,r){var n=Ri(t)?le:Ae,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},$r.repeat=function(t,e,r){return e=(r?ua(t,e,r):void 0===e)?1:nu(e),jn(uu(t),e)},$r.replace=function(){var t=arguments,e=uu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$r.result=function(t,e,r){var n=-1,o=(e=io(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ir(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=a)return t;var u=r-Ne(n);if(u<1)return n;var s=i?so(i,0,u).join(""):t.slice(0,u);if(void 0===o)return s+n;if(i&&(u+=s.length-u),Ki(o)){if(t.slice(u).search(o)){var c,l=s;for(o.global||(o=dt(o.source,uu(Q.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?u:p)}}else if(t.indexOf(Xn(o),u)!=u){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},$r.unescape=function(t){return(t=uu(t))&&I.test(t)?t.replace(k,He):t},$r.uniqueId=function(t){var e=++Ct;return uu(t)+e},$r.upperCase=Bu,$r.upperFirst=Nu,$r.each=ui,$r.eachRight=si,$r.first=Ta,Xu($r,(is={},sn($r,(function(t,e){wt.call($r.prototype,e)||(is[e]=t)})),is),{chain:!1}),$r.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$r[t].placeholder=$r})),ee(["drop","take"],(function(t,e){Lr.prototype[t]=function(r){r=void 0===r?1:ar(nu(r),0);var n=this.__filtered__&&!e?new Lr(this):this.clone();return n.__filtered__?n.__takeCount__=ir(r,n.__takeCount__):n.__views__.push({size:ir(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Lr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Lr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Lr.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Lr.prototype[t]=function(){return this.__filtered__?new Lr(this):this[r](1)}})),Lr.prototype.compact=function(){return this.filter(zu)},Lr.prototype.find=function(t){return this.filter(t).head()},Lr.prototype.findLast=function(t){return this.reverse().find(t)},Lr.prototype.invokeMap=Dn((function(t,e){return"function"==typeof t?new Lr(this):this.map((function(r){return mn(r,t,e)}))})),Lr.prototype.reject=function(t){return this.filter(Ci(Xo(t)))},Lr.prototype.slice=function(t,e){t=nu(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Lr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=nu(e))<0?r.dropRight(-e):r.take(e-t)),r)},Lr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Lr.prototype.toArray=function(){return this.take(4294967295)},sn(Lr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=$r[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);o&&($r.prototype[e]=function(){var e=this.__wrapped__,i=n?[1]:arguments,u=e instanceof Lr,s=i[0],c=u||Ri(e),l=function(t){var e=o.apply($r,se([t],i));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,_=a&&!p,h=u&&!f;if(!a&&c){e=h?e:new Lr(this);var d=t.apply(e,i);return d.__actions__.push({func:ri,args:[l],thisArg:void 0}),new Fr(d,p)}return _&&h?t.apply(this,i):(d=this.thru(l),_?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=mt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);$r.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ri(o)?o:[],t)}return this[r]((function(r){return e.apply(Ri(r)?r:[],t)}))}})),sn(Lr.prototype,(function(t,e){var r=$r[e];if(r){var n=r.name+"";wt.call(mr,n)||(mr[n]=[]),mr[n].push({name:e,func:r})}})),mr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],Lr.prototype.clone=function(){var t=new Lr(this.__wrapped__);return t.__actions__=vo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=vo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=vo(this.__views__),t},Lr.prototype.reverse=function(){if(this.__filtered__){var t=new Lr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Lr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ri(t),n=e<0,o=r?t.length:0,a=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$r.prototype.plant=function(t){for(var e,r=this;r instanceof Pr;){var n=Oa(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},$r.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Lr){var e=t;return this.__actions__.length&&(e=new Lr(this)),(e=e.reverse()).__actions__.push({func:ri,args:[Ga],thisArg:void 0}),new Fr(e,this.__chain__)}return this.thru(Ga)},$r.prototype.toJSON=$r.prototype.valueOf=$r.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},$r.prototype.first=$r.prototype.head,ze&&($r.prototype[ze]=function(){return this}),$r}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=Ge,define((function(){return Ge}))):Gt?((Gt.exports=Ge)._=Ge,Ht._=Ge):Ut._=Ge}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",a=this.position;ae/2-1){o=" ... ",a-=5;break}return i=this.buffer.slice(n,a),_$common_7.repeat(" ",t)+r+i+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,a,i,u,s,c=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(a=+e[4],i=+e[5],u=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,a,i,u,c)),l&&s.setTime(s.getTime()-l),s},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,a=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,a=BASE64_MAP,i=0,u=[];for(e=0;e>16&255),u.push(i>>8&255),u.push(255&i)),i=i<<6|a.indexOf(n.charAt(e));return 0==(r=o%4*6)?(u.push(i>>16&255),u.push(i>>8&255),u.push(255&i)):18===r?(u.push(i>>10&255),u.push(i>>2&255)):12===r&&u.push(i>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(u):new NodeBuffer(u):u},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,a=t.length,i=BASE64_MAP;for(e=0;e>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]),o=(o<<8)+t[e];return 0==(r=a%3)?(n+=i[o>>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]):2===r?(n+=i[o>>10&63],n+=i[o>>4&63],n+=i[o<<2&63],n+=i[64]):1===r&&(n+=i[o>>2&63],n+=i[o<<4&63],n+=i[64],n+=i[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,a,i=[],u=t;for(e=0,r=u.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,a;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),a=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&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,a,i,u;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,a=t.anchor,i=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=i),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)i.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),i.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,p,f,_,h,a,i),f=_=h=null),skipSeparationSpace(t,!0,-1),u=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==u)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(a)){do{a=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!is_EOL(a)&&0!==a)}for(;0!==a;){for(readLineBreak(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(a))p++;else{if(t.lineIndent0){for(o=i,a=0;o>0;o--)(i=fromHexCode(u=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+i:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(a),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(u)?(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,p)?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,a,i,u,s,c,l,p=t.kind,f=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=a=t.position,i=!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(u=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){i=!0,l=t.input.charCodeAt(t.position);continue}t.position=a,t.line=u,t.lineStart=s,t.lineIndent=c;break}}i&&(captureSegment(t,o,a,!1),writeFoldedLines(t,t.line-u),o=a=t.position,i=!1),is_WHITE_SPACE(l)||(a=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,a,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=u&&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+'"'),s=0,c=t.implicitTypes.length;s 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,a=t.position,i=!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(i=!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)):i&&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(a,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(a-1):null,_=_&&isPlainSafe(i,u)}else{for(a=0;an&&" "!==t[f+1],f=a);else if(!isPrintable(i))return STYLE_DOUBLE;u=a>0?t.charCodeAt(a-1):null,_=_&&isPlainSafe(i,u)}l=l||p&&a-f-1>n&&" "!==t[f+1]}return c||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),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),i=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,i,t.indent,a,(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,a=/(\n+)([^\n]*)/g,i=(o=-1!==(o=t.indexOf("\n"))?o:t.length,a.lastIndex=o,foldLine(t.slice(0,o),e)),u="\n"===t[0]||" "===t[0];n=a.exec(t);){var s=n[1],c=n[2];r=" "===c[0],i+=s+(u||r||""===c?"":"\n")+foldLine(c,e),u=r}return i}(e,a),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",a=0;a=55296&&e<=56319&&(r=t.charCodeAt(a+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),a++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[a]: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,a=0,i=0,u=0,s="";r=o.exec(t);)(u=r.index)-a>e&&(n=i>a?i:u,s+="\n"+t.slice(a,n),a=n+1),i=u;return s+="\n",t.length-a>e&&i>a?s+=t.slice(a,i)+"\n"+t.slice(i+1):s+=t.slice(a),s.slice(1)}function detectType(t,e,r){var n,o,a,i,u,s;for(a=0,i=(o=r?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+s+'" style');n=u.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,a){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var i=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var u,s,c="[object Object]"===i||"[object Array]"===i;if(c&&(s=-1!==(u=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(c&&s&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===i)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,a,i,u,s,c,l="",p=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,a=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,u,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+u+t.dump)):(function(t,e,r){var n,o,a,i,u,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,i,!1,!1)&&(s+=u+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===i){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,a,i="",u=t.tag;for(o=0,a=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],a=[];for(function t(e,r,n){var o,a,i;if(null!==e&&"object"==typeof e)if(-1!==(a=r.indexOf(e)))-1===n.indexOf(a)&&n.push(a);else if(r.push(e),Array.isArray(e))for(a=0,i=e.length;a0?o-4:o;for(r=0;r>16&255,i[u++]=e>>8&255,i[u++]=255&e;return 2===a&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,i[u++]=255&e),1===a&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,i[u++]=e>>8&255,i[u++]=255&e),i},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],a=0,i=r-n;ai?i:a+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,a=[],i=e;i>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return a.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var a,i,u=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,_=t[e+p];for(p+=f,a=_&(1<<-l)-1,_>>=-l,l+=u;l>0;a=256*a+t[e+p],p+=f,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+t[e+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(_?-1:1);i+=Math.pow(2,n),a-=c}return(_?-1:1)*i*Math.pow(2,a-n)},write:function(t,e,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-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?(u=isNaN(e)?1:0,i=l):(i=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-i))<1&&(i--,s*=2),(e+=i+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(i++,s/=2),i+p>=l?(u=0,i=l):i+p>=1?(u=(e*s-1)*Math.pow(2,o),i+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;t[r+_]=255&u,_+=h,u/=256,o-=8);for(i=i<0;t[r+_]=255&i,_+=h,i/=256,c-=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,a="function"==typeof TextDecoder?new TextDecoder:void 0,i="function"==typeof TextEncoder?new TextEncoder:void 0,u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},u.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,a="",i=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");a+=u[(e=r<<16|n<<8|o)>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}return i?a.slice(0,i-3)+"===".substring(i):a},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,b=function(t){return t.replace(g,m)},A=o?function(t){return e.from(t,"utf8").toString("base64")}:i?function(t){return y(i.encode(t))}:function(t){return d(b(t))},E=function(t,e){return void 0===e&&(e=!1),e?f(A(t)):A(t)},w=function(t){return E(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},S=function(t){return t.replace(C,x)},$=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",a=0;a>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:$,P=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},F=function(t){return P(k(t))},L=o?function(t){return e.from(t,"base64").toString("utf8")}:a?function(t){return a.decode(P(t))}:function(t){return S(O(t))},k=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return L(k(t))},I=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},T=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,I(e))};t("fromBase64",(function(){return R(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 F(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,I(e))};t("toBase64",(function(t){return v(this,t)})),t("toBase64URI",(function(){return v(this,!0)})),t("toBase64URL",(function(){return v(this,!0)}))},D={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:$,btoa:d,btoaPolyfill:h,fromBase64:R,toBase64:E,encode:E,encodeURI:w,encodeURL:w,utob:b,btou:S,decode:R,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:v,toUint8Array:F,extendString:T,extendUint8Array:j,extendBuiltins:function(){T(),j()},Base64:{}};return Object.keys(D).forEach((function(t){return D.Base64[t]=D[t]})),D}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_75(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_65.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,a=r.password,i=r.servers,u=0;u({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const a=e.find(({source:e})=>e===t.source),i=t.start;if(a){const e=t.end,u=a.text[i.line-1],s=(i.line===e.line?e.column:u.length+1)-i.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${i.line}:${i.column}\n${"".padEnd(r)} |\n${i.line.toString().padStart(r)} | ${u}\n${"".padEnd(r)} | ${"".padEnd(i.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${i.line}:${i.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let a;a=(a=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let i=`${t}: ${e}`;n&&(i+=r(n,a));for(const u of o)i+=r(u.location,a,u.message);return i}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const a={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(a).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=a[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return a(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=a(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let i=0;i0?NEVER_MATCH:SOMETIMES_MATCH}const a=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=a(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-a(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=a(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});a(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function a(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function i(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},a=JSON.stringify(n),i=o.findIndex(t=>JSON.stringify(t)===a);return-1===i?o.push(n)-1:i}function u(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],h(t,{sp:r.sp+1,env:u(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=i(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function _(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const h=_$visitor_52.build({grammar(t){t.rules.forEach(h),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=h(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:a({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],h(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=h(e[0],{sp:r.sp,env:u(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=u(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=h(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),a=0|t.expression.match,p=n&&a!==__NEVER_MATCH_39?i(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(a,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(h(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=i(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=u(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),h(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],h(t.expression,{sp:e.sp+1,env:u(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(h(t.expression,{sp:e.sp,env:u(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,_(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(_(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>h(t.expression,{sp:e.sp,env:u(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?a({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?a({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?a({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});h(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const a=o.toString();return"absolute"===r?a:"scheme-relative"===r?a.slice(PROTOCOL.length):"path-absolute"===r?a.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,a)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(a){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&a>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const a=t.sourceContentFor(n);null!=a&&r.setSourceContent(n,a)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const a=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,i=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const u=e.source;null==u||a.has(u)||a.add(u);const s=e.name;null==s||i.has(s)||i.add(s)}),this),this._sources=a,this._names=i,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,a=1,i=0,u=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,_=p.length;f<_;f++){if(t="",(e=p[f]).generatedLine!==a)for(o=0;e.generatedLine!==a;)t+=";",a++;else if(f>0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-u),u=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-i),i=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let a=0;const i=function(){return t()+(t()||"");function t(){return a=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+i,0===i?o:0,e.source,i===a.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function a(t){return"peg$e"+t}function i(t){return"peg$f"+t}function u(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const a={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),a=n();return a.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{a.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),a.push("")),a.push(t,"","module.exports = "+o()+";"),a},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const a=Object.keys(e.dependencies),i="["+a.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",u=a.join(", ");return[...n(),"define("+i+", function("+u+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const a=Object.keys(e.dependencies),i=a.map(t=>e.dependencies[t]),u="["+i.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=i.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=a.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+u+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,a.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+u(t)).join(", ")+" }",p=u(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+a(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${i(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let _;function h(t,n){const o=n+3,a=s[c+o-2],i=s[c+o-1];let u,p;l.checkedIf(c,()=>{c+=o,u=e(s.slice(c,c+a)),c+=a},i>0?()=>{p=e(s.slice(c,c+i)),c+=i}:null),f.push("if ("+t+") {"),f.push(...u.map(r)),i>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function y(){const t=s[c+4-1],e=i(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(_)),c+=r;break}case _$opcodes_38.IF:h(l.top(),0);break;case _$opcodes_38.IF_ERROR:h(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:h(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:h("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:h(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:h("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:h(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+a(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:y();break;case _$opcodes_38.RULE:f.push(l.push(u(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",u(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,a)=>{var i;"rule"===(i=o).type&&"rule_ref"===i.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(a))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){a(t.expression,n(e))}const a=_$visitor_52.build({rule(t){a(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{a(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),a(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});a(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],a=_$visitor_52.build({rule(t){n.push(t.name),a(t.expression),n.pop()},sequence(e){e.elements.every(e=>(a(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const i=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",i.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));i&&a(i),o.pop()}});a(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eYt&&(Yt=Ht,zt=[]),zt.push(t))}function re(){var e,r,o,a,i,u;if(e=Ht,Re(),r=Ht,(o=function(){var e,r,o,a;return e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(E)),r!==n&&(o=ke())!==n?(125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===Wt&&ee(w)),a!==n&&Ie()!==n?(Gt=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Kt()}}(o)):(Ht=e,e=n)):(Ht=e,e=n),e}())!==n?(a=Re(),r=o):(Ht=r,r=n),r===n&&(r=null),o=Ht,(a=function(){var t,e;return t=Ht,(e=ke())!==n&&Ie()!==n?(Gt=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Kt()}}(e)):(Ht=t,t=n),t}())!==n?(i=Re(),o=a):(Ht=o,o=n),o===n&&(o=null),a=[],i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n);else a=n;return a!==n?(Gt=e,e={type:"grammar",topLevelInitializer:r,initializer:o,rules:a,location:Kt()}):(Ht=e,e=n),e}function ne(){var e,r,o,a,i,u,s,c;return e=Ht,(r=me())!==n?(Re(),o=Ht,(a=Ae())!==n?(Re(),o=a):(Ht=o,o=n),o===n&&(o=null),61===t.charCodeAt(Ht)?(a="=",Ht++):(a=n,0===Wt&&ee(C)),a!==n?(Re(),(i=oe())!==n&&Ie()!==n?(Gt=e,s=o,c=i,e={type:"rule",name:(u=r)[0],nameLocation:u[1],expression:null!==s?{type:"named",name:s,expression:c,location:Kt()}:c,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n),e}function oe(){var e,r,o,a,i,u,s,c;if(e=Ht,(r=ae())!==n){for(o=[],a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===Wt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);a!==n;)o.push(a),a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===Wt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);Gt=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Kt()}:s}else Ht=e,e=n;return e}function ae(){var t,e,r,o;return t=Ht,(e=function(){var t,e,r,o,a,i,u;if(t=Ht,(e=ie())!==n){for(r=[],o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);o!==n;)r.push(o),o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);Gt=t,i=e,t=(u=r).length>0||"labeled"===i.type&&i.pick?{type:"sequence",elements:[i].concat(u),location:Kt()}:i}else Ht=t,t=n;return t}())!==n?(r=Ht,Re(),(o=ke())!==n?r=o:(Ht=r,r=n),r===n&&(r=null),Gt=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Kt()}:t}(e,r)):(Ht=t,t=n),t}function ie(){var e,r,o,a,i,u,s;return e=Ht,(r=function(){var e,r;return e=Ht,64===t.charCodeAt(Ht)?(r="@",Ht++):(r=n,0===Wt&&ee(S)),r!==n&&(Gt=e,r=Kt()),r}())!==n?((o=ue())===n&&(o=null),(a=se())!==n?(Gt=e,i=r,u=o,(s=a).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',i),e={type:"labeled",label:null!==u?u[0]:null,labelLocation:null!==u?u[1]:i,pick:!0,expression:s,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=Ht,(r=ue())!==n?(o=Re(),(a=se())!==n?(Gt=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Kt()}}(r,a)):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=se())),e}function ue(){var e,r,o,a;return e=Ht,(r=me())!==n?(Re(),58===t.charCodeAt(Ht)?(o=":",Ht++):(o=n,0===Wt&&ee($)),o!==n?(Gt=e,a=r,Te.indexOf(a[0])>=0&&Vt(`Label can't be a reserved word "${a[0]}"`,a[1]),e=a):(Ht=e,e=n)):(Ht=e,e=n),e}function se(){var e,r,o,a;return e=Ht,(r=function(){var e;return 36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(P)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(F)))),e}())!==n?(Re(),(o=ce())!==n?(Gt=e,a=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:a,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,a;return e=Ht,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Ht)?(e="?",Ht++):(e=n,0===Wt&&ee(L)),e===n&&(42===t.charCodeAt(Ht)?(e="*",Ht++):(e=n,0===Wt&&ee(k)),e===n&&(43===t.charCodeAt(Ht)?(e="+",Ht++):(e=n,0===Wt&&ee(R)))),e}())!==n?(Gt=e,a=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:a,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,a,i;return(e=function(){var e,r,o;return Wt++,e=Ht,(r=Ae())!==n?(105===t.charCodeAt(Ht)?(o="i",Ht++):(o=n,0===Wt&&ee(ut)),o===n&&(o=null),Gt=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Kt()}):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(it)),e}())===n&&(e=function(){var e,r,o,a,i,u,s,c;if(Wt++,e=Ht,91===t.charCodeAt(Ht)?(r="[",Ht++):(r=n,0===Wt&&ee(ft)),r!==n){for(94===t.charCodeAt(Ht)?(o="^",Ht++):(o=n,0===Wt&&ee(_t)),o===n&&(o=null),a=[],(i=Ce())===n&&(i=xe());i!==n;)a.push(i),(i=Ce())===n&&(i=xe());93===t.charCodeAt(Ht)?(i="]",Ht++):(i=n,0===Wt&&ee(ht)),i!==n?(105===t.charCodeAt(Ht)?(u="i",Ht++):(u=n,0===Wt&&ee(ut)),u===n&&(u=null),Gt=e,s=o,c=u,e={type:"class",parts:a.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Kt()}):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Ht,46===t.charCodeAt(Ht)?(r=".",Ht++):(r=n,0===Wt&&ee($t)),r!==n&&(Gt=e,r={type:"any",location:Kt()}),r}())===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,(r=me())!==n?(o=Ht,Wt++,a=Ht,i=Re(),u=Ht,(s=Ae())!==n?u=s=[s,Re()]:(Ht=u,u=n),u===n&&(u=null),61===t.charCodeAt(Ht)?(s="=",Ht++):(s=n,0===Wt&&ee(C)),s!==n?a=i=[i,u,s]:(Ht=a,a=n),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(Gt=e,e={type:"rule_ref",name:r[0],location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Ht,(r=function(){var e;return 38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(P)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(F))),e}())!==n?(Re(),(o=ke())!==n?(Gt=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Kt()}}(r,o)):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Ht,40===t.charCodeAt(Ht)?(r="(",Ht++):(r=n,0===Wt&&ee(I)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Ht)?(a=")",Ht++):(a=n,0===Wt&&ee(T)),a!==n?(Gt=e,e="labeled"===(i=o).type||"sequence"===i.type?{type:"group",expression:i,location:Kt()}:i):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n)),e}function pe(){var e;return t.length>Ht?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(j)),e}function fe(){var e;return Wt++,9===t.charCodeAt(Ht)?(e="\t",Ht++):(e=n,0===Wt&&ee(B)),e===n&&(11===t.charCodeAt(Ht)?(e="\v",Ht++):(e=n,0===Wt&&ee(N)),e===n&&(12===t.charCodeAt(Ht)?(e="\f",Ht++):(e=n,0===Wt&&ee(M)),e===n&&(32===t.charCodeAt(Ht)?(e=" ",Ht++):(e=n,0===Wt&&ee(U)),e===n&&(160===t.charCodeAt(Ht)?(e="\xa0",Ht++):(e=n,0===Wt&&ee(H)),e===n&&(65279===t.charCodeAt(Ht)?(e="\ufeff",Ht++):(e=n,0===Wt&&ee(G)),e===n&&(e=function(){var e;return A.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Mt)),e}())))))),Wt--,e===n&&0===Wt&&ee(D),e}function _e(){var e;return u.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(q)),e}function he(){var e;return Wt++,10===t.charCodeAt(Ht)?(e="\n",Ht++):(e=n,0===Wt&&ee(z)),e===n&&("\r\n"===t.substr(Ht,2)?(e="\r\n",Ht+=2):(e=n,0===Wt&&ee(W)),e===n&&(13===t.charCodeAt(Ht)?(e="\r",Ht++):(e=n,0===Wt&&ee(K)),e===n&&(8232===t.charCodeAt(Ht)?(e="\u2028",Ht++):(e=n,0===Wt&&ee(V)),e===n&&(8233===t.charCodeAt(Ht)?(e="\u2029",Ht++):(e=n,0===Wt&&ee(X)))))),Wt--,e===n&&0===Wt&&ee(Y),e}function de(){var e;return Wt++,(e=function(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===Wt&&ee(Q)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}())===n&&(e=ve()),Wt--,e===n&&0===Wt&&ee(J),e}function ye(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u===n&&(u=_e()),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u===n&&(u=_e()),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===Wt&&ee(Q)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}function ve(){var e,r,o,a,i,u;if(e=Ht,"//"===t.substr(Ht,2)?(r="//",Ht+=2):(r=n,0===Wt&&ee(tt)),r!==n){for(o=[],a=Ht,i=Ht,Wt++,u=_e(),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,Wt++,u=_e(),Wt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);e=r=[r,o]}else Ht=e,e=n;return e}function me(){var t,e,r,o;if(Wt++,t=Ht,(e=ge())!==n){for(r=[],o=be();o!==n;)r.push(o),o=be();Gt=t,t=[e+r.join(""),Kt()]}else Ht=t,t=n;return Wt--,t===n&&(e=n,0===Wt&&ee(et)),t}function ge(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(It)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Ft)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Lt)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(kt)),e}())===n&&(e=function(){var e;return g.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Bt)),e}()),e}())===n&&(36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(95===t.charCodeAt(Ht)?(e="_",Ht++):(e=n,0===Wt&&ee(rt)),e===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Pe())!==n?e=o:(Ht=e,e=n)))),e}function be(){var e;return(e=ge())===n&&(e=function(){var e;return(e=function(){var e;return v.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(jt)),e}())===n&&(e=function(){var e;return y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Tt)),e}()),e}())===n&&(e=function(){var e;return m.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Dt)),e}())===n&&(e=function(){var e;return b.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Nt)),e}())===n&&(8204===t.charCodeAt(Ht)?(e="\u200c",Ht++):(e=n,0===Wt&&ee(ot)),e===n&&(8205===t.charCodeAt(Ht)?(e="\u200d",Ht++):(e=n,0===Wt&&ee(at)))),e}function Ae(){var e,r,o,a;if(Wt++,e=Ht,34===t.charCodeAt(Ht)?(r='"',Ht++):(r=n,0===Wt&&ee(ct)),r!==n){for(o=[],a=Ee();a!==n;)o.push(a),a=Ee();34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===Wt&&ee(ct)),a!==n?(Gt=e,e=o.join("")):(Ht=e,e=n)}else Ht=e,e=n;if(e===n)if(e=Ht,39===t.charCodeAt(Ht)?(r="'",Ht++):(r=n,0===Wt&&ee(lt)),r!==n){for(o=[],a=we();a!==n;)o.push(a),a=we();39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===Wt&&ee(lt)),a!==n?(Gt=e,e=function(t){return t.join("")}(o)):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(st)),e}function Ee(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===Wt&&ee(ct)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function we(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===Wt&&ee(lt)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Ce(){var e,r,o,a,i,u;return e=Ht,(r=xe())!==n?(45===t.charCodeAt(Ht)?(o="-",Ht++):(o=n,0===Wt&&ee(dt)),o!==n&&(a=xe())!==n?(Gt=e,u=a,(i=r).charCodeAt(0)>u.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(Gt,Ht)+"."),e=[i,u]):(Ht=e,e=n)):(Ht=e,e=n),e}function xe(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,93===t.charCodeAt(Ht)?(a="]",Ht++):(a=n,0===Wt&&ee(ht)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===Wt&&ee(nt)),a===n&&(a=_e())),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Se(){var e,r;return e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&he()!==n?(Gt=e,e=""):(Ht=e,e=n),e}function $e(){var e,r,o,a;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,Wt++,(a=function(){var e;return(e=Oe())===n&&(e=Fe())===n&&(120===t.charCodeAt(Ht)?(e="x",Ht++):(e=n,0===Wt&&ee(wt)),e===n&&(117===t.charCodeAt(Ht)?(e="u",Ht++):(e=n,0===Wt&&ee(Ct)))),e}())===n&&(a=_e()),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),r!==n?t.substring(e,Ht):r}()),e}())===n&&(e=Ht,48===t.charCodeAt(Ht)?(r="0",Ht++):(r=n,0===Wt&&ee(yt)),r!==n?(o=Ht,Wt++,a=Fe(),Wt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(Gt=e,e="\0"):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,120===t.charCodeAt(Ht)?(r="x",Ht++):(r=n,0===Wt&&ee(wt)),r!==n?(o=Ht,a=Ht,(i=Le())!==n&&(u=Le())!==n?a=i=[i,u]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(Gt=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Pe())),e}function Oe(){var e,r;return 39===t.charCodeAt(Ht)?(e="'",Ht++):(e=n,0===Wt&&ee(lt)),e===n&&(34===t.charCodeAt(Ht)?(e='"',Ht++):(e=n,0===Wt&&ee(ct)),e===n&&(92===t.charCodeAt(Ht)?(e="\\",Ht++):(e=n,0===Wt&&ee(nt)),e===n&&(e=Ht,98===t.charCodeAt(Ht)?(r="b",Ht++):(r=n,0===Wt&&ee(vt)),r!==n&&(Gt=e,r="\b"),(e=r)===n&&(e=Ht,102===t.charCodeAt(Ht)?(r="f",Ht++):(r=n,0===Wt&&ee(mt)),r!==n&&(Gt=e,r="\f"),(e=r)===n&&(e=Ht,110===t.charCodeAt(Ht)?(r="n",Ht++):(r=n,0===Wt&&ee(gt)),r!==n&&(Gt=e,r="\n"),(e=r)===n&&(e=Ht,114===t.charCodeAt(Ht)?(r="r",Ht++):(r=n,0===Wt&&ee(bt)),r!==n&&(Gt=e,r="\r"),(e=r)===n&&(e=Ht,116===t.charCodeAt(Ht)?(r="t",Ht++):(r=n,0===Wt&&ee(At)),r!==n&&(Gt=e,r="\t"),(e=r)===n&&(e=Ht,118===t.charCodeAt(Ht)?(r="v",Ht++):(r=n,0===Wt&&ee(Et)),r!==n&&(Gt=e,r="\v"),e=r)))))))),e}function Pe(){var e,r,o,a,i,u,s,c,l;return e=Ht,117===t.charCodeAt(Ht)?(r="u",Ht++):(r=n,0===Wt&&ee(Ct)),r!==n?(o=Ht,a=Ht,(i=Le())!==n&&(u=Le())!==n&&(s=Le())!==n&&(c=Le())!==n?a=i=[i,u,s,c]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(Gt=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Ht=e,e=n)):(Ht=e,e=n),e}function Fe(){var e;return s.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(xt)),e}function Le(){var e;return c.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(St)),e}function ke(){var e,r,o,a;return Wt++,e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(E)),r!==n?(o=function(){var e,r;return e=Ht,r=function e(){var r,o,a,i,u,s;if(r=Ht,o=[],a=[],i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Pt)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Pt)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;for(a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===Wt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n));a!==n;){if(o.push(a),a=[],i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Pt)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Pt)),Wt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===Wt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n))}return t.substring(r,Ht)}(),Gt=e,r=function(t){return[t,Kt()]}(r)}(),125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===Wt&&ee(w)),a!==n?e=o:(Ht=e,e=n)):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=he())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=he())===n&&(e=de());return t}function Ie(){var e,r,o,a;return e=Ht,r=Re(),59===t.charCodeAt(Ht)?(o=";",Ht++):(o=n,0===Wt&&ee(Ut)),o!==n?e=r=[r,o]:(Ht=e,e=n),e===n&&(e=Ht,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=ye());e!==n;)t.push(e),(e=fe())===n&&(e=ye());return t}(),(o=ve())===n&&(o=null),(a=he())!==n?e=r=[r,o,a]:(Ht=e,e=n),e===n&&(e=Ht,r=Re(),(o=function(){var e,r;return e=Ht,Wt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=n,0===Wt&&ee(j)),Wt--,r===n?e=void 0:(Ht=e,e=n),e}())!==n?e=r=[r,o]:(Ht=e,e=n))),e}const Te=e.reservedWords||[];if((r=i())!==n&&Ht===t.length)return r;throw r!==n&&Ht{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(u[p]=f)}}catch(_){c.e(_)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},i),{},{name:u.remarks?_$base64_4.Base64.decode(u.remarks):i.server,"protocol-param":(0,_$utils_102.getIfNotBlank)(_$base64_4.Base64.decode(u.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_102.getIfNotBlank)(_$base64_4.Base64.decode(u.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={},a=___createForOfIteratorHelper_70(n);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(-1!==i.indexOf("=")){var u=___slicedToArray_70(i.split("="),2),s=u[0],c=u[1];o[s.trim()]=c.trim()}}}catch(h){a.e(h)}finally{a.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_102.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_102.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_102.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_102.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_102.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_102.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_102.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),_={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_102.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_102.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(_.network="ws",_["ws-opts"]={path:(0,_$utils_102.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_102.getIfNotBlank)(f.host)}},_.tls&&f.host&&(_.sni=f.host)),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$gist_101={};function ___typeof_101(t){return(___typeof_101="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_101(){___regeneratorRuntime_101=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_101(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_101(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_101(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_101(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_101(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_90(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_90(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_96(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_96(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_96(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_96(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>").concat(JSON.stringify(a,null,2))),t.prev=11,t.next=14,(0,_$artifacts_90.syncToGist)((c={},l=encodeURIComponent(a.name),p={content:i},l in c?Object.defineProperty(c,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[l]=p,c));case 14:u=t.sent,a.updated=(new Date).getTime(),s=JSON.parse(u.body),a.url=s.files[encodeURIComponent(a.name)].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_96.default.write(o,_$constants_67.ARTIFACTS_KEY),(0,_$response_95.success)(r,a),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),(0,_$response_95.failed)(r,new _$errors_92.InternalServerError("FAILED_TO_SYNC_ARTIFACT","Failed to sync artifact ".concat(n),"Reason: ".concat(t.t0)));case 25:case"end":return t.stop()}var c,l,p}),t,null,[[11,22]])})))).apply(this,arguments)}var _$download_91={};Object.defineProperty(_$download_91,"__esModule",{value:!0}),_$download_91.default=function(t){t.get("/download/collection/:name",downloadCollection),t.get("/download/:name",downloadSubscription)};var __obj_91,___app_91=(__obj_91=_$app_68)&&__obj_91.__esModule?__obj_91:{default:__obj_91};function ___typeof_91(t){return(___typeof_91="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_91(){___regeneratorRuntime_91=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_91(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_91(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_91(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_91(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_91(a,n,o,i,u,"throw",t)}i(void 0)}))}}function downloadSubscription(t,e){return _downloadSubscription.apply(this,arguments)}function _downloadSubscription(){return(_downloadSubscription=___asyncToGenerator_91(___regeneratorRuntime_91().mark((function t(e,r){var n,o,a,i,u,s;return ___regeneratorRuntime_91().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.params.name,n=decodeURIComponent(n),o=e.query.target||(0,_$platform_105.getPlatformFromHeaders)(e.headers)||"JSON",___app_91.default.info("\u6b63\u5728\u4e0b\u8f7d\u8ba2\u9605\uff1a".concat(n)),a=___app_91.default.read(_$constants_67.SUBS_KEY),!(i=(0,_$database_97.findByName)(a,n))){t.next=26;break}return t.prev=7,t.next=10,(0,_$sync_96.produceArtifact)({type:"subscription",name:n,platform:o});case 10:if(u=t.sent,"local"===i.source){t.next=16;break}return t.next=14,(0,_$flow_99.getFlowHeaders)(i.url);case 14:(s=t.sent)&&r.set("subscription-userinfo",s);case 16:"JSON"===o?r.set("Content-Type","application/json;charset=utf-8").send(u):r.send(u),t.next=24;break;case 19:t.prev=19,t.t0=t.catch(7),___app_91.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u8ba2\u9605\u5931\u8d25","\u274c \u65e0\u6cd5\u4e0b\u8f7d\u8ba2\u9605\uff1a".concat(n,"\uff01"),"\ud83e\udd14 \u539f\u56e0\uff1a".concat(JSON.stringify(t.t0))),___app_91.default.error(JSON.stringify(t.t0)),(0,_$response_95.failed)(r,new _$errors_92.InternalServerError("INTERNAL_SERVER_ERROR","Failed to download subscription: ".concat(n),"Reason: ".concat(JSON.stringify(t.t0))));case 24:t.next=28;break;case 26:___app_91.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u8ba2\u9605\uff1a".concat(n,"\uff01")),(0,_$response_95.failed)(r,new _$errors_92.ResourceNotFoundError("RESOURCE_NOT_FOUND","Subscription ".concat(n," does not exist!")),404);case 28:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}function downloadCollection(t,e){return _downloadCollection.apply(this,arguments)}function _downloadCollection(){return(_downloadCollection=___asyncToGenerator_91(___regeneratorRuntime_91().mark((function t(e,r){var n,o,a,i,u,s,c,l,p;return ___regeneratorRuntime_91().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.params.name,n=decodeURIComponent(n),o=e.query.target||(0,_$platform_105.getPlatformFromHeaders)(e.headers)||"JSON",a=___app_91.default.read(_$constants_67.COLLECTIONS_KEY),i=(0,_$database_97.findByName)(a,n),___app_91.default.info("\u6b63\u5728\u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n)),!i){t.next=29;break}return t.prev=7,t.next=10,(0,_$sync_96.produceArtifact)({type:"collection",name:n,platform:o});case 10:if(u=t.sent,s=___app_91.default.read(_$constants_67.SUBS_KEY),!((c=i.subscriptions).length>0)){t.next=20;break}if("local"===(l=(0,_$database_97.findByName)(s,c[0])).source){t.next=20;break}return t.next=18,(0,_$flow_99.getFlowHeaders)(l.url);case 18:(p=t.sent)&&r.set("subscription-userinfo",p);case 20:"JSON"===o?r.set("Content-Type","application/json;charset=utf-8").send(u):r.send(u),t.next=27;break;case 23:t.prev=23,t.t0=t.catch(7),___app_91.default.notify("\ud83c\udf0d Sub-Store \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)),(0,_$response_95.failed)(r,new _$errors_92.InternalServerError("INTERNAL_SERVER_ERROR","Failed to download collection: ".concat(n),"Reason: ".concat(JSON.stringify(t.t0))));case 27:t.next=31;break;case 29:___app_91.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n,"\uff01")),(0,_$response_95.failed)(r,new _$errors_92.ResourceNotFoundError("RESOURCE_NOT_FOUND","Collection ".concat(n," does not exist!")),404);case 31:case"end":return t.stop()}}),t,null,[[7,23]])})))).apply(this,arguments)}var _$preview_94={};Object.defineProperty(_$preview_94,"__esModule",{value:!0}),_$preview_94.default=function(t){t.post("/api/preview/sub",compareSub),t.post("/api/preview/collection",compareCollection)};var ___proxyUtils_94=_$proxyUtils_69({}),___download_94=___interopRequireDefault_94(_$download_98),___app_94=___interopRequireDefault_94(_$app_68);function ___interopRequireDefault_94(t){return t&&t.__esModule?t:{default:t}}function ___typeof_94(t){return(___typeof_94="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_94(){___regeneratorRuntime_94=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_94(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_94(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_94(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_94(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_94(a,n,o,i,u,"throw",t)}i(void 0)}))}}function compareSub(t,e){return _compareSub.apply(this,arguments)}function _compareSub(){return(_compareSub=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){var n,o,a,i,u;return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.body,o=e.query.target||"JSON","local"!==n.source){t.next=6;break}a=n.content,t.next=16;break;case 6:return t.prev=6,t.next=9,(0,___download_94.default)(n.url,n.ua);case 9:a=t.sent,t.next=16;break;case 12:return t.prev=12,t.t0=t.catch(6),(0,_$response_95.failed)(r,new _$errors_92.NetworkError("FAILED_TO_DOWNLOAD_RESOURCE","\u65e0\u6cd5\u4e0b\u8f7d\u8fdc\u7a0b\u8d44\u6e90","Reason: ".concat(t.t0))),t.abrupt("return");case 16:return(i=___proxyUtils_94.ProxyUtils.parse(a)).forEach((function(t,e){t.id=e})),t.next=20,___proxyUtils_94.ProxyUtils.process(i,n.process||[],o);case 20:u=t.sent,(0,_$response_95.success)(r,{original:i,processed:u});case 22:case"end":return t.stop()}}),t,null,[[6,12]])})))).apply(this,arguments)}function compareCollection(t,e){return _compareCollection.apply(this,arguments)}function _compareCollection(){return(_compareCollection=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){var n,o,a,i,u,s;return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=___app_94.default.read(_$constants_67.SUBS_KEY),o=e.body,a=o.subscriptions,i={},t.next=6,Promise.all(a.map(function(){var t=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e){var o,a,u;return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=(0,_$database_97.findByName)(n,e),t.prev=1,"local"!==o.source){t.next=6;break}a=o.content,t.next=9;break;case 6:return t.next=8,(0,___download_94.default)(o.url,o.ua);case 8:a=t.sent;case 9:return u=___proxyUtils_94.ProxyUtils.parse(a),t.next=12,___proxyUtils_94.ProxyUtils.process(u,o.process||[],"JSON");case 12:u=t.sent,i[e]=u,t.next=19;break;case 16:t.prev=16,t.t0=t.catch(1),(0,_$response_95.failed)(r,new _$errors_92.InternalServerError("PROCESS_FAILED","\u5904\u7406\u5b50\u8ba2\u9605 ".concat(e," \u5931\u8d25"),"Reason: ".concat(t.t0)));case 19:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()));case 6:return(u=Array.prototype.concat.apply([],a.map((function(t){return i[t]||[]})))).forEach((function(t,e){t.id=e})),t.next=10,___proxyUtils_94.ProxyUtils.process(u,o.process||[],"JSON");case 10:s=t.sent,(0,_$response_95.success)(r,{original:u,processed:s});case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var _$nodeInfo_93={};Object.defineProperty(_$nodeInfo_93,"__esModule",{value:!0}),_$nodeInfo_93.default=function(t){t.post("/api/utils/node-info",getNodeInfo)};var __obj_93,___producers_93=(__obj_93=_$producers_78)&&__obj_93.__esModule?__obj_93:{default:__obj_93};function ___typeof_93(t){return(___typeof_93="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_93(){___regeneratorRuntime_93=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_93(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_93(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function getNodeInfo(t,e){return _getNodeInfo.apply(this,arguments)}function _getNodeInfo(){var t;return t=___regeneratorRuntime_93().mark((function t(e,r){var n,o,a,i,u;return ___regeneratorRuntime_93().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.body,o=e.query.lang||"zh-CN";try{a=___producers_93.default.URI.produce(n)}catch(s){}return t.prev=3,i=(0,_$openApi_109.HTTP)(),t.next=7,i.get({url:"http://ip-api.com/json/".concat(encodeURIComponent(n.server),"?lang=").concat(o),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"}}).then((function(t){var e=JSON.parse(t.body);if("success"!==e.status)throw new Error(e.message);return delete e.status,e}));case 7:u=t.sent,(0,_$response_95.success)(r,{shareUrl:a,info:u}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),(0,_$response_95.failed)(r,new _$errors_92.NetworkError("FAILED_TO_GET_NODE_INFO","Failed to get node info","Reason: ".concat(t.t0)));case 14:case"end":return t.stop()}}),t,null,[[3,11]])})),(_getNodeInfo=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_93(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_93(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$subStore1_89={};function ___typeof_89(t){return(___typeof_89="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)}var $app,fn,_ref,_migration=___interopRequireDefault_89(_$migration_104),_express=___interopRequireDefault_89(_$express_107),___app_89=___interopRequireDefault_89(_$app_68),___download_89=___interopRequireDefault_89(_$download_91),_preview=___interopRequireDefault_89(_$preview_94),___sync_89=___interopRequireDefault_89(_$sync_96),_nodeInfo=___interopRequireDefault_89(_$nodeInfo_93);function ___interopRequireDefault_89(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_89(){___regeneratorRuntime_89=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_89(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_89(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}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 Sub-Store -- v".concat(_$package_66.version,"\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,_migration.default)(),$app=(0,_express.default)({substore:___app_89.default}),(0,___download_89.default)($app),(0,_preview.default)($app),(0,___sync_89.default)($app),(0,_nodeInfo.default)($app),$app.options("/",(fn=___regeneratorRuntime_89().mark((function t(e,r){return ___regeneratorRuntime_89().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.status(200).end();case 1:case"end":return t.stop()}}),t)})),_ref=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=fn.apply(t,e);function a(t){__asyncGeneratorStep_89(o,r,n,a,i,"next",t)}function i(t){__asyncGeneratorStep_89(o,r,n,a,i,"throw",t)}a(void 0)}))},function(t,e){return _ref.apply(this,arguments)})),$app.start()}(); \ No newline at end of file diff --git a/backend/dist/sub-store-parser.loon.min.js b/backend/dist/sub-store-parser.loon.min.js index 10b962c34..2fad1b831 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/9/9 21:06:45 - * @version: 2.12.9 + * @updated: 2022/9/9 23:06:30 + * @version: 2.13.0 * @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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_90),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=u?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(o,a,i):o[a]=t[a]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),u=c(_$preprocessors_75),a=c(_$producers_78),i=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",i=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,u=Object.create(o.prototype),a=new x(n||[]);return u._invoke=function(t,e,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var i=b(a,r);if(i){if(i===f)continue;return i}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),u}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function h(){}function _(){}function d(){}var m={};s(m,u,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g($([])));y&&y!==e&&n.call(y,u)&&(m=y);var v=d.prototype=h.prototype=Object.create(m);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var o;this._invoke=function(u,a){function i(){return new e((function(o,i){!function o(u,a,i,s){var c=p(t[u],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}(u,a,o,i)}))}return o=o?o.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function $(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var i=n.call(u,"catchLoc"),s=n.call(u,"finallyLoc");if(i&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:$(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],a=!0,i=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);a=!0);}catch(s){i=!0,o=s}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return u}}(t,e)||_(t,e)||function(){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 h(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function _(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],u=x.length>2?x[2]:void 0,a=h(r),t.prev=3,a.s();case 5:if((i=a.n()).done){t.next=39;break}if(c=i.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(_=c.args,d=_.mode,m=_.content,"link"!==d){t.next=27;break}if((y=(g=m).split("#")).length>1){v=h(y[1].split("&"));try{for(v.s();!(A=v.n()).done;)E=A.value,b=E.split("=")[0],w=E.split("=")[1]||!0,f[b]=w}catch(l){v.e(l)}finally{v.f()}}return t.prev=15,t.next=18,(0,n.default)(g.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=m;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,u,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),a.e(t.t1);case 44:return t.prev=44,a.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(m=function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){p(u,n,o,a,i,"next",t)}function i(t){p(u,n,o,a,i,"throw",t)}a(void 0)}))}).apply(this,arguments)}var g={parse:function(t){t=function(t){var e,r=h(u.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(a){r.e(a)}finally{r.f()}return t}(t);var e,r,n=[],o=h(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var a=r.value;if(0!==(a=a.trim()).length){var c=!1;if(e){var l=f(y(e,a),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var _,d=h(i.default);try{for(d.s();!(_=d.n()).done;){var m=_.value,g=f(y(m,a),2),v=g[0];if(!g[1]){n.push(v),e=m,c=!0,s.default.info("".concat(m.name," is activated"));break}}}catch(A){d.e(A)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(a))}}}catch(A){o.e(A)}finally{o.f()}return n},process:function(t){return m.apply(this,arguments)},produce:function(t,e){var r=a.default[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])})),s.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 s.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}};function y(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=g})),_$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 u(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|s(e,n),u=t(o),a=u.write(e,n);return a!==o&&(u=u.slice(0,a)),u}(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(B(e,ArrayBuffer)||e&&B(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(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 u=!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(u)return o?-1:I(t).length;e=(""+e).toLowerCase(),u=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,u){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),D(n=+n)&&(n=u?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(u)return-1;n=t.length-1}else if(n<0){if(!u)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,u);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?u?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,u);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var u,a=1,i=t.length,s=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,i/=2,s/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(u=r;ui&&(r=i-s),u=r;u>=0;u--){for(var p=!0,f=0;fo&&(n=o):n=o;var u=e.length;n>u/2&&(n=u/2);for(var a=0;a>8,o=r%256,u.push(o),u.push(n);return u}(e,t.length-r),t,r,n)}function y(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(u=t[o+1]))&&(s=(31&c)<<6|63&u)>127&&(l=s);break;case 3:u=t[o+1],a=t[o+2],128==(192&u)&&128==(192&a)&&(s=(15&c)<<12|(63&u)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:u=t[o+1],a=t[o+2],i=t[o+3],128==(192&u)&&128==(192&a)&&128==(192&i)&&(s=(15&c)<<18|(63&u)<<12|(63&a)<<6|63&i)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=A)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 w(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return b(this,e,r);case"base64":return y(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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,u){if(B(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===u&&(u=this.length),e<0||n>t.length||o<0||u>this.length)throw new RangeError("out of range index");if(o>=u&&e>=n)return 0;if(o>=u)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(u>>>=0)-(o>>>=0),i=(n>>>=0)-(e>>>=0),s=Math.min(a,i),c=this.slice(o,u),l=t.slice(e,n),p=0;p>>=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 u=!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 _(this,t,e,r);case"latin1":case"binary":return d(this,t,e,r);case"base64":return m(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,t,e,r);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var u="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,n,o,u,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>u||et.length)throw new RangeError("Index out of range")}function S(t,e,r,n,o,u){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||S(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||S(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||x(t,e,this.length);for(var n=this[t],o=1,u=0;++u>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,u=0;++u=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,u=this[t+--n];n>0&&(o*=256);)u+=this[t+--n]*o;return u>=(o*=128)&&(u-=Math.pow(2,8*e)),u},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||$(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,u=0;for(this[e]=255&t;++u>>=0,r>>>=0,n||$(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,u=1;for(this[e+o]=255&t;--o>=0&&(u*=256);)this[e+o]=t/u&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,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||$(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||$(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||$(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||$(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);$(this,t,e,r,o-1,-o)}var u=0,a=1,i=0;for(this[e]=255&t;++u>0)-i&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);$(this,t,e,r,o-1,-o)}var u=r-1,a=1,i=0;for(this[e+u]=255&t;--u>=0&&(a*=256);)t<0&&0===i&&0!==this[e+u+1]&&(i=1),this[e+u]=(t/a>>0)-i&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,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||$(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||$(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||$(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||$(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return F(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 u},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 u=t.charCodeAt(0);("utf8"===o&&u<128||"latin1"===o)&&(t=u)}}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&&u.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&u.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&u.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&u.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;u.push(r)}else if(r<2048){if((e-=2)<0)break;u.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;u.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;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return u}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return k.apply(this,arguments)},e.default=void 0;var n=i(_$resourceCache_94),o=i(_$lodash_35),u=i(_$app_68),a=_$proxyUtils_69({});function i(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",i=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,u=Object.create(o.prototype),a=new x(n||[]);return u._invoke=function(t,e,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var i=b(a,r);if(i){if(i===f)continue;return i}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),u}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function h(){}function _(){}function d(){}var m={};c(m,u,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g($([])));y&&y!==e&&n.call(y,u)&&(m=y);var v=d.prototype=h.prototype=Object.create(m);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var o;this._invoke=function(u,a){function i(){return new e((function(o,i){!function o(u,a,i,s){var c=p(t[u],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}(u,a,o,i)}))}return o=o?o.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function $(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var i=n.call(u,"catchLoc"),s=n.call(u,"finallyLoc");if(i&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:$(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){c(u,n,o,a,i,"next",t)}function i(t){c(u,n,o,a,i,"throw",t)}a(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function f(t,e){if(t){if("string"==typeof t)return h(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)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return $(t)})),e.sort((function(e,r){var n=g(t,e.name),o=g(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=a[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),s=r.call(u,"finallyLoc");if(i&&s){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),b(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;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){asyncGeneratorStep(u,n,o,a,i,"next",t)}function i(t){asyncGeneratorStep(u,n,o,a,i,"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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],u=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(u?"\n\u591a\u5a92\u4f53:"+u:""),{url:o}),isLoon){var a={};o&&(a.openUrl=o),u&&(a.mediaUrl=u),"{}"===JSON.stringify(a)?$notification.post(t,e,r):$notification.post(t,e,r,a)}if(isNode){var i=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(u?"\n\u591a\u5a92\u4f53: ".concat(u):"");console.log("".concat(t,"\n").concat(e,"\n").concat(i,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_96.OpenAPI=OpenAPI;var _$md5_95={};Object.defineProperty(_$md5_95,"__esModule",{value:!0}),_$md5_95.any_hmac_md5=function(t,e,r){return rstr2any(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)),r)},_$md5_95.any_md5=function(t,e){return rstr2any(rstr_md5(str2rstr_utf8(t)),e)},_$md5_95.b64_hmac_md5=function(t,e){return rstr2b64(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))},_$md5_95.b64_md5=function(t){return rstr2b64(rstr_md5(str2rstr_utf8(t)))},_$md5_95.hex_hmac_md5=function(t,e){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))},_$md5_95.hex_md5=hex_md5;var hexcase=0,b64pad="";function hex_md5(t){return rstr2hex(rstr_md5(str2rstr_utf8(t)))}function rstr_md5(t){return binl2rstr(binl_md5(rstr2binl(t),8*t.length))}function rstr_hmac_md5(t,e){var r=rstr2binl(t);r.length>16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),u=0;u<16;u++)n[u]=909522486^r[u],o[u]=1549556828^r[u];var a=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(a),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-u)&63);return e}function rstr2any(t,e){var r,n,o,u,a,i=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(a[a.length]=o);l[n]=u,s=a}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,u=271733878,a=0;a>>32-i,r);var a,i}function md5_ff(t,e,r,n,o,u,a){return md5_cmn(e&r|~e&n,t,e,o,u,a)}function md5_gg(t,e,r,n,o,u,a){return md5_cmn(e&n|r&~n,t,e,o,u,a)}function md5_hh(t,e,r,n,o,u,a){return md5_cmn(e^r^n,t,e,o,u,a)}function md5_ii(t,e,r,n,o,u,a){return md5_cmn(r^(e|~n),t,e,o,u,a)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_96.OpenAPI("sub-store");_$app_68.default=_default;var _$constants_67={};Object.defineProperty(_$constants_67,"__esModule",{value:!0}),_$constants_67.SUBS_KEY=_$constants_67.SETTINGS_KEY=_$constants_67.SCHEMA_VERSION_KEY=_$constants_67.RULES_KEY=_$constants_67.RESOURCE_CACHE_KEY=_$constants_67.GIST_BACKUP_KEY=_$constants_67.GIST_BACKUP_FILE_NAME=_$constants_67.COLLECTIONS_KEY=_$constants_67.CACHE_EXPIRATION_TIME_MS=_$constants_67.ARTIFACT_REPOSITORY_KEY=_$constants_67.ARTIFACTS_KEY=void 0,_$constants_67.SCHEMA_VERSION_KEY="schemaVersion",_$constants_67.SETTINGS_KEY="settings",_$constants_67.SUBS_KEY="subs",_$constants_67.COLLECTIONS_KEY="collections",_$constants_67.ARTIFACTS_KEY="artifacts",_$constants_67.RULES_KEY="rules",_$constants_67.GIST_BACKUP_KEY="Auto Generated Sub-Store Backup",_$constants_67.GIST_BACKUP_FILE_NAME="Sub-Store",_$constants_67.ARTIFACT_REPOSITORY_KEY="Sub-Store Artifacts Repository",_$constants_67.RESOURCE_CACHE_KEY="#sub-store-cached-resource",_$constants_67.CACHE_EXPIRATION_TIME_MS=36e5;var _$resourceCache_94={};Object.defineProperty(_$resourceCache_94,"__esModule",{value:!0}),_$resourceCache_94.default=void 0;var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],a=!0,i=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);a=!0);}catch(s){i=!0,o=s}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(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(t,e):void 0}}(t,e)||function(){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 _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(_app.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){_app.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){_app.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?_app.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),_app.default.write(e,"#".concat(t))}}])&&___defineProperties_94(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_94.default=___default_94;var _$download_90={};Object.defineProperty(_$download_90,"__esModule",{value:!0}),_$download_90.default=function(t,e){return _download.apply(this,arguments)};var __obj_90,_resourceCache=(__obj_90=_$resourceCache_94)&&__obj_90.__esModule?__obj_90:{default:__obj_90};function ___typeof_90(t){return(___typeof_90="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_90(){___regeneratorRuntime_90=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch($){i=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,u=Object.create(o.prototype),a=new w(n||[]);return u._invoke=function(t,e,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var i=A(a,r);if(i){if(i===l)continue;return i}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),u}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch($){return{type:"throw",arg:$}}}t.wrap=s;var l={};function p(){}function f(){}function h(){}var _={};i(_,o,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(C([])));m&&m!==e&&r.call(m,o)&&(_=m);var g=h.prototype=p.prototype=Object.create(_);function y(t){["next","throw","return"].forEach((function(e){i(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(o,u){function a(){return new e((function(n,a){!function n(o,u,a,i){var s=c(t[o],t,u);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_90(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,a,i)}),(function(t){n("throw",t,a,i)})):e.resolve(p).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,i)}))}i(s.arg)}(o,u,n,a)}))}return n=n?n.then(a,a):a()}}function A(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,A(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=c(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 E(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,u=function e(){for(;++n=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),s=r.call(u,"finallyLoc");if(i&&s){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),b(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;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_90(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_90().mark((function t(e,r){var n,o,u;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_95.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_96.HTTP)({headers:{"User-Agent":r}}),u=new Promise((function(t,r){var u=_resourceCache.default.get(n);u?t(u):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,u),t.abrupt("return",u);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){__asyncGeneratorStep_90(u,n,o,a,i,"next",t)}function i(t){__asyncGeneratorStep_90(u,n,o,a,i,"throw",t)}a(void 0)}))}).apply(this,arguments)}var _$utils_92={};Object.defineProperty(_$utils_92,"__esModule",{value:!0}),_$utils_92.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_92.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_92.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_92.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_92.isNotBlank=isNotBlank,_$utils_92.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_93={};function ___arrayLikeToArray_93(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,B=RegExp(k.source),D=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,L=/<%([\s\S]+?)%>/g,T=/<%=([\s\S]+?)%>/g,N=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,q=RegExp(H.source),z=/^\s+/,G=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Q=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,at=/($^)/,it=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",ht="[a-z\\xdf-\\xf6\\xf8-\\xff]",_t="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",mt="[^\\ud800-\\udfff]",gt="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+ht+"|"+_t+")",Et="(?:"+vt+"|"+_t+")",bt="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+bt+"(?:\\u200d(?:"+[mt,gt,yt].join("|")+")[\\ufe0e\\ufe0f]?"+bt+")*",Ct="(?:"+["[\\u2700-\\u27bf]",gt,yt].join("|")+")"+wt,xt="(?:"+[mt+pt+"?",pt,gt,yt,"[\\ud800-\\udfff]"].join("|")+")",$t=RegExp("['\u2019]","g"),St=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Ft=RegExp([vt+"?"+ht+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,vt,"$"].join("|")+")",Et+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,vt+At,"$"].join("|")+")",vt+"?"+At+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",vt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),It=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,Bt={};Bt[E]=Bt[b]=Bt[w]=Bt[C]=Bt[x]=Bt[$]=Bt["[object Uint8ClampedArray]"]=Bt[S]=Bt[O]=!0,Bt[o]=Bt[u]=Bt[v]=Bt[a]=Bt[A]=Bt[i]=Bt[s]=Bt[c]=Bt[p]=Bt[f]=Bt[h]=Bt[_]=Bt[d]=Bt[m]=Bt[y]=!1;var Dt={};Dt[o]=Dt[u]=Dt[v]=Dt[A]=Dt[a]=Dt[i]=Dt[E]=Dt[b]=Dt[w]=Dt[C]=Dt[x]=Dt[p]=Dt[f]=Dt[h]=Dt[_]=Dt[d]=Dt[m]=Dt[g]=Dt[$]=Dt["[object Uint8ClampedArray]"]=Dt[S]=Dt[O]=!0,Dt[s]=Dt[c]=Dt[y]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lt=parseFloat,Tt=parseInt,Nt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Nt||Mt||Function("return this")(),Ht="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,qt=Ht&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,zt=qt&&qt.exports===Ht,Gt=zt&&Nt.process,Yt=function(){try{return qt&&qt.require&&qt.require("util").types||Gt&&Gt.binding&&Gt.binding("util")}catch(t){}}(),Wt=Yt&&Yt.isArrayBuffer,Kt=Yt&&Yt.isDate,Vt=Yt&&Yt.isMap,Xt=Yt&&Yt.isRegExp,Jt=Yt&&Yt.isSet,Zt=Yt&&Yt.isTypedArray;function Qt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,u=null==t?0:t.length;++o-1}function ae(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Fe(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Pe=Ae({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Ie=Ae({"&":"&","<":"<",">":">",'"':""","'":"'"});function ke(t){return"\\"+jt[t]}function Re(t){return Pt.test(t)}function Be(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function De(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,u=0,a=[];++n",""":'"',"'":"'"}),qe=function t(G){var st,ct=(G=null==G?Ut:qe.defaults(Ut.Object(),G,qe.pick(Ut,kt))).Array,lt=G.Date,pt=G.Error,ft=G.Function,ht=G.Math,_t=G.Object,dt=G.RegExp,mt=G.String,gt=G.TypeError,yt=ct.prototype,vt=ft.prototype,At=_t.prototype,Et=G["__core-js_shared__"],bt=vt.toString,wt=At.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=At.toString,Pt=bt.call(_t),jt=Ut._,Nt=dt("^"+bt.call(wt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=zt?G.Buffer:void 0,Ht=G.Symbol,qt=G.Uint8Array,Gt=Mt?Mt.allocUnsafe:void 0,Yt=De(_t.getPrototypeOf,_t),fe=_t.create,Ae=At.propertyIsEnumerable,ze=yt.splice,Ge=Ht?Ht.isConcatSpreadable:void 0,Ye=Ht?Ht.iterator:void 0,We=Ht?Ht.toStringTag:void 0,Ke=function(){try{var t=Qo(_t,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=G.clearTimeout!==Ut.clearTimeout&&G.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=G.setTimeout!==Ut.setTimeout&&G.setTimeout,Ze=ht.ceil,Qe=ht.floor,tr=_t.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=G.isFinite,nr=yt.join,or=De(_t.keys,_t),ur=ht.max,ar=ht.min,ir=lt.now,sr=G.parseInt,cr=ht.random,lr=yt.reverse,pr=Qo(G,"DataView"),fr=Qo(G,"Map"),hr=Qo(G,"Promise"),_r=Qo(G,"Set"),dr=Qo(G,"WeakMap"),mr=Qo(_t,"create"),gr=dr&&new dr,yr={},vr=xu(pr),Ar=xu(fr),Er=xu(hr),br=xu(_r),wr=xu(dr),Cr=Ht?Ht.prototype:void 0,xr=Cr?Cr.valueOf:void 0,$r=Cr?Cr.toString:void 0;function Sr(t){if(Ha(t)&&!Ia(t)&&!(t instanceof Ir)){if(t instanceof Pr)return t;if(wt.call(t,"__wrapped__"))return $u(t)}return new Pr(t)}var Or=function(){function t(){}return function(e){if(!Ua(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Fr(){}function Pr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Ir(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,u,s){var y,F=1&e,P=2&e,I=4&e;if(r&&(y=u?r(t,n,u,s):r(t)),void 0!==y)return y;if(!Ua(t))return t;var k=Ia(t);if(k){if(y=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!F)return go(t,y)}else{var R=ru(t),B=R==c||R==l;if(Da(t))return lo(t,F);if(R==h||R==o||B&&!u){if(y=P||B?{}:ou(t),!F)return P?function(t,e){return yo(t,eu(t),e)}(t,function(t,e){return t&&yo(e,vi(e),t)}(y,t)):function(t,e){return yo(t,tu(t),e)}(t,Gr(y,t))}else{if(!Dt[R])return u?t:{};y=function(t,e,r){var n,o,u,s=t.constructor;switch(e){case v:return po(t);case a:case i:return new s(+t);case A:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case E:case b:case w:case C:case x:case $:case"[object Uint8ClampedArray]":case S:case O:return fo(t,r);case p:return new s;case f:case m:return new s(t);case _:return(u=new(o=t).constructor(o.source,Q.exec(o))).lastIndex=o.lastIndex,u;case d:return new s;case g:return n=t,xr?_t(xr.call(n)):{}}}(t,R,F)}}s||(s=new jr);var D=s.get(t);if(D)return D;s.set(t,y),Wa(t)?t.forEach((function(n){y.add(Vr(n,e,r,n,t,s))})):qa(t)&&t.forEach((function(n,o){y.set(o,Vr(n,e,r,o,t,s))}));var j=k?void 0:(I?P?Yo:Go:P?vi:yi)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Hr(y,o,Vr(n,e,r,o,t,s))})),y}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=_t(t);n--;){var o=r[n],u=e[o],a=t[o];if(void 0===a&&!(o in t)||!u(a))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new gt(e);return yu((function(){t.apply(void 0,n)}),r)}function Zr(t,e,r,n){var o=-1,u=ue,a=!0,i=t.length,s=[],c=e.length;if(!i)return s;r&&(e=ie(e,xe(r))),n?(u=ae,a=!1):e.length>=200&&(u=Se,a=!1,e=new Dr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=qr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Br.prototype.clear=function(){this.size=0,this.__data__={hash:new kr,map:new(fr||Rr),string:new kr}},Br.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Br.prototype.get=function(t){return Jo(this,t).get(t)},Br.prototype.has=function(t){return Jo(this,t).has(t)},Br.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Dr.prototype.add=Dr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Br(n)}return r.set(t,e),this.size=r.size,this};var Qr=Eo(sn),tn=Eo(cn,!0);function en(t,e){var r=!0;return Qr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(i)?e>1?on(i,e-1,r,n,o):se(o,i):n||(o[o.length]=i)}return o}var un=bo(),an=bo(!0);function sn(t,e){return t&&un(t,e,yi)}function cn(t,e){return t&&an(t,e,yi)}function ln(t,e){return oe(e,(function(e){return Ta(t[e])}))}function pn(t,e){for(var r=0,n=(e=ao(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function mn(t,e){return null!=t&&e in _t(t)}function gn(t,e,r){for(var n=r?ae:ue,o=t[0].length,u=t.length,a=u,i=ct(u),s=1/0,c=[];a--;){var l=t[a];a&&e&&(l=ie(l,xe(e))),s=ar(l.length,s),i[a]=!r&&(e||o>=120&&l.length>=120)?new Dr(a&&l):void 0}l=t[0];var p=-1,f=i[0];t:for(;++p=i?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}($n(t,(function(t,r,o){return{criteria:ie(e,(function(e){return e(t)})),index:++n,value:t}})))}function kn(t,e,r){for(var n=-1,o=e.length,u={};++n-1;)i!==t&&ze.call(i,s,1),ze.call(t,s,1);return t}function Bn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==u){var u=o;au(o)?ze.call(t,o,1):Zn(t,o)}}return t}function Dn(t,e){return t+Qe(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Qe(e/2))&&(t+=t)}while(e);return r}function Ln(t,e){return vu(_u(t,e,zi),t+"")}function Tn(t){return Tr(Si(t))}function Nn(t,e){var r=Si(t);return bu(r,Kr(e,0,r.length))}function Mn(t,e,r,n){if(!Ua(t))return t;for(var o=-1,u=(e=ao(e,t)).length,a=u-1,i=t;null!=i&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var u=ct(o);++n>>1,a=t[u];null!==a&&!Va(a)&&(r?a<=e:a=200){var c=e?null:Lo(t);if(c)return Le(c);a=!1,o=Se,s=new Dr}else s=e?[]:i;t:for(;++n=n?t:zn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Gt?Gt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ho(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,u=Va(t),a=void 0!==e,i=null===e,s=e==e,c=Va(e);if(!i&&!c&&!u&&t>e||u&&a&&s&&!i&&!c||n&&a&&s||!r&&s||!o)return 1;if(!n&&!u&&!c&&t1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(u=t.length>3&&"function"==typeof u?(o--,u):void 0,a&&iu(r[0],r[1],a)&&(u=o<3?void 0:u,o=1),e=_t(e);++n-1?o[u?e[a]:a]:void 0}}function So(t){return zo((function(r){var n=r.length,o=n,u=Pr.prototype.thru;for(t&&r.reverse();o--;){var a=r[o];if("function"!=typeof a)throw new gt(e);if(u&&!i&&"wrapper"==Ko(a))var i=new Pr([],!0)}for(o=i?o:n;++o1&&y.reverse(),l&&si))return!1;var c=u.get(t),l=u.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,h=2&r?new Dr:void 0;for(u.set(t,e),u.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Y,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ue(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(W);return e?e[1].split(K):[]}(o),r)))}function Eu(t){var e=0,r=0;return function(){var n=ir(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function bu(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Yu(t,r)}));function Qu(t){var e=Sr(t);return e.__chain__=!0,e}function ta(t,e){return e(t)}var ea=zo((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Ir&&au(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ta,args:[o],thisArg:void 0}),new Pr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),ra=vo((function(t,e,r){wt.call(t,r)?++t[r]:Yr(t,r,1)})),na=$o(Pu),oa=$o(Iu);function ua(t,e){return(Ia(t)?ee:Qr)(t,Xo(e,3))}function aa(t,e){return(Ia(t)?re:tn)(t,Xo(e,3))}var ia=vo((function(t,e,r){wt.call(t,r)?t[r].push(e):Yr(t,r,[e])})),sa=Ln((function(t,e,r){var n=-1,o="function"==typeof e,u=Ra(t)?ct(t.length):[];return Qr(t,(function(t){u[++n]=o?Qt(e,t,r):yn(t,e,r)})),u})),ca=vo((function(t,e,r){Yr(t,r,e)}));function la(t,e){return(Ia(t)?ie:$n)(t,Xo(e,3))}var pa=vo((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),fa=Ln((function(t,e){if(null==t)return[];var r=e.length;return r>1&&iu(t,e[0],e[1])?e=[]:r>2&&iu(e[0],e[1],e[2])&&(e=[e[0]]),In(t,on(e,1),[])})),ha=Xe||function(){return Ut.Date.now()};function _a(t,e,r){return e=r?void 0:e,No(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function da(t,r){var n;if("function"!=typeof r)throw new gt(e);return t=ei(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var ma=Ln((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(ma));n|=32}return No(t,n,e,r,o)})),ga=Ln((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(ga));n|=32}return No(e,n,t,r,o)}));function ya(t,r,n){var o,u,a,i,s,c,l=0,p=!1,f=!1,h=!0;if("function"!=typeof t)throw new gt(e);function _(e){var r=o,n=u;return o=u=void 0,l=e,i=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=a}function m(){var t=ha();if(d(t))return g(t);s=yu(m,function(t){var e=r-(t-c);return f?ar(e,a-(t-l)):e}(t))}function g(t){return s=void 0,h&&o?_(t):(o=u=void 0,i)}function y(){var t=ha(),e=d(t);if(o=arguments,u=this,c=t,e){if(void 0===s)return function(t){return l=t,s=yu(m,r),p?_(t):i}(c);if(f)return co(s),s=yu(m,r),_(c)}return void 0===s&&(s=yu(m,r)),i}return r=ni(r)||0,Ua(n)&&(p=!!n.leading,a=(f="maxWait"in n)?ur(ni(n.maxWait)||0,r):a,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&co(s),l=0,o=c=u=s=void 0},y.flush=function(){return void 0===s?i:g(ha())},y}var va=Ln((function(t,e){return Jr(t,1,e)})),Aa=Ln((function(t,e,r){return Jr(t,ni(e)||0,r)}));function Ea(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new gt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],u=n.cache;if(u.has(o))return u.get(o);var a=t.apply(this,e);return n.cache=u.set(o,a)||u,a};return n.cache=new(Ea.Cache||Br),n}function ba(t){if("function"!=typeof t)throw new gt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ea.Cache=Br;var wa=io((function(t,e){var r=(e=1==e.length&&Ia(e[0])?ie(e[0],xe(Xo())):ie(on(e,1),xe(Xo()))).length;return Ln((function(n){for(var o=-1,u=ar(n.length,r);++o=e})),Pa=vn(function(){return arguments}())?vn:function(t){return Ha(t)&&wt.call(t,"callee")&&!Ae.call(t,"callee")},Ia=ct.isArray,ka=Wt?xe(Wt):function(t){return Ha(t)&&hn(t)==v};function Ra(t){return null!=t&&Ma(t.length)&&!Ta(t)}function Ba(t){return Ha(t)&&Ra(t)}var Da=er||ns,ja=Kt?xe(Kt):function(t){return Ha(t)&&hn(t)==i};function La(t){if(!Ha(t))return!1;var e=hn(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ga(t)}function Ta(t){if(!Ua(t))return!1;var e=hn(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Na(t){return"number"==typeof t&&t==ei(t)}function Ma(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ua(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ha(t){return null!=t&&"object"==typeof t}var qa=Vt?xe(Vt):function(t){return Ha(t)&&ru(t)==p};function za(t){return"number"==typeof t||Ha(t)&&hn(t)==f}function Ga(t){if(!Ha(t)||hn(t)!=h)return!1;var e=Yt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&bt.call(r)==Pt}var Ya=Xt?xe(Xt):function(t){return Ha(t)&&hn(t)==_},Wa=Jt?xe(Jt):function(t){return Ha(t)&&ru(t)==d};function Ka(t){return"string"==typeof t||!Ia(t)&&Ha(t)&&hn(t)==m}function Va(t){return"symbol"==typeof t||Ha(t)&&hn(t)==g}var Xa=Zt?xe(Zt):function(t){return Ha(t)&&Ma(t.length)&&!!Bt[hn(t)]},Ja=Bo(xn),Za=Bo((function(t,e){return t<=e}));function Qa(t){if(!t)return[];if(Ra(t))return Ka(t)?Me(t):go(t);if(Ye&&t[Ye])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Ye]());var e=ru(t);return(e==p?Be:e==d?Le:Si)(t)}function ti(t){return t?(t=ni(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ei(t){var e=ti(t),r=e%1;return e==e?r?e-r:e:0}function ri(t){return t?Kr(ei(t),0,4294967295):0}function ni(t){if("number"==typeof t)return t;if(Va(t))return NaN;if(Ua(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ua(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Tt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function oi(t){return yo(t,vi(t))}function ui(t){return null==t?"":Xn(t)}var ai=Ao((function(t,e){if(pu(e)||Ra(e))yo(e,yi(e),t);else for(var r in e)wt.call(e,r)&&Hr(t,r,e[r])})),ii=Ao((function(t,e){yo(e,vi(e),t)})),si=Ao((function(t,e,r,n){yo(e,vi(e),t,n)})),ci=Ao((function(t,e,r,n){yo(e,yi(e),t,n)})),li=zo(Wr),pi=Ln((function(t,e){t=_t(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&iu(e[0],e[1],o)&&(n=1);++r1),e})),yo(t,Yo(t),r),n&&(r=Vr(r,7,Ho));for(var o=e.length;o--;)Zn(r,e[o]);return r})),wi=zo((function(t,e){return null==t?{}:function(t,e){return kn(t,e,(function(e,r){return _i(t,r)}))}(t,e)}));function Ci(t,e){if(null==t)return{};var r=ie(Yo(t),(function(t){return[t]}));return e=Xo(e),kn(t,r,(function(t,r){return e(t,r[0])}))}var xi=To(yi),$i=To(vi);function Si(t){return null==t?[]:$e(t,yi(t))}var Oi=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?Fi(e):e)}));function Fi(t){return Li(ui(t).toLowerCase())}function Pi(t){return(t=ui(t))&&t.replace(ut,Pe).replace(St,"")}var Ii=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),ki=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ri=wo("toLowerCase"),Bi=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Di=Co((function(t,e,r){return t+(r?" ":"")+Li(e)})),ji=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Li=wo("toUpperCase");function Ti(t,e,r){return t=ui(t),void 0===(e=r?void 0:e)?function(t){return It.test(t)}(t)?function(t){return t.match(Ft)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Ni=Ln((function(t,e){try{return Qt(t,void 0,e)}catch(r){return La(r)?r:new pt(r)}})),Mi=zo((function(t,e){return ee(e,(function(e){e=Cu(e),Yr(t,e,ma(t[e],t))})),t}));function Ui(t){return function(){return t}}var Hi=So(),qi=So(!0);function zi(t){return t}function Gi(t){return wn("function"==typeof t?t:Vr(t,1))}var Yi=Ln((function(t,e){return function(r){return yn(r,t,e)}})),Wi=Ln((function(t,e){return function(r){return yn(t,r,e)}}));function Ki(t,e,r){var n=yi(e),o=ln(e,n);null!=r||Ua(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,yi(e)));var u=!(Ua(r)&&"chain"in r&&!r.chain),a=Ta(t);return ee(o,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(u||e){var r=t(this.__wrapped__);return(r.__actions__=go(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Vi(){}var Xi=Io(ie),Ji=Io(ne),Zi=Io(pe);function Qi(t){return su(t)?ve(Cu(t)):function(t){return function(e){return pn(e,t)}}(t)}var ts=Ro(),es=Ro(!0);function rs(){return[]}function ns(){return!1}var os,us=Po((function(t,e){return t+e}),0),as=jo("ceil"),is=Po((function(t,e){return t/e}),1),ss=jo("floor"),cs=Po((function(t,e){return t*e}),1),ls=jo("round"),ps=Po((function(t,e){return t-e}),0);return Sr.after=function(t,r){if("function"!=typeof r)throw new gt(e);return t=ei(t),function(){if(--t<1)return r.apply(this,arguments)}},Sr.ary=_a,Sr.assign=ai,Sr.assignIn=ii,Sr.assignInWith=si,Sr.assignWith=ci,Sr.at=li,Sr.before=da,Sr.bind=ma,Sr.bindAll=Mi,Sr.bindKey=ga,Sr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ia(t)?t:[t]},Sr.chain=Qu,Sr.chunk=function(t,e,r){e=(r?iu(t,e,r):void 0===e)?1:ur(ei(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,u=0,a=ct(Ze(n/e));oo?0:o+r),(n=void 0===n||n>o?o:ei(n))<0&&(n+=o),n=r>n?0:ri(n);r>>0)?(t=ui(t))&&("string"==typeof e||null!=e&&!Ya(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},Sr.spread=function(t,r){if("function"!=typeof t)throw new gt(e);return r=null==r?0:ur(ei(r),0),Ln((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Qt(t,this,o)}))},Sr.tail=function(t){var e=null==t?0:t.length;return e?zn(t,1,e):[]},Sr.take=function(t,e,r){return t&&t.length?zn(t,0,(e=r||void 0===e?1:ei(e))<0?0:e):[]},Sr.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?zn(t,(e=n-(e=r||void 0===e?1:ei(e)))<0?0:e,n):[]},Sr.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},Sr.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},Sr.tap=function(t,e){return e(t),t},Sr.throttle=function(t,r,n){var o=!0,u=!0;if("function"!=typeof t)throw new gt(e);return Ua(n)&&(o="leading"in n?!!n.leading:o,u="trailing"in n?!!n.trailing:u),ya(t,r,{leading:o,maxWait:r,trailing:u})},Sr.thru=ta,Sr.toArray=Qa,Sr.toPairs=xi,Sr.toPairsIn=$i,Sr.toPath=function(t){return Ia(t)?ie(t,Cu):Va(t)?[t]:go(wu(ui(t)))},Sr.toPlainObject=oi,Sr.transform=function(t,e,r){var n=Ia(t),o=n||Da(t)||Xa(t);if(e=Xo(e,4),null==r){var u=t&&t.constructor;r=o?n?new u:[]:Ua(t)&&Ta(u)?Or(Yt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},Sr.unary=function(t){return _a(t,1)},Sr.union=Hu,Sr.unionBy=qu,Sr.unionWith=zu,Sr.uniq=function(t){return t&&t.length?Jn(t):[]},Sr.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},Sr.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},Sr.unset=function(t,e){return null==t||Zn(t,e)},Sr.unzip=Gu,Sr.unzipWith=Yu,Sr.update=function(t,e,r){return null==t?t:Qn(t,e,uo(r))},Sr.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Qn(t,e,uo(r),n)},Sr.values=Si,Sr.valuesIn=function(t){return null==t?[]:$e(t,vi(t))},Sr.without=Wu,Sr.words=Ti,Sr.wrap=function(t,e){return Ca(uo(e),t)},Sr.xor=Ku,Sr.xorBy=Vu,Sr.xorWith=Xu,Sr.zip=Ju,Sr.zipObject=function(t,e){return no(t||[],e||[],Hr)},Sr.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},Sr.zipWith=Zu,Sr.entries=xi,Sr.entriesIn=$i,Sr.extend=ii,Sr.extendWith=si,Ki(Sr,Sr),Sr.add=us,Sr.attempt=Ni,Sr.camelCase=Oi,Sr.capitalize=Fi,Sr.ceil=as,Sr.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=ni(r))==r?r:0),void 0!==e&&(e=(e=ni(e))==e?e:0),Kr(ni(t),e,r)},Sr.clone=function(t){return Vr(t,4)},Sr.cloneDeep=function(t){return Vr(t,5)},Sr.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},Sr.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},Sr.conformsTo=function(t,e){return null==e||Xr(t,e,yi(e))},Sr.deburr=Pi,Sr.defaultTo=function(t,e){return null==t||t!=t?e:t},Sr.divide=is,Sr.endsWith=function(t,e,r){t=ui(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Kr(ei(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},Sr.eq=Sa,Sr.escape=function(t){return(t=ui(t))&&D.test(t)?t.replace(R,Ie):t},Sr.escapeRegExp=function(t){return(t=ui(t))&&q.test(t)?t.replace(H,"\\$&"):t},Sr.every=function(t,e,r){var n=Ia(t)?ne:en;return r&&iu(t,e,r)&&(e=void 0),n(t,Xo(e,3))},Sr.find=na,Sr.findIndex=Pu,Sr.findKey=function(t,e){return he(t,Xo(e,3),sn)},Sr.findLast=oa,Sr.findLastIndex=Iu,Sr.findLastKey=function(t,e){return he(t,Xo(e,3),cn)},Sr.floor=ss,Sr.forEach=ua,Sr.forEachRight=aa,Sr.forIn=function(t,e){return null==t?t:un(t,Xo(e,3),vi)},Sr.forInRight=function(t,e){return null==t?t:an(t,Xo(e,3),vi)},Sr.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},Sr.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},Sr.get=hi,Sr.gt=Oa,Sr.gte=Fa,Sr.has=function(t,e){return null!=t&&nu(t,e,dn)},Sr.hasIn=_i,Sr.head=Ru,Sr.identity=zi,Sr.includes=function(t,e,r,n){t=Ra(t)?t:Si(t),r=r&&!n?ei(r):0;var o=t.length;return r<0&&(r=ur(o+r,0)),Ka(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},Sr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:ei(r);return o<0&&(o=ur(n+o,0)),de(t,e,o)},Sr.inRange=function(t,e,r){return e=ti(e),void 0===r?(r=e,e=0):r=ti(r),function(t,e,r){return t>=ar(e,r)&&t=-9007199254740991&&t<=9007199254740991},Sr.isSet=Wa,Sr.isString=Ka,Sr.isSymbol=Va,Sr.isTypedArray=Xa,Sr.isUndefined=function(t){return void 0===t},Sr.isWeakMap=function(t){return Ha(t)&&ru(t)==y},Sr.isWeakSet=function(t){return Ha(t)&&"[object WeakSet]"==hn(t)},Sr.join=function(t,e){return null==t?"":nr.call(t,e)},Sr.kebabCase=Ii,Sr.last=Lu,Sr.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=ei(r))<0?ur(n+o,0):ar(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):_e(t,ge,o,!0)},Sr.lowerCase=ki,Sr.lowerFirst=Ri,Sr.lt=Ja,Sr.lte=Za,Sr.max=function(t){return t&&t.length?rn(t,zi,_n):void 0},Sr.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),_n):void 0},Sr.mean=function(t){return ye(t,zi)},Sr.meanBy=function(t,e){return ye(t,Xo(e,2))},Sr.min=function(t){return t&&t.length?rn(t,zi,xn):void 0},Sr.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},Sr.stubArray=rs,Sr.stubFalse=ns,Sr.stubObject=function(){return{}},Sr.stubString=function(){return""},Sr.stubTrue=function(){return!0},Sr.multiply=cs,Sr.nth=function(t,e){return t&&t.length?Pn(t,ei(e)):void 0},Sr.noConflict=function(){return Ut._===this&&(Ut._=jt),this},Sr.noop=Vi,Sr.now=ha,Sr.pad=function(t,e,r){t=ui(t);var n=(e=ei(e))?Ne(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return ko(Qe(o),r)+t+ko(Ze(o),r)},Sr.padEnd=function(t,e,r){t=ui(t);var n=(e=ei(e))?Ne(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ar(t+o*(e-t+Lt("1e-"+((o+"").length-1))),e)}return Dn(t,e)},Sr.reduce=function(t,e,r){var n=Ia(t)?ce:Ee,o=arguments.length<3;return n(t,Xo(e,4),r,o,Qr)},Sr.reduceRight=function(t,e,r){var n=Ia(t)?le:Ee,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},Sr.repeat=function(t,e,r){return e=(r?iu(t,e,r):void 0===e)?1:ei(e),jn(ui(t),e)},Sr.replace=function(){var t=arguments,e=ui(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Sr.result=function(t,e,r){var n=-1,o=(e=ao(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ar(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=u)return t;var i=r-Ne(n);if(i<1)return n;var s=a?so(a,0,i).join(""):t.slice(0,i);if(void 0===o)return s+n;if(a&&(i+=s.length-i),Ya(o)){if(t.slice(i).search(o)){var c,l=s;for(o.global||(o=dt(o.source,ui(Q.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?i:p)}}else if(t.indexOf(Xn(o),i)!=i){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},Sr.unescape=function(t){return(t=ui(t))&&B.test(t)?t.replace(k,He):t},Sr.uniqueId=function(t){var e=++Ct;return ui(t)+e},Sr.upperCase=ji,Sr.upperFirst=Li,Sr.each=ua,Sr.eachRight=aa,Sr.first=Ru,Ki(Sr,(os={},sn(Sr,(function(t,e){wt.call(Sr.prototype,e)||(os[e]=t)})),os),{chain:!1}),Sr.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Sr[t].placeholder=Sr})),ee(["drop","take"],(function(t,e){Ir.prototype[t]=function(r){r=void 0===r?1:ur(ei(r),0);var n=this.__filtered__&&!e?new Ir(this):this.clone();return n.__filtered__?n.__takeCount__=ar(r,n.__takeCount__):n.__views__.push({size:ar(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Ir.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Ir.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Ir.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Ir.prototype[t]=function(){return this.__filtered__?new Ir(this):this[r](1)}})),Ir.prototype.compact=function(){return this.filter(zi)},Ir.prototype.find=function(t){return this.filter(t).head()},Ir.prototype.findLast=function(t){return this.reverse().find(t)},Ir.prototype.invokeMap=Ln((function(t,e){return"function"==typeof t?new Ir(this):this.map((function(r){return yn(r,t,e)}))})),Ir.prototype.reject=function(t){return this.filter(ba(Xo(t)))},Ir.prototype.slice=function(t,e){t=ei(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Ir(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=ei(e))<0?r.dropRight(-e):r.take(e-t)),r)},Ir.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ir.prototype.toArray=function(){return this.take(4294967295)},sn(Ir.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=Sr[n?"take"+("last"==e?"Right":""):e],u=n||/^find/.test(e);o&&(Sr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,i=e instanceof Ir,s=a[0],c=i||Ia(e),l=function(t){var e=o.apply(Sr,se([t],a));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(i=c=!1);var p=this.__chain__,f=!!this.__actions__.length,h=u&&!p,_=i&&!f;if(!u&&c){e=_?e:new Ir(this);var d=t.apply(e,a);return d.__actions__.push({func:ta,args:[l],thisArg:void 0}),new Pr(d,p)}return h&&_?t.apply(this,a):(d=this.thru(l),h?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Sr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ia(o)?o:[],t)}return this[r]((function(r){return e.apply(Ia(r)?r:[],t)}))}})),sn(Ir.prototype,(function(t,e){var r=Sr[e];if(r){var n=r.name+"";wt.call(yr,n)||(yr[n]=[]),yr[n].push({name:e,func:r})}})),yr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],Ir.prototype.clone=function(){var t=new Ir(this.__wrapped__);return t.__actions__=go(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=go(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=go(this.__views__),t},Ir.prototype.reverse=function(){if(this.__filtered__){var t=new Ir(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Ir.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ia(t),n=e<0,o=r?t.length:0,u=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Sr.prototype.plant=function(t){for(var e,r=this;r instanceof Fr;){var n=$u(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},Sr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Ir){var e=t;return this.__actions__.length&&(e=new Ir(this)),(e=e.reverse()).__actions__.push({func:ta,args:[Uu],thisArg:void 0}),new Pr(e,this.__chain__)}return this.thru(Uu)},Sr.prototype.toJSON=Sr.prototype.valueOf=Sr.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},Sr.prototype.first=Sr.prototype.head,Ye&&(Sr.prototype[Ye]=function(){return this}),Sr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=qe,define((function(){return qe}))):qt?((qt.exports=qe)._=qe,Ht._=qe):Ut._=qe}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",u=this.position;ue/2-1){o=" ... ",u-=5;break}return a=this.buffer.slice(n,u),_$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,u,a,i,s,c=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(u=+e[4],a=+e[5],i=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,u,a,i,c)),l&&s.setTime(s.getTime()-l),s},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,u=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,u=BASE64_MAP,a=0,i=[];for(e=0;e>16&255),i.push(a>>8&255),i.push(255&a)),a=a<<6|u.indexOf(n.charAt(e));return 0==(r=o%4*6)?(i.push(a>>16&255),i.push(a>>8&255),i.push(255&a)):18===r?(i.push(a>>10&255),i.push(a>>2&255)):12===r&&i.push(a>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(i):new NodeBuffer(i):i},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,u=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=u%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,u,a=[],i=t;for(e=0,r=i.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,u;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),u=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=u<2,1!==u&&2!==u&&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,u,a,i;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,u=t.anchor,a=[],i=!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(i=!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)&&(d?h=t.result:_=t.result),d||(storeMappingPair(t,l,p,f,h,_,u,a),f=h=_=null),skipSeparationSpace(t,!0,-1),i=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==i)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(u)){do{u=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(u));if(35===u)do{u=t.input.charCodeAt(++t.position)}while(!is_EOL(u)&&0!==u)}for(;0!==u;){for(readLineBreak(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(u))p++;else{if(t.lineIndent0){for(o=a,u=0;o>0;o--)(a=fromHexCode(i=t.input.charCodeAt(++t.position)))>=0?u=(u<<4)+a:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(u),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(i)?(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,p)?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,u,a,i,s,c,l,p=t.kind,f=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=u=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(i=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){a=!0,l=t.input.charCodeAt(t.position);continue}t.position=u,t.line=i,t.lineStart=s,t.lineIndent=c;break}}a&&(captureSegment(t,o,u,!1),writeFoldedLines(t,t.line-i),o=u=t.position,a=!1),is_WHITE_SPACE(l)||(u=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,u,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===h&&(d=i&&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+'"'),s=0,c=t.implicitTypes.length;s 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,u=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(u,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(u-1):null,h=h&&isPlainSafe(a,i)}else{for(u=0;un&&" "!==t[f+1],f=u);else if(!isPrintable(a))return STYLE_DOUBLE;i=u>0?t.charCodeAt(u-1):null,h=h&&isPlainSafe(a,i)}l=l||p&&u-f-1>n&&" "!==t[f+1]}return c||l?r>9&&needIndentIndicator(t)?STYLE_DOUBLE:l?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),u=-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,u,(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,u=/(\n+)([^\n]*)/g,a=(o=-1!==(o=t.indexOf("\n"))?o:t.length,u.lastIndex=o,foldLine(t.slice(0,o),e)),i="\n"===t[0]||" "===t[0];n=u.exec(t);){var s=n[1],c=n[2];r=" "===c[0],a+=s+(i||r||""===c?"":"\n")+foldLine(c,e),i=r}return a}(e,u),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",u=0;u=55296&&e<=56319&&(r=t.charCodeAt(u+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),u++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[u]: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,u=0,a=0,i=0,s="";r=o.exec(t);)(i=r.index)-u>e&&(n=a>u?a:i,s+="\n"+t.slice(u,n),u=n+1),a=i;return s+="\n",t.length-u>e&&a>u?s+=t.slice(u,a)+"\n"+t.slice(a+1):s+=t.slice(u),s.slice(1)}function detectType(t,e,r){var n,o,u,a,i,s;for(u=0,a=(o=r?t.explicitTypes:t.implicitTypes).length;u tag resolver accepts not "'+s+'" style');n=i.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,u){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 i,s,c="[object Object]"===a||"[object Array]"===a;if(c&&(s=-1!==(i=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[i])t.dump="*ref_"+i;else{if(c&&s&&!t.usedDuplicates[i]&&(t.usedDuplicates[i]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,u,a,i,s,c,l="",p=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,u=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,i,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+i+t.dump)):(function(t,e,r){var n,o,u,a,i,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(i+="? "),i+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,a,!1,!1)&&(s+=i+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+i+" "+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,u,a="",i=t.tag;for(o=0,u=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],u=[];for(function t(e,r,n){var o,u,a;if(null!==e&&"object"==typeof e)if(-1!==(u=r.indexOf(e)))-1===n.indexOf(u)&&n.push(u);else if(r.push(e),Array.isArray(e))for(u=0,a=e.length;u0?o-4:o;for(r=0;r>16&255,a[i++]=e>>8&255,a[i++]=255&e;return 2===u&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,a[i++]=255&e),1===u&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,a[i++]=e>>8&255,a[i++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],u=0,a=r-n;ua?a:u+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,u=[],a=e;a>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return u.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var u,a,i=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,h=t[e+p];for(p+=f,u=h&(1<<-l)-1,h>>=-l,l+=i;l>0;u=256*u+t[e+p],p+=f,l-=8);for(a=u&(1<<-l)-1,u>>=-l,l+=n;l>0;a=256*a+t[e+p],p+=f,l-=8);if(0===u)u=1-c;else{if(u===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),u-=c}return(h?-1:1)*a*Math.pow(2,u-n)},write:function(t,e,r,n,o,u){var a,i,s,c=8*u-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:u-1,_=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(a++,s/=2),a+p>=l?(i=0,a=l):a+p>=1?(i=(e*s-1)*Math.pow(2,o),a+=p):(i=e*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&i,h+=_,i/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=_,a/=256,c-=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,u="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,i=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},i.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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,"")},_=function(t){for(var e,r,n,o,u="",a=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");u+=i[(e=r<<16|n<<8|o)>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}return a?u.slice(0,a-3)+"===".substring(a):u},d=n?function(t){return btoa(t)}:o?function(t){return e.from(t,"binary").toString("base64")}:_,m=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)},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(t){return t.replace(v,y)},E=o?function(t){return e.from(t,"utf8").toString("base64")}:a?function(t){return m(a.encode(t))}:function(t){return d(A(t))},b=function(t,e){return void 0===e&&(e=!1),e?f(E(t)):E(t)},w=function(t){return b(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},$=function(t){return t.replace(C,x)},S=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",u=0;u>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(h(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:S,F=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},P=function(t){return F(k(t))},I=o?function(t){return e.from(t,"base64").toString("utf8")}:u?function(t){return u.decode(F(t))}:function(t){return $(O(t))},k=function(t){return h(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return I(k(t))},B=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},D=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,B(e))};t("fromBase64",(function(){return R(this)})),t("toBase64",(function(t){return b(this,t)})),t("toBase64URI",(function(){return b(this,!0)})),t("toBase64URL",(function(){return b(this,!0)})),t("toUint8Array",(function(){return P(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,B(e))};t("toBase64",(function(t){return g(this,t)})),t("toBase64URI",(function(){return g(this,!0)})),t("toBase64URL",(function(){return g(this,!0)}))},L={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:S,btoa:d,btoaPolyfill:_,fromBase64:R,toBase64:b,encode:b,encodeURI:w,encodeURL:w,utob:A,btou:$,decode:R,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:g,toUint8Array:P,extendString:D,extendUint8Array:j,extendBuiltins:function(){D(),j()},Base64:{}};return Object.keys(L).forEach((function(t){return L.Base64[t]=L[t]})),L}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___arrayLikeToArray_75(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_65.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,u=r.password,a=r.servers,i=0;i({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const u=e.find(({source:e})=>e===t.source),a=t.start;if(u){const e=t.end,i=u.text[a.line-1],s=(a.line===e.line?e.column:i.length+1)-a.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${a.line}:${a.column}\n${"".padEnd(r)} |\n${a.line.toString().padStart(r)} | ${i}\n${"".padEnd(r)} | ${"".padEnd(a.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${a.line}:${a.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let u;u=(u=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let a=`${t}: ${e}`;n&&(a+=r(n,u));for(const i of o)a+=r(i.location,u,i.message);return a}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const u={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(u).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=u[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return u(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=u(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let a=0;a0?NEVER_MATCH:SOMETIMES_MATCH}const u=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=u(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-u(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=u(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});u(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function u(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function a(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},u=JSON.stringify(n),a=o.findIndex(t=>JSON.stringify(t)===u);return-1===a?o.push(n)-1:a}function i(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],_(t,{sp:r.sp+1,env:i(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=a(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function h(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const _=_$visitor_52.build({grammar(t){t.rules.forEach(_),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=_(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:u({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],_(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=_(e[0],{sp:r.sp,env:i(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=i(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=_(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),u=0|t.expression.match,p=n&&u!==__NEVER_MATCH_39?a(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(u,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(_(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=a(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=i(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),_(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],_(t.expression,{sp:e.sp+1,env:i(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(_(t.expression,{sp:e.sp,env:i(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=_(t.expression,{sp:e.sp+1,env:i(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,h(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=_(t.expression,{sp:e.sp+1,env:i(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(h(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>_(t.expression,{sp:e.sp,env:i(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?u({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?u({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?u({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});_(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const u=o.toString();return"absolute"===r?u:"scheme-relative"===r?u.slice(PROTOCOL.length):"path-absolute"===r?u.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,u)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(u){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&u>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const u=t.sourceContentFor(n);null!=u&&r.setSourceContent(n,u)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const u=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,a=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const i=e.source;null==i||u.has(i)||u.add(i);const s=e.name;null==s||a.has(s)||a.add(s)}),this),this._sources=u,this._names=a,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,u=1,a=0,i=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,h=p.length;f0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-i),i=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-a),a=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let u=0;const a=function(){return t()+(t()||"");function t(){return u=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+a,0===a?o:0,e.source,a===u.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function u(t){return"peg$e"+t}function a(t){return"peg$f"+t}function i(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const u={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),u=n();return u.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{u.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),u.push("")),u.push(t,"","module.exports = "+o()+";"),u},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const u=Object.keys(e.dependencies),a="["+u.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",i=u.join(", ");return[...n(),"define("+a+", function("+i+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const u=Object.keys(e.dependencies),a=u.map(t=>e.dependencies[t]),i="["+a.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=a.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=u.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+i+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,u.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+i(t)).join(", ")+" }",p=i(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+u(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${a(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let h;function _(t,n){const o=n+3,u=s[c+o-2],a=s[c+o-1];let i,p;l.checkedIf(c,()=>{c+=o,i=e(s.slice(c,c+u)),c+=u},a>0?()=>{p=e(s.slice(c,c+a)),c+=a}:null),f.push("if ("+t+") {"),f.push(...i.map(r)),a>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function m(){const t=s[c+4-1],e=a(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(h)),c+=r;break}case _$opcodes_38.IF:_(l.top(),0);break;case _$opcodes_38.IF_ERROR:_(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:_(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:_("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:_(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:_("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:_(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+u(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:m();break;case _$opcodes_38.RULE:f.push(l.push(i(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",i(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,u)=>{var a;"rule"===(a=o).type&&"rule_ref"===a.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(u))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){u(t.expression,n(e))}const u=_$visitor_52.build({rule(t){u(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{u(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),u(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});u(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],u=_$visitor_52.build({rule(t){n.push(t.name),u(t.expression),n.pop()},sequence(e){e.elements.every(e=>(u(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const a=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",a.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));a&&u(a),o.pop()}});u(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eGt&&(Gt=Ht,Yt=[]),Yt.push(t))}function re(){var e,r,o,u,a,i;if(e=Ht,Re(),r=Ht,(o=function(){var e,r,o,u;return e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(b)),r!==n&&(o=ke())!==n?(125===t.charCodeAt(Ht)?(u="}",Ht++):(u=n,0===Wt&&ee(w)),u!==n&&Be()!==n?(qt=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Kt()}}(o)):(Ht=e,e=n)):(Ht=e,e=n),e}())!==n?(u=Re(),r=o):(Ht=r,r=n),r===n&&(r=null),o=Ht,(u=function(){var t,e;return t=Ht,(e=ke())!==n&&Be()!==n?(qt=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Kt()}}(e)):(Ht=t,t=n),t}())!==n?(a=Re(),o=u):(Ht=o,o=n),o===n&&(o=null),u=[],a=Ht,(i=ne())!==n?(Re(),a=i):(Ht=a,a=n),a!==n)for(;a!==n;)u.push(a),a=Ht,(i=ne())!==n?(Re(),a=i):(Ht=a,a=n);else u=n;return u!==n?(qt=e,e=function(t,e,r){return{type:"grammar",topLevelInitializer:t,initializer:e,rules:r,location:Kt()}}(r,o,u)):(Ht=e,e=n),e}function ne(){var e,r,o,u,a,i,s,c;return e=Ht,(r=ye())!==n?(Re(),o=Ht,(u=Ee())!==n?(Re(),o=u):(Ht=o,o=n),o===n&&(o=null),61===t.charCodeAt(Ht)?(u="=",Ht++):(u=n,0===Wt&&ee(C)),u!==n?(Re(),(a=oe())!==n&&Be()!==n?(qt=e,s=o,c=a,e={type:"rule",name:(i=r)[0],nameLocation:i[1],expression:null!==s?{type:"named",name:s,expression:c,location:Kt()}:c,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n),e}function oe(){var e,r,o,u,a,i,s,c;if(e=Ht,(r=ue())!==n){for(o=[],u=Ht,Re(),47===t.charCodeAt(Ht)?(a="/",Ht++):(a=n,0===Wt&&ee(x)),a!==n?(Re(),(i=ue())!==n?u=i:(Ht=u,u=n)):(Ht=u,u=n);u!==n;)o.push(u),u=Ht,Re(),47===t.charCodeAt(Ht)?(a="/",Ht++):(a=n,0===Wt&&ee(x)),a!==n?(Re(),(i=ue())!==n?u=i:(Ht=u,u=n)):(Ht=u,u=n);qt=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Kt()}:s}else Ht=e,e=n;return e}function ue(){var t,e,r,o;return t=Ht,(e=function(){var t,e,r,o,u,a,i;if(t=Ht,(e=ae())!==n){for(r=[],o=Ht,Re(),(u=ae())!==n?o=u:(Ht=o,o=n);o!==n;)r.push(o),o=Ht,Re(),(u=ae())!==n?o=u:(Ht=o,o=n);qt=t,a=e,t=(i=r).length>0||"labeled"===a.type&&a.pick?{type:"sequence",elements:[a].concat(i),location:Kt()}:a}else Ht=t,t=n;return t}())!==n?(r=Ht,Re(),(o=ke())!==n?r=o:(Ht=r,r=n),r===n&&(r=null),qt=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Kt()}:t}(e,r)):(Ht=t,t=n),t}function ae(){var e,r,o,u,a,i,s;return e=Ht,(r=function(){var e,r;return e=Ht,64===t.charCodeAt(Ht)?(r="@",Ht++):(r=n,0===Wt&&ee($)),r!==n&&(qt=e,r=Kt()),r}())!==n?((o=ie())===n&&(o=null),(u=se())!==n?(qt=e,a=r,i=o,(s=u).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',a),e={type:"labeled",label:null!==i?i[0]:null,labelLocation:null!==i?i[1]:a,pick:!0,expression:s,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=Ht,(r=ie())!==n?(o=Re(),(u=se())!==n?(qt=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Kt()}}(r,u)):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=se())),e}function ie(){var e,r,o,u;return e=Ht,(r=ye())!==n?(Re(),58===t.charCodeAt(Ht)?(o=":",Ht++):(o=n,0===Wt&&ee(S)),o!==n?(qt=e,u=r,De.indexOf(u[0])>=0&&Vt(`Label can't be a reserved word "${u[0]}"`,u[1]),e=u):(Ht=e,e=n)):(Ht=e,e=n),e}function se(){var e,r,o,u;return e=Ht,(r=function(){var e;return 36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P)))),e}())!==n?(Re(),(o=ce())!==n?(qt=e,u=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:u,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,u;return e=Ht,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Ht)?(e="?",Ht++):(e=n,0===Wt&&ee(I)),e===n&&(42===t.charCodeAt(Ht)?(e="*",Ht++):(e=n,0===Wt&&ee(k)),e===n&&(43===t.charCodeAt(Ht)?(e="+",Ht++):(e=n,0===Wt&&ee(R)))),e}())!==n?(qt=e,u=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:u,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,u,a;return(e=function(){var e,r,o;return Wt++,e=Ht,(r=Ee())!==n?(105===t.charCodeAt(Ht)?(o="i",Ht++):(o=n,0===Wt&&ee(it)),o===n&&(o=null),qt=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Kt()}):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(at)),e}())===n&&(e=function(){var e,r,o,u,a,i,s,c;if(Wt++,e=Ht,91===t.charCodeAt(Ht)?(r="[",Ht++):(r=n,0===Wt&&ee(ft)),r!==n){for(94===t.charCodeAt(Ht)?(o="^",Ht++):(o=n,0===Wt&&ee(ht)),o===n&&(o=null),u=[],(a=Ce())===n&&(a=xe());a!==n;)u.push(a),(a=Ce())===n&&(a=xe());93===t.charCodeAt(Ht)?(a="]",Ht++):(a=n,0===Wt&&ee(_t)),a!==n?(105===t.charCodeAt(Ht)?(i="i",Ht++):(i=n,0===Wt&&ee(it)),i===n&&(i=null),qt=e,s=o,c=i,e={type:"class",parts:u.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Kt()}):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Ht,46===t.charCodeAt(Ht)?(r=".",Ht++):(r=n,0===Wt&&ee(St)),r!==n&&(qt=e,r={type:"any",location:Kt()}),r}())===n&&(e=function(){var e,r,o,u,a,i,s;return e=Ht,(r=ye())!==n?(o=Ht,Wt++,u=Ht,a=Re(),i=Ht,(s=Ee())!==n?i=s=[s,Re()]:(Ht=i,i=n),i===n&&(i=null),61===t.charCodeAt(Ht)?(s="=",Ht++):(s=n,0===Wt&&ee(C)),s!==n?u=a=[a,i,s]:(Ht=u,u=n),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e={type:"rule_ref",name:r[0],location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Ht,(r=function(){var e;return 38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P))),e}())!==n?(Re(),(o=ke())!==n?(qt=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Kt()}}(r,o)):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Ht,40===t.charCodeAt(Ht)?(r="(",Ht++):(r=n,0===Wt&&ee(B)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Ht)?(u=")",Ht++):(u=n,0===Wt&&ee(D)),u!==n?(qt=e,e="labeled"===(a=o).type||"sequence"===a.type?{type:"group",expression:a,location:Kt()}:a):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n)),e}function pe(){var e;return t.length>Ht?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(j)),e}function fe(){var e;return Wt++,9===t.charCodeAt(Ht)?(e="\t",Ht++):(e=n,0===Wt&&ee(T)),e===n&&(11===t.charCodeAt(Ht)?(e="\v",Ht++):(e=n,0===Wt&&ee(N)),e===n&&(12===t.charCodeAt(Ht)?(e="\f",Ht++):(e=n,0===Wt&&ee(M)),e===n&&(32===t.charCodeAt(Ht)?(e=" ",Ht++):(e=n,0===Wt&&ee(U)),e===n&&(160===t.charCodeAt(Ht)?(e="\xa0",Ht++):(e=n,0===Wt&&ee(H)),e===n&&(65279===t.charCodeAt(Ht)?(e="\ufeff",Ht++):(e=n,0===Wt&&ee(q)),e===n&&(e=function(){var e;return E.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Mt)),e}())))))),Wt--,e===n&&0===Wt&&ee(L),e}function he(){var e;return i.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(z)),e}function _e(){var e;return Wt++,10===t.charCodeAt(Ht)?(e="\n",Ht++):(e=n,0===Wt&&ee(Y)),e===n&&("\r\n"===t.substr(Ht,2)?(e="\r\n",Ht+=2):(e=n,0===Wt&&ee(W)),e===n&&(13===t.charCodeAt(Ht)?(e="\r",Ht++):(e=n,0===Wt&&ee(K)),e===n&&(8232===t.charCodeAt(Ht)?(e="\u2028",Ht++):(e=n,0===Wt&&ee(V)),e===n&&(8233===t.charCodeAt(Ht)?(e="\u2029",Ht++):(e=n,0===Wt&&ee(X)))))),Wt--,e===n&&0===Wt&&ee(G),e}function de(){var e;return Wt++,(e=function(){var e,r,o,u,a,i;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);u!==n;)o.push(u),u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u!==n?e=r=[r,o,u]:(Ht=e,e=n)}else Ht=e,e=n;return e}())===n&&(e=ge()),Wt--,e===n&&0===Wt&&ee(J),e}function me(){var e,r,o,u,a,i;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),i===n&&(i=he()),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);u!==n;)o.push(u),u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),i===n&&(i=he()),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u!==n?e=r=[r,o,u]:(Ht=e,e=n)}else Ht=e,e=n;return e}function ge(){var e,r,o,u,a,i;if(e=Ht,"//"===t.substr(Ht,2)?(r="//",Ht+=2):(r=n,0===Wt&&ee(tt)),r!==n){for(o=[],u=Ht,a=Ht,Wt++,i=he(),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);u!==n;)o.push(u),u=Ht,a=Ht,Wt++,i=he(),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);e=r=[r,o]}else Ht=e,e=n;return e}function ye(){var t,e,r,o;if(Wt++,t=Ht,(e=ve())!==n){for(r=[],o=Ae();o!==n;)r.push(o),o=Ae();qt=t,t=[e+r.join(""),Kt()]}else Ht=t,t=n;return Wt--,t===n&&(e=n,0===Wt&&ee(et)),t}function ve(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Bt)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Pt)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(It)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(kt)),e}())===n&&(e=function(){var e;return v.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Tt)),e}()),e}())===n&&(36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(95===t.charCodeAt(Ht)?(e="_",Ht++):(e=n,0===Wt&&ee(rt)),e===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Fe())!==n?e=o:(Ht=e,e=n)))),e}function Ae(){var e;return(e=ve())===n&&(e=function(){var e;return(e=function(){var e;return g.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(jt)),e}())===n&&(e=function(){var e;return m.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Dt)),e}()),e}())===n&&(e=function(){var e;return y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Lt)),e}())===n&&(e=function(){var e;return A.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Nt)),e}())===n&&(8204===t.charCodeAt(Ht)?(e="\u200c",Ht++):(e=n,0===Wt&&ee(ot)),e===n&&(8205===t.charCodeAt(Ht)?(e="\u200d",Ht++):(e=n,0===Wt&&ee(ut)))),e}function Ee(){var e,r,o,u;if(Wt++,e=Ht,34===t.charCodeAt(Ht)?(r='"',Ht++):(r=n,0===Wt&&ee(ct)),r!==n){for(o=[],u=be();u!==n;)o.push(u),u=be();34===t.charCodeAt(Ht)?(u='"',Ht++):(u=n,0===Wt&&ee(ct)),u!==n?(qt=e,e=o.join("")):(Ht=e,e=n)}else Ht=e,e=n;if(e===n)if(e=Ht,39===t.charCodeAt(Ht)?(r="'",Ht++):(r=n,0===Wt&&ee(lt)),r!==n){for(o=[],u=we();u!==n;)o.push(u),u=we();39===t.charCodeAt(Ht)?(u="'",Ht++):(u=n,0===Wt&&ee(lt)),u!==n?(qt=e,e=function(t){return t.join("")}(o)):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(st)),e}function be(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,34===t.charCodeAt(Ht)?(u='"',Ht++):(u=n,0===Wt&&ee(ct)),u===n&&(92===t.charCodeAt(Ht)?(u="\\",Ht++):(u=n,0===Wt&&ee(nt)),u===n&&(u=he())),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Se())!==n?e=o:(Ht=e,e=n),e===n&&(e=$e())),e}function we(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,39===t.charCodeAt(Ht)?(u="'",Ht++):(u=n,0===Wt&&ee(lt)),u===n&&(92===t.charCodeAt(Ht)?(u="\\",Ht++):(u=n,0===Wt&&ee(nt)),u===n&&(u=he())),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Se())!==n?e=o:(Ht=e,e=n),e===n&&(e=$e())),e}function Ce(){var e,r,o,u,a,i;return e=Ht,(r=xe())!==n?(45===t.charCodeAt(Ht)?(o="-",Ht++):(o=n,0===Wt&&ee(dt)),o!==n&&(u=xe())!==n?(qt=e,i=u,(a=r).charCodeAt(0)>i.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(qt,Ht)+"."),e=[a,i]):(Ht=e,e=n)):(Ht=e,e=n),e}function xe(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,93===t.charCodeAt(Ht)?(u="]",Ht++):(u=n,0===Wt&&ee(_t)),u===n&&(92===t.charCodeAt(Ht)?(u="\\",Ht++):(u=n,0===Wt&&ee(nt)),u===n&&(u=he())),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Se())!==n?e=o:(Ht=e,e=n),e===n&&(e=$e())),e}function $e(){var e,r;return e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&_e()!==n?(qt=e,e=""):(Ht=e,e=n),e}function Se(){var e,r,o,u;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,(u=function(){var e;return(e=Oe())===n&&(e=Pe())===n&&(120===t.charCodeAt(Ht)?(e="x",Ht++):(e=n,0===Wt&&ee(wt)),e===n&&(117===t.charCodeAt(Ht)?(e="u",Ht++):(e=n,0===Wt&&ee(Ct)))),e}())===n&&(u=he()),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),r!==n?t.substring(e,Ht):r}()),e}())===n&&(e=Ht,48===t.charCodeAt(Ht)?(r="0",Ht++):(r=n,0===Wt&&ee(mt)),r!==n?(o=Ht,Wt++,u=Pe(),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e="\0"):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=function(){var e,r,o,u,a,i,s;return e=Ht,120===t.charCodeAt(Ht)?(r="x",Ht++):(r=n,0===Wt&&ee(wt)),r!==n?(o=Ht,u=Ht,(a=Ie())!==n&&(i=Ie())!==n?u=a=[a,i]:(Ht=u,u=n),(o=u!==n?t.substring(o,Ht):u)!==n?(qt=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Fe())),e}function Oe(){var e,r;return 39===t.charCodeAt(Ht)?(e="'",Ht++):(e=n,0===Wt&&ee(lt)),e===n&&(34===t.charCodeAt(Ht)?(e='"',Ht++):(e=n,0===Wt&&ee(ct)),e===n&&(92===t.charCodeAt(Ht)?(e="\\",Ht++):(e=n,0===Wt&&ee(nt)),e===n&&(e=Ht,98===t.charCodeAt(Ht)?(r="b",Ht++):(r=n,0===Wt&&ee(gt)),r!==n&&(qt=e,r="\b"),(e=r)===n&&(e=Ht,102===t.charCodeAt(Ht)?(r="f",Ht++):(r=n,0===Wt&&ee(yt)),r!==n&&(qt=e,r="\f"),(e=r)===n&&(e=Ht,110===t.charCodeAt(Ht)?(r="n",Ht++):(r=n,0===Wt&&ee(vt)),r!==n&&(qt=e,r="\n"),(e=r)===n&&(e=Ht,114===t.charCodeAt(Ht)?(r="r",Ht++):(r=n,0===Wt&&ee(At)),r!==n&&(qt=e,r="\r"),(e=r)===n&&(e=Ht,116===t.charCodeAt(Ht)?(r="t",Ht++):(r=n,0===Wt&&ee(Et)),r!==n&&(qt=e,r="\t"),(e=r)===n&&(e=Ht,118===t.charCodeAt(Ht)?(r="v",Ht++):(r=n,0===Wt&&ee(bt)),r!==n&&(qt=e,r="\v"),e=r)))))))),e}function Fe(){var e,r,o,u,a,i,s,c,l;return e=Ht,117===t.charCodeAt(Ht)?(r="u",Ht++):(r=n,0===Wt&&ee(Ct)),r!==n?(o=Ht,u=Ht,(a=Ie())!==n&&(i=Ie())!==n&&(s=Ie())!==n&&(c=Ie())!==n?u=a=[a,i,s,c]:(Ht=u,u=n),(o=u!==n?t.substring(o,Ht):u)!==n?(qt=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Ht=e,e=n)):(Ht=e,e=n),e}function Pe(){var e;return s.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(xt)),e}function Ie(){var e;return c.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee($t)),e}function ke(){var e,r,o,u;return Wt++,e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(b)),r!==n?(o=function(){var e,r;return e=Ht,r=function e(){var r,o,u,a,i,s;if(r=Ht,o=[],u=[],a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n),a!==n)for(;a!==n;)u.push(a),a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n);else u=n;for(u===n&&(u=Ht,123===t.charCodeAt(Ht)?(a="{",Ht++):(a=n,0===Wt&&ee(b)),a!==n?(i=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?u=a=[a,i,s]:(Ht=u,u=n)):(Ht=u,u=n));u!==n;){if(o.push(u),u=[],a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n),a!==n)for(;a!==n;)u.push(a),a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n);else u=n;u===n&&(u=Ht,123===t.charCodeAt(Ht)?(a="{",Ht++):(a=n,0===Wt&&ee(b)),a!==n?(i=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?u=a=[a,i,s]:(Ht=u,u=n)):(Ht=u,u=n))}return t.substring(r,Ht)}(),qt=e,r=function(t){return[t,Kt()]}(r)}(),125===t.charCodeAt(Ht)?(u="}",Ht++):(u=n,0===Wt&&ee(w)),u!==n?e=o:(Ht=e,e=n)):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=_e())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=_e())===n&&(e=de());return t}function Be(){var e,r,o,u;return e=Ht,r=Re(),59===t.charCodeAt(Ht)?(o=";",Ht++):(o=n,0===Wt&&ee(Ut)),o!==n?e=r=[r,o]:(Ht=e,e=n),e===n&&(e=Ht,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=me());e!==n;)t.push(e),(e=fe())===n&&(e=me());return t}(),(o=ge())===n&&(o=null),(u=_e())!==n?e=r=[r,o,u]:(Ht=e,e=n),e===n&&(e=Ht,r=Re(),(o=function(){var e,r;return e=Ht,Wt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=n,0===Wt&&ee(j)),Wt--,r===n?e=void 0:(Ht=e,e=n),e}())!==n?e=r=[r,o]:(Ht=e,e=n))),e}const De=e.reservedWords||[];if((r=a())!==n&&Ht===t.length)return r;throw r!==n&&Ht{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(i[p]=f)}}catch(h){c.e(h)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},a),{},{name:i.remarks?_$base64_4.Base64.decode(i.remarks):a.server,"protocol-param":(0,_$utils_92.getIfNotBlank)(_$base64_4.Base64.decode(i.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_92.getIfNotBlank)(_$base64_4.Base64.decode(i.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={},u=___createForOfIteratorHelper_70(n);try{for(u.s();!(r=u.n()).done;){var a=r.value;if(-1!==a.indexOf("=")){var i=___slicedToArray_70(a.split("="),2),s=i[0],c=i[1];o[s.trim()]=c.trim()}}}catch(_){u.e(_)}finally{u.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_92.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_92.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_92.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_92.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_92.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_92.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_92.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),h={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_92.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_92.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(h.network="ws",h["ws-opts"]={path:(0,_$utils_92.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_92.getIfNotBlank)(f.host)}},h.tls&&f.host&&(h.sni=f.host)),h}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$package_66={name:"sub-store",version:"2.12.9",description:"Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",main:"src/main.js",scripts:{preinstall:"npx only-allow pnpm",test:"gulp peggy && npx cross-env BABEL_ENV=test mocha src/test/**/*.spec.js --require @babel/register --recursive",serve:"node sub-store.min.js",start:"nodemon -w src -w package.json --exec babel-node src/main.js",build:"gulp"},author:"Peng-YM",license:"GPL-3.0",dependencies:{automerge:"1.0.1-preview.7","body-parser":"^1.19.0",express:"^4.17.1","js-base64":"^3.7.2",lodash:"^4.17.21",request:"^2.88.2",requests:"^0.3.0",semver:"^7.3.7","static-js-yaml":"^1.0.0",uuid:"^8.3.2"},devDependencies:{"@babel/core":"^7.18.0","@babel/node":"^7.17.10","@babel/preset-env":"^7.18.0","@babel/register":"^7.17.7","@types/gulp":"^4.0.9",axios:"^0.20.0","babel-plugin-relative-path-import":"^2.0.1",babelify:"^10.0.0","browser-pack-flat":"^3.4.2",browserify:"^17.0.0",chai:"^4.3.6",eslint:"^8.16.0",gulp:"^4.0.2","gulp-babel":"^8.0.0","gulp-eslint-new":"^1.4.4","gulp-file":"^0.4.0","gulp-header":"^2.0.9","gulp-prettier":"^4.0.0","gulp-tap":"^2.0.0",mocha:"^10.0.0",nodemon:"^2.0.16",peggy:"^2.0.1",prettier:"2.6.2","prettier-plugin-sort-imports":"^1.6.1",tinyify:"^3.0.0"}},_$resourceParserLoon_89={},_proxyUtils=_$proxyUtils_69({});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 Sub-Store -- v".concat(_$package_66.version,"\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"));var RESOURCE_TYPE_RULE=2,result=$resource;if(1===$resourceType){var proxies=_proxyUtils.ProxyUtils.parse($resource);result=_proxyUtils.ProxyUtils.produce(proxies,"Loon")}else if($resourceType===RESOURCE_TYPE_RULE){var rules=_$ruleUtils_85.RuleUtils.parse($resource);result=_$ruleUtils_85.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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_90),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=u?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(o,a,i):o[a]=t[a]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),u=c(_$preprocessors_75),a=c(_$producers_78),i=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",i=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,u=Object.create(o.prototype),a=new x(n||[]);return u._invoke=function(t,e,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var i=b(a,r);if(i){if(i===f)continue;return i}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),u}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function h(){}function _(){}function d(){}var m={};s(m,u,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g($([])));y&&y!==e&&n.call(y,u)&&(m=y);var v=d.prototype=h.prototype=Object.create(m);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var o;this._invoke=function(u,a){function i(){return new e((function(o,i){!function o(u,a,i,s){var c=p(t[u],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}(u,a,o,i)}))}return o=o?o.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function $(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var i=n.call(u,"catchLoc"),s=n.call(u,"finallyLoc");if(i&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:$(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],a=!0,i=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);a=!0);}catch(s){i=!0,o=s}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return u}}(t,e)||_(t,e)||function(){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 h(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function _(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],u=x.length>2?x[2]:void 0,a=h(r),t.prev=3,a.s();case 5:if((i=a.n()).done){t.next=39;break}if(c=i.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(_=c.args,d=_.mode,m=_.content,"link"!==d){t.next=27;break}if((y=(g=m).split("#")).length>1){v=h(y[1].split("&"));try{for(v.s();!(A=v.n()).done;)E=A.value,b=E.split("=")[0],w=E.split("=")[1]||!0,f[b]=w}catch(l){v.e(l)}finally{v.f()}}return t.prev=15,t.next=18,(0,n.default)(g.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=m;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,u,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),a.e(t.t1);case 44:return t.prev=44,a.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(m=function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){p(u,n,o,a,i,"next",t)}function i(t){p(u,n,o,a,i,"throw",t)}a(void 0)}))}).apply(this,arguments)}var g={parse:function(t){t=function(t){var e,r=h(u.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.default.error("Parser [".concat(n.name,"] failed\n Reason: ").concat(o))}}}catch(a){r.e(a)}finally{r.f()}return t}(t);var e,r,n=[],o=h(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var a=r.value;if(0!==(a=a.trim()).length){var c=!1;if(e){var l=f(y(e,a),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var _,d=h(i.default);try{for(d.s();!(_=d.n()).done;){var m=_.value,g=f(y(m,a),2),v=g[0];if(!g[1]){n.push(v),e=m,c=!0,s.default.info("".concat(m.name," is activated"));break}}}catch(A){d.e(A)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(a))}}}catch(A){o.e(A)}finally{o.f()}return n},process:function(t){return m.apply(this,arguments)},produce:function(t,e){var r=a.default[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])})),s.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 s.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}};function y(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=g})),_$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 u(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|s(e,n),u=t(o),a=u.write(e,n);return a!==o&&(u=u.slice(0,a)),u}(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(B(e,ArrayBuffer)||e&&B(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(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 u=!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(u)return o?-1:I(t).length;e=(""+e).toLowerCase(),u=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,u){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),D(n=+n)&&(n=u?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(u)return-1;n=t.length-1}else if(n<0){if(!u)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,u);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?u?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,u);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var u,a=1,i=t.length,s=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,i/=2,s/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(u=r;ui&&(r=i-s),u=r;u>=0;u--){for(var p=!0,f=0;fo&&(n=o):n=o;var u=e.length;n>u/2&&(n=u/2);for(var a=0;a>8,o=r%256,u.push(o),u.push(n);return u}(e,t.length-r),t,r,n)}function y(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(u=t[o+1]))&&(s=(31&c)<<6|63&u)>127&&(l=s);break;case 3:u=t[o+1],a=t[o+2],128==(192&u)&&128==(192&a)&&(s=(15&c)<<12|(63&u)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:u=t[o+1],a=t[o+2],i=t[o+3],128==(192&u)&&128==(192&a)&&128==(192&i)&&(s=(15&c)<<18|(63&u)<<12|(63&a)<<6|63&i)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=A)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 w(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return b(this,e,r);case"base64":return y(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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,u){if(B(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===u&&(u=this.length),e<0||n>t.length||o<0||u>this.length)throw new RangeError("out of range index");if(o>=u&&e>=n)return 0;if(o>=u)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(u>>>=0)-(o>>>=0),i=(n>>>=0)-(e>>>=0),s=Math.min(a,i),c=this.slice(o,u),l=t.slice(e,n),p=0;p>>=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 u=!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 _(this,t,e,r);case"latin1":case"binary":return d(this,t,e,r);case"base64":return m(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,t,e,r);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var u="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,n,o,u,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>u||et.length)throw new RangeError("Index out of range")}function S(t,e,r,n,o,u){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||S(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||S(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||x(t,e,this.length);for(var n=this[t],o=1,u=0;++u>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,u=0;++u=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,u=this[t+--n];n>0&&(o*=256);)u+=this[t+--n]*o;return u>=(o*=128)&&(u-=Math.pow(2,8*e)),u},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||$(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,u=0;for(this[e]=255&t;++u>>=0,r>>>=0,n||$(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,u=1;for(this[e+o]=255&t;--o>=0&&(u*=256);)this[e+o]=t/u&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,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||$(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||$(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||$(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||$(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);$(this,t,e,r,o-1,-o)}var u=0,a=1,i=0;for(this[e]=255&t;++u>0)-i&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);$(this,t,e,r,o-1,-o)}var u=r-1,a=1,i=0;for(this[e+u]=255&t;--u>=0&&(a*=256);)t<0&&0===i&&0!==this[e+u+1]&&(i=1),this[e+u]=(t/a>>0)-i&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,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||$(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||$(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||$(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||$(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return F(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 u},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 u=t.charCodeAt(0);("utf8"===o&&u<128||"latin1"===o)&&(t=u)}}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&&u.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&u.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&u.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&u.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;u.push(r)}else if(r<2048){if((e-=2)<0)break;u.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;u.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;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return u}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return k.apply(this,arguments)},e.default=void 0;var n=i(_$resourceCache_94),o=i(_$lodash_35),u=i(_$app_68),a=_$proxyUtils_69({});function i(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",i=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,u=Object.create(o.prototype),a=new x(n||[]);return u._invoke=function(t,e,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var i=b(a,r);if(i){if(i===f)continue;return i}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),u}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function h(){}function _(){}function d(){}var m={};c(m,u,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g($([])));y&&y!==e&&n.call(y,u)&&(m=y);var v=d.prototype=h.prototype=Object.create(m);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var o;this._invoke=function(u,a){function i(){return new e((function(o,i){!function o(u,a,i,s){var c=p(t[u],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}(u,a,o,i)}))}return o=o?o.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function $(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var i=n.call(u,"catchLoc"),s=n.call(u,"finallyLoc");if(i&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:$(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){c(u,n,o,a,i,"next",t)}function i(t){c(u,n,o,a,i,"throw",t)}a(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function f(t,e){if(t){if("string"==typeof t)return h(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)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return $(t)})),e.sort((function(e,r){var n=g(t,e.name),o=g(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=a[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),s=r.call(u,"finallyLoc");if(i&&s){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),b(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;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){asyncGeneratorStep(u,n,o,a,i,"next",t)}function i(t){asyncGeneratorStep(u,n,o,a,i,"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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],u=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(u?"\n\u591a\u5a92\u4f53:"+u:""),{url:o}),isLoon){var a={};o&&(a.openUrl=o),u&&(a.mediaUrl=u),"{}"===JSON.stringify(a)?$notification.post(t,e,r):$notification.post(t,e,r,a)}if(isNode){var i=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(u?"\n\u591a\u5a92\u4f53: ".concat(u):"");console.log("".concat(t,"\n").concat(e,"\n").concat(i,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_96.OpenAPI=OpenAPI;var _$md5_95={};Object.defineProperty(_$md5_95,"__esModule",{value:!0}),_$md5_95.any_hmac_md5=function(t,e,r){return rstr2any(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)),r)},_$md5_95.any_md5=function(t,e){return rstr2any(rstr_md5(str2rstr_utf8(t)),e)},_$md5_95.b64_hmac_md5=function(t,e){return rstr2b64(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))},_$md5_95.b64_md5=function(t){return rstr2b64(rstr_md5(str2rstr_utf8(t)))},_$md5_95.hex_hmac_md5=function(t,e){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))},_$md5_95.hex_md5=hex_md5;var hexcase=0,b64pad="";function hex_md5(t){return rstr2hex(rstr_md5(str2rstr_utf8(t)))}function rstr_md5(t){return binl2rstr(binl_md5(rstr2binl(t),8*t.length))}function rstr_hmac_md5(t,e){var r=rstr2binl(t);r.length>16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),u=0;u<16;u++)n[u]=909522486^r[u],o[u]=1549556828^r[u];var a=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(a),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-u)&63);return e}function rstr2any(t,e){var r,n,o,u,a,i=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(a[a.length]=o);l[n]=u,s=a}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,u=271733878,a=0;a>>32-i,r);var a,i}function md5_ff(t,e,r,n,o,u,a){return md5_cmn(e&r|~e&n,t,e,o,u,a)}function md5_gg(t,e,r,n,o,u,a){return md5_cmn(e&n|r&~n,t,e,o,u,a)}function md5_hh(t,e,r,n,o,u,a){return md5_cmn(e^r^n,t,e,o,u,a)}function md5_ii(t,e,r,n,o,u,a){return md5_cmn(r^(e|~n),t,e,o,u,a)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_96.OpenAPI("sub-store");_$app_68.default=_default;var _$constants_67={};Object.defineProperty(_$constants_67,"__esModule",{value:!0}),_$constants_67.SUBS_KEY=_$constants_67.SETTINGS_KEY=_$constants_67.SCHEMA_VERSION_KEY=_$constants_67.RULES_KEY=_$constants_67.RESOURCE_CACHE_KEY=_$constants_67.GIST_BACKUP_KEY=_$constants_67.GIST_BACKUP_FILE_NAME=_$constants_67.COLLECTIONS_KEY=_$constants_67.CACHE_EXPIRATION_TIME_MS=_$constants_67.ARTIFACT_REPOSITORY_KEY=_$constants_67.ARTIFACTS_KEY=void 0,_$constants_67.SCHEMA_VERSION_KEY="schemaVersion",_$constants_67.SETTINGS_KEY="settings",_$constants_67.SUBS_KEY="subs",_$constants_67.COLLECTIONS_KEY="collections",_$constants_67.ARTIFACTS_KEY="artifacts",_$constants_67.RULES_KEY="rules",_$constants_67.GIST_BACKUP_KEY="Auto Generated Sub-Store Backup",_$constants_67.GIST_BACKUP_FILE_NAME="Sub-Store",_$constants_67.ARTIFACT_REPOSITORY_KEY="Sub-Store Artifacts Repository",_$constants_67.RESOURCE_CACHE_KEY="#sub-store-cached-resource",_$constants_67.CACHE_EXPIRATION_TIME_MS=36e5;var _$resourceCache_94={};Object.defineProperty(_$resourceCache_94,"__esModule",{value:!0}),_$resourceCache_94.default=void 0;var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],a=!0,i=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);a=!0);}catch(s){i=!0,o=s}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(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(t,e):void 0}}(t,e)||function(){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 _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(_app.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){_app.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){_app.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?_app.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),_app.default.write(e,"#".concat(t))}}])&&___defineProperties_94(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_94.default=___default_94;var _$download_90={};Object.defineProperty(_$download_90,"__esModule",{value:!0}),_$download_90.default=function(t,e){return _download.apply(this,arguments)};var __obj_90,_resourceCache=(__obj_90=_$resourceCache_94)&&__obj_90.__esModule?__obj_90:{default:__obj_90};function ___typeof_90(t){return(___typeof_90="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_90(){___regeneratorRuntime_90=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch($){i=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,u=Object.create(o.prototype),a=new w(n||[]);return u._invoke=function(t,e,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var i=A(a,r);if(i){if(i===l)continue;return i}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),u}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch($){return{type:"throw",arg:$}}}t.wrap=s;var l={};function p(){}function f(){}function h(){}var _={};i(_,o,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(C([])));m&&m!==e&&r.call(m,o)&&(_=m);var g=h.prototype=p.prototype=Object.create(_);function y(t){["next","throw","return"].forEach((function(e){i(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(o,u){function a(){return new e((function(n,a){!function n(o,u,a,i){var s=c(t[o],t,u);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_90(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,a,i)}),(function(t){n("throw",t,a,i)})):e.resolve(p).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,i)}))}i(s.arg)}(o,u,n,a)}))}return n=n?n.then(a,a):a()}}function A(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,A(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=c(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 E(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,u=function e(){for(;++n=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),s=r.call(u,"finallyLoc");if(i&&s){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),b(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;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_90(t,e,r,n,o,u,a){try{var i=t[u](a),s=i.value}catch(c){return void r(c)}i.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_90().mark((function t(e,r){var n,o,u;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_95.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_96.HTTP)({headers:{"User-Agent":r}}),u=new Promise((function(t,r){var u=_resourceCache.default.get(n);u?t(u):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,u),t.abrupt("return",u);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){__asyncGeneratorStep_90(u,n,o,a,i,"next",t)}function i(t){__asyncGeneratorStep_90(u,n,o,a,i,"throw",t)}a(void 0)}))}).apply(this,arguments)}var _$utils_92={};Object.defineProperty(_$utils_92,"__esModule",{value:!0}),_$utils_92.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_92.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_92.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_92.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_92.isNotBlank=isNotBlank,_$utils_92.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_93={};function ___arrayLikeToArray_93(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,B=RegExp(k.source),D=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,L=/<%([\s\S]+?)%>/g,T=/<%=([\s\S]+?)%>/g,N=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,q=RegExp(H.source),z=/^\s+/,G=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Q=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,at=/($^)/,it=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",ht="[a-z\\xdf-\\xf6\\xf8-\\xff]",_t="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",mt="[^\\ud800-\\udfff]",gt="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+ht+"|"+_t+")",Et="(?:"+vt+"|"+_t+")",bt="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+bt+"(?:\\u200d(?:"+[mt,gt,yt].join("|")+")[\\ufe0e\\ufe0f]?"+bt+")*",Ct="(?:"+["[\\u2700-\\u27bf]",gt,yt].join("|")+")"+wt,xt="(?:"+[mt+pt+"?",pt,gt,yt,"[\\ud800-\\udfff]"].join("|")+")",$t=RegExp("['\u2019]","g"),St=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Ft=RegExp([vt+"?"+ht+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,vt,"$"].join("|")+")",Et+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,vt+At,"$"].join("|")+")",vt+"?"+At+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",vt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),It=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,Bt={};Bt[E]=Bt[b]=Bt[w]=Bt[C]=Bt[x]=Bt[$]=Bt["[object Uint8ClampedArray]"]=Bt[S]=Bt[O]=!0,Bt[o]=Bt[u]=Bt[v]=Bt[a]=Bt[A]=Bt[i]=Bt[s]=Bt[c]=Bt[p]=Bt[f]=Bt[h]=Bt[_]=Bt[d]=Bt[m]=Bt[y]=!1;var Dt={};Dt[o]=Dt[u]=Dt[v]=Dt[A]=Dt[a]=Dt[i]=Dt[E]=Dt[b]=Dt[w]=Dt[C]=Dt[x]=Dt[p]=Dt[f]=Dt[h]=Dt[_]=Dt[d]=Dt[m]=Dt[g]=Dt[$]=Dt["[object Uint8ClampedArray]"]=Dt[S]=Dt[O]=!0,Dt[s]=Dt[c]=Dt[y]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lt=parseFloat,Tt=parseInt,Nt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Nt||Mt||Function("return this")(),Ht="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,qt=Ht&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,zt=qt&&qt.exports===Ht,Gt=zt&&Nt.process,Yt=function(){try{return qt&&qt.require&&qt.require("util").types||Gt&&Gt.binding&&Gt.binding("util")}catch(t){}}(),Wt=Yt&&Yt.isArrayBuffer,Kt=Yt&&Yt.isDate,Vt=Yt&&Yt.isMap,Xt=Yt&&Yt.isRegExp,Jt=Yt&&Yt.isSet,Zt=Yt&&Yt.isTypedArray;function Qt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,u=null==t?0:t.length;++o-1}function ae(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Fe(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Pe=Ae({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Ie=Ae({"&":"&","<":"<",">":">",'"':""","'":"'"});function ke(t){return"\\"+jt[t]}function Re(t){return Pt.test(t)}function Be(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function De(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,u=0,a=[];++n",""":'"',"'":"'"}),qe=function t(G){var st,ct=(G=null==G?Ut:qe.defaults(Ut.Object(),G,qe.pick(Ut,kt))).Array,lt=G.Date,pt=G.Error,ft=G.Function,ht=G.Math,_t=G.Object,dt=G.RegExp,mt=G.String,gt=G.TypeError,yt=ct.prototype,vt=ft.prototype,At=_t.prototype,Et=G["__core-js_shared__"],bt=vt.toString,wt=At.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=At.toString,Pt=bt.call(_t),jt=Ut._,Nt=dt("^"+bt.call(wt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=zt?G.Buffer:void 0,Ht=G.Symbol,qt=G.Uint8Array,Gt=Mt?Mt.allocUnsafe:void 0,Yt=De(_t.getPrototypeOf,_t),fe=_t.create,Ae=At.propertyIsEnumerable,ze=yt.splice,Ge=Ht?Ht.isConcatSpreadable:void 0,Ye=Ht?Ht.iterator:void 0,We=Ht?Ht.toStringTag:void 0,Ke=function(){try{var t=Qo(_t,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=G.clearTimeout!==Ut.clearTimeout&&G.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=G.setTimeout!==Ut.setTimeout&&G.setTimeout,Ze=ht.ceil,Qe=ht.floor,tr=_t.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=G.isFinite,nr=yt.join,or=De(_t.keys,_t),ur=ht.max,ar=ht.min,ir=lt.now,sr=G.parseInt,cr=ht.random,lr=yt.reverse,pr=Qo(G,"DataView"),fr=Qo(G,"Map"),hr=Qo(G,"Promise"),_r=Qo(G,"Set"),dr=Qo(G,"WeakMap"),mr=Qo(_t,"create"),gr=dr&&new dr,yr={},vr=xu(pr),Ar=xu(fr),Er=xu(hr),br=xu(_r),wr=xu(dr),Cr=Ht?Ht.prototype:void 0,xr=Cr?Cr.valueOf:void 0,$r=Cr?Cr.toString:void 0;function Sr(t){if(Ha(t)&&!Ia(t)&&!(t instanceof Ir)){if(t instanceof Pr)return t;if(wt.call(t,"__wrapped__"))return $u(t)}return new Pr(t)}var Or=function(){function t(){}return function(e){if(!Ua(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Fr(){}function Pr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Ir(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,u,s){var y,F=1&e,P=2&e,I=4&e;if(r&&(y=u?r(t,n,u,s):r(t)),void 0!==y)return y;if(!Ua(t))return t;var k=Ia(t);if(k){if(y=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!F)return go(t,y)}else{var R=ru(t),B=R==c||R==l;if(Da(t))return lo(t,F);if(R==h||R==o||B&&!u){if(y=P||B?{}:ou(t),!F)return P?function(t,e){return yo(t,eu(t),e)}(t,function(t,e){return t&&yo(e,vi(e),t)}(y,t)):function(t,e){return yo(t,tu(t),e)}(t,Gr(y,t))}else{if(!Dt[R])return u?t:{};y=function(t,e,r){var n,o,u,s=t.constructor;switch(e){case v:return po(t);case a:case i:return new s(+t);case A:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case E:case b:case w:case C:case x:case $:case"[object Uint8ClampedArray]":case S:case O:return fo(t,r);case p:return new s;case f:case m:return new s(t);case _:return(u=new(o=t).constructor(o.source,Q.exec(o))).lastIndex=o.lastIndex,u;case d:return new s;case g:return n=t,xr?_t(xr.call(n)):{}}}(t,R,F)}}s||(s=new jr);var D=s.get(t);if(D)return D;s.set(t,y),Wa(t)?t.forEach((function(n){y.add(Vr(n,e,r,n,t,s))})):qa(t)&&t.forEach((function(n,o){y.set(o,Vr(n,e,r,o,t,s))}));var j=k?void 0:(I?P?Yo:Go:P?vi:yi)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Hr(y,o,Vr(n,e,r,o,t,s))})),y}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=_t(t);n--;){var o=r[n],u=e[o],a=t[o];if(void 0===a&&!(o in t)||!u(a))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new gt(e);return yu((function(){t.apply(void 0,n)}),r)}function Zr(t,e,r,n){var o=-1,u=ue,a=!0,i=t.length,s=[],c=e.length;if(!i)return s;r&&(e=ie(e,xe(r))),n?(u=ae,a=!1):e.length>=200&&(u=Se,a=!1,e=new Dr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=qr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Br.prototype.clear=function(){this.size=0,this.__data__={hash:new kr,map:new(fr||Rr),string:new kr}},Br.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Br.prototype.get=function(t){return Jo(this,t).get(t)},Br.prototype.has=function(t){return Jo(this,t).has(t)},Br.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Dr.prototype.add=Dr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Br(n)}return r.set(t,e),this.size=r.size,this};var Qr=Eo(sn),tn=Eo(cn,!0);function en(t,e){var r=!0;return Qr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(i)?e>1?on(i,e-1,r,n,o):se(o,i):n||(o[o.length]=i)}return o}var un=bo(),an=bo(!0);function sn(t,e){return t&&un(t,e,yi)}function cn(t,e){return t&&an(t,e,yi)}function ln(t,e){return oe(e,(function(e){return Ta(t[e])}))}function pn(t,e){for(var r=0,n=(e=ao(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function mn(t,e){return null!=t&&e in _t(t)}function gn(t,e,r){for(var n=r?ae:ue,o=t[0].length,u=t.length,a=u,i=ct(u),s=1/0,c=[];a--;){var l=t[a];a&&e&&(l=ie(l,xe(e))),s=ar(l.length,s),i[a]=!r&&(e||o>=120&&l.length>=120)?new Dr(a&&l):void 0}l=t[0];var p=-1,f=i[0];t:for(;++p=i?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}($n(t,(function(t,r,o){return{criteria:ie(e,(function(e){return e(t)})),index:++n,value:t}})))}function kn(t,e,r){for(var n=-1,o=e.length,u={};++n-1;)i!==t&&ze.call(i,s,1),ze.call(t,s,1);return t}function Bn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==u){var u=o;au(o)?ze.call(t,o,1):Zn(t,o)}}return t}function Dn(t,e){return t+Qe(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Qe(e/2))&&(t+=t)}while(e);return r}function Ln(t,e){return vu(_u(t,e,zi),t+"")}function Tn(t){return Tr(Si(t))}function Nn(t,e){var r=Si(t);return bu(r,Kr(e,0,r.length))}function Mn(t,e,r,n){if(!Ua(t))return t;for(var o=-1,u=(e=ao(e,t)).length,a=u-1,i=t;null!=i&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var u=ct(o);++n>>1,a=t[u];null!==a&&!Va(a)&&(r?a<=e:a=200){var c=e?null:Lo(t);if(c)return Le(c);a=!1,o=Se,s=new Dr}else s=e?[]:i;t:for(;++n=n?t:zn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Gt?Gt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ho(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,u=Va(t),a=void 0!==e,i=null===e,s=e==e,c=Va(e);if(!i&&!c&&!u&&t>e||u&&a&&s&&!i&&!c||n&&a&&s||!r&&s||!o)return 1;if(!n&&!u&&!c&&t1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(u=t.length>3&&"function"==typeof u?(o--,u):void 0,a&&iu(r[0],r[1],a)&&(u=o<3?void 0:u,o=1),e=_t(e);++n-1?o[u?e[a]:a]:void 0}}function So(t){return zo((function(r){var n=r.length,o=n,u=Pr.prototype.thru;for(t&&r.reverse();o--;){var a=r[o];if("function"!=typeof a)throw new gt(e);if(u&&!i&&"wrapper"==Ko(a))var i=new Pr([],!0)}for(o=i?o:n;++o1&&y.reverse(),l&&si))return!1;var c=u.get(t),l=u.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,h=2&r?new Dr:void 0;for(u.set(t,e),u.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Y,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ue(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(W);return e?e[1].split(K):[]}(o),r)))}function Eu(t){var e=0,r=0;return function(){var n=ir(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function bu(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Yu(t,r)}));function Qu(t){var e=Sr(t);return e.__chain__=!0,e}function ta(t,e){return e(t)}var ea=zo((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Ir&&au(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ta,args:[o],thisArg:void 0}),new Pr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),ra=vo((function(t,e,r){wt.call(t,r)?++t[r]:Yr(t,r,1)})),na=$o(Pu),oa=$o(Iu);function ua(t,e){return(Ia(t)?ee:Qr)(t,Xo(e,3))}function aa(t,e){return(Ia(t)?re:tn)(t,Xo(e,3))}var ia=vo((function(t,e,r){wt.call(t,r)?t[r].push(e):Yr(t,r,[e])})),sa=Ln((function(t,e,r){var n=-1,o="function"==typeof e,u=Ra(t)?ct(t.length):[];return Qr(t,(function(t){u[++n]=o?Qt(e,t,r):yn(t,e,r)})),u})),ca=vo((function(t,e,r){Yr(t,r,e)}));function la(t,e){return(Ia(t)?ie:$n)(t,Xo(e,3))}var pa=vo((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),fa=Ln((function(t,e){if(null==t)return[];var r=e.length;return r>1&&iu(t,e[0],e[1])?e=[]:r>2&&iu(e[0],e[1],e[2])&&(e=[e[0]]),In(t,on(e,1),[])})),ha=Xe||function(){return Ut.Date.now()};function _a(t,e,r){return e=r?void 0:e,No(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function da(t,r){var n;if("function"!=typeof r)throw new gt(e);return t=ei(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var ma=Ln((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(ma));n|=32}return No(t,n,e,r,o)})),ga=Ln((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(ga));n|=32}return No(e,n,t,r,o)}));function ya(t,r,n){var o,u,a,i,s,c,l=0,p=!1,f=!1,h=!0;if("function"!=typeof t)throw new gt(e);function _(e){var r=o,n=u;return o=u=void 0,l=e,i=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=a}function m(){var t=ha();if(d(t))return g(t);s=yu(m,function(t){var e=r-(t-c);return f?ar(e,a-(t-l)):e}(t))}function g(t){return s=void 0,h&&o?_(t):(o=u=void 0,i)}function y(){var t=ha(),e=d(t);if(o=arguments,u=this,c=t,e){if(void 0===s)return function(t){return l=t,s=yu(m,r),p?_(t):i}(c);if(f)return co(s),s=yu(m,r),_(c)}return void 0===s&&(s=yu(m,r)),i}return r=ni(r)||0,Ua(n)&&(p=!!n.leading,a=(f="maxWait"in n)?ur(ni(n.maxWait)||0,r):a,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&co(s),l=0,o=c=u=s=void 0},y.flush=function(){return void 0===s?i:g(ha())},y}var va=Ln((function(t,e){return Jr(t,1,e)})),Aa=Ln((function(t,e,r){return Jr(t,ni(e)||0,r)}));function Ea(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new gt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],u=n.cache;if(u.has(o))return u.get(o);var a=t.apply(this,e);return n.cache=u.set(o,a)||u,a};return n.cache=new(Ea.Cache||Br),n}function ba(t){if("function"!=typeof t)throw new gt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ea.Cache=Br;var wa=io((function(t,e){var r=(e=1==e.length&&Ia(e[0])?ie(e[0],xe(Xo())):ie(on(e,1),xe(Xo()))).length;return Ln((function(n){for(var o=-1,u=ar(n.length,r);++o=e})),Pa=vn(function(){return arguments}())?vn:function(t){return Ha(t)&&wt.call(t,"callee")&&!Ae.call(t,"callee")},Ia=ct.isArray,ka=Wt?xe(Wt):function(t){return Ha(t)&&hn(t)==v};function Ra(t){return null!=t&&Ma(t.length)&&!Ta(t)}function Ba(t){return Ha(t)&&Ra(t)}var Da=er||ns,ja=Kt?xe(Kt):function(t){return Ha(t)&&hn(t)==i};function La(t){if(!Ha(t))return!1;var e=hn(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ga(t)}function Ta(t){if(!Ua(t))return!1;var e=hn(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Na(t){return"number"==typeof t&&t==ei(t)}function Ma(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ua(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ha(t){return null!=t&&"object"==typeof t}var qa=Vt?xe(Vt):function(t){return Ha(t)&&ru(t)==p};function za(t){return"number"==typeof t||Ha(t)&&hn(t)==f}function Ga(t){if(!Ha(t)||hn(t)!=h)return!1;var e=Yt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&bt.call(r)==Pt}var Ya=Xt?xe(Xt):function(t){return Ha(t)&&hn(t)==_},Wa=Jt?xe(Jt):function(t){return Ha(t)&&ru(t)==d};function Ka(t){return"string"==typeof t||!Ia(t)&&Ha(t)&&hn(t)==m}function Va(t){return"symbol"==typeof t||Ha(t)&&hn(t)==g}var Xa=Zt?xe(Zt):function(t){return Ha(t)&&Ma(t.length)&&!!Bt[hn(t)]},Ja=Bo(xn),Za=Bo((function(t,e){return t<=e}));function Qa(t){if(!t)return[];if(Ra(t))return Ka(t)?Me(t):go(t);if(Ye&&t[Ye])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Ye]());var e=ru(t);return(e==p?Be:e==d?Le:Si)(t)}function ti(t){return t?(t=ni(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ei(t){var e=ti(t),r=e%1;return e==e?r?e-r:e:0}function ri(t){return t?Kr(ei(t),0,4294967295):0}function ni(t){if("number"==typeof t)return t;if(Va(t))return NaN;if(Ua(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ua(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Tt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function oi(t){return yo(t,vi(t))}function ui(t){return null==t?"":Xn(t)}var ai=Ao((function(t,e){if(pu(e)||Ra(e))yo(e,yi(e),t);else for(var r in e)wt.call(e,r)&&Hr(t,r,e[r])})),ii=Ao((function(t,e){yo(e,vi(e),t)})),si=Ao((function(t,e,r,n){yo(e,vi(e),t,n)})),ci=Ao((function(t,e,r,n){yo(e,yi(e),t,n)})),li=zo(Wr),pi=Ln((function(t,e){t=_t(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&iu(e[0],e[1],o)&&(n=1);++r1),e})),yo(t,Yo(t),r),n&&(r=Vr(r,7,Ho));for(var o=e.length;o--;)Zn(r,e[o]);return r})),wi=zo((function(t,e){return null==t?{}:function(t,e){return kn(t,e,(function(e,r){return _i(t,r)}))}(t,e)}));function Ci(t,e){if(null==t)return{};var r=ie(Yo(t),(function(t){return[t]}));return e=Xo(e),kn(t,r,(function(t,r){return e(t,r[0])}))}var xi=To(yi),$i=To(vi);function Si(t){return null==t?[]:$e(t,yi(t))}var Oi=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?Fi(e):e)}));function Fi(t){return Li(ui(t).toLowerCase())}function Pi(t){return(t=ui(t))&&t.replace(ut,Pe).replace(St,"")}var Ii=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),ki=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ri=wo("toLowerCase"),Bi=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Di=Co((function(t,e,r){return t+(r?" ":"")+Li(e)})),ji=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Li=wo("toUpperCase");function Ti(t,e,r){return t=ui(t),void 0===(e=r?void 0:e)?function(t){return It.test(t)}(t)?function(t){return t.match(Ft)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Ni=Ln((function(t,e){try{return Qt(t,void 0,e)}catch(r){return La(r)?r:new pt(r)}})),Mi=zo((function(t,e){return ee(e,(function(e){e=Cu(e),Yr(t,e,ma(t[e],t))})),t}));function Ui(t){return function(){return t}}var Hi=So(),qi=So(!0);function zi(t){return t}function Gi(t){return wn("function"==typeof t?t:Vr(t,1))}var Yi=Ln((function(t,e){return function(r){return yn(r,t,e)}})),Wi=Ln((function(t,e){return function(r){return yn(t,r,e)}}));function Ki(t,e,r){var n=yi(e),o=ln(e,n);null!=r||Ua(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,yi(e)));var u=!(Ua(r)&&"chain"in r&&!r.chain),a=Ta(t);return ee(o,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(u||e){var r=t(this.__wrapped__);return(r.__actions__=go(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Vi(){}var Xi=Io(ie),Ji=Io(ne),Zi=Io(pe);function Qi(t){return su(t)?ve(Cu(t)):function(t){return function(e){return pn(e,t)}}(t)}var ts=Ro(),es=Ro(!0);function rs(){return[]}function ns(){return!1}var os,us=Po((function(t,e){return t+e}),0),as=jo("ceil"),is=Po((function(t,e){return t/e}),1),ss=jo("floor"),cs=Po((function(t,e){return t*e}),1),ls=jo("round"),ps=Po((function(t,e){return t-e}),0);return Sr.after=function(t,r){if("function"!=typeof r)throw new gt(e);return t=ei(t),function(){if(--t<1)return r.apply(this,arguments)}},Sr.ary=_a,Sr.assign=ai,Sr.assignIn=ii,Sr.assignInWith=si,Sr.assignWith=ci,Sr.at=li,Sr.before=da,Sr.bind=ma,Sr.bindAll=Mi,Sr.bindKey=ga,Sr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ia(t)?t:[t]},Sr.chain=Qu,Sr.chunk=function(t,e,r){e=(r?iu(t,e,r):void 0===e)?1:ur(ei(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,u=0,a=ct(Ze(n/e));oo?0:o+r),(n=void 0===n||n>o?o:ei(n))<0&&(n+=o),n=r>n?0:ri(n);r>>0)?(t=ui(t))&&("string"==typeof e||null!=e&&!Ya(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},Sr.spread=function(t,r){if("function"!=typeof t)throw new gt(e);return r=null==r?0:ur(ei(r),0),Ln((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Qt(t,this,o)}))},Sr.tail=function(t){var e=null==t?0:t.length;return e?zn(t,1,e):[]},Sr.take=function(t,e,r){return t&&t.length?zn(t,0,(e=r||void 0===e?1:ei(e))<0?0:e):[]},Sr.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?zn(t,(e=n-(e=r||void 0===e?1:ei(e)))<0?0:e,n):[]},Sr.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},Sr.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},Sr.tap=function(t,e){return e(t),t},Sr.throttle=function(t,r,n){var o=!0,u=!0;if("function"!=typeof t)throw new gt(e);return Ua(n)&&(o="leading"in n?!!n.leading:o,u="trailing"in n?!!n.trailing:u),ya(t,r,{leading:o,maxWait:r,trailing:u})},Sr.thru=ta,Sr.toArray=Qa,Sr.toPairs=xi,Sr.toPairsIn=$i,Sr.toPath=function(t){return Ia(t)?ie(t,Cu):Va(t)?[t]:go(wu(ui(t)))},Sr.toPlainObject=oi,Sr.transform=function(t,e,r){var n=Ia(t),o=n||Da(t)||Xa(t);if(e=Xo(e,4),null==r){var u=t&&t.constructor;r=o?n?new u:[]:Ua(t)&&Ta(u)?Or(Yt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},Sr.unary=function(t){return _a(t,1)},Sr.union=Hu,Sr.unionBy=qu,Sr.unionWith=zu,Sr.uniq=function(t){return t&&t.length?Jn(t):[]},Sr.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},Sr.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},Sr.unset=function(t,e){return null==t||Zn(t,e)},Sr.unzip=Gu,Sr.unzipWith=Yu,Sr.update=function(t,e,r){return null==t?t:Qn(t,e,uo(r))},Sr.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Qn(t,e,uo(r),n)},Sr.values=Si,Sr.valuesIn=function(t){return null==t?[]:$e(t,vi(t))},Sr.without=Wu,Sr.words=Ti,Sr.wrap=function(t,e){return Ca(uo(e),t)},Sr.xor=Ku,Sr.xorBy=Vu,Sr.xorWith=Xu,Sr.zip=Ju,Sr.zipObject=function(t,e){return no(t||[],e||[],Hr)},Sr.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},Sr.zipWith=Zu,Sr.entries=xi,Sr.entriesIn=$i,Sr.extend=ii,Sr.extendWith=si,Ki(Sr,Sr),Sr.add=us,Sr.attempt=Ni,Sr.camelCase=Oi,Sr.capitalize=Fi,Sr.ceil=as,Sr.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=ni(r))==r?r:0),void 0!==e&&(e=(e=ni(e))==e?e:0),Kr(ni(t),e,r)},Sr.clone=function(t){return Vr(t,4)},Sr.cloneDeep=function(t){return Vr(t,5)},Sr.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},Sr.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},Sr.conformsTo=function(t,e){return null==e||Xr(t,e,yi(e))},Sr.deburr=Pi,Sr.defaultTo=function(t,e){return null==t||t!=t?e:t},Sr.divide=is,Sr.endsWith=function(t,e,r){t=ui(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Kr(ei(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},Sr.eq=Sa,Sr.escape=function(t){return(t=ui(t))&&D.test(t)?t.replace(R,Ie):t},Sr.escapeRegExp=function(t){return(t=ui(t))&&q.test(t)?t.replace(H,"\\$&"):t},Sr.every=function(t,e,r){var n=Ia(t)?ne:en;return r&&iu(t,e,r)&&(e=void 0),n(t,Xo(e,3))},Sr.find=na,Sr.findIndex=Pu,Sr.findKey=function(t,e){return he(t,Xo(e,3),sn)},Sr.findLast=oa,Sr.findLastIndex=Iu,Sr.findLastKey=function(t,e){return he(t,Xo(e,3),cn)},Sr.floor=ss,Sr.forEach=ua,Sr.forEachRight=aa,Sr.forIn=function(t,e){return null==t?t:un(t,Xo(e,3),vi)},Sr.forInRight=function(t,e){return null==t?t:an(t,Xo(e,3),vi)},Sr.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},Sr.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},Sr.get=hi,Sr.gt=Oa,Sr.gte=Fa,Sr.has=function(t,e){return null!=t&&nu(t,e,dn)},Sr.hasIn=_i,Sr.head=Ru,Sr.identity=zi,Sr.includes=function(t,e,r,n){t=Ra(t)?t:Si(t),r=r&&!n?ei(r):0;var o=t.length;return r<0&&(r=ur(o+r,0)),Ka(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},Sr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:ei(r);return o<0&&(o=ur(n+o,0)),de(t,e,o)},Sr.inRange=function(t,e,r){return e=ti(e),void 0===r?(r=e,e=0):r=ti(r),function(t,e,r){return t>=ar(e,r)&&t=-9007199254740991&&t<=9007199254740991},Sr.isSet=Wa,Sr.isString=Ka,Sr.isSymbol=Va,Sr.isTypedArray=Xa,Sr.isUndefined=function(t){return void 0===t},Sr.isWeakMap=function(t){return Ha(t)&&ru(t)==y},Sr.isWeakSet=function(t){return Ha(t)&&"[object WeakSet]"==hn(t)},Sr.join=function(t,e){return null==t?"":nr.call(t,e)},Sr.kebabCase=Ii,Sr.last=Lu,Sr.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=ei(r))<0?ur(n+o,0):ar(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):_e(t,ge,o,!0)},Sr.lowerCase=ki,Sr.lowerFirst=Ri,Sr.lt=Ja,Sr.lte=Za,Sr.max=function(t){return t&&t.length?rn(t,zi,_n):void 0},Sr.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),_n):void 0},Sr.mean=function(t){return ye(t,zi)},Sr.meanBy=function(t,e){return ye(t,Xo(e,2))},Sr.min=function(t){return t&&t.length?rn(t,zi,xn):void 0},Sr.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},Sr.stubArray=rs,Sr.stubFalse=ns,Sr.stubObject=function(){return{}},Sr.stubString=function(){return""},Sr.stubTrue=function(){return!0},Sr.multiply=cs,Sr.nth=function(t,e){return t&&t.length?Pn(t,ei(e)):void 0},Sr.noConflict=function(){return Ut._===this&&(Ut._=jt),this},Sr.noop=Vi,Sr.now=ha,Sr.pad=function(t,e,r){t=ui(t);var n=(e=ei(e))?Ne(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return ko(Qe(o),r)+t+ko(Ze(o),r)},Sr.padEnd=function(t,e,r){t=ui(t);var n=(e=ei(e))?Ne(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ar(t+o*(e-t+Lt("1e-"+((o+"").length-1))),e)}return Dn(t,e)},Sr.reduce=function(t,e,r){var n=Ia(t)?ce:Ee,o=arguments.length<3;return n(t,Xo(e,4),r,o,Qr)},Sr.reduceRight=function(t,e,r){var n=Ia(t)?le:Ee,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},Sr.repeat=function(t,e,r){return e=(r?iu(t,e,r):void 0===e)?1:ei(e),jn(ui(t),e)},Sr.replace=function(){var t=arguments,e=ui(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Sr.result=function(t,e,r){var n=-1,o=(e=ao(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ar(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=u)return t;var i=r-Ne(n);if(i<1)return n;var s=a?so(a,0,i).join(""):t.slice(0,i);if(void 0===o)return s+n;if(a&&(i+=s.length-i),Ya(o)){if(t.slice(i).search(o)){var c,l=s;for(o.global||(o=dt(o.source,ui(Q.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?i:p)}}else if(t.indexOf(Xn(o),i)!=i){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},Sr.unescape=function(t){return(t=ui(t))&&B.test(t)?t.replace(k,He):t},Sr.uniqueId=function(t){var e=++Ct;return ui(t)+e},Sr.upperCase=ji,Sr.upperFirst=Li,Sr.each=ua,Sr.eachRight=aa,Sr.first=Ru,Ki(Sr,(os={},sn(Sr,(function(t,e){wt.call(Sr.prototype,e)||(os[e]=t)})),os),{chain:!1}),Sr.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Sr[t].placeholder=Sr})),ee(["drop","take"],(function(t,e){Ir.prototype[t]=function(r){r=void 0===r?1:ur(ei(r),0);var n=this.__filtered__&&!e?new Ir(this):this.clone();return n.__filtered__?n.__takeCount__=ar(r,n.__takeCount__):n.__views__.push({size:ar(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Ir.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Ir.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Ir.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Ir.prototype[t]=function(){return this.__filtered__?new Ir(this):this[r](1)}})),Ir.prototype.compact=function(){return this.filter(zi)},Ir.prototype.find=function(t){return this.filter(t).head()},Ir.prototype.findLast=function(t){return this.reverse().find(t)},Ir.prototype.invokeMap=Ln((function(t,e){return"function"==typeof t?new Ir(this):this.map((function(r){return yn(r,t,e)}))})),Ir.prototype.reject=function(t){return this.filter(ba(Xo(t)))},Ir.prototype.slice=function(t,e){t=ei(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Ir(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=ei(e))<0?r.dropRight(-e):r.take(e-t)),r)},Ir.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ir.prototype.toArray=function(){return this.take(4294967295)},sn(Ir.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=Sr[n?"take"+("last"==e?"Right":""):e],u=n||/^find/.test(e);o&&(Sr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,i=e instanceof Ir,s=a[0],c=i||Ia(e),l=function(t){var e=o.apply(Sr,se([t],a));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(i=c=!1);var p=this.__chain__,f=!!this.__actions__.length,h=u&&!p,_=i&&!f;if(!u&&c){e=_?e:new Ir(this);var d=t.apply(e,a);return d.__actions__.push({func:ta,args:[l],thisArg:void 0}),new Pr(d,p)}return h&&_?t.apply(this,a):(d=this.thru(l),h?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Sr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ia(o)?o:[],t)}return this[r]((function(r){return e.apply(Ia(r)?r:[],t)}))}})),sn(Ir.prototype,(function(t,e){var r=Sr[e];if(r){var n=r.name+"";wt.call(yr,n)||(yr[n]=[]),yr[n].push({name:e,func:r})}})),yr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],Ir.prototype.clone=function(){var t=new Ir(this.__wrapped__);return t.__actions__=go(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=go(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=go(this.__views__),t},Ir.prototype.reverse=function(){if(this.__filtered__){var t=new Ir(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Ir.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ia(t),n=e<0,o=r?t.length:0,u=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Sr.prototype.plant=function(t){for(var e,r=this;r instanceof Fr;){var n=$u(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},Sr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Ir){var e=t;return this.__actions__.length&&(e=new Ir(this)),(e=e.reverse()).__actions__.push({func:ta,args:[Uu],thisArg:void 0}),new Pr(e,this.__chain__)}return this.thru(Uu)},Sr.prototype.toJSON=Sr.prototype.valueOf=Sr.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},Sr.prototype.first=Sr.prototype.head,Ye&&(Sr.prototype[Ye]=function(){return this}),Sr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=qe,define((function(){return qe}))):qt?((qt.exports=qe)._=qe,Ht._=qe):Ut._=qe}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",u=this.position;ue/2-1){o=" ... ",u-=5;break}return a=this.buffer.slice(n,u),_$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,u,a,i,s,c=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(u=+e[4],a=+e[5],i=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,u,a,i,c)),l&&s.setTime(s.getTime()-l),s},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,u=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,u=BASE64_MAP,a=0,i=[];for(e=0;e>16&255),i.push(a>>8&255),i.push(255&a)),a=a<<6|u.indexOf(n.charAt(e));return 0==(r=o%4*6)?(i.push(a>>16&255),i.push(a>>8&255),i.push(255&a)):18===r?(i.push(a>>10&255),i.push(a>>2&255)):12===r&&i.push(a>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(i):new NodeBuffer(i):i},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,u=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=u%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,u,a=[],i=t;for(e=0,r=i.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,u;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),u=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=u<2,1!==u&&2!==u&&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,u,a,i;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,u=t.anchor,a=[],i=!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(i=!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)&&(d?h=t.result:_=t.result),d||(storeMappingPair(t,l,p,f,h,_,u,a),f=h=_=null),skipSeparationSpace(t,!0,-1),i=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==i)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(u)){do{u=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(u));if(35===u)do{u=t.input.charCodeAt(++t.position)}while(!is_EOL(u)&&0!==u)}for(;0!==u;){for(readLineBreak(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(u))p++;else{if(t.lineIndent0){for(o=a,u=0;o>0;o--)(a=fromHexCode(i=t.input.charCodeAt(++t.position)))>=0?u=(u<<4)+a:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(u),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(i)?(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,p)?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,u,a,i,s,c,l,p=t.kind,f=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=u=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(i=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){a=!0,l=t.input.charCodeAt(t.position);continue}t.position=u,t.line=i,t.lineStart=s,t.lineIndent=c;break}}a&&(captureSegment(t,o,u,!1),writeFoldedLines(t,t.line-i),o=u=t.position,a=!1),is_WHITE_SPACE(l)||(u=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,u,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===h&&(d=i&&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+'"'),s=0,c=t.implicitTypes.length;s 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,u=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(u,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(u-1):null,h=h&&isPlainSafe(a,i)}else{for(u=0;un&&" "!==t[f+1],f=u);else if(!isPrintable(a))return STYLE_DOUBLE;i=u>0?t.charCodeAt(u-1):null,h=h&&isPlainSafe(a,i)}l=l||p&&u-f-1>n&&" "!==t[f+1]}return c||l?r>9&&needIndentIndicator(t)?STYLE_DOUBLE:l?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),u=-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,u,(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,u=/(\n+)([^\n]*)/g,a=(o=-1!==(o=t.indexOf("\n"))?o:t.length,u.lastIndex=o,foldLine(t.slice(0,o),e)),i="\n"===t[0]||" "===t[0];n=u.exec(t);){var s=n[1],c=n[2];r=" "===c[0],a+=s+(i||r||""===c?"":"\n")+foldLine(c,e),i=r}return a}(e,u),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",u=0;u=55296&&e<=56319&&(r=t.charCodeAt(u+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),u++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[u]: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,u=0,a=0,i=0,s="";r=o.exec(t);)(i=r.index)-u>e&&(n=a>u?a:i,s+="\n"+t.slice(u,n),u=n+1),a=i;return s+="\n",t.length-u>e&&a>u?s+=t.slice(u,a)+"\n"+t.slice(a+1):s+=t.slice(u),s.slice(1)}function detectType(t,e,r){var n,o,u,a,i,s;for(u=0,a=(o=r?t.explicitTypes:t.implicitTypes).length;u tag resolver accepts not "'+s+'" style');n=i.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,u){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 i,s,c="[object Object]"===a||"[object Array]"===a;if(c&&(s=-1!==(i=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[i])t.dump="*ref_"+i;else{if(c&&s&&!t.usedDuplicates[i]&&(t.usedDuplicates[i]=!0),"[object Object]"===a)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,u,a,i,s,c,l="",p=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,u=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,i,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+i+t.dump)):(function(t,e,r){var n,o,u,a,i,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(i+="? "),i+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,a,!1,!1)&&(s+=i+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+i+" "+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,u,a="",i=t.tag;for(o=0,u=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],u=[];for(function t(e,r,n){var o,u,a;if(null!==e&&"object"==typeof e)if(-1!==(u=r.indexOf(e)))-1===n.indexOf(u)&&n.push(u);else if(r.push(e),Array.isArray(e))for(u=0,a=e.length;u0?o-4:o;for(r=0;r>16&255,a[i++]=e>>8&255,a[i++]=255&e;return 2===u&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,a[i++]=255&e),1===u&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,a[i++]=e>>8&255,a[i++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],u=0,a=r-n;ua?a:u+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,u=[],a=e;a>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return u.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var u,a,i=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,h=t[e+p];for(p+=f,u=h&(1<<-l)-1,h>>=-l,l+=i;l>0;u=256*u+t[e+p],p+=f,l-=8);for(a=u&(1<<-l)-1,u>>=-l,l+=n;l>0;a=256*a+t[e+p],p+=f,l-=8);if(0===u)u=1-c;else{if(u===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),u-=c}return(h?-1:1)*a*Math.pow(2,u-n)},write:function(t,e,r,n,o,u){var a,i,s,c=8*u-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:u-1,_=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(a++,s/=2),a+p>=l?(i=0,a=l):a+p>=1?(i=(e*s-1)*Math.pow(2,o),a+=p):(i=e*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&i,h+=_,i/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=_,a/=256,c-=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,u="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,i=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},i.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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,"")},_=function(t){for(var e,r,n,o,u="",a=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");u+=i[(e=r<<16|n<<8|o)>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}return a?u.slice(0,a-3)+"===".substring(a):u},d=n?function(t){return btoa(t)}:o?function(t){return e.from(t,"binary").toString("base64")}:_,m=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)},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(t){return t.replace(v,y)},E=o?function(t){return e.from(t,"utf8").toString("base64")}:a?function(t){return m(a.encode(t))}:function(t){return d(A(t))},b=function(t,e){return void 0===e&&(e=!1),e?f(E(t)):E(t)},w=function(t){return b(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},$=function(t){return t.replace(C,x)},S=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",u=0;u>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(h(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:S,F=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},P=function(t){return F(k(t))},I=o?function(t){return e.from(t,"base64").toString("utf8")}:u?function(t){return u.decode(F(t))}:function(t){return $(O(t))},k=function(t){return h(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return I(k(t))},B=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},D=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,B(e))};t("fromBase64",(function(){return R(this)})),t("toBase64",(function(t){return b(this,t)})),t("toBase64URI",(function(){return b(this,!0)})),t("toBase64URL",(function(){return b(this,!0)})),t("toUint8Array",(function(){return P(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,B(e))};t("toBase64",(function(t){return g(this,t)})),t("toBase64URI",(function(){return g(this,!0)})),t("toBase64URL",(function(){return g(this,!0)}))},L={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:S,btoa:d,btoaPolyfill:_,fromBase64:R,toBase64:b,encode:b,encodeURI:w,encodeURL:w,utob:A,btou:$,decode:R,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:g,toUint8Array:P,extendString:D,extendUint8Array:j,extendBuiltins:function(){D(),j()},Base64:{}};return Object.keys(L).forEach((function(t){return L.Base64[t]=L[t]})),L}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___arrayLikeToArray_75(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_65.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,u=r.password,a=r.servers,i=0;i({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const u=e.find(({source:e})=>e===t.source),a=t.start;if(u){const e=t.end,i=u.text[a.line-1],s=(a.line===e.line?e.column:i.length+1)-a.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${a.line}:${a.column}\n${"".padEnd(r)} |\n${a.line.toString().padStart(r)} | ${i}\n${"".padEnd(r)} | ${"".padEnd(a.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${a.line}:${a.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let u;u=(u=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let a=`${t}: ${e}`;n&&(a+=r(n,u));for(const i of o)a+=r(i.location,u,i.message);return a}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const u={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(u).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=u[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return u(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=u(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let a=0;a0?NEVER_MATCH:SOMETIMES_MATCH}const u=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=u(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-u(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=u(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});u(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function u(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function a(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},u=JSON.stringify(n),a=o.findIndex(t=>JSON.stringify(t)===u);return-1===a?o.push(n)-1:a}function i(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],_(t,{sp:r.sp+1,env:i(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=a(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function h(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const _=_$visitor_52.build({grammar(t){t.rules.forEach(_),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=_(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:u({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],_(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=_(e[0],{sp:r.sp,env:i(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=i(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=_(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),u=0|t.expression.match,p=n&&u!==__NEVER_MATCH_39?a(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(u,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(_(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=a(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=i(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),_(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],_(t.expression,{sp:e.sp+1,env:i(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(_(t.expression,{sp:e.sp,env:i(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=_(t.expression,{sp:e.sp+1,env:i(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,h(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=_(t.expression,{sp:e.sp+1,env:i(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(h(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>_(t.expression,{sp:e.sp,env:i(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?u({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?u({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?u({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});_(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const u=o.toString();return"absolute"===r?u:"scheme-relative"===r?u.slice(PROTOCOL.length):"path-absolute"===r?u.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,u)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(u){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&u>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const u=t.sourceContentFor(n);null!=u&&r.setSourceContent(n,u)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const u=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,a=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const i=e.source;null==i||u.has(i)||u.add(i);const s=e.name;null==s||a.has(s)||a.add(s)}),this),this._sources=u,this._names=a,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,u=1,a=0,i=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,h=p.length;f0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-i),i=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-a),a=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let u=0;const a=function(){return t()+(t()||"");function t(){return u=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+a,0===a?o:0,e.source,a===u.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function u(t){return"peg$e"+t}function a(t){return"peg$f"+t}function i(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const u={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),u=n();return u.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{u.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),u.push("")),u.push(t,"","module.exports = "+o()+";"),u},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const u=Object.keys(e.dependencies),a="["+u.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",i=u.join(", ");return[...n(),"define("+a+", function("+i+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const u=Object.keys(e.dependencies),a=u.map(t=>e.dependencies[t]),i="["+a.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=a.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=u.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+i+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,u.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+i(t)).join(", ")+" }",p=i(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+u(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${a(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let h;function _(t,n){const o=n+3,u=s[c+o-2],a=s[c+o-1];let i,p;l.checkedIf(c,()=>{c+=o,i=e(s.slice(c,c+u)),c+=u},a>0?()=>{p=e(s.slice(c,c+a)),c+=a}:null),f.push("if ("+t+") {"),f.push(...i.map(r)),a>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function m(){const t=s[c+4-1],e=a(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(h)),c+=r;break}case _$opcodes_38.IF:_(l.top(),0);break;case _$opcodes_38.IF_ERROR:_(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:_(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:_("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:_(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:_("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:_(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+u(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:m();break;case _$opcodes_38.RULE:f.push(l.push(i(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",i(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,u)=>{var a;"rule"===(a=o).type&&"rule_ref"===a.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(u))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){u(t.expression,n(e))}const u=_$visitor_52.build({rule(t){u(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{u(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),u(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});u(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],u=_$visitor_52.build({rule(t){n.push(t.name),u(t.expression),n.pop()},sequence(e){e.elements.every(e=>(u(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const a=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",a.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));a&&u(a),o.pop()}});u(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eGt&&(Gt=Ht,Yt=[]),Yt.push(t))}function re(){var e,r,o,u,a,i;if(e=Ht,Re(),r=Ht,(o=function(){var e,r,o,u;return e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(b)),r!==n&&(o=ke())!==n?(125===t.charCodeAt(Ht)?(u="}",Ht++):(u=n,0===Wt&&ee(w)),u!==n&&Be()!==n?(qt=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Kt()}}(o)):(Ht=e,e=n)):(Ht=e,e=n),e}())!==n?(u=Re(),r=o):(Ht=r,r=n),r===n&&(r=null),o=Ht,(u=function(){var t,e;return t=Ht,(e=ke())!==n&&Be()!==n?(qt=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Kt()}}(e)):(Ht=t,t=n),t}())!==n?(a=Re(),o=u):(Ht=o,o=n),o===n&&(o=null),u=[],a=Ht,(i=ne())!==n?(Re(),a=i):(Ht=a,a=n),a!==n)for(;a!==n;)u.push(a),a=Ht,(i=ne())!==n?(Re(),a=i):(Ht=a,a=n);else u=n;return u!==n?(qt=e,e=function(t,e,r){return{type:"grammar",topLevelInitializer:t,initializer:e,rules:r,location:Kt()}}(r,o,u)):(Ht=e,e=n),e}function ne(){var e,r,o,u,a,i,s,c;return e=Ht,(r=ye())!==n?(Re(),o=Ht,(u=Ee())!==n?(Re(),o=u):(Ht=o,o=n),o===n&&(o=null),61===t.charCodeAt(Ht)?(u="=",Ht++):(u=n,0===Wt&&ee(C)),u!==n?(Re(),(a=oe())!==n&&Be()!==n?(qt=e,s=o,c=a,e={type:"rule",name:(i=r)[0],nameLocation:i[1],expression:null!==s?{type:"named",name:s,expression:c,location:Kt()}:c,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n),e}function oe(){var e,r,o,u,a,i,s,c;if(e=Ht,(r=ue())!==n){for(o=[],u=Ht,Re(),47===t.charCodeAt(Ht)?(a="/",Ht++):(a=n,0===Wt&&ee(x)),a!==n?(Re(),(i=ue())!==n?u=i:(Ht=u,u=n)):(Ht=u,u=n);u!==n;)o.push(u),u=Ht,Re(),47===t.charCodeAt(Ht)?(a="/",Ht++):(a=n,0===Wt&&ee(x)),a!==n?(Re(),(i=ue())!==n?u=i:(Ht=u,u=n)):(Ht=u,u=n);qt=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Kt()}:s}else Ht=e,e=n;return e}function ue(){var t,e,r,o;return t=Ht,(e=function(){var t,e,r,o,u,a,i;if(t=Ht,(e=ae())!==n){for(r=[],o=Ht,Re(),(u=ae())!==n?o=u:(Ht=o,o=n);o!==n;)r.push(o),o=Ht,Re(),(u=ae())!==n?o=u:(Ht=o,o=n);qt=t,a=e,t=(i=r).length>0||"labeled"===a.type&&a.pick?{type:"sequence",elements:[a].concat(i),location:Kt()}:a}else Ht=t,t=n;return t}())!==n?(r=Ht,Re(),(o=ke())!==n?r=o:(Ht=r,r=n),r===n&&(r=null),qt=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Kt()}:t}(e,r)):(Ht=t,t=n),t}function ae(){var e,r,o,u,a,i,s;return e=Ht,(r=function(){var e,r;return e=Ht,64===t.charCodeAt(Ht)?(r="@",Ht++):(r=n,0===Wt&&ee($)),r!==n&&(qt=e,r=Kt()),r}())!==n?((o=ie())===n&&(o=null),(u=se())!==n?(qt=e,a=r,i=o,(s=u).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',a),e={type:"labeled",label:null!==i?i[0]:null,labelLocation:null!==i?i[1]:a,pick:!0,expression:s,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=Ht,(r=ie())!==n?(o=Re(),(u=se())!==n?(qt=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Kt()}}(r,u)):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=se())),e}function ie(){var e,r,o,u;return e=Ht,(r=ye())!==n?(Re(),58===t.charCodeAt(Ht)?(o=":",Ht++):(o=n,0===Wt&&ee(S)),o!==n?(qt=e,u=r,De.indexOf(u[0])>=0&&Vt(`Label can't be a reserved word "${u[0]}"`,u[1]),e=u):(Ht=e,e=n)):(Ht=e,e=n),e}function se(){var e,r,o,u;return e=Ht,(r=function(){var e;return 36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P)))),e}())!==n?(Re(),(o=ce())!==n?(qt=e,u=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:u,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,u;return e=Ht,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Ht)?(e="?",Ht++):(e=n,0===Wt&&ee(I)),e===n&&(42===t.charCodeAt(Ht)?(e="*",Ht++):(e=n,0===Wt&&ee(k)),e===n&&(43===t.charCodeAt(Ht)?(e="+",Ht++):(e=n,0===Wt&&ee(R)))),e}())!==n?(qt=e,u=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:u,location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,u,a;return(e=function(){var e,r,o;return Wt++,e=Ht,(r=Ee())!==n?(105===t.charCodeAt(Ht)?(o="i",Ht++):(o=n,0===Wt&&ee(it)),o===n&&(o=null),qt=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Kt()}):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(at)),e}())===n&&(e=function(){var e,r,o,u,a,i,s,c;if(Wt++,e=Ht,91===t.charCodeAt(Ht)?(r="[",Ht++):(r=n,0===Wt&&ee(ft)),r!==n){for(94===t.charCodeAt(Ht)?(o="^",Ht++):(o=n,0===Wt&&ee(ht)),o===n&&(o=null),u=[],(a=Ce())===n&&(a=xe());a!==n;)u.push(a),(a=Ce())===n&&(a=xe());93===t.charCodeAt(Ht)?(a="]",Ht++):(a=n,0===Wt&&ee(_t)),a!==n?(105===t.charCodeAt(Ht)?(i="i",Ht++):(i=n,0===Wt&&ee(it)),i===n&&(i=null),qt=e,s=o,c=i,e={type:"class",parts:u.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Kt()}):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Ht,46===t.charCodeAt(Ht)?(r=".",Ht++):(r=n,0===Wt&&ee(St)),r!==n&&(qt=e,r={type:"any",location:Kt()}),r}())===n&&(e=function(){var e,r,o,u,a,i,s;return e=Ht,(r=ye())!==n?(o=Ht,Wt++,u=Ht,a=Re(),i=Ht,(s=Ee())!==n?i=s=[s,Re()]:(Ht=i,i=n),i===n&&(i=null),61===t.charCodeAt(Ht)?(s="=",Ht++):(s=n,0===Wt&&ee(C)),s!==n?u=a=[a,i,s]:(Ht=u,u=n),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e={type:"rule_ref",name:r[0],location:Kt()}):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Ht,(r=function(){var e;return 38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===Wt&&ee(F)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===Wt&&ee(P))),e}())!==n?(Re(),(o=ke())!==n?(qt=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Kt()}}(r,o)):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Ht,40===t.charCodeAt(Ht)?(r="(",Ht++):(r=n,0===Wt&&ee(B)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Ht)?(u=")",Ht++):(u=n,0===Wt&&ee(D)),u!==n?(qt=e,e="labeled"===(a=o).type||"sequence"===a.type?{type:"group",expression:a,location:Kt()}:a):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n)),e}function pe(){var e;return t.length>Ht?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(j)),e}function fe(){var e;return Wt++,9===t.charCodeAt(Ht)?(e="\t",Ht++):(e=n,0===Wt&&ee(T)),e===n&&(11===t.charCodeAt(Ht)?(e="\v",Ht++):(e=n,0===Wt&&ee(N)),e===n&&(12===t.charCodeAt(Ht)?(e="\f",Ht++):(e=n,0===Wt&&ee(M)),e===n&&(32===t.charCodeAt(Ht)?(e=" ",Ht++):(e=n,0===Wt&&ee(U)),e===n&&(160===t.charCodeAt(Ht)?(e="\xa0",Ht++):(e=n,0===Wt&&ee(H)),e===n&&(65279===t.charCodeAt(Ht)?(e="\ufeff",Ht++):(e=n,0===Wt&&ee(q)),e===n&&(e=function(){var e;return E.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Mt)),e}())))))),Wt--,e===n&&0===Wt&&ee(L),e}function he(){var e;return i.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(z)),e}function _e(){var e;return Wt++,10===t.charCodeAt(Ht)?(e="\n",Ht++):(e=n,0===Wt&&ee(Y)),e===n&&("\r\n"===t.substr(Ht,2)?(e="\r\n",Ht+=2):(e=n,0===Wt&&ee(W)),e===n&&(13===t.charCodeAt(Ht)?(e="\r",Ht++):(e=n,0===Wt&&ee(K)),e===n&&(8232===t.charCodeAt(Ht)?(e="\u2028",Ht++):(e=n,0===Wt&&ee(V)),e===n&&(8233===t.charCodeAt(Ht)?(e="\u2029",Ht++):(e=n,0===Wt&&ee(X)))))),Wt--,e===n&&0===Wt&&ee(G),e}function de(){var e;return Wt++,(e=function(){var e,r,o,u,a,i;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);u!==n;)o.push(u),u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u!==n?e=r=[r,o,u]:(Ht=e,e=n)}else Ht=e,e=n;return e}())===n&&(e=ge()),Wt--,e===n&&0===Wt&&ee(J),e}function me(){var e,r,o,u,a,i;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===Wt&&ee(Z)),r!==n){for(o=[],u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),i===n&&(i=he()),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);u!==n;)o.push(u),u=Ht,a=Ht,Wt++,"*/"===t.substr(Ht,2)?(i="*/",Ht+=2):(i=n,0===Wt&&ee(Q)),i===n&&(i=he()),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===Wt&&ee(Q)),u!==n?e=r=[r,o,u]:(Ht=e,e=n)}else Ht=e,e=n;return e}function ge(){var e,r,o,u,a,i;if(e=Ht,"//"===t.substr(Ht,2)?(r="//",Ht+=2):(r=n,0===Wt&&ee(tt)),r!==n){for(o=[],u=Ht,a=Ht,Wt++,i=he(),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);u!==n;)o.push(u),u=Ht,a=Ht,Wt++,i=he(),Wt--,i===n?a=void 0:(Ht=a,a=n),a!==n&&(i=pe())!==n?u=a=[a,i]:(Ht=u,u=n);e=r=[r,o]}else Ht=e,e=n;return e}function ye(){var t,e,r,o;if(Wt++,t=Ht,(e=ve())!==n){for(r=[],o=Ae();o!==n;)r.push(o),o=Ae();qt=t,t=[e+r.join(""),Kt()]}else Ht=t,t=n;return Wt--,t===n&&(e=n,0===Wt&&ee(et)),t}function ve(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Bt)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Pt)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(It)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(kt)),e}())===n&&(e=function(){var e;return v.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Tt)),e}()),e}())===n&&(36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===Wt&&ee(O)),e===n&&(95===t.charCodeAt(Ht)?(e="_",Ht++):(e=n,0===Wt&&ee(rt)),e===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Fe())!==n?e=o:(Ht=e,e=n)))),e}function Ae(){var e;return(e=ve())===n&&(e=function(){var e;return(e=function(){var e;return g.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(jt)),e}())===n&&(e=function(){var e;return m.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Dt)),e}()),e}())===n&&(e=function(){var e;return y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Lt)),e}())===n&&(e=function(){var e;return A.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(Nt)),e}())===n&&(8204===t.charCodeAt(Ht)?(e="\u200c",Ht++):(e=n,0===Wt&&ee(ot)),e===n&&(8205===t.charCodeAt(Ht)?(e="\u200d",Ht++):(e=n,0===Wt&&ee(ut)))),e}function Ee(){var e,r,o,u;if(Wt++,e=Ht,34===t.charCodeAt(Ht)?(r='"',Ht++):(r=n,0===Wt&&ee(ct)),r!==n){for(o=[],u=be();u!==n;)o.push(u),u=be();34===t.charCodeAt(Ht)?(u='"',Ht++):(u=n,0===Wt&&ee(ct)),u!==n?(qt=e,e=o.join("")):(Ht=e,e=n)}else Ht=e,e=n;if(e===n)if(e=Ht,39===t.charCodeAt(Ht)?(r="'",Ht++):(r=n,0===Wt&&ee(lt)),r!==n){for(o=[],u=we();u!==n;)o.push(u),u=we();39===t.charCodeAt(Ht)?(u="'",Ht++):(u=n,0===Wt&&ee(lt)),u!==n?(qt=e,e=function(t){return t.join("")}(o)):(Ht=e,e=n)}else Ht=e,e=n;return Wt--,e===n&&(r=n,0===Wt&&ee(st)),e}function be(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,34===t.charCodeAt(Ht)?(u='"',Ht++):(u=n,0===Wt&&ee(ct)),u===n&&(92===t.charCodeAt(Ht)?(u="\\",Ht++):(u=n,0===Wt&&ee(nt)),u===n&&(u=he())),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Se())!==n?e=o:(Ht=e,e=n),e===n&&(e=$e())),e}function we(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,39===t.charCodeAt(Ht)?(u="'",Ht++):(u=n,0===Wt&&ee(lt)),u===n&&(92===t.charCodeAt(Ht)?(u="\\",Ht++):(u=n,0===Wt&&ee(nt)),u===n&&(u=he())),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Se())!==n?e=o:(Ht=e,e=n),e===n&&(e=$e())),e}function Ce(){var e,r,o,u,a,i;return e=Ht,(r=xe())!==n?(45===t.charCodeAt(Ht)?(o="-",Ht++):(o=n,0===Wt&&ee(dt)),o!==n&&(u=xe())!==n?(qt=e,i=u,(a=r).charCodeAt(0)>i.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(qt,Ht)+"."),e=[a,i]):(Ht=e,e=n)):(Ht=e,e=n),e}function xe(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,93===t.charCodeAt(Ht)?(u="]",Ht++):(u=n,0===Wt&&ee(_t)),u===n&&(92===t.charCodeAt(Ht)?(u="\\",Ht++):(u=n,0===Wt&&ee(nt)),u===n&&(u=he())),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&(o=Se())!==n?e=o:(Ht=e,e=n),e===n&&(e=$e())),e}function $e(){var e,r;return e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===Wt&&ee(nt)),r!==n&&_e()!==n?(qt=e,e=""):(Ht=e,e=n),e}function Se(){var e,r,o,u;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,u;return e=Ht,r=Ht,o=Ht,Wt++,(u=function(){var e;return(e=Oe())===n&&(e=Pe())===n&&(120===t.charCodeAt(Ht)?(e="x",Ht++):(e=n,0===Wt&&ee(wt)),e===n&&(117===t.charCodeAt(Ht)?(e="u",Ht++):(e=n,0===Wt&&ee(Ct)))),e}())===n&&(u=he()),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n&&(u=pe())!==n?r=o=[o,u]:(Ht=r,r=n),r!==n?t.substring(e,Ht):r}()),e}())===n&&(e=Ht,48===t.charCodeAt(Ht)?(r="0",Ht++):(r=n,0===Wt&&ee(mt)),r!==n?(o=Ht,Wt++,u=Pe(),Wt--,u===n?o=void 0:(Ht=o,o=n),o!==n?(qt=e,e="\0"):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=function(){var e,r,o,u,a,i,s;return e=Ht,120===t.charCodeAt(Ht)?(r="x",Ht++):(r=n,0===Wt&&ee(wt)),r!==n?(o=Ht,u=Ht,(a=Ie())!==n&&(i=Ie())!==n?u=a=[a,i]:(Ht=u,u=n),(o=u!==n?t.substring(o,Ht):u)!==n?(qt=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Fe())),e}function Oe(){var e,r;return 39===t.charCodeAt(Ht)?(e="'",Ht++):(e=n,0===Wt&&ee(lt)),e===n&&(34===t.charCodeAt(Ht)?(e='"',Ht++):(e=n,0===Wt&&ee(ct)),e===n&&(92===t.charCodeAt(Ht)?(e="\\",Ht++):(e=n,0===Wt&&ee(nt)),e===n&&(e=Ht,98===t.charCodeAt(Ht)?(r="b",Ht++):(r=n,0===Wt&&ee(gt)),r!==n&&(qt=e,r="\b"),(e=r)===n&&(e=Ht,102===t.charCodeAt(Ht)?(r="f",Ht++):(r=n,0===Wt&&ee(yt)),r!==n&&(qt=e,r="\f"),(e=r)===n&&(e=Ht,110===t.charCodeAt(Ht)?(r="n",Ht++):(r=n,0===Wt&&ee(vt)),r!==n&&(qt=e,r="\n"),(e=r)===n&&(e=Ht,114===t.charCodeAt(Ht)?(r="r",Ht++):(r=n,0===Wt&&ee(At)),r!==n&&(qt=e,r="\r"),(e=r)===n&&(e=Ht,116===t.charCodeAt(Ht)?(r="t",Ht++):(r=n,0===Wt&&ee(Et)),r!==n&&(qt=e,r="\t"),(e=r)===n&&(e=Ht,118===t.charCodeAt(Ht)?(r="v",Ht++):(r=n,0===Wt&&ee(bt)),r!==n&&(qt=e,r="\v"),e=r)))))))),e}function Fe(){var e,r,o,u,a,i,s,c,l;return e=Ht,117===t.charCodeAt(Ht)?(r="u",Ht++):(r=n,0===Wt&&ee(Ct)),r!==n?(o=Ht,u=Ht,(a=Ie())!==n&&(i=Ie())!==n&&(s=Ie())!==n&&(c=Ie())!==n?u=a=[a,i,s,c]:(Ht=u,u=n),(o=u!==n?t.substring(o,Ht):u)!==n?(qt=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Ht=e,e=n)):(Ht=e,e=n),e}function Pe(){var e;return s.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee(xt)),e}function Ie(){var e;return c.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===Wt&&ee($t)),e}function ke(){var e,r,o,u;return Wt++,e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===Wt&&ee(b)),r!==n?(o=function(){var e,r;return e=Ht,r=function e(){var r,o,u,a,i,s;if(r=Ht,o=[],u=[],a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n),a!==n)for(;a!==n;)u.push(a),a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n);else u=n;for(u===n&&(u=Ht,123===t.charCodeAt(Ht)?(a="{",Ht++):(a=n,0===Wt&&ee(b)),a!==n?(i=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?u=a=[a,i,s]:(Ht=u,u=n)):(Ht=u,u=n));u!==n;){if(o.push(u),u=[],a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n),a!==n)for(;a!==n;)u.push(a),a=Ht,i=Ht,Wt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===Wt&&ee(Ft)),Wt--,s===n?i=void 0:(Ht=i,i=n),i!==n&&(s=pe())!==n?a=i=[i,s]:(Ht=a,a=n);else u=n;u===n&&(u=Ht,123===t.charCodeAt(Ht)?(a="{",Ht++):(a=n,0===Wt&&ee(b)),a!==n?(i=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===Wt&&ee(w)),s!==n?u=a=[a,i,s]:(Ht=u,u=n)):(Ht=u,u=n))}return t.substring(r,Ht)}(),qt=e,r=function(t){return[t,Kt()]}(r)}(),125===t.charCodeAt(Ht)?(u="}",Ht++):(u=n,0===Wt&&ee(w)),u!==n?e=o:(Ht=e,e=n)):(Ht=e,e=n),Wt--,e===n&&(r=n,0===Wt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=_e())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=_e())===n&&(e=de());return t}function Be(){var e,r,o,u;return e=Ht,r=Re(),59===t.charCodeAt(Ht)?(o=";",Ht++):(o=n,0===Wt&&ee(Ut)),o!==n?e=r=[r,o]:(Ht=e,e=n),e===n&&(e=Ht,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=me());e!==n;)t.push(e),(e=fe())===n&&(e=me());return t}(),(o=ge())===n&&(o=null),(u=_e())!==n?e=r=[r,o,u]:(Ht=e,e=n),e===n&&(e=Ht,r=Re(),(o=function(){var e,r;return e=Ht,Wt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=n,0===Wt&&ee(j)),Wt--,r===n?e=void 0:(Ht=e,e=n),e}())!==n?e=r=[r,o]:(Ht=e,e=n))),e}const De=e.reservedWords||[];if((r=a())!==n&&Ht===t.length)return r;throw r!==n&&Ht{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var a=o?Object.getOwnPropertyDescriptor(t,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=t[u]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(i[p]=f)}}catch(h){c.e(h)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},a),{},{name:i.remarks?_$base64_4.Base64.decode(i.remarks):a.server,"protocol-param":(0,_$utils_92.getIfNotBlank)(_$base64_4.Base64.decode(i.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_92.getIfNotBlank)(_$base64_4.Base64.decode(i.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={},u=___createForOfIteratorHelper_70(n);try{for(u.s();!(r=u.n()).done;){var a=r.value;if(-1!==a.indexOf("=")){var i=___slicedToArray_70(a.split("="),2),s=i[0],c=i[1];o[s.trim()]=c.trim()}}}catch(_){u.e(_)}finally{u.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_92.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_92.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_92.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_92.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_92.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_92.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_92.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),h={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_92.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_92.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(h.network="ws",h["ws-opts"]={path:(0,_$utils_92.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_92.getIfNotBlank)(f.host)}},h.tls&&f.host&&(h.sni=f.host)),h}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 u,a=!0,i=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw u}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$package_66={name:"sub-store",version:"2.13.0",description:"Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",main:"src/main.js",scripts:{preinstall:"npx only-allow pnpm",test:"gulp peggy && npx cross-env BABEL_ENV=test mocha src/test/**/*.spec.js --require @babel/register --recursive",serve:"node sub-store.min.js",start:"nodemon -w src -w package.json --exec babel-node src/main.js",build:"gulp"},author:"Peng-YM",license:"GPL-3.0",dependencies:{automerge:"1.0.1-preview.7","body-parser":"^1.19.0",express:"^4.17.1","js-base64":"^3.7.2",lodash:"^4.17.21",request:"^2.88.2",requests:"^0.3.0",semver:"^7.3.7","static-js-yaml":"^1.0.0",uuid:"^8.3.2"},devDependencies:{"@babel/core":"^7.18.0","@babel/node":"^7.17.10","@babel/preset-env":"^7.18.0","@babel/register":"^7.17.7","@types/gulp":"^4.0.9",axios:"^0.20.0","babel-plugin-relative-path-import":"^2.0.1",babelify:"^10.0.0","browser-pack-flat":"^3.4.2",browserify:"^17.0.0",chai:"^4.3.6",eslint:"^8.16.0",gulp:"^4.0.2","gulp-babel":"^8.0.0","gulp-eslint-new":"^1.4.4","gulp-file":"^0.4.0","gulp-header":"^2.0.9","gulp-prettier":"^4.0.0","gulp-tap":"^2.0.0",mocha:"^10.0.0",nodemon:"^2.0.16",peggy:"^2.0.1",prettier:"2.6.2","prettier-plugin-sort-imports":"^1.6.1",tinyify:"^3.0.0"}},_$resourceParserLoon_89={},_proxyUtils=_$proxyUtils_69({});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 Sub-Store -- v".concat(_$package_66.version,"\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"));var RESOURCE_TYPE_RULE=2,result=$resource;if(1===$resourceType){var proxies=_proxyUtils.ProxyUtils.parse($resource);result=_proxyUtils.ProxyUtils.produce(proxies,"Loon")}else if($resourceType===RESOURCE_TYPE_RULE){var rules=_$ruleUtils_85.RuleUtils.parse($resource);result=_$ruleUtils_85.RuleUtils.produce(rules,"Loon")}$done(result)}(); \ No newline at end of file diff --git a/backend/gulpfile.babel.js b/backend/gulpfile.babel.js index 01af0b3c3..d865f71c9 100644 --- a/backend/gulpfile.babel.js +++ b/backend/gulpfile.babel.js @@ -11,12 +11,11 @@ import tap from 'gulp-tap'; import pkg from './package.json'; export function peggy() { - return gulp.src('src/**/*.peg') - .pipe(tap(function (file) { - const filename = path.basename(file.path).split(".")[0] + ".js"; + return gulp.src('src/**/*.peg').pipe( + tap(function (file) { + const filename = path.basename(file.path).split('.')[0] + '.js'; const raw = fs.readFileSync(file.path, 'utf8'); - const contents = -`import * as peggy from 'peggy'; + const contents = `import * as peggy from 'peggy'; const grammars = String.raw\`\n${raw}\n\`; let parser; export default function getParser() { @@ -25,15 +24,17 @@ export default function getParser() { } return parser; }\n`; - return newFile(filename, contents) - .pipe(gulp.dest(path.dirname(file.path))) - })); + return newFile(filename, contents).pipe( + gulp.dest(path.dirname(file.path)), + ); + }), + ); } export function lint() { return gulp .src('src/**/*.js') - .pipe(eslint({fix: true})) + .pipe(eslint({ fix: true })) .pipe(eslint.fix()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); @@ -42,9 +43,14 @@ export function lint() { export function styles() { return gulp .src('src/**/*.js') - .pipe(prettier({ - singleQuote: true, trailingComma: 'all', tabWidth: 4, bracketSpacing: true - })) + .pipe( + prettier({ + singleQuote: true, + trailingComma: 'all', + tabWidth: 4, + bracketSpacing: true, + }), + ) .pipe(gulp.dest((file) => file.base)); } @@ -59,13 +65,13 @@ function scripts(src, dest) { { paths: [ { - 'rootPathPrefix': '@', - 'rootPathSuffix': 'src', - } - ] - } - ] - ] + rootPathPrefix: '@', + rootPathSuffix: 'src', + }, + ], + }, + ], + ], }) .plugin('tinyify') .bundle() @@ -74,20 +80,39 @@ function scripts(src, dest) { } function banner(dest) { - return () => gulp - .src(dest) - .pipe(header(fs.readFileSync('./banner', 'utf-8'), {pkg, updated: new Date().toLocaleString('zh-CN')})) - .pipe(gulp.dest((file) => file.base)); + return () => + gulp + .src(dest) + .pipe( + header(fs.readFileSync('./banner', 'utf-8'), { + pkg, + updated: new Date().toLocaleString('zh-CN'), + }), + ) + .pipe(gulp.dest((file) => file.base)); } const artifacts = [ - {src: 'src/main.js', dest: 'sub-store.min.js'}, - {src: 'src/products/resource-parser.loon.js', dest: 'dist/sub-store-parser.loon.min.js'}, - {src: 'src/products/cron-sync-artifacts.js', dest: 'dist/cron-sync-artifacts.min.js'} + { src: 'src/main.js', dest: 'sub-store.min.js' }, + { + src: 'src/products/resource-parser.loon.js', + dest: 'dist/sub-store-parser.loon.min.js', + }, + { + src: 'src/products/cron-sync-artifacts.js', + dest: 'dist/cron-sync-artifacts.min.js', + }, + { src: 'src/products/sub-store-0.js', dest: 'dist/sub-store-0.min.js' }, + { src: 'src/products/sub-store-1.js', dest: 'dist/sub-store-1.min.js' }, ]; -export const build = gulp.series(gulp.parallel(artifacts.map(artifact => scripts(artifact.src, artifact.dest))), gulp.parallel(artifacts.map(artifact => banner(artifact.dest)))); +export const build = gulp.series( + gulp.parallel( + artifacts.map((artifact) => scripts(artifact.src, artifact.dest)), + ), + gulp.parallel(artifacts.map((artifact) => banner(artifact.dest))), +); -const all = gulp.series(peggy, lint, styles, build) +const all = gulp.series(peggy, lint, styles, build); export default all; diff --git a/backend/package.json b/backend/package.json index 64385d5f3..d510418c2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.12.9", + "version": "2.13.0", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/products/cron-sync-artifacts.js b/backend/src/products/cron-sync-artifacts.js index f7a4526d2..d7c4474f7 100644 --- a/backend/src/products/cron-sync-artifacts.js +++ b/backend/src/products/cron-sync-artifacts.js @@ -1,7 +1,8 @@ -import { syncToGist, produceArtifact } from '@/restful/artifacts'; import { version } from '../../package.json'; import { SETTINGS_KEY, ARTIFACTS_KEY } from '@/constants'; import $ from '@/core/app'; +import { produceArtifact } from '@/restful/sync'; +import { syncToGist } from '@/restful/artifacts'; !(async function () { const settings = $.read(SETTINGS_KEY); diff --git a/backend/src/products/sub-store-0.js b/backend/src/products/sub-store-0.js new file mode 100644 index 000000000..21f6e4ecc --- /dev/null +++ b/backend/src/products/sub-store-0.js @@ -0,0 +1,39 @@ +/** + * 路由拆分 - 本文件只包含不涉及到解析器的 RESTFul API + */ + +import { version } from '../../package.json'; +console.log( + ` +┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ + Sub-Store -- v${version} +┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ +`, +); + +import migrate from '@/utils/migration'; +import express from '@/vendor/express'; +import $ from '@/core/app'; +import registerCollectionRoutes from '@/restful/collections'; +import registerSubscriptionRoutes from '@/restful/subscriptions'; +import registerArtifactRoutes from '@/restful/artifacts'; +import registerSettingRoutes from '@/restful/settings'; +import registerMiscRoutes from '@/restful/miscs'; +import registerSortRoutes from '@/restful/sort'; + +migrate(); +serve(); + +function serve() { + const $app = express({ substore: $ }); + + // register routes + registerCollectionRoutes($app); + registerSubscriptionRoutes($app); + registerArtifactRoutes($app); + registerSettingRoutes($app); + registerSortRoutes($app); + registerMiscRoutes($app); + + $app.start(); +} diff --git a/backend/src/products/sub-store-1.js b/backend/src/products/sub-store-1.js new file mode 100644 index 000000000..1a17b8ec8 --- /dev/null +++ b/backend/src/products/sub-store-1.js @@ -0,0 +1,39 @@ +/** + * 路由拆分 - 本文件仅包含使用到解析器的 RESTFul API + */ + +import { version } from '../../package.json'; +import migrate from '@/utils/migration'; +import express from '@/vendor/express'; +import $ from '@/core/app'; +import registerDownloadRoutes from '@/restful/download'; +import registerPreviewRoutes from '@/restful/preview'; +import registerSyncRoutes from '@/restful/sync'; +import registerNodeInfoRoutes from '@/restful/node-info'; + +console.log( + ` +┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ + Sub-Store -- v${version} +┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅ +`, +); + +migrate(); +serve(); + +function serve() { + const $app = express({ substore: $ }); + + // register routes + registerDownloadRoutes($app); + registerPreviewRoutes($app); + registerSyncRoutes($app); + registerNodeInfoRoutes($app); + + $app.options('/', (req, res) => { + res.status(200).end(); + }); + + $app.start(); +} diff --git a/backend/src/restful/artifacts.js b/backend/src/restful/artifacts.js index 88f9570db..2a8af9fce 100644 --- a/backend/src/restful/artifacts.js +++ b/backend/src/restful/artifacts.js @@ -1,15 +1,8 @@ -import { ProxyUtils } from '@/core/proxy-utils'; -import { RuleUtils } from '@/core/rule-utils'; -import download from '@/utils/download'; -import Gist from '@/utils/gist'; import $ from '@/core/app'; import { - SUBS_KEY, - ARTIFACTS_KEY, ARTIFACT_REPOSITORY_KEY, - COLLECTIONS_KEY, - RULES_KEY, + ARTIFACTS_KEY, SETTINGS_KEY, } from '@/constants'; import { deleteByName, findByName, updateByName } from '@/utils/database'; @@ -19,6 +12,7 @@ import { RequestInvalidError, ResourceNotFoundError, } from '@/restful/errors'; +import Gist from '@/utils/gist'; export default function register($app) { // Initialization @@ -31,10 +25,6 @@ export default function register($app) { .get(getArtifact) .patch(updateArtifact) .delete(deleteArtifact); - - // sync all artifacts - $app.get('/api/sync/artifacts', syncAllArtifacts); - $app.get('/api/sync/artifact/:name', syncArtifact); } function getAllArtifacts(req, res) { @@ -160,111 +150,8 @@ async function deleteArtifact(req, res) { } } -async function syncArtifact(req, res) { - let { name } = req.params; - name = decodeURIComponent(name); - const allArtifacts = $.read(ARTIFACTS_KEY); - const artifact = findByName(allArtifacts, name); - - if (!artifact) { - failed( - res, - new ResourceNotFoundError( - 'RESOURCE_NOT_FOUND', - `Artifact ${name} does not exist!`, - ), - 404, - ); - return; - } - - const output = await produceArtifact({ - type: artifact.type, - name: artifact.source, - platform: artifact.platform, - }); - - $.info( - `正在上传配置:${artifact.name}\n>>>${JSON.stringify( - artifact, - null, - 2, - )}`, - ); - try { - const resp = await syncToGist({ - [encodeURIComponent(artifact.name)]: { - content: output, - }, - }); - artifact.updated = new Date().getTime(); - const body = JSON.parse(resp.body); - artifact.url = body.files[ - encodeURIComponent(artifact.name) - ].raw_url.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1'); - $.write(allArtifacts, ARTIFACTS_KEY); - success(res, artifact); - } catch (err) { - failed( - res, - new InternalServerError( - `FAILED_TO_SYNC_ARTIFACT`, - `Failed to sync artifact ${name}`, - `Reason: ${err}`, - ), - ); - } -} - -async function syncAllArtifacts(_, res) { - $.info('开始同步所有远程配置...'); - const allArtifacts = $.read(ARTIFACTS_KEY); - const files = {}; - - try { - await Promise.all( - allArtifacts.map(async (artifact) => { - if (artifact.sync) { - $.info(`正在同步云配置:${artifact.name}...`); - const output = await produceArtifact({ - type: artifact.type, - name: artifact.source, - platform: artifact.platform, - }); - - files[artifact.name] = { - content: output, - }; - } - }), - ); - - const resp = await syncToGist(files); - const body = JSON.parse(resp.body); - - for (const artifact of allArtifacts) { - artifact.updated = new Date().getTime(); - // extract real url from gist - artifact.url = body.files[artifact.name].raw_url.replace( - /\/raw\/[^/]*\/(.*)/, - '/raw/$1', - ); - } - - $.write(allArtifacts, ARTIFACTS_KEY); - $.info('全部订阅同步成功!'); - success(res); - } catch (err) { - failed( - res, - new InternalServerError( - `FAILED_TO_SYNC_ARTIFACTS`, - `Failed to sync all artifacts`, - `Reason: ${err}`, - ), - ); - $.info(`同步订阅失败,原因:${err}`); - } +function validateArtifactName(name) { + return /^[a-zA-Z0-9._-]*$/.test(name); } async function syncToGist(files) { @@ -279,160 +166,4 @@ async function syncToGist(files) { return manager.upload(files); } -async function produceArtifact({ type, name, platform }) { - platform = platform || 'JSON'; - - // produce Clash node format for ShadowRocket - if (platform === 'ShadowRocket') platform = 'Clash'; - - if (type === 'subscription') { - const allSubs = $.read(SUBS_KEY); - const sub = findByName(allSubs, name); - let raw; - if (sub.source === 'local') { - raw = sub.content; - } else { - raw = await download(sub.url, sub.ua); - } - // parse proxies - let proxies = ProxyUtils.parse(raw); - // apply processors - proxies = await ProxyUtils.process( - proxies, - sub.process || [], - platform, - ); - // check duplicate - const exist = {}; - for (const proxy of proxies) { - if (exist[proxy.name]) { - $.notify( - '🌍 Sub-Store', - '⚠️ 订阅包含重复节点!', - '请仔细检测配置!', - { - 'media-url': - 'https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png', - }, - ); - break; - } - exist[proxy.name] = true; - } - // produce - return ProxyUtils.produce(proxies, platform); - } else if (type === 'collection') { - const allSubs = $.read(SUBS_KEY); - const allCols = $.read(COLLECTIONS_KEY); - const collection = findByName(allCols, name); - const subnames = collection.subscriptions; - const results = {}; - let processed = 0; - - await Promise.all( - subnames.map(async (name) => { - const sub = findByName(allSubs, name); - try { - $.info(`正在处理子订阅:${sub.name}...`); - let raw; - if (sub.source === 'local') { - raw = sub.content; - } else { - raw = await download(sub.url, sub.ua); - } - // parse proxies - let currentProxies = ProxyUtils.parse(raw); - // apply processors - currentProxies = await ProxyUtils.process( - currentProxies, - sub.process || [], - platform, - ); - results[name] = currentProxies; - processed++; - $.info( - `✅ 子订阅:${sub.name}加载成功,进度--${ - 100 * (processed / subnames.length).toFixed(1) - }% `, - ); - } catch (err) { - processed++; - $.error( - `❌ 处理组合订阅中的子订阅: ${ - sub.name - }时出现错误:${err},该订阅已被跳过!进度--${ - 100 * (processed / subnames.length).toFixed(1) - }%`, - ); - } - }), - ); - - // merge proxies with the original order - let proxies = Array.prototype.concat.apply( - [], - subnames.map((name) => results[name]), - ); - - // apply own processors - proxies = await ProxyUtils.process( - proxies, - collection.process || [], - platform, - ); - if (proxies.length === 0) { - throw new Error(`组合订阅中不含有效节点!`); - } - // check duplicate - const exist = {}; - for (const proxy of proxies) { - if (exist[proxy.name]) { - $.notify( - '🌍 Sub-Store', - '⚠️ 订阅包含重复节点!', - '请仔细检测配置!', - { - 'media-url': - 'https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png', - }, - ); - break; - } - exist[proxy.name] = true; - } - return ProxyUtils.produce(proxies, platform); - } else if (type === 'rule') { - const allRules = $.read(RULES_KEY); - const rule = findByName(allRules, name); - let rules = []; - for (let i = 0; i < rule.urls.length; i++) { - const url = rule.urls[i]; - $.info( - `正在处理URL:${url},进度--${ - 100 * ((i + 1) / rule.urls.length).toFixed(1) - }% `, - ); - try { - const { body } = await download(url); - const currentRules = RuleUtils.parse(body); - rules = rules.concat(currentRules); - } catch (err) { - $.error( - `处理分流订阅中的URL: ${url}时出现错误:${err}! 该订阅已被跳过。`, - ); - } - } - // remove duplicates - rules = await RuleUtils.process(rules, [ - { type: 'Remove Duplicate Filter' }, - ]); - // produce output - return RuleUtils.produce(rules, platform); - } -} - -function validateArtifactName(name) { - return /^[a-zA-Z0-9._-]*$/.test(name); -} - -export { syncToGist, produceArtifact }; +export { syncToGist }; diff --git a/backend/src/restful/download.js b/backend/src/restful/download.js index 65163803f..a369084c9 100644 --- a/backend/src/restful/download.js +++ b/backend/src/restful/download.js @@ -2,10 +2,10 @@ import { getPlatformFromHeaders } from '@/utils/platform'; import { COLLECTIONS_KEY, SUBS_KEY } from '@/constants'; import { findByName } from '@/utils/database'; import { getFlowHeaders } from '@/utils/flow'; -import { produceArtifact } from './artifacts'; import $ from '@/core/app'; import { failed } from '@/restful/response'; import { InternalServerError, ResourceNotFoundError } from '@/restful/errors'; +import { produceArtifact } from '@/restful/sync'; export default function register($app) { $app.get('/download/collection/:name', downloadCollection); diff --git a/backend/src/restful/index.js b/backend/src/restful/index.js index 273882240..88fdabfb7 100644 --- a/backend/src/restful/index.js +++ b/backend/src/restful/index.js @@ -1,33 +1,16 @@ -import { - SETTINGS_KEY, - GIST_BACKUP_KEY, - GIST_BACKUP_FILE_NAME, -} from '@/constants'; -import { version as substoreVersion } from '../../package.json'; -import { ENV, HTTP } from '@/vendor/open-api'; import express from '@/vendor/express'; -import Gist from '@/utils/gist'; -import migrate from '@/utils/migration'; import $ from '@/core/app'; import registerSubscriptionRoutes from './subscriptions'; import registerCollectionRoutes from './collections'; import registerArtifactRoutes from './artifacts'; +import registerSyncRoutes from './sync'; import registerDownloadRoutes from './download'; -import registerSettingRoutes, { - updateArtifactStore, - updateGitHubAvatar, -} from './settings'; +import registerSettingRoutes from './settings'; import registerPreviewRoutes from './preview'; import registerSortingRoutes from './sort'; -import { failed, success } from '@/restful/response'; -import { - InternalServerError, - NetworkError, - RequestInvalidError, -} from '@/restful/errors'; -import resourceCache from '@/utils/resource-cache'; -import producer from '@/core/proxy-utils/producers'; +import registerMiscRoutes from './miscs'; +import registerNodeInfoRoutes from './node-info'; export default function serve() { const $app = express({ substore: $ }); @@ -40,183 +23,9 @@ export default function serve() { registerSortingRoutes($app); registerSettingRoutes($app); registerArtifactRoutes($app); - - // utils - $app.post('/api/utils/node-info', getNodeInfo); - $app.get('/api/utils/env', getEnv); // get runtime environment - $app.get('/api/utils/backup', gistBackup); // gist backup actions - $app.get('/api/utils/refresh', refresh); - - // Storage management - $app.route('/api/storage') - .get((req, res) => { - res.json($.read('#sub-store')); - }) - .post((req, res) => { - const data = req.body; - $.write(JSON.stringify(data), '#sub-store'); - res.end(); - }); - - // Redirect sub.store to vercel webpage - $app.get('/', async (req, res) => { - // 302 redirect - res.set('location', 'https://sub-store.vercel.app/').status(302).end(); - }); - - // handle preflight request for QX - if (ENV().isQX) { - $app.options('/', async (req, res) => { - res.status(200).end(); - }); - } - - $app.all('/', (_, res) => { - res.send('Hello from sub-store, made with ❤️ by Peng-YM'); - }); + registerSyncRoutes($app); + registerNodeInfoRoutes($app); + registerMiscRoutes($app); $app.start(); } - -function getEnv(req, res) { - const { isNode, isQX, isLoon, isSurge, isStash, isShadowRocket } = ENV(); - let backend = 'Node'; - if (isNode) backend = 'Node'; - if (isQX) backend = 'QX'; - if (isLoon) backend = 'Loon'; - if (isSurge) backend = 'Surge'; - if (isStash) backend = 'Stash'; - if (isShadowRocket) backend = 'ShadowRocket'; - - success(res, { - backend, - version: substoreVersion, - }); -} - -async function refresh(_, res) { - // 1. get GitHub avatar and artifact store - await updateGitHubAvatar(); - await updateArtifactStore(); - - // 2. clear resource cache - resourceCache.revokeAll(); - success(res); -} - -async function gistBackup(req, res) { - const { action } = req.query; - // read token - const { gistToken } = $.read(SETTINGS_KEY); - if (!gistToken) { - failed( - res, - new RequestInvalidError( - 'GIST_TOKEN_NOT_FOUND', - `GitHub Token is required for backup!`, - ), - ); - } else { - const gist = new Gist({ - token: gistToken, - key: GIST_BACKUP_KEY, - }); - try { - let content; - const settings = $.read(SETTINGS_KEY); - const updated = settings.syncTime; - switch (action) { - case 'upload': - // update syncTime - settings.syncTime = new Date().getTime(); - $.write(settings, SETTINGS_KEY); - content = $.read('#sub-store'); - if ($.env.isNode) - content = JSON.stringify($.cache, null, ` `); - $.info(`上传备份中...`); - try { - await gist.upload({ - [GIST_BACKUP_FILE_NAME]: { content }, - }); - } catch (err) { - // restore syncTime if upload failed - settings.syncTime = updated; - $.write(settings, SETTINGS_KEY); - throw err; - } - break; - case 'download': - $.info(`还原备份中...`); - content = await gist.download(GIST_BACKUP_FILE_NAME); - // restore settings - $.write(content, '#sub-store'); - if ($.env.isNode) { - content = JSON.parse(content); - $.cache = content; - $.persistCache(); - } - // perform migration after restoring from gist - migrate(); - break; - } - success(res); - } catch (err) { - failed( - res, - new InternalServerError( - 'BACKUP_FAILED', - `Failed to ${action} data to gist!`, - `Reason: ${JSON.stringify(err)}`, - ), - ); - } - } -} - -async function getNodeInfo(req, res) { - const proxy = req.body; - const lang = req.query.lang || 'zh-CN'; - let shareUrl; - try { - shareUrl = producer.URI.produce(proxy); - } catch (err) { - // do nothing - } - - try { - const $http = HTTP(); - const info = await $http - .get({ - url: `http://ip-api.com/json/${encodeURIComponent( - proxy.server, - )}?lang=${lang}`, - headers: { - 'User-Agent': - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15', - }, - }) - .then((resp) => { - const data = JSON.parse(resp.body); - if (data.status !== 'success') { - throw new Error(data.message); - } - - // remove unnecessary fields - delete data.status; - return data; - }); - success(res, { - shareUrl, - info, - }); - } catch (err) { - failed( - res, - new NetworkError( - 'FAILED_TO_GET_NODE_INFO', - `Failed to get node info`, - `Reason: ${err}`, - ), - ); - } -} diff --git a/backend/src/restful/miscs.js b/backend/src/restful/miscs.js new file mode 100644 index 000000000..b03e146aa --- /dev/null +++ b/backend/src/restful/miscs.js @@ -0,0 +1,144 @@ +import $ from '@/core/app'; +import { ENV } from '@/vendor/open-api'; +import { failed, success } from '@/restful/response'; +import { version as substoreVersion } from '../../package.json'; +import { updateArtifactStore, updateGitHubAvatar } from '@/restful/settings'; +import resourceCache from '@/utils/resource-cache'; +import { + GIST_BACKUP_FILE_NAME, + GIST_BACKUP_KEY, + SETTINGS_KEY, +} from '@/constants'; +import { InternalServerError, RequestInvalidError } from '@/restful/errors'; +import Gist from '@/utils/gist'; +import migrate from '@/utils/migration'; + +export default function register($app) { + // utils + $app.get('/api/utils/env', getEnv); // get runtime environment + $app.get('/api/utils/backup', gistBackup); // gist backup actions + $app.get('/api/utils/refresh', refresh); + + // Storage management + $app.route('/api/storage') + .get((req, res) => { + res.json($.read('#sub-store')); + }) + .post((req, res) => { + const data = req.body; + $.write(JSON.stringify(data), '#sub-store'); + res.end(); + }); + + // Redirect sub.store to vercel webpage + $app.get('/', async (req, res) => { + // 302 redirect + res.set('location', 'https://sub-store.vercel.app/').status(302).end(); + }); + + // handle preflight request for QX + if (ENV().isQX) { + $app.options('/', async (req, res) => { + res.status(200).end(); + }); + } + + $app.all('/', (_, res) => { + res.send('Hello from sub-store, made with ❤️ by Peng-YM'); + }); +} + +function getEnv(req, res) { + const { isNode, isQX, isLoon, isSurge, isStash, isShadowRocket } = ENV(); + let backend = 'Node'; + if (isNode) backend = 'Node'; + if (isQX) backend = 'QX'; + if (isLoon) backend = 'Loon'; + if (isSurge) backend = 'Surge'; + if (isStash) backend = 'Stash'; + if (isShadowRocket) backend = 'ShadowRocket'; + + success(res, { + backend, + version: substoreVersion, + }); +} + +async function refresh(_, res) { + // 1. get GitHub avatar and artifact store + await updateGitHubAvatar(); + await updateArtifactStore(); + + // 2. clear resource cache + resourceCache.revokeAll(); + success(res); +} + +async function gistBackup(req, res) { + const { action } = req.query; + // read token + const { gistToken } = $.read(SETTINGS_KEY); + if (!gistToken) { + failed( + res, + new RequestInvalidError( + 'GIST_TOKEN_NOT_FOUND', + `GitHub Token is required for backup!`, + ), + ); + } else { + const gist = new Gist({ + token: gistToken, + key: GIST_BACKUP_KEY, + }); + try { + let content; + const settings = $.read(SETTINGS_KEY); + const updated = settings.syncTime; + switch (action) { + case 'upload': + // update syncTime + settings.syncTime = new Date().getTime(); + $.write(settings, SETTINGS_KEY); + content = $.read('#sub-store'); + if ($.env.isNode) + content = JSON.stringify($.cache, null, ` `); + $.info(`上传备份中...`); + try { + await gist.upload({ + [GIST_BACKUP_FILE_NAME]: { content }, + }); + } catch (err) { + // restore syncTime if upload failed + settings.syncTime = updated; + $.write(settings, SETTINGS_KEY); + throw err; + } + break; + case 'download': + $.info(`还原备份中...`); + content = await gist.download(GIST_BACKUP_FILE_NAME); + // restore settings + $.write(content, '#sub-store'); + if ($.env.isNode) { + content = JSON.parse(content); + $.cache = content; + $.persistCache(); + } + // perform migration after restoring from gist + migrate(); + break; + } + success(res); + } catch (err) { + failed( + res, + new InternalServerError( + 'BACKUP_FAILED', + `Failed to ${action} data to gist!`, + `Reason: ${JSON.stringify(err)}`, + ), + ); + } + } +} diff --git a/backend/src/restful/node-info.js b/backend/src/restful/node-info.js new file mode 100644 index 000000000..5b9a89012 --- /dev/null +++ b/backend/src/restful/node-info.js @@ -0,0 +1,56 @@ +import producer from '@/core/proxy-utils/producers'; +import { HTTP } from '@/vendor/open-api'; +import { failed, success } from '@/restful/response'; +import { NetworkError } from '@/restful/errors'; + +export default function register($app) { + $app.post('/api/utils/node-info', getNodeInfo); +} + +async function getNodeInfo(req, res) { + const proxy = req.body; + const lang = req.query.lang || 'zh-CN'; + let shareUrl; + try { + shareUrl = producer.URI.produce(proxy); + } catch (err) { + // do nothing + } + + try { + const $http = HTTP(); + const info = await $http + .get({ + url: `http://ip-api.com/json/${encodeURIComponent( + proxy.server, + )}?lang=${lang}`, + headers: { + 'User-Agent': + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15', + }, + }) + .then((resp) => { + const data = JSON.parse(resp.body); + if (data.status !== 'success') { + throw new Error(data.message); + } + + // remove unnecessary fields + delete data.status; + return data; + }); + success(res, { + shareUrl, + info, + }); + } catch (err) { + failed( + res, + new NetworkError( + 'FAILED_TO_GET_NODE_INFO', + `Failed to get node info`, + `Reason: ${err}`, + ), + ); + } +} diff --git a/backend/src/restful/preview.js b/backend/src/restful/preview.js index ff45fa579..2c6f4e280 100644 --- a/backend/src/restful/preview.js +++ b/backend/src/restful/preview.js @@ -92,7 +92,7 @@ async function compareCollection(req, res) { // merge proxies with the original order const original = Array.prototype.concat.apply( [], - subnames.map((name) => results[name]), + subnames.map((name) => results[name] || []), ); original.forEach((proxy, i) => { diff --git a/backend/src/restful/sync.js b/backend/src/restful/sync.js new file mode 100644 index 000000000..d4a7e0628 --- /dev/null +++ b/backend/src/restful/sync.js @@ -0,0 +1,284 @@ +import $ from '@/core/app'; +import { + ARTIFACTS_KEY, + COLLECTIONS_KEY, + RULES_KEY, + SUBS_KEY, +} from '@/constants'; +import { failed, success } from '@/restful/response'; +import { InternalServerError, ResourceNotFoundError } from '@/restful/errors'; +import { findByName } from '@/utils/database'; +import download from '@/utils/download'; +import { ProxyUtils } from '@/core/proxy-utils'; +import { RuleUtils } from '@/core/rule-utils'; +import { syncToGist } from '@/restful/artifacts'; + +export default function register($app) { + // Initialization + if (!$.read(ARTIFACTS_KEY)) $.write({}, ARTIFACTS_KEY); + + // sync all artifacts + $app.get('/api/sync/artifacts', syncAllArtifacts); + $app.get('/api/sync/artifact/:name', syncArtifact); +} + +async function produceArtifact({ type, name, platform }) { + platform = platform || 'JSON'; + + // produce Clash node format for ShadowRocket + if (platform === 'ShadowRocket') platform = 'Clash'; + + if (type === 'subscription') { + const allSubs = $.read(SUBS_KEY); + const sub = findByName(allSubs, name); + let raw; + if (sub.source === 'local') { + raw = sub.content; + } else { + raw = await download(sub.url, sub.ua); + } + // parse proxies + let proxies = ProxyUtils.parse(raw); + // apply processors + proxies = await ProxyUtils.process( + proxies, + sub.process || [], + platform, + ); + // check duplicate + const exist = {}; + for (const proxy of proxies) { + if (exist[proxy.name]) { + $.notify( + '🌍 Sub-Store', + '⚠️ 订阅包含重复节点!', + '请仔细检测配置!', + { + 'media-url': + 'https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png', + }, + ); + break; + } + exist[proxy.name] = true; + } + // produce + return ProxyUtils.produce(proxies, platform); + } else if (type === 'collection') { + const allSubs = $.read(SUBS_KEY); + const allCols = $.read(COLLECTIONS_KEY); + const collection = findByName(allCols, name); + const subnames = collection.subscriptions; + const results = {}; + let processed = 0; + + await Promise.all( + subnames.map(async (name) => { + const sub = findByName(allSubs, name); + try { + $.info(`正在处理子订阅:${sub.name}...`); + let raw; + if (sub.source === 'local') { + raw = sub.content; + } else { + raw = await download(sub.url, sub.ua); + } + // parse proxies + let currentProxies = ProxyUtils.parse(raw); + // apply processors + currentProxies = await ProxyUtils.process( + currentProxies, + sub.process || [], + platform, + ); + results[name] = currentProxies; + processed++; + $.info( + `✅ 子订阅:${sub.name}加载成功,进度--${ + 100 * (processed / subnames.length).toFixed(1) + }% `, + ); + } catch (err) { + processed++; + $.error( + `❌ 处理组合订阅中的子订阅: ${ + sub.name + }时出现错误:${err},该订阅已被跳过!进度--${ + 100 * (processed / subnames.length).toFixed(1) + }%`, + ); + } + }), + ); + + // merge proxies with the original order + let proxies = Array.prototype.concat.apply( + [], + subnames.map((name) => results[name]), + ); + + // apply own processors + proxies = await ProxyUtils.process( + proxies, + collection.process || [], + platform, + ); + if (proxies.length === 0) { + throw new Error(`组合订阅中不含有效节点!`); + } + // check duplicate + const exist = {}; + for (const proxy of proxies) { + if (exist[proxy.name]) { + $.notify( + '🌍 Sub-Store', + '⚠️ 订阅包含重复节点!', + '请仔细检测配置!', + { + 'media-url': + 'https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png', + }, + ); + break; + } + exist[proxy.name] = true; + } + return ProxyUtils.produce(proxies, platform); + } else if (type === 'rule') { + const allRules = $.read(RULES_KEY); + const rule = findByName(allRules, name); + let rules = []; + for (let i = 0; i < rule.urls.length; i++) { + const url = rule.urls[i]; + $.info( + `正在处理URL:${url},进度--${ + 100 * ((i + 1) / rule.urls.length).toFixed(1) + }% `, + ); + try { + const { body } = await download(url); + const currentRules = RuleUtils.parse(body); + rules = rules.concat(currentRules); + } catch (err) { + $.error( + `处理分流订阅中的URL: ${url}时出现错误:${err}! 该订阅已被跳过。`, + ); + } + } + // remove duplicates + rules = await RuleUtils.process(rules, [ + { type: 'Remove Duplicate Filter' }, + ]); + // produce output + return RuleUtils.produce(rules, platform); + } +} + +async function syncAllArtifacts(_, res) { + $.info('开始同步所有远程配置...'); + const allArtifacts = $.read(ARTIFACTS_KEY); + const files = {}; + + try { + await Promise.all( + allArtifacts.map(async (artifact) => { + if (artifact.sync) { + $.info(`正在同步云配置:${artifact.name}...`); + const output = await produceArtifact({ + type: artifact.type, + name: artifact.source, + platform: artifact.platform, + }); + + files[artifact.name] = { + content: output, + }; + } + }), + ); + + const resp = await syncToGist(files); + const body = JSON.parse(resp.body); + + for (const artifact of allArtifacts) { + artifact.updated = new Date().getTime(); + // extract real url from gist + artifact.url = body.files[artifact.name].raw_url.replace( + /\/raw\/[^/]*\/(.*)/, + '/raw/$1', + ); + } + + $.write(allArtifacts, ARTIFACTS_KEY); + $.info('全部订阅同步成功!'); + success(res); + } catch (err) { + failed( + res, + new InternalServerError( + `FAILED_TO_SYNC_ARTIFACTS`, + `Failed to sync all artifacts`, + `Reason: ${err}`, + ), + ); + $.info(`同步订阅失败,原因:${err}`); + } +} + +async function syncArtifact(req, res) { + let { name } = req.params; + name = decodeURIComponent(name); + const allArtifacts = $.read(ARTIFACTS_KEY); + const artifact = findByName(allArtifacts, name); + + if (!artifact) { + failed( + res, + new ResourceNotFoundError( + 'RESOURCE_NOT_FOUND', + `Artifact ${name} does not exist!`, + ), + 404, + ); + return; + } + + const output = await produceArtifact({ + type: artifact.type, + name: artifact.source, + platform: artifact.platform, + }); + + $.info( + `正在上传配置:${artifact.name}\n>>>${JSON.stringify( + artifact, + null, + 2, + )}`, + ); + try { + const resp = await syncToGist({ + [encodeURIComponent(artifact.name)]: { + content: output, + }, + }); + artifact.updated = new Date().getTime(); + const body = JSON.parse(resp.body); + artifact.url = body.files[ + encodeURIComponent(artifact.name) + ].raw_url.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1'); + $.write(allArtifacts, ARTIFACTS_KEY); + success(res, artifact); + } catch (err) { + failed( + res, + new InternalServerError( + `FAILED_TO_SYNC_ARTIFACT`, + `Failed to sync artifact ${name}`, + `Reason: ${err}`, + ), + ); + } +} + +export { produceArtifact }; diff --git a/backend/sub-store.min.js b/backend/sub-store.min.js index ef50d1f2c..51bd35969 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/9/9 21:06:45 - * @version: 2.12.9 + * @updated: 2022/9/9 23:06:30 + * @version: 2.13.0 * @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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_101),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),a=c(_$preprocessors_75),i=c(_$producers_78),u=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function _(){}function h(){}function d(){}var y={};s(y,a,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var g=d.prototype=_.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||h(t,e)||function(){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 _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function h(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],a=x.length>2?x[2]:void 0,i=_(r),t.prev=3,i.s();case 5:if((u=i.n()).done){t.next=39;break}if(c=u.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(h=c.args,d=h.mode,y=h.content,"link"!==d){t.next=27;break}if((m=(v=y).split("#")).length>1){g=_(m[1].split("&"));try{for(g.s();!(b=g.n()).done;)A=b.value,E=A.split("=")[0],w=A.split("=")[1]||!0,f[E]=w}catch(l){g.e(l)}finally{g.f()}}return t.prev=15,t.next=18,(0,n.default)(v.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=y;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,a,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),i.e(t.t1);case 44:return t.prev=44,i.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(y=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){p(a,n,o,i,u,"next",t)}function u(t){p(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var v={parse:function(t){t=function(t){var e,r=_(a.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.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,n=[],o=_(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value;if(0!==(i=i.trim()).length){var c=!1;if(e){var l=f(m(e,i),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var h,d=_(u.default);try{for(d.s();!(h=d.n()).done;){var y=h.value,v=f(m(y,i),2),g=v[0];if(!v[1]){n.push(g),e=y,c=!0,s.default.info("".concat(y.name," is activated"));break}}}catch(b){d.e(b)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(i))}}}catch(b){o.e(b)}finally{o.f()}return n},process:function(t){return y.apply(this,arguments)},produce:function(t,e){var r=i.default[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])})),s.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 s.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}};function m(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=v})),_$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 a(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|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(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(I(e,ArrayBuffer)||e&&I(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(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 a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(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(a)return o?-1:L(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),T(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var a,i=1,u=t.length,s=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;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(a=r;au&&(r=u-s),a=r;a>=0;a--){for(var p=!0,f=0;fo&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function m(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=t[o+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=b)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 w(this,e,r);case"utf8":case"utf-8":return g(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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,a){if(I(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===a&&(a=this.length),e<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(o>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(i,u),c=this.slice(o,a),l=t.slice(e,n),p=0;p>>=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 a=!1;;)switch(n){case"hex":return f(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 v(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,n,o,a,i){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function $(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||$(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||$(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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);S(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a>0)-u&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);S(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return P(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;--i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return a},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 a=t.charCodeAt(0);("utf8"===o&&a<128||"latin1"===o)&&(t=a)}}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(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.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;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function T(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return k.apply(this,arguments)},e.default=void 0;var n=u(_$resourceCache_109),o=u(_$lodash_35),a=u(_$app_68),i=_$proxyUtils_69({});function u(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=E(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function _(){}function h(){}function d(){}var y={};c(y,a,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var g=d.prototype=_.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function E(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,E(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){c(a,n,o,i,u,"next",t)}function u(t){c(a,n,o,i,u,"throw",t)}i(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function f(t,e){if(t){if("string"==typeof t)return _(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)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return S(t)})),e.sort((function(e,r){var n=v(t,e.name),o=v(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=i[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){asyncGeneratorStep(a,n,o,i,u,"next",t)}function u(t){asyncGeneratorStep(a,n,o,i,u,"throw",t)}i(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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],a=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(a?"\n\u591a\u5a92\u4f53:"+a:""),{url:o}),isLoon){var i={};o&&(i.openUrl=o),a&&(i.mediaUrl=a),"{}"===JSON.stringify(i)?$notification.post(t,e,r):$notification.post(t,e,r,i)}if(isNode){var u=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(a?"\n\u591a\u5a92\u4f53: ".concat(a):"");console.log("".concat(t,"\n").concat(e,"\n").concat(u,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_112.OpenAPI=OpenAPI;var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_112.OpenAPI("sub-store");_$app_68.default=_default;var _$migration_107={};Object.defineProperty(_$migration_107,"__esModule",{value:!0}),_$migration_107.default=function(){var t;(t=_app.default.read(_$constants_67.SCHEMA_VERSION_KEY))||function(){_app.default.info("Start migrating...");var t=_app.default.read(_$constants_67.SUBS_KEY)||{},e=Object.values(t).map((function(t){return t.source=t.source||"remote",s(t),c(t),t}));_app.default.write(e,_$constants_67.SUBS_KEY);var r=_app.default.read(_$constants_67.COLLECTIONS_KEY)||{},n=Object.values(r).map((function(t){return delete t.ua,s(t),c(t),t}));_app.default.write(n,_$constants_67.COLLECTIONS_KEY);var o=_app.default.read(_$constants_67.ARTIFACTS_KEY)||{},a=Object.values(o);_app.default.write(a,_$constants_67.ARTIFACTS_KEY);var i=_app.default.read(_$constants_67.RULES_KEY)||{},u=Object.values(i);function s(t){var e=t["display-name"];e&&(t.displayName=e,delete t["display-name"])}function c(t){var e=t.process;if(e&&0!==e.length){var r,n=[],o={type:"Quick Setting Operator",args:{udp:"DEFAULT",tfo:"DEFAULT",scert:"DEFAULT","vmess aead":"DEFAULT",useless:"DEFAULT"}},a=function(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))){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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i.type)if("Useless Filter"===i.type)o.args.useless="ENABLED";else if("Set Property Operator"===i.type){var u=i.args,s=u.key,c=u.value;switch(s){case"udp":o.args.udp=c?"ENABLED":"DISABLED";break;case"tfo":o.args.tfo=c?"ENABLED":"DISABLED";break;case"skip-cert-verify":o.args.scert=c?"ENABLED":"DISABLED";break;case"aead":o.args["vmess aead"]=c?"ENABLED":"DISABLED"}}else if(-1!==i.type.indexOf("Keyword"));else if("Flag Operator"===i.type){var l=void 0===i.args||i.args;i.args={mode:l?"add":"remove"},n.push(i)}else n.push(i)}}catch(p){a.e(p)}finally{a.f()}n.unshift(o),t.process=n}}_app.default.write(u,_$constants_67.RULES_KEY),delete _app.default.cache.builtin,_app.default.info("Migration complete!")}(),"2.0"!==t&&_app.default.write("2.0",_$constants_67.SCHEMA_VERSION_KEY)};var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,n=e.method,o=e.url,a=e.headers,i=e.body;a=formatHeaders(a),/json/i.test(a["content-type"])&&(i=JSON.parse(i)),n=n.toUpperCase();var u,s=extractURL(o),c=s.path,l=s.query,p=null,f=0;for(u=r;uf&&(p=handlers[u],f=_.split("/").length)}if(p){var h=function(){t(n,o,u)},d={method:n,url:o,path:c,query:l,params:extractPathParams(p.pattern,c),headers:a,body:i},y=Response(),v=p.callback,m=function(t){y.status(500).json({status:"failed",message:"Internal Server Error: ".concat(t)})};if("AsyncFunction"===v.constructor.name)v(d,y,h).catch(m);else try{v(d,y,h)}catch(g){m(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_112.ENV)(),r=e.isQX,n=e.isLoon,o=e.isSurge,a=DEFAULT_HEADERS,i={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_110(this,e)}return ___createClass_110(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]:"",u={status:r?i[t]:t,body:e,headers:a};r?$done(u):(n||o)&&$done({response:u})}},{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 a[t]=e,this}}]),e}())}}function formatHeaders(t){for(var e={},r=0,n=Object.keys(t);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(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_104(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_104(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_104(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_102(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _getFlowHeaders(){var t;return t=___regeneratorRuntime_102().mark((function t(e){var r,n,o,a;return ___regeneratorRuntime_102().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,_$openApi_112.HTTP)(),t.next=3,r.get({url:e,headers:{"User-Agent":"Quantumult%20X/1.0.30 (iPhone14,2; iOS 15.6)"}});case 3:return n=t.sent,o=n.headers,a=Object.keys(o).filter((function(t){return/SUBSCRIPTION-USERINFO/i.test(t)}))[0],t.abrupt("return",o[a]);case 7:case"end":return t.stop()}}),t)})),(_getFlowHeaders=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_102(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_102(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}Object.defineProperty(_$flow_102,"__esModule",{value:!0}),_$flow_102.getFlowHeaders=function(t){return _getFlowHeaders.apply(this,arguments)};var _$response_96={};Object.defineProperty(_$response_96,"__esModule",{value:!0}),_$response_96.failed=function(t,e,r){t.status(r||500).json({status:"failed",error:{code:e.code,type:e.type,message:e.message,details:e.details}})},_$response_96.success=function(t,e,r){t.status(r||200).json({status:"success",data:e})};var _$subscriptions_99={};function ___typeof_99(t){return(___typeof_99="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(_$subscriptions_99,"__esModule",{value:!0}),_$subscriptions_99.default=function(t){t.get("/api/sub/flow/:name",getFlowInfo),t.route("/api/sub/:name").get(getSubscription).patch(updateSubscription).delete(deleteSubscription),t.route("/api/subs").get(getAllSubscriptions).post(createSubscription)};var __obj_99,___app_99=(__obj_99=_$app_68)&&__obj_99.__esModule?__obj_99:{default:__obj_99};function ___regeneratorRuntime_99(){___regeneratorRuntime_99=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_99(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_99(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_99(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_99(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_99(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_91(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),a=0;a<16;a++)n[a]=909522486^r[a],o[a]=1549556828^r[a];var i=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(i),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return e}function rstr2any(t,e){var r,n,o,a,i,u=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(i[i.length]=o);l[n]=a,s=i}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i>>32-u,r);var i,u}function md5_ff(t,e,r,n,o,a,i){return md5_cmn(e&r|~e&n,t,e,o,a,i)}function md5_gg(t,e,r,n,o,a,i){return md5_cmn(e&n|r&~n,t,e,o,a,i)}function md5_hh(t,e,r,n,o,a,i){return md5_cmn(e^r^n,t,e,o,a,i)}function md5_ii(t,e,r,n,o,a,i){return md5_cmn(r^(e|~n),t,e,o,a,i)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$resourceCache_109={};Object.defineProperty(_$resourceCache_109,"__esModule",{value:!0}),_$resourceCache_109.default=void 0;var __obj_109,___app_109=(__obj_109=_$app_68)&&__obj_109.__esModule?__obj_109:{default:__obj_109};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_109(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_109(t,e):void 0}}(t,e)||function(){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 ___arrayLikeToArray_109(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(___app_109.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){___app_109.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){___app_109.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?___app_109.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),___app_109.default.write(e,"#".concat(t))}}])&&___defineProperties_109(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_109.default=___default_109;var _$download_101={};Object.defineProperty(_$download_101,"__esModule",{value:!0}),_$download_101.default=function(t,e){return _download.apply(this,arguments)};var __obj_101,_resourceCache=(__obj_101=_$resourceCache_109)&&__obj_101.__esModule?__obj_101:{default:__obj_101};function ___typeof_101(t){return(___typeof_101="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_101(){___regeneratorRuntime_101=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_101(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_101(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_101().mark((function t(e,r){var n,o,a;return ___regeneratorRuntime_101().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_111.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_112.HTTP)({headers:{"User-Agent":r}}),a=new Promise((function(t,r){var a=_resourceCache.default.get(n);a?t(a):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,a),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_101(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_101(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$utils_105={};Object.defineProperty(_$utils_105,"__esModule",{value:!0}),_$utils_105.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_105.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_105.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_105.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_105.isNotBlank=isNotBlank,_$utils_105.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_106={};function ___arrayLikeToArray_106(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,I=RegExp(k.source),T=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,N=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,G=RegExp(H.source),q=/^\s+/,Y=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,z=/\{\n\/\* \[wrapped with (.+)\] \*/,W=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Z=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,at=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,it=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",_t="[a-z\\xdf-\\xf6\\xf8-\\xff]",ht="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",yt="[^\\ud800-\\udfff]",vt="(?:\\ud83c[\\udde6-\\uddff]){2}",mt="[\\ud800-\\udbff][\\udc00-\\udfff]",gt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",bt="(?:"+_t+"|"+ht+")",At="(?:"+gt+"|"+ht+")",Et="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+Et+"(?:\\u200d(?:"+[yt,vt,mt].join("|")+")[\\ufe0e\\ufe0f]?"+Et+")*",Ct="(?:"+["[\\u2700-\\u27bf]",vt,mt].join("|")+")"+wt,xt="(?:"+[yt+pt+"?",pt,vt,mt,"[\\ud800-\\udfff]"].join("|")+")",St=RegExp("['\u2019]","g"),$t=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Pt=RegExp([gt+"?"+_t+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,gt,"$"].join("|")+")",At+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,gt+bt,"$"].join("|")+")",gt+"?"+bt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",gt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Ft=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,It={};It[A]=It[E]=It[w]=It[C]=It[x]=It[S]=It["[object Uint8ClampedArray]"]=It[$]=It[O]=!0,It[o]=It[a]=It[g]=It[i]=It[b]=It[u]=It[s]=It[c]=It[p]=It[f]=It[_]=It[h]=It[d]=It[y]=It[m]=!1;var Tt={};Tt[o]=Tt[a]=Tt[g]=Tt[b]=Tt[i]=Tt[u]=Tt[A]=Tt[E]=Tt[w]=Tt[C]=Tt[x]=Tt[p]=Tt[f]=Tt[_]=Tt[h]=Tt[d]=Tt[y]=Tt[v]=Tt[S]=Tt["[object Uint8ClampedArray]"]=Tt[$]=Tt[O]=!0,Tt[s]=Tt[c]=Tt[m]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Nt=parseFloat,Dt=parseInt,Bt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Bt||Mt||Function("return this")(),Ht="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,Gt=Ht&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,qt=Gt&&Gt.exports===Ht,Yt=qt&&Bt.process,Kt=function(){try{return Gt&&Gt.require&&Gt.require("util").types||Yt&&Yt.binding&&Yt.binding("util")}catch(t){}}(),zt=Kt&&Kt.isArrayBuffer,Wt=Kt&&Kt.isDate,Vt=Kt&&Kt.isMap,Xt=Kt&&Kt.isRegExp,Jt=Kt&&Kt.isSet,Qt=Kt&&Kt.isTypedArray;function Zt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,a=null==t?0:t.length;++o-1}function ie(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Pe(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Fe=be({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Le=be({"&":"&","<":"<",">":">",'"':""","'":"'"});function ke(t){return"\\"+jt[t]}function Re(t){return Ft.test(t)}function Ie(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Te(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,a=0,i=[];++n",""":'"',"'":"'"}),Ge=function t(Y){var st,ct=(Y=null==Y?Ut:Ge.defaults(Ut.Object(),Y,Ge.pick(Ut,kt))).Array,lt=Y.Date,pt=Y.Error,ft=Y.Function,_t=Y.Math,ht=Y.Object,dt=Y.RegExp,yt=Y.String,vt=Y.TypeError,mt=ct.prototype,gt=ft.prototype,bt=ht.prototype,At=Y["__core-js_shared__"],Et=gt.toString,wt=bt.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=bt.toString,Ft=Et.call(ht),jt=Ut._,Bt=dt("^"+Et.call(wt).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=qt?Y.Buffer:void 0,Ht=Y.Symbol,Gt=Y.Uint8Array,Yt=Mt?Mt.allocUnsafe:void 0,Kt=Te(ht.getPrototypeOf,ht),fe=ht.create,be=bt.propertyIsEnumerable,qe=mt.splice,Ye=Ht?Ht.isConcatSpreadable:void 0,Ke=Ht?Ht.iterator:void 0,ze=Ht?Ht.toStringTag:void 0,We=function(){try{var t=Zo(ht,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=Y.clearTimeout!==Ut.clearTimeout&&Y.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=Y.setTimeout!==Ut.setTimeout&&Y.setTimeout,Qe=_t.ceil,Ze=_t.floor,tr=ht.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=Y.isFinite,nr=mt.join,or=Te(ht.keys,ht),ar=_t.max,ir=_t.min,ur=lt.now,sr=Y.parseInt,cr=_t.random,lr=mt.reverse,pr=Zo(Y,"DataView"),fr=Zo(Y,"Map"),_r=Zo(Y,"Promise"),hr=Zo(Y,"Set"),dr=Zo(Y,"WeakMap"),yr=Zo(ht,"create"),vr=dr&&new dr,mr={},gr=$a(pr),br=$a(fr),Ar=$a(_r),Er=$a(hr),wr=$a(dr),Cr=Ht?Ht.prototype:void 0,xr=Cr?Cr.valueOf:void 0,Sr=Cr?Cr.toString:void 0;function $r(t){if(qi(t)&&!Ri(t)&&!(t instanceof Lr)){if(t instanceof Fr)return t;if(wt.call(t,"__wrapped__"))return Oa(t)}return new Fr(t)}var Or=function(){function t(){}return function(e){if(!Gi(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Pr(){}function Fr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Lr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,a,s){var m,P=1&e,F=2&e,L=4&e;if(r&&(m=a?r(t,n,a,s):r(t)),void 0!==m)return m;if(!Gi(t))return t;var k=Ri(t);if(k){if(m=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!P)return vo(t,m)}else{var R=ra(t),I=R==c||R==l;if(Ni(t))return lo(t,P);if(R==_||R==o||I&&!a){if(m=F||I?{}:oa(t),!P)return F?function(t,e){return mo(t,ea(t),e)}(t,function(t,e){return t&&mo(e,Au(e),t)}(m,t)):function(t,e){return mo(t,ta(t),e)}(t,Yr(m,t))}else{if(!Tt[R])return a?t:{};m=function(t,e,r){var n,o,a,s=t.constructor;switch(e){case g:return po(t);case i:case u:return new s(+t);case b:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case A:case E:case w:case C:case x:case S:case"[object Uint8ClampedArray]":case $:case O:return fo(t,r);case p:return new s;case f:case y:return new s(t);case h:return(a=new(o=t).constructor(o.source,Z.exec(o))).lastIndex=o.lastIndex,a;case d:return new s;case v:return n=t,xr?ht(xr.call(n)):{}}}(t,R,P)}}s||(s=new jr);var T=s.get(t);if(T)return T;s.set(t,m),Vi(t)?t.forEach((function(n){m.add(Vr(n,e,r,n,t,s))})):Yi(t)&&t.forEach((function(n,o){m.set(o,Vr(n,e,r,o,t,s))}));var j=k?void 0:(L?F?Ko:Yo:F?Au:bu)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Hr(m,o,Vr(n,e,r,o,t,s))})),m}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=ht(t);n--;){var o=r[n],a=e[o],i=t[o];if(void 0===i&&!(o in t)||!a(i))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new vt(e);return ma((function(){t.apply(void 0,n)}),r)}function Qr(t,e,r,n){var o=-1,a=ae,i=!0,u=t.length,s=[],c=e.length;if(!u)return s;r&&(e=ue(e,xe(r))),n?(a=ie,i=!1):e.length>=200&&(a=$e,i=!1,e=new Tr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=Gr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Ir.prototype.clear=function(){this.size=0,this.__data__={hash:new kr,map:new(fr||Rr),string:new kr}},Ir.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Ir.prototype.get=function(t){return Jo(this,t).get(t)},Ir.prototype.has=function(t){return Jo(this,t).has(t)},Ir.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Tr.prototype.add=Tr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Tr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ir(n)}return r.set(t,e),this.size=r.size,this};var Zr=Ao(sn),tn=Ao(cn,!0);function en(t,e){var r=!0;return Zr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(u)?e>1?on(u,e-1,r,n,o):se(o,u):n||(o[o.length]=u)}return o}var an=Eo(),un=Eo(!0);function sn(t,e){return t&&an(t,e,bu)}function cn(t,e){return t&&un(t,e,bu)}function ln(t,e){return oe(e,(function(e){return Mi(t[e])}))}function pn(t,e){for(var r=0,n=(e=io(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function yn(t,e){return null!=t&&e in ht(t)}function vn(t,e,r){for(var n=r?ie:ae,o=t[0].length,a=t.length,i=a,u=ct(a),s=1/0,c=[];i--;){var l=t[i];i&&e&&(l=ue(l,xe(e))),s=ir(l.length,s),u[i]=!r&&(e||o>=120&&l.length>=120)?new Tr(i&&l):void 0}l=t[0];var p=-1,f=u[0];t:for(;++p=u?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}(Sn(t,(function(t,r,o){return{criteria:ue(e,(function(e){return e(t)})),index:++n,value:t}})))}function kn(t,e,r){for(var n=-1,o=e.length,a={};++n-1;)u!==t&&qe.call(u,s,1),qe.call(t,s,1);return t}function In(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==a){var a=o;ia(o)?qe.call(t,o,1):Qn(t,o)}}return t}function Tn(t,e){return t+Ze(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Ze(e/2))&&(t+=t)}while(e);return r}function Nn(t,e){return ga(ha(t,e,Ku),t+"")}function Dn(t){return Dr(Pu(t))}function Bn(t,e){var r=Pu(t);return Ea(r,Wr(e,0,r.length))}function Mn(t,e,r,n){if(!Gi(t))return t;for(var o=-1,a=(e=io(e,t)).length,i=a-1,u=t;null!=u&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=ct(o);++n>>1,i=t[a];null!==i&&!Ji(i)&&(r?i<=e:i=200){var c=e?null:No(t);if(c)return Ne(c);i=!1,o=$e,s=new Tr}else s=e?[]:u;t:for(;++n=n?t:qn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Yt?Yt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,a=Ji(t),i=void 0!==e,u=null===e,s=e==e,c=Ji(e);if(!u&&!c&&!a&&t>e||a&&i&&s&&!u&&!c||n&&i&&s||!r&&s||!o)return 1;if(!n&&!a&&!c&&t1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ua(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=ht(e);++n-1?o[a?e[i]:i]:void 0}}function $o(t){return qo((function(r){var n=r.length,o=n,a=Fr.prototype.thru;for(t&&r.reverse();o--;){var i=r[o];if("function"!=typeof i)throw new vt(e);if(a&&!u&&"wrapper"==Wo(i))var u=new Fr([],!0)}for(o=u?o:n;++o1&&m.reverse(),l&&su))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,_=2&r?new Tr:void 0;for(a.set(t,e),a.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(K,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ae(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(z);return e?e[1].split(W):[]}(o),r)))}function Aa(t){var e=0,r=0;return function(){var n=ur(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ea(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Wa(t,r)}));function ei(t){var e=$r(t);return e.__chain__=!0,e}function ri(t,e){return e(t)}var ni=qo((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return zr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Lr&&ia(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new Fr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),oi=go((function(t,e,r){wt.call(t,r)?++t[r]:Kr(t,r,1)})),ai=So(ka),ii=So(Ra);function ui(t,e){return(Ri(t)?ee:Zr)(t,Xo(e,3))}function si(t,e){return(Ri(t)?re:tn)(t,Xo(e,3))}var ci=go((function(t,e,r){wt.call(t,r)?t[r].push(e):Kr(t,r,[e])})),li=Nn((function(t,e,r){var n=-1,o="function"==typeof e,a=Ti(t)?ct(t.length):[];return Zr(t,(function(t){a[++n]=o?Zt(e,t,r):mn(t,e,r)})),a})),pi=go((function(t,e,r){Kr(t,r,e)}));function fi(t,e){return(Ri(t)?ue:Sn)(t,Xo(e,3))}var _i=go((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),hi=Nn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ua(t,e[0],e[1])?e=[]:r>2&&ua(e[0],e[1],e[2])&&(e=[e[0]]),Ln(t,on(e,1),[])})),di=Xe||function(){return Ut.Date.now()};function yi(t,e,r){return e=r?void 0:e,Bo(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function vi(t,r){var n;if("function"!=typeof r)throw new vt(e);return t=nu(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var mi=Nn((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(mi));n|=32}return Bo(t,n,e,r,o)})),gi=Nn((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(gi));n|=32}return Bo(e,n,t,r,o)}));function bi(t,r,n){var o,a,i,u,s,c,l=0,p=!1,f=!1,_=!0;if("function"!=typeof t)throw new vt(e);function h(e){var r=o,n=a;return o=a=void 0,l=e,u=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function y(){var t=di();if(d(t))return v(t);s=ma(y,function(t){var e=r-(t-c);return f?ir(e,i-(t-l)):e}(t))}function v(t){return s=void 0,_&&o?h(t):(o=a=void 0,u)}function m(){var t=di(),e=d(t);if(o=arguments,a=this,c=t,e){if(void 0===s)return function(t){return l=t,s=ma(y,r),p?h(t):u}(c);if(f)return co(s),s=ma(y,r),h(c)}return void 0===s&&(s=ma(y,r)),u}return r=au(r)||0,Gi(n)&&(p=!!n.leading,i=(f="maxWait"in n)?ar(au(n.maxWait)||0,r):i,_="trailing"in n?!!n.trailing:_),m.cancel=function(){void 0!==s&&co(s),l=0,o=c=a=s=void 0},m.flush=function(){return void 0===s?u:v(di())},m}var Ai=Nn((function(t,e){return Jr(t,1,e)})),Ei=Nn((function(t,e,r){return Jr(t,au(e)||0,r)}));function wi(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new vt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,e);return n.cache=a.set(o,i)||a,i};return n.cache=new(wi.Cache||Ir),n}function Ci(t){if("function"!=typeof t)throw new vt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}wi.Cache=Ir;var xi=uo((function(t,e){var r=(e=1==e.length&&Ri(e[0])?ue(e[0],xe(Xo())):ue(on(e,1),xe(Xo()))).length;return Nn((function(n){for(var o=-1,a=ir(n.length,r);++o=e})),ki=gn(function(){return arguments}())?gn:function(t){return qi(t)&&wt.call(t,"callee")&&!be.call(t,"callee")},Ri=ct.isArray,Ii=zt?xe(zt):function(t){return qi(t)&&_n(t)==g};function Ti(t){return null!=t&&Hi(t.length)&&!Mi(t)}function ji(t){return qi(t)&&Ti(t)}var Ni=er||as,Di=Wt?xe(Wt):function(t){return qi(t)&&_n(t)==u};function Bi(t){if(!qi(t))return!1;var e=_n(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!zi(t)}function Mi(t){if(!Gi(t))return!1;var e=_n(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ui(t){return"number"==typeof t&&t==nu(t)}function Hi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Gi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qi(t){return null!=t&&"object"==typeof t}var Yi=Vt?xe(Vt):function(t){return qi(t)&&ra(t)==p};function Ki(t){return"number"==typeof t||qi(t)&&_n(t)==f}function zi(t){if(!qi(t)||_n(t)!=_)return!1;var e=Kt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==Ft}var Wi=Xt?xe(Xt):function(t){return qi(t)&&_n(t)==h},Vi=Jt?xe(Jt):function(t){return qi(t)&&ra(t)==d};function Xi(t){return"string"==typeof t||!Ri(t)&&qi(t)&&_n(t)==y}function Ji(t){return"symbol"==typeof t||qi(t)&&_n(t)==v}var Qi=Qt?xe(Qt):function(t){return qi(t)&&Hi(t.length)&&!!It[_n(t)]},Zi=Io(xn),tu=Io((function(t,e){return t<=e}));function eu(t){if(!t)return[];if(Ti(t))return Xi(t)?Me(t):vo(t);if(Ke&&t[Ke])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Ke]());var e=ra(t);return(e==p?Ie:e==d?Ne:Pu)(t)}function ru(t){return t?(t=au(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function nu(t){var e=ru(t),r=e%1;return e==e?r?e-r:e:0}function ou(t){return t?Wr(nu(t),0,4294967295):0}function au(t){if("number"==typeof t)return t;if(Ji(t))return NaN;if(Gi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Gi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Dt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function iu(t){return mo(t,Au(t))}function uu(t){return null==t?"":Xn(t)}var su=bo((function(t,e){if(pa(e)||Ti(e))mo(e,bu(e),t);else for(var r in e)wt.call(e,r)&&Hr(t,r,e[r])})),cu=bo((function(t,e){mo(e,Au(e),t)})),lu=bo((function(t,e,r,n){mo(e,Au(e),t,n)})),pu=bo((function(t,e,r,n){mo(e,bu(e),t,n)})),fu=qo(zr),_u=Nn((function(t,e){t=ht(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&ua(e[0],e[1],o)&&(n=1);++r1),e})),mo(t,Ko(t),r),n&&(r=Vr(r,7,Ho));for(var o=e.length;o--;)Qn(r,e[o]);return r})),xu=qo((function(t,e){return null==t?{}:function(t,e){return kn(t,e,(function(e,r){return yu(t,r)}))}(t,e)}));function Su(t,e){if(null==t)return{};var r=ue(Ko(t),(function(t){return[t]}));return e=Xo(e),kn(t,r,(function(t,r){return e(t,r[0])}))}var $u=Do(bu),Ou=Do(Au);function Pu(t){return null==t?[]:Se(t,bu(t))}var Fu=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?Lu(e):e)}));function Lu(t){return Bu(uu(t).toLowerCase())}function ku(t){return(t=uu(t))&&t.replace(at,Fe).replace($t,"")}var Ru=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Iu=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Tu=wo("toLowerCase"),ju=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Nu=Co((function(t,e,r){return t+(r?" ":"")+Bu(e)})),Du=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Bu=wo("toUpperCase");function Mu(t,e,r){return t=uu(t),void 0===(e=r?void 0:e)?function(t){return Lt.test(t)}(t)?function(t){return t.match(Pt)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Uu=Nn((function(t,e){try{return Zt(t,void 0,e)}catch(r){return Bi(r)?r:new pt(r)}})),Hu=qo((function(t,e){return ee(e,(function(e){e=Sa(e),Kr(t,e,mi(t[e],t))})),t}));function Gu(t){return function(){return t}}var qu=$o(),Yu=$o(!0);function Ku(t){return t}function zu(t){return wn("function"==typeof t?t:Vr(t,1))}var Wu=Nn((function(t,e){return function(r){return mn(r,t,e)}})),Vu=Nn((function(t,e){return function(r){return mn(t,r,e)}}));function Xu(t,e,r){var n=bu(e),o=ln(e,n);null!=r||Gi(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,bu(e)));var a=!(Gi(r)&&"chain"in r&&!r.chain),i=Mi(t);return ee(o,(function(r){var n=e[r];t[r]=n,i&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=vo(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Ju(){}var Qu=Lo(ue),Zu=Lo(ne),ts=Lo(pe);function es(t){return sa(t)?ge(Sa(t)):function(t){return function(e){return pn(e,t)}}(t)}var rs=Ro(),ns=Ro(!0);function os(){return[]}function as(){return!1}var is,us=Fo((function(t,e){return t+e}),0),ss=jo("ceil"),cs=Fo((function(t,e){return t/e}),1),ls=jo("floor"),ps=Fo((function(t,e){return t*e}),1),fs=jo("round"),_s=Fo((function(t,e){return t-e}),0);return $r.after=function(t,r){if("function"!=typeof r)throw new vt(e);return t=nu(t),function(){if(--t<1)return r.apply(this,arguments)}},$r.ary=yi,$r.assign=su,$r.assignIn=cu,$r.assignInWith=lu,$r.assignWith=pu,$r.at=fu,$r.before=vi,$r.bind=mi,$r.bindAll=Hu,$r.bindKey=gi,$r.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ri(t)?t:[t]},$r.chain=ei,$r.chunk=function(t,e,r){e=(r?ua(t,e,r):void 0===e)?1:ar(nu(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,a=0,i=ct(Qe(n/e));oo?0:o+r),(n=void 0===n||n>o?o:nu(n))<0&&(n+=o),n=r>n?0:ou(n);r>>0)?(t=uu(t))&&("string"==typeof e||null!=e&&!Wi(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},$r.spread=function(t,r){if("function"!=typeof t)throw new vt(e);return r=null==r?0:ar(nu(r),0),Nn((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Zt(t,this,o)}))},$r.tail=function(t){var e=null==t?0:t.length;return e?qn(t,1,e):[]},$r.take=function(t,e,r){return t&&t.length?qn(t,0,(e=r||void 0===e?1:nu(e))<0?0:e):[]},$r.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?qn(t,(e=n-(e=r||void 0===e?1:nu(e)))<0?0:e,n):[]},$r.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},$r.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},$r.tap=function(t,e){return e(t),t},$r.throttle=function(t,r,n){var o=!0,a=!0;if("function"!=typeof t)throw new vt(e);return Gi(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),bi(t,r,{leading:o,maxWait:r,trailing:a})},$r.thru=ri,$r.toArray=eu,$r.toPairs=$u,$r.toPairsIn=Ou,$r.toPath=function(t){return Ri(t)?ue(t,Sa):Ji(t)?[t]:vo(xa(uu(t)))},$r.toPlainObject=iu,$r.transform=function(t,e,r){var n=Ri(t),o=n||Ni(t)||Qi(t);if(e=Xo(e,4),null==r){var a=t&&t.constructor;r=o?n?new a:[]:Gi(t)&&Mi(a)?Or(Kt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},$r.unary=function(t){return yi(t,1)},$r.union=qa,$r.unionBy=Ya,$r.unionWith=Ka,$r.uniq=function(t){return t&&t.length?Jn(t):[]},$r.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},$r.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},$r.unset=function(t,e){return null==t||Qn(t,e)},$r.unzip=za,$r.unzipWith=Wa,$r.update=function(t,e,r){return null==t?t:Zn(t,e,ao(r))},$r.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Zn(t,e,ao(r),n)},$r.values=Pu,$r.valuesIn=function(t){return null==t?[]:Se(t,Au(t))},$r.without=Va,$r.words=Mu,$r.wrap=function(t,e){return Si(ao(e),t)},$r.xor=Xa,$r.xorBy=Ja,$r.xorWith=Qa,$r.zip=Za,$r.zipObject=function(t,e){return no(t||[],e||[],Hr)},$r.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},$r.zipWith=ti,$r.entries=$u,$r.entriesIn=Ou,$r.extend=cu,$r.extendWith=lu,Xu($r,$r),$r.add=us,$r.attempt=Uu,$r.camelCase=Fu,$r.capitalize=Lu,$r.ceil=ss,$r.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=au(r))==r?r:0),void 0!==e&&(e=(e=au(e))==e?e:0),Wr(au(t),e,r)},$r.clone=function(t){return Vr(t,4)},$r.cloneDeep=function(t){return Vr(t,5)},$r.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},$r.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},$r.conformsTo=function(t,e){return null==e||Xr(t,e,bu(e))},$r.deburr=ku,$r.defaultTo=function(t,e){return null==t||t!=t?e:t},$r.divide=cs,$r.endsWith=function(t,e,r){t=uu(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Wr(nu(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},$r.eq=Pi,$r.escape=function(t){return(t=uu(t))&&T.test(t)?t.replace(R,Le):t},$r.escapeRegExp=function(t){return(t=uu(t))&&G.test(t)?t.replace(H,"\\$&"):t},$r.every=function(t,e,r){var n=Ri(t)?ne:en;return r&&ua(t,e,r)&&(e=void 0),n(t,Xo(e,3))},$r.find=ai,$r.findIndex=ka,$r.findKey=function(t,e){return _e(t,Xo(e,3),sn)},$r.findLast=ii,$r.findLastIndex=Ra,$r.findLastKey=function(t,e){return _e(t,Xo(e,3),cn)},$r.floor=ls,$r.forEach=ui,$r.forEachRight=si,$r.forIn=function(t,e){return null==t?t:an(t,Xo(e,3),Au)},$r.forInRight=function(t,e){return null==t?t:un(t,Xo(e,3),Au)},$r.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},$r.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},$r.get=du,$r.gt=Fi,$r.gte=Li,$r.has=function(t,e){return null!=t&&na(t,e,dn)},$r.hasIn=yu,$r.head=Ta,$r.identity=Ku,$r.includes=function(t,e,r,n){t=Ti(t)?t:Pu(t),r=r&&!n?nu(r):0;var o=t.length;return r<0&&(r=ar(o+r,0)),Xi(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},$r.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:nu(r);return o<0&&(o=ar(n+o,0)),de(t,e,o)},$r.inRange=function(t,e,r){return e=ru(e),void 0===r?(r=e,e=0):r=ru(r),function(t,e,r){return t>=ir(e,r)&&t=-9007199254740991&&t<=9007199254740991},$r.isSet=Vi,$r.isString=Xi,$r.isSymbol=Ji,$r.isTypedArray=Qi,$r.isUndefined=function(t){return void 0===t},$r.isWeakMap=function(t){return qi(t)&&ra(t)==m},$r.isWeakSet=function(t){return qi(t)&&"[object WeakSet]"==_n(t)},$r.join=function(t,e){return null==t?"":nr.call(t,e)},$r.kebabCase=Ru,$r.last=Ba,$r.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=nu(r))<0?ar(n+o,0):ir(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):he(t,ve,o,!0)},$r.lowerCase=Iu,$r.lowerFirst=Tu,$r.lt=Zi,$r.lte=tu,$r.max=function(t){return t&&t.length?rn(t,Ku,hn):void 0},$r.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),hn):void 0},$r.mean=function(t){return me(t,Ku)},$r.meanBy=function(t,e){return me(t,Xo(e,2))},$r.min=function(t){return t&&t.length?rn(t,Ku,xn):void 0},$r.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},$r.stubArray=os,$r.stubFalse=as,$r.stubObject=function(){return{}},$r.stubString=function(){return""},$r.stubTrue=function(){return!0},$r.multiply=ps,$r.nth=function(t,e){return t&&t.length?Fn(t,nu(e)):void 0},$r.noConflict=function(){return Ut._===this&&(Ut._=jt),this},$r.noop=Ju,$r.now=di,$r.pad=function(t,e,r){t=uu(t);var n=(e=nu(e))?Be(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return ko(Ze(o),r)+t+ko(Qe(o),r)},$r.padEnd=function(t,e,r){t=uu(t);var n=(e=nu(e))?Be(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ir(t+o*(e-t+Nt("1e-"+((o+"").length-1))),e)}return Tn(t,e)},$r.reduce=function(t,e,r){var n=Ri(t)?ce:Ae,o=arguments.length<3;return n(t,Xo(e,4),r,o,Zr)},$r.reduceRight=function(t,e,r){var n=Ri(t)?le:Ae,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},$r.repeat=function(t,e,r){return e=(r?ua(t,e,r):void 0===e)?1:nu(e),jn(uu(t),e)},$r.replace=function(){var t=arguments,e=uu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$r.result=function(t,e,r){var n=-1,o=(e=io(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ir(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=a)return t;var u=r-Be(n);if(u<1)return n;var s=i?so(i,0,u).join(""):t.slice(0,u);if(void 0===o)return s+n;if(i&&(u+=s.length-u),Wi(o)){if(t.slice(u).search(o)){var c,l=s;for(o.global||(o=dt(o.source,uu(Z.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?u:p)}}else if(t.indexOf(Xn(o),u)!=u){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},$r.unescape=function(t){return(t=uu(t))&&I.test(t)?t.replace(k,He):t},$r.uniqueId=function(t){var e=++Ct;return uu(t)+e},$r.upperCase=Du,$r.upperFirst=Bu,$r.each=ui,$r.eachRight=si,$r.first=Ta,Xu($r,(is={},sn($r,(function(t,e){wt.call($r.prototype,e)||(is[e]=t)})),is),{chain:!1}),$r.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$r[t].placeholder=$r})),ee(["drop","take"],(function(t,e){Lr.prototype[t]=function(r){r=void 0===r?1:ar(nu(r),0);var n=this.__filtered__&&!e?new Lr(this):this.clone();return n.__filtered__?n.__takeCount__=ir(r,n.__takeCount__):n.__views__.push({size:ir(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Lr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Lr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Lr.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Lr.prototype[t]=function(){return this.__filtered__?new Lr(this):this[r](1)}})),Lr.prototype.compact=function(){return this.filter(Ku)},Lr.prototype.find=function(t){return this.filter(t).head()},Lr.prototype.findLast=function(t){return this.reverse().find(t)},Lr.prototype.invokeMap=Nn((function(t,e){return"function"==typeof t?new Lr(this):this.map((function(r){return mn(r,t,e)}))})),Lr.prototype.reject=function(t){return this.filter(Ci(Xo(t)))},Lr.prototype.slice=function(t,e){t=nu(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Lr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=nu(e))<0?r.dropRight(-e):r.take(e-t)),r)},Lr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Lr.prototype.toArray=function(){return this.take(4294967295)},sn(Lr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=$r[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);o&&($r.prototype[e]=function(){var e=this.__wrapped__,i=n?[1]:arguments,u=e instanceof Lr,s=i[0],c=u||Ri(e),l=function(t){var e=o.apply($r,se([t],i));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,_=a&&!p,h=u&&!f;if(!a&&c){e=h?e:new Lr(this);var d=t.apply(e,i);return d.__actions__.push({func:ri,args:[l],thisArg:void 0}),new Fr(d,p)}return _&&h?t.apply(this,i):(d=this.thru(l),_?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=mt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);$r.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ri(o)?o:[],t)}return this[r]((function(r){return e.apply(Ri(r)?r:[],t)}))}})),sn(Lr.prototype,(function(t,e){var r=$r[e];if(r){var n=r.name+"";wt.call(mr,n)||(mr[n]=[]),mr[n].push({name:e,func:r})}})),mr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],Lr.prototype.clone=function(){var t=new Lr(this.__wrapped__);return t.__actions__=vo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=vo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=vo(this.__views__),t},Lr.prototype.reverse=function(){if(this.__filtered__){var t=new Lr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Lr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ri(t),n=e<0,o=r?t.length:0,a=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$r.prototype.plant=function(t){for(var e,r=this;r instanceof Pr;){var n=Oa(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},$r.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Lr){var e=t;return this.__actions__.length&&(e=new Lr(this)),(e=e.reverse()).__actions__.push({func:ri,args:[Ga],thisArg:void 0}),new Fr(e,this.__chain__)}return this.thru(Ga)},$r.prototype.toJSON=$r.prototype.valueOf=$r.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},$r.prototype.first=$r.prototype.head,Ke&&($r.prototype[Ke]=function(){return this}),$r}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=Ge,define((function(){return Ge}))):Gt?((Gt.exports=Ge)._=Ge,Ht._=Ge):Ut._=Ge}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",a=this.position;ae/2-1){o=" ... ",a-=5;break}return i=this.buffer.slice(n,a),_$common_7.repeat(" ",t)+r+i+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,a,i,u,s,c=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(a=+e[4],i=+e[5],u=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,a,i,u,c)),l&&s.setTime(s.getTime()-l),s},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,a=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,a=BASE64_MAP,i=0,u=[];for(e=0;e>16&255),u.push(i>>8&255),u.push(255&i)),i=i<<6|a.indexOf(n.charAt(e));return 0==(r=o%4*6)?(u.push(i>>16&255),u.push(i>>8&255),u.push(255&i)):18===r?(u.push(i>>10&255),u.push(i>>2&255)):12===r&&u.push(i>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(u):new NodeBuffer(u):u},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,a=t.length,i=BASE64_MAP;for(e=0;e>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]),o=(o<<8)+t[e];return 0==(r=a%3)?(n+=i[o>>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]):2===r?(n+=i[o>>10&63],n+=i[o>>4&63],n+=i[o<<2&63],n+=i[64]):1===r&&(n+=i[o>>2&63],n+=i[o<<4&63],n+=i[64],n+=i[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,a,i=[],u=t;for(e=0,r=u.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,a;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),a=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&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,a,i,u;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,a=t.anchor,i=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=i),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)i.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),i.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,p,f,_,h,a,i),f=_=h=null),skipSeparationSpace(t,!0,-1),u=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==u)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(a)){do{a=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!is_EOL(a)&&0!==a)}for(;0!==a;){for(readLineBreak(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(a))p++;else{if(t.lineIndent0){for(o=i,a=0;o>0;o--)(i=fromHexCode(u=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+i:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(a),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(u)?(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,p)?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,a,i,u,s,c,l,p=t.kind,f=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=a=t.position,i=!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(u=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){i=!0,l=t.input.charCodeAt(t.position);continue}t.position=a,t.line=u,t.lineStart=s,t.lineIndent=c;break}}i&&(captureSegment(t,o,a,!1),writeFoldedLines(t,t.line-u),o=a=t.position,i=!1),is_WHITE_SPACE(l)||(a=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,a,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=u&&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+'"'),s=0,c=t.implicitTypes.length;s 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,a=t.position,i=!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(i=!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)):i&&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(a,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(a-1):null,_=_&&isPlainSafe(i,u)}else{for(a=0;an&&" "!==t[f+1],f=a);else if(!isPrintable(i))return STYLE_DOUBLE;u=a>0?t.charCodeAt(a-1):null,_=_&&isPlainSafe(i,u)}l=l||p&&a-f-1>n&&" "!==t[f+1]}return c||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),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),i=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,i,t.indent,a,(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,a=/(\n+)([^\n]*)/g,i=(o=-1!==(o=t.indexOf("\n"))?o:t.length,a.lastIndex=o,foldLine(t.slice(0,o),e)),u="\n"===t[0]||" "===t[0];n=a.exec(t);){var s=n[1],c=n[2];r=" "===c[0],i+=s+(u||r||""===c?"":"\n")+foldLine(c,e),u=r}return i}(e,a),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",a=0;a=55296&&e<=56319&&(r=t.charCodeAt(a+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),a++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[a]: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,a=0,i=0,u=0,s="";r=o.exec(t);)(u=r.index)-a>e&&(n=i>a?i:u,s+="\n"+t.slice(a,n),a=n+1),i=u;return s+="\n",t.length-a>e&&i>a?s+=t.slice(a,i)+"\n"+t.slice(i+1):s+=t.slice(a),s.slice(1)}function detectType(t,e,r){var n,o,a,i,u,s;for(a=0,i=(o=r?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+s+'" style');n=u.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,a){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var i=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var u,s,c="[object Object]"===i||"[object Array]"===i;if(c&&(s=-1!==(u=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(c&&s&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===i)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,a,i,u,s,c,l="",p=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,a=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,u,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+u+t.dump)):(function(t,e,r){var n,o,a,i,u,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,i,!1,!1)&&(s+=u+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===i){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,a,i="",u=t.tag;for(o=0,a=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],a=[];for(function t(e,r,n){var o,a,i;if(null!==e&&"object"==typeof e)if(-1!==(a=r.indexOf(e)))-1===n.indexOf(a)&&n.push(a);else if(r.push(e),Array.isArray(e))for(a=0,i=e.length;a0?o-4:o;for(r=0;r>16&255,i[u++]=e>>8&255,i[u++]=255&e;return 2===a&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,i[u++]=255&e),1===a&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,i[u++]=e>>8&255,i[u++]=255&e),i},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],a=0,i=r-n;ai?i:a+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,a=[],i=e;i>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return a.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var a,i,u=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,_=t[e+p];for(p+=f,a=_&(1<<-l)-1,_>>=-l,l+=u;l>0;a=256*a+t[e+p],p+=f,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+t[e+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(_?-1:1);i+=Math.pow(2,n),a-=c}return(_?-1:1)*i*Math.pow(2,a-n)},write:function(t,e,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-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?(u=isNaN(e)?1:0,i=l):(i=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-i))<1&&(i--,s*=2),(e+=i+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(i++,s/=2),i+p>=l?(u=0,i=l):i+p>=1?(u=(e*s-1)*Math.pow(2,o),i+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;t[r+_]=255&u,_+=h,u/=256,o-=8);for(i=i<0;t[r+_]=255&i,_+=h,i/=256,c-=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,a="function"==typeof TextDecoder?new TextDecoder:void 0,i="function"==typeof TextEncoder?new TextEncoder:void 0,u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},u.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,a="",i=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");a+=u[(e=r<<16|n<<8|o)>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}return i?a.slice(0,i-3)+"===".substring(i):a},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,b=function(t){return t.replace(g,m)},A=o?function(t){return e.from(t,"utf8").toString("base64")}:i?function(t){return y(i.encode(t))}:function(t){return d(b(t))},E=function(t,e){return void 0===e&&(e=!1),e?f(A(t)):A(t)},w=function(t){return E(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},S=function(t){return t.replace(C,x)},$=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",a=0;a>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:$,P=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},F=function(t){return P(k(t))},L=o?function(t){return e.from(t,"base64").toString("utf8")}:a?function(t){return a.decode(P(t))}:function(t){return S(O(t))},k=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return L(k(t))},I=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},T=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,I(e))};t("fromBase64",(function(){return R(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 F(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,I(e))};t("toBase64",(function(t){return v(this,t)})),t("toBase64URI",(function(){return v(this,!0)})),t("toBase64URL",(function(){return v(this,!0)}))},N={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:$,btoa:d,btoaPolyfill:h,fromBase64:R,toBase64:E,encode:E,encodeURI:w,encodeURL:w,utob:b,btou:S,decode:R,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:v,toUint8Array:F,extendString:T,extendUint8Array:j,extendBuiltins:function(){T(),j()},Base64:{}};return Object.keys(N).forEach((function(t){return N.Base64[t]=N[t]})),N}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_75(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_65.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,a=r.password,i=r.servers,u=0;u({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const a=e.find(({source:e})=>e===t.source),i=t.start;if(a){const e=t.end,u=a.text[i.line-1],s=(i.line===e.line?e.column:u.length+1)-i.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${i.line}:${i.column}\n${"".padEnd(r)} |\n${i.line.toString().padStart(r)} | ${u}\n${"".padEnd(r)} | ${"".padEnd(i.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${i.line}:${i.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let a;a=(a=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let i=`${t}: ${e}`;n&&(i+=r(n,a));for(const u of o)i+=r(u.location,a,u.message);return i}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const a={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(a).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=a[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return a(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=a(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let i=0;i0?NEVER_MATCH:SOMETIMES_MATCH}const a=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=a(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-a(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=a(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});a(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function a(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function i(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},a=JSON.stringify(n),i=o.findIndex(t=>JSON.stringify(t)===a);return-1===i?o.push(n)-1:i}function u(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],h(t,{sp:r.sp+1,env:u(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=i(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function _(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const h=_$visitor_52.build({grammar(t){t.rules.forEach(h),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=h(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:a({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],h(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=h(e[0],{sp:r.sp,env:u(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=u(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=h(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),a=0|t.expression.match,p=n&&a!==__NEVER_MATCH_39?i(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(a,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(h(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=i(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=u(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),h(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],h(t.expression,{sp:e.sp+1,env:u(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(h(t.expression,{sp:e.sp,env:u(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,_(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(_(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>h(t.expression,{sp:e.sp,env:u(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?a({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?a({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?a({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});h(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const a=o.toString();return"absolute"===r?a:"scheme-relative"===r?a.slice(PROTOCOL.length):"path-absolute"===r?a.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,a)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(a){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&a>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const a=t.sourceContentFor(n);null!=a&&r.setSourceContent(n,a)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const a=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,i=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const u=e.source;null==u||a.has(u)||a.add(u);const s=e.name;null==s||i.has(s)||i.add(s)}),this),this._sources=a,this._names=i,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,a=1,i=0,u=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,_=p.length;f<_;f++){if(t="",(e=p[f]).generatedLine!==a)for(o=0;e.generatedLine!==a;)t+=";",a++;else if(f>0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-u),u=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-i),i=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let a=0;const i=function(){return t()+(t()||"");function t(){return a=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+i,0===i?o:0,e.source,i===a.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function a(t){return"peg$e"+t}function i(t){return"peg$f"+t}function u(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const a={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),a=n();return a.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{a.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),a.push("")),a.push(t,"","module.exports = "+o()+";"),a},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const a=Object.keys(e.dependencies),i="["+a.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",u=a.join(", ");return[...n(),"define("+i+", function("+u+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const a=Object.keys(e.dependencies),i=a.map(t=>e.dependencies[t]),u="["+i.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=i.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=a.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+u+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,a.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+u(t)).join(", ")+" }",p=u(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+a(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${i(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let _;function h(t,n){const o=n+3,a=s[c+o-2],i=s[c+o-1];let u,p;l.checkedIf(c,()=>{c+=o,u=e(s.slice(c,c+a)),c+=a},i>0?()=>{p=e(s.slice(c,c+i)),c+=i}:null),f.push("if ("+t+") {"),f.push(...u.map(r)),i>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function y(){const t=s[c+4-1],e=i(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(_)),c+=r;break}case _$opcodes_38.IF:h(l.top(),0);break;case _$opcodes_38.IF_ERROR:h(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:h(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:h("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:h(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:h("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:h(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+a(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:y();break;case _$opcodes_38.RULE:f.push(l.push(u(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",u(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,a)=>{var i;"rule"===(i=o).type&&"rule_ref"===i.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(a))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){a(t.expression,n(e))}const a=_$visitor_52.build({rule(t){a(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{a(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),a(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});a(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],a=_$visitor_52.build({rule(t){n.push(t.name),a(t.expression),n.pop()},sequence(e){e.elements.every(e=>(a(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const i=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",i.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));i&&a(i),o.pop()}});a(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eYt&&(Yt=Ht,Kt=[]),Kt.push(t))}function re(){var e,r,o,a,i,u;if(e=Ht,Re(),r=Ht,(o=function(){var e,r,o,a;return e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===zt&&ee(E)),r!==n&&(o=ke())!==n?(125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===zt&&ee(w)),a!==n&&Ie()!==n?(Gt=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Wt()}}(o)):(Ht=e,e=n)):(Ht=e,e=n),e}())!==n?(a=Re(),r=o):(Ht=r,r=n),r===n&&(r=null),o=Ht,(a=function(){var t,e;return t=Ht,(e=ke())!==n&&Ie()!==n?(Gt=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Wt()}}(e)):(Ht=t,t=n),t}())!==n?(i=Re(),o=a):(Ht=o,o=n),o===n&&(o=null),a=[],i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,(u=ne())!==n?(Re(),i=u):(Ht=i,i=n);else a=n;return a!==n?(Gt=e,e={type:"grammar",topLevelInitializer:r,initializer:o,rules:a,location:Wt()}):(Ht=e,e=n),e}function ne(){var e,r,o,a,i,u,s,c;return e=Ht,(r=me())!==n?(Re(),o=Ht,(a=Ae())!==n?(Re(),o=a):(Ht=o,o=n),o===n&&(o=null),61===t.charCodeAt(Ht)?(a="=",Ht++):(a=n,0===zt&&ee(C)),a!==n?(Re(),(i=oe())!==n&&Ie()!==n?(Gt=e,s=o,c=i,e={type:"rule",name:(u=r)[0],nameLocation:u[1],expression:null!==s?{type:"named",name:s,expression:c,location:Wt()}:c,location:Wt()}):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n),e}function oe(){var e,r,o,a,i,u,s,c;if(e=Ht,(r=ae())!==n){for(o=[],a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===zt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);a!==n;)o.push(a),a=Ht,Re(),47===t.charCodeAt(Ht)?(i="/",Ht++):(i=n,0===zt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Ht=a,a=n)):(Ht=a,a=n);Gt=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Wt()}:s}else Ht=e,e=n;return e}function ae(){var t,e,r,o;return t=Ht,(e=function(){var t,e,r,o,a,i,u;if(t=Ht,(e=ie())!==n){for(r=[],o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);o!==n;)r.push(o),o=Ht,Re(),(a=ie())!==n?o=a:(Ht=o,o=n);Gt=t,i=e,t=(u=r).length>0||"labeled"===i.type&&i.pick?{type:"sequence",elements:[i].concat(u),location:Wt()}:i}else Ht=t,t=n;return t}())!==n?(r=Ht,Re(),(o=ke())!==n?r=o:(Ht=r,r=n),r===n&&(r=null),Gt=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Wt()}:t}(e,r)):(Ht=t,t=n),t}function ie(){var e,r,o,a,i,u,s;return e=Ht,(r=function(){var e,r;return e=Ht,64===t.charCodeAt(Ht)?(r="@",Ht++):(r=n,0===zt&&ee(S)),r!==n&&(Gt=e,r=Wt()),r}())!==n?((o=ue())===n&&(o=null),(a=se())!==n?(Gt=e,i=r,u=o,(s=a).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',i),e={type:"labeled",label:null!==u?u[0]:null,labelLocation:null!==u?u[1]:i,pick:!0,expression:s,location:Wt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=Ht,(r=ue())!==n?(o=Re(),(a=se())!==n?(Gt=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Wt()}}(r,a)):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=se())),e}function ue(){var e,r,o,a;return e=Ht,(r=me())!==n?(Re(),58===t.charCodeAt(Ht)?(o=":",Ht++):(o=n,0===zt&&ee($)),o!==n?(Gt=e,a=r,Te.indexOf(a[0])>=0&&Vt(`Label can't be a reserved word "${a[0]}"`,a[1]),e=a):(Ht=e,e=n)):(Ht=e,e=n),e}function se(){var e,r,o,a;return e=Ht,(r=function(){var e;return 36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===zt&&ee(O)),e===n&&(38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===zt&&ee(P)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===zt&&ee(F)))),e}())!==n?(Re(),(o=ce())!==n?(Gt=e,a=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:a,location:Wt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,a;return e=Ht,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Ht)?(e="?",Ht++):(e=n,0===zt&&ee(L)),e===n&&(42===t.charCodeAt(Ht)?(e="*",Ht++):(e=n,0===zt&&ee(k)),e===n&&(43===t.charCodeAt(Ht)?(e="+",Ht++):(e=n,0===zt&&ee(R)))),e}())!==n?(Gt=e,a=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:a,location:Wt()}):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,a,i;return(e=function(){var e,r,o;return zt++,e=Ht,(r=Ae())!==n?(105===t.charCodeAt(Ht)?(o="i",Ht++):(o=n,0===zt&&ee(ut)),o===n&&(o=null),Gt=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Wt()}):(Ht=e,e=n),zt--,e===n&&(r=n,0===zt&&ee(it)),e}())===n&&(e=function(){var e,r,o,a,i,u,s,c;if(zt++,e=Ht,91===t.charCodeAt(Ht)?(r="[",Ht++):(r=n,0===zt&&ee(ft)),r!==n){for(94===t.charCodeAt(Ht)?(o="^",Ht++):(o=n,0===zt&&ee(_t)),o===n&&(o=null),a=[],(i=Ce())===n&&(i=xe());i!==n;)a.push(i),(i=Ce())===n&&(i=xe());93===t.charCodeAt(Ht)?(i="]",Ht++):(i=n,0===zt&&ee(ht)),i!==n?(105===t.charCodeAt(Ht)?(u="i",Ht++):(u=n,0===zt&&ee(ut)),u===n&&(u=null),Gt=e,s=o,c=u,e={type:"class",parts:a.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Wt()}):(Ht=e,e=n)}else Ht=e,e=n;return zt--,e===n&&(r=n,0===zt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Ht,46===t.charCodeAt(Ht)?(r=".",Ht++):(r=n,0===zt&&ee($t)),r!==n&&(Gt=e,r={type:"any",location:Wt()}),r}())===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,(r=me())!==n?(o=Ht,zt++,a=Ht,i=Re(),u=Ht,(s=Ae())!==n?u=s=[s,Re()]:(Ht=u,u=n),u===n&&(u=null),61===t.charCodeAt(Ht)?(s="=",Ht++):(s=n,0===zt&&ee(C)),s!==n?a=i=[i,u,s]:(Ht=a,a=n),zt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(Gt=e,e={type:"rule_ref",name:r[0],location:Wt()}):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Ht,(r=function(){var e;return 38===t.charCodeAt(Ht)?(e="&",Ht++):(e=n,0===zt&&ee(P)),e===n&&(33===t.charCodeAt(Ht)?(e="!",Ht++):(e=n,0===zt&&ee(F))),e}())!==n?(Re(),(o=ke())!==n?(Gt=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Wt()}}(r,o)):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Ht,40===t.charCodeAt(Ht)?(r="(",Ht++):(r=n,0===zt&&ee(I)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Ht)?(a=")",Ht++):(a=n,0===zt&&ee(T)),a!==n?(Gt=e,e="labeled"===(i=o).type||"sequence"===i.type?{type:"group",expression:i,location:Wt()}:i):(Ht=e,e=n)):(Ht=e,e=n)):(Ht=e,e=n)),e}function pe(){var e;return t.length>Ht?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(j)),e}function fe(){var e;return zt++,9===t.charCodeAt(Ht)?(e="\t",Ht++):(e=n,0===zt&&ee(D)),e===n&&(11===t.charCodeAt(Ht)?(e="\v",Ht++):(e=n,0===zt&&ee(B)),e===n&&(12===t.charCodeAt(Ht)?(e="\f",Ht++):(e=n,0===zt&&ee(M)),e===n&&(32===t.charCodeAt(Ht)?(e=" ",Ht++):(e=n,0===zt&&ee(U)),e===n&&(160===t.charCodeAt(Ht)?(e="\xa0",Ht++):(e=n,0===zt&&ee(H)),e===n&&(65279===t.charCodeAt(Ht)?(e="\ufeff",Ht++):(e=n,0===zt&&ee(G)),e===n&&(e=function(){var e;return A.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Mt)),e}())))))),zt--,e===n&&0===zt&&ee(N),e}function _e(){var e;return u.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(q)),e}function he(){var e;return zt++,10===t.charCodeAt(Ht)?(e="\n",Ht++):(e=n,0===zt&&ee(K)),e===n&&("\r\n"===t.substr(Ht,2)?(e="\r\n",Ht+=2):(e=n,0===zt&&ee(z)),e===n&&(13===t.charCodeAt(Ht)?(e="\r",Ht++):(e=n,0===zt&&ee(W)),e===n&&(8232===t.charCodeAt(Ht)?(e="\u2028",Ht++):(e=n,0===zt&&ee(V)),e===n&&(8233===t.charCodeAt(Ht)?(e="\u2029",Ht++):(e=n,0===zt&&ee(X)))))),zt--,e===n&&0===zt&&ee(Y),e}function de(){var e;return zt++,(e=function(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===zt&&ee(Q)),r!==n){for(o=[],a=Ht,i=Ht,zt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===zt&&ee(Z)),zt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,zt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===zt&&ee(Z)),zt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===zt&&ee(Z)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}())===n&&(e=ve()),zt--,e===n&&0===zt&&ee(J),e}function ye(){var e,r,o,a,i,u;if(e=Ht,"/*"===t.substr(Ht,2)?(r="/*",Ht+=2):(r=n,0===zt&&ee(Q)),r!==n){for(o=[],a=Ht,i=Ht,zt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===zt&&ee(Z)),u===n&&(u=_e()),zt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,zt++,"*/"===t.substr(Ht,2)?(u="*/",Ht+=2):(u=n,0===zt&&ee(Z)),u===n&&(u=_e()),zt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);"*/"===t.substr(Ht,2)?(a="*/",Ht+=2):(a=n,0===zt&&ee(Z)),a!==n?e=r=[r,o,a]:(Ht=e,e=n)}else Ht=e,e=n;return e}function ve(){var e,r,o,a,i,u;if(e=Ht,"//"===t.substr(Ht,2)?(r="//",Ht+=2):(r=n,0===zt&&ee(tt)),r!==n){for(o=[],a=Ht,i=Ht,zt++,u=_e(),zt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);a!==n;)o.push(a),a=Ht,i=Ht,zt++,u=_e(),zt--,u===n?i=void 0:(Ht=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Ht=a,a=n);e=r=[r,o]}else Ht=e,e=n;return e}function me(){var t,e,r,o;if(zt++,t=Ht,(e=ge())!==n){for(r=[],o=be();o!==n;)r.push(o),o=be();Gt=t,t=[e+r.join(""),Wt()]}else Ht=t,t=n;return zt--,t===n&&(e=n,0===zt&&ee(et)),t}function ge(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(It)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Ft)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Lt)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(kt)),e}())===n&&(e=function(){var e;return g.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Dt)),e}()),e}())===n&&(36===t.charCodeAt(Ht)?(e="$",Ht++):(e=n,0===zt&&ee(O)),e===n&&(95===t.charCodeAt(Ht)?(e="_",Ht++):(e=n,0===zt&&ee(rt)),e===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===zt&&ee(nt)),r!==n&&(o=Pe())!==n?e=o:(Ht=e,e=n)))),e}function be(){var e;return(e=ge())===n&&(e=function(){var e;return(e=function(){var e;return v.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(jt)),e}())===n&&(e=function(){var e;return y.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Tt)),e}()),e}())===n&&(e=function(){var e;return m.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Nt)),e}())===n&&(e=function(){var e;return b.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(Bt)),e}())===n&&(8204===t.charCodeAt(Ht)?(e="\u200c",Ht++):(e=n,0===zt&&ee(ot)),e===n&&(8205===t.charCodeAt(Ht)?(e="\u200d",Ht++):(e=n,0===zt&&ee(at)))),e}function Ae(){var e,r,o,a;if(zt++,e=Ht,34===t.charCodeAt(Ht)?(r='"',Ht++):(r=n,0===zt&&ee(ct)),r!==n){for(o=[],a=Ee();a!==n;)o.push(a),a=Ee();34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===zt&&ee(ct)),a!==n?(Gt=e,e=o.join("")):(Ht=e,e=n)}else Ht=e,e=n;if(e===n)if(e=Ht,39===t.charCodeAt(Ht)?(r="'",Ht++):(r=n,0===zt&&ee(lt)),r!==n){for(o=[],a=we();a!==n;)o.push(a),a=we();39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===zt&&ee(lt)),a!==n?(Gt=e,e=function(t){return t.join("")}(o)):(Ht=e,e=n)}else Ht=e,e=n;return zt--,e===n&&(r=n,0===zt&&ee(st)),e}function Ee(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,zt++,34===t.charCodeAt(Ht)?(a='"',Ht++):(a=n,0===zt&&ee(ct)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===zt&&ee(nt)),a===n&&(a=_e())),zt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===zt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function we(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,zt++,39===t.charCodeAt(Ht)?(a="'",Ht++):(a=n,0===zt&&ee(lt)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===zt&&ee(nt)),a===n&&(a=_e())),zt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===zt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Ce(){var e,r,o,a,i,u;return e=Ht,(r=xe())!==n?(45===t.charCodeAt(Ht)?(o="-",Ht++):(o=n,0===zt&&ee(dt)),o!==n&&(a=xe())!==n?(Gt=e,u=a,(i=r).charCodeAt(0)>u.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(Gt,Ht)+"."),e=[i,u]):(Ht=e,e=n)):(Ht=e,e=n),e}function xe(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,zt++,93===t.charCodeAt(Ht)?(a="]",Ht++):(a=n,0===zt&&ee(ht)),a===n&&(92===t.charCodeAt(Ht)?(a="\\",Ht++):(a=n,0===zt&&ee(nt)),a===n&&(a=_e())),zt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),(e=r!==n?t.substring(e,Ht):r)===n&&(e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===zt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Ht=e,e=n),e===n&&(e=Se())),e}function Se(){var e,r;return e=Ht,92===t.charCodeAt(Ht)?(r="\\",Ht++):(r=n,0===zt&&ee(nt)),r!==n&&he()!==n?(Gt=e,e=""):(Ht=e,e=n),e}function $e(){var e,r,o,a;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,a;return e=Ht,r=Ht,o=Ht,zt++,(a=function(){var e;return(e=Oe())===n&&(e=Fe())===n&&(120===t.charCodeAt(Ht)?(e="x",Ht++):(e=n,0===zt&&ee(wt)),e===n&&(117===t.charCodeAt(Ht)?(e="u",Ht++):(e=n,0===zt&&ee(Ct)))),e}())===n&&(a=_e()),zt--,a===n?o=void 0:(Ht=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Ht=r,r=n),r!==n?t.substring(e,Ht):r}()),e}())===n&&(e=Ht,48===t.charCodeAt(Ht)?(r="0",Ht++):(r=n,0===zt&&ee(yt)),r!==n?(o=Ht,zt++,a=Fe(),zt--,a===n?o=void 0:(Ht=o,o=n),o!==n?(Gt=e,e="\0"):(Ht=e,e=n)):(Ht=e,e=n),e===n&&(e=function(){var e,r,o,a,i,u,s;return e=Ht,120===t.charCodeAt(Ht)?(r="x",Ht++):(r=n,0===zt&&ee(wt)),r!==n?(o=Ht,a=Ht,(i=Le())!==n&&(u=Le())!==n?a=i=[i,u]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(Gt=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Ht=e,e=n)):(Ht=e,e=n),e}())===n&&(e=Pe())),e}function Oe(){var e,r;return 39===t.charCodeAt(Ht)?(e="'",Ht++):(e=n,0===zt&&ee(lt)),e===n&&(34===t.charCodeAt(Ht)?(e='"',Ht++):(e=n,0===zt&&ee(ct)),e===n&&(92===t.charCodeAt(Ht)?(e="\\",Ht++):(e=n,0===zt&&ee(nt)),e===n&&(e=Ht,98===t.charCodeAt(Ht)?(r="b",Ht++):(r=n,0===zt&&ee(vt)),r!==n&&(Gt=e,r="\b"),(e=r)===n&&(e=Ht,102===t.charCodeAt(Ht)?(r="f",Ht++):(r=n,0===zt&&ee(mt)),r!==n&&(Gt=e,r="\f"),(e=r)===n&&(e=Ht,110===t.charCodeAt(Ht)?(r="n",Ht++):(r=n,0===zt&&ee(gt)),r!==n&&(Gt=e,r="\n"),(e=r)===n&&(e=Ht,114===t.charCodeAt(Ht)?(r="r",Ht++):(r=n,0===zt&&ee(bt)),r!==n&&(Gt=e,r="\r"),(e=r)===n&&(e=Ht,116===t.charCodeAt(Ht)?(r="t",Ht++):(r=n,0===zt&&ee(At)),r!==n&&(Gt=e,r="\t"),(e=r)===n&&(e=Ht,118===t.charCodeAt(Ht)?(r="v",Ht++):(r=n,0===zt&&ee(Et)),r!==n&&(Gt=e,r="\v"),e=r)))))))),e}function Pe(){var e,r,o,a,i,u,s,c,l;return e=Ht,117===t.charCodeAt(Ht)?(r="u",Ht++):(r=n,0===zt&&ee(Ct)),r!==n?(o=Ht,a=Ht,(i=Le())!==n&&(u=Le())!==n&&(s=Le())!==n&&(c=Le())!==n?a=i=[i,u,s,c]:(Ht=a,a=n),(o=a!==n?t.substring(o,Ht):a)!==n?(Gt=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Ht=e,e=n)):(Ht=e,e=n),e}function Fe(){var e;return s.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(xt)),e}function Le(){var e;return c.test(t.charAt(Ht))?(e=t.charAt(Ht),Ht++):(e=n,0===zt&&ee(St)),e}function ke(){var e,r,o,a;return zt++,e=Ht,123===t.charCodeAt(Ht)?(r="{",Ht++):(r=n,0===zt&&ee(E)),r!==n?(o=function(){var e,r;return e=Ht,r=function e(){var r,o,a,i,u,s;if(r=Ht,o=[],a=[],i=Ht,u=Ht,zt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===zt&&ee(Pt)),zt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,zt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===zt&&ee(Pt)),zt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;for(a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===zt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===zt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n));a!==n;){if(o.push(a),a=[],i=Ht,u=Ht,zt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===zt&&ee(Pt)),zt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Ht,u=Ht,zt++,l.test(t.charAt(Ht))?(s=t.charAt(Ht),Ht++):(s=n,0===zt&&ee(Pt)),zt--,s===n?u=void 0:(Ht=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Ht=i,i=n);else a=n;a===n&&(a=Ht,123===t.charCodeAt(Ht)?(i="{",Ht++):(i=n,0===zt&&ee(E)),i!==n?(u=e(),125===t.charCodeAt(Ht)?(s="}",Ht++):(s=n,0===zt&&ee(w)),s!==n?a=i=[i,u,s]:(Ht=a,a=n)):(Ht=a,a=n))}return t.substring(r,Ht)}(),Gt=e,r=function(t){return[t,Wt()]}(r)}(),125===t.charCodeAt(Ht)?(a="}",Ht++):(a=n,0===zt&&ee(w)),a!==n?e=o:(Ht=e,e=n)):(Ht=e,e=n),zt--,e===n&&(r=n,0===zt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=he())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=he())===n&&(e=de());return t}function Ie(){var e,r,o,a;return e=Ht,r=Re(),59===t.charCodeAt(Ht)?(o=";",Ht++):(o=n,0===zt&&ee(Ut)),o!==n?e=r=[r,o]:(Ht=e,e=n),e===n&&(e=Ht,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=ye());e!==n;)t.push(e),(e=fe())===n&&(e=ye());return t}(),(o=ve())===n&&(o=null),(a=he())!==n?e=r=[r,o,a]:(Ht=e,e=n),e===n&&(e=Ht,r=Re(),(o=function(){var e,r;return e=Ht,zt++,t.length>Ht?(r=t.charAt(Ht),Ht++):(r=n,0===zt&&ee(j)),zt--,r===n?e=void 0:(Ht=e,e=n),e}())!==n?e=r=[r,o]:(Ht=e,e=n))),e}const Te=e.reservedWords||[];if((r=i())!==n&&Ht===t.length)return r;throw r!==n&&Ht{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(u[p]=f)}}catch(_){c.e(_)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},i),{},{name:u.remarks?_$base64_4.Base64.decode(u.remarks):i.server,"protocol-param":(0,_$utils_105.getIfNotBlank)(_$base64_4.Base64.decode(u.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_105.getIfNotBlank)(_$base64_4.Base64.decode(u.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={},a=___createForOfIteratorHelper_70(n);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(-1!==i.indexOf("=")){var u=___slicedToArray_70(i.split("="),2),s=u[0],c=u[1];o[s.trim()]=c.trim()}}}catch(h){a.e(h)}finally{a.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_105.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_105.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_105.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_105.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_105.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_105.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_105.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),_={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_105.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_105.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(_.network="ws",_["ws-opts"]={path:(0,_$utils_105.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_105.getIfNotBlank)(f.host)}},_.tls&&f.host&&(_.sni=f.host)),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$artifacts_90={};function ___typeof_90(t){return(___typeof_90="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_90,"__esModule",{value:!0}),_$artifacts_90.default=function(t){___app_90.default.read(_$constants_67.ARTIFACTS_KEY)||___app_90.default.write({},_$constants_67.ARTIFACTS_KEY),t.route("/api/artifacts").get(getAllArtifacts).post(createArtifact),t.route("/api/artifact/:name").get(getArtifact).patch(updateArtifact).delete(deleteArtifact),t.get("/api/sync/artifacts",syncAllArtifacts),t.get("/api/sync/artifact/:name",syncArtifact)},_$artifacts_90.produceArtifact=produceArtifact,_$artifacts_90.syncToGist=syncToGist;var _proxyUtils=_$proxyUtils_69({}),___download_90=___interopRequireDefault_90(_$download_101),_gist=___interopRequireDefault_90(_$gist_104),___app_90=___interopRequireDefault_90(_$app_68);function ___interopRequireDefault_90(t){return t&&t.__esModule?t:{default:t}}function ___createForOfIteratorHelper_90(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_90(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_90(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_90(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_90(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_90(t){for(var e=1;e>>").concat(JSON.stringify(a,null,2))),t.prev=11,t.next=14,syncToGist(___defineProperty_90({},encodeURIComponent(a.name),{content:i}));case 14:u=t.sent,a.updated=(new Date).getTime(),s=JSON.parse(u.body),a.url=s.files[encodeURIComponent(a.name)].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_90.default.write(o,_$constants_67.ARTIFACTS_KEY),(0,_$response_96.success)(r,a),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),(0,_$response_96.failed)(r,new _$errors_93.InternalServerError("FAILED_TO_SYNC_ARTIFACT","Failed to sync artifact ".concat(n),"Reason: ".concat(t.t0)));case 25:case"end":return t.stop()}}),t,null,[[11,22]])})))).apply(this,arguments)}function syncAllArtifacts(t,e){return _syncAllArtifacts.apply(this,arguments)}function _syncAllArtifacts(){return(_syncAllArtifacts=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e,r){var n,o,a,i,u,s,c;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ___app_90.default.info("\u5f00\u59cb\u540c\u6b65\u6240\u6709\u8fdc\u7a0b\u914d\u7f6e..."),n=___app_90.default.read(_$constants_67.ARTIFACTS_KEY),o={},t.prev=3,t.next=6,Promise.all(n.map(function(){var t=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sync){t.next=6;break}return ___app_90.default.info("\u6b63\u5728\u540c\u6b65\u4e91\u914d\u7f6e\uff1a".concat(e.name,"...")),t.next=4,produceArtifact({type:e.type,name:e.source,platform:e.platform});case 4:r=t.sent,o[e.name]={content:r};case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return t.next=8,syncToGist(o);case 8:a=t.sent,i=JSON.parse(a.body),u=___createForOfIteratorHelper_90(n);try{for(u.s();!(s=u.n()).done;)(c=s.value).updated=(new Date).getTime(),c.url=i.files[c.name].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1")}catch(e){u.e(e)}finally{u.f()}___app_90.default.write(n,_$constants_67.ARTIFACTS_KEY),___app_90.default.info("\u5168\u90e8\u8ba2\u9605\u540c\u6b65\u6210\u529f\uff01"),(0,_$response_96.success)(r),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(3),(0,_$response_96.failed)(r,new _$errors_93.InternalServerError("FAILED_TO_SYNC_ARTIFACTS","Failed to sync all artifacts","Reason: ".concat(t.t0))),___app_90.default.info("\u540c\u6b65\u8ba2\u9605\u5931\u8d25\uff0c\u539f\u56e0\uff1a".concat(t.t0));case 21:case"end":return t.stop()}}),t,null,[[3,17]])})))).apply(this,arguments)}function syncToGist(t){return _syncToGist.apply(this,arguments)}function _syncToGist(){return(_syncToGist=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r,n,o;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=___app_90.default.read(_$constants_67.SETTINGS_KEY),n=r.gistToken){t.next=3;break}return t.abrupt("return",Promise.reject("\u672a\u8bbe\u7f6eGist Token\uff01"));case 3:return o=new _gist.default({token:n,key:_$constants_67.ARTIFACT_REPOSITORY_KEY}),t.abrupt("return",o.upload(e));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function produceArtifact(t){return _produceArtifact.apply(this,arguments)}function _produceArtifact(){return(_produceArtifact=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r,n,o,a,i,u,s,c,l,p,f,_,h,d,y,v,m,g,b,A,E,w,C,x,S,$,O,P,F,L;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.type,n=e.name,"ShadowRocket"===(o=(o=e.platform)||"JSON")&&(o="Clash"),"subscription"!==r){t.next=40;break}if(a=___app_90.default.read(_$constants_67.SUBS_KEY),"local"!==(i=(0,_$database_100.findByName)(a,n)).source){t.next=10;break}u=i.content,t.next=13;break;case 10:return t.next=12,(0,___download_90.default)(i.url,i.ua);case 12:u=t.sent;case 13:return s=_proxyUtils.ProxyUtils.parse(u),t.next=16,_proxyUtils.ProxyUtils.process(s,i.process||[],o);case 16:s=t.sent,c={},l=___createForOfIteratorHelper_90(s),t.prev=19,l.s();case 21:if((p=l.n()).done){t.next=29;break}if(f=p.value,!c[f.name]){t.next=26;break}return ___app_90.default.notify("\ud83c\udf0d Sub-Store","\u26a0\ufe0f \u8ba2\u9605\u5305\u542b\u91cd\u590d\u8282\u70b9\uff01","\u8bf7\u4ed4\u7ec6\u68c0\u6d4b\u914d\u7f6e\uff01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"}),t.abrupt("break",29);case 26:c[f.name]=!0;case 27:t.next=21;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(19),l.e(t.t0);case 34:return t.prev=34,l.f(),t.finish(34);case 37:return t.abrupt("return",_proxyUtils.ProxyUtils.produce(s,o));case 40:if("collection"!==r){t.next=78;break}return _=___app_90.default.read(_$constants_67.SUBS_KEY),h=___app_90.default.read(_$constants_67.COLLECTIONS_KEY),d=(0,_$database_100.findByName)(h,n),y=d.subscriptions,v={},m=0,t.next=49,Promise.all(y.map(function(){var t=___asyncToGenerator_90(___regeneratorRuntime_90().mark((function t(e){var r,n,a;return ___regeneratorRuntime_90().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,_$database_100.findByName)(_,e),t.prev=1,___app_90.default.info("\u6b63\u5728\u5904\u7406\u5b50\u8ba2\u9605\uff1a".concat(r.name,"...")),"local"!==r.source){t.next=7;break}n=r.content,t.next=10;break;case 7:return t.next=9,(0,___download_90.default)(r.url,r.ua);case 9:n=t.sent;case 10:return a=_proxyUtils.ProxyUtils.parse(n),t.next=13,_proxyUtils.ProxyUtils.process(a,r.process||[],o);case 13:a=t.sent,v[e]=a,m++,___app_90.default.info("\u2705 \u5b50\u8ba2\u9605\uff1a".concat(r.name,"\u52a0\u8f7d\u6210\u529f\uff0c\u8fdb\u5ea6--").concat(100*(m/y.length).toFixed(1),"% ")),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(1),m++,___app_90.default.error("\u274c \u5904\u7406\u7ec4\u5408\u8ba2\u9605\u4e2d\u7684\u5b50\u8ba2\u9605: ".concat(r.name,"\u65f6\u51fa\u73b0\u9519\u8bef\uff1a").concat(t.t0,"\uff0c\u8be5\u8ba2\u9605\u5df2\u88ab\u8df3\u8fc7\uff01\u8fdb\u5ea6--").concat(100*(m/y.length).toFixed(1),"%"));case 23:case"end":return t.stop()}}),t,null,[[1,19]])})));return function(e){return t.apply(this,arguments)}}()));case 49:return g=Array.prototype.concat.apply([],y.map((function(t){return v[t]}))),t.next=52,_proxyUtils.ProxyUtils.process(g,d.process||[],o);case 52:if(0!==(g=t.sent).length){t.next=55;break}throw new Error("\u7ec4\u5408\u8ba2\u9605\u4e2d\u4e0d\u542b\u6709\u6548\u8282\u70b9\uff01");case 55:b={},A=___createForOfIteratorHelper_90(g),t.prev=57,A.s();case 59:if((E=A.n()).done){t.next=67;break}if(w=E.value,!b[w.name]){t.next=64;break}return ___app_90.default.notify("\ud83c\udf0d Sub-Store","\u26a0\ufe0f \u8ba2\u9605\u5305\u542b\u91cd\u590d\u8282\u70b9\uff01","\u8bf7\u4ed4\u7ec6\u68c0\u6d4b\u914d\u7f6e\uff01",{"media-url":"https://cdn3.iconfinder.com/data/icons/seo-outline-1/512/25_code_program_programming_develop_bug_search_developer-512.png"}),t.abrupt("break",67);case 64:b[w.name]=!0;case 65:t.next=59;break;case 67:t.next=72;break;case 69:t.prev=69,t.t1=t.catch(57),A.e(t.t1);case 72:return t.prev=72,A.f(),t.finish(72);case 75:return t.abrupt("return",_proxyUtils.ProxyUtils.produce(g,o));case 78:if("rule"!==r){t.next=105;break}C=___app_90.default.read(_$constants_67.RULES_KEY),x=(0,_$database_100.findByName)(C,n),S=[],$=0;case 83:if(!($=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_92(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_92(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_92(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_92(a,n,o,i,u,"throw",t)}i(void 0)}))}}function downloadSubscription(t,e){return _downloadSubscription.apply(this,arguments)}function _downloadSubscription(){return(_downloadSubscription=___asyncToGenerator_92(___regeneratorRuntime_92().mark((function t(e,r){var n,o,a,i,u,s;return ___regeneratorRuntime_92().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.params.name,n=decodeURIComponent(n),o=e.query.target||(0,_$platform_108.getPlatformFromHeaders)(e.headers)||"JSON",___app_92.default.info("\u6b63\u5728\u4e0b\u8f7d\u8ba2\u9605\uff1a".concat(n)),a=___app_92.default.read(_$constants_67.SUBS_KEY),!(i=(0,_$database_100.findByName)(a,n))){t.next=26;break}return t.prev=7,t.next=10,(0,_$artifacts_90.produceArtifact)({type:"subscription",name:n,platform:o});case 10:if(u=t.sent,"local"===i.source){t.next=16;break}return t.next=14,(0,_$flow_102.getFlowHeaders)(i.url);case 14:(s=t.sent)&&r.set("subscription-userinfo",s);case 16:"JSON"===o?r.set("Content-Type","application/json;charset=utf-8").send(u):r.send(u),t.next=24;break;case 19:t.prev=19,t.t0=t.catch(7),___app_92.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u8ba2\u9605\u5931\u8d25","\u274c \u65e0\u6cd5\u4e0b\u8f7d\u8ba2\u9605\uff1a".concat(n,"\uff01"),"\ud83e\udd14 \u539f\u56e0\uff1a".concat(JSON.stringify(t.t0))),___app_92.default.error(JSON.stringify(t.t0)),(0,_$response_96.failed)(r,new _$errors_93.InternalServerError("INTERNAL_SERVER_ERROR","Failed to download subscription: ".concat(n),"Reason: ".concat(JSON.stringify(t.t0))));case 24:t.next=28;break;case 26:___app_92.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u8ba2\u9605\uff1a".concat(n,"\uff01")),(0,_$response_96.failed)(r,new _$errors_93.ResourceNotFoundError("RESOURCE_NOT_FOUND","Subscription ".concat(n," does not exist!")),404);case 28:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}function downloadCollection(t,e){return _downloadCollection.apply(this,arguments)}function _downloadCollection(){return(_downloadCollection=___asyncToGenerator_92(___regeneratorRuntime_92().mark((function t(e,r){var n,o,a,i,u,s,c,l,p;return ___regeneratorRuntime_92().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.params.name,n=decodeURIComponent(n),o=e.query.target||(0,_$platform_108.getPlatformFromHeaders)(e.headers)||"JSON",a=___app_92.default.read(_$constants_67.COLLECTIONS_KEY),i=(0,_$database_100.findByName)(a,n),___app_92.default.info("\u6b63\u5728\u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n)),!i){t.next=29;break}return t.prev=7,t.next=10,(0,_$artifacts_90.produceArtifact)({type:"collection",name:n,platform:o});case 10:if(u=t.sent,s=___app_92.default.read(_$constants_67.SUBS_KEY),!((c=i.subscriptions).length>0)){t.next=20;break}if("local"===(l=(0,_$database_100.findByName)(s,c[0])).source){t.next=20;break}return t.next=18,(0,_$flow_102.getFlowHeaders)(l.url);case 18:(p=t.sent)&&r.set("subscription-userinfo",p);case 20:"JSON"===o?r.set("Content-Type","application/json;charset=utf-8").send(u):r.send(u),t.next=27;break;case 23:t.prev=23,t.t0=t.catch(7),___app_92.default.notify("\ud83c\udf0d Sub-Store \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)),(0,_$response_96.failed)(r,new _$errors_93.InternalServerError("INTERNAL_SERVER_ERROR","Failed to download collection: ".concat(n),"Reason: ".concat(JSON.stringify(t.t0))));case 27:t.next=31;break;case 29:___app_92.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n,"\uff01")),(0,_$response_96.failed)(r,new _$errors_93.ResourceNotFoundError("RESOURCE_NOT_FOUND","Collection ".concat(n," does not exist!")),404);case 31:case"end":return t.stop()}}),t,null,[[7,23]])})))).apply(this,arguments)}var _$settings_97={};Object.defineProperty(_$settings_97,"__esModule",{value:!0}),_$settings_97.default=function(t){___app_97.default.read(_$constants_67.SETTINGS_KEY)||___app_97.default.write({},_$constants_67.SETTINGS_KEY),t.route("/api/settings").get(getSettings).patch(updateSettings)},_$settings_97.updateArtifactStore=updateArtifactStore,_$settings_97.updateGitHubAvatar=updateGitHubAvatar;var ___app_97=___interopRequireDefault_97(_$app_68),___gist_97=___interopRequireDefault_97(_$gist_104);function ___interopRequireDefault_97(t){return t&&t.__esModule?t:{default:t}}function ___typeof_97(t){return(___typeof_97="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_97(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_97(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_97(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_97(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_97(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_97(a,n,o,i,u,"throw",t)}i(void 0)}))}}function getSettings(t,e){return _getSettings.apply(this,arguments)}function _getSettings(){return(_getSettings=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(e,r){var n;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=___app_97.default.read(_$constants_67.SETTINGS_KEY)).avatarUrl){t.next=4;break}return t.next=4,updateGitHubAvatar();case 4:if(n.artifactStore){t.next=7;break}return t.next=7,updateArtifactStore();case 7:(0,_$response_96.success)(r,n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function updateSettings(t,e){return _updateSettings.apply(this,arguments)}function _updateSettings(){return(_updateSettings=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(e,r){var n,o;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=___app_97.default.read(_$constants_67.SETTINGS_KEY),o=___objectSpread_97(___objectSpread_97({},n),e.body),___app_97.default.write(o,_$constants_67.SETTINGS_KEY),t.next=5,updateGitHubAvatar();case 5:return t.next=7,updateArtifactStore();case 7:(0,_$response_96.success)(r,o);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function updateGitHubAvatar(){return _updateGitHubAvatar.apply(this,arguments)}function _updateGitHubAvatar(){return(_updateGitHubAvatar=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(){var e,r,n;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=___app_97.default.read(_$constants_67.SETTINGS_KEY),!(r=e.githubUser)){t.next=14;break}return t.prev=3,t.next=6,___app_97.default.http.get({url:"https://api.github.com/users/".concat(r),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then((function(t){return JSON.parse(t.body)}));case 6:n=t.sent,e.avatarUrl=n.avatar_url,___app_97.default.write(e,_$constants_67.SETTINGS_KEY),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),___app_97.default.error("Failed to fetch GitHub avatar for User: "+r);case 14:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}function updateArtifactStore(){return _updateArtifactStore.apply(this,arguments)}function _updateArtifactStore(){return(_updateArtifactStore=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(){var e,r,n,o,a;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(___app_97.default.log("Updating artifact store"),e=___app_97.default.read(_$constants_67.SETTINGS_KEY),r=e.githubUser,n=e.gistToken,!r||!n){t.next=15;break}return o=new ___gist_97.default({token:n,key:_$constants_67.ARTIFACT_REPOSITORY_KEY}),t.prev=5,t.next=8,o.locate();case 8:-1!==(a=t.sent)&&(e.artifactStore="https://gist.github.com/".concat(r,"/").concat(a),___app_97.default.write(e,_$constants_67.SETTINGS_KEY)),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),___app_97.default.error("Failed to fetch artifact store for User: "+r);case 15:case"end":return t.stop()}}),t,null,[[5,12]])})))).apply(this,arguments)}var _$preview_95={};Object.defineProperty(_$preview_95,"__esModule",{value:!0}),_$preview_95.default=function(t){t.post("/api/preview/sub",compareSub),t.post("/api/preview/collection",compareCollection)};var ___proxyUtils_95=_$proxyUtils_69({}),___download_95=___interopRequireDefault_95(_$download_101),___app_95=___interopRequireDefault_95(_$app_68);function ___interopRequireDefault_95(t){return t&&t.__esModule?t:{default:t}}function ___typeof_95(t){return(___typeof_95="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_95(){___regeneratorRuntime_95=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_95(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_95(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_95(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_95(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_95(a,n,o,i,u,"throw",t)}i(void 0)}))}}function compareSub(t,e){return _compareSub.apply(this,arguments)}function _compareSub(){return(_compareSub=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e,r){var n,o,a,i,u;return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.body,o=e.query.target||"JSON","local"!==n.source){t.next=6;break}a=n.content,t.next=16;break;case 6:return t.prev=6,t.next=9,(0,___download_95.default)(n.url,n.ua);case 9:a=t.sent,t.next=16;break;case 12:return t.prev=12,t.t0=t.catch(6),(0,_$response_96.failed)(r,new _$errors_93.NetworkError("FAILED_TO_DOWNLOAD_RESOURCE","\u65e0\u6cd5\u4e0b\u8f7d\u8fdc\u7a0b\u8d44\u6e90","Reason: ".concat(t.t0))),t.abrupt("return");case 16:return(i=___proxyUtils_95.ProxyUtils.parse(a)).forEach((function(t,e){t.id=e})),t.next=20,___proxyUtils_95.ProxyUtils.process(i,n.process||[],o);case 20:u=t.sent,(0,_$response_96.success)(r,{original:i,processed:u});case 22:case"end":return t.stop()}}),t,null,[[6,12]])})))).apply(this,arguments)}function compareCollection(t,e){return _compareCollection.apply(this,arguments)}function _compareCollection(){return(_compareCollection=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e,r){var n,o,a,i,u,s;return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=___app_95.default.read(_$constants_67.SUBS_KEY),o=e.body,a=o.subscriptions,i={},t.next=6,Promise.all(a.map(function(){var t=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e){var o,a,u;return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=(0,_$database_100.findByName)(n,e),t.prev=1,"local"!==o.source){t.next=6;break}a=o.content,t.next=9;break;case 6:return t.next=8,(0,___download_95.default)(o.url,o.ua);case 8:a=t.sent;case 9:return u=___proxyUtils_95.ProxyUtils.parse(a),t.next=12,___proxyUtils_95.ProxyUtils.process(u,o.process||[],"JSON");case 12:u=t.sent,i[e]=u,t.next=19;break;case 16:t.prev=16,t.t0=t.catch(1),(0,_$response_96.failed)(r,new _$errors_93.InternalServerError("PROCESS_FAILED","\u5904\u7406\u5b50\u8ba2\u9605 ".concat(e," \u5931\u8d25"),"Reason: ".concat(t.t0)));case 19:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()));case 6:return(u=Array.prototype.concat.apply([],a.map((function(t){return i[t]})))).forEach((function(t,e){t.id=e})),t.next=10,___proxyUtils_95.ProxyUtils.process(u,o.process||[],"JSON");case 10:s=t.sent,(0,_$response_96.success)(r,{original:u,processed:s});case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var _$sort_98={};Object.defineProperty(_$sort_98,"__esModule",{value:!0}),_$sort_98.default=function(t){t.post("/api/sort/subs",sortSubs),t.post("/api/sort/collections",sortCollections),t.post("/api/sort/artifacts",sortArtifacts)};var __obj_98,___app_98=(__obj_98=_$app_68)&&__obj_98.__esModule?__obj_98:{default:__obj_98};function sortSubs(t,e){var r=t.body,n=___app_98.default.read(_$constants_67.SUBS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_98.default.write(n,_$constants_67.SUBS_KEY),(0,_$response_96.success)(e,n)}function sortCollections(t,e){var r=t.body,n=___app_98.default.read(_$constants_67.COLLECTIONS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_98.default.write(n,_$constants_67.COLLECTIONS_KEY),(0,_$response_96.success)(e,n)}function sortArtifacts(t,e){var r=t.body,n=___app_98.default.read(_$constants_67.ARTIFACTS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_98.default.write(n,_$constants_67.ARTIFACTS_KEY),(0,_$response_96.success)(e,n)}var _$restful_94={};function ___typeof_94(t){return(___typeof_94="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(_$restful_94,"__esModule",{value:!0}),_$restful_94.default=function(){var t,e,r=(0,_express.default)({substore:___app_94.default});(0,_collections.default)(r),(0,_subscriptions.default)(r),(0,___download_94.default)(r),(0,_preview.default)(r),(0,_sort.default)(r),(0,_settings.default)(r),(0,___artifacts_94.default)(r),r.post("/api/utils/node-info",getNodeInfo),r.get("/api/utils/env",getEnv),r.get("/api/utils/backup",gistBackup),r.get("/api/utils/refresh",refresh),r.route("/api/storage").get((function(t,e){e.json(___app_94.default.read("#sub-store"))})).post((function(t,e){var r=t.body;___app_94.default.write(JSON.stringify(r),"#sub-store"),e.end()})),r.get("/",(e=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.set("location","https://sub-store.vercel.app/").status(302).end();case 1:case"end":return t.stop()}}),t)}))),function(t,r){return e.apply(this,arguments)})),(0,_$openApi_112.ENV)().isQX&&r.options("/",(t=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.status(200).end();case 1:case"end":return t.stop()}}),t)}))),function(e,r){return t.apply(this,arguments)})),r.all("/",(function(t,e){e.send("Hello from sub-store, made with \u2764\ufe0f by Peng-YM")})),r.start()};var _express=___interopRequireDefault_94(_$express_110),___gist_94=___interopRequireDefault_94(_$gist_104),_migration=___interopRequireDefault_94(_$migration_107),___app_94=___interopRequireDefault_94(_$app_68),_subscriptions=___interopRequireDefault_94(_$subscriptions_99),_collections=___interopRequireDefault_94(_$collections_91),___artifacts_94=___interopRequireDefault_94(_$artifacts_90),___download_94=___interopRequireDefault_94(_$download_92),_settings=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_94(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_94(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$settings_97),_preview=___interopRequireDefault_94(_$preview_95),_sort=___interopRequireDefault_94(_$sort_98),___resourceCache_94=___interopRequireDefault_94(_$resourceCache_109),___producers_94=___interopRequireDefault_94(_$producers_78);function ___getRequireWildcardCache_94(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_94=function(t){return t?r:e})(t)}function ___interopRequireDefault_94(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_94(){___regeneratorRuntime_94=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_94(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 A(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 w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_94(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_94(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_94(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_94(a,n,o,i,u,"throw",t)}i(void 0)}))}}function getEnv(t,e){var r=(0,_$openApi_112.ENV)(),n="Node";r.isNode&&(n="Node"),r.isQX&&(n="QX"),r.isLoon&&(n="Loon"),r.isSurge&&(n="Surge"),r.isStash&&(n="Stash"),r.isShadowRocket&&(n="ShadowRocket"),(0,_$response_96.success)(e,{backend:n,version:_$package_66.version})}function refresh(t,e){return _refresh.apply(this,arguments)}function _refresh(){return(_refresh=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_settings.updateGitHubAvatar)();case 2:return t.next=4,(0,_settings.updateArtifactStore)();case 4:___resourceCache_94.default.revokeAll(),(0,_$response_96.success)(r);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gistBackup(t,e){return _gistBackup.apply(this,arguments)}function _gistBackup(){return(_gistBackup=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){var n,o,a,i,u,s,c;return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.query.action,o=___app_94.default.read(_$constants_67.SETTINGS_KEY),a=o.gistToken){t.next=6;break}(0,_$response_96.failed)(r,new _$errors_93.RequestInvalidError("GIST_TOKEN_NOT_FOUND","GitHub Token is required for backup!")),t.next=43;break;case 6:i=new ___gist_94.default({token:a,key:_$constants_67.GIST_BACKUP_KEY}),t.prev=7,s=___app_94.default.read(_$constants_67.SETTINGS_KEY),c=s.syncTime,t.t0=n,t.next="upload"===t.t0?13:"download"===t.t0?29:37;break;case 13:return s.syncTime=(new Date).getTime(),___app_94.default.write(s,_$constants_67.SETTINGS_KEY),u=___app_94.default.read("#sub-store"),___app_94.default.env.isNode&&(u=JSON.stringify(___app_94.default.cache,null," ")),___app_94.default.info("\u4e0a\u4f20\u5907\u4efd\u4e2d..."),t.prev=18,t.next=21,i.upload((l={},p=_$constants_67.GIST_BACKUP_FILE_NAME,f={content:u},p in l?Object.defineProperty(l,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):l[p]=f,l));case 21:t.next=28;break;case 23:throw t.prev=23,t.t1=t.catch(18),s.syncTime=c,___app_94.default.write(s,_$constants_67.SETTINGS_KEY),t.t1;case 28:return t.abrupt("break",37);case 29:return ___app_94.default.info("\u8fd8\u539f\u5907\u4efd\u4e2d..."),t.next=32,i.download(_$constants_67.GIST_BACKUP_FILE_NAME);case 32:return u=t.sent,___app_94.default.write(u,"#sub-store"),___app_94.default.env.isNode&&(u=JSON.parse(u),___app_94.default.cache=u,___app_94.default.persistCache()),(0,_migration.default)(),t.abrupt("break",37);case 37:(0,_$response_96.success)(r),t.next=43;break;case 40:t.prev=40,t.t2=t.catch(7),(0,_$response_96.failed)(r,new _$errors_93.InternalServerError("BACKUP_FAILED","Failed to ".concat(n," data to gist!"),"Reason: ".concat(JSON.stringify(t.t2))));case 43:case"end":return t.stop()}var l,p,f}),t,null,[[7,40],[18,23]])})))).apply(this,arguments)}function getNodeInfo(t,e){return _getNodeInfo.apply(this,arguments)}function _getNodeInfo(){return(_getNodeInfo=___asyncToGenerator_94(___regeneratorRuntime_94().mark((function t(e,r){var n,o,a,i,u;return ___regeneratorRuntime_94().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.body,o=e.query.lang||"zh-CN";try{a=___producers_94.default.URI.produce(n)}catch(s){}return t.prev=3,i=(0,_$openApi_112.HTTP)(),t.next=7,i.get({url:"http://ip-api.com/json/".concat(encodeURIComponent(n.server),"?lang=").concat(o),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"}}).then((function(t){var e=JSON.parse(t.body);if("success"!==e.status)throw new Error(e.message);return delete e.status,e}));case 7:u=t.sent,(0,_$response_96.success)(r,{shareUrl:a,info:u}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),(0,_$response_96.failed)(r,new _$errors_93.NetworkError("FAILED_TO_GET_NODE_INFO","Failed to get node info","Reason: ".concat(t.t0)));case 14:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}var _$main_89={},___migration_89=___interopRequireDefault_89(_$migration_107),_restful=___interopRequireDefault_89(_$restful_94);function ___interopRequireDefault_89(t){return t&&t.__esModule?t:{default:t}}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 Sub-Store -- v".concat(_$package_66.version,"\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,___migration_89.default)(),(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}},_$proxyUtils_69=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ProxyUtils=void 0;var n=c(_$download_104),o=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=function(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return function(t){return t?r:e}(t)}(void 0);if(n&&n.has(t))return n.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}(_$processors_76({})),a=c(_$preprocessors_75),i=c(_$producers_78),u=c(_$parsers_70),s=c(_$app_68);function c(t){return t&&t.__esModule?t:{default:t}}function l(){l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.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(O){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=A(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=c;var f={};function _(){}function h(){}function d(){}var y={};s(y,a,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var g=d.prototype=_.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function A(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,A(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function p(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||h(t,e)||function(){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 _(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=h(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function h(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==x[1]?x[1]:[],a=x.length>2?x[2]:void 0,i=_(r),t.prev=3,i.s();case 5:if((u=i.n()).done){t.next=39;break}if(c=u.value,p=void 0,f={},-1===c.type.indexOf("Script")){t.next=28;break}if(h=c.args,d=h.mode,y=h.content,"link"!==d){t.next=27;break}if((m=(v=y).split("#")).length>1){g=_(m[1].split("&"));try{for(g.s();!(b=g.n()).done;)E=b.value,A=E.split("=")[0],w=E.split("=")[1]||!0,f[A]=w}catch(l){g.e(l)}finally{g.f()}}return t.prev=15,t.next=18,(0,n.default)(v.split("#")[0]);case 18:p=t.sent,t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(15),s.default.error("Error when downloading remote script: ".concat(c.args.content,".\n Reason: ").concat(t.t0)),t.abrupt("continue",37);case 25:t.next=28;break;case 27:p=y;case 28:if(o.default[c.type]){t.next=31;break}return s.default.error('Unknown operator: "'.concat(c.type,'"')),t.abrupt("continue",37);case 31:return s.default.info('Applying "'.concat(c.type,'" with arguments:\n >>> ').concat(JSON.stringify(c.args,null,2)||"None")),C=void 0,C=-1!==c.type.indexOf("Script")?o.default[c.type](p,a,f):o.default[c.type](c.args||{}),t.next=36,(0,o.ApplyProcessor)(C,e);case 36:e=t.sent;case 37:t.next=5;break;case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(3),i.e(t.t1);case 44:return t.prev=44,i.f(),t.finish(44);case 47:return t.abrupt("return",e);case 48:case"end":return t.stop()}}),t,null,[[3,41,44,47],[15,21]])})),(y=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){p(a,n,o,i,u,"next",t)}function u(t){p(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var v={parse:function(t){t=function(t){var e,r=_(a.default);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{if(n.test(t))return s.default.info("Pre-processor [".concat(n.name,"] activated")),n.parse(t)}catch(o){s.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,n=[],o=_(t.split("\n"));try{for(o.s();!(r=o.n()).done;){var i=r.value;if(0!==(i=i.trim()).length){var c=!1;if(e){var l=f(m(e,i),2),p=l[0];l[1]||(n.push(p),c=!0)}if(!c){var h,d=_(u.default);try{for(d.s();!(h=d.n()).done;){var y=h.value,v=f(m(y,i),2),g=v[0];if(!v[1]){n.push(g),e=y,c=!0,s.default.info("".concat(y.name," is activated"));break}}}catch(b){d.e(b)}finally{d.f()}}c||s.default.error("Failed to parse line: ".concat(i))}}}catch(b){o.e(b)}finally{o.f()}return n},process:function(t){return y.apply(this,arguments)},produce:function(t,e){var r=i.default[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])})),s.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 s.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}};function m(t,e){if(!function(t,e){try{return t.test(e)}catch(r){return!1}}(t,e))return[null,new Error("Parser mismatch")];try{return[t.parse(e),null]}catch(r){return[null,r]}}e.ProxyUtils=v})),_$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 a(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|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(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(I(e,ArrayBuffer)||e&&I(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 s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(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 a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return F(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(a)return o?-1:F(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),T(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var a,i=1,u=t.length,s=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;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(a=r;au&&(r=u-s),a=r;a>=0;a--){for(var p=!0,f=0;fo&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i>8,o=r%256,a.push(o),a.push(n);return a}(e,t.length-r),t,r,n)}function m(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:c>223?3:c>191?2:1;if(o+p<=r)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=t[o+1]))&&(s=(31&c)<<6|63&a)>127&&(l=s);break;case 3:a=t[o+1],i=t[o+2],128==(192&a)&&128==(192&i)&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:a=t[o+1],i=t[o+2],u=t[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,p=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=p}return function(t){var e=t.length;if(e<=b)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 w(this,e,r);case"utf8":case"utf-8":return g(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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,a){if(I(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===a&&(a=this.length),e<0||n>t.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&e>=n)return 0;if(o>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(o>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(i,u),c=this.slice(o,a),l=t.slice(e,n),p=0;p>>=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 a=!1;;)switch(n){case"hex":return f(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 v(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;oo)&&(r=o);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,n,o,a,i){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function $(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return e=+e,r>>>=0,o||$(t,0,r,4),_$ieee754_3.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return e=+e,r>>>=0,o||$(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a>>=0,e>>>=0,r||x(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||x(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(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||x(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||x(t,e,this.length);for(var n=this[t],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,o=1,a=this[t+--n];n>0&&(o*=256);)a+=this[t+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*e)),a},r.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||x(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||x(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||x(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||x(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||x(t,4,this.length),_$ieee754_3.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),_$ieee754_3.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),_$ieee754_3.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(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||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[e+o]=255&t;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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);S(this,t,e,r,o-1,-o)}var a=0,i=1,u=0;for(this[e]=255&t;++a>0)-u&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);S(this,t,e,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[e+a]=255&t;--a>=0&&(i*=256);)t<0&&0===u&&0!==this[e+a+1]&&(u=1),this[e+a]=(t/i>>0)-u&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||S(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||S(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||S(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||S(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||S(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 O(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return L(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;--i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return a},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 a=t.charCodeAt(0);("utf8"===o&&a<128||"latin1"===o)&&(t=a)}}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(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.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;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function k(t){return _$base64Js_1.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function T(t){return t!=t}}).call(this)}).call(this,_$buffer_2({}).Buffer)})),_$processors_76=createModuleFactory((function(t,e){"use strict";function r(t){return(r="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(e,"__esModule",{value:!0}),e.ApplyProcessor=function(t,e){return k.apply(this,arguments)},e.default=void 0;var n=u(_$resourceCache_112),o=u(_$lodash_35),a=u(_$app_68),i=_$proxyUtils_69({});function u(t){return t&&t.__esModule?t:{default:t}}function s(){s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(O){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof _?e:_,a=Object.create(o.prototype),i=new x(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=A(i,r);if(u){if(u===f)continue;return u}}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 s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(O){return{type:"throw",arg:O}}}t.wrap=l;var f={};function _(){}function h(){}function d(){}var y={};c(y,a,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==e&&n.call(m,a)&&(y=m);var g=d.prototype=_.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var o;this._invoke=function(a,i){function u(){return new e((function(o,u){!function o(a,i,u,s){var c=p(t[a],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,u,s)}),(function(t){o("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return o("throw",t,u,s)}))}s(c.arg)}(a,i,o,u)}))}return o=o?o.then(u,u):u()}}function A(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,A(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;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,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function w(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),f}},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;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function c(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){c(a,n,o,i,u,"next",t)}function u(t){c(a,n,o,i,u,"throw",t)}i(void 0)}))}}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function f(t,e){if(t){if("string"==typeof t)return _(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)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&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 function(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}(e);default:throw new Error("Unknown sort option: "+t)}}}},"Regex Sort Operator":function(t){return{name:"Regex Sort Operator",func:function(e){return t=t.map((function(t){return S(t)})),e.sort((function(e,r){var n=v(t,e.name),o=v(t,r.name);return n&&!o?-1:o&&!n?1:n&&o?n1){void 0===c[t.name]&&(c[t.name]=1);for(var e="",r=c[t.name]++,n=0;r>0;)e=i[r%10]+e,r=parseInt(r/10),n++;for(;n++=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){asyncGeneratorStep(a,n,o,i,u,"next",t)}function u(t){asyncGeneratorStep(a,n,o,i,u,"throw",t)}i(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.root=JSON.parse(this.node.fs.readFileSync("".concat(t))):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"}),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"}),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"],a=n["media-url"];if(isQX&&$notify(t,e,r,n),isSurge&&$notification.post(t,e,r+"".concat(a?"\n\u591a\u5a92\u4f53:"+a:""),{url:o}),isLoon){var i={};o&&(i.openUrl=o),a&&(i.mediaUrl=a),"{}"===JSON.stringify(i)?$notification.post(t,e,r):$notification.post(t,e,r,i)}if(isNode){var u=r+(o?"\n\u70b9\u51fb\u8df3\u8f6c: ".concat(o):"")+(a?"\n\u591a\u5a92\u4f53: ".concat(a):"");console.log("".concat(t,"\n").concat(e,"\n").concat(u,"\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,isStash:isStash,isShadowRocket:isShadowRocket}}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;if(events.onRequest(method,options),options.node&&isSurge){var build=$environment["surge-build"];build&&parseInt(build)>=2407&&(options["policy-descriptor"]=options.node,delete options.node)}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_115.OpenAPI=OpenAPI;var _$app_68={};Object.defineProperty(_$app_68,"__esModule",{value:!0}),_$app_68.default=void 0;var _default=new _$openApi_115.OpenAPI("sub-store");_$app_68.default=_default;var _$migration_110={};Object.defineProperty(_$migration_110,"__esModule",{value:!0}),_$migration_110.default=function(){var t;(t=_app.default.read(_$constants_67.SCHEMA_VERSION_KEY))||function(){_app.default.info("Start migrating...");var t=_app.default.read(_$constants_67.SUBS_KEY)||{},e=Object.values(t).map((function(t){return t.source=t.source||"remote",s(t),c(t),t}));_app.default.write(e,_$constants_67.SUBS_KEY);var r=_app.default.read(_$constants_67.COLLECTIONS_KEY)||{},n=Object.values(r).map((function(t){return delete t.ua,s(t),c(t),t}));_app.default.write(n,_$constants_67.COLLECTIONS_KEY);var o=_app.default.read(_$constants_67.ARTIFACTS_KEY)||{},a=Object.values(o);_app.default.write(a,_$constants_67.ARTIFACTS_KEY);var i=_app.default.read(_$constants_67.RULES_KEY)||{},u=Object.values(i);function s(t){var e=t["display-name"];e&&(t.displayName=e,delete t["display-name"])}function c(t){var e=t.process;if(e&&0!==e.length){var r,n=[],o={type:"Quick Setting Operator",args:{udp:"DEFAULT",tfo:"DEFAULT",scert:"DEFAULT","vmess aead":"DEFAULT",useless:"DEFAULT"}},a=function(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))){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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(i.type)if("Useless Filter"===i.type)o.args.useless="ENABLED";else if("Set Property Operator"===i.type){var u=i.args,s=u.key,c=u.value;switch(s){case"udp":o.args.udp=c?"ENABLED":"DISABLED";break;case"tfo":o.args.tfo=c?"ENABLED":"DISABLED";break;case"skip-cert-verify":o.args.scert=c?"ENABLED":"DISABLED";break;case"aead":o.args["vmess aead"]=c?"ENABLED":"DISABLED"}}else if(-1!==i.type.indexOf("Keyword"));else if("Flag Operator"===i.type){var l=void 0===i.args||i.args;i.args={mode:l?"add":"remove"},n.push(i)}else n.push(i)}}catch(p){a.e(p)}finally{a.f()}n.unshift(o),t.process=n}}_app.default.write(u,_$constants_67.RULES_KEY),delete _app.default.cache.builtin,_app.default.info("Migration complete!")}(),"2.0"!==t&&_app.default.write("2.0",_$constants_67.SCHEMA_VERSION_KEY)};var obj,_app=(obj=_$app_68)&&obj.__esModule?obj:{default:obj};function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:0,n=e.method,o=e.url,a=e.headers,i=e.body;a=formatHeaders(a),/json/i.test(a["content-type"])&&(i=JSON.parse(i)),n=n.toUpperCase();var u,s=extractURL(o),c=s.path,l=s.query,p=null,f=0;for(u=r;uf&&(p=handlers[u],f=_.split("/").length)}if(p){var h=function(){t(n,o,u)},d={method:n,url:o,path:c,query:l,params:extractPathParams(p.pattern,c),headers:a,body:i},y=Response(),v=p.callback,m=function(t){y.status(500).json({status:"failed",message:"Internal Server Error: ".concat(t)})};if("AsyncFunction"===v.constructor.name)v(d,y,h).catch(m);else try{v(d,y,h)}catch(g){m(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_115.ENV)(),r=e.isQX,n=e.isLoon,o=e.isSurge,a=DEFAULT_HEADERS,i={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_113(this,e)}return ___createClass_113(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]:"",u={status:r?i[t]:t,body:e,headers:a};r?$done(u):(n||o)&&$done({response:u})}},{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 a[t]=e,this}}]),e}())}}function formatHeaders(t){for(var e={},r=0,n=Object.keys(t);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_105(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function _getFlowHeaders(){var t;return t=___regeneratorRuntime_105().mark((function t(e){var r,n,o,a;return ___regeneratorRuntime_105().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,_$openApi_115.HTTP)(),t.next=3,r.get({url:e,headers:{"User-Agent":"Quantumult%20X/1.0.30 (iPhone14,2; iOS 15.6)"}});case 3:return n=t.sent,o=n.headers,a=Object.keys(o).filter((function(t){return/SUBSCRIPTION-USERINFO/i.test(t)}))[0],t.abrupt("return",o[a]);case 7:case"end":return t.stop()}}),t)})),(_getFlowHeaders=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_105(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_105(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}Object.defineProperty(_$flow_105,"__esModule",{value:!0}),_$flow_105.getFlowHeaders=function(t){return _getFlowHeaders.apply(this,arguments)};var _$response_98={};Object.defineProperty(_$response_98,"__esModule",{value:!0}),_$response_98.failed=function(t,e,r){t.status(r||500).json({status:"failed",error:{code:e.code,type:e.type,message:e.message,details:e.details}})},_$response_98.success=function(t,e,r){t.status(r||200).json({status:"success",data:e})};var _$subscriptions_101={};function ___typeof_101(t){return(___typeof_101="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(_$subscriptions_101,"__esModule",{value:!0}),_$subscriptions_101.default=function(t){t.get("/api/sub/flow/:name",getFlowInfo),t.route("/api/sub/:name").get(getSubscription).patch(updateSubscription).delete(deleteSubscription),t.route("/api/subs").get(getAllSubscriptions).post(createSubscription)};var __obj_101,___app_101=(__obj_101=_$app_68)&&__obj_101.__esModule?__obj_101:{default:__obj_101};function ___regeneratorRuntime_101(){___regeneratorRuntime_101=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_101(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 E(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(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_101(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_101(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_101(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_91(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_107(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_107(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_107(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_107(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __ownKeys_90(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_90(t){for(var e=1;e16&&(r=binl_md5(r,8*t.length));for(var n=Array(16),o=Array(16),a=0;a<16;a++)n[a]=909522486^r[a],o[a]=1549556828^r[a];var i=binl_md5(n.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(o.concat(i),640))}function rstr2hex(t){for(var e,r=hexcase?"0123456789ABCDEF":"0123456789abcdef",n="",o=0;o>>4&15)+r.charAt(15&e);return n}function rstr2b64(t){for(var e="",r=t.length,n=0;n8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-a)&63);return e}function rstr2any(t,e){var r,n,o,a,i,u=e.length,s=Array(Math.ceil(t.length/2));for(r=0;r0||o>0)&&(i[i.length]=o);l[n]=a,s=i}var p="";for(r=l.length-1;r>=0;r--)p+=e.charAt(l[r]);return p}function str2rstr_utf8(t){for(var e,r,n="",o=-1;++o>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}function rstr2binl(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<>5]>>>r%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i>>32-u,r);var i,u}function md5_ff(t,e,r,n,o,a,i){return md5_cmn(e&r|~e&n,t,e,o,a,i)}function md5_gg(t,e,r,n,o,a,i){return md5_cmn(e&n|r&~n,t,e,o,a,i)}function md5_hh(t,e,r,n,o,a,i){return md5_cmn(e^r^n,t,e,o,a,i)}function md5_ii(t,e,r,n,o,a,i){return md5_cmn(r^(e|~n),t,e,o,a,i)}function safe_add(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var _$resourceCache_112={};Object.defineProperty(_$resourceCache_112,"__esModule",{value:!0}),_$resourceCache_112.default=void 0;var __obj_112,___app_112=(__obj_112=_$app_68)&&__obj_112.__esModule?__obj_112:{default:__obj_112};function _slicedToArray(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(s){u=!0,o=s}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_112(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_112(t,e):void 0}}(t,e)||function(){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 ___arrayLikeToArray_112(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.expires&&(___app_112.default.delete("#".concat(o)),delete t.resourceCache[o],e=!0)})),e&&this._persist()}},{key:"revokeAll",value:function(){Object.keys(this.resourceCache).forEach((function(t){___app_112.default.delete("#".concat(t))})),this.resourceCache={},this._persist()}},{key:"_persist",value:function(){___app_112.default.write(JSON.stringify(this.resourceCache),_$constants_67.RESOURCE_CACHE_KEY)}},{key:"get",value:function(t){var e=this.resourceCache[t];return e&&(new Date).getTime()-e<=this.expires?___app_112.default.read("#".concat(t)):null}},{key:"set",value:function(t,e){this.resourceCache[t]=(new Date).getTime(),this._persist(),___app_112.default.write(e,"#".concat(t))}}])&&___defineProperties_112(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}())(_$constants_67.CACHE_EXPIRATION_TIME_MS);_$resourceCache_112.default=___default_112;var _$download_104={};Object.defineProperty(_$download_104,"__esModule",{value:!0}),_$download_104.default=function(t,e){return _download.apply(this,arguments)};var __obj_104,_resourceCache=(__obj_104=_$resourceCache_112)&&__obj_104.__esModule?__obj_104:{default:__obj_104};function ___typeof_104(t){return(___typeof_104="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_104(){___regeneratorRuntime_104=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_104(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 E(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_104(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}var tasks=new Map;function _download(){var t;return t=___regeneratorRuntime_104().mark((function t(e,r){var n,o,a;return ___regeneratorRuntime_104().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=r||"Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)",n=(0,_$md5_114.hex_md5)(r+e),!tasks.has(n)){t.next=4;break}return t.abrupt("return",tasks.get(n));case 4:return o=(0,_$openApi_115.HTTP)({headers:{"User-Agent":r}}),a=new Promise((function(t,r){var a=_resourceCache.default.get(n);a?t(a):o.get(e).then((function(e){var o=e.body;0===o.replace(/\s/g,"").length?r(new Error("\u8fdc\u7a0b\u8d44\u6e90\u5185\u5bb9\u4e3a\u7a7a\uff01")):(_resourceCache.default.set(n,o),t(o))})).catch((function(){r(new Error("\u65e0\u6cd5\u4e0b\u8f7d URL\uff1a".concat(e)))}))})),tasks.set(n,a),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})),(_download=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_104(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_104(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$utils_108={};Object.defineProperty(_$utils_108,"__esModule",{value:!0}),_$utils_108.getIfNotBlank=function(t,e){return isNotBlank(t)?t:e},_$utils_108.getIfPresent=function(t,e){return isPresent(t)?t:e},_$utils_108.isIPv4=function(t){return IPV4_REGEX.test(t)},_$utils_108.isIPv6=function(t){return IPV6_REGEX.test(t)},_$utils_108.isNotBlank=isNotBlank,_$utils_108.isPresent=isPresent;var IPV4_REGEX=/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/,IPV6_REGEX=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;function isNotBlank(t){return"string"==typeof t&&t.trim().length>0}function isPresent(t){return null!=t}var _$logical_109={};function ___arrayLikeToArray_109(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"']/g,I=RegExp(k.source),T=RegExp(R.source),j=/<%-([\s\S]+?)%>/g,N=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,H=RegExp(G.source),q=/^\s+/,Y=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,z=/\{\n\/\* \[wrapped with (.+)\] \*/,W=/,? & /,V=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,X=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,Q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Z=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,et=/^0b[01]+$/i,rt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,at=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,it=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,st="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="["+ct+"]",pt="["+st+"]",ft="\\d+",_t="[a-z\\xdf-\\xf6\\xf8-\\xff]",ht="[^\\ud800-\\udfff"+ct+ft+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",dt="\\ud83c[\\udffb-\\udfff]",yt="[^\\ud800-\\udfff]",vt="(?:\\ud83c[\\udde6-\\uddff]){2}",mt="[\\ud800-\\udbff][\\udc00-\\udfff]",gt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",bt="(?:"+_t+"|"+ht+")",Et="(?:"+gt+"|"+ht+")",At="(?:"+pt+"|"+dt+")?",wt="[\\ufe0e\\ufe0f]?"+At+"(?:\\u200d(?:"+[yt,vt,mt].join("|")+")[\\ufe0e\\ufe0f]?"+At+")*",Ct="(?:"+["[\\u2700-\\u27bf]",vt,mt].join("|")+")"+wt,xt="(?:"+[yt+pt+"?",pt,vt,mt,"[\\ud800-\\udfff]"].join("|")+")",St=RegExp("['\u2019]","g"),$t=RegExp(pt,"g"),Ot=RegExp(dt+"(?="+dt+")|"+xt+wt,"g"),Lt=RegExp([gt+"?"+_t+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[lt,gt,"$"].join("|")+")",Et+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[lt,gt+bt,"$"].join("|")+")",gt+"?"+bt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",gt+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ft,Ct].join("|"),"g"),Pt=RegExp("[\\u200d\\ud800-\\udfff"+st+"\\ufe0e\\ufe0f]"),Ft=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rt=-1,It={};It[E]=It[A]=It[w]=It[C]=It[x]=It[S]=It["[object Uint8ClampedArray]"]=It[$]=It[O]=!0,It[o]=It[a]=It[g]=It[i]=It[b]=It[u]=It[s]=It[c]=It[p]=It[f]=It[_]=It[h]=It[d]=It[y]=It[m]=!1;var Tt={};Tt[o]=Tt[a]=Tt[g]=Tt[b]=Tt[i]=Tt[u]=Tt[E]=Tt[A]=Tt[w]=Tt[C]=Tt[x]=Tt[p]=Tt[f]=Tt[_]=Tt[h]=Tt[d]=Tt[y]=Tt[v]=Tt[S]=Tt["[object Uint8ClampedArray]"]=Tt[$]=Tt[O]=!0,Tt[s]=Tt[c]=Tt[m]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Nt=parseFloat,Dt=parseInt,Bt="object"==typeof t&&t&&t.Object===Object&&t,Mt="object"==typeof self&&self&&self.Object===Object&&self,Ut=Bt||Mt||Function("return this")(),Gt="object"==typeof _$lodash_35.exports&&_$lodash_35.exports&&!_$lodash_35.exports.nodeType&&_$lodash_35.exports,Ht=Gt&&_$lodash_35&&!_$lodash_35.nodeType&&_$lodash_35,qt=Ht&&Ht.exports===Gt,Yt=qt&&Bt.process,Kt=function(){try{return Ht&&Ht.require&&Ht.require("util").types||Yt&&Yt.binding&&Yt.binding("util")}catch(t){}}(),zt=Kt&&Kt.isArrayBuffer,Wt=Kt&&Kt.isDate,Vt=Kt&&Kt.isMap,Xt=Kt&&Kt.isRegExp,Jt=Kt&&Kt.isSet,Qt=Kt&&Kt.isTypedArray;function Zt(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function te(t,e,r,n){for(var o=-1,a=null==t?0:t.length;++o-1}function ie(t,e,r){for(var n=-1,o=null==t?0:t.length;++n-1;);return r}function Le(t,e){for(var r=t.length;r--&&de(e,t[r],0)>-1;);return r}var Pe=be({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Fe=be({"&":"&","<":"<",">":">",'"':""","'":"'"});function ke(t){return"\\"+jt[t]}function Re(t){return Pt.test(t)}function Ie(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Te(t,e){return function(r){return t(e(r))}}function je(t,e){for(var n=-1,o=t.length,a=0,i=[];++n",""":'"',"'":"'"}),He=function t(Y){var st,ct=(Y=null==Y?Ut:He.defaults(Ut.Object(),Y,He.pick(Ut,kt))).Array,lt=Y.Date,pt=Y.Error,ft=Y.Function,_t=Y.Math,ht=Y.Object,dt=Y.RegExp,yt=Y.String,vt=Y.TypeError,mt=ct.prototype,gt=ft.prototype,bt=ht.prototype,Et=Y["__core-js_shared__"],At=gt.toString,wt=bt.hasOwnProperty,Ct=0,xt=(st=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ot=bt.toString,Pt=At.call(ht),jt=Ut._,Bt=dt("^"+At.call(wt).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=qt?Y.Buffer:void 0,Gt=Y.Symbol,Ht=Y.Uint8Array,Yt=Mt?Mt.allocUnsafe:void 0,Kt=Te(ht.getPrototypeOf,ht),fe=ht.create,be=bt.propertyIsEnumerable,qe=mt.splice,Ye=Gt?Gt.isConcatSpreadable:void 0,Ke=Gt?Gt.iterator:void 0,ze=Gt?Gt.toStringTag:void 0,We=function(){try{var t=Zo(ht,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=Y.clearTimeout!==Ut.clearTimeout&&Y.clearTimeout,Xe=lt&<.now!==Ut.Date.now&<.now,Je=Y.setTimeout!==Ut.setTimeout&&Y.setTimeout,Qe=_t.ceil,Ze=_t.floor,tr=ht.getOwnPropertySymbols,er=Mt?Mt.isBuffer:void 0,rr=Y.isFinite,nr=mt.join,or=Te(ht.keys,ht),ar=_t.max,ir=_t.min,ur=lt.now,sr=Y.parseInt,cr=_t.random,lr=mt.reverse,pr=Zo(Y,"DataView"),fr=Zo(Y,"Map"),_r=Zo(Y,"Promise"),hr=Zo(Y,"Set"),dr=Zo(Y,"WeakMap"),yr=Zo(ht,"create"),vr=dr&&new dr,mr={},gr=$a(pr),br=$a(fr),Er=$a(_r),Ar=$a(hr),wr=$a(dr),Cr=Gt?Gt.prototype:void 0,xr=Cr?Cr.valueOf:void 0,Sr=Cr?Cr.toString:void 0;function $r(t){if(qi(t)&&!Ri(t)&&!(t instanceof Fr)){if(t instanceof Pr)return t;if(wt.call(t,"__wrapped__"))return Oa(t)}return new Pr(t)}var Or=function(){function t(){}return function(e){if(!Hi(e))return{};if(fe)return fe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Lr(){}function Pr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Fr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Vr(t,e,r,n,a,s){var m,L=1&e,P=2&e,F=4&e;if(r&&(m=a?r(t,n,a,s):r(t)),void 0!==m)return m;if(!Hi(t))return t;var k=Ri(t);if(k){if(m=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&wt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!L)return vo(t,m)}else{var R=ra(t),I=R==c||R==l;if(Ni(t))return lo(t,L);if(R==_||R==o||I&&!a){if(m=P||I?{}:oa(t),!L)return P?function(t,e){return mo(t,ea(t),e)}(t,function(t,e){return t&&mo(e,Eu(e),t)}(m,t)):function(t,e){return mo(t,ta(t),e)}(t,Yr(m,t))}else{if(!Tt[R])return a?t:{};m=function(t,e,r){var n,o,a,s=t.constructor;switch(e){case g:return po(t);case i:case u:return new s(+t);case b:return function(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case E:case A:case w:case C:case x:case S:case"[object Uint8ClampedArray]":case $:case O:return fo(t,r);case p:return new s;case f:case y:return new s(t);case h:return(a=new(o=t).constructor(o.source,Z.exec(o))).lastIndex=o.lastIndex,a;case d:return new s;case v:return n=t,xr?ht(xr.call(n)):{}}}(t,R,L)}}s||(s=new jr);var T=s.get(t);if(T)return T;s.set(t,m),Vi(t)?t.forEach((function(n){m.add(Vr(n,e,r,n,t,s))})):Yi(t)&&t.forEach((function(n,o){m.set(o,Vr(n,e,r,o,t,s))}));var j=k?void 0:(F?P?Ko:Yo:P?Eu:bu)(t);return ee(j||t,(function(n,o){j&&(n=t[o=n]),Gr(m,o,Vr(n,e,r,o,t,s))})),m}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=ht(t);n--;){var o=r[n],a=e[o],i=t[o];if(void 0===i&&!(o in t)||!a(i))return!1}return!0}function Jr(t,r,n){if("function"!=typeof t)throw new vt(e);return ma((function(){t.apply(void 0,n)}),r)}function Qr(t,e,r,n){var o=-1,a=ae,i=!0,u=t.length,s=[],c=e.length;if(!u)return s;r&&(e=ue(e,xe(r))),n?(a=ie,i=!1):e.length>=200&&(a=$e,i=!1,e=new Tr(e));t:for(;++o-1},Rr.prototype.set=function(t,e){var r=this.__data__,n=Hr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Ir.prototype.clear=function(){this.size=0,this.__data__={hash:new kr,map:new(fr||Rr),string:new kr}},Ir.prototype.delete=function(t){var e=Jo(this,t).delete(t);return this.size-=e?1:0,e},Ir.prototype.get=function(t){return Jo(this,t).get(t)},Ir.prototype.has=function(t){return Jo(this,t).has(t)},Ir.prototype.set=function(t,e){var r=Jo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Tr.prototype.add=Tr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Tr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.clear=function(){this.__data__=new Rr,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Rr){var n=r.__data__;if(!fr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ir(n)}return r.set(t,e),this.size=r.size,this};var Zr=Eo(sn),tn=Eo(cn,!0);function en(t,e){var r=!0;return Zr(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function rn(t,e,r){for(var n=-1,o=t.length;++n0&&r(u)?e>1?on(u,e-1,r,n,o):se(o,u):n||(o[o.length]=u)}return o}var an=Ao(),un=Ao(!0);function sn(t,e){return t&&an(t,e,bu)}function cn(t,e){return t&&un(t,e,bu)}function ln(t,e){return oe(e,(function(e){return Mi(t[e])}))}function pn(t,e){for(var r=0,n=(e=io(e,t)).length;null!=t&&re}function dn(t,e){return null!=t&&wt.call(t,e)}function yn(t,e){return null!=t&&e in ht(t)}function vn(t,e,r){for(var n=r?ie:ae,o=t[0].length,a=t.length,i=a,u=ct(a),s=1/0,c=[];i--;){var l=t[i];i&&e&&(l=ue(l,xe(e))),s=ir(l.length,s),u[i]=!r&&(e||o>=120&&l.length>=120)?new Tr(i&&l):void 0}l=t[0];var p=-1,f=u[0];t:for(;++p=u?s:s*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}(Sn(t,(function(t,r,o){return{criteria:ue(e,(function(e){return e(t)})),index:++n,value:t}})))}function kn(t,e,r){for(var n=-1,o=e.length,a={};++n-1;)u!==t&&qe.call(u,s,1),qe.call(t,s,1);return t}function In(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==a){var a=o;ia(o)?qe.call(t,o,1):Qn(t,o)}}return t}function Tn(t,e){return t+Ze(cr()*(e-t+1))}function jn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Ze(e/2))&&(t+=t)}while(e);return r}function Nn(t,e){return ga(ha(t,e,Ku),t+"")}function Dn(t){return Dr(Lu(t))}function Bn(t,e){var r=Lu(t);return Aa(r,Wr(e,0,r.length))}function Mn(t,e,r,n){if(!Hi(t))return t;for(var o=-1,a=(e=io(e,t)).length,i=a-1,u=t;null!=u&&++oo?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=ct(o);++n>>1,i=t[a];null!==i&&!Ji(i)&&(r?i<=e:i=200){var c=e?null:No(t);if(c)return Ne(c);i=!1,o=$e,s=new Tr}else s=e?[]:u;t:for(;++n=n?t:qn(t,e,r)}var co=Ve||function(t){return Ut.clearTimeout(t)};function lo(t,e){if(e)return t.slice();var r=t.length,n=Yt?Yt(r):new t.constructor(r);return t.copy(n),n}function po(t){var e=new t.constructor(t.byteLength);return new Ht(e).set(new Ht(t)),e}function fo(t,e){var r=e?po(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,a=Ji(t),i=void 0!==e,u=null===e,s=e==e,c=Ji(e);if(!u&&!c&&!a&&t>e||a&&i&&s&&!u&&!c||n&&i&&s||!r&&s||!o)return 1;if(!n&&!a&&!c&&t1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ua(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=ht(e);++n-1?o[a?e[i]:i]:void 0}}function $o(t){return qo((function(r){var n=r.length,o=n,a=Pr.prototype.thru;for(t&&r.reverse();o--;){var i=r[o];if("function"!=typeof i)throw new vt(e);if(a&&!u&&"wrapper"==Wo(i))var u=new Pr([],!0)}for(o=u?o:n;++o1&&m.reverse(),l&&su))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var p=-1,f=!0,_=2&r?new Tr:void 0;for(a.set(t,e),a.set(e,t);++p-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(K,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ee(n,(function(r){var n="_."+r[0];e&r[1]&&!ae(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(z);return e?e[1].split(W):[]}(o),r)))}function Ea(t){var e=0,r=0;return function(){var n=ur(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Aa(t,e){var r=-1,n=t.length,o=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Wa(t,r)}));function ei(t){var e=$r(t);return e.__chain__=!0,e}function ri(t,e){return e(t)}var ni=qo((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return zr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Fr&&ia(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ri,args:[o],thisArg:void 0}),new Pr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)})),oi=go((function(t,e,r){wt.call(t,r)?++t[r]:Kr(t,r,1)})),ai=So(ka),ii=So(Ra);function ui(t,e){return(Ri(t)?ee:Zr)(t,Xo(e,3))}function si(t,e){return(Ri(t)?re:tn)(t,Xo(e,3))}var ci=go((function(t,e,r){wt.call(t,r)?t[r].push(e):Kr(t,r,[e])})),li=Nn((function(t,e,r){var n=-1,o="function"==typeof e,a=Ti(t)?ct(t.length):[];return Zr(t,(function(t){a[++n]=o?Zt(e,t,r):mn(t,e,r)})),a})),pi=go((function(t,e,r){Kr(t,r,e)}));function fi(t,e){return(Ri(t)?ue:Sn)(t,Xo(e,3))}var _i=go((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),hi=Nn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ua(t,e[0],e[1])?e=[]:r>2&&ua(e[0],e[1],e[2])&&(e=[e[0]]),Fn(t,on(e,1),[])})),di=Xe||function(){return Ut.Date.now()};function yi(t,e,r){return e=r?void 0:e,Bo(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function vi(t,r){var n;if("function"!=typeof r)throw new vt(e);return t=nu(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}var mi=Nn((function(t,e,r){var n=1;if(r.length){var o=je(r,Vo(mi));n|=32}return Bo(t,n,e,r,o)})),gi=Nn((function(t,e,r){var n=3;if(r.length){var o=je(r,Vo(gi));n|=32}return Bo(e,n,t,r,o)}));function bi(t,r,n){var o,a,i,u,s,c,l=0,p=!1,f=!1,_=!0;if("function"!=typeof t)throw new vt(e);function h(e){var r=o,n=a;return o=a=void 0,l=e,u=t.apply(n,r)}function d(t){var e=t-c;return void 0===c||e>=r||e<0||f&&t-l>=i}function y(){var t=di();if(d(t))return v(t);s=ma(y,function(t){var e=r-(t-c);return f?ir(e,i-(t-l)):e}(t))}function v(t){return s=void 0,_&&o?h(t):(o=a=void 0,u)}function m(){var t=di(),e=d(t);if(o=arguments,a=this,c=t,e){if(void 0===s)return function(t){return l=t,s=ma(y,r),p?h(t):u}(c);if(f)return co(s),s=ma(y,r),h(c)}return void 0===s&&(s=ma(y,r)),u}return r=au(r)||0,Hi(n)&&(p=!!n.leading,i=(f="maxWait"in n)?ar(au(n.maxWait)||0,r):i,_="trailing"in n?!!n.trailing:_),m.cancel=function(){void 0!==s&&co(s),l=0,o=c=a=s=void 0},m.flush=function(){return void 0===s?u:v(di())},m}var Ei=Nn((function(t,e){return Jr(t,1,e)})),Ai=Nn((function(t,e,r){return Jr(t,au(e)||0,r)}));function wi(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new vt(e);var n=function(){var e=arguments,o=r?r.apply(this,e):e[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,e);return n.cache=a.set(o,i)||a,i};return n.cache=new(wi.Cache||Ir),n}function Ci(t){if("function"!=typeof t)throw new vt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}wi.Cache=Ir;var xi=uo((function(t,e){var r=(e=1==e.length&&Ri(e[0])?ue(e[0],xe(Xo())):ue(on(e,1),xe(Xo()))).length;return Nn((function(n){for(var o=-1,a=ir(n.length,r);++o=e})),ki=gn(function(){return arguments}())?gn:function(t){return qi(t)&&wt.call(t,"callee")&&!be.call(t,"callee")},Ri=ct.isArray,Ii=zt?xe(zt):function(t){return qi(t)&&_n(t)==g};function Ti(t){return null!=t&&Gi(t.length)&&!Mi(t)}function ji(t){return qi(t)&&Ti(t)}var Ni=er||as,Di=Wt?xe(Wt):function(t){return qi(t)&&_n(t)==u};function Bi(t){if(!qi(t))return!1;var e=_n(t);return e==s||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!zi(t)}function Mi(t){if(!Hi(t))return!1;var e=_n(t);return e==c||e==l||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ui(t){return"number"==typeof t&&t==nu(t)}function Gi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Hi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qi(t){return null!=t&&"object"==typeof t}var Yi=Vt?xe(Vt):function(t){return qi(t)&&ra(t)==p};function Ki(t){return"number"==typeof t||qi(t)&&_n(t)==f}function zi(t){if(!qi(t)||_n(t)!=_)return!1;var e=Kt(t);if(null===e)return!0;var r=wt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&At.call(r)==Pt}var Wi=Xt?xe(Xt):function(t){return qi(t)&&_n(t)==h},Vi=Jt?xe(Jt):function(t){return qi(t)&&ra(t)==d};function Xi(t){return"string"==typeof t||!Ri(t)&&qi(t)&&_n(t)==y}function Ji(t){return"symbol"==typeof t||qi(t)&&_n(t)==v}var Qi=Qt?xe(Qt):function(t){return qi(t)&&Gi(t.length)&&!!It[_n(t)]},Zi=Io(xn),tu=Io((function(t,e){return t<=e}));function eu(t){if(!t)return[];if(Ti(t))return Xi(t)?Me(t):vo(t);if(Ke&&t[Ke])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Ke]());var e=ra(t);return(e==p?Ie:e==d?Ne:Lu)(t)}function ru(t){return t?(t=au(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function nu(t){var e=ru(t),r=e%1;return e==e?r?e-r:e:0}function ou(t){return t?Wr(nu(t),0,4294967295):0}function au(t){if("number"==typeof t)return t;if(Ji(t))return NaN;if(Hi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Hi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var r=et.test(t);return r||nt.test(t)?Dt(t.slice(2),r?2:8):tt.test(t)?NaN:+t}function iu(t){return mo(t,Eu(t))}function uu(t){return null==t?"":Xn(t)}var su=bo((function(t,e){if(pa(e)||Ti(e))mo(e,bu(e),t);else for(var r in e)wt.call(e,r)&&Gr(t,r,e[r])})),cu=bo((function(t,e){mo(e,Eu(e),t)})),lu=bo((function(t,e,r,n){mo(e,Eu(e),t,n)})),pu=bo((function(t,e,r,n){mo(e,bu(e),t,n)})),fu=qo(zr),_u=Nn((function(t,e){t=ht(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&ua(e[0],e[1],o)&&(n=1);++r1),e})),mo(t,Ko(t),r),n&&(r=Vr(r,7,Go));for(var o=e.length;o--;)Qn(r,e[o]);return r})),xu=qo((function(t,e){return null==t?{}:function(t,e){return kn(t,e,(function(e,r){return yu(t,r)}))}(t,e)}));function Su(t,e){if(null==t)return{};var r=ue(Ko(t),(function(t){return[t]}));return e=Xo(e),kn(t,r,(function(t,r){return e(t,r[0])}))}var $u=Do(bu),Ou=Do(Eu);function Lu(t){return null==t?[]:Se(t,bu(t))}var Pu=Co((function(t,e,r){return e=e.toLowerCase(),t+(r?Fu(e):e)}));function Fu(t){return Bu(uu(t).toLowerCase())}function ku(t){return(t=uu(t))&&t.replace(at,Pe).replace($t,"")}var Ru=Co((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Iu=Co((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Tu=wo("toLowerCase"),ju=Co((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Nu=Co((function(t,e,r){return t+(r?" ":"")+Bu(e)})),Du=Co((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Bu=wo("toUpperCase");function Mu(t,e,r){return t=uu(t),void 0===(e=r?void 0:e)?function(t){return Ft.test(t)}(t)?function(t){return t.match(Lt)||[]}(t):function(t){return t.match(V)||[]}(t):t.match(e)||[]}var Uu=Nn((function(t,e){try{return Zt(t,void 0,e)}catch(r){return Bi(r)?r:new pt(r)}})),Gu=qo((function(t,e){return ee(e,(function(e){e=Sa(e),Kr(t,e,mi(t[e],t))})),t}));function Hu(t){return function(){return t}}var qu=$o(),Yu=$o(!0);function Ku(t){return t}function zu(t){return wn("function"==typeof t?t:Vr(t,1))}var Wu=Nn((function(t,e){return function(r){return mn(r,t,e)}})),Vu=Nn((function(t,e){return function(r){return mn(t,r,e)}}));function Xu(t,e,r){var n=bu(e),o=ln(e,n);null!=r||Hi(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=ln(e,bu(e)));var a=!(Hi(r)&&"chain"in r&&!r.chain),i=Mi(t);return ee(o,(function(r){var n=e[r];t[r]=n,i&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__);return(r.__actions__=vo(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,se([this.value()],arguments))})})),t}function Ju(){}var Qu=Fo(ue),Zu=Fo(ne),ts=Fo(pe);function es(t){return sa(t)?ge(Sa(t)):function(t){return function(e){return pn(e,t)}}(t)}var rs=Ro(),ns=Ro(!0);function os(){return[]}function as(){return!1}var is,us=Po((function(t,e){return t+e}),0),ss=jo("ceil"),cs=Po((function(t,e){return t/e}),1),ls=jo("floor"),ps=Po((function(t,e){return t*e}),1),fs=jo("round"),_s=Po((function(t,e){return t-e}),0);return $r.after=function(t,r){if("function"!=typeof r)throw new vt(e);return t=nu(t),function(){if(--t<1)return r.apply(this,arguments)}},$r.ary=yi,$r.assign=su,$r.assignIn=cu,$r.assignInWith=lu,$r.assignWith=pu,$r.at=fu,$r.before=vi,$r.bind=mi,$r.bindAll=Gu,$r.bindKey=gi,$r.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ri(t)?t:[t]},$r.chain=ei,$r.chunk=function(t,e,r){e=(r?ua(t,e,r):void 0===e)?1:ar(nu(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,a=0,i=ct(Qe(n/e));oo?0:o+r),(n=void 0===n||n>o?o:nu(n))<0&&(n+=o),n=r>n?0:ou(n);r>>0)?(t=uu(t))&&("string"==typeof e||null!=e&&!Wi(e))&&!(e=Xn(e))&&Re(t)?so(Me(t),0,r):t.split(e,r):[]},$r.spread=function(t,r){if("function"!=typeof t)throw new vt(e);return r=null==r?0:ar(nu(r),0),Nn((function(e){var n=e[r],o=so(e,0,r);return n&&se(o,n),Zt(t,this,o)}))},$r.tail=function(t){var e=null==t?0:t.length;return e?qn(t,1,e):[]},$r.take=function(t,e,r){return t&&t.length?qn(t,0,(e=r||void 0===e?1:nu(e))<0?0:e):[]},$r.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?qn(t,(e=n-(e=r||void 0===e?1:nu(e)))<0?0:e,n):[]},$r.takeRightWhile=function(t,e){return t&&t.length?to(t,Xo(e,3),!1,!0):[]},$r.takeWhile=function(t,e){return t&&t.length?to(t,Xo(e,3)):[]},$r.tap=function(t,e){return e(t),t},$r.throttle=function(t,r,n){var o=!0,a=!0;if("function"!=typeof t)throw new vt(e);return Hi(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),bi(t,r,{leading:o,maxWait:r,trailing:a})},$r.thru=ri,$r.toArray=eu,$r.toPairs=$u,$r.toPairsIn=Ou,$r.toPath=function(t){return Ri(t)?ue(t,Sa):Ji(t)?[t]:vo(xa(uu(t)))},$r.toPlainObject=iu,$r.transform=function(t,e,r){var n=Ri(t),o=n||Ni(t)||Qi(t);if(e=Xo(e,4),null==r){var a=t&&t.constructor;r=o?n?new a:[]:Hi(t)&&Mi(a)?Or(Kt(t)):{}}return(o?ee:sn)(t,(function(t,n,o){return e(r,t,n,o)})),r},$r.unary=function(t){return yi(t,1)},$r.union=qa,$r.unionBy=Ya,$r.unionWith=Ka,$r.uniq=function(t){return t&&t.length?Jn(t):[]},$r.uniqBy=function(t,e){return t&&t.length?Jn(t,Xo(e,2)):[]},$r.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jn(t,void 0,e):[]},$r.unset=function(t,e){return null==t||Qn(t,e)},$r.unzip=za,$r.unzipWith=Wa,$r.update=function(t,e,r){return null==t?t:Zn(t,e,ao(r))},$r.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Zn(t,e,ao(r),n)},$r.values=Lu,$r.valuesIn=function(t){return null==t?[]:Se(t,Eu(t))},$r.without=Va,$r.words=Mu,$r.wrap=function(t,e){return Si(ao(e),t)},$r.xor=Xa,$r.xorBy=Ja,$r.xorWith=Qa,$r.zip=Za,$r.zipObject=function(t,e){return no(t||[],e||[],Gr)},$r.zipObjectDeep=function(t,e){return no(t||[],e||[],Mn)},$r.zipWith=ti,$r.entries=$u,$r.entriesIn=Ou,$r.extend=cu,$r.extendWith=lu,Xu($r,$r),$r.add=us,$r.attempt=Uu,$r.camelCase=Pu,$r.capitalize=Fu,$r.ceil=ss,$r.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=au(r))==r?r:0),void 0!==e&&(e=(e=au(e))==e?e:0),Wr(au(t),e,r)},$r.clone=function(t){return Vr(t,4)},$r.cloneDeep=function(t){return Vr(t,5)},$r.cloneDeepWith=function(t,e){return Vr(t,5,e="function"==typeof e?e:void 0)},$r.cloneWith=function(t,e){return Vr(t,4,e="function"==typeof e?e:void 0)},$r.conformsTo=function(t,e){return null==e||Xr(t,e,bu(e))},$r.deburr=ku,$r.defaultTo=function(t,e){return null==t||t!=t?e:t},$r.divide=cs,$r.endsWith=function(t,e,r){t=uu(t),e=Xn(e);var n=t.length,o=r=void 0===r?n:Wr(nu(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},$r.eq=Li,$r.escape=function(t){return(t=uu(t))&&T.test(t)?t.replace(R,Fe):t},$r.escapeRegExp=function(t){return(t=uu(t))&&H.test(t)?t.replace(G,"\\$&"):t},$r.every=function(t,e,r){var n=Ri(t)?ne:en;return r&&ua(t,e,r)&&(e=void 0),n(t,Xo(e,3))},$r.find=ai,$r.findIndex=ka,$r.findKey=function(t,e){return _e(t,Xo(e,3),sn)},$r.findLast=ii,$r.findLastIndex=Ra,$r.findLastKey=function(t,e){return _e(t,Xo(e,3),cn)},$r.floor=ls,$r.forEach=ui,$r.forEachRight=si,$r.forIn=function(t,e){return null==t?t:an(t,Xo(e,3),Eu)},$r.forInRight=function(t,e){return null==t?t:un(t,Xo(e,3),Eu)},$r.forOwn=function(t,e){return t&&sn(t,Xo(e,3))},$r.forOwnRight=function(t,e){return t&&cn(t,Xo(e,3))},$r.get=du,$r.gt=Pi,$r.gte=Fi,$r.has=function(t,e){return null!=t&&na(t,e,dn)},$r.hasIn=yu,$r.head=Ta,$r.identity=Ku,$r.includes=function(t,e,r,n){t=Ti(t)?t:Lu(t),r=r&&!n?nu(r):0;var o=t.length;return r<0&&(r=ar(o+r,0)),Xi(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&de(t,e,r)>-1},$r.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:nu(r);return o<0&&(o=ar(n+o,0)),de(t,e,o)},$r.inRange=function(t,e,r){return e=ru(e),void 0===r?(r=e,e=0):r=ru(r),function(t,e,r){return t>=ir(e,r)&&t=-9007199254740991&&t<=9007199254740991},$r.isSet=Vi,$r.isString=Xi,$r.isSymbol=Ji,$r.isTypedArray=Qi,$r.isUndefined=function(t){return void 0===t},$r.isWeakMap=function(t){return qi(t)&&ra(t)==m},$r.isWeakSet=function(t){return qi(t)&&"[object WeakSet]"==_n(t)},$r.join=function(t,e){return null==t?"":nr.call(t,e)},$r.kebabCase=Ru,$r.last=Ba,$r.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return void 0!==r&&(o=(o=nu(r))<0?ar(n+o,0):ir(o,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):he(t,ve,o,!0)},$r.lowerCase=Iu,$r.lowerFirst=Tu,$r.lt=Zi,$r.lte=tu,$r.max=function(t){return t&&t.length?rn(t,Ku,hn):void 0},$r.maxBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),hn):void 0},$r.mean=function(t){return me(t,Ku)},$r.meanBy=function(t,e){return me(t,Xo(e,2))},$r.min=function(t){return t&&t.length?rn(t,Ku,xn):void 0},$r.minBy=function(t,e){return t&&t.length?rn(t,Xo(e,2),xn):void 0},$r.stubArray=os,$r.stubFalse=as,$r.stubObject=function(){return{}},$r.stubString=function(){return""},$r.stubTrue=function(){return!0},$r.multiply=ps,$r.nth=function(t,e){return t&&t.length?Pn(t,nu(e)):void 0},$r.noConflict=function(){return Ut._===this&&(Ut._=jt),this},$r.noop=Ju,$r.now=di,$r.pad=function(t,e,r){t=uu(t);var n=(e=nu(e))?Be(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return ko(Ze(o),r)+t+ko(Qe(o),r)},$r.padEnd=function(t,e,r){t=uu(t);var n=(e=nu(e))?Be(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=cr();return ir(t+o*(e-t+Nt("1e-"+((o+"").length-1))),e)}return Tn(t,e)},$r.reduce=function(t,e,r){var n=Ri(t)?ce:Ee,o=arguments.length<3;return n(t,Xo(e,4),r,o,Zr)},$r.reduceRight=function(t,e,r){var n=Ri(t)?le:Ee,o=arguments.length<3;return n(t,Xo(e,4),r,o,tn)},$r.repeat=function(t,e,r){return e=(r?ua(t,e,r):void 0===e)?1:nu(e),jn(uu(t),e)},$r.replace=function(){var t=arguments,e=uu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$r.result=function(t,e,r){var n=-1,o=(e=io(e,t)).length;for(o||(o=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ir(t,4294967295);t-=4294967295;for(var o=we(n,e=Xo(e));++r=a)return t;var u=r-Be(n);if(u<1)return n;var s=i?so(i,0,u).join(""):t.slice(0,u);if(void 0===o)return s+n;if(i&&(u+=s.length-u),Wi(o)){if(t.slice(u).search(o)){var c,l=s;for(o.global||(o=dt(o.source,uu(Z.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var p=c.index;s=s.slice(0,void 0===p?u:p)}}else if(t.indexOf(Xn(o),u)!=u){var f=s.lastIndexOf(o);f>-1&&(s=s.slice(0,f))}return s+n},$r.unescape=function(t){return(t=uu(t))&&I.test(t)?t.replace(k,Ge):t},$r.uniqueId=function(t){var e=++Ct;return uu(t)+e},$r.upperCase=Du,$r.upperFirst=Bu,$r.each=ui,$r.eachRight=si,$r.first=Ta,Xu($r,(is={},sn($r,(function(t,e){wt.call($r.prototype,e)||(is[e]=t)})),is),{chain:!1}),$r.VERSION="4.17.21",ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$r[t].placeholder=$r})),ee(["drop","take"],(function(t,e){Fr.prototype[t]=function(r){r=void 0===r?1:ar(nu(r),0);var n=this.__filtered__&&!e?new Fr(this):this.clone();return n.__filtered__?n.__takeCount__=ir(r,n.__takeCount__):n.__views__.push({size:ir(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Fr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ee(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Fr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ee(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Fr.prototype[t]=function(){return this[r](1).value()[0]}})),ee(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Fr.prototype[t]=function(){return this.__filtered__?new Fr(this):this[r](1)}})),Fr.prototype.compact=function(){return this.filter(Ku)},Fr.prototype.find=function(t){return this.filter(t).head()},Fr.prototype.findLast=function(t){return this.reverse().find(t)},Fr.prototype.invokeMap=Nn((function(t,e){return"function"==typeof t?new Fr(this):this.map((function(r){return mn(r,t,e)}))})),Fr.prototype.reject=function(t){return this.filter(Ci(Xo(t)))},Fr.prototype.slice=function(t,e){t=nu(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Fr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=nu(e))<0?r.dropRight(-e):r.take(e-t)),r)},Fr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Fr.prototype.toArray=function(){return this.take(4294967295)},sn(Fr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=$r[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);o&&($r.prototype[e]=function(){var e=this.__wrapped__,i=n?[1]:arguments,u=e instanceof Fr,s=i[0],c=u||Ri(e),l=function(t){var e=o.apply($r,se([t],i));return n&&p?e[0]:e};c&&r&&"function"==typeof s&&1!=s.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,_=a&&!p,h=u&&!f;if(!a&&c){e=h?e:new Fr(this);var d=t.apply(e,i);return d.__actions__.push({func:ri,args:[l],thisArg:void 0}),new Pr(d,p)}return _&&h?t.apply(this,i):(d=this.thru(l),_?n?d.value()[0]:d.value():d)})})),ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=mt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);$r.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Ri(o)?o:[],t)}return this[r]((function(r){return e.apply(Ri(r)?r:[],t)}))}})),sn(Fr.prototype,(function(t,e){var r=$r[e];if(r){var n=r.name+"";wt.call(mr,n)||(mr[n]=[]),mr[n].push({name:e,func:r})}})),mr[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],Fr.prototype.clone=function(){var t=new Fr(this.__wrapped__);return t.__actions__=vo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=vo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=vo(this.__views__),t},Fr.prototype.reverse=function(){if(this.__filtered__){var t=new Fr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Fr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ri(t),n=e<0,o=r?t.length:0,a=function(t,e,r){for(var n=-1,o=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$r.prototype.plant=function(t){for(var e,r=this;r instanceof Lr;){var n=Oa(r);n.__index__=0,n.__values__=void 0,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},$r.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Fr){var e=t;return this.__actions__.length&&(e=new Fr(this)),(e=e.reverse()).__actions__.push({func:ri,args:[Ha],thisArg:void 0}),new Pr(e,this.__chain__)}return this.thru(Ha)},$r.prototype.toJSON=$r.prototype.valueOf=$r.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},$r.prototype.first=$r.prototype.head,Ke&&($r.prototype[Ke]=function(){return this}),$r}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ut._=He,define((function(){return He}))):Ht?((Ht.exports=He)._=He,Gt._=He):Ut._=He}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$lodash_35=_$lodash_35.exports;var _$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="",a=this.position;ae/2-1){o=" ... ",a-=5;break}return i=this.buffer.slice(n,a),_$common_7.repeat(" ",t)+r+i+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,a,i,u,s,c=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(a=+e[4],i=+e[5],u=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),s=new Date(Date.UTC(r,n,o,a,i,u,c)),l&&s.setTime(s.getTime()-l),s},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,a=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,a=BASE64_MAP,i=0,u=[];for(e=0;e>16&255),u.push(i>>8&255),u.push(255&i)),i=i<<6|a.indexOf(n.charAt(e));return 0==(r=o%4*6)?(u.push(i>>16&255),u.push(i>>8&255),u.push(255&i)):18===r?(u.push(i>>10&255),u.push(i>>2&255)):12===r&&u.push(i>>4&255),NodeBuffer?NodeBuffer.from?NodeBuffer.from(u):new NodeBuffer(u):u},predicate:function(t){return NodeBuffer&&NodeBuffer.isBuffer(t)},represent:function(t){var e,r,n="",o=0,a=t.length,i=BASE64_MAP;for(e=0;e>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]),o=(o<<8)+t[e];return 0==(r=a%3)?(n+=i[o>>18&63],n+=i[o>>12&63],n+=i[o>>6&63],n+=i[63&o]):2===r?(n+=i[o>>10&63],n+=i[o>>4&63],n+=i[o<<2&63],n+=i[64]):1===r&&(n+=i[o>>2&63],n+=i[o<<4&63],n+=i[64],n+=i[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,a,i=[],u=t;for(e=0,r=u.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,a;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),a=parseInt(n[2],10),1!==o&&throwError(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&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,a,i,u;if(e1&&(t.result+=_$common_7.repeat("\n",e-1))}function readBlockSequence(t,e){var r,n,o=t.tag,a=t.anchor,i=[],u=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=i),n=t.input.charCodeAt(t.position);0!==n&&45===n&&is_WS_OR_EOL(t.input.charCodeAt(t.position+1));)if(u=!0,t.position++,skipSeparationSpace(t,!0,-1)&&t.lineIndent<=e)i.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,composeNode(t,e,CONTEXT_BLOCK_IN,!1,!0),i.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,p,f,_,h,a,i),f=_=h=null),skipSeparationSpace(t,!0,-1),u=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==u)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"):c?throwError(t,"repeat of an indentation width identifier"):(l=e+o-1,c=!0)}if(is_WHITE_SPACE(a)){do{a=t.input.charCodeAt(++t.position)}while(is_WHITE_SPACE(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!is_EOL(a)&&0!==a)}for(;0!==a;){for(readLineBreak(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),is_EOL(a))p++;else{if(t.lineIndent0){for(o=i,a=0;o>0;o--)(i=fromHexCode(u=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+i:throwError(t,"expected hexadecimal character");t.result+=charFromCodepoint(a),t.position++}else throwError(t,"unknown escape sequence");r=n=t.position}else is_EOL(u)?(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,p)?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,a,i,u,s,c,l,p=t.kind,f=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=a=t.position,i=!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(u=t.line,s=t.lineStart,c=t.lineIndent,skipSeparationSpace(t,!1,-1),t.lineIndent>=e){i=!0,l=t.input.charCodeAt(t.position);continue}t.position=a,t.line=u,t.lineStart=s,t.lineIndent=c;break}}i&&(captureSegment(t,o,a,!1),writeFoldedLines(t,t.line-u),o=a=t.position,i=!1),is_WHITE_SPACE(l)||(a=t.position+1),l=t.input.charCodeAt(++t.position)}return captureSegment(t,o,a,!1),!!t.result||(t.kind=p,t.result=f,!1)}(t,p,CONTEXT_FLOW_IN===r)&&(d=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===_&&(d=u&&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+'"'),s=0,c=t.implicitTypes.length;s 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,a=t.position,i=!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(i=!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)):i&&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(a,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(a-1):null,_=_&&isPlainSafe(i,u)}else{for(a=0;an&&" "!==t[f+1],f=a);else if(!isPrintable(i))return STYLE_DOUBLE;u=a>0?t.charCodeAt(a-1):null,_=_&&isPlainSafe(i,u)}l=l||p&&a-f-1>n&&" "!==t[f+1]}return c||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),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),i=n||t.flowLevel>-1&&r>=t.flowLevel;switch(chooseScalarStyle(e,i,t.indent,a,(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,a=/(\n+)([^\n]*)/g,i=(o=-1!==(o=t.indexOf("\n"))?o:t.length,a.lastIndex=o,foldLine(t.slice(0,o),e)),u="\n"===t[0]||" "===t[0];n=a.exec(t);){var s=n[1],c=n[2];r=" "===c[0],i+=s+(u||r||""===c?"":"\n")+foldLine(c,e),u=r}return i}(e,a),o));case STYLE_DOUBLE:return'"'+function(t){for(var e,r,n,o="",a=0;a=55296&&e<=56319&&(r=t.charCodeAt(a+1))>=56320&&r<=57343?(o+=encodeHex(1024*(e-55296)+r-56320+65536),a++):o+=!(n=ESCAPE_SEQUENCES[e])&&isPrintable(e)?t[a]: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,a=0,i=0,u=0,s="";r=o.exec(t);)(u=r.index)-a>e&&(n=i>a?i:u,s+="\n"+t.slice(a,n),a=n+1),i=u;return s+="\n",t.length-a>e&&i>a?s+=t.slice(a,i)+"\n"+t.slice(i+1):s+=t.slice(a),s.slice(1)}function detectType(t,e,r){var n,o,a,i,u,s;for(a=0,i=(o=r?t.explicitTypes:t.implicitTypes).length;a tag resolver accepts not "'+s+'" style');n=u.represent[s](e,s)}t.dump=n}return!0}return!1}function writeNode(t,e,r,n,o,a){t.tag=null,t.dump=r,detectType(t,r,!1)||detectType(t,r,!0);var i=___toString_8.call(t.dump);n&&(n=t.flowLevel<0||t.flowLevel>e);var u,s,c="[object Object]"===i||"[object Array]"===i;if(c&&(s=-1!==(u=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||s||2!==t.indent&&e>0)&&(o=!1),s&&t.usedDuplicates[u])t.dump="*ref_"+u;else{if(c&&s&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=!0),"[object Object]"===i)n&&0!==Object.keys(t.dump).length?(function(t,e,r,n){var o,a,i,u,s,c,l="",p=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,a=f.length;o1024)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,s&&(c+=generateNextLine(t,e)),writeNode(t,e+1,u,!0,s)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=p,t.dump=l||"{}"}(t,e,t.dump,o),s&&(t.dump="&ref_"+u+t.dump)):(function(t,e,r){var n,o,a,i,u,s="",c=t.tag,l=Object.keys(r);for(n=0,o=l.length;n1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,e,i,!1,!1)&&(s+=u+=t.dump));t.tag=c,t.dump="{"+s+"}"}(t,e,t.dump),s&&(t.dump="&ref_"+u+" "+t.dump));else if("[object Array]"===i){var l=t.noArrayIndent&&e>0?e-1:e;n&&0!==t.dump.length?(function(t,e,r,n){var o,a,i="",u=t.tag;for(o=0,a=r.length;o "+t.dump)}return!0}function getDuplicateReferences(t,e){var r,n,o=[],a=[];for(function t(e,r,n){var o,a,i;if(null!==e&&"object"==typeof e)if(-1!==(a=r.indexOf(e)))-1===n.indexOf(a)&&n.push(a);else if(r.push(e),Array.isArray(e))for(a=0,i=e.length;a0?o-4:o;for(r=0;r>16&255,i[u++]=e>>8&255,i[u++]=255&e;return 2===a&&(e=revLookup[t.charCodeAt(r)]<<2|revLookup[t.charCodeAt(r+1)]>>4,i[u++]=255&e),1===a&&(e=revLookup[t.charCodeAt(r)]<<10|revLookup[t.charCodeAt(r+1)]<<4|revLookup[t.charCodeAt(r+2)]>>2,i[u++]=e>>8&255,i[u++]=255&e),i},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],a=0,i=r-n;ai?i:a+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,a=[],i=e;i>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]);return a.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var _$ieee754_3={read:function(t,e,r,n,o){var a,i,u=8*o-n-1,s=(1<>1,l=-7,p=r?o-1:0,f=r?-1:1,_=t[e+p];for(p+=f,a=_&(1<<-l)-1,_>>=-l,l+=u;l>0;a=256*a+t[e+p],p+=f,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+t[e+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(_?-1:1);i+=Math.pow(2,n),a-=c}return(_?-1:1)*i*Math.pow(2,a-n)},write:function(t,e,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-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?(u=isNaN(e)?1:0,i=l):(i=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-i))<1&&(i--,s*=2),(e+=i+p>=1?f/s:f*Math.pow(2,1-p))*s>=2&&(i++,s/=2),i+p>=l?(u=0,i=l):i+p>=1?(u=(e*s-1)*Math.pow(2,o),i+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;t[r+_]=255&u,_+=h,u/=256,o-=8);for(i=i<0;t[r+_]=255&i,_+=h,i/=256,c-=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,a="function"==typeof TextDecoder?new TextDecoder:void 0,i="function"==typeof TextEncoder?new TextEncoder:void 0,u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),s=(t={},u.forEach((function(e,r){return t[e]=r})),t),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),p="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?"-":"_"}))},_=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(t){for(var e,r,n,o,a="",i=t.length%3,s=0;s255||(n=t.charCodeAt(s++))>255||(o=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");a+=u[(e=r<<16|n<<8|o)>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}return i?a.slice(0,i-3)+"===".substring(i):a},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,b=function(t){return t.replace(g,m)},E=o?function(t){return e.from(t,"utf8").toString("base64")}:i?function(t){return y(i.encode(t))}:function(t){return d(b(t))},A=function(t,e){return void 0===e&&(e=!1),e?f(E(t)):E(t)},w=function(t){return A(t,!0)},C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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))}},S=function(t){return t.replace(C,x)},$=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",a=0;a>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return o},O=r?function(t){return atob(_(t))}:o?function(t){return e.from(t,"base64").toString("binary")}:$,L=o?function(t){return p(e.from(t,"base64"))}:function(t){return p(O(t),(function(t){return t.charCodeAt(0)}))},P=function(t){return L(k(t))},F=o?function(t){return e.from(t,"base64").toString("utf8")}:a?function(t){return a.decode(L(t))}:function(t){return S(O(t))},k=function(t){return _(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},R=function(t){return F(k(t))},I=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},T=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,I(e))};t("fromBase64",(function(){return R(this)})),t("toBase64",(function(t){return A(this,t)})),t("toBase64URI",(function(){return A(this,!0)})),t("toBase64URL",(function(){return A(this,!0)})),t("toUint8Array",(function(){return P(this)}))},j=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,I(e))};t("toBase64",(function(t){return v(this,t)})),t("toBase64URI",(function(){return v(this,!0)})),t("toBase64URL",(function(){return v(this,!0)}))},N={version:"3.7.2",VERSION:"3.7.2",atob:O,atobPolyfill:$,btoa:d,btoaPolyfill:h,fromBase64:R,toBase64:A,encode:A,encodeURI:w,encodeURL:w,utob:b,btou:S,decode:R,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:v,toUint8Array:P,extendString:T,extendUint8Array:j,extendBuiltins:function(){T(),j()},Base64:{}};return Object.keys(N).forEach((function(t){return N.Base64[t]=N[t]})),N}))}).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 _$preprocessors_75={};function ___createForOfIteratorHelper_75(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_75(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_75(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_75(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_65.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,a=r.password,i=r.servers,u=0;u({source:t,text:e.split(/\r\n|\n|\r/g)}));function r(t,r,n=""){let o="";const a=e.find(({source:e})=>e===t.source),i=t.start;if(a){const e=t.end,u=a.text[i.line-1],s=(i.line===e.line?e.column:u.length+1)-i.column||1;n&&(o+="\nnote: "+n),o+=`\n --\x3e ${t.source}:${i.line}:${i.column}\n${"".padEnd(r)} |\n${i.line.toString().padStart(r)} | ${u}\n${"".padEnd(r)} | ${"".padEnd(i.column-1)}${"".padEnd(s,"^")}`}else o+=`\n at ${t.source}:${i.line}:${i.column}`,n&&(o+=": "+n);return o}return this.problems.filter(t=>"info"!==t[0]).map(t=>function(t,e,n,o=[]){let a;a=(a=n?o.reduce((t,{location:e})=>Math.max(t,e.start.line),n.start.line):Math.max.apply(null,o.map(t=>t.location.start.line))).toString().length;let i=`${t}: ${e}`;n&&(i+=r(n,a));for(const u of o)i+=r(u.location,a,u.message);return i}(...t)).join("\n\n")}}var _$GrammarError_53=GrammarError;const visitor={build(t){function e(e,...r){return t[e.type](e,...r)}function r(){}function n(t,...r){return e(t.expression,...r)}function o(t){return function(r,...n){r[t].forEach(t=>e(t,...n))}}const a={grammar(t,...r){t.topLevelInitializer&&e(t.topLevelInitializer,...r),t.initializer&&e(t.initializer,...r),t.rules.forEach(t=>e(t,...r))},top_level_initializer:r,initializer:r,rule:n,named:n,choice:o("alternatives"),action:n,sequence:o("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,group:n,semantic_and:r,semantic_not:r,rule_ref:r,literal:r,class:r,any:r};return Object.keys(a).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)||(t[e]=a[e])}),e}};var _$visitor_52=visitor;const asts={findRule(t,e){for(let r=0;rt.alternatives.every(o),sequence:t=>t.elements.some(o),simple_and:n,simple_not:n,optional:n,zero_or_more:n,semantic_and:n,semantic_not:n,rule_ref(e){const r=asts.findRule(t,e.name);return r?o(r):void 0},literal:t=>""!==t.value,class:r,any:r});return o(e)}};var _$asts_36=asts,_$opcodes_38={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29},_$inferenceMatchResult_41={};const ALWAYS_MATCH=1,SOMETIMES_MATCH=0,NEVER_MATCH=-1;function inferenceMatchResult(t){function e(t){return t.match=SOMETIMES_MATCH}function r(t){return a(t.expression),t.match=ALWAYS_MATCH}function n(t){return t.match=a(t.expression)}function o(t,e){const r=t.length;let n=0,o=0;for(let i=0;i0?NEVER_MATCH:SOMETIMES_MATCH}const a=_$visitor_52.build({rule(t){let e,r=0;if(void 0===t.match){t.match=SOMETIMES_MATCH;do{if(e=t.match,t.match=a(t.expression),++r>6)throw new _$GrammarError_53("Infinity cycle detected when trying to evaluate node match result",t.location)}while(e!==t.match)}return t.match},named:n,choice:t=>t.match=o(t.alternatives,!0),action:n,sequence:t=>t.match=o(t.elements,!1),labeled:n,text:n,simple_and:n,simple_not:t=>t.match=-a(t.expression),optional:r,zero_or_more:r,one_or_more:n,group:n,semantic_and:e,semantic_not:e,rule_ref(e){const r=_$asts_36.findRule(t,e.name);return e.match=a(r)},literal(t){const e=0===t.value.length?ALWAYS_MATCH:SOMETIMES_MATCH;return t.match=e},class(t){const e=0===t.parts.length?NEVER_MATCH:SOMETIMES_MATCH;return t.match=e},any:e});a(t)}inferenceMatchResult.ALWAYS_MATCH=ALWAYS_MATCH,inferenceMatchResult.SOMETIMES_MATCH=SOMETIMES_MATCH,inferenceMatchResult.NEVER_MATCH=NEVER_MATCH,_$inferenceMatchResult_41=inferenceMatchResult;const{ALWAYS_MATCH:__ALWAYS_MATCH_39,SOMETIMES_MATCH:__SOMETIMES_MATCH_39,NEVER_MATCH:__NEVER_MATCH_39}=_$inferenceMatchResult_41;var _$generateBytecode_39=function(t){const e=[],r=[],n=[],o=[];function a(t){const e=JSON.stringify(t),r=n.findIndex(t=>JSON.stringify(t)===e);return-1===r?n.push(t)-1:r}function i(t,e,r){const n={predicate:t,params:e,body:r.code,location:r.codeLocation},a=JSON.stringify(n),i=o.findIndex(t=>JSON.stringify(t)===a);return-1===i?o.push(n)-1:i}function u(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function s(t,...e){return t.concat(...e)}function c(t,e,r,n){return t===__ALWAYS_MATCH_39?r:t===__NEVER_MATCH_39?n:e.concat([r.length,n.length],r,n)}function l(t,e,r,n){const o=Object.keys(r).map(t=>n-r[t]);return[_$opcodes_38.CALL,t,e,o.length].concat(o)}function p(t,e,r){const n=0|t.match;return s([_$opcodes_38.PUSH_CURR_POS],[_$opcodes_38.SILENT_FAILS_ON],h(t,{sp:r.sp+1,env:u(r.env),action:null}),[_$opcodes_38.SILENT_FAILS_OFF],c(e?-n:n,[e?_$opcodes_38.IF_ERROR:_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[e?_$opcodes_38.POP:_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],[e?_$opcodes_38.POP_CURR_POS:_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))}function f(t,e,r){const n=i(!0,Object.keys(r.env),t);return s([_$opcodes_38.UPDATE_SAVED_POS],l(n,0,r.env,r.sp),c(0|t.match,[_$opcodes_38.IF],s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_FAILED]:[_$opcodes_38.PUSH_UNDEFINED]),s([_$opcodes_38.POP],e?[_$opcodes_38.PUSH_UNDEFINED]:[_$opcodes_38.PUSH_FAILED])))}function _(t){return e=[_$opcodes_38.WHILE_NOT_ERROR],r=s([_$opcodes_38.APPEND],t),e.concat([r.length],r);var e,r}const h=_$visitor_52.build({grammar(t){t.rules.forEach(h),t.literals=e,t.classes=r,t.expectations=n,t.functions=o},rule(t){t.bytecode=h(t.expression,{sp:-1,env:{},pluck:[],action:null})},named(t,e){const r=0|t.match,n=r===__NEVER_MATCH_39?null:a({type:"rule",value:t.name});return s([_$opcodes_38.SILENT_FAILS_ON],h(t.expression,e),[_$opcodes_38.SILENT_FAILS_OFF],c(r,[_$opcodes_38.IF_ERROR],[_$opcodes_38.FAIL,n],[]))},choice:(t,e)=>function t(e,r){const n=0|e[0].match,o=h(e[0],{sp:r.sp,env:u(r.env),action:null});return n===__ALWAYS_MATCH_39?o:s(o,e.length>1?c(__SOMETIMES_MATCH_39,[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],t(e.slice(1),r)),[]):[])}(t.alternatives,e),action(t,e){const r=u(e.env),n="sequence"!==t.expression.type||0===t.expression.elements.length,o=h(t.expression,{sp:e.sp+(n?1:0),env:r,action:t}),a=0|t.expression.match,p=n&&a!==__NEVER_MATCH_39?i(!1,Object.keys(r),t):null;return n?s([_$opcodes_38.PUSH_CURR_POS],o,c(a,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.LOAD_SAVED_POS,1],l(p,1,r,e.sp+2)),[]),[_$opcodes_38.NIP]):o},sequence:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],function e(r,n){if(r.length>0){const o=t.elements.length-r.length+1;return s(h(r[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),c(0|r[0].match,[_$opcodes_38.IF_NOT_ERROR],e(r.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),s(o>1?[_$opcodes_38.POP_N,o]:[_$opcodes_38.POP],[_$opcodes_38.POP_CURR_POS],[_$opcodes_38.PUSH_FAILED])))}if(n.pluck.length>0)return s([_$opcodes_38.PLUCK,t.elements.length+1,n.pluck.length],n.pluck.map(t=>n.sp-t));if(n.action){const e=i(!1,Object.keys(n.env),n.action);return s([_$opcodes_38.LOAD_SAVED_POS,t.elements.length],l(e,t.elements.length+1,n.env,n.sp))}return s([_$opcodes_38.WRAP,t.elements.length],[_$opcodes_38.NIP])}(t.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action})),labeled(t,e){let r=e.env;const n=t.label,o=e.sp+1;return n&&(r=u(e.env),e.env[t.label]=o),t.pick&&e.pluck.push(o),h(t.expression,{sp:e.sp,env:r,action:null})},text:(t,e)=>s([_$opcodes_38.PUSH_CURR_POS],h(t.expression,{sp:e.sp+1,env:u(e.env),action:null}),c(0|t.match,[_$opcodes_38.IF_NOT_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.TEXT]),[_$opcodes_38.NIP])),simple_and:(t,e)=>p(t.expression,!1,e),simple_not:(t,e)=>p(t.expression,!0,e),optional:(t,e)=>s(h(t.expression,{sp:e.sp,env:u(e.env),action:null}),c(-(0|t.expression.match),[_$opcodes_38.IF_ERROR],s([_$opcodes_38.POP],[_$opcodes_38.PUSH_NULL]),[])),zero_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,_(r),[_$opcodes_38.POP])},one_or_more(t,e){const r=h(t.expression,{sp:e.sp+1,env:u(e.env),action:null});return s([_$opcodes_38.PUSH_EMPTY_ARRAY],r,c(0|t.expression.match,[_$opcodes_38.IF_NOT_ERROR],s(_(r),[_$opcodes_38.POP]),s([_$opcodes_38.POP],[_$opcodes_38.POP],[_$opcodes_38.PUSH_FAILED])))},group:(t,e)=>h(t.expression,{sp:e.sp,env:u(e.env),action:null}),semantic_and:(t,e)=>f(t,!1,e),semantic_not:(t,e)=>f(t,!0,e),rule_ref:e=>[_$opcodes_38.RULE,_$asts_36.indexOfRule(t,e.name)],literal(t){if(t.value.length>0){const r=0|t.match,n=r===__SOMETIMES_MATCH_39||r===__ALWAYS_MATCH_39&&!t.ignoreCase?function(t){const r=e.indexOf(t);return-1===r?e.push(t)-1:r}(t.ignoreCase?t.value.toLowerCase():t.value):null,o=r!==__ALWAYS_MATCH_39?a({type:"literal",value:t.value,ignoreCase:t.ignoreCase}):null;return c(r,t.ignoreCase?[_$opcodes_38.MATCH_STRING_IC,n]:[_$opcodes_38.MATCH_STRING,n],t.ignoreCase?[_$opcodes_38.ACCEPT_N,t.value.length]:[_$opcodes_38.ACCEPT_STRING,n],[_$opcodes_38.FAIL,o])}return[_$opcodes_38.PUSH_EMPTY_STRING]},class(t){const e=0|t.match,n=e===__SOMETIMES_MATCH_39?function(t){const e={value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase},n=JSON.stringify(e),o=r.findIndex(t=>JSON.stringify(t)===n);return-1===o?r.push(e)-1:o}(t):null,o=e!==__ALWAYS_MATCH_39?a({type:"class",value:t.parts,inverted:t.inverted,ignoreCase:t.ignoreCase}):null;return c(e,[_$opcodes_38.MATCH_CHAR_CLASS,n],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,o])},any(t){const e=0|t.match,r=e!==__ALWAYS_MATCH_39?a({type:"any"}):null;return c(e,[_$opcodes_38.MATCH_ANY],[_$opcodes_38.ACCEPT_N,1],[_$opcodes_38.FAIL,r])}});h(t)},_$stack_50=class{constructor(t,e,r){this.sp=-1,this.maxSp=-1,this.varName=e,this.ruleName=t,this.type=r}name(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack underflow: attempt to use a variable '${this.varName}' at an index ${t}`);return this.varName+t}push(t){const e=this.name(++this.sp)+" = "+t+";";return this.sp>this.maxSp&&(this.maxSp=this.sp),e}pop(t){return void 0!==t?(this.sp-=t,Array.from({length:t},(t,e)=>this.name(this.sp+1+e))):this.name(this.sp--)}top(){return this.name(this.sp)}index(t){if(t<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack overflow: attempt to get a variable at a negative index ${t}`);return this.name(this.sp-t)}result(){if(this.maxSp<0)throw new RangeError(`Rule '${this.ruleName}': The variable stack is empty, can't get the result'`);return this.name(0)}defines(){return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},(t,e)=>this.name(e)).join(", ")+";"}checkedIf(t,e,r){const n=this.sp;if(e(),r){const e=this.sp;if(this.sp=n,r(),e!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+e+", after else: "+this.sp+").")}}checkedLoop(t,e){const r=this.sp;if(e(),r!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+t+": Body of a loop can't move the stack pointer (before: "+r+", after: "+this.sp+").")}},_$version_56="2.0.1",_$utils_51={};function hex(t){return t.charCodeAt(0).toString(16).toUpperCase()}_$utils_51.hex=hex,_$utils_51.stringEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))},_$utils_51.regexpClassEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+hex(t)).replace(/[\x10-\x1F\x7F-\xFF]/g,t=>"\\x"+hex(t)).replace(/[\u0100-\u0FFF]/g,t=>"\\u0"+hex(t)).replace(/[\u1000-\uFFFF]/g,t=>"\\u"+hex(t))};var _$base64_59={};const intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");_$base64_59.encode=function(t){if(0<=t&&t>>=5)>0&&(e|=32),r+=_$base64_59.encode(e)}while(n>0);return r}},_$util_63={getArg:function(t,e,r){if(e in t)return t[e];if(3===arguments.length)return r;throw new Error('"'+e+'" is a required argument.')}};const supportsNullProto=!("__proto__"in Object.create(null));function identity(t){return t}function isProtoString(t){if(!t)return!1;const e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(let r=e-10;r>=0;r--)if(36!==t.charCodeAt(r))return!1;return!0}function strcmp(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}_$util_63.toSetString=supportsNullProto?identity:function(t){return isProtoString(t)?"$"+t:t},_$util_63.fromSetString=supportsNullProto?identity:function(t){return isProtoString(t)?t.slice(1):t},_$util_63.compareByGeneratedPositionsInflated=function(t,e){let r=t.generatedLine-e.generatedLine;return 0!==r||0!=(r=t.generatedColumn-e.generatedColumn)||0!==(r=strcmp(t.source,e.source))||0!=(r=t.originalLine-e.originalLine)||0!=(r=t.originalColumn-e.originalColumn)?r:strcmp(t.name,e.name)};const PROTOCOL="http:",PROTOCOL_AND_HOST=PROTOCOL+"//host";function createSafeHandler(t){return e=>{const r=getURLType(e),n=buildSafeBase(e),o=new URL(e,n);t(o);const a=o.toString();return"absolute"===r?a:"scheme-relative"===r?a.slice(PROTOCOL.length):"path-absolute"===r?a.slice(PROTOCOL_AND_HOST.length):computeRelativeURL(n,a)}}function withBase(t,e){return new URL(t,e).toString()}function buildSafeBase(t){const e=t.split("..").length-1,r=function(t,e){let r=0;for(;;){const t="p"+r++;if(-1===e.indexOf(t))return t}}(0,t);let n=PROTOCOL_AND_HOST+"/";for(let o=0;o0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+e.search+e.hash}const ensureDirectory=createSafeHandler(t=>{t.pathname=t.pathname.replace(/\/?$/,"/")}),normalize=createSafeHandler(t=>{});_$util_63.normalize=normalize,_$util_63.join=function(t,e){const r=getURLType(e),n=getURLType(t);if(t=ensureDirectory(t),"absolute"===r)return withBase(e,void 0);if("absolute"===n)return withBase(e,t);if("scheme-relative"===r)return normalize(e);if("scheme-relative"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL.length);if("path-absolute"===r)return normalize(e);if("path-absolute"===n)return withBase(e,withBase(t,PROTOCOL_AND_HOST)).slice(PROTOCOL_AND_HOST.length);const o=buildSafeBase(e+t);return computeRelativeURL(o,withBase(e,withBase(t,o)))},_$util_63.relative=function(t,e){const r=function(t,e){if(getURLType(t)!==getURLType(e))return null;const r=buildSafeBase(t+e),n=new URL(t,r),o=new URL(e,r);try{new URL("",o.toString())}catch(a){return null}return o.protocol!==n.protocol||o.user!==n.user||o.password!==n.password||o.hostname!==n.hostname||o.port!==n.port?null:computeRelativeURL(n,o)}(t,e);return"string"==typeof r?r:normalize(e)};var _$arraySet_57={};class ArraySet{constructor(){this._array=[],this._set=new Map}static fromArray(t,e){const r=new ArraySet;for(let n=0,o=t.length;n=0)return e;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&tr||n==r&&a>=o||_$util_63.compareByGeneratedPositionsInflated(t,e)<=0}(this._last,t)?(this._sorted=!1,this._array.push(t)):(this._last=t,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(_$util_63.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}},_$sourceMapGenerator_61={};const __ArraySet_61=_$arraySet_57.ArraySet,MappingList=_$mappingList_60.MappingList;class SourceMapGenerator{constructor(t){t||(t={}),this._file=_$util_63.getArg(t,"file",null),this._sourceRoot=_$util_63.getArg(t,"sourceRoot",null),this._skipValidation=_$util_63.getArg(t,"skipValidation",!1),this._sources=new __ArraySet_61,this._names=new __ArraySet_61,this._mappings=new MappingList,this._sourcesContents=null}static fromSourceMap(t){const e=t.sourceRoot,r=new SourceMapGenerator({file:t.file,sourceRoot:e});return t.eachMapping((function(t){const n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=e&&(n.source=_$util_63.relative(e,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),r.addMapping(n)})),t.sources.forEach((function(n){let o=n;null!=e&&(o=_$util_63.relative(e,n)),r._sources.has(o)||r._sources.add(o);const a=t.sourceContentFor(n);null!=a&&r.setSourceContent(n,a)})),r}addMapping(t){const e=_$util_63.getArg(t,"generated"),r=_$util_63.getArg(t,"original",null);let n=_$util_63.getArg(t,"source",null),o=_$util_63.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:n,name:o})}setSourceContent(t,e){let r=t;null!=this._sourceRoot&&(r=_$util_63.relative(this._sourceRoot,r)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[_$util_63.toSetString(r)]=e):this._sourcesContents&&(delete this._sourcesContents[_$util_63.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))}applySourceMap(t,e,r){let n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}const o=this._sourceRoot;null!=o&&(n=_$util_63.relative(o,n));const a=this._mappings.toArray().length>0?new __ArraySet_61:this._sources,i=new __ArraySet_61;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){const n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=_$util_63.join(r,e.source)),null!=o&&(e.source=_$util_63.relative(o,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.name))}const u=e.source;null==u||a.has(u)||a.add(u);const s=e.name;null==s||i.has(s)||i.add(s)}),this),this._sources=a,this._names=i,t.sources.forEach((function(e){const n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=_$util_63.join(r,e)),null!=o&&(e=_$util_63.relative(o,e)),this.setSourceContent(e,n))}),this)}_validateMapping(t,e,r,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!r&&!n);else if(!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:e,name:n}))}_serializeMappings(){let t,e,r,n,o=0,a=1,i=0,u=0,s=0,c=0,l="";const p=this._mappings.toArray();for(let f=0,_=p.length;f<_;f++){if(t="",(e=p[f]).generatedLine!==a)for(o=0;e.generatedLine!==a;)t+=";",a++;else if(f>0){if(!_$util_63.compareByGeneratedPositionsInflated(e,p[f-1]))continue;t+=","}t+=_$base64Vlq_58.encode(e.generatedColumn-o),o=e.generatedColumn,null!=e.source&&(n=this._sources.indexOf(e.source),t+=_$base64Vlq_58.encode(n-c),c=n,t+=_$base64Vlq_58.encode(e.originalLine-1-u),u=e.originalLine-1,t+=_$base64Vlq_58.encode(e.originalColumn-i),i=e.originalColumn,null!=e.name&&(r=this._names.indexOf(e.name),t+=_$base64Vlq_58.encode(r-s),s=r)),l+=t}return l}_generateSourcesContent(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=_$util_63.relative(e,t));const r=_$util_63.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)}toJSON(){const t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}}SourceMapGenerator.prototype._version=3,_$sourceMapGenerator_61.SourceMapGenerator=SourceMapGenerator;var _$sourceNode_62={};const __SourceMapGenerator_62=_$sourceMapGenerator_61.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";class SourceNode{constructor(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}static fromStringWithSourceMap(t,e,r){const n=new SourceNode,o=t.split(REGEX_NEWLINE);let a=0;const i=function(){return t()+(t()||"");function t(){return a=0;e--)this.prepend(t[e]);else{if(!t[isSourceNode]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this}walk(t){let e;for(let r=0,n=this.children.length;r0){for(e=[],r=0;rnew __SourceNode_40(n+i,0===i?o:0,e.source,i===a.length-1?t:[t,"\n"],r)))}function wrapInSourceNode(t,e,r,n,o){return r?new __SourceNode_40(null,null,r.source,[t,toSourceNode(e,r,o),new __SourceNode_40(r.end.line,r.end.column-1,r.source,n)]):new __SourceNode_40(null,null,null,[t,e,n])}var _$generateJs_40=function(t,e){function r(t){return t instanceof __SourceNode_40?t:t.replace(/^(.+)$/gm," $1")}function n(t){return"peg$c"+t}function o(t){return"peg$r"+t}function a(t){return"peg$e"+t}function i(t){return"peg$f"+t}function u(t){return"peg$parse"+t}function s(t){return t.codeLocation?toSourceNode(t.code,t.codeLocation,"$"+t.type):t.code}t.code=function(t){function n(){return[`// Generated by Peggy ${_$version_56}.`,"//","// https://peggyjs.org/"]}function o(){return e.trace?["{"," SyntaxError: peg$SyntaxError,"," DefaultTracer: peg$DefaultTracer,"," parse: peg$parse","}"].join("\n"):["{"," SyntaxError: peg$SyntaxError,"," parse: peg$parse","}"].join("\n")}const a={bare:()=>[...n(),"(function() {",' "use strict";',"",t,"",r("return "+o()+";"),"})()"],commonjs(){const r=Object.keys(e.dependencies),a=n();return a.push("",'"use strict";',""),r.length>0&&(r.forEach(t=>{a.push("var "+t+' = require("'+stringEscape(e.dependencies[t])+'");')}),a.push("")),a.push(t,"","module.exports = "+o()+";"),a},es(){const r=Object.keys(e.dependencies),o=n();return o.push(""),r.length>0&&(r.forEach(t=>{o.push("import "+t+' from "'+stringEscape(e.dependencies[t])+'";')}),o.push("")),o.push(t,"","export {"," peg$SyntaxError as SyntaxError,",e.trace?" peg$DefaultTracer as DefaultTracer,":""," peg$parse as parse","};"),o},amd(){const a=Object.keys(e.dependencies),i="["+a.map(t=>e.dependencies[t]).map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",u=a.join(", ");return[...n(),"define("+i+", function("+u+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"]},globals:()=>[...n(),"(function(root) {",' "use strict";',"",t,"",r("root."+e.exportVar+" = "+o()+";"),"})(this);"],umd(){const a=Object.keys(e.dependencies),i=a.map(t=>e.dependencies[t]),u="["+i.map(t=>'"'+stringEscape(t)+'"').join(", ")+"]",s=i.map(t=>'require("'+stringEscape(t)+'")').join(", "),c=a.join(", "),l=n();return l.push("(function(root, factory) {",' if (typeof define === "function" && define.amd) {'," define("+u+", factory);",' } else if (typeof module === "object" && module.exports) {'," module.exports = factory("+s+");"),null!==e.exportVar&&l.push(" } else {"," root."+e.exportVar+" = factory();"),l.push(" }","})(this, function("+c+") {",' "use strict";',"",t,"",r("return "+o()+";"),"});"),l}}[e.format]();return new __SourceNode_40(null,null,e.grammarSource,a.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}(function(){const c=[];t.topLevelInitializer&&(c.push(s(t.topLevelInitializer)),c.push("")),c.push("function peg$subclass(child, parent) {"," function C() { this.constructor = child; }"," C.prototype = parent.prototype;"," child.prototype = new C();","}","","function peg$SyntaxError(message, expected, found, location) {"," var self = Error.call(this, message);"," // istanbul ignore next Check is a necessary evil to support older environments"," if (Object.setPrototypeOf) {"," Object.setPrototypeOf(self, peg$SyntaxError.prototype);"," }"," self.expected = expected;"," self.found = found;"," self.location = location;",' self.name = "SyntaxError";'," return self;","}","","peg$subclass(peg$SyntaxError, Error);","","function peg$padEnd(str, targetLength, padString) {",' padString = padString || " ";'," if (str.length > targetLength) { return str; }"," targetLength -= str.length;"," padString += padString.repeat(targetLength);"," return str + padString.slice(0, targetLength);","}","","peg$SyntaxError.prototype.format = function(sources) {",' var str = "Error: " + this.message;'," if (this.location) {"," var src = null;"," var k;"," for (k = 0; k < sources.length; k++) {"," if (sources[k].source === this.location.source) {"," src = sources[k].text.split(/\\r\\n|\\n|\\r/g);"," break;"," }"," }"," var s = this.location.start;",' var loc = this.location.source + ":" + s.line + ":" + s.column;'," if (src) {"," var e = this.location.end;"," var filler = peg$padEnd(\"\", s.line.toString().length, ' ');"," var line = src[s.line - 1];"," var last = s.line === e.line ? e.column : line.length + 1;"," var hatLen = (last - s.column) || 1;",' str += "\\n --\x3e " + loc + "\\n"',' + filler + " |\\n"',' + s.line + " | " + line + "\\n"',' + filler + " | " + peg$padEnd("", s.column - 1, \' \')',' + peg$padEnd("", hatLen, "^");'," } else {",' str += "\\n at " + loc;'," }"," }"," return str;","};","","peg$SyntaxError.buildMessage = function(expected, found) {"," var DESCRIBE_EXPECTATION_FNS = {"," literal: function(expectation) {",' return "\\"" + literalEscape(expectation.text) + "\\"";'," },",""," class: function(expectation) {"," var escapedParts = expectation.parts.map(function(part) {"," return Array.isArray(part)",' ? classEscape(part[0]) + "-" + classEscape(part[1])'," : classEscape(part);"," });","",' return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";'," },",""," any: function() {",' return "any character";'," },",""," end: function() {",' return "end of input";'," },",""," other: function(expectation) {"," return expectation.description;"," }"," };",""," function hex(ch) {"," return ch.charCodeAt(0).toString(16).toUpperCase();"," }",""," function literalEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/"/g, "\\\\\\"")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function classEscape(s) {"," return s",' .replace(/\\\\/g, "\\\\\\\\")',' .replace(/\\]/g, "\\\\]")',' .replace(/\\^/g, "\\\\^")',' .replace(/-/g, "\\\\-")',' .replace(/\\0/g, "\\\\0")',' .replace(/\\t/g, "\\\\t")',' .replace(/\\n/g, "\\\\n")',' .replace(/\\r/g, "\\\\r")',' .replace(/[\\x00-\\x0F]/g, function(ch) { return "\\\\x0" + hex(ch); })',' .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return "\\\\x" + hex(ch); });'," }",""," function describeExpectation(expectation) {"," return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);"," }",""," function describeExpected(expected) {"," var descriptions = expected.map(describeExpectation);"," var i, j;",""," descriptions.sort();",""," if (descriptions.length > 0) {"," for (i = 1, j = 1; i < descriptions.length; i++) {"," if (descriptions[i - 1] !== descriptions[i]) {"," descriptions[j] = descriptions[i];"," j++;"," }"," }"," descriptions.length = j;"," }",""," switch (descriptions.length) {"," case 1:"," return descriptions[0];",""," case 2:",' return descriptions[0] + " or " + descriptions[1];',""," default:",' return descriptions.slice(0, -1).join(", ")',' + ", or "'," + descriptions[descriptions.length - 1];"," }"," }",""," function describeFound(found) {",' return found ? "\\"" + literalEscape(found) + "\\"" : "end of input";'," }","",' return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";',"};",""),e.trace&&c.push("function peg$DefaultTracer() {"," this.indentLevel = 0;","}","","peg$DefaultTracer.prototype.trace = function(event) {"," var that = this;",""," function log(event) {"," function repeat(string, n) {",' var result = "", i;',""," for (i = 0; i < n; i++) {"," result += string;"," }",""," return result;"," }",""," function pad(string, length) {",' return string + repeat(" ", length - string.length);'," }","",' if (typeof console === "object") {'," console.log(",' event.location.start.line + ":" + event.location.start.column + "-"',' + event.location.end.line + ":" + event.location.end.column + " "',' + pad(event.type, 10) + " "',' + repeat(" ", that.indentLevel) + event.rule'," );"," }"," }",""," switch (event.type) {",' case "rule.enter":'," log(event);"," this.indentLevel++;"," break;","",' case "rule.match":'," this.indentLevel--;"," log(event);"," break;","",' case "rule.fail":'," this.indentLevel--;"," log(event);"," break;",""," default:",' throw new Error("Invalid event type: " + event.type + ".");'," }","};","");const l="{ "+e.allowedStartRules.map(t=>t+": "+u(t)).join(", ")+" }",p=u(e.allowedStartRules[0]);return c.push("function peg$parse(input, options) {"," options = options !== undefined ? options : {};",""," var peg$FAILED = {};"," var peg$source = options.grammarSource;",""," var peg$startRuleFunctions = "+l+";"," var peg$startRuleFunction = "+p+";","",new __SourceNode_40(null,null,e.grammarSource,[t.literals.map((t,e)=>" var "+n(e)+' = "'+stringEscape(t)+'";').concat("",t.classes.map((t,e)=>{return" var "+o(e)+" = /^["+((r=t).inverted?"^":"")+r.value.map(t=>Array.isArray(t)?regexpClassEscape(t[0])+"-"+regexpClassEscape(t[1]):regexpClassEscape(t)).join("")+"]/"+(r.ignoreCase?"i":"")+";";var r})).concat("",t.expectations.map((t,e)=>" var "+a(e)+" = "+function(t){switch(t.type){case"rule":return'peg$otherExpectation("'+stringEscape(t.value)+'")';case"literal":return'peg$literalExpectation("'+stringEscape(t.value)+'", '+t.ignoreCase+")";case"class":return"peg$classExpectation(["+t.value.map(t=>Array.isArray(t)?'["'+stringEscape(t[0])+'", "'+stringEscape(t[1])+'"]':'"'+stringEscape(t)+'"').join(", ")+"], "+t.inverted+", "+t.ignoreCase+")";case"any":return"peg$anyExpectation()";default:throw new Error("Unknown expectation type ("+JSON.stringify(t)+")")}}(t)+";")).concat("").join("\n"),t.functions.map((function(t,e){return wrapInSourceNode(`\n var ${i(e)} = function(${t.params.join(", ")}) {`,t.body,t.location,"};")}))]),""," var peg$currPos = 0;"," var peg$savedPos = 0;"," var peg$posDetailsCache = [{ line: 1, column: 1 }];"," var peg$maxFailPos = 0;"," var peg$maxFailExpected = [];"," var peg$silentFails = 0;",""),e.cache&&c.push(" var peg$resultsCache = {};",""),e.trace&&c.push(' var peg$tracer = "tracer" in options ? options.tracer : new peg$DefaultTracer();',""),c.push(" var peg$result;","",' if ("startRule" in options) {'," if (!(options.startRule in peg$startRuleFunctions)) {",' throw new Error("Can\'t start parsing from rule \\"" + options.startRule + "\\".");'," }",""," peg$startRuleFunction = peg$startRuleFunctions[options.startRule];"," }",""," function text() {"," return input.substring(peg$savedPos, peg$currPos);"," }",""," function offset() {"," return peg$savedPos;"," }",""," function range() {"," return {"," source: peg$source,"," start: peg$savedPos,"," end: peg$currPos"," };"," }",""," function location() {"," return peg$computeLocation(peg$savedPos, peg$currPos);"," }",""," function expected(description, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildStructuredError("," [peg$otherExpectation(description)],"," input.substring(peg$savedPos, peg$currPos),"," location"," );"," }",""," function error(message, location) {"," location = location !== undefined"," ? location"," : peg$computeLocation(peg$savedPos, peg$currPos);",""," throw peg$buildSimpleError(message, location);"," }",""," function peg$literalExpectation(text, ignoreCase) {",' return { type: "literal", text: text, ignoreCase: ignoreCase };'," }",""," function peg$classExpectation(parts, inverted, ignoreCase) {",' return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };'," }",""," function peg$anyExpectation() {",' return { type: "any" };'," }",""," function peg$endExpectation() {",' return { type: "end" };'," }",""," function peg$otherExpectation(description) {",' return { type: "other", description: description };'," }",""," function peg$computePosDetails(pos) {"," var details = peg$posDetailsCache[pos];"," var p;",""," if (details) {"," return details;"," } else {"," p = pos - 1;"," while (!peg$posDetailsCache[p]) {"," p--;"," }",""," details = peg$posDetailsCache[p];"," details = {"," line: details.line,"," column: details.column"," };",""," while (p < pos) {"," if (input.charCodeAt(p) === 10) {"," details.line++;"," details.column = 1;"," } else {"," details.column++;"," }",""," p++;"," }",""," peg$posDetailsCache[pos] = details;",""," return details;"," }"," }",""," function peg$computeLocation(startPos, endPos) {"," var startPosDetails = peg$computePosDetails(startPos);"," var endPosDetails = peg$computePosDetails(endPos);",""," return {"," source: peg$source,"," start: {"," offset: startPos,"," line: startPosDetails.line,"," column: startPosDetails.column"," },"," end: {"," offset: endPos,"," line: endPosDetails.line,"," column: endPosDetails.column"," }"," };"," }",""," function peg$fail(expected) {"," if (peg$currPos < peg$maxFailPos) { return; }",""," if (peg$currPos > peg$maxFailPos) {"," peg$maxFailPos = peg$currPos;"," peg$maxFailExpected = [];"," }",""," peg$maxFailExpected.push(expected);"," }",""," function peg$buildSimpleError(message, location) {"," return new peg$SyntaxError(message, null, null, location);"," }",""," function peg$buildStructuredError(expected, found, location) {"," return new peg$SyntaxError("," peg$SyntaxError.buildMessage(expected, found),"," expected,"," found,"," location"," );"," }",""),t.rules.forEach(s=>{c.push(...function(s){const c=[],l=new _$stack_50(s.name,"s","var"),p=function e(s){let c=0;const p=s.length,f=[];let _;function h(t,n){const o=n+3,a=s[c+o-2],i=s[c+o-1];let u,p;l.checkedIf(c,()=>{c+=o,u=e(s.slice(c,c+a)),c+=a},i>0?()=>{p=e(s.slice(c,c+i)),c+=i}:null),f.push("if ("+t+") {"),f.push(...u.map(r)),i>0&&(f.push("} else {"),f.push(...p.map(r))),f.push("}")}function d(t){const n=s[c+2-1];let o;l.checkedLoop(c,()=>{c+=2,o=e(s.slice(c,c+n)),c+=n}),f.push("while ("+t+") {"),f.push(...o.map(r)),f.push("}")}function y(){const t=s[c+4-1],e=i(s[c+1])+"("+s.slice(c+4,c+4+t).map(t=>l.index(t)).join(", ")+")";l.pop(s[c+2]),f.push(l.push(e)),c+=4+t}for(;cl.index(t)).join(", ")} ]`,l.pop(s[c+1]),f.push(l.push(_)),c+=r;break}case _$opcodes_38.IF:h(l.top(),0);break;case _$opcodes_38.IF_ERROR:h(l.top()+" === peg$FAILED",0);break;case _$opcodes_38.IF_NOT_ERROR:h(l.top()+" !== peg$FAILED",0);break;case _$opcodes_38.WHILE_NOT_ERROR:d(l.top()+" !== peg$FAILED");break;case _$opcodes_38.MATCH_ANY:h("input.length > peg$currPos",0);break;case _$opcodes_38.MATCH_STRING:h(t.literals[s[c+1]].length>1?"input.substr(peg$currPos, "+t.literals[s[c+1]].length+") === "+n(s[c+1]):"input.charCodeAt(peg$currPos) === "+t.literals[s[c+1]].charCodeAt(0),1);break;case _$opcodes_38.MATCH_STRING_IC:h("input.substr(peg$currPos, "+t.literals[s[c+1]].length+").toLowerCase() === "+n(s[c+1]),1);break;case _$opcodes_38.MATCH_CHAR_CLASS:h(o(s[c+1])+".test(input.charAt(peg$currPos))",1);break;case _$opcodes_38.ACCEPT_N:f.push(l.push(s[c+1]>1?"input.substr(peg$currPos, "+s[c+1]+")":"input.charAt(peg$currPos)")),f.push(s[c+1]>1?"peg$currPos += "+s[c+1]+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.ACCEPT_STRING:f.push(l.push(n(s[c+1]))),f.push(t.literals[s[c+1]].length>1?"peg$currPos += "+t.literals[s[c+1]].length+";":"peg$currPos++;"),c+=2;break;case _$opcodes_38.FAIL:f.push(l.push("peg$FAILED")),f.push("if (peg$silentFails === 0) { peg$fail("+a(s[c+1])+"); }"),c+=2;break;case _$opcodes_38.LOAD_SAVED_POS:f.push("peg$savedPos = "+l.index(s[c+1])+";"),c+=2;break;case _$opcodes_38.UPDATE_SAVED_POS:f.push("peg$savedPos = peg$currPos;"),c++;break;case _$opcodes_38.CALL:y();break;case _$opcodes_38.RULE:f.push(l.push(u(t.rules[s[c+1]].name)+"()")),c+=2;break;case _$opcodes_38.SILENT_FAILS_ON:f.push("peg$silentFails++;"),c++;break;case _$opcodes_38.SILENT_FAILS_OFF:f.push("peg$silentFails--;"),c++;break;default:throw new Error("Invalid opcode: "+s[c]+".")}return f}(s.bytecode);return c.push(wrapInSourceNode(" function ",u(s.name),s.nameLocation,"() {\n",s.name)),e.trace&&c.push(" var startPos = peg$currPos;"),c.push(r(l.defines())),c.push(...function(r,n){const o=[];return o.push(""),e.trace&&o.push("peg$tracer.trace({",' type: "rule.enter",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)","});",""),e.cache&&(o.push("var key = peg$currPos * "+t.rules.length+" + "+n+";","var cached = peg$resultsCache[key];","","if (cached) {"," peg$currPos = cached.nextPos;",""),e.trace&&o.push("if (cached.result !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+r+","," result: cached.result,"," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+r+","," location: peg$computeLocation(startPos, startPos)"," });","}",""),o.push(" return cached.result;","}","")),o}('"'+stringEscape(s.name)+'"',_$asts_36.indexOfRule(t,s.name)).map(r)),c.push(...p.map(r)),c.push(...function(t,r){const n=[];return e.cache&&n.push("","peg$resultsCache[key] = { nextPos: peg$currPos, result: "+r+" };"),e.trace&&n.push("","if ("+r+" !== peg$FAILED) {"," peg$tracer.trace({",' type: "rule.match",'," rule: "+t+","," result: "+r+","," location: peg$computeLocation(startPos, peg$currPos)"," });","} else {"," peg$tracer.trace({",' type: "rule.fail",'," rule: "+t+","," location: peg$computeLocation(startPos, startPos)"," });","}"),n.push("","return "+r+";"),n}('"'+stringEscape(s.name)+'"',l.result()).map(r)),c.push("}"),c}(s).map(r)),c.push("")}),t.initializer&&(c.push(s(t.initializer)),c.push("")),c.push(" peg$result = peg$startRuleFunction();",""," if (peg$result !== peg$FAILED && peg$currPos === input.length) {"," return peg$result;"," } else {"," if (peg$result !== peg$FAILED && peg$currPos < input.length) {"," peg$fail(peg$endExpectation());"," }",""," throw peg$buildStructuredError("," peg$maxFailExpected,"," peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,"," peg$maxFailPos < input.length"," ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)"," : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)"," );"," }","}"),new __SourceNode_40(null,null,e.grammarSource,c.map(t=>t instanceof __SourceNode_40?t:t+"\n"))}())},_$removeProxyRules_42=function(t,e,r){const n=[];t.rules.forEach((o,a)=>{var i;"rule"===(i=o).type&&"rule_ref"===i.expression.type&&(function(t,e,n){_$visitor_52.build({rule_ref(o){o.name===e&&(o.name=n,r.info(`Proxy rule "${e}" replaced by the rule "${n}"`,o.location,[{message:"This rule will be used",location:_$asts_36.findRule(t,n).nameLocation}]))}})(t)}(t,o.name,o.expression.name),-1===e.allowedStartRules.indexOf(o.name)&&n.push(a))}),n.reverse(),n.forEach(e=>{t.rules.splice(e,1)})},_$reportDuplicateLabels_43=function(t,e,r){function n(t){const e={};return Object.keys(t).forEach(r=>{e[r]=t[r]}),e}function o(t,e){a(t.expression,n(e))}const a=_$visitor_52.build({rule(t){a(t.expression,{})},choice(t,e){t.alternatives.forEach(t=>{a(t,n(e))})},action:o,labeled(t,e){const n=t.label;n&&Object.prototype.hasOwnProperty.call(e,n)&&r.error(`Label "${t.label}" is already defined`,t.labelLocation,[{message:"Original label location",location:e[n]}]),a(t.expression,e),e[t.label]=t.labelLocation},text:o,simple_and:o,simple_not:o,optional:o,zero_or_more:o,one_or_more:o,group:o});a(t)},_$reportDuplicateRules_44=function(t,e,r){const n={};_$visitor_52.build({rule(t){Object.prototype.hasOwnProperty.call(n,t.name)?r.error(`Rule "${t.name}" is already defined`,t.nameLocation,[{message:"Original rule location",location:n[t.name]}]):n[t.name]=t.nameLocation}})(t)},_$reportInfiniteRecursion_46=function(t,e,r){const n=[],o=[],a=_$visitor_52.build({rule(t){n.push(t.name),a(t.expression),n.pop()},sequence(e){e.elements.every(e=>(a(e),!_$asts_36.alwaysConsumesOnSuccess(t,e)))},rule_ref(e){o.push(e);const i=_$asts_36.findRule(t,e.name);if(-1!==n.indexOf(e.name))return n.push(e.name),void r.error("Possible infinite loop when parsing (left recursion: "+n.join(" -> ")+")",i.nameLocation,o.map((t,e,r)=>({message:e+1!==r.length?`Step ${e+1}: call of the rule "${t.name}" without input consumption`:`Step ${e+1}: call itself without input consumption - left recursion`,location:t.location})));i&&a(i),o.pop()}});a(t)},_$reportInfiniteRepetition_47=function(t,e,r){_$visitor_52.build({zero_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)},one_or_more(e){_$asts_36.alwaysConsumesOnSuccess(t,e.expression)||r.error("Possible infinite loop when parsing (repetition used with an expression that may not consume any input)",e.location)}})(t)},_$reportUndefinedRules_48=function(t,e,r){_$visitor_52.build({rule_ref(e){_$asts_36.findRule(t,e.name)||r.error(`Rule "${e.name}" is not defined`,e.location)}})(t)},_$reportIncorrectPlucking_45=function(t,e,r){const n=_$visitor_52.build({action(t){n(t.expression,t)},labeled(t,e){t.pick&&e&&r.error('"@" cannot be used with an action block',t.labelLocation,[{message:"Action block location",location:e.codeLocation}]),n(t.expression)}});n(t)};class Defaults{constructor(t){"function"==typeof(t=void 0!==t?t:{}).error&&(this.error=t.error),"function"==typeof t.warning&&(this.warning=t.warning),"function"==typeof t.info&&(this.info=t.info)}error(){}warning(){}info(){}}var _$session_49=class{constructor(t){this._callbacks=new Defaults(t),this._firstError=null,this.errors=0,this.problems=[],this.stage=null}error(...t){++this.errors,null===this._firstError&&(this._firstError=new _$GrammarError_53(...t),this._firstError.stage=this.stage,this._firstError.problems=this.problems),this.problems.push(["error",...t]),this._callbacks.error(this.stage,...t)}warning(...t){this.problems.push(["warning",...t]),this._callbacks.warning(this.stage,...t)}info(...t){this.problems.push(["info",...t]),this._callbacks.info(this.stage,...t)}checkErrors(){if(0!==this.errors)throw this._firstError}};function processOptions(t,e){const r={};return Object.keys(t).forEach(e=>{r[e]=t[e]}),Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(r,t)||(r[t]=e[t])}),r}const compiler={visitor:_$visitor_52,passes:{check:[_$reportUndefinedRules_48,_$reportDuplicateRules_44,_$reportDuplicateLabels_43,_$reportInfiniteRecursion_46,_$reportInfiniteRepetition_47,_$reportIncorrectPlucking_45],transform:[_$removeProxyRules_42,_$inferenceMatchResult_41],generate:[_$generateBytecode_39,_$generateJs_40]},compile(ast,passes,options){if(options=void 0!==options?options:{},options=processOptions(options,{allowedStartRules:[ast.rules[0].name],cache:!1,dependencies:{},exportVar:null,format:"bare",output:"parser",trace:!1}),!Array.isArray(options.allowedStartRules))throw new Error("allowedStartRules must be an array");if(0===options.allowedStartRules.length)throw new Error("Must have at least one start rule");const allRules=ast.rules.map(t=>t.name);for(const t of options.allowedStartRules)if(-1===allRules.indexOf(t))throw new Error(`Unknown start rule "${t}"`);const session=new _$session_49(options);switch(Object.keys(passes).forEach(t=>{session.stage=t,session.info("Process stage "+t),passes[t].forEach(e=>{session.info(`Process pass ${t}.${e.name}`),e(ast,options,session)}),session.checkErrors()}),options.output){case"parser":return eval(ast.code.toString());case"source":return ast.code.toString();case"source-and-map":return ast.code;default:throw new Error("Invalid output format: "+options.output+".")}}};var _$compiler_37=compiler,_$parser_54={};const OPS_TO_PREFIXED_TYPES={$:"text","&":"simple_and","!":"simple_not"},OPS_TO_SUFFIXED_TYPES={"?":"optional","*":"zero_or_more","+":"one_or_more"},OPS_TO_SEMANTIC_PREDICATE_TYPES={"&":"semantic_and","!":"semantic_not"};function peg$SyntaxError(t,e,r,n){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,peg$SyntaxError.prototype),o.expected=e,o.found=r,o.location=n,o.name="SyntaxError",o}function peg$padEnd(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r0){for(e=1,r=1;eYt&&(Yt=Gt,Kt=[]),Kt.push(t))}function re(){var e,r,o,a,i,u;if(e=Gt,Re(),r=Gt,(o=function(){var e,r,o,a;return e=Gt,123===t.charCodeAt(Gt)?(r="{",Gt++):(r=n,0===zt&&ee(A)),r!==n&&(o=ke())!==n?(125===t.charCodeAt(Gt)?(a="}",Gt++):(a=n,0===zt&&ee(w)),a!==n&&Ie()!==n?(Ht=e,e=function(t){return{type:"top_level_initializer",code:t[0],codeLocation:t[1],location:Wt()}}(o)):(Gt=e,e=n)):(Gt=e,e=n),e}())!==n?(a=Re(),r=o):(Gt=r,r=n),r===n&&(r=null),o=Gt,(a=function(){var t,e;return t=Gt,(e=ke())!==n&&Ie()!==n?(Ht=t,t=function(t){return{type:"initializer",code:t[0],codeLocation:t[1],location:Wt()}}(e)):(Gt=t,t=n),t}())!==n?(i=Re(),o=a):(Gt=o,o=n),o===n&&(o=null),a=[],i=Gt,(u=ne())!==n?(Re(),i=u):(Gt=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Gt,(u=ne())!==n?(Re(),i=u):(Gt=i,i=n);else a=n;return a!==n?(Ht=e,e={type:"grammar",topLevelInitializer:r,initializer:o,rules:a,location:Wt()}):(Gt=e,e=n),e}function ne(){var e,r,o,a,i,u,s,c;return e=Gt,(r=me())!==n?(Re(),o=Gt,(a=Ee())!==n?(Re(),o=a):(Gt=o,o=n),o===n&&(o=null),61===t.charCodeAt(Gt)?(a="=",Gt++):(a=n,0===zt&&ee(C)),a!==n?(Re(),(i=oe())!==n&&Ie()!==n?(Ht=e,s=o,c=i,e={type:"rule",name:(u=r)[0],nameLocation:u[1],expression:null!==s?{type:"named",name:s,expression:c,location:Wt()}:c,location:Wt()}):(Gt=e,e=n)):(Gt=e,e=n)):(Gt=e,e=n),e}function oe(){var e,r,o,a,i,u,s,c;if(e=Gt,(r=ae())!==n){for(o=[],a=Gt,Re(),47===t.charCodeAt(Gt)?(i="/",Gt++):(i=n,0===zt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Gt=a,a=n)):(Gt=a,a=n);a!==n;)o.push(a),a=Gt,Re(),47===t.charCodeAt(Gt)?(i="/",Gt++):(i=n,0===zt&&ee(x)),i!==n?(Re(),(u=ae())!==n?a=u:(Gt=a,a=n)):(Gt=a,a=n);Ht=e,s=r,e=(c=o).length>0?{type:"choice",alternatives:[s].concat(c),location:Wt()}:s}else Gt=e,e=n;return e}function ae(){var t,e,r,o;return t=Gt,(e=function(){var t,e,r,o,a,i,u;if(t=Gt,(e=ie())!==n){for(r=[],o=Gt,Re(),(a=ie())!==n?o=a:(Gt=o,o=n);o!==n;)r.push(o),o=Gt,Re(),(a=ie())!==n?o=a:(Gt=o,o=n);Ht=t,i=e,t=(u=r).length>0||"labeled"===i.type&&i.pick?{type:"sequence",elements:[i].concat(u),location:Wt()}:i}else Gt=t,t=n;return t}())!==n?(r=Gt,Re(),(o=ke())!==n?r=o:(Gt=r,r=n),r===n&&(r=null),Ht=t,t=function(t,e){return null!==e?{type:"action",expression:t,code:e[0],codeLocation:e[1],location:Wt()}:t}(e,r)):(Gt=t,t=n),t}function ie(){var e,r,o,a,i,u,s;return e=Gt,(r=function(){var e,r;return e=Gt,64===t.charCodeAt(Gt)?(r="@",Gt++):(r=n,0===zt&&ee(S)),r!==n&&(Ht=e,r=Wt()),r}())!==n?((o=ue())===n&&(o=null),(a=se())!==n?(Ht=e,i=r,u=o,(s=a).type.startsWith("semantic_")&&Vt('"@" cannot be used on a semantic predicate',i),e={type:"labeled",label:null!==u?u[0]:null,labelLocation:null!==u?u[1]:i,pick:!0,expression:s,location:Wt()}):(Gt=e,e=n)):(Gt=e,e=n),e===n&&(e=Gt,(r=ue())!==n?(o=Re(),(a=se())!==n?(Ht=e,e=function(t,e){return{type:"labeled",label:t[0],labelLocation:t[1],expression:e,location:Wt()}}(r,a)):(Gt=e,e=n)):(Gt=e,e=n),e===n&&(e=se())),e}function ue(){var e,r,o,a;return e=Gt,(r=me())!==n?(Re(),58===t.charCodeAt(Gt)?(o=":",Gt++):(o=n,0===zt&&ee($)),o!==n?(Ht=e,a=r,Te.indexOf(a[0])>=0&&Vt(`Label can't be a reserved word "${a[0]}"`,a[1]),e=a):(Gt=e,e=n)):(Gt=e,e=n),e}function se(){var e,r,o,a;return e=Gt,(r=function(){var e;return 36===t.charCodeAt(Gt)?(e="$",Gt++):(e=n,0===zt&&ee(O)),e===n&&(38===t.charCodeAt(Gt)?(e="&",Gt++):(e=n,0===zt&&ee(L)),e===n&&(33===t.charCodeAt(Gt)?(e="!",Gt++):(e=n,0===zt&&ee(P)))),e}())!==n?(Re(),(o=ce())!==n?(Ht=e,a=o,e={type:OPS_TO_PREFIXED_TYPES[r],expression:a,location:Wt()}):(Gt=e,e=n)):(Gt=e,e=n),e===n&&(e=ce()),e}function ce(){var e,r,o,a;return e=Gt,(r=le())!==n?(Re(),(o=function(){var e;return 63===t.charCodeAt(Gt)?(e="?",Gt++):(e=n,0===zt&&ee(F)),e===n&&(42===t.charCodeAt(Gt)?(e="*",Gt++):(e=n,0===zt&&ee(k)),e===n&&(43===t.charCodeAt(Gt)?(e="+",Gt++):(e=n,0===zt&&ee(R)))),e}())!==n?(Ht=e,a=r,e={type:OPS_TO_SUFFIXED_TYPES[o],expression:a,location:Wt()}):(Gt=e,e=n)):(Gt=e,e=n),e===n&&(e=le()),e}function le(){var e,r,o,a,i;return(e=function(){var e,r,o;return zt++,e=Gt,(r=Ee())!==n?(105===t.charCodeAt(Gt)?(o="i",Gt++):(o=n,0===zt&&ee(ut)),o===n&&(o=null),Ht=e,e={type:"literal",value:r,ignoreCase:null!==o,location:Wt()}):(Gt=e,e=n),zt--,e===n&&(r=n,0===zt&&ee(it)),e}())===n&&(e=function(){var e,r,o,a,i,u,s,c;if(zt++,e=Gt,91===t.charCodeAt(Gt)?(r="[",Gt++):(r=n,0===zt&&ee(ft)),r!==n){for(94===t.charCodeAt(Gt)?(o="^",Gt++):(o=n,0===zt&&ee(_t)),o===n&&(o=null),a=[],(i=Ce())===n&&(i=xe());i!==n;)a.push(i),(i=Ce())===n&&(i=xe());93===t.charCodeAt(Gt)?(i="]",Gt++):(i=n,0===zt&&ee(ht)),i!==n?(105===t.charCodeAt(Gt)?(u="i",Gt++):(u=n,0===zt&&ee(ut)),u===n&&(u=null),Ht=e,s=o,c=u,e={type:"class",parts:a.filter(t=>""!==t),inverted:null!==s,ignoreCase:null!==c,location:Wt()}):(Gt=e,e=n)}else Gt=e,e=n;return zt--,e===n&&(r=n,0===zt&&ee(pt)),e}())===n&&(e=function(){var e,r;return e=Gt,46===t.charCodeAt(Gt)?(r=".",Gt++):(r=n,0===zt&&ee($t)),r!==n&&(Ht=e,r={type:"any",location:Wt()}),r}())===n&&(e=function(){var e,r,o,a,i,u,s;return e=Gt,(r=me())!==n?(o=Gt,zt++,a=Gt,i=Re(),u=Gt,(s=Ee())!==n?u=s=[s,Re()]:(Gt=u,u=n),u===n&&(u=null),61===t.charCodeAt(Gt)?(s="=",Gt++):(s=n,0===zt&&ee(C)),s!==n?a=i=[i,u,s]:(Gt=a,a=n),zt--,a===n?o=void 0:(Gt=o,o=n),o!==n?(Ht=e,e={type:"rule_ref",name:r[0],location:Wt()}):(Gt=e,e=n)):(Gt=e,e=n),e}())===n&&(e=function(){var e,r,o;return e=Gt,(r=function(){var e;return 38===t.charCodeAt(Gt)?(e="&",Gt++):(e=n,0===zt&&ee(L)),e===n&&(33===t.charCodeAt(Gt)?(e="!",Gt++):(e=n,0===zt&&ee(P))),e}())!==n?(Re(),(o=ke())!==n?(Ht=e,e=function(t,e){return{type:OPS_TO_SEMANTIC_PREDICATE_TYPES[t],code:e[0],codeLocation:e[1],location:Wt()}}(r,o)):(Gt=e,e=n)):(Gt=e,e=n),e}())===n&&(e=Gt,40===t.charCodeAt(Gt)?(r="(",Gt++):(r=n,0===zt&&ee(I)),r!==n?(Re(),(o=oe())!==n?(Re(),41===t.charCodeAt(Gt)?(a=")",Gt++):(a=n,0===zt&&ee(T)),a!==n?(Ht=e,e="labeled"===(i=o).type||"sequence"===i.type?{type:"group",expression:i,location:Wt()}:i):(Gt=e,e=n)):(Gt=e,e=n)):(Gt=e,e=n)),e}function pe(){var e;return t.length>Gt?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(j)),e}function fe(){var e;return zt++,9===t.charCodeAt(Gt)?(e="\t",Gt++):(e=n,0===zt&&ee(D)),e===n&&(11===t.charCodeAt(Gt)?(e="\v",Gt++):(e=n,0===zt&&ee(B)),e===n&&(12===t.charCodeAt(Gt)?(e="\f",Gt++):(e=n,0===zt&&ee(M)),e===n&&(32===t.charCodeAt(Gt)?(e=" ",Gt++):(e=n,0===zt&&ee(U)),e===n&&(160===t.charCodeAt(Gt)?(e="\xa0",Gt++):(e=n,0===zt&&ee(G)),e===n&&(65279===t.charCodeAt(Gt)?(e="\ufeff",Gt++):(e=n,0===zt&&ee(H)),e===n&&(e=function(){var e;return E.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Mt)),e}())))))),zt--,e===n&&0===zt&&ee(N),e}function _e(){var e;return u.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(q)),e}function he(){var e;return zt++,10===t.charCodeAt(Gt)?(e="\n",Gt++):(e=n,0===zt&&ee(K)),e===n&&("\r\n"===t.substr(Gt,2)?(e="\r\n",Gt+=2):(e=n,0===zt&&ee(z)),e===n&&(13===t.charCodeAt(Gt)?(e="\r",Gt++):(e=n,0===zt&&ee(W)),e===n&&(8232===t.charCodeAt(Gt)?(e="\u2028",Gt++):(e=n,0===zt&&ee(V)),e===n&&(8233===t.charCodeAt(Gt)?(e="\u2029",Gt++):(e=n,0===zt&&ee(X)))))),zt--,e===n&&0===zt&&ee(Y),e}function de(){var e;return zt++,(e=function(){var e,r,o,a,i,u;if(e=Gt,"/*"===t.substr(Gt,2)?(r="/*",Gt+=2):(r=n,0===zt&&ee(Q)),r!==n){for(o=[],a=Gt,i=Gt,zt++,"*/"===t.substr(Gt,2)?(u="*/",Gt+=2):(u=n,0===zt&&ee(Z)),zt--,u===n?i=void 0:(Gt=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Gt=a,a=n);a!==n;)o.push(a),a=Gt,i=Gt,zt++,"*/"===t.substr(Gt,2)?(u="*/",Gt+=2):(u=n,0===zt&&ee(Z)),zt--,u===n?i=void 0:(Gt=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Gt=a,a=n);"*/"===t.substr(Gt,2)?(a="*/",Gt+=2):(a=n,0===zt&&ee(Z)),a!==n?e=r=[r,o,a]:(Gt=e,e=n)}else Gt=e,e=n;return e}())===n&&(e=ve()),zt--,e===n&&0===zt&&ee(J),e}function ye(){var e,r,o,a,i,u;if(e=Gt,"/*"===t.substr(Gt,2)?(r="/*",Gt+=2):(r=n,0===zt&&ee(Q)),r!==n){for(o=[],a=Gt,i=Gt,zt++,"*/"===t.substr(Gt,2)?(u="*/",Gt+=2):(u=n,0===zt&&ee(Z)),u===n&&(u=_e()),zt--,u===n?i=void 0:(Gt=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Gt=a,a=n);a!==n;)o.push(a),a=Gt,i=Gt,zt++,"*/"===t.substr(Gt,2)?(u="*/",Gt+=2):(u=n,0===zt&&ee(Z)),u===n&&(u=_e()),zt--,u===n?i=void 0:(Gt=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Gt=a,a=n);"*/"===t.substr(Gt,2)?(a="*/",Gt+=2):(a=n,0===zt&&ee(Z)),a!==n?e=r=[r,o,a]:(Gt=e,e=n)}else Gt=e,e=n;return e}function ve(){var e,r,o,a,i,u;if(e=Gt,"//"===t.substr(Gt,2)?(r="//",Gt+=2):(r=n,0===zt&&ee(tt)),r!==n){for(o=[],a=Gt,i=Gt,zt++,u=_e(),zt--,u===n?i=void 0:(Gt=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Gt=a,a=n);a!==n;)o.push(a),a=Gt,i=Gt,zt++,u=_e(),zt--,u===n?i=void 0:(Gt=i,i=n),i!==n&&(u=pe())!==n?a=i=[i,u]:(Gt=a,a=n);e=r=[r,o]}else Gt=e,e=n;return e}function me(){var t,e,r,o;if(zt++,t=Gt,(e=ge())!==n){for(r=[],o=be();o!==n;)r.push(o),o=be();Ht=t,t=[e+r.join(""),Wt()]}else Gt=t,t=n;return zt--,t===n&&(e=n,0===zt&&ee(et)),t}function ge(){var e,r,o;return(e=function(){var e;return(e=function(){var e;return d.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(It)),e}())===n&&(e=function(){var e;return p.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Pt)),e}())===n&&(e=function(){var e;return h.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Rt)),e}())===n&&(e=function(){var e;return f.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Ft)),e}())===n&&(e=function(){var e;return _.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(kt)),e}())===n&&(e=function(){var e;return g.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Dt)),e}()),e}())===n&&(36===t.charCodeAt(Gt)?(e="$",Gt++):(e=n,0===zt&&ee(O)),e===n&&(95===t.charCodeAt(Gt)?(e="_",Gt++):(e=n,0===zt&&ee(rt)),e===n&&(e=Gt,92===t.charCodeAt(Gt)?(r="\\",Gt++):(r=n,0===zt&&ee(nt)),r!==n&&(o=Le())!==n?e=o:(Gt=e,e=n)))),e}function be(){var e;return(e=ge())===n&&(e=function(){var e;return(e=function(){var e;return v.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(jt)),e}())===n&&(e=function(){var e;return y.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Tt)),e}()),e}())===n&&(e=function(){var e;return m.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Nt)),e}())===n&&(e=function(){var e;return b.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(Bt)),e}())===n&&(8204===t.charCodeAt(Gt)?(e="\u200c",Gt++):(e=n,0===zt&&ee(ot)),e===n&&(8205===t.charCodeAt(Gt)?(e="\u200d",Gt++):(e=n,0===zt&&ee(at)))),e}function Ee(){var e,r,o,a;if(zt++,e=Gt,34===t.charCodeAt(Gt)?(r='"',Gt++):(r=n,0===zt&&ee(ct)),r!==n){for(o=[],a=Ae();a!==n;)o.push(a),a=Ae();34===t.charCodeAt(Gt)?(a='"',Gt++):(a=n,0===zt&&ee(ct)),a!==n?(Ht=e,e=o.join("")):(Gt=e,e=n)}else Gt=e,e=n;if(e===n)if(e=Gt,39===t.charCodeAt(Gt)?(r="'",Gt++):(r=n,0===zt&&ee(lt)),r!==n){for(o=[],a=we();a!==n;)o.push(a),a=we();39===t.charCodeAt(Gt)?(a="'",Gt++):(a=n,0===zt&&ee(lt)),a!==n?(Ht=e,e=function(t){return t.join("")}(o)):(Gt=e,e=n)}else Gt=e,e=n;return zt--,e===n&&(r=n,0===zt&&ee(st)),e}function Ae(){var e,r,o,a;return e=Gt,r=Gt,o=Gt,zt++,34===t.charCodeAt(Gt)?(a='"',Gt++):(a=n,0===zt&&ee(ct)),a===n&&(92===t.charCodeAt(Gt)?(a="\\",Gt++):(a=n,0===zt&&ee(nt)),a===n&&(a=_e())),zt--,a===n?o=void 0:(Gt=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Gt=r,r=n),(e=r!==n?t.substring(e,Gt):r)===n&&(e=Gt,92===t.charCodeAt(Gt)?(r="\\",Gt++):(r=n,0===zt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Gt=e,e=n),e===n&&(e=Se())),e}function we(){var e,r,o,a;return e=Gt,r=Gt,o=Gt,zt++,39===t.charCodeAt(Gt)?(a="'",Gt++):(a=n,0===zt&&ee(lt)),a===n&&(92===t.charCodeAt(Gt)?(a="\\",Gt++):(a=n,0===zt&&ee(nt)),a===n&&(a=_e())),zt--,a===n?o=void 0:(Gt=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Gt=r,r=n),(e=r!==n?t.substring(e,Gt):r)===n&&(e=Gt,92===t.charCodeAt(Gt)?(r="\\",Gt++):(r=n,0===zt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Gt=e,e=n),e===n&&(e=Se())),e}function Ce(){var e,r,o,a,i,u;return e=Gt,(r=xe())!==n?(45===t.charCodeAt(Gt)?(o="-",Gt++):(o=n,0===zt&&ee(dt)),o!==n&&(a=xe())!==n?(Ht=e,u=a,(i=r).charCodeAt(0)>u.charCodeAt(0)&&Vt("Invalid character range: "+t.substring(Ht,Gt)+"."),e=[i,u]):(Gt=e,e=n)):(Gt=e,e=n),e}function xe(){var e,r,o,a;return e=Gt,r=Gt,o=Gt,zt++,93===t.charCodeAt(Gt)?(a="]",Gt++):(a=n,0===zt&&ee(ht)),a===n&&(92===t.charCodeAt(Gt)?(a="\\",Gt++):(a=n,0===zt&&ee(nt)),a===n&&(a=_e())),zt--,a===n?o=void 0:(Gt=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Gt=r,r=n),(e=r!==n?t.substring(e,Gt):r)===n&&(e=Gt,92===t.charCodeAt(Gt)?(r="\\",Gt++):(r=n,0===zt&&ee(nt)),r!==n&&(o=$e())!==n?e=o:(Gt=e,e=n),e===n&&(e=Se())),e}function Se(){var e,r;return e=Gt,92===t.charCodeAt(Gt)?(r="\\",Gt++):(r=n,0===zt&&ee(nt)),r!==n&&he()!==n?(Ht=e,e=""):(Gt=e,e=n),e}function $e(){var e,r,o,a;return(e=function(){var e;return(e=Oe())===n&&(e=function(){var e,r,o,a;return e=Gt,r=Gt,o=Gt,zt++,(a=function(){var e;return(e=Oe())===n&&(e=Pe())===n&&(120===t.charCodeAt(Gt)?(e="x",Gt++):(e=n,0===zt&&ee(wt)),e===n&&(117===t.charCodeAt(Gt)?(e="u",Gt++):(e=n,0===zt&&ee(Ct)))),e}())===n&&(a=_e()),zt--,a===n?o=void 0:(Gt=o,o=n),o!==n&&(a=pe())!==n?r=o=[o,a]:(Gt=r,r=n),r!==n?t.substring(e,Gt):r}()),e}())===n&&(e=Gt,48===t.charCodeAt(Gt)?(r="0",Gt++):(r=n,0===zt&&ee(yt)),r!==n?(o=Gt,zt++,a=Pe(),zt--,a===n?o=void 0:(Gt=o,o=n),o!==n?(Ht=e,e="\0"):(Gt=e,e=n)):(Gt=e,e=n),e===n&&(e=function(){var e,r,o,a,i,u,s;return e=Gt,120===t.charCodeAt(Gt)?(r="x",Gt++):(r=n,0===zt&&ee(wt)),r!==n?(o=Gt,a=Gt,(i=Fe())!==n&&(u=Fe())!==n?a=i=[i,u]:(Gt=a,a=n),(o=a!==n?t.substring(o,Gt):a)!==n?(Ht=e,s=o,e=String.fromCharCode(parseInt(s,16))):(Gt=e,e=n)):(Gt=e,e=n),e}())===n&&(e=Le())),e}function Oe(){var e,r;return 39===t.charCodeAt(Gt)?(e="'",Gt++):(e=n,0===zt&&ee(lt)),e===n&&(34===t.charCodeAt(Gt)?(e='"',Gt++):(e=n,0===zt&&ee(ct)),e===n&&(92===t.charCodeAt(Gt)?(e="\\",Gt++):(e=n,0===zt&&ee(nt)),e===n&&(e=Gt,98===t.charCodeAt(Gt)?(r="b",Gt++):(r=n,0===zt&&ee(vt)),r!==n&&(Ht=e,r="\b"),(e=r)===n&&(e=Gt,102===t.charCodeAt(Gt)?(r="f",Gt++):(r=n,0===zt&&ee(mt)),r!==n&&(Ht=e,r="\f"),(e=r)===n&&(e=Gt,110===t.charCodeAt(Gt)?(r="n",Gt++):(r=n,0===zt&&ee(gt)),r!==n&&(Ht=e,r="\n"),(e=r)===n&&(e=Gt,114===t.charCodeAt(Gt)?(r="r",Gt++):(r=n,0===zt&&ee(bt)),r!==n&&(Ht=e,r="\r"),(e=r)===n&&(e=Gt,116===t.charCodeAt(Gt)?(r="t",Gt++):(r=n,0===zt&&ee(Et)),r!==n&&(Ht=e,r="\t"),(e=r)===n&&(e=Gt,118===t.charCodeAt(Gt)?(r="v",Gt++):(r=n,0===zt&&ee(At)),r!==n&&(Ht=e,r="\v"),e=r)))))))),e}function Le(){var e,r,o,a,i,u,s,c,l;return e=Gt,117===t.charCodeAt(Gt)?(r="u",Gt++):(r=n,0===zt&&ee(Ct)),r!==n?(o=Gt,a=Gt,(i=Fe())!==n&&(u=Fe())!==n&&(s=Fe())!==n&&(c=Fe())!==n?a=i=[i,u,s,c]:(Gt=a,a=n),(o=a!==n?t.substring(o,Gt):a)!==n?(Ht=e,l=o,e=String.fromCharCode(parseInt(l,16))):(Gt=e,e=n)):(Gt=e,e=n),e}function Pe(){var e;return s.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(xt)),e}function Fe(){var e;return c.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=n,0===zt&&ee(St)),e}function ke(){var e,r,o,a;return zt++,e=Gt,123===t.charCodeAt(Gt)?(r="{",Gt++):(r=n,0===zt&&ee(A)),r!==n?(o=function(){var e,r;return e=Gt,r=function e(){var r,o,a,i,u,s;if(r=Gt,o=[],a=[],i=Gt,u=Gt,zt++,l.test(t.charAt(Gt))?(s=t.charAt(Gt),Gt++):(s=n,0===zt&&ee(Lt)),zt--,s===n?u=void 0:(Gt=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Gt=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Gt,u=Gt,zt++,l.test(t.charAt(Gt))?(s=t.charAt(Gt),Gt++):(s=n,0===zt&&ee(Lt)),zt--,s===n?u=void 0:(Gt=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Gt=i,i=n);else a=n;for(a===n&&(a=Gt,123===t.charCodeAt(Gt)?(i="{",Gt++):(i=n,0===zt&&ee(A)),i!==n?(u=e(),125===t.charCodeAt(Gt)?(s="}",Gt++):(s=n,0===zt&&ee(w)),s!==n?a=i=[i,u,s]:(Gt=a,a=n)):(Gt=a,a=n));a!==n;){if(o.push(a),a=[],i=Gt,u=Gt,zt++,l.test(t.charAt(Gt))?(s=t.charAt(Gt),Gt++):(s=n,0===zt&&ee(Lt)),zt--,s===n?u=void 0:(Gt=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Gt=i,i=n),i!==n)for(;i!==n;)a.push(i),i=Gt,u=Gt,zt++,l.test(t.charAt(Gt))?(s=t.charAt(Gt),Gt++):(s=n,0===zt&&ee(Lt)),zt--,s===n?u=void 0:(Gt=u,u=n),u!==n&&(s=pe())!==n?i=u=[u,s]:(Gt=i,i=n);else a=n;a===n&&(a=Gt,123===t.charCodeAt(Gt)?(i="{",Gt++):(i=n,0===zt&&ee(A)),i!==n?(u=e(),125===t.charCodeAt(Gt)?(s="}",Gt++):(s=n,0===zt&&ee(w)),s!==n?a=i=[i,u,s]:(Gt=a,a=n)):(Gt=a,a=n))}return t.substring(r,Gt)}(),Ht=e,r=function(t){return[t,Wt()]}(r)}(),125===t.charCodeAt(Gt)?(a="}",Gt++):(a=n,0===zt&&ee(w)),a!==n?e=o:(Gt=e,e=n)):(Gt=e,e=n),zt--,e===n&&(r=n,0===zt&&ee(Ot)),e}function Re(){var t,e;for(t=[],(e=fe())===n&&(e=he())===n&&(e=de());e!==n;)t.push(e),(e=fe())===n&&(e=he())===n&&(e=de());return t}function Ie(){var e,r,o,a;return e=Gt,r=Re(),59===t.charCodeAt(Gt)?(o=";",Gt++):(o=n,0===zt&&ee(Ut)),o!==n?e=r=[r,o]:(Gt=e,e=n),e===n&&(e=Gt,r=function(){var t,e;for(t=[],(e=fe())===n&&(e=ye());e!==n;)t.push(e),(e=fe())===n&&(e=ye());return t}(),(o=ve())===n&&(o=null),(a=he())!==n?e=r=[r,o,a]:(Gt=e,e=n),e===n&&(e=Gt,r=Re(),(o=function(){var e,r;return e=Gt,zt++,t.length>Gt?(r=t.charAt(Gt),Gt++):(r=n,0===zt&&ee(j)),zt--,r===n?e=void 0:(Gt=e,e=n),e}())!==n?e=r=[r,o]:(Gt=e,e=n))),e}const Te=e.reservedWords||[];if((r=i())!==n&&Gt===t.length)return r;throw r!==n&&Gt{e[r]=t[r].slice()}),e}(peg.compiler.passes),reservedWords:peg.RESERVED_WORDS.slice()};return r.forEach(t=>{t.use(n,e)}),peg.compiler.compile(n.parser.parse(t,{grammarSource:e.grammarSource,reservedWords:n.reservedWords}),n.passes,e)}};var _$peg_55=peg,_$surge_73={};function ___typeof_73(t){return(___typeof_73="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(_$surge_73,"__esModule",{value:!0}),_$surge_73.default=function(){return __parser_73||(__parser_73=peggy.generate(grammars)),__parser_73};var _templateObject,peggy=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_73(t)&&"function"!=typeof t)return{default:t};var r=_getRequireWildcardCache(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(t){return t?r:e})(t)}var strings,raw,__parser_73,grammars=String.raw(_templateObject||(strings=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(raw=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleWebsocket() {\n if (obfs.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers", obfs[\'ws-headers\']);\n }\n }\n}\n\nstart = (shadowsocks/vmess/trojan/https/http/snell/socks5/socks5_tls) {\n return proxy;\n}\n\nshadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleWebsocket();\n}\ntrojan = tag equals "trojan" address (passwordk/ws/ws_path/ws_headers/tls/sni/tls_fingerprint/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleWebsocket();\n}\nhttps = tag equals "https" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http" address (username password)? (fast_open/others)* {\n proxy.type = "http";\n}\nsnell = tag equals "snell" address (snell_version/snell_psk/obfs/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "snell";\n // handle obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n $set(proxy, "obfs-opts.mode", obfs.type);\n $set(proxy, "obfs-opts.host", obfs.host);\n $set(proxy, "obfs-opts.path", obfs.path);\n }\n}\nsocks5 = tag equals "socks5" address (username password)? (fast_open/others)* {\n proxy.type = "socks5";\n}\nsocks5_tls = tag equals "socks5-tls" address (username password)? (sni/tls_fingerprint/tls_verification/fast_open/others)* {\n proxy.type = "socks5";\n proxy.tls = true;\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma match:[^,]+ { proxy.password = match.join(""); }\n\ntls = comma "tls" equals flag:bool { proxy.tls = flag; }\nsni = comma "sni" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\ntls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nsnell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }\nsnell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }\n\npasswordk = comma "password" equals match:[^,]+ { proxy.password = match.join(""); }\nvmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }\nvmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }\n\nmethod = comma "encrypt-method" equals cipher:cipher {\n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\n\nws = comma "ws" equals flag:bool { obfs.type = "ws"; }\nws_headers = comma "ws-headers" equals headers:$[^,]+ {\n const pairs = headers.split("|");\n const result = {};\n pairs.forEach(pair => {\n const [key, value] = pair.trim().split(":");\n result[key.trim()] = value.trim();\n })\n obfs["ws-headers"] = result;\n}\nws_path = comma "ws-path" equals path:uri { obfs.path = path; }\n\nobfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };\nobfs_uri = comma "obfs-uri" equals path:uri { obfs.path = path }\nuri = $[^,]+\n\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(raw=strings.slice(0)),_templateObject=Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}})))),_$loon_71={};function ___typeof_71(t){return(___typeof_71="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(_$loon_71,"__esModule",{value:!0}),_$loon_71.default=function(){return __parser_71||(__parser_71=__peggy_71.generate(__grammars_71)),__parser_71};var ___templateObject_71,__peggy_71=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_71(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_71(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_71(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_71=function(t){return t?r:e})(t)}var __strings_71,__raw_71,__parser_71,__grammars_71=String.raw(___templateObject_71||(__strings_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'],(__raw_71=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parser initializer\n{\n const proxy = {};\n const obfs = {};\n const transport = {};\n const $ = {};\n\n function handleTransport() {\n if (transport.type === "tcp") { /* do nothing */ }\n else if (transport.type === "ws") {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", transport.path);\n $set(proxy, "ws-opts.headers.Host", transport.host);\n } else if (transport.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", transport.path);\n $set(proxy, "http-opts.headers.Host", transport.host);\n }\n }\n}\n\nstart = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http) {\n return proxy;\n}\n\nshadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/others)*{\n proxy.type = "ssr";\n // handle ssr obfs\n proxy.obfs = obfs.type;\n}\nshadowsocks = tag equals "shadowsocks"i address method password (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/others)* {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts.mode", obfs.type);\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n}\nvmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/vmess_alterId/fast_open/udp_relay/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n proxy.alterId = proxy.alterId || 0;\n handleTransport();\n}\nvless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "vless";\n handleTransport();\n}\ntrojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "trojan";\n handleTransport();\n}\nhttps = tag equals "https"i address (username password)? (tls_host/tls_verification/fast_open/udp_relay/others)* {\n proxy.type = "http";\n proxy.tls = true;\n}\nhttp = tag equals "http"i address (username password)? (fast_open/udp_relay/others)* {\n proxy.type = "http";\n}\n\naddress = comma server:server comma port:port {\n proxy.server = server;\n proxy.port = port;\n}\n\nserver = ip/domain\n\nip = & {\n const start = peg$currPos;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n j++;\n }\n peg$currPos = j;\n $.ip = input.substring(start, j).trim();\n return true;\n} { return $.ip; }\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n throw new Error("Invalid domain: " + domain);\n}\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n throw new Error("Invalid port number: " + port);\n}\n\nmethod = comma cipher:cipher { \n proxy.cipher = cipher;\n}\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none"/"auto");\n\nusername = & {\n let j = peg$currPos; \n let start, end;\n let first = true;\n while (j < input.length) {\n if (input[j] === \',\') {\n if (first) {\n start = j + 1;\n first = false;\n } else {\n end = j;\n break;\n }\n }\n j++;\n }\n const match = input.substring(start, end);\n if (match.indexOf("=") === -1) {\n $.username = match;\n peg$currPos = end;\n return true;\n }\n} { proxy.username = $.username; }\npassword = comma \'"\' match:[^"]* \'"\' { proxy.password = match.join(""); }\nuuid = comma \'"\' match:[^"]+ \'"\' { proxy.uuid = match.join(""); }\n\nobfs_ss = comma "obfs-name" equals type:("http"/"tls") { obfs.type = type; }\n\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; }\nobfs_ssr_param = comma "obfs-param" equals match:$[^,]+ { proxy["obfs-param"] = match; }\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\nuri = $[^,]+\n\ntransport = comma "transport" equals type:("tcp"/"ws"/"http") { transport.type = type; }\ntransport_host = comma "host" equals host:domain { transport.host = host; }\ntransport_path = comma "path" equals path:uri { transport.path = path; }\n\nssr_protocol = comma "protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; }\nssr_protocol_param = comma "protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nvmess_alterId = comma "alterId" equals alterId:$[0-9]+ { proxy.alterId = parseInt(alterId); } \n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-name" equals host:domain { proxy.sni = host; }\ntls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }\n\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\nudp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }\n\ntag = match:[^=,]* { proxy.name = match.join("").trim(); }\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\nothers = comma [^=,]+ equals [^=,]+\n'])||(__raw_71=__strings_71.slice(0)),___templateObject_71=Object.freeze(Object.defineProperties(__strings_71,{raw:{value:Object.freeze(__raw_71)}})))),_$qx_72={};function ___typeof_72(t){return(___typeof_72="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(_$qx_72,"__esModule",{value:!0}),_$qx_72.default=function(){return __parser_72||(__parser_72=__peggy_72.generate(__grammars_72)),__parser_72};var ___templateObject_72,__peggy_72=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_72(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_72(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_72(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_72=function(t){return t?r:e})(t)}var __strings_72,__raw_72,__parser_72,__grammars_72=String.raw(___templateObject_72||(__strings_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \r\t]*\nbool = b:("true"/"false") { return b === "true" }\n'],(__raw_72=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n}}\n\n// per-parse initializer\n{\n\tconst proxy = {};\n const obfs = {};\n const $ = {};\n\n function handleObfs() {\n if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.network = "ws";\n if (obfs.type === \'wss\') {\n proxy.tls = true;\n }\n $set(proxy, "ws-opts.path", obfs.path);\n $set(proxy, "ws-opts.headers.Host", obfs.host);\n } else if (obfs.type === "over-tls") {\n proxy.tls = true;\n } else if (obfs.type === "http") {\n proxy.network = "http";\n $set(proxy, "http-opts.path", obfs.path);\n $set(proxy, "http-opts.headers.Host", obfs.host);\n }\n }\n}\n\nstart = (trojan/shadowsocks/vmess/http/socks5) {\n return proxy\n}\n\ntrojan = "trojan" equals address\n (password/over_tls/tls_host/tls_fingerprint/tls_verification/obfs/obfs_host/obfs_uri/tag/udp_relay/udp_over_tcp/fast_open/others)* {\n proxy.type = "trojan";\n handleObfs();\n}\n\nshadowsocks = "shadowsocks" equals address\n (password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/others)* {\n if (proxy.protocol) {\n proxy.type = "ssr";\n // handle ssr obfs\n if (obfs.host) proxy["obfs-param"] = obfs.host;\n if (obfs.type) proxy.obfs = obfs.type;\n } else {\n proxy.type = "ss";\n // handle ss obfs\n if (obfs.type == "http" || obfs.type === "tls") {\n proxy.plugin = "obfs";\n $set(proxy, "plugin-opts", {\n mode: obfs.type\n });\n } else if (obfs.type === "ws" || obfs.type === "wss") {\n proxy.plugin = "v2ray-plugin";\n $set(proxy, "plugin-opts.mode", "websocket");\n if (obfs.type === "wss") {\n $set(proxy, "plugin-opts.tls", true);\n }\n } else if (obfs.type === \'over-tls\') {\n throw new Error(\'ss over-tls is not supported\');\n }\n if (obfs.type) {\n $set(proxy, "plugin-opts.host", obfs.host);\n $set(proxy, "plugin-opts.path", obfs.path);\n }\n }\n}\n\nvmess = "vmess" equals address\n (uuid/method/over_tls/tls_host/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/others)* {\n proxy.type = "vmess";\n proxy.cipher = proxy.cipher || "none";\n if (proxy.aead) {\n proxy.alterId = 0;\n } else {\n proxy.alterId = proxy.alterId || 0;\n }\n handleObfs();\n}\n\nhttp = "http" equals address \n (username/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)*{\n proxy.type = "http";\n}\n\nsocks5 = "socks5" equals address\n (username/password/password/over_tls/tls_host/tls_fingerprint/tls_verification/tag/fast_open/udp_relay/udp_over_tcp/others)* {\n proxy.type = "socks5";\n}\n \naddress = server:server ":" port:port {\n proxy.server = server;\n proxy.port = port;\n}\nserver = ip/domain\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n \treturn port;\n }\n}\n\nusername = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }\npassword = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }\nuuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }\n\nmethod = comma "method" equals cipher:cipher { \n proxy.cipher = cipher;\n};\ncipher = ("aes-128-gcm"/"aes-192-gcm"/"aes-256-gcm"/"aes-128-cfb"/"aes-192-cfb"/"aes-256-cfb"/"aes-128-ctr"/"aes-192-ctr"/"aes-256-ctr"/"rc4-md5"/"xchacha20-ietf-poly1305"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"none");\naead = comma "aead" equals flag:bool { proxy.aead = flag; }\n\nudp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }\nudp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }\nfast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }\n\nover_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }\ntls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }\ntls_verification = comma "tls-verification" equals flag:bool { \n proxy["skip-cert-verify"] = !flag;\n}\ntls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }\n\nobfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }\nobfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }\nobfs = comma "obfs" equals type:("wss"/"ws"/"over-tls"/"http") { obfs.type = type; return type; };\n\nobfs_host = comma "obfs-host" equals host:domain { obfs.host = host; }\nobfs_uri = comma "obfs-uri" equals uri:uri { obfs.path = uri; }\n\nssr_protocol = comma "ssr-protocol" equals protocol:("origin"/"auth_sha1_v4"/"auth_aes128_md5"/"auth_aes128_sha1"/"auth_chain_a"/"auth_chain_b") { proxy.protocol = protocol; return protocol; }\nssr_protocol_param = comma "ssr-protocol-param" equals param:$[^=,]+ { proxy["protocol-param"] = param; }\n\nuri = $[^,]+\n\ntag = comma "tag" equals tag:[^=,]+ { proxy.name = tag.join(""); }\nothers = comma [^=,]+ equals [^=,]+\ncomma = _ "," _\nequals = _ "=" _\n_ = [ \\r\\t]*\nbool = b:("true"/"false") { return b === "true" }\n'])||(__raw_72=__strings_72.slice(0)),___templateObject_72=Object.freeze(Object.defineProperties(__strings_72,{raw:{value:Object.freeze(__raw_72)}})))),_$trojanUri_74={};function ___typeof_74(t){return(___typeof_74="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(_$trojanUri_74,"__esModule",{value:!0}),_$trojanUri_74.default=function(){return __parser_74||(__parser_74=__peggy_74.generate(__grammars_74)),__parser_74};var ___templateObject_74,__peggy_74=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==___typeof_74(t)&&"function"!=typeof t)return{default:t};var r=___getRequireWildcardCache_74(void 0);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n}(_$peg_55);function ___getRequireWildcardCache_74(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(___getRequireWildcardCache_74=function(t){return t?r:e})(t)}var __strings_74,__raw_74,__parser_74,__grammars_74=String.raw(___templateObject_74||(__strings_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'],(__raw_74=['\n// global initializer\n{{\n function $set(obj, path, value) {\n if (Object(obj) !== obj) return obj;\n if (!Array.isArray(path)) path = path.toString().match(/[^.[\\]]+/g) || [];\n path\n .slice(0, -1)\n .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[\n path[path.length - 1]\n ] = value;\n return obj;\n }\n\n function toBool(str) {\n if (typeof str === \'undefined\' || str === null) return undefined;\n return /(TRUE)|1/i.test(str);\n }\n}}\n\n{\n const proxy = {};\n const obfs = {};\n const $ = {};\n const params = {};\n}\n\nstart = (trojan) {\n return proxy\n}\n\ntrojan = "trojan://" password:password "@" server:server ":" port:port params? name:name?{\n proxy.type = "trojan";\n proxy.password = password;\n proxy.server = server;\n proxy.port = port;\n proxy.name = name;\n\n // name may be empty\n if (!proxy.name) {\n proxy.name = server + ":" + port;\n }\n};\n\npassword = match:$[^@]+ {\n return decodeURIComponent(match);\n};\n\nserver = ip/domain;\n\ndomain = match:[0-9a-zA-z-_.]+ { \n const domain = match.join(""); \n if (/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(domain)) {\n return domain;\n }\n}\n\nip = & {\n const start = peg$currPos;\n let end;\n let j = start;\n while (j < input.length) {\n if (input[j] === ",") break;\n if (input[j] === ":") end = j;\n j++;\n }\n peg$currPos = end || j;\n $.ip = input.substring(start, end).trim();\n return true;\n} { return $.ip; }\n\nport = digits:[0-9]+ { \n const port = parseInt(digits.join(""), 10); \n if (port >= 0 && port <= 65535) {\n return port;\n } else {\n throw new Error("Invalid port: " + port);\n }\n}\n\nparams = "?" head:param tail:("&"@param)* {\n proxy["skip-cert-verify"] = toBool(params["allowInsecure"]);\n proxy.sni = params["sni"] || params["peer"];\n\n if (toBool(params["ws"])) {\n proxy.network = "ws";\n $set(proxy, "ws-opts.path", params["wspath"]);\n }\n\n proxy.udp = toBool(params["udp"]);\n proxy.tfo = toBool(params["tfo"]);\n}\n\nparam = kv/single;\n\nkv = key:$[a-z]i+ "=" value:$[^&#]i+ {\n params[key] = value;\n}\n\nsingle = key:$[a-z]i+ {\n params[key] = true;\n};\n\nname = "#" + match:$.* {\n return decodeURIComponent(match);\n}\n'])||(__raw_74=__strings_74.slice(0)),___templateObject_74=Object.freeze(Object.defineProperties(__strings_74,{raw:{value:Object.freeze(__raw_74)}})))),_$parsers_70={};Object.defineProperty(_$parsers_70,"__esModule",{value:!0}),_$parsers_70.default=void 0;var ___surge_70=___interopRequireDefault_70(_$surge_73),___loon_70=___interopRequireDefault_70(_$loon_71),_qx=___interopRequireDefault_70(_$qx_72),_trojanUri=___interopRequireDefault_70(_$trojanUri_74);function ___interopRequireDefault_70(t){return t&&t.__esModule?t:{default:t}}function __ownKeys_70(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_70(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___unsupportedIterableToArray_70(t,e){if(t){if("string"==typeof t)return ___arrayLikeToArray_70(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_70(t,e):void 0}}function ___arrayLikeToArray_70(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){var s,c=___createForOfIteratorHelper_70(t);try{for(c.s();!(s=c.n()).done;){var l=___slicedToArray_70(s.value.split("="),2),p=l[0],f=l[1];(f=f.trim()).length>0&&(u[p]=f)}}catch(_){c.e(_)}finally{c.f()}}return ___objectSpread_70(___objectSpread_70({},i),{},{name:u.remarks?_$base64_4.Base64.decode(u.remarks):i.server,"protocol-param":(0,_$utils_108.getIfNotBlank)(_$base64_4.Base64.decode(u.protoparam||"").replace(/\s/g,"")),"obfs-param":(0,_$utils_108.getIfNotBlank)(_$base64_4.Base64.decode(u.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={},a=___createForOfIteratorHelper_70(n);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(-1!==i.indexOf("=")){var u=___slicedToArray_70(i.split("="),2),s=u[0],c=u[1];o[s.trim()]=c.trim()}}}catch(h){a.e(h)}finally{a.f()}var l={name:n[0].split("=")[0].trim(),type:"vmess",server:n[1],port:n[2],cipher:(0,_$utils_108.getIfNotBlank)(n[3],"auto"),uuid:n[4].match(/^"(.*)"$/)[1],tls:"wss"===o.obfs,udp:(0,_$utils_108.getIfPresent)(o["udp-relay"]),tfo:(0,_$utils_108.getIfPresent)(o["fast-open"]),"skip-cert-verify":(0,_$utils_108.isPresent)(o["tls-verification"])?!o["tls-verification"]:void 0};if((0,_$utils_108.isPresent)(o.obfs)){if("ws"!==o.obfs&&"wss"!==o.obfs)throw new Error("Unsupported obfs: ".concat(o.obfs));l.network="ws",l["ws-opts"].path=((0,_$utils_108.getIfNotBlank)(o["obfs-path"])||'"/"').match(/^"(.*)"$/)[1];var p=o["obfs-header"];p&&-1!==p.indexOf("Host")&&(p=p.match(/Host:\s*([a-zA-Z0-9-.]*)/)[1]),(0,_$utils_108.isNotBlank)(p)&&(l["ws-opts"].headers={Host:p})}return l}var f=JSON.parse(e),_={name:f.ps,type:"vmess",server:f.add,port:f.port,cipher:"auto",uuid:f.id,alterId:(0,_$utils_108.getIfPresent)(f.aid,0),tls:"tls"===f.tls||!0===f.tls,"skip-cert-verify":(0,_$utils_108.isPresent)(f.verify_cert)?!f.verify_cert:void 0};return"ws"===f.net&&(_.network="ws",_["ws-opts"]={path:(0,_$utils_108.getIfNotBlank)(f.path),headers:{Host:(0,_$utils_108.getIfNotBlank)(f.host)}},_.tls&&f.host&&(_.sni=f.host)),_}},{name:"URI Trojan Parser",test:function(t){return/^trojan:\/\//.test(t)},parse:function(t){return(0,_trojanUri.default)().parse(t)}},{name:"Clash Parser",test:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},parse:function(t){var e=JSON.parse(t);if(!["ss","ssr","vmess","socks","http","snell","trojan"].includes(e.type))throw new Error("Clash does not support proxy with type: ".concat(e.type));return"vmess"===e.type&&(e.sni=e.servername,delete e.servername),e}},{name:"Surge SS Parser",test:function(t){return/^.*=\s*ss/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge VMess Parser",test:function(t){return/^.*=\s*vmess/.test(t.split(",")[0])&&-1!==t.indexOf("username")},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Trojan Parser",test:function(t){return/^.*=\s*trojan/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge HTTP Parser",test:function(t){return/^.*=\s*https?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Snell Parser",test:function(t){return/^.*=\s*snell?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Surge Socks5 Parser",test:function(t){return/^.*=\s*socks5(-tls)?/.test(t.split(",")[0])},parse:function(t){return(0,___surge_70.default)().parse(t)}},{name:"Loon SS Parser",test:function(t){return"shadowsocks"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon SSR Parser",test:function(t){return"shadowsocksr"===t.split(",")[0].split("=")[1].trim().toLowerCase()},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon VMess Parser",test:function(t){return/^.*=\s*vmess/i.test(t.split(",")[0])&&-1===t.indexOf("username")},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Vless Parser",test:function(t){return/^.*=\s*vless/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon Trojan Parser",test:function(t){return/^.*=\s*trojan/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"Loon HTTP Parser",test:function(t){return/^.*=\s*http/i.test(t.split(",")[0])},parse:function(t){return(0,___loon_70.default)().parse(t)}},{name:"QX SS Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1===t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX SSR Parser",test:function(t){return/^shadowsocks\s*=/.test(t.split(",")[0].trim())&&-1!==t.indexOf("ssr-protocol")},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX VMess Parser",test:function(t){return/^vmess\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Trojan Parser",test:function(t){return/^trojan\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX HTTP Parser",test:function(t){return/^http\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}},{name:"QX Socks5 Parser",test:function(t){return/^socks5\s*=/.test(t.split(",")[0].trim())},parse:function(t){return(0,_qx.default)().parse(t)}}];_$parsers_70.default=___default_70;var _$preprocessors_87={};Object.defineProperty(_$preprocessors_87,"__esModule",{value:!0}),_$preprocessors_87.default=void 0;var ___default_87=[{name:"HTML",test:function(t){return/^/.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,"")}}];_$preprocessors_87.default=___default_87;var _$producers_88={};Object.defineProperty(_$producers_88,"__esModule",{value:!0}),_$producers_88.default=void 0;var __obj_88,___staticJsYaml_88=(__obj_88=_$staticJsYaml_65)&&__obj_88.__esModule?__obj_88:{default:__obj_88},___default_88={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_88.default.dump(r)}}};_$producers_88.default=___default_88;var _$parsers_86={};function ___createForOfIteratorHelper_86(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_86(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_86(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_86(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_85(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0})).join("\n"):"ALL"===r.type?r.func(t):void 0}};_$ruleUtils_85.RuleUtils=RuleUtils;var _$sync_102={};function ___typeof_102(t){return(___typeof_102="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(_$sync_102,"__esModule",{value:!0}),_$sync_102.default=function(t){___app_102.default.read(_$constants_67.ARTIFACTS_KEY)||___app_102.default.write({},_$constants_67.ARTIFACTS_KEY),t.get("/api/sync/artifacts",syncAllArtifacts),t.get("/api/sync/artifact/:name",syncArtifact)},_$sync_102.produceArtifact=produceArtifact;var ___app_102=___interopRequireDefault_102(_$app_68),___download_102=___interopRequireDefault_102(_$download_104),_proxyUtils=_$proxyUtils_69({});function ___interopRequireDefault_102(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_102(){___regeneratorRuntime_102=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_102(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 E(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ___createForOfIteratorHelper_102(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_102(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_102(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 a,i=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function ___arrayLikeToArray_102(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>").concat(JSON.stringify(a,null,2))),t.prev=11,t.next=14,(0,_$artifacts_90.syncToGist)((c={},l=encodeURIComponent(a.name),p={content:i},l in c?Object.defineProperty(c,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[l]=p,c));case 14:u=t.sent,a.updated=(new Date).getTime(),s=JSON.parse(u.body),a.url=s.files[encodeURIComponent(a.name)].raw_url.replace(/\/raw\/[^/]*\/(.*)/,"/raw/$1"),___app_102.default.write(o,_$constants_67.ARTIFACTS_KEY),(0,_$response_98.success)(r,a),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),(0,_$response_98.failed)(r,new _$errors_93.InternalServerError("FAILED_TO_SYNC_ARTIFACT","Failed to sync artifact ".concat(n),"Reason: ".concat(t.t0)));case 25:case"end":return t.stop()}var c,l,p}),t,null,[[11,22]])})))).apply(this,arguments)}var _$platform_111={};Object.defineProperty(_$platform_111,"__esModule",{value:!0}),_$platform_111.getPlatformFromHeaders=function(t){for(var e="",r=0,n=Object.keys(t);r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_92(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_92(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_92(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_92(a,n,o,i,u,"throw",t)}i(void 0)}))}}function downloadSubscription(t,e){return _downloadSubscription.apply(this,arguments)}function _downloadSubscription(){return(_downloadSubscription=___asyncToGenerator_92(___regeneratorRuntime_92().mark((function t(e,r){var n,o,a,i,u,s;return ___regeneratorRuntime_92().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.params.name,n=decodeURIComponent(n),o=e.query.target||(0,_$platform_111.getPlatformFromHeaders)(e.headers)||"JSON",___app_92.default.info("\u6b63\u5728\u4e0b\u8f7d\u8ba2\u9605\uff1a".concat(n)),a=___app_92.default.read(_$constants_67.SUBS_KEY),!(i=(0,_$database_103.findByName)(a,n))){t.next=26;break}return t.prev=7,t.next=10,(0,_$sync_102.produceArtifact)({type:"subscription",name:n,platform:o});case 10:if(u=t.sent,"local"===i.source){t.next=16;break}return t.next=14,(0,_$flow_105.getFlowHeaders)(i.url);case 14:(s=t.sent)&&r.set("subscription-userinfo",s);case 16:"JSON"===o?r.set("Content-Type","application/json;charset=utf-8").send(u):r.send(u),t.next=24;break;case 19:t.prev=19,t.t0=t.catch(7),___app_92.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u8ba2\u9605\u5931\u8d25","\u274c \u65e0\u6cd5\u4e0b\u8f7d\u8ba2\u9605\uff1a".concat(n,"\uff01"),"\ud83e\udd14 \u539f\u56e0\uff1a".concat(JSON.stringify(t.t0))),___app_92.default.error(JSON.stringify(t.t0)),(0,_$response_98.failed)(r,new _$errors_93.InternalServerError("INTERNAL_SERVER_ERROR","Failed to download subscription: ".concat(n),"Reason: ".concat(JSON.stringify(t.t0))));case 24:t.next=28;break;case 26:___app_92.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u8ba2\u9605\uff1a".concat(n,"\uff01")),(0,_$response_98.failed)(r,new _$errors_93.ResourceNotFoundError("RESOURCE_NOT_FOUND","Subscription ".concat(n," does not exist!")),404);case 28:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}function downloadCollection(t,e){return _downloadCollection.apply(this,arguments)}function _downloadCollection(){return(_downloadCollection=___asyncToGenerator_92(___regeneratorRuntime_92().mark((function t(e,r){var n,o,a,i,u,s,c,l,p;return ___regeneratorRuntime_92().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.params.name,n=decodeURIComponent(n),o=e.query.target||(0,_$platform_111.getPlatformFromHeaders)(e.headers)||"JSON",a=___app_92.default.read(_$constants_67.COLLECTIONS_KEY),i=(0,_$database_103.findByName)(a,n),___app_92.default.info("\u6b63\u5728\u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n)),!i){t.next=29;break}return t.prev=7,t.next=10,(0,_$sync_102.produceArtifact)({type:"collection",name:n,platform:o});case 10:if(u=t.sent,s=___app_92.default.read(_$constants_67.SUBS_KEY),!((c=i.subscriptions).length>0)){t.next=20;break}if("local"===(l=(0,_$database_103.findByName)(s,c[0])).source){t.next=20;break}return t.next=18,(0,_$flow_105.getFlowHeaders)(l.url);case 18:(p=t.sent)&&r.set("subscription-userinfo",p);case 20:"JSON"===o?r.set("Content-Type","application/json;charset=utf-8").send(u):r.send(u),t.next=27;break;case 23:t.prev=23,t.t0=t.catch(7),___app_92.default.notify("\ud83c\udf0d Sub-Store \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)),(0,_$response_98.failed)(r,new _$errors_93.InternalServerError("INTERNAL_SERVER_ERROR","Failed to download collection: ".concat(n),"Reason: ".concat(JSON.stringify(t.t0))));case 27:t.next=31;break;case 29:___app_92.default.notify("\ud83c\udf0d Sub-Store \u4e0b\u8f7d\u7ec4\u5408\u8ba2\u9605\u5931\u8d25","\u274c \u672a\u627e\u5230\u7ec4\u5408\u8ba2\u9605\uff1a".concat(n,"\uff01")),(0,_$response_98.failed)(r,new _$errors_93.ResourceNotFoundError("RESOURCE_NOT_FOUND","Collection ".concat(n," does not exist!")),404);case 31:case"end":return t.stop()}}),t,null,[[7,23]])})))).apply(this,arguments)}var _$settings_99={};Object.defineProperty(_$settings_99,"__esModule",{value:!0}),_$settings_99.default=function(t){___app_99.default.read(_$constants_67.SETTINGS_KEY)||___app_99.default.write({},_$constants_67.SETTINGS_KEY),t.route("/api/settings").get(getSettings).patch(updateSettings)},_$settings_99.updateArtifactStore=updateArtifactStore,_$settings_99.updateGitHubAvatar=updateGitHubAvatar;var ___app_99=___interopRequireDefault_99(_$app_68),___gist_99=___interopRequireDefault_99(_$gist_107);function ___interopRequireDefault_99(t){return t&&t.__esModule?t:{default:t}}function ___typeof_99(t){return(___typeof_99="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_99(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_99(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_99(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_99(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_99(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_99(a,n,o,i,u,"throw",t)}i(void 0)}))}}function getSettings(t,e){return _getSettings.apply(this,arguments)}function _getSettings(){return(_getSettings=___asyncToGenerator_99(___regeneratorRuntime_99().mark((function t(e,r){var n;return ___regeneratorRuntime_99().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=___app_99.default.read(_$constants_67.SETTINGS_KEY)).avatarUrl){t.next=4;break}return t.next=4,updateGitHubAvatar();case 4:if(n.artifactStore){t.next=7;break}return t.next=7,updateArtifactStore();case 7:(0,_$response_98.success)(r,n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function updateSettings(t,e){return _updateSettings.apply(this,arguments)}function _updateSettings(){return(_updateSettings=___asyncToGenerator_99(___regeneratorRuntime_99().mark((function t(e,r){var n,o;return ___regeneratorRuntime_99().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=___app_99.default.read(_$constants_67.SETTINGS_KEY),o=___objectSpread_99(___objectSpread_99({},n),e.body),___app_99.default.write(o,_$constants_67.SETTINGS_KEY),t.next=5,updateGitHubAvatar();case 5:return t.next=7,updateArtifactStore();case 7:(0,_$response_98.success)(r,o);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function updateGitHubAvatar(){return _updateGitHubAvatar.apply(this,arguments)}function _updateGitHubAvatar(){return(_updateGitHubAvatar=___asyncToGenerator_99(___regeneratorRuntime_99().mark((function t(){var e,r,n;return ___regeneratorRuntime_99().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=___app_99.default.read(_$constants_67.SETTINGS_KEY),!(r=e.githubUser)){t.next=14;break}return t.prev=3,t.next=6,___app_99.default.http.get({url:"https://api.github.com/users/".concat(r),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36"}}).then((function(t){return JSON.parse(t.body)}));case 6:n=t.sent,e.avatarUrl=n.avatar_url,___app_99.default.write(e,_$constants_67.SETTINGS_KEY),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),___app_99.default.error("Failed to fetch GitHub avatar for User: "+r);case 14:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}function updateArtifactStore(){return _updateArtifactStore.apply(this,arguments)}function _updateArtifactStore(){return(_updateArtifactStore=___asyncToGenerator_99(___regeneratorRuntime_99().mark((function t(){var e,r,n,o,a;return ___regeneratorRuntime_99().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(___app_99.default.log("Updating artifact store"),e=___app_99.default.read(_$constants_67.SETTINGS_KEY),r=e.githubUser,n=e.gistToken,!r||!n){t.next=15;break}return o=new ___gist_99.default({token:n,key:_$constants_67.ARTIFACT_REPOSITORY_KEY}),t.prev=5,t.next=8,o.locate();case 8:-1!==(a=t.sent)&&(e.artifactStore="https://gist.github.com/".concat(r,"/").concat(a),___app_99.default.write(e,_$constants_67.SETTINGS_KEY)),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),___app_99.default.error("Failed to fetch artifact store for User: "+r);case 15:case"end":return t.stop()}}),t,null,[[5,12]])})))).apply(this,arguments)}var _$preview_97={};Object.defineProperty(_$preview_97,"__esModule",{value:!0}),_$preview_97.default=function(t){t.post("/api/preview/sub",compareSub),t.post("/api/preview/collection",compareCollection)};var ___proxyUtils_97=_$proxyUtils_69({}),___download_97=___interopRequireDefault_97(_$download_104),___app_97=___interopRequireDefault_97(_$app_68);function ___interopRequireDefault_97(t){return t&&t.__esModule?t:{default:t}}function ___typeof_97(t){return(___typeof_97="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_97(){___regeneratorRuntime_97=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_97(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 E(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_97(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_97(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_97(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_97(a,n,o,i,u,"throw",t)}i(void 0)}))}}function compareSub(t,e){return _compareSub.apply(this,arguments)}function _compareSub(){return(_compareSub=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(e,r){var n,o,a,i,u;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.body,o=e.query.target||"JSON","local"!==n.source){t.next=6;break}a=n.content,t.next=16;break;case 6:return t.prev=6,t.next=9,(0,___download_97.default)(n.url,n.ua);case 9:a=t.sent,t.next=16;break;case 12:return t.prev=12,t.t0=t.catch(6),(0,_$response_98.failed)(r,new _$errors_93.NetworkError("FAILED_TO_DOWNLOAD_RESOURCE","\u65e0\u6cd5\u4e0b\u8f7d\u8fdc\u7a0b\u8d44\u6e90","Reason: ".concat(t.t0))),t.abrupt("return");case 16:return(i=___proxyUtils_97.ProxyUtils.parse(a)).forEach((function(t,e){t.id=e})),t.next=20,___proxyUtils_97.ProxyUtils.process(i,n.process||[],o);case 20:u=t.sent,(0,_$response_98.success)(r,{original:i,processed:u});case 22:case"end":return t.stop()}}),t,null,[[6,12]])})))).apply(this,arguments)}function compareCollection(t,e){return _compareCollection.apply(this,arguments)}function _compareCollection(){return(_compareCollection=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(e,r){var n,o,a,i,u,s;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=___app_97.default.read(_$constants_67.SUBS_KEY),o=e.body,a=o.subscriptions,i={},t.next=6,Promise.all(a.map(function(){var t=___asyncToGenerator_97(___regeneratorRuntime_97().mark((function t(e){var o,a,u;return ___regeneratorRuntime_97().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=(0,_$database_103.findByName)(n,e),t.prev=1,"local"!==o.source){t.next=6;break}a=o.content,t.next=9;break;case 6:return t.next=8,(0,___download_97.default)(o.url,o.ua);case 8:a=t.sent;case 9:return u=___proxyUtils_97.ProxyUtils.parse(a),t.next=12,___proxyUtils_97.ProxyUtils.process(u,o.process||[],"JSON");case 12:u=t.sent,i[e]=u,t.next=19;break;case 16:t.prev=16,t.t0=t.catch(1),(0,_$response_98.failed)(r,new _$errors_93.InternalServerError("PROCESS_FAILED","\u5904\u7406\u5b50\u8ba2\u9605 ".concat(e," \u5931\u8d25"),"Reason: ".concat(t.t0)));case 19:case"end":return t.stop()}}),t,null,[[1,16]])})));return function(e){return t.apply(this,arguments)}}()));case 6:return(u=Array.prototype.concat.apply([],a.map((function(t){return i[t]||[]})))).forEach((function(t,e){t.id=e})),t.next=10,___proxyUtils_97.ProxyUtils.process(u,o.process||[],"JSON");case 10:s=t.sent,(0,_$response_98.success)(r,{original:u,processed:s});case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var _$sort_100={};Object.defineProperty(_$sort_100,"__esModule",{value:!0}),_$sort_100.default=function(t){t.post("/api/sort/subs",sortSubs),t.post("/api/sort/collections",sortCollections),t.post("/api/sort/artifacts",sortArtifacts)};var __obj_100,___app_100=(__obj_100=_$app_68)&&__obj_100.__esModule?__obj_100:{default:__obj_100};function sortSubs(t,e){var r=t.body,n=___app_100.default.read(_$constants_67.SUBS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_100.default.write(n,_$constants_67.SUBS_KEY),(0,_$response_98.success)(e,n)}function sortCollections(t,e){var r=t.body,n=___app_100.default.read(_$constants_67.COLLECTIONS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_100.default.write(n,_$constants_67.COLLECTIONS_KEY),(0,_$response_98.success)(e,n)}function sortArtifacts(t,e){var r=t.body,n=___app_100.default.read(_$constants_67.ARTIFACTS_KEY);n.sort((function(t,e){return r.indexOf(t)-r.indexOf(e)})),___app_100.default.write(n,_$constants_67.ARTIFACTS_KEY),(0,_$response_98.success)(e,n)}var _$miscs_95={};function ___typeof_95(t){return(___typeof_95="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(_$miscs_95,"__esModule",{value:!0}),_$miscs_95.default=function(t){var e,r;t.get("/api/utils/env",getEnv),t.get("/api/utils/backup",gistBackup),t.get("/api/utils/refresh",refresh),t.route("/api/storage").get((function(t,e){e.json(___app_95.default.read("#sub-store"))})).post((function(t,e){var r=t.body;___app_95.default.write(JSON.stringify(r),"#sub-store"),e.end()})),t.get("/",(r=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e,r){return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.set("location","https://sub-store.vercel.app/").status(302).end();case 1:case"end":return t.stop()}}),t)}))),function(t,e){return r.apply(this,arguments)})),(0,_$openApi_115.ENV)().isQX&&t.options("/",(e=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e,r){return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.status(200).end();case 1:case"end":return t.stop()}}),t)}))),function(t,r){return e.apply(this,arguments)})),t.all("/",(function(t,e){e.send("Hello from sub-store, made with \u2764\ufe0f by Peng-YM")}))};var ___app_95=___interopRequireDefault_95(_$app_68),___resourceCache_95=___interopRequireDefault_95(_$resourceCache_112),___gist_95=___interopRequireDefault_95(_$gist_107),_migration=___interopRequireDefault_95(_$migration_110);function ___interopRequireDefault_95(t){return t&&t.__esModule?t:{default:t}}function ___regeneratorRuntime_95(){___regeneratorRuntime_95=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_95(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 E(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_95(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function ___asyncToGenerator_95(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_95(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_95(a,n,o,i,u,"throw",t)}i(void 0)}))}}function getEnv(t,e){var r=(0,_$openApi_115.ENV)(),n="Node";r.isNode&&(n="Node"),r.isQX&&(n="QX"),r.isLoon&&(n="Loon"),r.isSurge&&(n="Surge"),r.isStash&&(n="Stash"),r.isShadowRocket&&(n="ShadowRocket"),(0,_$response_98.success)(e,{backend:n,version:_$package_66.version})}function refresh(t,e){return _refresh.apply(this,arguments)}function _refresh(){return(_refresh=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e,r){return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_$settings_99.updateGitHubAvatar)();case 2:return t.next=4,(0,_$settings_99.updateArtifactStore)();case 4:___resourceCache_95.default.revokeAll(),(0,_$response_98.success)(r);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gistBackup(t,e){return _gistBackup.apply(this,arguments)}function _gistBackup(){return(_gistBackup=___asyncToGenerator_95(___regeneratorRuntime_95().mark((function t(e,r){var n,o,a,i,u,s,c;return ___regeneratorRuntime_95().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.query.action,o=___app_95.default.read(_$constants_67.SETTINGS_KEY),a=o.gistToken){t.next=6;break}(0,_$response_98.failed)(r,new _$errors_93.RequestInvalidError("GIST_TOKEN_NOT_FOUND","GitHub Token is required for backup!")),t.next=43;break;case 6:i=new ___gist_95.default({token:a,key:_$constants_67.GIST_BACKUP_KEY}),t.prev=7,s=___app_95.default.read(_$constants_67.SETTINGS_KEY),c=s.syncTime,t.t0=n,t.next="upload"===t.t0?13:"download"===t.t0?29:37;break;case 13:return s.syncTime=(new Date).getTime(),___app_95.default.write(s,_$constants_67.SETTINGS_KEY),u=___app_95.default.read("#sub-store"),___app_95.default.env.isNode&&(u=JSON.stringify(___app_95.default.cache,null," ")),___app_95.default.info("\u4e0a\u4f20\u5907\u4efd\u4e2d..."),t.prev=18,t.next=21,i.upload((l={},p=_$constants_67.GIST_BACKUP_FILE_NAME,f={content:u},p in l?Object.defineProperty(l,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):l[p]=f,l));case 21:t.next=28;break;case 23:throw t.prev=23,t.t1=t.catch(18),s.syncTime=c,___app_95.default.write(s,_$constants_67.SETTINGS_KEY),t.t1;case 28:return t.abrupt("break",37);case 29:return ___app_95.default.info("\u8fd8\u539f\u5907\u4efd\u4e2d..."),t.next=32,i.download(_$constants_67.GIST_BACKUP_FILE_NAME);case 32:return u=t.sent,___app_95.default.write(u,"#sub-store"),___app_95.default.env.isNode&&(u=JSON.parse(u),___app_95.default.cache=u,___app_95.default.persistCache()),(0,_migration.default)(),t.abrupt("break",37);case 37:(0,_$response_98.success)(r),t.next=43;break;case 40:t.prev=40,t.t2=t.catch(7),(0,_$response_98.failed)(r,new _$errors_93.InternalServerError("BACKUP_FAILED","Failed to ".concat(n," data to gist!"),"Reason: ".concat(JSON.stringify(t.t2))));case 43:case"end":return t.stop()}var l,p,f}),t,null,[[7,40],[18,23]])})))).apply(this,arguments)}var _$nodeInfo_96={};Object.defineProperty(_$nodeInfo_96,"__esModule",{value:!0}),_$nodeInfo_96.default=function(t){t.post("/api/utils/node-info",getNodeInfo)};var __obj_96,___producers_96=(__obj_96=_$producers_78)&&__obj_96.__esModule?__obj_96:{default:__obj_96};function ___typeof_96(t){return(___typeof_96="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_96(){___regeneratorRuntime_96=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=b(i,r);if(u){if(u===l)continue;return u}}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 s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=s;var l={};function p(){}function f(){}function _(){}var h={};u(h,o,(function(){return this}));var d=Object.getPrototypeOf,y=d&&d(d(C([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=_.prototype=p.prototype=Object.create(h);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,u){var s=c(t[o],t,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==___typeof_96(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,u)}),(function(t){n("throw",t,i,u)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,u)}))}u(s.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function b(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,b(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=c(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 E(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(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,a=function e(){for(;++n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){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),A(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;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function __asyncGeneratorStep_96(t,e,r,n,o,a,i){try{var u=t[a](i),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function getNodeInfo(t,e){return _getNodeInfo.apply(this,arguments)}function _getNodeInfo(){var t;return t=___regeneratorRuntime_96().mark((function t(e,r){var n,o,a,i,u;return ___regeneratorRuntime_96().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.body,o=e.query.lang||"zh-CN";try{a=___producers_96.default.URI.produce(n)}catch(s){}return t.prev=3,i=(0,_$openApi_115.HTTP)(),t.next=7,i.get({url:"http://ip-api.com/json/".concat(encodeURIComponent(n.server),"?lang=").concat(o),headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"}}).then((function(t){var e=JSON.parse(t.body);if("success"!==e.status)throw new Error(e.message);return delete e.status,e}));case 7:u=t.sent,(0,_$response_98.success)(r,{shareUrl:a,info:u}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3),(0,_$response_98.failed)(r,new _$errors_93.NetworkError("FAILED_TO_GET_NODE_INFO","Failed to get node info","Reason: ".concat(t.t0)));case 14:case"end":return t.stop()}}),t,null,[[3,11]])})),(_getNodeInfo=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){__asyncGeneratorStep_96(a,n,o,i,u,"next",t)}function u(t){__asyncGeneratorStep_96(a,n,o,i,u,"throw",t)}i(void 0)}))}).apply(this,arguments)}var _$restful_94={};Object.defineProperty(_$restful_94,"__esModule",{value:!0}),_$restful_94.default=function(){var t=(0,_express.default)({substore:___app_94.default});(0,_collections.default)(t),(0,_subscriptions.default)(t),(0,___download_94.default)(t),(0,_preview.default)(t),(0,_sort.default)(t),(0,___settings_94.default)(t),(0,___artifacts_94.default)(t),(0,___sync_94.default)(t),(0,_nodeInfo.default)(t),(0,_miscs.default)(t),t.start()};var _express=___interopRequireDefault_94(_$express_113),___app_94=___interopRequireDefault_94(_$app_68),_subscriptions=___interopRequireDefault_94(_$subscriptions_101),_collections=___interopRequireDefault_94(_$collections_91),___artifacts_94=___interopRequireDefault_94(_$artifacts_90),___sync_94=___interopRequireDefault_94(_$sync_102),___download_94=___interopRequireDefault_94(_$download_92),___settings_94=___interopRequireDefault_94(_$settings_99),_preview=___interopRequireDefault_94(_$preview_97),_sort=___interopRequireDefault_94(_$sort_100),_miscs=___interopRequireDefault_94(_$miscs_95),_nodeInfo=___interopRequireDefault_94(_$nodeInfo_96);function ___interopRequireDefault_94(t){return t&&t.__esModule?t:{default:t}}var _$main_89={},___migration_89=___interopRequireDefault_89(_$migration_110),_restful=___interopRequireDefault_89(_$restful_94);function ___interopRequireDefault_89(t){return t&&t.__esModule?t:{default:t}}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 Sub-Store -- v".concat(_$package_66.version,"\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,___migration_89.default)(),(0,_restful.default)()}(); \ No newline at end of file