diff --git a/es5/dist.js b/es5/dist.js index 012cf17..395e181 100644 --- a/es5/dist.js +++ b/es5/dist.js @@ -1,431 +1,81 @@ -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.owns=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)};$jscomp.assign="function"==typeof Object.assign?Object.assign:function(a,c){for(var g=1;gg&&(g=Math.max(0,b+g));if(null==e||e>b)e=b;e=Number(e);0>e&&(e=Math.max(0,b+e));for(g=Number(g||0);ga||1342177279>>=1)c+=c;return e}},"es6","es3");$jscomp.findInternal=function(a,c,g){a instanceof String&&(a=String(a));for(var e=a.length,b=0;b does not exist in ",""],["<","> does not exist in ",""]),_templateObject11= _taggedTemplateLiteral([""," is not a promise"],[""," is not a promise"]),_templateObject12=_taggedTemplateLiteral(["'","' does not resolve to '","'"],["'","' does not resolve to '","'"]),_templateObject13=_taggedTemplateLiteral(["'","' is not of type '","'"],["'","' is not of type '","'"]),_templateObject14=_taggedTemplateLiteral(["'","' is not greater than ",""],["'","' is not greater than ",""]),_templateObject15=_taggedTemplateLiteral(["'","' is not less than ",""],["'","' is not less than ", -""]),_templateObject16=_taggedTemplateLiteral(["'","' is less than ",""],["'","' is less than ",""]),_templateObject17=_taggedTemplateLiteral(["'","' is greater than ",""],["'","' is greater than ",""]);function _possibleConstructorReturn(a,c){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!c||"object"!==typeof c&&"function"!==typeof c?a:c} -function _inherits(a,c){if("function"!==typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function, not "+typeof c);a.prototype=Object.create(c&&c.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});c&&(Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c)}function _taggedTemplateLiteral(a,c){return Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(c)}}))} -function _toArray(a){return Array.isArray(a)?a:Array.from(a)}function _classCallCheck2(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function _defineProperty2(a,c,g){c in a?Object.defineProperty(a,c,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[c]=g;return a}function _toConsumableArray2(a){if(Array.isArray(a)){for(var c=0,g=Array(a.length);c>18&63]+f[b>>12&63]+f[b>>6&63]+f[b&63]);return e.join("")}g.byteLength=function(a){a=e(a);var b=a[1];return 3*(a[0]+b)/4-b};g.toByteArray=function(a){var b=e(a);var f=b[0];b=b[1];for(var c=new h(3*(f+b)/4-b),k=0,g=0>16&255,c[k++]=f>>8&255,c[k++]=f&255;2=== -b&&(f=d[a.charCodeAt(r)]<<2|d[a.charCodeAt(r+1)]>>4,c[k++]=f&255);1===b&&(f=d[a.charCodeAt(r)]<<10|d[a.charCodeAt(r+1)]<<4|d[a.charCodeAt(r+2)]>>2,c[k++]=f>>8&255,c[k++]=f&255);return c};g.fromByteArray=function(a){for(var d=a.length,e=d%3,h=[],c=0,k=d-e;ck?k:c+16383));1===e?(a=a[d-1],h.push(f[a>>2]+f[a<<4&63]+"==")):2===e&&(a=(a[d-2]<<8)+a[d-1],h.push(f[a>>10]+f[a>>4&63]+f[a<<2&63]+"="));return h.join("")};var f=[],d=[],h="undefined"!==typeof Uint8Array?Uint8Array: -Array;for(a=0;64>a;++a)f[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[a],d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(a)]=a;d[45]=62;d[95]=63},{}],7:[function(a,c,g){},{}],8:[function(a,c,g){function e(a){if(a>x)throw new RangeError('The value "'+a+'" is invalid for option "size"');a=new Uint8Array(a);a.__proto__=b.prototype;return a}function b(a,b,d){if("number"===typeof a){if("string"===typeof b)throw new TypeError('The "string" argument must be of type string. Received type number'); -return h(a)}return f(a,b,d)}function f(a,d,f){if("string"===typeof a){var h=d;if("string"!==typeof h||""===h)h="utf8";if(!b.isEncoding(h))throw new TypeError("Unknown encoding: "+h);d=p(a,h)|0;f=e(d);a=f.write(a,h);a!==d&&(f=f.slice(0,a));return f}if(ArrayBuffer.isView(a))return k(a);if(null==a)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+("undefined"===typeof a?"undefined":_typeof2(a)));if(H(a,ArrayBuffer)||a&&H(a.buffer, -ArrayBuffer)){if(0>d||a.byteLengtha)throw new RangeError('The value "'+a+'" is invalid for option "size"'); -}function h(a){d(a);return e(0>a?0:n(a)|0)}function k(a){for(var b=0>a.length?0:n(a.length)|0,d=e(b),f=0;f=x)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+x.toString(16)+ -" bytes");return a|0}function p(a,d){if(b.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||H(a,ArrayBuffer))return a.byteLength;if("string"!==typeof a)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+("undefined"===typeof a?"undefined":_typeof2(a)));var f=a.length,e=2>>1;case "base64":return I.toByteArray(y(a)).length;default:if(h)return e?-1:J(a).length;d=(""+d).toLowerCase();h=!0}}function q(a,b,d){var f=!1;if(void 0===b||0>b)b=0;if(b>this.length)return"";if(void 0===d||d>this.length)d=this.length;if(0>=d)return"";d>>>=0;b>>>=0;if(d<=b)return"";for(a||(a="utf8");;)switch(a){case "hex":a=b;b=d;d=this.length;if(!a||0>a)a=0;if(!b||0>b||b>d)b=d;f="";for(d=a;df?"0"+f.toString(16):f.toString(16),f=a+f;return f;case "utf8":case "utf-8":return u(this,b,d);case "ascii":a="";for(d=Math.min(this.length,d);bf&&(f=-2147483648);f=+f;f!==f&&(f=h?0:a.length-1);0>f&&(f=a.length+f);if(f>=a.length){if(h)return-1;f=a.length-1}else if(0>f)if(h)f=0;else return-1;"string"===typeof d&&(d=b.from(d,e));if(b.isBuffer(d))return 0=== -d.length?-1:t(a,d,f,e,h);if("number"===typeof d)return d&=255,"function"===typeof Uint8Array.prototype.indexOf?h?Uint8Array.prototype.indexOf.call(a,d,f):Uint8Array.prototype.lastIndexOf.call(a,d,f):t(a,[d],f,e,h);throw new TypeError("val must be string, number or Buffer");}function t(a,b,d,f,e){function h(a,b){return 1===c?a[b]:a.readUInt16BE(b*c)}var c=1,z=a.length,k=b.length;if(void 0!==f&&(f=String(f).toLowerCase(),"ucs2"===f||"ucs-2"===f||"utf16le"===f||"utf-16le"===f)){if(2>a.length||2>b.length)return-1; -c=2;z/=2;k/=2;d/=2}if(e)for(f=-1;dz&&(d=z-k);0<=d;d--){z=!0;for(f=0;fe&&(h=e);break;case 2:var z=a[b+1];128===(z&192)&&(e=(e&31)<<6|z&63,127e||57343e&&(h=e))}null===h?(h=65533,c=1):65535>>10&1023|55296),h=56320|h&1023);f.push(h);b+=c}a=f.length;if(a<=Q)f=String.fromCharCode.apply(String,f);else{d="";for(b=0;ba)throw new RangeError("offset is not uint");if(a+b>d)throw new RangeError("Trying to access beyond buffer length");}function w(a,d,f,e,h,c){if(!b.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>h||da.length)throw new RangeError("Index out of range");}function B(a,b,d,f,e,h){if(d+f>a.length)throw new RangeError("Index out of range");if(0>d)throw new RangeError("Index out of range"); -}function G(a,b,d,f,e){b=+b;d>>>=0;e||B(a,b,d,4,3.4028234663852886E38,-3.4028234663852886E38);F.write(a,b,d,f,23,4);return d+4}function E(a,b,d,f,e){b=+b;d>>>=0;e||B(a,b,d,8,1.7976931348623157E308,-1.7976931348623157E308);F.write(a,b,d,f,52,8);return d+8}function y(a){a=a.split("=")[0];a=a.trim().replace(L,"");if(2>a.length)return"";for(;0!==a.length%4;)a+="=";return a}function J(a,b){b=b||Infinity;for(var d,f=a.length,e=null,h=[],c=0;cd){if(!e){if(56319< -d){-1<(b-=3)&&h.push(239,191,189);continue}else if(c+1===f){-1<(b-=3)&&h.push(239,191,189);continue}e=d;continue}if(56320>d){-1<(b-=3)&&h.push(239,191,189);e=d;continue}d=(e-55296<<10|d-56320)+65536}else e&&-1<(b-=3)&&h.push(239,191,189);e=null;if(128>d){if(0>--b)break;h.push(d)}else if(2048>d){if(0>(b-=2))break;h.push(d>>6|192,d&63|128)}else if(65536>d){if(0>(b-=3))break;h.push(d>>12|224,d>>6&63|128,d&63|128)}else if(1114112>d){if(0>(b-=4))break;h.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw Error("Invalid code point"); -}return h}function A(a){for(var b=[],d=0;d=b.length||e>=a.length);++e)b[e+d]=a[e];return e}function H(a,b){return a instanceof b||null!=a&&null!=a.constructor&&null!=a.constructor.name&&a.constructor.name===b.name}var I=a("base64-js"),F=a("ieee754");g.Buffer=b;g.SlowBuffer=function(a){+a!=a&&(a=0);return b.alloc(+a)};g.INSPECT_MAX_BYTES=50;var x=2147483647;g.kMaxLength=x;b.TYPED_ARRAY_SUPPORT=function(){try{var a= -new Uint8Array(1);a.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return 42===a.foo()}catch(z){return!1}}();b.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}});Object.defineProperty(b.prototype, -"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});"undefined"!==typeof Symbol&&null!=Symbol.species&&b[Symbol.species]===b&&Object.defineProperty(b,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1});b.poolSize=8192;b.from=function(a,b,d){return f(a,b,d)};b.prototype.__proto__=Uint8Array.prototype;b.__proto__=Uint8Array;b.alloc=function(a,b,f){d(a);a=0>=a?e(a):void 0!==b?"string"===typeof f?e(a).fill(b,f):e(a).fill(b):e(a);return a};b.allocUnsafe= -function(a){return h(a)};b.allocUnsafeSlow=function(a){return h(a)};b.isBuffer=function(a){return null!=a&&!0===a._isBuffer&&a!==b.prototype};b.compare=function(a,d){H(a,Uint8Array)&&(a=b.from(a,a.offset,a.byteLength));H(d,Uint8Array)&&(d=b.from(d,d.offset,d.byteLength));if(!b.isBuffer(a)||!b.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===d)return 0;for(var f=a.length,e=d.length,h=0,c=Math.min(f,e);ha&&(b+=" ... ");return""};b.prototype.compare=function(a,d,f,e,h){H(a,Uint8Array)&&(a=b.from(a,a.offset,a.byteLength));if(!b.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+("undefined"===typeof a?"undefined":_typeof2(a)));void 0===d&&(d=0);void 0=== -f&&(f=a?a.length:0);void 0===e&&(e=0);void 0===h&&(h=this.length);if(0>d||f>a.length||0>e||h>this.length)throw new RangeError("out of range index");if(e>=h&&d>=f)return 0;if(e>=h)return-1;if(d>=f)return 1;d>>>=0;f>>>=0;e>>>=0;h>>>=0;if(this===a)return 0;var c=h-e,k=f-d,l=Math.min(c,k);e=this.slice(e,h);a=a.slice(d,f);for(d=0;d>>=0,isFinite(d)?(d>>>=0,void 0===f&&(f="utf8")):(f=d,d=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var e=this.length-b;if(void 0===d||d>e)d=e;if(0d||0>b)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds"); -f||(f="utf8");for(e=!1;;)switch(f){case "hex":a:{b=Number(b)||0;f=this.length-b;d?(d=Number(d),d>f&&(d=f)):d=f;f=a.length;d>f/2&&(d=f/2);for(f=0;f(e-=2));++c){var k=f.charCodeAt(c);a=k>>8;k%=256;h.push(k);h.push(a)}return D(h,this,b,d);default:if(e)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase();e=!0}};b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;b.prototype.slice=function(a,d){var f=this.length;a=~~a;d=void 0===d?f:~~d;0>a?(a+=f,0>a&&(a=0)):a>f&&(a=f);0>d?(d+=f,0>d&&(d=0)):d>f&&(d=f);d>>=0;b>>>=0;d||v(a,b,this.length);d=this[a];for(var f=1,e=0;++e>>=0;b>>>=0;d||v(a,b,this.length);d=this[a+--b];for(var f=1;0>>=0;b||v(a,1,this.length);return this[a]};b.prototype.readUInt16LE=function(a,b){a>>>=0;b||v(a,2,this.length);return this[a]|this[a+1]<<8};b.prototype.readUInt16BE= -function(a,b){a>>>=0;b||v(a,2,this.length);return this[a]<<8|this[a+1]};b.prototype.readUInt32LE=function(a,b){a>>>=0;b||v(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};b.prototype.readUInt32BE=function(a,b){a>>>=0;b||v(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};b.prototype.readIntLE=function(a,b,d){a>>>=0;b>>>=0;d||v(a,b,this.length);d=this[a];for(var f=1,e=0;++e=128*f&&(d-=Math.pow(2,8*b));return d}; -b.prototype.readIntBE=function(a,b,d){a>>>=0;b>>>=0;d||v(a,b,this.length);d=b;for(var f=1,e=this[a+--d];0=128*f&&(e-=Math.pow(2,8*b));return e};b.prototype.readInt8=function(a,b){a>>>=0;b||v(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};b.prototype.readInt16LE=function(a,b){a>>>=0;b||v(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};b.prototype.readInt16BE=function(a,b){a>>>=0;b||v(a,2,this.length);a=this[a+1]|this[a]<<8;return a& -32768?a|4294901760:a};b.prototype.readInt32LE=function(a,b){a>>>=0;b||v(a,4,this.length);return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};b.prototype.readInt32BE=function(a,b){a>>>=0;b||v(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};b.prototype.readFloatLE=function(a,b){a>>>=0;b||v(a,4,this.length);return F.read(this,a,!0,23,4)};b.prototype.readFloatBE=function(a,b){a>>>=0;b||v(a,4,this.length);return F.read(this,a,!1,23,4)};b.prototype.readDoubleLE=function(a, -b){a>>>=0;b||v(a,8,this.length);return F.read(this,a,!0,52,8)};b.prototype.readDoubleBE=function(a,b){a>>>=0;b||v(a,8,this.length);return F.read(this,a,!1,52,8)};b.prototype.writeUIntLE=function(a,b,d,f){a=+a;b>>>=0;d>>>=0;f||w(this,a,b,d,Math.pow(2,8*d)-1,0);f=1;var e=0;for(this[b]=a&255;++e>>=0;d>>>=0;f||w(this,a,b,d,Math.pow(2,8*d)-1,0);f=d-1;var e=1;for(this[b+f]=a&255;0<=--f&&(e*=256);)this[b+f]=a/e& -255;return b+d};b.prototype.writeUInt8=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,1,255,0);this[b]=a&255;return b+1};b.prototype.writeUInt16LE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,2,65535,0);this[b]=a&255;this[b+1]=a>>>8;return b+2};b.prototype.writeUInt16BE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,2,65535,0);this[b]=a>>>8;this[b+1]=a&255;return b+2};b.prototype.writeUInt32LE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,4,4294967295,0);this[b+3]=a>>>24;this[b+2]=a>>>16;this[b+1]=a>>>8;this[b]=a& -255;return b+4};b.prototype.writeUInt32BE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,4,4294967295,0);this[b]=a>>>24;this[b+1]=a>>>16;this[b+2]=a>>>8;this[b+3]=a&255;return b+4};b.prototype.writeIntLE=function(a,b,d,f){a=+a;b>>>=0;f||(f=Math.pow(2,8*d-1),w(this,a,b,d,f-1,-f));f=0;var e=1,h=0;for(this[b]=a&255;++fa&&0===h&&0!==this[b+f-1]&&(h=1),this[b+f]=(a/e>>0)-h&255;return b+d};b.prototype.writeIntBE=function(a,b,d,f){a=+a;b>>>=0;f||(f=Math.pow(2,8*d-1),w(this,a,b,d,f-1,-f));f=d- -1;var e=1,h=0;for(this[b+f]=a&255;0<=--f&&(e*=256);)0>a&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/e>>0)-h&255;return b+d};b.prototype.writeInt8=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,1,127,-128);0>a&&(a=255+a+1);this[b]=a&255;return b+1};b.prototype.writeInt16LE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,2,32767,-32768);this[b]=a&255;this[b+1]=a>>>8;return b+2};b.prototype.writeInt16BE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,2,32767,-32768);this[b]=a>>>8;this[b+1]=a&255;return b+2};b.prototype.writeInt32LE= -function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,4,2147483647,-2147483648);this[b]=a&255;this[b+1]=a>>>8;this[b+2]=a>>>16;this[b+3]=a>>>24;return b+4};b.prototype.writeInt32BE=function(a,b,d){a=+a;b>>>=0;d||w(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);this[b]=a>>>24;this[b+1]=a>>>16;this[b+2]=a>>>8;this[b+3]=a&255;return b+4};b.prototype.writeFloatLE=function(a,b,d){return G(this,a,b,!0,d)};b.prototype.writeFloatBE=function(a,b,d){return G(this,a,b,!1,d)};b.prototype.writeDoubleLE=function(a, -b,d){return E(this,a,b,!0,d)};b.prototype.writeDoubleBE=function(a,b,d){return E(this,a,b,!1,d)};b.prototype.copy=function(a,d,f,e){if(!b.isBuffer(a))throw new TypeError("argument should be a Buffer");f||(f=0);e||0===e||(e=this.length);d>=a.length&&(d=a.length);d||(d=0);0d)throw new RangeError("targetStart out of bounds");if(0>f||f>=this.length)throw new RangeError("Index out of range");if(0>e)throw new RangeError("sourceEnd out of bounds"); -e>this.length&&(e=this.length);a.length-dh||"latin1"===e)a=h}}else"number"===typeof a&&(a&=255);if(0>d||this.length>>=0;f=void 0===f?this.length:f>>>0;a||(a=0);if("number"===typeof a)for(e=d;ed&&(c.warned=!0,d=Error("Possible EventEmitter memory leak detected. "+c.length+' "'+String(b)+'" listeners added. Use emitter.setMaxListeners() to increase limit.'),d.name="MaxListenersExceededWarning",d.emitter=a,d.type=b,d.count=c.length,"object"=== -("undefined"===typeof console?"undefined":_typeof2(console))&&console.warn&&console.warn("%s: %s",d.name,d.message))):(h[b]=d,++a._eventsCount);return a}function f(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0], -arguments[1],arguments[2]);default:for(var a=Array(arguments.length),b=0;ba||a!==a)throw new TypeError('"defaultMaxListeners" must be a positive number');u=a}}):e.defaultMaxListeners=u;e.prototype.setMaxListeners=function(a){if("number"!==typeof a||0>a||isNaN(a))throw new TypeError('"n" argument must be a positive number'); -this._maxListeners=a;return this};e.prototype.getMaxListeners=function(){return void 0===this._maxListeners?e.defaultMaxListeners:this._maxListeners};e.prototype.emit=function(a){var b,d,f;var e="error"===a;if(f=this._events)e=e&&null==f.error;else if(!e)return!1;if(e){1h)return this;if(0===h)e.shift();else{d=h+1;for(var k=e.length;d>1,g=-7;h=f?h-1:0;var q=f?-1:1,m=a[b+h];h+=q;f=m&(1<<-g)-1;m>>=-g;for(g+=e;0>=-g;for(g+=d;0>1,m=23===h?Math.pow(2,-24)-Math.pow(2,-77):0;c=d?0:c-1;var r=d?1:-1,t=0>b||0===b&&0>1/b?1:0;b=Math.abs(b);isNaN(b)||Infinity===b?(b=isNaN(b)?1:0,d=g):(d=Math.floor(Math.log(b)/Math.LN2),1>b*(e=Math.pow(2,-d))&&(d--,e*=2),b=1<=d+q?b+m/e:b+m*Math.pow(2,1-q),2<=b*e&&(d++,e/=2),d+q>=g?(b=0,d=g):1<=d+q?(b=(b*e-1)*Math.pow(2,h),d+=q):(b=b*Math.pow(2,q-1)*Math.pow(2,h),d=0));for(;8<=h;a[f+c]=b&255,c+=r,b/=256,h-=8);d=d<=a){a="x";var d=2}else if(65535>=a)a="u",d=4;else if(4294967295>=a)a="U",d=8;else throw new G("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+B.repeat("0",d-b.length)+b}function b(a){this.schema=a.schema||E;this.indent=Math.max(1, -a.indent||2);this.skipInvalid=a.skipInvalid||!1;this.flowLevel=B.isNothing(a.flowLevel)?-1:a.flowLevel;var b=this.schema;var d=a.styles||null,f,e;if(null===d)b={};else{var h={};var c=Object.keys(d);var k=0;for(f=c.length;k=a||161<=a&&55295>=a&&8232!==a&&8233!==a|| -57344<=a&&65533>=a&&65279!==a||65536<=a&&1114111>=a}function h(a){return d(a)&&65279!==a&&44!==a&&91!==a&&93!==a&&123!==a&&125!==a&&58!==a&&35!==a}function k(a,b,f,e,c){var k=!1,l=!1,g=-1!==e,n=-1,m=a.charCodeAt(0);if(m=d(m)&&65279!==m&&!(32===m||9===m)&&45!==m&&63!==m&&58!==m&&44!==m&&91!==m&&93!==m&&123!==m&&125!==m&&35!==m&&38!==m&&42!==m&&33!==m&&124!==m&&62!==m&&39!==m&&34!==m&&37!==m&&64!==m&&96!==m)m=a.charCodeAt(a.length-1),m=!(32===m||9===m);if(b)for(b=0;be&&" "!==a[n+1],n=b);else if(!d(r))return 5;m=m&&h(r)}l=l||g&&b-n-1>e&&" "!==a[n+1]}return k||l?9=a.flowLevel, -a.indent,c,function(b){a:{var d;var f=0;for(d=a.implicitTypes.length;f"+n(b,a.indent)+p(f(q(b,c),h));case 5:return'"'+r(b,c)+'"';default:throw new G("impossible error: invalid scalar style");}}()}function n(a,b){b=/^\n* /.test(a)?String(b):"";var d="\n"===a[a.length-1];return b+(!d||"\n"!==a[a.length-2]&& -"\n"!==a?d?"":"-":"+")+"\n"}function p(a){return"\n"===a[a.length-1]?a.slice(0,-1):a}function q(a,b){var d=/(\n+)([^\n]*)/g;var f=a.indexOf("\n");f=-1!==f?f:a.length;d.lastIndex=f;f=m(a.slice(0,f),b);for(var e="\n"===a[0]||" "===a[0],h;h=d.exec(a);){var c=h[1],k=h[2];h=" "===k[0];f+=c+(e||h||""===k?"":"\n")+m(k,b);e=h}return f}function m(a,b){if(""===a||" "===a[0])return a;var d=/ [^ ]/g,f,e=0;var h=0;for(var c="";f=d.exec(a);)f=f.index,f-e>b&&(h=h>e?h:f,c+="\n"+a.slice(e,h),e=h+1),h=f;c+="\n";c= -a.length-e>b&&h>e?c+(a.slice(e,h)+"\n"+a.slice(h+1)):c+a.slice(e);return c.slice(1)}function r(a){for(var b="",f,h,c=0;c=f&&(h=a.charCodeAt(c+1),56320<=h&&57343>=h)){b+=e(1024*(f-55296)+h-56320+65536);c++;continue}h=D[f];b+=!h&&d(f)?a[c]:h||e(f)}return b}function t(a,b,d){var f;var e=d?a.explicitTypes:a.implicitTypes;var h=0;for(f=e.length;h tag resolver accepts not "'+d+'" style');a.dump=b}return!0}}return!1}function u(a,b,d,f,e,h){a.tag=null;a.dump=d;t(a,d,!1)||t(a,d,!0);var c=J.call(a.dump);f&&(f=0>a.flowLevel||a.flowLevel>b);var k="[object Object]"=== -c||"[object Array]"===c;if(k){var g=a.duplicates.indexOf(d);var n=-1!==g}if(null!==a.tag&&"?"!==a.tag||n||2!==a.indent&&0 "+a.dump)}return!0}function v(a,b,d){var f;if(null!==a&&"object"===("undefined"===typeof a?"undefined": -_typeof2(a))){var e=b.indexOf(a);if(-1!==e)-1===d.indexOf(e)&&d.push(e);else if(b.push(a),Array.isArray(a))for(e=0,f=a.length;e=e||n(a,"expected valid JSON character")}else K.test(b)&&n(a,"the stream contains non-printable characters");a.result+=b}}function m(a,b,d,f){var e;H.isObject(d)||n(a,"cannot merge mappings; the provided source object is unacceptable");a=Object.keys(d);var h=0;for(e=a.length;hb)&&0!== -k)n(a,"bad indentation of a sequence entry");else if(a.lineIndenth?z=1:a.lineIndent===h?z=0:a.lineIndenth?z=1:a.lineIndent===h?z=0:a.lineIndentk)y(a,k,4,!0,C)&&(x?P=a.result:M=a.result),x||(r(a,K,N,D,P,M,z,l),D=P=M=null),u(a,!0,-1),I=a.input.charCodeAt(a.position);if(a.lineIndent>k&&0!==I)n(a,"bad indentation of a mapping entry");else if(a.lineIndent=p?p-48:-1))0===K?n(a,"bad explicit indentation width of a block scalar; it cannot be less than one"):m?n(a,"repeat of an indentation width identifier"):(z=h+K-1,m=!0);else break;if(b(p)){do p=a.input.charCodeAt(++a.position);while(b(p));if(35===p){do p=a.input.charCodeAt(++a.position);while(!e(p)&&0!==p)}}for(;0!==p;){t(a);a.lineIndent=0;for(p=a.input.charCodeAt(a.position);(!m||a.lineIndentz&&(z=a.lineIndent);if(e(p))l++;else{if(a.lineIndentm&&T[m])a.result+=S[m],a.position++;else if(0<(k=120===m?2:117===m?4:85===m?8:0)){C=k;for(g=0;0=m?m-=48:(m|=32,m=97<=m&&102>=m?m-97+10:-1),0<=(k=m)?g=(g<<4)+k:n(a,"expected hexadecimal character"); -C=a.result;g=65535>=g?String.fromCharCode(g):String.fromCharCode((g-65536>>10)+55296,(g-65536&1023)+56320);a.result=C+g;a.position++}else n(a,"unknown escape sequence");g=C=a.position}else e(m)?(q(a,g,C,!0),w(a,u(a,!1,h)),g=C=a.position):a.position===a.lineStart&&v(a)?n(a,"unexpected end of the document within a double quoted scalar"):(a.position++,C=a.position);n(a,"unexpected end of the stream within a double quoted scalar");g=void 0}if(g)R=!0;else{C=a.input.charCodeAt(a.position);if(42!==C)g=!1; -else{C=a.input.charCodeAt(++a.position);for(g=a.position;0!==C&&!f(C)&&!d(C);)C=a.input.charCodeAt(++a.position);a.position===g&&n(a,"name of an alias node must contain at least one character");g=a.input.slice(g,a.position);a.anchorMap.hasOwnProperty(g)||n(a,'unidentified alias "'+g+'"');a.result=a.anchorMap[g];u(a,!0,-1);g=!0}if(g)R=!0,null===a.tag&&null===a.anchor||n(a,"alias node should not have any properties");else{a:if(c=1===c,k=a.kind,m=a.result,l=a.input.charCodeAt(a.position),f(l)||d(l)|| -35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)var F=!1;else{if(63===l||45===l)if(A=a.input.charCodeAt(a.position+1),f(A)||c&&d(A)){F=!1;break a}a.kind="scalar";a.result="";g=C=a.position;for(z=!1;0!==l;){if(58===l){if(A=a.input.charCodeAt(a.position+1),f(A)||c&&d(A))break}else if(35===l){if(A=a.input.charCodeAt(a.position-1),f(A))break}else if(a.position===a.lineStart&&v(a)||c&&d(l))break;else if(e(l))if(F=a.line,z=a.lineStart,l=a.lineIndent,u(a,!1,-1),a.lineIndent>= -h){z=!0;l=a.input.charCodeAt(a.position);continue}else{a.position=C;a.line=F;a.lineStart=z;a.lineIndent=l;break}z&&(q(a,g,C,!1),w(a,a.line-F),g=C=a.position,z=!1);b(l)||(C=a.position+1);l=a.input.charCodeAt(++a.position)}q(a,g,C,!1);a.result?F=!0:(a.kind=k,a.result=m,F=!1)}F&&(R=!0,null===a.tag&&(a.tag="?"))}}null!==a.anchor&&(a.anchorMap[a.anchor]=a.result)}}else 0===z&&(R=m&&B(a,k));if(null!==a.tag&&"!"!==a.tag)if("?"===a.tag)for(F=0,h=a.implicitTypes.length;F tag; it should be "'+c.kind+'", not "'+a.kind+'"'),c.resolve(a.result)?(a.result=c.construct(a.result),null!==a.anchor&&(a.anchorMap[a.anchor]=a.result)):n(a,"cannot resolve a node with !<"+a.tag+"> explicit tag")):n(a,"unknown tag !<"+a.tag+ -">");null!==a.listener&&a.listener("close",a);return null!==a.tag||null!==a.anchor||R}function J(a,d){a=String(a);d=d||{};0!==a.length&&(10!==a.charCodeAt(a.length-1)&&13!==a.charCodeAt(a.length-1)&&(a+="\n"),65279===a.charCodeAt(0)&&(a=a.slice(1)));a=new k(a,d);for(a.input+="\x00";32===a.input.charCodeAt(a.position);)a.lineIndent+=1,a.position+=1;for(;a.positionm.length&&n(c,"directive name must not be less than one character in length");0!==d;){for(;b(d);)d=c.input.charCodeAt(++c.position);if(35===d){do d=c.input.charCodeAt(++c.position);while(0!==d&&!e(d));break}if(e(d))break;for(h=c.position;0!==d&&!f(d);)d=c.input.charCodeAt(++c.position); -r.push(c.input.slice(h,c.position))}0!==d&&t(c);if(L.call(U,m))U[m](c,m,r);else p(c,'unknown document directive "'+m+'"')}u(c,!0,-1);0===c.lineIndent&&45===c.input.charCodeAt(c.position)&&45===c.input.charCodeAt(c.position+1)&&45===c.input.charCodeAt(c.position+2)?(c.position+=3,u(c,!0,-1)):g&&n(c,"directives end mark is expected");y(c,c.lineIndent-1,4,!1,!0);u(c,!0,-1);c.checkLineBreaks&&z.test(c.input.slice(l,c.position))&&p(c,"non-ASCII line breaks are interpreted as content");c.documents.push(c.result); -c.position===c.lineStart&&v(c)?46===c.input.charCodeAt(c.position)&&(c.position+=3,u(c,!0,-1)):c.positiona;a++)T[a]=h(a)?1:0,S[a]=h(a);var U={YAML:function(a,b,d){null!==a.version&&n(a,"duplication of %YAML directive"); -1!==d.length&&n(a,"YAML directive accepts exactly one argument");var f=/^([0-9]+)\.([0-9]+)$/.exec(d[0]);null===f&&n(a,"ill-formed argument of the YAML directive");b=parseInt(f[1],10);f=parseInt(f[2],10);1!==b&&n(a,"unacceptable YAML version of the document");a.version=d[0];a.checkLineBreaks=2>f;1!==f&&2!==f&&p(a,"unsupported YAML version of the document")},TAG:function(a,b,d){2!==d.length&&n(a,"TAG directive accepts exactly two arguments");b=d[0];d=d[1];N.test(b)||n(a,"ill-formed tag handle (first argument) of the TAG directive"); -L.call(a.tagMap,b)&&n(a,'there is a previously declared suffix for "'+b+'" tag handle');M.test(d)||n(a,"ill-formed tag prefix (second argument) of the TAG directive");a.tagMap[b]=d}};c.exports.loadAll=A;c.exports.load=D;c.exports.safeLoadAll=function(a,b,d){if("function"===typeof b)A(a,b,H.extend({schema:x},d));else return A(a,H.extend({schema:x},d))};c.exports.safeLoad=function(a,b){return D(a,H.extend({schema:x},b))}},{"./common":19,"./exception":21,"./mark":23,"./schema/default_full":26,"./schema/default_safe":27}], -23:[function(a,c,g){function e(a,b,e,c,l){this.name=a;this.buffer=b;this.position=e;this.line=c;this.column=l}var b=a("./common");e.prototype.getSnippet=function(a,d){var f,e;if(!this.buffer)return null;a=a||4;d=d||75;var c="";for(f=this.position;0d/2-1){c=" ... ";f+=5;break}var g="";for(e=this.position;e -d/2-1){g=" ... ";e-=5;break}d=this.buffer.slice(f,e);return b.repeat(" ",a)+c+d+g+"\n"+b.repeat(" ",a+this.position-f+c.length)+"^"};e.prototype.toString=function(a){var b="";this.name&&(b+='in "'+this.name+'" ');b+="at line "+(this.line+1)+", column "+(this.column+1);a||(a=this.getSnippet())&&(b+=":\n"+a);return b};c.exports=e},{"./common":19}],24:[function(a,c,g){function e(a,b,d){var f=[];a.include.forEach(function(a){d=e(a,b,d)});a[b].forEach(function(a){d.forEach(function(b,d){b.tag===a.tag&& -b.kind===a.kind&&f.push(d)});d.push(a)});return d.filter(function(a,b){return-1===f.indexOf(b)})}function b(){function a(a){b[a.kind][a.tag]=b.fallback[a.tag]=a}var b={scalar:{},sequence:{},mapping:{},fallback:{}},d;var f=0;for(d=arguments.length;fc)return!1;d+=6}}return 0===d%8},construct:function(a){var b,d=a.replace(/[\r\n=]/g,""),c=d.length;a=0;var k=[];for(b=0;b>16&255),k.push(a>>8&255),k.push(a&255)),a=a<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r".indexOf(d.charAt(b)); -b=c%4*6;0===b?(k.push(a>>16&255),k.push(a>>8&255),k.push(a&255)):18===b?(k.push(a>>10&255),k.push(a>>2&255)):12===b&&k.push(a>>4&255);return e?e.from?e.from(k):new e(k):k},predicate:function(a){return e&&e.isBuffer(a)},represent:function(a){var b="",d=0,e,c=a.length;for(e=0;e>18&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>>12&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>> -6&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d&63]),d=(d<<8)+a[e];a=c%3;0===a?(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>>18&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>>12&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>>6&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d&63]):2===a?(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>> -10&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>>4&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d<<2&63],b+="="):1===a&&(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d>>2&63],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"[d<<4&63],b+="==");return b}})},{"../type":30}],32:[function(a,c,g){a=a("../type");c.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(a){if(null=== -a)return!1;var b=a.length;return 4===b&&("true"===a||"True"===a||"TRUE"===a)||5===b&&("false"===a||"False"===a||"FALSE"===a)},construct:function(a){return"true"===a||"True"===a||"TRUE"===a},predicate:function(a){return"[object Boolean]"===Object.prototype.toString.call(a)},represent:{lowercase:function(a){return a?"true":"false"},uppercase:function(a){return a?"TRUE":"FALSE"},camelcase:function(a){return a?"True":"False"}},defaultStyle:"lowercase"})},{"../type":30}],33:[function(a,c,g){var e=a("../common"); -a=a("../type");var b=/^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,f=/^[-+]?[0-9]+e/;c.exports=new a("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(a){return null!==a&&b.test(a)&&"_"!==a[a.length-1]?!0:!1},construct:function(a){var b=a.replace(/_/g,"").toLowerCase();a="-"===b[0]?-1:1;var d=[];0<="+-".indexOf(b[0])&&(b=b.slice(1));if(".inf"===b)return 1=== -a?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(".nan"===b)return NaN;if(0<=b.indexOf(":")){b.split(":").forEach(function(a){d.unshift(parseFloat(a,10))});b=0;var f=1;d.forEach(function(a){b+=a*f;f*=60});return a*b}return a*parseFloat(b,10)},predicate:function(a){return"[object Number]"===Object.prototype.toString.call(a)&&(0!==a%1||e.isNegativeZero(a))},represent:function(a,b){if(isNaN(a))switch(b){case "lowercase":return".nan";case "uppercase":return".NAN";case "camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY=== -a)switch(b){case "lowercase":return".inf";case "uppercase":return".INF";case "camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===a)switch(b){case "lowercase":return"-.inf";case "uppercase":return"-.INF";case "camelcase":return"-.Inf"}else if(e.isNegativeZero(a))return"-0.0";a=a.toString(10);return f.test(a)?a.replace("e",".e"):a},defaultStyle:"lowercase"})},{"../common":19,"../type":30}],34:[function(a,c,g){var e=a("../common");a=a("../type");c.exports=new a("tag:yaml.org,2002:int",{kind:"scalar", -resolve:function(a){if(null===a)return!1;var b=a.length,d=0,e=!1;if(!b)return!1;var c=a[d];if("-"===c||"+"===c)c=a[++d];if("0"===c){if(d+1===b)return!0;c=a[++d];if("b"===c){for(d++;d=e||65<=e&&70>=e||97<=e&&102>=e))return!1;e=!0}return e&&"_"!==c}for(;d=e))return!1;e=!0}return e&&"_"!== -c}if("_"===c)return!1;for(;d=e))return!1;e=!0}return e&&"_"!==c?":"!==c?!0:/^(:[0-5]?[0-9])+$/.test(a.slice(d)):!1},construct:function(a){var b=a;a=1;var d=[];-1!==b.indexOf("_")&&(b=b.replace(/_/g,""));var e=b[0];if("-"===e||"+"===e)"-"===e&&(a=-1),b=b.slice(1),e=b[0];if("0"===b)return 0;if("0"===e)return"b"===b[1]?a*parseInt(b.slice(2),2):"x"===b[1]?a*parseInt(b,16):a*parseInt(b,8);if(-1!==b.indexOf(":")){b.split(":").forEach(function(a){d.unshift(parseInt(a, -10))});b=0;var c=1;d.forEach(function(a){b+=a*c;c*=60});return a*b}return a*parseInt(b,10)},predicate:function(a){return"[object Number]"===Object.prototype.toString.call(a)&&0===a%1&&!e.isNegativeZero(a)},represent:{binary:function(a){return 0<=a?"0b"+a.toString(2):"-0b"+a.toString(2).slice(1)},octal:function(a){return 0<=a?"0"+a.toString(8):"-0"+a.toString(8).slice(1)},decimal:function(a){return a.toString(10)},hexadecimal:function(a){return 0<=a?"0x"+a.toString(16).toUpperCase():"-0x"+a.toString(16).toUpperCase().slice(1)}}, -defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":19,"../type":30}],35:[function(a,c,g){try{var e=a("esprima")}catch(b){"undefined"!==typeof window&&(e=window.esprima)}a=a("../../type");c.exports=new a("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(a){if(null===a)return!1;try{var b=e.parse("("+a+")",{range:!0});return"Program"!==b.type||1!==b.body.length||"ExpressionStatement"!==b.body[0].type||"ArrowFunctionExpression"!== -b.body[0].expression.type&&"FunctionExpression"!==b.body[0].expression.type?!1:!0}catch(d){return!1}},construct:function(a){a="("+a+")";var b=e.parse(a,{range:!0}),d=[];if("Program"!==b.type||1!==b.body.length||"ExpressionStatement"!==b.body[0].type||"ArrowFunctionExpression"!==b.body[0].expression.type&&"FunctionExpression"!==b.body[0].expression.type)throw Error("Failed to resolve function");b.body[0].expression.params.forEach(function(a){d.push(a.name)});var c=b.body[0].expression.body.range;return"BlockStatement"=== -b.body[0].expression.body.type?new Function(d,a.slice(c[0]+1,c[1]-1)):new Function(d,"return "+a.slice(c[0],c[1]))},predicate:function(a){return"[object Function]"===Object.prototype.toString.call(a)},represent:function(a){return a.toString()}})},{"../../type":30}],36:[function(a,c,g){a=a("../../type");c.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(a){if(null===a||0===a.length)return!1;var b=/\/([gim]*)$/.exec(a),f="";return"/"===a[0]&&(b&&(f=b[1]),3d.length;)d+="0";d=+d}if(c[9]){f=+c[10];var r=+(c[11]||0);f=6E4*(60*f+r);"-"===c[9]&&(f=-f)}c=new Date(Date.UTC(a,l,g,p,q,m,d));f&&c.setTime(c.getTime()-f);return c},instanceOf:Date,represent:function(a){return a.toISOString()}})},{"../type":30}],47:[function(a,c,g){function e(a,f){var b=[],e= -[];null==f&&(f=function(a,d){return b[0]===d?"[Circular ~]":"[Circular ~."+e.slice(0,b.indexOf(d)).join(".")+"]"});return function(d,c){if(0e?void 0:h,e=1);for(d=Object(d);++ch))return!1;if((k= -p.get(a))&&p.get(c))return k==c;k=-1;var t=!0,u=g&2?new e:void 0;p.set(a,c);for(p.set(c,a);++ka)return!1; -a==d.length-1?d.pop():b.call(d,a,1);--this.size;return!0}},{"./_assocIndexOf":68}],132:[function(a,c,g){var e=a("./_assocIndexOf");c.exports=function(a){var b=this.__data__;a=e(b,a);return 0>a?void 0:b[a][1]}},{"./_assocIndexOf":68}],133:[function(a,c,g){var e=a("./_assocIndexOf");c.exports=function(a){return-1f?(++this.size,b.push([a,c])):b[f][1]=c; -return this}},{"./_assocIndexOf":68}],135:[function(a,c,g){var e=a("./_Hash"),b=a("./_ListCache"),f=a("./_Map");c.exports=function(){this.size=0;this.__data__={hash:new e,map:new (f||b),string:new e}}},{"./_Hash":49,"./_ListCache":50,"./_Map":51}],136:[function(a,c,g){var e=a("./_getMapData");c.exports=function(a){a=e(this,a)["delete"](a);this.size-=a?1:0;return a}},{"./_getMapData":110}],137:[function(a,c,g){var e=a("./_getMapData");c.exports=function(a){return e(this,a).get(a)}},{"./_getMapData":110}], -138:[function(a,c,g){var e=a("./_getMapData");c.exports=function(a){return e(this,a).has(a)}},{"./_getMapData":110}],139:[function(a,c,g){var e=a("./_getMapData");c.exports=function(a,c){var b=e(this,a),f=b.size;b.set(a,c);this.size+=b.size==f?0:1;return this}},{"./_getMapData":110}],140:[function(a,c,g){c.exports=function(a){var b=-1,c=Array(a.size);a.forEach(function(a,f){c[++b]=[f,a]});return c}},{}],141:[function(a,c,g){c.exports=function(a,b){return function(c){return null==c?!1:c[a]===b&&(void 0!== -b||a in Object(c))}}},{}],142:[function(a,c,g){var e=a("./memoize");c.exports=function(a){a=e(a,function(a){500===b.size&&b.clear();return a});var b=a.cache;return a}},{"./memoize":183}],143:[function(a,c,g){a=a("./_getNative")(Object,"create");c.exports=a},{"./_getNative":112}],144:[function(a,c,g){a=a("./_overArg")(Object.keys,Object);c.exports=a},{"./_overArg":147}],145:[function(a,c,g){a=a("./_freeGlobal");var e="object"==("undefined"===typeof g?"undefined":_typeof2(g))&&g&&!g.nodeType&&g;a=(g= -e&&"object"==("undefined"===typeof c?"undefined":_typeof2(c))&&c&&!c.nodeType&&c)&&g.exports===e&&a.process;a:{try{var b=g&&g.require&&g.require("util").types;if(b){var f=b;break a}f=a&&a.binding&&a.binding("util");break a}catch(d){}f=void 0}c.exports=f},{"./_freeGlobal":108}],146:[function(a,c,g){var e=Object.prototype.toString;c.exports=function(a){return e.call(a)}},{}],147:[function(a,c,g){c.exports=function(a,b){return function(c){return a(b(c))}}},{}],148:[function(a,c,g){var e=a("./_apply"), -b=Math.max;c.exports=function(a,d,c){d=b(void 0===d?a.length-1:d,0);return function(){for(var f=arguments,h=-1,g=b(f.length-d,0),p=Array(g);++hh.length)return h.push([a,c]),this.size=++d.size,this;d=this.__data__=new f(h)}d.set(a,c);this.size=d.size;return this}},{"./_ListCache":50,"./_Map":51,"./_MapCache":52}],160:[function(a,c,g){var e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/\\(\\)?/g;a=a("./_memoizeCapped")(function(a){var d=[];46===a.charCodeAt(0)&&d.push("");a.replace(e,function(a, -c,f,e){d.push(f?e.replace(b,"$1"):c||a)});return d});c.exports=a},{"./_memoizeCapped":142}],161:[function(a,c,g){var e=a("./isSymbol"),b=1/0;c.exports=function(a){if("string"==typeof a||e(a))return a;var d=a+"";return"0"==d&&1/a==-b?"-0":d}},{"./isSymbol":180}],162:[function(a,c,g){var e=Function.prototype.toString;c.exports=function(a){if(null!=a){try{return e.call(a)}catch(f){}return a+""}return""}},{}],163:[function(a,c,g){var e=a("./_assignValue"),b=a("./_copyObject");g=a("./_createAssigner"); -var f=a("./isArrayLike"),d=a("./_isPrototype"),h=a("./keys"),k=Object.prototype.hasOwnProperty;a=g(function(a,c){if(d(c)||f(c))b(c,h(c),a);else for(var g in c)k.call(c,g)&&e(a,g,c[g])});c.exports=a},{"./_assignValue":67,"./_copyObject":99,"./_createAssigner":101,"./_isPrototype":128,"./isArrayLike":173,"./keys":182}],164:[function(a,c,g){c.exports=function(a){return function(){return a}}},{}],165:[function(a,c,g){var e=a("./_baseAssign"),b=a("./_baseCreate");c.exports=function(a,d){a=b(a);return null== -d?a:e(a,d)}},{"./_baseAssign":69,"./_baseCreate":71}],166:[function(a,c,g){c.exports=function(a,b){return a===b||a!==a&&b!==b}},{}],167:[function(a,c,g){var e=a("./_arrayEvery"),b=a("./_baseEvery"),f=a("./_baseIteratee"),d=a("./isArray"),h=a("./_isIterateeCall");c.exports=function(a,c,g){var k=d(a)?e:b;g&&h(a,c,g)&&(c=void 0);return k(a,f(c,3))}},{"./_arrayEvery":61,"./_baseEvery":73,"./_baseIteratee":86,"./_isIterateeCall":124,"./isArray":172}],168:[function(a,c,g){var e=a("./_baseGet");c.exports= -function(a,c,d){a=null==a?void 0:e(a,c);return void 0===a?d:a}},{"./_baseGet":76}],169:[function(a,c,g){var e=a("./_baseHasIn"),b=a("./_hasPath");c.exports=function(a,d){return null!=a&&b(a,d,e)}},{"./_baseHasIn":79,"./_hasPath":117}],170:[function(a,c,g){c.exports=function(a){return a}},{}],171:[function(a,c,g){g=a("./_baseIsArguments");var e=a("./isObjectLike");a=Object.prototype;var b=a.hasOwnProperty,f=a.propertyIsEnumerable;a=g(function(){return arguments}())?g:function(a){return e(a)&&b.call(a, -"callee")&&!f.call(a,"callee")};c.exports=a},{"./_baseIsArguments":80,"./isObjectLike":179}],172:[function(a,c,g){c.exports=Array.isArray},{}],173:[function(a,c,g){var e=a("./isFunction"),b=a("./isLength");c.exports=function(a){return null!=a&&b(a.length)&&!e(a)}},{"./isFunction":176,"./isLength":177}],174:[function(a,c,g){var e=a("./_root");a=a("./stubFalse");var b=(g="object"==("undefined"===typeof g?"undefined":_typeof2(g))&&g&&!g.nodeType&&g)&&"object"==("undefined"===typeof c?"undefined":_typeof2(c))&& -c&&!c.nodeType&&c;e=b&&b.exports===g?e.Buffer:void 0;c.exports=(e?e.isBuffer:void 0)||a},{"./_root":149,"./stubFalse":186}],175:[function(a,c,g){var e=a("./_baseKeys"),b=a("./_getTag"),f=a("./isArguments"),d=a("./isArray"),h=a("./isArrayLike"),k=a("./isBuffer"),l=a("./_isPrototype"),n=a("./isTypedArray"),p=Object.prototype.hasOwnProperty;c.exports=function(a){if(null==a)return!0;if(h(a)&&(d(a)||"string"==typeof a||"function"==typeof a.splice||k(a)||n(a)||f(a)))return!a.length;var c=b(a);if("[object Map]"== -c||"[object Set]"==c)return!a.size;if(l(a))return!e(a).length;for(var g in a)if(p.call(a,g))return!1;return!0}},{"./_baseKeys":87,"./_getTag":115,"./_isPrototype":128,"./isArguments":171,"./isArray":172,"./isArrayLike":173,"./isBuffer":174,"./isTypedArray":181}],176:[function(a,c,g){var e=a("./_baseGetTag"),b=a("./isObject");c.exports=function(a){if(!b(a))return!1;a=e(a);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a}},{"./_baseGetTag":78, -"./isObject":178}],177:[function(a,c,g){c.exports=function(a){return"number"==typeof a&&-1=a}},{}],178:[function(a,c,g){c.exports=function(a){var b="undefined"===typeof a?"undefined":_typeof2(a);return null!=a&&("object"==b||"function"==b)}},{}],179:[function(a,c,g){c.exports=function(a){return null!=a&&"object"==("undefined"===typeof a?"undefined":_typeof2(a))}},{}],180:[function(a,c,g){var e=a("./_baseGetTag"),b=a("./isObjectLike");c.exports=function(a){return"symbol"== -("undefined"===typeof a?"undefined":_typeof2(a))||b(a)&&"[object Symbol]"==e(a)}},{"./_baseGetTag":78,"./isObjectLike":179}],181:[function(a,c,g){g=a("./_baseIsTypedArray");var e=a("./_baseUnary");g=(a=(a=a("./_nodeUtil"))&&a.isTypedArray)?e(a):g;c.exports=g},{"./_baseIsTypedArray":85,"./_baseUnary":96,"./_nodeUtil":145}],182:[function(a,c,g){var e=a("./_arrayLikeKeys"),b=a("./_baseKeys"),f=a("./isArrayLike");c.exports=function(a){return f(a)?e(a):b(a)}},{"./_arrayLikeKeys":63,"./_baseKeys":87,"./isArrayLike":173}], -183:[function(a,c,g){function e(a,d){if("function"!=typeof a||null!=d&&"function"!=typeof d)throw new TypeError("Expected a function");var c=function l(){var b=arguments,c=d?d.apply(this,b):b[0],f=l.cache;if(f.has(c))return f.get(c);b=a.apply(this,b);l.cache=f.set(c,b)||f;return b};c.cache=new (e.Cache||b);return c}var b=a("./_MapCache");e.Cache=b;c.exports=e},{"./_MapCache":52}],184:[function(a,c,g){var e=a("./_baseProperty"),b=a("./_basePropertyDeep"),f=a("./_isKey"),d=a("./_toKey");c.exports=function(a){return f(a)? -e(d(a)):b(a)}},{"./_baseProperty":90,"./_basePropertyDeep":91,"./_isKey":125,"./_toKey":161}],185:[function(a,c,g){c.exports=function(){return[]}},{}],186:[function(a,c,g){c.exports=function(){return!1}},{}],187:[function(a,c,g){var e=a("./_baseToString");c.exports=function(a){return null==a?"":e(a)}},{"./_baseToString":95}],188:[function(a,c,g){(function(a){function b(b,d,c,e){if("function"!==typeof b)throw new TypeError('"callback" argument must be a function');var f=arguments.length;switch(f){case 0:case 1:return a.nextTick(b); -case 2:return a.nextTick(function(){b.call(null,d)});case 3:return a.nextTick(function(){b.call(null,d,c)});case 4:return a.nextTick(function(){b.call(null,d,c,e)});default:var h=Array(f-1);for(f=0;f=a||0===b.length&&b.ended)return 0;if(b.objectMode)return 1;if(a!==a)return b.flowing&&b.length?b.buffer.head.data.length:b.length;if(a>b.highWaterMark){var d=a;8388608<=d?d=8388608:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++);b.highWaterMark=d}return a<=b.length?a:b.ended?b.length:(b.needReadable=!0,0)}function p(a){var b=a._readableState;b.needReadable= -!1;b.emittedReadable||(x("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?y.nextTick(q,a):q(a))}function q(a){x("emit readable");a.emit("readable");v(a)}function m(a,b){for(var d=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length=b.length)d=b.decoder?b.buffer.join(""):1===b.buffer.length?b.buffer.head.data:b.buffer.concat(b.length), -b.buffer.clear();else{d=b.buffer;b=b.decoder;if(ae.length?e.length:a;f=h===e.length?f+e:f+e.slice(0,a);a-=h;if(0===a){h===e.length?(++c,d.head=b.next?b.next:d.tail=null):(d.head=b,b.data=e.slice(h));break}++c}d.length-=c;d=f}else{b=H.allocUnsafe(a);c=d.head;f=1;c.data.copy(b);for(a-=c.data.length;c= -c.next;){e=c.data;h=a>e.length?e.length:a;e.copy(b,b.length-a,0,h);a-=h;if(0===a){h===e.length?(++f,d.head=c.next?c.next:d.tail=null):(d.head=c,c.data=e.slice(h));break}++f}d.length-=f;d=b}b=d}d=b}return d}function B(a){var b=a._readableState;if(0=b.highWaterMark||b.ended))return x("read: emitReadable",b.length,b.ended), -0===b.length&&b.ended?B(this):p(this),null;a=n(a,b);if(0===a&&b.ended)return 0===b.length&&B(this),null;var c=b.needReadable;x("need readable",c);if(0===b.length||b.length-a>>0);for(var b=this.head,d=0;b;)b.data.copy(a,d),d+=b.data.length,b=b.next;return a};return a}();b&&b.inspect&&b.inspect.custom&&(c.exports.prototype[b.inspect.custom]=function(){var a=b.inspect({length:this.length});return this.constructor.name+" "+a})},{"safe-buffer":203, -util:7}],197:[function(a,c,g){function e(a,b){a.emit("error",b)}var b=a("process-nextick-args");c.exports={destroy:function(a,d){var c=this,f=this._writableState&&this._writableState.destroyed;if(this._readableState&&this._readableState.destroyed||f)return d?d(a):!a||this._writableState&&this._writableState.errorEmitted||b.nextTick(e,this,a),this;this._readableState&&(this._readableState.destroyed=!0);this._writableState&&(this._writableState.destroyed=!0);this._destroy(a||null,function(a){!d&&a? -(b.nextTick(e,c,a),c._writableState&&(c._writableState.errorEmitted=!0)):d&&d(a)});return this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1);this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":188}],198:[function(a,c, -g){c.exports=a("events").EventEmitter},{events:11}],199:[function(a,c,g){c.exports=a("./readable").PassThrough},{"./readable":200}],200:[function(a,c,g){g=c.exports=a("./lib/_stream_readable.js");g.Stream=g;g.Readable=g;g.Writable=a("./lib/_stream_writable.js");g.Duplex=a("./lib/_stream_duplex.js");g.Transform=a("./lib/_stream_transform.js");g.PassThrough=a("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":191,"./lib/_stream_passthrough.js":192,"./lib/_stream_readable.js":193,"./lib/_stream_transform.js":194, -"./lib/_stream_writable.js":195}],201:[function(a,c,g){c.exports=a("./readable").Transform},{"./readable":200}],202:[function(a,c,g){c.exports=a("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":195}],203:[function(a,c,g){function e(a,b){for(var d in a)b[d]=a[d]}function b(a,b,c){return d(a,b,c)}var f=a("buffer"),d=f.Buffer;d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?c.exports=f:(e(f,g),g.Buffer=b);e(d,b);b.from=function(a,b,c){if("number"===typeof a)throw new TypeError("Argument must not be a number"); -return d(a,b,c)};b.alloc=function(a,b,c){if("number"!==typeof a)throw new TypeError("Argument must be a number");a=d(a);void 0!==b?"string"===typeof c?a.fill(b,c):a.fill(b):a.fill(0);return a};b.allocUnsafe=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return d(a)};b.allocUnsafeSlow=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return f.SlowBuffer(a)}},{buffer:8}],204:[function(a,c,g){function e(){b.call(this)}c.exports=e; -var b=a("events").EventEmitter;a("inherits")(e,b);e.Readable=a("readable-stream/readable.js");e.Writable=a("readable-stream/writable.js");e.Duplex=a("readable-stream/duplex.js");e.Transform=a("readable-stream/transform.js");e.PassThrough=a("readable-stream/passthrough.js");e.Stream=e;e.prototype.pipe=function(a,d){function c(b){a.writable&&!1===a.write(b)&&m.pause&&m.pause()}function e(){m.readable&&m.resume&&m.resume()}function f(){r||(r=!0,a.end())}function g(){r||(r=!0,"function"===typeof a.destroy&& -a.destroy())}function p(a){q();if(0===b.listenerCount(this,"error"))throw a;}function q(){m.removeListener("data",c);a.removeListener("drain",e);m.removeListener("end",f);m.removeListener("close",g);m.removeListener("error",p);a.removeListener("error",p);m.removeListener("end",q);m.removeListener("close",q);a.removeListener("close",q)}var m=this;m.on("data",c);a.on("drain",e);a._isStdio||d&&!1===d.end||(m.on("end",f),m.on("close",g));var r=!1;m.on("error",p);a.on("error",p);m.on("end",q);m.on("close", -q);a.on("close",q);a.emit("pipe",m);return a}},{events:11,inherits:14,"readable-stream/duplex.js":190,"readable-stream/passthrough.js":199,"readable-stream/readable.js":200,"readable-stream/transform.js":201,"readable-stream/writable.js":202}],205:[function(a,c,g){function e(a){if(!a)return"utf8";for(var b;;)switch(a){case "utf8":case "utf-8":return"utf8";case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return"utf16le";case "latin1":case "binary":return"latin1";case "base64":case "ascii":case "hex":return a; -default:if(b)return;a=(""+a).toLowerCase();b=!0}}function b(a){var b=e(a);if("string"!==typeof b&&(r.isEncoding===t||!t(a)))throw Error("Unknown encoding: "+a);this.encoding=b||a;switch(this.encoding){case "utf16le":this.text=k;this.end=l;a=4;break;case "utf8":this.fillLast=h;a=4;break;case "base64":this.text=n;this.end=p;a=3;break;default:this.write=q;this.end=m;return}this.lastTotal=this.lastNeed=0;this.lastChar=r.allocUnsafe(a)}function f(a){return 127>=a?0:6===a>>5?2:14===a>>4?3:30===a>>3?4:2=== -a>>6?-1:-2}function d(a,b,d){var c=b.length-1;if(c=d)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],b.slice(0, --1)}return b}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=a[a.length-1];return a.toString("utf16le",b,a.length-1)}function l(a){a=a&&a.length?this.write(a):"";return this.lastNeed?a+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):a}function n(a,b){var d=(a.length-b)%3;if(0===d)return a.toString("base64",b);this.lastNeed=3-d;this.lastTotal=3;1===d?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]);return a.toString("base64",b,a.length- -d)}function p(a){a=a&&a.length?this.write(a):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function q(a){return a.toString(this.encoding)}function m(a){return a&&a.length?this.write(a):""}var r=a("safe-buffer").Buffer,t=r.isEncoding||function(a){a=""+a;switch(a&&a.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}};g.StringDecoder= -b;b.prototype.write=function(a){if(0===a.length)return"";if(this.lastNeed){var b=this.fillLast(a);if(void 0===b)return"";var d=this.lastNeed;this.lastNeed=0}else d=0;return dthis.planEnd,a||d)&&(this.ok=!1,b.tapError=a?"id less than plan start":"id greater than plan end",this.failures.push(b));this.sawValidTap=!0;if(b.id){if(!this.first||b.idthis.last)this.last=b.id}this.current=b}else this.nonTap(a);else this.emitComment(a)}}}}).call(this,a("_process"), -a("buffer").Buffer)},{_process:189,assert:5,buffer:8,"js-yaml":17,"readable-stream":200,stream:204,util:216}],207:[function(a,c,g){var e=a("tap-parser"),b=a("through2"),f=a("duplexer"),d=a("xtend"),h=a("./serialize");c.exports=function(a){function c(a){r.push({id:r.length,extra:[],asserts:[],testName:g(a)});return r[r.length-1]}function g(b){a.replaceWithUnicodeDot&&(b=b.replace(/\./g,"\uff0e"));a.package&&(b=a.package+"."+b);0===b.indexOf("#")&&(b=b.substr(1));return b.trim()}a=d(k,a);var l=b(), -m=e();m.strict=a.strict;var r=[],t,u=!1,v=0,w=!1;m.on("comment",function(b){a.dontUseCommentsAsTestNames||u||(t=c(b))});m.on("plan",function(){w=!0});m.on("assert",function(a){t||(t=c("Default"));t.asserts.push(a)});m.on("extra",function(a){t&&t.extra.push(a)});m.on("extra",function(a){});m.on("plan",function(a){u=!0});m.on("complete",function(a){t&&!r.filter(function(a){return a.id===t.id}).length&&r.push(t);a.failures&&a.failures.forEach(function(a){a.tapError&&(a=Error("TAP parse error: "+a.tapError), -v=1,l.emit("error",a))});r.forEach(function(a){a.asserts.forEach(function(a){a.skip=a.skip||a.todo;a.ok||a.skip||(v=1)})});m.sawValidTap&&w?(a=h(r),l.push(a+"\n")):v=1;B.exitCode=v;l.emit("end")});var B=f(m,l);return B};var k={dontUseCommentsAsTestNames:!1,replaceWithUnicodeDot:!1,package:"",strict:!1}},{"./serialize":209,duplexer:10,"tap-parser":206,through2:210,xtend:234}],208:[function(a,c,g){var e=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm;c.exports=function(a){return a.replace(e, -"")}},{}],209:[function(a,c,g){function e(a){var b="\n ---\n",d;for(d in a)if(a.hasOwnProperty(d)&&void 0!==a[d]){var c=a[d];b+=" "+d+": "+("object"===("undefined"===typeof c?"undefined":_typeof2(c))?JSON.stringify(c):c)+"\n"}return b+" ...\n "}var b=a("xmlbuilder"),f=a("./sanitize-string");c.exports=function(a){var d=b.create("testsuites");a.forEach(function(a){var b=d.ele("testsuite"),c,h;b.att("tests",a.asserts.length);(c=a.asserts.filter(function(a){return a.skip}).length)&& -b.att("skipped",c);b.att("failures",a.asserts.filter(function(a){return!a.ok&&!a.skip}).length);b.att("errors","0");b.att("name",a.testName||"");a.asserts.forEach(function(d,c){var g=b.ele("testcase",{name:"#"+d.id+" "+d.name});d.skip&&g.ele("skipped");d.ok||d.skip||(h=g.ele("failure"),d.diag&&h.txt(e(d.diag)));c===a.asserts.length-1&&a.extra.forEach(function(a){g.ele("system-out",f(a))})})});return d.end({pretty:!0,indent:" ",newline:"\n"})}},{"./sanitize-string":208,xmlbuilder:233}],210:[function(a, -c,g){(function(e){function b(a){h.call(this,a);this._destroyed=!1}function f(a,b,d){d(null,a)}function d(a){return function(b,d,c){"function"==typeof b&&(c=d,d=b,b={});"function"!=typeof d&&(d=f);"function"!=typeof c&&(c=null);return a(b,d,c)}}var h=a("readable-stream/transform"),g=a("util").inherits,l=a("xtend");g(b,h);b.prototype.destroy=function(a){if(!this._destroyed){this._destroyed=!0;var b=this;e.nextTick(function(){a&&b.emit("error",a);b.emit("close")})}};c.exports=d(function(a,d,c){a=new b(a); -a._transform=d;c&&(a._flush=c);return a});c.exports.ctor=d(function(a,d,c){function e(d){if(!(this instanceof e))return new e(d);this.options=l(a,d);b.call(this,this.options)}g(e,b);e.prototype._transform=d;c&&(e.prototype._flush=c);return e});c.exports.obj=d(function(a,d,c){a=new b(l({objectMode:!0,highWaterMark:16},a));a._transform=d;c&&(a._flush=c);return a})}).call(this,a("_process"))},{_process:189,"readable-stream/transform":201,util:216,xtend:234}],211:[function(a,c,g){(function(c,b){function e(a, -b){this._id=a;this._clearFn=b}var d=a("process/browser.js").nextTick,h=Function.prototype.apply,k=Array.prototype.slice,l={},n=0;g.setTimeout=function(){return new e(h.call(setTimeout,window,arguments),clearTimeout)};g.setInterval=function(){return new e(h.call(setInterval,window,arguments),clearInterval)};g.clearTimeout=g.clearInterval=function(a){a.close()};e.prototype.unref=e.prototype.ref=function(){};e.prototype.close=function(){this._clearFn.call(window,this._id)};g.enroll=function(a,b){clearTimeout(a._idleTimeoutId); -a._idleTimeout=b};g.unenroll=function(a){clearTimeout(a._idleTimeoutId);a._idleTimeout=-1};g._unrefActive=g.active=function(a){clearTimeout(a._idleTimeoutId);var b=a._idleTimeout;0<=b&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},b))};g.setImmediate="function"===typeof c?c:function(a){var b=n++,c=2>arguments.length?!1:k.call(arguments,1);l[b]=!0;d(function(){l[b]&&(c?a.apply(null,c):a.call(null),g.clearImmediate(b))});return b};g.clearImmediate="function"===typeof b?b:function(a){delete l[a]}}).call(this, -a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":189,timers:211}],212:[function(a,c,g){(function(a){function b(b){try{if(!a.localStorage)return!1}catch(d){return!1}b=a.localStorage[b];return null==b?!1:"true"===String(b).toLowerCase()}c.exports=function(a,d){if(b("noDeprecation"))return a;var c=!1;return function(){if(!c){if(b("throwDeprecation"))throw Error(d);b("traceDeprecation")?console.trace(d):console.warn(d);c=!0}return a.apply(this,arguments)}}}).call(this,"undefined"!== -typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],213:[function(a,c,g){c.exports=function(a){return a&&"object"===("undefined"===typeof a?"undefined":_typeof2(a))&&"function"===typeof a.copy&&"function"===typeof a.fill&&"function"===typeof a.readUInt8}},{}],214:[function(a,c,g){(function(c,b){function e(a,b){var c={seen:[],stylize:h};3<=arguments.length&&(c.depth=arguments[2]);4<=arguments.length&&(c.colors=arguments[3]);u(b)?c.showHidden=b:b&&g._extend(c, -b);B(c.showHidden)&&(c.showHidden=!1);B(c.depth)&&(c.depth=2);B(c.colors)&&(c.colors=!1);B(c.customInspect)&&(c.customInspect=!0);c.colors&&(c.stylize=d);return l(c,a,c.depth)}function d(a,b){return(b=e.styles[b])?"\u001b["+e.colors[b][0]+"m"+a+"\u001b["+e.colors[b][1]+"m":a}function h(a,b){return a}function k(a){var b={};a.forEach(function(a,d){b[a]=!0});return b}function l(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==g.inspect&&(!b.constructor||b.constructor.prototype!==b)){var c=b.inspect(d, -a);w(c)||(c=l(a,c,d));return c}if(c=n(a,b))return c;var e=Object.keys(b),f=k(e);a.showHidden&&(e=Object.getOwnPropertyNames(b));if(J(b)&&(0<=e.indexOf("message")||0<=e.indexOf("description")))return p(b);if(0===e.length){if(A(b))return a.stylize("[Function"+(b.name?": "+b.name:"")+"]","special");if(G(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(J(b))return p(b)}c="";var h=!1,u=["{","}"];t(b)&&(h=!0,u=["[","]"]); -A(b)&&(c=" [Function"+(b.name?": "+b.name:"")+"]");G(b)&&(c=" "+RegExp.prototype.toString.call(b));y(b)&&(c=" "+Date.prototype.toUTCString.call(b));J(b)&&(c=" "+p(b));if(0===e.length&&(!h||0==b.length))return u[0]+c+u[1];if(0>d)return G(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);e=h?q(a,b,d,f,e):e.map(function(c){return m(a,b,d,f,c,h)});a.seen.pop();return r(e,c,u)}function n(a,b){if(B(b))return a.stylize("undefined","undefined");if(w(b))return b= -"'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",a.stylize(b,"string");if(v(b))return a.stylize(""+b,"number");if(u(b))return a.stylize(""+b,"boolean");if(null===b)return a.stylize("null","null")}function p(a){return"["+Error.prototype.toString.call(a)+"]"}function q(a,b,d,c,e){for(var f=[],h=0,g=b.length;ha.seen.indexOf(b.value)?(g=null===d?l(a,b.value,null):l(a,b.value,d-1),-1a?"0"+a.toString(10):a.toString(10)}function H(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),Q[a.getMonth()],b].join(" ")}var I=/%[sdj%]/g;g.format=function(a){if(!w(a)){for(var b=[],d=0;d=f)return a;switch(a){case "%s":return String(c[d++]);case "%d":return Number(c[d++]);case "%j":try{return JSON.stringify(c[d++])}catch(S){return"[Circular]"}default:return a}});for(var h=c[d];d";g&&(c+=a);return c};return a}()}).call(this)},{"lodash/create":165}], -223:[function(a,c,g){(function(){a("lodash/create");var e=a("lodash/isObject");c.exports=function(){function a(a,b,c,g){this.stringify=a.stringify;if(null==c)throw Error("Missing entity name");if(null==g)throw Error("Missing entity value");this.pe=!!b;this.name=this.stringify.eleName(c);if(e(g)){if(!g.pubID&&!g.sysID)throw Error("Public and/or system identifiers are required for an external entity");if(g.pubID&&!g.sysID)throw Error("System identifier is required for a public external entity");null!= -g.pubID&&(this.pubID=this.stringify.dtdPubID(g.pubID));null!=g.sysID&&(this.sysID=this.stringify.dtdSysID(g.sysID));null!=g.nData&&(this.nData=this.stringify.dtdNData(g.nData));if(this.pe&&this.nData)throw Error("Notation declaration is not allowed in a parameter entity");}else this.value=this.stringify.dtdEntityValue(g)}a.prototype.toString=function(a,b){var d,c,e;var f=(null!=a?a.pretty:void 0)||!1;var g=null!=(d=null!=a?a.indent:void 0)?d:" ";d=null!=(c=null!=a?a.offset:void 0)?c:0;a=null!=(e= -null!=a?a.newline:void 0)?e:"\n";b||(b=0);g=Array(b+d+1).join(g);b="";f&&(b+=g);b+="";f&&(b+=a);return b};return a}()}).call(this)},{"lodash/create":165,"lodash/isObject":178}],224:[function(a,c,g){(function(){a("lodash/create");c.exports=function(){function a(a, -c,d){this.stringify=a.stringify;if(null==c)throw Error("Missing notation name");if(!d.pubID&&!d.sysID)throw Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(c);null!=d.pubID&&(this.pubID=this.stringify.dtdPubID(d.pubID));null!=d.sysID&&(this.sysID=this.stringify.dtdSysID(d.sysID))}a.prototype.toString=function(a,c){var b,e,f;var g=(null!=a?a.pretty:void 0)||!1;var n=null!=(b=null!=a?a.indent:void 0)?b:" ";b=null!=(e=null!=a?a.offset:void 0)? -e:0;a=null!=(f=null!=a?a.newline:void 0)?f:"\n";c||(c=0);n=Array(c+b+1).join(n);c="";g&&(c+=n);c+="";g&&(c+=a);return c};return a}()}).call(this)},{"lodash/create":165}],225:[function(a,c,g){(function(){var e=function(a,d){function c(){this.constructor=a}for(var e in d)b.call(d,e)&&(a[e]=d[e]);c.prototype=d.prototype; -a.prototype=new c;a.__super__=d.prototype;return a},b={}.hasOwnProperty;a("lodash/create");var f=a("lodash/isObject");var d=a("./XMLNode");c.exports=function(a){function b(a,d,c,e){b.__super__.constructor.call(this,a);f(d)&&(a=d,d=a.version,c=a.encoding,e=a.standalone);d||(d="1.0");this.version=this.stringify.xmlVersion(d);null!=c&&(this.encoding=this.stringify.xmlEncoding(c));null!=e&&(this.standalone=this.stringify.xmlStandalone(e))}e(b,a);b.prototype.toString=function(a,b){var d,c,e;var f=(null!= -a?a.pretty:void 0)||!1;var g=null!=(d=null!=a?a.indent:void 0)?d:" ";d=null!=(c=null!=a?a.offset:void 0)?c:0;a=null!=(e=null!=a?a.newline:void 0)?e:"\n";b||(b=0);g=Array(b+d+1).join(g);b="";f&&(b+=g);b=b+"";f&&(b+=a);return b};return b}(d)}).call(this)},{"./XMLNode":228,"lodash/create":165,"lodash/isObject":178}],226:[function(a,c, -g){(function(){a("lodash/create");var e=a("lodash/isObject");var b=a("./XMLCData");var f=a("./XMLComment");var d=a("./XMLDTDAttList");var g=a("./XMLDTDEntity");var k=a("./XMLDTDElement");var l=a("./XMLDTDNotation");var n=a("./XMLProcessingInstruction");c.exports=function(){function a(a,b,d){this.documentObject=a;this.stringify=this.documentObject.stringify;this.children=[];e(b)&&(d=b,b=d.pubID,d=d.sysID);null==d&&(b=[b,d],d=b[0],b=b[1]);null!=b&&(this.pubID=this.stringify.dtdPubID(b));null!=d&&(this.sysID= -this.stringify.dtdSysID(d))}a.prototype.element=function(a,b){a=new k(this,a,b);this.children.push(a);return this};a.prototype.attList=function(a,b,c,e,f){a=new d(this,a,b,c,e,f);this.children.push(a);return this};a.prototype.entity=function(a,b){a=new g(this,!1,a,b);this.children.push(a);return this};a.prototype.pEntity=function(a,b){a=new g(this,!0,a,b);this.children.push(a);return this};a.prototype.notation=function(a,b){a=new l(this,a,b);this.children.push(a);return this};a.prototype.cdata=function(a){a= -new b(this,a);this.children.push(a);return this};a.prototype.comment=function(a){a=new f(this,a);this.children.push(a);return this};a.prototype.instruction=function(a,b){a=new n(this,a,b);this.children.push(a);return this};a.prototype.root=function(){return this.documentObject.root()};a.prototype.document=function(){return this.documentObject};a.prototype.toString=function(a,b){var d,c,e,f;var g=(null!=a?a.pretty:void 0)||!1;var h=null!=(c=null!=a?a.indent:void 0)?c:" ";c=null!=(f=null!=a?a.offset: -void 0)?f:0;f=null!=(d=null!=a?a.newline:void 0)?d:"\n";b||(b=0);d=Array(b+c+1).join(h);h="";g&&(h+=d);h+="";g&&(h+=f);return h};a.prototype.ele=function(a,b){return this.element(a,b)};a.prototype.att=function(a,b,d,c,e){return this.attList(a, -b,d,c,e)};a.prototype.ent=function(a,b){return this.entity(a,b)};a.prototype.pent=function(a,b){return this.pEntity(a,b)};a.prototype.not=function(a,b){return this.notation(a,b)};a.prototype.dat=function(a){return this.cdata(a)};a.prototype.com=function(a){return this.comment(a)};a.prototype.ins=function(a,b){return this.instruction(a,b)};a.prototype.up=function(){return this.root()};a.prototype.doc=function(){return this.document()};return a}()}).call(this)},{"./XMLCData":219,"./XMLComment":220, -"./XMLDTDAttList":221,"./XMLDTDElement":222,"./XMLDTDEntity":223,"./XMLDTDNotation":224,"./XMLProcessingInstruction":229,"lodash/create":165,"lodash/isObject":178}],227:[function(a,c,g){(function(){var e=function(a,d){function c(){this.constructor=a}for(var e in d)b.call(d,e)&&(a[e]=d[e]);c.prototype=d.prototype;a.prototype=new c;a.__super__=d.prototype;return a},b={}.hasOwnProperty;var f=a("lodash/create");var d=a("lodash/isObject");var g=a("lodash/isFunction");var k=a("lodash/every");var l=a("./XMLNode"); -var n=a("./XMLAttribute");var p=a("./XMLProcessingInstruction");c.exports=function(a){function c(a,b,d){c.__super__.constructor.call(this,a);if(null==b)throw Error("Missing element name");this.name=this.stringify.eleName(b);this.children=[];this.instructions=[];this.attributes={};null!=d&&this.attribute(d)}e(c,a);c.prototype.clone=function(){var a;var d=f(c.prototype,this);d.isRoot&&(d.documentObject=null);d.attributes={};var e=this.attributes;for(a in e)if(b.call(e,a)){var g=e[a];d.attributes[a]= -g.clone()}d.instructions=[];var h=this.instructions;g=0;for(a=h.length;g"+this.children[0].value,l+="",l+=f;else{l+=">";h&&(l+=f);e=this.children;c=0;for(m=e.length;c";h&&(l+=f)}return l};c.prototype.att=function(a,b){return this.attribute(a,b)};c.prototype.ins=function(a,b){return this.instruction(a,b)};c.prototype.a=function(a,b){return this.attribute(a,b)};c.prototype.i=function(a, -b){return this.instruction(a,b)};return c}(l)}).call(this)},{"./XMLAttribute":217,"./XMLNode":228,"./XMLProcessingInstruction":229,"lodash/create":165,"lodash/every":167,"lodash/isFunction":176,"lodash/isObject":178}],228:[function(a,c,g){(function(){var e,b,f,d,g,k,l={}.hasOwnProperty;var n=a("lodash/isObject");var p=a("lodash/isFunction");var q=a("lodash/isEmpty");var m=k=d=f=b=e=g=null;c.exports=function(){function c(c){this.parent=c;this.options=this.parent.options;this.stringify=this.parent.stringify; -null===g&&(g=a("./XMLElement"),e=a("./XMLCData"),b=a("./XMLComment"),f=a("./XMLDeclaration"),d=a("./XMLDocType"),k=a("./XMLRaw"),m=a("./XMLText"))}c.prototype.element=function(a,b,d){var c=null;null==b&&(b={});b=b.valueOf();n(b)||(b=[b,d],d=b[0],b=b[1]);null!=a&&(a=a.valueOf());if(Array.isArray(a)){var e=0;for(d=a.length;ea)throw Error("Already at the first node");return this.parent.children[a-1]};c.prototype.next=function(){if(this.isRoot)throw Error("Root node has no siblings");var a=this.parent.children.indexOf(this);if(-1===a||a===this.parent.children.length-1)throw Error("Already at the last node");return this.parent.children[a+1]};c.prototype.importXMLBuilder=function(a){a=a.root().clone();a.parent=this;a.isRoot=!1;this.children.push(a);return this};c.prototype.ele= -function(a,b,d){return this.element(a,b,d)};c.prototype.nod=function(a,b,d){return this.node(a,b,d)};c.prototype.txt=function(a){return this.text(a)};c.prototype.dat=function(a){return this.cdata(a)};c.prototype.com=function(a){return this.comment(a)};c.prototype.doc=function(){return this.document()};c.prototype.dec=function(a,b,d){return this.declaration(a,b,d)};c.prototype.dtd=function(a,b){return this.doctype(a,b)};c.prototype.e=function(a,b,d){return this.element(a,b,d)};c.prototype.n=function(a, -b,d){return this.node(a,b,d)};c.prototype.t=function(a){return this.text(a)};c.prototype.d=function(a){return this.cdata(a)};c.prototype.c=function(a){return this.comment(a)};c.prototype.r=function(a){return this.raw(a)};c.prototype.u=function(){return this.up()};return c}()}).call(this)},{"./XMLCData":219,"./XMLComment":220,"./XMLDeclaration":225,"./XMLDocType":226,"./XMLElement":227,"./XMLRaw":230,"./XMLText":232,"lodash/isEmpty":175,"lodash/isFunction":176,"lodash/isObject":178}],229:[function(a, -c,g){(function(){var e=a("lodash/create");c.exports=function(){function a(a,b,c){this.stringify=a.stringify;if(null==b)throw Error("Missing instruction target");this.target=this.stringify.insTarget(b);c&&(this.value=this.stringify.insValue(c))}a.prototype.clone=function(){return e(a.prototype,this)};a.prototype.toString=function(a,b){var d,c,e;var f=(null!=a?a.pretty:void 0)||!1;var g=null!=(d=null!=a?a.indent:void 0)?d:" ";d=null!=(c=null!=a?a.offset:void 0)?c:0;a=null!=(e=null!=a?a.newline:void 0)? -e:"\n";b||(b=0);g=Array(b+d+1).join(g);b="";f&&(b+=g);b=b+"";f&&(b+=a);return b};return a}()}).call(this)},{"lodash/create":165}],230:[function(a,c,g){(function(){var e=function(a,d){function c(){this.constructor=a}for(var e in d)b.call(d,e)&&(a[e]=d[e]);c.prototype=d.prototype;a.prototype=new c;a.__super__=d.prototype;return a},b={}.hasOwnProperty;var f=a("lodash/create");var d=a("./XMLNode");c.exports=function(a){function b(a,d){b.__super__.constructor.call(this, -a);if(null==d)throw Error("Missing raw text");this.value=this.stringify.raw(d)}e(b,a);b.prototype.clone=function(){return f(b.prototype,this)};b.prototype.toString=function(a,b){var d,c,e;var f=(null!=a?a.pretty:void 0)||!1;var g=null!=(d=null!=a?a.indent:void 0)?d:" ";d=null!=(c=null!=a?a.offset:void 0)?c:0;a=null!=(e=null!=a?a.newline:void 0)?e:"\n";b||(b=0);g=Array(b+d+1).join(g);b="";f&&(b+=g);b+=this.value;f&&(b+=a);return b};return b}(d)}).call(this)},{"./XMLNode":228,"lodash/create":165}], -231:[function(a,c,g){(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty;c.exports=function(){function c(d){this.assertLegalChar=a(this.assertLegalChar,this);var c;this.allowSurrogateChars=null!=d?d.allowSurrogateChars:void 0;this.noDoubleEncoding=null!=d?d.noDoubleEncoding:void 0;d=(null!=d?d.stringify:void 0)||{};for(c in d)if(b.call(d,c)){var e=d[c];this[c]=e}}c.prototype.eleName=function(a){return this.assertLegalChar(""+a||"")};c.prototype.eleText= -function(a){return this.assertLegalChar(this.elEscape(""+a||""))};c.prototype.cdata=function(a){a=""+a||"";if(a.match(/]]\x3e/))throw Error("Invalid CDATA text: "+a);return this.assertLegalChar(a)};c.prototype.comment=function(a){a=""+a||"";if(a.match(/--/))throw Error("Comment text cannot contain double-hypen: "+a);return this.assertLegalChar(a)};c.prototype.raw=function(a){return""+a||""};c.prototype.attName=function(a){return""+a||""};c.prototype.attValue=function(a){return this.attEscape(""+a|| -"")};c.prototype.insTarget=function(a){return""+a||""};c.prototype.insValue=function(a){a=""+a||"";if(a.match(/\?>/))throw Error("Invalid processing instruction value: "+a);return a};c.prototype.xmlVersion=function(a){a=""+a||"";if(!a.match(/1\.[0-9]+/))throw Error("Invalid version number: "+a);return a};c.prototype.xmlEncoding=function(a){a=""+a||"";if(!a.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/))throw Error("Invalid encoding: "+a);return a};c.prototype.xmlStandalone=function(a){return a?"yes":"no"}; -c.prototype.dtdPubID=function(a){return""+a||""};c.prototype.dtdSysID=function(a){return""+a||""};c.prototype.dtdElementValue=function(a){return""+a||""};c.prototype.dtdAttType=function(a){return""+a||""};c.prototype.dtdAttDefault=function(a){return null!=a?""+a||"":a};c.prototype.dtdEntityValue=function(a){return""+a||""};c.prototype.dtdNData=function(a){return""+a||""};c.prototype.convertAttKey="@";c.prototype.convertPIKey="?";c.prototype.convertTextKey="#text";c.prototype.convertCDataKey="#cdata"; -c.prototype.convertCommentKey="#comment";c.prototype.convertRawKey="#raw";c.prototype.assertLegalChar=function(a){var b;if(b=a.match(this.allowSurrogateChars?/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/:/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/))throw Error("Invalid character ("+b+") in string: "+a+" at index "+b.index);return a};c.prototype.elEscape=function(a){return a.replace(this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,"&").replace(//g, -">").replace(/\r/g," ")};c.prototype.attEscape=function(a){return a.replace(this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,"&").replace(/b},function(a,b){return f(_templateObject14,a,b)}];c.exports.lessThan=[function(a,b){return a=b},function(a,b){return f(_templateObject16,a,b)}];c.exports.lte=[function(a,b){return a<=b},function(a,b){return f(_templateObject17,a,b)}];c.exports.success=c.exports.done;c.exports.succeed=c.exports.done;c.exports.failure=c.exports.fail;c.exports.equal=c.exports.equals;c.exports.deepEqual=c.exports.deepEquals;c.exports.match=c.exports.deepEquals;c.exports.greaterThanOrEqualTo=c.exports.gte;c.exports.lessThanOrEqualTo=c.exports.lte},{"../util":247,"@codefeathers/iseq":2}], -238:[function(a,c,g){a("../gunner");var e=a("../util/symbols"),b=function(a){return function(b){return{type:a,unit:b}}};c.exports=function(a){var c=[];Array.prototype.push.apply(c,a.__suite__.beforeHooks[e.Start].map(b("@start")));c.push.apply(a.__suite__.afterHooks[e.Start].map(b("@start")));a.__suite__.tests.forEach(function(d){return Array.prototype.push.apply(c,a.__suite__.beforeHooks["*"].map(b("@every"))),Array.prototype.push.apply(c,(a.__suite__.beforeHooks[d.description]||[]).map(b("@this"))), -c.push(b("@test")(d)),Array.prototype.push.apply(c,(a.__suite__.afterHooks[d.description]||[]).map(b("@afterTest"))),Array.prototype.push.apply(c,a.__suite__.afterHooks["*"].map(b("@afterEvery")))});Array.prototype.push.apply(c,a.__suite__.beforeHooks[e.End].map(b("@beforeend")));Array.prototype.push.apply(c,a.__suite__.afterHooks[e.End].map(b("@end")));return c}},{"../gunner":235,"../util/symbols":248}],239:[function(a,c,g){var e=a("../util").isPromise;c.exports=function(a,c){var b=void 0,f=void 0, -g=void 0;try{b=a(c)}catch(l){g=!0,f=l}return e(b)?b.then(function(a){return{status:"ok",resolve:a,promise:!0}}).catch(function(a){return{status:"notOk",rejection:a,promise:!0}}):Promise.resolve(_extends2({status:g?"notOk":"ok"},!g&&{value:b},g&&{error:f},{promise:!1}))}},{"../util":247}],240:[function(a,c,g){a=function(a){function b(){_classCallCheck2(this,b);return _possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}_inherits(b,a);return b}(a("events")); -c.exports=new a},{events:11}],241:[function(a,c,g){g=a("../util");var e=g.liftPromise,b=g.lowerCaseFirstLetter,f=a("./assertionsLibrary"),d=a("./assertPromise"),h=function(a,b){var c=2",b[0],b[1],a.description); -c.trace&&a.reason&&console.log("\n---\n\n",a.reason,"\n\n---\n")})});a.on("end",function(a){console.log(a.success.length,"tests of",a.length,"passed");console.log("Success ratio:",a.successPercent,"%")})}},{}],244:[function(a,c,g){c.exports={default:a("./default"),tap:a("./tap"),xunit:a("./xunit")}},{"./default":243,"./tap":245,"./xunit":246}],245:[function(a,c,g){var e={ok:"ok",notOk:"not ok",skip:"skip"},b=function(a,b){return"\nTAP version 13\n"+(a.length?"1":0)+".."+a.length+"\n"+a.map(function(a, -c){var d=b.trace&&a.reason&&(a.reason.stack?a.reason.stack:a.reason)||"";return e[a.status]+" "+(c+1)+" - "+a.description+(d&&"\n ---\n message: |\n "+d+"\n ---\n")}).join("\n")+"\n"};c.exports=function(a,c){a.on("end",function(a){return console.log(b(a,c))})};c.exports.convert=b},{}],246:[function(a,c,g){(function(e){var b=a("stream").Readable,f=a("./tap"),d=a("tap-xunit"),g=function(a){var c=new b;c._read=function(){};c.push(a);c.push(null);return c};c.exports=function(a){a.on("end",function(a){return g(f.convert(a, -{trace:!1})).pipe(d()).pipe(e.stdout)})}}).call(this,a("_process"))},{"./tap":245,_process:189,stream:204,"tap-xunit":207}],247:[function(a,c,g){var e=a("json-stringify-safe"),b=function(a){return a&&"object"===("undefined"===typeof a?"undefined":_typeof2(a))},f=function(a){return b(a)?a.stack||e(a):a},d=function(a){return a&&"function"===typeof a.then},h=function(a,b){return d(b)?b.then(a):a(b)};c.exports={isObject:b,isPromise:d,liftPromise:h,path:function(a){return function(b){return b.reduce(function(a, -b){return a&&a[b]},a)}},pick:function(a){return function(b){return b[a]}},pipe:function(){for(var a=arguments.length,b=Array(a),c=0;cb&&(f.warned=!0,b=Error("Possible EventEmitter memory leak detected. "+ +f.length+' "'+String(c)+'" listeners added. Use emitter.setMaxListeners() to increase limit.'),b.name="MaxListenersExceededWarning",b.emitter=a,b.type=c,b.count=f.length,"object"===("undefined"===typeof console?"undefined":_typeof2(console))&&console.warn&&console.warn("%s: %s",b.name,b.message))):(g[c]=b,++a._eventsCount);return a}function l(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target, +arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var a=Array(arguments.length),c=0;ca||a!==a)throw new TypeError('"defaultMaxListeners" must be a positive number');u=a}}):d.defaultMaxListeners= +u;d.prototype.setMaxListeners=function(a){if("number"!==typeof a||0>a||isNaN(a))throw new TypeError('"n" argument must be a positive number');this._maxListeners=a;return this};d.prototype.getMaxListeners=function(){return void 0===this._maxListeners?d.defaultMaxListeners:this._maxListeners};d.prototype.emit=function(a){var c,b,g;var d="error"===a;if(g=this._events)d=d&&null==g.error;else if(!d)return!1;if(d){1d)return this;if(0===d)e.shift();else{b=d+1;for(var k=e.length;bb},function(a,b){return l(_templateObject14,a,b)}];b.exports.lessThan=[function(a,b){return a=b},function(a,b){return l(_templateObject16,a,b)}];b.exports.lte=[function(a,b){return a<=b},function(a,b){return l(_templateObject17,a,b)}];b.exports.success=b.exports.done;b.exports.succeed=b.exports.done;b.exports.failure=b.exports.fail;b.exports.equal=b.exports.equals; +b.exports.deepEqual=b.exports.deepEquals;b.exports.match=b.exports.deepEquals;b.exports.greaterThanOrEqualTo=b.exports.gte;b.exports.lessThanOrEqualTo=b.exports.lte},{"../util":20,"@codefeathers/iseq":2}],11:[function(a,b,h){a("../gunner");var d=a("../util/symbols"),f=function(a){return function(b){return{type:a,unit:b}}};b.exports=function(a){var b=[];Array.prototype.push.apply(b,a.__suite__.beforeHooks[d.Start].map(f("@start")));b.push.apply(a.__suite__.afterHooks[d.Start].map(f("@start")));a.__suite__.tests.forEach(function(c){return Array.prototype.push.apply(b, +a.__suite__.beforeHooks["*"].map(f("@every"))),Array.prototype.push.apply(b,(a.__suite__.beforeHooks[c.description]||[]).map(f("@this"))),b.push(f("@test")(c)),Array.prototype.push.apply(b,(a.__suite__.afterHooks[c.description]||[]).map(f("@afterTest"))),Array.prototype.push.apply(b,a.__suite__.afterHooks["*"].map(f("@afterEvery")))});Array.prototype.push.apply(b,a.__suite__.beforeHooks[d.End].map(f("@beforeend")));Array.prototype.push.apply(b,a.__suite__.afterHooks[d.End].map(f("@end")));return b}}, +{"../gunner":8,"../util/symbols":21}],12:[function(a,b,h){var d=a("../util").isPromise;b.exports=function(a,b){var c=void 0,f=void 0,k=void 0;try{c=a(b)}catch(e){k=!0,f=e}return d(c)?c.then(function(a){return{status:"ok",resolve:a,promise:!0}}).catch(function(a){return{status:"notOk",rejection:a,promise:!0}}):Promise.resolve(_extends2({status:k?"notOk":"ok"},!k&&{value:c},k&&{error:f},{promise:!1}))}},{"../util":20}],13:[function(a,b,h){a=function(a){function b(){_classCallCheck(this,b);return _possibleConstructorReturn(this, +(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}_inherits(b,a);return b}(a("events"));b.exports=new a},{events:5}],14:[function(a,b,h){h=a("../util");var d=h.liftPromise,f=h.lowerCaseFirstLetter,l=a("./assertionsLibrary"),c=a("./assertPromise"),g=function(a,b){var e=2",c[0],c[1],a.description);b.trace&&a.reason&&console.log("\n---\n\n",a.reason,"\n\n---\n")})});a.on("end",function(a){console.log(a.success.length,"tests of",a.length,"passed");console.log("Success ratio:",a.successPercent,"%")})};b.exports.convert=function(a){return a}},{}],17:[function(a,b,h){b.exports={default:a("./default"),tap:a("./tap"),xunit:a("./xunit")}},{"./default":16,"./tap":18,"./xunit":19}],18:[function(a,b,h){var d= +{ok:"ok",notOk:"not ok",skip:"skip"},f=function(a,b){return"\nTAP version 13\n"+(a.length?"1":0)+".."+a.length+"\n"+a.map(function(a,c){var e=b.trace&&a.reason&&(a.reason.stack?a.reason.stack:a.reason)||"";return d[a.status]+" "+(c+1)+" - "+a.description+(e&&"\n ---\n message: |\n "+e+"\n ---\n")}).join("\n")+"\n"};b.exports=function(a,b){a.on("end",function(a){return console.log(f(a,b))})};b.exports.convert=f},{}],19:[function(a,b,h){var d=function(a,b,d,f){d=d?"/>":">";var c=[],g=void 0;Object.keys(b).forEach(function(a){Object.prototype.hasOwnProperty.call(b, +a)&&c.push(a+'="'+b[a]+'"')});g="<"+a+(c.length?" "+c.join(" "):"")+d;f&&(g+=f+"'+d("testsuites",{},!1,d("testsuite",{tests:a.count,success:a.success.length,failures:a.failures.length,skipped:a.skipped.length},!1,a.reduce(function(a,b){var c="ok"===b.status,e="ok"!==b.status&&("skip"===b.status?d("skipped",{},!0):d("failure",{},!b.reason,b.reason?escape(b.reason):""));return a+=d("testcase",{name:escape(b.description)},c,e|| +"")},"")))};b.exports=function(a){a.on("end",function(a){console.log(f(a))})};b.exports.convert=f},{}],20:[function(a,b,h){var d=a("json-stringify-safe"),f=function(a){return a&&"object"===("undefined"===typeof a?"undefined":_typeof2(a))},l=function(a){return f(a)?a.stack||d(a):a},c=function(a){return a&&"function"===typeof a.then},g=function(a,b){return c(b)?b.then(a):a(b)};b.exports={isObject:f,isPromise:c,liftPromise:g,path:function(a){return function(b){return b.reduce(function(a,b){return a&& +a[b]},a)}},pick:function(a){return function(b){return b[a]}},pipe:function(){for(var a=arguments.length,b=Array(a),c=0;c does not exist in ",""],["<","> does not exist in ",""]),_templateObject11=_taggedTemplateLiteral([""," is not a promise"],[""," is not a promise"]),_templateObject12=_taggedTemplateLiteral(["'","' does not resolve to '","'"],["'","' does not resolve to '","'"]),_templateObject13=_taggedTemplateLiteral(["'","' is not of type '","'"],["'","' is not of type '","'"]),_templateObject14=_taggedTemplateLiteral(["'","' is not greater than ",""],["'","' is not greater than ",""]),_templateObject15=_taggedTemplateLiteral(["'","' is not less than ",""],["'","' is not less than ",""]),_templateObject16=_taggedTemplateLiteral(["'","' is less than ",""],["'","' is less than ",""]),_templateObject17=_taggedTemplateLiteral(["'","' is greater than ",""],["'","' is greater than ",""]);function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function _taggedTemplateLiteral(strings,raw){return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toArray(arr){return Array.isArray(arr)?arr:Array.from(arr);}function _classCallCheck2(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperty2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toConsumableArray2(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i} arr Array of Promises. - * @param {Function} functor Function to call resolved values. - */var PromiseMap=function PromiseMap(arr,functor){return Promise.all(arr.map(function(x){return Promise.resolve(x).then(functor);}));};/** - * Resolve a flat object's promises. - * @param {Object} - * @returns {Object} - */var ResolveObject=function ResolveObject(obj){return Promise.all(Object.keys(obj).map(function(key){return Promise.resolve(obj[key]).then(function(val){return obj[key]=val;});})).then(function(_){return obj;});};/** - * Recursively resolves deep objects with nested promises. - * @param {Object} object Object or value to resolve. - * @returns {Object} Resolved object. - */var PromiseObject=function PromiseObject(object){var shouldReplaceSelf=false;var ResolveDeepObject=function ResolveDeepObject(obj){return Promise.resolve(obj).then(function(resolvedObject){if(Array.isArray(resolvedObject)){// Promise and map every item to recursively deep resolve. -return PromiseMap(resolvedObject,function(obj){return ResolveDeepObject(obj);});}else if(isObject(resolvedObject)){return ResolveObject(Object.keys(resolvedObject).reduce(function(acc,key){if(resolvedObject[key]===object){shouldReplaceSelf=true;return _extends2({},acc,_defineProperty2({},key,$SELF));}return _extends2({},acc,_defineProperty2({},key,ResolveDeepObject(resolvedObject[key])));},{}));}return resolvedObject;});};return ResolveDeepObject(object).then(function(obj){// Replace $SELF with reference to obj -if(shouldReplaceSelf)makeCyclic(obj,$SELF);return obj;});};module.exports=PromiseObject;},{}],5:[function(require,module,exports){(function(global){'use strict';// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js -// original notice: -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */function compare(a,b){if(a===b){return 0;}var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -var util=require('util/');var hasOwn=Object.prototype.hasOwnProperty;var pSlice=Array.prototype.slice;var functionsHaveNames=function(){return function foo(){}.name==='foo';}();function pToString(obj){return Object.prototype.toString.call(obj);}function isView(arrbuf){if(isBuffer(arrbuf)){return false;}if(typeof global.ArrayBuffer!=='function'){return false;}if(typeof ArrayBuffer.isView==='function'){return ArrayBuffer.isView(arrbuf);}if(!arrbuf){return false;}if(arrbuf instanceof DataView){return true;}if(arrbuf.buffer&&arrbuf.buffer instanceof ArrayBuffer){return true;}return false;}// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. -var assert=module.exports=ok;// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) -var regex=/\s*function\s+([^\(\s]*)\s*/;// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js -function getName(func){if(!util.isFunction(func)){return;}if(functionsHaveNames){return func.name;}var str=func.toString();var match=str.match(regex);return match&&match[1];}assert.AssertionError=function AssertionError(options){this.name='AssertionError';this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false;}else{this.message=getMessage(this);this.generatedMessage=true;}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction);}else{// non v8 browsers so we can have a stacktrace -var err=new Error();if(err.stack){var out=err.stack;// try to strip useless frames -var fn_name=getName(stackStartFunction);var idx=out.indexOf('\n'+fn_name);if(idx>=0){// once we have located the function frame -// we need to strip out everything before it (and its line) -var next_line=out.indexOf('\n',idx+1);out=out.substring(next_line+1);}this.stack=out;}}};// assert.AssertionError instanceof Error -util.inherits(assert.AssertionError,Error);function truncate(s,n){if(typeof s==='string'){return s.length=0;i--){if(ka[i]!==kb[i])return false;}//equivalent values for every corresponding key, and -//~~~possibly expensive deep test -for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return false;}return true;}// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); -assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected,false)){fail(actual,expected,message,'notDeepEqual',assert.notDeepEqual);}};assert.notDeepStrictEqual=notDeepStrictEqual;function notDeepStrictEqual(actual,expected,message){if(_deepEqual(actual,expected,true)){fail(actual,expected,message,'notDeepStrictEqual',notDeepStrictEqual);}}// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); -assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,'===',assert.strictEqual);}};// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); -assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,'!==',assert.notStrictEqual);}};function expectedException(actual,expected){if(!actual||!expected){return false;}if(Object.prototype.toString.call(expected)=='[object RegExp]'){return expected.test(actual);}try{if(actual instanceof expected){return true;}}catch(e){// Ignore. The instanceof check doesn't work for arrow functions. -}if(Error.isPrototypeOf(expected)){return false;}return expected.call({},actual)===true;}function _tryBlock(block){var error;try{block();}catch(e){error=e;}return error;}function _throws(shouldThrow,block,expected,message){var actual;if(typeof block!=='function'){throw new TypeError('"block" argument must be a function');}if(typeof expected==='string'){message=expected;expected=null;}actual=_tryBlock(block);message=(expected&&expected.name?' ('+expected.name+').':'.')+(message?' '+message:'.');if(shouldThrow&&!actual){fail(actual,expected,'Missing expected exception'+message);}var userProvidedMessage=typeof message==='string';var isUnwantedException=!shouldThrow&&util.isError(actual);var isUnexpectedException=!shouldThrow&&actual&&!expected;if(isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException){fail(actual,expected,'Got unwanted exception'+message);}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual;}}// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); -assert.throws=function(block,/*optional*/error,/*optional*/message){_throws(true,block,error,message);};// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow=function(block,/*optional*/error,/*optional*/message){_throws(false,block,error,message);};assert.ifError=function(err){if(err)throw err;};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key);}return keys;};}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"util/":214}],6:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i0){throw new Error('Invalid string. Length must be a multiple of 4');}// Trim off extra bytes after placeholder bytes are found -// See: https://github.com/beatgammit/base64-js/issues/42 -var validLen=b64.indexOf('=');if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen];}// base64 is 4/3 + up to two characters of the original data -function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen;}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen;}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;// if there are placeholders, only get up to the last complete 4 chars -var len=placeHoldersLen>0?validLen-4:validLen;for(var i=0;i>16&0xFF;arr[curByte++]=tmp>>8&0xFF;arr[curByte++]=tmp&0xFF;}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&0xFF;}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&0xFF;arr[curByte++]=tmp&0xFF;}return arr;}function tripletToBase64(num){return lookup[num>>18&0x3F]+lookup[num>>12&0x3F]+lookup[num>>6&0x3F]+lookup[num&0x3F];}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength));}// pad the end with zeros, but make sure to not forget the extra bytes -if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&0x3F]+'==');}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&0x3F]+lookup[tmp<<2&0x3F]+'=');}return parts.join('');}},{}],7:[function(require,module,exports){},{}],8:[function(require,module,exports){/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - *//* eslint-disable no-proto */'use strict';var base64=require('base64-js');var ieee754=require('ieee754');exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=0x7fffffff;exports.kMaxLength=K_MAX_LENGTH;/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=='undefined'&&typeof console.error==='function'){console.error('This browser lacks typed array (Uint8Array) support which is required by '+'`buffer` v5.x. Use `buffer` v4.x if you require old browser support.');}function typedArraySupport(){// Can typed array instances can be augmented? -try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function foo(){return 42;}};return arr.foo()===42;}catch(e){return false;}}Object.defineProperty(Buffer.prototype,'parent',{enumerable:true,get:function get(){if(!Buffer.isBuffer(this))return undefined;return this.buffer;}});Object.defineProperty(Buffer.prototype,'offset',{enumerable:true,get:function get(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset;}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"');}// Return an augmented `Uint8Array` instance -var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf;}/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */function Buffer(arg,encodingOrOffset,length){// Common case. -if(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The "string" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if(typeof Symbol!=='undefined'&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false});}Buffer.poolSize=8192;// not used by this implementation -function from(value,encodingOrOffset,length){if(typeof value==='string'){return fromString(value,encodingOrOffset);}if(ArrayBuffer.isView(value)){return fromArrayLike(value);}if(value==null){throw TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+(typeof value==="undefined"?"undefined":_typeof2(value)));}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length);}if(typeof value==='number'){throw new TypeError('The "value" argument must not be of type number. Received type number');}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length);}var b=fromObject(value);if(b)return b;if(typeof Symbol!=='undefined'&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==='function'){return Buffer.from(value[Symbol.toPrimitive]('string'),encodingOrOffset,length);}throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+(typeof value==="undefined"?"undefined":_typeof2(value)));}/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length);};// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: -// https://github.com/feross/buffer/pull/148 -Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=='number'){throw new TypeError('"size" argument must be of type number');}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"');}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size);}if(fill!==undefined){// Only pay attention to encoding if it's a string. This -// prevents accidentally sending in a number that would -// be interpretted as a start offset. -return typeof encoding==='string'?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill);}return createBuffer(size);}/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding);};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0);}/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */Buffer.allocUnsafe=function(size){return allocUnsafe(size);};/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size);};function fromString(string,encoding){if(typeof encoding!=='string'||encoding===''){encoding='utf8';}if(!Buffer.isEncoding(encoding)){throw new TypeError('Unknown encoding: '+encoding);}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){// Writing a hex string, for example, that contains invalid characters will -// cause everything after the first invalid character to be ignored. (e.g. -// 'abxxcd' will be treated as 'ab') -buf=buf.slice(0,actual);}return buf;}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i=K_MAX_LENGTH){throw new RangeError('Attempt to allocate Buffer larger than maximum '+'size: 0x'+K_MAX_LENGTH.toString(16)+' bytes');}return length|0;}function SlowBuffer(length){if(+length!=length){// eslint-disable-line eqeqeq -length=0;}return Buffer.alloc(+length);}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype;// so Buffer.isBuffer(Buffer.prototype) will be false -};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;// Use a for loop to avoid recursion -var loweredCase=false;for(;;){switch(encoding){case'ascii':case'latin1':case'binary':return len;case'utf8':case'utf-8':return utf8ToBytes(string).length;case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return len*2;case'hex':return len>>>1;case'base64':return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length;// assume utf8 -}encoding=(''+encoding).toLowerCase();loweredCase=true;}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;// No need to verify that "this.length <= MAX_UINT32" since it's a read-only -// property of a typed array. -// This behaves neither like String nor Uint8Array in that we set start/end -// to their upper/lower bounds if the value passed is out of range. -// undefined is handled specially as per ECMA-262 6th Edition, -// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. -if(start===undefined||start<0){start=0;}// Return early if start > this.length. Done here to prevent potential uint32 -// coercion fail below. -if(start>this.length){return'';}if(end===undefined||end>this.length){end=this.length;}if(end<=0){return'';}// Force coersion to uint32. This will also coerce falsey/NaN values to 0. -end>>>=0;start>>>=0;if(end<=start){return'';}if(!encoding)encoding='utf8';while(true){switch(encoding){case'hex':return hexSlice(this,start,end);case'utf8':case'utf-8':return utf8Slice(this,start,end);case'ascii':return asciiSlice(this,start,end);case'latin1':case'binary':return latin1Slice(this,start,end);case'base64':return base64Slice(this,start,end);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError('Unknown encoding: '+encoding);encoding=(encoding+'').toLowerCase();loweredCase=true;}}}// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) -// to detect a Buffer instance. It's not possible to use `instanceof Buffer` -// reliably in a browserify context because there could be multiple different -// copies of the 'buffer' package in use. This method works even for Buffer -// instances that were created from another copy of the `buffer` package. -// See: https://github.com/feross/buffer/issues/154 -Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i;}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError('Buffer size must be a multiple of 16-bits');}for(var i=0;imax)str+=' ... ';return'';};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength);}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+'Received type '+(typeof target==="undefined"?"undefined":_typeof2(target)));}if(start===undefined){start=0;}if(end===undefined){end=target?target.length:0;}if(thisStart===undefined){thisStart=0;}if(thisEnd===undefined){thisEnd=this.length;}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError('out of range index');}if(thisStart>=thisEnd&&start>=end){return 0;}if(thisStart>=thisEnd){return-1;}if(start>=end){return 1;}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match -if(buffer.length===0)return-1;// Normalize byteOffset -if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number. -if(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer -byteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer -if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val -if(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf -if(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails -if(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255] -if(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==='ucs2'||encoding==='ucs-2'||encoding==='utf16le'||encoding==='utf-16le'){if(arr.length<2||val.length<2){return-1;}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2;}}function read(buf,i){if(indexSize===1){return buf[i];}else{return buf.readUInt16BE(i*indexSize);}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;jremaining){length=remaining;}}var strLen=string.length;if(length>strLen/2){length=strLen/2;}for(var i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding='utf8';}else{encoding=length;length=undefined;}}else{throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError('Attempt to write outside buffer bounds');}if(!encoding)encoding='utf8';var loweredCase=false;for(;;){switch(encoding){case'hex':return hexWrite(this,string,offset,length);case'utf8':case'utf-8':return utf8Write(this,string,offset,length);case'ascii':return asciiWrite(this,string,offset,length);case'latin1':case'binary':return latin1Write(this,string,offset,length);case'base64':// Warning: maxLength not taken into account in base64Write -return base64Write(this,string,offset,length);case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError('Unknown encoding: '+encoding);encoding=(''+encoding).toLowerCase();loweredCase=true;}}};Buffer.prototype.toJSON=function toJSON(){return{type:'Buffer',data:Array.prototype.slice.call(this._arr||this,0)};};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf);}else{return base64.fromByteArray(buf.slice(start,end));}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i0xEF?4:firstByte>0xDF?3:firstByte>0xBF?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<0x80){codePoint=firstByte;}break;case 2:secondByte=buf[i+1];if((secondByte&0xC0)===0x80){tempCodePoint=(firstByte&0x1F)<<0x6|secondByte&0x3F;if(tempCodePoint>0x7F){codePoint=tempCodePoint;}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&0xC0)===0x80&&(thirdByte&0xC0)===0x80){tempCodePoint=(firstByte&0xF)<<0xC|(secondByte&0x3F)<<0x6|thirdByte&0x3F;if(tempCodePoint>0x7FF&&(tempCodePoint<0xD800||tempCodePoint>0xDFFF)){codePoint=tempCodePoint;}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&0xC0)===0x80&&(thirdByte&0xC0)===0x80&&(fourthByte&0xC0)===0x80){tempCodePoint=(firstByte&0xF)<<0x12|(secondByte&0x3F)<<0xC|(thirdByte&0x3F)<<0x6|fourthByte&0x3F;if(tempCodePoint>0xFFFF&&tempCodePoint<0x110000){codePoint=tempCodePoint;}}}}if(codePoint===null){// we did not generate a valid codePoint so insert a -// replacement char (U+FFFD) and advance only 1 byte -codePoint=0xFFFD;bytesPerSequence=1;}else if(codePoint>0xFFFF){// encode to utf16 (surrogate pair dance) -codePoint-=0x10000;res.push(codePoint>>>10&0x3FF|0xD800);codePoint=0xDC00|codePoint&0x3FF;}res.push(codePoint);i+=bytesPerSequence;}return decodeCodePointsArray(res);}// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH=0x1000;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints);// avoid extra slice() -}// Decode in chunks to avoid "call stack size exceeded". -var res='';var i=0;while(ilen)end=len;var out='';for(var i=start;ilen){start=len;}if(end<0){end+=len;if(end<0)end=0;}else if(end>len){end=len;}if(endlength)throw new RangeError('Trying to access beyond buffer length');}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length);}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=0x100)){val+=this[offset+--byteLength]*mul;}return val;};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset];};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8;};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1];};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*0x1000000;};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*0x1000000+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3]);};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val;};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=0x100)){val+=this[offset+--i]*mul;}mul*=0x80;if(val>=mul)val-=Math.pow(2,8*byteLength);return val;};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&0x80))return this[offset];return(0xff-this[offset]+1)*-1;};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&0x8000?val|0xFFFF0000:val;};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&0x8000?val|0xFFFF0000:val;};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24;};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3];};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4);};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4);};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8);};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8);};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError('Index out of range');}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0);}var mul=1;var i=0;this[offset]=value&0xFF;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0);}var i=byteLength-1;var mul=1;this[offset+i]=value&0xFF;while(--i>=0&&(mul*=0x100)){this[offset+i]=value/mul&0xFF;}return offset+byteLength;};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,0xff,0);this[offset]=value&0xff;return offset+1;};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0xffff,0);this[offset]=value&0xff;this[offset+1]=value>>>8;return offset+2;};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0xffff,0);this[offset]=value>>>8;this[offset+1]=value&0xff;return offset+2;};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0xffffffff,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&0xff;return offset+4;};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0xffffffff,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&0xff;return offset+4;};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit);}var i=0;var mul=1;var sub=0;this[offset]=value&0xFF;while(++i>0)-sub&0xFF;}return offset+byteLength;};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit);}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&0xFF;while(--i>=0&&(mul*=0x100)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1;}this[offset+i]=(value/mul>>0)-sub&0xFF;}return offset+byteLength;};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,0x7f,-0x80);if(value<0)value=0xff+value+1;this[offset]=value&0xff;return offset+1;};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0x7fff,-0x8000);this[offset]=value&0xff;this[offset+1]=value>>>8;return offset+2;};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,0x7fff,-0x8000);this[offset]=value>>>8;this[offset+1]=value&0xff;return offset+2;};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0x7fffffff,-0x80000000);this[offset]=value&0xff;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4;};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,0x7fffffff,-0x80000000);if(value<0)value=0xffffffff+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&0xff;return offset+4;};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError('Index out of range');if(offset<0)throw new RangeError('Index out of range');}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,3.4028234663852886e+38,-3.4028234663852886e+38);}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4;}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert);};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert);};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,1.7976931348623157E+308,-1.7976931348623157E+308);}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8;}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert);};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert);};// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError('argument should be a Buffer');if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError('Index out of range');if(end<0)throw new RangeError('sourceEnd out of bounds');// Are we oob? -if(end>this.length)end=this.length;if(target.length-targetStart=0;--i){target[i+targetStart]=this[i+start];}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart);}return len;};// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill=function fill(val,start,end,encoding){// Handle string cases: -if(typeof val==='string'){if(typeof start==='string'){encoding=start;start=0;end=this.length;}else if(typeof end==='string'){encoding=end;end=this.length;}if(encoding!==undefined&&typeof encoding!=='string'){throw new TypeError('encoding must be a string');}if(typeof encoding==='string'&&!Buffer.isEncoding(encoding)){throw new TypeError('Unknown encoding: '+encoding);}if(val.length===1){var code=val.charCodeAt(0);if(encoding==='utf8'&&code<128||encoding==='latin1'){// Fast path: If `val` fits into a single byte, use that numeric value. -val=code;}}}else if(typeof val==='number'){val=val&255;}// Invalid ranges are not set to a default, so can range check early. -if(start<0||this.length>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==='number'){for(i=start;i0xD7FF&&codePoint<0xE000){// last char was a lead -if(!leadSurrogate){// no lead yet -if(codePoint>0xDBFF){// unexpected trail -if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);continue;}else if(i+1===length){// unpaired lead -if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);continue;}// valid lead -leadSurrogate=codePoint;continue;}// 2 leads in a row -if(codePoint<0xDC00){if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);leadSurrogate=codePoint;continue;}// valid surrogate pair -codePoint=(leadSurrogate-0xD800<<10|codePoint-0xDC00)+0x10000;}else if(leadSurrogate){// valid bmp char, but last char was a lead -if((units-=3)>-1)bytes.push(0xEF,0xBF,0xBD);}leadSurrogate=null;// encode utf8 -if(codePoint<0x80){if((units-=1)<0)break;bytes.push(codePoint);}else if(codePoint<0x800){if((units-=2)<0)break;bytes.push(codePoint>>0x6|0xC0,codePoint&0x3F|0x80);}else if(codePoint<0x10000){if((units-=3)<0)break;bytes.push(codePoint>>0xC|0xE0,codePoint>>0x6&0x3F|0x80,codePoint&0x3F|0x80);}else if(codePoint<0x110000){if((units-=4)<0)break;bytes.push(codePoint>>0x12|0xF0,codePoint>>0xC&0x3F|0x80,codePoint>>0x6&0x3F|0x80,codePoint&0x3F|0x80);}else{throw new Error('Invalid code point');}}return bytes;}function asciiToBytes(str){var byteArray=[];for(var i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi);}return byteArray;}function base64ToBytes(str){return base64.toByteArray(base64clean(str));}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i];}return i;}// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass -// the `instanceof` check but they should be treated as of that type. -// See: https://github.com/feross/buffer/issues/166 -function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}function numberIsNaN(obj){// For IE11 support -return obj!==obj;// eslint-disable-line no-self-compare -}},{"base64-js":6,"ieee754":12}],9:[function(require,module,exports){(function(Buffer){// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(arg){if(Array.isArray){return Array.isArray(arg);}return objectToString(arg)==='[object Array]';}exports.isArray=isArray;function isBoolean(arg){return typeof arg==='boolean';}exports.isBoolean=isBoolean;function isNull(arg){return arg===null;}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null;}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==='number';}exports.isNumber=isNumber;function isString(arg){return typeof arg==='string';}exports.isString=isString;function isSymbol(arg){return(typeof arg==="undefined"?"undefined":_typeof2(arg))==='symbol';}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0;}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==='[object RegExp]';}exports.isRegExp=isRegExp;function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof2(arg))==='object'&&arg!==null;}exports.isObject=isObject;function isDate(d){return objectToString(d)==='[object Date]';}exports.isDate=isDate;function isError(e){return objectToString(e)==='[object Error]'||e instanceof Error;}exports.isError=isError;function isFunction(arg){return typeof arg==='function';}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==='boolean'||typeof arg==='number'||typeof arg==='string'||(typeof arg==="undefined"?"undefined":_typeof2(arg))==='symbol'||// ES6 symbol -typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o);}}).call(this,{"isBuffer":require("../../../../../is-buffer/1.1.6/node_modules/is-buffer/index.js")});},{"../../../../../is-buffer/1.1.6/node_modules/is-buffer/index.js":15}],10:[function(require,module,exports){var Stream=require("stream");var writeMethods=["write","end","destroy"];var readMethods=["resume","pause"];var readEvents=["data","close"];var slice=Array.prototype.slice;module.exports=duplex;function forEach(arr,fn){if(arr.forEach){return arr.forEach(fn);}for(var i=0;i1)er=arguments[1];if(er instanceof Error){throw er;// Unhandled 'error' event -}else{// At least give some kind of context to the user -var err=new Error('Unhandled "error" event. ('+er+')');err.context=er;throw err;}return false;}handler=events[type];if(!handler)return false;var isFn=typeof handler==='function';len=arguments.length;switch(len){// fast cases -case 1:emitNone(handler,isFn,this);break;case 2:emitOne(handler,isFn,this,arguments[1]);break;case 3:emitTwo(handler,isFn,this,arguments[1],arguments[2]);break;case 4:emitThree(handler,isFn,this,arguments[1],arguments[2],arguments[3]);break;// slower -default:args=new Array(len-1);for(i=1;i0&&existing.length>m){existing.warned=true;var w=new Error('Possible EventEmitter memory leak detected. '+existing.length+' "'+String(type)+'" listeners '+'added. Use emitter.setMaxListeners() to '+'increase limit.');w.name='MaxListenersExceededWarning';w.emitter=target;w.type=type;w.count=existing.length;if((typeof console==="undefined"?"undefined":_typeof2(console))==='object'&&console.warn){console.warn('%s: %s',w.name,w.message);}}}}return target;}EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false);};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true);};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;switch(arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:var args=new Array(arguments.length);for(var i=0;i=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break;}}if(position<0)return this;if(position===0)list.shift();else spliceOne(list,position);if(list.length===1)events[type]=list[0];if(events.removeListener)this.emit('removeListener',type,originalListener||listener);}return this;};EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(!events)return this;// not listening for removeListener, no need to emit -if(!events.removeListener){if(arguments.length===0){this._events=objectCreate(null);this._eventsCount=0;}else if(events[type]){if(--this._eventsCount===0)this._events=objectCreate(null);else delete events[type];}return this;}// emit removeListener for all listeners on all events -if(arguments.length===0){var keys=objectKeys(events);var key;for(i=0;i=0;i--){this.removeListener(type,listeners[i]);}}return this;};function _listeners(target,type,unwrap){var events=target._events;if(!events)return[];var evlistener=events[type];if(!evlistener)return[];if(typeof evlistener==='function')return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length);}EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true);};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false);};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==='function'){return emitter.listenerCount(type);}else{return listenerCount.call(emitter,type);}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events){var evlistener=events[type];if(typeof evlistener==='function'){return 1;}else if(evlistener){return evlistener.length;}}return 0;}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[];};// About 1.5x faster than the two-arg version of Array#splice(). -function spliceOne(list,index){for(var i=index,k=i+1,n=list.length;k>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias;}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity;}else{m=m+Math.pow(2,mLen);e=e-eBias;}return(s?-1:1)*m*Math.pow(2,e-mLen);};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax;}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*Math.pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias;}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0;}}for(;mLen>=8;buffer[offset+i]=m&0xff,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&0xff,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128;};},{}],13:[function(require,module,exports){if(typeof Object.create==='function'){// implementation from standard node.js 'util' module -module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}});};}else{// old school shim for old browsers -module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;};}},{}],14:[function(require,module,exports){arguments[4][13][0].apply(exports,arguments);},{"dup":13}],15:[function(require,module,exports){/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer);};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==='function'&&obj.constructor.isBuffer(obj);}// For Node v0.10 support. Remove this eventually. -function isSlowBuffer(obj){return typeof obj.readFloatLE==='function'&&typeof obj.slice==='function'&&isBuffer(obj.slice(0,0));}},{}],16:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return toString.call(arr)=='[object Array]';};},{}],17:[function(require,module,exports){'use strict';var yaml=require('./lib/js-yaml.js');module.exports=yaml;},{"./lib/js-yaml.js":18}],18:[function(require,module,exports){'use strict';var loader=require('./js-yaml/loader');var dumper=require('./js-yaml/dumper');function deprecated(name){return function(){throw new Error('Function '+name+' is deprecated and cannot be used.');};}module.exports.Type=require('./js-yaml/type');module.exports.Schema=require('./js-yaml/schema');module.exports.FAILSAFE_SCHEMA=require('./js-yaml/schema/failsafe');module.exports.JSON_SCHEMA=require('./js-yaml/schema/json');module.exports.CORE_SCHEMA=require('./js-yaml/schema/core');module.exports.DEFAULT_SAFE_SCHEMA=require('./js-yaml/schema/default_safe');module.exports.DEFAULT_FULL_SCHEMA=require('./js-yaml/schema/default_full');module.exports.load=loader.load;module.exports.loadAll=loader.loadAll;module.exports.safeLoad=loader.safeLoad;module.exports.safeLoadAll=loader.safeLoadAll;module.exports.dump=dumper.dump;module.exports.safeDump=dumper.safeDump;module.exports.YAMLException=require('./js-yaml/exception');// Deprecated schema names from JS-YAML 2.0.x -module.exports.MINIMAL_SCHEMA=require('./js-yaml/schema/failsafe');module.exports.SAFE_SCHEMA=require('./js-yaml/schema/default_safe');module.exports.DEFAULT_SCHEMA=require('./js-yaml/schema/default_full');// Deprecated functions from JS-YAML 1.x.x -module.exports.scan=deprecated('scan');module.exports.parse=deprecated('parse');module.exports.compose=deprecated('compose');module.exports.addConstructor=deprecated('addConstructor');},{"./js-yaml/dumper":20,"./js-yaml/exception":21,"./js-yaml/loader":22,"./js-yaml/schema":24,"./js-yaml/schema/core":25,"./js-yaml/schema/default_full":26,"./js-yaml/schema/default_safe":27,"./js-yaml/schema/failsafe":28,"./js-yaml/schema/json":29,"./js-yaml/type":30}],19:[function(require,module,exports){'use strict';function isNothing(subject){return typeof subject==='undefined'||subject===null;}function isObject(subject){return(typeof subject==="undefined"?"undefined":_typeof2(subject))==='object'&&subject!==null;}function toArray(sequence){if(Array.isArray(sequence))return sequence;else if(isNothing(sequence))return[];return[sequence];}function extend(target,source){var index,length,key,sourceKeys;if(source){sourceKeys=Object.keys(source);for(index=0,length=sourceKeys.length;index */var CHAR_QUESTION=0x3F;/* ? */var CHAR_COMMERCIAL_AT=0x40;/* @ */var CHAR_LEFT_SQUARE_BRACKET=0x5B;/* [ */var CHAR_RIGHT_SQUARE_BRACKET=0x5D;/* ] */var CHAR_GRAVE_ACCENT=0x60;/* ` */var CHAR_LEFT_CURLY_BRACKET=0x7B;/* { */var CHAR_VERTICAL_LINE=0x7C;/* | */var CHAR_RIGHT_CURLY_BRACKET=0x7D;/* } */var ESCAPE_SEQUENCES={};ESCAPE_SEQUENCES[0x00]='\\0';ESCAPE_SEQUENCES[0x07]='\\a';ESCAPE_SEQUENCES[0x08]='\\b';ESCAPE_SEQUENCES[0x09]='\\t';ESCAPE_SEQUENCES[0x0A]='\\n';ESCAPE_SEQUENCES[0x0B]='\\v';ESCAPE_SEQUENCES[0x0C]='\\f';ESCAPE_SEQUENCES[0x0D]='\\r';ESCAPE_SEQUENCES[0x1B]='\\e';ESCAPE_SEQUENCES[0x22]='\\"';ESCAPE_SEQUENCES[0x5C]='\\\\';ESCAPE_SEQUENCES[0x85]='\\N';ESCAPE_SEQUENCES[0xA0]='\\_';ESCAPE_SEQUENCES[0x2028]='\\L';ESCAPE_SEQUENCES[0x2029]='\\P';var DEPRECATED_BOOLEANS_SYNTAX=['y','Y','yes','Yes','YES','on','On','ON','n','N','no','No','NO','off','Off','OFF'];function compileStyleMap(schema,map){var result,keys,index,length,tag,style,type;if(map===null)return{};result={};keys=Object.keys(map);for(index=0,length=keys.length;index” | “'” | “"” -&&c!==CHAR_SHARP&&c!==CHAR_AMPERSAND&&c!==CHAR_ASTERISK&&c!==CHAR_EXCLAMATION&&c!==CHAR_VERTICAL_LINE&&c!==CHAR_GREATER_THAN&&c!==CHAR_SINGLE_QUOTE&&c!==CHAR_DOUBLE_QUOTE// | “%” | “@” | “`”) -&&c!==CHAR_PERCENT&&c!==CHAR_COMMERCIAL_AT&&c!==CHAR_GRAVE_ACCENT;}// Determines whether block indentation indicator is required. -function needIndentIndicator(string){var leadingSpaceRe=/^\n* /;return leadingSpaceRe.test(string);}var STYLE_PLAIN=1,STYLE_SINGLE=2,STYLE_LITERAL=3,STYLE_FOLDED=4,STYLE_DOUBLE=5;// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string,singleLineOnly,indentPerLevel,lineWidth,testAmbiguousType){var i;var char;var hasLineBreak=false;var hasFoldableLine=false;// only checked if shouldTrackWidth -var shouldTrackWidth=lineWidth!==-1;var previousLineBreak=-1;// count the first line correctly -var plain=isPlainSafeFirst(string.charCodeAt(0))&&!isWhitespace(string.charCodeAt(string.length-1));if(singleLineOnly){// Case: no block styles. -// Check for disallowed characters to rule out plain and single. -for(i=0;ilineWidth&&string[previousLineBreak+1]!==' ';previousLineBreak=i;}}else if(!isPrintable(char)){return STYLE_DOUBLE;}plain=plain&&isPlainSafe(char);}// in case the end is missing a \n -hasFoldableLine=hasFoldableLine||shouldTrackWidth&&i-previousLineBreak-1>lineWidth&&string[previousLineBreak+1]!==' ';}// Although every style can represent \n without escaping, prefer block styles -// for multiline, since they're more readable and they don't add empty lines. -// Also prefer folding a super-long line. -if(!hasLineBreak&&!hasFoldableLine){// Strings interpretable as another type have to be quoted; -// e.g. the string 'true' vs. the boolean true. -return plain&&!testAmbiguousType(string)?STYLE_PLAIN:STYLE_SINGLE;}// Edge case: block indentation indicator can only have one digit. -if(indentPerLevel>9&&needIndentIndicator(string)){return STYLE_DOUBLE;}// At this point we know block styles are valid. -// Prefer literal style unless we want to fold. -return hasFoldableLine?STYLE_FOLDED:STYLE_LITERAL;}// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state,string,level,iskey){state.dump=function(){if(string.length===0){return"''";}if(!state.noCompatMode&&DEPRECATED_BOOLEANS_SYNTAX.indexOf(string)!==-1){return"'"+string+"'";}var indent=state.indent*Math.max(1,level);// no 0-indent scalars -// As indentation gets deeper, let the width decrease monotonically -// to the lower bound min(state.lineWidth, 40). -// Note that this implies -// state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. -// state.lineWidth > 40 + state.indent: width decreases until the lower bound. -// This behaves better than a constant minimum width which disallows narrower options, -// or an indent threshold which causes the width to suddenly increase. -var lineWidth=state.lineWidth===-1?-1:Math.max(Math.min(state.lineWidth,40),state.lineWidth-indent);// Without knowing if keys are implicit/explicit, assume implicit for safety. -var singleLineOnly=iskey// No block styles in flow mode. -||state.flowLevel>-1&&level>=state.flowLevel;function testAmbiguity(string){return testImplicitResolving(state,string);}switch(chooseScalarStyle(string,singleLineOnly,state.indent,lineWidth,testAmbiguity)){case STYLE_PLAIN:return string;case STYLE_SINGLE:return"'"+string.replace(/'/g,"''")+"'";case STYLE_LITERAL:return'|'+blockHeader(string,state.indent)+dropEndingNewline(indentString(string,indent));case STYLE_FOLDED:return'>'+blockHeader(string,state.indent)+dropEndingNewline(indentString(foldString(string,lineWidth),indent));case STYLE_DOUBLE:return'"'+escapeString(string,lineWidth)+'"';default:throw new YAMLException('impossible error: invalid scalar style');}}();}// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string,indentPerLevel){var indentIndicator=needIndentIndicator(string)?String(indentPerLevel):'';// note the special case: the string '\n' counts as a "trailing" empty line. -var clip=string[string.length-1]==='\n';var keep=clip&&(string[string.length-2]==='\n'||string==='\n');var chomp=keep?'+':clip?'':'-';return indentIndicator+chomp+'\n';}// (See the note for writeScalar.) -function dropEndingNewline(string){return string[string.length-1]==='\n'?string.slice(0,-1):string;}// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string,width){// In folded style, $k$ consecutive newlines output as $k+1$ newlines— -// unless they're before or after a more-indented line, or at the very -// beginning or end, in which case $k$ maps to $k$. -// Therefore, parse each chunk as newline(s) followed by a content line. -var lineRe=/(\n+)([^\n]*)/g;// first line (possibly an empty line) -var result=function(){var nextLF=string.indexOf('\n');nextLF=nextLF!==-1?nextLF:string.length;lineRe.lastIndex=nextLF;return foldLine(string.slice(0,nextLF),width);}();// If we haven't reached the first content line yet, don't add an extra \n. -var prevMoreIndented=string[0]==='\n'||string[0]===' ';var moreIndented;// rest of the lines -var match;while(match=lineRe.exec(string)){var prefix=match[1],line=match[2];moreIndented=line[0]===' ';result+=prefix+(!prevMoreIndented&&!moreIndented&&line!==''?'\n':'')+foldLine(line,width);prevMoreIndented=moreIndented;}return result;}// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line,width){if(line===''||line[0]===' ')return line;// Since a more-indented line adds a \n, breaks can't be followed by a space. -var breakRe=/ [^ ]/g;// note: the match index will always be <= length-2. -var match;// start is an inclusive index. end, curr, and next are exclusive. -var start=0,end,curr=0,next=0;var result='';// Invariants: 0 <= start <= length-1. -// 0 <= curr <= next <= max(0, length-2). curr - start <= width. -// Inside the loop: -// A match implies length >= 2, so curr and next are <= length-2. -while(match=breakRe.exec(line)){next=match.index;// maintain invariant: curr - start <= width -if(next-start>width){end=curr>start?curr:next;// derive end <= length-2 -result+='\n'+line.slice(start,end);// skip the space that was output as \n -start=end+1;// derive start <= length-1 -}curr=next;}// By the invariants, start <= length-1, so there is something left over. -// It is either the whole string or a part starting from non-whitespace. -result+='\n';// Insert a break if the remainder is too long and there is a break available. -if(line.length-start>width&&curr>start){result+=line.slice(start,curr)+'\n'+line.slice(curr+1);}else{result+=line.slice(start);}return result.slice(1);// drop extra \n joiner -}// Escapes a double-quoted string. -function escapeString(string){var result='';var char,nextChar;var escapeSeq;for(var i=0;i=0xD800&&char<=0xDBFF/* high surrogate */){nextChar=string.charCodeAt(i+1);if(nextChar>=0xDC00&&nextChar<=0xDFFF/* low surrogate */){// Combine the surrogate pair and store it escaped. -result+=encodeHex((char-0xD800)*0x400+nextChar-0xDC00+0x10000);// Advance index one extra since we already used that char here. -i++;continue;}}escapeSeq=ESCAPE_SEQUENCES[char];result+=!escapeSeq&&isPrintable(char)?string[i]:escapeSeq||encodeHex(char);}return result;}function writeFlowSequence(state,level,object){var _result='',_tag=state.tag,index,length;for(index=0,length=object.length;index1024)pairBuffer+='? ';pairBuffer+=state.dump+(state.condenseFlow?'"':'')+':'+(state.condenseFlow?'':' ');if(!writeNode(state,level,objectValue,false,false)){continue;// Skip this pair because of invalid value. -}pairBuffer+=state.dump;// Both key and value are valid. -_result+=pairBuffer;}state.tag=_tag;state.dump='{'+_result+'}';}function writeBlockMapping(state,level,object,compact){var _result='',_tag=state.tag,objectKeyList=Object.keys(object),index,length,objectKey,objectValue,explicitPair,pairBuffer;// Allow sorting keys so that the output file is deterministic -if(state.sortKeys===true){// Default sorting -objectKeyList.sort();}else if(typeof state.sortKeys==='function'){// Custom sort function -objectKeyList.sort(state.sortKeys);}else if(state.sortKeys){// Something is wrong -throw new YAMLException('sortKeys must be a boolean or a function');}for(index=0,length=objectKeyList.length;index1024;if(explicitPair){if(state.dump&&CHAR_LINE_FEED===state.dump.charCodeAt(0)){pairBuffer+='?';}else{pairBuffer+='? ';}}pairBuffer+=state.dump;if(explicitPair){pairBuffer+=generateNextLine(state,level);}if(!writeNode(state,level+1,objectValue,true,explicitPair)){continue;// Skip this pair because of invalid value. -}if(state.dump&&CHAR_LINE_FEED===state.dump.charCodeAt(0)){pairBuffer+=':';}else{pairBuffer+=': ';}pairBuffer+=state.dump;// Both key and value are valid. -_result+=pairBuffer;}state.tag=_tag;state.dump=_result||'{}';// Empty mapping if no valid pairs. -}function detectType(state,object,explicit){var _result,typeList,index,length,type,style;typeList=explicit?state.explicitTypes:state.implicitTypes;for(index=0,length=typeList.length;index tag resolver accepts not "'+style+'" style');}state.dump=_result;}return true;}}return false;}// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state,level,object,block,compact,iskey){state.tag=null;state.dump=object;if(!detectType(state,object,false)){detectType(state,object,true);}var type=_toString.call(state.dump);if(block){block=state.flowLevel<0||state.flowLevel>level;}var objectOrArray=type==='[object Object]'||type==='[object Array]',duplicateIndex,duplicate;if(objectOrArray){duplicateIndex=state.duplicates.indexOf(object);duplicate=duplicateIndex!==-1;}if(state.tag!==null&&state.tag!=='?'||duplicate||state.indent!==2&&level>0){compact=false;}if(duplicate&&state.usedDuplicates[duplicateIndex]){state.dump='*ref_'+duplicateIndex;}else{if(objectOrArray&&duplicate&&!state.usedDuplicates[duplicateIndex]){state.usedDuplicates[duplicateIndex]=true;}if(type==='[object Object]'){if(block&&Object.keys(state.dump).length!==0){writeBlockMapping(state,level,state.dump,compact);if(duplicate){state.dump='&ref_'+duplicateIndex+state.dump;}}else{writeFlowMapping(state,level,state.dump);if(duplicate){state.dump='&ref_'+duplicateIndex+' '+state.dump;}}}else if(type==='[object Array]'){if(block&&state.dump.length!==0){writeBlockSequence(state,level,state.dump,compact);if(duplicate){state.dump='&ref_'+duplicateIndex+state.dump;}}else{writeFlowSequence(state,level,state.dump);if(duplicate){state.dump='&ref_'+duplicateIndex+' '+state.dump;}}}else if(type==='[object String]'){if(state.tag!=='?'){writeScalar(state,state.dump,level,iskey);}}else{if(state.skipInvalid)return false;throw new YAMLException('unacceptable kind of an object to dump '+type);}if(state.tag!==null&&state.tag!=='?'){state.dump='!<'+state.tag+'> '+state.dump;}}return true;}function getDuplicateReferences(object,state){var objects=[],duplicatesIndexes=[],index,length;inspectNode(object,objects,duplicatesIndexes);for(index=0,length=duplicatesIndexes.length;index>10)+0xD800,(c-0x010000&0x03FF)+0xDC00);}var simpleEscapeCheck=new Array(256);// integer, for fast access -var simpleEscapeMap=new Array(256);for(var i=0;i<256;i++){simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0;simpleEscapeMap[i]=simpleEscapeSequence(i);}function State(input,options){this.input=input;this.filename=options['filename']||null;this.schema=options['schema']||DEFAULT_FULL_SCHEMA;this.onWarning=options['onWarning']||null;this.legacy=options['legacy']||false;this.json=options['json']||false;this.listener=options['listener']||null;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=input.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.documents=[];/* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/}function generateError(state,message){return new YAMLException(message,new Mark(state.filename,state.input,state.position,state.line,state.position-state.lineStart));}function throwError(state,message){throw generateError(state,message);}function throwWarning(state,message){if(state.onWarning){state.onWarning.call(null,generateError(state,message));}}var directiveHandlers={YAML:function handleYamlDirective(state,name,args){var match,major,minor;if(state.version!==null){throwError(state,'duplication of %YAML directive');}if(args.length!==1){throwError(state,'YAML directive accepts exactly one argument');}match=/^([0-9]+)\.([0-9]+)$/.exec(args[0]);if(match===null){throwError(state,'ill-formed argument of the YAML directive');}major=parseInt(match[1],10);minor=parseInt(match[2],10);if(major!==1){throwError(state,'unacceptable YAML version of the document');}state.version=args[0];state.checkLineBreaks=minor<2;if(minor!==1&&minor!==2){throwWarning(state,'unsupported YAML version of the document');}},TAG:function handleTagDirective(state,name,args){var handle,prefix;if(args.length!==2){throwError(state,'TAG directive accepts exactly two arguments');}handle=args[0];prefix=args[1];if(!PATTERN_TAG_HANDLE.test(handle)){throwError(state,'ill-formed tag handle (first argument) of the TAG directive');}if(_hasOwnProperty.call(state.tagMap,handle)){throwError(state,'there is a previously declared suffix for "'+handle+'" tag handle');}if(!PATTERN_TAG_URI.test(prefix)){throwError(state,'ill-formed tag prefix (second argument) of the TAG directive');}state.tagMap[handle]=prefix;}};function captureSegment(state,start,end,checkJson){var _position,_length,_character,_result;if(start1){state.result+=common.repeat('\n',count-1);}}function readPlainScalar(state,nodeIndent,withinFlowCollection){var preceding,following,captureStart,captureEnd,hasPendingContent,_line,_lineStart,_lineIndent,_kind=state.kind,_result=state.result,ch;ch=state.input.charCodeAt(state.position);if(is_WS_OR_EOL(ch)||is_FLOW_INDICATOR(ch)||ch===0x23/* # */||ch===0x26/* & */||ch===0x2A/* * */||ch===0x21/* ! */||ch===0x7C/* | */||ch===0x3E/* > */||ch===0x27/* ' */||ch===0x22/* " */||ch===0x25/* % */||ch===0x40/* @ */||ch===0x60/* ` */){return false;}if(ch===0x3F/* ? */||ch===0x2D/* - */){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)||withinFlowCollection&&is_FLOW_INDICATOR(following)){return false;}}state.kind='scalar';state.result='';captureStart=captureEnd=state.position;hasPendingContent=false;while(ch!==0){if(ch===0x3A/* : */){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)||withinFlowCollection&&is_FLOW_INDICATOR(following)){break;}}else if(ch===0x23/* # */){preceding=state.input.charCodeAt(state.position-1);if(is_WS_OR_EOL(preceding)){break;}}else if(state.position===state.lineStart&&testDocumentSeparator(state)||withinFlowCollection&&is_FLOW_INDICATOR(ch)){break;}else if(is_EOL(ch)){_line=state.line;_lineStart=state.lineStart;_lineIndent=state.lineIndent;skipSeparationSpace(state,false,-1);if(state.lineIndent>=nodeIndent){hasPendingContent=true;ch=state.input.charCodeAt(state.position);continue;}else{state.position=captureEnd;state.line=_line;state.lineStart=_lineStart;state.lineIndent=_lineIndent;break;}}if(hasPendingContent){captureSegment(state,captureStart,captureEnd,false);writeFoldedLines(state,state.line-_line);captureStart=captureEnd=state.position;hasPendingContent=false;}if(!is_WHITE_SPACE(ch)){captureEnd=state.position+1;}ch=state.input.charCodeAt(++state.position);}captureSegment(state,captureStart,captureEnd,false);if(state.result){return true;}state.kind=_kind;state.result=_result;return false;}function readSingleQuotedScalar(state,nodeIndent){var ch,captureStart,captureEnd;ch=state.input.charCodeAt(state.position);if(ch!==0x27/* ' */){return false;}state.kind='scalar';state.result='';state.position++;captureStart=captureEnd=state.position;while((ch=state.input.charCodeAt(state.position))!==0){if(ch===0x27/* ' */){captureSegment(state,captureStart,state.position,true);ch=state.input.charCodeAt(++state.position);if(ch===0x27/* ' */){captureStart=state.position;state.position++;captureEnd=state.position;}else{return true;}}else if(is_EOL(ch)){captureSegment(state,captureStart,captureEnd,true);writeFoldedLines(state,skipSeparationSpace(state,false,nodeIndent));captureStart=captureEnd=state.position;}else if(state.position===state.lineStart&&testDocumentSeparator(state)){throwError(state,'unexpected end of the document within a single quoted scalar');}else{state.position++;captureEnd=state.position;}}throwError(state,'unexpected end of the stream within a single quoted scalar');}function readDoubleQuotedScalar(state,nodeIndent){var captureStart,captureEnd,hexLength,hexResult,tmp,ch;ch=state.input.charCodeAt(state.position);if(ch!==0x22/* " */){return false;}state.kind='scalar';state.result='';state.position++;captureStart=captureEnd=state.position;while((ch=state.input.charCodeAt(state.position))!==0){if(ch===0x22/* " */){captureSegment(state,captureStart,state.position,true);state.position++;return true;}else if(ch===0x5C/* \ */){captureSegment(state,captureStart,state.position,true);ch=state.input.charCodeAt(++state.position);if(is_EOL(ch)){skipSeparationSpace(state,false,nodeIndent);// TODO: rework to inline fn with no type cast? -}else if(ch<256&&simpleEscapeCheck[ch]){state.result+=simpleEscapeMap[ch];state.position++;}else if((tmp=escapedHexLen(ch))>0){hexLength=tmp;hexResult=0;for(;hexLength>0;hexLength--){ch=state.input.charCodeAt(++state.position);if((tmp=fromHexCode(ch))>=0){hexResult=(hexResult<<4)+tmp;}else{throwError(state,'expected hexadecimal character');}}state.result+=charFromCodepoint(hexResult);state.position++;}else{throwError(state,'unknown escape sequence');}captureStart=captureEnd=state.position;}else if(is_EOL(ch)){captureSegment(state,captureStart,captureEnd,true);writeFoldedLines(state,skipSeparationSpace(state,false,nodeIndent));captureStart=captureEnd=state.position;}else if(state.position===state.lineStart&&testDocumentSeparator(state)){throwError(state,'unexpected end of the document within a double quoted scalar');}else{state.position++;captureEnd=state.position;}}throwError(state,'unexpected end of the stream within a double quoted scalar');}function readFlowCollection(state,nodeIndent){var readNext=true,_line,_tag=state.tag,_result,_anchor=state.anchor,following,terminator,isPair,isExplicitPair,isMapping,overridableKeys={},keyNode,keyTag,valueNode,ch;ch=state.input.charCodeAt(state.position);if(ch===0x5B/* [ */){terminator=0x5D;/* ] */isMapping=false;_result=[];}else if(ch===0x7B/* { */){terminator=0x7D;/* } */isMapping=true;_result={};}else{return false;}if(state.anchor!==null){state.anchorMap[state.anchor]=_result;}ch=state.input.charCodeAt(++state.position);while(ch!==0){skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if(ch===terminator){state.position++;state.tag=_tag;state.anchor=_anchor;state.kind=isMapping?'mapping':'sequence';state.result=_result;return true;}else if(!readNext){throwError(state,'missed comma between flow collection entries');}keyTag=keyNode=valueNode=null;isPair=isExplicitPair=false;if(ch===0x3F/* ? */){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)){isPair=isExplicitPair=true;state.position++;skipSeparationSpace(state,true,nodeIndent);}}_line=state.line;composeNode(state,nodeIndent,CONTEXT_FLOW_IN,false,true);keyTag=state.tag;keyNode=state.result;skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if((isExplicitPair||state.line===_line)&&ch===0x3A/* : */){isPair=true;ch=state.input.charCodeAt(++state.position);skipSeparationSpace(state,true,nodeIndent);composeNode(state,nodeIndent,CONTEXT_FLOW_IN,false,true);valueNode=state.result;}if(isMapping){storeMappingPair(state,_result,overridableKeys,keyTag,keyNode,valueNode);}else if(isPair){_result.push(storeMappingPair(state,null,overridableKeys,keyTag,keyNode,valueNode));}else{_result.push(keyNode);}skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if(ch===0x2C/* , */){readNext=true;ch=state.input.charCodeAt(++state.position);}else{readNext=false;}}throwError(state,'unexpected end of the stream within a flow collection');}function readBlockScalar(state,nodeIndent){var captureStart,folding,chomping=CHOMPING_CLIP,didReadContent=false,detectedIndent=false,textIndent=nodeIndent,emptyLines=0,atMoreIndented=false,tmp,ch;ch=state.input.charCodeAt(state.position);if(ch===0x7C/* | */){folding=false;}else if(ch===0x3E/* > */){folding=true;}else{return false;}state.kind='scalar';state.result='';while(ch!==0){ch=state.input.charCodeAt(++state.position);if(ch===0x2B/* + */||ch===0x2D/* - */){if(CHOMPING_CLIP===chomping){chomping=ch===0x2B/* + */?CHOMPING_KEEP:CHOMPING_STRIP;}else{throwError(state,'repeat of a chomping mode identifier');}}else if((tmp=fromDecimalCode(ch))>=0){if(tmp===0){throwError(state,'bad explicit indentation width of a block scalar; it cannot be less than one');}else if(!detectedIndent){textIndent=nodeIndent+tmp-1;detectedIndent=true;}else{throwError(state,'repeat of an indentation width identifier');}}else{break;}}if(is_WHITE_SPACE(ch)){do{ch=state.input.charCodeAt(++state.position);}while(is_WHITE_SPACE(ch));if(ch===0x23/* # */){do{ch=state.input.charCodeAt(++state.position);}while(!is_EOL(ch)&&ch!==0);}}while(ch!==0){readLineBreak(state);state.lineIndent=0;ch=state.input.charCodeAt(state.position);while((!detectedIndent||state.lineIndenttextIndent){textIndent=state.lineIndent;}if(is_EOL(ch)){emptyLines++;continue;}// End of the scalar. -if(state.lineIndentnodeIndent)&&ch!==0){throwError(state,'bad indentation of a sequence entry');}else if(state.lineIndentnodeIndent){if(composeNode(state,nodeIndent,CONTEXT_BLOCK_OUT,true,allowCompact)){if(atExplicitKey){keyNode=state.result;}else{valueNode=state.result;}}if(!atExplicitKey){storeMappingPair(state,_result,overridableKeys,keyTag,keyNode,valueNode,_line,_pos);keyTag=keyNode=valueNode=null;}skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position);}if(state.lineIndent>nodeIndent&&ch!==0){throwError(state,'bad indentation of a mapping entry');}else if(state.lineIndent */);if(state.positionparent, 0: this=parent, -1: thisparentIndent){indentStatus=1;}else if(state.lineIndent===parentIndent){indentStatus=0;}else if(state.lineIndentparentIndent){indentStatus=1;}else if(state.lineIndent===parentIndent){indentStatus=0;}else if(state.lineIndent tag; it should be "'+type.kind+'", not "'+state.kind+'"');}if(!type.resolve(state.result)){// `state.result` updated in resolver if matched -throwError(state,'cannot resolve a node with !<'+state.tag+'> explicit tag');}else{state.result=type.construct(state.result);if(state.anchor!==null){state.anchorMap[state.anchor]=state.result;}}}else{throwError(state,'unknown tag !<'+state.tag+'>');}}if(state.listener!==null){state.listener('close',state);}return state.tag!==null||state.anchor!==null||hasContent;}function readDocument(state){var documentStart=state.position,_position,directiveName,directiveArgs,hasDirectives=false,ch;state.version=null;state.checkLineBreaks=state.legacy;state.tagMap={};state.anchorMap={};while((ch=state.input.charCodeAt(state.position))!==0){skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position);if(state.lineIndent>0||ch!==0x25/* % */){break;}hasDirectives=true;ch=state.input.charCodeAt(++state.position);_position=state.position;while(ch!==0&&!is_WS_OR_EOL(ch)){ch=state.input.charCodeAt(++state.position);}directiveName=state.input.slice(_position,state.position);directiveArgs=[];if(directiveName.length<1){throwError(state,'directive name must not be less than one character in length');}while(ch!==0){while(is_WHITE_SPACE(ch)){ch=state.input.charCodeAt(++state.position);}if(ch===0x23/* # */){do{ch=state.input.charCodeAt(++state.position);}while(ch!==0&&!is_EOL(ch));break;}if(is_EOL(ch))break;_position=state.position;while(ch!==0&&!is_WS_OR_EOL(ch)){ch=state.input.charCodeAt(++state.position);}directiveArgs.push(state.input.slice(_position,state.position));}if(ch!==0)readLineBreak(state);if(_hasOwnProperty.call(directiveHandlers,directiveName)){directiveHandlers[directiveName](state,directiveName,directiveArgs);}else{throwWarning(state,'unknown document directive "'+directiveName+'"');}}skipSeparationSpace(state,true,-1);if(state.lineIndent===0&&state.input.charCodeAt(state.position)===0x2D/* - */&&state.input.charCodeAt(state.position+1)===0x2D/* - */&&state.input.charCodeAt(state.position+2)===0x2D/* - */){state.position+=3;skipSeparationSpace(state,true,-1);}else if(hasDirectives){throwError(state,'directives end mark is expected');}composeNode(state,state.lineIndent-1,CONTEXT_BLOCK_OUT,false,true);skipSeparationSpace(state,true,-1);if(state.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart,state.position))){throwWarning(state,'non-ASCII line breaks are interpreted as content');}state.documents.push(state.result);if(state.position===state.lineStart&&testDocumentSeparator(state)){if(state.input.charCodeAt(state.position)===0x2E/* . */){state.position+=3;skipSeparationSpace(state,true,-1);}return;}if(state.position0&&"\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start-1))===-1){start-=1;if(this.position-start>maxLength/2-1){head=' ... ';start+=5;break;}}tail='';end=this.position;while(endmaxLength/2-1){tail=' ... ';end-=5;break;}}snippet=this.buffer.slice(start,end);return common.repeat(' ',indent)+head+snippet+tail+'\n'+common.repeat(' ',indent+this.position-start+head.length)+'^';};Mark.prototype.toString=function toString(compact){var snippet,where='';if(this.name){where+='in "'+this.name+'" ';}where+='at line '+(this.line+1)+', column '+(this.column+1);if(!compact){snippet=this.getSnippet();if(snippet){where+=':\n'+snippet;}}return where;};module.exports=Mark;},{"./common":19}],24:[function(require,module,exports){'use strict';/*eslint-disable max-len*/var common=require('./common');var YAMLException=require('./exception');var Type=require('./type');function compileList(schema,name,result){var exclude=[];schema.include.forEach(function(includedSchema){result=compileList(includedSchema,name,result);});schema[name].forEach(function(currentType){result.forEach(function(previousType,previousIndex){if(previousType.tag===currentType.tag&&previousType.kind===currentType.kind){exclude.push(previousIndex);}});result.push(currentType);});return result.filter(function(type,index){return exclude.indexOf(index)===-1;});}function compileMap()/* lists... */{var result={scalar:{},sequence:{},mapping:{},fallback:{}},index,length;function collectType(type){result[type.kind][type.tag]=result['fallback'][type.tag]=type;}for(index=0,length=arguments.length;index [ padding, CR, LF ] -var BASE64_MAP='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';function resolveYamlBinary(data){if(data===null)return false;var code,idx,bitlen=0,max=data.length,map=BASE64_MAP;// Convert one by one. -for(idx=0;idx64)continue;// Fail on illegal characters -if(code<0)return false;bitlen+=6;}// If there are any bits left, source was corrupted -return bitlen%8===0;}function constructYamlBinary(data){var idx,tailbits,input=data.replace(/[\r\n=]/g,''),// remove CR/LF & padding to simplify scan -max=input.length,map=BASE64_MAP,bits=0,result=[];// Collect by 6*4 bits (3 bytes) -for(idx=0;idx>16&0xFF);result.push(bits>>8&0xFF);result.push(bits&0xFF);}bits=bits<<6|map.indexOf(input.charAt(idx));}// Dump tail -tailbits=max%4*6;if(tailbits===0){result.push(bits>>16&0xFF);result.push(bits>>8&0xFF);result.push(bits&0xFF);}else if(tailbits===18){result.push(bits>>10&0xFF);result.push(bits>>2&0xFF);}else if(tailbits===12){result.push(bits>>4&0xFF);}// Wrap into Buffer for NodeJS and leave Array for browser -if(NodeBuffer){// Support node 6.+ Buffer API when available -return NodeBuffer.from?NodeBuffer.from(result):new NodeBuffer(result);}return result;}function representYamlBinary(object/*, style*/){var result='',bits=0,idx,tail,max=object.length,map=BASE64_MAP;// Convert every three bytes to 4 ASCII characters. -for(idx=0;idx>18&0x3F];result+=map[bits>>12&0x3F];result+=map[bits>>6&0x3F];result+=map[bits&0x3F];}bits=(bits<<8)+object[idx];}// Dump tail -tail=max%3;if(tail===0){result+=map[bits>>18&0x3F];result+=map[bits>>12&0x3F];result+=map[bits>>6&0x3F];result+=map[bits&0x3F];}else if(tail===2){result+=map[bits>>10&0x3F];result+=map[bits>>4&0x3F];result+=map[bits<<2&0x3F];result+=map[64];}else if(tail===1){result+=map[bits>>2&0x3F];result+=map[bits<<4&0x3F];result+=map[64];result+=map[64];}return result;}function isBinary(object){return NodeBuffer&&NodeBuffer.isBuffer(object);}module.exports=new Type('tag:yaml.org,2002:binary',{kind:'scalar',resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary});},{"../type":30}],32:[function(require,module,exports){'use strict';var Type=require('../type');function resolveYamlBoolean(data){if(data===null)return false;var max=data.length;return max===4&&(data==='true'||data==='True'||data==='TRUE')||max===5&&(data==='false'||data==='False'||data==='FALSE');}function constructYamlBoolean(data){return data==='true'||data==='True'||data==='TRUE';}function isBoolean(object){return Object.prototype.toString.call(object)==='[object Boolean]';}module.exports=new Type('tag:yaml.org,2002:bool',{kind:'scalar',resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function lowercase(object){return object?'true':'false';},uppercase:function uppercase(object){return object?'TRUE':'FALSE';},camelcase:function camelcase(object){return object?'True':'False';}},defaultStyle:'lowercase'});},{"../type":30}],33:[function(require,module,exports){'use strict';var common=require('../common');var Type=require('../type');var YAML_FLOAT_PATTERN=new RegExp(// 2.5e4, 2.5 and integers -'^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?'+// .2e4, .2 -// special case, seems not from spec -'|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?'+// 20:59 -'|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*'+// .inf -'|[-+]?\\.(?:inf|Inf|INF)'+// .nan -'|\\.(?:nan|NaN|NAN))$');function resolveYamlFloat(data){if(data===null)return false;if(!YAML_FLOAT_PATTERN.test(data)||// Quick hack to not allow integers end with `_` -// Probably should update regexp & check speed -data[data.length-1]==='_'){return false;}return true;}function constructYamlFloat(data){var value,sign,base,digits;value=data.replace(/_/g,'').toLowerCase();sign=value[0]==='-'?-1:1;digits=[];if('+-'.indexOf(value[0])>=0){value=value.slice(1);}if(value==='.inf'){return sign===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;}else if(value==='.nan'){return NaN;}else if(value.indexOf(':')>=0){value.split(':').forEach(function(v){digits.unshift(parseFloat(v,10));});value=0.0;base=1;digits.forEach(function(d){value+=d*base;base*=60;});return sign*value;}return sign*parseFloat(value,10);}var SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/;function representYamlFloat(object,style){var res;if(isNaN(object)){switch(style){case'lowercase':return'.nan';case'uppercase':return'.NAN';case'camelcase':return'.NaN';}}else if(Number.POSITIVE_INFINITY===object){switch(style){case'lowercase':return'.inf';case'uppercase':return'.INF';case'camelcase':return'.Inf';}}else if(Number.NEGATIVE_INFINITY===object){switch(style){case'lowercase':return'-.inf';case'uppercase':return'-.INF';case'camelcase':return'-.Inf';}}else if(common.isNegativeZero(object)){return'-0.0';}res=object.toString(10);// JS stringifier can build scientific format without dots: 5e-100, -// while YAML requres dot: 5.e-100. Fix it with simple hack -return SCIENTIFIC_WITHOUT_DOT.test(res)?res.replace('e','.e'):res;}function isFloat(object){return Object.prototype.toString.call(object)==='[object Number]'&&(object%1!==0||common.isNegativeZero(object));}module.exports=new Type('tag:yaml.org,2002:float',{kind:'scalar',resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:'lowercase'});},{"../common":19,"../type":30}],34:[function(require,module,exports){'use strict';var common=require('../common');var Type=require('../type');function isHexCode(c){return 0x30/* 0 */<=c&&c<=0x39/* 9 */||0x41/* A */<=c&&c<=0x46/* F */||0x61/* a */<=c&&c<=0x66/* f */;}function isOctCode(c){return 0x30/* 0 */<=c&&c<=0x37/* 7 */;}function isDecCode(c){return 0x30/* 0 */<=c&&c<=0x39/* 9 */;}function resolveYamlInteger(data){if(data===null)return false;var max=data.length,index=0,hasDigits=false,ch;if(!max)return false;ch=data[index];// sign -if(ch==='-'||ch==='+'){ch=data[++index];}if(ch==='0'){// 0 -if(index+1===max)return true;ch=data[++index];// base 2, base 8, base 16 -if(ch==='b'){// base 2 -index++;for(;index=0?'0b'+obj.toString(2):'-0b'+obj.toString(2).slice(1);},octal:function octal(obj){return obj>=0?'0'+obj.toString(8):'-0'+obj.toString(8).slice(1);},decimal:function decimal(obj){return obj.toString(10);},/* eslint-disable max-len */hexadecimal:function hexadecimal(obj){return obj>=0?'0x'+obj.toString(16).toUpperCase():'-0x'+obj.toString(16).toUpperCase().slice(1);}},defaultStyle:'decimal',styleAliases:{binary:[2,'bin'],octal:[8,'oct'],decimal:[10,'dec'],hexadecimal:[16,'hex']}});},{"../common":19,"../type":30}],35:[function(require,module,exports){'use strict';var esprima;// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try{// workaround to exclude package from browserify list. -var _require=require;esprima=_require('esprima');}catch(_){/*global window */if(typeof window!=='undefined')esprima=window.esprima;}var Type=require('../../type');function resolveJavascriptFunction(data){if(data===null)return false;try{var source='('+data+')',ast=esprima.parse(source,{range:true});if(ast.type!=='Program'||ast.body.length!==1||ast.body[0].type!=='ExpressionStatement'||ast.body[0].expression.type!=='ArrowFunctionExpression'&&ast.body[0].expression.type!=='FunctionExpression'){return false;}return true;}catch(err){return false;}}function constructJavascriptFunction(data){/*jslint evil:true*/var source='('+data+')',ast=esprima.parse(source,{range:true}),params=[],body;if(ast.type!=='Program'||ast.body.length!==1||ast.body[0].type!=='ExpressionStatement'||ast.body[0].expression.type!=='ArrowFunctionExpression'&&ast.body[0].expression.type!=='FunctionExpression'){throw new Error('Failed to resolve function');}ast.body[0].expression.params.forEach(function(param){params.push(param.name);});body=ast.body[0].expression.body.range;// Esprima's ranges include the first '{' and the last '}' characters on -// function expressions. So cut them out. -if(ast.body[0].expression.body.type==='BlockStatement'){/*eslint-disable no-new-func*/return new Function(params,source.slice(body[0]+1,body[1]-1));}// ES6 arrow functions can omit the BlockStatement. In that case, just return -// the body. -/*eslint-disable no-new-func*/return new Function(params,'return '+source.slice(body[0],body[1]));}function representJavascriptFunction(object/*, style*/){return object.toString();}function isFunction(object){return Object.prototype.toString.call(object)==='[object Function]';}module.exports=new Type('tag:yaml.org,2002:js/function',{kind:'scalar',resolve:resolveJavascriptFunction,construct:constructJavascriptFunction,predicate:isFunction,represent:representJavascriptFunction});},{"../../type":30}],36:[function(require,module,exports){'use strict';var Type=require('../../type');function resolveJavascriptRegExp(data){if(data===null)return false;if(data.length===0)return false;var regexp=data,tail=/\/([gim]*)$/.exec(data),modifiers='';// if regexp starts with '/' it can have modifiers and must be properly closed -// `/foo/gim` - modifiers tail can be maximum 3 chars -if(regexp[0]==='/'){if(tail)modifiers=tail[1];if(modifiers.length>3)return false;// if expression starts with /, is should be properly terminated -if(regexp[regexp.length-modifiers.length-1]!=='/')return false;}return true;}function constructJavascriptRegExp(data){var regexp=data,tail=/\/([gim]*)$/.exec(data),modifiers='';// `/foo/gim` - tail can be maximum 4 chars -if(regexp[0]==='/'){if(tail)modifiers=tail[1];regexp=regexp.slice(1,regexp.length-modifiers.length-1);}return new RegExp(regexp,modifiers);}function representJavascriptRegExp(object/*, style*/){var result='/'+object.source+'/';if(object.global)result+='g';if(object.multiline)result+='m';if(object.ignoreCase)result+='i';return result;}function isRegExp(object){return Object.prototype.toString.call(object)==='[object RegExp]';}module.exports=new Type('tag:yaml.org,2002:js/regexp',{kind:'scalar',resolve:resolveJavascriptRegExp,construct:constructJavascriptRegExp,predicate:isRegExp,represent:representJavascriptRegExp});},{"../../type":30}],37:[function(require,module,exports){'use strict';var Type=require('../../type');function resolveJavascriptUndefined(){return true;}function constructJavascriptUndefined(){/*eslint-disable no-undefined*/return undefined;}function representJavascriptUndefined(){return'';}function isUndefined(object){return typeof object==='undefined';}module.exports=new Type('tag:yaml.org,2002:js/undefined',{kind:'scalar',resolve:resolveJavascriptUndefined,construct:constructJavascriptUndefined,predicate:isUndefined,represent:representJavascriptUndefined});},{"../../type":30}],38:[function(require,module,exports){'use strict';var Type=require('../type');module.exports=new Type('tag:yaml.org,2002:map',{kind:'mapping',construct:function construct(data){return data!==null?data:{};}});},{"../type":30}],39:[function(require,module,exports){'use strict';var Type=require('../type');function resolveYamlMerge(data){return data==='<<'||data===null;}module.exports=new Type('tag:yaml.org,2002:merge',{kind:'scalar',resolve:resolveYamlMerge});},{"../type":30}],40:[function(require,module,exports){'use strict';var Type=require('../type');function resolveYamlNull(data){if(data===null)return true;var max=data.length;return max===1&&data==='~'||max===4&&(data==='null'||data==='Null'||data==='NULL');}function constructYamlNull(){return null;}function isNull(object){return object===null;}module.exports=new Type('tag:yaml.org,2002:null',{kind:'scalar',resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function canonical(){return'~';},lowercase:function lowercase(){return'null';},uppercase:function uppercase(){return'NULL';},camelcase:function camelcase(){return'Null';}},defaultStyle:'lowercase'});},{"../type":30}],41:[function(require,module,exports){'use strict';var Type=require('../type');var _hasOwnProperty=Object.prototype.hasOwnProperty;var _toString=Object.prototype.toString;function resolveYamlOmap(data){if(data===null)return true;var objectKeys=[],index,length,pair,pairKey,pairHasKey,object=data;for(index=0,length=object.length;index0){var thisPos=stack.indexOf(this);~thisPos?stack.splice(thisPos+1):stack.push(this);~thisPos?keys.splice(thisPos,Infinity,key):keys.push(key);if(~stack.indexOf(value))value=cycleReplacer.call(this,key,value);}else stack.push(value);return replacer==null?value:replacer.call(this,key,value);};}},{}],48:[function(require,module,exports){var getNative=require('./_getNative'),root=require('./_root');/* Built-in method references that are verified to be native. */var DataView=getNative(root,'DataView');module.exports=DataView;},{"./_getNative":112,"./_root":149}],49:[function(require,module,exports){var hashClear=require('./_hashClear'),hashDelete=require('./_hashDelete'),hashGet=require('./_hashGet'),hashHas=require('./_hashHas'),hashSet=require('./_hashSet');/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}object=Object(object);while(++indexarrLength)){return false;}// Assume cyclic values are equal. -var stacked=stack.get(array);if(stacked&&stack.get(other)){return stacked==other;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache():undefined;stack.set(array,other);stack.set(other,array);// Ignore non-index properties. -while(++index-1&&value%1==0&&value-1;}module.exports=listCacheHas;},{"./_assocIndexOf":68}],134:[function(require,module,exports){var assocIndexOf=require('./_assocIndexOf');/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}module.exports=listCacheSet;},{"./_assocIndexOf":68}],135:[function(require,module,exports){var Hash=require('./_Hash'),ListCache=require('./_ListCache'),Map=require('./_Map');/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}module.exports=mapCacheClear;},{"./_Hash":49,"./_ListCache":50,"./_Map":51}],136:[function(require,module,exports){var getMapData=require('./_getMapData');/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */function mapCacheDelete(key){var result=getMapData(this,key)['delete'](key);this.size-=result?1:0;return result;}module.exports=mapCacheDelete;},{"./_getMapData":110}],137:[function(require,module,exports){var getMapData=require('./_getMapData');/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */function mapCacheGet(key){return getMapData(this,key).get(key);}module.exports=mapCacheGet;},{"./_getMapData":110}],138:[function(require,module,exports){var getMapData=require('./_getMapData');/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */function mapCacheHas(key){return getMapData(this,key).has(key);}module.exports=mapCacheHas;},{"./_getMapData":110}],139:[function(require,module,exports){var getMapData=require('./_getMapData');/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}module.exports=mapCacheSet;},{"./_getMapData":110}],140:[function(require,module,exports){/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}module.exports=mapToArray;},{}],141:[function(require,module,exports){/** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */function matchesStrictComparable(key,srcValue){return function(object){if(object==null){return false;}return object[key]===srcValue&&(srcValue!==undefined||key in Object(object));};}module.exports=matchesStrictComparable;},{}],142:[function(require,module,exports){var memoize=require('./memoize');/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE=500;/** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */function memoizeCapped(func){var result=memoize(func,function(key){if(cache.size===MAX_MEMOIZE_SIZE){cache.clear();}return key;});var cache=result.cache;return result;}module.exports=memoizeCapped;},{"./memoize":183}],143:[function(require,module,exports){var getNative=require('./_getNative');/* Built-in method references that are verified to be native. */var nativeCreate=getNative(Object,'create');module.exports=nativeCreate;},{"./_getNative":112}],144:[function(require,module,exports){var overArg=require('./_overArg');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeKeys=overArg(Object.keys,Object);module.exports=nativeKeys;},{"./_overArg":147}],145:[function(require,module,exports){var freeGlobal=require('./_freeGlobal');/** Detect free variable `exports`. */var freeExports=(typeof exports==="undefined"?"undefined":_typeof2(exports))=='object'&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&(typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{// Use `util.types` for Node.js 10+. -var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}// Legacy `process.binding('util')` for Node.js < 10. -return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();module.exports=nodeUtil;},{"./_freeGlobal":108}],146:[function(require,module,exports){/** Used for built-in method references. */var objectProto=Object.prototype;/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */var nativeObjectToString=objectProto.toString;/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */function objectToString(value){return nativeObjectToString.call(value);}module.exports=objectToString;},{}],147:[function(require,module,exports){/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */function overArg(func,transform){return function(arg){return func(transform(arg));};}module.exports=overArg;},{}],148:[function(require,module,exports){var apply=require('./_apply');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax=Math.max;/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index0){if(++count>=HOT_COUNT){return arguments[0];}}else{count=0;}return func.apply(undefined,arguments);};}module.exports=shortOut;},{}],155:[function(require,module,exports){var ListCache=require('./_ListCache');/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */function stackClear(){this.__data__=new ListCache();this.size=0;}module.exports=stackClear;},{"./_ListCache":50}],156:[function(require,module,exports){/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */function stackDelete(key){var data=this.__data__,result=data['delete'](key);this.size=data.size;return result;}module.exports=stackDelete;},{}],157:[function(require,module,exports){/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */function stackGet(key){return this.__data__.get(key);}module.exports=stackGet;},{}],158:[function(require,module,exports){/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */function stackHas(key){return this.__data__.has(key);}module.exports=stackHas;},{}],159:[function(require,module,exports){var ListCache=require('./_ListCache'),Map=require('./_Map'),MapCache=require('./_MapCache');/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length { 'a': 1, 'c': 3 } - */var assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return;}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key]);}}});module.exports=assign;},{"./_assignValue":67,"./_copyObject":99,"./_createAssigner":101,"./_isPrototype":128,"./isArrayLike":173,"./keys":182}],164:[function(require,module,exports){/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */function constant(value){return function(){return value;};}module.exports=constant;},{}],165:[function(require,module,exports){var baseAssign=require('./_baseAssign'),baseCreate=require('./_baseCreate');/** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */function create(prototype,properties){var result=baseCreate(prototype);return properties==null?result:baseAssign(result,properties);}module.exports=create;},{"./_baseAssign":69,"./_baseCreate":71}],166:[function(require,module,exports){/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */function eq(value,other){return value===other||value!==value&&other!==other;}module.exports=eq;},{}],167:[function(require,module,exports){var arrayEvery=require('./_arrayEvery'),baseEvery=require('./_baseEvery'),baseIteratee=require('./_baseIteratee'),isArray=require('./isArray'),isIterateeCall=require('./_isIterateeCall');/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined;}return func(collection,baseIteratee(predicate,3));}module.exports=every;},{"./_arrayEvery":61,"./_baseEvery":73,"./_baseIteratee":86,"./_isIterateeCall":124,"./isArray":172}],168:[function(require,module,exports){var baseGet=require('./_baseGet');/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,path);return result===undefined?defaultValue:result;}module.exports=get;},{"./_baseGet":76}],169:[function(require,module,exports){var baseHasIn=require('./_baseHasIn'),hasPath=require('./_hasPath');/** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn);}module.exports=hasIn;},{"./_baseHasIn":79,"./_hasPath":117}],170:[function(require,module,exports){/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */function identity(value){return value;}module.exports=identity;},{}],171:[function(require,module,exports){var baseIsArguments=require('./_baseIsArguments'),isObjectLike=require('./isObjectLike');/** Used for built-in method references. */var objectProto=Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** Built-in value references. */var propertyIsEnumerable=objectProto.propertyIsEnumerable;/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};module.exports=isArguments;},{"./_baseIsArguments":80,"./isObjectLike":179}],172:[function(require,module,exports){/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */var isArray=Array.isArray;module.exports=isArray;},{}],173:[function(require,module,exports){var isFunction=require('./isFunction'),isLength=require('./isLength');/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}module.exports=isArrayLike;},{"./isFunction":176,"./isLength":177}],174:[function(require,module,exports){var root=require('./_root'),stubFalse=require('./stubFalse');/** Detect free variable `exports`. */var freeExports=(typeof exports==="undefined"?"undefined":_typeof2(exports))=='object'&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&(typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Built-in value references. */var Buffer=moduleExports?root.Buffer:undefined;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsBuffer=Buffer?Buffer.isBuffer:undefined;/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */var isBuffer=nativeIsBuffer||stubFalse;module.exports=isBuffer;},{"./_root":149,"./stubFalse":186}],175:[function(require,module,exports){var baseKeys=require('./_baseKeys'),getTag=require('./_getTag'),isArguments=require('./isArguments'),isArray=require('./isArray'),isArrayLike=require('./isArrayLike'),isBuffer=require('./isBuffer'),isPrototype=require('./_isPrototype'),isTypedArray=require('./isTypedArray');/** `Object#toString` result references. */var mapTag='[object Map]',setTag='[object Set]';/** Used for built-in method references. */var objectProto=Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */function isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||typeof value=='string'||typeof value.splice=='function'||isBuffer(value)||isTypedArray(value)||isArguments(value))){return!value.length;}var tag=getTag(value);if(tag==mapTag||tag==setTag){return!value.size;}if(isPrototype(value)){return!baseKeys(value).length;}for(var key in value){if(hasOwnProperty.call(value,key)){return false;}}return true;}module.exports=isEmpty;},{"./_baseKeys":87,"./_getTag":115,"./_isPrototype":128,"./isArguments":171,"./isArray":172,"./isArrayLike":173,"./isBuffer":174,"./isTypedArray":181}],176:[function(require,module,exports){var baseGetTag=require('./_baseGetTag'),isObject=require('./isObject');/** `Object#toString` result references. */var asyncTag='[object AsyncFunction]',funcTag='[object Function]',genTag='[object GeneratorFunction]',proxyTag='[object Proxy]';/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */function isFunction(value){if(!isObject(value)){return false;}// The use of `Object#toString` avoids issues with the `typeof` operator -// in Safari 9 which returns 'object' for typed arrays and other constructors. -var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}module.exports=isFunction;},{"./_baseGetTag":78,"./isObject":178}],177:[function(require,module,exports){/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER=9007199254740991;/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}module.exports=isLength;},{}],178:[function(require,module,exports){/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */function isObject(value){var type=typeof value==="undefined"?"undefined":_typeof2(value);return value!=null&&(type=='object'||type=='function');}module.exports=isObject;},{}],179:[function(require,module,exports){/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */function isObjectLike(value){return value!=null&&(typeof value==="undefined"?"undefined":_typeof2(value))=='object';}module.exports=isObjectLike;},{}],180:[function(require,module,exports){var baseGetTag=require('./_baseGetTag'),isObjectLike=require('./isObjectLike');/** `Object#toString` result references. */var symbolTag='[object Symbol]';/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */function isSymbol(value){return(typeof value==="undefined"?"undefined":_typeof2(value))=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}module.exports=isSymbol;},{"./_baseGetTag":78,"./isObjectLike":179}],181:[function(require,module,exports){var baseIsTypedArray=require('./_baseIsTypedArray'),baseUnary=require('./_baseUnary'),nodeUtil=require('./_nodeUtil');/* Node.js helper references. */var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isTypedArray;},{"./_baseIsTypedArray":85,"./_baseUnary":96,"./_nodeUtil":145}],182:[function(require,module,exports){var arrayLikeKeys=require('./_arrayLikeKeys'),baseKeys=require('./_baseKeys'),isArrayLike=require('./isArrayLike');/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}module.exports=keys;},{"./_arrayLikeKeys":63,"./_baseKeys":87,"./isArrayLike":173}],183:[function(require,module,exports){var MapCache=require('./_MapCache');/** Error message constants. */var FUNC_ERROR_TEXT='Expected a function';/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */function memoize(func,resolver){if(typeof func!='function'||resolver!=null&&typeof resolver!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function memoized(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result;};memoized.cache=new(memoize.Cache||MapCache)();return memoized;}// Expose `MapCache`. -memoize.Cache=MapCache;module.exports=memoize;},{"./_MapCache":52}],184:[function(require,module,exports){var baseProperty=require('./_baseProperty'),basePropertyDeep=require('./_basePropertyDeep'),isKey=require('./_isKey'),toKey=require('./_toKey');/** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - * @example - * - * var objects = [ - * { 'a': { 'b': 2 } }, - * { 'a': { 'b': 1 } } - * ]; - * - * _.map(objects, _.property('a.b')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); - * // => [1, 2] - */function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path);}module.exports=property;},{"./_baseProperty":90,"./_basePropertyDeep":91,"./_isKey":125,"./_toKey":161}],185:[function(require,module,exports){/** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */function stubArray(){return[];}module.exports=stubArray;},{}],186:[function(require,module,exports){/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */function stubFalse(){return false;}module.exports=stubFalse;},{}],187:[function(require,module,exports){var baseToString=require('./_baseToString');/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */function toString(value){return value==null?'':baseToString(value);}module.exports=toString;},{"./_baseToString":95}],188:[function(require,module,exports){(function(process){'use strict';if(!process.version||process.version.indexOf('v0.')===0||process.version.indexOf('v1.')===0&&process.version.indexOf('v1.8.')!==0){module.exports={nextTick:nextTick};}else{module.exports=process;}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=='function'){throw new TypeError('"callback" argument must be a function');}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1);});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2);});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3);});default:args=new Array(len-1);i=0;while(i1){for(var i=1;i*/var pna=require('process-nextick-args');/**//**/var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){keys.push(key);}return keys;};/**/module.exports=Duplex;/**/var util=require('core-util-is');util.inherits=require('inherits');/**/var Readable=require('./_stream_readable');var Writable=require('./_stream_writable');util.inherits(Duplex,Readable);{// avoid scope creep, the keys array can then be collected -var keys=objectKeys(Writable.prototype);for(var v=0;v*/var util=require('core-util-is');util.inherits=require('inherits');/**/util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":194,"core-util-is":9,"inherits":14}],193:[function(require,module,exports){(function(process,global){// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -'use strict';/**/var pna=require('process-nextick-args');/**/module.exports=Readable;/**/var isArray=require('isarray');/**//**/var Duplex;/**/Readable.ReadableState=ReadableState;/**/var EE=require('events').EventEmitter;var EElistenerCount=function EElistenerCount(emitter,type){return emitter.listeners(type).length;};/**//**/var Stream=require('./internal/streams/stream');/**//**/var Buffer=require('safe-buffer').Buffer;var OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk);}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array;}/**//**/var util=require('core-util-is');util.inherits=require('inherits');/**//**/var debugUtil=require('util');var debug=void 0;if(debugUtil&&debugUtil.debuglog){debug=debugUtil.debuglog('stream');}else{debug=function debug(){};}/**/var BufferList=require('./internal/streams/BufferList');var destroyImpl=require('./internal/streams/destroy');var StringDecoder;util.inherits(Readable,Stream);var kProxyEvents=['error','close','destroy','pause','resume'];function prependListener(emitter,event,fn){// Sadly this is not cacheable as some libraries bundle their own -// event emitter implementation with them. -if(typeof emitter.prependListener==='function')return emitter.prependListener(event,fn);// This is a hack to make sure that our error handler is attached before any -// userland ones. NEVER DO THIS. This is here only because this code needs -// to continue to work with older versions of Node.js that do not include -// the prependListener() method. The goal is to eventually remove this hack. -if(!emitter._events||!emitter._events[event])emitter.on(event,fn);else if(isArray(emitter._events[event]))emitter._events[event].unshift(fn);else emitter._events[event]=[fn,emitter._events[event]];}function ReadableState(options,stream){Duplex=Duplex||require('./_stream_duplex');options=options||{};// Duplex streams are both readable and writable, but share -// the same options object. -// However, some cases require setting options to different -// values for the readable and the writable sides of the duplex stream. -// These options can be provided separately as readableXXX and writableXXX. -var isDuplex=stream instanceof Duplex;// object stream flag. Used to make read(n) ignore n and to -// make all the buffer merging and length checks go away -this.objectMode=!!options.objectMode;if(isDuplex)this.objectMode=this.objectMode||!!options.readableObjectMode;// the point at which it stops calling _read() to fill the buffer -// Note: 0 is a valid value, means "don't call _read preemptively ever" -var hwm=options.highWaterMark;var readableHwm=options.readableHighWaterMark;var defaultHwm=this.objectMode?16:16*1024;if(hwm||hwm===0)this.highWaterMark=hwm;else if(isDuplex&&(readableHwm||readableHwm===0))this.highWaterMark=readableHwm;else this.highWaterMark=defaultHwm;// cast to ints. -this.highWaterMark=Math.floor(this.highWaterMark);// A linked list is used to store data chunks instead of an array because the -// linked list can remove elements from the beginning faster than -// array.shift() -this.buffer=new BufferList();this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;// a flag to be able to tell if the event 'readable'/'data' is emitted -// immediately, or on a later tick. We set this to true at first, because -// any actions that shouldn't happen until "later" should generally also -// not happen before the first read call. -this.sync=true;// whenever we return null, then we set a flag to say -// that we're awaiting a 'readable' event emission. -this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;// has it been destroyed -this.destroyed=false;// Crypto is kind of old and crusty. Historically, its default string -// encoding is 'binary' so we have to make this configurable. -// Everything else in the universe uses 'utf8', though. -this.defaultEncoding=options.defaultEncoding||'utf8';// the number of writers that are awaiting a drain event in .pipe()s -this.awaitDrain=0;// if true, a maybeReadMore has been scheduled -this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require('string_decoder/').StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding;}}function Readable(options){Duplex=Duplex||require('./_stream_duplex');if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);// legacy -this.readable=true;if(options){if(typeof options.read==='function')this._read=options.read;if(typeof options.destroy==='function')this._destroy=options.destroy;}Stream.call(this);}Object.defineProperty(Readable.prototype,'destroyed',{get:function get(){if(this._readableState===undefined){return false;}return this._readableState.destroyed;},set:function set(value){// we ignore the value if the stream -// has not been initialized yet -if(!this._readableState){return;}// backward compatibility, the user is explicitly -// managing destroyed -this._readableState.destroyed=value;}});Readable.prototype.destroy=destroyImpl.destroy;Readable.prototype._undestroy=destroyImpl.undestroy;Readable.prototype._destroy=function(err,cb){this.push(null);cb(err);};// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push=function(chunk,encoding){var state=this._readableState;var skipChunkCheck;if(!state.objectMode){if(typeof chunk==='string'){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=Buffer.from(chunk,encoding);encoding='';}skipChunkCheck=true;}}else{skipChunkCheck=true;}return readableAddChunk(this,chunk,encoding,false,skipChunkCheck);};// Unshift should *always* be something directly out of read() -Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,true,false);};function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var state=stream._readableState;if(chunk===null){state.reading=false;onEofChunk(stream,state);}else{var er;if(!skipChunkCheck)er=chunkInvalid(state,chunk);if(er){stream.emit('error',er);}else if(state.objectMode||chunk&&chunk.length>0){if(typeof chunk!=='string'&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype){chunk=_uint8ArrayToBuffer(chunk);}if(addToFront){if(state.endEmitted)stream.emit('error',new Error('stream.unshift() after end event'));else addChunk(stream,state,chunk,true);}else if(state.ended){stream.emit('error',new Error('stream.push() after EOF'));}else{state.reading=false;if(state.decoder&&!encoding){chunk=state.decoder.write(chunk);if(state.objectMode||chunk.length!==0)addChunk(stream,state,chunk,false);else maybeReadMore(stream,state);}else{addChunk(stream,state,chunk,false);}}}else if(!addToFront){state.reading=false;}}return needMoreData(state);}function addChunk(stream,state,chunk,addToFront){if(state.flowing&&state.length===0&&!state.sync){stream.emit('data',chunk);stream.read(0);}else{// update the buffer info. -state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream);}maybeReadMore(stream,state);}function chunkInvalid(state,chunk){var er;if(!_isUint8Array(chunk)&&typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}return er;}// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state){return!state.ended&&(state.needReadable||state.length 8MB -var MAX_HWM=0x800000;function computeNewHighWaterMark(n){if(n>=MAX_HWM){n=MAX_HWM;}else{// Get the next highest power of 2 to prevent increasing hwm excessively in -// tiny amounts -n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++;}return n;}// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time -if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm. -if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough -if(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below. -Readable.prototype.read=function(n){debug('read',n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;// if we're doing read(0) to trigger a readable event, but we -// already have a bunch of data in the buffer, then just trigger -// the 'readable' event and move on. -if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug('read: emitReadable',state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null;}n=howMuchToRead(n,state);// if we've ended, and we're now clear, then finish it up. -if(n===0&&state.ended){if(state.length===0)endReadable(this);return null;}// All the actual chunk generation logic needs to be -// *below* the call to _read. The reason is that in certain -// synthetic stream cases, such as passthrough streams, _read -// may be a completely synchronous operation which may change -// the state of the read buffer, providing enough data when -// before there was *not* enough. -// -// So, the steps are: -// 1. Figure out what the state of things will be after we do -// a read from the buffer. -// -// 2. If that resulting state will trigger a _read, then call _read. -// Note that this may be asynchronous, or synchronous. Yes, it is -// deeply ugly to write APIs this way, but that still doesn't mean -// that the Readable class should behave improperly, as streams are -// designed to be sync/async agnostic. -// Take note if the _read call is sync or async (ie, if the read call -// has returned yet), so that we know whether or not it's safe to emit -// 'readable' etc. -// -// 3. Actually pull the requested chunks out of the buffer and return. -// if we need a readable event, then we need to do some reading. -var doRead=state.needReadable;debug('need readable',doRead);// if we currently have less than the highWaterMark, then also read some -if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0;}else{state.length-=n;}if(state.length===0){// If we have nothing in the buffer, then we want to know -// as soon as we *do* get something into the buffer. -if(!state.ended)state.needReadable=true;// If we tried to read() past the EOF, then emit end on the next tick. -if(nOrig!==n&&state.ended)endReadable(this);}if(ret!==null)this.emit('data',ret);return ret;};function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length;}}state.ended=true;// emit 'readable' now to make sure it gets picked up. -emitReadable(stream);}// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug('emitReadable',state.flowing);state.emittedReadable=true;if(state.sync)pna.nextTick(emitReadable_,stream);else emitReadable_(stream);}}function emitReadable_(stream){debug('emit readable');stream.emit('readable');flow(stream);}// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length Introduce a guard on increasing awaitDrain. -var increasedAwaitDrain=false;src.on('data',ondata);function ondata(chunk){debug('ondata');increasedAwaitDrain=false;var ret=dest.write(chunk);if(false===ret&&!increasedAwaitDrain){// If the user unpiped during `dest.write()`, it is possible -// to get stuck in a permanently paused state if that write -// also returned false. -// => Check whether `dest` is still a piping destination. -if((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug('false write response, pause',src._readableState.awaitDrain);src._readableState.awaitDrain++;increasedAwaitDrain=true;}src.pause();}}// if the dest has an error, then stop piping into it. -// however, don't suppress the throwing behavior for this. -function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones. -prependListener(dest,'error',onerror);// Both close and finish should trigger unpipe, but only once. -function onclose(){dest.removeListener('finish',onfinish);unpipe();}dest.once('close',onclose);function onfinish(){debug('onfinish');dest.removeListener('close',onclose);unpipe();}dest.once('finish',onfinish);function unpipe(){debug('unpipe');src.unpipe(dest);}// tell the dest that it's being piped to -dest.emit('pipe',src);// start the flow if it hasn't been started already. -if(!state.flowing){debug('pipe resume');src.resume();}return dest;};function pipeOnDrain(src){return function(){var state=src._readableState;debug('pipeOnDrain',state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,'data')){state.flowing=true;flow(src);}};}Readable.prototype.unpipe=function(dest){var state=this._readableState;var unpipeInfo={hasUnpiped:false};// if we're not piping anywhere, then do nothing. -if(state.pipesCount===0)return this;// just one destination. most common case. -if(state.pipesCount===1){// passed in one, but it's not the right one. -if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;// got a match. -state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit('unpipe',this,unpipeInfo);return this;}// slow case. multiple pipe destinations. -if(!dest){// remove all. -var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var i=0;i=state.length){// read it all, truncate the list -if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=state.buffer.head.data;else ret=state.buffer.concat(state.length);state.buffer.clear();}else{// read part of list -ret=fromListPartial(n,state.buffer,state.decoder);}return ret;}// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n,list,hasStrings){var ret;if(nstr.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=str.slice(nb);}break;}++c;}list.length-=c;return ret;}// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n);var p=list.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=buf.slice(nb);}break;}++c;}list.length-=c;return ret;}function endReadable(stream){var state=stream._readableState;// If we get here before consuming all the bytes, then that is a -// bug in node. Should never happen. -if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;pna.nextTick(endReadableNT,state,stream);}}function endReadableNT(state,stream){// Check that we didn't get one last unshift. -if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit('end');}}function indexOf(xs,x){for(var i=0,l=xs.length;i*/var util=require('core-util-is');util.inherits=require('inherits');/**/util.inherits(Transform,Duplex);function afterTransform(er,data){var ts=this._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb){return this.emit('error',new Error('write callback called multiple times'));}ts.writechunk=null;ts.writecb=null;if(data!=null)// single equals check for both `null` and `undefined` -this.push(data);cb(er);var rs=this._readableState;rs.reading=false;if(rs.needReadable||rs.length*/var pna=require('process-nextick-args');/**/module.exports=Writable;/* */function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null;}// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state){var _this=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(_this,state);};}/* *//**/var asyncWrite=!process.browser&&['v0.10','v0.9.'].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;/**//**/var Duplex;/**/Writable.WritableState=WritableState;/**/var util=require('core-util-is');util.inherits=require('inherits');/**//**/var internalUtil={deprecate:require('util-deprecate')};/**//**/var Stream=require('./internal/streams/stream');/**//**/var Buffer=require('safe-buffer').Buffer;var OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk);}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array;}/**/var destroyImpl=require('./internal/streams/destroy');util.inherits(Writable,Stream);function nop(){}function WritableState(options,stream){Duplex=Duplex||require('./_stream_duplex');options=options||{};// Duplex streams are both readable and writable, but share -// the same options object. -// However, some cases require setting options to different -// values for the readable and the writable sides of the duplex stream. -// These options can be provided separately as readableXXX and writableXXX. -var isDuplex=stream instanceof Duplex;// object stream flag to indicate whether or not this stream -// contains buffers or objects. -this.objectMode=!!options.objectMode;if(isDuplex)this.objectMode=this.objectMode||!!options.writableObjectMode;// the point at which write() starts returning false -// Note: 0 is a valid value, means that we always return false if -// the entire buffer is not flushed immediately on write() -var hwm=options.highWaterMark;var writableHwm=options.writableHighWaterMark;var defaultHwm=this.objectMode?16:16*1024;if(hwm||hwm===0)this.highWaterMark=hwm;else if(isDuplex&&(writableHwm||writableHwm===0))this.highWaterMark=writableHwm;else this.highWaterMark=defaultHwm;// cast to ints. -this.highWaterMark=Math.floor(this.highWaterMark);// if _final has been called -this.finalCalled=false;// drain event flag. -this.needDrain=false;// at the start of calling end() -this.ending=false;// when end() has been called, and returned -this.ended=false;// when 'finish' is emitted -this.finished=false;// has it been destroyed -this.destroyed=false;// should we decode strings into buffers before passing to _write? -// this is here so that some node-core streams can optimize string -// handling at a lower level. -var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;// Crypto is kind of old and crusty. Historically, its default string -// encoding is 'binary' so we have to make this configurable. -// Everything else in the universe uses 'utf8', though. -this.defaultEncoding=options.defaultEncoding||'utf8';// not an actual buffer we keep track of, but a measurement -// of how much we're waiting to get pushed to some underlying -// socket or file. -this.length=0;// a flag to see when we're in the middle of a write. -this.writing=false;// when true all writes will be buffered until .uncork() call -this.corked=0;// a flag to be able to tell if the onwrite cb is called immediately, -// or on a later tick. We set this to true at first, because any -// actions that shouldn't happen until "later" should generally also -// not happen before the first write call. -this.sync=true;// a flag to know if we're processing previously buffered items, which -// may call the _write() callback in the same tick, so that we don't -// end up in an overlapped onwrite situation. -this.bufferProcessing=false;// the callback that's passed to _write(chunk,cb) -this.onwrite=function(er){onwrite(stream,er);};// the callback that the user supplies to write(chunk,encoding,cb) -this.writecb=null;// the amount that is being written when _write is called. -this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;// number of pending user-supplied write callbacks -// this must be 0 before 'finish' can be emitted -this.pendingcb=0;// emit prefinish if the only thing we're waiting for is _write cbs -// This is relevant for synchronous Transform streams -this.prefinished=false;// True if the error was already emitted and should not be thrown again -this.errorEmitted=false;// count buffered requests -this.bufferedRequestCount=0;// allocate the first CorkedRequest, there is always -// one allocated and free to use, and we maintain at most two -this.corkedRequestsFree=new CorkedRequest(this);}WritableState.prototype.getBuffer=function getBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next;}return out;};(function(){try{Object.defineProperty(WritableState.prototype,'buffer',{get:internalUtil.deprecate(function(){return this.getBuffer();},'_writableState.buffer is deprecated. Use _writableState.getBuffer '+'instead.','DEP0003')});}catch(_){}})();// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance;if(typeof Symbol==='function'&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==='function'){realHasInstance=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(object){if(realHasInstance.call(this,object))return true;if(this!==Writable)return false;return object&&object._writableState instanceof WritableState;}});}else{realHasInstance=function realHasInstance(object){return object instanceof this;};}function Writable(options){Duplex=Duplex||require('./_stream_duplex');// Writable ctor is applied to Duplexes, too. -// `realHasInstance` is necessary because using plain `instanceof` -// would return false, as no `_writableState` property is attached. -// Trying to use the custom `instanceof` for Writable here will also break the -// Node.js LazyTransform implementation, which has a non-trivial getter for -// `_writableState` that would lead to infinite recursion. -if(!realHasInstance.call(Writable,this)&&!(this instanceof Duplex)){return new Writable(options);}this._writableState=new WritableState(options,this);// legacy. -this.writable=true;if(options){if(typeof options.write==='function')this._write=options.write;if(typeof options.writev==='function')this._writev=options.writev;if(typeof options.destroy==='function')this._destroy=options.destroy;if(typeof options.final==='function')this._final=options.final;}Stream.call(this);}// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe=function(){this.emit('error',new Error('Cannot pipe, not readable'));};function writeAfterEnd(stream,cb){var er=new Error('write after end');// TODO: defer error events consistently everywhere, not just the cb -stream.emit('error',er);pna.nextTick(cb,er);}// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError('May not write null values to stream');}else if(typeof chunk!=='string'&&chunk!==undefined&&!state.objectMode){er=new TypeError('Invalid non-string/buffer chunk');}if(er){stream.emit('error',er);pna.nextTick(cb,er);valid=false;}return valid;}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;var isBuf=!state.objectMode&&_isUint8Array(chunk);if(isBuf&&!Buffer.isBuffer(chunk)){chunk=_uint8ArrayToBuffer(chunk);}if(typeof encoding==='function'){cb=encoding;encoding=null;}if(isBuf)encoding='buffer';else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=='function')cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(isBuf||validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb);}return ret;};Writable.prototype.cork=function(){var state=this._writableState;state.corked++;};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state);}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){// node::ParseEncoding() requires lower case. -if(typeof encoding==='string')encoding=encoding.toLowerCase();if(!(['hex','utf8','utf-8','ascii','binary','base64','ucs2','ucs-2','utf16le','utf-16le','raw'].indexOf((encoding+'').toLowerCase())>-1))throw new TypeError('Unknown encoding: '+encoding);this._writableState.defaultEncoding=encoding;return this;};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==='string'){chunk=Buffer.from(chunk,encoding);}return chunk;}Object.defineProperty(Writable.prototype,'writableHighWaterMark',{// making it explicit this property is not enumerable -// because otherwise some prototype manipulation in -// userland will fail -enumerable:false,get:function get(){return this._writableState.highWaterMark;}});// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);if(chunk!==newChunk){isBuf=true;encoding='buffer';chunk=newChunk;}}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length*/asyncWrite(afterWrite,stream,state,finished,cb);/**/}else{afterWrite(stream,state,finished,cb);}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);state.pendingcb--;cb();finishMaybe(stream,state);}// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it -function clearBuffer(stream,state){state.bufferProcessing=true;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){// Fast case, write everything using _writev() -var l=state.bufferedRequestCount;var buffer=new Array(l);var holder=state.corkedRequestsFree;holder.entry=entry;var count=0;var allBuffers=true;while(entry){buffer[count]=entry;if(!entry.isBuf)allBuffers=false;entry=entry.next;count+=1;}buffer.allBuffers=allBuffers;doWrite(stream,state,true,state.length,buffer,'',holder.finish);// doWrite is almost always async, defer these to save a bit of time -// as the hot path ends with doWrite -state.pendingcb++;state.lastBufferedRequest=null;if(holder.next){state.corkedRequestsFree=holder.next;holder.next=null;}else{state.corkedRequestsFree=new CorkedRequest(state);}state.bufferedRequestCount=0;}else{// Slow case, write chunks one-by-one -while(entry){var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,false,len,chunk,encoding,cb);entry=entry.next;state.bufferedRequestCount--;// if we didn't call the onwrite immediately, then -// it means that we need to wait until it does. -// also, that means that the chunk and cb are currently -// being processed, so move the buffer counter past them. -if(state.writing){break;}}if(entry===null)state.lastBufferedRequest=null;}state.bufferedRequest=entry;state.bufferProcessing=false;}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error('_write() is not implemented'));};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==='function'){cb=chunk;chunk=null;encoding=null;}else if(typeof encoding==='function'){cb=encoding;encoding=null;}if(chunk!==null&&chunk!==undefined)this.write(chunk,encoding);// .end() fully uncorks -if(state.corked){state.corked=1;this.uncork();}// ignore unnecessary end() calls. -if(!state.ending&&!state.finished)endWritable(this,state,cb);};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing;}function callFinal(stream,state){stream._final(function(err){state.pendingcb--;if(err){stream.emit('error',err);}state.prefinished=true;stream.emit('prefinish');finishMaybe(stream,state);});}function prefinish(stream,state){if(!state.prefinished&&!state.finalCalled){if(typeof stream._final==='function'){state.pendingcb++;state.finalCalled=true;pna.nextTick(callFinal,stream,state);}else{state.prefinished=true;stream.emit('prefinish');}}}function finishMaybe(stream,state){var need=needFinish(state);if(need){prefinish(stream,state);if(state.pendingcb===0){state.finished=true;stream.emit('finish');}}return need;}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)pna.nextTick(cb);else stream.once('finish',cb);}state.ended=true;stream.writable=false;}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;corkReq.entry=null;while(entry){var cb=entry.callback;state.pendingcb--;cb(err);entry=entry.next;}if(state.corkedRequestsFree){state.corkedRequestsFree.next=corkReq;}else{state.corkedRequestsFree=corkReq;}}Object.defineProperty(Writable.prototype,'destroyed',{get:function get(){if(this._writableState===undefined){return false;}return this._writableState.destroyed;},set:function set(value){// we ignore the value if the stream -// has not been initialized yet -if(!this._writableState){return;}// backward compatibility, the user is explicitly -// managing destroyed -this._writableState.destroyed=value;}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){this.end();cb(err);};}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("timers").setImmediate);},{"./_stream_duplex":191,"./internal/streams/destroy":197,"./internal/streams/stream":198,"_process":189,"core-util-is":9,"inherits":14,"process-nextick-args":188,"safe-buffer":203,"timers":211,"util-deprecate":212}],196:[function(require,module,exports){'use strict';function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var Buffer=require('safe-buffer').Buffer;var util=require('util');function copyBuffer(src,target,offset){src.copy(target,offset);}module.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0;}BufferList.prototype.push=function push(v){var entry={data:v,next:null};if(this.length>0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length;};BufferList.prototype.unshift=function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length;};BufferList.prototype.shift=function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret;};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0;};BufferList.prototype.join=function join(s){if(this.length===0)return'';var p=this.head;var ret=''+p.data;while(p=p.next){ret+=s+p.data;}return ret;};BufferList.prototype.concat=function concat(n){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next;}return ret;};return BufferList;}();if(util&&util.inspect&&util.inspect.custom){module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+' '+obj;};}},{"safe-buffer":203,"util":7}],197:[function(require,module,exports){'use strict';/**/var pna=require('process-nextick-args');/**/// undocumented cb() API, needed for core, not for public API -function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err);}else if(err&&(!this._writableState||!this._writableState.errorEmitted)){pna.nextTick(emitErrorNT,this,err);}return this;}// we set destroyed to true before firing error callbacks in order -// to make it re-entrance safe in case destroy() is called within callbacks -if(this._readableState){this._readableState.destroyed=true;}// if this is a duplex stream mark the writable part as destroyed as well -if(this._writableState){this._writableState.destroyed=true;}this._destroy(err||null,function(err){if(!cb&&err){pna.nextTick(emitErrorNT,_this,err);if(_this._writableState){_this._writableState.errorEmitted=true;}}else if(cb){cb(err);}});return this;}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false;}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false;}}function emitErrorNT(self,err){self.emit('error',err);}module.exports={destroy:destroy,undestroy:undestroy};},{"process-nextick-args":188}],198:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":11}],199:[function(require,module,exports){module.exports=require('./readable').PassThrough;},{"./readable":200}],200:[function(require,module,exports){exports=module.exports=require('./lib/_stream_readable.js');exports.Stream=exports;exports.Readable=exports;exports.Writable=require('./lib/_stream_writable.js');exports.Duplex=require('./lib/_stream_duplex.js');exports.Transform=require('./lib/_stream_transform.js');exports.PassThrough=require('./lib/_stream_passthrough.js');},{"./lib/_stream_duplex.js":191,"./lib/_stream_passthrough.js":192,"./lib/_stream_readable.js":193,"./lib/_stream_transform.js":194,"./lib/_stream_writable.js":195}],201:[function(require,module,exports){module.exports=require('./readable').Transform;},{"./readable":200}],202:[function(require,module,exports){module.exports=require('./lib/_stream_writable.js');},{"./lib/_stream_writable.js":195}],203:[function(require,module,exports){/* eslint-disable node/no-deprecated-api */var buffer=require('buffer');var Buffer=buffer.Buffer;// alternative to using Object.keys for old browsers -function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer;}else{// Copy properties from require('buffer') -copyProps(buffer,exports);exports.Buffer=SafeBuffer;}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length);}// Copy static methods from Buffer -copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==='number'){throw new TypeError('Argument must not be a number');}return Buffer(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==='string'){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return Buffer(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return buffer.SlowBuffer(size);};},{"buffer":8}],204:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -module.exports=Stream;var EE=require('events').EventEmitter;var inherits=require('inherits');inherits(Stream,EE);Stream.Readable=require('readable-stream/readable.js');Stream.Writable=require('readable-stream/writable.js');Stream.Duplex=require('readable-stream/duplex.js');Stream.Transform=require('readable-stream/transform.js');Stream.PassThrough=require('readable-stream/passthrough.js');// Backwards-compat with node 0.4.x -Stream.Stream=Stream;// old-style streams. Note that the pipe method (the only relevant -// part of this class) is overridden in the Readable class. -function Stream(){EE.call(this);}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause();}}}source.on('data',ondata);function ondrain(){if(source.readable&&source.resume){source.resume();}}dest.on('drain',ondrain);// If the 'end' option is not supplied, dest.end() will be called when -// source gets the 'end' or 'close' events. Only dest.end() once. -if(!dest._isStdio&&(!options||options.end!==false)){source.on('end',onend);source.on('close',onclose);}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end();}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==='function')dest.destroy();}// don't leave dangling pipes when there are errors. -function onerror(er){cleanup();if(EE.listenerCount(this,'error')===0){throw er;// Unhandled stream error in pipe. -}}source.on('error',onerror);dest.on('error',onerror);// remove all the event listeners that were added. -function cleanup(){source.removeListener('data',ondata);dest.removeListener('drain',ondrain);source.removeListener('end',onend);source.removeListener('close',onclose);source.removeListener('error',onerror);dest.removeListener('error',onerror);source.removeListener('end',cleanup);source.removeListener('close',cleanup);dest.removeListener('close',cleanup);}source.on('end',cleanup);source.on('close',cleanup);dest.on('close',cleanup);dest.emit('pipe',source);// Allow for unix-like usage: A.pipe(B).pipe(C) -return dest;};},{"events":11,"inherits":14,"readable-stream/duplex.js":190,"readable-stream/passthrough.js":199,"readable-stream/readable.js":200,"readable-stream/transform.js":201,"readable-stream/writable.js":202}],205:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -'use strict';/**/var Buffer=require('safe-buffer').Buffer;/**/var isEncoding=Buffer.isEncoding||function(encoding){encoding=''+encoding;switch(encoding&&encoding.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 true;default:return false;}};function _normalizeEncoding(enc){if(!enc)return'utf8';var retried;while(true){switch(enc){case'utf8':case'utf-8':return'utf8';case'ucs2':case'ucs-2':case'utf16le':case'utf-16le':return'utf16le';case'latin1':case'binary':return'latin1';case'base64':case'ascii':case'hex':return enc;default:if(retried)return;// undefined -enc=(''+enc).toLowerCase();retried=true;}}};// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=='string'&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error('Unknown encoding: '+enc);return nenc||enc;}// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case'utf16le':this.text=utf16Text;this.end=utf16End;nb=4;break;case'utf8':this.fillLast=utf8FillLast;nb=4;break;case'base64':this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return;}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb);}StringDecoder.prototype.write=function(buf){if(buf.length===0)return'';var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return'';i=this.lastNeed;this.lastNeed=0;}else{i=0;}if(i>5===0x06)return 2;else if(byte>>4===0x0E)return 3;else if(byte>>3===0x1E)return 4;return byte>>6===0x02?-1:-2;}// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3;}return nb;}return 0;}// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return"\uFFFD";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return"\uFFFD";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return"\uFFFD";}}}}// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal);}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length;}// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)return r+"\uFFFD";return r;}// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString('utf16le',i);if(r){var c=r.charCodeAt(r.length-1);if(c>=0xD800&&c<=0xDBFF){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1);}}return r;}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString('utf16le',i,buf.length-1);}// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString('utf16le',0,end);}return r;}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString('base64',i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1];}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];}return buf.toString('base64',i,buf.length-n);}function base64End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)return r+this.lastChar.toString('base64',0,3-this.lastNeed);return r;}// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf){return buf.toString(this.encoding);}function simpleEnd(buf){return buf&&buf.length?this.write(buf):'';}},{"safe-buffer":203}],206:[function(require,module,exports){(function(process,Buffer){// Transforms a stream of TAP into a stream of result objects -// and string comments. Emits "results" event with summary. -var Writable=require('stream').Writable;if(!Writable){try{Writable=require('readable-stream').Writable;}catch(er){throw new Error('Please install "readable-stream" to use this module '+'with Node.js v0.8 and before');}}var yaml=require('js-yaml');var util=require('util');var assert=require('assert');util.inherits(Parser,Writable);module.exports=Parser;var testPointRE=/^(not )?ok(?: ([0-9]+))?(?:(?: - )?(.*))?\n$/;function parseDirective(line){line=line.trim();var time=line.match(/^time=((?:[1-9][0-9]*|0)(?:\.[0-9]+)?)(ms|s)$/i);if(time){var n=+time[1];if(time[2]==='s')n*=1000;return['time',n];}var type=line.match(/^(todo|skip)\b/i);if(!type)return false;return[type[1].toLowerCase(),line.substr(type[1].length).trim()||true];}function Result(line,count){var parsed=line.match(testPointRE);assert(parsed,'invalid line to Result');var ok=!parsed[1];var id=+(parsed[2]||count+1);this.ok=ok;this.id=id;var src=line;Object.defineProperty(this,'src',{value:line,writable:true,enumerable:false,configurable:false});this.src=line;var rest=parsed[3]||'';var name;rest=rest.replace(/([^\\]|^)((?:\\\\)*)#/g,'$1\n$2').split('\n');name=rest.shift();rest=rest.filter(function(r){return r.trim();}).join('#');// now, let's see if there's a directive in there. -var dir=parseDirective(rest.trim());if(!dir)name+=rest?'#'+rest:'';else this[dir[0]]=dir[1];if(name)this.name=name.trim();return this;}Object.defineProperty(Result.prototype,'toString',{value:function value(){return this.src;},enumerable:false,writable:true,configurable:true});function Parser(options,onComplete){if(typeof options==='function'){onComplete=options;options={};}if(!(this instanceof Parser))return new Parser(options,onComplete);options=options||{};if(onComplete)this.on('complete',onComplete);this.sawValidTap=false;this.failures=[];this.indent=options.indent||'';this.level=options.level||0;Writable.call(this);this.buffer='';this.bailedOut=false;this.planStart=-1;this.planEnd=-1;this.planComment='';this.yamlish='';this.yind='';this.child=null;this.current=null;this.commentQueue=[];this.count=0;this.pass=0;this.fail=0;this.todo=0;this.skip=0;this.ok=true;this.strict=false;this.postPlan=false;}Parser.prototype.createResult=function(line){if(!testPointRE.test(line))return null;this.emitResult();return new Result(line,this.count);};Parser.prototype.nonTap=function(data){if(this.strict){this.failures.push({tapError:'Non-TAP data encountered in strict mode',data:data});this.ok=false;}this.emit('extra',data);};Parser.prototype.processYamlish=function(){var yamlish=this.yamlish;this.yamlish='';this.yind='';if(!this.current){this.nonTap(yamlish);return;}try{var diags=yaml.safeLoad(yamlish);}catch(er){this.nonTap(yamlish);return;}this.current.src+=yamlish;this.current.diag=diags;this.emitResult();};Parser.prototype.write=function(chunk,encoding,cb){if(typeof encoding==='string'&&encoding!=='utf8')chunk=new Buffer(chunk,encoding);if(Buffer.isBuffer(chunk))chunk+='';if(typeof encoding==='function'){cb=encoding;encoding=null;}if(this.bailedOut){if(cb)process.nextTick(cb);return true;}this.buffer+=chunk;do{var match=this.buffer.match(/^.*\r?\n/);if(!match||this.bailedOut)break;this.buffer=this.buffer.substr(match[0].length);this._parse(match[0]);}while(this.buffer.length);if(cb)process.nextTick(cb);return true;};Parser.prototype.end=function(chunk,encoding,cb){if(chunk){if(typeof encoding==='function'){cb=encoding;encoding=null;}this.write(chunk,encoding);}if(this.buffer)this.write('\n');// if we have yamlish, means we didn't finish with a ... -if(this.yamlish)this.nonTap(this.yamlish);this.emitResult();var skipAll;if(this.planEnd===0&&this.planStart===1){this.ok=true;skipAll=true;}else if(this.count!==this.planEnd-this.planStart+1)this.ok=false;if(this.ok&&!skipAll&&this.first!==this.planStart)this.ok=false;if(this.ok&&!skipAll&&this.last!==this.planEnd)this.ok=false;var final={ok:this.ok,count:this.count,pass:this.pass};if(this.fail)final.fail=this.fail;if(this.bailedOut)final.bailout=this.bailedOut;if(this.todo)final.todo=this.todo;if(this.skip)final.skip=this.skip;if(this.planStart!==-1){final.plan={start:this.planStart,end:this.planEnd};if(skipAll){final.plan.skipAll=true;if(this.planComment)final.plan.skipReason=this.planComment;}}// We didn't get any actual tap, so just treat this like a -// 1..0 test, because it was probably just console.log junk -if(!this.sawValidTap){final.plan={start:1,end:0};final.ok=true;}if(this.failures.length)final.failures=this.failures;this.emit('complete',final);Writable.prototype.end.call(this,null,null,cb);};Parser.prototype.bailout=function(reason){this.bailedOut=reason||true;this.ok=false;this.emit('bailout',reason);};Parser.prototype.clearCommentQueue=function(){for(var c=0;c\nfoo\n\nbar\n is yaml for `"foo\nbar"` -// >\nfoo\nbar\n is yaml for `"foo bar"` -if(line==='\n'||line.trim()===''){if(this.child){this.child.write('\n');}else if(this.yind){this.yamlish+='\n';}return;}// After a bailout, everything is ignored -if(this.bailedOut)return;this.emit('line',line);// The only Pragma supported is strict. Others may be added. -var pragma=line.match(/^pragma ([+-])strict\n$/);if(pragma){this.strict=pragma[1]==='+';this.emit('pragma',{strict:this.strict});return;}var bailout=line.match(/^bail out!(.*)\n$/i);if(bailout){this.sawValidTap=true;var reason=bailout[1].trim();this.bailout(reason);return;}// If version is specified, must be at the very beginning. -var version=line.match(/^TAP version ([0-9]+)\n$/i);if(version){version=parseInt(version[1],10);if(version>=13&&this.planStart===-1&&this.count===0)this.emit('version',version);else this.nonTap(line);return;}// still belongs to the child. -if(this.child){if(line.indexOf(this.child.indent)===0){line=line.substr(this.child.indent.length);this.child.write(line);return;}if(line.trim().charAt(0)==='#'){this.emitComment(line);return;}// a child test can only end when we get an test point line. -// anything else is extra. -if(this.child.sawValidTap&&!/^(not )?ok/.test(line)){this.nonTap(line);return;}}// comment, but let "# Subtest:" comments start a child -var c=line.match(/^(\s+)?#(.*)/);if(c&&!(c[1]&&/^ Subtest: /.test(c[2]))){this.emitComment(line);return;}// if we got a plan at the end, or a 1..0 plan, then we can't -// have any more results, yamlish, or child sets. -if(this.postPlan){this.nonTap(line);return;}var indent=line.match(/^[ \t]+/);if(indent){indent=indent[0];// if we don't have a current res, then it can't be yamlish. -// If it is a subtest command, then it's a child test. -if(!this.current){this.startChild(indent,line);return;}// if we are not currently processing yamlish, then it has to -// be either the start of a child, or the start of yamlish. -if(!this.yind){// either this starts yamlish, or it is a child. -if(line===indent+'---\n')this.yind=indent;else this.startChild(indent,line);return;}// now we know it is yamlish -// if it's not as indented, then it's broken. -// The whole yamlish chunk is garbage. -if(indent.indexOf(this.yind)!==0){// oops! was not actually yamlish, I guess. -// treat as garbage -this.nonTap(this.yamlish+line);this.emitResult();return;}// yamlish ends with "...\n" -if(line===this.yind+'...\n'){this.processYamlish();return;}// ok! it is valid yamlish indentation, and not the ... -// save it to parse later. -this.yamlish+=line;return;}// not indented. if we were doing yamlish, then it didn't go good -if(this.yind){this.nonTap(this.yamlish);this.yamlish='';this.yind='';}var plan=line.match(/^([0-9]+)\.\.([0-9]+)(?:\s+(?:#\s*(.*)))?\n$/);if(plan){if(this.planStart!==-1){// this is not valid tap, just garbage -this.nonTap(line);return;}this.sawValidTap=true;this.emitResult();var start=+plan[1];var end=+plan[2];var comment=plan[3];this.planStart=start;this.planEnd=end;var p={start:start,end:end};if(comment)this.planComment=p.comment=comment;this.emit('plan',p);// This means that the plan is coming at the END of all the tests -// Plans MUST be either at the beginning or the very end. We treat -// plans like '1..0' the same, since they indicate that no tests -// will be coming. -if(this.count!==0||this.planEnd===0)this.postPlan=true;return;}var res=this.createResult(line);if(!res){this.nonTap(line);return;}if(this.planStart!==-1){var lessThanStart=+res.idthis.planEnd;if(lessThanStart||greaterThanEnd){this.ok=false;if(lessThanStart)res.tapError='id less than plan start';else res.tapError='id greater than plan end';this.failures.push(res);}}this.sawValidTap=true;if(res.id){if(!this.first||res.idthis.last)this.last=res.id;}// hold onto it, because we might get yamlish diagnostics -this.current=res;};}).call(this,require('_process'),require("buffer").Buffer);},{"_process":189,"assert":5,"buffer":8,"js-yaml":17,"readable-stream":200,"stream":204,"util":216}],207:[function(require,module,exports){var parser=require('tap-parser');var through=require('through2');var duplexer=require('duplexer');var extend=require('xtend');var serialize=require('./serialize');module.exports=converter;var defaults={// Whether the TAP comments should not be used as test-suite names -dontUseCommentsAsTestNames:false,// Whether . in test-suite names should be replaced with Unicode dot -// NOTE: this feature exist because many xUnit reporters assume . in -// test-suite name implies package hierarchy, which may not be the case. -replaceWithUnicodeDot:false,// If specified, all test-suites will be prefixed with the given -// package name. -// NOTE: replaceWithUnicodeDot does not apply to package and . can be -// used to specify package hierarchy. -package:'',// Whether tap parser should be in strict mode or not, false by default. -strict:false};function converter(options){options=extend(defaults,options);var outStream=through();var tapParser=parser();tapParser.strict=options.strict;var testSuites=[];var testCase;var noMoreTests=false;var exitCode=0;var planPresent=false;tapParser.on('comment',function(comment){// comment specifies boundaries between testsuites, unless feature disabled. -if(options.dontUseCommentsAsTestNames){return;}if(noMoreTests){return;}// create new test -testCase=newTest(comment);});tapParser.on('plan',function(){planPresent=true;});tapParser.on('assert',function(assert){// no test name was given, so all asserts go in a single test -if(!testCase){testCase=newTest('Default');}testCase.asserts.push(assert);});tapParser.on('extra',function(e){if(testCase){testCase.extra.push(e);}});tapParser.on('extra',function(line){});tapParser.on('plan',function(p){noMoreTests=true;});tapParser.on('complete',function(r){// output any parse errors -if(testCase&&!testSuites.filter(function(ts){return ts.id===testCase.id;}).length){testSuites.push(testCase);}if(r.failures){r.failures.forEach(function(fail){if(fail.tapError){var err=new Error('TAP parse error: '+fail.tapError);exitCode=1;outStream.emit('error',err);}});}// treat # SKIP and # TODO the same -// see https://github.com/aghassemi/tap-xunit/issues/8 -testSuites.forEach(function(suite){suite.asserts.forEach(function(a){a.skip=a.skip||a.todo;if(!a.ok&&!a.skip){exitCode=1;}});});if(tapParser.sawValidTap&&planPresent){var xmlString=serialize(testSuites);outStream.push(xmlString+'\n');}else{// Fail, no valid tap found (normally means no plan line present) -// Note that is a less strict check than TapParser's strict mode. -exitCode=1;}result.exitCode=exitCode;outStream.emit('end');});var result=duplexer(tapParser,outStream);return result;function newTest(testName){testSuites.push({id:testSuites.length,extra:[],asserts:[],testName:formatTestName(testName)});return testSuites[testSuites.length-1];}function formatTestName(testName){if(options.replaceWithUnicodeDot){var unicodeDot="\uFF0E";//full width unicode dot -testName=testName.replace(/\./g,unicodeDot);}if(options.package){testName=options.package+'.'+testName;}if(testName.indexOf('#')===0){testName=testName.substr(1);}return testName.trim();}}},{"./serialize":209,"duplexer":10,"tap-parser":206,"through2":210,"xtend":234}],208:[function(require,module,exports){var NOT_SAFE_IN_XML_1_0=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm;module.exports=function sanitizeString(str){return str.replace(NOT_SAFE_IN_XML_1_0,'');};},{}],209:[function(require,module,exports){var xmlbuilder=require('xmlbuilder');var sanitizeString=require('./sanitize-string');module.exports=function serialize(testCases){var rootXml=xmlbuilder.create('testsuites');testCases.forEach(function(suite){var suiteElement=rootXml.ele('testsuite');var skipped;var failureElement;suiteElement.att('tests',suite.asserts.length);skipped=suite.asserts.filter(function(a){return a.skip;}).length;if(skipped){suiteElement.att('skipped',skipped);}suiteElement.att('failures',suite.asserts.filter(function(a){return!a.ok&&!a.skip;}).length);suiteElement.att('errors','0');suiteElement.att('name',suite.testName||'');suite.asserts.forEach(function(a,i){var testCaseElement=suiteElement.ele('testcase',{name:'#'+a.id+' '+a.name});if(a.skip){testCaseElement.ele('skipped');}if(!a.ok&&!a.skip){failureElement=testCaseElement.ele('failure');if(a.diag){failureElement.txt(formatFailure(a.diag));}}if(i===suite.asserts.length-1){suite.extra.forEach(function(extraContent){testCaseElement.ele('system-out',sanitizeString(extraContent));});}});});return rootXml.end({pretty:true,indent:' ',newline:'\n'});};function formatFailure(diag){var text='\n ---\n';for(var key in diag){if(diag.hasOwnProperty(key)&&diag[key]!==undefined){var value=diag[key];text+=' '+key+': '+((typeof value==="undefined"?"undefined":_typeof2(value))==='object'?JSON.stringify(value):value)+'\n';}}text+=' ...\n ';return text;}},{"./sanitize-string":208,"xmlbuilder":233}],210:[function(require,module,exports){(function(process){var Transform=require('readable-stream/transform'),inherits=require('util').inherits,xtend=require('xtend');function DestroyableTransform(opts){Transform.call(this,opts);this._destroyed=false;}inherits(DestroyableTransform,Transform);DestroyableTransform.prototype.destroy=function(err){if(this._destroyed)return;this._destroyed=true;var self=this;process.nextTick(function(){if(err)self.emit('error',err);self.emit('close');});};// a noop _transform function -function noop(chunk,enc,callback){callback(null,chunk);}// create a new export function, used by both the main export and -// the .ctor export, contains common logic for dealing with arguments -function through2(construct){return function(options,transform,flush){if(typeof options=='function'){flush=transform;transform=options;options={};}if(typeof transform!='function')transform=noop;if(typeof flush!='function')flush=null;return construct(options,transform,flush);};}// main export, just make me a transform stream! -module.exports=through2(function(options,transform,flush){var t2=new DestroyableTransform(options);t2._transform=transform;if(flush)t2._flush=flush;return t2;});// make me a reusable prototype that I can `new`, or implicitly `new` -// with a constructor call -module.exports.ctor=through2(function(options,transform,flush){function Through2(override){if(!(this instanceof Through2))return new Through2(override);this.options=xtend(options,override);DestroyableTransform.call(this,this.options);}inherits(Through2,DestroyableTransform);Through2.prototype._transform=transform;if(flush)Through2.prototype._flush=flush;return Through2;});module.exports.obj=through2(function(options,transform,flush){var t2=new DestroyableTransform(xtend({objectMode:true,highWaterMark:16},options));t2._transform=transform;if(flush)t2._flush=flush;return t2;});}).call(this,require('_process'));},{"_process":189,"readable-stream/transform":201,"util":216,"xtend":234}],211:[function(require,module,exports){(function(setImmediate,clearImmediate){var nextTick=require('process/browser.js').nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;// DOM APIs, for completeness -exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout);};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval);};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close();};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn;}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id);};// Does not start the time, just sets up the members needed. -exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs;};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1;};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout();},msecs);}};// That's not how node.js implements it but the exposed api is the same. -exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){// fn.call() is faster so we optimize for the common use-case -// @see http://jsperf.com/call-apply-segu -if(args){fn.apply(null,args);}else{fn.call(null);}// Prevent ids from leaking -exports.clearImmediate(id);}});return id;};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id];};}).call(this,require("timers").setImmediate,require("timers").clearImmediate);},{"process/browser.js":189,"timers":211}],212:[function(require,module,exports){(function(global){/** - * Module exports. - */module.exports=deprecate;/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */function deprecate(fn,msg){if(config('noDeprecation')){return fn;}var warned=false;function deprecated(){if(!warned){if(config('throwDeprecation')){throw new Error(msg);}else if(config('traceDeprecation')){console.trace(msg);}else{console.warn(msg);}warned=true;}return fn.apply(this,arguments);}return deprecated;}/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */function config(name){// accessing global.localStorage can trigger a DOMException in sandboxed iframes -try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==='true';}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],213:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&(typeof arg==="undefined"?"undefined":_typeof2(arg))==='object'&&typeof arg.copy==='function'&&typeof arg.fill==='function'&&typeof arg.readUInt8==='function';};},{}],214:[function(require,module,exports){(function(process,global){// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. -var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case'%s':return String(args[i++]);case'%d':return Number(args[i++]);case'%j':try{return JSON.stringify(args[i++]);}catch(_){return'[Circular]';}default:return x;}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){// legacy... -ctx.showHidden=opts;}else if(opts){// got an "options" object -exports._extend(ctx,opts);}// set default options -if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth);}exports.inspect=inspect;// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.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]};// Don't use 'blue' not visible on cmd.exe -inspect.styles={'special':'cyan','number':'yellow','boolean':'yellow','undefined':'grey','null':'bold','string':'green','date':'magenta',// "name": intentionally not styling -'regexp':'red'};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"\x1B["+inspect.colors[style][0]+'m'+str+"\x1B["+inspect.colors[style][1]+'m';}else{return str;}}function stylizeNoColor(str,styleType){return str;}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true;});return hash;}function formatValue(ctx,value,recurseTimes){// Provide a hook for user-specified inspect functions. -// Check that value is an object with an inspect function on it -if(ctx.customInspect&&value&&isFunction(value.inspect)&&// Filter out the util module, it's inspect function is special -value.inspect!==exports.inspect&&// Also filter out any prototype objects using the circular check. -!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes);}return ret;}// Primitive types cannot have properties -var primitive=formatPrimitive(ctx,value);if(primitive){return primitive;}// Look up the keys of the object. -var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value);}// IE doesn't make error fields non-enumerable -// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx -if(isError(value)&&(keys.indexOf('message')>=0||keys.indexOf('description')>=0)){return formatError(value);}// Some type of object without properties can be shortcutted. -if(keys.length===0){if(isFunction(value)){var name=value.name?': '+value.name:'';return ctx.stylize('[Function'+name+']','special');}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),'date');}if(isError(value)){return formatError(value);}}var base='',array=false,braces=['{','}'];// Make Array say that they are Array -if(isArray(value)){array=true;braces=['[',']'];}// Make functions say that they are functions -if(isFunction(value)){var n=value.name?': '+value.name:'';base=' [Function'+n+']';}// Make RegExps say that they are RegExps -if(isRegExp(value)){base=' '+RegExp.prototype.toString.call(value);}// Make dates with properties first say the date -if(isDate(value)){base=' '+Date.prototype.toUTCString.call(value);}// Make error with message first say the error -if(isError(value)){base=' '+formatError(value);}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1];}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}else{return ctx.stylize('[Object]','special');}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys);}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array);});}ctx.seen.pop();return reduceToSingleString(output,base,braces);}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize('undefined','undefined');if(isString(value)){var simple='\''+JSON.stringify(value).replace(/^"|"$/g,'').replace(/'/g,"\\'").replace(/\\"/g,'"')+'\'';return ctx.stylize(simple,'string');}if(isNumber(value))return ctx.stylize(''+value,'number');if(isBoolean(value))return ctx.stylize(''+value,'boolean');// For some reason typeof null is "object", so special case here. -if(isNull(value))return ctx.stylize('null','null');}function formatError(value){return'['+Error.prototype.toString.call(value)+']';}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split('\n').map(function(line){return' '+line;}).join('\n').substr(2);}else{str='\n'+str.split('\n').map(function(line){return' '+line;}).join('\n');}}}else{str=ctx.stylize('[Circular]','special');}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str;}name=JSON.stringify(''+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,'name');}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,'string');}}return name+': '+str;}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf('\n')>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,'').length+1;},0);if(length>60){return braces[0]+(base===''?'':base+'\n ')+' '+output.join(',\n ')+' '+braces[1];}return braces[0]+base+' '+output.join(', ')+' '+braces[1];}// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar){return Array.isArray(ar);}exports.isArray=isArray;function isBoolean(arg){return typeof arg==='boolean';}exports.isBoolean=isBoolean;function isNull(arg){return arg===null;}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null;}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==='number';}exports.isNumber=isNumber;function isString(arg){return typeof arg==='string';}exports.isString=isString;function isSymbol(arg){return(typeof arg==="undefined"?"undefined":_typeof2(arg))==='symbol';}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0;}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==='[object RegExp]';}exports.isRegExp=isRegExp;function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof2(arg))==='object'&&arg!==null;}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==='[object Date]';}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==='[object Error]'||e instanceof Error);}exports.isError=isError;function isFunction(arg){return typeof arg==='function';}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==='boolean'||typeof arg==='number'||typeof arg==='string'||(typeof arg==="undefined"?"undefined":_typeof2(arg))==='symbol'||// ES6 symbol -typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=require('./support/isBuffer');function objectToString(o){return Object.prototype.toString.call(o);}function pad(n){return n<10?'0'+n.toString(10):n.toString(10);}var months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];// 26 Feb 16:19:34 -function timestamp(){var d=new Date();var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(':');return[d.getDate(),months[d.getMonth()],time].join(' ');}// log is just a thin wrapper to console.log that prepends a timestamp -exports.log=function(){console.log('%s - %s',timestamp(),exports.format.apply(exports,arguments));};/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */exports.inherits=require('inherits');exports._extend=function(origin,add){// Don't do anything if add isn't an object -if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]];}return origin;};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./support/isBuffer":213,"_process":189,"inherits":13}],215:[function(require,module,exports){arguments[4][213][0].apply(exports,arguments);},{"dup":213}],216:[function(require,module,exports){arguments[4][214][0].apply(exports,arguments);},{"./support/isBuffer":215,"_process":189,"dup":214,"inherits":14}],217:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLAttribute,create;create=require('lodash/create');module.exports=XMLAttribute=function(){function XMLAttribute(parent,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing attribute name of element "+parent.name);}if(value==null){throw new Error("Missing attribute value for attribute "+name+" of element "+parent.name);}this.name=this.stringify.attName(name);this.value=this.stringify.attValue(value);}XMLAttribute.prototype.clone=function(){return create(XMLAttribute.prototype,this);};XMLAttribute.prototype.toString=function(options,level){return' '+this.name+'="'+this.value+'"';};return XMLAttribute;}();}).call(this);},{"lodash/create":165}],218:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLBuilder,XMLDeclaration,XMLDocType,XMLElement,XMLStringifier;XMLStringifier=require('./XMLStringifier');XMLDeclaration=require('./XMLDeclaration');XMLDocType=require('./XMLDocType');XMLElement=require('./XMLElement');module.exports=XMLBuilder=function(){function XMLBuilder(name,options){var root,temp;if(name==null){throw new Error("Root element needs a name");}if(options==null){options={};}this.options=options;this.stringify=new XMLStringifier(options);temp=new XMLElement(this,'doc');root=temp.element(name);root.isRoot=true;root.documentObject=this;this.rootObject=root;if(!options.headless){root.declaration(options);if(options.pubID!=null||options.sysID!=null){root.doctype(options);}}}XMLBuilder.prototype.root=function(){return this.rootObject;};XMLBuilder.prototype.end=function(options){return this.toString(options);};XMLBuilder.prototype.toString=function(options){var indent,newline,offset,pretty,r,ref,ref1,ref2;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';r='';if(this.xmldec!=null){r+=this.xmldec.toString(options);}if(this.doctype!=null){r+=this.doctype.toString(options);}r+=this.rootObject.toString(options);if(pretty&&r.slice(-newline.length)===newline){r=r.slice(0,-newline.length);}return r;};return XMLBuilder;}();}).call(this);},{"./XMLDeclaration":225,"./XMLDocType":226,"./XMLElement":227,"./XMLStringifier":231}],219:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLCData,XMLNode,create,extend=function extend(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;},hasProp={}.hasOwnProperty;create=require('lodash/create');XMLNode=require('./XMLNode');module.exports=XMLCData=function(superClass){extend(XMLCData,superClass);function XMLCData(parent,text){XMLCData.__super__.constructor.call(this,parent);if(text==null){throw new Error("Missing CDATA text");}this.text=this.stringify.cdata(text);}XMLCData.prototype.clone=function(){return create(XMLCData.prototype,this);};XMLCData.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLCData;}(XMLNode);}).call(this);},{"./XMLNode":228,"lodash/create":165}],220:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLComment,XMLNode,create,extend=function extend(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;},hasProp={}.hasOwnProperty;create=require('lodash/create');XMLNode=require('./XMLNode');module.exports=XMLComment=function(superClass){extend(XMLComment,superClass);function XMLComment(parent,text){XMLComment.__super__.constructor.call(this,parent);if(text==null){throw new Error("Missing comment text");}this.text=this.stringify.comment(text);}XMLComment.prototype.clone=function(){return create(XMLComment.prototype,this);};XMLComment.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLComment;}(XMLNode);}).call(this);},{"./XMLNode":228,"lodash/create":165}],221:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLDTDAttList,create;create=require('lodash/create');module.exports=XMLDTDAttList=function(){function XMLDTDAttList(parent,elementName,attributeName,attributeType,defaultValueType,defaultValue){this.stringify=parent.stringify;if(elementName==null){throw new Error("Missing DTD element name");}if(attributeName==null){throw new Error("Missing DTD attribute name");}if(!attributeType){throw new Error("Missing DTD attribute type");}if(!defaultValueType){throw new Error("Missing DTD attribute default");}if(defaultValueType.indexOf('#')!==0){defaultValueType='#'+defaultValueType;}if(!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");}if(defaultValue&&!defaultValueType.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT");}this.elementName=this.stringify.eleName(elementName);this.attributeName=this.stringify.attName(attributeName);this.attributeType=this.stringify.dtdAttType(attributeType);this.defaultValue=this.stringify.dtdAttDefault(defaultValue);this.defaultValueType=defaultValueType;}XMLDTDAttList.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDAttList;}();}).call(this);},{"lodash/create":165}],222:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLDTDElement,create;create=require('lodash/create');module.exports=XMLDTDElement=function(){function XMLDTDElement(parent,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing DTD element name");}if(!value){value='(#PCDATA)';}if(Array.isArray(value)){value='('+value.join(',')+')';}this.name=this.stringify.eleName(name);this.value=this.stringify.dtdElementValue(value);}XMLDTDElement.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDElement;}();}).call(this);},{"lodash/create":165}],223:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLDTDEntity,create,isObject;create=require('lodash/create');isObject=require('lodash/isObject');module.exports=XMLDTDEntity=function(){function XMLDTDEntity(parent,pe,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing entity name");}if(value==null){throw new Error("Missing entity value");}this.pe=!!pe;this.name=this.stringify.eleName(name);if(!isObject(value)){this.value=this.stringify.dtdEntityValue(value);}else{if(!value.pubID&&!value.sysID){throw new Error("Public and/or system identifiers are required for an external entity");}if(value.pubID&&!value.sysID){throw new Error("System identifier is required for a public external entity");}if(value.pubID!=null){this.pubID=this.stringify.dtdPubID(value.pubID);}if(value.sysID!=null){this.sysID=this.stringify.dtdSysID(value.sysID);}if(value.nData!=null){this.nData=this.stringify.dtdNData(value.nData);}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity");}}}XMLDTDEntity.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDEntity;}();}).call(this);},{"lodash/create":165,"lodash/isObject":178}],224:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLDTDNotation,create;create=require('lodash/create');module.exports=XMLDTDNotation=function(){function XMLDTDNotation(parent,name,value){this.stringify=parent.stringify;if(name==null){throw new Error("Missing notation name");}if(!value.pubID&&!value.sysID){throw new Error("Public or system identifiers are required for an external entity");}this.name=this.stringify.eleName(name);if(value.pubID!=null){this.pubID=this.stringify.dtdPubID(value.pubID);}if(value.sysID!=null){this.sysID=this.stringify.dtdSysID(value.sysID);}}XMLDTDNotation.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDTDNotation;}();}).call(this);},{"lodash/create":165}],225:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLDeclaration,XMLNode,create,isObject,extend=function extend(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;},hasProp={}.hasOwnProperty;create=require('lodash/create');isObject=require('lodash/isObject');XMLNode=require('./XMLNode');module.exports=XMLDeclaration=function(superClass){extend(XMLDeclaration,superClass);function XMLDeclaration(parent,version,encoding,standalone){var ref;XMLDeclaration.__super__.constructor.call(this,parent);if(isObject(version)){ref=version,version=ref.version,encoding=ref.encoding,standalone=ref.standalone;}if(!version){version='1.0';}this.version=this.stringify.xmlVersion(version);if(encoding!=null){this.encoding=this.stringify.xmlEncoding(encoding);}if(standalone!=null){this.standalone=this.stringify.xmlStandalone(standalone);}}XMLDeclaration.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,ref,ref1,ref2,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='';if(pretty){r+=newline;}return r;};return XMLDeclaration;}(XMLNode);}).call(this);},{"./XMLNode":228,"lodash/create":165,"lodash/isObject":178}],226:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLCData,XMLComment,XMLDTDAttList,XMLDTDElement,XMLDTDEntity,XMLDTDNotation,XMLDocType,XMLProcessingInstruction,create,isObject;create=require('lodash/create');isObject=require('lodash/isObject');XMLCData=require('./XMLCData');XMLComment=require('./XMLComment');XMLDTDAttList=require('./XMLDTDAttList');XMLDTDEntity=require('./XMLDTDEntity');XMLDTDElement=require('./XMLDTDElement');XMLDTDNotation=require('./XMLDTDNotation');XMLProcessingInstruction=require('./XMLProcessingInstruction');module.exports=XMLDocType=function(){function XMLDocType(parent,pubID,sysID){var ref,ref1;this.documentObject=parent;this.stringify=this.documentObject.stringify;this.children=[];if(isObject(pubID)){ref=pubID,pubID=ref.pubID,sysID=ref.sysID;}if(sysID==null){ref1=[pubID,sysID],sysID=ref1[0],pubID=ref1[1];}if(pubID!=null){this.pubID=this.stringify.dtdPubID(pubID);}if(sysID!=null){this.sysID=this.stringify.dtdSysID(sysID);}}XMLDocType.prototype.element=function(name,value){var child;child=new XMLDTDElement(this,name,value);this.children.push(child);return this;};XMLDocType.prototype.attList=function(elementName,attributeName,attributeType,defaultValueType,defaultValue){var child;child=new XMLDTDAttList(this,elementName,attributeName,attributeType,defaultValueType,defaultValue);this.children.push(child);return this;};XMLDocType.prototype.entity=function(name,value){var child;child=new XMLDTDEntity(this,false,name,value);this.children.push(child);return this;};XMLDocType.prototype.pEntity=function(name,value){var child;child=new XMLDTDEntity(this,true,name,value);this.children.push(child);return this;};XMLDocType.prototype.notation=function(name,value){var child;child=new XMLDTDNotation(this,name,value);this.children.push(child);return this;};XMLDocType.prototype.cdata=function(value){var child;child=new XMLCData(this,value);this.children.push(child);return this;};XMLDocType.prototype.comment=function(value){var child;child=new XMLComment(this,value);this.children.push(child);return this;};XMLDocType.prototype.instruction=function(target,value){var child;child=new XMLProcessingInstruction(this,target,value);this.children.push(child);return this;};XMLDocType.prototype.root=function(){return this.documentObject.root();};XMLDocType.prototype.document=function(){return this.documentObject;};XMLDocType.prototype.toString=function(options,level){var child,i,indent,len,newline,offset,pretty,r,ref,ref1,ref2,ref3,space;pretty=(options!=null?options.pretty:void 0)||false;indent=(ref=options!=null?options.indent:void 0)!=null?ref:' ';offset=(ref1=options!=null?options.offset:void 0)!=null?ref1:0;newline=(ref2=options!=null?options.newline:void 0)!=null?ref2:'\n';level||(level=0);space=new Array(level+offset+1).join(indent);r='';if(pretty){r+=space;}r+='0){r+=' [';if(pretty){r+=newline;}ref3=this.children;for(i=0,len=ref3.length;i';if(pretty){r+=newline;}return r;};XMLDocType.prototype.ele=function(name,value){return this.element(name,value);};XMLDocType.prototype.att=function(elementName,attributeName,attributeType,defaultValueType,defaultValue){return this.attList(elementName,attributeName,attributeType,defaultValueType,defaultValue);};XMLDocType.prototype.ent=function(name,value){return this.entity(name,value);};XMLDocType.prototype.pent=function(name,value){return this.pEntity(name,value);};XMLDocType.prototype.not=function(name,value){return this.notation(name,value);};XMLDocType.prototype.dat=function(value){return this.cdata(value);};XMLDocType.prototype.com=function(value){return this.comment(value);};XMLDocType.prototype.ins=function(target,value){return this.instruction(target,value);};XMLDocType.prototype.up=function(){return this.root();};XMLDocType.prototype.doc=function(){return this.document();};return XMLDocType;}();}).call(this);},{"./XMLCData":219,"./XMLComment":220,"./XMLDTDAttList":221,"./XMLDTDElement":222,"./XMLDTDEntity":223,"./XMLDTDNotation":224,"./XMLProcessingInstruction":229,"lodash/create":165,"lodash/isObject":178}],227:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLAttribute,XMLElement,XMLNode,XMLProcessingInstruction,create,every,isFunction,isObject,extend=function extend(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;},hasProp={}.hasOwnProperty;create=require('lodash/create');isObject=require('lodash/isObject');isFunction=require('lodash/isFunction');every=require('lodash/every');XMLNode=require('./XMLNode');XMLAttribute=require('./XMLAttribute');XMLProcessingInstruction=require('./XMLProcessingInstruction');module.exports=XMLElement=function(superClass){extend(XMLElement,superClass);function XMLElement(parent,name,attributes){XMLElement.__super__.constructor.call(this,parent);if(name==null){throw new Error("Missing element name");}this.name=this.stringify.eleName(name);this.children=[];this.instructions=[];this.attributes={};if(attributes!=null){this.attribute(attributes);}}XMLElement.prototype.clone=function(){var att,attName,clonedSelf,i,len,pi,ref,ref1;clonedSelf=create(XMLElement.prototype,this);if(clonedSelf.isRoot){clonedSelf.documentObject=null;}clonedSelf.attributes={};ref=this.attributes;for(attName in ref){if(!hasProp.call(ref,attName))continue;att=ref[attName];clonedSelf.attributes[attName]=att.clone();}clonedSelf.instructions=[];ref1=this.instructions;for(i=0,len=ref1.length;i';if(pretty){r+=newline;}}else if(pretty&&this.children.length===1&&this.children[0].value!=null){r+='>';r+=this.children[0].value;r+='';r+=newline;}else{r+='>';if(pretty){r+=newline;}ref5=this.children;for(j=0,len1=ref5.length;j';if(pretty){r+=newline;}}return r;};XMLElement.prototype.att=function(name,value){return this.attribute(name,value);};XMLElement.prototype.ins=function(target,value){return this.instruction(target,value);};XMLElement.prototype.a=function(name,value){return this.attribute(name,value);};XMLElement.prototype.i=function(target,value){return this.instruction(target,value);};return XMLElement;}(XMLNode);}).call(this);},{"./XMLAttribute":217,"./XMLNode":228,"./XMLProcessingInstruction":229,"lodash/create":165,"lodash/every":167,"lodash/isFunction":176,"lodash/isObject":178}],228:[function(require,module,exports){// Generated by CoffeeScript 1.9.1 -(function(){var XMLCData,XMLComment,XMLDeclaration,XMLDocType,XMLElement,XMLNode,XMLRaw,XMLText,isEmpty,isFunction,isObject,hasProp={}.hasOwnProperty;isObject=require('lodash/isObject');isFunction=require('lodash/isFunction');isEmpty=require('lodash/isEmpty');XMLElement=null;XMLCData=null;XMLComment=null;XMLDeclaration=null;XMLDocType=null;XMLRaw=null;XMLText=null;module.exports=XMLNode=function(){function XMLNode(parent){this.parent=parent;this.options=this.parent.options;this.stringify=this.parent.stringify;if(XMLElement===null){XMLElement=require('./XMLElement');XMLCData=require('./XMLCData');XMLComment=require('./XMLComment');XMLDeclaration=require('./XMLDeclaration');XMLDocType=require('./XMLDocType');XMLRaw=require('./XMLRaw');XMLText=require('./XMLText');}}XMLNode.prototype.element=function(name,attributes,text){var childNode,item,j,k,key,lastChild,len,len1,ref,val;lastChild=null;if(attributes==null){attributes={};}attributes=attributes.valueOf();if(!isObject(attributes)){ref=[attributes,text],text=ref[0],attributes=ref[1];}if(name!=null){name=name.valueOf();}if(Array.isArray(name)){for(j=0,len=name.length;j/)){throw new Error("Invalid CDATA text: "+val);}return this.assertLegalChar(val);};XMLStringifier.prototype.comment=function(val){val=''+val||'';if(val.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+val);}return this.assertLegalChar(val);};XMLStringifier.prototype.raw=function(val){return''+val||'';};XMLStringifier.prototype.attName=function(val){return''+val||'';};XMLStringifier.prototype.attValue=function(val){val=''+val||'';return this.attEscape(val);};XMLStringifier.prototype.insTarget=function(val){return''+val||'';};XMLStringifier.prototype.insValue=function(val){val=''+val||'';if(val.match(/\?>/)){throw new Error("Invalid processing instruction value: "+val);}return val;};XMLStringifier.prototype.xmlVersion=function(val){val=''+val||'';if(!val.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+val);}return val;};XMLStringifier.prototype.xmlEncoding=function(val){val=''+val||'';if(!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)){throw new Error("Invalid encoding: "+val);}return val;};XMLStringifier.prototype.xmlStandalone=function(val){if(val){return"yes";}else{return"no";}};XMLStringifier.prototype.dtdPubID=function(val){return''+val||'';};XMLStringifier.prototype.dtdSysID=function(val){return''+val||'';};XMLStringifier.prototype.dtdElementValue=function(val){return''+val||'';};XMLStringifier.prototype.dtdAttType=function(val){return''+val||'';};XMLStringifier.prototype.dtdAttDefault=function(val){if(val!=null){return''+val||'';}else{return val;}};XMLStringifier.prototype.dtdEntityValue=function(val){return''+val||'';};XMLStringifier.prototype.dtdNData=function(val){return''+val||'';};XMLStringifier.prototype.convertAttKey='@';XMLStringifier.prototype.convertPIKey='?';XMLStringifier.prototype.convertTextKey='#text';XMLStringifier.prototype.convertCDataKey='#cdata';XMLStringifier.prototype.convertCommentKey='#comment';XMLStringifier.prototype.convertRawKey='#raw';XMLStringifier.prototype.assertLegalChar=function(str){var chars,chr;if(this.allowSurrogateChars){chars=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/;}else{chars=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;}chr=str.match(chars);if(chr){throw new Error("Invalid character ("+chr+") in string: "+str+" at index "+chr.index);}return str;};XMLStringifier.prototype.elEscape=function(str){var ampregex;ampregex=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return str.replace(ampregex,'&').replace(//g,'>').replace(/\r/g,' ');};XMLStringifier.prototype.attEscape=function(str){var ampregex;ampregex=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return str.replace(ampregex,'&').replace(/0&&arguments[0]!==undefined?arguments[0]:{};if(options.reporter===true)reporters.default(emitter,options);else if(typeof options.reporter==='function')options.reporter(emitter,options);else if(reporters[options.reporter])reporters[options.reporter](emitter,options);emitter.emit('start');return testrunner(this,options).then(function(results){results.success=results.filter(function(r){return r.status==='ok';});results.successPercent=Math.floor(results.success.length/results.length*100);if(results.successPercent!==100&&typeof process!=='undefined')process.exitCode=1;emitter.emit('test end',results);emitter.emit('end',results);return results;});}}]);return Gunner;}();module.exports=Gunner;module.exports.expect=expect;module.exports.expectMany=expect.expectMany;module.exports.Start=symbols.Start;module.exports.End=symbols.End;module.exports.Gunner=module.exports;}).call(this,require('_process'));},{"./lib/caller":239,"./lib/emitter":240,"./lib/expect":241,"./lib/testrunner":242,"./reporters":244,"./util":247,"./util/symbols":248,"_process":189}],236:[function(require,module,exports){var _require3=require('../util'),isPromise=_require3.isPromise;var createRejectionStatement=function createRejectionStatement(statement){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}return Promise.reject(statement?statement.apply(undefined,args):'');};var assertPromise=function assertPromise(bool,statementTuple){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _statementTuple=_toArray(statementTuple),statement=_statementTuple[0],args=_statementTuple.slice(1);statement=options.skipStatement?function(){return options.skipStatement;}:statement;if(isPromise(bool))return bool.catch(function(){return createRejectionStatement.apply(undefined,[statement].concat(_toConsumableArray2(args)));});return bool?Promise.resolve():createRejectionStatement.apply(undefined,[statement].concat(_toConsumableArray2(args)));};module.exports=assertPromise;},{"../util":247}],237:[function(require,module,exports){var isEq=require('@codefeathers/iseq');var U=require('../util');var _=U.taggedStringify;module.exports.done=[function(){return true;},function(){return null;}];module.exports.fail=[function(){return false;},function(_,rejection){return rejection;}];module.exports.exists=[function(val){return typeof val!=='undefined';},function(){return"Value is undefined";}];module.exports.isArray=[function(val){return Array.isArray(val);},function(val){return _(_templateObject,val);}];module.exports.isObject=[function(val){return(typeof val==="undefined"?"undefined":_typeof2(val))==='object'&&val!==null;},function(val){return _(_templateObject2,val);}];module.exports.hasLength=[function(val,l){return val.length===l;},function(val,l){return _(_templateObject3,val,l);}];module.exports.equals=[function(val,thing){return val===thing;},function(val,thing){return _(_templateObject4,val,thing);}];module.exports.deepEquals=[function(val,match){return isEq(val,match);},function(val,match){return _(_templateObject5,val,match);}];module.exports.contains=[function(val,match){return isEq(val,match,Object.keys(match));},function(val,match){return _(_templateObject6,val,match);}];module.exports.isTrue=[function(val){return val===true;},function(val){return _(_templateObject7,val);}];module.exports.isFalse=[function(val){return val===false;},function(val){return _(_templateObject8,val);}];module.exports.hasProp=[function(val,prop){return val.hasOwnProperty(prop);},function(val,prop){return _(_templateObject9,val,prop);}];module.exports.hasPair=[function(val){for(var _len2=arguments.length,pair=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){pair[_key2-1]=arguments[_key2];}return isEq(val[pair[0]],pair[1]);},function(val){for(var _len3=arguments.length,pair=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){pair[_key3-1]=arguments[_key3];}return _(_templateObject10,pair,val);}];module.exports.isPromise=[function(val){return U.isPromise(val);},function(val){return _(_templateObject11,val);},{shouldCatch:true}];module.exports.resolvesTo=[function(val,thing){return U.isPromise(val)?val.then(function(x){return x===thing?Promise.resolve():Promise.reject();}):Promise.reject(val+" was not a Promise");},function(val,thing){return _(_templateObject12,val,thing);}];module.exports.isType=[function(val,type){return type==='nil'&&(val==='null'||val==='undefined')||(typeof val==="undefined"?"undefined":_typeof2(val))===type||Array.isArray(val)&&type==="array"&&val===null&&type!=='object';},function(val,type){return _(_templateObject13,val,type);}];module.exports.greaterThan=[function(val,compare){return val>compare;},function(val,compare){return _(_templateObject14,val,compare);}];module.exports.lessThan=[function(val,compare){return val=compare;},function(val,compare){return _(_templateObject16,val,compare);}];module.exports.lte=[function(val,compare){return val<=compare;},function(val,compare){return _(_templateObject17,val,compare);}];/* Convenience aliases */module.exports.success=module.exports.done;module.exports.succeed=module.exports.done;module.exports.failure=module.exports.fail;module.exports.equal=module.exports.equals;module.exports.deepEqual=module.exports.deepEquals;module.exports.match=module.exports.deepEquals;module.exports.greaterThanOrEqualTo=module.exports.gte;module.exports.lessThanOrEqualTo=module.exports.lte;},{"../util":247,"@codefeathers/iseq":2}],238:[function(require,module,exports){// Only imported for JSDoc -/* eslint-disable-next-line */var Gunner=require('../gunner');var symbols=require('../util/symbols');var wrap=function wrap(type){return function(unit){return{type:type,unit:unit};};};/** - * runs the test suite - * @param {Gunner} instance - */var buildTestTree=function buildTestTree(instance){var testQueue=[];Array.prototype.push.apply(testQueue,instance.__suite__.beforeHooks[symbols.Start].map(wrap('@start')));testQueue.push.apply(instance.__suite__.afterHooks[symbols.Start].map(wrap('@start')));instance.__suite__.tests.forEach(function(test){return Array.prototype.push.apply(testQueue,instance.__suite__.beforeHooks['*'].map(wrap('@every'))),Array.prototype.push.apply(testQueue,(instance.__suite__.beforeHooks[test.description]||[]).map(wrap('@this'))),testQueue.push(wrap('@test')(test)),Array.prototype.push.apply(testQueue,(instance.__suite__.afterHooks[test.description]||[]).map(wrap('@afterTest'))),Array.prototype.push.apply(testQueue,instance.__suite__.afterHooks['*'].map(wrap('@afterEvery')));});Array.prototype.push.apply(testQueue,instance.__suite__.beforeHooks[symbols.End].map(wrap('@beforeend')));Array.prototype.push.apply(testQueue,instance.__suite__.afterHooks[symbols.End].map(wrap('@end')));return testQueue;};module.exports=buildTestTree;},{"../gunner":235,"../util/symbols":248}],239:[function(require,module,exports){var _require4=require('../util'),isPromise=_require4.isPromise;var caller=function caller(test,state){var value=void 0,error=void 0,errored=void 0;try{value=test(state);}catch(e){errored=true;error=e;}var promise=isPromise(value);if(promise){return value.then(function(res){return{status:'ok',resolve:res,promise:true};}).catch(function(rej){return{status:'notOk',rejection:rej,promise:true};});}else{return Promise.resolve(_extends2({status:errored?'notOk':'ok'},!errored&&{value:value},errored&&{error:error},{promise:false}));}};module.exports=caller;},{"../util":247}],240:[function(require,module,exports){var EventEmitter=require('events');var GunnerEmitter=function(_EventEmitter){_inherits(GunnerEmitter,_EventEmitter);function GunnerEmitter(){_classCallCheck2(this,GunnerEmitter);return _possibleConstructorReturn(this,(GunnerEmitter.__proto__||Object.getPrototypeOf(GunnerEmitter)).apply(this,arguments));}return GunnerEmitter;}(EventEmitter);module.exports=new GunnerEmitter();},{"events":11}],241:[function(require,module,exports){'use strict';var _require5=require('../util'),liftPromise=_require5.liftPromise,lowerCaseFirstLetter=_require5.lowerCaseFirstLetter;var library=require('./assertionsLibrary');var assertPromise=require('./assertPromise');var expectPromise=function expectPromise(pred,statement){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return function(toTest){return function(){for(var _len4=arguments.length,testValues=Array(_len4),_key4=0;_key4<_len4;_key4++){testValues[_key4]=arguments[_key4];}return liftPromise(function(resolvedValue){return assertPromise(pred.apply(undefined,[toTest].concat(testValues)),[statement,resolvedValue].concat(testValues));},toTest).catch(function(rejectedValue){return options.shouldCatch?assertPromise(pred.apply(undefined,[toTest].concat(testValues)),[statement,rejectedValue].concat(testValues),{skipStatement:rejectedValue}):Promise.reject(rejectedValue);});};};};var expects=Object.keys(library).reduce(function(acc,e){var _library$e=_slicedToArray(library[e],3),pred=_library$e[0],statement=_library$e[1],options=_library$e[2];acc[e]=expectPromise(pred,statement,options);return acc;},{});var negateP=function negateP(prom){return prom.then(Promise.reject,Promise.resolve);};var expect=function expect(thing,args){return new Proxy({},{get:function get(obj,prop){var toCheck=args?thing.apply(undefined,_toConsumableArray2(args)):thing;if(expects.hasOwnProperty(prop))return function(){return expects[prop](toCheck).apply(undefined,arguments);};else if(prop.slice(0,3)==='not')return function(){return negateP(expects[lowerCaseFirstLetter(prop.slice(3))](toCheck).apply(undefined,arguments));};else throw new Error('Unknown assertion method',prop);}});};var expectMany=function expectMany(){for(var _len5=arguments.length,expects=Array(_len5),_key5=0;_key5<_len5;_key5++){expects[_key5]=arguments[_key5];}return Promise.all(expects);};module.exports=expect;module.exports.expectMany=expectMany;},{"../util":247,"./assertPromise":236,"./assertionsLibrary":237}],242:[function(require,module,exports){// Only imported for JSDoc -/* eslint-disable-next-line */var Gunner=require('../gunner');Promise.object=require('@codefeathers/promise.object');var _require6=require('../util'),last=_require6.last,pipe=_require6.pipe,pick=_require6.pick,assignToObject=_require6.assignToObject;var buildTestQueue=require('./buildTestQueue');var findSkip=function findSkip(skip,unit){var startFailed=skip.findIndex(function(x){return x.type==='@start';});var everyFailed=skip.findIndex(function(x){return x.type==='@every';});var beforeFailed=skip.findIndex(function(x){return x.description===unit.description;});return startFailed!==-1&&'A start hook failed\n'+skip[startFailed].error||everyFailed!==-1&&'An every hook failed\n'+skip[everyFailed].error||beforeFailed!==-1&&'A before test hook failed\n'+skip[beforeFailed].error;};var reduceQueue=function reduceQueue(queue){return queue.reduce(function(acc,item){return Promise.resolve(acc).then(function(acc){return Promise.all([last(acc.results),Promise.object(acc.state)]).then(function(_ref){var _ref2=_slicedToArray(_ref,2),state=_ref2[1];var toSkip=findSkip(acc.skip,item.unit);return[toSkip,state];}).then(function(_ref3){var _ref4=_slicedToArray(_ref3,2),toSkip=_ref4[0],state=_ref4[1];return toSkip?{status:'skip',description:toSkip}:item.unit.run(state);}).then(function(result){var status=result.status;if(item.type==='@test'){var resultObject=_extends2({status:status,description:item.unit.description},(status==='notOk'||status==='skip')&&{reason:result.error||result.rejection||result.description});acc.results.push(resultObject);}else{var identifier=item.unit.label||queue.filter(function(i){return i.type===item.type;}).filter(function(i){return i.unit.description===item.unit.description;}).length;var stateAddition=/* eslint-disable-next-line */status==='ok'?result.promise?result.resolve:result.value:null;if(identifier&&stateAddition)assignToObject(acc.state,item.type)(identifier,stateAddition);}if(status==='notOk'){acc.skip.push({type:item.type,description:item.unit.description,error:result.promise?result.rejection:result.error});}return acc;});});},{results:[],state:{},skip:[]});};/** - * runs the test suite - * @param {Gunner} instance - * @param {object} options - */var testrunner=function testrunner(instance){return Promise.object(pipe(buildTestQueue,reduceQueue,pick('results'))(instance));};module.exports=testrunner;},{"../gunner":235,"../util":247,"./buildTestQueue":238,"@codefeathers/promise.object":3}],243:[function(require,module,exports){var statusMap={'ok':['ok','✅'],'notOk':['notOk','❌'],'skip':['skip','⚠️']};var Default=function Default(runner,options){runner.on('start',function(){return console.log('Started tests');});runner.on('test end',function(results){results.forEach(function(x){var s=statusMap[x.status];console.log('>',s[0],s[1],x.description);options.trace&&x.reason&&console.log('\n---\n\n',x.reason,'\n\n---\n');});});runner.on('end',function(results){console.log(results.success.length,'tests of',results.length,'passed');console.log('Success ratio:',results.successPercent,'%');});};module.exports=Default;},{}],244:[function(require,module,exports){module.exports={default:require('./default'),tap:require('./tap'),xunit:require('./xunit')};},{"./default":243,"./tap":245,"./xunit":246}],245:[function(require,module,exports){var statusMap={'ok':'ok','notOk':'not ok','skip':'skip'};var convert=function convert(results,options){return"\nTAP version 13\n"+(results.length?'1':0)+".."+results.length+"\n"+results.map(function(r,i){var status=statusMap[r.status];var message=options.trace&&r.reason&&(r.reason.stack?r.reason.stack:r.reason)||'';return status+" "+(i+1)+" - "+r.description+(message&&'\n ---\n message: |\n '+message+'\n ---\n');}).join('\n')+"\n";};var TAP=function TAP(runner,options){runner.on('end',function(results){return console.log(convert(results,options));});};module.exports=TAP;module.exports.convert=convert;},{}],246:[function(require,module,exports){(function(process){var Readable=require('stream').Readable;var TAP=require('./tap');var xUnitConverter=require('tap-xunit');var streamify=function streamify(text){var s=new Readable();s._read=function(){};s.push(text);s.push(null);return s;};var xunit=function xunit(runner){runner.on('end',function(results){return streamify(TAP.convert(results,{trace:false})).pipe(xUnitConverter()).pipe(process.stdout);});};module.exports=xunit;}).call(this,require('_process'));},{"./tap":245,"_process":189,"stream":204,"tap-xunit":207}],247:[function(require,module,exports){var _stringify=require('json-stringify-safe');var isObject=function isObject(x){return x&&(typeof x==="undefined"?"undefined":_typeof2(x))==='object';};var stringify=function stringify(obj){return isObject(obj)?obj.stack||_stringify(obj):obj;};var deepFlatten=function deepFlatten(arr){var _ref5;return(_ref5=[]).concat.apply(_ref5,_toConsumableArray2(arr.map(function(v){return Array.isArray(v)?deepFlatten(v):v;})));};/* Returns true if a promise is passed */var isPromise=function isPromise(prom){return prom&&typeof prom.then==='function';};/* Lift a value or promise into a function */var liftPromise=function liftPromise(fn,thing){return isPromise(thing)?thing.then(fn):fn(thing);};module.exports={/* Returns true if an object is passed */isObject:isObject,/* Returns true if a promise is passed */isPromise:isPromise,/* Lift a value or promise into a function */liftPromise:liftPromise,/* Returns the element found at the given path or undefined */path:function path(obj){return function(path){return path.reduce(function(result,segment){return result&&result[segment];},obj);};},/* Picks a key from an object */pick:function pick(key){return function(obj){return obj[key];};},/* Pipe a value or promise through any number of unary functions */pipe:function pipe(){for(var _len6=arguments.length,fns=Array(_len6),_key6=0;_key6<_len6;_key6++){fns[_key6]=arguments[_key6];}return function(arg){return fns.reduce(function(acc,fn){return liftPromise(fn,acc);},arg);};},/* Reduces an array */reduce:function reduce(fn,def){return function(arr){return arr.reduce(fn,def);};},/* Flattens an array of arrays to an array */flatten:function flatten(arrData){return[].concat.apply([],arrData);},/* Deep flattens arrays */deepFlatten:deepFlatten,/* Maps a function over an array */map:function map(fn){return function(x){return x.map(fn);};},/* Filter an array using provided function */filter:function filter(fn){return function(x){return x.filter(fn);};},/* Returns identity */identity:function identity(x){return x;},/* Wraps a value in an object with given key */wrapWith:function wrapWith(x){return function(y){return _defineProperty2({},x,y);};},/* Unwraps a value from an object with given key */unwrapFrom:function unwrapFrom(x){return function(y){return y[x];};},/* Resolves an array of Promises */promiseAll:function promiseAll(x){return Promise.all(x);},/* Pass partial arguments and return a function that accepts the rest */partial:function partial(fn){for(var _len7=arguments.length,args=Array(_len7>1?_len7-1:0),_key7=1;_key7<_len7;_key7++){args[_key7-1]=arguments[_key7];}return function(){for(var _len8=arguments.length,rest=Array(_len8),_key8=0;_key8<_len8;_key8++){rest[_key8]=arguments[_key8];}return fn.apply(undefined,args.concat(rest));};},/* Item is in collection */isIn:function isIn(collection,item){return collection.indexOf(item)!==-1;},/* Collection contains given path */containsPath:function containsPath(collection,path){return collection.some(function(x){return path.match(new RegExp("/"+x+"/?$"));});},/* Stringifies object or coerces to string */stringify:stringify,/* Tagged Stringify */taggedStringify:function taggedStringify(strings){for(var _len9=arguments.length,expr=Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){expr[_key9-1]=arguments[_key9];}return strings.reduce(function(acc,curr,i){return acc+curr+(stringify(expr[i])||'');},'');},/* Short circuits with given value on pred. Else calls function */short:function short(pred,shorter){return function(fn){return function(value){return pred(value)?shorter(value):fn(value);};};},/* Check if object has given property */hasProp:function hasProp(obj){return function(prop){return prop in obj;};},/* Fetches last element from list */last:function last(arr){return arr[arr.length-1];},/* Uppercases first letter of word */upperCaseFirstLetter:function upperCaseFirstLetter(word){return word[0].toUpperCase()+word.slice(1);},/* Lowercases first letter of word */lowerCaseFirstLetter:function lowerCaseFirstLetter(word){return word[0].toLowerCase()+word.slice(1);},/* Creates an array or pushes to an existing one */arrayOrPush:function arrayOrPush(obj,key,item){return Array.isArray(obj[key])?obj[key].push(item):obj[key]=[item];},/* Assigns to key or creates a new object */assignToObject:function assignToObject(obj,path){return function(key,value){return isObject(obj[path])?obj[path][key]=value:obj[path]=_defineProperty2({},key,value);};}};},{"json-stringify-safe":47}],248:[function(require,module,exports){module.exports={Start:Symbol('Start'),End:Symbol('End'),expect:Symbol('expect'),pass:'pass',fail:'fail'};},{}]},{},[1])(1);}); +"use strict"; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extends2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _templateObject = _taggedTemplateLiteral(["", " is not an array"], ["", " is not an array"]), + _templateObject2 = _taggedTemplateLiteral(["", " is not an object"], ["", " is not an object"]), + _templateObject3 = _taggedTemplateLiteral(["", " doesn't have length ", ""], ["", " doesn't have length ", ""]), + _templateObject4 = _taggedTemplateLiteral(["", " is not equal to ", ""], ["", " is not equal to ", ""]), + _templateObject5 = _taggedTemplateLiteral(["", " is not deeply equal to ", ""], ["", " is not deeply equal to ", ""]), + _templateObject6 = _taggedTemplateLiteral(["", " does not contain ", ""], ["", " does not contain ", ""]), + _templateObject7 = _taggedTemplateLiteral(["", " is not true"], ["", " is not true"]), + _templateObject8 = _taggedTemplateLiteral(["", " is not false"], ["", " is not false"]), + _templateObject9 = _taggedTemplateLiteral(["", " does not have property '", "'"], ["", " does not have property '", "'"]), + _templateObject10 = _taggedTemplateLiteral(["<", "> does not exist in ", ""], ["<", "> does not exist in ", ""]), + _templateObject11 = _taggedTemplateLiteral(["", " is not a promise"], ["", " is not a promise"]), + _templateObject12 = _taggedTemplateLiteral(["'", "' does not resolve to '", "'"], ["'", "' does not resolve to '", "'"]), + _templateObject13 = _taggedTemplateLiteral(["'", "' is not of type '", "'"], ["'", "' is not of type '", "'"]), + _templateObject14 = _taggedTemplateLiteral(["'", "' is not greater than ", ""], ["'", "' is not greater than ", ""]), + _templateObject15 = _taggedTemplateLiteral(["'", "' is not less than ", ""], ["'", "' is not less than ", ""]), + _templateObject16 = _taggedTemplateLiteral(["'", "' is less than ", ""], ["'", "' is less than ", ""]), + _templateObject17 = _taggedTemplateLiteral(["'", "' is greater than ", ""], ["'", "' is greater than ", ""]); + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperty2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +(function (f) { + if ((typeof exports === "undefined" ? "undefined" : _typeof2(exports)) === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g;if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + }g.Gunner = f(); + } +})(function () { + var define, module, exports;return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = "function" == typeof require && require;if (!f && c) return c(i, !0);if (u) return u(i, !0);var a = new Error("Cannot find module '" + i + "'");throw a.code = "MODULE_NOT_FOUND", a; + }var p = n[i] = { exports: {} };e[i][0].call(p.exports, function (r) { + var n = e[i][1][r];return o(n || r); + }, p, p.exports, r, e, n, t); + }return n[i].exports; + }for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { + o(t[i]); + }return o; + }return r; + }()({ 1: [function (require, module, exports) { + module.exports = require('../src/gunner'); + }, { "../src/gunner": 8 }], 2: [function (require, module, exports) { + (function (global) { + (function (f) { + if ((typeof exports === "undefined" ? "undefined" : _typeof2(exports)) === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + } + g.isEq = f(); + } + })(function () { + var define, module, exports; + return function () { + function e(t, n, r) { + function s(o, u) { + if (!n[o]) { + if (!t[o]) { + var a = typeof require == "function" && require; + if (!u && a) return a(o, !0); + if (i) return i(o, !0); + var f = new Error("Cannot find module '" + o + "'"); + throw f.code = "MODULE_NOT_FOUND", f; + } + var l = n[o] = { exports: {} }; + t[o][0].call(l.exports, function (e) { + var n = t[o][1][e]; + return s(n ? n : e); + }, l, l.exports, e, t, n, r); + } + return n[o].exports; + } + var i = typeof require == "function" && require; + for (var o = 0; o < r.length; o++) { + s(r[o]); + }return s; + } + return e; + }()({ + 1: [function (require, module, exports) { + "use strict"; + + var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof2(obj); + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj); + }; + var isEq = function isEq(item1, item2, compareKeys) { + if (item1 === item2) return true; + if ((typeof item1 === "undefined" ? "undefined" : _typeof(item1)) !== (typeof item2 === "undefined" ? "undefined" : _typeof(item2))) return false; + if (Array.isArray(item1) && !Array.isArray(item2) || Array.isArray(item2) && !Array.isArray(item1)) return false; + if (typeof item1 === "number") { + if (isNaN(item1) && isNaN(item2)) return false;else return item1 === item2; + } + if (typeof item1 === "string" || typeof item1 === "boolean" || item1 === null || item1 === undefined) { + return item1 === item2; + } + if (item1 instanceof RegExp) return String(item1) === String(item2); + if ((typeof item1 === "undefined" ? "undefined" : _typeof(item1)) !== "object" || (typeof item2 === "undefined" ? "undefined" : _typeof(item2)) !== "object") return item1 === item2; + var item1Keys = Object.keys(item1); + var item2Keys = Object.keys(item2); + if (!compareKeys) { + compareKeys = item1Keys; + if (item1Keys.length !== item2Keys.length) { + return false; + } + } + if (!Array.isArray(compareKeys)) throw new Error("[isEq] third parameter should be an array of keys!"); + if (compareKeys.length === 0) return true; + for (var KeyIndex in compareKeys) { + var Key = compareKeys[KeyIndex]; + if (Array.isArray(item1[Key]) && Array.isArray(item2[Key])) { + Key = KeyIndex; + } + if (item1[Key] !== item2[Key]) { + if (_typeof(item1[Key] === "object") && _typeof(item2[Key] === "object") || Array.isArray(item1[Key]) && Array.isArray(item2[Key])) { + if (!isEq(item1[Key], item2[Key])) { + return false; + } + } else { + return false; + } + } + } + return true; + }; + module.exports = isEq; + }, {}] + }, {}, [1])(1); + }); + }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); + }, {}], 3: [function (require, module, exports) { + (function (global) { + "use strict"; + var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; + };var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof2(obj); + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj); + };function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + }return obj; + }function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + }return arr2; + } else { + return Array.from(arr); + } + }(function (f) { + if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g;if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + }g.promiseObject = f(); + } + })(function () { + var define, module, exports;return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = "function" == typeof require && require;if (!f && c) return c(i, !0);if (u) return u(i, !0);var a = new Error("Cannot find module '" + i + "'");throw a.code = "MODULE_NOT_FOUND", a; + }var p = n[i] = { exports: {} };e[i][0].call(p.exports, function (r) { + var n = e[i][1][r];return o(n || r); + }, p, p.exports, r, e, n, t); + }return n[i].exports; + }for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { + o(t[i]); + }return o; + }return r; + }()({ 1: [function (require, module, exports) { + module.exports = require("../index.js"); + }, { "../index.js": 2 }], 2: [function (require, module, exports) { + "use strict"; + var isObject = function isObject(x) { + return x && (typeof x === "undefined" ? "undefined" : _typeof(x)) === "object" && x.constructor === Object; + };var $SELF = typeof Symbol !== "undefined" ? Symbol("SELF") : "[~~//-- SELF --//~~]";var makeCyclic = function makeCyclic(object, query) { + var start = function start(obj) { + return Object.keys(obj).reduce(function (acc, key) { + var value = obj[key];if (value === query) { + obj[key] = object;return [].concat(_toConsumableArray(acc), [key]); + }if (isObject(value)) return [].concat(_toConsumableArray(acc), _toConsumableArray(start(value, query)));else return acc; + }, []); + };return start(object); + };var PromiseMap = function PromiseMap(arr, functor) { + return Promise.all(arr.map(function (x) { + return Promise.resolve(x).then(functor); + })); + };var ResolveObject = function ResolveObject(obj) { + return Promise.all(Object.keys(obj).map(function (key) { + return Promise.resolve(obj[key]).then(function (val) { + return obj[key] = val; + }); + })).then(function (_) { + return obj; + }); + };var PromiseObject = function PromiseObject(object) { + var shouldReplaceSelf = false;var ResolveDeepObject = function ResolveDeepObject(obj) { + return Promise.resolve(obj).then(function (resolvedObject) { + if (Array.isArray(resolvedObject)) { + return PromiseMap(resolvedObject, function (obj) { + return ResolveDeepObject(obj); + }); + } else if (isObject(resolvedObject)) { + return ResolveObject(Object.keys(resolvedObject).reduce(function (acc, key) { + if (resolvedObject[key] === object) { + shouldReplaceSelf = true;return _extends({}, acc, _defineProperty({}, key, $SELF)); + }return _extends({}, acc, _defineProperty({}, key, ResolveDeepObject(resolvedObject[key]))); + }, {})); + }return resolvedObject; + }); + };return ResolveDeepObject(object).then(function (obj) { + if (shouldReplaceSelf) makeCyclic(obj, $SELF);return obj; + }); + };module.exports = PromiseObject; + }, {}] }, {}, [1])(1); + }); + }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); + }, { "../index.js": 4 }], 4: [function (require, module, exports) { + "use strict"; + + /** + * Returns true if x is an object, false otherwise. + * @param {any} x + * @returns {Boolean} + */ + + var isObject = function isObject(x) { + return x && (typeof x === "undefined" ? "undefined" : _typeof2(x)) === 'object' && x.constructor === Object; + }; + + /* A well known Symbol. */ + var $SELF = typeof Symbol !== 'undefined' ? Symbol('SELF') : '[~~//-- SELF --//~~]'; + + /** + * Replaces values that match the query parameter + * with a reference to the parent parameter. + * @param {Object} object Object to make cyclic. + * @param {any} query Query to match against. + * @returns {Object} + */ + var makeCyclic = function makeCyclic(object, query) { + var start = function start(obj) { + return Object.keys(obj).reduce(function (acc, key) { + var value = obj[key]; + if (value === query) { + obj[key] = object; + return [].concat(_toConsumableArray2(acc), [key]); + }; + if (isObject(value)) return [].concat(_toConsumableArray2(acc), _toConsumableArray2(start(value, query)));else return acc; + }, []); + }; + return start(object); + }; + + /** + * Promise.map polyfill. + * @param {Array.} arr Array of Promises. + * @param {Function} functor Function to call resolved values. + */ + var PromiseMap = function PromiseMap(arr, functor) { + return Promise.all(arr.map(function (x) { + return Promise.resolve(x).then(functor); + })); + }; + + /** + * Resolve a flat object's promises. + * @param {Object} + * @returns {Object} + */ + var ResolveObject = function ResolveObject(obj) { + return Promise.all(Object.keys(obj).map(function (key) { + return Promise.resolve(obj[key]).then(function (val) { + return obj[key] = val; + }); + })).then(function (_) { + return obj; + }); + }; + + /** + * Recursively resolves deep objects with nested promises. + * @param {Object} object Object or value to resolve. + * @returns {Object} Resolved object. + */ + var PromiseObject = function PromiseObject(object) { + var shouldReplaceSelf = false; + var ResolveDeepObject = function ResolveDeepObject(obj) { + return Promise.resolve(obj).then(function (resolvedObject) { + if (Array.isArray(resolvedObject)) { + // Promise and map every item to recursively deep resolve. + return PromiseMap(resolvedObject, function (obj) { + return ResolveDeepObject(obj); + }); + } else if (isObject(resolvedObject)) { + return ResolveObject(Object.keys(resolvedObject).reduce(function (acc, key) { + if (resolvedObject[key] === object) { + shouldReplaceSelf = true; + return _extends2({}, acc, _defineProperty2({}, key, $SELF)); + } + return _extends2({}, acc, _defineProperty2({}, key, ResolveDeepObject(resolvedObject[key]))); + }, {})); + } + return resolvedObject; + }); + }; + return ResolveDeepObject(object).then(function (obj) { + // Replace $SELF with reference to obj + if (shouldReplaceSelf) makeCyclic(obj, $SELF); + return obj; + }); + }; + + module.exports = PromiseObject; + }, {}], 5: [function (require, module, exports) { + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var objectCreate = Object.create || objectCreatePolyfill; + var objectKeys = Object.keys || objectKeysPolyfill; + var bind = Function.prototype.bind || functionBindPolyfill; + + function EventEmitter() { + if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { + this._events = objectCreate(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; + } + module.exports = EventEmitter; + + // Backwards-compat with node 0.10.x + EventEmitter.EventEmitter = EventEmitter; + + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._maxListeners = undefined; + + // By default EventEmitters will print a warning if more than 10 listeners are + // added to it. This is a useful default which helps finding memory leaks. + var defaultMaxListeners = 10; + + var hasDefineProperty; + try { + var o = {}; + if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 }); + hasDefineProperty = o.x === 0; + } catch (err) { + hasDefineProperty = false; + } + if (hasDefineProperty) { + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function get() { + return defaultMaxListeners; + }, + set: function set(arg) { + // check whether the input is a positive number (whose value is zero or + // greater and not a NaN). + if (typeof arg !== 'number' || arg < 0 || arg !== arg) throw new TypeError('"defaultMaxListeners" must be a positive number'); + defaultMaxListeners = arg; + } + }); + } else { + EventEmitter.defaultMaxListeners = defaultMaxListeners; + } + + // Obviously not all Emitters should be limited to 10. This function allows + // that to be increased. Set to zero for unlimited. + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || isNaN(n)) throw new TypeError('"n" argument must be a positive number'); + this._maxListeners = n; + return this; + }; + + function $getMaxListeners(that) { + if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } + + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return $getMaxListeners(this); + }; + + // These standalone emit* functions are used to optimize calling of event + // handlers for fast cases because emit() itself often has a variable number of + // arguments and can be deoptimized because of that. These functions always have + // the same number of arguments and thus do not get deoptimized, so the code + // inside them can execute faster. + function emitNone(handler, isFn, self) { + if (isFn) handler.call(self);else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) { + listeners[i].call(self); + } + } + } + function emitOne(handler, isFn, self, arg1) { + if (isFn) handler.call(self, arg1);else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) { + listeners[i].call(self, arg1); + } + } + } + function emitTwo(handler, isFn, self, arg1, arg2) { + if (isFn) handler.call(self, arg1, arg2);else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) { + listeners[i].call(self, arg1, arg2); + } + } + } + function emitThree(handler, isFn, self, arg1, arg2, arg3) { + if (isFn) handler.call(self, arg1, arg2, arg3);else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) { + listeners[i].call(self, arg1, arg2, arg3); + } + } + } + + function emitMany(handler, isFn, self, args) { + if (isFn) handler.apply(self, args);else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) { + listeners[i].apply(self, args); + } + } + } + + EventEmitter.prototype.emit = function emit(type) { + var er, handler, len, args, i, events; + var doError = type === 'error'; + + events = this._events; + if (events) doError = doError && events.error == null;else if (!doError) return false; + + // If there is no 'error' event listener then throw. + if (doError) { + if (arguments.length > 1) er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Unhandled "error" event. (' + er + ')'); + err.context = er; + throw err; + } + return false; + } + + handler = events[type]; + + if (!handler) return false; + + var isFn = typeof handler === 'function'; + len = arguments.length; + switch (len) { + // fast cases + case 1: + emitNone(handler, isFn, this); + break; + case 2: + emitOne(handler, isFn, this, arguments[1]); + break; + case 3: + emitTwo(handler, isFn, this, arguments[1], arguments[2]); + break; + case 4: + emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); + break; + // slower + default: + args = new Array(len - 1); + for (i = 1; i < len; i++) { + args[i - 1] = arguments[i]; + }emitMany(handler, isFn, this, args); + } + + return true; + }; + + function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + if (typeof listener !== 'function') throw new TypeError('"listener" argument must be a function'); + + events = target._events; + if (!events) { + events = target._events = objectCreate(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener) { + target.emit('newListener', type, listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (!existing) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = prepend ? [listener, existing] : [existing, listener]; + } else { + // If we've already got an array, just append. + if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + } + + // Check for listener leak + if (!existing.warned) { + m = $getMaxListeners(target); + if (m && m > 0 && existing.length > m) { + existing.warned = true; + var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' "' + String(type) + '" listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit.'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + if ((typeof console === "undefined" ? "undefined" : _typeof2(console)) === 'object' && console.warn) { + console.warn('%s: %s', w.name, w.message); + } + } + } + } + + return target; + } + + EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); + }; + + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + + EventEmitter.prototype.prependListener = function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + switch (arguments.length) { + case 0: + return this.listener.call(this.target); + case 1: + return this.listener.call(this.target, arguments[0]); + case 2: + return this.listener.call(this.target, arguments[0], arguments[1]); + case 3: + return this.listener.call(this.target, arguments[0], arguments[1], arguments[2]); + default: + var args = new Array(arguments.length); + for (var i = 0; i < args.length; ++i) { + args[i] = arguments[i]; + }this.listener.apply(this.target, args); + } + } + } + + function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = bind.call(onceWrapper, state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } + + EventEmitter.prototype.once = function once(type, listener) { + if (typeof listener !== 'function') throw new TypeError('"listener" argument must be a function'); + this.on(type, _onceWrap(this, type, listener)); + return this; + }; + + EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { + if (typeof listener !== 'function') throw new TypeError('"listener" argument must be a function'); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + + // Emits a 'removeListener' event if and only if the listener was removed. + EventEmitter.prototype.removeListener = function removeListener(type, listener) { + var list, events, position, i, originalListener; + + if (typeof listener !== 'function') throw new TypeError('"listener" argument must be a function'); + + events = this._events; + if (!events) return this; + + list = events[type]; + if (!list) return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) this._events = objectCreate(null);else { + delete events[type]; + if (events.removeListener) this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) return this; + + if (position === 0) list.shift();else spliceOne(list, position); + + if (list.length === 1) events[type] = list[0]; + + if (events.removeListener) this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + + EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (!events) return this; + + // not listening for removeListener, no need to emit + if (!events.removeListener) { + if (arguments.length === 0) { + this._events = objectCreate(null); + this._eventsCount = 0; + } else if (events[type]) { + if (--this._eventsCount === 0) this._events = objectCreate(null);else delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = objectKeys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = objectCreate(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + + function _listeners(target, type, unwrap) { + var events = target._events; + + if (!events) return []; + + var evlistener = events[type]; + if (!evlistener) return []; + + if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); + } + + EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); + }; + + EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); + }; + + EventEmitter.listenerCount = function (emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } + }; + + EventEmitter.prototype.listenerCount = listenerCount; + function listenerCount(type) { + var events = this._events; + + if (events) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener) { + return evlistener.length; + } + } + + return 0; + } + + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; + }; + + // About 1.5x faster than the two-arg version of Array#splice(). + function spliceOne(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) { + list[i] = list[k]; + }list.pop(); + } + + function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) { + copy[i] = arr[i]; + }return copy; + } + + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; + } + + function objectCreatePolyfill(proto) { + var F = function F() {}; + F.prototype = proto; + return new F(); + } + function objectKeysPolyfill(obj) { + var keys = []; + for (var k in obj) { + if (Object.prototype.hasOwnProperty.call(obj, k)) { + keys.push(k); + } + }return k; + } + function functionBindPolyfill(context) { + var fn = this; + return function () { + return fn.apply(context, arguments); + }; + } + }, {}], 6: [function (require, module, exports) { + exports = module.exports = stringify; + exports.getSerialize = serializer; + + function stringify(obj, replacer, spaces, cycleReplacer) { + return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces); + } + + function serializer(replacer, cycleReplacer) { + var stack = [], + keys = []; + + if (cycleReplacer == null) cycleReplacer = function cycleReplacer(key, value) { + if (stack[0] === value) return "[Circular ~]"; + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; + }; + + return function (key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this); + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value); + } else stack.push(value); + + return replacer == null ? value : replacer.call(this, key, value); + }; + } + }, {}], 7: [function (require, module, exports) { + // shim for using process in browser + var process = module.exports = {}; + + // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. + + var cachedSetTimeout; + var cachedClearTimeout; + + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + })(); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + + process.listeners = function (name) { + return []; + }; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, {}], 8: [function (require, module, exports) { + (function (process) { + 'use strict'; + + var _require = require('./util'), + arrayOrPush = _require.arrayOrPush; + + var caller = require('./lib/caller'); + var emitter = require('./lib/emitter'); + var reporters = require('./reporters'); + var testrunner = require('./lib/testrunner'); + var expect = require('./lib/expect'); + + var symbols = require('./util/symbols'); + + var Gunner = function () { + function Gunner(name) { + var _beforeHooks, _afterHooks; + + _classCallCheck(this, Gunner); + + this.name = name; + this.__suite__ = { + tests: [], + beforeHooks: (_beforeHooks = {}, _defineProperty2(_beforeHooks, symbols.Start, []), _defineProperty2(_beforeHooks, symbols.End, []), _defineProperty2(_beforeHooks, '*', []), _beforeHooks), + afterHooks: (_afterHooks = {}, _defineProperty2(_afterHooks, symbols.Start, []), _defineProperty2(_afterHooks, symbols.End, []), _defineProperty2(_afterHooks, '*', []), _afterHooks) + }; + } + + _createClass(Gunner, [{ + key: "test", + value: function test(description, _test) { + var existing = this.__suite__.tests.find(function (x) { + return x.description === description; + }); + if (existing) throw new Error("Test '" + description + "' already exists!"); + + var unit = { + description: description, + type: 'test', + run: function run(state) { + return caller(_test, state); + } + }; + this.__suite__.tests.push(unit); + return this; + } + }, { + key: "before", + value: function before(description, _run, label) { + var unit = { + description: description, + label: label, + type: 'hook', + run: function run(state) { + return caller(_run, state); + } + }; + arrayOrPush(this.__suite__.beforeHooks, description, unit); + return this; + } + }, { + key: "after", + value: function after(description, _run2, label) { + var unit = { + description: description, + label: label, + type: 'hook', + run: function run(state) { + return caller(_run2, state); + } + }; + arrayOrPush(this.__suite__.afterHooks, description, unit); + return this; + } + }, { + key: "run", + value: function run() { + var _this = this; + + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + + if (options.reporter === true) reporters.default(emitter, options);else if (typeof options.reporter === 'function') options.reporter(emitter, options);else if (reporters[options.reporter]) reporters[options.reporter](emitter, options); + + emitter.emit('start'); + return testrunner(this, options).then(function (results) { + var _ref; + + results.count = results.length; + results.success = results.filter(function (r) { + return r.status === 'ok'; + }); + results.failures = results.filter(function (r) { + return r.status === 'notOk'; + }); + results.skipped = results.filter(function (r) { + return r.status === 'skip'; + }); + results.successPercent = Math.floor(results.success.length / results.length * 100); + + results.name = _this.name; + + if (results.successPercent !== 100 && typeof process !== 'undefined') process.exitCode = 1; + emitter.emit('test end', results); + emitter.emit('end', results); + + return options.request ? (_ref = {}, _defineProperty2(_ref, options.request, reporters[options.request].convert(results)), _defineProperty2(_ref, "json", results), _ref) : results; + }); + } + }]); + + return Gunner; + }(); + + module.exports = Gunner; + module.exports.expect = expect; + module.exports.expectMany = expect.expectMany; + module.exports.Start = symbols.Start; + module.exports.End = symbols.End; + module.exports.Gunner = module.exports; + }).call(this, require('_process')); + }, { "./lib/caller": 12, "./lib/emitter": 13, "./lib/expect": 14, "./lib/testrunner": 15, "./reporters": 17, "./util": 20, "./util/symbols": 21, "_process": 7 }], 9: [function (require, module, exports) { + var _require2 = require('../util'), + isPromise = _require2.isPromise; + + var createRejectionStatement = function createRejectionStatement(statement) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return Promise.reject(statement ? statement.apply(undefined, args) : ''); + }; + + var assertPromise = function assertPromise(bool, statementTuple) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var _statementTuple = _toArray(statementTuple), + statement = _statementTuple[0], + args = _statementTuple.slice(1); + + statement = options.skipStatement ? function () { + return options.skipStatement; + } : statement; + + if (isPromise(bool)) return bool.catch(function () { + return createRejectionStatement.apply(undefined, [statement].concat(_toConsumableArray2(args))); + }); + + return bool ? Promise.resolve() : createRejectionStatement.apply(undefined, [statement].concat(_toConsumableArray2(args))); + }; + + module.exports = assertPromise; + }, { "../util": 20 }], 10: [function (require, module, exports) { + var isEq = require('@codefeathers/iseq'); + var U = require('../util'); + var _ = U.taggedStringify; + + module.exports.done = [function () { + return true; + }, function () { + return null; + }]; + module.exports.fail = [function () { + return false; + }, function (_, rejection) { + return rejection; + }]; + module.exports.exists = [function (val) { + return typeof val !== 'undefined'; + }, function () { + return "Value is undefined"; + }]; + module.exports.isArray = [function (val) { + return Array.isArray(val); + }, function (val) { + return _(_templateObject, val); + }]; + module.exports.isObject = [function (val) { + return (typeof val === "undefined" ? "undefined" : _typeof2(val)) === 'object' && val !== null; + }, function (val) { + return _(_templateObject2, val); + }]; + module.exports.hasLength = [function (val, l) { + return val.length === l; + }, function (val, l) { + return _(_templateObject3, val, l); + }]; + module.exports.equals = [function (val, thing) { + return val === thing; + }, function (val, thing) { + return _(_templateObject4, val, thing); + }]; + module.exports.deepEquals = [function (val, match) { + return isEq(val, match); + }, function (val, match) { + return _(_templateObject5, val, match); + }]; + module.exports.contains = [function (val, match) { + return isEq(val, match, Object.keys(match)); + }, function (val, match) { + return _(_templateObject6, val, match); + }]; + module.exports.isTrue = [function (val) { + return val === true; + }, function (val) { + return _(_templateObject7, val); + }]; + module.exports.isFalse = [function (val) { + return val === false; + }, function (val) { + return _(_templateObject8, val); + }]; + module.exports.hasProp = [function (val, prop) { + return val.hasOwnProperty(prop); + }, function (val, prop) { + return _(_templateObject9, val, prop); + }]; + module.exports.hasPair = [function (val) { + for (var _len2 = arguments.length, pair = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + pair[_key2 - 1] = arguments[_key2]; + } + + return isEq(val[pair[0]], pair[1]); + }, function (val) { + for (var _len3 = arguments.length, pair = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + pair[_key3 - 1] = arguments[_key3]; + } + + return _(_templateObject10, pair, val); + }]; + module.exports.isPromise = [function (val) { + return U.isPromise(val); + }, function (val) { + return _(_templateObject11, val); + }, { shouldCatch: true }]; + module.exports.resolvesTo = [function (val, thing) { + return U.isPromise(val) ? val.then(function (x) { + return x === thing ? Promise.resolve() : Promise.reject(); + }) : Promise.reject(val + " was not a Promise"); + }, function (val, thing) { + return _(_templateObject12, val, thing); + }]; + module.exports.isType = [function (val, type) { + return type === 'nil' && (val === 'null' || val === 'undefined') || (typeof val === "undefined" ? "undefined" : _typeof2(val)) === type || Array.isArray(val) && type === "array" && val === null && type !== 'object'; + }, function (val, type) { + return _(_templateObject13, val, type); + }]; + module.exports.greaterThan = [function (val, compare) { + return val > compare; + }, function (val, compare) { + return _(_templateObject14, val, compare); + }]; + module.exports.lessThan = [function (val, compare) { + return val < compare; + }, function (val, compare) { + return _(_templateObject15, val, compare); + }]; + module.exports.gte = [function (val, compare) { + return val >= compare; + }, function (val, compare) { + return _(_templateObject16, val, compare); + }]; + module.exports.lte = [function (val, compare) { + return val <= compare; + }, function (val, compare) { + return _(_templateObject17, val, compare); + }]; + + /* Convenience aliases */ + module.exports.success = module.exports.done; + module.exports.succeed = module.exports.done; + module.exports.failure = module.exports.fail; + module.exports.equal = module.exports.equals; + module.exports.deepEqual = module.exports.deepEquals; + module.exports.match = module.exports.deepEquals; + module.exports.greaterThanOrEqualTo = module.exports.gte; + module.exports.lessThanOrEqualTo = module.exports.lte; + }, { "../util": 20, "@codefeathers/iseq": 2 }], 11: [function (require, module, exports) { + // Only imported for JSDoc + /* eslint-disable-next-line */ + var Gunner = require('../gunner'); + var symbols = require('../util/symbols'); + + var wrap = function wrap(type) { + return function (unit) { + return { type: type, unit: unit }; + }; + }; + + /** + * runs the test suite + * @param {Gunner} instance + */ + var buildTestTree = function buildTestTree(instance) { + + var testQueue = []; + + Array.prototype.push.apply(testQueue, instance.__suite__.beforeHooks[symbols.Start].map(wrap('@start'))); + testQueue.push.apply(instance.__suite__.afterHooks[symbols.Start].map(wrap('@start'))); + + instance.__suite__.tests.forEach(function (test) { + return Array.prototype.push.apply(testQueue, instance.__suite__.beforeHooks['*'].map(wrap('@every'))), Array.prototype.push.apply(testQueue, (instance.__suite__.beforeHooks[test.description] || []).map(wrap('@this'))), testQueue.push(wrap('@test')(test)), Array.prototype.push.apply(testQueue, (instance.__suite__.afterHooks[test.description] || []).map(wrap('@afterTest'))), Array.prototype.push.apply(testQueue, instance.__suite__.afterHooks['*'].map(wrap('@afterEvery'))); + }); + + Array.prototype.push.apply(testQueue, instance.__suite__.beforeHooks[symbols.End].map(wrap('@beforeend'))); + Array.prototype.push.apply(testQueue, instance.__suite__.afterHooks[symbols.End].map(wrap('@end'))); + + return testQueue; + }; + + module.exports = buildTestTree; + }, { "../gunner": 8, "../util/symbols": 21 }], 12: [function (require, module, exports) { + var _require3 = require('../util'), + isPromise = _require3.isPromise; + + var caller = function caller(test, state) { + + var value = void 0, + error = void 0, + errored = void 0; + try { + value = test(state); + } catch (e) { + errored = true; + error = e; + } + + var promise = isPromise(value); + + if (promise) { + return value.then(function (res) { + return { status: 'ok', resolve: res, promise: true }; + }).catch(function (rej) { + return { status: 'notOk', rejection: rej, promise: true }; + }); + } else { + return Promise.resolve(_extends2({ + status: errored ? 'notOk' : 'ok' + }, !errored && { value: value }, errored && { error: error }, { + promise: false + })); + } + }; + + module.exports = caller; + }, { "../util": 20 }], 13: [function (require, module, exports) { + var EventEmitter = require('events'); + + var GunnerEmitter = function (_EventEmitter) { + _inherits(GunnerEmitter, _EventEmitter); + + function GunnerEmitter() { + _classCallCheck(this, GunnerEmitter); + + return _possibleConstructorReturn(this, (GunnerEmitter.__proto__ || Object.getPrototypeOf(GunnerEmitter)).apply(this, arguments)); + } + + return GunnerEmitter; + }(EventEmitter); + + module.exports = new GunnerEmitter(); + }, { "events": 5 }], 14: [function (require, module, exports) { + 'use strict'; + + var _require4 = require('../util'), + liftPromise = _require4.liftPromise, + lowerCaseFirstLetter = _require4.lowerCaseFirstLetter; + + var library = require('./assertionsLibrary'); + var assertPromise = require('./assertPromise'); + + var expectPromise = function expectPromise(pred, statement) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return function (toTest) { + return function () { + for (var _len4 = arguments.length, testValues = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + testValues[_key4] = arguments[_key4]; + } + + return liftPromise(function (resolvedValue) { + return assertPromise(pred.apply(undefined, [toTest].concat(testValues)), [statement, resolvedValue].concat(testValues)); + }, toTest).catch(function (rejectedValue) { + return options.shouldCatch ? assertPromise(pred.apply(undefined, [toTest].concat(testValues)), [statement, rejectedValue].concat(testValues), { skipStatement: rejectedValue }) : Promise.reject(rejectedValue); + }); + }; + }; + }; + + var expects = Object.keys(library).reduce(function (acc, e) { + var _library$e = _slicedToArray(library[e], 3), + pred = _library$e[0], + statement = _library$e[1], + options = _library$e[2]; + + acc[e] = expectPromise(pred, statement, options); + + return acc; + }, {}); + + var negateP = function negateP(prom) { + return prom.then(Promise.reject, Promise.resolve); + }; + + var expect = function expect(thing, args) { + return new Proxy({}, { + get: function get(obj, prop) { + var toCheck = args ? thing.apply(undefined, _toConsumableArray2(args)) : thing; + if (expects.hasOwnProperty(prop)) return function () { + return expects[prop](toCheck).apply(undefined, arguments); + };else if (prop.slice(0, 3) === 'not') return function () { + return negateP(expects[lowerCaseFirstLetter(prop.slice(3))](toCheck).apply(undefined, arguments)); + };else throw new Error('Unknown assertion method', prop); + } + }); + }; + + var expectMany = function expectMany() { + for (var _len5 = arguments.length, expects = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + expects[_key5] = arguments[_key5]; + } + + return Promise.all(expects); + }; + + module.exports = expect; + module.exports.expectMany = expectMany; + }, { "../util": 20, "./assertPromise": 9, "./assertionsLibrary": 10 }], 15: [function (require, module, exports) { + // Only imported for JSDoc + /* eslint-disable-next-line */ + var Gunner = require('../gunner'); + Promise.object = require('@codefeathers/promise.object'); + + var _require5 = require('../util'), + last = _require5.last, + pipe = _require5.pipe, + pick = _require5.pick, + assignToObject = _require5.assignToObject; + + var buildTestQueue = require('./buildTestQueue'); + + var findSkip = function findSkip(skip, unit) { + + var startFailed = skip.findIndex(function (x) { + return x.type === '@start'; + }); + var everyFailed = skip.findIndex(function (x) { + return x.type === '@every'; + }); + var beforeFailed = skip.findIndex(function (x) { + return x.description === unit.description; + }); + + return startFailed !== -1 && 'A start hook failed\n' + skip[startFailed].error || everyFailed !== -1 && 'An every hook failed\n' + skip[everyFailed].error || beforeFailed !== -1 && 'A before test hook failed\n' + skip[beforeFailed].error; + }; + + var reduceQueue = function reduceQueue(queue) { + return queue.reduce(function (acc, item) { + return Promise.resolve(acc).then(function (acc) { + + return Promise.all([last(acc.results), Promise.object(acc.state)]).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + state = _ref3[1]; + + var toSkip = findSkip(acc.skip, item.unit); + return [toSkip, state]; + }).then(function (_ref4) { + var _ref5 = _slicedToArray(_ref4, 2), + toSkip = _ref5[0], + state = _ref5[1]; + + return toSkip ? { status: 'skip', description: toSkip } : item.unit.run(state); + }).then(function (result) { + var status = result.status; + + + if (item.type === '@test') { + + var resultObject = _extends2({ + status: status, + description: item.unit.description + }, (status === 'notOk' || status === 'skip') && { reason: result.error || result.rejection || result.description }); + acc.results.push(resultObject); + } else { + + var identifier = item.unit.label || queue.filter(function (i) { + return i.type === item.type; + }).filter(function (i) { + return i.unit.description === item.unit.description; + }).length; + + var stateAddition = + /* eslint-disable-next-line */ + status === 'ok' ? result.promise ? result.resolve : result.value : null; + + if (identifier && stateAddition) assignToObject(acc.state, item.type)(identifier, stateAddition); + } + + if (status === 'notOk') { + + acc.skip.push({ + type: item.type, + description: item.unit.description, + error: result.promise ? result.rejection : result.error + }); + } + + return acc; + }); + }); + }, { results: [], state: {}, skip: [] }); + }; + + /** + * runs the test suite + * @param {Gunner} instance + * @param {object} options + */ + var testrunner = function testrunner(instance) { + + return Promise.object(pipe(buildTestQueue, reduceQueue, pick('results'))(instance)); + }; + + module.exports = testrunner; + }, { "../gunner": 8, "../util": 20, "./buildTestQueue": 11, "@codefeathers/promise.object": 3 }], 16: [function (require, module, exports) { + var statusMap = { + + 'ok': ['ok', '✅'], + 'notOk': ['notOk', '❌'], + 'skip': ['skip', '⚠️'] + + }; + + var convert = function convert(x) { + return x; + }; + + var Default = function Default(runner, options) { + + runner.on('start', function () { + return console.log('Started tests'); + }); + + runner.on('test end', function (results) { + + results.forEach(function (x) { + + var s = statusMap[x.status]; + + console.log('>', s[0], s[1], x.description); + options.trace && x.reason && console.log('\n---\n\n', x.reason, '\n\n---\n'); + }); + }); + + runner.on('end', function (results) { + + console.log(results.success.length, 'tests of', results.length, 'passed'); + console.log('Success ratio:', results.successPercent, '%'); + }); + }; + + module.exports = Default; + module.exports.convert = convert; + }, {}], 17: [function (require, module, exports) { + module.exports = { + + default: require('./default'), + tap: require('./tap'), + xunit: require('./xunit') + + }; + }, { "./default": 16, "./tap": 18, "./xunit": 19 }], 18: [function (require, module, exports) { + var statusMap = { + + 'ok': 'ok', + 'notOk': 'not ok', + 'skip': 'skip' + + }; + + var convert = function convert(results, options) { + return "\nTAP version 13\n" + (results.length ? '1' : 0) + ".." + results.length + "\n" + results.map(function (r, i) { + + var status = statusMap[r.status]; + var message = options.trace && r.reason && (r.reason.stack ? r.reason.stack : r.reason) || ''; + return status + " " + (i + 1) + " - " + r.description + (message && '\n ---\n message: |\n ' + message + '\n ---\n'); + }).join('\n') + "\n"; + }; + + var TAP = function TAP(runner, options) { + + runner.on('end', function (results) { + return console.log(convert(results, options)); + }); + }; + + module.exports = TAP; + module.exports.convert = convert; + }, {}], 19: [function (require, module, exports) { + var tag = function tag(name, attrs, close, content) { + var end = close ? "/>" : ">"; + var pairs = []; + var tag = void 0; + + Object.keys(attrs).forEach(function (key) { + if (Object.prototype.hasOwnProperty.call(attrs, key)) { + pairs.push(key + '="' + attrs[key] + '"'); + } + }); + + tag = "<" + name + (pairs.length ? " " + pairs.join(" ") : "") + end; + if (content) { + // content = content instanceof String ? content : escape(content); + tag += content + "' + tag('testsuites', {}, false, tag('testsuite', { + tests: count, + success: success.length, + failures: failures.length, + skipped: skipped.length + }, false, results.reduce(function (acc, r) { + var close = r.status === 'ok'; + var content = r.status !== 'ok' && (r.status === 'skip' ? tag('skipped', {}, true) : tag('failure', {}, !r.reason, r.reason ? escape(r.reason) : '')); + acc += tag('testcase', { name: escape(r.description) }, close, content || ''); + return acc; + }, ''))); + }; + + var xunit = function xunit(runner) { + runner.on("end", function (results) { + + console.log(convert(results)); + }); + }; + + module.exports = xunit; + module.exports.convert = convert; + }, {}], 20: [function (require, module, exports) { + var _stringify = require('json-stringify-safe'); + + var isObject = function isObject(x) { + return x && (typeof x === "undefined" ? "undefined" : _typeof2(x)) === 'object'; + }; + + var stringify = function stringify(obj) { + return isObject(obj) ? obj.stack || _stringify(obj) : obj; + }; + + var deepFlatten = function deepFlatten(arr) { + var _ref6; + + return (_ref6 = []).concat.apply(_ref6, _toConsumableArray2(arr.map(function (v) { + return Array.isArray(v) ? deepFlatten(v) : v; + }))); + }; + + /* Returns true if a promise is passed */ + var isPromise = function isPromise(prom) { + return prom && typeof prom.then === 'function'; + }; + + /* Lift a value or promise into a function */ + var liftPromise = function liftPromise(fn, thing) { + return isPromise(thing) ? thing.then(fn) : fn(thing); + }; + + module.exports = { + + /* Returns true if an object is passed */ + isObject: isObject, + + /* Returns true if a promise is passed */ + isPromise: isPromise, + + /* Lift a value or promise into a function */ + liftPromise: liftPromise, + + /* Returns the element found at the given path or undefined */ + path: function path(obj) { + return function (path) { + return path.reduce(function (result, segment) { + return result && result[segment]; + }, obj); + }; + }, + + /* Picks a key from an object */ + pick: function pick(key) { + return function (obj) { + return obj[key]; + }; + }, + + /* Pipe a value or promise through any number of unary functions */ + pipe: function pipe() { + for (var _len6 = arguments.length, fns = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + fns[_key6] = arguments[_key6]; + } + + return function (arg) { + return fns.reduce(function (acc, fn) { + return liftPromise(fn, acc); + }, arg); + }; + }, + + /* Reduces an array */ + reduce: function reduce(fn, def) { + return function (arr) { + return arr.reduce(fn, def); + }; + }, + + /* Flattens an array of arrays to an array */ + flatten: function flatten(arrData) { + return [].concat.apply([], arrData); + }, + + /* Deep flattens arrays */ + deepFlatten: deepFlatten, + + /* Maps a function over an array */ + map: function map(fn) { + return function (x) { + return x.map(fn); + }; + }, + + /* Filter an array using provided function */ + filter: function filter(fn) { + return function (x) { + return x.filter(fn); + }; + }, + + /* Returns identity */ + identity: function identity(x) { + return x; + }, + + /* Wraps a value in an object with given key */ + wrapWith: function wrapWith(x) { + return function (y) { + return _defineProperty2({}, x, y); + }; + }, + + /* Unwraps a value from an object with given key */ + unwrapFrom: function unwrapFrom(x) { + return function (y) { + return y[x]; + }; + }, + + /* Resolves an array of Promises */ + promiseAll: function promiseAll(x) { + return Promise.all(x); + }, + + /* Pass partial arguments and return a function that accepts the rest */ + partial: function partial(fn) { + for (var _len7 = arguments.length, args = Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) { + args[_key7 - 1] = arguments[_key7]; + } + + return function () { + for (var _len8 = arguments.length, rest = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + rest[_key8] = arguments[_key8]; + } + + return fn.apply(undefined, args.concat(rest)); + }; + }, + + /* Item is in collection */ + isIn: function isIn(collection, item) { + return collection.indexOf(item) !== -1; + }, + + /* Collection contains given path */ + containsPath: function containsPath(collection, path) { + return collection.some(function (x) { + return path.match(new RegExp("/" + x + "/?$")); + }); + }, + + /* Stringifies object or coerces to string */ + stringify: stringify, + + /* Tagged Stringify */ + taggedStringify: function taggedStringify(strings) { + for (var _len9 = arguments.length, expr = Array(_len9 > 1 ? _len9 - 1 : 0), _key9 = 1; _key9 < _len9; _key9++) { + expr[_key9 - 1] = arguments[_key9]; + } + + return strings.reduce(function (acc, curr, i) { + return acc + curr + (stringify(expr[i]) || ''); + }, ''); + }, + + /* Short circuits with given value on pred. Else calls function */ + short: function short(pred, shorter) { + return function (fn) { + return function (value) { + return pred(value) ? shorter(value) : fn(value); + }; + }; + }, + + /* Check if object has given property */ + hasProp: function hasProp(obj) { + return function (prop) { + return prop in obj; + }; + }, + + /* Fetches last element from list */ + last: function last(arr) { + return arr[arr.length - 1]; + }, + + /* Uppercases first letter of word */ + upperCaseFirstLetter: function upperCaseFirstLetter(word) { + return word[0].toUpperCase() + word.slice(1); + }, + + /* Lowercases first letter of word */ + lowerCaseFirstLetter: function lowerCaseFirstLetter(word) { + return word[0].toLowerCase() + word.slice(1); + }, + + /* Creates an array or pushes to an existing one */ + arrayOrPush: function arrayOrPush(obj, key, item) { + return Array.isArray(obj[key]) ? obj[key].push(item) : obj[key] = [item]; + }, + + /* Assigns to key or creates a new object */ + assignToObject: function assignToObject(obj, path) { + return function (key, value) { + return isObject(obj[path]) ? obj[path][key] = value : obj[path] = _defineProperty2({}, key, value); + }; + } + + }; + }, { "json-stringify-safe": 6 }], 21: [function (require, module, exports) { + module.exports = { + + Start: Symbol('Start'), + End: Symbol('End'), + + expect: Symbol('expect'), + + pass: 'pass', + fail: 'fail' + + }; + }, {}] }, {}, [1])(1); +}); diff --git a/package.json b/package.json index 75e56a8..20894e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@klenty/gunner", - "version": "0.10.2", + "version": "0.10.4", "description": "Zero magic, fast test-runner and assertion framework. No magic globals.", "main": "es6/index.js", "repository": {