>>=y,p-=y),p<15&&(d+=z[n++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<>>=y,p-=y,(y=s-a)>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){e.msg=\"unknown compression method\",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[s++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3}else{for(z=_+7;l>>=_)),u>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=30;break}for(;d--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg=\"invalid distance code\",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=a-r.offset,d=r.length;for(hd?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]]}if(k>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function P(e,t,r){e.bi_valid>d-r?(e.bi_buf|=t<>d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n<=g;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=j(s[o]++,o))}}function W(e){var t;for(t=0;t>1;1<=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_;r++)p<(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),h[2*n+1]=s,u>=7;n>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{\"../utils/common\":41}],53:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(e){!function(r,n){\"use strict\";if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(r);e=e&&e.setTimeout?e:r,i=\"[object process]\"==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e)})}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1},r.postMessage(\"\",\"*\"),r.onmessage=t,e}}()?(a=\"setImmediate$\"+Math.random()+\"$\",r.addEventListener?r.addEventListener(\"message\",d,!1):r.attachEvent(\"onmessage\",d),function(e){r.postMessage(a+e,\"*\")}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data)},function(e){t.port2.postMessage(e)}):l&&\"onreadystatechange\"in l.createElement(\"script\")?(s=l.documentElement,function(e){var t=l.createElement(\"script\");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):function(e){setTimeout(c,0,e)},e.setImmediate=function(e){\"function\"!=typeof e&&(e=new Function(\"\"+e));for(var t=new Array(arguments.length-1),r=0;r\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!seen.has(othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n return seen.add(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, customizer, bitmask, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= UNORDERED_COMPARE_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var result,\n index = -1,\n length = path.length;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result) {\n return result;\n }\n var length = object ? object.length : 0;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity]\n * The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n result[key] = [value];\n }\n});\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = groupBy;\n","/**\n * lodash 3.0.3 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\nfunction isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && objectToString.call(value) == boolTag);\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isBoolean;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n nullTag = '[object Null]',\n proxyTag = '[object Proxy]',\n undefinedTag = '[object Undefined]';\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isFunction;\n","/**\n * lodash 4.0.0 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nmodule.exports = isNil;\n","/**\n * lodash 3.0.1 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nmodule.exports = isUndefined;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array ? array.length : 0;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\n/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return baseFindIndex(array, baseIsNaN, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\n/**\n * Checks if a cache value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n Set = getNative(root, 'Set'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each\n * element is kept.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length)\n ? baseUniq(array)\n : [];\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = uniq;\n","'use strict'\nvar inherits = require('inherits')\nvar HashBase = require('hash-base')\nvar Buffer = require('safe-buffer').Buffer\n\nvar ARRAY16 = new Array(16)\n\nfunction MD5 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n}\n\ninherits(MD5, HashBase)\n\nMD5.prototype._update = function () {\n var M = ARRAY16\n for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)\n\n var a = this._a\n var b = this._b\n var c = this._c\n var d = this._d\n\n a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)\n d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)\n c = fnF(c, d, a, b, M[2], 0x242070db, 17)\n b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)\n a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)\n d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)\n c = fnF(c, d, a, b, M[6], 0xa8304613, 17)\n b = fnF(b, c, d, a, M[7], 0xfd469501, 22)\n a = fnF(a, b, c, d, M[8], 0x698098d8, 7)\n d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)\n c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)\n b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)\n a = fnF(a, b, c, d, M[12], 0x6b901122, 7)\n d = fnF(d, a, b, c, M[13], 0xfd987193, 12)\n c = fnF(c, d, a, b, M[14], 0xa679438e, 17)\n b = fnF(b, c, d, a, M[15], 0x49b40821, 22)\n\n a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)\n d = fnG(d, a, b, c, M[6], 0xc040b340, 9)\n c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)\n b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)\n a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)\n d = fnG(d, a, b, c, M[10], 0x02441453, 9)\n c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)\n b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)\n a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)\n d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)\n c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)\n b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)\n a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)\n d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)\n c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)\n b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)\n\n a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)\n d = fnH(d, a, b, c, M[8], 0x8771f681, 11)\n c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)\n b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)\n a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)\n d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)\n c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)\n b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)\n a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)\n d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)\n c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)\n b = fnH(b, c, d, a, M[6], 0x04881d05, 23)\n a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)\n d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)\n c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)\n b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)\n\n a = fnI(a, b, c, d, M[0], 0xf4292244, 6)\n d = fnI(d, a, b, c, M[7], 0x432aff97, 10)\n c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)\n b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)\n a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)\n d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)\n c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)\n b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)\n a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)\n d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)\n c = fnI(c, d, a, b, M[6], 0xa3014314, 15)\n b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)\n a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)\n d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)\n c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)\n b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)\n\n this._a = (this._a + a) | 0\n this._b = (this._b + b) | 0\n this._c = (this._c + c) | 0\n this._d = (this._d + d) | 0\n}\n\nMD5.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.allocUnsafe(16)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fnF (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnG (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnH (a, b, c, d, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnI (a, b, c, d, m, k, s) {\n return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0\n}\n\nmodule.exports = MD5\n","var bn = require('bn.js');\nvar brorand = require('brorand');\n\nfunction MillerRabin(rand) {\n this.rand = rand || new brorand.Rand();\n}\nmodule.exports = MillerRabin;\n\nMillerRabin.create = function create(rand) {\n return new MillerRabin(rand);\n};\n\nMillerRabin.prototype._randbelow = function _randbelow(n) {\n var len = n.bitLength();\n var min_bytes = Math.ceil(len / 8);\n\n // Generage random bytes until a number less than n is found.\n // This ensures that 0..n-1 have an equal probability of being selected.\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n\n return a;\n};\n\nMillerRabin.prototype._randrange = function _randrange(start, stop) {\n // Generate a random number greater than or equal to start and less than stop.\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n};\n\nMillerRabin.prototype.test = function test(n, k, cb) {\n var len = n.bitLength();\n var red = bn.mont(n);\n var rone = new bn(1).toRed(red);\n\n if (!k)\n k = Math.max(1, (len / 48) | 0);\n\n // Find d and s, (n - 1) = (2 ^ s) * d;\n var n1 = n.subn(1);\n for (var s = 0; !n1.testn(s); s++) {}\n var d = n.shrn(s);\n\n var rn1 = n1.toRed(red);\n\n var prime = true;\n for (; k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n if (cb)\n cb(a);\n\n var x = a.toRed(red).redPow(d);\n if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\n continue;\n\n for (var i = 1; i < s; i++) {\n x = x.redSqr();\n\n if (x.cmp(rone) === 0)\n return false;\n if (x.cmp(rn1) === 0)\n break;\n }\n\n if (i === s)\n return false;\n }\n\n return prime;\n};\n\nMillerRabin.prototype.getDivisor = function getDivisor(n, k) {\n var len = n.bitLength();\n var red = bn.mont(n);\n var rone = new bn(1).toRed(red);\n\n if (!k)\n k = Math.max(1, (len / 48) | 0);\n\n // Find d and s, (n - 1) = (2 ^ s) * d;\n var n1 = n.subn(1);\n for (var s = 0; !n1.testn(s); s++) {}\n var d = n.shrn(s);\n\n var rn1 = n1.toRed(red);\n\n for (; k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n\n var g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n\n var x = a.toRed(red).redPow(d);\n if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\n continue;\n\n for (var i = 1; i < s; i++) {\n x = x.redSqr();\n\n if (x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n\n if (i === s) {\n x = x.redSqr();\n return x.fromRed().subn(1).gcd(n);\n }\n }\n\n return false;\n};\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n","module.exports={\"2.16.840.1.101.3.4.1.1\": \"aes-128-ecb\",\n\"2.16.840.1.101.3.4.1.2\": \"aes-128-cbc\",\n\"2.16.840.1.101.3.4.1.3\": \"aes-128-ofb\",\n\"2.16.840.1.101.3.4.1.4\": \"aes-128-cfb\",\n\"2.16.840.1.101.3.4.1.21\": \"aes-192-ecb\",\n\"2.16.840.1.101.3.4.1.22\": \"aes-192-cbc\",\n\"2.16.840.1.101.3.4.1.23\": \"aes-192-ofb\",\n\"2.16.840.1.101.3.4.1.24\": \"aes-192-cfb\",\n\"2.16.840.1.101.3.4.1.41\": \"aes-256-ecb\",\n\"2.16.840.1.101.3.4.1.42\": \"aes-256-cbc\",\n\"2.16.840.1.101.3.4.1.43\": \"aes-256-ofb\",\n\"2.16.840.1.101.3.4.1.44\": \"aes-256-cfb\"\n}","// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js\n// Fedor, you are amazing.\n'use strict'\n\nvar asn1 = require('asn1.js')\n\nexports.certificate = require('./certificate')\n\nvar RSAPrivateKey = asn1.define('RSAPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('modulus').int(),\n this.key('publicExponent').int(),\n this.key('privateExponent').int(),\n this.key('prime1').int(),\n this.key('prime2').int(),\n this.key('exponent1').int(),\n this.key('exponent2').int(),\n this.key('coefficient').int()\n )\n})\nexports.RSAPrivateKey = RSAPrivateKey\n\nvar RSAPublicKey = asn1.define('RSAPublicKey', function () {\n this.seq().obj(\n this.key('modulus').int(),\n this.key('publicExponent').int()\n )\n})\nexports.RSAPublicKey = RSAPublicKey\n\nvar PublicKey = asn1.define('SubjectPublicKeyInfo', function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPublicKey').bitstr()\n )\n})\nexports.PublicKey = PublicKey\n\nvar AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {\n this.seq().obj(\n this.key('algorithm').objid(),\n this.key('none').null_().optional(),\n this.key('curve').objid().optional(),\n this.key('params').seq().obj(\n this.key('p').int(),\n this.key('q').int(),\n this.key('g').int()\n ).optional()\n )\n})\n\nvar PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPrivateKey').octstr()\n )\n})\nexports.PrivateKey = PrivateKeyInfo\nvar EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {\n this.seq().obj(\n this.key('algorithm').seq().obj(\n this.key('id').objid(),\n this.key('decrypt').seq().obj(\n this.key('kde').seq().obj(\n this.key('id').objid(),\n this.key('kdeparams').seq().obj(\n this.key('salt').octstr(),\n this.key('iters').int()\n )\n ),\n this.key('cipher').seq().obj(\n this.key('algo').objid(),\n this.key('iv').octstr()\n )\n )\n ),\n this.key('subjectPrivateKey').octstr()\n )\n})\n\nexports.EncryptedPrivateKey = EncryptedPrivateKeyInfo\n\nvar DSAPrivateKey = asn1.define('DSAPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('p').int(),\n this.key('q').int(),\n this.key('g').int(),\n this.key('pub_key').int(),\n this.key('priv_key').int()\n )\n})\nexports.DSAPrivateKey = DSAPrivateKey\n\nexports.DSAparam = asn1.define('DSAparam', function () {\n this.int()\n})\n\nvar ECPrivateKey = asn1.define('ECPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('privateKey').octstr(),\n this.key('parameters').optional().explicit(0).use(ECParameters),\n this.key('publicKey').optional().explicit(1).bitstr()\n )\n})\nexports.ECPrivateKey = ECPrivateKey\n\nvar ECParameters = asn1.define('ECParameters', function () {\n this.choice({\n namedCurve: this.objid()\n })\n})\n\nexports.signature = asn1.define('signature', function () {\n this.seq().obj(\n this.key('r').int(),\n this.key('s').int()\n )\n})\n","// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js\n// thanks to @Rantanen\n\n'use strict'\n\nvar asn = require('asn1.js')\n\nvar Time = asn.define('Time', function () {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n })\n})\n\nvar AttributeTypeValue = asn.define('AttributeTypeValue', function () {\n this.seq().obj(\n this.key('type').objid(),\n this.key('value').any()\n )\n})\n\nvar AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {\n this.seq().obj(\n this.key('algorithm').objid(),\n this.key('parameters').optional(),\n this.key('curve').objid().optional()\n )\n})\n\nvar SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPublicKey').bitstr()\n )\n})\n\nvar RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {\n this.setof(AttributeTypeValue)\n})\n\nvar RDNSequence = asn.define('RDNSequence', function () {\n this.seqof(RelativeDistinguishedName)\n})\n\nvar Name = asn.define('Name', function () {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n })\n})\n\nvar Validity = asn.define('Validity', function () {\n this.seq().obj(\n this.key('notBefore').use(Time),\n this.key('notAfter').use(Time)\n )\n})\n\nvar Extension = asn.define('Extension', function () {\n this.seq().obj(\n this.key('extnID').objid(),\n this.key('critical').bool().def(false),\n this.key('extnValue').octstr()\n )\n})\n\nvar TBSCertificate = asn.define('TBSCertificate', function () {\n this.seq().obj(\n this.key('version').explicit(0).int().optional(),\n this.key('serialNumber').int(),\n this.key('signature').use(AlgorithmIdentifier),\n this.key('issuer').use(Name),\n this.key('validity').use(Validity),\n this.key('subject').use(Name),\n this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),\n this.key('issuerUniqueID').implicit(1).bitstr().optional(),\n this.key('subjectUniqueID').implicit(2).bitstr().optional(),\n this.key('extensions').explicit(3).seqof(Extension).optional()\n )\n})\n\nvar X509Certificate = asn.define('X509Certificate', function () {\n this.seq().obj(\n this.key('tbsCertificate').use(TBSCertificate),\n this.key('signatureAlgorithm').use(AlgorithmIdentifier),\n this.key('signatureValue').bitstr()\n )\n})\n\nmodule.exports = X509Certificate\n","// adapted from https://github.com/apatil/pemstrip\nvar findProc = /Proc-Type: 4,ENCRYPTED[\\n\\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\\n\\r]+([0-9A-z\\n\\r+/=]+)[\\n\\r]+/m\nvar startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m\nvar fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\\n\\r+/=]+)-----END \\1-----$/m\nvar evp = require('evp_bytestokey')\nvar ciphers = require('browserify-aes')\nvar Buffer = require('safe-buffer').Buffer\nmodule.exports = function (okey, password) {\n var key = okey.toString()\n var match = key.match(findProc)\n var decrypted\n if (!match) {\n var match2 = key.match(fullRegex)\n decrypted = Buffer.from(match2[2].replace(/[\\r\\n]/g, ''), 'base64')\n } else {\n var suite = 'aes' + match[1]\n var iv = Buffer.from(match[2], 'hex')\n var cipherText = Buffer.from(match[3].replace(/[\\r\\n]/g, ''), 'base64')\n var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key\n var out = []\n var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)\n out.push(cipher.update(cipherText))\n out.push(cipher.final())\n decrypted = Buffer.concat(out)\n }\n var tag = key.match(startRegex)[1]\n return {\n tag: tag,\n data: decrypted\n }\n}\n","var asn1 = require('./asn1')\nvar aesid = require('./aesid.json')\nvar fixProc = require('./fixProc')\nvar ciphers = require('browserify-aes')\nvar compat = require('pbkdf2')\nvar Buffer = require('safe-buffer').Buffer\nmodule.exports = parseKeys\n\nfunction parseKeys (buffer) {\n var password\n if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {\n password = buffer.passphrase\n buffer = buffer.key\n }\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer)\n }\n\n var stripped = fixProc(buffer, password)\n\n var type = stripped.tag\n var data = stripped.data\n var subtype, ndata\n switch (type) {\n case 'CERTIFICATE':\n ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo\n // falls through\n case 'PUBLIC KEY':\n if (!ndata) {\n ndata = asn1.PublicKey.decode(data, 'der')\n }\n subtype = ndata.algorithm.algorithm.join('.')\n switch (subtype) {\n case '1.2.840.113549.1.1.1':\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')\n case '1.2.840.10045.2.1':\n ndata.subjectPrivateKey = ndata.subjectPublicKey\n return {\n type: 'ec',\n data: ndata\n }\n case '1.2.840.10040.4.1':\n ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')\n return {\n type: 'dsa',\n data: ndata.algorithm.params\n }\n default: throw new Error('unknown key id ' + subtype)\n }\n // throw new Error('unknown key type ' + type)\n case 'ENCRYPTED PRIVATE KEY':\n data = asn1.EncryptedPrivateKey.decode(data, 'der')\n data = decrypt(data, password)\n // falls through\n case 'PRIVATE KEY':\n ndata = asn1.PrivateKey.decode(data, 'der')\n subtype = ndata.algorithm.algorithm.join('.')\n switch (subtype) {\n case '1.2.840.113549.1.1.1':\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')\n case '1.2.840.10045.2.1':\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey\n }\n case '1.2.840.10040.4.1':\n ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')\n return {\n type: 'dsa',\n params: ndata.algorithm.params\n }\n default: throw new Error('unknown key id ' + subtype)\n }\n // throw new Error('unknown key type ' + type)\n case 'RSA PUBLIC KEY':\n return asn1.RSAPublicKey.decode(data, 'der')\n case 'RSA PRIVATE KEY':\n return asn1.RSAPrivateKey.decode(data, 'der')\n case 'DSA PRIVATE KEY':\n return {\n type: 'dsa',\n params: asn1.DSAPrivateKey.decode(data, 'der')\n }\n case 'EC PRIVATE KEY':\n data = asn1.ECPrivateKey.decode(data, 'der')\n return {\n curve: data.parameters.value,\n privateKey: data.privateKey\n }\n default: throw new Error('unknown key type ' + type)\n }\n}\nparseKeys.signature = asn1.signature\nfunction decrypt (data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt\n var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)\n var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]\n var iv = data.algorithm.decrypt.cipher.iv\n var cipherText = data.subjectPrivateKey\n var keylen = parseInt(algo.split('-')[1], 10) / 8\n var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')\n var cipher = ciphers.createDecipheriv(algo, key, iv)\n var out = []\n out.push(cipher.update(cipherText))\n out.push(cipher.final())\n return Buffer.concat(out)\n}\n","exports.pbkdf2 = require('./lib/async')\nexports.pbkdf2Sync = require('./lib/sync')\n","var Buffer = require('safe-buffer').Buffer\n\nvar checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar sync = require('./sync')\nvar toBuffer = require('./to-buffer')\n\nvar ZERO_BUF\nvar subtle = global.crypto && global.crypto.subtle\nvar toBrowser = {\n sha: 'SHA-1',\n 'sha-1': 'SHA-1',\n sha1: 'SHA-1',\n sha256: 'SHA-256',\n 'sha-256': 'SHA-256',\n sha384: 'SHA-384',\n 'sha-384': 'SHA-384',\n 'sha-512': 'SHA-512',\n sha512: 'SHA-512'\n}\nvar checks = []\nfunction checkNative (algo) {\n if (global.process && !global.process.browser) {\n return Promise.resolve(false)\n }\n if (!subtle || !subtle.importKey || !subtle.deriveBits) {\n return Promise.resolve(false)\n }\n if (checks[algo] !== undefined) {\n return checks[algo]\n }\n ZERO_BUF = ZERO_BUF || Buffer.alloc(8)\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)\n .then(function () {\n return true\n }).catch(function () {\n return false\n })\n checks[algo] = prom\n return prom\n}\nvar nextTick\nfunction getNextTick () {\n if (nextTick) {\n return nextTick\n }\n if (global.process && global.process.nextTick) {\n nextTick = global.process.nextTick\n } else if (global.queueMicrotask) {\n nextTick = global.queueMicrotask\n } else if (global.setImmediate) {\n nextTick = global.setImmediate\n } else {\n nextTick = global.setTimeout\n }\n return nextTick\n}\nfunction browserPbkdf2 (password, salt, iterations, length, algo) {\n return subtle.importKey(\n 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']\n ).then(function (key) {\n return subtle.deriveBits({\n name: 'PBKDF2',\n salt: salt,\n iterations: iterations,\n hash: {\n name: algo\n }\n }, key, length << 3)\n }).then(function (res) {\n return Buffer.from(res)\n })\n}\n\nfunction resolvePromise (promise, callback) {\n promise.then(function (out) {\n getNextTick()(function () {\n callback(null, out)\n })\n }, function (e) {\n getNextTick()(function () {\n callback(e)\n })\n })\n}\nmodule.exports = function (password, salt, iterations, keylen, digest, callback) {\n if (typeof digest === 'function') {\n callback = digest\n digest = undefined\n }\n\n digest = digest || 'sha1'\n var algo = toBrowser[digest.toLowerCase()]\n\n if (!algo || typeof global.Promise !== 'function') {\n getNextTick()(function () {\n var out\n try {\n out = sync(password, salt, iterations, keylen, digest)\n } catch (e) {\n return callback(e)\n }\n callback(null, out)\n })\n return\n }\n\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')\n\n resolvePromise(checkNative(algo).then(function (resp) {\n if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)\n\n return sync(password, salt, iterations, keylen, digest)\n }), callback)\n}\n","var defaultEncoding\n/* istanbul ignore next */\nif (global.process && global.process.browser) {\n defaultEncoding = 'utf-8'\n} else if (global.process && global.process.version) {\n var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)\n\n defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'\n} else {\n defaultEncoding = 'utf-8'\n}\nmodule.exports = defaultEncoding\n","var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs\n\nmodule.exports = function (iterations, keylen) {\n if (typeof iterations !== 'number') {\n throw new TypeError('Iterations not a number')\n }\n\n if (iterations < 0) {\n throw new TypeError('Bad iterations')\n }\n\n if (typeof keylen !== 'number') {\n throw new TypeError('Key length not a number')\n }\n\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */\n throw new TypeError('Bad key length')\n }\n}\n","var md5 = require('create-hash/md5')\nvar RIPEMD160 = require('ripemd160')\nvar sha = require('sha.js')\nvar Buffer = require('safe-buffer').Buffer\n\nvar checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar toBuffer = require('./to-buffer')\n\nvar ZEROS = Buffer.alloc(128)\nvar sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n}\n\nfunction Hmac (alg, key, saltLen) {\n var hash = getDigest(alg)\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n if (key.length > blocksize) {\n key = hash(key)\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])\n var opad = Buffer.allocUnsafe(blocksize + sizes[alg])\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)\n ipad.copy(ipad1, 0, 0, blocksize)\n this.ipad1 = ipad1\n this.ipad2 = ipad\n this.opad = opad\n this.alg = alg\n this.blocksize = blocksize\n this.hash = hash\n this.size = sizes[alg]\n}\n\nHmac.prototype.run = function (data, ipad) {\n data.copy(ipad, this.blocksize)\n var h = this.hash(ipad)\n h.copy(this.opad, this.blocksize)\n return this.hash(this.opad)\n}\n\nfunction getDigest (alg) {\n function shaFunc (data) {\n return sha(alg).update(data).digest()\n }\n function rmd160Func (data) {\n return new RIPEMD160().update(data).digest()\n }\n\n if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func\n if (alg === 'md5') return md5\n return shaFunc\n}\n\nfunction pbkdf2 (password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n\n digest = digest || 'sha1'\n\n var hmac = new Hmac(digest, password, salt.length)\n\n var DK = Buffer.allocUnsafe(keylen)\n var block1 = Buffer.allocUnsafe(salt.length + 4)\n salt.copy(block1, 0, 0, salt.length)\n\n var destPos = 0\n var hLen = sizes[digest]\n var l = Math.ceil(keylen / hLen)\n\n for (var i = 1; i <= l; i++) {\n block1.writeUInt32BE(i, salt.length)\n\n var T = hmac.run(block1, hmac.ipad1)\n var U = T\n\n for (var j = 1; j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2)\n for (var k = 0; k < hLen; k++) T[k] ^= U[k]\n }\n\n T.copy(DK, destPos)\n destPos += hLen\n }\n\n return DK\n}\n\nmodule.exports = pbkdf2\n","var Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (thing, encoding, name) {\n if (Buffer.isBuffer(thing)) {\n return thing\n } else if (typeof thing === 'string') {\n return Buffer.from(thing, encoding)\n } else if (ArrayBuffer.isView(thing)) {\n return Buffer.from(thing.buffer)\n } else {\n throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')\n }\n}\n","'use strict';\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // 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\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // 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.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","exports.publicEncrypt = require('./publicEncrypt')\nexports.privateDecrypt = require('./privateDecrypt')\n\nexports.privateEncrypt = function privateEncrypt (key, buf) {\n return exports.publicEncrypt(key, buf, true)\n}\n\nexports.publicDecrypt = function publicDecrypt (key, buf) {\n return exports.privateDecrypt(key, buf, true)\n}\n","var createHash = require('create-hash')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (seed, len) {\n var t = Buffer.alloc(0)\n var i = 0\n var c\n while (t.length < len) {\n c = i2ops(i++)\n t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])\n }\n return t.slice(0, len)\n}\n\nfunction i2ops (c) {\n var out = Buffer.allocUnsafe(4)\n out.writeUInt32BE(c, 0)\n return out\n}\n","var parseKeys = require('parse-asn1')\nvar mgf = require('./mgf')\nvar xor = require('./xor')\nvar BN = require('bn.js')\nvar crt = require('browserify-rsa')\nvar createHash = require('create-hash')\nvar withPublic = require('./withPublic')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function privateDecrypt (privateKey, enc, reverse) {\n var padding\n if (privateKey.padding) {\n padding = privateKey.padding\n } else if (reverse) {\n padding = 1\n } else {\n padding = 4\n }\n\n var key = parseKeys(privateKey)\n var k = key.modulus.byteLength()\n if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {\n throw new Error('decryption error')\n }\n var msg\n if (reverse) {\n msg = withPublic(new BN(enc), key)\n } else {\n msg = crt(enc, key)\n }\n var zBuffer = Buffer.alloc(k - msg.length)\n msg = Buffer.concat([zBuffer, msg], k)\n if (padding === 4) {\n return oaep(key, msg)\n } else if (padding === 1) {\n return pkcs1(key, msg, reverse)\n } else if (padding === 3) {\n return msg\n } else {\n throw new Error('unknown padding')\n }\n}\n\nfunction oaep (key, msg) {\n var k = key.modulus.byteLength()\n var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()\n var hLen = iHash.length\n if (msg[0] !== 0) {\n throw new Error('decryption error')\n }\n var maskedSeed = msg.slice(1, hLen + 1)\n var maskedDb = msg.slice(hLen + 1)\n var seed = xor(maskedSeed, mgf(maskedDb, hLen))\n var db = xor(maskedDb, mgf(seed, k - hLen - 1))\n if (compare(iHash, db.slice(0, hLen))) {\n throw new Error('decryption error')\n }\n var i = hLen\n while (db[i] === 0) {\n i++\n }\n if (db[i++] !== 1) {\n throw new Error('decryption error')\n }\n return db.slice(i)\n}\n\nfunction pkcs1 (key, msg, reverse) {\n var p1 = msg.slice(0, 2)\n var i = 2\n var status = 0\n while (msg[i++] !== 0) {\n if (i >= msg.length) {\n status++\n break\n }\n }\n var ps = msg.slice(2, i - 1)\n\n if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {\n status++\n }\n if (ps.length < 8) {\n status++\n }\n if (status) {\n throw new Error('decryption error')\n }\n return msg.slice(i)\n}\nfunction compare (a, b) {\n a = Buffer.from(a)\n b = Buffer.from(b)\n var dif = 0\n var len = a.length\n if (a.length !== b.length) {\n dif++\n len = Math.min(a.length, b.length)\n }\n var i = -1\n while (++i < len) {\n dif += (a[i] ^ b[i])\n }\n return dif\n}\n","var parseKeys = require('parse-asn1')\nvar randomBytes = require('randombytes')\nvar createHash = require('create-hash')\nvar mgf = require('./mgf')\nvar xor = require('./xor')\nvar BN = require('bn.js')\nvar withPublic = require('./withPublic')\nvar crt = require('browserify-rsa')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function publicEncrypt (publicKey, msg, reverse) {\n var padding\n if (publicKey.padding) {\n padding = publicKey.padding\n } else if (reverse) {\n padding = 1\n } else {\n padding = 4\n }\n var key = parseKeys(publicKey)\n var paddedMsg\n if (padding === 4) {\n paddedMsg = oaep(key, msg)\n } else if (padding === 1) {\n paddedMsg = pkcs1(key, msg, reverse)\n } else if (padding === 3) {\n paddedMsg = new BN(msg)\n if (paddedMsg.cmp(key.modulus) >= 0) {\n throw new Error('data too long for modulus')\n }\n } else {\n throw new Error('unknown padding')\n }\n if (reverse) {\n return crt(paddedMsg, key)\n } else {\n return withPublic(paddedMsg, key)\n }\n}\n\nfunction oaep (key, msg) {\n var k = key.modulus.byteLength()\n var mLen = msg.length\n var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()\n var hLen = iHash.length\n var hLen2 = 2 * hLen\n if (mLen > k - hLen2 - 2) {\n throw new Error('message too long')\n }\n var ps = Buffer.alloc(k - mLen - hLen2 - 2)\n var dblen = k - hLen - 1\n var seed = randomBytes(hLen)\n var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))\n var maskedSeed = xor(seed, mgf(maskedDb, hLen))\n return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))\n}\nfunction pkcs1 (key, msg, reverse) {\n var mLen = msg.length\n var k = key.modulus.byteLength()\n if (mLen > k - 11) {\n throw new Error('message too long')\n }\n var ps\n if (reverse) {\n ps = Buffer.alloc(k - mLen - 3, 0xff)\n } else {\n ps = nonZero(k - mLen - 3)\n }\n return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))\n}\nfunction nonZero (len) {\n var out = Buffer.allocUnsafe(len)\n var i = 0\n var cache = randomBytes(len * 2)\n var cur = 0\n var num\n while (i < len) {\n if (cur === cache.length) {\n cache = randomBytes(len * 2)\n cur = 0\n }\n num = cache[cur++]\n if (num) {\n out[i++] = num\n }\n }\n return out\n}\n","var BN = require('bn.js')\nvar Buffer = require('safe-buffer').Buffer\n\nfunction withPublic (paddedMsg, key) {\n return Buffer.from(paddedMsg\n .toRed(BN.mont(key.modulus))\n .redPow(new BN(key.publicExponent))\n .fromRed()\n .toArray())\n}\n\nmodule.exports = withPublic\n","module.exports = function xor (a, b) {\n var len = a.length\n var i = -1\n while (++i < len) {\n a[i] ^= b[i]\n }\n return a\n}\n","'use strict'\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nvar MAX_BYTES = 65536\n\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nvar MAX_UINT32 = 4294967295\n\nfunction oldBrowser () {\n throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11')\n}\n\nvar Buffer = require('safe-buffer').Buffer\nvar crypto = global.crypto || global.msCrypto\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes\n} else {\n module.exports = oldBrowser\n}\n\nfunction randomBytes (size, cb) {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n\n var bytes = Buffer.allocUnsafe(size)\n\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (var generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n\n if (typeof cb === 'function') {\n return process.nextTick(function () {\n cb(null, bytes)\n })\n }\n\n return bytes\n}\n","'use strict'\n\nfunction oldBrowser () {\n throw new Error('secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11')\n}\nvar safeBuffer = require('safe-buffer')\nvar randombytes = require('randombytes')\nvar Buffer = safeBuffer.Buffer\nvar kBufferMaxLength = safeBuffer.kMaxLength\nvar crypto = global.crypto || global.msCrypto\nvar kMaxUint32 = Math.pow(2, 32) - 1\nfunction assertOffset (offset, length) {\n if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare\n throw new TypeError('offset must be a number')\n }\n\n if (offset > kMaxUint32 || offset < 0) {\n throw new TypeError('offset must be a uint32')\n }\n\n if (offset > kBufferMaxLength || offset > length) {\n throw new RangeError('offset out of range')\n }\n}\n\nfunction assertSize (size, offset, length) {\n if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare\n throw new TypeError('size must be a number')\n }\n\n if (size > kMaxUint32 || size < 0) {\n throw new TypeError('size must be a uint32')\n }\n\n if (size + offset > length || size > kBufferMaxLength) {\n throw new RangeError('buffer too small')\n }\n}\nif ((crypto && crypto.getRandomValues) || !process.browser) {\n exports.randomFill = randomFill\n exports.randomFillSync = randomFillSync\n} else {\n exports.randomFill = oldBrowser\n exports.randomFillSync = oldBrowser\n}\nfunction randomFill (buf, offset, size, cb) {\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n }\n\n if (typeof offset === 'function') {\n cb = offset\n offset = 0\n size = buf.length\n } else if (typeof size === 'function') {\n cb = size\n size = buf.length - offset\n } else if (typeof cb !== 'function') {\n throw new TypeError('\"cb\" argument must be a function')\n }\n assertOffset(offset, buf.length)\n assertSize(size, offset, buf.length)\n return actualFill(buf, offset, size, cb)\n}\n\nfunction actualFill (buf, offset, size, cb) {\n if (process.browser) {\n var ourBuf = buf.buffer\n var uint = new Uint8Array(ourBuf, offset, size)\n crypto.getRandomValues(uint)\n if (cb) {\n process.nextTick(function () {\n cb(null, buf)\n })\n return\n }\n return buf\n }\n if (cb) {\n randombytes(size, function (err, bytes) {\n if (err) {\n return cb(err)\n }\n bytes.copy(buf, offset)\n cb(null, buf)\n })\n return\n }\n var bytes = randombytes(size)\n bytes.copy(buf, offset)\n return buf\n}\nfunction randomFillSync (buf, offset, size) {\n if (typeof offset === 'undefined') {\n offset = 0\n }\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n }\n\n assertOffset(offset, buf.length)\n\n if (size === undefined) size = buf.length - offset\n\n assertSize(size, offset, buf.length)\n\n return actualFill(buf, offset, size)\n}\n","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar codes = {};\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inheritsLoose(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;\n }\n\n return NodeError;\n }(Base);\n\n NodeError.prototype.name = Base.name;\n NodeError.prototype.code = code;\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {\n return 'The value \"' + value + '\" is invalid for option \"' + name + '\"';\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n }\n\n msg += \". Received type \".concat(typeof actual);\n return msg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');\ncreateErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {\n return 'The ' + name + ' method is not implemented';\n});\ncreateErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');\ncreateErrorType('ERR_STREAM_DESTROYED', function (name) {\n return 'Cannot call ' + name + ' after a stream was destroyed';\n});\ncreateErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');\ncreateErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');\ncreateErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');\ncreateErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);\ncreateErrorType('ERR_UNKNOWN_ENCODING', function (arg) {\n return 'Unknown encoding: ' + arg;\n}, TypeError);\ncreateErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');\nmodule.exports.codes = codes;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n};\n/**/\n\nmodule.exports = Duplex;\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\nrequire('inherits')(Duplex, Readable);\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n process.nextTick(onEndNT, this);\n}\nfunction onEndNT(self) {\n self.end();\n}\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\nvar Transform = require('./_stream_transform');\nrequire('inherits')(PassThrough, Transform);\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n Transform.call(this, options);\n}\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nmodule.exports = Readable;\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\nvar Buffer = require('buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\nvar debugUtil = require('util');\nvar debug;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/buffer_list');\nvar destroyImpl = require('./internal/streams/destroy');\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;\n\n// Lazy loaded to improve the startup performance.\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\nrequire('inherits')(Readable, Stream);\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true;\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = options.emitClose !== false;\n\n // Should .destroy() be called after 'end' (and potentially 'finish')\n this.autoDestroy = !!options.autoDestroy;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options);\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex);\n\n // legacy\n this.readable = true;\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n Stream.call(this);\n}\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n }\n\n // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n return er;\n}\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder;\n // If setEncoding(null), decoder.encoding equals utf8\n this._readableState.encoding = this._readableState.decoder.encoding;\n\n // Iterate over current buffer to convert already stored Buffers:\n var p = this._readableState.buffer.head;\n var content = '';\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n this._readableState.buffer.clear();\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n};\n\n// Don't raise the hwm > 1GB\nvar MAX_HWM = 0x40000000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n }\n\n // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n return dest;\n};\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0;\n\n // Try start flowing on next tick if stream isn't explicitly paused\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n return res;\n};\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n return res;\n};\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true;\n\n // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n state.paused = false;\n return this;\n};\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n if (!state.reading) {\n stream.read(0);\n }\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n this._readableState.paused = true;\n return this;\n};\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null);\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n return this;\n};\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n return createReadableStreamAsyncIterator(this);\n };\n}\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n});\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length);\n\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n return from(Readable, iterable, opts);\n };\n}\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\nvar _require$codes = require('../errors').codes,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,\n ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;\nvar Duplex = require('./_stream_duplex');\nrequire('inherits')(Transform, Duplex);\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n var cb = ts.writecb;\n if (cb === null) {\n return this.emit('error', new ERR_MULTIPLE_CALLBACK());\n }\n ts.writechunk = null;\n ts.writecb = null;\n if (data != null)\n // single equals check for both `null` and `undefined`\n this.push(data);\n cb(er);\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n Duplex.call(this, options);\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\nfunction prefinish() {\n var _this = this;\n if (typeof this._flush === 'function' && !this._readableState.destroyed) {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));\n};\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n if (ts.writechunk !== null && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\nTransform.prototype._destroy = function (err, cb) {\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n });\n};\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n if (data != null)\n // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // TODO(BridgeAR): Write a test for these two error cases\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();\n if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\nvar Buffer = require('buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\nvar destroyImpl = require('./internal/streams/destroy');\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,\n ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,\n ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,\n ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,\n ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nrequire('inherits')(Writable, Stream);\nfunction nop() {}\nfunction WritableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream,\n // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // Should close be emitted on destroy. Defaults to true.\n this.emitClose = options.emitClose !== false;\n\n // Should .destroy() be called after 'finish' (and potentially 'end')\n this.autoDestroy = !!options.autoDestroy;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function writableStateBufferGetter() {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function value(object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function realHasInstance(object) {\n return object instanceof this;\n };\n}\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n\n // Checking for a Stream.Duplex instance is faster here instead of inside\n // the WritableState constructor, at least with V8 6.5\n var isDuplex = this instanceof Duplex;\n if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);\n this._writableState = new WritableState(options, this, isDuplex);\n\n // legacy.\n this.writable = true;\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n if (typeof options.writev === 'function') this._writev = options.writev;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n if (typeof options.final === 'function') this._final = options.final;\n }\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());\n};\nfunction writeAfterEnd(stream, cb) {\n var er = new ERR_STREAM_WRITE_AFTER_END();\n // TODO: defer error events consistently everywhere, not just the cb\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var er;\n if (chunk === null) {\n er = new ERR_STREAM_NULL_VALUES();\n } else if (typeof chunk !== 'string' && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);\n }\n if (er) {\n errorOrDestroy(stream, er);\n process.nextTick(cb, er);\n return false;\n }\n return true;\n}\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n if (typeof cb !== 'function') cb = nop;\n if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n return ret;\n};\nWritable.prototype.cork = function () {\n this._writableState.corked++;\n};\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n if (state.corked) {\n state.corked--;\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\nObject.defineProperty(Writable.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n state.length += len;\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n return ret;\n}\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n process.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n process.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n errorOrDestroy(stream, er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();\n onwriteStateUpdate(state);\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state) || stream.destroyed;\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n if (sync) {\n process.nextTick(afterWrite, stream, state, finished, cb);\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n if (entry === null) state.lastBufferedRequest = null;\n }\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));\n};\nWritable.prototype._writev = null;\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending) endWritable(this, state, cb);\n return this;\n};\nObject.defineProperty(Writable.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n});\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n errorOrDestroy(stream, err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function' && !state.destroyed) {\n state.pendingcb++;\n state.finalCalled = true;\n process.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the readable side is ready for autoDestroy as well\n var rState = stream._readableState;\n if (!rState || rState.autoDestroy && rState.endEmitted) {\n stream.destroy();\n }\n }\n }\n }\n return need;\n}\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) process.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n\n // reuse the free corkReq.\n state.corkedRequestsFree.next = corkReq;\n}\nObject.defineProperty(Writable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n cb(err);\n};","'use strict';\n\nvar _Object$setPrototypeO;\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar finished = require('./end-of-stream');\nvar kLastResolve = Symbol('lastResolve');\nvar kLastReject = Symbol('lastReject');\nvar kError = Symbol('error');\nvar kEnded = Symbol('ended');\nvar kLastPromise = Symbol('lastPromise');\nvar kHandlePromise = Symbol('handlePromise');\nvar kStream = Symbol('stream');\nfunction createIterResult(value, done) {\n return {\n value: value,\n done: done\n };\n}\nfunction readAndResolve(iter) {\n var resolve = iter[kLastResolve];\n if (resolve !== null) {\n var data = iter[kStream].read();\n // we defer if data is null\n // we can be expecting either 'end' or\n // 'error'\n if (data !== null) {\n iter[kLastPromise] = null;\n iter[kLastResolve] = null;\n iter[kLastReject] = null;\n resolve(createIterResult(data, false));\n }\n }\n}\nfunction onReadable(iter) {\n // we wait for the next tick, because it might\n // emit an error with process.nextTick\n process.nextTick(readAndResolve, iter);\n}\nfunction wrapForNext(lastPromise, iter) {\n return function (resolve, reject) {\n lastPromise.then(function () {\n if (iter[kEnded]) {\n resolve(createIterResult(undefined, true));\n return;\n }\n iter[kHandlePromise](resolve, reject);\n }, reject);\n };\n}\nvar AsyncIteratorPrototype = Object.getPrototypeOf(function () {});\nvar ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {\n get stream() {\n return this[kStream];\n },\n next: function next() {\n var _this = this;\n // if we have detected an error in the meanwhile\n // reject straight away\n var error = this[kError];\n if (error !== null) {\n return Promise.reject(error);\n }\n if (this[kEnded]) {\n return Promise.resolve(createIterResult(undefined, true));\n }\n if (this[kStream].destroyed) {\n // We need to defer via nextTick because if .destroy(err) is\n // called, the error will be emitted via nextTick, and\n // we cannot guarantee that there is no error lingering around\n // waiting to be emitted.\n return new Promise(function (resolve, reject) {\n process.nextTick(function () {\n if (_this[kError]) {\n reject(_this[kError]);\n } else {\n resolve(createIterResult(undefined, true));\n }\n });\n });\n }\n\n // if we have multiple next() calls\n // we will wait for the previous Promise to finish\n // this logic is optimized to support for await loops,\n // where next() is only called once at a time\n var lastPromise = this[kLastPromise];\n var promise;\n if (lastPromise) {\n promise = new Promise(wrapForNext(lastPromise, this));\n } else {\n // fast path needed to support multiple this.push()\n // without triggering the next() queue\n var data = this[kStream].read();\n if (data !== null) {\n return Promise.resolve(createIterResult(data, false));\n }\n promise = new Promise(this[kHandlePromise]);\n }\n this[kLastPromise] = promise;\n return promise;\n }\n}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {\n return this;\n}), _defineProperty(_Object$setPrototypeO, \"return\", function _return() {\n var _this2 = this;\n // destroy(err, cb) is a private API\n // we can guarantee we have that here, because we control the\n // Readable class this is attached to\n return new Promise(function (resolve, reject) {\n _this2[kStream].destroy(null, function (err) {\n if (err) {\n reject(err);\n return;\n }\n resolve(createIterResult(undefined, true));\n });\n });\n}), _Object$setPrototypeO), AsyncIteratorPrototype);\nvar createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {\n var _Object$create;\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {\n value: stream,\n writable: true\n }), _defineProperty(_Object$create, kLastResolve, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kLastReject, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kError, {\n value: null,\n writable: true\n }), _defineProperty(_Object$create, kEnded, {\n value: stream._readableState.endEmitted,\n writable: true\n }), _defineProperty(_Object$create, kHandlePromise, {\n value: function value(resolve, reject) {\n var data = iterator[kStream].read();\n if (data) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(data, false));\n } else {\n iterator[kLastResolve] = resolve;\n iterator[kLastReject] = reject;\n }\n },\n writable: true\n }), _Object$create));\n iterator[kLastPromise] = null;\n finished(stream, function (err) {\n if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {\n var reject = iterator[kLastReject];\n // reject if we are waiting for data in the Promise\n // returned by next() and store the error\n if (reject !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n reject(err);\n }\n iterator[kError] = err;\n return;\n }\n var resolve = iterator[kLastResolve];\n if (resolve !== null) {\n iterator[kLastPromise] = null;\n iterator[kLastResolve] = null;\n iterator[kLastReject] = null;\n resolve(createIterResult(undefined, true));\n }\n iterator[kEnded] = true;\n });\n stream.on('readable', onReadable.bind(null, iterator));\n return iterator;\n};\nmodule.exports = createReadableStreamAsyncIterator;","'use strict';\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar _require = require('buffer'),\n Buffer = _require.Buffer;\nvar _require2 = require('util'),\n inspect = _require2.inspect;\nvar custom = inspect && inspect.custom || 'inspect';\nfunction copyBuffer(src, target, offset) {\n Buffer.prototype.copy.call(src, target, offset);\n}\nmodule.exports = /*#__PURE__*/function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n _createClass(BufferList, [{\n key: \"push\",\n value: function push(v) {\n var entry = {\n data: v,\n next: null\n };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n }\n }, {\n key: \"unshift\",\n value: function unshift(v) {\n var entry = {\n data: v,\n next: this.head\n };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n }\n }, {\n key: \"shift\",\n value: function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.head = this.tail = null;\n this.length = 0;\n }\n }, {\n key: \"join\",\n value: function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) ret += s + p.data;\n return ret;\n }\n }, {\n key: \"concat\",\n value: function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n }\n\n // Consumes a specified amount of bytes or characters from the buffered data.\n }, {\n key: \"consume\",\n value: function consume(n, hasStrings) {\n var ret;\n if (n < this.head.data.length) {\n // `slice` is the same for buffers and strings.\n ret = this.head.data.slice(0, n);\n this.head.data = this.head.data.slice(n);\n } else if (n === this.head.data.length) {\n // First chunk is a perfect match.\n ret = this.shift();\n } else {\n // Result spans more than one buffer.\n ret = hasStrings ? this._getString(n) : this._getBuffer(n);\n }\n return ret;\n }\n }, {\n key: \"first\",\n value: function first() {\n return this.head.data;\n }\n\n // Consumes a specified amount of characters from the buffered data.\n }, {\n key: \"_getString\",\n value: function _getString(n) {\n var p = this.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n this.length -= c;\n return ret;\n }\n\n // Consumes a specified amount of bytes from the buffered data.\n }, {\n key: \"_getBuffer\",\n value: function _getBuffer(n) {\n var ret = Buffer.allocUnsafe(n);\n var p = this.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) this.head = p.next;else this.head = this.tail = null;\n } else {\n this.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n this.length -= c;\n return ret;\n }\n\n // Make sure the linked list only shows the minimal necessary information.\n }, {\n key: custom,\n value: function value(_, options) {\n return inspect(this, _objectSpread(_objectSpread({}, options), {}, {\n // Only inspect one level.\n depth: 0,\n // It should not recurse.\n customInspect: false\n }));\n }\n }]);\n return BufferList;\n}();","'use strict';\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n process.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n process.nextTick(emitErrorNT, this, err);\n }\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n return this;\n}\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\nfunction errorOrDestroy(stream, err) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n\n var rState = stream._readableState;\n var wState = stream._writableState;\n if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);\n}\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy,\n errorOrDestroy: errorOrDestroy\n};","// Ported from https://github.com/mafintosh/end-of-stream with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict';\n\nvar ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n callback.apply(this, args);\n };\n}\nfunction noop() {}\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\nfunction eos(stream, opts, callback) {\n if (typeof opts === 'function') return eos(stream, null, opts);\n if (!opts) opts = {};\n callback = once(callback || noop);\n var readable = opts.readable || opts.readable !== false && stream.readable;\n var writable = opts.writable || opts.writable !== false && stream.writable;\n var onlegacyfinish = function onlegacyfinish() {\n if (!stream.writable) onfinish();\n };\n var writableEnded = stream._writableState && stream._writableState.finished;\n var onfinish = function onfinish() {\n writable = false;\n writableEnded = true;\n if (!readable) callback.call(stream);\n };\n var readableEnded = stream._readableState && stream._readableState.endEmitted;\n var onend = function onend() {\n readable = false;\n readableEnded = true;\n if (!writable) callback.call(stream);\n };\n var onerror = function onerror(err) {\n callback.call(stream, err);\n };\n var onclose = function onclose() {\n var err;\n if (readable && !readableEnded) {\n if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n if (writable && !writableEnded) {\n if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();\n return callback.call(stream, err);\n }\n };\n var onrequest = function onrequest() {\n stream.req.on('finish', onfinish);\n };\n if (isRequest(stream)) {\n stream.on('complete', onfinish);\n stream.on('abort', onclose);\n if (stream.req) onrequest();else stream.on('request', onrequest);\n } else if (writable && !stream._writableState) {\n // legacy streams\n stream.on('end', onlegacyfinish);\n stream.on('close', onlegacyfinish);\n }\n stream.on('end', onend);\n stream.on('finish', onfinish);\n if (opts.error !== false) stream.on('error', onerror);\n stream.on('close', onclose);\n return function () {\n stream.removeListener('complete', onfinish);\n stream.removeListener('abort', onclose);\n stream.removeListener('request', onrequest);\n if (stream.req) stream.req.removeListener('finish', onfinish);\n stream.removeListener('end', onlegacyfinish);\n stream.removeListener('close', onlegacyfinish);\n stream.removeListener('finish', onfinish);\n stream.removeListener('end', onend);\n stream.removeListener('error', onerror);\n stream.removeListener('close', onclose);\n };\n}\nmodule.exports = eos;","module.exports = function () {\n throw new Error('Readable.from is not available in the browser')\n};\n","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n\n'use strict';\n\nvar eos;\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true;\n\n // request.destroy just do .end - .abort is what we want\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\nfunction call(fn) {\n fn();\n}\nfunction pipe(from, to) {\n return from.pipe(to);\n}\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\nmodule.exports = pipeline;","'use strict';\n\nvar ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;\nfunction highWaterMarkFrom(options, isDuplex, duplexKey) {\n return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;\n}\nfunction getHighWaterMark(state, options, duplexKey, isDuplex) {\n var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);\n if (hwm != null) {\n if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {\n var name = isDuplex ? duplexKey : 'highWaterMark';\n throw new ERR_INVALID_OPT_VALUE(name, hwm);\n }\n return Math.floor(hwm);\n }\n\n // Default value\n return state.objectMode ? 16 : 16 * 1024;\n}\nmodule.exports = {\n getHighWaterMark: getHighWaterMark\n};","module.exports = require('events').EventEmitter;\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\nexports.finished = require('./lib/internal/streams/end-of-stream.js');\nexports.pipeline = require('./lib/internal/streams/pipeline.js');\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) });\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: true });\n defineProperty(\n GeneratorFunctionPrototype,\n \"constructor\",\n { value: GeneratorFunction, configurable: true }\n );\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n defineProperty(this, \"_invoke\", { value: enqueue });\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next mehtod, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(val) {\n var object = Object(val);\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","'use strict'\nvar Buffer = require('buffer').Buffer\nvar inherits = require('inherits')\nvar HashBase = require('hash-base')\n\nvar ARRAY16 = new Array(16)\n\nvar zl = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n]\n\nvar zr = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n]\n\nvar sl = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n]\n\nvar sr = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n]\n\nvar hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]\nvar hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]\n\nfunction RIPEMD160 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n}\n\ninherits(RIPEMD160, HashBase)\n\nRIPEMD160.prototype._update = function () {\n var words = ARRAY16\n for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)\n\n var al = this._a | 0\n var bl = this._b | 0\n var cl = this._c | 0\n var dl = this._d | 0\n var el = this._e | 0\n\n var ar = this._a | 0\n var br = this._b | 0\n var cr = this._c | 0\n var dr = this._d | 0\n var er = this._e | 0\n\n // computation\n for (var i = 0; i < 80; i += 1) {\n var tl\n var tr\n if (i < 16) {\n tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])\n tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])\n } else if (i < 32) {\n tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])\n tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])\n } else if (i < 48) {\n tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])\n tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])\n } else if (i < 64) {\n tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])\n tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])\n } else { // if (i<80) {\n tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])\n tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])\n }\n\n al = el\n el = dl\n dl = rotl(cl, 10)\n cl = bl\n bl = tl\n\n ar = er\n er = dr\n dr = rotl(cr, 10)\n cr = br\n br = tr\n }\n\n // update state\n var t = (this._b + cl + dr) | 0\n this._b = (this._c + dl + er) | 0\n this._c = (this._d + el + ar) | 0\n this._d = (this._e + al + br) | 0\n this._e = (this._a + bl + cr) | 0\n this._a = t\n}\n\nRIPEMD160.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n buffer.writeInt32LE(this._e, 16)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fn1 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn2 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn3 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn4 (a, b, c, d, e, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn5 (a, b, c, d, e, m, k, s) {\n return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0\n}\n\nmodule.exports = RIPEMD160\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/* eslint-disable node/no-deprecated-api */\n\n'use strict'\n\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nconst ed5 = require(\"xmlchars/xml/1.0/ed5\");\nconst ed2 = require(\"xmlchars/xml/1.1/ed2\");\nconst NSed3 = require(\"xmlchars/xmlns/1.0/ed3\");\nvar isS = ed5.isS;\nvar isChar10 = ed5.isChar;\nvar isNameStartChar = ed5.isNameStartChar;\nvar isNameChar = ed5.isNameChar;\nvar S_LIST = ed5.S_LIST;\nvar NAME_RE = ed5.NAME_RE;\nvar isChar11 = ed2.isChar;\nvar isNCNameStartChar = NSed3.isNCNameStartChar;\nvar isNCNameChar = NSed3.isNCNameChar;\nvar NC_NAME_RE = NSed3.NC_NAME_RE;\nconst XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\nconst XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\nconst rootNS = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n __proto__: null,\n xml: XML_NAMESPACE,\n xmlns: XMLNS_NAMESPACE\n};\nconst XML_ENTITIES = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n __proto__: null,\n amp: \"&\",\n gt: \">\",\n lt: \"<\",\n quot: \"\\\"\",\n apos: \"'\"\n};\n// EOC: end-of-chunk\nconst EOC = -1;\nconst NL_LIKE = -2;\nconst S_BEGIN = 0; // Initial state.\nconst S_BEGIN_WHITESPACE = 1; // leading whitespace\nconst S_DOCTYPE = 2; // \nconst TAB = 9;\nconst NL = 0xA;\nconst CR = 0xD;\nconst SPACE = 0x20;\nconst BANG = 0x21;\nconst DQUOTE = 0x22;\nconst AMP = 0x26;\nconst SQUOTE = 0x27;\nconst MINUS = 0x2D;\nconst FORWARD_SLASH = 0x2F;\nconst SEMICOLON = 0x3B;\nconst LESS = 0x3C;\nconst EQUAL = 0x3D;\nconst GREATER = 0x3E;\nconst QUESTION = 0x3F;\nconst OPEN_BRACKET = 0x5B;\nconst CLOSE_BRACKET = 0x5D;\nconst NEL = 0x85;\nconst LS = 0x2028; // Line Separator\nconst isQuote = c => c === DQUOTE || c === SQUOTE;\nconst QUOTES = [DQUOTE, SQUOTE];\nconst DOCTYPE_TERMINATOR = [...QUOTES, OPEN_BRACKET, GREATER];\nconst DTD_TERMINATOR = [...QUOTES, LESS, CLOSE_BRACKET];\nconst XML_DECL_NAME_TERMINATOR = [EQUAL, QUESTION, ...S_LIST];\nconst ATTRIB_VALUE_UNQUOTED_TERMINATOR = [...S_LIST, GREATER, AMP, LESS];\nfunction nsPairCheck(parser, prefix, uri) {\n switch (prefix) {\n case \"xml\":\n if (uri !== XML_NAMESPACE) {\n parser.fail(`xml prefix must be bound to ${XML_NAMESPACE}.`);\n }\n break;\n case \"xmlns\":\n if (uri !== XMLNS_NAMESPACE) {\n parser.fail(`xmlns prefix must be bound to ${XMLNS_NAMESPACE}.`);\n }\n break;\n default:\n }\n switch (uri) {\n case XMLNS_NAMESPACE:\n parser.fail(prefix === \"\" ? `the default namespace may not be set to ${uri}.` : `may not assign a prefix (even \"xmlns\") to the URI \\\n${XMLNS_NAMESPACE}.`);\n break;\n case XML_NAMESPACE:\n switch (prefix) {\n case \"xml\":\n // Assinging the XML namespace to \"xml\" is fine.\n break;\n case \"\":\n parser.fail(`the default namespace may not be set to ${uri}.`);\n break;\n default:\n parser.fail(\"may not assign the xml namespace to another prefix.\");\n }\n break;\n default:\n }\n}\nfunction nsMappingCheck(parser, mapping) {\n for (const local of Object.keys(mapping)) {\n nsPairCheck(parser, local, mapping[local]);\n }\n}\nconst isNCName = name => NC_NAME_RE.test(name);\nconst isName = name => NAME_RE.test(name);\nconst FORBIDDEN_START = 0;\nconst FORBIDDEN_BRACKET = 1;\nconst FORBIDDEN_BRACKET_BRACKET = 2;\n/**\n * The list of supported events.\n */\nexports.EVENTS = [\"xmldecl\", \"text\", \"processinginstruction\", \"doctype\", \"comment\", \"opentagstart\", \"attribute\", \"opentag\", \"closetag\", \"cdata\", \"error\", \"end\", \"ready\"];\nconst EVENT_NAME_TO_HANDLER_NAME = {\n xmldecl: \"xmldeclHandler\",\n text: \"textHandler\",\n processinginstruction: \"piHandler\",\n doctype: \"doctypeHandler\",\n comment: \"commentHandler\",\n opentagstart: \"openTagStartHandler\",\n attribute: \"attributeHandler\",\n opentag: \"openTagHandler\",\n closetag: \"closeTagHandler\",\n cdata: \"cdataHandler\",\n error: \"errorHandler\",\n end: \"endHandler\",\n ready: \"readyHandler\"\n};\nclass SaxesParser {\n /**\n * @param opt The parser options.\n */\n constructor(opt) {\n this.opt = opt !== null && opt !== void 0 ? opt : {};\n this.fragmentOpt = !!this.opt.fragment;\n const xmlnsOpt = this.xmlnsOpt = !!this.opt.xmlns;\n this.trackPosition = this.opt.position !== false;\n this.fileName = this.opt.fileName;\n if (xmlnsOpt) {\n // This is the function we use to perform name checks on PIs and entities.\n // When namespaces are used, colons are not allowed in PI target names or\n // entity names. So the check depends on whether namespaces are used. See:\n //\n // https://www.w3.org/XML/xml-names-19990114-errata.html\n // NE08\n //\n this.nameStartCheck = isNCNameStartChar;\n this.nameCheck = isNCNameChar;\n this.isName = isNCName;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.processAttribs = this.processAttribsNS;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.pushAttrib = this.pushAttribNS;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.ns = Object.assign({\n __proto__: null\n }, rootNS);\n const additional = this.opt.additionalNamespaces;\n if (additional != null) {\n nsMappingCheck(this, additional);\n Object.assign(this.ns, additional);\n }\n } else {\n this.nameStartCheck = isNameStartChar;\n this.nameCheck = isNameChar;\n this.isName = isName;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.processAttribs = this.processAttribsPlain;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.pushAttrib = this.pushAttribPlain;\n }\n //\n // The order of the members in this table needs to correspond to the state\n // numbers given to the states that correspond to the methods being recorded\n // here.\n //\n this.stateTable = [/* eslint-disable @typescript-eslint/unbound-method */\n this.sBegin, this.sBeginWhitespace, this.sDoctype, this.sDoctypeQuote, this.sDTD, this.sDTDQuoted, this.sDTDOpenWaka, this.sDTDOpenWakaBang, this.sDTDComment, this.sDTDCommentEnding, this.sDTDCommentEnded, this.sDTDPI, this.sDTDPIEnding, this.sText, this.sEntity, this.sOpenWaka, this.sOpenWakaBang, this.sComment, this.sCommentEnding, this.sCommentEnded, this.sCData, this.sCDataEnding, this.sCDataEnding2, this.sPIFirstChar, this.sPIRest, this.sPIBody, this.sPIEnding, this.sXMLDeclNameStart, this.sXMLDeclName, this.sXMLDeclEq, this.sXMLDeclValueStart, this.sXMLDeclValue, this.sXMLDeclSeparator, this.sXMLDeclEnding, this.sOpenTag, this.sOpenTagSlash, this.sAttrib, this.sAttribName, this.sAttribNameSawWhite, this.sAttribValue, this.sAttribValueQuoted, this.sAttribValueClosed, this.sAttribValueUnquoted, this.sCloseTag, this.sCloseTagSawWhite];\n this._init();\n }\n /**\n * Indicates whether or not the parser is closed. If ``true``, wait for\n * the ``ready`` event to write again.\n */\n get closed() {\n return this._closed;\n }\n _init() {\n var _a;\n this.openWakaBang = \"\";\n this.text = \"\";\n this.name = \"\";\n this.piTarget = \"\";\n this.entity = \"\";\n this.q = null;\n this.tags = [];\n this.tag = null;\n this.topNS = null;\n this.chunk = \"\";\n this.chunkPosition = 0;\n this.i = 0;\n this.prevI = 0;\n this.carriedFromPrevious = undefined;\n this.forbiddenState = FORBIDDEN_START;\n this.attribList = [];\n // The logic is organized so as to minimize the need to check\n // this.opt.fragment while parsing.\n const {\n fragmentOpt\n } = this;\n this.state = fragmentOpt ? S_TEXT : S_BEGIN;\n // We want these to be all true if we are dealing with a fragment.\n this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = fragmentOpt;\n // An XML declaration is intially possible only when parsing whole\n // documents.\n this.xmlDeclPossible = !fragmentOpt;\n this.xmlDeclExpects = [\"version\"];\n this.entityReturnState = undefined;\n let {\n defaultXMLVersion\n } = this.opt;\n if (defaultXMLVersion === undefined) {\n if (this.opt.forceXMLVersion === true) {\n throw new Error(\"forceXMLVersion set but defaultXMLVersion is not set\");\n }\n defaultXMLVersion = \"1.0\";\n }\n this.setXMLVersion(defaultXMLVersion);\n this.positionAtNewLine = 0;\n this.doctype = false;\n this._closed = false;\n this.xmlDecl = {\n version: undefined,\n encoding: undefined,\n standalone: undefined\n };\n this.line = 1;\n this.column = 0;\n this.ENTITIES = Object.create(XML_ENTITIES);\n // eslint-disable-next-line no-unused-expressions\n (_a = this.readyHandler) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n /**\n * The stream position the parser is currently looking at. This field is\n * zero-based.\n *\n * This field is not based on counting Unicode characters but is to be\n * interpreted as a plain index into a JavaScript string.\n */\n get position() {\n return this.chunkPosition + this.i;\n }\n /**\n * The column number of the next character to be read by the parser. *\n * This field is zero-based. (The first column in a line is 0.)\n *\n * This field reports the index at which the next character would be in the\n * line if the line were represented as a JavaScript string. Note that this\n * *can* be different to a count based on the number of *Unicode characters*\n * due to how JavaScript handles astral plane characters.\n *\n * See [[column]] for a number that corresponds to a count of Unicode\n * characters.\n */\n get columnIndex() {\n return this.position - this.positionAtNewLine;\n }\n /**\n * Set an event listener on an event. The parser supports one handler per\n * event type. If you try to set an event handler over an existing handler,\n * the old handler is silently overwritten.\n *\n * @param name The event to listen to.\n *\n * @param handler The handler to set.\n */\n on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }\n /**\n * Unset an event handler.\n *\n * @parma name The event to stop listening to.\n */\n off(name) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = undefined;\n }\n /**\n * Make an error object. The error object will have a message that contains\n * the ``fileName`` option passed at the creation of the parser. If position\n * tracking was turned on, it will also have line and column number\n * information.\n *\n * @param message The message describing the error to report.\n *\n * @returns An error object with a properly formatted message.\n */\n makeError(message) {\n var _a;\n let msg = (_a = this.fileName) !== null && _a !== void 0 ? _a : \"\";\n if (this.trackPosition) {\n if (msg.length > 0) {\n msg += \":\";\n }\n msg += `${this.line}:${this.column}`;\n }\n if (msg.length > 0) {\n msg += \": \";\n }\n return new Error(msg + message);\n }\n /**\n * Report a parsing error. This method is made public so that client code may\n * check for issues that are outside the scope of this project and can report\n * errors.\n *\n * @param message The error to report.\n *\n * @returns this\n */\n fail(message) {\n const err = this.makeError(message);\n const handler = this.errorHandler;\n if (handler === undefined) {\n throw err;\n } else {\n handler(err);\n }\n return this;\n }\n /**\n * Write a XML data to the parser.\n *\n * @param chunk The XML data to write.\n *\n * @returns this\n */\n write(chunk) {\n if (this.closed) {\n return this.fail(\"cannot write after close; assign an onready handler.\");\n }\n let end = false;\n if (chunk === null) {\n // We cannot return immediately because carriedFromPrevious may need\n // processing.\n end = true;\n chunk = \"\";\n } else if (typeof chunk === \"object\") {\n chunk = chunk.toString();\n }\n // We checked if performing a pre-decomposition of the string into an array\n // of single complete characters (``Array.from(chunk)``) would be faster\n // than the current repeated calls to ``charCodeAt``. As of August 2018, it\n // isn't. (There may be Node-specific code that would perform faster than\n // ``Array.from`` but don't want to be dependent on Node.)\n if (this.carriedFromPrevious !== undefined) {\n // The previous chunk had char we must carry over.\n chunk = `${this.carriedFromPrevious}${chunk}`;\n this.carriedFromPrevious = undefined;\n }\n let limit = chunk.length;\n const lastCode = chunk.charCodeAt(limit - 1);\n if (!end && (\n // A trailing CR or surrogate must be carried over to the next\n // chunk.\n lastCode === CR || lastCode >= 0xD800 && lastCode <= 0xDBFF)) {\n // The chunk ends with a character that must be carried over. We cannot\n // know how to handle it until we get the next chunk or the end of the\n // stream. So save it for later.\n this.carriedFromPrevious = chunk[limit - 1];\n limit--;\n chunk = chunk.slice(0, limit);\n }\n const {\n stateTable\n } = this;\n this.chunk = chunk;\n this.i = 0;\n while (this.i < limit) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateTable[this.state].call(this);\n }\n this.chunkPosition += limit;\n return end ? this.end() : this;\n }\n /**\n * Close the current stream. Perform final well-formedness checks and reset\n * the parser tstate.\n *\n * @returns this\n */\n close() {\n return this.write(null);\n }\n /**\n * Get a single code point out of the current chunk. This updates the current\n * position if we do position tracking.\n *\n * This is the algorithm to use for XML 1.0.\n *\n * @returns The character read.\n */\n getCode10() {\n const {\n chunk,\n i\n } = this;\n this.prevI = i;\n // Yes, we do this instead of doing this.i++. Doing it this way, we do not\n // read this.i again, which is a bit faster.\n this.i = i + 1;\n if (i >= chunk.length) {\n return EOC;\n }\n // Using charCodeAt and handling the surrogates ourselves is faster\n // than using codePointAt.\n const code = chunk.charCodeAt(i);\n this.column++;\n if (code < 0xD800) {\n if (code >= SPACE || code === TAB) {\n return code;\n }\n switch (code) {\n case NL:\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL;\n case CR:\n // We may get NaN if we read past the end of the chunk, which is fine.\n if (chunk.charCodeAt(i + 1) === NL) {\n // A \\r\\n sequence is converted to \\n so we have to skip over the\n // next character. We already know it has a size of 1 so ++ is fine\n // here.\n this.i = i + 2;\n }\n // Otherwise, a \\r is just converted to \\n, so we don't have to skip\n // ahead.\n // In either case, \\r becomes \\n.\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL_LIKE;\n default:\n // If we get here, then code < SPACE and it is not NL CR or TAB.\n this.fail(\"disallowed character.\");\n return code;\n }\n }\n if (code > 0xDBFF) {\n // This is a specialized version of isChar10 that takes into account\n // that in this context code > 0xDBFF and code <= 0xFFFF. So it does not\n // test cases that don't need testing.\n if (!(code >= 0xE000 && code <= 0xFFFD)) {\n this.fail(\"disallowed character.\");\n }\n return code;\n }\n const final = 0x10000 + (code - 0xD800) * 0x400 + (chunk.charCodeAt(i + 1) - 0xDC00);\n this.i = i + 2;\n // This is a specialized version of isChar10 that takes into account that in\n // this context necessarily final >= 0x10000.\n if (final > 0x10FFFF) {\n this.fail(\"disallowed character.\");\n }\n return final;\n }\n /**\n * Get a single code point out of the current chunk. This updates the current\n * position if we do position tracking.\n *\n * This is the algorithm to use for XML 1.1.\n *\n * @returns {number} The character read.\n */\n getCode11() {\n const {\n chunk,\n i\n } = this;\n this.prevI = i;\n // Yes, we do this instead of doing this.i++. Doing it this way, we do not\n // read this.i again, which is a bit faster.\n this.i = i + 1;\n if (i >= chunk.length) {\n return EOC;\n }\n // Using charCodeAt and handling the surrogates ourselves is faster\n // than using codePointAt.\n const code = chunk.charCodeAt(i);\n this.column++;\n if (code < 0xD800) {\n if (code > 0x1F && code < 0x7F || code > 0x9F && code !== LS || code === TAB) {\n return code;\n }\n switch (code) {\n case NL:\n // 0xA\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL;\n case CR:\n {\n // 0xD\n // We may get NaN if we read past the end of the chunk, which is\n // fine.\n const next = chunk.charCodeAt(i + 1);\n if (next === NL || next === NEL) {\n // A CR NL or CR NEL sequence is converted to NL so we have to skip\n // over the next character. We already know it has a size of 1.\n this.i = i + 2;\n }\n // Otherwise, a CR is just converted to NL, no skip.\n }\n /* yes, fall through */\n case NEL: // 0x85\n case LS:\n // Ox2028\n this.line++;\n this.column = 0;\n this.positionAtNewLine = this.position;\n return NL_LIKE;\n default:\n this.fail(\"disallowed character.\");\n return code;\n }\n }\n if (code > 0xDBFF) {\n // This is a specialized version of isCharAndNotRestricted that takes into\n // account that in this context code > 0xDBFF and code <= 0xFFFF. So it\n // does not test cases that don't need testing.\n if (!(code >= 0xE000 && code <= 0xFFFD)) {\n this.fail(\"disallowed character.\");\n }\n return code;\n }\n const final = 0x10000 + (code - 0xD800) * 0x400 + (chunk.charCodeAt(i + 1) - 0xDC00);\n this.i = i + 2;\n // This is a specialized version of isCharAndNotRestricted that takes into\n // account that in this context necessarily final >= 0x10000.\n if (final > 0x10FFFF) {\n this.fail(\"disallowed character.\");\n }\n return final;\n }\n /**\n * Like ``getCode`` but with the return value normalized so that ``NL`` is\n * returned for ``NL_LIKE``.\n */\n getCodeNorm() {\n const c = this.getCode();\n return c === NL_LIKE ? NL : c;\n }\n unget() {\n this.i = this.prevI;\n this.column--;\n }\n /**\n * Capture characters into a buffer until encountering one of a set of\n * characters.\n *\n * @param chars An array of codepoints. Encountering a character in the array\n * ends the capture. (``chars`` may safely contain ``NL``.)\n *\n * @return The character code that made the capture end, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n captureTo(chars) {\n let {\n i: start\n } = this;\n const {\n chunk\n } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n const isNLLike = c === NL_LIKE;\n const final = isNLLike ? NL : c;\n if (final === EOC || chars.includes(final)) {\n this.text += chunk.slice(start, this.prevI);\n return final;\n }\n if (isNLLike) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n }\n }\n }\n /**\n * Capture characters into a buffer until encountering a character.\n *\n * @param char The codepoint that ends the capture. **NOTE ``char`` MAY NOT\n * CONTAIN ``NL``.** Passing ``NL`` will result in buggy behavior.\n *\n * @return ``true`` if we ran into the character. Otherwise, we ran into the\n * end of the current chunk.\n */\n captureToChar(char) {\n let {\n i: start\n } = this;\n const {\n chunk\n } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let c = this.getCode();\n switch (c) {\n case NL_LIKE:\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n c = NL;\n break;\n case EOC:\n this.text += chunk.slice(start);\n return false;\n default:\n }\n if (c === char) {\n this.text += chunk.slice(start, this.prevI);\n return true;\n }\n }\n }\n /**\n * Capture characters that satisfy ``isNameChar`` into the ``name`` field of\n * this parser.\n *\n * @return The character code that made the test fail, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n captureNameChars() {\n const {\n chunk,\n i: start\n } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n if (c === EOC) {\n this.name += chunk.slice(start);\n return EOC;\n }\n // NL is not a name char so we don't have to test specifically for it.\n if (!isNameChar(c)) {\n this.name += chunk.slice(start, this.prevI);\n return c === NL_LIKE ? NL : c;\n }\n }\n }\n /**\n * Skip white spaces.\n *\n * @return The character that ended the skip, or ``EOC`` if we hit\n * the end of the chunk. The return value cannot be NL_LIKE: NL is returned\n * instead.\n */\n skipSpaces() {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCodeNorm();\n if (c === EOC || !isS(c)) {\n return c;\n }\n }\n }\n setXMLVersion(version) {\n this.currentXMLVersion = version;\n /* eslint-disable @typescript-eslint/unbound-method */\n if (version === \"1.0\") {\n this.isChar = isChar10;\n this.getCode = this.getCode10;\n } else {\n this.isChar = isChar11;\n this.getCode = this.getCode11;\n }\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n // STATE ENGINE METHODS\n // This needs to be a state separate from S_BEGIN_WHITESPACE because we want\n // to be sure never to come back to this state later.\n sBegin() {\n // We are essentially peeking at the first character of the chunk. Since\n // S_BEGIN can be in effect only when we start working on the first chunk,\n // the index at which we must look is necessarily 0. Note also that the\n // following test does not depend on decoding surrogates.\n // If the initial character is 0xFEFF, ignore it.\n if (this.chunk.charCodeAt(0) === 0xFEFF) {\n this.i++;\n this.column++;\n }\n this.state = S_BEGIN_WHITESPACE;\n }\n sBeginWhitespace() {\n // We need to know whether we've encountered spaces or not because as soon\n // as we run into a space, an XML declaration is no longer possible. Rather\n // than slow down skipSpaces even in places where we don't care whether it\n // skipped anything or not, we check whether prevI is equal to the value of\n // i from before we skip spaces.\n const iBefore = this.i;\n const c = this.skipSpaces();\n if (this.prevI !== iBefore) {\n this.xmlDeclPossible = false;\n }\n switch (c) {\n case LESS:\n this.state = S_OPEN_WAKA;\n // We could naively call closeText but in this state, it is not normal\n // to have text be filled with any data.\n if (this.text.length !== 0) {\n throw new Error(\"no-empty text at start\");\n }\n break;\n case EOC:\n break;\n default:\n this.unget();\n this.state = S_TEXT;\n this.xmlDeclPossible = false;\n }\n }\n sDoctype() {\n var _a;\n const c = this.captureTo(DOCTYPE_TERMINATOR);\n switch (c) {\n case GREATER:\n {\n // eslint-disable-next-line no-unused-expressions\n (_a = this.doctypeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n this.state = S_TEXT;\n this.doctype = true; // just remember that we saw it.\n break;\n }\n case EOC:\n break;\n default:\n this.text += String.fromCodePoint(c);\n if (c === OPEN_BRACKET) {\n this.state = S_DTD;\n } else if (isQuote(c)) {\n this.state = S_DOCTYPE_QUOTE;\n this.q = c;\n }\n }\n }\n sDoctypeQuote() {\n const q = this.q;\n if (this.captureToChar(q)) {\n this.text += String.fromCodePoint(q);\n this.q = null;\n this.state = S_DOCTYPE;\n }\n }\n sDTD() {\n const c = this.captureTo(DTD_TERMINATOR);\n if (c === EOC) {\n return;\n }\n this.text += String.fromCodePoint(c);\n if (c === CLOSE_BRACKET) {\n this.state = S_DOCTYPE;\n } else if (c === LESS) {\n this.state = S_DTD_OPEN_WAKA;\n } else if (isQuote(c)) {\n this.state = S_DTD_QUOTED;\n this.q = c;\n }\n }\n sDTDQuoted() {\n const q = this.q;\n if (this.captureToChar(q)) {\n this.text += String.fromCodePoint(q);\n this.state = S_DTD;\n this.q = null;\n }\n }\n sDTDOpenWaka() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n switch (c) {\n case BANG:\n this.state = S_DTD_OPEN_WAKA_BANG;\n this.openWakaBang = \"\";\n break;\n case QUESTION:\n this.state = S_DTD_PI;\n break;\n default:\n this.state = S_DTD;\n }\n }\n sDTDOpenWakaBang() {\n const char = String.fromCodePoint(this.getCodeNorm());\n const owb = this.openWakaBang += char;\n this.text += char;\n if (owb !== \"-\") {\n this.state = owb === \"--\" ? S_DTD_COMMENT : S_DTD;\n this.openWakaBang = \"\";\n }\n }\n sDTDComment() {\n if (this.captureToChar(MINUS)) {\n this.text += \"-\";\n this.state = S_DTD_COMMENT_ENDING;\n }\n }\n sDTDCommentEnding() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n this.state = c === MINUS ? S_DTD_COMMENT_ENDED : S_DTD_COMMENT;\n }\n sDTDCommentEnded() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n if (c === GREATER) {\n this.state = S_DTD;\n } else {\n this.fail(\"malformed comment.\");\n // will be recorded as\n // a comment of \" blah -- bloo \"\n this.state = S_DTD_COMMENT;\n }\n }\n sDTDPI() {\n if (this.captureToChar(QUESTION)) {\n this.text += \"?\";\n this.state = S_DTD_PI_ENDING;\n }\n }\n sDTDPIEnding() {\n const c = this.getCodeNorm();\n this.text += String.fromCodePoint(c);\n if (c === GREATER) {\n this.state = S_DTD;\n }\n }\n sText() {\n //\n // We did try a version of saxes where the S_TEXT state was split in two\n // states: one for text inside the root element, and one for text\n // outside. This was avoiding having to test this.tags.length to decide\n // what implementation to actually use.\n //\n // Peformance testing on gigabyte-size files did not show any advantage to\n // using the two states solution instead of the current one. Conversely, it\n // made the code a bit more complicated elsewhere. For instance, a comment\n // can appear before the root element so when a comment ended it was\n // necessary to determine whether to return to the S_TEXT state or to the\n // new text-outside-root state.\n //\n if (this.tags.length !== 0) {\n this.handleTextInRoot();\n } else {\n this.handleTextOutsideRoot();\n }\n }\n sEntity() {\n // This is essentially a specialized version of captureToChar(SEMICOLON...)\n let {\n i: start\n } = this;\n const {\n chunk\n } = this;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n loop:\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case NL_LIKE:\n this.entity += `${chunk.slice(start, this.prevI)}\\n`;\n start = this.i;\n break;\n case SEMICOLON:\n {\n const {\n entityReturnState\n } = this;\n const entity = this.entity + chunk.slice(start, this.prevI);\n this.state = entityReturnState;\n let parsed;\n if (entity === \"\") {\n this.fail(\"empty entity name.\");\n parsed = \"&;\";\n } else {\n parsed = this.parseEntity(entity);\n this.entity = \"\";\n }\n if (entityReturnState !== S_TEXT || this.textHandler !== undefined) {\n this.text += parsed;\n }\n // eslint-disable-next-line no-labels\n break loop;\n }\n case EOC:\n this.entity += chunk.slice(start);\n // eslint-disable-next-line no-labels\n break loop;\n default:\n }\n }\n }\n sOpenWaka() {\n // Reminder: a state handler is called with at least one character\n // available in the current chunk. So the first call to get code inside of\n // a state handler cannot return ``EOC``. That's why we don't test\n // for it.\n const c = this.getCode();\n // either a /, ?, !, or text is coming next.\n if (isNameStartChar(c)) {\n this.state = S_OPEN_TAG;\n this.unget();\n this.xmlDeclPossible = false;\n } else {\n switch (c) {\n case FORWARD_SLASH:\n this.state = S_CLOSE_TAG;\n this.xmlDeclPossible = false;\n break;\n case BANG:\n this.state = S_OPEN_WAKA_BANG;\n this.openWakaBang = \"\";\n this.xmlDeclPossible = false;\n break;\n case QUESTION:\n this.state = S_PI_FIRST_CHAR;\n break;\n default:\n this.fail(\"disallowed character in tag name\");\n this.state = S_TEXT;\n this.xmlDeclPossible = false;\n }\n }\n }\n sOpenWakaBang() {\n this.openWakaBang += String.fromCodePoint(this.getCodeNorm());\n switch (this.openWakaBang) {\n case \"[CDATA[\":\n if (!this.sawRoot && !this.reportedTextBeforeRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextBeforeRoot = true;\n }\n if (this.closedRoot && !this.reportedTextAfterRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextAfterRoot = true;\n }\n this.state = S_CDATA;\n this.openWakaBang = \"\";\n break;\n case \"--\":\n this.state = S_COMMENT;\n this.openWakaBang = \"\";\n break;\n case \"DOCTYPE\":\n this.state = S_DOCTYPE;\n if (this.doctype || this.sawRoot) {\n this.fail(\"inappropriately located doctype declaration.\");\n }\n this.openWakaBang = \"\";\n break;\n default:\n // 7 happens to be the maximum length of the string that can possibly\n // match one of the cases above.\n if (this.openWakaBang.length >= 7) {\n this.fail(\"incorrect syntax.\");\n }\n }\n }\n sComment() {\n if (this.captureToChar(MINUS)) {\n this.state = S_COMMENT_ENDING;\n }\n }\n sCommentEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === MINUS) {\n this.state = S_COMMENT_ENDED;\n // eslint-disable-next-line no-unused-expressions\n (_a = this.commentHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n } else {\n this.text += `-${String.fromCodePoint(c)}`;\n this.state = S_COMMENT;\n }\n }\n sCommentEnded() {\n const c = this.getCodeNorm();\n if (c !== GREATER) {\n this.fail(\"malformed comment.\");\n // will be recorded as\n // a comment of \" blah -- bloo \"\n this.text += `--${String.fromCodePoint(c)}`;\n this.state = S_COMMENT;\n } else {\n this.state = S_TEXT;\n }\n }\n sCData() {\n if (this.captureToChar(CLOSE_BRACKET)) {\n this.state = S_CDATA_ENDING;\n }\n }\n sCDataEnding() {\n const c = this.getCodeNorm();\n if (c === CLOSE_BRACKET) {\n this.state = S_CDATA_ENDING_2;\n } else {\n this.text += `]${String.fromCodePoint(c)}`;\n this.state = S_CDATA;\n }\n }\n sCDataEnding2() {\n var _a;\n const c = this.getCodeNorm();\n switch (c) {\n case GREATER:\n {\n // eslint-disable-next-line no-unused-expressions\n (_a = this.cdataHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.text);\n this.text = \"\";\n this.state = S_TEXT;\n break;\n }\n case CLOSE_BRACKET:\n this.text += \"]\";\n break;\n default:\n this.text += `]]${String.fromCodePoint(c)}`;\n this.state = S_CDATA;\n }\n }\n // We need this separate state to check the first character fo the pi target\n // with this.nameStartCheck which allows less characters than this.nameCheck.\n sPIFirstChar() {\n const c = this.getCodeNorm();\n // This is first because in the case where the file is well-formed this is\n // the branch taken. We optimize for well-formedness.\n if (this.nameStartCheck(c)) {\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n } else if (c === QUESTION || isS(c)) {\n this.fail(\"processing instruction without a target.\");\n this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;\n } else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n }\n sPIRest() {\n // Capture characters into a piTarget while ``this.nameCheck`` run on the\n // character read returns true.\n const {\n chunk,\n i: start\n } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCodeNorm();\n if (c === EOC) {\n this.piTarget += chunk.slice(start);\n return;\n }\n // NL cannot satisfy this.nameCheck so we don't have to test specifically\n // for it.\n if (!this.nameCheck(c)) {\n this.piTarget += chunk.slice(start, this.prevI);\n const isQuestion = c === QUESTION;\n if (isQuestion || isS(c)) {\n if (this.piTarget === \"xml\") {\n if (!this.xmlDeclPossible) {\n this.fail(\"an XML declaration must be at the start of the document.\");\n }\n this.state = isQuestion ? S_XML_DECL_ENDING : S_XML_DECL_NAME_START;\n } else {\n this.state = isQuestion ? S_PI_ENDING : S_PI_BODY;\n }\n } else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n }\n break;\n }\n }\n }\n sPIBody() {\n if (this.text.length === 0) {\n const c = this.getCodeNorm();\n if (c === QUESTION) {\n this.state = S_PI_ENDING;\n } else if (!isS(c)) {\n this.text = String.fromCodePoint(c);\n }\n }\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n else if (this.captureToChar(QUESTION)) {\n this.state = S_PI_ENDING;\n }\n }\n sPIEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === GREATER) {\n const {\n piTarget\n } = this;\n if (piTarget.toLowerCase() === \"xml\") {\n this.fail(\"the XML declaration must appear at the start of the document.\");\n }\n // eslint-disable-next-line no-unused-expressions\n (_a = this.piHandler) === null || _a === void 0 ? void 0 : _a.call(this, {\n target: piTarget,\n body: this.text\n });\n this.piTarget = this.text = \"\";\n this.state = S_TEXT;\n } else if (c === QUESTION) {\n // We ran into ?? as part of a processing instruction. We initially took\n // the first ? as a sign that the PI was ending, but it is not. So we have\n // to add it to the body but we take the new ? as a sign that the PI is\n // ending.\n this.text += \"?\";\n } else {\n this.text += `?${String.fromCodePoint(c)}`;\n this.state = S_PI_BODY;\n }\n this.xmlDeclPossible = false;\n }\n sXMLDeclNameStart() {\n const c = this.skipSpaces();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n // It is valid to go to S_XML_DECL_ENDING from this state.\n this.state = S_XML_DECL_ENDING;\n return;\n }\n if (c !== EOC) {\n this.state = S_XML_DECL_NAME;\n this.name = String.fromCodePoint(c);\n }\n }\n sXMLDeclName() {\n const c = this.captureTo(XML_DECL_NAME_TERMINATOR);\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.name += this.text;\n this.text = \"\";\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (!(isS(c) || c === EQUAL)) {\n return;\n }\n this.name += this.text;\n this.text = \"\";\n if (!this.xmlDeclExpects.includes(this.name)) {\n switch (this.name.length) {\n case 0:\n this.fail(\"did not expect any more name/value pairs.\");\n break;\n case 1:\n this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);\n break;\n default:\n this.fail(`expected one of ${this.xmlDeclExpects.join(\", \")}`);\n }\n }\n this.state = c === EQUAL ? S_XML_DECL_VALUE_START : S_XML_DECL_EQ;\n }\n sXMLDeclEq() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (isS(c)) {\n return;\n }\n if (c !== EQUAL) {\n this.fail(\"value required.\");\n }\n this.state = S_XML_DECL_VALUE_START;\n }\n sXMLDeclValueStart() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (isS(c)) {\n return;\n }\n if (!isQuote(c)) {\n this.fail(\"value must be quoted.\");\n this.q = SPACE;\n } else {\n this.q = c;\n }\n this.state = S_XML_DECL_VALUE;\n }\n sXMLDeclValue() {\n const c = this.captureTo([this.q, QUESTION]);\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n this.state = S_XML_DECL_ENDING;\n this.text = \"\";\n this.fail(\"XML declaration is incomplete.\");\n return;\n }\n if (c === EOC) {\n return;\n }\n const value = this.text;\n this.text = \"\";\n switch (this.name) {\n case \"version\":\n {\n this.xmlDeclExpects = [\"encoding\", \"standalone\"];\n const version = value;\n this.xmlDecl.version = version;\n // This is the test specified by XML 1.0 but it is fine for XML 1.1.\n if (!/^1\\.[0-9]+$/.test(version)) {\n this.fail(\"version number must match /^1\\\\.[0-9]+$/.\");\n }\n // When forceXMLVersion is set, the XML declaration is ignored.\n else if (!this.opt.forceXMLVersion) {\n this.setXMLVersion(version);\n }\n break;\n }\n case \"encoding\":\n if (!/^[A-Za-z][A-Za-z0-9._-]*$/.test(value)) {\n this.fail(\"encoding value must match \\\n/^[A-Za-z0-9][A-Za-z0-9._-]*$/.\");\n }\n this.xmlDeclExpects = [\"standalone\"];\n this.xmlDecl.encoding = value;\n break;\n case \"standalone\":\n if (value !== \"yes\" && value !== \"no\") {\n this.fail(\"standalone value must match \\\"yes\\\" or \\\"no\\\".\");\n }\n this.xmlDeclExpects = [];\n this.xmlDecl.standalone = value;\n break;\n default:\n // We don't need to raise an error here since we've already raised one\n // when checking what name was expected.\n }\n\n this.name = \"\";\n this.state = S_XML_DECL_SEPARATOR;\n }\n sXMLDeclSeparator() {\n const c = this.getCodeNorm();\n // The question mark character is not valid inside any of the XML\n // declaration name/value pairs.\n if (c === QUESTION) {\n // It is valid to go to S_XML_DECL_ENDING from this state.\n this.state = S_XML_DECL_ENDING;\n return;\n }\n if (!isS(c)) {\n this.fail(\"whitespace required.\");\n this.unget();\n }\n this.state = S_XML_DECL_NAME_START;\n }\n sXMLDeclEnding() {\n var _a;\n const c = this.getCodeNorm();\n if (c === GREATER) {\n if (this.piTarget !== \"xml\") {\n this.fail(\"processing instructions are not allowed before root.\");\n } else if (this.name !== \"version\" && this.xmlDeclExpects.includes(\"version\")) {\n this.fail(\"XML declaration must contain a version.\");\n }\n // eslint-disable-next-line no-unused-expressions\n (_a = this.xmldeclHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.xmlDecl);\n this.name = \"\";\n this.piTarget = this.text = \"\";\n this.state = S_TEXT;\n } else {\n // We got here because the previous character was a ?, but the question\n // mark character is not valid inside any of the XML declaration\n // name/value pairs.\n this.fail(\"The character ? is disallowed anywhere in XML declarations.\");\n }\n this.xmlDeclPossible = false;\n }\n sOpenTag() {\n var _a;\n const c = this.captureNameChars();\n if (c === EOC) {\n return;\n }\n const tag = this.tag = {\n name: this.name,\n attributes: Object.create(null)\n };\n this.name = \"\";\n if (this.xmlnsOpt) {\n this.topNS = tag.ns = Object.create(null);\n }\n // eslint-disable-next-line no-unused-expressions\n (_a = this.openTagStartHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n this.sawRoot = true;\n if (!this.fragmentOpt && this.closedRoot) {\n this.fail(\"documents may contain only one root.\");\n }\n switch (c) {\n case GREATER:\n this.openTag();\n break;\n case FORWARD_SLASH:\n this.state = S_OPEN_TAG_SLASH;\n break;\n default:\n if (!isS(c)) {\n this.fail(\"disallowed character in tag name.\");\n }\n this.state = S_ATTRIB;\n }\n }\n sOpenTagSlash() {\n if (this.getCode() === GREATER) {\n this.openSelfClosingTag();\n } else {\n this.fail(\"forward-slash in opening tag not followed by >.\");\n this.state = S_ATTRIB;\n }\n }\n sAttrib() {\n const c = this.skipSpaces();\n if (c === EOC) {\n return;\n }\n if (isNameStartChar(c)) {\n this.unget();\n this.state = S_ATTRIB_NAME;\n } else if (c === GREATER) {\n this.openTag();\n } else if (c === FORWARD_SLASH) {\n this.state = S_OPEN_TAG_SLASH;\n } else {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribName() {\n const c = this.captureNameChars();\n if (c === EQUAL) {\n this.state = S_ATTRIB_VALUE;\n } else if (isS(c)) {\n this.state = S_ATTRIB_NAME_SAW_WHITE;\n } else if (c === GREATER) {\n this.fail(\"attribute without value.\");\n this.pushAttrib(this.name, this.name);\n this.name = this.text = \"\";\n this.openTag();\n } else if (c !== EOC) {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribNameSawWhite() {\n const c = this.skipSpaces();\n switch (c) {\n case EOC:\n return;\n case EQUAL:\n this.state = S_ATTRIB_VALUE;\n break;\n default:\n this.fail(\"attribute without value.\");\n // Should we do this???\n // this.tag.attributes[this.name] = \"\";\n this.text = \"\";\n this.name = \"\";\n if (c === GREATER) {\n this.openTag();\n } else if (isNameStartChar(c)) {\n this.unget();\n this.state = S_ATTRIB_NAME;\n } else {\n this.fail(\"disallowed character in attribute name.\");\n this.state = S_ATTRIB;\n }\n }\n }\n sAttribValue() {\n const c = this.getCodeNorm();\n if (isQuote(c)) {\n this.q = c;\n this.state = S_ATTRIB_VALUE_QUOTED;\n } else if (!isS(c)) {\n this.fail(\"unquoted attribute value.\");\n this.state = S_ATTRIB_VALUE_UNQUOTED;\n this.unget();\n }\n }\n sAttribValueQuoted() {\n // We deliberately do not use captureTo here. The specialized code we use\n // here is faster than using captureTo.\n const {\n q,\n chunk\n } = this;\n let {\n i: start\n } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case q:\n this.pushAttrib(this.name, this.text + chunk.slice(start, this.prevI));\n this.name = this.text = \"\";\n this.q = null;\n this.state = S_ATTRIB_VALUE_CLOSED;\n return;\n case AMP:\n this.text += chunk.slice(start, this.prevI);\n this.state = S_ENTITY;\n this.entityReturnState = S_ATTRIB_VALUE_QUOTED;\n return;\n case NL:\n case NL_LIKE:\n case TAB:\n this.text += `${chunk.slice(start, this.prevI)} `;\n start = this.i;\n break;\n case LESS:\n this.text += chunk.slice(start, this.prevI);\n this.fail(\"disallowed character.\");\n return;\n case EOC:\n this.text += chunk.slice(start);\n return;\n default:\n }\n }\n }\n sAttribValueClosed() {\n const c = this.getCodeNorm();\n if (isS(c)) {\n this.state = S_ATTRIB;\n } else if (c === GREATER) {\n this.openTag();\n } else if (c === FORWARD_SLASH) {\n this.state = S_OPEN_TAG_SLASH;\n } else if (isNameStartChar(c)) {\n this.fail(\"no whitespace between attributes.\");\n this.unget();\n this.state = S_ATTRIB_NAME;\n } else {\n this.fail(\"disallowed character in attribute name.\");\n }\n }\n sAttribValueUnquoted() {\n // We don't do anything regarding EOL or space handling for unquoted\n // attributes. We already have failed by the time we get here, and the\n // contract that saxes upholds states that upon failure, it is not safe to\n // rely on the data passed to event handlers (other than\n // ``onerror``). Passing \"bad\" data is not a problem.\n const c = this.captureTo(ATTRIB_VALUE_UNQUOTED_TERMINATOR);\n switch (c) {\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_ATTRIB_VALUE_UNQUOTED;\n break;\n case LESS:\n this.fail(\"disallowed character.\");\n break;\n case EOC:\n break;\n default:\n if (this.text.includes(\"]]>\")) {\n this.fail(\"the string \\\"]]>\\\" is disallowed in char data.\");\n }\n this.pushAttrib(this.name, this.text);\n this.name = this.text = \"\";\n if (c === GREATER) {\n this.openTag();\n } else {\n this.state = S_ATTRIB;\n }\n }\n }\n sCloseTag() {\n const c = this.captureNameChars();\n if (c === GREATER) {\n this.closeTag();\n } else if (isS(c)) {\n this.state = S_CLOSE_TAG_SAW_WHITE;\n } else if (c !== EOC) {\n this.fail(\"disallowed character in closing tag.\");\n }\n }\n sCloseTagSawWhite() {\n switch (this.skipSpaces()) {\n case GREATER:\n this.closeTag();\n break;\n case EOC:\n break;\n default:\n this.fail(\"disallowed character in closing tag.\");\n }\n }\n // END OF STATE ENGINE METHODS\n handleTextInRoot() {\n // This is essentially a specialized version of captureTo which is optimized\n // for performing the ]]> check. A previous version of this code, checked\n // ``this.text`` for the presence of ]]>. It simplified the code but was\n // very costly when character data contained a lot of entities to be parsed.\n //\n // Since we are using a specialized loop, we also keep track of the presence\n // of ]]> in text data. The sequence ]]> is forbidden to appear as-is.\n //\n let {\n i: start,\n forbiddenState\n } = this;\n const {\n chunk,\n textHandler: handler\n } = this;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n scanLoop:\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (this.getCode()) {\n case LESS:\n {\n this.state = S_OPEN_WAKA;\n if (handler !== undefined) {\n const {\n text\n } = this;\n const slice = chunk.slice(start, this.prevI);\n if (text.length !== 0) {\n handler(text + slice);\n this.text = \"\";\n } else if (slice.length !== 0) {\n handler(slice);\n }\n }\n forbiddenState = FORBIDDEN_START;\n // eslint-disable-next-line no-labels\n break scanLoop;\n }\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_TEXT;\n if (handler !== undefined) {\n this.text += chunk.slice(start, this.prevI);\n }\n forbiddenState = FORBIDDEN_START;\n // eslint-disable-next-line no-labels\n break scanLoop;\n case CLOSE_BRACKET:\n switch (forbiddenState) {\n case FORBIDDEN_START:\n forbiddenState = FORBIDDEN_BRACKET;\n break;\n case FORBIDDEN_BRACKET:\n forbiddenState = FORBIDDEN_BRACKET_BRACKET;\n break;\n case FORBIDDEN_BRACKET_BRACKET:\n break;\n default:\n throw new Error(\"impossible state\");\n }\n break;\n case GREATER:\n if (forbiddenState === FORBIDDEN_BRACKET_BRACKET) {\n this.fail(\"the string \\\"]]>\\\" is disallowed in char data.\");\n }\n forbiddenState = FORBIDDEN_START;\n break;\n case NL_LIKE:\n if (handler !== undefined) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n }\n start = this.i;\n forbiddenState = FORBIDDEN_START;\n break;\n case EOC:\n if (handler !== undefined) {\n this.text += chunk.slice(start);\n }\n // eslint-disable-next-line no-labels\n break scanLoop;\n default:\n forbiddenState = FORBIDDEN_START;\n }\n }\n this.forbiddenState = forbiddenState;\n }\n handleTextOutsideRoot() {\n // This is essentially a specialized version of captureTo which is optimized\n // for a specialized task. We keep track of the presence of non-space\n // characters in the text since these are errors when appearing outside the\n // document root element.\n let {\n i: start\n } = this;\n const {\n chunk,\n textHandler: handler\n } = this;\n let nonSpace = false;\n // eslint-disable-next-line no-labels, no-restricted-syntax\n outRootLoop:\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const code = this.getCode();\n switch (code) {\n case LESS:\n {\n this.state = S_OPEN_WAKA;\n if (handler !== undefined) {\n const {\n text\n } = this;\n const slice = chunk.slice(start, this.prevI);\n if (text.length !== 0) {\n handler(text + slice);\n this.text = \"\";\n } else if (slice.length !== 0) {\n handler(slice);\n }\n }\n // eslint-disable-next-line no-labels\n break outRootLoop;\n }\n case AMP:\n this.state = S_ENTITY;\n this.entityReturnState = S_TEXT;\n if (handler !== undefined) {\n this.text += chunk.slice(start, this.prevI);\n }\n nonSpace = true;\n // eslint-disable-next-line no-labels\n break outRootLoop;\n case NL_LIKE:\n if (handler !== undefined) {\n this.text += `${chunk.slice(start, this.prevI)}\\n`;\n }\n start = this.i;\n break;\n case EOC:\n if (handler !== undefined) {\n this.text += chunk.slice(start);\n }\n // eslint-disable-next-line no-labels\n break outRootLoop;\n default:\n if (!isS(code)) {\n nonSpace = true;\n }\n }\n }\n if (!nonSpace) {\n return;\n }\n // We use the reportedTextBeforeRoot and reportedTextAfterRoot flags\n // to avoid reporting errors for every single character that is out of\n // place.\n if (!this.sawRoot && !this.reportedTextBeforeRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextBeforeRoot = true;\n }\n if (this.closedRoot && !this.reportedTextAfterRoot) {\n this.fail(\"text data outside of root node.\");\n this.reportedTextAfterRoot = true;\n }\n }\n pushAttribNS(name, value) {\n var _a;\n const {\n prefix,\n local\n } = this.qname(name);\n const attr = {\n name,\n prefix,\n local,\n value\n };\n this.attribList.push(attr);\n // eslint-disable-next-line no-unused-expressions\n (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);\n if (prefix === \"xmlns\") {\n const trimmed = value.trim();\n if (this.currentXMLVersion === \"1.0\" && trimmed === \"\") {\n this.fail(\"invalid attempt to undefine prefix in XML 1.0\");\n }\n this.topNS[local] = trimmed;\n nsPairCheck(this, local, trimmed);\n } else if (name === \"xmlns\") {\n const trimmed = value.trim();\n this.topNS[\"\"] = trimmed;\n nsPairCheck(this, \"\", trimmed);\n }\n }\n pushAttribPlain(name, value) {\n var _a;\n const attr = {\n name,\n value\n };\n this.attribList.push(attr);\n // eslint-disable-next-line no-unused-expressions\n (_a = this.attributeHandler) === null || _a === void 0 ? void 0 : _a.call(this, attr);\n }\n /**\n * End parsing. This performs final well-formedness checks and resets the\n * parser to a clean state.\n *\n * @returns this\n */\n end() {\n var _a, _b;\n if (!this.sawRoot) {\n this.fail(\"document must contain a root element.\");\n }\n const {\n tags\n } = this;\n while (tags.length > 0) {\n const tag = tags.pop();\n this.fail(`unclosed tag: ${tag.name}`);\n }\n if (this.state !== S_BEGIN && this.state !== S_TEXT) {\n this.fail(\"unexpected end.\");\n }\n const {\n text\n } = this;\n if (text.length !== 0) {\n // eslint-disable-next-line no-unused-expressions\n (_a = this.textHandler) === null || _a === void 0 ? void 0 : _a.call(this, text);\n this.text = \"\";\n }\n this._closed = true;\n // eslint-disable-next-line no-unused-expressions\n (_b = this.endHandler) === null || _b === void 0 ? void 0 : _b.call(this);\n this._init();\n return this;\n }\n /**\n * Resolve a namespace prefix.\n *\n * @param prefix The prefix to resolve.\n *\n * @returns The namespace URI or ``undefined`` if the prefix is not defined.\n */\n resolve(prefix) {\n var _a, _b;\n let uri = this.topNS[prefix];\n if (uri !== undefined) {\n return uri;\n }\n const {\n tags\n } = this;\n for (let index = tags.length - 1; index >= 0; index--) {\n uri = tags[index].ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n }\n uri = this.ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);\n }\n /**\n * Parse a qname into its prefix and local name parts.\n *\n * @param name The name to parse\n *\n * @returns\n */\n qname(name) {\n // This is faster than using name.split(\":\").\n const colon = name.indexOf(\":\");\n if (colon === -1) {\n return {\n prefix: \"\",\n local: name\n };\n }\n const local = name.slice(colon + 1);\n const prefix = name.slice(0, colon);\n if (prefix === \"\" || local === \"\" || local.includes(\":\")) {\n this.fail(`malformed name: ${name}.`);\n }\n return {\n prefix,\n local\n };\n }\n processAttribsNS() {\n var _a;\n const {\n attribList\n } = this;\n const tag = this.tag;\n {\n // add namespace info to tag\n const {\n prefix,\n local\n } = this.qname(tag.name);\n tag.prefix = prefix;\n tag.local = local;\n const uri = tag.uri = (_a = this.resolve(prefix)) !== null && _a !== void 0 ? _a : \"\";\n if (prefix !== \"\") {\n if (prefix === \"xmlns\") {\n this.fail(\"tags may not have \\\"xmlns\\\" as prefix.\");\n }\n if (uri === \"\") {\n this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);\n tag.uri = prefix;\n }\n }\n }\n if (attribList.length === 0) {\n return;\n }\n const {\n attributes\n } = tag;\n const seen = new Set();\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (const attr of attribList) {\n const {\n name,\n prefix,\n local\n } = attr;\n let uri;\n let eqname;\n if (prefix === \"\") {\n uri = name === \"xmlns\" ? XMLNS_NAMESPACE : \"\";\n eqname = name;\n } else {\n uri = this.resolve(prefix);\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (uri === undefined) {\n this.fail(`unbound namespace prefix: ${JSON.stringify(prefix)}.`);\n uri = prefix;\n }\n eqname = `{${uri}}${local}`;\n }\n if (seen.has(eqname)) {\n this.fail(`duplicate attribute: ${eqname}.`);\n }\n seen.add(eqname);\n attr.uri = uri;\n attributes[name] = attr;\n }\n this.attribList = [];\n }\n processAttribsPlain() {\n const {\n attribList\n } = this;\n // eslint-disable-next-line prefer-destructuring\n const attributes = this.tag.attributes;\n for (const {\n name,\n value\n } of attribList) {\n if (attributes[name] !== undefined) {\n this.fail(`duplicate attribute: ${name}.`);\n }\n attributes[name] = value;\n }\n this.attribList = [];\n }\n /**\n * Handle a complete open tag. This parser code calls this once it has seen\n * the whole tag. This method checks for well-formeness and then emits\n * ``onopentag``.\n */\n openTag() {\n var _a;\n this.processAttribs();\n const {\n tags\n } = this;\n const tag = this.tag;\n tag.isSelfClosing = false;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n // eslint-disable-next-line no-unused-expressions\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n tags.push(tag);\n this.state = S_TEXT;\n this.name = \"\";\n }\n /**\n * Handle a complete self-closing tag. This parser code calls this once it has\n * seen the whole tag. This method checks for well-formeness and then emits\n * ``onopentag`` and ``onclosetag``.\n */\n openSelfClosingTag() {\n var _a, _b, _c;\n this.processAttribs();\n const {\n tags\n } = this;\n const tag = this.tag;\n tag.isSelfClosing = true;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n // eslint-disable-next-line no-unused-expressions\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n // eslint-disable-next-line no-unused-expressions\n (_b = this.closeTagHandler) === null || _b === void 0 ? void 0 : _b.call(this, tag);\n const top = this.tag = (_c = tags[tags.length - 1]) !== null && _c !== void 0 ? _c : null;\n if (top === null) {\n this.closedRoot = true;\n }\n this.state = S_TEXT;\n this.name = \"\";\n }\n /**\n * Handle a complete close tag. This parser code calls this once it has seen\n * the whole tag. This method checks for well-formeness and then emits\n * ``onclosetag``.\n */\n closeTag() {\n const {\n tags,\n name\n } = this;\n // Our state after this will be S_TEXT, no matter what, and we can clear\n // tagName now.\n this.state = S_TEXT;\n this.name = \"\";\n if (name === \"\") {\n this.fail(\"weird empty close tag.\");\n this.text += \">\";\n return;\n }\n const handler = this.closeTagHandler;\n let l = tags.length;\n while (l-- > 0) {\n const tag = this.tag = tags.pop();\n this.topNS = tag.ns;\n // eslint-disable-next-line no-unused-expressions\n handler === null || handler === void 0 ? void 0 : handler(tag);\n if (tag.name === name) {\n break;\n }\n this.fail(\"unexpected close tag.\");\n }\n if (l === 0) {\n this.closedRoot = true;\n } else if (l < 0) {\n this.fail(`unmatched closing tag: ${name}.`);\n this.text += `${name}>`;\n }\n }\n /**\n * Resolves an entity. Makes any necessary well-formedness checks.\n *\n * @param entity The entity to resolve.\n *\n * @returns The parsed entity.\n */\n parseEntity(entity) {\n // startsWith would be significantly slower for this test.\n // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with\n if (entity[0] !== \"#\") {\n const defined = this.ENTITIES[entity];\n if (defined !== undefined) {\n return defined;\n }\n this.fail(this.isName(entity) ? \"undefined entity.\" : \"disallowed character in entity name.\");\n return `&${entity};`;\n }\n let num = NaN;\n if (entity[1] === \"x\" && /^#x[0-9a-f]+$/i.test(entity)) {\n num = parseInt(entity.slice(2), 16);\n } else if (/^#[0-9]+$/.test(entity)) {\n num = parseInt(entity.slice(1), 10);\n }\n // The character reference is required to match the CHAR production.\n if (!this.isChar(num)) {\n this.fail(\"malformed character entity.\");\n return `&${entity};`;\n }\n return String.fromCodePoint(num);\n }\n}\nexports.SaxesParser = SaxesParser;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1l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FBSyxHQUFHLElBQUksZ0JBQWdCLENBQUM3RixJQUFJLENBQUM2RixNQUFNLENBQUMsRUFBRTtNQUN0RGlJLEdBQUcsR0FBR0UsUUFBUSxDQUFDbkksTUFBTSxDQUFDb0QsS0FBSyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztLQUNwQyxNQUNJLElBQUksV0FBVyxDQUFDakosSUFBSSxDQUFDNkYsTUFBTSxDQUFDLEVBQUU7TUFDakNpSSxHQUFHLEdBQUdFLFFBQVEsQ0FBQ25JLE1BQU0sQ0FBQ29ELEtBQUssQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7O0lBR3JDO0lBQ0EsSUFBSSxDQUFDLElBQUksQ0FBQzNQLE1BQU0sQ0FBQ3dVLEdBQUcsQ0FBQyxFQUFFO01BQ3JCLElBQUksQ0FBQ3RPLElBQUksQ0FBQyw2QkFBNkIsQ0FBQztNQUN4QyxPQUFPLElBQUlxRyxNQUFNLEdBQUc7O0lBR3RCLE9BQU8wRSxNQUFNLENBQUNDLGFBQWEsQ0FBQ3NELEdBQUcsQ0FBQztFQUNsQzs7QUFobUVGek4sT0FBQSxDQUFBZ0IsV0FBQSxHQUFBQSxXQUFBIn0=","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha1 () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha1, Hash)\n\nSha1.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl1 (num) {\n return (num << 1) | (num >>> 31)\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha1.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha1.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha1\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Sha256 = require('./sha256')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar W = new Array(64)\n\nfunction Sha224 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha224, Sha256)\n\nSha224.prototype.init = function () {\n this._a = 0xc1059ed8\n this._b = 0x367cd507\n this._c = 0x3070dd17\n this._d = 0xf70e5939\n this._e = 0xffc00b31\n this._f = 0x68581511\n this._g = 0x64f98fa7\n this._h = 0xbefa4fa4\n\n return this\n}\n\nSha224.prototype._hash = function () {\n var H = Buffer.allocUnsafe(28)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n\n return H\n}\n\nmodule.exports = Sha224\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","var inherits = require('inherits')\nvar SHA512 = require('./sha512')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar W = new Array(160)\n\nfunction Sha384 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha384, SHA512)\n\nSha384.prototype.init = function () {\n this._ah = 0xcbbb9d5d\n this._bh = 0x629a292a\n this._ch = 0x9159015a\n this._dh = 0x152fecd8\n this._eh = 0x67332667\n this._fh = 0x8eb44a87\n this._gh = 0xdb0c2e0d\n this._hh = 0x47b5481d\n\n this._al = 0xc1059ed8\n this._bl = 0x367cd507\n this._cl = 0x3070dd17\n this._dl = 0xf70e5939\n this._el = 0xffc00b31\n this._fl = 0x68581511\n this._gl = 0x64f98fa7\n this._hl = 0xbefa4fa4\n\n return this\n}\n\nSha384.prototype._hash = function () {\n var H = Buffer.allocUnsafe(48)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n\n return H\n}\n\nmodule.exports = Sha384\n","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","module.exports = require('./lib/_stream_duplex.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/**/\n\nmodule.exports = Duplex;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Readable;\n\n/**/\nvar isArray = require('isarray');\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n 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]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, { hasUnpiped: false });\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n 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);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n 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);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /**/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /**/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n\n // reuse the free corkReq.\n state.corkedRequestsFree.next = corkReq;\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n pna.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n pna.nextTick(emitErrorNT, this, err);\n }\n }\n\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n pna.nextTick(emitErrorNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n pna.nextTick(emitErrorNT, _this, err);\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","module.exports = require('./readable').PassThrough\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","module.exports = require('./readable').Transform\n","module.exports = require('./lib/_stream_writable.js');\n","var nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\n/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (let i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n const output = [];\n const length32 = input.length * 32;\n const hexTab = '0123456789abcdef';\n\n for (let i = 0; i < length32; i += 8) {\n const x = input[i >> 5] >>> i % 32 & 0xff;\n const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n let a = 1732584193;\n let b = -271733879;\n let c = -1732584194;\n let d = 271733878;\n\n for (let i = 0; i < x.length; i += 16) {\n const olda = a;\n const oldb = b;\n const oldc = c;\n const oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n const length8 = input.length * 8;\n const output = new Uint32Array(getOutputLength(length8));\n\n for (let i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n const lsw = (x & 0xffff) + (y & 0xffff);\n const msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\n\nfunction rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\n// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (let i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n\n for (let i = 0; i < N; ++i) {\n const arr = new Uint32Array(16);\n\n for (let j = 0; j < 16; ++j) {\n arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];\n }\n\n M[i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (let i = 0; i < N; ++i) {\n const W = new Uint32Array(80);\n\n for (let t = 0; t < 16; ++t) {\n W[t] = M[i][t];\n }\n\n for (let t = 16; t < 80; ++t) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n for (let t = 0; t < 80; ++t) {\n const s = Math.floor(t / 20);\n const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","\"use strict\";\n\n/**\n * Character classes and associated utilities for the 5th edition of XML 1.0.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n//\n// Fragments.\n//\nexports.CHAR = \"\\t\\n\\r -\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\";\nexports.S = \" \\t\\r\\n\";\n// tslint:disable-next-line:max-line-length\nexports.NAME_START_CHAR = \":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NAME_CHAR = \"-\" + exports.NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.CHAR_RE = new RegExp(\"^[\" + exports.CHAR + \"]$\", \"u\");\nexports.S_RE = new RegExp(\"^[\" + exports.S + \"]+$\", \"u\");\nexports.NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"]$\", \"u\");\nexports.NAME_CHAR_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]$\", \"u\");\nexports.NAME_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"][\" + exports.NAME_CHAR + \"]*$\", \"u\");\nexports.NMTOKEN_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]+$\", \"u\");\nvar TAB = 9;\nvar NL = 0xA;\nvar CR = 0xD;\nvar SPACE = 0x20;\n//\n// Lists.\n//\n/** All characters in the ``S`` production. */\nexports.S_LIST = [SPACE, NL, CR, TAB];\n/**\n * Determines whether a codepoint matches the ``CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR``.\n */\nfunction isChar(c) {\n return c >= SPACE && c <= 0xD7FF || c === NL || c === CR || c === TAB || c >= 0xE000 && c <= 0xFFFD || c >= 0x10000 && c <= 0x10FFFF;\n}\nexports.isChar = isChar;\n/**\n * Determines whether a codepoint matches the ``S`` (space) production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``S``.\n */\nfunction isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}\nexports.isS = isS;\n/**\n * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.\n */\nfunction isNameStartChar(c) {\n return c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A || c === 0x3A || c === 0x5F || c === 0x200C || c === 0x200D || c >= 0xC0 && c <= 0xD6 || c >= 0xD8 && c <= 0xF6 || c >= 0x00F8 && c <= 0x02FF || c >= 0x0370 && c <= 0x037D || c >= 0x037F && c <= 0x1FFF || c >= 0x2070 && c <= 0x218F || c >= 0x2C00 && c <= 0x2FEF || c >= 0x3001 && c <= 0xD7FF || c >= 0xF900 && c <= 0xFDCF || c >= 0xFDF0 && c <= 0xFFFD || c >= 0x10000 && c <= 0xEFFFF;\n}\nexports.isNameStartChar = isNameStartChar;\n/**\n * Determines whether a codepoint matches the ``NAME_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_CHAR``.\n */\nfunction isNameChar(c) {\n return isNameStartChar(c) || c >= 0x30 && c <= 0x39 || c === 0x2D || c === 0x2E || c === 0xB7 || c >= 0x0300 && c <= 0x036F || c >= 0x203F && c <= 0x2040;\n}\nexports.isNameChar = isNameChar;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwiQ0hBUiIsIlMiLCJOQU1FX1NUQVJUX0NIQVIiLCJOQU1FX0NIQVIiLCJDSEFSX1JFIiwiUmVnRXhwIiwiU19SRSIsIk5BTUVfU1RBUlRfQ0hBUl9SRSIsIk5BTUVfQ0hBUl9SRSIsIk5BTUVfUkUiLCJOTVRPS0VOX1JFIiwiVEFCIiwiTkwiLCJDUiIsIlNQQUNFIiwiU19MSVNUIiwiaXNDaGFyIiwiYyIsImlzUyIsImlzTmFtZVN0YXJ0Q2hhciIsImlzTmFtZUNoYXIiXSwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMveG1sLzEuMC9lZDUudHMiXSwic291cmNlc0NvbnRlbnQiOltudWxsXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7Ozs7Ozs7QUFRQTtBQUNBO0FBQ0E7QUFDYUEsT0FBQSxDQUFBQyxJQUFJLEdBQUcsc0RBQXNEO0FBRTdERCxPQUFBLENBQUFFLENBQUMsR0FBRyxTQUFTO0FBRTFCO0FBQ2FGLE9BQUEsQ0FBQUcsZUFBZSxHQUFHLGlMQUEySztBQUU3TEgsT0FBQSxDQUFBSSxTQUFTL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sSUFBSUEsQ0FBQyxJQUFJLE1BQU8sSUFDM0JBLENBQUMsSUFBSSxNQUFNLElBQUlBLENBQUMsSUFBSSxNQUFPLElBQzNCQSxDQUFDLElBQUksTUFBTSxJQUFJQSxDQUFDLElBQUksTUFBTyxJQUMzQkEsQ0FBQyxJQUFJLE1BQU0sSUFBSUEsQ0FBQyxJQUFJLE1BQU8sSUFDM0JBLENBQUMsSUFBSSxNQUFNLElBQUlBLENBQUMsSUFBSSxNQUFPLElBQzNCQSxDQUFDLElBQUksTUFBTSxJQUFJQSxDQUFDLElBQUksTUFBTyxJQUMzQkEsQ0FBQyxJQUFJLE1BQU0sSUFBSUEsQ0FBQyxJQUFJLE1BQU8sSUFDM0JBLENBQUMsSUFBSSxNQUFNLElBQUlBLENBQUMsSUFBSSxNQUFPLElBQzNCQSxDQUFDLElBQUksT0FBTyxJQUFJQSxDQUFDLElBQUksT0FBUTtBQUN4QztBQWxCQWxCLE9BQUEsQ0FBQW9CLGVBQUEsR0FBQUEsZUFBQTtBQW9CQTs7Ozs7OztBQU9BLFNBQWdCQyxVQUFVQSxDQUFDSCxDQUFTO0VBQ2xDLE9BQU9FLGVBQWUsQ0FBQ0YsQ0FBQyxDQUFDLElBQ3RCQSxDQUFDLElBQUksSUFBSSxJQUFJQSxDQUFDLElBQUksSUFBSyxJQUN4QkEsQ0FBQyxLQUFLLElBQUksSUFDVkEsQ0FBQyxLQUFLLElBQUksSUFDVkEsQ0FBQyxLQUFLLElBQUksSUFDVEEsQ0FBQyxJQUFJLE1BQU0sSUFBSUEsQ0FBQyxJQUFJLE1BQU8sSUFDM0JBLENBQUMsSUFBSSxNQUFNLElBQUlBLENBQUMsSUFBSSxNQUFPO0FBQ2hDO0FBUkFsQixPQUFBLENBQUFxQixVQUFBLEdBQUFBLFVBQUEifQ==","\"use strict\";\n\n/**\n * Character classes and associated utilities for the 2nd edition of XML 1.1.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n//\n// Fragments.\n//\nexports.CHAR = \"\\u0001-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\";\nexports.RESTRICTED_CHAR = \"\\u0001-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F-\\u0084\\u0086-\\u009F\";\nexports.S = \" \\t\\r\\n\";\n// tslint:disable-next-line:max-line-length\nexports.NAME_START_CHAR = \":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NAME_CHAR = \"-\" + exports.NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.CHAR_RE = new RegExp(\"^[\" + exports.CHAR + \"]$\", \"u\");\nexports.RESTRICTED_CHAR_RE = new RegExp(\"^[\" + exports.RESTRICTED_CHAR + \"]$\", \"u\");\nexports.S_RE = new RegExp(\"^[\" + exports.S + \"]+$\", \"u\");\nexports.NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"]$\", \"u\");\nexports.NAME_CHAR_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]$\", \"u\");\nexports.NAME_RE = new RegExp(\"^[\" + exports.NAME_START_CHAR + \"][\" + exports.NAME_CHAR + \"]*$\", \"u\");\nexports.NMTOKEN_RE = new RegExp(\"^[\" + exports.NAME_CHAR + \"]+$\", \"u\");\nvar TAB = 9;\nvar NL = 0xA;\nvar CR = 0xD;\nvar SPACE = 0x20;\n//\n// Lists.\n//\n/** All characters in the ``S`` production. */\nexports.S_LIST = [SPACE, NL, CR, TAB];\n/**\n * Determines whether a codepoint matches the ``CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR``.\n */\nfunction isChar(c) {\n return c >= 0x0001 && c <= 0xD7FF || c >= 0xE000 && c <= 0xFFFD || c >= 0x10000 && c <= 0x10FFFF;\n}\nexports.isChar = isChar;\n/**\n * Determines whether a codepoint matches the ``RESTRICTED_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``RESTRICTED_CHAR``.\n */\nfunction isRestrictedChar(c) {\n return c >= 0x1 && c <= 0x8 || c === 0xB || c === 0xC || c >= 0xE && c <= 0x1F || c >= 0x7F && c <= 0x84 || c >= 0x86 && c <= 0x9F;\n}\nexports.isRestrictedChar = isRestrictedChar;\n/**\n * Determines whether a codepoint matches the ``CHAR`` production and does not\n * match the ``RESTRICTED_CHAR`` production. ``isCharAndNotRestricted(x)`` is\n * equivalent to ``isChar(x) && !isRestrictedChar(x)``. This function is faster\n * than running the two-call equivalent.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``CHAR`` and does not match\n * ``RESTRICTED_CHAR``.\n */\nfunction isCharAndNotRestricted(c) {\n return c === 0x9 || c === 0xA || c === 0xD || c > 0x1F && c < 0x7F || c === 0x85 || c > 0x9F && c <= 0xD7FF || c >= 0xE000 && c <= 0xFFFD || c >= 0x10000 && c <= 0x10FFFF;\n}\nexports.isCharAndNotRestricted = isCharAndNotRestricted;\n/**\n * Determines whether a codepoint matches the ``S`` (space) production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``S``.\n */\nfunction isS(c) {\n return c === SPACE || c === NL || c === CR || c === TAB;\n}\nexports.isS = isS;\n/**\n * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction isNameStartChar(c) {\n return c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A || c === 0x3A || c === 0x5F || c === 0x200C || c === 0x200D || c >= 0xC0 && c <= 0xD6 || c >= 0xD8 && c <= 0xF6 || c >= 0x00F8 && c <= 0x02FF || c >= 0x0370 && c <= 0x037D || c >= 0x037F && c <= 0x1FFF || c >= 0x2070 && c <= 0x218F || c >= 0x2C00 && c <= 0x2FEF || c >= 0x3001 && c <= 0xD7FF || c >= 0xF900 && c <= 0xFDCF || c >= 0xFDF0 && c <= 0xFFFD || c >= 0x10000 && c <= 0xEFFFF;\n}\nexports.isNameStartChar = isNameStartChar;\n/**\n * Determines whether a codepoint matches the ``NAME_CHAR`` production.\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches ``NAME_CHAR``.\n */\nfunction isNameChar(c) {\n return isNameStartChar(c) || c >= 0x30 && c <= 0x39 || c === 0x2D || c === 0x2E || c === 0xB7 || c >= 0x0300 && c <= 0x036F || c >= 0x203F && c <= 0x2040;\n}\nexports.isNameChar = isNameChar;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwiQ0hBUiIsIlJFU1RSSUNURURfQ0hBUiIsIlMiLCJOQU1FX1NUQVJUX0NIQVIiLCJOQU1FX0NIQVIiLCJDSEFSX1JFIiwiUmVnRXhwIiwiUkVTVFJJQ1RFRF9DSEFSX1JFIiwiU19SRSIsIk5BTUVfU1RBUlRfQ0hBUl9SRSIsIk5BTUVfQ0hBUl9SRSIsIk5BTUVfUkUiLCJOTVRPS0VOX1JFIiwiVEFCIiwiTkwiLCJDUiIsIlNQQUNFIiwiU19MSVNUIiwiaXNDaGFyIiwiYyIsImlzUmVzdHJpY3RlZENoYXIiLCJpc0NoYXJBbmROb3RSZXN0cmljdGVkIiwiaXNTIiwiaXNOYW1lU3RhcnRDaGFyIiwiaXNOYW1lQ2hhciJdLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy94bWwvMS4xL2VkMi50cyJdLCJzb3VyY2VzQ29udGVudCI6W251bGxd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cEIsT0FBQSxDQUFBeUIsVUFBQSxHQUFBQSxVQUFBIn0=","\"use strict\";\n\n/**\n * Character class utilities for XML NS 1.0 edition 3.\n *\n * @author Louis-Dominique Dubeau\n * @license MIT\n * @copyright Louis-Dominique Dubeau\n */\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n//\n// Fragments.\n//\n// tslint:disable-next-line:max-line-length\nexports.NC_NAME_START_CHAR = \"A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\uD800\\uDC00-\\uDB7F\\uDFFF\";\nexports.NC_NAME_CHAR = \"-\" + exports.NC_NAME_START_CHAR + \".0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040\";\n//\n// Regular expressions.\n//\nexports.NC_NAME_START_CHAR_RE = new RegExp(\"^[\" + exports.NC_NAME_START_CHAR + \"]$\", \"u\");\nexports.NC_NAME_CHAR_RE = new RegExp(\"^[\" + exports.NC_NAME_CHAR + \"]$\", \"u\");\nexports.NC_NAME_RE = new RegExp(\"^[\" + exports.NC_NAME_START_CHAR + \"][\" + exports.NC_NAME_CHAR + \"]*$\", \"u\");\n/**\n * Determines whether a codepoint matches [[NC_NAME_START_CHAR]].\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches.\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction isNCNameStartChar(c) {\n return c >= 0x41 && c <= 0x5A || c === 0x5F || c >= 0x61 && c <= 0x7A || c >= 0xC0 && c <= 0xD6 || c >= 0xD8 && c <= 0xF6 || c >= 0x00F8 && c <= 0x02FF || c >= 0x0370 && c <= 0x037D || c >= 0x037F && c <= 0x1FFF || c >= 0x200C && c <= 0x200D || c >= 0x2070 && c <= 0x218F || c >= 0x2C00 && c <= 0x2FEF || c >= 0x3001 && c <= 0xD7FF || c >= 0xF900 && c <= 0xFDCF || c >= 0xFDF0 && c <= 0xFFFD || c >= 0x10000 && c <= 0xEFFFF;\n}\nexports.isNCNameStartChar = isNCNameStartChar;\n/**\n * Determines whether a codepoint matches [[NC_NAME_CHAR]].\n *\n * @param c The code point.\n *\n * @returns ``true`` if the codepoint matches.\n */\nfunction isNCNameChar(c) {\n return isNCNameStartChar(c) || c === 0x2D || c === 0x2E || c >= 0x30 && c <= 0x39 || c === 0x00B7 || c >= 0x0300 && c <= 0x036F || c >= 0x203F && c <= 0x2040;\n}\nexports.isNCNameChar = isNCNameChar;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwiTkNfTkFNRV9TVEFSVF9DSEFSIiwiTkNfTkFNRV9DSEFSIiwiTkNfTkFNRV9TVEFSVF9DSEFSX1JFIiwiUmVnRXhwIiwiTkNfTkFNRV9DSEFSX1JFIiwiTkNfTkFNRV9SRSIsImlzTkNOYW1lU3RhcnRDaGFyIiwiYyIsImlzTkNOYW1lQ2hhciJdLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy94bWxucy8xLjAvZWQzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbbnVsbF0sIm1hcHBpbmdzIjoiOztBQUFBOzs7Ozs7Ozs7O0FBUUE7QUFDQTtBQUNBO0FBRUE7QUFDYUEsT0FBQSxDQUFBQyxrQkFBa0IsR0FBRyxpTEFBMks7QUFFaE1ELE9BQUEsQ0FBQUUsWUFBWSxHQUN2QixNQUFJRixPQUFBLENBQUFDLGtCQUFrQix5Q0FBc0M7QUFFOUQ7QUFDQTtBQUNBO0FBRWFELE9BQUEsQ0FBQUcscUJBQXFCLEdBQ2hDLElBQUlDLE1BQU0sQ0FBQyxPQUFLSixPQUFBLENBQUFDLGtCQUFrQixPQUFJLEVBQUUsR0FBRyxDQUFDO0FBRWpDRCxPQUFBLENBQUFLLGVBQWUsR0FBRyxJ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QU8sSUFDM0JBLENBQUMsSUFBSSxPQUFPLElBQUlBLENBQUMsSUFBSSxPQUFRO0FBQ3hDO0FBaEJBUixPQUFBLENBQUFPLGlCQUFBLEdBQUFBLGlCQUFBO0FBa0JBOzs7Ozs7O0FBT0EsU0FBZ0JFLFlBQVlBLENBQUNELENBQVM7RUFDcEMsT0FBT0QsaUJBQWlCLENBQUNDLENBQUMsQ0FBQyxJQUN4QkEsQ0FBQyxLQUFLLElBQUksSUFDVkEsQ0FBQyxLQUFLLElBQUksSUFDVEEsQ0FBQyxJQUFJLElBQUksSUFBSUEsQ0FBQyxJQUFJLElBQUssSUFDeEJBLENBQUMsS0FBSyxNQUFNLElBQ1hBLENBQUMsSUFBSSxNQUFNLElBQUlBLENBQUMsSUFBSSxNQUFPLElBQzNCQSxDQUFDLElBQUksTUFBTSxJQUFJQSxDQUFDLElBQUksTUFBUTtBQUNsQztBQVJBUixPQUFBLENBQUFTLFlBQUEsR0FBQUEsWUFBQSJ9","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BaseBuilder = /** @class */ (function () {\n function BaseBuilder() {\n }\n BaseBuilder.prototype.exportFile = function (dataType, fileName, data) {\n if (window.navigator.msSaveOrOpenBlob) {\n var blob = new Blob([data]);\n window.navigator.msSaveOrOpenBlob(blob, fileName);\n }\n else {\n var charBom = \"\\uFEFF\";\n var encodedData = encodeURIComponent(data);\n var content = \"data:text/\" + dataType + \";charset=utf-8,\" + charBom + encodedData;\n var link = document.createElement(\"a\");\n link.setAttribute(\"href\", content);\n link.setAttribute(\"download\", fileName);\n document.body.appendChild(link);\n link.click();\n }\n };\n return BaseBuilder;\n}());\nexports.default = BaseBuilder;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar BaseBuilder_1 = __importDefault(require(\"../core/BaseBuilder\"));\nvar CsvBuilder = /** @class */ (function (_super) {\n __extends(CsvBuilder, _super);\n function CsvBuilder(fileName) {\n var _this = _super.call(this) || this;\n _this._FileName = '';\n _this._Delimeter = ',';\n _this._Columns = [];\n _this._RowData = [];\n _this._FileName = fileName;\n return _this;\n }\n CsvBuilder.prototype.setColumns = function (columns) {\n this._Columns = columns;\n return this;\n };\n CsvBuilder.prototype.setDelimeter = function (delimeter) {\n this._Delimeter = delimeter;\n return this;\n };\n CsvBuilder.prototype.addRow = function (row) {\n this._RowData.push(row);\n return this;\n };\n CsvBuilder.prototype.addRows = function (rows) {\n this._RowData = this._RowData.concat(rows);\n return this;\n };\n CsvBuilder.prototype.escapeCell = function (cellData) {\n if (typeof cellData === 'string') {\n return '\"' + cellData.replace(/\\\"/g, '\"\"') + '\"';\n }\n return cellData;\n };\n CsvBuilder.prototype.getRowData = function (row) {\n return row.map(this.escapeCell).join(this._Delimeter);\n };\n CsvBuilder.prototype.exportFile = function () {\n var _this = this;\n var dataArray = [];\n if (this._Columns && this._Columns.length > 0) {\n dataArray.push(this.getRowData(this._Columns));\n }\n this._RowData.forEach(function (row) {\n dataArray.push(_this.getRowData(row));\n });\n var csvContent = dataArray.join(\"\\r\\n\");\n _super.prototype.exportFile.call(this, 'csv', this._FileName, csvContent);\n };\n return CsvBuilder;\n}(BaseBuilder_1.default));\nexports.default = CsvBuilder;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar CsvBuilder_1 = require(\"./csv-builder/CsvBuilder\");\nexports.CsvBuilder = CsvBuilder_1.default;\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/*!\n * \n * jsPDF AutoTable plugin v3.5.9\n * \n * Copyright (c) 2020 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n * \n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory((function webpackLoadOptionalExternalModule() { try { return require(\"jspdf\"); } catch(e) {} }()));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jspdf\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory((function webpackLoadOptionalExternalModule() { try { return require(\"jspdf\"); } catch(e) {} }())) : factory(root[\"jsPDF\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(typeof this !== 'undefined' ? this : window, function(__WEBPACK_EXTERNAL_MODULE__16__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 10);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseSpacing = exports.getFillStyle = exports.addTableBorder = exports.getStringWidth = void 0;\nfunction getStringWidth(text, styles, doc) {\n doc.applyStyles(styles, true);\n var textArr = Array.isArray(text) ? text : [text];\n var widestLineWidth = textArr\n .map(function (text) { return doc.getTextWidth(text); })\n .reduce(function (a, b) { return Math.max(a, b); }, 0);\n return widestLineWidth;\n}\nexports.getStringWidth = getStringWidth;\nfunction addTableBorder(doc, table, startPos, cursor) {\n var lineWidth = table.settings.tableLineWidth;\n var lineColor = table.settings.tableLineColor;\n doc.applyStyles({ lineWidth: lineWidth, lineColor: lineColor });\n var fillStyle = getFillStyle(lineWidth, false);\n if (fillStyle) {\n doc.rect(startPos.x, startPos.y, table.getWidth(doc.pageSize().width), cursor.y - startPos.y, fillStyle);\n }\n}\nexports.addTableBorder = addTableBorder;\nfunction getFillStyle(lineWidth, fillColor) {\n var drawLine = lineWidth > 0;\n var drawBackground = fillColor || fillColor === 0;\n if (drawLine && drawBackground) {\n return 'DF'; // Fill then stroke\n }\n else if (drawLine) {\n return 'S'; // Only stroke (transparent background)\n }\n else if (drawBackground) {\n return 'F'; // Only fill, no stroke\n }\n else {\n return null;\n }\n}\nexports.getFillStyle = getFillStyle;\nfunction parseSpacing(value, defaultValue) {\n var _a, _b, _c, _d;\n value = value || defaultValue;\n if (Array.isArray(value)) {\n if (value.length >= 4) {\n return {\n top: value[0],\n right: value[1],\n bottom: value[2],\n left: value[3],\n };\n }\n else if (value.length === 3) {\n return {\n top: value[0],\n right: value[1],\n bottom: value[2],\n left: value[1],\n };\n }\n else if (value.length === 2) {\n return {\n top: value[0],\n right: value[1],\n bottom: value[0],\n left: value[1],\n };\n }\n else if (value.length === 1) {\n value = value[0];\n }\n else {\n value = defaultValue;\n }\n }\n if (typeof value === 'object') {\n if (typeof value.vertical === 'number') {\n value.top = value.vertical;\n value.bottom = value.vertical;\n }\n if (typeof value.horizontal === 'number') {\n value.right = value.horizontal;\n value.left = value.horizontal;\n }\n return {\n left: (_a = value.left) !== null && _a !== void 0 ? _a : defaultValue,\n top: (_b = value.top) !== null && _b !== void 0 ? _b : defaultValue,\n right: (_c = value.right) !== null && _c !== void 0 ? _c : defaultValue,\n bottom: (_d = value.bottom) !== null && _d !== void 0 ? _d : defaultValue,\n };\n }\n if (typeof value !== 'number') {\n value = defaultValue;\n }\n return { top: value, right: value, bottom: value, left: value };\n}\nexports.parseSpacing = parseSpacing;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getTheme = exports.defaultStyles = exports.HtmlRowInput = exports.FONT_ROW_RATIO = void 0;\n/**\n * Ratio between font size and font height. The number comes from jspdf's source code\n */\nexports.FONT_ROW_RATIO = 1.15;\nvar HtmlRowInput = /** @class */ (function (_super) {\n __extends(HtmlRowInput, _super);\n function HtmlRowInput(element) {\n var _this = _super.call(this) || this;\n _this._element = element;\n return _this;\n }\n return HtmlRowInput;\n}(Array));\nexports.HtmlRowInput = HtmlRowInput;\n// Base style for all themes\nfunction defaultStyles(scaleFactor) {\n return {\n font: 'helvetica',\n fontStyle: 'normal',\n overflow: 'linebreak',\n fillColor: false,\n textColor: 20,\n halign: 'left',\n valign: 'top',\n fontSize: 10,\n cellPadding: 5 / scaleFactor,\n lineColor: 200,\n lineWidth: 0,\n cellWidth: 'auto',\n minCellHeight: 0,\n minCellWidth: 0,\n };\n}\nexports.defaultStyles = defaultStyles;\nfunction getTheme(name) {\n var themes = {\n striped: {\n table: { fillColor: 255, textColor: 80, fontStyle: 'normal' },\n head: { textColor: 255, fillColor: [41, 128, 185], fontStyle: 'bold' },\n body: {},\n foot: { textColor: 255, fillColor: [41, 128, 185], fontStyle: 'bold' },\n alternateRow: { fillColor: 245 },\n },\n grid: {\n table: {\n fillColor: 255,\n textColor: 80,\n fontStyle: 'normal',\n lineWidth: 0.1,\n },\n head: {\n textColor: 255,\n fillColor: [26, 188, 156],\n fontStyle: 'bold',\n lineWidth: 0,\n },\n body: {},\n foot: {\n textColor: 255,\n fillColor: [26, 188, 156],\n fontStyle: 'bold',\n lineWidth: 0,\n },\n alternateRow: {},\n },\n plain: {\n head: { fontStyle: 'bold' },\n foot: { fontStyle: 'bold' },\n },\n };\n return themes[name];\n}\nexports.getTheme = getTheme;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocHandler = void 0;\nvar globalDefaults = {};\nvar DocHandler = /** @class */ (function () {\n function DocHandler(jsPDFDocument) {\n this.jsPDFDocument = jsPDFDocument;\n this.userStyles = {\n // Black for versions of jspdf without getTextColor\n textColor: jsPDFDocument.getTextColor\n ? this.jsPDFDocument.getTextColor()\n : 0,\n fontSize: jsPDFDocument.internal.getFontSize(),\n fontStyle: jsPDFDocument.internal.getFont().fontStyle,\n font: jsPDFDocument.internal.getFont().fontName,\n };\n }\n DocHandler.setDefaults = function (defaults, doc) {\n if (doc === void 0) { doc = null; }\n if (doc) {\n doc.__autoTableDocumentDefaults = defaults;\n }\n else {\n globalDefaults = defaults;\n }\n };\n DocHandler.unifyColor = function (c) {\n if (Array.isArray(c)) {\n return c;\n }\n else if (typeof c === 'number') {\n return [c, c, c];\n }\n else if (typeof c === 'string') {\n return [c];\n }\n else {\n return null;\n }\n };\n DocHandler.prototype.applyStyles = function (styles, fontOnly) {\n // Font style needs to be applied before font\n // https://github.com/simonbengtsson/jsPDF-AutoTable/issues/632\n var _a, _b, _c;\n if (fontOnly === void 0) { fontOnly = false; }\n if (styles.fontStyle)\n this.jsPDFDocument.setFontStyle && this.jsPDFDocument.setFontStyle(styles.fontStyle);\n if (styles.font) {\n var available = this.getFontList()[styles.font];\n var fontStyle = styles.fontStyle;\n if (available && fontStyle && available.indexOf(fontStyle) === -1) {\n // Common issue for uses with was that the default bold in headers\n // made custom fonts not work. For example:\n // https://github.com/simonbengtsson/jsPDF-AutoTable/issues/653\n this.jsPDFDocument.setFontStyle(available[0]);\n }\n this.jsPDFDocument.setFont(styles.font, styles.fontStyle);\n }\n if (styles.fontSize)\n this.jsPDFDocument.setFontSize(styles.fontSize);\n if (fontOnly) {\n return; // Performance improvement\n }\n var color = DocHandler.unifyColor(styles.fillColor);\n if (color)\n (_a = this.jsPDFDocument).setFillColor.apply(_a, color);\n color = DocHandler.unifyColor(styles.textColor);\n if (color)\n (_b = this.jsPDFDocument).setTextColor.apply(_b, color);\n color = DocHandler.unifyColor(styles.lineColor);\n if (color)\n (_c = this.jsPDFDocument).setDrawColor.apply(_c, color);\n if (typeof styles.lineWidth === 'number') {\n this.jsPDFDocument.setLineWidth(styles.lineWidth);\n }\n };\n DocHandler.prototype.splitTextToSize = function (text, size, opts) {\n return this.jsPDFDocument.splitTextToSize(text, size, opts);\n };\n DocHandler.prototype.rect = function (x, y, width, height, fillStyle) {\n return this.jsPDFDocument.rect(x, y, width, height, fillStyle);\n };\n DocHandler.prototype.getLastAutoTable = function () {\n return this.jsPDFDocument.lastAutoTable || null;\n };\n DocHandler.prototype.getTextWidth = function (text) {\n return this.jsPDFDocument.getTextWidth(text);\n };\n DocHandler.prototype.getDocument = function () {\n return this.jsPDFDocument;\n };\n DocHandler.prototype.setPage = function (page) {\n this.jsPDFDocument.setPage(page);\n };\n DocHandler.prototype.addPage = function () {\n return this.jsPDFDocument.addPage();\n };\n DocHandler.prototype.getFontList = function () {\n return this.jsPDFDocument.getFontList();\n };\n DocHandler.prototype.getGlobalOptions = function () {\n return globalDefaults || {};\n };\n DocHandler.prototype.getDocumentOptions = function () {\n return this.jsPDFDocument.__autoTableDocumentDefaults || {};\n };\n DocHandler.prototype.pageSize = function () {\n var pageSize = this.jsPDFDocument.internal.pageSize;\n // JSPDF 1.4 uses get functions instead of properties on pageSize\n if (pageSize.width == null) {\n pageSize = {\n width: pageSize.getWidth(),\n height: pageSize.getHeight(),\n };\n }\n return pageSize;\n };\n DocHandler.prototype.scaleFactor = function () {\n return this.jsPDFDocument.internal.scaleFactor;\n };\n DocHandler.prototype.pageNumber = function () {\n var pageInfo = this.jsPDFDocument.internal.getCurrentPageInfo();\n if (!pageInfo) {\n // Only recent versions of jspdf has pageInfo\n return this.jsPDFDocument.internal.getNumberOfPages();\n }\n return pageInfo.pageNumber;\n };\n return DocHandler;\n}());\nexports.DocHandler = DocHandler;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assign = void 0;\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\nfunction assign(target, s, s1, s2, s3) {\n if (target == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n var to = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n // eslint-disable-next-line prefer-rest-params\n var nextSource = arguments[index];\n if (nextSource != null) {\n // Skip over if undefined or null\n for (var nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n}\nexports.assign = assign;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseHtml = void 0;\nvar cssParser_1 = __webpack_require__(12);\nvar config_1 = __webpack_require__(1);\nfunction parseHtml(doc, input, window, includeHiddenHtml, useCss) {\n var _a, _b;\n if (includeHiddenHtml === void 0) { includeHiddenHtml = false; }\n if (useCss === void 0) { useCss = false; }\n var tableElement;\n if (typeof input === 'string') {\n tableElement = window.document.querySelector(input);\n }\n else {\n tableElement = input;\n }\n var supportedFonts = Object.keys(doc.getFontList());\n var scaleFactor = doc.scaleFactor();\n var head = [], body = [], foot = [];\n if (!tableElement) {\n console.error('Html table could not be found with input: ', input);\n return { head: head, body: body, foot: foot };\n }\n for (var i = 0; i < tableElement.rows.length; i++) {\n var element = tableElement.rows[i];\n var tagName = (_b = (_a = element === null || element === void 0 ? void 0 : element.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === null || _b === void 0 ? void 0 : _b.toLowerCase();\n var row = parseRowContent(supportedFonts, scaleFactor, window, element, includeHiddenHtml, useCss);\n if (!row)\n continue;\n if (tagName === 'thead') {\n head.push(row);\n }\n else if (tagName === 'tfoot') {\n foot.push(row);\n }\n else {\n // Add to body both if parent is tbody or table\n body.push(row);\n }\n }\n return { head: head, body: body, foot: foot };\n}\nexports.parseHtml = parseHtml;\nfunction parseRowContent(supportedFonts, scaleFactor, window, row, includeHidden, useCss) {\n var resultRow = new config_1.HtmlRowInput(row);\n for (var i = 0; i < row.cells.length; i++) {\n var cell = row.cells[i];\n var style_1 = window.getComputedStyle(cell);\n if (includeHidden || style_1.display !== 'none') {\n var cellStyles = void 0;\n if (useCss) {\n cellStyles = cssParser_1.parseCss(supportedFonts, cell, scaleFactor, style_1, window);\n }\n resultRow.push({\n rowSpan: cell.rowSpan,\n colSpan: cell.colSpan,\n styles: cellStyles,\n _element: cell,\n content: parseCellContent(cell),\n });\n }\n }\n var style = window.getComputedStyle(row);\n if (resultRow.length > 0 && (includeHidden || style.display !== 'none')) {\n return resultRow;\n }\n}\nfunction parseCellContent(orgCell) {\n // Work on cloned node to make sure no changes are applied to html table\n var cell = orgCell.cloneNode(true);\n // Remove extra space and line breaks in markup to make it more similar to\n // what would be shown in html\n cell.innerHTML = cell.innerHTML.replace(/\\n/g, '').replace(/ +/g, ' ');\n // Preserve
tags as line breaks in the pdf\n cell.innerHTML = cell.innerHTML\n .split('
')\n .map(function (part) { return part.trim(); })\n .join('\\n');\n // innerText for ie\n return cell.innerText || cell.textContent || '';\n}\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Improved text function with halign and valign support\n * Inspiration from: http://stackoverflow.com/questions/28327510/align-text-right-using-jspdf/28433113#28433113\n */\nfunction default_1(text, x, y, styles, doc) {\n styles = styles || {};\n var FONT_ROW_RATIO = 1.15;\n var k = doc.internal.scaleFactor;\n var fontSize = doc.internal.getFontSize() / k;\n var splitRegex = /\\r\\n|\\r|\\n/g;\n var splitText = '';\n var lineCount = 1;\n if (styles.valign === 'middle' ||\n styles.valign === 'bottom' ||\n styles.halign === 'center' ||\n styles.halign === 'right') {\n splitText = typeof text === 'string' ? text.split(splitRegex) : text;\n lineCount = splitText.length || 1;\n }\n // Align the top\n y += fontSize * (2 - FONT_ROW_RATIO);\n if (styles.valign === 'middle')\n y -= (lineCount / 2) * fontSize * FONT_ROW_RATIO;\n else if (styles.valign === 'bottom')\n y -= lineCount * fontSize * FONT_ROW_RATIO;\n if (styles.halign === 'center' || styles.halign === 'right') {\n var alignSize = fontSize;\n if (styles.halign === 'center')\n alignSize *= 0.5;\n if (splitText && lineCount >= 1) {\n for (var iLine = 0; iLine < splitText.length; iLine++) {\n doc.text(splitText[iLine], x - doc.getStringUnitWidth(splitText[iLine]) * alignSize, y);\n y += fontSize * FONT_ROW_RATIO;\n }\n return doc;\n }\n x -= doc.getStringUnitWidth(text) * alignSize;\n }\n if (styles.halign === 'justify') {\n doc.text(text, x, y, {\n maxWidth: styles.maxWidth || 100,\n align: 'justify',\n });\n }\n else {\n doc.text(text, x, y);\n }\n return doc;\n}\nexports.default = default_1;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseInput = void 0;\nvar htmlParser_1 = __webpack_require__(4);\nvar polyfills_1 = __webpack_require__(3);\nvar common_1 = __webpack_require__(0);\nvar documentHandler_1 = __webpack_require__(2);\nvar inputValidator_1 = __webpack_require__(13);\nfunction parseInput(d, current) {\n var doc = new documentHandler_1.DocHandler(d);\n var document = doc.getDocumentOptions();\n var global = doc.getGlobalOptions();\n inputValidator_1.default(doc, global, document, current);\n var options = polyfills_1.assign({}, global, document, current);\n var win;\n if (typeof window !== 'undefined') {\n win = window;\n }\n var styles = parseStyles(global, document, current);\n var hooks = parseHooks(global, document, current);\n var settings = parseSettings(doc, options);\n var content = parseContent(doc, options, win);\n return {\n id: current.tableId,\n content: content,\n hooks: hooks,\n styles: styles,\n settings: settings,\n };\n}\nexports.parseInput = parseInput;\nfunction parseStyles(gInput, dInput, cInput) {\n var styleOptions = {\n styles: {},\n headStyles: {},\n bodyStyles: {},\n footStyles: {},\n alternateRowStyles: {},\n columnStyles: {},\n };\n var _loop_1 = function (prop) {\n if (prop === 'columnStyles') {\n var global_1 = gInput[prop];\n var document_1 = dInput[prop];\n var current = cInput[prop];\n styleOptions.columnStyles = polyfills_1.assign({}, global_1, document_1, current);\n }\n else {\n var allOptions = [gInput, dInput, cInput];\n var styles = allOptions.map(function (opts) { return opts[prop] || {}; });\n styleOptions[prop] = polyfills_1.assign({}, styles[0], styles[1], styles[2]);\n }\n };\n for (var _i = 0, _a = Object.keys(styleOptions); _i < _a.length; _i++) {\n var prop = _a[_i];\n _loop_1(prop);\n }\n return styleOptions;\n}\nfunction parseHooks(global, document, current) {\n var allOptions = [global, document, current];\n var result = {\n didParseCell: [],\n willDrawCell: [],\n didDrawCell: [],\n didDrawPage: [],\n };\n for (var _i = 0, allOptions_1 = allOptions; _i < allOptions_1.length; _i++) {\n var options = allOptions_1[_i];\n if (options.didParseCell)\n result.didParseCell.push(options.didParseCell);\n if (options.willDrawCell)\n result.willDrawCell.push(options.willDrawCell);\n if (options.didDrawCell)\n result.didDrawCell.push(options.didDrawCell);\n if (options.didDrawPage)\n result.didDrawPage.push(options.didDrawPage);\n }\n return result;\n}\nfunction parseSettings(doc, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n var margin = common_1.parseSpacing(options.margin, 40 / doc.scaleFactor());\n var startY = (_a = getStartY(doc, options.startY)) !== null && _a !== void 0 ? _a : margin.top;\n var showFoot;\n if (options.showFoot === true) {\n showFoot = 'everyPage';\n }\n else if (options.showFoot === false) {\n showFoot = 'never';\n }\n else {\n showFoot = (_b = options.showFoot) !== null && _b !== void 0 ? _b : 'everyPage';\n }\n var showHead;\n if (options.showHead === true) {\n showHead = 'everyPage';\n }\n else if (options.showHead === false) {\n showHead = 'never';\n }\n else {\n showHead = (_c = options.showHead) !== null && _c !== void 0 ? _c : 'everyPage';\n }\n var useCss = (_d = options.useCss) !== null && _d !== void 0 ? _d : false;\n var theme = options.theme || (useCss ? 'plain' : 'striped');\n return {\n includeHiddenHtml: (_e = options.includeHiddenHtml) !== null && _e !== void 0 ? _e : false,\n useCss: useCss,\n theme: theme,\n startY: startY,\n margin: margin,\n pageBreak: (_f = options.pageBreak) !== null && _f !== void 0 ? _f : 'auto',\n rowPageBreak: (_g = options.rowPageBreak) !== null && _g !== void 0 ? _g : 'auto',\n tableWidth: (_h = options.tableWidth) !== null && _h !== void 0 ? _h : 'auto',\n showHead: showHead,\n showFoot: showFoot,\n tableLineWidth: (_j = options.tableLineWidth) !== null && _j !== void 0 ? _j : 0,\n tableLineColor: (_k = options.tableLineColor) !== null && _k !== void 0 ? _k : 200,\n };\n}\nfunction getStartY(doc, userStartY) {\n var previous = doc.getLastAutoTable();\n var sf = doc.scaleFactor();\n var currentPage = doc.pageNumber();\n var isSamePageAsPreviousTable = false;\n if (previous && previous.startPageNumber) {\n var endingPage = previous.startPageNumber + previous.pageNumber - 1;\n isSamePageAsPreviousTable = endingPage === currentPage;\n }\n if (typeof userStartY === 'number') {\n return userStartY;\n }\n else if (userStartY == null || userStartY === false) {\n if (isSamePageAsPreviousTable && (previous === null || previous === void 0 ? void 0 : previous.finalY) != null) {\n // Some users had issues with overlapping tables when they used multiple\n // tables without setting startY so setting it here to a sensible default.\n return previous.finalY + 20 / sf;\n }\n }\n return null;\n}\nfunction parseContent(doc, options, window) {\n var head = options.head || [];\n var body = options.body || [];\n var foot = options.foot || [];\n if (options.html) {\n var hidden = options.includeHiddenHtml;\n if (window) {\n var htmlContent = htmlParser_1.parseHtml(doc, options.html, window, hidden, options.useCss) || {};\n head = htmlContent.head || head;\n body = htmlContent.body || head;\n foot = htmlContent.foot || head;\n }\n else {\n console.error('Cannot parse html in non browser environment');\n }\n }\n var columns = options.columns || parseColumns(head, body, foot);\n return {\n columns: columns,\n head: head,\n body: body,\n foot: foot,\n };\n}\nfunction parseColumns(head, body, foot) {\n var firstRow = head[0] || body[0] || foot[0] || [];\n var result = [];\n Object.keys(firstRow)\n .filter(function (key) { return key !== '_element'; })\n .forEach(function (key) {\n var colSpan = 1;\n var input;\n if (Array.isArray(firstRow)) {\n input = firstRow[parseInt(key)];\n }\n else {\n input = firstRow[key];\n }\n if (typeof input === 'object' && !Array.isArray(input)) {\n colSpan = (input === null || input === void 0 ? void 0 : input.colSpan) || 1;\n }\n for (var i = 0; i < colSpan; i++) {\n var id = void 0;\n if (Array.isArray(firstRow)) {\n id = result.length;\n }\n else {\n id = key + (i > 0 ? \"_\" + i : '');\n }\n var rowResult = { dataKey: id };\n result.push(rowResult);\n }\n });\n return result;\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addPage = exports.drawTable = void 0;\nvar config_1 = __webpack_require__(1);\nvar common_1 = __webpack_require__(0);\nvar models_1 = __webpack_require__(8);\nvar documentHandler_1 = __webpack_require__(2);\nvar polyfills_1 = __webpack_require__(3);\nvar autoTableText_1 = __webpack_require__(5);\nfunction drawTable(jsPDFDoc, table) {\n var settings = table.settings;\n var startY = settings.startY;\n var margin = settings.margin;\n var cursor = {\n x: margin.left,\n y: startY,\n };\n var sectionsHeight = table.getHeadHeight(table.columns) + table.getFootHeight(table.columns);\n var minTableBottomPos = startY + margin.bottom + sectionsHeight;\n if (settings.pageBreak === 'avoid') {\n var rows = table.allRows();\n var tableHeight = rows.reduce(function (acc, row) { return acc + row.height; }, 0);\n minTableBottomPos += tableHeight;\n }\n var doc = new documentHandler_1.DocHandler(jsPDFDoc);\n if (settings.pageBreak === 'always' ||\n (settings.startY != null && minTableBottomPos > doc.pageSize().height)) {\n nextPage(doc);\n cursor.y = margin.top;\n }\n var startPos = polyfills_1.assign({}, cursor);\n table.startPageNumber = doc.pageNumber();\n doc.applyStyles(doc.userStyles);\n if (settings.showHead === 'firstPage' || settings.showHead === 'everyPage') {\n table.head.forEach(function (row) { return printRow(doc, table, row, cursor); });\n }\n doc.applyStyles(doc.userStyles);\n table.body.forEach(function (row, index) {\n var isLastRow = index === table.body.length - 1;\n printFullRow(doc, table, row, isLastRow, startPos, cursor);\n });\n doc.applyStyles(doc.userStyles);\n if (settings.showFoot === 'lastPage' || settings.showFoot === 'everyPage') {\n table.foot.forEach(function (row) { return printRow(doc, table, row, cursor); });\n }\n common_1.addTableBorder(doc, table, startPos, cursor);\n table.callEndPageHooks(doc, cursor);\n table.finalY = cursor.y;\n jsPDFDoc.lastAutoTable = table;\n jsPDFDoc.previousAutoTable = table; // Deprecated\n if (jsPDFDoc.autoTable)\n jsPDFDoc.autoTable.previous = table; // Deprecated\n doc.applyStyles(doc.userStyles);\n}\nexports.drawTable = drawTable;\nfunction getRemainingLineCount(cell, remainingPageSpace, doc) {\n var fontHeight = (cell.styles.fontSize / doc.scaleFactor()) * config_1.FONT_ROW_RATIO;\n var vPadding = cell.padding('vertical');\n var remainingLines = Math.floor((remainingPageSpace - vPadding) / fontHeight);\n return Math.max(0, remainingLines);\n}\nfunction modifyRowToFit(row, remainingPageSpace, table, doc) {\n var cells = {};\n row.spansMultiplePages = true;\n var rowHeight = 0;\n for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {\n var column = _a[_i];\n var cell = row.cells[column.index];\n if (!cell)\n continue;\n if (!Array.isArray(cell.text)) {\n cell.text = [cell.text];\n }\n var remainderCell = new models_1.Cell(cell.raw, cell.styles, cell.section);\n remainderCell = polyfills_1.assign(remainderCell, cell);\n remainderCell.text = [];\n var remainingLineCount = getRemainingLineCount(cell, remainingPageSpace, doc);\n if (cell.text.length > remainingLineCount) {\n remainderCell.text = cell.text.splice(remainingLineCount, cell.text.length);\n }\n var scaleFactor = doc.scaleFactor();\n cell.contentHeight = cell.getContentHeight(scaleFactor);\n if (cell.contentHeight >= remainingPageSpace) {\n cell.contentHeight = remainingPageSpace;\n remainderCell.styles.minCellHeight -= remainingPageSpace;\n }\n if (cell.contentHeight > row.height) {\n row.height = cell.contentHeight;\n }\n remainderCell.contentHeight = remainderCell.getContentHeight(scaleFactor);\n if (remainderCell.contentHeight > rowHeight) {\n rowHeight = remainderCell.contentHeight;\n }\n cells[column.index] = remainderCell;\n }\n var remainderRow = new models_1.Row(row.raw, -1, row.section, cells, true);\n remainderRow.height = rowHeight;\n for (var _b = 0, _c = table.columns; _b < _c.length; _b++) {\n var column = _c[_b];\n var remainderCell = remainderRow.cells[column.index];\n if (remainderCell) {\n remainderCell.height = remainderRow.height;\n }\n var cell = row.cells[column.index];\n if (cell) {\n cell.height = row.height;\n }\n }\n return remainderRow;\n}\nfunction shouldPrintOnCurrentPage(doc, row, remainingPageSpace, table) {\n var pageHeight = doc.pageSize().height;\n var margin = table.settings.margin;\n var marginHeight = margin.top + margin.bottom;\n var maxRowHeight = pageHeight - marginHeight;\n if (row.section === 'body') {\n // Should also take into account that head and foot is not\n // on every page with some settings\n maxRowHeight -=\n table.getHeadHeight(table.columns) + table.getFootHeight(table.columns);\n }\n var minRowHeight = row.getMinimumRowHeight(table.columns, doc);\n var minRowFits = minRowHeight < remainingPageSpace;\n if (minRowHeight > maxRowHeight) {\n console.error(\"Will not be able to print row \" + row.index + \" correctly since it's minimum height is larger than page height\");\n return true;\n }\n if (!minRowFits) {\n return false;\n }\n var rowHasRowSpanCell = row.hasRowSpan(table.columns);\n var rowHigherThanPage = row.getMaxCellHeight(table.columns) > maxRowHeight;\n if (rowHigherThanPage) {\n if (rowHasRowSpanCell) {\n console.error(\"The content of row \" + row.index + \" will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.\");\n }\n return true;\n }\n if (rowHasRowSpanCell) {\n // Currently a new page is required whenever a rowspan row don't fit a page.\n return false;\n }\n if (table.settings.rowPageBreak === 'avoid') {\n return false;\n }\n // In all other cases print the row on current page\n return true;\n}\nfunction printFullRow(doc, table, row, isLastRow, startPos, cursor) {\n var remainingSpace = getRemainingPageSpace(doc, table, isLastRow, cursor);\n if (row.canEntireRowFit(remainingSpace, table.columns)) {\n printRow(doc, table, row, cursor);\n }\n else {\n if (shouldPrintOnCurrentPage(doc, row, remainingSpace, table)) {\n var remainderRow = modifyRowToFit(row, remainingSpace, table, doc);\n printRow(doc, table, row, cursor);\n addPage(doc, table, startPos, cursor);\n printFullRow(doc, table, remainderRow, isLastRow, startPos, cursor);\n }\n else {\n addPage(doc, table, startPos, cursor);\n printFullRow(doc, table, row, isLastRow, startPos, cursor);\n }\n }\n}\nfunction printRow(doc, table, row, cursor) {\n cursor.x = table.settings.margin.left;\n for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {\n var column = _a[_i];\n var cell = row.cells[column.index];\n if (!cell) {\n cursor.x += column.width;\n continue;\n }\n doc.applyStyles(cell.styles);\n cell.x = cursor.x;\n cell.y = cursor.y;\n var result = table.callCellHooks(doc, table.hooks.willDrawCell, cell, row, column, cursor);\n if (result === false) {\n cursor.x += column.width;\n continue;\n }\n var cellStyles = cell.styles;\n var fillStyle = common_1.getFillStyle(cellStyles.lineWidth, cellStyles.fillColor);\n if (fillStyle) {\n doc.rect(cell.x, cursor.y, cell.width, cell.height, fillStyle);\n }\n var textPos = cell.getTextPos();\n autoTableText_1.default(cell.text, textPos.x, textPos.y, {\n halign: cell.styles.halign,\n valign: cell.styles.valign,\n maxWidth: Math.ceil(cell.width - cell.padding('left') - cell.padding('right')),\n }, doc.getDocument());\n table.callCellHooks(doc, table.hooks.didDrawCell, cell, row, column, cursor);\n cursor.x += column.width;\n }\n cursor.y += row.height;\n}\nfunction getRemainingPageSpace(doc, table, isLastRow, cursor) {\n var bottomContentHeight = table.settings.margin.bottom;\n var showFoot = table.settings.showFoot;\n if (showFoot === 'everyPage' || (showFoot === 'lastPage' && isLastRow)) {\n bottomContentHeight += table.getFootHeight(table.columns);\n }\n return doc.pageSize().height - cursor.y - bottomContentHeight;\n}\nfunction addPage(doc, table, startPos, cursor) {\n doc.applyStyles(doc.userStyles);\n if (table.settings.showFoot === 'everyPage') {\n table.foot.forEach(function (row) { return printRow(doc, table, row, cursor); });\n }\n // Add user content just before adding new page ensure it will\n // be drawn above other things on the page\n table.callEndPageHooks(doc, cursor);\n var margin = table.settings.margin;\n common_1.addTableBorder(doc, table, startPos, cursor);\n nextPage(doc);\n table.pageNumber++;\n table.pageCount++;\n cursor.x = margin.left;\n cursor.y = margin.top;\n if (table.settings.showHead === 'everyPage') {\n table.head.forEach(function (row) { return printRow(doc, table, row, cursor); });\n }\n}\nexports.addPage = addPage;\nfunction nextPage(doc) {\n var current = doc.pageNumber();\n doc.setPage(current + 1);\n var newCurrent = doc.pageNumber();\n if (newCurrent === current) {\n doc.addPage();\n }\n}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Column = exports.Cell = exports.Row = exports.Table = void 0;\nvar config_1 = __webpack_require__(1);\nvar HookData_1 = __webpack_require__(14);\nvar common_1 = __webpack_require__(0);\nvar Table = /** @class */ (function () {\n function Table(input, content) {\n this.pageNumber = 1;\n // Deprecated, use pageNumber instead\n // Not using getter since:\n // https://github.com/simonbengtsson/jsPDF-AutoTable/issues/596\n this.pageCount = 1;\n this.id = input.id;\n this.settings = input.settings;\n this.styles = input.styles;\n this.hooks = input.hooks;\n this.columns = content.columns;\n this.head = content.head;\n this.body = content.body;\n this.foot = content.foot;\n }\n Table.prototype.getHeadHeight = function (columns) {\n return this.head.reduce(function (acc, row) { return acc + row.getMaxCellHeight(columns); }, 0);\n };\n Table.prototype.getFootHeight = function (columns) {\n return this.foot.reduce(function (acc, row) { return acc + row.getMaxCellHeight(columns); }, 0);\n };\n Table.prototype.allRows = function () {\n return this.head.concat(this.body).concat(this.foot);\n };\n Table.prototype.callCellHooks = function (doc, handlers, cell, row, column, cursor) {\n for (var _i = 0, handlers_1 = handlers; _i < handlers_1.length; _i++) {\n var handler = handlers_1[_i];\n var data = new HookData_1.CellHookData(doc, this, cell, row, column, cursor);\n var result = handler(data) === false;\n // Make sure text is always string[] since user can assign string\n cell.text = Array.isArray(cell.text) ? cell.text : [cell.text];\n if (result) {\n return false;\n }\n }\n return true;\n };\n Table.prototype.callEndPageHooks = function (doc, cursor) {\n doc.applyStyles(doc.userStyles);\n for (var _i = 0, _a = this.hooks.didDrawPage; _i < _a.length; _i++) {\n var handler = _a[_i];\n handler(new HookData_1.HookData(doc, this, cursor));\n }\n };\n Table.prototype.getWidth = function (pageWidth) {\n if (typeof this.settings.tableWidth === 'number') {\n return this.settings.tableWidth;\n }\n else if (this.settings.tableWidth === 'wrap') {\n var wrappedWidth = this.columns.reduce(function (total, col) { return total + col.wrappedWidth; }, 0);\n return wrappedWidth;\n }\n else {\n var margin = this.settings.margin;\n return pageWidth - margin.left - margin.right;\n }\n };\n return Table;\n}());\nexports.Table = Table;\nvar Row = /** @class */ (function () {\n function Row(raw, index, section, cells, spansMultiplePages) {\n if (spansMultiplePages === void 0) { spansMultiplePages = false; }\n this.height = 0;\n this.raw = raw;\n if (raw instanceof config_1.HtmlRowInput) {\n this.raw = raw._element;\n this.element = raw._element;\n }\n this.index = index;\n this.section = section;\n this.cells = cells;\n this.spansMultiplePages = spansMultiplePages;\n }\n Row.prototype.getMaxCellHeight = function (columns) {\n var _this = this;\n return columns.reduce(function (acc, column) { var _a; return Math.max(acc, ((_a = _this.cells[column.index]) === null || _a === void 0 ? void 0 : _a.height) || 0); }, 0);\n };\n Row.prototype.hasRowSpan = function (columns) {\n var _this = this;\n return (columns.filter(function (column) {\n var cell = _this.cells[column.index];\n if (!cell)\n return false;\n return cell.rowSpan > 1;\n }).length > 0);\n };\n Row.prototype.canEntireRowFit = function (height, columns) {\n return this.getMaxCellHeight(columns) <= height;\n };\n Row.prototype.getMinimumRowHeight = function (columns, doc) {\n var _this = this;\n return columns.reduce(function (acc, column) {\n var cell = _this.cells[column.index];\n if (!cell)\n return 0;\n var fontHeight = (cell.styles.fontSize / doc.scaleFactor()) * config_1.FONT_ROW_RATIO;\n var vPadding = cell.padding('vertical');\n var oneRowHeight = vPadding + fontHeight;\n return oneRowHeight > acc ? oneRowHeight : acc;\n }, 0);\n };\n return Row;\n}());\nexports.Row = Row;\nvar Cell = /** @class */ (function () {\n function Cell(raw, styles, section) {\n var _a, _b;\n this.contentHeight = 0;\n this.contentWidth = 0;\n this.wrappedWidth = 0;\n this.minReadableWidth = 0;\n this.minWidth = 0;\n this.width = 0;\n this.height = 0;\n this.x = 0;\n this.y = 0;\n this.styles = styles;\n this.section = section;\n this.raw = raw;\n var content = raw;\n if (raw != null && typeof raw === 'object' && !Array.isArray(raw)) {\n this.rowSpan = raw.rowSpan || 1;\n this.colSpan = raw.colSpan || 1;\n content = (_b = (_a = raw.content) !== null && _a !== void 0 ? _a : raw.title) !== null && _b !== void 0 ? _b : raw;\n if (raw._element) {\n this.raw = raw._element;\n }\n }\n else {\n this.rowSpan = 1;\n this.colSpan = 1;\n }\n // Stringify 0 and false, but not undefined or null\n var text = content != null ? '' + content : '';\n var splitRegex = /\\r\\n|\\r|\\n/g;\n this.text = text.split(splitRegex);\n }\n Cell.prototype.getTextPos = function () {\n var y;\n if (this.styles.valign === 'top') {\n y = this.y + this.padding('top');\n }\n else if (this.styles.valign === 'bottom') {\n y = this.y + this.height - this.padding('bottom');\n }\n else {\n var netHeight = this.height - this.padding('vertical');\n y = this.y + netHeight / 2 + this.padding('top');\n }\n var x;\n if (this.styles.halign === 'right') {\n x = this.x + this.width - this.padding('right');\n }\n else if (this.styles.halign === 'center') {\n var netWidth = this.width - this.padding('horizontal');\n x = this.x + netWidth / 2 + this.padding('left');\n }\n else {\n x = this.x + this.padding('left');\n }\n return { x: x, y: y };\n };\n Cell.prototype.getContentHeight = function (scaleFactor) {\n var lineCount = Array.isArray(this.text) ? this.text.length : 1;\n var fontHeight = (this.styles.fontSize / scaleFactor) * config_1.FONT_ROW_RATIO;\n var height = lineCount * fontHeight + this.padding('vertical');\n return Math.max(height, this.styles.minCellHeight);\n };\n Cell.prototype.padding = function (name) {\n var padding = common_1.parseSpacing(this.styles.cellPadding, 0);\n if (name === 'vertical') {\n return padding.top + padding.bottom;\n }\n else if (name === 'horizontal') {\n return padding.left + padding.right;\n }\n else {\n return padding[name];\n }\n };\n return Cell;\n}());\nexports.Cell = Cell;\nvar Column = /** @class */ (function () {\n function Column(dataKey, raw, index) {\n this.wrappedWidth = 0;\n this.minReadableWidth = 0;\n this.minWidth = 0;\n this.width = 0;\n this.dataKey = dataKey;\n this.raw = raw;\n this.index = index;\n }\n Column.prototype.getMaxCustomCellWidth = function (table) {\n var max = 0;\n for (var _i = 0, _a = table.allRows(); _i < _a.length; _i++) {\n var row = _a[_i];\n var cell = row.cells[this.index];\n if (cell && typeof cell.styles.cellWidth === 'number') {\n max = Math.max(max, cell.styles.cellWidth);\n }\n }\n return max;\n };\n return Column;\n}());\nexports.Column = Column;\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTable = void 0;\nvar documentHandler_1 = __webpack_require__(2);\nvar models_1 = __webpack_require__(8);\nvar widthCalculator_1 = __webpack_require__(15);\nvar config_1 = __webpack_require__(1);\nvar polyfills_1 = __webpack_require__(3);\nfunction createTable(jsPDFDoc, input) {\n var doc = new documentHandler_1.DocHandler(jsPDFDoc);\n var content = parseContent(input, doc.scaleFactor());\n var table = new models_1.Table(input, content);\n widthCalculator_1.calculateWidths(doc, table);\n doc.applyStyles(doc.userStyles);\n return table;\n}\nexports.createTable = createTable;\nfunction parseContent(input, sf) {\n var content = input.content;\n var columns = createColumns(content.columns);\n // If no head or foot is set, try generating it with content from columns\n if (content.head.length === 0) {\n var sectionRow = generateSectionRow(columns, 'head');\n if (sectionRow)\n content.head.push(sectionRow);\n }\n if (content.foot.length === 0) {\n var sectionRow = generateSectionRow(columns, 'foot');\n if (sectionRow)\n content.foot.push(sectionRow);\n }\n var theme = input.settings.theme;\n var styles = input.styles;\n return {\n columns: columns,\n head: parseSection('head', content.head, columns, styles, theme, sf),\n body: parseSection('body', content.body, columns, styles, theme, sf),\n foot: parseSection('foot', content.foot, columns, styles, theme, sf),\n };\n}\nfunction parseSection(sectionName, sectionRows, columns, styleProps, theme, scaleFactor) {\n var rowSpansLeftForColumn = {};\n var result = sectionRows.map(function (rawRow, rowIndex) {\n var skippedRowForRowSpans = 0;\n var cells = {};\n var colSpansAdded = 0;\n var columnSpansLeft = 0;\n for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {\n var column = columns_1[_i];\n if (rowSpansLeftForColumn[column.index] == null ||\n rowSpansLeftForColumn[column.index].left === 0) {\n if (columnSpansLeft === 0) {\n var rawCell = void 0;\n if (Array.isArray(rawRow)) {\n rawCell =\n rawRow[column.index - colSpansAdded - skippedRowForRowSpans];\n }\n else {\n rawCell = rawRow[column.dataKey];\n }\n var cellInputStyles = {};\n if (typeof rawCell === 'object' && !Array.isArray(rawCell)) {\n cellInputStyles = (rawCell === null || rawCell === void 0 ? void 0 : rawCell.styles) || {};\n }\n var styles = cellStyles(sectionName, column, rowIndex, theme, styleProps, scaleFactor, cellInputStyles);\n var cell = new models_1.Cell(rawCell, styles, sectionName);\n // dataKey is not used internally no more but keep for\n // backwards compat in hooks\n cells[column.dataKey] = cell;\n cells[column.index] = cell;\n columnSpansLeft = cell.colSpan - 1;\n rowSpansLeftForColumn[column.index] = {\n left: cell.rowSpan - 1,\n times: columnSpansLeft,\n };\n }\n else {\n columnSpansLeft--;\n colSpansAdded++;\n }\n }\n else {\n rowSpansLeftForColumn[column.index].left--;\n columnSpansLeft = rowSpansLeftForColumn[column.index].times;\n skippedRowForRowSpans++;\n }\n }\n return new models_1.Row(rawRow, rowIndex, sectionName, cells);\n });\n return result;\n}\nfunction generateSectionRow(columns, section) {\n var sectionRow = {};\n columns.forEach(function (col) {\n if (col.raw != null) {\n var title = getSectionTitle(section, col.raw);\n if (title != null)\n sectionRow[col.dataKey] = title;\n }\n });\n return Object.keys(sectionRow).length > 0 ? sectionRow : null;\n}\nfunction getSectionTitle(section, column) {\n if (section === 'head') {\n if (typeof column === 'object') {\n return column.header || column.title || null;\n }\n else if (typeof column === 'string' || typeof column === 'number') {\n return column;\n }\n }\n else if (section === 'foot' && typeof column === 'object') {\n return column.footer;\n }\n return null;\n}\nfunction createColumns(columns) {\n return columns.map(function (input, index) {\n var _a, _b;\n var key;\n if (typeof input === 'object') {\n key = (_b = (_a = input.dataKey) !== null && _a !== void 0 ? _a : input.key) !== null && _b !== void 0 ? _b : index;\n }\n else {\n key = index;\n }\n return new models_1.Column(key, input, index);\n });\n}\nfunction cellStyles(sectionName, column, rowIndex, themeName, styles, scaleFactor, cellInputStyles) {\n var theme = config_1.getTheme(themeName);\n var sectionStyles;\n if (sectionName === 'head') {\n sectionStyles = styles.headStyles;\n }\n else if (sectionName === 'body') {\n sectionStyles = styles.bodyStyles;\n }\n else if (sectionName === 'foot') {\n sectionStyles = styles.footStyles;\n }\n var otherStyles = polyfills_1.assign({}, theme.table, theme[sectionName], styles.styles, sectionStyles);\n var columnStyles = styles.columnStyles[column.dataKey] ||\n styles.columnStyles[column.index] ||\n {};\n var colStyles = sectionName === 'body' ? columnStyles : {};\n var rowStyles = sectionName === 'body' && rowIndex % 2 === 0\n ? polyfills_1.assign({}, theme.alternateRow, styles.alternateRowStyles)\n : {};\n var defaultStyle = config_1.defaultStyles(scaleFactor);\n var themeStyles = polyfills_1.assign({}, defaultStyle, otherStyles, rowStyles, colStyles);\n return polyfills_1.assign(themeStyles, cellInputStyles);\n}\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.__drawTable = exports.__createTable = exports.applyPlugin = void 0;\nvar applyPlugin_1 = __webpack_require__(11);\nvar inputParser_1 = __webpack_require__(6);\nvar tableDrawer_1 = __webpack_require__(7);\nvar tableCalculator_1 = __webpack_require__(9);\n// export { applyPlugin } didn't export applyPlugin\n// to index.d.ts for some reason\nfunction applyPlugin(jsPDF) {\n applyPlugin_1.default(jsPDF);\n}\nexports.applyPlugin = applyPlugin;\nfunction autoTable(d, options) {\n var input = inputParser_1.parseInput(d, options);\n var table = tableCalculator_1.createTable(d, input);\n tableDrawer_1.drawTable(d, table);\n}\nexports.default = autoTable;\n// Experimental export\nfunction __createTable(d, options) {\n var input = inputParser_1.parseInput(d, options);\n return tableCalculator_1.createTable(d, input);\n}\nexports.__createTable = __createTable;\nfunction __drawTable(d, table) {\n tableDrawer_1.drawTable(d, table);\n}\nexports.__drawTable = __drawTable;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n var jsPDF = __webpack_require__(16);\n // Webpack imported jspdf instead of jsPDF for some reason \n // while it seemed to work everywhere else.\n if (jsPDF.jsPDF)\n jsPDF = jsPDF.jsPDF;\n applyPlugin(jsPDF);\n}\ncatch (error) {\n // Importing jspdf in nodejs environments does not work as of jspdf\n // 1.5.3 so we need to silence potential errors to support using for example\n // the nodejs jspdf dist files with the exported applyPlugin\n}\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar htmlParser_1 = __webpack_require__(4);\nvar autoTableText_1 = __webpack_require__(5);\nvar documentHandler_1 = __webpack_require__(2);\nvar inputParser_1 = __webpack_require__(6);\nvar tableDrawer_1 = __webpack_require__(7);\nvar tableCalculator_1 = __webpack_require__(9);\nfunction default_1(jsPDF) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n jsPDF.API.autoTable = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var options;\n if (args.length === 1) {\n options = args[0];\n }\n else {\n console.error('Use of deprecated autoTable initiation');\n options = args[2] || {};\n options.columns = args[0];\n options.body = args[1];\n }\n var input = inputParser_1.parseInput(this, options);\n var table = tableCalculator_1.createTable(this, input);\n tableDrawer_1.drawTable(this, table);\n return this;\n };\n // Assign false to enable `doc.lastAutoTable.finalY || 40` sugar\n jsPDF.API.lastAutoTable = false;\n jsPDF.API.previousAutoTable = false; // deprecated in v3\n jsPDF.API.autoTable.previous = false; // deprecated in v3\n jsPDF.API.autoTableText = function (text, x, y, styles) {\n autoTableText_1.default(text, x, y, styles, this);\n };\n jsPDF.API.autoTableSetDefaults = function (defaults) {\n documentHandler_1.DocHandler.setDefaults(defaults, this);\n return this;\n };\n jsPDF.autoTableSetDefaults = function (defaults, doc) {\n documentHandler_1.DocHandler.setDefaults(defaults, doc);\n };\n jsPDF.API.autoTableHtmlToJson = function (tableElem, includeHiddenElements) {\n if (includeHiddenElements === void 0) { includeHiddenElements = false; }\n if (typeof window === 'undefined') {\n console.error('Cannot run autoTableHtmlToJson in non browser environment');\n return null;\n }\n var doc = new documentHandler_1.DocHandler(this);\n var _a = htmlParser_1.parseHtml(doc, tableElem, window, includeHiddenElements, false), head = _a.head, body = _a.body;\n var columns = head[0].map(function (c) { return c.content; });\n return { columns: columns, rows: body, data: body };\n };\n /**\n * @deprecated\n */\n jsPDF.API.autoTableEndPosY = function () {\n console.error('Use of deprecated function: autoTableEndPosY. Use doc.lastAutoTable.finalY instead.');\n var prev = this.lastAutoTable;\n if (prev && prev.finalY) {\n return prev.finalY;\n }\n else {\n return 0;\n }\n };\n /**\n * @deprecated\n */\n jsPDF.API.autoTableAddPageContent = function (hook) {\n console.error('Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead.');\n if (!jsPDF.API.autoTable.globalDefaults) {\n jsPDF.API.autoTable.globalDefaults = {};\n }\n jsPDF.API.autoTable.globalDefaults.addPageContent = hook;\n return this;\n };\n /**\n * @deprecated\n */\n jsPDF.API.autoTableAddPage = function () {\n console.error('Use of deprecated function: autoTableAddPage. Use doc.addPage()');\n this.addPage();\n return this;\n };\n}\nexports.default = default_1;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCss = void 0;\n// Limitations\n// - No support for border spacing\n// - No support for transparency\nvar common_1 = __webpack_require__(0);\nfunction parseCss(supportedFonts, element, scaleFactor, style, window) {\n var result = {};\n var pxScaleFactor = 96 / 72;\n var color = parseColor(element, function (elem) {\n return window.getComputedStyle(elem)['backgroundColor'];\n });\n if (color != null)\n result.fillColor = color;\n color = parseColor(element, function (elem) {\n return window.getComputedStyle(elem)['color'];\n });\n if (color != null)\n result.textColor = color;\n color = parseColor(element, function (elem) {\n return window.getComputedStyle(elem)['borderTopColor'];\n });\n if (color != null)\n result.lineColor = color;\n var padding = parsePadding(style, scaleFactor);\n if (padding)\n result.cellPadding = padding;\n // style.borderWidth only works in chrome (borderTopWidth etc works in firefox and ie as well)\n var bw = parseInt(style.borderTopWidth || '');\n bw = bw / pxScaleFactor / scaleFactor;\n if (bw)\n result.lineWidth = bw;\n var accepted = ['left', 'right', 'center', 'justify'];\n if (accepted.indexOf(style.textAlign) !== -1) {\n result.halign = style.textAlign;\n }\n accepted = ['middle', 'bottom', 'top'];\n if (accepted.indexOf(style.verticalAlign) !== -1) {\n result.valign = style.verticalAlign;\n }\n var res = parseInt(style.fontSize || '');\n if (!isNaN(res))\n result.fontSize = res / pxScaleFactor;\n var fontStyle = parseFontStyle(style);\n if (fontStyle)\n result.fontStyle = fontStyle;\n var font = (style.fontFamily || '').toLowerCase();\n if (supportedFonts.indexOf(font) !== -1) {\n result.font = font;\n }\n return result;\n}\nexports.parseCss = parseCss;\nfunction parseFontStyle(style) {\n var res = '';\n if (style.fontWeight === 'bold' ||\n style.fontWeight === 'bolder' ||\n parseInt(style.fontWeight) >= 700) {\n res = 'bold';\n }\n if (style.fontStyle === 'italic' || style.fontStyle === 'oblique') {\n res += 'italic';\n }\n return res;\n}\nfunction parseColor(element, styleGetter) {\n var cssColor = realColor(element, styleGetter);\n if (!cssColor)\n return null;\n var rgba = cssColor.match(/^rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*(\\d*\\.?\\d*))?\\)$/);\n if (!rgba || !Array.isArray(rgba)) {\n return null;\n }\n var color = [\n parseInt(rgba[1]),\n parseInt(rgba[2]),\n parseInt(rgba[3]),\n ];\n var alpha = parseInt(rgba[4]);\n if (alpha === 0 || isNaN(color[0]) || isNaN(color[1]) || isNaN(color[2])) {\n return null;\n }\n return color;\n}\nfunction realColor(elem, styleGetter) {\n var bg = styleGetter(elem);\n if (bg === 'rgba(0, 0, 0, 0)' ||\n bg === 'transparent' ||\n bg === 'initial' ||\n bg === 'inherit') {\n if (elem.parentElement == null) {\n return null;\n }\n return realColor(elem.parentElement, styleGetter);\n }\n else {\n return bg;\n }\n}\nfunction parsePadding(style, scaleFactor) {\n var val = [\n style.paddingTop,\n style.paddingRight,\n style.paddingBottom,\n style.paddingLeft,\n ];\n var pxScaleFactor = 96 / (72 / scaleFactor);\n var linePadding = (parseInt(style.lineHeight) - parseInt(style.fontSize)) / scaleFactor / 2;\n var inputPadding = val.map(function (n) {\n return parseInt(n) / pxScaleFactor;\n });\n var padding = common_1.parseSpacing(inputPadding, 0);\n if (linePadding > padding.top) {\n padding.top = linePadding;\n }\n if (linePadding > padding.bottom) {\n padding.bottom = linePadding;\n }\n return padding;\n}\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction default_1(doc, global, document, current) {\n var _loop_1 = function (options) {\n if (options && typeof options !== 'object') {\n console.error('The options parameter should be of type object, is: ' + typeof options);\n }\n if (typeof options.extendWidth !== 'undefined') {\n options.tableWidth = options.extendWidth ? 'auto' : 'wrap';\n console.error('Use of deprecated option: extendWidth, use tableWidth instead.');\n }\n if (typeof options.margins !== 'undefined') {\n if (typeof options.margin === 'undefined')\n options.margin = options.margins;\n console.error('Use of deprecated option: margins, use margin instead.');\n }\n if (options.startY && typeof options.startY !== 'number') {\n console.error('Invalid value for startY option', options.startY);\n delete options.startY;\n }\n if (!options.didDrawPage &&\n (options.afterPageContent ||\n options.beforePageContent ||\n options.afterPageAdd)) {\n console.error('The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead');\n options.didDrawPage = function (data) {\n doc.applyStyles(doc.userStyles);\n if (options.beforePageContent)\n options.beforePageContent(data);\n doc.applyStyles(doc.userStyles);\n if (options.afterPageContent)\n options.afterPageContent(data);\n doc.applyStyles(doc.userStyles);\n if (options.afterPageAdd && data.pageNumber > 1) {\n ;\n data.afterPageAdd(data);\n }\n doc.applyStyles(doc.userStyles);\n };\n }\n ;\n [\n 'createdHeaderCell',\n 'drawHeaderRow',\n 'drawRow',\n 'drawHeaderCell',\n ].forEach(function (name) {\n if (options[name]) {\n console.error(\"The \\\"\" + name + \"\\\" hook has changed in version 3.0, check the changelog for how to migrate.\");\n }\n });\n [\n ['showFoot', 'showFooter'],\n ['showHead', 'showHeader'],\n ['didDrawPage', 'addPageContent'],\n ['didParseCell', 'createdCell'],\n ['headStyles', 'headerStyles'],\n ].forEach(function (_a) {\n var current = _a[0], deprecated = _a[1];\n if (options[deprecated]) {\n console.error(\"Use of deprecated option \" + deprecated + \". Use \" + current + \" instead\");\n options[current] = options[deprecated];\n }\n });\n [\n ['padding', 'cellPadding'],\n ['lineHeight', 'rowHeight'],\n 'fontSize',\n 'overflow',\n ].forEach(function (o) {\n var deprecatedOption = typeof o === 'string' ? o : o[0];\n var style = typeof o === 'string' ? o : o[1];\n if (typeof options[deprecatedOption] !== 'undefined') {\n if (typeof options.styles[style] === 'undefined') {\n options.styles[style] = options[deprecatedOption];\n }\n console.error('Use of deprecated option: ' +\n deprecatedOption +\n ', use the style ' +\n style +\n ' instead.');\n }\n });\n for (var _i = 0, _a = [\n 'styles',\n 'bodyStyles',\n 'headStyles',\n 'footStyles',\n ]; _i < _a.length; _i++) {\n var styleProp = _a[_i];\n checkStyles(options[styleProp] || {});\n }\n var columnStyles = options['columnStyles'] || {};\n for (var _b = 0, _c = Object.keys(columnStyles); _b < _c.length; _b++) {\n var key = _c[_b];\n checkStyles(columnStyles[key] || {});\n }\n };\n for (var _i = 0, _a = [global, document, current]; _i < _a.length; _i++) {\n var options = _a[_i];\n _loop_1(options);\n }\n}\nexports.default = default_1;\nfunction checkStyles(styles) {\n if (styles.rowHeight) {\n console.error('Use of deprecated style rowHeight. It is renamed to minCellHeight.');\n if (!styles.minCellHeight) {\n styles.minCellHeight = styles.rowHeight;\n }\n }\n else if (styles.columnWidth) {\n console.error('Use of deprecated style columnWidth. It is renamed to cellWidth.');\n if (!styles.cellWidth) {\n styles.cellWidth = styles.columnWidth;\n }\n }\n}\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CellHookData = exports.HookData = void 0;\nvar HookData = /** @class */ (function () {\n function HookData(doc, table, cursor) {\n this.table = table;\n this.pageNumber = table.pageNumber;\n this.pageCount = this.pageNumber;\n this.settings = table.settings;\n this.cursor = cursor;\n this.doc = doc.getDocument();\n }\n return HookData;\n}());\nexports.HookData = HookData;\nvar CellHookData = /** @class */ (function (_super) {\n __extends(CellHookData, _super);\n function CellHookData(doc, table, cell, row, column, cursor) {\n var _this = _super.call(this, doc, table, cursor) || this;\n _this.cell = cell;\n _this.row = row;\n _this.column = column;\n _this.section = row.section;\n return _this;\n }\n return CellHookData;\n}(HookData));\nexports.CellHookData = CellHookData;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ellipsize = exports.resizeColumns = exports.calculateWidths = void 0;\nvar common_1 = __webpack_require__(0);\n/**\n * Calculate the column widths\n */\nfunction calculateWidths(doc, table) {\n calculate(doc, table);\n var resizableColumns = [];\n var initialTableWidth = 0;\n table.columns.forEach(function (column) {\n var customWidth = column.getMaxCustomCellWidth(table);\n if (customWidth) {\n // final column width\n column.width = customWidth;\n }\n else {\n // initial column width (will be resized)\n column.width = column.wrappedWidth;\n resizableColumns.push(column);\n }\n initialTableWidth += column.width;\n });\n // width difference that needs to be distributed\n var resizeWidth = table.getWidth(doc.pageSize().width) - initialTableWidth;\n // first resize attempt: with respect to minReadableWidth and minWidth\n if (resizeWidth) {\n resizeWidth = resizeColumns(resizableColumns, resizeWidth, function (column) {\n return Math.max(column.minReadableWidth, column.minWidth);\n });\n }\n // second resize attempt: ignore minReadableWidth but respect minWidth\n if (resizeWidth) {\n resizeWidth = resizeColumns(resizableColumns, resizeWidth, function (column) { return column.minWidth; });\n }\n resizeWidth = Math.abs(resizeWidth);\n if (resizeWidth > 0.1 / doc.scaleFactor()) {\n // Table can't get smaller due to custom-width or minWidth restrictions\n // We can't really do much here. Up to user to for example\n // reduce font size, increase page size or remove custom cell widths\n // to allow more columns to be reduced in size\n resizeWidth = resizeWidth < 1 ? resizeWidth : Math.round(resizeWidth);\n console.error(\"Of the table content, \" + resizeWidth + \" units width could not fit page\");\n }\n applyColSpans(table);\n fitContent(table, doc);\n applyRowSpans(table);\n}\nexports.calculateWidths = calculateWidths;\nfunction calculate(doc, table) {\n var sf = doc.scaleFactor();\n table.allRows().forEach(function (row) {\n for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {\n var column = _a[_i];\n var cell = row.cells[column.index];\n if (!cell)\n continue;\n var hooks = table.hooks.didParseCell;\n table.callCellHooks(doc, hooks, cell, row, column, null);\n var padding = cell.padding('horizontal');\n cell.contentWidth = common_1.getStringWidth(cell.text, cell.styles, doc) + padding;\n var longestWordWidth = common_1.getStringWidth(cell.text.join(' ').split(/\\s+/), cell.styles, doc);\n cell.minReadableWidth = longestWordWidth + cell.padding('horizontal');\n if (typeof cell.styles.cellWidth === 'number') {\n cell.minWidth = cell.styles.cellWidth;\n cell.wrappedWidth = cell.styles.cellWidth;\n }\n else if (cell.styles.cellWidth === 'wrap') {\n cell.minWidth = cell.contentWidth;\n cell.wrappedWidth = cell.contentWidth;\n }\n else {\n // auto\n var defaultMinWidth = 10 / sf;\n cell.minWidth = cell.styles.minCellWidth || defaultMinWidth;\n cell.wrappedWidth = cell.contentWidth;\n if (cell.minWidth > cell.wrappedWidth) {\n cell.wrappedWidth = cell.minWidth;\n }\n }\n }\n });\n table.allRows().forEach(function (row) {\n for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {\n var column = _a[_i];\n var cell = row.cells[column.index];\n // For now we ignore the minWidth and wrappedWidth of colspan cells when calculating colspan widths.\n // Could probably be improved upon however.\n if (cell && cell.colSpan === 1) {\n column.wrappedWidth = Math.max(column.wrappedWidth, cell.wrappedWidth);\n column.minWidth = Math.max(column.minWidth, cell.minWidth);\n column.minReadableWidth = Math.max(column.minReadableWidth, cell.minReadableWidth);\n }\n else {\n // Respect cellWidth set in columnStyles even if there is no cells for this column\n // or if the column only have colspan cells. Since the width of colspan cells\n // does not affect the width of columns, setting columnStyles cellWidth enables the\n // user to at least do it manually.\n // Note that this is not perfect for now since for example row and table styles are\n // not accounted for\n var columnStyles = table.styles.columnStyles[column.dataKey] ||\n table.styles.columnStyles[column.index] ||\n {};\n var cellWidth = columnStyles.cellWidth;\n if (cellWidth && typeof cellWidth === 'number') {\n column.minWidth = cellWidth;\n column.wrappedWidth = cellWidth;\n }\n }\n if (cell) {\n // Make sure all columns get at least min width even though width calculations are not based on them\n if (cell.colSpan > 1 && !column.minWidth) {\n column.minWidth = cell.minWidth;\n }\n if (cell.colSpan > 1 && !column.wrappedWidth) {\n column.wrappedWidth = cell.minWidth;\n }\n }\n }\n });\n}\n/**\n * Distribute resizeWidth on passed resizable columns\n */\nfunction resizeColumns(columns, resizeWidth, getMinWidth) {\n var initialResizeWidth = resizeWidth;\n var sumWrappedWidth = columns.reduce(function (acc, column) { return acc + column.wrappedWidth; }, 0);\n for (var i = 0; i < columns.length; i++) {\n var column = columns[i];\n var ratio = column.wrappedWidth / sumWrappedWidth;\n var suggestedChange = initialResizeWidth * ratio;\n var suggestedWidth = column.width + suggestedChange;\n var minWidth = getMinWidth(column);\n var newWidth = suggestedWidth < minWidth ? minWidth : suggestedWidth;\n resizeWidth -= newWidth - column.width;\n column.width = newWidth;\n }\n resizeWidth = Math.round(resizeWidth * 1e10) / 1e10;\n // Run the resizer again if there's remaining width needs\n // to be distributed and there're columns that can be resized\n if (resizeWidth) {\n var resizableColumns = columns.filter(function (column) {\n return resizeWidth < 0\n ? column.width > getMinWidth(column) // check if column can shrink\n : true; // check if column can grow\n });\n if (resizableColumns.length) {\n resizeWidth = resizeColumns(resizableColumns, resizeWidth, getMinWidth);\n }\n }\n return resizeWidth;\n}\nexports.resizeColumns = resizeColumns;\nfunction applyRowSpans(table) {\n var rowSpanCells = {};\n var colRowSpansLeft = 1;\n var all = table.allRows();\n for (var rowIndex = 0; rowIndex < all.length; rowIndex++) {\n var row = all[rowIndex];\n for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {\n var column = _a[_i];\n var data = rowSpanCells[column.index];\n if (colRowSpansLeft > 1) {\n colRowSpansLeft--;\n delete row.cells[column.index];\n }\n else if (data) {\n data.cell.height += row.height;\n colRowSpansLeft = data.cell.colSpan;\n delete row.cells[column.index];\n data.left--;\n if (data.left <= 1) {\n delete rowSpanCells[column.index];\n }\n }\n else {\n var cell = row.cells[column.index];\n if (!cell) {\n continue;\n }\n cell.height = row.height;\n if (cell.rowSpan > 1) {\n var remaining = all.length - rowIndex;\n var left = cell.rowSpan > remaining ? remaining : cell.rowSpan;\n rowSpanCells[column.index] = { cell: cell, left: left, row: row };\n }\n }\n }\n }\n}\nfunction applyColSpans(table) {\n var all = table.allRows();\n for (var rowIndex = 0; rowIndex < all.length; rowIndex++) {\n var row = all[rowIndex];\n var colSpanCell = null;\n var combinedColSpanWidth = 0;\n var colSpansLeft = 0;\n for (var columnIndex = 0; columnIndex < table.columns.length; columnIndex++) {\n var column = table.columns[columnIndex];\n // Width and colspan\n colSpansLeft -= 1;\n if (colSpansLeft > 1 && table.columns[columnIndex + 1]) {\n combinedColSpanWidth += column.width;\n delete row.cells[column.index];\n }\n else if (colSpanCell) {\n var cell = colSpanCell;\n delete row.cells[column.index];\n colSpanCell = null;\n cell.width = column.width + combinedColSpanWidth;\n }\n else {\n var cell = row.cells[column.index];\n if (!cell)\n continue;\n colSpansLeft = cell.colSpan;\n combinedColSpanWidth = 0;\n if (cell.colSpan > 1) {\n colSpanCell = cell;\n combinedColSpanWidth += column.width;\n continue;\n }\n cell.width = column.width + combinedColSpanWidth;\n }\n }\n }\n}\nfunction fitContent(table, doc) {\n var rowSpanHeight = { count: 0, height: 0 };\n for (var _i = 0, _a = table.allRows(); _i < _a.length; _i++) {\n var row = _a[_i];\n for (var _b = 0, _c = table.columns; _b < _c.length; _b++) {\n var column = _c[_b];\n var cell = row.cells[column.index];\n if (!cell)\n continue;\n doc.applyStyles(cell.styles, true);\n var textSpace = cell.width - cell.padding('horizontal');\n if (cell.styles.overflow === 'linebreak') {\n // Add one pt to textSpace to fix rounding error\n cell.text = doc.splitTextToSize(cell.text, textSpace + 1 / doc.scaleFactor(), { fontSize: cell.styles.fontSize });\n }\n else if (cell.styles.overflow === 'ellipsize') {\n cell.text = ellipsize(cell.text, textSpace, cell.styles, doc, '...');\n }\n else if (cell.styles.overflow === 'hidden') {\n cell.text = ellipsize(cell.text, textSpace, cell.styles, doc, '');\n }\n else if (typeof cell.styles.overflow === 'function') {\n cell.text = cell.styles.overflow(cell.text, textSpace);\n }\n cell.contentHeight = cell.getContentHeight(doc.scaleFactor());\n var realContentHeight = cell.contentHeight / cell.rowSpan;\n if (cell.rowSpan > 1 &&\n rowSpanHeight.count * rowSpanHeight.height <\n realContentHeight * cell.rowSpan) {\n rowSpanHeight = { height: realContentHeight, count: cell.rowSpan };\n }\n else if (rowSpanHeight && rowSpanHeight.count > 0) {\n if (rowSpanHeight.height > realContentHeight) {\n realContentHeight = rowSpanHeight.height;\n }\n }\n if (realContentHeight > row.height) {\n row.height = realContentHeight;\n }\n }\n rowSpanHeight.count--;\n }\n}\nfunction ellipsize(text, width, styles, doc, overflow) {\n return text.map(function (str) { return ellipsizeStr(str, width, styles, doc, overflow); });\n}\nexports.ellipsize = ellipsize;\nfunction ellipsizeStr(text, width, styles, doc, overflow) {\n var precision = 10000 * doc.scaleFactor();\n width = Math.ceil(width * precision) / precision;\n if (width >= common_1.getStringWidth(text, styles, doc)) {\n return text;\n }\n while (width < common_1.getStringWidth(text + overflow, styles, doc)) {\n if (text.length <= 1) {\n break;\n }\n text = text.substring(0, text.length - 1);\n }\n return text.trim() + overflow;\n}\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\nif(typeof __WEBPACK_EXTERNAL_MODULE__16__ === 'undefined') {var e = new Error(\"Cannot find module 'undefined'\"); e.code = 'MODULE_NOT_FOUND'; throw e;}\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__16__;\n\n/***/ })\n/******/ ]);\n});","export var globalObject = (function() {\n return \"undefined\" !== typeof window\n ? window\n : \"undefined\" !== typeof global\n ? global\n : \"undefined\" !== typeof self\n ? self\n : this;\n})();\n","import { globalObject } from \"./globalObject.js\";\n\nfunction consoleLog() {\n if (globalObject.console && typeof globalObject.console.log === \"function\") {\n globalObject.console.log.apply(globalObject.console, arguments);\n }\n}\n\nfunction consoleWarn(str) {\n if (globalObject.console) {\n if (typeof globalObject.console.warn === \"function\") {\n globalObject.console.warn.apply(globalObject.console, arguments);\n } else {\n consoleLog.call(null, arguments);\n }\n }\n}\n\nfunction consoleError(str) {\n if (globalObject.console) {\n if (typeof globalObject.console.error === \"function\") {\n globalObject.console.error.apply(globalObject.console, arguments);\n } else {\n consoleLog(str);\n }\n }\n}\nexport var console = {\n log: consoleLog,\n warn: consoleWarn,\n error: consoleError\n};\n","/**\n * @license\n * FileSaver.js\n * A saveAs() FileSaver implementation.\n *\n * By Eli Grey, http://eligrey.com\n *\n * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)\n * source : http://purl.eligrey.com/github/FileSaver.js\n */\n\nimport { globalObject as _global } from \"./globalObject.js\";\nimport { console } from \"./console.js\";\n\nfunction bom(blob, opts) {\n if (typeof opts === \"undefined\") opts = { autoBom: false };\n else if (typeof opts !== \"object\") {\n console.warn(\"Deprecated: Expected third argument to be a object\");\n opts = { autoBom: !opts };\n }\n\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (\n opts.autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(\n blob.type\n )\n ) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\n\nfunction download(url, name, opts) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.responseType = \"blob\";\n xhr.onload = function() {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function() {\n console.error(\"could not download file\");\n };\n xhr.send();\n}\n\nfunction corsEnabled(url) {\n var xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open(\"HEAD\", url, false);\n try {\n xhr.send();\n } catch (e) {}\n return xhr.status >= 200 && xhr.status <= 299;\n}\n\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent(\"click\"));\n } catch (e) {\n var evt = document.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\n \"click\",\n true,\n true,\n window,\n 0,\n 0,\n 0,\n 80,\n 20,\n false,\n false,\n false,\n false,\n 0,\n null\n );\n node.dispatchEvent(evt);\n }\n}\n\nvar saveAs =\n _global.saveAs ||\n // probably in some web worker\n (typeof window !== \"object\" || window !== _global\n ? function saveAs() {\n /* noop */\n }\n : // Use download attribute first if possible (#193 Lumia mobile)\n \"download\" in HTMLAnchorElement.prototype\n ? function saveAs(blob, name, opts) {\n var URL = _global.URL || _global.webkitURL;\n var a = document.createElement(\"a\");\n name = name || blob.name || \"download\";\n\n a.download = name;\n a.rel = \"noopener\"; // tabnabbing\n\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n\n if (typeof blob === \"string\") {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n corsEnabled(a.href)\n ? download(blob, name, opts)\n : click(a, (a.target = \"_blank\"));\n } else {\n click(a);\n }\n } else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function() {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function() {\n click(a);\n }, 0);\n }\n }\n : // Use msSaveOrOpenBlob as a second approach\n \"msSaveOrOpenBlob\" in navigator\n ? function saveAs(blob, name, opts) {\n name = name || blob.name || \"download\";\n\n if (typeof blob === \"string\") {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n } else {\n var a = document.createElement(\"a\");\n a.href = blob;\n a.target = \"_blank\";\n setTimeout(function() {\n click(a);\n });\n }\n } else {\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n }\n : // Fallback to using FileReader and a popup\n function saveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open(\"\", \"_blank\");\n if (popup) {\n popup.document.title = popup.document.body.innerText =\n \"downloading...\";\n }\n\n if (typeof blob === \"string\") return download(blob, name, opts);\n\n var force = blob.type === \"application/octet-stream\";\n var isSafari =\n /constructor/i.test(_global.HTMLElement) || _global.safari;\n var isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n\n if (\n (isChromeIOS || (force && isSafari)) &&\n typeof FileReader === \"object\"\n ) {\n // Safari doesn't allow downloading of blob URLs\n var reader = new FileReader();\n reader.onloadend = function() {\n var url = reader.result;\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, \"data:attachment/file;\");\n if (popup) popup.location.href = url;\n else location = url;\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n } else {\n var URL = _global.URL || _global.webkitURL;\n var url = URL.createObjectURL(blob);\n if (popup) popup.location = url;\n else location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function() {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n });\n\nexport { saveAs };\n","import { globalObject } from \"./globalObject.js\";\n\nvar atob, btoa;\n\n(function() {\n atob = globalObject.atob;\n btoa = globalObject.btoa;\n return;\n\n})();\n\nexport { atob, btoa };\n","/**\n * A class to parse color values\n * @author Stoyan Stefanov \n * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}\n * @license Use it if you like it\n */\n\nfunction RGBColor(color_string) {\n color_string = color_string || \"\";\n this.ok = false;\n\n // strip any leading #\n if (color_string.charAt(0) == \"#\") {\n // remove # if any\n color_string = color_string.substr(1, 6);\n }\n\n color_string = color_string.replace(/ /g, \"\");\n color_string = color_string.toLowerCase();\n\n var channels;\n\n // before getting into regexps, try simple matches\n // and overwrite the input\n var simple_colors = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"00ffff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000000\",\n blanchedalmond: \"ffebcd\",\n blue: \"0000ff\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"00ffff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dodgerblue: \"1e90ff\",\n feldspar: \"d19275\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"ff00ff\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgrey: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslateblue: \"8470ff\",\n lightslategray: \"778899\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"00ff00\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"ff00ff\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370d8\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"d87093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n red: \"ff0000\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n violetred: \"d02090\",\n wheat: \"f5deb3\",\n white: \"ffffff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ffff00\",\n yellowgreen: \"9acd32\"\n };\n color_string = simple_colors[color_string] || color_string;\n\n // array of color definition objects\n var color_defs = [\n {\n re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n example: [\"rgb(123, 234, 45)\", \"rgb(255,234,245)\"],\n process: function(bits) {\n return [parseInt(bits[1]), parseInt(bits[2]), parseInt(bits[3])];\n }\n },\n {\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n example: [\"#00ff00\", \"336699\"],\n process: function(bits) {\n return [\n parseInt(bits[1], 16),\n parseInt(bits[2], 16),\n parseInt(bits[3], 16)\n ];\n }\n },\n {\n re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n example: [\"#fb0\", \"f0f\"],\n process: function(bits) {\n return [\n parseInt(bits[1] + bits[1], 16),\n parseInt(bits[2] + bits[2], 16),\n parseInt(bits[3] + bits[3], 16)\n ];\n }\n }\n ];\n\n // search through the definitions to find a match\n for (var i = 0; i < color_defs.length; i++) {\n var re = color_defs[i].re;\n var processor = color_defs[i].process;\n var bits = re.exec(color_string);\n if (bits) {\n channels = processor(bits);\n this.r = channels[0];\n this.g = channels[1];\n this.b = channels[2];\n this.ok = true;\n }\n }\n\n // validate/cleanup values\n this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;\n this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;\n this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;\n\n // some getters\n this.toRGB = function() {\n return \"rgb(\" + this.r + \", \" + this.g + \", \" + this.b + \")\";\n };\n this.toHex = function() {\n var r = this.r.toString(16);\n var g = this.g.toString(16);\n var b = this.b.toString(16);\n if (r.length == 1) r = \"0\" + r;\n if (g.length == 1) g = \"0\" + g;\n if (b.length == 1) b = \"0\" + b;\n return \"#\" + r + g + b;\n };\n}\n\nexport { RGBColor };\n","/* eslint-disable no-console */\n\nimport { saveAs } from \"./libs/FileSaver.js\";\nimport { globalObject } from \"./libs/globalObject.js\";\nimport { RGBColor } from \"./libs/rgbcolor.js\";\nimport { btoa } from \"./libs/AtobBtoa.js\";\nimport { console } from \"./libs/console.js\";\n\n/**\n * jsPDF's Internal PubSub Implementation.\n * Backward compatible rewritten on 2014 by\n * Diego Casorran, https://github.com/diegocr\n *\n * @class\n * @name PubSub\n * @ignore\n */\nfunction PubSub(context) {\n if (typeof context !== \"object\") {\n throw new Error(\n \"Invalid Context passed to initialize PubSub (jsPDF-module)\"\n );\n }\n var topics = {};\n\n this.subscribe = function(topic, callback, once) {\n once = once || false;\n if (\n typeof topic !== \"string\" ||\n typeof callback !== \"function\" ||\n typeof once !== \"boolean\"\n ) {\n throw new Error(\n \"Invalid arguments passed to PubSub.subscribe (jsPDF-module)\"\n );\n }\n\n if (!topics.hasOwnProperty(topic)) {\n topics[topic] = {};\n }\n\n var token = Math.random().toString(35);\n topics[topic][token] = [callback, !!once];\n\n return token;\n };\n\n this.unsubscribe = function(token) {\n for (var topic in topics) {\n if (topics[topic][token]) {\n delete topics[topic][token];\n if (Object.keys(topics[topic]).length === 0) {\n delete topics[topic];\n }\n return true;\n }\n }\n return false;\n };\n\n this.publish = function(topic) {\n if (topics.hasOwnProperty(topic)) {\n var args = Array.prototype.slice.call(arguments, 1),\n tokens = [];\n\n for (var token in topics[topic]) {\n var sub = topics[topic][token];\n try {\n sub[0].apply(context, args);\n } catch (ex) {\n if (globalObject.console) {\n console.error(\"jsPDF PubSub Error\", ex.message, ex);\n }\n }\n if (sub[1]) tokens.push(token);\n }\n if (tokens.length) tokens.forEach(this.unsubscribe);\n }\n };\n\n this.getTopics = function() {\n return topics;\n };\n}\n\nfunction GState(parameters) {\n if (!(this instanceof GState)) {\n return new GState(parameters);\n }\n\n /**\n * @name GState#opacity\n * @type {any}\n */\n /**\n * @name GState#stroke-opacity\n * @type {any}\n */\n var supported = \"opacity,stroke-opacity\".split(\",\");\n for (var p in parameters) {\n if (parameters.hasOwnProperty(p) && supported.indexOf(p) >= 0) {\n this[p] = parameters[p];\n }\n }\n /**\n * @name GState#id\n * @type {string}\n */\n this.id = \"\"; // set by addGState()\n /**\n * @name GState#objectNumber\n * @type {number}\n */\n this.objectNumber = -1; // will be set by putGState()\n}\n\nGState.prototype.equals = function equals(other) {\n var ignore = \"id,objectNumber,equals\";\n var p;\n if (!other || typeof other !== typeof this) return false;\n var count = 0;\n for (p in this) {\n if (ignore.indexOf(p) >= 0) continue;\n if (this.hasOwnProperty(p) && !other.hasOwnProperty(p)) return false;\n if (this[p] !== other[p]) return false;\n count++;\n }\n for (p in other) {\n if (other.hasOwnProperty(p) && ignore.indexOf(p) < 0) count--;\n }\n return count === 0;\n};\n\nfunction Pattern(gState, matrix) {\n this.gState = gState;\n this.matrix = matrix;\n\n this.id = \"\"; // set by addPattern()\n this.objectNumber = -1; // will be set by putPattern()\n}\n\nfunction ShadingPattern(type, coords, colors, gState, matrix) {\n if (!(this instanceof ShadingPattern)) {\n return new ShadingPattern(type, coords, colors, gState, matrix);\n }\n\n // see putPattern() for information how they are realized\n this.type = type === \"axial\" ? 2 : 3;\n this.coords = coords;\n this.colors = colors;\n\n Pattern.call(this, gState, matrix);\n}\n\nfunction TilingPattern(boundingBox, xStep, yStep, gState, matrix) {\n if (!(this instanceof TilingPattern)) {\n return new TilingPattern(boundingBox, xStep, yStep, gState, matrix);\n }\n\n this.boundingBox = boundingBox;\n this.xStep = xStep;\n this.yStep = yStep;\n\n this.stream = \"\"; // set by endTilingPattern();\n\n this.cloneIndex = 0;\n\n Pattern.call(this, gState, matrix);\n}\n\n/**\n * Creates new jsPDF document object instance.\n * @name jsPDF\n * @class\n * @param {Object} [options] - Collection of settings initializing the jsPDF-instance\n * @param {string} [options.orientation=portrait] - Orientation of the first page. Possible values are \"portrait\" or \"landscape\" (or shortcuts \"p\" or \"l\").
\n * @param {string} [options.unit=mm] Measurement unit (base unit) to be used when coordinates are specified.
\n * Possible values are \"pt\" (points), \"mm\", \"cm\", \"m\", \"in\" or \"px\".\n * @param {string/Array} [options.format=a4] The format of the first page. Can be:- a0 - a10
- b0 - b10
- c0 - c10
- dl
- letter
- government-letter
- legal
- junior-legal
- ledger
- tabloid
- credit-card
\n * Default is \"a4\". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]\n * @param {boolean} [options.putOnlyUsedFonts=false] Only put fonts into the PDF, which were used.\n * @param {boolean} [options.compress=false] Compress the generated PDF.\n * @param {number} [options.precision=16] Precision of the element-positions.\n * @param {number} [options.userUnit=1.0] Not to be confused with the base unit. Please inform yourself before you use it.\n * @param {number|\"smart\"} [options.floatPrecision=16]\n * @returns {jsPDF} jsPDF-instance\n * @description\n * ```\n * {\n * orientation: 'p',\n * unit: 'mm',\n * format: 'a4',\n * putOnlyUsedFonts:true,\n * floatPrecision: 16 // or \"smart\", default is 16\n * }\n * ```\n *\n * @constructor\n */\nfunction jsPDF(options) {\n var orientation = typeof arguments[0] === \"string\" ? arguments[0] : \"p\";\n var unit = arguments[1];\n var format = arguments[2];\n var compressPdf = arguments[3];\n var filters = [];\n var userUnit = 1.0;\n var precision;\n var floatPrecision = 16;\n var defaultPathOperation = \"S\";\n\n options = options || {};\n\n if (typeof options === \"object\") {\n orientation = options.orientation;\n unit = options.unit || unit;\n format = options.format || format;\n compressPdf = options.compress || options.compressPdf || compressPdf;\n userUnit =\n typeof options.userUnit === \"number\" ? Math.abs(options.userUnit) : 1.0;\n if (typeof options.precision !== \"undefined\") {\n precision = options.precision;\n }\n if (typeof options.floatPrecision !== \"undefined\") {\n floatPrecision = options.floatPrecision;\n }\n defaultPathOperation = options.defaultPathOperation || \"S\";\n }\n\n filters =\n options.filters || (compressPdf === true ? [\"FlateEncode\"] : filters);\n\n unit = unit || \"mm\";\n orientation = (\"\" + (orientation || \"P\")).toLowerCase();\n var putOnlyUsedFonts = options.putOnlyUsedFonts || false;\n var usedFonts = {};\n\n var API = {\n internal: {},\n __private__: {}\n };\n\n API.__private__.PubSub = PubSub;\n\n var pdfVersion = \"1.3\";\n var getPdfVersion = (API.__private__.getPdfVersion = function() {\n return pdfVersion;\n });\n\n API.__private__.setPdfVersion = function(value) {\n pdfVersion = value;\n };\n\n // Size in pt of various paper formats\n var pageFormats = {\n a0: [2383.94, 3370.39],\n a1: [1683.78, 2383.94],\n a2: [1190.55, 1683.78],\n a3: [841.89, 1190.55],\n a4: [595.28, 841.89],\n a5: [419.53, 595.28],\n a6: [297.64, 419.53],\n a7: [209.76, 297.64],\n a8: [147.4, 209.76],\n a9: [104.88, 147.4],\n a10: [73.7, 104.88],\n b0: [2834.65, 4008.19],\n b1: [2004.09, 2834.65],\n b2: [1417.32, 2004.09],\n b3: [1000.63, 1417.32],\n b4: [708.66, 1000.63],\n b5: [498.9, 708.66],\n b6: [354.33, 498.9],\n b7: [249.45, 354.33],\n b8: [175.75, 249.45],\n b9: [124.72, 175.75],\n b10: [87.87, 124.72],\n c0: [2599.37, 3676.54],\n c1: [1836.85, 2599.37],\n c2: [1298.27, 1836.85],\n c3: [918.43, 1298.27],\n c4: [649.13, 918.43],\n c5: [459.21, 649.13],\n c6: [323.15, 459.21],\n c7: [229.61, 323.15],\n c8: [161.57, 229.61],\n c9: [113.39, 161.57],\n c10: [79.37, 113.39],\n dl: [311.81, 623.62],\n letter: [612, 792],\n \"government-letter\": [576, 756],\n legal: [612, 1008],\n \"junior-legal\": [576, 360],\n ledger: [1224, 792],\n tabloid: [792, 1224],\n \"credit-card\": [153, 243]\n };\n\n API.__private__.getPageFormats = function() {\n return pageFormats;\n };\n\n var getPageFormat = (API.__private__.getPageFormat = function(value) {\n return pageFormats[value];\n });\n\n format = format || \"a4\";\n\n var ApiMode = {\n COMPAT: \"compat\",\n ADVANCED: \"advanced\"\n };\n var apiMode = ApiMode.COMPAT;\n\n function advancedAPI() {\n // prepend global change of basis matrix\n // (Now, instead of converting every coordinate to the pdf coordinate system, we apply a matrix\n // that does this job for us (however, texts, images and similar objects must be drawn bottom up))\n this.saveGraphicsState();\n out(\n new Matrix(\n scaleFactor,\n 0,\n 0,\n -scaleFactor,\n 0,\n getPageHeight() * scaleFactor\n ).toString() + \" cm\"\n );\n this.setFontSize(this.getFontSize() / scaleFactor);\n\n // The default in MrRio's implementation is \"S\" (stroke), whereas the default in the yWorks implementation\n // was \"n\" (none). Although this has nothing to do with transforms, we should use the API switch here.\n defaultPathOperation = \"n\";\n\n apiMode = ApiMode.ADVANCED;\n }\n\n function compatAPI() {\n this.restoreGraphicsState();\n defaultPathOperation = \"S\";\n apiMode = ApiMode.COMPAT;\n }\n\n /**\n * @callback ApiSwitchBody\n * @param {jsPDF} pdf\n */\n\n /**\n * For compatibility reasons jsPDF offers two API modes which differ in the way they convert between the the usual\n * screen coordinates and the PDF coordinate system.\n * - \"compat\": Offers full compatibility across all plugins but does not allow arbitrary transforms\n * - \"advanced\": Allows arbitrary transforms and more advanced features like pattern fills. Some plugins might\n * not support this mode, though.\n * Initial mode is \"compat\".\n *\n * You can either provide a callback to the body argument, which means that jsPDF will automatically switch back to\n * the original API mode afterwards; or you can omit the callback and switch back manually using {@link compatAPI}.\n *\n * Note, that the calls to {@link saveGraphicsState} and {@link restoreGraphicsState} need to be balanced within the\n * callback or between calls of this method and its counterpart {@link compatAPI}. Calls to {@link beginFormObject}\n * or {@link beginTilingPattern} need to be closed by their counterparts before switching back to \"compat\" API mode.\n *\n * @param {ApiSwitchBody=} body When provided, this callback will be called after the API mode has been switched.\n * The API mode will be switched back automatically afterwards.\n * @returns {jsPDF}\n * @memberof jsPDF#\n * @name advancedAPI\n */\n API.advancedAPI = function(body) {\n var doSwitch = apiMode === ApiMode.COMPAT;\n\n if (doSwitch) {\n advancedAPI.call(this);\n }\n\n if (typeof body !== \"function\") {\n return this;\n }\n\n body(this);\n\n if (doSwitch) {\n compatAPI.call(this);\n }\n\n return this;\n };\n\n /**\n * Switches to \"compat\" API mode. See {@link advancedAPI} for more details.\n *\n * @param {ApiSwitchBody=} body When provided, this callback will be called after the API mode has been switched.\n * The API mode will be switched back automatically afterwards.\n * @return {jsPDF}\n * @memberof jsPDF#\n * @name compatApi\n */\n API.compatAPI = function(body) {\n var doSwitch = apiMode === ApiMode.ADVANCED;\n\n if (doSwitch) {\n compatAPI.call(this);\n }\n\n if (typeof body !== \"function\") {\n return this;\n }\n\n body(this);\n\n if (doSwitch) {\n advancedAPI.call(this);\n }\n\n return this;\n };\n\n /**\n * @return {boolean} True iff the current API mode is \"advanced\". See {@link advancedAPI}.\n * @memberof jsPDF#\n * @name isAdvancedAPI\n */\n API.isAdvancedAPI = function() {\n return apiMode === ApiMode.ADVANCED;\n };\n\n var advancedApiModeTrap = function(methodName) {\n if (apiMode !== ApiMode.ADVANCED) {\n throw new Error(\n methodName +\n \" is only available in 'advanced' API mode. \" +\n \"You need to call advancedAPI() first.\"\n );\n }\n };\n\n var roundToPrecision = (API.roundToPrecision = API.__private__.roundToPrecision = function(\n number,\n parmPrecision\n ) {\n var tmpPrecision = precision || parmPrecision;\n if (isNaN(number) || isNaN(tmpPrecision)) {\n throw new Error(\"Invalid argument passed to jsPDF.roundToPrecision\");\n }\n return number.toFixed(tmpPrecision).replace(/0+$/, \"\");\n });\n\n // high precision float\n var hpf;\n if (typeof floatPrecision === \"number\") {\n hpf = API.hpf = API.__private__.hpf = function(number) {\n if (isNaN(number)) {\n throw new Error(\"Invalid argument passed to jsPDF.hpf\");\n }\n return roundToPrecision(number, floatPrecision);\n };\n } else if (floatPrecision === \"smart\") {\n hpf = API.hpf = API.__private__.hpf = function(number) {\n if (isNaN(number)) {\n throw new Error(\"Invalid argument passed to jsPDF.hpf\");\n }\n if (number > -1 && number < 1) {\n return roundToPrecision(number, 16);\n } else {\n return roundToPrecision(number, 5);\n }\n };\n } else {\n hpf = API.hpf = API.__private__.hpf = function(number) {\n if (isNaN(number)) {\n throw new Error(\"Invalid argument passed to jsPDF.hpf\");\n }\n return roundToPrecision(number, 16);\n };\n }\n var f2 = (API.f2 = API.__private__.f2 = function(number) {\n if (isNaN(number)) {\n throw new Error(\"Invalid argument passed to jsPDF.f2\");\n }\n return roundToPrecision(number, 2);\n });\n\n var f3 = (API.__private__.f3 = function(number) {\n if (isNaN(number)) {\n throw new Error(\"Invalid argument passed to jsPDF.f3\");\n }\n return roundToPrecision(number, 3);\n });\n\n var scale = (API.scale = API.__private__.scale = function(number) {\n if (isNaN(number)) {\n throw new Error(\"Invalid argument passed to jsPDF.scale\");\n }\n if (apiMode === ApiMode.COMPAT) {\n return number * scaleFactor;\n } else if (apiMode === ApiMode.ADVANCED) {\n return number;\n }\n });\n\n var transformY = function(y) {\n if (apiMode === ApiMode.COMPAT) {\n return getPageHeight() - y;\n } else if (apiMode === ApiMode.ADVANCED) {\n return y;\n }\n };\n\n var transformScaleY = function(y) {\n return scale(transformY(y));\n };\n\n /**\n * @name setPrecision\n * @memberof jsPDF#\n * @function\n * @instance\n * @param {string} precision\n * @returns {jsPDF}\n */\n API.__private__.setPrecision = API.setPrecision = function(value) {\n if (typeof parseInt(value, 10) === \"number\") {\n precision = parseInt(value, 10);\n }\n };\n\n var fileId = \"00000000000000000000000000000000\";\n\n var getFileId = (API.__private__.getFileId = function() {\n return fileId;\n });\n\n var setFileId = (API.__private__.setFileId = function(value) {\n if (typeof value !== \"undefined\" && /^[a-fA-F0-9]{32}$/.test(value)) {\n fileId = value.toUpperCase();\n } else {\n fileId = fileId\n .split(\"\")\n .map(function() {\n return \"ABCDEF0123456789\".charAt(Math.floor(Math.random() * 16));\n })\n .join(\"\");\n }\n return fileId;\n });\n\n /**\n * @name setFileId\n * @memberof jsPDF#\n * @function\n * @instance\n * @param {string} value GUID.\n * @returns {jsPDF}\n */\n API.setFileId = function(value) {\n setFileId(value);\n return this;\n };\n\n /**\n * @name getFileId\n * @memberof jsPDF#\n * @function\n * @instance\n *\n * @returns {string} GUID.\n */\n API.getFileId = function() {\n return getFileId();\n };\n\n var creationDate;\n\n var convertDateToPDFDate = (API.__private__.convertDateToPDFDate = function(\n parmDate\n ) {\n var result = \"\";\n var tzoffset = parmDate.getTimezoneOffset(),\n tzsign = tzoffset < 0 ? \"+\" : \"-\",\n tzhour = Math.floor(Math.abs(tzoffset / 60)),\n tzmin = Math.abs(tzoffset % 60),\n timeZoneString = [tzsign, padd2(tzhour), \"'\", padd2(tzmin), \"'\"].join(\"\");\n\n result = [\n \"D:\",\n parmDate.getFullYear(),\n padd2(parmDate.getMonth() + 1),\n padd2(parmDate.getDate()),\n padd2(parmDate.getHours()),\n padd2(parmDate.getMinutes()),\n padd2(parmDate.getSeconds()),\n timeZoneString\n ].join(\"\");\n return result;\n });\n\n var convertPDFDateToDate = (API.__private__.convertPDFDateToDate = function(\n parmPDFDate\n ) {\n var year = parseInt(parmPDFDate.substr(2, 4), 10);\n var month = parseInt(parmPDFDate.substr(6, 2), 10) - 1;\n var date = parseInt(parmPDFDate.substr(8, 2), 10);\n var hour = parseInt(parmPDFDate.substr(10, 2), 10);\n var minutes = parseInt(parmPDFDate.substr(12, 2), 10);\n var seconds = parseInt(parmPDFDate.substr(14, 2), 10);\n // var timeZoneHour = parseInt(parmPDFDate.substr(16, 2), 10);\n // var timeZoneMinutes = parseInt(parmPDFDate.substr(20, 2), 10);\n\n var resultingDate = new Date(year, month, date, hour, minutes, seconds, 0);\n return resultingDate;\n });\n\n var setCreationDate = (API.__private__.setCreationDate = function(date) {\n var tmpCreationDateString;\n var regexPDFCreationDate = /^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\\+0[0-9]|\\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/;\n if (typeof date === \"undefined\") {\n date = new Date();\n }\n\n if (date instanceof Date) {\n tmpCreationDateString = convertDateToPDFDate(date);\n } else if (regexPDFCreationDate.test(date)) {\n tmpCreationDateString = date;\n } else {\n throw new Error(\"Invalid argument passed to jsPDF.setCreationDate\");\n }\n creationDate = tmpCreationDateString;\n return creationDate;\n });\n\n var getCreationDate = (API.__private__.getCreationDate = function(type) {\n var result = creationDate;\n if (type === \"jsDate\") {\n result = convertPDFDateToDate(creationDate);\n }\n return result;\n });\n\n /**\n * @name setCreationDate\n * @memberof jsPDF#\n * @function\n * @instance\n * @param {Object} date\n * @returns {jsPDF}\n */\n API.setCreationDate = function(date) {\n setCreationDate(date);\n return this;\n };\n\n /**\n * @name getCreationDate\n * @memberof jsPDF#\n * @function\n * @instance\n * @param {Object} type\n * @returns {Object}\n */\n API.getCreationDate = function(type) {\n return getCreationDate(type);\n };\n\n var padd2 = (API.__private__.padd2 = function(number) {\n return (\"0\" + parseInt(number)).slice(-2);\n });\n\n var padd2Hex = (API.__private__.padd2Hex = function(hexString) {\n hexString = hexString.toString();\n return (\"00\" + hexString).substr(hexString.length);\n });\n\n var objectNumber = 0; // 'n' Current object number\n var offsets = []; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.\n var content = [];\n var contentLength = 0;\n var additionalObjects = [];\n\n var pages = [];\n var currentPage;\n var hasCustomDestination = false;\n var outputDestination = content;\n\n var resetDocument = function() {\n //reset fields relevant for objectNumber generation and xref.\n objectNumber = 0;\n contentLength = 0;\n content = [];\n offsets = [];\n additionalObjects = [];\n\n rootDictionaryObjId = newObjectDeferred();\n resourceDictionaryObjId = newObjectDeferred();\n };\n\n API.__private__.setCustomOutputDestination = function(destination) {\n hasCustomDestination = true;\n outputDestination = destination;\n };\n var setOutputDestination = function(destination) {\n if (!hasCustomDestination) {\n outputDestination = destination;\n }\n };\n\n API.__private__.resetCustomOutputDestination = function() {\n hasCustomDestination = false;\n outputDestination = content;\n };\n\n var out = (API.__private__.out = function(string) {\n string = string.toString();\n contentLength += string.length + 1;\n outputDestination.push(string);\n\n return outputDestination;\n });\n\n var write = (API.__private__.write = function(value) {\n return out(\n arguments.length === 1\n ? value.toString()\n : Array.prototype.join.call(arguments, \" \")\n );\n });\n\n var getArrayBuffer = (API.__private__.getArrayBuffer = function(data) {\n var len = data.length,\n ab = new ArrayBuffer(len),\n u8 = new Uint8Array(ab);\n\n while (len--) u8[len] = data.charCodeAt(len);\n return ab;\n });\n\n var standardFonts = [\n [\"Helvetica\", \"helvetica\", \"normal\", \"WinAnsiEncoding\"],\n [\"Helvetica-Bold\", \"helvetica\", \"bold\", \"WinAnsiEncoding\"],\n [\"Helvetica-Oblique\", \"helvetica\", \"italic\", \"WinAnsiEncoding\"],\n [\"Helvetica-BoldOblique\", \"helvetica\", \"bolditalic\", \"WinAnsiEncoding\"],\n [\"Courier\", \"courier\", \"normal\", \"WinAnsiEncoding\"],\n [\"Courier-Bold\", \"courier\", \"bold\", \"WinAnsiEncoding\"],\n [\"Courier-Oblique\", \"courier\", \"italic\", \"WinAnsiEncoding\"],\n [\"Courier-BoldOblique\", \"courier\", \"bolditalic\", \"WinAnsiEncoding\"],\n [\"Times-Roman\", \"times\", \"normal\", \"WinAnsiEncoding\"],\n [\"Times-Bold\", \"times\", \"bold\", \"WinAnsiEncoding\"],\n [\"Times-Italic\", \"times\", \"italic\", \"WinAnsiEncoding\"],\n [\"Times-BoldItalic\", \"times\", \"bolditalic\", \"WinAnsiEncoding\"],\n [\"ZapfDingbats\", \"zapfdingbats\", \"normal\", null],\n [\"Symbol\", \"symbol\", \"normal\", null]\n ];\n\n API.__private__.getStandardFonts = function() {\n return standardFonts;\n };\n\n var activeFontSize = options.fontSize || 16;\n\n /**\n * Sets font size for upcoming text elements.\n *\n * @param {number} size Font size in points.\n * @function\n * @instance\n * @returns {jsPDF}\n * @memberof jsPDF#\n * @name setFontSize\n */\n API.__private__.setFontSize = API.setFontSize = function(size) {\n if (apiMode === ApiMode.ADVANCED) {\n activeFontSize = size / scaleFactor;\n } else {\n activeFontSize = size;\n }\n return this;\n };\n\n /**\n * Gets the fontsize for upcoming text elements.\n *\n * @function\n * @instance\n * @returns {number}\n * @memberof jsPDF#\n * @name getFontSize\n */\n var getFontSize = (API.__private__.getFontSize = API.getFontSize = function() {\n if (apiMode === ApiMode.COMPAT) {\n return activeFontSize;\n } else {\n return activeFontSize * scaleFactor;\n }\n });\n\n var R2L = options.R2L || false;\n\n /**\n * Set value of R2L functionality.\n *\n * @param {boolean} value\n * @function\n * @instance\n * @returns {jsPDF} jsPDF-instance\n * @memberof jsPDF#\n * @name setR2L\n */\n API.__private__.setR2L = API.setR2L = function(value) {\n R2L = value;\n return this;\n };\n\n /**\n * Get value of R2L functionality.\n *\n * @function\n * @instance\n * @returns {boolean} jsPDF-instance\n * @memberof jsPDF#\n * @name getR2L\n */\n API.__private__.getR2L = API.getR2L = function() {\n return R2L;\n };\n\n var zoomMode; // default: 1;\n\n var setZoomMode = (API.__private__.setZoomMode = function(zoom) {\n var validZoomModes = [\n undefined,\n null,\n \"fullwidth\",\n \"fullheight\",\n \"fullpage\",\n \"original\"\n ];\n\n if (/^\\d*\\.?\\d*%$/.test(zoom)) {\n zoomMode = zoom;\n } else if (!isNaN(zoom)) {\n zoomMode = parseInt(zoom, 10);\n } else if (validZoomModes.indexOf(zoom) !== -1) {\n zoomMode = zoom;\n } else {\n throw new Error(\n 'zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. \"' +\n zoom +\n '\" is not recognized.'\n );\n }\n });\n\n API.__private__.getZoomMode = function() {\n return zoomMode;\n };\n\n var pageMode; // default: 'UseOutlines';\n var setPageMode = (API.__private__.setPageMode = function(pmode) {\n var validPageModes = [\n undefined,\n null,\n \"UseNone\",\n \"UseOutlines\",\n \"UseThumbs\",\n \"FullScreen\"\n ];\n\n if (validPageModes.indexOf(pmode) == -1) {\n throw new Error(\n 'Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. \"' +\n pmode +\n '\" is not recognized.'\n );\n }\n pageMode = pmode;\n });\n\n API.__private__.getPageMode = function() {\n return pageMode;\n };\n\n var layoutMode; // default: 'continuous';\n var setLayoutMode = (API.__private__.setLayoutMode = function(layout) {\n var validLayoutModes = [\n undefined,\n null,\n \"continuous\",\n \"single\",\n \"twoleft\",\n \"tworight\",\n \"two\"\n ];\n\n if (validLayoutModes.indexOf(layout) == -1) {\n throw new Error(\n 'Layout mode must be one of continuous, single, twoleft, tworight. \"' +\n layout +\n '\" is not recognized.'\n );\n }\n layoutMode = layout;\n });\n\n API.__private__.getLayoutMode = function() {\n return layoutMode;\n };\n\n /**\n * Set the display mode options of the page like zoom and layout.\n *\n * @name setDisplayMode\n * @memberof jsPDF#\n * @function\n * @instance\n * @param {integer|String} zoom You can pass an integer or percentage as\n * a string. 2 will scale the document up 2x, '200%' will scale up by the\n * same amount. You can also set it to 'fullwidth', 'fullheight',\n * 'fullpage', or 'original'.\n *\n * Only certain PDF readers support this, such as Adobe Acrobat.\n *\n * @param {string} layout Layout mode can be: 'continuous' - this is the\n * default continuous scroll. 'single' - the single page mode only shows one\n * page at a time. 'twoleft' - two column left mode, first page starts on\n * the left, and 'tworight' - pages are laid out in two columns, with the\n * first page on the right. This would be used for books.\n * @param {string} pmode 'UseOutlines' - it shows the\n * outline of the document on the left. 'UseThumbs' - shows thumbnails along\n * the left. 'FullScreen' - prompts the user to enter fullscreen mode.\n *\n * @returns {jsPDF}\n */\n API.__private__.setDisplayMode = API.setDisplayMode = function(\n zoom,\n layout,\n pmode\n ) {\n setZoomMode(zoom);\n setLayoutMode(layout);\n setPageMode(pmode);\n return this;\n };\n\n var documentProperties = {\n title: \"\",\n subject: \"\",\n author: \"\",\n keywords: \"\",\n creator: \"\"\n };\n\n API.__private__.getDocumentProperty = function(key) {\n if (Object.keys(documentProperties).indexOf(key) === -1) {\n throw new Error(\"Invalid argument passed to jsPDF.getDocumentProperty\");\n }\n return documentProperties[key];\n };\n\n API.__private__.getDocumentProperties = function() {\n return documentProperties;\n };\n\n /**\n * Adds a properties to the PDF document.\n *\n * @param {Object} A property_name-to-property_value object structure.\n * @function\n * @instance\n * @returns {jsPDF}\n * @memberof jsPDF#\n * @name setDocumentProperties\n */\n API.__private__.setDocumentProperties = API.setProperties = API.setDocumentProperties = function(\n properties\n ) {\n // copying only those properties we can render.\n for (var property in documentProperties) {\n if (documentProperties.hasOwnProperty(property) && properties[property]) {\n documentProperties[property] = properties[property];\n }\n }\n return this;\n };\n\n API.__private__.setDocumentProperty = function(key, value) {\n if (Object.keys(documentProperties).indexOf(key) === -1) {\n throw new Error(\"Invalid arguments passed to jsPDF.setDocumentProperty\");\n }\n return (documentProperties[key] = value);\n };\n\n var fonts = {}; // collection of font objects, where key is fontKey - a dynamically created label for a given font.\n var fontmap = {}; // mapping structure fontName > fontStyle > font key - performance layer. See addFont()\n var activeFontKey; // will be string representing the KEY of the font as combination of fontName + fontStyle\n var fontStateStack = []; //\n var patterns = {}; // collection of pattern objects\n var patternMap = {}; // see fonts\n var gStates = {}; // collection of graphic state objects\n var gStatesMap = {}; // see fonts\n var activeGState = null;\n var scaleFactor; // Scale factor\n var page = 0;\n var pagesContext = [];\n var events = new PubSub(API);\n var hotfixes = options.hotfixes || [];\n\n var renderTargets = {};\n var renderTargetMap = {};\n var renderTargetStack = [];\n var pageX;\n var pageY;\n var pageMatrix; // only used for FormObjects\n\n /**\n * A matrix object for 2D homogenous transformations:
\n * | a b 0 |
\n * | c d 0 |
\n * | e f 1 |
\n * pdf multiplies matrices righthand: v' = v x m1 x m2 x ...\n *\n * @class\n * @name Matrix\n * @param {number} sx\n * @param {number} shy\n * @param {number} shx\n * @param {number} sy\n * @param {number} tx\n * @param {number} ty\n * @constructor\n */\n var Matrix = function(sx, shy, shx, sy, tx, ty) {\n if (!(this instanceof Matrix)) {\n return new Matrix(sx, shy, shx, sy, tx, ty);\n }\n\n if (isNaN(sx)) sx = 1;\n if (isNaN(shy)) shy = 0;\n if (isNaN(shx)) shx = 0;\n if (isNaN(sy)) sy = 1;\n if (isNaN(tx)) tx = 0;\n if (isNaN(ty)) ty = 0;\n\n this._matrix = [sx, shy, shx, sy, tx, ty];\n };\n\n /**\n * @name sx\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"sx\", {\n get: function() {\n return this._matrix[0];\n },\n set: function(value) {\n this._matrix[0] = value;\n }\n });\n\n /**\n * @name shy\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"shy\", {\n get: function() {\n return this._matrix[1];\n },\n set: function(value) {\n this._matrix[1] = value;\n }\n });\n\n /**\n * @name shx\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"shx\", {\n get: function() {\n return this._matrix[2];\n },\n set: function(value) {\n this._matrix[2] = value;\n }\n });\n\n /**\n * @name sy\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"sy\", {\n get: function() {\n return this._matrix[3];\n },\n set: function(value) {\n this._matrix[3] = value;\n }\n });\n\n /**\n * @name tx\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"tx\", {\n get: function() {\n return this._matrix[4];\n },\n set: function(value) {\n this._matrix[4] = value;\n }\n });\n\n /**\n * @name ty\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"ty\", {\n get: function() {\n return this._matrix[5];\n },\n set: function(value) {\n this._matrix[5] = value;\n }\n });\n\n Object.defineProperty(Matrix.prototype, \"a\", {\n get: function() {\n return this._matrix[0];\n },\n set: function(value) {\n this._matrix[0] = value;\n }\n });\n\n Object.defineProperty(Matrix.prototype, \"b\", {\n get: function() {\n return this._matrix[1];\n },\n set: function(value) {\n this._matrix[1] = value;\n }\n });\n\n Object.defineProperty(Matrix.prototype, \"c\", {\n get: function() {\n return this._matrix[2];\n },\n set: function(value) {\n this._matrix[2] = value;\n }\n });\n\n Object.defineProperty(Matrix.prototype, \"d\", {\n get: function() {\n return this._matrix[3];\n },\n set: function(value) {\n this._matrix[3] = value;\n }\n });\n\n Object.defineProperty(Matrix.prototype, \"e\", {\n get: function() {\n return this._matrix[4];\n },\n set: function(value) {\n this._matrix[4] = value;\n }\n });\n\n Object.defineProperty(Matrix.prototype, \"f\", {\n get: function() {\n return this._matrix[5];\n },\n set: function(value) {\n this._matrix[5] = value;\n }\n });\n\n /**\n * @name rotation\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"rotation\", {\n get: function() {\n return Math.atan2(this.shx, this.sx);\n }\n });\n\n /**\n * @name scaleX\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"scaleX\", {\n get: function() {\n return this.decompose().scale.sx;\n }\n });\n\n /**\n * @name scaleY\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"scaleY\", {\n get: function() {\n return this.decompose().scale.sy;\n }\n });\n\n /**\n * @name isIdentity\n * @memberof Matrix#\n */\n Object.defineProperty(Matrix.prototype, \"isIdentity\", {\n get: function() {\n if (this.sx !== 1) {\n return false;\n }\n if (this.shy !== 0) {\n return false;\n }\n if (this.shx !== 0) {\n return false;\n }\n if (this.sy !== 1) {\n return false;\n }\n if (this.tx !== 0) {\n return false;\n }\n if (this.ty !== 0) {\n return false;\n }\n return true;\n }\n });\n\n /**\n * Join the Matrix Values to a String\n *\n * @function join\n * @param {string} separator Specifies a string to separate each pair of adjacent elements of the array. The separator is converted to a string if necessary. If omitted, the array elements are separated with a comma (\",\"). If separator is an empty string, all elements are joined without any characters in between them.\n * @returns {string} A string with all array elements joined.\n * @memberof Matrix#\n */\n Matrix.prototype.join = function(separator) {\n return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty]\n .map(hpf)\n .join(separator);\n };\n\n /**\n * Multiply the matrix with given Matrix\n *\n * @function multiply\n * @param matrix\n * @returns {Matrix}\n * @memberof Matrix#\n */\n Matrix.prototype.multiply = function(matrix) {\n var sx = matrix.sx * this.sx + matrix.shy * this.shx;\n var shy = matrix.sx * this.shy + matrix.shy * this.sy;\n var shx = matrix.shx * this.sx + matrix.sy * this.shx;\n var sy = matrix.shx * this.shy + matrix.sy * this.sy;\n var tx = matrix.tx * this.sx + matrix.ty * this.shx + this.tx;\n var ty = matrix.tx * this.shy + matrix.ty * this.sy + this.ty;\n\n return new Matrix(sx, shy, shx, sy, tx, ty);\n };\n\n /**\n * @function decompose\n * @memberof Matrix#\n */\n Matrix.prototype.decompose = function() {\n var a = this.sx;\n var b = this.shy;\n var c = this.shx;\n var d = this.sy;\n var e = this.tx;\n var f = this.ty;\n\n var scaleX = Math.sqrt(a * a + b * b);\n a /= scaleX;\n b /= scaleX;\n\n var shear = a * c + b * d;\n c -= a * shear;\n d -= b * shear;\n\n var scaleY = Math.sqrt(c * c + d * d);\n c /= scaleY;\n d /= scaleY;\n shear /= scaleY;\n\n if (a * d < b * c) {\n a = -a;\n b = -b;\n shear = -shear;\n scaleX = -scaleX;\n }\n\n return {\n scale: new Matrix(scaleX, 0, 0, scaleY, 0, 0),\n translate: new Matrix(1, 0, 0, 1, e, f),\n rotate: new Matrix(a, b, -b, a, 0, 0),\n skew: new Matrix(1, 0, shear, 1, 0, 0)\n };\n };\n\n /**\n * @function toString\n * @memberof Matrix#\n */\n Matrix.prototype.toString = function(parmPrecision) {\n return this.join(\" \");\n };\n\n /**\n * @function inversed\n * @memberof Matrix#\n */\n Matrix.prototype.inversed = function() {\n var a = this.sx,\n b = this.shy,\n c = this.shx,\n d = this.sy,\n e = this.tx,\n f = this.ty;\n\n var quot = 1 / (a * d - b * c);\n\n var aInv = d * quot;\n var bInv = -b * quot;\n var cInv = -c * quot;\n var dInv = a * quot;\n var eInv = -aInv * e - cInv * f;\n var fInv = -bInv * e - dInv * f;\n\n return new Matrix(aInv, bInv, cInv, dInv, eInv, fInv);\n };\n\n /**\n * @function applyToPoint\n * @memberof Matrix#\n */\n Matrix.prototype.applyToPoint = function(pt) {\n var x = pt.x * this.sx + pt.y * this.shx + this.tx;\n var y = pt.x * this.shy + pt.y * this.sy + this.ty;\n return new Point(x, y);\n };\n\n /**\n * @function applyToRectangle\n * @memberof Matrix#\n */\n Matrix.prototype.applyToRectangle = function(rect) {\n var pt1 = this.applyToPoint(rect);\n var pt2 = this.applyToPoint(new Point(rect.x + rect.w, rect.y + rect.h));\n return new Rectangle(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y);\n };\n\n /**\n * Clone the Matrix\n *\n * @function clone\n * @memberof Matrix#\n * @name clone\n * @instance\n */\n Matrix.prototype.clone = function() {\n var sx = this.sx;\n var shy = this.shy;\n var shx = this.shx;\n var sy = this.sy;\n var tx = this.tx;\n var ty = this.ty;\n\n return new Matrix(sx, shy, shx, sy, tx, ty);\n };\n\n API.Matrix = Matrix;\n\n /**\n * Multiplies two matrices. (see {@link Matrix})\n * @param {Matrix} m1\n * @param {Matrix} m2\n * @memberof jsPDF#\n * @name matrixMult\n */\n var matrixMult = (API.matrixMult = function(m1, m2) {\n return m2.multiply(m1);\n });\n\n /**\n * The identity matrix (equivalent to new Matrix(1, 0, 0, 1, 0, 0)).\n * @type {Matrix}\n * @memberof! jsPDF#\n * @name identityMatrix\n */\n var identityMatrix = new Matrix(1, 0, 0, 1, 0, 0);\n API.unitMatrix = API.identityMatrix = identityMatrix;\n\n /**\n * Adds a new pattern for later use.\n * @param {String} key The key by it can be referenced later. The keys must be unique!\n * @param {API.Pattern} pattern The pattern\n */\n var addPattern = function(key, pattern) {\n // only add it if it is not already present (the keys provided by the user must be unique!)\n if (patternMap[key]) return;\n\n var prefix = pattern instanceof ShadingPattern ? \"Sh\" : \"P\";\n var patternKey = prefix + (Object.keys(patterns).length + 1).toString(10);\n pattern.id = patternKey;\n\n patternMap[key] = patternKey;\n patterns[patternKey] = pattern;\n\n events.publish(\"addPattern\", pattern);\n };\n\n /**\n * A pattern describing a shading pattern.\n *\n * Only available in \"advanced\" API mode.\n *\n * @param {String} type One of \"axial\" or \"radial\"\n * @param {Array} coords Either [x1, y1, x2, y2] for \"axial\" type describing the two interpolation points\n * or [x1, y1, r, x2, y2, r2] for \"radial\" describing inner and the outer circle.\n * @param {Array>\" });\n\n scope.internal.acroformPlugin.xForms.push(appearance);\n }\n\n // Assume AppearanceStreamContent is a Array with N,R,D (at least\n // one of them!)\n if (fieldObject.appearanceStreamContent) {\n var appearanceStreamString = \"\";\n // Iterate over N,R and D\n for (var k in fieldObject.appearanceStreamContent) {\n if (fieldObject.appearanceStreamContent.hasOwnProperty(k)) {\n var value = fieldObject.appearanceStreamContent[k];\n appearanceStreamString += \"/\" + k + \" \";\n appearanceStreamString += \"<<\";\n if (Object.keys(value).length >= 1 || Array.isArray(value)) {\n // appearanceStream is an Array or Object!\n for (var i in value) {\n if (value.hasOwnProperty(i)) {\n var obj = value[i];\n if (typeof obj === \"function\") {\n // if Function is referenced, call it in order\n // to get the FormXObject\n obj = obj.call(this, fieldObject);\n }\n appearanceStreamString += \"/\" + i + \" \" + obj + \" \";\n\n // In case the XForm is already used, e.g. OffState\n // of CheckBoxes, don't add it\n if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0))\n scope.internal.acroformPlugin.xForms.push(obj);\n }\n }\n } else {\n obj = value;\n if (typeof obj === \"function\") {\n // if Function is referenced, call it in order to\n // get the FormXObject\n obj = obj.call(this, fieldObject);\n }\n appearanceStreamString += \"/\" + i + \" \" + obj;\n if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0))\n scope.internal.acroformPlugin.xForms.push(obj);\n }\n appearanceStreamString += \">>\";\n }\n }\n\n // appearance stream is a normal Object..\n keyValueList.push({\n key: \"AP\",\n value: \"<<\\n\" + appearanceStreamString + \">>\"\n });\n }\n\n scope.internal.putStream({ additionalKeyValues: keyValueList });\n\n scope.internal.out(\"endobj\");\n }\n }\n if (standardFields) {\n createXFormObjectCallback.call(this, scope.internal.acroformPlugin.xForms);\n }\n};\n\nvar createXFormObjectCallback = function(fieldArray) {\n for (var i in fieldArray) {\n if (fieldArray.hasOwnProperty(i)) {\n var key = i;\n var fieldObject = fieldArray[i];\n // Start Writing the Object\n scope.internal.newObjectDeferredBegin(\n fieldObject && fieldObject.objId,\n true\n );\n\n if (\n typeof fieldObject === \"object\" &&\n typeof fieldObject.putStream === \"function\"\n ) {\n fieldObject.putStream();\n }\n delete fieldArray[key];\n }\n }\n};\n\nvar initializeAcroForm = function() {\n if (\n this.internal !== undefined &&\n (this.internal.acroformPlugin === undefined ||\n this.internal.acroformPlugin.isInitialized === false)\n ) {\n scope = this;\n\n AcroFormField.FieldNum = 0;\n this.internal.acroformPlugin = JSON.parse(\n JSON.stringify(acroformPluginTemplate)\n );\n if (this.internal.acroformPlugin.acroFormDictionaryRoot) {\n throw new Error(\"Exception while creating AcroformDictionary\");\n }\n scaleFactor = scope.internal.scaleFactor;\n // The Object Number of the AcroForm Dictionary\n scope.internal.acroformPlugin.acroFormDictionaryRoot = new AcroFormDictionary();\n\n // add Callback for creating the AcroForm Dictionary\n scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID = scope.internal.events.subscribe(\n \"postPutResources\",\n AcroFormDictionaryCallback\n );\n\n scope.internal.events.subscribe(\"buildDocument\", annotReferenceCallback); // buildDocument\n\n // Register event, that is triggered when the DocumentCatalog is\n // written, in order to add /AcroForm\n scope.internal.events.subscribe(\"putCatalog\", putCatalogCallback);\n\n // Register event, that creates all Fields\n scope.internal.events.subscribe(\"postPutPages\", createFieldCallback);\n\n scope.internal.acroformPlugin.isInitialized = true;\n }\n};\n\n//PDF 32000-1:2008, page 26, 7.3.6\nvar arrayToPdfArray = (jsPDFAPI.__acroform__.arrayToPdfArray = function(array) {\n if (Array.isArray(array)) {\n var content = \"[\";\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n content += \" \";\n }\n switch (typeof array[i]) {\n case \"boolean\":\n case \"number\":\n case \"object\":\n content += array[i].toString();\n break;\n case \"string\":\n if (array[i].substr(0, 1) !== \"/\") {\n content += \"(\" + pdfEscape(array[i].toString()) + \")\";\n } else {\n content += array[i].toString();\n }\n break;\n }\n }\n content += \"]\";\n return content;\n }\n throw new Error(\n \"Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray\"\n );\n});\nfunction getMatches(string, regex, index) {\n index || (index = 1); // default to the first capturing group\n var matches = [];\n var match;\n while ((match = regex.exec(string))) {\n matches.push(match[index]);\n }\n return matches;\n}\nvar pdfArrayToStringArray = function(array) {\n var result = [];\n if (typeof array === \"string\") {\n result = getMatches(array, /\\((.*?)\\)/g);\n }\n return result;\n};\n\nvar toPdfString = function(string) {\n string = string || \"\";\n string.toString();\n string = \"(\" + pdfEscape(string) + \")\";\n return string;\n};\n\n// ##########################\n// Classes\n// ##########################\n\n/**\n * @class AcroFormPDFObject\n * @classdesc A AcroFormPDFObject\n */\nvar AcroFormPDFObject = function() {\n var _objId;\n\n /**\n * @name AcroFormPDFObject#objId\n * @type {any}\n */\n Object.defineProperty(this, \"objId\", {\n configurable: true,\n get: function() {\n if (!_objId) {\n _objId = scope.internal.newObjectDeferred();\n }\n return _objId;\n },\n set: function(value) {\n _objId = value;\n }\n });\n};\n\n/**\n * @function AcroFormPDFObject.toString\n */\nAcroFormPDFObject.prototype.toString = function() {\n return this.objId + \" 0 R\";\n};\n\nAcroFormPDFObject.prototype.putStream = function() {\n var keyValueList = this.getKeyValueListForStream();\n scope.internal.putStream({\n data: this.stream,\n additionalKeyValues: keyValueList\n });\n scope.internal.out(\"endobj\");\n};\n\n/**\n * Returns an key-value-List of all non-configurable Variables from the Object\n *\n * @name getKeyValueListForStream\n * @returns {string}\n */\nAcroFormPDFObject.prototype.getKeyValueListForStream = function() {\n var createKeyValueListFromFieldObject = function(fieldObject) {\n var keyValueList = [];\n var keys = Object.getOwnPropertyNames(fieldObject).filter(function(key) {\n return (\n key != \"content\" &&\n key != \"appearanceStreamContent\" &&\n key.substring(0, 1) != \"_\"\n );\n });\n\n for (var i in keys) {\n if (\n Object.getOwnPropertyDescriptor(fieldObject, keys[i]).configurable ===\n false\n ) {\n var key = keys[i];\n var value = fieldObject[key];\n\n if (value) {\n if (Array.isArray(value)) {\n keyValueList.push({ key: key, value: arrayToPdfArray(value) });\n } else if (value instanceof AcroFormPDFObject) {\n // In case it is a reference to another PDFObject,\n // take the reference number\n keyValueList.push({ key: key, value: value.objId + \" 0 R\" });\n } else if (typeof value !== \"function\") {\n keyValueList.push({ key: key, value: value });\n }\n }\n }\n }\n return keyValueList;\n };\n\n return createKeyValueListFromFieldObject(this);\n};\n\nvar AcroFormXObject = function() {\n AcroFormPDFObject.call(this);\n\n Object.defineProperty(this, \"Type\", {\n value: \"/XObject\",\n configurable: false,\n writeable: true\n });\n\n Object.defineProperty(this, \"Subtype\", {\n value: \"/Form\",\n configurable: false,\n writeable: true\n });\n\n Object.defineProperty(this, \"FormType\", {\n value: 1,\n configurable: false,\n writeable: true\n });\n\n var _BBox = [];\n Object.defineProperty(this, \"BBox\", {\n configurable: false,\n writeable: true,\n get: function() {\n return _BBox;\n },\n set: function(value) {\n _BBox = value;\n }\n });\n\n Object.defineProperty(this, \"Resources\", {\n value: \"2 0 R\",\n configurable: false,\n writeable: true\n });\n\n var _stream;\n Object.defineProperty(this, \"stream\", {\n enumerable: false,\n configurable: true,\n set: function(value) {\n _stream = value.trim();\n },\n get: function() {\n if (_stream) {\n return _stream;\n } else {\n return null;\n }\n }\n });\n};\n\ninherit(AcroFormXObject, AcroFormPDFObject);\n\nvar AcroFormDictionary = function() {\n AcroFormPDFObject.call(this);\n\n var _Kids = [];\n\n Object.defineProperty(this, \"Kids\", {\n enumerable: false,\n configurable: true,\n get: function() {\n if (_Kids.length > 0) {\n return _Kids;\n } else {\n return undefined;\n }\n }\n });\n Object.defineProperty(this, \"Fields\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _Kids;\n }\n });\n\n // Default Appearance\n var _DA;\n Object.defineProperty(this, \"DA\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_DA) {\n return undefined;\n }\n return \"(\" + _DA + \")\";\n },\n set: function(value) {\n _DA = value;\n }\n });\n};\n\ninherit(AcroFormDictionary, AcroFormPDFObject);\n\n/**\n * The Field Object contains the Variables, that every Field needs\n *\n * @class AcroFormField\n * @classdesc An AcroForm FieldObject\n */\nvar AcroFormField = function() {\n AcroFormPDFObject.call(this);\n\n //Annotation-Flag See Table 165\n var _F = 4;\n Object.defineProperty(this, \"F\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _F;\n },\n set: function(value) {\n if (!isNaN(value)) {\n _F = value;\n } else {\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute F supplied.'\n );\n }\n }\n });\n\n /**\n * (PDF 1.2) If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of wether is is displayed on the screen.\n * NOTE 2 This can be useful for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page.\n *\n * @name AcroFormField#showWhenPrinted\n * @default true\n * @type {boolean}\n */\n Object.defineProperty(this, \"showWhenPrinted\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(_F, 3));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.F = setBitForPdf(_F, 3);\n } else {\n this.F = clearBitForPdf(_F, 3);\n }\n }\n });\n\n var _Ff = 0;\n Object.defineProperty(this, \"Ff\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _Ff;\n },\n set: function(value) {\n if (!isNaN(value)) {\n _Ff = value;\n } else {\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute Ff supplied.'\n );\n }\n }\n });\n\n var _Rect = [];\n Object.defineProperty(this, \"Rect\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (_Rect.length === 0) {\n return undefined;\n }\n return _Rect;\n },\n set: function(value) {\n if (typeof value !== \"undefined\") {\n _Rect = value;\n } else {\n _Rect = [];\n }\n }\n });\n\n /**\n * The x-position of the field.\n *\n * @name AcroFormField#x\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"x\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[0])) {\n return 0;\n }\n return _Rect[0];\n },\n set: function(value) {\n _Rect[0] = value;\n }\n });\n\n /**\n * The y-position of the field.\n *\n * @name AcroFormField#y\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"y\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[1])) {\n return 0;\n }\n return _Rect[1];\n },\n set: function(value) {\n _Rect[1] = value;\n }\n });\n\n /**\n * The width of the field.\n *\n * @name AcroFormField#width\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"width\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[2])) {\n return 0;\n }\n return _Rect[2];\n },\n set: function(value) {\n _Rect[2] = value;\n }\n });\n\n /**\n * The height of the field.\n *\n * @name AcroFormField#height\n * @default null\n * @type {number}\n */\n Object.defineProperty(this, \"height\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (!_Rect || isNaN(_Rect[3])) {\n return 0;\n }\n return _Rect[3];\n },\n set: function(value) {\n _Rect[3] = value;\n }\n });\n\n var _FT = \"\";\n Object.defineProperty(this, \"FT\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _FT;\n },\n set: function(value) {\n switch (value) {\n case \"/Btn\":\n case \"/Tx\":\n case \"/Ch\":\n case \"/Sig\":\n _FT = value;\n break;\n default:\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute FT supplied.'\n );\n }\n }\n });\n\n var _T = null;\n\n Object.defineProperty(this, \"T\", {\n enumerable: true,\n configurable: false,\n get: function() {\n if (!_T || _T.length < 1) {\n // In case of a Child from a Radio´Group, you don't need a FieldName\n if (this instanceof AcroFormChildClass) {\n return undefined;\n }\n _T = \"FieldObject\" + AcroFormField.FieldNum++;\n }\n return \"(\" + pdfEscape(_T) + \")\";\n },\n set: function(value) {\n _T = value.toString();\n }\n });\n\n /**\n * (Optional) The partial field name (see 12.7.3.2, “Field Names”).\n *\n * @name AcroFormField#fieldName\n * @default null\n * @type {string}\n */\n Object.defineProperty(this, \"fieldName\", {\n configurable: true,\n enumerable: true,\n get: function() {\n return _T;\n },\n set: function(value) {\n _T = value;\n }\n });\n\n var _fontName = \"helvetica\";\n /**\n * The fontName of the font to be used.\n *\n * @name AcroFormField#fontName\n * @default 'helvetica'\n * @type {string}\n */\n Object.defineProperty(this, \"fontName\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _fontName;\n },\n set: function(value) {\n _fontName = value;\n }\n });\n\n var _fontStyle = \"normal\";\n /**\n * The fontStyle of the font to be used.\n *\n * @name AcroFormField#fontStyle\n * @default 'normal'\n * @type {string}\n */\n Object.defineProperty(this, \"fontStyle\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _fontStyle;\n },\n set: function(value) {\n _fontStyle = value;\n }\n });\n\n var _fontSize = 0;\n /**\n * The fontSize of the font to be used.\n *\n * @name AcroFormField#fontSize\n * @default 0 (for auto)\n * @type {number}\n */\n Object.defineProperty(this, \"fontSize\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _fontSize;\n },\n set: function(value) {\n _fontSize = value;\n }\n });\n\n var _maxFontSize = undefined;\n /**\n * The maximum fontSize of the font to be used.\n *\n * @name AcroFormField#maxFontSize\n * @default 0 (for auto)\n * @type {number}\n */\n Object.defineProperty(this, \"maxFontSize\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (_maxFontSize === undefined) {\n // use the old default value here - the value is some kind of random as it depends on the scaleFactor (user unit)\n // (\"50\" is transformed to the \"user space\" but then used in \"pdf space\")\n return 50 / scaleFactor;\n } else {\n return _maxFontSize;\n }\n },\n set: function(value) {\n _maxFontSize = value;\n }\n });\n\n var _color = \"black\";\n /**\n * The color of the text\n *\n * @name AcroFormField#color\n * @default 'black'\n * @type {string|rgba}\n */\n Object.defineProperty(this, \"color\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _color;\n },\n set: function(value) {\n _color = value;\n }\n });\n\n var _DA = \"/F1 0 Tf 0 g\";\n // Defines the default appearance (Needed for variable Text)\n Object.defineProperty(this, \"DA\", {\n enumerable: true,\n configurable: false,\n get: function() {\n if (\n !_DA ||\n this instanceof AcroFormChildClass ||\n this instanceof AcroFormTextField\n ) {\n return undefined;\n }\n return toPdfString(_DA);\n },\n set: function(value) {\n value = value.toString();\n _DA = value;\n }\n });\n\n var _DV = null;\n Object.defineProperty(this, \"DV\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_DV) {\n return undefined;\n }\n if (this instanceof AcroFormButton === false) {\n return toPdfString(_DV);\n }\n return _DV;\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === false) {\n if (value.substr(0, 1) === \"(\") {\n _DV = pdfUnescape(value.substr(1, value.length - 2));\n } else {\n _DV = pdfUnescape(value);\n }\n } else {\n _DV = value;\n }\n }\n });\n\n /**\n * (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of value.\n *\n * @name AcroFormField#defaultValue\n * @default null\n * @type {any}\n */\n Object.defineProperty(this, \"defaultValue\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (this instanceof AcroFormButton === true) {\n return pdfUnescape(_DV.substr(1, _DV.length - 1));\n } else {\n return _DV;\n }\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === true) {\n _DV = \"/\" + value;\n } else {\n _DV = value;\n }\n }\n });\n\n var _V = null;\n Object.defineProperty(this, \"V\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (!_V) {\n return undefined;\n }\n if (this instanceof AcroFormButton === false) {\n return toPdfString(_V);\n }\n return _V;\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === false) {\n if (value.substr(0, 1) === \"(\") {\n _V = pdfUnescape(value.substr(1, value.length - 2));\n } else {\n _V = pdfUnescape(value);\n }\n } else {\n _V = value;\n }\n }\n });\n\n /**\n * (Optional; inheritable) The field’s value, whose format varies depending on the field type. See the descriptions of individual field types for further information.\n *\n * @name AcroFormField#value\n * @default null\n * @type {any}\n */\n Object.defineProperty(this, \"value\", {\n enumerable: true,\n configurable: true,\n get: function() {\n if (this instanceof AcroFormButton === true) {\n return pdfUnescape(_V.substr(1, _V.length - 1));\n } else {\n return _V;\n }\n },\n set: function(value) {\n value = value.toString();\n if (this instanceof AcroFormButton === true) {\n _V = \"/\" + value;\n } else {\n _V = value;\n }\n }\n });\n\n /**\n * Check if field has annotations\n *\n * @name AcroFormField#hasAnnotation\n * @readonly\n * @type {boolean}\n */\n Object.defineProperty(this, \"hasAnnotation\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.Rect;\n }\n });\n\n Object.defineProperty(this, \"Type\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return this.hasAnnotation ? \"/Annot\" : null;\n }\n });\n\n Object.defineProperty(this, \"Subtype\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return this.hasAnnotation ? \"/Widget\" : null;\n }\n });\n\n var _hasAppearanceStream = false;\n /**\n * true if field has an appearanceStream\n *\n * @name AcroFormField#hasAppearanceStream\n * @readonly\n * @type {boolean}\n */\n Object.defineProperty(this, \"hasAppearanceStream\", {\n enumerable: true,\n configurable: true,\n writeable: true,\n get: function() {\n return _hasAppearanceStream;\n },\n set: function(value) {\n value = Boolean(value);\n _hasAppearanceStream = value;\n }\n });\n\n /**\n * The page on which the AcroFormField is placed\n *\n * @name AcroFormField#page\n * @type {number}\n */\n var _page;\n Object.defineProperty(this, \"page\", {\n enumerable: true,\n configurable: true,\n writeable: true,\n get: function() {\n if (!_page) {\n return undefined;\n }\n return _page;\n },\n set: function(value) {\n _page = value;\n }\n });\n\n /**\n * If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database.\n *\n * @name AcroFormField#readOnly\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"readOnly\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 1));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 1);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 1);\n }\n }\n });\n\n /**\n * If set, the field shall have a value at the time it is exported by a submitform action (see 12.7.5.2, “Submit-Form Action”).\n *\n * @name AcroFormField#required\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"required\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 2));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 2);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 2);\n }\n }\n });\n\n /**\n * If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”)\n *\n * @name AcroFormField#noExport\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"noExport\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 3));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 3);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 3);\n }\n }\n });\n\n var _Q = null;\n Object.defineProperty(this, \"Q\", {\n enumerable: true,\n configurable: false,\n get: function() {\n if (_Q === null) {\n return undefined;\n }\n return _Q;\n },\n set: function(value) {\n if ([0, 1, 2].indexOf(value) !== -1) {\n _Q = value;\n } else {\n throw new Error(\n 'Invalid value \"' + value + '\" for attribute Q supplied.'\n );\n }\n }\n });\n\n /**\n * (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text:\n * 'left', 'center', 'right'\n *\n * @name AcroFormField#textAlign\n * @default 'left'\n * @type {string}\n */\n Object.defineProperty(this, \"textAlign\", {\n get: function() {\n var result;\n switch (_Q) {\n case 0:\n default:\n result = \"left\";\n break;\n case 1:\n result = \"center\";\n break;\n case 2:\n result = \"right\";\n break;\n }\n return result;\n },\n configurable: true,\n enumerable: true,\n set: function(value) {\n switch (value) {\n case \"right\":\n case 2:\n _Q = 2;\n break;\n case \"center\":\n case 1:\n _Q = 1;\n break;\n case \"left\":\n case 0:\n default:\n _Q = 0;\n }\n }\n });\n};\n\ninherit(AcroFormField, AcroFormPDFObject);\n\n/**\n * @class AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormChoiceField = function() {\n AcroFormField.call(this);\n // Field Type = Choice Field\n this.FT = \"/Ch\";\n // options\n this.V = \"()\";\n\n this.fontName = \"zapfdingbats\";\n // Top Index\n var _TI = 0;\n\n Object.defineProperty(this, \"TI\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _TI;\n },\n set: function(value) {\n _TI = value;\n }\n });\n\n /**\n * (Optional) For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0.\n *\n * @name AcroFormChoiceField#topIndex\n * @default 0\n * @type {number}\n */\n Object.defineProperty(this, \"topIndex\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _TI;\n },\n set: function(value) {\n _TI = value;\n }\n });\n\n var _Opt = [];\n Object.defineProperty(this, \"Opt\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return arrayToPdfArray(_Opt);\n },\n set: function(value) {\n _Opt = pdfArrayToStringArray(value);\n }\n });\n\n /**\n * @memberof AcroFormChoiceField\n * @name getOptions\n * @function\n * @instance\n * @returns {array} array of Options\n */\n this.getOptions = function() {\n return _Opt;\n };\n\n /**\n * @memberof AcroFormChoiceField\n * @name setOptions\n * @function\n * @instance\n * @param {array} value\n */\n this.setOptions = function(value) {\n _Opt = value;\n if (this.sort) {\n _Opt.sort();\n }\n };\n\n /**\n * @memberof AcroFormChoiceField\n * @name addOption\n * @function\n * @instance\n * @param {string} value\n */\n this.addOption = function(value) {\n value = value || \"\";\n value = value.toString();\n _Opt.push(value);\n if (this.sort) {\n _Opt.sort();\n }\n };\n\n /**\n * @memberof AcroFormChoiceField\n * @name removeOption\n * @function\n * @instance\n * @param {string} value\n * @param {boolean} allEntries (default: false)\n */\n this.removeOption = function(value, allEntries) {\n allEntries = allEntries || false;\n value = value || \"\";\n value = value.toString();\n\n while (_Opt.indexOf(value) !== -1) {\n _Opt.splice(_Opt.indexOf(value), 1);\n if (allEntries === false) {\n break;\n }\n }\n };\n\n /**\n * If set, the field is a combo box; if clear, the field is a list box.\n *\n * @name AcroFormChoiceField#combo\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"combo\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 18));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 18);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 18);\n }\n }\n });\n\n /**\n * If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set.\n *\n * @name AcroFormChoiceField#edit\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"edit\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 19));\n },\n set: function(value) {\n //PDF 32000-1:2008, page 444\n if (this.combo === true) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 19);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 19);\n }\n }\n }\n });\n\n /**\n * If set, the field’s option items shall be sorted alphabetically. This flag is intended for use by writers, not by readers. Conforming readers shall display the options in the order in which they occur in the Opt array (see Table 231).\n *\n * @name AcroFormChoiceField#sort\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"sort\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 20));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 20);\n _Opt.sort();\n } else {\n this.Ff = clearBitForPdf(this.Ff, 20);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected\n *\n * @name AcroFormChoiceField#multiSelect\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"multiSelect\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 22));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 22);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 22);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, text entered in the field shall not be spellchecked. This flag shall not be used unless the Combo and Edit flags are both set.\n *\n * @name AcroFormChoiceField#doNotSpellCheck\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"doNotSpellCheck\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 23));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 23);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 23);\n }\n }\n });\n\n /**\n * (PDF 1.5) If set, the new value shall be committed as soon as a selection is made (commonly with the pointing device). In this case, supplying a value for a field involves three actions: selecting the field for fill-in, selecting a choice for the fill-in value, and leaving that field, which finalizes or “commits” the data choice and triggers any actions associated with the entry or changing of this data. If this flag is on, then processing does not wait for leaving the field action to occur, but immediately proceeds to the third step.\n * This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field.\n *\n * @name AcroFormChoiceField#commitOnSelChange\n * @default false\n * @type {boolean}\n */\n Object.defineProperty(this, \"commitOnSelChange\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 27));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 27);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 27);\n }\n }\n });\n\n this.hasAppearanceStream = false;\n};\ninherit(AcroFormChoiceField, AcroFormField);\n\n/**\n * @class AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormListBox = function() {\n AcroFormChoiceField.call(this);\n this.fontName = \"helvetica\";\n\n //PDF 32000-1:2008, page 444\n this.combo = false;\n};\ninherit(AcroFormListBox, AcroFormChoiceField);\n\n/**\n * @class AcroFormComboBox\n * @extends AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormComboBox = function() {\n AcroFormListBox.call(this);\n this.combo = true;\n};\ninherit(AcroFormComboBox, AcroFormListBox);\n\n/**\n * @class AcroFormEditBox\n * @extends AcroFormComboBox\n * @extends AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormEditBox = function() {\n AcroFormComboBox.call(this);\n this.edit = true;\n};\ninherit(AcroFormEditBox, AcroFormComboBox);\n\n/**\n * @class AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormButton = function() {\n AcroFormField.call(this);\n this.FT = \"/Btn\";\n\n /**\n * (Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected.\n *\n * @name AcroFormButton#noToggleToOff\n * @type {boolean}\n */\n Object.defineProperty(this, \"noToggleToOff\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 15));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 15);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 15);\n }\n }\n });\n\n /**\n * If set, the field is a set of radio buttons; if clear, the field is a checkbox. This flag may be set only if the Pushbutton flag is clear.\n *\n * @name AcroFormButton#radio\n * @type {boolean}\n */\n Object.defineProperty(this, \"radio\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 16));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 16);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 16);\n }\n }\n });\n\n /**\n * If set, the field is a pushbutton that does not retain a permanent value.\n *\n * @name AcroFormButton#pushButton\n * @type {boolean}\n */\n Object.defineProperty(this, \"pushButton\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 17));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 17);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 17);\n }\n }\n });\n\n /**\n * (PDF 1.5) If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons).\n *\n * @name AcroFormButton#radioIsUnison\n * @type {boolean}\n */\n Object.defineProperty(this, \"radioIsUnison\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 26));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 26);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 26);\n }\n }\n });\n\n var _MK = {};\n Object.defineProperty(this, \"MK\", {\n enumerable: false,\n configurable: false,\n get: function() {\n if (Object.keys(_MK).length !== 0) {\n var result = [];\n result.push(\"<<\");\n var key;\n for (key in _MK) {\n result.push(\"/\" + key + \" (\" + _MK[key] + \")\");\n }\n result.push(\">>\");\n return result.join(\"\\n\");\n }\n return undefined;\n },\n set: function(value) {\n if (typeof value === \"object\") {\n _MK = value;\n }\n }\n });\n\n /**\n * From the PDF reference:\n * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user.\n * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, \"Button Fields\"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, \"Button Fields\") and radio buttons (Radio Buttons in 12.7.4.2, \"Button Fields\").\n *\n * - '8' = Cross,\n * - 'l' = Circle,\n * - '' = nothing\n * @name AcroFormButton#caption\n * @type {string}\n */\n Object.defineProperty(this, \"caption\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _MK.CA || \"\";\n },\n set: function(value) {\n if (typeof value === \"string\") {\n _MK.CA = value;\n }\n }\n });\n\n var _AS;\n Object.defineProperty(this, \"AS\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _AS;\n },\n set: function(value) {\n _AS = value;\n }\n });\n\n /**\n * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, \"Appearance Streams\")\n *\n * @name AcroFormButton#appearanceState\n * @type {any}\n */\n Object.defineProperty(this, \"appearanceState\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _AS.substr(1, _AS.length - 1);\n },\n set: function(value) {\n _AS = \"/\" + value;\n }\n });\n};\ninherit(AcroFormButton, AcroFormField);\n\n/**\n * @class AcroFormPushButton\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormPushButton = function() {\n AcroFormButton.call(this);\n this.pushButton = true;\n};\ninherit(AcroFormPushButton, AcroFormButton);\n\n/**\n * @class AcroFormRadioButton\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormRadioButton = function() {\n AcroFormButton.call(this);\n this.radio = true;\n this.pushButton = false;\n\n var _Kids = [];\n Object.defineProperty(this, \"Kids\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _Kids;\n },\n set: function(value) {\n if (typeof value !== \"undefined\") {\n _Kids = value;\n } else {\n _Kids = [];\n }\n }\n });\n};\ninherit(AcroFormRadioButton, AcroFormButton);\n\n/**\n * The Child class of a RadioButton (the radioGroup) -> The single Buttons\n *\n * @class AcroFormChildClass\n * @extends AcroFormField\n * @ignore\n */\nvar AcroFormChildClass = function() {\n AcroFormField.call(this);\n\n var _parent;\n Object.defineProperty(this, \"Parent\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _parent;\n },\n set: function(value) {\n _parent = value;\n }\n });\n\n var _optionName;\n Object.defineProperty(this, \"optionName\", {\n enumerable: false,\n configurable: true,\n get: function() {\n return _optionName;\n },\n set: function(value) {\n _optionName = value;\n }\n });\n\n var _MK = {};\n Object.defineProperty(this, \"MK\", {\n enumerable: false,\n configurable: false,\n get: function() {\n var result = [];\n result.push(\"<<\");\n var key;\n for (key in _MK) {\n result.push(\"/\" + key + \" (\" + _MK[key] + \")\");\n }\n result.push(\">>\");\n return result.join(\"\\n\");\n },\n set: function(value) {\n if (typeof value === \"object\") {\n _MK = value;\n }\n }\n });\n\n /**\n * From the PDF reference:\n * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user.\n * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, \"Button Fields\"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, \"Button Fields\") and radio buttons (Radio Buttons in 12.7.4.2, \"Button Fields\").\n *\n * - '8' = Cross,\n * - 'l' = Circle,\n * - '' = nothing\n * @name AcroFormButton#caption\n * @type {string}\n */\n Object.defineProperty(this, \"caption\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _MK.CA || \"\";\n },\n set: function(value) {\n if (typeof value === \"string\") {\n _MK.CA = value;\n }\n }\n });\n\n var _AS;\n Object.defineProperty(this, \"AS\", {\n enumerable: false,\n configurable: false,\n get: function() {\n return _AS;\n },\n set: function(value) {\n _AS = value;\n }\n });\n\n /**\n * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, \"Appearance Streams\")\n *\n * @name AcroFormButton#appearanceState\n * @type {any}\n */\n Object.defineProperty(this, \"appearanceState\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _AS.substr(1, _AS.length - 1);\n },\n set: function(value) {\n _AS = \"/\" + value;\n }\n });\n this.caption = \"l\";\n this.appearanceState = \"Off\";\n // todo: set AppearanceType as variable that can be set from the\n // outside...\n this._AppearanceType = AcroFormAppearance.RadioButton.Circle;\n // The Default appearanceType is the Circle\n this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(\n this.optionName\n );\n};\ninherit(AcroFormChildClass, AcroFormField);\n\nAcroFormRadioButton.prototype.setAppearance = function(appearance) {\n if (!(\"createAppearanceStream\" in appearance && \"getCA\" in appearance)) {\n throw new Error(\n \"Couldn't assign Appearance to RadioButton. Appearance was Invalid!\"\n );\n }\n for (var objId in this.Kids) {\n if (this.Kids.hasOwnProperty(objId)) {\n var child = this.Kids[objId];\n child.appearanceStreamContent = appearance.createAppearanceStream(\n child.optionName\n );\n child.caption = appearance.getCA();\n }\n }\n};\n\nAcroFormRadioButton.prototype.createOption = function(name) {\n // Create new Child for RadioGroup\n var child = new AcroFormChildClass();\n child.Parent = this;\n child.optionName = name;\n // Add to Parent\n this.Kids.push(child);\n\n addField.call(this, child);\n\n return child;\n};\n\n/**\n * @class AcroFormCheckBox\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormCheckBox = function() {\n AcroFormButton.call(this);\n\n this.fontName = \"zapfdingbats\";\n this.caption = \"3\";\n this.appearanceState = \"On\";\n this.value = \"On\";\n this.textAlign = \"center\";\n this.appearanceStreamContent = AcroFormAppearance.CheckBox.createAppearanceStream();\n};\ninherit(AcroFormCheckBox, AcroFormButton);\n\n/**\n * @class AcroFormTextField\n * @extends AcroFormField\n */\nvar AcroFormTextField = function() {\n AcroFormField.call(this);\n this.FT = \"/Tx\";\n\n /**\n * If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line.\n *\n * @name AcroFormTextField#multiline\n * @type {boolean}\n */\n Object.defineProperty(this, \"multiline\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 13));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 13);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 13);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, the text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field.\n *\n * @name AcroFormTextField#fileSelect\n * @type {boolean}\n */\n Object.defineProperty(this, \"fileSelect\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 21));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 21);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 21);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, text entered in the field shall not be spell-checked.\n *\n * @name AcroFormTextField#doNotSpellCheck\n * @type {boolean}\n */\n Object.defineProperty(this, \"doNotSpellCheck\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 23));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 23);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 23);\n }\n }\n });\n\n /**\n * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for noninteractive form filling, the filler should take care not to add more character than will visibly fit in the defined area.\n *\n * @name AcroFormTextField#doNotScroll\n * @type {boolean}\n */\n Object.defineProperty(this, \"doNotScroll\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 24));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 24);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 24);\n }\n }\n });\n\n /**\n * (PDF 1.5) May be set only if the MaxLen entry is present in the text field dictionary (see Table 229) and if the Multiline, Password, and FileSelect flags are clear. If set, the field shall be automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.\n *\n * @name AcroFormTextField#comb\n * @type {boolean}\n */\n Object.defineProperty(this, \"comb\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 25));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 25);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 25);\n }\n }\n });\n\n /**\n * (PDF 1.5) If set, the value of this field shall be a rich text string (see 12.7.3.4, “Rich Text Strings”). If the field has a value, the RV entry of the field dictionary (Table 222) shall specify the rich text string.\n *\n * @name AcroFormTextField#richText\n * @type {boolean}\n */\n Object.defineProperty(this, \"richText\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 26));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 26);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 26);\n }\n }\n });\n\n var _MaxLen = null;\n Object.defineProperty(this, \"MaxLen\", {\n enumerable: true,\n configurable: false,\n get: function() {\n return _MaxLen;\n },\n set: function(value) {\n _MaxLen = value;\n }\n });\n\n /**\n * (Optional; inheritable) The maximum length of the field’s text, in characters.\n *\n * @name AcroFormTextField#maxLength\n * @type {number}\n */\n Object.defineProperty(this, \"maxLength\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return _MaxLen;\n },\n set: function(value) {\n if (Number.isInteger(value)) {\n _MaxLen = value;\n }\n }\n });\n\n Object.defineProperty(this, \"hasAppearanceStream\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return this.V || this.DV;\n }\n });\n};\ninherit(AcroFormTextField, AcroFormField);\n\n/**\n * @class AcroFormPasswordField\n * @extends AcroFormTextField\n * @extends AcroFormField\n */\nvar AcroFormPasswordField = function() {\n AcroFormTextField.call(this);\n\n /**\n * If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters.\n * NOTE To protect password confidentiality, readers should never store the value of the text field in the PDF file if this flag is set.\n *\n * @name AcroFormTextField#password\n * @type {boolean}\n */\n Object.defineProperty(this, \"password\", {\n enumerable: true,\n configurable: true,\n get: function() {\n return Boolean(getBitForPdf(this.Ff, 14));\n },\n set: function(value) {\n if (Boolean(value) === true) {\n this.Ff = setBitForPdf(this.Ff, 14);\n } else {\n this.Ff = clearBitForPdf(this.Ff, 14);\n }\n }\n });\n this.password = true;\n};\ninherit(AcroFormPasswordField, AcroFormTextField);\n\n// Contains Methods for creating standard appearances\nvar AcroFormAppearance = {\n CheckBox: {\n createAppearanceStream: function() {\n var appearance = {\n N: {\n On: AcroFormAppearance.CheckBox.YesNormal\n },\n D: {\n On: AcroFormAppearance.CheckBox.YesPushDown,\n Off: AcroFormAppearance.CheckBox.OffPushDown\n }\n };\n\n return appearance;\n },\n /**\n * Returns the standard On Appearance for a CheckBox\n *\n * @returns {AcroFormXObject}\n */\n YesPushDown: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n var fontKey = scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n var encodedColor = scope.__private__.encodeColorString(formObject.color);\n var calcRes = calculateX(formObject, formObject.caption);\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n stream.push(\"BMC\");\n stream.push(\"q\");\n stream.push(\"0 0 1 rg\");\n stream.push(\n \"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf \" + encodedColor\n );\n stream.push(\"BT\");\n stream.push(calcRes.text);\n stream.push(\"ET\");\n stream.push(\"Q\");\n stream.push(\"EMC\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n\n YesNormal: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var fontKey = scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n var encodedColor = scope.__private__.encodeColorString(formObject.color);\n var stream = [];\n var height = AcroFormAppearance.internal.getHeight(formObject);\n var width = AcroFormAppearance.internal.getWidth(formObject);\n var calcRes = calculateX(formObject, formObject.caption);\n stream.push(\"1 g\");\n stream.push(\"0 0 \" + f2(width) + \" \" + f2(height) + \" re\");\n stream.push(\"f\");\n stream.push(\"q\");\n stream.push(\"0 0 1 rg\");\n stream.push(\"0 0 \" + f2(width - 1) + \" \" + f2(height - 1) + \" re\");\n stream.push(\"W\");\n stream.push(\"n\");\n stream.push(\"0 g\");\n stream.push(\"BT\");\n stream.push(\n \"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf \" + encodedColor\n );\n stream.push(calcRes.text);\n stream.push(\"ET\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n\n /**\n * Returns the standard Off Appearance for a CheckBox\n *\n * @returns {AcroFormXObject}\n */\n OffPushDown: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n }\n },\n\n RadioButton: {\n Circle: {\n createAppearanceStream: function(name) {\n var appearanceStreamContent = {\n D: {\n Off: AcroFormAppearance.RadioButton.Circle.OffPushDown\n },\n N: {}\n };\n appearanceStreamContent.N[name] =\n AcroFormAppearance.RadioButton.Circle.YesNormal;\n appearanceStreamContent.D[name] =\n AcroFormAppearance.RadioButton.Circle.YesPushDown;\n return appearanceStreamContent;\n },\n getCA: function() {\n return \"l\";\n },\n\n YesNormal: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n // Make the Radius of the Circle relative to min(height, width) of formObject\n var DotRadius =\n AcroFormAppearance.internal.getWidth(formObject) <=\n AcroFormAppearance.internal.getHeight(formObject)\n ? AcroFormAppearance.internal.getWidth(formObject) / 4\n : AcroFormAppearance.internal.getHeight(formObject) / 4;\n // The Borderpadding...\n DotRadius = Number((DotRadius * 0.9).toFixed(5));\n var c = AcroFormAppearance.internal.Bezier_C;\n var DotRadiusBezier = Number((DotRadius * c).toFixed(5));\n /*\n * The Following is a Circle created with Bezier-Curves.\n */\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(DotRadius + \" 0 m\");\n stream.push(\n DotRadius +\n \" \" +\n DotRadiusBezier +\n \" \" +\n DotRadiusBezier +\n \" \" +\n DotRadius +\n \" 0 \" +\n DotRadius +\n \" c\"\n );\n stream.push(\n \"-\" +\n DotRadiusBezier +\n \" \" +\n DotRadius +\n \" -\" +\n DotRadius +\n \" \" +\n DotRadiusBezier +\n \" -\" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\n \"-\" +\n DotRadius +\n \" -\" +\n DotRadiusBezier +\n \" -\" +\n DotRadiusBezier +\n \" -\" +\n DotRadius +\n \" 0 -\" +\n DotRadius +\n \" c\"\n );\n stream.push(\n DotRadiusBezier +\n \" -\" +\n DotRadius +\n \" \" +\n DotRadius +\n \" -\" +\n DotRadiusBezier +\n \" \" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\"f\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n YesPushDown: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n var DotRadius =\n AcroFormAppearance.internal.getWidth(formObject) <=\n AcroFormAppearance.internal.getHeight(formObject)\n ? AcroFormAppearance.internal.getWidth(formObject) / 4\n : AcroFormAppearance.internal.getHeight(formObject) / 4;\n // The Borderpadding...\n var DotRadius = Number((DotRadius * 0.9).toFixed(5));\n // Save results for later use; no need to waste\n // processor ticks on doing math\n var k = Number((DotRadius * 2).toFixed(5));\n var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));\n var dc = Number(\n (DotRadius * AcroFormAppearance.internal.Bezier_C).toFixed(5)\n );\n\n stream.push(\"0.749023 g\");\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(k + \" 0 m\");\n stream.push(k + \" \" + kc + \" \" + kc + \" \" + k + \" 0 \" + k + \" c\");\n stream.push(\n \"-\" + kc + \" \" + k + \" -\" + k + \" \" + kc + \" -\" + k + \" 0 c\"\n );\n stream.push(\n \"-\" + k + \" -\" + kc + \" -\" + kc + \" -\" + k + \" 0 -\" + k + \" c\"\n );\n stream.push(kc + \" -\" + k + \" \" + k + \" -\" + kc + \" \" + k + \" 0 c\");\n stream.push(\"f\");\n stream.push(\"Q\");\n stream.push(\"0 g\");\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(DotRadius + \" 0 m\");\n stream.push(\n \"\" +\n DotRadius +\n \" \" +\n dc +\n \" \" +\n dc +\n \" \" +\n DotRadius +\n \" 0 \" +\n DotRadius +\n \" c\"\n );\n stream.push(\n \"-\" +\n dc +\n \" \" +\n DotRadius +\n \" -\" +\n DotRadius +\n \" \" +\n dc +\n \" -\" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\n \"-\" +\n DotRadius +\n \" -\" +\n dc +\n \" -\" +\n dc +\n \" -\" +\n DotRadius +\n \" 0 -\" +\n DotRadius +\n \" c\"\n );\n stream.push(\n dc +\n \" -\" +\n DotRadius +\n \" \" +\n DotRadius +\n \" -\" +\n dc +\n \" \" +\n DotRadius +\n \" 0 c\"\n );\n stream.push(\"f\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n OffPushDown: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n var DotRadius =\n AcroFormAppearance.internal.getWidth(formObject) <=\n AcroFormAppearance.internal.getHeight(formObject)\n ? AcroFormAppearance.internal.getWidth(formObject) / 4\n : AcroFormAppearance.internal.getHeight(formObject) / 4;\n // The Borderpadding...\n DotRadius = Number((DotRadius * 0.9).toFixed(5));\n // Save results for later use; no need to waste\n // processor ticks on doing math\n var k = Number((DotRadius * 2).toFixed(5));\n var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));\n\n stream.push(\"0.749023 g\");\n stream.push(\"q\");\n stream.push(\n \"1 0 0 1 \" +\n f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n \" \" +\n f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n \" cm\"\n );\n stream.push(k + \" 0 m\");\n stream.push(k + \" \" + kc + \" \" + kc + \" \" + k + \" 0 \" + k + \" c\");\n stream.push(\n \"-\" + kc + \" \" + k + \" -\" + k + \" \" + kc + \" -\" + k + \" 0 c\"\n );\n stream.push(\n \"-\" + k + \" -\" + kc + \" -\" + kc + \" -\" + k + \" 0 -\" + k + \" c\"\n );\n stream.push(kc + \" -\" + k + \" \" + k + \" -\" + kc + \" \" + k + \" 0 c\");\n stream.push(\"f\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n }\n },\n\n Cross: {\n /**\n * Creates the Actual AppearanceDictionary-References\n *\n * @param {string} name\n * @returns {Object}\n * @ignore\n */\n createAppearanceStream: function(name) {\n var appearanceStreamContent = {\n D: {\n Off: AcroFormAppearance.RadioButton.Cross.OffPushDown\n },\n N: {}\n };\n appearanceStreamContent.N[name] =\n AcroFormAppearance.RadioButton.Cross.YesNormal;\n appearanceStreamContent.D[name] =\n AcroFormAppearance.RadioButton.Cross.YesPushDown;\n return appearanceStreamContent;\n },\n getCA: function() {\n return \"8\";\n },\n\n YesNormal: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n var cross = AcroFormAppearance.internal.calculateCross(formObject);\n stream.push(\"q\");\n stream.push(\n \"1 1 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject) - 2) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject) - 2) +\n \" re\"\n );\n stream.push(\"W\");\n stream.push(\"n\");\n stream.push(f2(cross.x1.x) + \" \" + f2(cross.x1.y) + \" m\");\n stream.push(f2(cross.x2.x) + \" \" + f2(cross.x2.y) + \" l\");\n stream.push(f2(cross.x4.x) + \" \" + f2(cross.x4.y) + \" m\");\n stream.push(f2(cross.x3.x) + \" \" + f2(cross.x3.y) + \" l\");\n stream.push(\"s\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n YesPushDown: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var cross = AcroFormAppearance.internal.calculateCross(formObject);\n var stream = [];\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n stream.push(\"q\");\n stream.push(\n \"1 1 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject) - 2) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject) - 2) +\n \" re\"\n );\n stream.push(\"W\");\n stream.push(\"n\");\n stream.push(f2(cross.x1.x) + \" \" + f2(cross.x1.y) + \" m\");\n stream.push(f2(cross.x2.x) + \" \" + f2(cross.x2.y) + \" l\");\n stream.push(f2(cross.x4.x) + \" \" + f2(cross.x4.y) + \" m\");\n stream.push(f2(cross.x3.x) + \" \" + f2(cross.x3.y) + \" l\");\n stream.push(\"s\");\n stream.push(\"Q\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n },\n OffPushDown: function(formObject) {\n var xobj = new createFormXObject(formObject);\n var stream = [];\n stream.push(\"0.749023 g\");\n stream.push(\n \"0 0 \" +\n f2(AcroFormAppearance.internal.getWidth(formObject)) +\n \" \" +\n f2(AcroFormAppearance.internal.getHeight(formObject)) +\n \" re\"\n );\n stream.push(\"f\");\n xobj.stream = stream.join(\"\\n\");\n return xobj;\n }\n }\n },\n\n /**\n * Returns the standard Appearance\n *\n * @returns {AcroFormXObject}\n */\n createDefaultAppearanceStream: function(formObject) {\n // Set Helvetica to Standard Font (size: auto)\n // Color: Black\n var fontKey = scope.internal.getFont(\n formObject.fontName,\n formObject.fontStyle\n ).id;\n var encodedColor = scope.__private__.encodeColorString(formObject.color);\n var fontSize = formObject.fontSize;\n var result = \"/\" + fontKey + \" \" + fontSize + \" Tf \" + encodedColor;\n return result;\n }\n};\n\nAcroFormAppearance.internal = {\n Bezier_C: 0.551915024494,\n\n calculateCross: function(formObject) {\n var width = AcroFormAppearance.internal.getWidth(formObject);\n var height = AcroFormAppearance.internal.getHeight(formObject);\n var a = Math.min(width, height);\n\n var cross = {\n x1: {\n // upperLeft\n x: (width - a) / 2,\n y: (height - a) / 2 + a // height - borderPadding\n },\n x2: {\n // lowerRight\n x: (width - a) / 2 + a,\n y: (height - a) / 2 // borderPadding\n },\n x3: {\n // lowerLeft\n x: (width - a) / 2,\n y: (height - a) / 2 // borderPadding\n },\n x4: {\n // upperRight\n x: (width - a) / 2 + a,\n y: (height - a) / 2 + a // height - borderPadding\n }\n };\n\n return cross;\n }\n};\nAcroFormAppearance.internal.getWidth = function(formObject) {\n var result = 0;\n if (typeof formObject === \"object\") {\n result = scale(formObject.Rect[2]);\n }\n return result;\n};\nAcroFormAppearance.internal.getHeight = function(formObject) {\n var result = 0;\n if (typeof formObject === \"object\") {\n result = scale(formObject.Rect[3]);\n }\n return result;\n};\n\n// Public:\n\n/**\n * Add an AcroForm-Field to the jsPDF-instance\n *\n * @name addField\n * @function\n * @instance\n * @param {Object} fieldObject\n * @returns {jsPDF}\n */\nvar addField = (jsPDFAPI.addField = function(fieldObject) {\n initializeAcroForm.call(this);\n\n if (fieldObject instanceof AcroFormField) {\n putForm.call(this, fieldObject);\n } else {\n throw new Error(\"Invalid argument passed to jsPDF.addField.\");\n }\n fieldObject.page = scope.internal.getCurrentPageInfo().pageNumber;\n return this;\n});\n\njsPDFAPI.AcroFormChoiceField = AcroFormChoiceField;\njsPDFAPI.AcroFormListBox = AcroFormListBox;\njsPDFAPI.AcroFormComboBox = AcroFormComboBox;\njsPDFAPI.AcroFormEditBox = AcroFormEditBox;\njsPDFAPI.AcroFormButton = AcroFormButton;\njsPDFAPI.AcroFormPushButton = AcroFormPushButton;\njsPDFAPI.AcroFormRadioButton = AcroFormRadioButton;\njsPDFAPI.AcroFormCheckBox = AcroFormCheckBox;\njsPDFAPI.AcroFormTextField = AcroFormTextField;\njsPDFAPI.AcroFormPasswordField = AcroFormPasswordField;\njsPDFAPI.AcroFormAppearance = AcroFormAppearance;\n\njsPDFAPI.AcroForm = {\n ChoiceField: AcroFormChoiceField,\n ListBox: AcroFormListBox,\n ComboBox: AcroFormComboBox,\n EditBox: AcroFormEditBox,\n Button: AcroFormButton,\n PushButton: AcroFormPushButton,\n RadioButton: AcroFormRadioButton,\n CheckBox: AcroFormCheckBox,\n TextField: AcroFormTextField,\n PasswordField: AcroFormPasswordField,\n Appearance: AcroFormAppearance\n};\n\njsPDF.AcroForm = {\n ChoiceField: AcroFormChoiceField,\n ListBox: AcroFormListBox,\n ComboBox: AcroFormComboBox,\n EditBox: AcroFormEditBox,\n Button: AcroFormButton,\n PushButton: AcroFormPushButton,\n RadioButton: AcroFormRadioButton,\n CheckBox: AcroFormCheckBox,\n TextField: AcroFormTextField,\n PasswordField: AcroFormPasswordField,\n Appearance: AcroFormAppearance\n};\n\nvar AcroForm = jsPDF.AcroForm;\n\nexport {\n AcroForm,\n AcroFormChoiceField,\n AcroFormListBox,\n AcroFormComboBox,\n AcroFormEditBox,\n AcroFormButton,\n AcroFormPushButton,\n AcroFormRadioButton,\n AcroFormCheckBox,\n AcroFormTextField,\n AcroFormPasswordField,\n AcroFormAppearance\n};\n","/** @license\n * jsPDF addImage plugin\n * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/\n * 2013 Chris Dowling, https://github.com/gingerchris\n * 2013 Trinh Ho, https://github.com/ineedfat\n * 2013 Edwin Alejandro Perez, https://github.com/eaparango\n * 2013 Norah Smith, https://github.com/burnburnrocket\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 James Robb, https://github.com/jamesbrobb\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * @name addImage\n * @module\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { atob, btoa } from \"../libs/AtobBtoa.js\";\n\n(function(jsPDFAPI) {\n \"use strict\";\n\n var namespace = \"addImage_\";\n jsPDFAPI.__addimage__ = {};\n\n var UNKNOWN = \"UNKNOWN\";\n\n var imageFileTypeHeaders = {\n PNG: [[0x89, 0x50, 0x4e, 0x47]],\n TIFF: [\n [0x4d, 0x4d, 0x00, 0x2a], //Motorola\n [0x49, 0x49, 0x2a, 0x00] //Intel\n ],\n JPEG: [\n [\n 0xff,\n 0xd8,\n 0xff,\n 0xe0,\n undefined,\n undefined,\n 0x4a,\n 0x46,\n 0x49,\n 0x46,\n 0x00\n ], //JFIF\n [\n 0xff,\n 0xd8,\n 0xff,\n 0xe1,\n undefined,\n undefined,\n 0x45,\n 0x78,\n 0x69,\n 0x66,\n 0x00,\n 0x00\n ], //Exif\n [0xff, 0xd8, 0xff, 0xdb], //JPEG RAW\n [0xff, 0xd8, 0xff, 0xee] //EXIF RAW\n ],\n JPEG2000: [[0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20]],\n GIF87a: [[0x47, 0x49, 0x46, 0x38, 0x37, 0x61]],\n GIF89a: [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61]],\n WEBP: [\n [\n 0x52,\n 0x49,\n 0x46,\n 0x46,\n undefined,\n undefined,\n undefined,\n undefined,\n 0x57,\n 0x45,\n 0x42,\n 0x50\n ]\n ],\n BMP: [\n [0x42, 0x4d], //BM - Windows 3.1x, 95, NT, ... etc.\n [0x42, 0x41], //BA - OS/2 struct bitmap array\n [0x43, 0x49], //CI - OS/2 struct color icon\n [0x43, 0x50], //CP - OS/2 const color pointer\n [0x49, 0x43], //IC - OS/2 struct icon\n [0x50, 0x54] //PT - OS/2 pointer\n ]\n };\n\n /**\n * Recognize filetype of Image by magic-bytes\n *\n * https://en.wikipedia.org/wiki/List_of_file_signatures\n *\n * @name getImageFileTypeByImageData\n * @public\n * @function\n * @param {string|arraybuffer} imageData imageData as binary String or arraybuffer\n * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG'\n *\n * @returns {string} filetype of Image\n */\n var getImageFileTypeByImageData = (jsPDFAPI.__addimage__.getImageFileTypeByImageData = function(\n imageData,\n fallbackFormat\n ) {\n fallbackFormat = fallbackFormat || UNKNOWN;\n var i;\n var j;\n var result = UNKNOWN;\n var headerSchemata;\n var compareResult;\n var fileType;\n\n if (isArrayBufferView(imageData)) {\n for (fileType in imageFileTypeHeaders) {\n headerSchemata = imageFileTypeHeaders[fileType];\n for (i = 0; i < headerSchemata.length; i += 1) {\n compareResult = true;\n for (j = 0; j < headerSchemata[i].length; j += 1) {\n if (headerSchemata[i][j] === undefined) {\n continue;\n }\n if (headerSchemata[i][j] !== imageData[j]) {\n compareResult = false;\n break;\n }\n }\n if (compareResult === true) {\n result = fileType;\n break;\n }\n }\n }\n } else {\n for (fileType in imageFileTypeHeaders) {\n headerSchemata = imageFileTypeHeaders[fileType];\n for (i = 0; i < headerSchemata.length; i += 1) {\n compareResult = true;\n for (j = 0; j < headerSchemata[i].length; j += 1) {\n if (headerSchemata[i][j] === undefined) {\n continue;\n }\n if (headerSchemata[i][j] !== imageData.charCodeAt(j)) {\n compareResult = false;\n break;\n }\n }\n if (compareResult === true) {\n result = fileType;\n break;\n }\n }\n }\n }\n\n if (result === UNKNOWN && fallbackFormat !== UNKNOWN) {\n result = fallbackFormat;\n }\n return result;\n });\n\n // Image functionality ported from pdf.js\n var putImage = function(image) {\n var out = this.internal.write;\n var putStream = this.internal.putStream;\n var getFilters = this.internal.getFilters;\n\n var filter = getFilters();\n while (filter.indexOf(\"FlateEncode\") !== -1) {\n filter.splice(filter.indexOf(\"FlateEncode\"), 1);\n }\n\n image.objectId = this.internal.newObject();\n\n var additionalKeyValues = [];\n additionalKeyValues.push({ key: \"Type\", value: \"/XObject\" });\n additionalKeyValues.push({ key: \"Subtype\", value: \"/Image\" });\n additionalKeyValues.push({ key: \"Width\", value: image.width });\n additionalKeyValues.push({ key: \"Height\", value: image.height });\n\n if (image.colorSpace === color_spaces.INDEXED) {\n additionalKeyValues.push({\n key: \"ColorSpace\",\n value:\n \"[/Indexed /DeviceRGB \" +\n // if an indexed png defines more than one colour with transparency, we've created a sMask\n (image.palette.length / 3 - 1) +\n \" \" +\n (\"sMask\" in image && typeof image.sMask !== \"undefined\"\n ? image.objectId + 2\n : image.objectId + 1) +\n \" 0 R]\"\n });\n } else {\n additionalKeyValues.push({\n key: \"ColorSpace\",\n value: \"/\" + image.colorSpace\n });\n if (image.colorSpace === color_spaces.DEVICE_CMYK) {\n additionalKeyValues.push({ key: \"Decode\", value: \"[1 0 1 0 1 0 1 0]\" });\n }\n }\n additionalKeyValues.push({\n key: \"BitsPerComponent\",\n value: image.bitsPerComponent\n });\n if (\n \"decodeParameters\" in image &&\n typeof image.decodeParameters !== \"undefined\"\n ) {\n additionalKeyValues.push({\n key: \"DecodeParms\",\n value: \"<<\" + image.decodeParameters + \">>\"\n });\n }\n if (\"transparency\" in image && Array.isArray(image.transparency)) {\n var transparency = \"\",\n i = 0,\n len = image.transparency.length;\n for (; i < len; i++)\n transparency +=\n image.transparency[i] + \" \" + image.transparency[i] + \" \";\n\n additionalKeyValues.push({\n key: \"Mask\",\n value: \"[\" + transparency + \"]\"\n });\n }\n if (typeof image.sMask !== \"undefined\") {\n additionalKeyValues.push({\n key: \"SMask\",\n value: image.objectId + 1 + \" 0 R\"\n });\n }\n\n var alreadyAppliedFilters =\n typeof image.filter !== \"undefined\" ? [\"/\" + image.filter] : undefined;\n\n putStream({\n data: image.data,\n additionalKeyValues: additionalKeyValues,\n alreadyAppliedFilters: alreadyAppliedFilters\n });\n\n out(\"endobj\");\n\n // Soft mask\n if (\"sMask\" in image && typeof image.sMask !== \"undefined\") {\n var decodeParameters =\n \"/Predictor \" +\n image.predictor +\n \" /Colors 1 /BitsPerComponent \" +\n image.bitsPerComponent +\n \" /Columns \" +\n image.width;\n var sMask = {\n width: image.width,\n height: image.height,\n colorSpace: \"DeviceGray\",\n bitsPerComponent: image.bitsPerComponent,\n decodeParameters: decodeParameters,\n data: image.sMask\n };\n if (\"filter\" in image) {\n sMask.filter = image.filter;\n }\n putImage.call(this, sMask);\n }\n\n //Palette\n if (image.colorSpace === color_spaces.INDEXED) {\n this.internal.newObject();\n //out('<< /Filter / ' + img['f'] +' /Length ' + img['pal'].length + '>>');\n //putStream(zlib.compress(img['pal']));\n putStream({\n data: arrayBufferToBinaryString(new Uint8Array(image.palette))\n });\n out(\"endobj\");\n }\n };\n var putResourcesCallback = function() {\n var images = this.internal.collections[namespace + \"images\"];\n for (var i in images) {\n putImage.call(this, images[i]);\n }\n };\n var putXObjectsDictCallback = function() {\n var images = this.internal.collections[namespace + \"images\"],\n out = this.internal.write,\n image;\n for (var i in images) {\n image = images[i];\n out(\"/I\" + image.index, image.objectId, \"0\", \"R\");\n }\n };\n\n var checkCompressValue = function(value) {\n if (value && typeof value === \"string\") value = value.toUpperCase();\n return value in jsPDFAPI.image_compression ? value : image_compression.NONE;\n };\n\n var initialize = function() {\n if (!this.internal.collections[namespace + \"images\"]) {\n this.internal.collections[namespace + \"images\"] = {};\n this.internal.events.subscribe(\"putResources\", putResourcesCallback);\n this.internal.events.subscribe(\"putXobjectDict\", putXObjectsDictCallback);\n }\n };\n\n var getImages = function() {\n var images = this.internal.collections[namespace + \"images\"];\n initialize.call(this);\n return images;\n };\n var getImageIndex = function() {\n return Object.keys(this.internal.collections[namespace + \"images\"]).length;\n };\n var notDefined = function(value) {\n return typeof value === \"undefined\" || value === null || value.length === 0;\n };\n var generateAliasFromImageData = function(imageData) {\n if (typeof imageData === \"string\" || isArrayBufferView(imageData)) {\n return sHashCode(imageData);\n }\n\n return null;\n };\n\n var isImageTypeSupported = function(type) {\n return typeof jsPDFAPI[\"process\" + type.toUpperCase()] === \"function\";\n };\n\n var isDOMElement = function(object) {\n return typeof object === \"object\" && object.nodeType === 1;\n };\n\n var getImageDataFromElement = function(element, format) {\n //if element is an image which uses data url definition, just return the dataurl\n if (element.nodeName === \"IMG\" && element.hasAttribute(\"src\")) {\n var src = \"\" + element.getAttribute(\"src\");\n\n //is base64 encoded dataUrl, directly process it\n if (src.indexOf(\"data:image/\") === 0) {\n return atob(\n unescape(src)\n .split(\"base64,\")\n .pop()\n );\n }\n\n //it is probably an url, try to load it\n var tmpImageData = jsPDFAPI.loadFile(src, true);\n if (tmpImageData !== undefined) {\n return tmpImageData;\n }\n }\n\n if (element.nodeName === \"CANVAS\") {\n var mimeType;\n switch (format) {\n case \"PNG\":\n mimeType = \"image/png\";\n break;\n case \"WEBP\":\n mimeType = \"image/webp\";\n break;\n case \"JPEG\":\n case \"JPG\":\n default:\n mimeType = \"image/jpeg\";\n break;\n }\n return atob(\n element\n .toDataURL(mimeType, 1.0)\n .split(\"base64,\")\n .pop()\n );\n }\n };\n\n var checkImagesForAlias = function(alias) {\n var images = this.internal.collections[namespace + \"images\"];\n if (images) {\n for (var e in images) {\n if (alias === images[e].alias) {\n return images[e];\n }\n }\n }\n };\n\n var determineWidthAndHeight = function(width, height, image) {\n if (!width && !height) {\n width = -96;\n height = -96;\n }\n if (width < 0) {\n width = (-1 * image.width * 72) / width / this.internal.scaleFactor;\n }\n if (height < 0) {\n height = (-1 * image.height * 72) / height / this.internal.scaleFactor;\n }\n if (width === 0) {\n width = (height * image.width) / image.height;\n }\n if (height === 0) {\n height = (width * image.height) / image.width;\n }\n\n return [width, height];\n };\n\n var writeImageToPDF = function(x, y, width, height, image, rotation) {\n var dims = determineWidthAndHeight.call(this, width, height, image),\n coord = this.internal.getCoordinateString,\n vcoord = this.internal.getVerticalCoordinateString;\n\n var images = getImages.call(this);\n\n width = dims[0];\n height = dims[1];\n images[image.index] = image;\n\n if (rotation) {\n rotation *= Math.PI / 180;\n var c = Math.cos(rotation);\n var s = Math.sin(rotation);\n //like in pdf Reference do it 4 digits instead of 2\n var f4 = function(number) {\n return number.toFixed(4);\n };\n var rotationTransformationMatrix = [\n f4(c),\n f4(s),\n f4(s * -1),\n f4(c),\n 0,\n 0,\n \"cm\"\n ];\n }\n this.internal.write(\"q\"); //Save graphics state\n if (rotation) {\n this.internal.write(\n [1, \"0\", \"0\", 1, coord(x), vcoord(y + height), \"cm\"].join(\" \")\n ); //Translate\n this.internal.write(rotationTransformationMatrix.join(\" \")); //Rotate\n this.internal.write(\n [coord(width), \"0\", \"0\", coord(height), \"0\", \"0\", \"cm\"].join(\" \")\n ); //Scale\n } else {\n this.internal.write(\n [\n coord(width),\n \"0\",\n \"0\",\n coord(height),\n coord(x),\n vcoord(y + height),\n \"cm\"\n ].join(\" \")\n ); //Translate and Scale\n }\n\n if (this.isAdvancedAPI()) {\n // draw image bottom up when in \"advanced\" API mode\n this.internal.write([1, 0, 0, -1, 0, 0, \"cm\"].join(\" \"));\n }\n\n this.internal.write(\"/I\" + image.index + \" Do\"); //Paint Image\n this.internal.write(\"Q\"); //Restore graphics state\n };\n\n /**\n * COLOR SPACES\n */\n var color_spaces = (jsPDFAPI.color_spaces = {\n DEVICE_RGB: \"DeviceRGB\",\n DEVICE_GRAY: \"DeviceGray\",\n DEVICE_CMYK: \"DeviceCMYK\",\n CAL_GREY: \"CalGray\",\n CAL_RGB: \"CalRGB\",\n LAB: \"Lab\",\n ICC_BASED: \"ICCBased\",\n INDEXED: \"Indexed\",\n PATTERN: \"Pattern\",\n SEPARATION: \"Separation\",\n DEVICE_N: \"DeviceN\"\n });\n\n /**\n * DECODE METHODS\n */\n jsPDFAPI.decode = {\n DCT_DECODE: \"DCTDecode\",\n FLATE_DECODE: \"FlateDecode\",\n LZW_DECODE: \"LZWDecode\",\n JPX_DECODE: \"JPXDecode\",\n JBIG2_DECODE: \"JBIG2Decode\",\n ASCII85_DECODE: \"ASCII85Decode\",\n ASCII_HEX_DECODE: \"ASCIIHexDecode\",\n RUN_LENGTH_DECODE: \"RunLengthDecode\",\n CCITT_FAX_DECODE: \"CCITTFaxDecode\"\n };\n\n /**\n * IMAGE COMPRESSION TYPES\n */\n var image_compression = (jsPDFAPI.image_compression = {\n NONE: \"NONE\",\n FAST: \"FAST\",\n MEDIUM: \"MEDIUM\",\n SLOW: \"SLOW\"\n });\n\n /**\n * @name sHashCode\n * @function\n * @param {string} data\n * @returns {string}\n */\n var sHashCode = (jsPDFAPI.__addimage__.sHashCode = function(data) {\n var hash = 0,\n i,\n len;\n\n if (typeof data === \"string\") {\n len = data.length;\n for (i = 0; i < len; i++) {\n hash = (hash << 5) - hash + data.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n } else if (isArrayBufferView(data)) {\n len = data.byteLength / 2;\n for (i = 0; i < len; i++) {\n hash = (hash << 5) - hash + data[i];\n hash |= 0; // Convert to 32bit integer\n }\n }\n return hash;\n });\n\n /**\n * Validates if given String is a valid Base64-String\n *\n * @name validateStringAsBase64\n * @public\n * @function\n * @param {String} possible Base64-String\n *\n * @returns {boolean}\n */\n var validateStringAsBase64 = (jsPDFAPI.__addimage__.validateStringAsBase64 = function(\n possibleBase64String\n ) {\n possibleBase64String = possibleBase64String || \"\";\n possibleBase64String.toString().trim();\n\n var result = true;\n\n if (possibleBase64String.length === 0) {\n result = false;\n }\n\n if (possibleBase64String.length % 4 !== 0) {\n result = false;\n }\n\n if (\n /^[A-Za-z0-9+/]+$/.test(\n possibleBase64String.substr(0, possibleBase64String.length - 2)\n ) === false\n ) {\n result = false;\n }\n\n if (\n /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(\n possibleBase64String.substr(-2)\n ) === false\n ) {\n result = false;\n }\n return result;\n });\n\n /**\n * Strips out and returns info from a valid base64 data URI\n *\n * @name extractImageFromDataUrl\n * @function\n * @param {string} dataUrl a valid data URI of format 'data:[][;base64],'\n * @returns {Array}an Array containing the following\n * [0] the complete data URI\n * [1] \n * [2] format - the second part of the mime-type i.e 'png' in 'image/png'\n * [4] \n */\n var extractImageFromDataUrl = (jsPDFAPI.__addimage__.extractImageFromDataUrl = function(\n dataUrl\n ) {\n dataUrl = dataUrl || \"\";\n var dataUrlParts = dataUrl.split(\"base64,\");\n var result = null;\n\n if (dataUrlParts.length === 2) {\n var extractedInfo = /^data:(\\w*\\/\\w*);*(charset=[\\w=-]*)*;*$/.exec(\n dataUrlParts[0]\n );\n if (Array.isArray(extractedInfo)) {\n result = {\n mimeType: extractedInfo[1],\n charset: extractedInfo[2],\n data: dataUrlParts[1]\n };\n }\n }\n return result;\n });\n\n /**\n * Check to see if ArrayBuffer is supported\n *\n * @name supportsArrayBuffer\n * @function\n * @returns {boolean}\n */\n var supportsArrayBuffer = (jsPDFAPI.__addimage__.supportsArrayBuffer = function() {\n return (\n typeof ArrayBuffer !== \"undefined\" && typeof Uint8Array !== \"undefined\"\n );\n });\n\n /**\n * Tests supplied object to determine if ArrayBuffer\n *\n * @name isArrayBuffer\n * @function\n * @param {Object} object an Object\n *\n * @returns {boolean}\n */\n jsPDFAPI.__addimage__.isArrayBuffer = function(object) {\n return supportsArrayBuffer() && object instanceof ArrayBuffer;\n };\n\n /**\n * Tests supplied object to determine if it implements the ArrayBufferView (TypedArray) interface\n *\n * @name isArrayBufferView\n * @function\n * @param {Object} object an Object\n * @returns {boolean}\n */\n var isArrayBufferView = (jsPDFAPI.__addimage__.isArrayBufferView = function(\n object\n ) {\n return (\n supportsArrayBuffer() &&\n typeof Uint32Array !== \"undefined\" &&\n (object instanceof Int8Array ||\n object instanceof Uint8Array ||\n (typeof Uint8ClampedArray !== \"undefined\" &&\n object instanceof Uint8ClampedArray) ||\n object instanceof Int16Array ||\n object instanceof Uint16Array ||\n object instanceof Int32Array ||\n object instanceof Uint32Array ||\n object instanceof Float32Array ||\n object instanceof Float64Array)\n );\n });\n\n /**\n * Convert Binary String to ArrayBuffer\n *\n * @name binaryStringToUint8Array\n * @public\n * @function\n * @param {string} BinaryString with ImageData\n * @returns {Uint8Array}\n */\n var binaryStringToUint8Array = (jsPDFAPI.__addimage__.binaryStringToUint8Array = function(\n binary_string\n ) {\n var len = binary_string.length;\n var bytes = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes;\n });\n\n /**\n * Convert the Buffer to a Binary String\n *\n * @name arrayBufferToBinaryString\n * @public\n * @function\n * @param {ArrayBuffer} ArrayBuffer with ImageData\n *\n * @returns {String}\n */\n var arrayBufferToBinaryString = (jsPDFAPI.__addimage__.arrayBufferToBinaryString = function(\n buffer\n ) {\n try {\n return atob(btoa(String.fromCharCode.apply(null, buffer)));\n } catch (e) {\n if (\n typeof Uint8Array !== \"undefined\" &&\n typeof Uint8Array.prototype.reduce !== \"undefined\"\n ) {\n return new Uint8Array(buffer)\n .reduce(function(data, byte) {\n return data.push(String.fromCharCode(byte)), data;\n }, [])\n .join(\"\");\n }\n }\n });\n\n /**\n * Adds an Image to the PDF.\n *\n * @name addImage\n * @public\n * @function\n * @param {string|HTMLImageElement|HTMLCanvasElement|Uint8Array} imageData imageData as base64 encoded DataUrl or Image-HTMLElement or Canvas-HTMLElement\n * @param {string} format format of file if filetype-recognition fails or in case of a Canvas-Element needs to be specified (default for Canvas is JPEG), e.g. 'JPEG', 'PNG', 'WEBP'\n * @param {number} x x Coordinate (in units declared at inception of PDF document) against left edge of the page\n * @param {number} y y Coordinate (in units declared at inception of PDF document) against upper edge of the page\n * @param {number} width width of the image (in units declared at inception of PDF document)\n * @param {number} height height of the Image (in units declared at inception of PDF document)\n * @param {string} alias alias of the image (if used multiple times)\n * @param {string} compression compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'\n * @param {number} rotation rotation of the image in degrees (0-359)\n *\n * @returns jsPDF\n */\n jsPDFAPI.addImage = function() {\n var imageData, format, x, y, w, h, alias, compression, rotation;\n\n imageData = arguments[0];\n if (typeof arguments[1] === \"number\") {\n format = UNKNOWN;\n x = arguments[1];\n y = arguments[2];\n w = arguments[3];\n h = arguments[4];\n alias = arguments[5];\n compression = arguments[6];\n rotation = arguments[7];\n } else {\n format = arguments[1];\n x = arguments[2];\n y = arguments[3];\n w = arguments[4];\n h = arguments[5];\n alias = arguments[6];\n compression = arguments[7];\n rotation = arguments[8];\n }\n\n if (\n typeof imageData === \"object\" &&\n !isDOMElement(imageData) &&\n \"imageData\" in imageData\n ) {\n var options = imageData;\n\n imageData = options.imageData;\n format = options.format || format || UNKNOWN;\n x = options.x || x || 0;\n y = options.y || y || 0;\n w = options.w || options.width || w;\n h = options.h || options.height || h;\n alias = options.alias || alias;\n compression = options.compression || compression;\n rotation = options.rotation || options.angle || rotation;\n }\n\n //If compression is not explicitly set, determine if we should use compression\n var filter = this.internal.getFilters();\n if (compression === undefined && filter.indexOf(\"FlateEncode\") !== -1) {\n compression = \"SLOW\";\n }\n\n if (isNaN(x) || isNaN(y)) {\n throw new Error(\"Invalid coordinates passed to jsPDF.addImage\");\n }\n\n initialize.call(this);\n\n var image = processImageData.call(\n this,\n imageData,\n format,\n alias,\n compression\n );\n\n writeImageToPDF.call(this, x, y, w, h, image, rotation);\n\n return this;\n };\n\n var processImageData = function(imageData, format, alias, compression) {\n var result, dataAsBinaryString;\n\n if (\n typeof imageData === \"string\" &&\n getImageFileTypeByImageData(imageData) === UNKNOWN\n ) {\n imageData = unescape(imageData);\n var tmpImageData = convertBase64ToBinaryString(imageData, false);\n\n if (tmpImageData !== \"\") {\n imageData = tmpImageData;\n } else {\n tmpImageData = jsPDFAPI.loadFile(imageData, true);\n if (tmpImageData !== undefined) {\n imageData = tmpImageData;\n }\n }\n }\n\n if (isDOMElement(imageData)) {\n imageData = getImageDataFromElement(imageData, format);\n }\n\n format = getImageFileTypeByImageData(imageData, format);\n if (!isImageTypeSupported(format)) {\n throw new Error(\n \"addImage does not support files of type '\" +\n format +\n \"', please ensure that a plugin for '\" +\n format +\n \"' support is added.\"\n );\n }\n\n // now do the heavy lifting\n\n if (notDefined(alias)) {\n alias = generateAliasFromImageData(imageData);\n }\n result = checkImagesForAlias.call(this, alias);\n\n if (!result) {\n if (supportsArrayBuffer()) {\n // no need to convert if imageData is already uint8array\n if (!(imageData instanceof Uint8Array)) {\n dataAsBinaryString = imageData;\n imageData = binaryStringToUint8Array(imageData);\n }\n }\n\n result = this[\"process\" + format.toUpperCase()](\n imageData,\n getImageIndex.call(this),\n alias,\n checkCompressValue(compression),\n dataAsBinaryString\n );\n }\n\n if (!result) {\n throw new Error(\"An unknown error occurred whilst processing the image.\");\n }\n return result;\n };\n\n /**\n * @name convertBase64ToBinaryString\n * @function\n * @param {string} stringData\n * @returns {string} binary string\n */\n var convertBase64ToBinaryString = (jsPDFAPI.__addimage__.convertBase64ToBinaryString = function(\n stringData,\n throwError\n ) {\n throwError = typeof throwError === \"boolean\" ? throwError : true;\n var base64Info;\n var imageData = \"\";\n var rawData;\n\n if (typeof stringData === \"string\") {\n base64Info = extractImageFromDataUrl(stringData);\n rawData = base64Info !== null ? base64Info.data : stringData;\n\n try {\n imageData = atob(rawData);\n } catch (e) {\n if (throwError) {\n if (!validateStringAsBase64(rawData)) {\n throw new Error(\n \"Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString \"\n );\n } else {\n throw new Error(\n \"atob-Error in jsPDF.convertBase64ToBinaryString \" + e.message\n );\n }\n }\n }\n }\n return imageData;\n });\n\n /**\n * @name getImageProperties\n * @function\n * @param {Object} imageData\n * @returns {Object}\n */\n jsPDFAPI.getImageProperties = function(imageData) {\n var image;\n var tmpImageData = \"\";\n var format;\n\n if (isDOMElement(imageData)) {\n imageData = getImageDataFromElement(imageData);\n }\n\n if (\n typeof imageData === \"string\" &&\n getImageFileTypeByImageData(imageData) === UNKNOWN\n ) {\n tmpImageData = convertBase64ToBinaryString(imageData, false);\n\n if (tmpImageData === \"\") {\n tmpImageData = jsPDFAPI.loadFile(imageData) || \"\";\n }\n imageData = tmpImageData;\n }\n\n format = getImageFileTypeByImageData(imageData);\n if (!isImageTypeSupported(format)) {\n throw new Error(\n \"addImage does not support files of type '\" +\n format +\n \"', please ensure that a plugin for '\" +\n format +\n \"' support is added.\"\n );\n }\n\n if (supportsArrayBuffer() && !(imageData instanceof Uint8Array)) {\n imageData = binaryStringToUint8Array(imageData);\n }\n\n image = this[\"process\" + format.toUpperCase()](imageData);\n\n if (!image) {\n throw new Error(\"An unknown error occurred whilst processing the image\");\n }\n\n image.fileType = format;\n\n return image;\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF Annotations PlugIn\n *\n * There are many types of annotations in a PDF document. Annotations are placed\n * on a page at a particular location. They are not 'attached' to an object.\n *
\n * This plugin current supports
\n * Goto Page (set pageNumber and top in options)\n * Goto Name (set name and top in options)\n * Goto URL (set url in options)\n * \n * \tThe destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below)\n * (set magFactor in options). XYZ is the default.\n *
\n * \n * Links, Text, Popup, and FreeText are supported.\n *
\n * \n * Options In PDF spec Not Implemented Yet\n *
link border\n * named target\n * page coordinates\n * destination page scaling and layout\n * actions other than URL and GotoPage\n * background / hover actions\n *
\n * @name annotations\n * @module\n */\n\n/*\n Destination Magnification Factors\n See PDF 1.3 Page 386 for meanings and options\n\n [supported]\n\tXYZ (options; left top zoom)\n\tFit (no options)\n\tFitH (options: top)\n\tFitV (options: left)\n\n\t[not supported]\n\tFitR\n\tFitB\n\tFitBH\n\tFitBV\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n(function(jsPDFAPI) {\n \"use strict\";\n\n var notEmpty = function(obj) {\n if (typeof obj != \"undefined\") {\n if (obj != \"\") {\n return true;\n }\n }\n };\n\n jsPDF.API.events.push([\n \"addPage\",\n function(addPageData) {\n var pageInfo = this.internal.getPageInfo(addPageData.pageNumber);\n pageInfo.pageContext.annotations = [];\n }\n ]);\n\n jsPDFAPI.events.push([\n \"putPage\",\n function(putPageData) {\n var getHorizontalCoordinateString = this.internal.getCoordinateString;\n var getVerticalCoordinateString = this.internal\n .getVerticalCoordinateString;\n var pageInfo = this.internal.getPageInfoByObjId(putPageData.objId);\n var pageAnnos = putPageData.pageContext.annotations;\n\n var anno, rect, line;\n var found = false;\n for (var a = 0; a < pageAnnos.length && !found; a++) {\n anno = pageAnnos[a];\n switch (anno.type) {\n case \"link\":\n if (\n notEmpty(anno.options.url) ||\n notEmpty(anno.options.pageNumber)\n ) {\n found = true;\n }\n break;\n case \"reference\":\n case \"text\":\n case \"freetext\":\n found = true;\n break;\n }\n }\n if (found == false) {\n return;\n }\n\n this.internal.write(\"/Annots [\");\n for (var i = 0; i < pageAnnos.length; i++) {\n anno = pageAnnos[i];\n\n switch (anno.type) {\n case \"reference\":\n // References to Widget Annotations (for AcroForm Fields)\n this.internal.write(\" \" + anno.object.objId + \" 0 R \");\n break;\n case \"text\":\n // Create a an object for both the text and the popup\n var objText = this.internal.newAdditionalObject();\n var objPopup = this.internal.newAdditionalObject();\n\n var title = anno.title || \"Note\";\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.bounds.x) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n \" \" +\n getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y) +\n \"] \";\n line =\n \"<>\";\n objText.content = line;\n\n var parent = objText.objId + \" 0 R\";\n var popoff = 30;\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.bounds.x + popoff) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n \" \" +\n getHorizontalCoordinateString(\n anno.bounds.x + anno.bounds.w + popoff\n ) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y) +\n \"] \";\n line =\n \"<>\";\n objPopup.content = line;\n\n this.internal.write(objText.objId, \"0 R\", objPopup.objId, \"0 R\");\n\n break;\n case \"freetext\":\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.bounds.x) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y) +\n \" \" +\n getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) +\n \" \" +\n getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n \"] \";\n var color = anno.color || \"#000000\";\n line =\n \"<>\";\n this.internal.write(line);\n break;\n case \"link\":\n if (anno.options.name) {\n var loc = this.annotations._nameMap[anno.options.name];\n anno.options.pageNumber = loc.page;\n anno.options.top = loc.y;\n } else {\n if (!anno.options.top) {\n anno.options.top = 0;\n }\n }\n\n rect =\n \"/Rect [\" +\n getHorizontalCoordinateString(anno.x) +\n \" \" +\n getVerticalCoordinateString(anno.y) +\n \" \" +\n getHorizontalCoordinateString(anno.x + anno.w) +\n \" \" +\n getVerticalCoordinateString(anno.y + anno.h) +\n \"] \";\n\n line = \"\";\n if (anno.options.url) {\n line =\n \"<>\";\n } else if (anno.options.pageNumber) {\n // first page is 0\n var info = this.internal.getPageInfo(anno.options.pageNumber);\n line =\n \"<>\";\n this.internal.write(line);\n }\n break;\n }\n }\n this.internal.write(\"]\");\n }\n ]);\n\n /**\n * @name createAnnotation\n * @function\n * @param {Object} options\n */\n jsPDFAPI.createAnnotation = function(options) {\n var pageInfo = this.internal.getCurrentPageInfo();\n switch (options.type) {\n case \"link\":\n this.link(\n options.bounds.x,\n options.bounds.y,\n options.bounds.w,\n options.bounds.h,\n options\n );\n break;\n case \"text\":\n case \"freetext\":\n pageInfo.pageContext.annotations.push(options);\n break;\n }\n };\n\n /**\n * Create a link\n *\n * valid options\n * pageNumber or url [required]\n * If pageNumber is specified, top and zoom may also be specified
\n * @name link\n * @function\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {Object} options\n */\n jsPDFAPI.link = function(x, y, w, h, options) {\n var pageInfo = this.internal.getCurrentPageInfo();\n pageInfo.pageContext.annotations.push({\n x: x,\n y: y,\n w: w,\n h: h,\n options: options,\n type: \"link\"\n });\n };\n\n /**\n * Currently only supports single line text.\n * Returns the width of the text/link\n *\n * @name textWithLink\n * @function\n * @param {string} text\n * @param {number} x\n * @param {number} y\n * @param {Object} options\n * @returns {number} width the width of the text/link\n */\n jsPDFAPI.textWithLink = function(text, x, y, options) {\n var width = this.getTextWidth(text);\n var height = this.internal.getLineHeight() / this.internal.scaleFactor;\n this.text(text, x, y, options);\n //TODO We really need the text baseline height to do this correctly.\n // Or ability to draw text on top, bottom, center, or baseline.\n y += height * 0.2;\n this.link(x, y - height, width, height, options);\n return width;\n };\n\n //TODO move into external library\n /**\n * @name getTextWidth\n * @function\n * @param {string} text\n * @returns {number} txtWidth\n */\n jsPDFAPI.getTextWidth = function(text) {\n var fontSize = this.internal.getFontSize();\n var txtWidth =\n (this.getStringUnitWidth(text) * fontSize) / this.internal.scaleFactor;\n return txtWidth;\n };\n\n return this;\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2017 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF arabic parser PlugIn\n *\n * @name arabic\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * Arabic shape substitutions: char code => (isolated, final, initial, medial).\n * Arabic Substition A\n */\n var arabicSubstitionA = {\n 0x0621: [0xfe80], // ARABIC LETTER HAMZA\n 0x0622: [0xfe81, 0xfe82], // ARABIC LETTER ALEF WITH MADDA ABOVE\n 0x0623: [0xfe83, 0xfe84], // ARABIC LETTER ALEF WITH HAMZA ABOVE\n 0x0624: [0xfe85, 0xfe86], // ARABIC LETTER WAW WITH HAMZA ABOVE\n 0x0625: [0xfe87, 0xfe88], // ARABIC LETTER ALEF WITH HAMZA BELOW\n 0x0626: [0xfe89, 0xfe8a, 0xfe8b, 0xfe8c], // ARABIC LETTER YEH WITH HAMZA ABOVE\n 0x0627: [0xfe8d, 0xfe8e], // ARABIC LETTER ALEF\n 0x0628: [0xfe8f, 0xfe90, 0xfe91, 0xfe92], // ARABIC LETTER BEH\n 0x0629: [0xfe93, 0xfe94], // ARABIC LETTER TEH MARBUTA\n 0x062a: [0xfe95, 0xfe96, 0xfe97, 0xfe98], // ARABIC LETTER TEH\n 0x062b: [0xfe99, 0xfe9a, 0xfe9b, 0xfe9c], // ARABIC LETTER THEH\n 0x062c: [0xfe9d, 0xfe9e, 0xfe9f, 0xfea0], // ARABIC LETTER JEEM\n 0x062d: [0xfea1, 0xfea2, 0xfea3, 0xfea4], // ARABIC LETTER HAH\n 0x062e: [0xfea5, 0xfea6, 0xfea7, 0xfea8], // ARABIC LETTER KHAH\n 0x062f: [0xfea9, 0xfeaa], // ARABIC LETTER DAL\n 0x0630: [0xfeab, 0xfeac], // ARABIC LETTER THAL\n 0x0631: [0xfead, 0xfeae], // ARABIC LETTER REH\n 0x0632: [0xfeaf, 0xfeb0], // ARABIC LETTER ZAIN\n 0x0633: [0xfeb1, 0xfeb2, 0xfeb3, 0xfeb4], // ARABIC LETTER SEEN\n 0x0634: [0xfeb5, 0xfeb6, 0xfeb7, 0xfeb8], // ARABIC LETTER SHEEN\n 0x0635: [0xfeb9, 0xfeba, 0xfebb, 0xfebc], // ARABIC LETTER SAD\n 0x0636: [0xfebd, 0xfebe, 0xfebf, 0xfec0], // ARABIC LETTER DAD\n 0x0637: [0xfec1, 0xfec2, 0xfec3, 0xfec4], // ARABIC LETTER TAH\n 0x0638: [0xfec5, 0xfec6, 0xfec7, 0xfec8], // ARABIC LETTER ZAH\n 0x0639: [0xfec9, 0xfeca, 0xfecb, 0xfecc], // ARABIC LETTER AIN\n 0x063a: [0xfecd, 0xfece, 0xfecf, 0xfed0], // ARABIC LETTER GHAIN\n 0x0641: [0xfed1, 0xfed2, 0xfed3, 0xfed4], // ARABIC LETTER FEH\n 0x0642: [0xfed5, 0xfed6, 0xfed7, 0xfed8], // ARABIC LETTER QAF\n 0x0643: [0xfed9, 0xfeda, 0xfedb, 0xfedc], // ARABIC LETTER KAF\n 0x0644: [0xfedd, 0xfede, 0xfedf, 0xfee0], // ARABIC LETTER LAM\n 0x0645: [0xfee1, 0xfee2, 0xfee3, 0xfee4], // ARABIC LETTER MEEM\n 0x0646: [0xfee5, 0xfee6, 0xfee7, 0xfee8], // ARABIC LETTER NOON\n 0x0647: [0xfee9, 0xfeea, 0xfeeb, 0xfeec], // ARABIC LETTER HEH\n 0x0648: [0xfeed, 0xfeee], // ARABIC LETTER WAW\n 0x0649: [0xfeef, 0xfef0, 64488, 64489], // ARABIC LETTER ALEF MAKSURA\n 0x064a: [0xfef1, 0xfef2, 0xfef3, 0xfef4], // ARABIC LETTER YEH\n 0x0671: [0xfb50, 0xfb51], // ARABIC LETTER ALEF WASLA\n 0x0677: [0xfbdd], // ARABIC LETTER U WITH HAMZA ABOVE\n 0x0679: [0xfb66, 0xfb67, 0xfb68, 0xfb69], // ARABIC LETTER TTEH\n 0x067a: [0xfb5e, 0xfb5f, 0xfb60, 0xfb61], // ARABIC LETTER TTEHEH\n 0x067b: [0xfb52, 0xfb53, 0xfb54, 0xfb55], // ARABIC LETTER BEEH\n 0x067e: [0xfb56, 0xfb57, 0xfb58, 0xfb59], // ARABIC LETTER PEH\n 0x067f: [0xfb62, 0xfb63, 0xfb64, 0xfb65], // ARABIC LETTER TEHEH\n 0x0680: [0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d], // ARABIC LETTER BEHEH\n 0x0683: [0xfb76, 0xfb77, 0xfb78, 0xfb79], // ARABIC LETTER NYEH\n 0x0684: [0xfb72, 0xfb73, 0xfb74, 0xfb75], // ARABIC LETTER DYEH\n 0x0686: [0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d], // ARABIC LETTER TCHEH\n 0x0687: [0xfb7e, 0xfb7f, 0xfb80, 0xfb81], // ARABIC LETTER TCHEHEH\n 0x0688: [0xfb88, 0xfb89], // ARABIC LETTER DDAL\n 0x068c: [0xfb84, 0xfb85], // ARABIC LETTER DAHAL\n 0x068d: [0xfb82, 0xfb83], // ARABIC LETTER DDAHAL\n 0x068e: [0xfb86, 0xfb87], // ARABIC LETTER DUL\n 0x0691: [0xfb8c, 0xfb8d], // ARABIC LETTER RREH\n 0x0698: [0xfb8a, 0xfb8b], // ARABIC LETTER JEH\n 0x06a4: [0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d], // ARABIC LETTER VEH\n 0x06a6: [0xfb6e, 0xfb6f, 0xfb70, 0xfb71], // ARABIC LETTER PEHEH\n 0x06a9: [0xfb8e, 0xfb8f, 0xfb90, 0xfb91], // ARABIC LETTER KEHEH\n 0x06ad: [0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6], // ARABIC LETTER NG\n 0x06af: [0xfb92, 0xfb93, 0xfb94, 0xfb95], // ARABIC LETTER GAF\n 0x06b1: [0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d], // ARABIC LETTER NGOEH\n 0x06b3: [0xfb96, 0xfb97, 0xfb98, 0xfb99], // ARABIC LETTER GUEH\n 0x06ba: [0xfb9e, 0xfb9f], // ARABIC LETTER NOON GHUNNA\n 0x06bb: [0xfba0, 0xfba1, 0xfba2, 0xfba3], // ARABIC LETTER RNOON\n 0x06be: [0xfbaa, 0xfbab, 0xfbac, 0xfbad], // ARABIC LETTER HEH DOACHASHMEE\n 0x06c0: [0xfba4, 0xfba5], // ARABIC LETTER HEH WITH YEH ABOVE\n 0x06c1: [0xfba6, 0xfba7, 0xfba8, 0xfba9], // ARABIC LETTER HEH GOAL\n 0x06c5: [0xfbe0, 0xfbe1], // ARABIC LETTER KIRGHIZ OE\n 0x06c6: [0xfbd9, 0xfbda], // ARABIC LETTER OE\n 0x06c7: [0xfbd7, 0xfbd8], // ARABIC LETTER U\n 0x06c8: [0xfbdb, 0xfbdc], // ARABIC LETTER YU\n 0x06c9: [0xfbe2, 0xfbe3], // ARABIC LETTER KIRGHIZ YU\n 0x06cb: [0xfbde, 0xfbdf], // ARABIC LETTER VE\n 0x06cc: [0xfbfc, 0xfbfd, 0xfbfe, 0xfbff], // ARABIC LETTER FARSI YEH\n 0x06d0: [0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7], //ARABIC LETTER E\n 0x06d2: [0xfbae, 0xfbaf], // ARABIC LETTER YEH BARREE\n 0x06d3: [0xfbb0, 0xfbb1] // ARABIC LETTER YEH BARREE WITH HAMZA ABOVE\n };\n\n /*\n var ligaturesSubstitutionA = {\n 0xFBEA: []// ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF ISOLATED FORM\n };\n */\n\n var ligatures = {\n 0xfedf: {\n 0xfe82: 0xfef5, // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM\n 0xfe84: 0xfef7, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM\n 0xfe88: 0xfef9, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM\n 0xfe8e: 0xfefb // ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM\n },\n 0xfee0: {\n 0xfe82: 0xfef6, // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM\n 0xfe84: 0xfef8, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM\n 0xfe88: 0xfefa, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM\n 0xfe8e: 0xfefc // ARABIC LIGATURE LAM WITH ALEF FINAL FORM\n },\n 0xfe8d: { 0xfedf: { 0xfee0: { 0xfeea: 0xfdf2 } } }, // ALLAH\n 0x0651: {\n 0x064c: 0xfc5e, // Shadda + Dammatan\n 0x064d: 0xfc5f, // Shadda + Kasratan\n 0x064e: 0xfc60, // Shadda + Fatha\n 0x064f: 0xfc61, // Shadda + Damma\n 0x0650: 0xfc62 // Shadda + Kasra\n }\n };\n\n var arabic_diacritics = {\n 1612: 64606, // Shadda + Dammatan\n 1613: 64607, // Shadda + Kasratan\n 1614: 64608, // Shadda + Fatha\n 1615: 64609, // Shadda + Damma\n 1616: 64610 // Shadda + Kasra\n };\n\n var alfletter = [1570, 1571, 1573, 1575];\n\n var noChangeInForm = -1;\n var isolatedForm = 0;\n var finalForm = 1;\n var initialForm = 2;\n var medialForm = 3;\n\n jsPDFAPI.__arabicParser__ = {};\n\n //private\n var isInArabicSubstitutionA = (jsPDFAPI.__arabicParser__.isInArabicSubstitutionA = function(\n letter\n ) {\n return typeof arabicSubstitionA[letter.charCodeAt(0)] !== \"undefined\";\n });\n\n var isArabicLetter = (jsPDFAPI.__arabicParser__.isArabicLetter = function(\n letter\n ) {\n return (\n typeof letter === \"string\" &&\n /^[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]+$/.test(\n letter\n )\n );\n });\n\n var isArabicEndLetter = (jsPDFAPI.__arabicParser__.isArabicEndLetter = function(\n letter\n ) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length <= 2\n );\n });\n\n var isArabicAlfLetter = (jsPDFAPI.__arabicParser__.isArabicAlfLetter = function(\n letter\n ) {\n return (\n isArabicLetter(letter) && alfletter.indexOf(letter.charCodeAt(0)) >= 0\n );\n });\n\n jsPDFAPI.__arabicParser__.arabicLetterHasIsolatedForm = function(letter) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length >= 1\n );\n };\n\n var arabicLetterHasFinalForm = (jsPDFAPI.__arabicParser__.arabicLetterHasFinalForm = function(\n letter\n ) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length >= 2\n );\n });\n\n jsPDFAPI.__arabicParser__.arabicLetterHasInitialForm = function(letter) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length >= 3\n );\n };\n\n var arabicLetterHasMedialForm = (jsPDFAPI.__arabicParser__.arabicLetterHasMedialForm = function(\n letter\n ) {\n return (\n isArabicLetter(letter) &&\n isInArabicSubstitutionA(letter) &&\n arabicSubstitionA[letter.charCodeAt(0)].length == 4\n );\n });\n\n var resolveLigatures = (jsPDFAPI.__arabicParser__.resolveLigatures = function(\n letters\n ) {\n var i = 0;\n var tmpLigatures = ligatures;\n var result = \"\";\n var effectedLetters = 0;\n\n for (i = 0; i < letters.length; i += 1) {\n if (typeof tmpLigatures[letters.charCodeAt(i)] !== \"undefined\") {\n effectedLetters++;\n tmpLigatures = tmpLigatures[letters.charCodeAt(i)];\n\n if (typeof tmpLigatures === \"number\") {\n result += String.fromCharCode(tmpLigatures);\n tmpLigatures = ligatures;\n effectedLetters = 0;\n }\n if (i === letters.length - 1) {\n tmpLigatures = ligatures;\n result += letters.charAt(i - (effectedLetters - 1));\n i = i - (effectedLetters - 1);\n effectedLetters = 0;\n }\n } else {\n tmpLigatures = ligatures;\n result += letters.charAt(i - effectedLetters);\n i = i - effectedLetters;\n effectedLetters = 0;\n }\n }\n\n return result;\n });\n\n jsPDFAPI.__arabicParser__.isArabicDiacritic = function(letter) {\n return (\n letter !== undefined &&\n arabic_diacritics[letter.charCodeAt(0)] !== undefined\n );\n };\n\n var getCorrectForm = (jsPDFAPI.__arabicParser__.getCorrectForm = function(\n currentChar,\n beforeChar,\n nextChar\n ) {\n if (!isArabicLetter(currentChar)) {\n return -1;\n }\n\n if (isInArabicSubstitutionA(currentChar) === false) {\n return noChangeInForm;\n }\n if (\n !arabicLetterHasFinalForm(currentChar) ||\n (!isArabicLetter(beforeChar) && !isArabicLetter(nextChar)) ||\n (!isArabicLetter(nextChar) && isArabicEndLetter(beforeChar)) ||\n (isArabicEndLetter(currentChar) && !isArabicLetter(beforeChar)) ||\n (isArabicEndLetter(currentChar) && isArabicAlfLetter(beforeChar)) ||\n (isArabicEndLetter(currentChar) && isArabicEndLetter(beforeChar))\n ) {\n return isolatedForm;\n }\n\n if (\n arabicLetterHasMedialForm(currentChar) &&\n isArabicLetter(beforeChar) &&\n !isArabicEndLetter(beforeChar) &&\n isArabicLetter(nextChar) &&\n arabicLetterHasFinalForm(nextChar)\n ) {\n return medialForm;\n }\n\n if (isArabicEndLetter(currentChar) || !isArabicLetter(nextChar)) {\n return finalForm;\n }\n return initialForm;\n });\n\n /**\n * @name processArabic\n * @function\n * @param {string} text\n * @returns {string}\n */\n var parseArabic = function(text) {\n text = text || \"\";\n\n var result = \"\";\n var i = 0;\n var j = 0;\n var position = 0;\n var currentLetter = \"\";\n var prevLetter = \"\";\n var nextLetter = \"\";\n\n var words = text.split(\"\\\\s+\");\n var newWords = [];\n for (i = 0; i < words.length; i += 1) {\n newWords.push(\"\");\n for (j = 0; j < words[i].length; j += 1) {\n currentLetter = words[i][j];\n prevLetter = words[i][j - 1];\n nextLetter = words[i][j + 1];\n if (isArabicLetter(currentLetter)) {\n position = getCorrectForm(currentLetter, prevLetter, nextLetter);\n if (position !== -1) {\n newWords[i] += String.fromCharCode(\n arabicSubstitionA[currentLetter.charCodeAt(0)][position]\n );\n } else {\n newWords[i] += currentLetter;\n }\n } else {\n newWords[i] += currentLetter;\n }\n }\n\n newWords[i] = resolveLigatures(newWords[i]);\n }\n result = newWords.join(\" \");\n\n return result;\n };\n\n var processArabic = (jsPDFAPI.__arabicParser__.processArabic = jsPDFAPI.processArabic = function() {\n var text =\n typeof arguments[0] === \"string\" ? arguments[0] : arguments[0].text;\n var tmpText = [];\n var result;\n\n if (Array.isArray(text)) {\n var i = 0;\n tmpText = [];\n for (i = 0; i < text.length; i += 1) {\n if (Array.isArray(text[i])) {\n tmpText.push([parseArabic(text[i][0]), text[i][1], text[i][2]]);\n } else {\n tmpText.push([parseArabic(text[i])]);\n }\n }\n result = tmpText;\n } else {\n result = parseArabic(text);\n }\n if (typeof arguments[0] === \"string\") {\n return result;\n } else {\n arguments[0].text = result;\n return arguments[0];\n }\n });\n\n jsPDFAPI.events.push([\"preProcessText\", processArabic]);\n})(jsPDF.API);\n","/** @license\n * jsPDF Autoprint Plugin\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name autoprint\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * Makes the PDF automatically open the print-Dialog when opened in a PDF-viewer.\n *\n * @name autoPrint\n * @function\n * @param {Object} options (optional) Set the attribute variant to 'non-conform' (default) or 'javascript' to activate different methods of automatic printing when opening in a PDF-viewer .\n * @returns {jsPDF}\n * @example\n * var doc = new jsPDF();\n * doc.text(10, 10, 'This is a test');\n * doc.autoPrint({variant: 'non-conform'});\n * doc.save('autoprint.pdf');\n */\n jsPDFAPI.autoPrint = function(options) {\n \"use strict\";\n var refAutoPrintTag;\n options = options || {};\n options.variant = options.variant || \"non-conform\";\n\n switch (options.variant) {\n case \"javascript\":\n //https://github.com/Rob--W/pdf.js/commit/c676ecb5a0f54677b9f3340c3ef2cf42225453bb\n this.addJS(\"print({});\");\n break;\n case \"non-conform\":\n default:\n this.internal.events.subscribe(\"postPutResources\", function() {\n refAutoPrintTag = this.internal.newObject();\n this.internal.out(\"<<\");\n this.internal.out(\"/S /Named\");\n this.internal.out(\"/Type /Action\");\n this.internal.out(\"/N /Print\");\n this.internal.out(\">>\");\n this.internal.out(\"endobj\");\n });\n\n this.internal.events.subscribe(\"putCatalog\", function() {\n this.internal.out(\"/OpenAction \" + refAutoPrintTag + \" 0 R\");\n });\n break;\n }\n return this;\n };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF Canvas PlugIn\n * This plugin mimics the HTML5 Canvas\n *\n * The goal is to provide a way for current canvas users to print directly to a PDF.\n * @name canvas\n * @module\n */\n(function(jsPDFAPI) {\n \"use strict\";\n\n /**\n * @class Canvas\n * @classdesc A Canvas Wrapper for jsPDF\n */\n var Canvas = function() {\n var jsPdfInstance = undefined;\n Object.defineProperty(this, \"pdf\", {\n get: function() {\n return jsPdfInstance;\n },\n set: function(value) {\n jsPdfInstance = value;\n }\n });\n\n var _width = 150;\n /**\n * The height property is a positive integer reflecting the height HTML attribute of the