nope-js-browser
Version:
NoPE Runtime for the Browser. For nodejs please use nope-js-node
13 lines • 4.31 MB
JavaScript
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=129)}([function(t,e,n){"use strict";n.r(e),n.d(e,"SPLITCHAR",(function(){return o})),n.d(e,"rgetattr",(function(){return a})),n.d(e,"rqueryAttr",(function(){return c})),n.d(e,"convertData",(function(){return u})),n.d(e,"rsetattr",(function(){return l})),n.d(e,"isInt",(function(){return h})),n.d(e,"isFloat",(function(){return f})),n.d(e,"copy",(function(){return p})),n.d(e,"objectToMap",(function(){return d})),n.d(e,"isObject",(function(){return g})),n.d(e,"isObjectOrArray",(function(){return y})),n.d(e,"flattenObject",(function(){return _})),n.d(e,"recursiveForEach",(function(){return v})),n.d(e,"flattenObjectType",(function(){return m})),n.d(e,"deflattenObject",(function(){return b})),n.d(e,"deepAssign",(function(){return w})),n.d(e,"deepClone",(function(){return E})),n.d(e,"getType",(function(){return O})),n.d(e,"deepEqual",(function(){return S})),n.d(e,"keepPropertiesOfObject",(function(){return T}));var r=n(27),i=n(4);const o="/",s=new Object;function a(t,e,n=s,r=o){let i=t;if(e.length>0){if(-1===e.indexOf(r))return null==i[e]||null==i[e]?n==s?null:n:i[e];for(const t of e.split(r)){if(i=i instanceof Map?i.get(t):i[t],(null==i||null==i)&&n===s)return null;if(null==i||null==i)return n}}return i}function c(t,e){if(!Object(i.containsWildcards)(e)){const n={id:Date.now()},r=a(t,e,n);return r===n?[]:[{path:e,data:r}]}let n=[];const r=e.includes(i.MULTI_LEVEL_WILDCARD),s=_(t,{maxDepth:r?1/0:e.split(o).length,onlyPathToSimpleValue:!1});for(const[t,o]of s.entries()){const s=Object(i.comparePatternAndPath)(e,t);(s.affectedOnSameLevel||r&&s.affectedByChild)&&n.push({path:t,data:o})}return n}function u(t,e){const n={},o=Object(r.a)(e.map(t=>t.query));e.map(e=>{n[e.key]=c(t,e.query)});const s={};for(const t of e){const e=n[t.key];for(const[n,r]of e.entries())if(!1!==o){const e=Object(i.comparePatternAndPath)(o,r.path);e.pathToExtractData&&(void 0===s[e.pathToExtractData]&&(s[e.pathToExtractData]={}),s[e.pathToExtractData][t.key]=r.data)}else void 0===s[n]&&(s[n]={}),s[n][t.key]=r.data}return Object.getOwnPropertyNames(s).map(t=>s[t])}function l(t,e,n,r=o){let i=t;const s=e.split(r);s.slice(0,-1).forEach((function(t,e){let n=i[t];if(null==n){const r=h(s[e+1]);Array.isArray(i)?i[t]=r?new Array:{}:i[t]=r?[]:{},n=i[t]}i=n})),i[s[s.length-1]]=n}function h(t){return parseInt(t)===t}function f(t){return!isNaN(Number(t))}function p(t){return JSON.parse(JSON.stringify(t))}function d(t){const e=new Map;for(const n of Object.getOwnPropertyNames(t))"function"!=typeof t&&e.set(n,t[n]);return e}function g(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&Object.keys(t).length>0}function y(t){return g(t)||Array.isArray(t)}function _(t,e={}){const n=Object.assign({prefix:"",splitchar:o,onlyPathToSimpleValue:!1,maxDepth:1/0},e),r=new Map;return(g(t)||Array.isArray(t))&&v(t,n.prefix,(t,e)=>{r.set(t,e)},n.splitchar,n.onlyPathToSimpleValue,n.maxDepth),r}function v(t,e="",n,r=o,i=!0,s=1/0,a="",c=0){if(c>s)return;let u=Array();"string"!=typeof t&&"function"!=typeof t&&(u=Object.getOwnPropertyNames(t),Array.isArray(t)&&u.splice(u.indexOf("length"),1));let l=!1;if(i||(n(e,t,a,c),l=!0),u.length>0)for(const o of u){const a=""===e?o:e+r+o;if(null!==t[o]&&void 0!==t[o])if("function"==typeof t[o].toJSON){v(t[o].toJSON(),a,n,r,i,s,e,c+1)}else v(t[o],a,n,r,i,s,e,c+1)}else l||n(e,t,e,c)}function m(t,e={}){const n=Object.assign({prefix:"",onlyPathToSimpleValue:!1,splitchar:o,maxDepth:1/0},e),r=new Map;return g(t)&&v(t,n.prefix,(t,e)=>{r.set(t,typeof e)},n.splitchar,n.onlyPathToSimpleValue,n.maxDepth),r}function b(t,e){const n=Object.assign({prefix:"",splitchar:o},e),r={};return t.forEach((t,e)=>{""!==n.prefix&&(e=e.slice(n.prefix.length)),l(r,e,t,n.splitchar)}),r}function w(t,e){const n=_(e);for(const[e,r]of n.entries())l(t,e,r);return t}function E(t){switch(typeof t){case"object":{if(null===t)return null;const e=Object.assign({},t);return Object.keys(e).forEach(n=>{e[n]="object"==typeof t[n]?E(t[n]):t[n]}),Array.isArray(t)&&t.length?(e.length=t.length)&&Array.from(e):Array.isArray(t)?Array.from(t):e}default:return t}}function O(t){return Object.prototype.toString.call(t).slice(8,-1)}function S(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;0!=r--;)if(!S(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!S(r[1],e.get(r[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.byteLength,n!=e.byteLength)return!1;for(r=n;0!=r--;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(!S(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function T(t,e){if(g(t)){const n={},r={error:!0};return Object.getOwnPropertyNames(e).map(i=>{const o=a(t,i,r);l(n,i,o!==r?"object"==typeof o?E(o):o:e[i]())}),n}throw TypeError("Function can only create Objects")}},function(t,e,n){"use strict";n.r(e),n.d(e,"TRACE",(function(){return f})),n.d(e,"DEBUG",(function(){return p})),n.d(e,"INFO",(function(){return d})),n.d(e,"WARN",(function(){return g})),n.d(e,"ERROR",(function(){return y})),n.d(e,"LEVELS",(function(){return _})),n.d(e,"getLogerAsEventEmitter",(function(){return c})),n.d(e,"LoggerAsEventEmitter",(function(){return a})),n.d(e,"useEventLogger",(function(){return u})),n.d(e,"defineNopeLogger",(function(){return i.a})),n.d(e,"getCentralNopeLogger",(function(){return i.b})),n.d(e,"getNopeLogger",(function(){return i.c})),n.d(e,"enabledFor",(function(){return l.d})),n.d(e,"enableFor",(function(){return l.c})),n.d(e,"LoggerLevels",(function(){return l.a})),n.d(e,"shouldLog",(function(){return l.e})),n.d(e,"setGlobalLoggerLevel",(function(){return h}));var r=n(11),i=n(2),o=n(16),s=n(8);class a{constructor(t=new o.EventEmitter){this._emitter=t,this._emitter=new o.EventEmitter}onLog(t){this._emitter.on("log",t)}onDebug(t){this._emitter.on("log.debug",t)}onInfo(t){this._emitter.on("log.info",t)}onWarn(t){this._emitter.on("log.warn",t)}onError(t){this._emitter.on("log.error",t)}emit(t,e,n){switch(t){case"debug":this._emitter.emit("log.debug",e,n);break;case"info":this._emitter.emit("log.info",e,n);break;case"warn":this._emitter.emit("log.warn",e,n);break;case"error":this._emitter.emit("log.error",e,n)}this._emitter.emit("log",t,e,n)}}function c(){return Object(s.getSingleton)("nope.logger.event",()=>new a).instance}function u(){const t=Object(i.b)(),e=c();return t.setHandler((t,n)=>{const r=[];for(const e in t)r.push(t[e].toString());e.emit(n.level.name.toLowerCase(),n.name,r.join(" "))}),e}var l=n(37);function h(t){Object(i.b)().level=t}Object(i.b)();const f=r.TRACE,p=r.DEBUG,d=r.INFO,g=r.WARN,y=r.ERROR,_={trace:f,debug:p,info:d,warn:g,error:y}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return a}));var r=n(8),i=n(37);function o(){return Object(r.getSingleton)("nopeBackendLogger.instance",()=>new i.b).instance}function s(t,e){return o().getLogger(t,e)}function a(t,e){if(0!=t)return"string"==typeof t?s(e,t):t}},function(t,e,n){"use strict";n.r(e),n.d(e,"generateId",(function(){return h}));var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const o=new Uint8Array(16);function s(){if(!i&&(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(o)}const a=[];for(let t=0;t<256;++t)a.push((t+256).toString(16).slice(1));function c(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}var u=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return c(i)},l=n(17);function h(t={}){let e=u();return"string"==typeof t.prestring&&(e=t.prestring+e),t.useAsVar&&(e=Object(l.varifyString)(e)),e}},function(t,e,n){"use strict";n.r(e),n.d(e,"SEPARATOR",(function(){return i})),n.d(e,"SINGLE_LEVEL_WILDCARD",(function(){return o})),n.d(e,"MULTI_LEVEL_WILDCARD",(function(){return s})),n.d(e,"generateResult",(function(){return a})),n.d(e,"comparePatternAndPath",(function(){return c})),n.d(e,"containsWildcards",(function(){return u})),n.d(e,"patternIsValid",(function(){return l}));var r=n(0);const i="/",o="+",s="#";function a(t={}){let e={affected:!1,affectedByChild:!1,affectedByParent:!1,affectedOnSameLevel:!1,containsWildcards:!1,patternToExtractData:!1,patternLengthComparedToPathLength:"=",pathToExtractData:!1};return e=Object.assign(e,t),e.affected=e.affectedByChild||e.affectedByParent||e.affectedOnSameLevel,Object.assign(e,t)}function c(t,e,n={matchTopicsWithoutWildcards:!1}){if(u(e))throw Error("The Path is invalid. The path should not contain pattern-related chars '#' or '+'.");if(!l(t))throw Error("The Pattern is invalid.");if(!l(e))throw Error("The Path is invalid.");const r=u(t),c=t.split(i),h=e.split(i),f=c.length,p=h.length;let d="=";if(f>p?d=">":f<p&&(d="<"),t===e)return a({affectedOnSameLevel:!0,pathToExtractData:e,patternLengthComparedToPathLength:d});if(""===e)return a({affectedByParent:!0,patternToExtractData:!!r&&t,pathToExtractData:!r&&t,patternLengthComparedToPathLength:">",containsWildcards:r});if(""===t)return a({affectedByChild:!0,pathToExtractData:"",patternLengthComparedToPathLength:"<"});if(n.matchTopicsWithoutWildcards){if(e.startsWith(t))return a(r?{affectedByChild:!0,pathToExtractData:e,patternLengthComparedToPathLength:d,containsWildcards:r}:{affectedByChild:!0,pathToExtractData:t,patternLengthComparedToPathLength:d,containsWildcards:r});if(t.startsWith(e))return a(r?{affectedByParent:!0,patternToExtractData:t,patternLengthComparedToPathLength:d,containsWildcards:r}:{affectedByParent:!0,pathToExtractData:t,patternLengthComparedToPathLength:d,containsWildcards:r})}let g="";for(let n=0;n<f;n++){const u=c[n],l=u[0],f=h[n];if(void 0===f){if(r)return a({affectedByParent:!0,patternToExtractData:t,patternLengthComparedToPathLength:d,containsWildcards:r});if(">"===d)return a({affectedByParent:!0,pathToExtractData:t,patternLengthComparedToPathLength:d,containsWildcards:r});throw Error("Implementation Error! This should not happen.")}if(f==u)g=g.length>0?`${g}${i}${f}`:f;else{if(l===s){if("="==d)return a({affectedOnSameLevel:!0,pathToExtractData:e,patternLengthComparedToPathLength:d,containsWildcards:r});if("<"==d)return a({affectedByChild:!0,pathToExtractData:e,patternLengthComparedToPathLength:d,containsWildcards:r});throw Error("Implementation Error!")}if(l===o)g=g.length>0?`${g}${exports.SEPARATOR}${f}`:f;else if(l!==o&&u!==f)return a({patternLengthComparedToPathLength:d,containsWildcards:r})}}const y=e.slice(g.length+1);return a({affectedOnSameLevel:0==y.length,affectedByChild:y.length>=1,pathToExtractData:g,patternLengthComparedToPathLength:d,containsWildcards:r})}function u(t){return t.includes(o)||t.includes(s)}function l(t){if(""===t)return!0;const e=t.split(r.SPLITCHAR),n=e.length-1;return e.map((t,e)=>!!t&&(t!==s||e===n)).reduce((t,e)=>t&&e,!0)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function o(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create},function(t,e,n){"use strict";n.r(e),n.d(e,"dynamicSort",(function(){return i})),n.d(e,"extractListElement",(function(){return o})),n.d(e,"toSet",(function(){return s})),n.d(e,"getElement",(function(){return a})),n.d(e,"arraysEqual",(function(){return c})),n.d(e,"limitedPush",(function(){return u})),n.d(e,"countElements",(function(){return l})),n.d(e,"flattenDeep",(function(){return h})),n.d(e,"elementInArray",(function(){return f})),n.d(e,"zipArrays",(function(){return p})),n.d(e,"avgOfArray",(function(){return d})),n.d(e,"minOfArray",(function(){return g})),n.d(e,"maxOfArray",(function(){return y}));var r=n(0);function i(t,e=!1){const n=e?-1:1;return function(e,i){const o=Object(r.rgetattr)(e,t),s=Object(r.rgetattr)(i,t);if("number"==typeof o&&"number"==typeof s){return(o<s?-1:o>s?1:0)*n}return"number"==typeof o?1*n:"number"==typeof s?-1*n:"string"==typeof o&&"string"==typeof s?o<s?-1:o>s?1:0:0}}function o(t,e){return t.map((function(t){const n=Object(r.rgetattr)(t,e);if(n)return n}))}function s(t){const e=new Set;for(const n of t)e.add(n);return e}function a(t,e,n=""){for(const i of t)if(e===Object(r.rgetattr)(i,n))return i;return null}function c(t,e,n=!0){if(t===e)return!0;if(null==t||null==e)return!1;if(t.length!=e.length)return!1;let r=t,i=e;n||(r=t.concat().sort(),i=e.concat().sort());for(let t=0;t<r.length;++t)if(r[t]!==i[t])return!1;return!0}function u(t,e,n){t.push(e),t.length>n&&t.splice(0,1)}function l(t){const e=new Map;for(const n of t)e.set(n,(e.get(n)||0)+1);return e}function h(t){return t.reduce((t,e)=>Array.isArray(e)?t.concat(h(e)):t.concat(e),[])}function f(t,e,n){const i=Object(r.rgetattr)(t,n,!1);for(const[t,o]of e.entries())if(i===Object(r.rgetattr)(o,n,!0))return t;return-1}function p(t,e){if(t.length!==e.length)throw Error("Length of the Elements doesnt match!");return t.map((function(t,n){return[t,e[n]]}))}function d(t,e,n=0){if(0===t.length)return n;return t.map(t=>Object(r.rgetattr)(t,e,n)).reduce((t,e)=>t+e)/t.length}function g(t,e,n=0){if(0===t.length)return{min:n,index:-1};const i=t.map(t=>Object(r.rgetattr)(t,e,n)),o=Math.min(...i);return{min:o,index:i.indexOf(o)}}function y(t,e,n=0){if(0===t.length)return{max:n,index:-1};const i=t.map(t=>Object(r.rgetattr)(t,e,n)),o=Math.max(...i);return{max:o,index:i.indexOf(o)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"Eventnames",(function(){return r})),n.d(e,"ENopeDispatcherStatus",(function(){return i})),n.d(e,"ValidDefaultSelectors",(function(){return o}));const r=["aurevoir","bonjour","instancesChanged","dataChanged","servicesChanged","statusChanged","taskCancelation","event","rpcRequest","rpcResponse","rpcUnregister","tasks"];var i;!function(t){t[t.HEALTHY=0]="HEALTHY",t[t.SLOW=1]="SLOW",t[t.WARNING=2]="WARNING",t[t.DEAD=3]="DEAD"}(i||(i={}));n(46),n(47),n(48),n(49),n(50);const o=["master","first","dispatcher","host","free-ram","cpu-usage"]},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"getSingleton",(function(){return o}));const r=Symbol.for("nope"),i=Symbol.for("singletons");function o(e,n){t[r]||(t[r]={singletons:{}}),t[r][i]||(t[r][i]={});const o=Object.getOwnPropertyNames(t[r][i]),s=e;o.indexOf(s)>-1||(t[r][i][s]=n());const a={instance:t[r][i][s],setInstance:e=>{t[r][i][s]=e}};return Object.defineProperty(a,"instance",{get:function(){return t[r][i][s]}}),Object.freeze(a),a}}.call(this,n(20))},function(t,e,n){"use strict";function r(t){return new Promise(e=>{setTimeout(e,t)})}function i(t){return"AsyncFunction"===t.constructor.name}function o(t,e={}){const n=Object.assign({testFirst:!0,delay:50},e),o=i(t);return new Promise(o?async(i,o)=>{let s;e.initialWait&&await r(e.initialWait),s=n.additionalDelay?()=>{setTimeout(i,n.additionalDelay)}:i;try{if(n.testFirst&&await t())s();else{let e=0,r=null,i=null;n.maxTimeout&&(r=setTimeout(async()=>{i&&clearInterval(i),o(new Error("Wait has been Timeout"))},n.maxTimeout)),i=setInterval(async()=>{try{n.maxRetries&&e>n.maxRetries?(clearInterval(i),r&&clearTimeout(r),o(new RangeError("Max Retries has been reached"))):await t()&&(clearInterval(i),r&&clearTimeout(r),s()),e+=1}catch(t){o(t)}},n.delay)}}catch(t){o(t)}}:(r,i)=>{const o=()=>{let e;e=n.additionalDelay?()=>{setTimeout(r,n.additionalDelay)}:r;try{if(n.testFirst&&t())n.additionalDelay?setTimeout(r,n.additionalDelay):e();else{let r=0,o=null,s=null;n.maxTimeout&&(o=setTimeout(async()=>{s&&clearInterval(s),i(new Error("Wait has been Timeout"))},n.maxTimeout)),s=setInterval(()=>{try{n.maxRetries&&r>n.maxRetries?(clearInterval(s),o&&clearTimeout(o),i(new RangeError("Max Retries has been reached"))):t()&&(clearInterval(s),o&&clearTimeout(o),e()),r+=1}catch(t){i(t)}},n.delay)}}catch(t){i(t)}};e.initialWait?setTimeout(o,e.initialWait):o()})}n.r(e),n.d(e,"sleep",(function(){return r})),n.d(e,"isAsyncFunction",(function(){return i})),n.d(e,"waitFor",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(25),i=n(3),o=n(0),s=n(2);Object(s.c)("obervable");class a extends r.a{get observable(){return this._emitter}setContent(t,e={}){return this._emit(t,e)}_emit(t,e={}){var n;if(null!==this.setter){const n=this.setter(t,e);if(!n.valid)return!1;this._value=n.data}else this._value=t;const r=this.getContent();return!(this.disablePublishing||!e.forced&&Object(o.deepEqual)(null===(n=this._emitter.value)||void 0===n?void 0:n.value,r))&&this._publish(r,e)}_publish(t,e={}){return!(!e.forced&&!1!==this.disablePublishing)&&(e=this._updateSenderAndTimestamp(e),this._emitter.next({value:t,...e}),this.hasSubscriptions)}forcePublish(t={}){return t.forced=!0,this._publish(this.getContent(),t)}getContent(){return null!==this.getter?this.getter(this._value):this._value}subscribe(t,e={type:"sync",mode:["direct","sub","super"],skipCurrent:!1}){return this._subscribe(t,e)}constructor(t={}){super(Object.assign(t,{showCurrent:!0})),this._options=t,this.id=Object(i.generateId)(),this.options={generateTimeStamp:!0}}}},function(t,e,n){var r,i;
/*!
* js-logger - http://github.com/jonnyreeves/js-logger
* Jonny Reeves, http://jonnyreeves.co.uk/
* js-logger may be freely distributed under the MIT license.
*/!function(o){"use strict";var s,a={};a.VERSION="1.6.1";var c={},u=function(t,e){return function(){return e.apply(t,arguments)}},l=function(){var t,e,n=arguments,r=n[0];for(e=1;e<n.length;e++)for(t in n[e])!(t in r)&&n[e].hasOwnProperty(t)&&(r[t]=n[e][t]);return r},h=function(t,e){return{value:t,name:e}};a.TRACE=h(1,"TRACE"),a.DEBUG=h(2,"DEBUG"),a.INFO=h(3,"INFO"),a.TIME=h(4,"TIME"),a.WARN=h(5,"WARN"),a.ERROR=h(8,"ERROR"),a.OFF=h(99,"OFF");var f=function(t){this.context=t,this.setLevel(t.filterLevel),this.log=this.info};f.prototype={setLevel:function(t){t&&"value"in t&&(this.context.filterLevel=t)},getLevel:function(){return this.context.filterLevel},enabledFor:function(t){var e=this.context.filterLevel;return t.value>=e.value},trace:function(){this.invoke(a.TRACE,arguments)},debug:function(){this.invoke(a.DEBUG,arguments)},info:function(){this.invoke(a.INFO,arguments)},warn:function(){this.invoke(a.WARN,arguments)},error:function(){this.invoke(a.ERROR,arguments)},time:function(t){"string"==typeof t&&t.length>0&&this.invoke(a.TIME,[t,"start"])},timeEnd:function(t){"string"==typeof t&&t.length>0&&this.invoke(a.TIME,[t,"end"])},invoke:function(t,e){s&&this.enabledFor(t)&&s(e,l({level:t},this.context))}};var p,d=new f({filterLevel:a.OFF});(p=a).enabledFor=u(d,d.enabledFor),p.trace=u(d,d.trace),p.debug=u(d,d.debug),p.time=u(d,d.time),p.timeEnd=u(d,d.timeEnd),p.info=u(d,d.info),p.warn=u(d,d.warn),p.error=u(d,d.error),p.log=p.info,a.setHandler=function(t){s=t},a.setLevel=function(t){for(var e in d.setLevel(t),c)c.hasOwnProperty(e)&&c[e].setLevel(t)},a.getLevel=function(){return d.getLevel()},a.get=function(t){return c[t]||(c[t]=new f(l({name:t},d.context)))},a.createDefaultHandler=function(t){(t=t||{}).formatter=t.formatter||function(t,e){e.name&&t.unshift("["+e.name+"]")};var e={},n=function(t,e){Function.prototype.apply.call(t,console,e)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var o,s=console.log;i.level===a.TIME?(o=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(o):e[o]=(new Date).getTime():console.timeEnd?console.timeEnd(o):n(s,[o+": "+((new Date).getTime()-e[o])+"ms"])):(i.level===a.WARN&&console.warn?s=console.warn:i.level===a.ERROR&&console.error?s=console.error:i.level===a.INFO&&console.info?s=console.info:i.level===a.DEBUG&&console.debug?s=console.debug:i.level===a.TRACE&&console.trace&&(s=console.trace),t.formatter(r,i),n(s,r))}},a.useDefaults=function(t){a.setLevel(t&&t.defaultLevel||a.DEBUG),a.setHandler(a.createDefaultHandler(t))},a.setDefaults=a.useDefaults,void 0===(i="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}()},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var c,u=[],l=!1,h=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&p())}function p(){if(!l){var t=a(f);l=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new d(t,e)),1!==u.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";n.r(e),function(t,r){n.d(e,"callImmediate",(function(){return o})),n.d(e,"callDirect",(function(){return s})),n.d(e,"RUNNINGINNODE",(function(){return a})),n.d(e,"RUNNINGINWINDOWS",(function(){return c})),n.d(e,"RUNNINGINLINUX",(function(){return u})),n.d(e,"RUNNINGINOSX",(function(){return l}));const i=void 0!==t&&void 0!==t.release&&"node"===t.release.name,o=i?(t,...e)=>{const n=new Error("Error for Bugtracing");return r(()=>{try{t(...e)}catch(t){console.error(t),console.log("Trancing Bug with the Following Error"),console.error(n)}})}:(t,...e)=>{const n=new Error("Error for Bugtracing");return setTimeout(()=>{try{t(...e)}catch(t){console.error(t),console.log("Trancing Bug with the Following Error"),console.error(n)}},0)},s=(t,...e)=>{t(...e)},a=i,c=!!i&&"win32"===t.platform,u=!!i&&"linux"===t.platform,l=!!i&&"darwin"===t.platform}.call(this,n(12),n(80).setImmediate)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var r=n(82),i=n(83),o=n(84);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,n)}function u(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(c.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|p(e)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return T(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function _(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,s=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){for(var h=!0,f=0;f<c;f++)if(u(t,o+f)!==u(e,f)){h=!1;break}if(h)return o}return-1}function m(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function b(t,e,n,r){return W(U(e,t.length-n),t,n,r)}function w(t,e,n,r){return W(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function E(t,e,n,r){return w(t,e,n,r)}function O(t,e,n,r){return W(q(e),t,n,r)}function S(t,e,n,r){return W(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function T(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,c,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(l=u);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return u(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=c.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):g.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,n,r,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=t.slice(e,n),h=0;h<a;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return _(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return _(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return E(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function P(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function k(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=F(t[o]);return i}function R(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function N(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function D(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function x(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function M(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,o){return o||M(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,o){return o||M(t,0,n,8),i.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=c.prototype;else{var i=e-t;n=new c(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},c.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},c.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},c.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},c.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):x(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):x(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):x(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):x(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},c.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=c.isBuffer(t)?t:U(new c(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(20))},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&_(t,"error",e,n)}(t,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var i,o,s,a;if(u(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]),void 0===s)s=o[e]=n,++t._eventsCount;else if("function"==typeof s?s=o[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=l(t))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):y(i,i.length)}function g(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function _(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var u=c.length,l=y(c,u);for(n=0;n<u;++n)o(l[n],this,e)}return!0},a.prototype.addListener=function(t,e){return h(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return h(this,t,e,!0)},a.prototype.once=function(t,e){return u(e),this.on(t,p(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,p(this,t,e)),this},a.prototype.removeListener=function(t,e){var n,r,i,o,s;if(u(e),void 0===(r=this.