@web/test-runner-mocha
Version:
Mocha test framework for Web Test Runner
1 lines • 274 kB
JavaScript
import{sendMessage as e}from"/__web-dev-server__web-socket.js";const t="wds-import-map";let r=!1;const n=new URL(window.location.href).searchParams.get("wtr-test-file"),i=new URL(window.location.href).searchParams.get("wtr-session-id");if("string"!=typeof i&&"string"!=typeof n)throw new Error("Could not find any session id or test filequery parameter.");if(!window.__WTR_CONFIG__){const e="Could not find any config defined by the test runner. Are your dependencies up to date?";throw o({message:e}),new Error(e)}function o(e){return s({userAgent:window.navigator.userAgent,passed:!1,errors:[{name:e.name,message:e.message,stack:e.stack,expected:e.expected,actual:e.actual}]})}async function s(t){if(!i)return;if(r)return;r=!0;const o={logs:window.__wtr_browser_logs__?window.__wtr_browser_logs__.logs:[],errors:[],...t};await e({type:"wtr-session-finished",userAgent:window.navigator.userAgent,sessionId:i,testFile:n,result:o})}function a(e){const t=[];let r=!0;function n(e){var r,n;for(const i of e){const e=i.err;if("failed"===i.state||e)if(e){const i=null!==(n=null===(r=e.stack)||void 0===r?void 0:r.split("\n"))&&void 0!==n?n:[];t.push({name:e.name,message:e.message,stack:i.join("\n")})}else t.push({message:"Unknown error in mocha hook"})}}const i=function e(t){n(t._beforeAll),n(t._afterAll),n(t._beforeEach),n(t._afterEach);const i=t.suites.map((t=>e(t))),o=function(e){const t=[];for(const n of e){n.isPassed()||n.isPending()||(r=!1);const e=n.err;t.push({name:n.title,passed:n.isPassed(),skipped:n.isPending(),...void 0!==n.duration&&{duration:n.duration},error:e?{name:e.name,message:e.message,stack:e.stack,expected:e.expected,actual:e.actual}:void 0})}return t}(t.tests);return{name:t.title,suites:i,tests:o}}(e.suite);return{testResults:i,hookErrors:t,passed:r}}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).mocha=t()}(void 0,(function(){var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}var i=r,o=n;function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}"function"==typeof t.setTimeout&&(i=setTimeout),"function"==typeof t.clearTimeout&&(o=clearTimeout);var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===n||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function h(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(p)}function d(e,t){this.fun=e,this.array=t}d.prototype.run=function(){this.fun.apply(null,this.array)};function g(){}var m=g,b=g,y=g,v=g,w=g,E=g,_=g;var T=t.performance||{},A=T.now||T.mozNow||T.msNow||T.oNow||T.webkitNow||function(){return(new Date).getTime()};var x=new Date;var S={nextTick:h,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:m,addListener:b,once:y,off:v,removeListener:w,removeAllListeners:E,emit:_,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*A.call(T),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-x)/1e3}},D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function N(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function L(){}function k(){k.init.call(this)}function C(e){return void 0===e._maxListeners?k.defaultMaxListeners:e._maxListeners}function q(e,t,r,n){var i,o,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]):(o=e._events=new L,e._eventsCount=0),s){if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),!s.warned&&(i=C(e))&&i>0&&s.length>i){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=o[t]=r,++e._eventsCount;return e}function O(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function P(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function I(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}L.prototype=Object.create(null),k.EventEmitter=k,k.usingDomains=!1,k.prototype.domain=void 0,k.prototype._events=void 0,k.prototype._maxListeners=void 0,k.defaultMaxListeners=10,k.init=function(){this.domain=null,k.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new L,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},k.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},k.prototype.getMaxListeners=function(){return C(this)},k.prototype.emit=function(e){var t,r,n,i,o,s,a,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(r=s[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=I(e,n),o=0;o<n;++o)i[o].call(r)}(r,l,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=I(e,i),s=0;s<i;++s)o[s].call(r,n)}(r,l,this,arguments[1]);break;case 3:!function(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,s=I(e,o),a=0;a<o;++a)s[a].call(r,n,i)}(r,l,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var s=e.length,a=I(e,s),u=0;u<s;++u)a[u].call(r,n,i,o)}(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];!function(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=I(e,i),s=0;s<i;++s)o[s].apply(r,n)}(r,l,this,i)}return!0},k.prototype.addListener=function(e,t){return q(this,e,t,!1)},k.prototype.on=k.prototype.addListener,k.prototype.prependListener=function(e,t){return q(this,e,t,!0)},k.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,O(this,e,t)),this},k.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,O(this,e,t)),this},k.prototype.removeListener=function(e,t){var r,n,i,o,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new L:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new L,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}(r,i);n.removeListener&&this.emit("removeListener",e,s||t)}return this},k.prototype.off=function(e,t){return this.removeListener(e,t)},k.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new L,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new L:delete r[e]),this;if(0===arguments.length){for(var n,i=Object.keys(r),o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new L,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},k.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):[]},k.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):P.call(e,t)},k.prototype.listenerCount=P,k.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var U=Object.freeze({__proto__:null,default:k,EventEmitter:k}),F=[],B=[],V="undefined"!=typeof Uint8Array?Uint8Array:Array,M=!1;function j(){M=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)F[t]=e[t],B[e.charCodeAt(t)]=t;B["-".charCodeAt(0)]=62,B["_".charCodeAt(0)]=63}function G(e,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(F[(i=n)>>18&63]+F[i>>12&63]+F[i>>6&63]+F[63&i]);return o.join("")}function H(e){var t;M||j();for(var r=e.length,n=r%3,i="",o=[],s=16383,a=0,u=r-n;a<u;a+=s)o.push(G(e,a,a+s>u?u:a+s));return 1===n?(t=e[r-1],i+=F[t>>2],i+=F[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=F[t>>10],i+=F[t>>4&63],i+=F[t<<2&63],i+="="),o.push(i),o.join("")}function z(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,p=r?-1:1,h=e[t+f];for(f+=p,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=p,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=c}return(h?-1:1)*s*Math.pow(2,o-n)}function Y(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+h]=255&s,h+=d,s/=256,c-=8);e[r+h-d]|=128*g}var $={}.toString,W=Array.isArray||function(e){return"[object Array]"==$.call(e)};function J(){return Z.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function K(e,t){if(J()<t)throw new RangeError("Invalid typed array length");return Z.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Z.prototype:(null===e&&(e=new Z(t)),e.length=t),e}function Z(e,t,r){if(!(Z.TYPED_ARRAY_SUPPORT||this instanceof Z))return new Z(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return ee(this,e)}return Q(this,e,t,r)}function Q(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Z.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Z.prototype:e=te(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!Z.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|ie(t,r);e=K(e,n);var i=e.write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(ne(t)){var r=0|re(t.length);return 0===(e=K(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?K(e,0):te(e,t);if("Buffer"===t.type&&W(t.data))return te(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function X(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function ee(e,t){if(X(t),e=K(e,t<0?0:0|re(t)),!Z.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function te(e,t){var r=t.length<0?0:0|re(t.length);e=K(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function re(e){if(e>=J())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J().toString(16)+" bytes");return 0|e}function ne(e){return!(null==e||!e._isBuffer)}function ie(e,t){if(ne(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ke(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ce(e).length;default:if(n)return ke(e).length;t=(""+t).toLowerCase(),n=!0}}function oe(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return we(this,t,r);case"utf8":case"utf-8":return me(this,t,r);case"ascii":return ye(this,t,r);case"latin1":case"binary":return ve(this,t,r);case"base64":return ge(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function se(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function ae(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Z.from(t,n)),ne(t))return 0===t.length?-1:ue(e,t,r,n,i);if("number"==typeof t)return t&=255,Z.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ue(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ue(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,p=0;p<u;p++)if(c(e,o+p)!==c(t,p)){f=!1;break}if(f)return o}return-1}function ce(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function le(e,t,r,n){return qe(ke(t,e.length-r),e,r,n)}function fe(e,t,r,n){return qe(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function pe(e,t,r,n){return fe(e,t,r,n)}function he(e,t,r,n){return qe(Ce(t),e,r,n)}function de(e,t,r,n){return qe(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function ge(e,t,r){return 0===t&&r===e.length?H(e):H(e.slice(t,r))}function me(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=be)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=be));return r}(n)}Z.TYPED_ARRAY_SUPPORT=void 0===e.TYPED_ARRAY_SUPPORT||e.TYPED_ARRAY_SUPPORT,Z.poolSize=8192,Z._augment=function(e){return e.__proto__=Z.prototype,e},Z.from=function(e,t,r){return Q(null,e,t,r)},Z.TYPED_ARRAY_SUPPORT&&(Z.prototype.__proto__=Uint8Array.prototype,Z.__proto__=Uint8Array),Z.alloc=function(e,t,r){return function(e,t,r,n){return X(t),t<=0?K(e,t):void 0!==r?"string"==typeof n?K(e,t).fill(r,n):K(e,t).fill(r):K(e,t)}(null,e,t,r)},Z.allocUnsafe=function(e){return ee(null,e)},Z.allocUnsafeSlow=function(e){return ee(null,e)},Z.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Oe(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Oe(e.slice(0,0))}(e))},Z.compare=function(e,t){if(!ne(e)||!ne(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Z.isEncoding=function(e){switch(String(e).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}},Z.concat=function(e,t){if(!W(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Z.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Z.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!ne(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Z.byteLength=ie,Z.prototype._isBuffer=!0,Z.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)se(this,t,t+1);return this},Z.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)se(this,t,t+3),se(this,t+1,t+2);return this},Z.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)se(this,t,t+7),se(this,t+1,t+6),se(this,t+2,t+5),se(this,t+3,t+4);return this},Z.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?me(this,0,e):oe.apply(this,arguments)},Z.prototype.equals=function(e){if(!ne(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Z.compare(this,e)},Z.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Z.prototype.compare=function(e,t,r,n,i){if(!ne(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},Z.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Z.prototype.indexOf=function(e,t,r){return ae(this,e,t,r,!0)},Z.prototype.lastIndexOf=function(e,t,r){return ae(this,e,t,r,!1)},Z.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return ce(this,e,t,r);case"utf8":case"utf-8":return le(this,e,t,r);case"ascii":return fe(this,e,t,r);case"latin1":case"binary":return pe(this,e,t,r);case"base64":return he(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Z.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var be=4096;function ye(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function ve(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function we(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Le(e[o]);return i}function Ee(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function _e(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Te(e,t,r,n,i,o){if(!ne(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function Ae(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function xe(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function Se(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function De(e,t,r,n,i){return i||Se(e,0,r,4),Y(e,t,r,n,23,4),r+4}function Re(e,t,r,n,i){return i||Se(e,0,r,8),Y(e,t,r,n,52,8),r+8}Z.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Z.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Z.prototype;else{var i=t-e;r=new Z(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},Z.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||_e(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},Z.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||_e(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Z.prototype.readUInt8=function(e,t){return t||_e(e,1,this.length),this[e]},Z.prototype.readUInt16LE=function(e,t){return t||_e(e,2,this.length),this[e]|this[e+1]<<8},Z.prototype.readUInt16BE=function(e,t){return t||_e(e,2,this.length),this[e]<<8|this[e+1]},Z.prototype.readUInt32LE=function(e,t){return t||_e(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Z.prototype.readUInt32BE=function(e,t){return t||_e(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Z.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||_e(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Z.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||_e(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Z.prototype.readInt8=function(e,t){return t||_e(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Z.prototype.readInt16LE=function(e,t){t||_e(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Z.prototype.readInt16BE=function(e,t){t||_e(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Z.prototype.readInt32LE=function(e,t){return t||_e(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Z.prototype.readInt32BE=function(e,t){return t||_e(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Z.prototype.readFloatLE=function(e,t){return t||_e(e,4,this.length),z(this,e,!0,23,4)},Z.prototype.readFloatBE=function(e,t){return t||_e(e,4,this.length),z(this,e,!1,23,4)},Z.prototype.readDoubleLE=function(e,t){return t||_e(e,8,this.length),z(this,e,!0,52,8)},Z.prototype.readDoubleBE=function(e,t){return t||_e(e,8,this.length),z(this,e,!1,52,8)},Z.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Te(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},Z.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Te(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Z.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,1,255,0),Z.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Z.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,2,65535,0),Z.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ae(this,e,t,!0),t+2},Z.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,2,65535,0),Z.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ae(this,e,t,!1),t+2},Z.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,4,4294967295,0),Z.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):xe(this,e,t,!0),t+4},Z.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,4,4294967295,0),Z.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):xe(this,e,t,!1),t+4},Z.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Te(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},Z.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Te(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},Z.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,1,127,-128),Z.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Z.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,2,32767,-32768),Z.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ae(this,e,t,!0),t+2},Z.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,2,32767,-32768),Z.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ae(this,e,t,!1),t+2},Z.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,4,2147483647,-2147483648),Z.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):xe(this,e,t,!0),t+4},Z.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Te(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Z.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):xe(this,e,t,!1),t+4},Z.prototype.writeFloatLE=function(e,t,r){return De(this,e,t,!0,r)},Z.prototype.writeFloatBE=function(e,t,r){return De(this,e,t,!1,r)},Z.prototype.writeDoubleLE=function(e,t,r){return Re(this,e,t,!0,r)},Z.prototype.writeDoubleBE=function(e,t,r){return Re(this,e,t,!1,r)},Z.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!Z.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},Z.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Z.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=ne(e)?e:ke(new Z(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var Ne=/[^+\/0-9A-Za-z-_]/g;function Le(e){return e<16?"0"+e.toString(16):e.toString(16)}function ke(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Ce(e){return function(e){var t,r,n,i,o,s;M||j();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new V(3*a/4-o),n=o>0?a-4:a;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)i=B[e.charCodeAt(t)]<<18|B[e.charCodeAt(t+1)]<<12|B[e.charCodeAt(t+2)]<<6|B[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=B[e.charCodeAt(t)]<<2|B[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=B[e.charCodeAt(t)]<<10|B[e.charCodeAt(t+1)]<<4|B[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Ne,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function qe(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Oe(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Pe(){throw new Error("setTimeout has not been defined")}function Ie(){throw new Error("clearTimeout has not been defined")}var Ue=Pe,Fe=Ie;function Be(e){if(Ue===setTimeout)return setTimeout(e,0);if((Ue===Pe||!Ue)&&setTimeout)return Ue=setTimeout,setTimeout(e,0);try{return Ue(e,0)}catch(t){try{return Ue.call(null,e,0)}catch(t){return Ue.call(this,e,0)}}}"function"==typeof e.setTimeout&&(Ue=setTimeout),"function"==typeof e.clearTimeout&&(Fe=clearTimeout);var Ve,Me=[],je=!1,Ge=-1;function He(){je&&Ve&&(je=!1,Ve.length?Me=Ve.concat(Me):Ge=-1,Me.length&&ze())}function ze(){if(!je){var e=Be(He);je=!0;for(var t=Me.length;t;){for(Ve=Me,Me=[];++Ge<t;)Ve&&Ve[Ge].run();Ge=-1,t=Me.length}Ve=null,je=!1,function(e){if(Fe===clearTimeout)return clearTimeout(e);if((Fe===Ie||!Fe)&&clearTimeout)return Fe=clearTimeout,clearTimeout(e);try{return Fe(e)}catch(t){try{return Fe.call(null,e)}catch(t){return Fe.call(this,e)}}}(e)}}function Ye(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Me.push(new $e(e,t)),1!==Me.length||je||Be(ze)}function $e(e,t){this.fun=e,this.array=t}$e.prototype.run=function(){this.fun.apply(null,this.array)};function We(){}var Je=We,Ke=We,Ze=We,Qe=We,Xe=We,et=We,tt=We;var rt=e.performance||{},nt=rt.now||rt.mozNow||rt.msNow||rt.oNow||rt.webkitNow||function(){return(new Date).getTime()};var it=new Date;var ot={nextTick:Ye,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Je,addListener:Ke,once:Ze,off:Qe,removeListener:Xe,removeAllListeners:et,emit:tt,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*nt.call(rt),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-it)/1e3}},st="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},at=/%[sdj%]/g;function ut(e){if(!At(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(ht(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(at,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])Et(s)||!Rt(s)?o+=" "+s:o+=" "+ht(s);return o}function ct(t,r){if(St(e.process))return function(){return ct(t,r).apply(this,arguments)};if(!0===ot.noDeprecation)return t;var n=!1;return function(){if(!n){if(ot.throwDeprecation)throw new Error(r);ot.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}}var lt,ft={};function pt(e){if(St(lt)&&(lt=ot.env.NODE_DEBUG||""),e=e.toUpperCase(),!ft[e])if(new RegExp("\\b"+e+"\\b","i").test(lt)){ft[e]=function(){var t=ut.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else ft[e]=function(){};return ft[e]}function ht(e,t){var r={seen:[],stylize:gt};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),wt(t)?r.showHidden=t:t&&Ft(r,t),St(r.showHidden)&&(r.showHidden=!1),St(r.depth)&&(r.depth=2),St(r.colors)&&(r.colors=!1),St(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=dt),mt(r,e,r.depth)}function dt(e,t){var r=ht.styles[t];return r?"["+ht.colors[r][0]+"m"+e+"["+ht.colors[r][1]+"m":e}function gt(e,t){return e}function mt(e,t,r){if(e.customInspect&&t&&kt(t.inspect)&&t.inspect!==ht&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return At(n)||(n=mt(e,n,r)),n}var i=function(e,t){if(St(t))return e.stylize("undefined","undefined");if(At(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(Tt(t))return e.stylize(""+t,"number");if(wt(t))return e.stylize(""+t,"boolean");if(Et(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Lt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return bt(t);if(0===o.length){if(kt(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Dt(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Nt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Lt(t))return bt(t)}var u,c="",l=!1,f=["{","}"];(vt(t)&&(l=!0,f=["[","]"]),kt(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return Dt(t)&&(c=" "+RegExp.prototype.toString.call(t)),Nt(t)&&(c=" "+Date.prototype.toUTCString.call(t)),Lt(t)&&(c=" "+bt(t)),0!==o.length||l&&0!=t.length?r<0?Dt(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=l?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)Bt(t,String(s))?o.push(yt(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(yt(e,t,r,n,i,!0))})),o}(e,t,r,s,o):o.map((function(n){return yt(e,t,r,s,n,l)})),e.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,f)):f[0]+c+f[1]}function bt(e){return"["+Error.prototype.toString.call(e)+"]"}function yt(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),Bt(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=Et(r)?mt(e,u.value,null):mt(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),St(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function vt(e){return Array.isArray(e)}function wt(e){return"boolean"==typeof e}function Et(e){return null===e}function _t(e){return null==e}function Tt(e){return"number"==typeof e}function At(e){return"string"==typeof e}function xt(e){return"symbol"==typeof e}function St(e){return void 0===e}function Dt(e){return Rt(e)&&"[object RegExp]"===Ot(e)}function Rt(e){return"object"==typeof e&&null!==e}function Nt(e){return Rt(e)&&"[object Date]"===Ot(e)}function Lt(e){return Rt(e)&&("[object Error]"===Ot(e)||e instanceof Error)}function kt(e){return"function"==typeof e}function Ct(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function qt(e){return Z.isBuffer(e)}function Ot(e){return Object.prototype.toString.call(e)}function Pt(e){return e<10?"0"+e.toString(10):e.toString(10)}ht.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ht.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var It=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ut(){console.log("%s - %s",function(){var e=new Date,t=[Pt(e.getHours()),Pt(e.getMinutes()),Pt(e.getSeconds())].join(":");return[e.getDate(),It[e.getMonth()],t].join(" ")}(),ut.apply(null,arguments))}function Ft(e,t){if(!t||!Rt(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function Bt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Vt={inherits:st,_extend:Ft,log:Ut,isBuffer:qt,isPrimitive:Ct,isFunction:kt,isError:Lt,isDate:Nt,isObject:Rt,isRegExp:Dt,isUndefined:St,isSymbol:xt,isString:At,isNumber:Tt,isNullOrUndefined:_t,isNull:Et,isBoolean:wt,isArray:vt,inspect:ht,deprecate:ct,format:ut,debuglog:pt},Mt=Object.freeze({__proto__:null,format:ut,deprecate:ct,debuglog:pt,inspect:ht,isArray:vt,isBoolean:wt,isNull:Et,isNullOrUndefined:_t,isNumber:Tt,isString:At,isSymbol:xt,isUndefined:St,isRegExp:Dt,isObject:Rt,isDate:Nt,isError:Lt,isFunction:kt,isPrimitive:Ct,isBuffer:qt,log:Ut,inherits:st,_extend:Ft,default:Vt});function jt(){this.head=null,this.tail=null,this.length=0}jt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},jt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},jt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},jt.prototype.clear=function(){this.head=this.tail=null,this.length=0},jt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},jt.prototype.concat=function(e){if(0===this.length)return Z.alloc(0);if(1===this.length)return this.head.data;for(var t=Z.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Gt=Z.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ht(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Gt(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Yt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=$t;break;default:return void(this.write=zt)}this.charBuffer=new Z(6),this.charReceived=0,this.charLength=0}function zt(e){return e.toString(this.encoding)}function Yt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function $t(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Ht.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},Ht.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},Ht.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},Kt.ReadableState=Jt;var Wt=pt("stream");function Jt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ar&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new jt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Ht(e.encoding),this.encoding=e.encoding)}function Kt(e){if(!(this instanceof Kt))return new Kt(e);this._readableState=new Jt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),k.call(this)}function Zt(e,t,r,n,i){var o=function(e,t){var r=null;Z.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,er(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var u;!t.decoder||i||n||(r=t.decoder.write(r),u=!t.objectMode&&0===r.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&er(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ye(rr,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}st(Kt,k),Kt.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding)!==r.encoding&&(e=Z.from(e,t),t=""),Zt(this,r,e,t,!1)},Kt.prototype.unshift=function(e){return Zt(this,this._readableState,e,"",!0)},Kt.prototype.isPaused=function(){return!1===this._readableState.flowing},Kt.prototype.setEncoding=function(e){return this._readableState.decoder=new Ht(e),this._readableState.encoding=e,this};var Qt=8388608;function Xt(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=Qt?e=Qt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function er(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Wt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ye(tr,e):tr(e))}function tr(e){Wt("emit readable"),e.emit("readable"),or(e)}function rr(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Wt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function nr(e){Wt("readable nexttick read 0"),e.read(0)}function ir(e,t){t.reading||(Wt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),or(e),t.flowing&&!t.reading&&e.read(0)}function or(e){var t=e._readableState;for(Wt("flow",t.flowing);t.flowing&&null!==e.read(););}function sr(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=Z.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function ar(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ye(ur,t,e))}function ur(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function cr(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function lr(){}function fr(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function pr(e,t){Object.defineProperty(this,"buffer",{get:ct((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Ar&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?Ye(i,n):i(n);e._writableState.errorEmitted=!0,e.emit("error",n)}(e,r,n,t,i);else{var o=br(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||mr(e,r),n?Ye(gr,e,r,o,i):gr(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new wr(this)}function hr(e){if(!(this instanceof hr||this instanceof Ar))return new hr(e);this._writableState=new pr(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),k.call(this)}function dr(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function gr(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.e