UNPKG

296 kBJavaScriptView Raw
1// PouchDB localStorage plugin 9.0.0
2// Based on localstorage-down: https://github.com/No9/localstorage-down
3//
4// (c) 2012-2024 Dale Harvey and the PouchDB team
5// PouchDB may be freely distributed under the Apache license, version 2.0.
6// For all details and documentation:
7// http://pouchdb.com
8!function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[a]={exports:{}};t[a][0].call(f.exports,(function(e){return i(t[a][1][e]||e)}),f,f.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){(function(e){(function(){function r(e){this._db=e,this._operations=[],this._written=!1}r.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},r.prototype.put=function(e,t){this._checkWritten();var r=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(r)throw r;if(r=this._db._checkKeyValue(t,"value",this._db._isBuffer))throw r;return this._db._isBuffer(e)||(e=String(e)),this._db._isBuffer(t)||(t=String(t)),"function"==typeof this._put?this._put(e,t):this._operations.push({type:"put",key:e,value:t}),this},r.prototype.del=function(e){this._checkWritten();var t=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(t)throw t;return this._db._isBuffer(e)||(e=String(e)),"function"==typeof this._del?this._del(e):this._operations.push({type:"del",key:e}),this},r.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},r.prototype.write=function(t,r){if(this._checkWritten(),"function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("write() requires a callback argument");return"object"!=typeof t&&(t={}),this._written=!0,"function"==typeof this._write?this._write(r):"function"==typeof this._db._batch?this._db._batch(this._operations,t,r):void e.nextTick(r)},t.exports=r}).call(this)}).call(this,e("_process"))},{_process:94}],2:[function(e,t,r){(function(e){(function(){function r(e){this.db=e,this._ended=!1,this._nexting=!1}r.prototype.next=function(t){var r=this;if("function"!=typeof t)throw new Error("next() requires a callback argument");return r._ended?t(new Error("cannot call next() after end()")):r._nexting?t(new Error("cannot call next() before previous next() has completed")):(r._nexting=!0,"function"==typeof r._next?r._next((function(){r._nexting=!1,t.apply(null,arguments)})):void e.nextTick((function(){r._nexting=!1,t()})))},r.prototype.end=function(t){if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?t(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(t):void e.nextTick(t))},t.exports=r}).call(this)}).call(this,e("_process"))},{_process:94}],3:[function(e,t,r){(function(r,n){(function(){var i=e("xtend"),o=e("./abstract-iterator"),a=e("./abstract-chained-batch");function s(e){if(!arguments.length||void 0===e)throw new Error("constructor requires at least a location argument");if("string"!=typeof e)throw new Error("constructor requires a location string argument");this.location=e}s.prototype.open=function(e,t){if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");if("object"!=typeof e&&(e={}),"function"==typeof this._open)return this._open(e,t);n.nextTick(t)},s.prototype.close=function(e){if("function"!=typeof e)throw new Error("close() requires a callback argument");if("function"==typeof this._close)return this._close(e);n.nextTick(e)},s.prototype.get=function(e,t,r){var i;if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("get() requires a callback argument");return(i=this._checkKeyValue(e,"key",this._isBuffer))?r(i):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),"function"==typeof this._get?this._get(e,t,r):void n.nextTick((function(){r(new Error("NotFound"))})))},s.prototype.put=function(e,t,r,i){var o;if("function"==typeof r&&(i=r),"function"!=typeof i)throw new Error("put() requires a callback argument");return(o=this._checkKeyValue(e,"key",this._isBuffer))||(o=this._checkKeyValue(t,"value",this._isBuffer))?i(o):(this._isBuffer(e)||(e=String(e)),this._isBuffer(t)||n.browser||(t=String(t)),"object"!=typeof r&&(r={}),"function"==typeof this._put?this._put(e,t,r,i):void n.nextTick(i))},s.prototype.del=function(e,t,r){var i;if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("del() requires a callback argument");return(i=this._checkKeyValue(e,"key",this._isBuffer))?r(i):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,r):void n.nextTick(r))},s.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return r(new Error("batch(array) requires an array argument"));"object"!=typeof t&&(t={});for(var i,o,a=0,s=e.length;a<s;a++)if("object"==typeof(i=e[a])){if(o=this._checkKeyValue(i.type,"type",this._isBuffer))return r(o);if(o=this._checkKeyValue(i.key,"key",this._isBuffer))return r(o);if("put"==i.type&&(o=this._checkKeyValue(i.value,"value",this._isBuffer)))return r(o)}if("function"==typeof this._batch)return this._batch(e,t,r);n.nextTick(r)},s.prototype.approximateSize=function(e,t,r){if(null==e||null==t||"function"==typeof e||"function"==typeof t)throw new Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof r)throw new Error("approximateSize() requires a callback argument");if(this._isBuffer(e)||(e=String(e)),this._isBuffer(t)||(t=String(t)),"function"==typeof this._approximateSize)return this._approximateSize(e,t,r);n.nextTick((function(){r(null,0)}))},s.prototype._setupIteratorOptions=function(e){var t=this;return e=i(e),["start","end","gt","gte","lt","lte"].forEach((function(r){e[r]&&t._isBuffer(e[r])&&0===e[r].length&&delete e[r]})),e.reverse=!!e.reverse,e.reverse&&e.lt&&(e.start=e.lt),e.reverse&&e.lte&&(e.start=e.lte),!e.reverse&&e.gt&&(e.start=e.gt),!e.reverse&&e.gte&&(e.start=e.gte),(e.reverse&&e.lt&&!e.lte||!e.reverse&&e.gt&&!e.gte)&&(e.exclusiveStart=!0),e},s.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),e=this._setupIteratorOptions(e),"function"==typeof this._iterator?this._iterator(e):new o(this)},s.prototype._chainedBatch=function(){return new a(this)},s.prototype._isBuffer=function(e){return r.isBuffer(e)},s.prototype._checkKeyValue=function(e,t){if(null==e)return new Error(t+" cannot be `null` or `undefined`");if(null==e)return new Error(t+" cannot be `null` or `undefined`");if(this._isBuffer(e)){if(0===e.length)return new Error(t+" cannot be an empty Buffer")}else if(""===String(e))return new Error(t+" cannot be an empty String")},t.exports.AbstractLevelDOWN=s,t.exports.AbstractIterator=o,t.exports.AbstractChainedBatch=a}).call(this)}).call(this,{isBuffer:e("../is-buffer/index.js")},e("_process"))},{"../is-buffer/index.js":54,"./abstract-chained-batch":1,"./abstract-iterator":2,_process:94,xtend:4}],4:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}},{}],5:[function(e,t,r){"use strict";t.exports=function(e){return function(){var t=arguments.length;if(t){for(var r=[],n=-1;++n<t;)r[n]=arguments[n];return e.call(this,r)}return e.call(this,[])}}},{}],6:[function(e,t,r){(function(r){(function(){"use strict";var n=e("object.assign/polyfill")();
9/*!
10 * The buffer module from node.js, for the browser.
11 *
12 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
13 * @license MIT
14 */function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=e("util/"),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function f(e){return Object.prototype.toString.call(e)}function l(e){return!o(e)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var d=t.exports=b,h=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(a.isFunction(e)){if(c)return e.name;var t=e.toString().match(h);return t&&t[1]}}function y(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(c||!a.isFunction(e))return a.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function v(e,t,r,n,i){throw new d.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||v(e,!0,t,"==",d.ok)}function m(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&f(e)===f(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),o=_(t);if(i&&!o||!i&&o)return!1;if(i)return e=u.call(e),t=u.call(t),m(e,t,r);var s,c,f=k(e),l=k(t);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),c=f.length-1;c>=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(s=f[c],!m(e[s],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&w(i,r)||s)&&v(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return y(g(e.actual),128)+" "+e.operator+" "+y(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(d.AssertionError,Error),d.fail=v,d.ok=b,d.equal=function(e,t,r){e!=t&&v(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&v(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){m(e,t,!1)||v(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){m(e,t,!0)||v(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){m(e,t,!1)&&v(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,n){m(t,r,!0)&&v(t,r,n,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&v(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&v(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){E(!0,e,t,r)},d.doesNotThrow=function(e,t,r){E(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=n((function e(t,r){t||v(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var k=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object.assign/polyfill":92,"util/":145}],7:[function(e,t,r){"use strict";r.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=c(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(f(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],8:[function(e,t,r){},{}],9:[function(e,t,r){(function(t){(function(){
15/*!
16 * The buffer module from node.js, for the browser.
17 *
18 * @author Feross Aboukhadijeh <https://feross.org>
19 * @license MIT
20 */
21"use strict";var t=e("base64-js"),n=e("ieee754"),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=a,r.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},r.INSPECT_MAX_BYTES=50;function o(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|h(e,t),n=o(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(N(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var i=function(e){if(a.isBuffer(e)){var t=0|d(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||D(e.length)?o(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|d(e))}function f(e){for(var t=e.length<0?0:0|d(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,a.prototype),n}function d(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(e).length;default:if(i)return n?-1:C(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var l=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){l=!1;break}if(l)return o}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(D(s))return a;e[r+a]=s}return a}function m(e,t,r,n){return q(C(t,e.length-r),e,r,n)}function _(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return q(I(t),e,r,n)}function E(e,t,r,n){return q(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function k(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}r.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(N(o,Uint8Array))i+o.length>n.length?a.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},a.byteLength=h,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(o,s),c=this.slice(n,i),f=e.slice(t,r),l=0;l<u;++l)if(c[l]!==f[l]){o=c[l],s=f[l];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function j(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=U[e[o]];return i}function A(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function L(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%u]}return this};var P=/[^+/0-9A-Za-z-_]/g;function C(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function I(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function D(e){return e!=e}var U=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return e}()}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":7,buffer:9,ieee754:52}],10:[function(e,t,r){"use strict";var n=e("get-intrinsic"),i=e("./"),o=i(n("String.prototype.indexOf"));t.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},{"./":11,"get-intrinsic":42}],11:[function(e,t,r){"use strict";var n=e("function-bind"),i=e("get-intrinsic"),o=e("set-function-length"),a=e("es-errors/type"),s=i("%Function.prototype.apply%"),u=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||n.call(u,s),f=e("es-define-property"),l=i("%Math.max%");t.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=c(n,u,arguments);return o(t,1+l(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};f?f(t.exports,"apply",{value:d}):t.exports.apply=d},{"es-define-property":31,"es-errors/type":37,"function-bind":41,"get-intrinsic":42,"set-function-length":104}],12:[function(e,t,r){function n(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===n(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===n(e)},r.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("buffer").Buffer.isBuffer},{buffer:9}],13:[function(e,t,r){var n=e("buffer").Buffer,i=".PYFGCRLAOEUIDHTNSQJKXBMWVZ_pyfgcrlaoeuidhtnsqjkxbmwvz1234567890".split("").sort().join("");t.exports=function(e,t){if(t=t||{},64!==(e=e||i).length)throw new Error("a base 64 encoding requires 64 chars");var r=new n(128);r.fill();for(var o=0;o<64;o++){var a=e.charCodeAt(o);r[a]=o}return t.encode=function(t){for(var r="",n=t.length,i=0,o=0;o<n;o++){var a=t[o];switch(o%3){case 0:r+=e[a>>2],i=(3&a)<<4;break;case 1:r+=e[i|a>>4],i=(15&a)<<2;break;case 2:r+=e[i|a>>6],r+=e[63&a],i=0}}return n%3&&(r+=e[i]),r},t.decode=function(e){for(var t=e.length,i=0,o=new n(~~(t/4*3)),a=0,s=0;s<t;s++){var u=r[e.charCodeAt(s)];switch(s%4){case 0:a=u<<2;break;case 1:o[i++]=a|u>>4,a=u<<4&255;break;case 2:o[i++]=a|u>>2,a=u<<6&255;break;case 3:o[i++]=a|u}}return o},t},t.exports(i,t.exports)},{buffer:9}],14:[function(e,t,r){var n=e("abstract-leveldown").AbstractIterator;function i(e,t){n.call(this,e),this._options=t,this._iterator=null,this._operations=[]}e("inherits")(i,n),i.prototype.setDb=function(e){var t=this._iterator=e.iterator(this._options);this._operations.forEach((function(e){t[e.method].apply(t,e.args)}))},i.prototype._operation=function(e,t){if(this._iterator)return this._iterator[e].apply(this._iterator,t);this._operations.push({method:e,args:t})},"next end".split(" ").forEach((function(e){i.prototype["_"+e]=function(){this._operation(e,arguments)}})),i.prototype.seek=function(){this._operation("seek",arguments)},t.exports=i},{"abstract-leveldown":19,inherits:53}],15:[function(e,t,r){var n=e("abstract-leveldown").AbstractLevelDOWN,i=e("inherits"),o=e("./deferred-iterator"),a="put get del batch clear".split(" "),s="approximateSize compactRange".split(" ");function u(e){n.call(this,e.supports||{}),s.forEach((function(t){"function"!=typeof e[t]||this.supports.additionalMethods[t]||(this.supports.additionalMethods[t]=!0)}),this),this._db=e,this._operations=[],c(this)}function c(e){a.forEach((function(t){e["_"+t]=function(){this._operations.push({method:t,args:arguments})}})),Object.keys(e.supports.additionalMethods).forEach((function(t){e[t]=function(){this._operations.push({method:t,args:arguments})}})),e._iterator=function(t){var r=new o(e,t);return this._operations.push({iterator:r}),r}}i(u,n),u.prototype.type="deferred-leveldown",u.prototype._open=function(e,t){var r=this;this._db.open(e,(function(e){if(e)return t(e);r._operations.forEach((function(e){e.iterator?e.iterator.setDb(r._db):r._db[e.method].apply(r._db,e.args)})),r._operations=[],function(e){a.concat("iterator").forEach((function(t){e["_"+t]=function(){return this._db[t].apply(this._db,arguments)}})),Object.keys(e.supports.additionalMethods).forEach((function(t){e[t]=function(){return this._db[t].apply(this._db,arguments)}}))}(r),t()}))},u.prototype._close=function(e){var t=this;this._db.close((function(r){if(r)return e(r);c(t),e()}))},u.prototype._serializeKey=function(e){return e},u.prototype._serializeValue=function(e){return e},t.exports=u,t.exports.DeferredIterator=o},{"./deferred-iterator":14,"abstract-leveldown":19,inherits:53}],16:[function(e,t,r){var n=e("./next-tick");function i(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(e,t){this._checkWritten();var r=this.db._checkKey(e)||this.db._checkValue(t);if(r)throw r;return e=this.db._serializeKey(e),t=this.db._serializeValue(t),this._put(e,t),this},i.prototype._put=function(e,t){this._operations.push({type:"put",key:e,value:t})},i.prototype.del=function(e){this._checkWritten();var t=this.db._checkKey(e);if(t)throw t;return e=this.db._serializeKey(e),this._del(e),this},i.prototype._del=function(e){this._operations.push({type:"del",key:e})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");"object"==typeof e&&null!==e||(e={}),this._written=!0,this._write(e,t)},i.prototype._write=function(e,t){this.db._batch(this._operations,e,t)},i.prototype._nextTick=n,t.exports=i},{"./next-tick":20}],17:[function(e,t,r){var n=e("./next-tick");function i(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._ended=!1,this._nexting=!1}i.prototype.next=function(e){var t=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return t._ended?(n(e,new Error("cannot call next() after end()")),t):t._nexting?(n(e,new Error("cannot call next() before previous next() has completed")),t):(t._nexting=!0,t._next((function(){t._nexting=!1,e.apply(null,arguments)})),t)},i.prototype._next=function(e){n(e)},i.prototype.seek=function(e){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");e=this.db._serializeKey(e),this._seek(e)},i.prototype._seek=function(e){},i.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");if(this._ended)return n(e,new Error("end() already called on iterator"));this._ended=!0,this._end(e)},i.prototype._end=function(e){n(e)},i.prototype._nextTick=n,t.exports=i},{"./next-tick":20}],18:[function(e,t,r){var n=e("xtend"),i=e("level-supports"),o=e("buffer").Buffer,a=e("./abstract-iterator"),s=e("./abstract-chained-batch"),u=e("./next-tick"),c=Object.prototype.hasOwnProperty,f="start end gt gte lt lte".split(" ");function l(e){this.status="new",this.supports=i(e,{status:!0})}function d(e,t){var r={};for(var n in t)if(c.call(t,n)){var i=t[n];h(n)&&(i=e._serializeKey(i)),r[n]=i}return r}function h(e){return-1!==f.indexOf(e)}l.prototype.open=function(e,t){var r=this,n=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"==typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,(function(e){if(e)return r.status=n,t(e);r.status="open",t()}))},l.prototype._open=function(e,t){u(t)},l.prototype.close=function(e){var t=this,r=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close((function(n){if(n)return t.status=r,e(n);t.status="closed",e()}))},l.prototype._close=function(e){u(e)},l.prototype.get=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("get() requires a callback argument");var n=this._checkKey(e);if(n)return u(r,n);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),t.asBuffer=!1!==t.asBuffer,this._get(e,t,r)},l.prototype._get=function(e,t,r){u((function(){r(new Error("NotFound"))}))},l.prototype.put=function(e,t,r,n){if("function"==typeof r&&(n=r),"function"!=typeof n)throw new Error("put() requires a callback argument");var i=this._checkKey(e)||this._checkValue(t);if(i)return u(n,i);e=this._serializeKey(e),t=this._serializeValue(t),"object"==typeof r&&null!==r||(r={}),this._put(e,t,r,n)},l.prototype._put=function(e,t,r,n){u(n)},l.prototype.del=function(e,t,r){if("function"==typeof t&&(r=t),"function"!=typeof r)throw new Error("del() requires a callback argument");var n=this._checkKey(e);if(n)return u(r,n);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),this._del(e,t,r)},l.prototype._del=function(e,t,r){u(r)},l.prototype.batch=function(e,t,r){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(r=t),"function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return u(r,new Error("batch(array) requires an array argument"));if(0===e.length)return u(r);"object"==typeof t&&null!==t||(t={});for(var i=new Array(e.length),o=0;o<e.length;o++){if("object"!=typeof e[o]||null===e[o])return u(r,new Error("batch(array) element must be an object and not `null`"));var a=n(e[o]);if("put"!==a.type&&"del"!==a.type)return u(r,new Error("`type` must be 'put' or 'del'"));var s=this._checkKey(a.key);if(s)return u(r,s);if(a.key=this._serializeKey(a.key),"put"===a.type){var c=this._checkValue(a.value);if(c)return u(r,c);a.value=this._serializeValue(a.value)}i[o]=a}this._batch(i,t,r)},l.prototype._batch=function(e,t,r){u(r)},l.prototype.clear=function(e,t){if("function"==typeof e)t=e;else if("function"!=typeof t)throw new Error("clear() requires a callback argument");(e=d(this,e)).reverse=!!e.reverse,e.limit="limit"in e?e.limit:-1,this._clear(e,t)},l.prototype._clear=function(e,t){e.keys=!0,e.values=!1,e.keyAsBuffer=!0,e.valueAsBuffer=!0;var r=this._iterator(e),n={},i=this,o=function(e){if(e)return r.end((function(){t(e)}));r.next((function(e,a){return e?o(e):void 0===a?r.end(t):void i._del(a,n,o)}))};o()},l.prototype._setupIteratorOptions=function(e){return(e=d(this,e)).reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},l.prototype.iterator=function(e){return"object"==typeof e&&null!==e||(e={}),e=this._setupIteratorOptions(e),this._iterator(e)},l.prototype._iterator=function(e){return new a(this)},l.prototype._chainedBatch=function(){return new s(this)},l.prototype._serializeKey=function(e){return e},l.prototype._serializeValue=function(e){return e},l.prototype._checkKey=function(e){return null==e?new Error("key cannot be `null` or `undefined`"):o.isBuffer(e)&&0===e.length?new Error("key cannot be an empty Buffer"):""===e?new Error("key cannot be an empty String"):Array.isArray(e)&&0===e.length?new Error("key cannot be an empty Array"):void 0},l.prototype._checkValue=function(e){if(null==e)return new Error("value cannot be `null` or `undefined`")},l.prototype._nextTick=u,t.exports=l},{"./abstract-chained-batch":16,"./abstract-iterator":17,"./next-tick":20,buffer:9,"level-supports":75,xtend:162}],19:[function(e,t,r){r.AbstractLevelDOWN=e("./abstract-leveldown"),r.AbstractIterator=e("./abstract-iterator"),r.AbstractChainedBatch=e("./abstract-chained-batch")},{"./abstract-chained-batch":16,"./abstract-iterator":17,"./abstract-leveldown":18}],20:[function(e,t,r){t.exports=e("immediate")},{immediate:21}],21:[function(e,t,r){"use strict";var n,i,o,a=[e("./nextTick"),e("./queueMicrotask"),e("./mutation.js"),e("./messageChannel"),e("./stateChange"),e("./timeout")],s=-1,u=[],c=!1;function f(){n&&i&&(n=!1,i.length?u=i.concat(u):s=-1,u.length&&l())}function l(){if(!n){c=!1,n=!0;for(var e=u.length,t=setTimeout(f);e;){for(i=u,u=[];i&&++s<e;)i[s].run();s=-1,e=u.length}i=null,s=-1,n=!1,clearTimeout(t)}}for(var d=-1,h=a.length;++d<h;)if(a[d]&&a[d].test&&a[d].test()){o=a[d].install(l);break}function p(e,t){this.fun=e,this.array=t}p.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},t.exports=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),c||n||(c=!0,o())}},{"./messageChannel":22,"./mutation.js":23,"./nextTick":8,"./queueMicrotask":24,"./stateChange":25,"./timeout":26}],22:[function(e,t,r){(function(e){(function(){"use strict";r.test=function(){return!e.setImmediate&&void 0!==e.MessageChannel},r.install=function(t){var r=new e.MessageChannel;return r.port1.onmessage=t,function(){r.port2.postMessage(0)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,r){(function(e){(function(){"use strict";var t=e.MutationObserver||e.WebKitMutationObserver;r.test=function(){return t},r.install=function(r){var n=0,i=new t(r),o=e.document.createTextNode("");return i.observe(o,{characterData:!0}),function(){o.data=n=++n%2}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,r){(function(e){(function(){"use strict";r.test=function(){return"function"==typeof e.queueMicrotask},r.install=function(t){return function(){e.queueMicrotask(t)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],25:[function(e,t,r){(function(e){(function(){"use strict";r.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},r.install=function(t){return function(){var r=e.document.createElement("script");return r.onreadystatechange=function(){t(),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},e.document.documentElement.appendChild(r),t}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],26:[function(e,t,r){"use strict";r.test=function(){return!0},r.install=function(e){return function(){setTimeout(e,0)}}},{}],27:[function(e,t,r){"use strict";var n=e("es-define-property"),i=e("es-errors/syntax"),o=e("es-errors/type"),a=e("gopd");t.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],l=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&l?l.configurable:!c,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===u&&l?l.writable:!u});else{if(!f&&(s||u||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},{"es-define-property":31,"es-errors/syntax":36,"es-errors/type":37,gopd:43}],28:[function(e,t,r){"use strict";function n(e){if(this._capacity=o(e),this._length=0,this._front=0,i(e)){for(var t=e.length,r=0;r<t;++r)this[r]=e[r];this._length=t}}n.prototype.toArray=function(){for(var e=this._length,t=new Array(e),r=this._front,n=this._capacity,i=0;i<e;++i)t[i]=this[r+i&n-1];return t},n.prototype.push=function(e){var t=arguments.length,r=this._length;if(t>1){var n=this._capacity;if(r+t>n){for(var i=0;i<t;++i){this._checkCapacity(r+1),this[o=this._front+r&this._capacity-1]=arguments[i],r++,this._length=r}return r}for(var o=this._front,i=0;i<t;++i)this[o+r&n-1]=arguments[i],o++;return this._length=r+t,r+t}return 0===t?r:(this._checkCapacity(r+1),this[i=this._front+r&this._capacity-1]=e,this._length=r+1,r+1)},n.prototype.pop=function(){var e=this._length;if(0!==e){var t=this._front+e-1&this._capacity-1,r=this[t];return this[t]=void 0,this._length=e-1,r}},n.prototype.shift=function(){var e=this._length;if(0!==e){var t=this._front,r=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length=e-1,r}},n.prototype.unshift=function(e){var t=this._length,r=arguments.length;if(r>1){if(t+r>(i=this._capacity)){for(var n=r-1;n>=0;n--){this._checkCapacity(t+1);var i=this._capacity;this[a=(this._front-1&i-1^i)-i]=arguments[n],t++,this._length=t,this._front=a}return t}var o=this._front;for(n=r-1;n>=0;n--){var a;this[a=(o-1&i-1^i)-i]=arguments[n],o=a}return this._front=o,this._length=t+r,t+r}if(0===r)return t;this._checkCapacity(t+1);i=this._capacity;return this[n=(this._front-1&i-1^i)-i]=e,this._length=t+1,this._front=n,t+1},n.prototype.peekBack=function(){var e=this._length;if(0!==e)return this[this._front+e-1&this._capacity-1]},n.prototype.peekFront=function(){if(0!==this._length)return this[this._front]},n.prototype.get=function(e){var t=e;if(t===(0|t)){var r=this._length;if(t<0&&(t+=r),!(t<0||t>=r))return this[this._front+t&this._capacity-1]}},n.prototype.isEmpty=function(){return 0===this._length},n.prototype.clear=function(){for(var e=this._length,t=this._front,r=this._capacity,n=0;n<e;++n)this[t+n&r-1]=void 0;this._length=0,this._front=0},n.prototype.toString=function(){return this.toArray().toString()},n.prototype.valueOf=n.prototype.toString,n.prototype.removeFront=n.prototype.shift,n.prototype.removeBack=n.prototype.pop,n.prototype.insertFront=n.prototype.unshift,n.prototype.insertBack=n.prototype.push,n.prototype.enqueue=n.prototype.push,n.prototype.dequeue=n.prototype.shift,n.prototype.toJSON=n.prototype.toArray,Object.defineProperty(n.prototype,"length",{get:function(){return this._length},set:function(){throw new RangeError("")}}),n.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(o(1.5*this._capacity+16))},n.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var r=this._front,n=this._length;r+n>t&&function(e,t,r,n,i){for(var o=0;o<i;++o)r[o+n]=e[o+t],e[o+t]=void 0}(this,0,this,t,r+n&t-1)};var i=Array.isArray;function o(e){if("number"!=typeof e){if(!i(e))return 16;e=e.length}return t=Math.min(Math.max(16,e),1073741824),t>>>=0,t-=1,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,1+(t|=t>>16);var t}t.exports=n},{}],29:[function(e,t,r){var n=e("prr");function i(e,t,r){t&&"string"!=typeof t&&(t=t.message||t.name),n(this,{type:e,name:e,cause:"string"!=typeof t?t:r,message:t},"ewr")}function o(e,t){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),i.call(this,"CustomError",e,t)}o.prototype=new Error,t.exports=function(e){var t=function(t,r){return function(e,t,r){var n=function(r,o){i.call(this,t,r,o),"FilesystemError"==t&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(e.errno[this.cause.errno]?e.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,n)};return n.prototype=r?new r:new o,n}(e,t,r)};return{CustomError:o,FilesystemError:t("FilesystemError"),createError:t}}},{prr:95}],30:[function(e,t,r){var n=t.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];t.exports.errno={},t.exports.code={},n.forEach((function(e){t.exports.errno[e.errno]=e,t.exports.code[e.code]=e})),t.exports.custom=e("./custom")(t.exports),t.exports.create=t.exports.custom.createError},{"./custom":29}],31:[function(e,t,r){"use strict";var n=e("get-intrinsic")("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}t.exports=n},{"get-intrinsic":42}],32:[function(e,t,r){"use strict";t.exports=EvalError},{}],33:[function(e,t,r){"use strict";t.exports=Error},{}],34:[function(e,t,r){"use strict";t.exports=RangeError},{}],35:[function(e,t,r){"use strict";t.exports=ReferenceError},{}],36:[function(e,t,r){"use strict";t.exports=SyntaxError},{}],37:[function(e,t,r){"use strict";t.exports=TypeError},{}],38:[function(e,t,r){"use strict";t.exports=URIError},{}],39:[function(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},o=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),s=0===c.x}catch(e){s=!1}function f(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r){if(t)e.call(r);else for(var n=e.length,i=w(e,n),o=0;o<n;++o)i[o].call(r)}function d(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=w(e,i),a=0;a<i;++a)o[a].call(r,n)}function h(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,a=w(e,o),s=0;s<o;++s)a[s].call(r,n,i)}function p(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var a=e.length,s=w(e,a),u=0;u<a;++u)s[u].call(r,n,i,o)}function y(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=w(e,i),a=0;a<i;++a)o[a].apply(r,n)}function g(e,t,r,i){var o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]):(a=e._events=n(null),e._eventsCount=0),s){if("function"==typeof s?s=a[t]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(o=f(e))&&o>0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=a[t]=r,++e._eventsCount;return e}function v(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function b(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=o.call(v,n);return i.listener=r,n.wrapFn=i,i}function m(e,t,r){var n=e._events;if(!n)return[];var i=n[t];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):w(i,i.length):[]}function _(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function w(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}s?Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');u=e}}):a.defaultMaxListeners=u,a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(e){var t,r,n,i,o,a,s="error"===e;if(a=this._events)s=s&&null==a.error;else if(!s)return!1;if(s){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(r=a[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:l(r,c,this);break;case 2:d(r,c,this,arguments[1]);break;case 3:h(r,c,this,arguments[1],arguments[2]);break;case 4:p(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];y(r,c,this,i)}return!0},a.prototype.addListener=function(e,t){return g(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return g(this,e,t,!0)},a.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,b(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,b(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,i,o,a,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=n(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}(r,o),1===r.length&&(i[e]=r[0]),i.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.removeAllListeners=function(e){var t,r,o;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=n(null):delete r[e]),this;if(0===arguments.length){var a,s=i(r);for(o=0;o<s.length;++o)"removeListener"!==(a=s[o])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return m(this,e,!0)},a.prototype.rawListeners=function(e){return m(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},a.prototype.listenerCount=_,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],40:[function(e,t,r){"use strict";var n="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,o=Math.max,a=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r},s=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r},u=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};t.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==i.apply(t))throw new TypeError(n+t);for(var r,c=s(arguments,1),f=function(){if(this instanceof r){var n=t.apply(this,a(c,arguments));return Object(n)===n?n:this}return t.apply(e,a(c,arguments))},l=o(0,t.length-c.length),d=[],h=0;h<l;h++)d[h]="$"+h;if(r=Function("binder","return function ("+u(d,",")+"){ return binder.apply(this,arguments); }")(f),t.prototype){var p=function(){};p.prototype=t.prototype,r.prototype=new p,p.prototype=null}return r}},{}],41:[function(e,t,r){"use strict";var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":40}],42:[function(e,t,r){"use strict";var n=e("es-errors"),i=e("es-errors/eval"),o=e("es-errors/range"),a=e("es-errors/ref"),s=e("es-errors/syntax"),u=e("es-errors/type"),c=e("es-errors/uri"),f=Function,l=function(e){try{return f('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var h=function(){throw new u},p=d?function(){try{return h}catch(e){try{return d(arguments,"callee").get}catch(e){return h}}}():h,y=e("has-symbols")(),g=e("has-proto")(),v=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),b={},m="undefined"!=typeof Uint8Array&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":y&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":b,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&y&&v?v((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":o,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&y&&v?v((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":y?Symbol:void 0,"%SyntaxError%":s,"%ThrowTypeError%":p,"%TypedArray%":m,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet};if(v)try{null.error}catch(e){var w=v(v(e));_["%Error.prototype%"]=w}var E={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=e("function-bind"),S=e("hasown"),x=k.call(Function.call,Array.prototype.concat),j=k.call(Function.apply,Array.prototype.splice),O=k.call(Function.call,String.prototype.replace),A=k.call(Function.call,String.prototype.slice),R=k.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,B=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return O(e,T,(function(e,t,r,i){n[n.length]=r?O(i,M,"$1"):t||e})),n},L=function(e,t){var r,n=e;if(S(E,n)&&(n="%"+(r=E[n])[0]+"%"),S(_,n)){var i=_[n];if(i===b&&(i=function e(t){var r;if("%AsyncFunction%"===t)r=l("async function () {}");else if("%GeneratorFunction%"===t)r=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=l("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&v&&(r=v(i.prototype))}return _[t]=r,r}(n)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new s("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===R(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=B(e),n=r.length>0?r[0]:"",i=L("%"+n+"%",t),o=i.name,a=i.value,c=!1,f=i.alias;f&&(n=f[0],j(r,x([0,1],f)));for(var l=1,h=!0;l<r.length;l+=1){var p=r[l],y=A(p,0,1),g=A(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===g||"'"===g||"`"===g)&&y!==g)throw new s("property names with quotes must have matching quotes");if("constructor"!==p&&h||(c=!0),S(_,o="%"+(n+="."+p)+"%"))a=_[o];else if(null!=a){if(!(p in a)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(d&&l+1>=r.length){var v=d(a,p);a=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[p]}else h=S(a,p),a=a[p];h&&!c&&(_[o]=a)}}return a}},{"es-errors":33,"es-errors/eval":32,"es-errors/range":34,"es-errors/ref":35,"es-errors/syntax":36,"es-errors/type":37,"es-errors/uri":38,"function-bind":41,"has-proto":46,"has-symbols":47,hasown:49}],43:[function(e,t,r){"use strict";var n=e("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"get-intrinsic":42}],44:[function(e,t,r){"object"==typeof r&&(t.exports=function(){try{if("undefined"==typeof localStorage)return!1;if(localStorage.setItem("Storage-Test","1"),"1"!==localStorage.getItem("Storage-Test"))return!1;localStorage.removeItem("Storage-Test")}catch(e){return!1}return!0})},{}],45:[function(e,t,r){"use strict";var n=e("es-define-property"),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},t.exports=i},{"es-define-property":31}],46:[function(e,t,r){"use strict";var n={__proto__:null,foo:{}},i=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!(n instanceof i)}},{}],47:[function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=e("./shams");t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},{"./shams":48}],48:[function(e,t,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},{}],49:[function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=e("function-bind");t.exports=o.call(n,i)},{"function-bind":41}],50:[function(e,t,r){(function(r){(function(){var n=t.exports={},i=e("localstorage-memory");n.hasLocalStorage=e("has-localstorage"),n.create=function(){var e;return n.hasLocalStorage()?(e=r.localStorage,(e={get length(){return r.localStorage.length},getItem:r.localStorage.getItem.bind(r.localStorage),setItem:r.localStorage.setItem.bind(r.localStorage),removeItem:r.localStorage.removeItem.bind(r.localStorage),key:r.localStorage.key.bind(r.localStorage),clear:r.localStorage.clear.bind(r.localStorage)}).isPersistent=!0):(e=i).isPersistent=!1,e.getObject=n.getObject.bind(null,e),e.setObject=n.setObject.bind(null,e),e},n.setObject=function(e,t,r){return"object"!=typeof r?e.setItem(t,r):e.setItem(t,JSON.stringify(r))},n.getObject=function(e,t){var r=e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return r}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"has-localstorage":44,"localstorage-memory":86}],51:[function(e,t,r){var n=e("./api");t.exports=n.create()},{"./api":50}],52:[function(e,t,r){
22/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
23r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},{}],53:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],54:[function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
24/*!
25 * Determine if an object is a Buffer
26 *
27 * @author Feross Aboukhadijeh <https://feross.org>
28 * @license MIT
29 */
30t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],55:[function(e,t,r){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],56:[function(e,t,r){var n=e("./lib/encodings");function i(e){if(!(this instanceof i))return new i(e);this.opts=e||{},this.encodings=n}t.exports=i,i.prototype._encoding=function(e){return"string"==typeof e&&(e=n[e]),e||(e=n.id),e},i.prototype._keyEncoding=function(e,t){return this._encoding(t&&t.keyEncoding||e&&e.keyEncoding||this.opts.keyEncoding)},i.prototype._valueEncoding=function(e,t){return this._encoding(t&&(t.valueEncoding||t.encoding)||e&&(e.valueEncoding||e.encoding)||this.opts.valueEncoding||this.opts.encoding)},i.prototype.encodeKey=function(e,t,r){return this._keyEncoding(t,r).encode(e)},i.prototype.encodeValue=function(e,t,r){return this._valueEncoding(t,r).encode(e)},i.prototype.decodeKey=function(e,t){return this._keyEncoding(t).decode(e)},i.prototype.decodeValue=function(e,t){return this._valueEncoding(t).decode(e)},i.prototype.encodeBatch=function(e,t){var r=this;return e.map((function(e){var n={type:e.type,key:r.encodeKey(e.key,t,e)};return r.keyAsBuffer(t,e)&&(n.keyEncoding="binary"),e.prefix&&(n.prefix=e.prefix),"value"in e&&(n.value=r.encodeValue(e.value,t,e),r.valueAsBuffer(t,e)&&(n.valueEncoding="binary")),n}))};var o=["lt","gt","lte","gte","start","end"];i.prototype.encodeLtgt=function(e){var t=this,r={};return Object.keys(e).forEach((function(n){r[n]=o.indexOf(n)>-1?t.encodeKey(e[n],e):e[n]})),r},i.prototype.createStreamDecoder=function(e){var t=this;return e.keys&&e.values?function(r,n){return{key:t.decodeKey(r,e),value:t.decodeValue(n,e)}}:e.keys?function(r){return t.decodeKey(r,e)}:e.values?function(r,n){return t.decodeValue(n,e)}:function(){}},i.prototype.keyAsBuffer=function(e){return this._keyEncoding(e).buffer},i.prototype.valueAsBuffer=function(e){return this._valueEncoding(e).buffer}},{"./lib/encodings":57}],57:[function(e,t,r){var n=e("buffer").Buffer;r.utf8=r["utf-8"]={encode:function(e){return o(e)?e:String(e)},decode:i,buffer:!1,type:"utf8"},r.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},r.binary={encode:function(e){return o(e)?e:n.from(e)},decode:i,buffer:!0,type:"binary"},r.none={encode:i,decode:i,buffer:!1,type:"id"},r.id=r.none;function i(e){return e}function o(e){return null==e||n.isBuffer(e)}["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach((function(e){r[e]={encode:function(t){return o(t)?t:n.from(t,e)},decode:function(t){return t.toString(e)},buffer:!0,type:e}}))},{buffer:9}],58:[function(e,t,r){var n=e("errno").create,i=n("LevelUPError"),o=n("NotFoundError",i);o.prototype.notFound=!0,o.prototype.status=404,t.exports={LevelUPError:i,InitializationError:n("InitializationError",i),OpenError:n("OpenError",i),ReadError:n("ReadError",i),WriteError:n("WriteError",i),NotFoundError:o,EncodingError:n("EncodingError",i)}},{errno:30}],59:[function(e,t,r){var n=e("inherits"),i=e("readable-stream").Readable,o=e("xtend");function a(e,t){if(!(this instanceof a))return new a(e,t);t=t||{},i.call(this,o(t,{objectMode:!0})),this._iterator=e,this._options=t,this.on("end",this.destroy.bind(this,null,null))}t.exports=a,n(a,i),a.prototype._read=function(){var e=this,t=this._options;this.destroyed||this._iterator.next((function(r,n,i){if(!e.destroyed)return r?e.destroy(r):void(void 0===n&&void 0===i?e.push(null):!1!==t.keys&&!1===t.values?e.push(n):!1===t.keys&&!1!==t.values?e.push(i):e.push({key:n,value:i}))}))},a.prototype._destroy=function(e,t){this._iterator.end((function(r){t(e||r)}))}},{inherits:53,"readable-stream":74,xtend:162}],60:[function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],61:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(c,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||r.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":63,"./_stream_writable":65,_process:94,inherits:53}],62:[function(e,t,r){"use strict";t.exports=i;var n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":64,inherits:53}],63:[function(e,t,r){(function(r,n){(function(){"use strict";var i;t.exports=x,x.ReadableState=S;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream"),s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,f=e("util");c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,d,h,p=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),g=e("./internal/streams/state").getHighWaterMark,v=e("../errors").codes,b=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,_=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(x,a);var E=y.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=e("string_decoder/").StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function x(t){if(i=i||e("./_stream_duplex"),!(this instanceof x))return new x(t);var r=this instanceof i;this._readableState=new S(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function j(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?E(e,new w):O(e,a,t,!0);else if(a.ended)E(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):M(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,M(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),M(e,t)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=y.destroy,x.prototype._undestroy=y.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),j(this,e,t,!1,r)},x.prototype.unshift=function(e){return j(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){l||(l=e("string_decoder/").StringDecoder);var r=new l(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(T,e))}function T(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,I(e)}function M(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(B,e,t))}function B(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function P(e){c("readable nexttick read 0"),e.read(0)}function C(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function N(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(D,t,e))}function D(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}x.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):R(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(n=e>0?q(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&N(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){E(this,new _("_read()"))},x.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:g;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",d),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function u(){c("onend"),e.end()}i.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,I(e))}}(n);e.on("drain",f);var l=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!l&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){c("onerror",t),g(),e.removeListener("error",h),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",y),g()}function y(){c("onfinish"),e.removeListener("close",p),g()}function g(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},x.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(P,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(L,this),n},x.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(L,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(C,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<k.length;o++)e.on(k[o],this.emit.bind(this,k[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=q,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,r){return void 0===h&&(h=e("./internal/streams/from")),h(x,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":60,"./_stream_duplex":61,"./internal/streams/async_iterator":66,"./internal/streams/buffer_list":67,"./internal/streams/destroy":68,"./internal/streams/from":70,"./internal/streams/state":72,"./internal/streams/stream":73,_process:94,buffer:9,events:39,inherits:53,"string_decoder/":123,util:8}],64:[function(e,t,r){"use strict";t.exports=f;var n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=e("./_stream_duplex");function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}e("inherits")(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":60,"./_stream_duplex":61,inherits:53}],65:[function(e,t,r){(function(r,n){(function(){"use strict";function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;t.exports=x,x.WritableState=S;var a={deprecate:e("util-deprecate")},s=e("./internal/streams/stream"),u=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var f,l=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,h=e("../errors").codes,p=h.ERR_INVALID_ARG_TYPE,y=h.ERR_METHOD_NOT_IMPLEMENTED,g=h.ERR_MULTIPLE_CALLBACK,v=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,_=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function k(){}function S(t,n,a){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof a&&(a=n instanceof o),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,o){--t.pendingcb,n?(r.nextTick(o,i),r.nextTick(M,e,t),e._writableState.errorEmitted=!0,E(e,i)):(o(i),e._writableState.errorEmitted=!0,E(e,i),M(e,t))}(e,n,i,t,o);else{var a=R(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||A(e,n),i?r.nextTick(O,e,n,a,o):O(e,n,a,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(t){var r=this instanceof(o=o||e("./_stream_duplex"));if(!r&&!f.call(x,this))return new x(t);this._writableState=new S(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function j(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),M(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,j(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(j(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),M(e,t)}))}function M(e,t){var n=R(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}e("inherits")(x,s),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===x&&(e&&e._writableState instanceof S)}})):f=function(e){return e instanceof this},x.prototype.pipe=function(){E(this,new v)},x.prototype.write=function(e,t,n){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=k),o.ending?function(e,t){var n=new _;E(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var o;return null===n?o=new m:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(E(e,o),r.nextTick(i,o),!1)}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,s,n,i,o);return c}(this,o,s,e,t,n)),a},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new y("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,M(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":60,"./_stream_duplex":61,"./internal/streams/destroy":68,"./internal/streams/state":72,"./internal/streams/stream":73,_process:94,buffer:9,inherits:53,"util-deprecate":142}],66:[function(e,t,r){(function(r){(function(){"use strict";var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=e("./end-of-stream"),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[s]=null,t(h(r,!1)))}}function y(e){r.nextTick(p,e)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[u]?n(e[u]):t(h(void 0,!0))}))}));var n,i=this[f];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[l](r,n)}),n)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(h(o,!1));n=new Promise(this[l])}return this[f]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),g);t.exports=function(e){var t,r=Object.create(v,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,l,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[s]=null,e(h(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[f]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[f]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",y.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":69,_process:94}],67:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var u=e("buffer").Buffer,c=e("util").inspect,f=c&&c.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,u.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:f,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:9,util:8}],68:[function(e,t,r){(function(e){(function(){"use strict";function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(n,a):(a._writableState.errorEmitted=!0,e.nextTick(r,a,t)):e.nextTick(r,a,t):o?(e.nextTick(n,a),o(t)):e.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:94}],69:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){s=!1,c=!0,a||o.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,l=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",f),t.on("abort",p),t.req?y():t.on("request",y)),t.on("end",d),t.on("finish",f),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},{"../../../errors":60}],70:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],71:[function(e,t,r){"use strict";var n;var i=e("../../../errors").codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(t,r,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var u=!1;return function(e){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function c(e){e()}function f(e,t){return e.pipe(t)}function l(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}t.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=l(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return t.reduce(f)}},{"../../../errors":60,"./end-of-stream":69}],72:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":60}],73:[function(e,t,r){t.exports=e("events").EventEmitter},{events:39}],74:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":61,"./lib/_stream_passthrough.js":62,"./lib/_stream_readable.js":63,"./lib/_stream_transform.js":64,"./lib/_stream_writable.js":65,"./lib/internal/streams/end-of-stream.js":69,"./lib/internal/streams/pipeline.js":71}],75:[function(e,t,r){"use strict";var n=e("xtend"),i=e("xtend/mutable");t.exports=function(){var e=n.apply(null,arguments);return i(e,{bufferKeys:e.bufferKeys||!1,snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,openCallback:e.openCallback||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:e.encodings||!1,additionalMethods:n(e.additionalMethods)})}},{xtend:162,"xtend/mutable":163}],76:[function(e,t,r){var n=e("level-errors").WriteError,i=e("./promisify"),o=e("./common").getCallback,a=e("./common").getOptions;function s(e){this.db=this._levelup=e,this.batch=e.db.batch(),this.ops=[],this.length=0}s.prototype.put=function(e,t){try{this.batch.put(e,t)}catch(e){throw new n(e)}return this.ops.push({type:"put",key:e,value:t}),this.length++,this},s.prototype.del=function(e){try{this.batch.del(e)}catch(e){throw new n(e)}return this.ops.push({type:"del",key:e}),this.length++,this},s.prototype.clear=function(){try{this.batch.clear()}catch(e){throw new n(e)}return this.ops=[],this.length=0,this},s.prototype.write=function(e,t){var r,s=this._levelup,u=this.ops;(t=o(e,t))||(r=(t=i()).promise),e=a(e);try{this.batch.write(e,(function(e){if(e)return t(new n(e));s.emit("batch",u),t()}))}catch(e){throw new n(e)}return r},t.exports=s},{"./common":77,"./promisify":79,"level-errors":58}],77:[function(e,t,r){r.getCallback=function(e,t){return"function"==typeof e?e:t},r.getOptions=function(e){return"object"==typeof e&&null!==e?e:{}}},{}],78:[function(e,t,r){(function(r){(function(){var n=e("events").EventEmitter,i=e("util").inherits,o=e("xtend"),a=e("deferred-leveldown"),s=e("level-iterator-stream"),u=e("./batch"),c=e("level-errors"),f=e("level-supports"),l=e("assert"),d=e("./promisify"),h=e("./common").getCallback,p=e("./common").getOptions,y=c.WriteError,g=c.ReadError,v=c.NotFoundError,b=c.OpenError,m=c.InitializationError;function _(e,t,i){if(!(this instanceof _))return new _(e,t,i);var o,s=this;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof t&&(i=t,t={}),t=t||{},!e||"object"!=typeof e){if(o=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof i)return r.nextTick(i,o);throw o}l.strictEqual(typeof e.status,"string",".status required, old abstract-leveldown"),this.options=p(t),this._db=e,this.db=new a(e),this.open(i||function(e){e&&s.emit("error",e)}),this.supports=f(this.db.supports,{status:!1,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0}),Object.keys(this.supports.additionalMethods).forEach((function(e){null==this[e]&&(this[e]=function(){return this.db[e].apply(this.db,arguments)})}),this)}function w(e,t){if(!e._isOpening()&&!e.isOpen())return r.nextTick(t,new g("Database is not open")),!0}_.prototype.emit=n.prototype.emit,_.prototype.once=n.prototype.once,i(_,n),_.prototype.open=function(e,t){var n,i=this;return"function"==typeof e&&(t=e,e=null),t||(n=(t=d()).promise),e||(e=this.options),this.isOpen()?(r.nextTick(t,null,i),n):this._isOpening()?(this.once("open",(function(){t(null,i)})),n):(this.emit("opening"),this.db.open(e,(function(e){if(e)return t(new b(e));i.db=i._db,t(null,i),i.emit("open"),i.emit("ready")})),n)},_.prototype.close=function(e){var t,n=this;return e||(t=(e=d()).promise),this.isOpen()?(this.db.close((function(){n.emit("closed"),e.apply(null,arguments)})),this.emit("closing"),this.db=new a(this._db)):this.isClosed()?r.nextTick(e):"closing"===this.db.status?this.once("closed",e):this._isOpening()&&this.once("open",(function(){n.close(e)})),t},_.prototype.isOpen=function(){return"open"===this.db.status},_.prototype._isOpening=function(){return"opening"===this.db.status},_.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},_.prototype.get=function(e,t,r){var n;return(r=h(t,r))||(n=(r=d()).promise),w(this,r)||(t=p(t),this.db.get(e,t,(function(t,n){if(t)return t=/notfound/i.test(t)||t.notFound?new v("Key not found in database ["+e+"]",t):new g(t),r(t);r(null,n)}))),n},_.prototype.put=function(e,t,r,n){var i,o=this;return(n=h(r,n))||(i=(n=d()).promise),w(this,n)||(r=p(r),this.db.put(e,t,r,(function(r){if(r)return n(new y(r));o.emit("put",e,t),n()}))),i},_.prototype.del=function(e,t,r){var n,i=this;return(r=h(t,r))||(n=(r=d()).promise),w(this,r)||(t=p(t),this.db.del(e,t,(function(t){if(t)return r(new y(t));i.emit("del",e),r()}))),n},_.prototype.batch=function(e,t,r){if(!arguments.length)return new u(this);var n,i=this;return(r="function"==typeof e?e:h(t,r))||(n=(r=d()).promise),w(this,r)||(t=p(t),this.db.batch(e,t,(function(t){if(t)return r(new y(t));i.emit("batch",e),r()}))),n},_.prototype.iterator=function(e){return this.db.iterator(e)},_.prototype.clear=function(e,t){var r,n=this;return t=h(e,t),e=p(e),t||(r=(t=d()).promise),w(this,t)||this.db.clear(e,(function(r){if(r)return t(new y(r));n.emit("clear",e),t()})),r},_.prototype.readStream=_.prototype.createReadStream=function(e){return"number"!=typeof(e=o({keys:!0,values:!0},e)).limit&&(e.limit=-1),new s(this.db.iterator(e),e)},_.prototype.keyStream=_.prototype.createKeyStream=function(e){return this.createReadStream(o(e,{keys:!0,values:!1}))},_.prototype.valueStream=_.prototype.createValueStream=function(e){return this.createReadStream(o(e,{keys:!1,values:!0}))},_.prototype.toString=function(){return"LevelUP"},_.prototype.type="levelup",_.errors=c,t.exports=_.default=_}).call(this)}).call(this,e("_process"))},{"./batch":76,"./common":77,"./promisify":79,_process:94,assert:6,"deferred-leveldown":15,events:39,"level-errors":58,"level-iterator-stream":59,"level-supports":75,util:145,xtend:162}],79:[function(e,t,r){t.exports=function(){var e,t=new Promise((function(t,r){e=function(e,n){e?r(e):t(n)}}));return e.promise=t,e}},{}],80:[function(e,t,r){(function(r,n,i){(function(){"use strict";var o=e("inherits"),a=e("buffer-from"),s=e("abstract-leveldown").AbstractLevelDOWN,u=e("abstract-leveldown").AbstractIterator,c=e("./localstorage").LocalStorage,f=e("./localstorage-core"),l=e("./utils"),d=i.setImmediate||n.nextTick;function h(e,t){u.call(this,e),this._reverse=!!t.reverse,this._endkey=t.end,this._startkey=t.start,this._gt=t.gt,this._gte=t.gte,this._lt=t.lt,this._lte=t.lte,this._exclusiveStart=t.exclusiveStart,this._keysOnly=!1===t.values,this._limit=t.limit,this._count=0,this.onInitCompleteListeners=[]}function p(e){if(!(this instanceof p))return new p(e);s.call(this,e),this.container=new c(e)}function y(e,t){if(null==e)return new Error(t+" cannot be `null` or `undefined`");if(null==e)return new Error(t+" cannot be `null` or `undefined`");if("key"===t){if(e instanceof Boolean)return new Error(t+" cannot be `null` or `undefined`");if(""===e)return new Error(t+" cannot be empty")}if(0===e.toString().indexOf("[object ArrayBuffer]")&&(0===e.byteLength||void 0===e.byteLength))return new Error(t+" cannot be an empty Buffer");if(r.isBuffer(e)){if(0===e.length)return new Error(t+" cannot be an empty Buffer")}else if(""===String(e))return new Error(t+" cannot be an empty String")}o(h,u),h.prototype._init=function(e){d((function(){e()}))},h.prototype._next=function(e){var t=this;function r(){if(t._pos===t._keys.length||t._pos<0)return e();var r=t._keys[t._pos];return t._endkey&&(t._reverse?r<t._endkey:r>t._endkey)||t._limit&&t._limit>0&&t._count++>=t._limit||t._lt&&r>=t._lt||t._lte&&r>t._lte||t._gt&&r<=t._gt||t._gte&&r<t._gte?e():(t._pos+=t._reverse?-1:1,t._keysOnly?e(null,r):void t.db.container.getItem(r,(function(n,i){if(n)return"NotFound"===n.message?d((function(){t._next(e)})):e(n);e(null,r,i)})))}t.initStarted?t.initCompleted?n.nextTick(r):t.onInitCompleteListeners.push(r):n.nextTick((function(){t.initStarted=!0,t._init((function(n){if(n)return e(n);t.db.container.keys((function(n,i){if(n)return e(n);if(t._keys=i,t._startkey){var o=l.sortedIndexOf(t._keys,t._startkey),a=o>=t._keys.length||o<0?void 0:t._keys[o];t._pos=o,t._reverse?(t._exclusiveStart||a!==t._startkey)&&t._pos--:t._exclusiveStart&&a===t._startkey&&t._pos++}else t._pos=t._reverse?t._keys.length-1:0;r(),t.initCompleted=!0;for(var s=-1;++s<t.onInitCompleteListeners.length;)d(t.onInitCompleteListeners[s])}))}))}))},o(p,s),p.prototype._open=function(e,t){this.container.init(t)},p.prototype._put=function(e,t,n,i){var o=y(e,"key");if(o)return d((function(){i(o)}));if(o=y(t,"value"))return d((function(){i(o)}));if("object"==typeof t&&!r.isBuffer(t)&&void 0===t.buffer){var a={storetype:"json"};a.data=t,t=JSON.stringify(a)}this.container.setItem(e,t,i)},p.prototype._get=function(e,t,n){var i=y(e,"key");if(i)return d((function(){n(i)}));r.isBuffer(e)||(e=String(e)),this.container.getItem(e,(function(e,i){if(e)return n(e);(!1===t.asBuffer||r.isBuffer(i)||(i=a(i)),!1===t.asBuffer)&&(i.indexOf('{"storetype":"json","data"')>-1&&(i=JSON.parse(i).data));n(null,i)}))},p.prototype._del=function(e,t,n){var i=y(e,"key");if(i)return d((function(){n(i)}));r.isBuffer(e)||(e=String(e)),this.container.removeItem(e,n)},p.prototype._batch=function(e,t,n){var i=this;d((function(){var o,a,s,u,c=0;function f(){++c===e.length&&n(u)}if(Array.isArray(e)&&e.length)for(var l=0;l<e.length;l++){var d=e[l];d?(o=y(a=r.isBuffer(d.key)?d.key:String(d.key),"key"))?(u=o,f()):"del"===d.type?i._del(d.key,t,f):"put"===d.type&&((o=y(s=r.isBuffer(d.value)?d.value:String(d.value),"value"))?(u=o,f()):i._put(a,s,t,f)):f()}else n()}))},p.prototype._iterator=function(e){return new h(this,e)},p.destroy=function(e,t){f.destroy(e,t)},t.exports=p}).call(this)}).call(this,{isBuffer:e("../../is-buffer/index.js")},e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../is-buffer/index.js":54,"./localstorage":82,"./localstorage-core":81,"./utils":84,_process:94,"abstract-leveldown":3,"buffer-from":85,inherits:53}],81:[function(e,t,r){(function(r,n){(function(){"use strict";var i=n.setImmediate||r.nextTick,o=e("humble-localstorage");function a(e,t){var r,n;try{r=t()}catch(e){n=e}i((function(){e(n,r)}))}function s(e){return e.replace(/!/g,"!!")+"!"}function u(e){this._prefix=s(e)}u.prototype.getKeys=function(e){var t=this;a(e,(function(){for(var e=[],r=t._prefix.length,n=-1,i=o.length;++n<i;){var a=o.key(n);a.substring(0,r)===t._prefix&&e.push(a.substring(r))}return e.sort(),e}))},u.prototype.put=function(e,t,r){var n=this;a(r,(function(){o.setItem(n._prefix+e,t)}))},u.prototype.get=function(e,t){var r=this;a(t,(function(){return o.getItem(r._prefix+e)}))},u.prototype.remove=function(e,t){var r=this;a(t,(function(){o.removeItem(r._prefix+e)}))},u.destroy=function(e,t){var r=s(e);a(t,(function(){for(var e=[],t=-1,n=o.length;++t<n;){var i=o.key(t);i.substring(0,r.length)===r&&e.push(i)}e.forEach((function(e){o.removeItem(e)}))}))},t.exports=u}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:94,"humble-localstorage":51}],82:[function(e,t,r){(function(t){(function(){"use strict";var n=new RegExp("^ArrayBuffer:"),i=new RegExp("^Uint8Array:"),o=new RegExp("^Buff:"),a=e("./utils"),s=e("./localstorage-core"),u=e("./taskqueue"),c=e("d64");function f(e){this._store=new s(e),this._queue=new u}f.prototype.sequentialize=function(e,t){this._queue.add(t,e)},f.prototype.init=function(e){var t=this;t.sequentialize(e,(function(e){t._store.getKeys((function(r,n){return r?e(r):(t._keys=n,e())}))}))},f.prototype.keys=function(e){var t=this;t.sequentialize(e,(function(e){t._store.getKeys((function(t,r){e(null,r.slice())}))}))},f.prototype.setItem=function(e,r,n){var i=this;i.sequentialize(n,(function(n){t.isBuffer(r)&&(r="Buff:"+c.encode(r));var o=a.sortedIndexOf(i._keys,e);i._keys[o]!==e&&i._keys.splice(o,0,e),i._store.put(e,r,n)}))},f.prototype.getItem=function(e,t){var r=this;r.sequentialize(t,(function(t){r._store.get(e,(function(e,r){return e?t(e):null==r?t(new Error("NotFound")):(void 0!==r&&(o.test(r)?r=c.decode(r.substring("Buff:".length)):n.test(r)?(r=r.substring("ArrayBuffer:".length),r=new ArrayBuffer(atob(r).split("").map((function(e){return e.charCodeAt(0)})))):i.test(r)&&(r=r.substring("Uint8Array:".length),r=new Uint8Array(atob(r).split("").map((function(e){return e.charCodeAt(0)}))))),void t(null,r))}))}))},f.prototype.removeItem=function(e,t){var r=this;r.sequentialize(t,(function(t){var n=a.sortedIndexOf(r._keys,e);r._keys[n]===e?(r._keys.splice(n,1),r._store.remove(e,(function(e){if(e)return t(e);t()}))):t()}))},f.prototype.length=function(e){var t=this;t.sequentialize(e,(function(e){e(null,t._keys.length)}))},r.LocalStorage=f}).call(this)}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":54,"./localstorage-core":81,"./taskqueue":83,"./utils":84,d64:13}],83:[function(e,t,r){(function(r,n){(function(){"use strict";var i=e("argsarray"),o=e("tiny-queue"),a=n.setImmediate||r.nextTick;function s(){this.queue=new o,this.running=!1}s.prototype.add=function(e,t){this.queue.push({fun:e,callback:t}),this.processNext()},s.prototype.processNext=function(){var e=this;if(!e.running&&e.queue.length){e.running=!0;var t=e.queue.shift();a((function(){t.fun(i((function(r){t.callback.apply(null,r),e.running=!1,e.processNext()})))}))}},t.exports=s}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:94,argsarray:5,"tiny-queue":141}],84:[function(e,t,r){"use strict";r.sortedIndexOf=function(e,t){for(var r,n=0,i=e.length;n<i;)e[r=n+i>>>1]<t?n=r+1:i=r;return n}},{}],85:[function(e,t,r){(function(e){(function(){var r=Object.prototype.toString,n="function"==typeof e.alloc&&"function"==typeof e.allocUnsafe&&"function"==typeof e.from;t.exports=function(t,i,o){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return a=t,"ArrayBuffer"===r.call(a).slice(8,-1)?function(t,r,i){r>>>=0;var o=t.byteLength-r;if(o<0)throw new RangeError("'offset' is out of bounds");if(void 0===i)i=o;else if((i>>>=0)>o)throw new RangeError("'length' is out of bounds");return n?e.from(t.slice(r,r+i)):new e(new Uint8Array(t.slice(r,r+i)))}(t,i,o):"string"==typeof t?function(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!e.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');return n?e.from(t,r):new e(t,r)}(t,i):n?e.from(t):new e(t);var a}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:9}],86:[function(e,t,r){var n,i,o;n=this,o={},(i={}).length=0,i.getItem=function(e){return e in o?o[e]:null},i.setItem=function(e,t){void 0===t?i.removeItem(e):(o.hasOwnProperty(e)||i.length++,o[e]=""+t)},i.removeItem=function(e){o.hasOwnProperty(e)&&(delete o[e],i.length--)},i.key=function(e){return Object.keys(o)[e]||null},i.clear=function(){o={},i.length=0},"object"==typeof r?t.exports=i:n.localStorageMemory=i},{}],87:[function(e,t,r){(function(e){(function(){function t(e){return void 0!==e&&""!==e}function n(e,t){return Object.hasOwnProperty.call(e,t)}function i(e,t){return Object.hasOwnProperty.call(e,t)&&t}r.compare=function(t,r){if(e.isBuffer(t)){for(var n=Math.min(t.length,r.length),i=0;i<n;i++){var o=t[i]-r[i];if(o)return o}return t.length-r.length}return t<r?-1:t>r?1:0};var o=r.lowerBoundKey=function(e){return i(e,"gt")||i(e,"gte")||i(e,"min")||(e.reverse?i(e,"end"):i(e,"start"))||void 0},a=r.lowerBound=function(e,t){var r=o(e);return r?e[r]:t},s=r.lowerBoundInclusive=function(e){return!n(e,"gt")},u=r.upperBoundInclusive=function(e){return!n(e,"lt")},c=r.lowerBoundExclusive=function(e){return!s(e)},f=r.upperBoundExclusive=function(e){return!u(e)},l=r.upperBoundKey=function(e){return i(e,"lt")||i(e,"lte")||i(e,"max")||(e.reverse?i(e,"start"):i(e,"end"))||void 0},d=r.upperBound=function(e,t){var r=l(e);return r?e[r]:t};function h(e){return e}r.start=function(e,t){return e.reverse?d(e,t):a(e,t)},r.end=function(e,t){return e.reverse?a(e,t):d(e,t)},r.startInclusive=function(e){return e.reverse?u(e):s(e)},r.endInclusive=function(e){return e.reverse?s(e):u(e)},r.toLtgt=function(e,t,i,o,a){t=t||{},i=i||h;var s=arguments.length>3,u=r.lowerBoundKey(e),c=r.upperBoundKey(e);return u?"gt"===u?t.gt=i(e.gt,!1):t.gte=i(e[u],!1):s&&(t.gte=i(o,!1)),c?"lt"===c?t.lt=i(e.lt,!0):t.lte=i(e[c],!0):s&&(t.lte=i(a,!0)),null!=e.reverse&&(t.reverse=!!e.reverse),n(t,"max")&&delete t.max,n(t,"min")&&delete t.min,n(t,"start")&&delete t.start,n(t,"end")&&delete t.end,t},r.contains=function(e,n,i){i=i||r.compare;var o=a(e);if(t(o)&&((s=i(n,o))<0||0===s&&c(e)))return!1;var s,u=d(e);if(t(u)&&((s=i(n,u))>0||0===s&&f(e)))return!1;return!0},r.filter=function(e,t){return function(n){return r.contains(e,n,t)}}}).call(this)}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":54}],88:[function(e,t,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=e("./isArguments"),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{l(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)d.push(String(y));if(n&&e.length>0)for(var g=0;g<e.length;++g)d.push(String(g));else for(var v in e)p&&"prototype"===v||!i.call(e,v)||d.push(String(v));if(u)for(var b=function(e){if("undefined"==typeof window||!h)return l(e);try{return l(e)}catch(e){return!1}}(e),m=0;m<f.length;++m)b&&"constructor"===f[m]||!i.call(e,f[m])||d.push(f[m]);return d}}t.exports=n},{"./isArguments":90}],89:[function(e,t,r){"use strict";var n=Array.prototype.slice,i=e("./isArguments"),o=Object.keys,a=o?function(e){return o(e)}:e("./implementation"),s=Object.keys;a.shim=function(){Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)}):Object.keys=a;return Object.keys||a},t.exports=a},{"./implementation":88,"./isArguments":90}],90:[function(e,t,r){"use strict";var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r="[object Arguments]"===t;return r||(r="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),r}},{}],91:[function(e,t,r){"use strict";var n=e("object-keys"),i=e("has-symbols/shams")(),o=e("call-bind/callBound"),a=Object,s=o("Array.prototype.push"),u=o("Object.prototype.propertyIsEnumerable"),c=i?Object.getOwnPropertySymbols:null;t.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var o=1;o<arguments.length;++o){var f=a(arguments[o]),l=n(f),d=i&&(Object.getOwnPropertySymbols||c);if(d)for(var h=d(f),p=0;p<h.length;++p){var y=h[p];u(f,y)&&s(l,y)}for(var g=0;g<l.length;++g){var v=l[g];if(u(f,v)){var b=f[v];r[v]=b}}}return r}},{"call-bind/callBound":10,"has-symbols/shams":48,"object-keys":89}],92:[function(e,t,r){"use strict";var n=e("./implementation");t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),o="";for(var a in i)o+=a;return e!==o}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},{"./implementation":91}],93:[function(e,t,r){(function(e){(function(){"use strict";void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this)}).call(this,e("_process"))},{_process:94}],94:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,f=[],l=!1,d=-1;function h(){l&&c&&(l=!1,c.length?f=c.concat(f):d=-1,f.length&&p())}function p(){if(!l){var e=u(h);l=!0;for(var t=f.length;t;){for(c=f,f=[];++d<t;)c&&c[d].run();d=-1,t=f.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new y(e,t)),1!==f.length||l||u(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],95:[function(e,t,r){
31/*!
32 * prr
33 * (c) 2013 Rod Vagg <rod@vagg.org>
34 * https://github.com/rvagg/prr
35 * License: MIT
36 */
37var n,i;n=this,i=function(){var e="function"==typeof Object.defineProperty?function(e,t,r){return Object.defineProperty(e,t,r),e}:function(e,t,r){return e[t]=r.value,e};return function(t,r,n,i){var o;if(i=function(e,t){var r="object"==typeof t,n=!r&&"string"==typeof t,i=function(e){return r?!!t[e]:!!n&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}}(n,i),"object"==typeof r){for(o in r)Object.hasOwnProperty.call(r,o)&&(i.value=r[o],e(t,o,i));return t}return e(t,r,i)}},void 0!==t&&t.exports?t.exports=i():n.prr=i()},{}],96:[function(e,t,r){(function(r){(function(){t.exports=s;var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},i=e("core-util-is");i.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");function s(e){if(!(this instanceof s))return new s(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||r.nextTick(this.end.bind(this))}i.inherits(s,o),function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(n(a.prototype),(function(e){s.prototype[e]||(s.prototype[e]=a.prototype[e])}))}).call(this)}).call(this,e("_process"))},{"./_stream_readable":98,"./_stream_writable":100,_process:94,"core-util-is":12,inherits:53}],97:[function(e,t,r){t.exports=o;var n=e("./_stream_transform"),i=e("core-util-is");function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=e("inherits"),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":99,"core-util-is":12,inherits:53}],98:[function(e,t,r){(function(r){(function(){t.exports=l;var n=e("isarray"),i=e("buffer").Buffer;l.ReadableState=f;var o=e("events").EventEmitter;o.listenerCount||(o.listenerCount=function(e,t){return e.listeners(t).length});var a,s=e("stream"),u=e("core-util-is");u.inherits=e("inherits");var c=e("util");function f(t,r){var n=e("./_stream_duplex"),i=(t=t||{}).highWaterMark,o=t.objectMode?16:16384;this.highWaterMark=i||0===i?i:o,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,r instanceof n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(a||(a=e("string_decoder/").StringDecoder),this.decoder=new a(t.encoding),this.encoding=t.encoding)}function l(t){e("./_stream_duplex");if(!(this instanceof l))return new l(t);this._readableState=new f(t,this),this.readable=!0,s.call(this)}function d(e,t,n,i,o){var a=function(e,t){var r=null;u.isBuffer(t)||u.isString(t)||u.isNullOrUndefined(t)||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,n);if(a)e.emit("error",a);else if(u.isNullOrUndefined(n))t.reading=!1,t.ended||function(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,p(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&o){s=new Error("stream.unshift() after end event");e.emit("error",s)}else!t.decoder||o||i||(n=t.decoder.write(n)),o||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e)),function(e,t){t.readingMore||(t.readingMore=!0,r.nextTick((function(){!function(e,t){var r=t.length;for(;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(c("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}(e,t)})))}(e,t);else o||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}c=c&&c.debuglog?c.debuglog("stream"):function(){},u.inherits(l,s),l.prototype.push=function(e,t){var r=this._readableState;return u.isString(e)&&!r.objectMode&&(t=t||r.defaultEncoding)!==r.encoding&&(e=new i(e,t),t=""),d(this,r,e,t,!1)},l.prototype.unshift=function(e){return d(this,this._readableState,e,"",!0)},l.prototype.setEncoding=function(t){return a||(a=e("string_decoder/").StringDecoder),this._readableState.decoder=new a(t),this._readableState.encoding=t,this};function h(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||u.isNull(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>=8388608)e=8388608;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r.nextTick((function(){y(e)})):y(e))}function y(e){c("emit readable"),e.emit("readable"),g(e)}function g(e){var t=e._readableState;if(c("flow",t.flowing),t.flowing)do{var r=e.read()}while(null!==r&&t.flowing)}function v(e,t){var r,n=t.buffer,o=t.length,a=!!t.decoder,s=!!t.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!e||e>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(e<n[0].length)r=(l=n[0]).slice(0,e),n[0]=l.slice(e);else if(e===n[0].length)r=n.shift();else{r=a?"":new i(e);for(var u=0,c=0,f=n.length;c<f&&u<e;c++){var l=n[0],d=Math.min(e-u,l.length);a?r+=l.slice(0,d):l.copy(r,u,0,d),d<l.length?n[0]=l.slice(d):n.shift(),u+=d}}}return r}function b(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,r.nextTick((function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))})))}l.prototype.read=function(e){c("read",e);var t=this._readableState,r=e;if((!u.isNumber(e)||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?b(this):p(this),null;if(0===(e=h(e,t))&&t.ended)return 0===t.length&&b(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),(t.ended||t.reading)&&c("reading or ended",i=!1),i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=h(r,t)),n=e>0?v(e,t):null,u.isNull(n)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&b(this),u.isNull(n)||this.emit("data",n),n},l.prototype._read=function(e){this.emit("error",new Error("not implemented"))},l.prototype.pipe=function(e,t){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,t);var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?f:d;function u(e){c("onunpipe"),e===i&&d()}function f(){c("onend"),e.end()}a.endEmitted?r.nextTick(s):i.once("end",s),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o.listenerCount(e,"data")&&(t.flowing=!0,g(e))}}(i);function d(){c("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",u),i.removeListener("end",f),i.removeListener("end",d),i.removeListener("data",h),!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l()}function h(t){c("ondata"),!1===e.write(t)&&(c("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function p(t){c("onerror",t),b(),e.removeListener("error",p),0===o.listenerCount(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),b()}function v(){c("onfinish"),e.removeListener("close",y),b()}function b(){c("unpipe"),i.unpipe(e)}return e.on("drain",l),i.on("data",h),e._events&&e._events.error?n(e._events.error)?e._events.error.unshift(p):e._events.error=[p,e._events.error]:e.on("error",p),e.once("close",y),e.once("finish",v),e.emit("pipe",i),a.flowing||(c("pipe resume"),i.resume()),e},l.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}return-1===(i=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}(t.pipes,e))||(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},l.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var i=this._readableState;if(!i.readableListening)if(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading)i.length&&p(this);else{var o=this;r.nextTick((function(){c("readable nexttick read 0"),o.read(0)}))}}return n},l.prototype.addListener=l.prototype.on,l.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!0,e.reading||(c("resume read 0"),this.read(0)),function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick((function(){!function(e,t){t.resumeScheduled=!1,e.emit("resume"),g(e),t.flowing&&!t.reading&&e.read(0)}(e,t)})))}(this,e)),this},l.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this},l.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",(function(){if(c("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)})),e.on("data",(function(i){(c("wrapped data"),t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length))&&(n.push(i)||(r=!0,e.pause()))})),e)u.isFunction(e[i])&&u.isUndefined(this[i])&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(["error","close","destroy","pause","resume"],(function(t){e.on(t,n.emit.bind(n,t))})),n._read=function(t){c("wrapped _read",t),r&&(r=!1,e.resume())},n},l._fromList=v}).call(this)}).call(this,e("_process"))},{"./_stream_duplex":96,_process:94,buffer:9,"core-util-is":12,events:39,inherits:53,isarray:55,stream:106,"string_decoder/":101,util:8}],99:[function(e,t,r){t.exports=a;var n=e("./_stream_duplex"),i=e("core-util-is");function o(e,t){this.afterTransform=function(e,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var o=n.writecb;if(!o)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,i.isNullOrUndefined(r)||e.push(r);o&&o(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&e._read(a.highWaterMark)}(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState=new o(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",(function(){i.isFunction(this._flush)?this._flush((function(e){s(t,e)})):s(t)}))}function s(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;i.isNull(t.writechunk)||!t.writecb||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))}},{"./_stream_duplex":96,"core-util-is":12,inherits:53}],100:[function(e,t,r){(function(r){(function(){t.exports=u;var n=e("buffer").Buffer;u.WritableState=s;var i=e("core-util-is");i.inherits=e("inherits");var o=e("stream");function a(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}function s(t,n){var i=e("./_stream_duplex"),o=(t=t||{}).highWaterMark,a=t.objectMode?16:16384;this.highWaterMark=o||0===o?o:a,this.objectMode=!!t.objectMode,n instanceof i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,o){n?r.nextTick((function(){t.pendingcb--,o(i)})):(t.pendingcb--,o(i));e._writableState.errorEmitted=!0,e.emit("error",i)}(e,n,i,t,o);else{var a=d(e,n);a||n.corked||n.bufferProcessing||!n.buffer.length||l(e,n),i?r.nextTick((function(){f(e,n,a,o)})):f(e,n,a,o)}}(n,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function u(t){var r=e("./_stream_duplex");if(!(this instanceof u||this instanceof r))return new u(t);this._writableState=new s(t,this),this.writable=!0,o.call(this)}function c(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function f(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),p(e,t)}function l(e,t){if(t.bufferProcessing=!0,e._writev&&t.buffer.length>1){for(var r=[],n=0;n<t.buffer.length;n++)r.push(t.buffer[n].callback);t.pendingcb++,c(e,t,!0,t.length,t.buffer,"",(function(e){for(var n=0;n<r.length;n++)t.pendingcb--,r[n](e)})),t.buffer=[]}else{for(n=0;n<t.buffer.length;n++){var i=t.buffer[n],o=i.chunk,a=i.encoding,s=i.callback,u=t.objectMode?1:o.length;if(c(e,t,!1,u,o,a,s),t.writing){n++;break}}n<t.buffer.length?t.buffer=t.buffer.slice(n):t.buffer.length=0}t.bufferProcessing=!1}function d(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function h(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function p(e,t){var r=d(0,t);return r&&(0===t.pendingcb?(h(e,t),t.finished=!0,e.emit("finish")):h(e,t)),r}i.inherits(u,o),u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},u.prototype.write=function(e,t,o){var s=this._writableState,u=!1;return i.isFunction(t)&&(o=t,t=null),i.isBuffer(e)?t="buffer":t||(t=s.defaultEncoding),i.isFunction(o)||(o=function(){}),s.ended?function(e,t,n){var i=new Error("write after end");e.emit("error",i),r.nextTick((function(){n(i)}))}(this,0,o):function(e,t,n,o){var a=!0;if(!(i.isBuffer(n)||i.isString(n)||i.isNullOrUndefined(n)||t.objectMode)){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),r.nextTick((function(){o(s)})),a=!1}return a}(this,s,e,o)&&(s.pendingcb++,u=function(e,t,r,o,s){r=function(e,t,r){!e.objectMode&&!1!==e.decodeStrings&&i.isString(t)&&(t=new n(t,r));return t}(t,r,o),i.isBuffer(r)&&(o="buffer");var u=t.objectMode?1:r.length;t.length+=u;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);t.writing||t.corked?t.buffer.push(new a(r,o,s)):c(e,t,!1,u,r,o,s);return f}(this,s,e,t,o)),u},u.prototype.cork=function(){this._writableState.corked++},u.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.buffer.length||l(this,e))},u.prototype._write=function(e,t,r){r(new Error("not implemented"))},u.prototype._writev=null,u.prototype.end=function(e,t,n){var o=this._writableState;i.isFunction(e)?(n=e,e=null,t=null):i.isFunction(t)&&(n=t,t=null),i.isNullOrUndefined(e)||this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||o.finished||function(e,t,n){t.ending=!0,p(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0}(this,o,n)}}).call(this)}).call(this,e("_process"))},{"./_stream_duplex":96,_process:94,buffer:9,"core-util-is":12,inherits:53,stream:106}],101:[function(e,t,r){var n=e("buffer").Buffer,i=n.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!i(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new n(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},o.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},{buffer:9}],102:[function(e,t,r){(function(n){(function(){(r=t.exports=e("./lib/_stream_readable.js")).Stream=e("stream"),r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),n.browser||"disable"!==n.env.READABLE_STREAM||(t.exports=e("stream"))}).call(this)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":96,"./lib/_stream_passthrough.js":97,"./lib/_stream_readable.js":98,"./lib/_stream_transform.js":99,"./lib/_stream_writable.js":100,_process:94,stream:106}],103:[function(e,t,r){
38/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
39var n=e("buffer"),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,r),r.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:9}],104:[function(e,t,r){"use strict";var n=e("get-intrinsic"),i=e("define-data-property"),o=e("has-property-descriptors")(),a=e("gopd"),s=e("es-errors/type"),u=n("%Math.floor%");t.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var f=a(e,"length");f&&!f.configurable&&(n=!1),f&&!f.writable&&(c=!1)}return(n||c||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},{"define-data-property":27,"es-errors/type":37,"get-intrinsic":42,gopd:43,"has-property-descriptors":45}],105:[function(e,t,r){!function(e){if("object"==typeof r)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var n;try{n=window}catch(e){n=self}n.SparkMD5=e()}}((function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],i=e[2],o=e[3];n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+t[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&n)+t[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&r)+t[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+t[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&n)+t[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&r)+t[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+t[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&n)+t[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&r)+t[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&i|~n&o)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+t[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&n)+t[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&r)+t[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+t[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+t[6]-1069501632|0)<<9|o>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|i>>>18)+o|0)&r|o&~r)+t[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+t[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+t[10]+38016083|0)<<9|o>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|i>>>18)+o|0)&r|o&~r)+t[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+t[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+t[14]-1019803690|0)<<9|o>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|i>>>18)+o|0)&r|o&~r)+t[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n&o|i&~o)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+t[2]-51403784|0)<<9|o>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|i>>>18)+o|0)&r|o&~r)+t[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+t[8]-2022574463|0)<<11|o>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|i>>>16)+o|0)^o^r)+t[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+t[4]+1272893353|0)<<11|o>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|i>>>16)+o|0)^o^r)+t[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+t[0]-358537222|0)<<11|o>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|i>>>16)+o|0)^o^r)+t[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((o=((o+=((r=((r+=(n^i^o)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+t[12]-421815835|0)<<11|o>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|i>>>16)+o|0)^o^r)+t[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+t[7]+1126891415|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+t[14]-1416354905|0)<<15|i>>>17)+o|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+t[3]-1894986606|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+t[10]-1051523|0)<<15|i>>>17)+o|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+t[15]-30611744|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+t[6]-1560198380|0)<<15|i>>>17)+o|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((o=((o+=(n^((r=((r+=(i^(n|~o))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+t[11]-1120210379|0)<<10|o>>>22)+r|0)^((i=((i+=(r^(o|~n))+t[2]+718787259|0)<<15|i>>>17)+o|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function i(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function o(e){var t,i,o,a,s,u,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(f,n(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)o[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(f,o),t=0;t<16;t+=1)o[t]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,r(f,o),f}function a(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function s(e){var t;for(t=0;t<e.length;t+=1)e[t]=a(e[t]);return e.join("")}function u(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function c(e){var t,r=[],n=e.length;for(t=0;t<n-1;t+=2)r.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,r)}function f(){this.reset()}return"5d41402abc4b2a76b9719d911017c592"!==s(o("hello"))&&function(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r},"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(r,n){var i,o,a,s,u=this.byteLength,c=t(r,u),f=u;return n!==e&&(f=t(n,u)),c>f?new ArrayBuffer(0):(i=f-c,o=new ArrayBuffer(i),a=new Uint8Array(o),s=new Uint8Array(this,c,i),a.set(s),o)}}(),f.prototype.append=function(e){return this.appendBinary(u(e)),this},f.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},f.prototype.end=function(e){var t,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)o[t>>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),r=s(this._hash),e&&(r=c(r)),this.reset(),r},f.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},f.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},f.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},f.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},f.prototype._finish=function(e,t){var n,i,o,a=t;if(e[a>>2]|=128<<(a%4<<3),a>55)for(r(this._hash,e),a=0;a<16;a+=1)e[a]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=i,e[15]=o,r(this._hash,e)},f.hash=function(e,t){return f.hashBinary(u(e),t)},f.hashBinary=function(e,t){var r=s(o(e));return t?c(r):r},f.ArrayBuffer=function(){this.reset()},f.ArrayBuffer.prototype.append=function(e){var t,n,o,a,s,u=(n=this._buff.buffer,o=e,a=!0,(s=new Uint8Array(n.byteLength+o.byteLength)).set(new Uint8Array(n)),s.set(new Uint8Array(o),n.byteLength),a?s:s.buffer),c=u.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)r(this._hash,i(u.subarray(t-64,t)));return this._buff=t-64<c?new Uint8Array(u.buffer.slice(t-64)):new Uint8Array(0),this},f.ArrayBuffer.prototype.end=function(e){var t,r,n=this._buff,i=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)o[t>>2]|=n[t]<<(t%4<<3);return this._finish(o,i),r=s(this._hash),e&&(r=c(r)),this.reset(),r},f.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},f.ArrayBuffer.prototype.getState=function(){var e,t=f.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},f.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,i=new ArrayBuffer(n),o=new Uint8Array(i);for(r=0;r<n;r+=1)o[r]=e.charCodeAt(r);return t?o:i}(e.buff,!0),f.prototype.setState.call(this,e)},f.ArrayBuffer.prototype.destroy=f.prototype.destroy,f.ArrayBuffer.prototype._finish=f.prototype._finish,f.ArrayBuffer.hash=function(e,t){var n=s(function(e){var t,n,o,a,s,u,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(f,i(e.subarray(t-64,t)));for(n=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<n;t+=1)o[t>>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(r(f,o),t=0;t<16;t+=1)o[t]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,r(f,o),f}(new Uint8Array(e)));return t?c(n):n},f}))},{}],106:[function(e,t,r){t.exports=i;var n=e("events").EventEmitter;function i(){n.call(this)}e("inherits")(i,n),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},{events:39,inherits:53,"readable-stream/duplex.js":108,"readable-stream/passthrough.js":117,"readable-stream/readable.js":118,"readable-stream/transform.js":119,"readable-stream/writable.js":120}],107:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],108:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":109}],109:[function(e,t,r){"use strict";var n=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var o=Object.create(e("core-util-is"));o.inherits=e("inherits");var a=e("./_stream_readable"),s=e("./_stream_writable");o.inherits(l,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];l.prototype[f]||(l.prototype[f]=s.prototype[f])}function l(e){if(!(this instanceof l))return new l(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},{"./_stream_readable":111,"./_stream_writable":113,"core-util-is":12,inherits:53,"process-nextick-args":93}],110:[function(e,t,r){"use strict";t.exports=o;var n=e("./_stream_transform"),i=Object.create(e("core-util-is"));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=e("inherits"),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":112,"core-util-is":12,inherits:53}],111:[function(e,t,r){(function(r,n){(function(){"use strict";var i=e("process-nextick-args");t.exports=m;var o,a=e("isarray");m.ReadableState=b;e("events").EventEmitter;var s=function(e,t){return e.listeners(t).length},u=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,f=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,y=e("./internal/streams/BufferList"),g=e("./internal/streams/destroy");l.inherits(m,u);var v=["error","close","destroy","pause","resume"];function b(t,r){t=t||{};var n=r instanceof(o=o||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=e("string_decoder/").StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function m(t){if(o=o||e("./_stream_duplex"),!(this instanceof m))return new m(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function _(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):x(e,a)):w(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),x(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},m.prototype.unshift=function(e){return _(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(t){return p||(p=e("string_decoder/").StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),R(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){h("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function M(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}m.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):k(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?T(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?f:m;function c(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",v),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",c),n.removeListener("end",f),n.removeListener("end",m),n.removeListener("data",y),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){h("onend"),e.end()}o.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,R(e))}}(n);e.on("drain",l);var d=!1;var p=!1;function y(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==L(o.pipes,e))&&!d&&(h("false write response, pause",o.awaitDrain),o.awaitDrain++,p=!0),n.pause())}function g(t){h("onerror",t),m(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",b),m()}function b(){h("onfinish"),e.removeListener("close",v),m()}function m(){h("unpipe"),n.unpipe(e)}return n.on("data",y),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",v),e.once("finish",b),e.emit("pipe",n),o.flowing||(h("pipe resume"),n.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=L(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},m.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&k(this):i.nextTick(O,this))}return r},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(A,e,t))}(this,e)),this},m.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<v.length;o++)e.on(v[o],this.emit.bind(this,v[o]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=T}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":109,"./internal/streams/BufferList":114,"./internal/streams/destroy":115,"./internal/streams/stream":116,_process:94,"core-util-is":12,events:39,inherits:53,isarray:107,"process-nextick-args":93,"safe-buffer":121,"string_decoder/":122,util:8}],112:[function(e,t,r){"use strict";t.exports=a;var n=e("./_stream_duplex"),i=Object.create(e("core-util-is"));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},{"./_stream_duplex":109,"core-util-is":12,inherits:53}],113:[function(e,t,r){(function(r,n,i){(function(){"use strict";var o=e("process-nextick-args");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}t.exports=b;var s,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:o.nextTick;b.WritableState=v;var c=Object.create(e("core-util-is"));c.inherits=e("inherits");var f={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),d=e("safe-buffer").Buffer,h=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var p,y=e("./internal/streams/destroy");function g(){}function v(t,r){s=s||e("./_stream_duplex"),t=t||{};var n=r instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),S(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?u(_,e,r,a,i):_(e,r,a,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function b(t){if(s=s||e("./_stream_duplex"),!(p.call(b,this)||this instanceof s))return new b(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function m(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(m(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,l),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===b&&(e&&e._writableState instanceof v)}})):p=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||w(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=y.destroy,b.prototype._undestroy=y.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":109,"./internal/streams/destroy":115,"./internal/streams/stream":116,_process:94,"core-util-is":12,inherits:53,"process-nextick-args":93,"safe-buffer":121,timers:140,"util-deprecate":142}],114:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=e("util");t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":121,util:8}],115:[function(e,t,r){"use strict";var n=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":93}],116:[function(e,t,r){arguments[4][73][0].apply(r,arguments)},{dup:73,events:39}],117:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":118}],118:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":109,"./lib/_stream_passthrough.js":110,"./lib/_stream_readable.js":111,"./lib/_stream_transform.js":112,"./lib/_stream_writable.js":113}],119:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":118}],120:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":113}],121:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:9}],122:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}r.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":121}],123:[function(e,t,r){arguments[4][122][0].apply(r,arguments)},{dup:122,"safe-buffer":103}],124:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],125:[function(e,t,r){arguments[4][61][0].apply(r,arguments)},{"./_stream_readable":127,"./_stream_writable":129,_process:94,dup:61,inherits:53}],126:[function(e,t,r){arguments[4][62][0].apply(r,arguments)},{"./_stream_transform":128,dup:62,inherits:53}],127:[function(e,t,r){arguments[4][63][0].apply(r,arguments)},{"../errors":124,"./_stream_duplex":125,"./internal/streams/async_iterator":130,"./internal/streams/buffer_list":131,"./internal/streams/destroy":132,"./internal/streams/from":134,"./internal/streams/state":136,"./internal/streams/stream":137,_process:94,buffer:9,dup:63,events:39,inherits:53,"string_decoder/":123,util:8}],128:[function(e,t,r){arguments[4][64][0].apply(r,arguments)},{"../errors":124,"./_stream_duplex":125,dup:64,inherits:53}],129:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{"../errors":124,"./_stream_duplex":125,"./internal/streams/destroy":132,"./internal/streams/state":136,"./internal/streams/stream":137,_process:94,buffer:9,dup:65,inherits:53,"util-deprecate":142}],130:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{"./end-of-stream":133,_process:94,dup:66}],131:[function(e,t,r){arguments[4][67][0].apply(r,arguments)},{buffer:9,dup:67,util:8}],132:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{_process:94,dup:68}],133:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{"../../../errors":124,dup:69}],134:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{dup:70}],135:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{"../../../errors":124,"./end-of-stream":133,dup:71}],136:[function(e,t,r){arguments[4][72][0].apply(r,arguments)},{"../../../errors":124,dup:72}],137:[function(e,t,r){arguments[4][73][0].apply(r,arguments)},{dup:73,events:39}],138:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{"./lib/_stream_duplex.js":125,"./lib/_stream_passthrough.js":126,"./lib/_stream_readable.js":127,"./lib/_stream_transform.js":128,"./lib/_stream_writable.js":129,"./lib/internal/streams/end-of-stream.js":133,"./lib/internal/streams/pipeline.js":135,dup:74}],139:[function(e,t,r){(function(r){(function(){var n=e("readable-stream").Transform,i=e("inherits");function o(e){n.call(this,e),this._destroyed=!1}function a(e,t,r){r(null,e)}function s(e){return function(t,r,n){return"function"==typeof t&&(n=r,r=t,t={}),"function"!=typeof r&&(r=a),"function"!=typeof n&&(n=null),e(t,r,n)}}i(o,n),o.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;r.nextTick((function(){e&&t.emit("error",e),t.emit("close")}))}},t.exports=s((function(e,t,r){var n=new o(e);return n._transform=t,r&&(n._flush=r),n})),t.exports.ctor=s((function(e,t,r){function n(t){if(!(this instanceof n))return new n(t);this.options=Object.assign({},e,t),o.call(this,this.options)}return i(n,o),n.prototype._transform=t,r&&(n.prototype._flush=r),n})),t.exports.obj=s((function(e,t,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},e));return n._transform=t,r&&(n._flush=r),n}))}).call(this)}).call(this,e("_process"))},{_process:94,inherits:53,"readable-stream":138}],140:[function(e,t,r){(function(t,n){(function(){var i=e("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":94,timers:140}],141:[function(e,t,r){"use strict";function n(){this.length=0}n.prototype.push=function(e){var t={item:e};this.last?this.last=this.last.next=t:this.last=this.first=t,this.length++},n.prototype.shift=function(){var e=this.first;if(e)return this.first=e.next,--this.length||(this.last=void 0),e.item},n.prototype.slice=function(e,t){e=void 0===e?0:e,t=void 0===t?1/0:t;for(var r=[],n=0,i=this.first;i&&!(--t<0);i=i.next)++n>e&&r.push(i.item);return r},t.exports=n},{}],142:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],143:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],144:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],145:[function(e,t,r){(function(t,n){(function(){var i=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])y(u)||!_(u)?a+=" "+u:a+=" "+s(u);return a},r.deprecate=function(e,i){if(b(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),o=!0}return e.apply(this,arguments)}};var o,a={};function s(e,t){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(t)?n.showHidden=t:t&&r._extend(n,t),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"\x1b["+s.colors[r][0]+"m"+e+"\x1b["+s.colors[r][1]+"m":e}function c(e,t){return e}function f(e,t,n){if(e.customInspect&&t&&k(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=f(e,i,n)),i}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),E(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(t);if(0===a.length){if(k(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(m(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(E(t))return l(t)}var c,_="",S=!1,x=["{","}"];(h(t)&&(S=!0,x=["[","]"]),k(t))&&(_=" [Function"+(t.name?": "+t.name:"")+"]");return m(t)&&(_=" "+RegExp.prototype.toString.call(t)),w(t)&&(_=" "+Date.prototype.toUTCString.call(t)),E(t)&&(_=" "+l(t)),0!==a.length||S&&0!=t.length?n<0?m(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=S?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)A(t,String(a))?o.push(d(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(e,t,r,n,i,!0))})),o}(e,t,n,s,a):a.map((function(r){return d(e,t,n,s,r,S)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,_,x)):x[0]+_+x[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=y(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function m(e){return _(e)&&"[object RegExp]"===S(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===S(e)}function E(e){return _(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(b(o)&&(o=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else a[e]=function(){};return a[e]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=h,r.isBoolean=p,r.isNull=y,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=v,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=b,r.isRegExp=m,r.isObject=_,r.isDate=w,r.isError=E,r.isFunction=k,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var e=new Date,t=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log("%s - %s",O(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":144,_process:94,inherits:143}],146:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return l.default}});var n=d(e("./v1.js")),i=d(e("./v3.js")),o=d(e("./v4.js")),a=d(e("./v5.js")),s=d(e("./nil.js")),u=d(e("./version.js")),c=d(e("./validate.js")),f=d(e("./stringify.js")),l=d(e("./parse.js"));function d(e){return e&&e.__esModule?e:{default:e}}},{"./nil.js":148,"./parse.js":149,"./stringify.js":153,"./v1.js":154,"./v3.js":155,"./v4.js":157,"./v5.js":158,"./validate.js":159,"./version.js":160}],147:[function(e,t,r){"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function i(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function o(e,t,r,n,o,a){return i((s=i(i(t,e),i(n,a)))<<(u=o)|s>>>32-u,r);var s,u}function a(e,t,r,n,i,a,s){return o(t&r|~t&n,e,t,i,a,s)}function s(e,t,r,n,i,a,s){return o(t&n|r&~n,e,t,i,a,s)}function u(e,t,r,n,i,a,s){return o(t^r^n,e,t,i,a,s)}function c(e,t,r,n,i,a,s){return o(r^(t|~n),e,t,i,a,s)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var f=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length;for(let n=0;n<r;n+=8){const r=e[n>>5]>>>n%32&255,i=parseInt("0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let r=1732584193,o=-271733879,f=-1732584194,l=271733878;for(let t=0;t<e.length;t+=16){const n=r,d=o,h=f,p=l;r=a(r,o,f,l,e[t],7,-680876936),l=a(l,r,o,f,e[t+1],12,-389564586),f=a(f,l,r,o,e[t+2],17,606105819),o=a(o,f,l,r,e[t+3],22,-1044525330),r=a(r,o,f,l,e[t+4],7,-176418897),l=a(l,r,o,f,e[t+5],12,1200080426),f=a(f,l,r,o,e[t+6],17,-1473231341),o=a(o,f,l,r,e[t+7],22,-45705983),r=a(r,o,f,l,e[t+8],7,1770035416),l=a(l,r,o,f,e[t+9],12,-1958414417),f=a(f,l,r,o,e[t+10],17,-42063),o=a(o,f,l,r,e[t+11],22,-1990404162),r=a(r,o,f,l,e[t+12],7,1804603682),l=a(l,r,o,f,e[t+13],12,-40341101),f=a(f,l,r,o,e[t+14],17,-1502002290),o=a(o,f,l,r,e[t+15],22,1236535329),r=s(r,o,f,l,e[t+1],5,-165796510),l=s(l,r,o,f,e[t+6],9,-1069501632),f=s(f,l,r,o,e[t+11],14,643717713),o=s(o,f,l,r,e[t],20,-373897302),r=s(r,o,f,l,e[t+5],5,-701558691),l=s(l,r,o,f,e[t+10],9,38016083),f=s(f,l,r,o,e[t+15],14,-660478335),o=s(o,f,l,r,e[t+4],20,-405537848),r=s(r,o,f,l,e[t+9],5,568446438),l=s(l,r,o,f,e[t+14],9,-1019803690),f=s(f,l,r,o,e[t+3],14,-187363961),o=s(o,f,l,r,e[t+8],20,1163531501),r=s(r,o,f,l,e[t+13],5,-1444681467),l=s(l,r,o,f,e[t+2],9,-51403784),f=s(f,l,r,o,e[t+7],14,1735328473),o=s(o,f,l,r,e[t+12],20,-1926607734),r=u(r,o,f,l,e[t+5],4,-378558),l=u(l,r,o,f,e[t+8],11,-2022574463),f=u(f,l,r,o,e[t+11],16,1839030562),o=u(o,f,l,r,e[t+14],23,-35309556),r=u(r,o,f,l,e[t+1],4,-1530992060),l=u(l,r,o,f,e[t+4],11,1272893353),f=u(f,l,r,o,e[t+7],16,-155497632),o=u(o,f,l,r,e[t+10],23,-1094730640),r=u(r,o,f,l,e[t+13],4,681279174),l=u(l,r,o,f,e[t],11,-358537222),f=u(f,l,r,o,e[t+3],16,-722521979),o=u(o,f,l,r,e[t+6],23,76029189),r=u(r,o,f,l,e[t+9],4,-640364487),l=u(l,r,o,f,e[t+12],11,-421815835),f=u(f,l,r,o,e[t+15],16,530742520),o=u(o,f,l,r,e[t+2],23,-995338651),r=c(r,o,f,l,e[t],6,-198630844),l=c(l,r,o,f,e[t+7],10,1126891415),f=c(f,l,r,o,e[t+14],15,-1416354905),o=c(o,f,l,r,e[t+5],21,-57434055),r=c(r,o,f,l,e[t+12],6,1700485571),l=c(l,r,o,f,e[t+3],10,-1894986606),f=c(f,l,r,o,e[t+10],15,-1051523),o=c(o,f,l,r,e[t+1],21,-2054922799),r=c(r,o,f,l,e[t+8],6,1873313359),l=c(l,r,o,f,e[t+15],10,-30611744),f=c(f,l,r,o,e[t+6],15,-1560198380),o=c(o,f,l,r,e[t+13],21,1309151649),r=c(r,o,f,l,e[t+4],6,-145523070),l=c(l,r,o,f,e[t+11],10,-1120210379),f=c(f,l,r,o,e[t+2],15,718787259),o=c(o,f,l,r,e[t+9],21,-343485551),r=i(r,n),o=i(o,d),f=i(f,h),l=i(l,p)}return[r,o,f,l]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};r.default=f},{}],148:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default="00000000-0000-0000-0000-000000000000"},{}],149:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var o=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};r.default=o},{"./validate.js":159}],150:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.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},{}],151:[function(e,t,r){"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)};const i=new Uint8Array(16)},{}],152:[function(e,t,r){"use strict";function n(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function i(e,t){return e<<t|e>>>32-t}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a);for(let t=0;t<a;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];s[t]=r}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<a;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=s[e][t];for(let e=16;e<80;++e)o[e]=i(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let a=r[0],u=r[1],c=r[2],f=r[3],l=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),s=i(a,5)+n(r,u,c,f)+l+t[r]+o[e]>>>0;l=f,f=c,c=i(u,30)>>>0,u=a,a=s}r[0]=r[0]+a>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+c>>>0,r[3]=r[3]+f>>>0,r[4]=r[4]+l>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};r.default=o},{}],153:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).substr(1));var a=function(e,t=0){const r=(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase();if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r};r.default=a},{"./validate.js":159}],154:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./rng.js")),i=o(e("./stringify.js"));function o(e){return e&&e.__esModule?e:{default:e}}let a,s,u=0,c=0;var f=function(e,t,r){let o=t&&r||0;const f=t||new Array(16);let l=(e=e||{}).node||a,d=void 0!==e.clockseq?e.clockseq:s;if(null==l||null==d){const t=e.random||(e.rng||n.default)();null==l&&(l=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(d=s=16383&(t[6]<<8|t[7]))}let h=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:c+1;const y=h-u+(p-c)/1e4;if(y<0&&void 0===e.clockseq&&(d=d+1&16383),(y<0||h>u)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=h,c=p,s=d,h+=122192928e5;const g=(1e4*(268435455&h)+p)%4294967296;f[o++]=g>>>24&255,f[o++]=g>>>16&255,f[o++]=g>>>8&255,f[o++]=255&g;const v=h/4294967296*1e4&268435455;f[o++]=v>>>8&255,f[o++]=255&v,f[o++]=v>>>24&15|16,f[o++]=v>>>16&255,f[o++]=d>>>8|128,f[o++]=255&d;for(let e=0;e<6;++e)f[o+e]=l[e];return t||(0,i.default)(f)};r.default=f},{"./rng.js":151,"./stringify.js":153}],155:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./v35.js")),i=o(e("./md5.js"));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v3",48,i.default);r.default=a},{"./md5.js":147,"./v35.js":156}],156:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){function o(e,o,a,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof o&&(o=(0,i.default)(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(o),u.set(e,o.length),u=r(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,a){s=s||0;for(let e=0;e<16;++e)a[s+e]=u[e];return a}return(0,n.default)(u)}try{o.name=e}catch(e){}return o.DNS=a,o.URL=s,o},r.URL=r.DNS=void 0;var n=o(e("./stringify.js")),i=o(e("./parse.js"));function o(e){return e&&e.__esModule?e:{default:e}}const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";r.DNS=a;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";r.URL=s},{"./parse.js":149,"./stringify.js":153}],157:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./rng.js")),i=o(e("./stringify.js"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t,r){const o=(e=e||{}).random||(e.rng||n.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=o[e];return t}return(0,i.default)(o)};r.default=a},{"./rng.js":151,"./stringify.js":153}],158:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./v35.js")),i=o(e("./sha1.js"));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v5",80,i.default);r.default=a},{"./sha1.js":152,"./v35.js":156}],159:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./regex.js"))&&n.__esModule?n:{default:n};var o=function(e){return"string"==typeof e&&i.default.test(e)};r.default=o},{"./regex.js":150}],160:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var o=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)};r.default=o},{"./validate.js":159}],161:[function(e,t,r){"use strict";function n(e,t,r){var n=r[r.length-1];e===n.element&&(r.pop(),n=r[r.length-1]);var i=n.element,o=n.index;if(Array.isArray(i))i.push(e);else if(o===t.length-2){i[t.pop()]=e}else t.push(e)}r.stringify=function(e){var t=[];t.push({obj:e});for(var r,n,i,o,a,s,u,c,f,l,d="";r=t.pop();)if(n=r.obj,d+=r.prefix||"",i=r.val||"")d+=i;else if("object"!=typeof n)d+=void 0===n?null:JSON.stringify(n);else if(null===n)d+="null";else if(Array.isArray(n)){for(t.push({val:"]"}),o=n.length-1;o>=0;o--)a=0===o?"":",",t.push({obj:n[o],prefix:a});t.push({val:"["})}else{for(u in s=[],n)n.hasOwnProperty(u)&&s.push(u);for(t.push({val:"}"}),o=s.length-1;o>=0;o--)f=n[c=s[o]],l=o>0?",":"",l+=JSON.stringify(c)+":",t.push({obj:f,prefix:l});t.push({val:"{"})}return d},r.parse=function(e){for(var t,r,i,o,a,s,u,c,f,l=[],d=[],h=0;;)if("}"!==(t=e[h++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":h+=3,n(null,l,d);break;case"t":h+=3,n(!0,l,d);break;case"f":h+=4,n(!1,l,d);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(r="",h--;;){if(i=e[h++],!/[\d\.\-e\+]/.test(i)){h--;break}r+=i}n(parseFloat(r),l,d);break;case'"':for(o="",a=void 0,s=0;'"'!==(u=e[h++])||"\\"===a&&s%2==1;)o+=u,"\\"===(a=u)?s++:s=0;n(JSON.parse('"'+o+'"'),l,d);break;case"[":c={element:[],index:l.length},l.push(c.element),d.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),d.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();n(l.pop(),l,d)}}},{}],162:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],163:[function(e,t,r){t.exports=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],164:[function(e,t,r){(function(t){(function(){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=r(e("levelup")),i=r(e("ltgt")),o=r(e("level-codec")),a=r(e("readable-stream")),s=e("through2"),u=r(e("double-ended-queue")),c=r(e("spark-md5")),f=r(e("events")),l=e("uuid"),d=r(e("vuvuzela")),h=r(e("localstorage-down"));function p(e){return function(e){return"function"==typeof e}(e.prefix)?e.prefix():e}class y extends Error{constructor(){super(),this.name="NotFoundError"}}var g=f.EventEmitter,v=new y,b=function(e,t,r,n){var i=new g;function o(e){var t,r={};if(n)for(t in n)void 0!==n[t]&&(r[t]=n[t]);if(e)for(t in e)void 0!==e[t]&&(r[t]=e[t]);return r}return i.sublevels={},i.options=n,i.version="6.5.4",i.methods={},t=t||[],i.put=function(r,n,a,s){"function"==typeof a&&(s=a,a={}),e.apply([{key:r,value:n,prefix:t.slice(),type:"put"}],o(a),(function(e){if(e)return s(e);i.emit("put",r,n),s(null)}))},i.prefix=function(){return t.slice()},i.batch=function(r,n,a){"function"==typeof n&&(a=n,n={}),r=r.map((function(e){return{key:e.key,value:e.value,prefix:e.prefix||t,keyEncoding:e.keyEncoding,valueEncoding:e.valueEncoding,type:e.type}})),e.apply(r,o(n),(function(e){if(e)return a(e);i.emit("batch",r),a(null)}))},i.get=function(r,n,i){"function"==typeof n&&(i=n,n={}),e.get(r,t,o(n),(function(e,t){e?i(v):i(null,t)}))},i.sublevel=function(n,a){return i.sublevels[n]=i.sublevels[n]||b(e,t.concat(n),r,o(a))},i.readStream=i.createReadStream=function(n){var i;(n=o(n)).prefix=t;var a=e.iterator(n);return(i=r(n,e.createDecoder(n))).setIterator(a),i},i.close=function(t){e.close(t)},i.isOpen=e.isOpen,i.isClosed=e.isClosed,i},m=a.Readable;class _ extends m{constructor(e,t){super({objectMode:!0,highWaterMark:e.highWaterMark}),this._setup(e,t)}_setup(e,t){super.constructor({objectMode:!0,highWaterMark:e.highWaterMark}),this._waiting=!1,this._options=e,this._makeData=t}setIterator(e){return this._iterator=e,this._destroyed?e.end((function(){})):this._waiting?(this._waiting=!1,this._read()):this}_cleanup(e){if(!this._destroyed){this._destroyed=!0;var t=this;e&&"iterator has ended"!==e.message&&t.emit("error",e),t._iterator?t._iterator.end((function(){t._iterator=null,t.emit("close")})):t.emit("close")}}destroy(){this._cleanup()}_read(){var e=this;if(!e._destroyed)return e._iterator?void e._iterator.next((function(t,r,n){if(t||void 0===r&&void 0===n)return t||e._destroyed||e.push(null),e._cleanup(t);n=e._makeData(r,n),e._destroyed||e.push(n)})):this._waiting=!0}}const w=function(e,t){let r=function(...e){if(!(this instanceof r))return new r(...e);t.apply(this,e)};return r.prototype=Object.create(e.prototype,{constructor:{value:r}}),r}(_,(function(e,t){_.prototype._setup.call(this,e,t)}));var E={encode:function(e){return"\xff"+e[0]+"\xff"+e[1]},decode:function(e){var t=e.toString(),r=t.indexOf("\xff",1);return[t.substring(1,r),t.substring(r+1)]},lowerBound:"\0",upperBound:"\xff"},k=new o;function S(e){return b(function(e,t,r){function n(e,n,i,o){return t.encode([e,r.encodeKey(n,i,o)])}function o(e,t){return t&&t.options&&(e.keyEncoding=e.keyEncoding||t.options.keyEncoding,e.valueEncoding=e.valueEncoding||t.options.valueEncoding),e}return e.open((function(){})),{apply:function(t,i,a){i=i||{};for(var s=[],u=-1,c=t.length;++u<c;){var f=t[u];o(f,f.prefix),f.prefix=p(f.prefix),s.push({key:n(f.prefix,f.key,i,f),value:"del"!==f.type&&r.encodeValue(f.value,i,f),type:f.type})}e.db.batch(s,i,a)},get:function(t,i,o,a){return o.asBuffer=r.valueAsBuffer(o),e.db.get(n(i,t,o),o,(function(e,t){e?a(e):a(null,r.decodeValue(t,o))}))},createDecoder:function(e){return function(n,i){return{key:r.decodeKey(t.decode(n)[1],e),value:r.decodeValue(i,e)}}},isClosed:function(){return e.isClosed()},close:function(t){return e.close(t)},iterator:function(o){var a,s=function(e){var t={};for(var r in e)t[r]=e[r];return t}(o||{}),u=o.prefix||[];return i.toLtgt(o,s,(function(e){return n(u,e,s,{})}),t.lowerBound,t.upperBound),s.prefix=null,s.keyAsBuffer=s.valueAsBuffer=!1,"number"!=typeof s.limit&&(s.limit=-1),s.keyAsBuffer=t.buffer,s.valueAsBuffer=r.valueAsBuffer(s),a=e.db.iterator(s),{next:function(e){return a.next(e)},end:function(e){a.end(e)}}}}}(e,E,k),[],w,e.options)}var x=Function.prototype.toString,j=x.call(Object);function O(e){var t,r,n;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],r=0,n=e.length;r<n;r++)t[r]=O(e[r]);return t}if(e instanceof Date&&isFinite(e))return e.toISOString();if(function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}(e))return function(e){return e instanceof ArrayBuffer?e.slice(0):e.slice(0,e.size,e.type)}(e);if(!function(e){var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=t.constructor;return"function"==typeof r&&r instanceof r&&x.call(r)==j}(e))return e;for(r in t={},e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=O(e[r]);void 0!==i&&(t[r]=i)}return t}function A(e){var t=!1;return function(...r){if(t)throw new Error("once called more than once");t=!0,e.apply(this,r)}}function R(e,t){return r=function(...r){if(this._closed)return Promise.reject(new Error("database is closed"));if(this._destroyed)return Promise.reject(new Error("database is destroyed"));var n=this;return function(e,t,r){if(e.constructor.listeners("debug").length){for(var n=["api",e.name,t],i=0;i<r.length-1;i++)n.push(r[i]);e.constructor.emit("debug",n);var o=r[r.length-1];r[r.length-1]=function(r,n){var i=["api",e.name,t];i=i.concat(r?["error",r]:["success",n]),e.constructor.emit("debug",i),o(r,n)}}}(n,e,r),this.taskqueue.isReady?t.apply(this,r):new Promise((function(t,i){n.taskqueue.addTask((function(o){o?i(o):t(n[e].apply(n,r))}))}))},function(...e){e=O(e);var t=this,n="function"==typeof e[e.length-1]&&e.pop(),i=new Promise((function(n,i){var o;try{var a=A((function(e,t){e?i(e):n(t)}));e.push(a),(o=r.apply(t,e))&&"function"==typeof o.then&&n(o)}catch(e){i(e)}}));return n&&i.then((function(e){n(null,e)}),n),i};var r}function T(e,t){for(var r={},n=0,i=t.length;n<i;n++){var o=t[n];o in e&&(r[o]=e[o])}return r}var M;function B(e){return e}function L(e){return[{ok:e}]}function P(e,t,r){var n=t.docs,i=new Map;n.forEach((function(e){i.has(e.id)?i.get(e.id).push(e):i.set(e.id,[e])}));var o=i.size,a=0,s=new Array(o);function u(){var e;++a===o&&(e=[],s.forEach((function(t){t.docs.forEach((function(r){e.push({id:t.id,docs:[r]})}))})),r(null,{results:e}))}var c=[];i.forEach((function(e,t){c.push(t)}));var f=0;function l(){if(!(f>=c.length)){var r=Math.min(f+6,c.length),n=c.slice(f,r);!function(r,n){r.forEach((function(r,o){var a=n+o,c=i.get(r),f=T(c[0],["atts_since","attachments"]);f.open_revs=c.map((function(e){return e.rev})),f.open_revs=f.open_revs.filter(B);var d=B;0===f.open_revs.length&&(delete f.open_revs,d=L),["revs","attachments","binary","ajax","latest"].forEach((function(e){e in t&&(f[e]=t[e])})),e.get(r,f,(function(e,t){var n,i,o;n=e?[{error:e}]:d(t),i=r,o=n,s[a]={id:i,docs:o},u(),l()}))}))}(n,f),f+=n.length}}l()}try{localStorage.setItem("_pouch_check_localstorage",1),M=!!localStorage.getItem("_pouch_check_localstorage")}catch(e){M=!1}function C(){return M}const I="function"==typeof queueMicrotask?queueMicrotask:function(e){Promise.resolve().then(e)};function q(e){if("undefined"!=typeof console&&"function"==typeof console[e]){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}class N extends Error{constructor(e,t,r){super(),this.status=e,this.name=t,this.message=r,this.error=!0}toString(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})}}new N(401,"unauthorized","Name or password is incorrect.");var D=new N(400,"bad_request","Missing JSON list of 'docs'"),U=new N(404,"not_found","missing"),F=new N(409,"conflict","Document update conflict"),W=new N(400,"bad_request","_id field must contain a string"),$=new N(412,"missing_id","_id is required for puts"),z=new N(400,"bad_request","Only reserved document ids may start with underscore."),V=new N(412,"precondition_failed","Database not open"),K=new N(500,"unknown_error","Database encountered an unknown error"),H=new N(500,"badarg","Some query argument is invalid"),G=(new N(400,"invalid_request","Request was invalid"),new N(400,"query_parse_error","Some query parameter is invalid")),J=new N(500,"doc_validation","Bad special document member"),Y=new N(400,"bad_request","Something wrong with the request"),Q=new N(400,"bad_request","Document must be a JSON object"),X=(new N(404,"not_found","Database not found"),new N(500,"indexed_db_went_bad","unknown"),new N(500,"web_sql_went_bad","unknown"),new N(500,"levelDB_went_went_bad","unknown"),new N(403,"forbidden","Forbidden by design doc validate_doc_update function"),new N(400,"bad_request","Invalid rev format")),Z=(new N(412,"file_exists","The database could not be created, the file already exists."),new N(412,"missing_stub","A pre-existing attachment stub wasn't found"));new N(413,"invalid_url","Provided URL is invalid");function ee(e,t){function r(t){for(var r=Object.getOwnPropertyNames(e),n=0,i=r.length;n<i;n++)"function"!=typeof e[r[n]]&&(this[r[n]]=e[r[n]]);void 0===this.stack&&(this.stack=(new Error).stack),void 0!==t&&(this.reason=t)}return r.prototype=N.prototype,new r(t)}function te(e){if("object"!=typeof e){var t=e;(e=K).data=t}return"error"in e&&"conflict"===e.error&&(e.name="conflict",e.status=409),"name"in e||(e.name=e.error||"unknown"),"status"in e||(e.status=500),"message"in e||(e.message=e.message||e.reason),"stack"in e||(e.stack=(new Error).stack),e}function re(e){var t={},r=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(n){n.doc||(n.doc={});var i=r&&function(e,t,r){try{return!e(t,r)}catch(e){var n="Filter function threw: "+e.toString();return ee(Y,n)}}(e.filter,n.doc,t);if("object"==typeof i)return i;if(i)return!1;if(e.include_docs){if(!e.attachments)for(var o in n.doc._attachments)Object.prototype.hasOwnProperty.call(n.doc._attachments,o)&&(n.doc._attachments[o].stub=!0)}else delete n.doc;return!0}}var ne=function(){}.name?function(e){return e.name}:function(e){var t=e.toString().match(/^\s*function\s*(?:(\S+)\s*)?\(/);return t&&t[1]?t[1]:""};function ie(e){var t;if(e?"string"!=typeof e?t=ee(W):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=ee(z)):t=ee($),t)throw t}function oe(e){return"boolean"==typeof e._remote?e._remote:"function"==typeof e.type&&(q("warn","db.type() is deprecated and will be removed in a future version of PouchDB"),"http"===e.type())}function ae(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function se(e){var t=ae(e);return t?t.join("/"):null}function ue(e,t){var r=[],n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r.push(i),n.push(t[i]));return r.push(e),Function.apply(null,r).apply(null,n)}function ce(e,t,r){return e.get(t).catch((function(e){if(404!==e.status)throw e;return{}})).then((function(n){var i=n._rev,o=r(n);return o?(o._id=t,o._rev=i,function(e,t,r){return e.put(t).then((function(e){return{updated:!0,rev:e.rev}}),(function(n){if(409!==n.status)throw n;return ce(e,t._id,r)}))}(e,o,r)):{updated:!1,rev:i}}))}function fe(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}function le(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}function de(e,t){var r=new FileReader,n="function"==typeof r.readAsBinaryString;r.onloadend=function(e){var r=e.target.result||"";if(n)return t(r);t(function(e){for(var t="",r=new Uint8Array(e),n=r.byteLength,i=0;i<n;i++)t+=String.fromCharCode(r[i]);return t}(r))},n?r.readAsBinaryString(e):r.readAsArrayBuffer(e)}var he=self.setImmediate||self.setTimeout;function pe(e){return btoa(e)}function ye(e,t,r,n,i){(r>0||n<t.size)&&(t=t.slice(r,n)),function(e,t){var r=new FileReader;r.onloadend=function(e){var r=e.target.result||new ArrayBuffer(0);t(r)},r.readAsArrayBuffer(e)}(t,(function(t){e.append(t),i()}))}function ge(e,t,r,n,i){(r>0||n<t.length)&&(t=t.substring(r,n)),e.appendBinary(t),i()}function ve(e,t){if(!t)return l.v4().replace(/-/g,"").toLowerCase();var r,n=Object.assign({},e);return delete n._rev_tree,r=JSON.stringify(n),c.hash(r)}var be=l.v4;function me(e){for(var t,r,n,i,o=e.rev_tree.slice();i=o.pop();){var a=i.ids,s=a[2],u=i.pos;if(s.length)for(var c=0,f=s.length;c<f;c++)o.push({pos:u+1,ids:s[c]});else{var l=!!a[1].deleted,d=a[0];t&&!(n!==l?n:r!==u?r<u:t<d)||(t=d,r=u,n=l)}}return r+"-"+t}function _e(e,t){for(var r,n=e.slice();r=n.pop();)for(var i=r.pos,o=r.ids,a=o[2],s=t(0===a.length,i,o[0],r.ctx,o[1]),u=0,c=a.length;u<c;u++)n.push({pos:i+1,ids:a[u],ctx:s})}function we(e,t){return e.pos-t.pos}function Ee(e){var t=[];_e(e,(function(e,r,n,i,o){e&&t.push({rev:r+"-"+n,pos:r,opts:o})})),t.sort(we).reverse();for(var r=0,n=t.length;r<n;r++)delete t[r].pos;return t}function ke(e){for(var t=me(e),r=Ee(e.rev_tree),n=[],i=0,o=r.length;i<o;i++){var a=r[i];a.rev===t||a.opts.deleted||n.push(a.rev)}return n}function Se(e){for(var t,r=[],n=e.slice();t=n.pop();){var i=t.pos,o=t.ids,a=o[0],s=o[1],u=o[2],c=0===u.length,f=t.history?t.history.slice():[];f.push({id:a,opts:s}),c&&r.push({pos:i+1-f.length,ids:f});for(var l=0,d=u.length;l<d;l++)n.push({pos:i+1,ids:u[l],history:f})}return r.reverse()}function xe(e,t){return e.pos-t.pos}function je(e,t,r){var n=function(e,t,r){for(var n,i=0,o=e.length;i<o;)r(e[n=i+o>>>1],t)<0?i=n+1:o=n;return i}(e,t,r);e.splice(n,0,t)}function Oe(e,t){for(var r,n,i=t,o=e.length;i<o;i++){var a=e[i],s=[a.id,a.opts,[]];n?(n[2].push(s),n=s):r=n=s}return r}function Ae(e,t){return e[0]<t[0]?-1:1}function Re(e,t){for(var r=[{tree1:e,tree2:t}],n=!1;r.length>0;){var i=r.pop(),o=i.tree1,a=i.tree2;(o[1].status||a[1].status)&&(o[1].status="available"===o[1].status||"available"===a[1].status?"available":"missing");for(var s=0;s<a[2].length;s++)if(o[2][0]){for(var u=!1,c=0;c<o[2].length;c++)o[2][c][0]===a[2][s][0]&&(r.push({tree1:o[2][c],tree2:a[2][s]}),u=!0);u||(n="new_branch",je(o[2],a[2][s],Ae))}else n="new_leaf",o[2][0]=a[2][s]}return{conflicts:n,tree:e}}function Te(e,t,r){var n,i=[],o=!1,a=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var s=0,u=e.length;s<u;s++){var c=e[s];if(c.pos===t.pos&&c.ids[0]===t.ids[0])n=Re(c.ids,t.ids),i.push({pos:c.pos,ids:n.tree}),o=o||n.conflicts,a=!0;else if(!0!==r){var f=c.pos<t.pos?c:t,l=c.pos<t.pos?t:c,d=l.pos-f.pos,h=[],p=[];for(p.push({ids:f.ids,diff:d,parent:null,parentIdx:null});p.length>0;){var y=p.pop();if(0!==y.diff)for(var g=y.ids[2],v=0,b=g.length;v<b;v++)p.push({ids:g[v],diff:y.diff-1,parent:y.ids,parentIdx:v});else y.ids[0]===l.ids[0]&&h.push(y)}var m=h[0];m?(n=Re(m.ids,l.ids),m.parent[2][m.parentIdx]=n.tree,i.push({pos:f.pos,ids:f.ids}),o=o||n.conflicts,a=!0):i.push(c)}else i.push(c)}return a||i.push(t),i.sort(xe),{tree:i,conflicts:o||"internal_node"}}function Me(e,t,r){var n=Te(e,t),i=function(e,t){for(var r,n,i=Se(e),o=0,a=i.length;o<a;o++){var s,u=i[o],c=u.ids;if(c.length>t){r||(r={});var f=c.length-t;s={pos:u.pos+f,ids:Oe(c,f)};for(var l=0;l<f;l++){var d=u.pos+l+"-"+c[l].id;r[d]=!0}}else s={pos:u.pos,ids:Oe(c,0)};n=n?Te(n,s,!0).tree:[s]}return r&&_e(n,(function(e,t,n){delete r[t+"-"+n]})),{tree:n,revs:r?Object.keys(r):[]}}(n.tree,r);return{tree:i.tree,stemmedRevs:i.revs,conflicts:n.conflicts}}function Be(e){return e.ids}function Le(e,t){t||(t=me(e));for(var r,n=t.substring(t.indexOf("-")+1),i=e.rev_tree.map(Be);r=i.pop();){if(r[0]===n)return!!r[1].deleted;i=i.concat(r[2])}}function Pe(e){return"string"==typeof e&&e.startsWith("_local/")}function Ce(e,t,r){var n=[{rev:e._rev}];"all_docs"===r.style&&(n=Ee(t.rev_tree).map((function(e){return{rev:e.rev}})));var i={id:t.id,changes:n,doc:e};return Le(t,e._rev)&&(i.deleted=!0),r.conflicts&&(i.doc._conflicts=ke(t),i.doc._conflicts.length||delete i.doc._conflicts),i}class Ie extends f{constructor(e,t,r){super(),this.db=e;var n=(t=t?O(t):{}).complete=A((t,r)=>{var n,o;t?(o="error",("listenerCount"in(n=this)?n.listenerCount(o):f.listenerCount(n,o))>0&&this.emit("error",t)):this.emit("complete",r),this.removeAllListeners(),e.removeListener("destroyed",i)});r&&(this.on("complete",(function(e){r(null,e)})),this.on("error",r));const i=()=>{this.cancel()};e.once("destroyed",i),t.onChange=(e,t,r)=>{this.isCancelled||function(e,t,r,n){try{e.emit("change",t,r,n)}catch(e){q("error",'Error in .on("change", function):',e)}}(this,e,t,r)};var o=new Promise((function(e,r){t.complete=function(t,n){t?r(t):e(n)}}));this.once("cancel",(function(){e.removeListener("destroyed",i),t.complete(null,{status:"cancelled"})})),this.then=o.then.bind(o),this.catch=o.catch.bind(o),this.then((function(e){n(null,e)}),n),e.taskqueue.isReady?this.validateChanges(t):e.taskqueue.addTask(e=>{e?t.complete(e):this.isCancelled?this.emit("cancel"):this.validateChanges(t)})}cancel(){this.isCancelled=!0,this.db.taskqueue.isReady&&this.emit("cancel")}validateChanges(e){var t=e.complete;He._changesFilterPlugin?He._changesFilterPlugin.validate(e,r=>{if(r)return t(r);this.doChanges(e)}):this.doChanges(e)}doChanges(e){var t=e.complete;if("live"in(e=O(e))&&!("continuous"in e)&&(e.continuous=e.live),e.processChange=Ce,"latest"===e.since&&(e.since="now"),e.since||(e.since=0),"now"!==e.since){if(He._changesFilterPlugin){if(He._changesFilterPlugin.normalize(e),He._changesFilterPlugin.shouldFilter(this,e))return He._changesFilterPlugin.filter(this,e)}else["doc_ids","filter","selector","view"].forEach((function(t){t in e&&q("warn",'The "'+t+'" option was passed in to changes/replicate, but pouchdb-changes-filter plugin is not installed, so it was ignored. Please install the plugin to enable filtering.')}));"descending"in e||(e.descending=!1),e.limit=0===e.limit?1:e.limit,e.complete=t;var r=this.db._changes(e);if(r&&"function"==typeof r.cancel){const e=this.cancel;this.cancel=(...t)=>{r.cancel(),e.apply(this,t)}}}else this.db.info().then(r=>{this.isCancelled?t(null,{status:"cancelled"}):(e.since=r.update_seq,this.doChanges(e))},t)}}function qe(e,t){return function(r,n){r||n[0]&&n[0].error?((r=r||n[0]).docId=t,e(r)):e(null,n.length?n[0]:n)}}function Ne(e,t){if(e._id===t._id){return(e._revisions?e._revisions.start:0)-(t._revisions?t._revisions.start:0)}return e._id<t._id?-1:1}function De(e,t,r){return e.get("_local/purges").then((function(e){const n=e.purgeSeq+1;return e.purges.push({docId:t,rev:r,purgeSeq:n}),e.purges.length>self.purged_infos_limit&&e.purges.splice(0,e.purges.length-self.purged_infos_limit),e.purgeSeq=n,e})).catch((function(e){if(404!==e.status)throw e;return{_id:"_local/purges",purges:[{docId:t,rev:r,purgeSeq:0}],purgeSeq:0}})).then((function(t){return e.put(t)}))}function Ue(e){return null===e||"object"!=typeof e||Array.isArray(e)}const Fe=/^\d+-[^-]*$/;function We(e){return"string"==typeof e&&Fe.test(e)}class $e extends f{_setup(){this.post=R("post",(function(e,t,r){if("function"==typeof t&&(r=t,t={}),Ue(e))return r(ee(Q));this.bulkDocs({docs:[e]},t,qe(r,e._id))})).bind(this),this.put=R("put",(function(e,t,r){if("function"==typeof t&&(r=t,t={}),Ue(e))return r(ee(Q));if(ie(e._id),"_rev"in e&&!We(e._rev))return r(ee(X));if(Pe(e._id)&&"function"==typeof this._putLocal)return e._deleted?this._removeLocal(e,r):this._putLocal(e,r);const n=r=>{"function"==typeof this._put&&!1!==t.new_edits?this._put(e,t,r):this.bulkDocs({docs:[e]},t,qe(r,e._id))};var i,o,a,s;t.force&&e._rev?(i=e._rev.split("-"),o=i[1],a=parseInt(i[0],10)+1,s=ve(),e._revisions={start:a,ids:[s,o]},e._rev=a+"-"+s,t.new_edits=!1,n((function(t){var n=t?null:{ok:!0,id:e._id,rev:e._rev};r(t,n)}))):n(r)})).bind(this),this.putAttachment=R("putAttachment",(function(e,t,r,n,i){var o=this;function a(e){var r="_rev"in e?parseInt(e._rev,10):0;return e._attachments=e._attachments||{},e._attachments[t]={content_type:i,data:n,revpos:++r},o.put(e)}return"function"==typeof i&&(i=n,n=r,r=null),void 0===i&&(i=n,n=r,r=null),i||q("warn","Attachment",t,"on document",e,"is missing content_type"),o.get(e).then((function(e){if(e._rev!==r)throw ee(F);return a(e)}),(function(t){if(t.reason===U.message)return a({_id:e});throw t}))})).bind(this),this.removeAttachment=R("removeAttachment",(function(e,t,r,n){this.get(e,(e,i)=>{if(e)n(e);else if(i._rev===r){if(!i._attachments)return n();delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,this.put(i,n)}else n(ee(F))})})).bind(this),this.remove=R("remove",(function(e,t,r,n){var i;"string"==typeof t?(i={_id:e,_rev:t},"function"==typeof r&&(n=r,r={})):(i=e,"function"==typeof t?(n=t,r={}):(n=r,r=t)),(r=r||{}).was_delete=!0;var o={_id:i._id,_rev:i._rev||r.rev,_deleted:!0};if(Pe(o._id)&&"function"==typeof this._removeLocal)return this._removeLocal(i,n);this.bulkDocs({docs:[o]},r,qe(n,o._id))})).bind(this),this.revsDiff=R("revsDiff",(function(e,t,r){"function"==typeof t&&(r=t,t={});var n=Object.keys(e);if(!n.length)return r(null,{});var i=0,o=new Map;function a(e,t){o.has(e)||o.set(e,{missing:[]}),o.get(e).missing.push(t)}n.forEach((function(t){this._getRevisionTree(t,(function(s,u){if(s&&404===s.status&&"missing"===s.message)o.set(t,{missing:e[t]});else{if(s)return r(s);!function(t,r){var n=e[t].slice(0);_e(r,(function(e,r,i,o,s){var u=r+"-"+i,c=n.indexOf(u);-1!==c&&(n.splice(c,1),"available"!==s.status&&a(t,u))})),n.forEach((function(e){a(t,e)}))}(t,u)}if(++i===n.length){var c={};return o.forEach((function(e,t){c[t]=e})),r(null,c)}}))}),this)})).bind(this),this.bulkGet=R("bulkGet",(function(e,t){P(this,e,t)})).bind(this),this.compactDocument=R("compactDocument",(function(e,t,r){this._getRevisionTree(e,(n,i)=>{if(n)return r(n);var o=function(e){var t={},r=[];return _e(e,(function(e,n,i,o){var a=n+"-"+i;return e&&(t[a]=0),void 0!==o&&r.push({from:o,to:a}),a})),r.reverse(),r.forEach((function(e){void 0===t[e.from]?t[e.from]=1+t[e.to]:t[e.from]=Math.min(t[e.from],1+t[e.to])})),t}(i),a=[],s=[];Object.keys(o).forEach((function(e){o[e]>t&&a.push(e)})),_e(i,(function(e,t,r,n,i){var o=t+"-"+r;"available"===i.status&&-1!==a.indexOf(o)&&s.push(o)})),this._doCompaction(e,s,r)})})).bind(this),this.compact=R("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=e||{},this._compactionQueue=this._compactionQueue||[],this._compactionQueue.push({opts:e,callback:t}),1===this._compactionQueue.length&&function e(t){var r=t._compactionQueue[0],n=r.opts,i=r.callback;t.get("_local/compaction").catch((function(){return!1})).then((function(r){r&&r.last_seq&&(n.last_seq=r.last_seq),t._compact(n,(function(r,n){r?i(r):i(null,n),I((function(){t._compactionQueue.shift(),t._compactionQueue.length&&e(t)}))}))}))}(this)})).bind(this),this.get=R("get",(function(e,t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},"string"!=typeof e)return r(ee(W));if(Pe(e)&&"function"==typeof this._getLocal)return this._getLocal(e,r);var n=[];const i=()=>{var i=[],o=n.length;if(!o)return r(null,i);n.forEach(n=>{this.get(e,{rev:n,revs:t.revs,latest:t.latest,attachments:t.attachments,binary:t.binary},(function(e,t){if(e)i.push({missing:n});else{for(var a,s=0,u=i.length;s<u;s++)if(i[s].ok&&i[s].ok._rev===t._rev){a=!0;break}a||i.push({ok:t})}--o||r(null,i)}))})};if(!t.open_revs)return this._get(e,t,(n,i)=>{if(n)return n.docId=e,r(n);var o=i.doc,a=i.metadata,s=i.ctx;if(t.conflicts){var u=ke(a);u.length&&(o._conflicts=u)}if(Le(a,o._rev)&&(o._deleted=!0),t.revs||t.revs_info){for(var c=o._rev.split("-"),f=parseInt(c[0],10),l=c[1],d=Se(a.rev_tree),h=null,p=0;p<d.length;p++){var y=d[p];const e=y.ids.findIndex(e=>e.id===l);(e===f-1||!h&&-1!==e)&&(h=y)}if(!h)return(n=new Error("invalid rev tree")).docId=e,r(n);const i=o._rev.split("-")[1],s=h.ids.findIndex(e=>e.id===i)+1;var g=h.ids.length-s;if(h.ids.splice(s,g),h.ids.reverse(),t.revs&&(o._revisions={start:h.pos+h.ids.length-1,ids:h.ids.map((function(e){return e.id}))}),t.revs_info){var v=h.pos+h.ids.length;o._revs_info=h.ids.map((function(e){return{rev:--v+"-"+e.id,status:e.opts.status}}))}}if(t.attachments&&o._attachments){var b=o._attachments,m=Object.keys(b).length;if(0===m)return r(null,o);Object.keys(b).forEach(e=>{this._getAttachment(o._id,e,b[e],{binary:t.binary,metadata:a,ctx:s},(function(t,n){var i=o._attachments[e];i.data=n,delete i.stub,delete i.length,--m||r(null,o)}))})}else{if(o._attachments)for(var _ in o._attachments)Object.prototype.hasOwnProperty.call(o._attachments,_)&&(o._attachments[_].stub=!0);r(null,o)}});if("all"===t.open_revs)this._getRevisionTree(e,(function(e,t){if(e)return r(e);n=Ee(t).map((function(e){return e.rev})),i()}));else{if(!Array.isArray(t.open_revs))return r(ee(K,"function_clause"));n=t.open_revs;for(var o=0;o<n.length;o++){if(!We(n[o]))return r(ee(X))}i()}})).bind(this),this.getAttachment=R("getAttachment",(function(e,t,r,n){r instanceof Function&&(n=r,r={}),this._get(e,r,(i,o)=>i?n(i):o.doc._attachments&&o.doc._attachments[t]?(r.ctx=o.ctx,r.binary=!0,r.metadata=o.metadata,void this._getAttachment(e,t,o.doc._attachments[t],r,n)):n(ee(U)))})).bind(this),this.allDocs=R("allDocs",(function(e,t){if("function"==typeof e&&(t=e,e={}),e.skip=void 0!==e.skip?e.skip:0,e.start_key&&(e.startkey=e.start_key),e.end_key&&(e.endkey=e.end_key),"keys"in e){if(!Array.isArray(e.keys))return t(new TypeError("options.keys must be an array"));var r=["startkey","endkey","key"].filter((function(t){return t in e}))[0];if(r)return void t(ee(G,"Query parameter `"+r+"` is not compatible with multi-get"));if(!oe(this)&&(function(e){var t="limit"in e?e.keys.slice(e.skip,e.limit+e.skip):e.skip>0?e.keys.slice(e.skip):e.keys;e.keys=t,e.skip=0,delete e.limit,e.descending&&(t.reverse(),e.descending=!1)}(e),0===e.keys.length))return this._allDocs({limit:0},t)}return this._allDocs(e,t)})).bind(this),this.close=R("close",(function(e){return this._closed=!0,this.emit("closed"),this._close(e)})).bind(this),this.info=R("info",(function(e){this._info((t,r)=>{if(t)return e(t);r.db_name=r.db_name||this.name,r.auto_compaction=!(!this.auto_compaction||oe(this)),r.adapter=this.adapter,e(null,r)})})).bind(this),this.id=R("id",(function(e){return this._id(e)})).bind(this),this.bulkDocs=R("bulkDocs",(function(e,t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},Array.isArray(e)&&(e={docs:e}),!e||!e.docs||!Array.isArray(e.docs))return r(ee(D));for(var n=0;n<e.docs.length;++n){const t=e.docs[n];if(Ue(t))return r(ee(Q));if("_rev"in t&&!We(t._rev))return r(ee(X))}var i;if(e.docs.forEach((function(e){e._attachments&&Object.keys(e._attachments).forEach((function(t){i=i||function(e){return"_"===e.charAt(0)&&e+" is not a valid attachment name, attachment names cannot start with '_'"}(t),e._attachments[t].content_type||q("warn","Attachment",t,"on document",e._id,"is missing content_type")}))})),i)return r(ee(Y,i));"new_edits"in t||(t.new_edits=!("new_edits"in e)||e.new_edits);var o=this;t.new_edits||oe(o)||e.docs.sort(Ne),function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r._deleted)delete r._attachments;else if(r._attachments)for(var n=Object.keys(r._attachments),i=0;i<n.length;i++){var o=n[i];r._attachments[o]=T(r._attachments[o],["data","digest","content_type","length","revpos","stub"])}}}(e.docs);var a=e.docs.map((function(e){return e._id}));this._bulkDocs(e,t,(function(e,n){if(e)return r(e);if(t.new_edits||(n=n.filter((function(e){return e.error}))),!oe(o))for(var i=0,s=n.length;i<s;i++)n[i].id=n[i].id||a[i];r(null,n)}))})).bind(this),this.registerDependentDatabase=R("registerDependentDatabase",(function(e,t){var r=O(this.__opts);this.__opts.view_adapter&&(r.adapter=this.__opts.view_adapter);var n=new this.constructor(e,r);ce(this,"_local/_pouch_dependentDbs",(function(t){return t.dependentDbs=t.dependentDbs||{},!t.dependentDbs[e]&&(t.dependentDbs[e]=!0,t)})).then((function(){t(null,{db:n})})).catch(t)})).bind(this),this.destroy=R("destroy",(function(e,t){"function"==typeof e&&(t=e,e={});var r=!("use_prefix"in this)||this.use_prefix;const n=()=>{this._destroy(e,(e,r)=>{if(e)return t(e);this._destroyed=!0,this.emit("destroyed"),t(null,r||{ok:!0})})};if(oe(this))return n();this.get("_local/_pouch_dependentDbs",(e,i)=>{if(e)return 404!==e.status?t(e):n();var o=i.dependentDbs,a=this.constructor,s=Object.keys(o).map(e=>{var t=r?e.replace(new RegExp("^"+a.prefix),""):e;return new a(t,this.__opts).destroy()});Promise.all(s).then(n,t)})})).bind(this)}_compact(e,t){var r,n={return_docs:!1,last_seq:e.last_seq||0,since:e.last_seq||0},i=[],o=0;const a=e=>{this.activeTasks.update(r,{completed_items:++o}),i.push(this.compactDocument(e.id,0))},s=e=>{this.activeTasks.remove(r,e),t(e)},u=e=>{var n=e.last_seq;Promise.all(i).then(()=>ce(this,"_local/compaction",e=>(!e.last_seq||e.last_seq<n)&&(e.last_seq=n,e))).then(()=>{this.activeTasks.remove(r),t(null,{ok:!0})}).catch(s)};this.info().then(e=>{r=this.activeTasks.add({name:"database_compaction",total_items:e.update_seq-n.last_seq}),this.changes(n).on("change",a).on("complete",u).on("error",s)})}changes(e,t){return"function"==typeof e&&(t=e,e={}),(e=e||{}).return_docs="return_docs"in e?e.return_docs:!e.live,new Ie(this,e,t)}type(){return"function"==typeof this._type?this._type():this.adapter}}$e.prototype.purge=R("_purge",(function(e,t,r){if(void 0===this._purge)return r(ee(K,"Purge is not implemented in the "+this.adapter+" adapter."));var n=this;n._getRevisionTree(e,(i,o)=>{if(i)return r(i);if(!o)return r(ee(U));let a;try{a=function(e,t){let r=[];const n=e.slice();let i;for(;i=n.pop();){const{pos:e,ids:o}=i,a=`${e}-${o[0]}`,s=o[2];if(r.push(a),a===t){if(0!==s.length)throw new Error("The requested revision is not a leaf");return r.reverse()}(0===s.length||s.length>1)&&(r=[]);for(let t=0,r=s.length;t<r;t++)n.push({pos:e+1,ids:s[t]})}if(0===r.length)throw new Error("The requested revision does not exist");return r.reverse()}(o,t)}catch(i){return r(i.message||i)}n._purge(e,a,(i,o)=>{if(i)return r(i);De(n,e,t).then((function(){return r(null,o)}))})})}));class ze{constructor(){this.isReady=!1,this.failed=!1,this.queue=[]}execute(){var e;if(this.failed)for(;e=this.queue.shift();)e(this.failed);else for(;e=this.queue.shift();)e()}fail(e){this.failed=e,this.execute()}ready(e){this.isReady=!0,this.db=e,this.execute()}addTask(e){this.queue.push(e),this.failed&&this.execute()}}function Ve(e,t){let r=function(...e){if(!(this instanceof r))return new r(...e);t.apply(this,e)};var n,i;return i=e,(n=r).prototype=Object.create(i.prototype,{constructor:{value:n}}),r}class Ke extends $e{constructor(e,t){super(),this._setup(e,t)}_setup(e,t){if(super._setup(),t=t||{},e&&"object"==typeof e&&(e=(t=e).name,delete t.name),void 0===t.deterministic_revs&&(t.deterministic_revs=!0),this.__opts=t=O(t),this.auto_compaction=t.auto_compaction,this.purged_infos_limit=t.purged_infos_limit||1e3,this.prefix=He.prefix,"string"!=typeof e)throw new Error("Missing/invalid DB name");var r=function(e,t){var r=e.match(/([a-z-]*):\/\/(.*)/);if(r)return{name:/https?/.test(r[1])?r[1]+"://"+r[2]:r[2],adapter:r[1]};var n=He.adapters,i=He.preferredAdapters,o=He.prefix,a=t.adapter;if(!a)for(var s=0;s<i.length&&("idb"===(a=i[s])&&"websql"in n&&C()&&localStorage["_pouch__websqldb_"+o+e]);++s)q("log",'PouchDB is downgrading "'+e+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.');var u=n[a];return{name:!u||!("use_prefix"in u)||u.use_prefix?o+e:e,adapter:a}}((t.prefix||"")+e,t);if(t.name=r.name,t.adapter=t.adapter||r.adapter,this.name=e,this._adapter=t.adapter,He.emit("debug",["adapter","Picked adapter: ",t.adapter]),!He.adapters[t.adapter]||!He.adapters[t.adapter].valid())throw new Error("Invalid Adapter: "+t.adapter);if(t.view_adapter&&(!He.adapters[t.view_adapter]||!He.adapters[t.view_adapter].valid()))throw new Error("Invalid View Adapter: "+t.view_adapter);this.taskqueue=new ze,this.adapter=t.adapter,He.adapters[t.adapter].call(this,t,e=>{if(e)return this.taskqueue.fail(e);!function(e){function t(t){e.removeListener("closed",r),t||e.constructor.emit("destroyed",e.name)}function r(){e.removeListener("destroyed",t),e.constructor.emit("unref",e)}e.once("destroyed",t),e.once("closed",r),e.constructor.emit("ref",e)}(this),this.emit("created",this),He.emit("created",this.name),this.taskqueue.ready(this)})}}const He=Ve(Ke,(function(e,t){Ke.prototype._setup.call(this,e,t)}));var Ge=fetch;He.adapters={},He.preferredAdapters=[],He.prefix="_pouch_";var Je=new f;!function(e){Object.keys(f.prototype).forEach((function(t){"function"==typeof f.prototype[t]&&(e[t]=Je[t].bind(Je))}));var t=e._destructionListeners=new Map;e.on("ref",(function(e){t.has(e.name)||t.set(e.name,[]),t.get(e.name).push(e)})),e.on("unref",(function(e){if(t.has(e.name)){var r=t.get(e.name),n=r.indexOf(e);n<0||(r.splice(n,1),r.length>1?t.set(e.name,r):t.delete(e.name))}})),e.on("destroyed",(function(e){if(t.has(e)){var r=t.get(e);t.delete(e),r.forEach((function(e){e.emit("destroyed",!0)}))}}))}(He),He.adapter=function(e,t,r){t.valid()&&(He.adapters[e]=t,r&&He.preferredAdapters.push(e))},He.plugin=function(e){if("function"==typeof e)e(He);else{if("object"!=typeof e||0===Object.keys(e).length)throw new Error('Invalid plugin: got "'+e+'", expected an object or a function');Object.keys(e).forEach((function(t){He.prototype[t]=e[t]}))}return this.__defaults&&(He.__defaults=Object.assign({},this.__defaults)),He},He.defaults=function(e){let t=Ve(He,(function(e,r){r=r||{},e&&"object"==typeof e&&(e=(r=e).name,delete r.name),r=Object.assign({},t.__defaults,r),He.call(this,e,r)}));return t.preferredAdapters=He.preferredAdapters.slice(),Object.keys(He).forEach((function(e){e in t||(t[e]=He[e])})),t.__defaults=Object.assign({},this.__defaults,e),t},He.fetch=function(e,t){return Ge(e,t)},He.prototype.activeTasks=He.activeTasks=new class{constructor(){this.tasks={}}list(){return Object.values(this.tasks)}add(e){const t=l.v4();return this.tasks[t]={id:t,name:e.name,total_items:e.total_items,created_at:(new Date).toJSON()},t}get(e){return this.tasks[e]}remove(e,t){return delete this.tasks[e],this.tasks}update(e,t){const r=this.tasks[e];if(void 0!==r){const n={id:r.id,name:r.name,created_at:r.created_at,total_items:t.total_items||r.total_items,completed_items:t.completed_items||r.completed_items,updated_at:(new Date).toJSON()};this.tasks[e]=n}return this.tasks}};function Ye(e,t){for(var r=e,n=0,i=t.length;n<i;n++){if(!(r=r[t[n]]))break}return r}function Qe(e){for(var t=[],r="",n=0,i=e.length;n<i;n++){var o=e[n];n>0&&"\\"===e[n-1]&&("$"===o||"."===o)?r=r.substring(0,r.length-1)+o:"."===o?(t.push(r),r=""):r+=o}return t.push(r),t}var Xe=["$or","$nor","$not"];function Ze(e){return Xe.indexOf(e)>-1}function et(e){return Object.keys(e)[0]}function tt(e){var t={},r={$or:!0,$nor:!0};return e.forEach((function(e){Object.keys(e).forEach((function(n){var i=e[n];if("object"!=typeof i&&(i={$eq:i}),Ze(n))if(i instanceof Array){if(r[n])return r[n]=!1,void(t[n]=i);var o=[];t[n].forEach((function(e){Object.keys(i).forEach((function(t){var r=i[t],n=Math.max(Object.keys(e).length,Object.keys(r).length),a=tt([e,r]);Object.keys(a).length<=n||o.push(a)}))})),t[n]=o}else t[n]=tt([i]);else{var a=t[n]=t[n]||{};Object.keys(i).forEach((function(e){var t=i[e];return"$gt"===e||"$gte"===e?function(e,t,r){if(void 0!==r.$eq)return;void 0!==r.$gte?"$gte"===e?t>r.$gte&&(r.$gte=t):t>=r.$gte&&(delete r.$gte,r.$gt=t):void 0!==r.$gt?"$gte"===e?t>r.$gt&&(delete r.$gt,r.$gte=t):t>r.$gt&&(r.$gt=t):r[e]=t}(e,t,a):"$lt"===e||"$lte"===e?function(e,t,r){if(void 0!==r.$eq)return;void 0!==r.$lte?"$lte"===e?t<r.$lte&&(r.$lte=t):t<=r.$lte&&(delete r.$lte,r.$lt=t):void 0!==r.$lt?"$lte"===e?t<r.$lt&&(delete r.$lt,r.$lte=t):t<r.$lt&&(r.$lt=t):r[e]=t}(e,t,a):"$ne"===e?function(e,t){"$ne"in t?t.$ne.push(e):t.$ne=[e]}(t,a):"$eq"===e?function(e,t){delete t.$gt,delete t.$gte,delete t.$lt,delete t.$lte,delete t.$ne,t.$eq=e}(t,a):"$regex"===e?function(e,t){"$regex"in t?t.$regex.push(e):t.$regex=[e]}(t,a):void(a[e]=t)}))}}))})),t}function rt(e){var t=O(e);(function e(t,r){for(var n in t){"$and"===n&&(r=!0);var i=t[n];"object"==typeof i&&(r=e(i,r))}return r})(t,!1)&&"$and"in(t=function e(t){for(var r in t){if(Array.isArray(t))for(var n in t)t[n].$and&&(t[n]=tt(t[n].$and));var i=t[r];"object"==typeof i&&e(i)}return t}(t))&&(t=tt(t.$and)),["$or","$nor"].forEach((function(e){e in t&&t[e].forEach((function(e){for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r],i=e[n];"object"==typeof i&&null!==i||(e[n]={$eq:i})}}))})),"$not"in t&&(t.$not=tt([t.$not]));for(var r=Object.keys(t),n=0;n<r.length;n++){var i=r[n],o=t[i];"object"==typeof o&&null!==o||(o={$eq:o}),t[i]=o}return function e(t){Object.keys(t).forEach((function(r){var n=t[r];Array.isArray(n)?n.forEach((function(t){t&&"object"==typeof t&&e(t)})):"$ne"===r?t.$ne=[n]:"$regex"===r?t.$regex=[n]:n&&"object"==typeof n&&e(n)}))}(t),t}function nt(e,t){if(e===t)return 0;e=it(e),t=it(t);var r=ot(e),n=ot(t);if(r-n!=0)return r-n;switch(typeof e){case"number":return e-t;case"boolean":return e<t?-1:1;case"string":return function(e,t){return e===t?0:e>t?1:-1}(e,t)}return Array.isArray(e)?function(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){var i=nt(e[n],t[n]);if(0!==i)return i}return e.length===t.length?0:e.length>t.length?1:-1}(e,t):function(e,t){for(var r=Object.keys(e),n=Object.keys(t),i=Math.min(r.length,n.length),o=0;o<i;o++){var a=nt(r[o],n[o]);if(0!==a)return a;if(0!==(a=nt(e[r[o]],t[n[o]])))return a}return r.length===n.length?0:r.length>n.length?1:-1}(e,t)}function it(e){switch(typeof e){case"undefined":return null;case"number":return e===1/0||e===-1/0||isNaN(e)?null:e;case"object":var t=e;if(Array.isArray(e)){var r=e.length;e=new Array(r);for(var n=0;n<r;n++)e[n]=it(t[n])}else{if(e instanceof Date)return e.toJSON();if(null!==e)for(var i in e={},t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];void 0!==o&&(e[i]=it(o))}}}return e}function ot(e){var t=["boolean","number","string","object"].indexOf(typeof e);return~t?null===e?1:Array.isArray(e)?5:t<3?t+2:t+3:Array.isArray(e)?5:void 0}function at(e,t,r){if(e=e.filter((function(e){return st(e.doc,t.selector,r)})),t.sort){var n=function(e){function t(t){return e.map((function(e){var r=Qe(et(e));return Ye(t,r)}))}return function(e,r){var n,i,o=nt(t(e.doc),t(r.doc));return 0!==o?o:(n=e.doc._id,i=r.doc._id,n<i?-1:n>i?1:0)}}(t.sort);e=e.sort(n),"string"!=typeof t.sort[0]&&"desc"===(i=t.sort[0])[et(i)]&&(e=e.reverse())}var i;if("limit"in t||"skip"in t){var o=t.skip||0,a=("limit"in t?t.limit:e.length)+o;e=e.slice(o,a)}return e}function st(e,t,r){return r.every((function(r){var n=t[r],i=Qe(r),o=Ye(e,i);return Ze(r)?function(e,t,r){if("$or"===e)return t.some((function(e){return st(r,e,Object.keys(e))}));if("$not"===e)return!st(r,t,Object.keys(t));return!t.find((function(e){return st(r,e,Object.keys(e))}))}(r,n,e):ut(n,e,i,o)}))}function ut(e,t,r,n){return!e||("object"==typeof e?Object.keys(e).every((function(i){var o=e[i];if(0===i.indexOf("$"))return ct(i,t,o,r,n);var a=Qe(i);if(void 0===n&&"object"!=typeof o&&a.length>0)return!1;var s=Ye(n,a);return"object"==typeof o?ut(o,t,r,s):ct("$eq",t,o,a,s)})):e===n)}function ct(e,t,r,n,i){if(!ht[e])throw new Error('unknown operator "'+e+'" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, $nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all');return ht[e](t,r,n,i)}function ft(e){return null!=e}function lt(e){return void 0!==e}function dt(e,t){return t.some((function(t){return e instanceof Array?e.some((function(e){return 0===nt(t,e)})):0===nt(t,e)}))}var ht={$elemMatch:function(e,t,r,n){return!!Array.isArray(n)&&(0!==n.length&&("object"==typeof n[0]&&null!==n[0]?n.some((function(e){return st(e,t,Object.keys(t))})):n.some((function(n){return ut(t,e,r,n)}))))},$allMatch:function(e,t,r,n){return!!Array.isArray(n)&&(0!==n.length&&("object"==typeof n[0]&&null!==n[0]?n.every((function(e){return st(e,t,Object.keys(t))})):n.every((function(n){return ut(t,e,r,n)}))))},$eq:function(e,t,r,n){return lt(n)&&0===nt(n,t)},$gte:function(e,t,r,n){return lt(n)&&nt(n,t)>=0},$gt:function(e,t,r,n){return lt(n)&&nt(n,t)>0},$lte:function(e,t,r,n){return lt(n)&&nt(n,t)<=0},$lt:function(e,t,r,n){return lt(n)&&nt(n,t)<0},$exists:function(e,t,r,n){return t?lt(n):!lt(n)},$mod:function(e,t,r,n){return ft(n)&&function(e,t){return"number"==typeof e&&parseInt(e,10)===e&&e%t[0]===t[1]}(n,t)},$ne:function(e,t,r,n){return t.every((function(e){return 0!==nt(n,e)}))},$in:function(e,t,r,n){return ft(n)&&dt(n,t)},$nin:function(e,t,r,n){return ft(n)&&!dt(n,t)},$size:function(e,t,r,n){return ft(n)&&Array.isArray(n)&&function(e,t){return e.length===t}(n,t)},$all:function(e,t,r,n){return Array.isArray(n)&&function(e,t){return t.every((function(t){return e.some((function(e){return 0===nt(t,e)}))}))}(n,t)},$regex:function(e,t,r,n){return ft(n)&&"string"==typeof n&&t.every((function(e){return function(e,t){return new RegExp(t).test(e)}(n,e)}))},$type:function(e,t,r,n){return function(e,t){switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"number":return"number"==typeof e;case"string":return"string"==typeof e;case"array":return e instanceof Array;case"object":return"[object Object]"==={}.toString.call(e)}}(n,t)}};function pt(e,t){if(e.selector&&e.filter&&"_selector"!==e.filter){var r="string"==typeof e.filter?e.filter:"function";return t(new Error('selector invalid for filter "'+r+'"'))}t()}function yt(e){e.view&&!e.filter&&(e.filter="_view"),e.selector&&!e.filter&&(e.filter="_selector"),e.filter&&"string"==typeof e.filter&&("_view"===e.filter?e.view=se(e.view):e.filter=se(e.filter))}function gt(e,t){return t.filter&&"string"==typeof t.filter&&!t.doc_ids&&!oe(e.db)}function vt(e,t){var r=t.complete;if("_view"===t.filter){if(!t.view||"string"!=typeof t.view){var n=ee(Y,"`view` filter parameter not found or invalid.");return r(n)}var i=ae(t.view);e.db.get("_design/"+i[0],(function(n,o){if(e.isCancelled)return r(null,{status:"cancelled"});if(n)return r(te(n));var a=o&&o.views&&o.views[i[1]]&&o.views[i[1]].map;if(!a)return r(ee(U,o.views?"missing json key: "+i[1]:"missing json key: views"));t.filter=ue(["return function(doc) {",' "use strict";'," var emitted = false;"," var emit = function (a, b) {"," emitted = true;"," };"," var view = "+a+";"," view(doc);"," if (emitted) {"," return true;"," }","};"].join("\n"),{}),e.doChanges(t)}))}else if(t.selector)t.filter=function(e){return function(e,t){if("object"!=typeof t)throw new Error("Selector error: expected a JSON object");var r=at([{doc:e}],{selector:t=rt(t)},Object.keys(t));return r&&1===r.length}(e,t.selector)},e.doChanges(t);else{var o=ae(t.filter);e.db.get("_design/"+o[0],(function(n,i){if(e.isCancelled)return r(null,{status:"cancelled"});if(n)return r(te(n));var a=i&&i.filters&&i.filters[o[1]];if(!a)return r(ee(U,i&&i.filters?"missing json key: "+o[1]:"missing json key: filters"));t.filter=ue('"use strict";\nreturn '+a+";",{}),e.doChanges(t)}))}}function bt(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}He.plugin((function(e){e._changesFilterPlugin={validate:pt,normalize:yt,shouldFilter:gt,filter:vt}})),He.version="9.0.0";var mt=bt(["_id","_rev","_access","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats","_removed"]),_t=bt(["_access","_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]);function wt(e){if(!/^\d+-/.test(e))return ee(X);var t=e.indexOf("-"),r=e.substring(0,t),n=e.substring(t+1);return{prefix:parseInt(r,10),id:n}}function Et(e,t,r){var n,i,o;r||(r={deterministic_revs:!0});var a={status:"available"};if(e._deleted&&(a.deleted=!0),t)if(e._id||(e._id=be()),i=ve(e,r.deterministic_revs),e._rev){if((o=wt(e._rev)).error)return o;e._rev_tree=[{pos:o.prefix,ids:[o.id,{status:"missing"},[[i,a,[]]]]}],n=o.prefix+1}else e._rev_tree=[{pos:1,ids:[i,a,[]]}],n=1;else if(e._revisions&&(e._rev_tree=function(e,t){for(var r=e.start-e.ids.length+1,n=e.ids,i=[n[0],t,[]],o=1,a=n.length;o<a;o++)i=[n[o],{status:"missing"},[i]];return[{pos:r,ids:i}]}(e._revisions,a),n=e._revisions.start,i=e._revisions.ids[0]),!e._rev_tree){if((o=wt(e._rev)).error)return o;n=o.prefix,i=o.id,e._rev_tree=[{pos:n,ids:[i,a,[]]}]}ie(e._id),e._rev=n+"-"+i;var s={metadata:{},data:{}};for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var c="_"===u[0];if(c&&!mt[u]){var f=ee(J,u);throw f.message=J.message+": "+u,f}c&&!_t[u]?s.metadata[u.slice(1)]=e[u]:s.data[u]=e[u]}return s}function kt(e,t,r,n,i,o,a,s){if(function(e,t){for(var r,n=e.slice(),i=t.split("-"),o=parseInt(i[0],10),a=i[1];r=n.pop();){if(r.pos===o&&r.ids[0]===a)return!0;for(var s=r.ids[2],u=0,c=s.length;u<c;u++)n.push({pos:r.pos+1,ids:s[u]})}return!1}(t.rev_tree,r.metadata.rev)&&!s)return n[i]=r,o();var u=t.winningRev||me(t),c="deleted"in t?t.deleted:Le(t,u),f="deleted"in r.metadata?r.metadata.deleted:Le(r.metadata),l=/^1-/.test(r.metadata.rev);if(c&&!f&&s&&l){var d=r.data;d._rev=u,d._id=r.metadata.id,r=Et(d,s)}var h=Me(t.rev_tree,r.metadata.rev_tree[0],e);if(s&&(c&&f&&"new_leaf"!==h.conflicts||!c&&"new_leaf"!==h.conflicts||c&&!f&&"new_branch"===h.conflicts)){var p=ee(F);return n[i]=p,o()}var y=r.metadata.rev;r.metadata.rev_tree=h.tree,r.stemmedRevs=h.stemmedRevs||[],t.rev_map&&(r.metadata.rev_map=t.rev_map);var g=me(r.metadata),v=Le(r.metadata,g),b=c===v?0:c<v?-1:1;a(r,g,v,y===g?v:Le(r.metadata,y),!0,b,i,o)}function St(e,t,r,n,i,o,a,s,u){e=e||1e3;var c=s.new_edits,f=new Map,l=0,d=t.length;function h(){++l===d&&u&&u()}t.forEach((function(e,t){if(e._id&&Pe(e._id)){var n=e._deleted?"_removeLocal":"_putLocal";r[n](e,{ctx:i},(function(e,r){o[t]=e||r,h()}))}else{var a=e.metadata.id;f.has(a)?(d--,f.get(a).push([e,t])):f.set(a,[[e,t]])}})),f.forEach((function(t,r){var i=0;function u(){++i<t.length?f():h()}function f(){var f=t[i],l=f[0],d=f[1];if(n.has(r))kt(e,n.get(r),l,o,d,u,a,c);else{var h=Me([],l.metadata.rev_tree[0],e);l.metadata.rev_tree=h.tree,l.stemmedRevs=h.stemmedRevs||[],function(e,t,r){var n=me(e.metadata),i=Le(e.metadata,n);if("was_delete"in s&&i)return o[t]=ee(U,"deleted"),r();if(c&&function(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}(e)){var u=ee(F);return o[t]=u,r()}a(e,n,i,i,!1,i?0:1,t,r)}(l,d,u)}}f()}))}function xt(e,t){return fe([new Uint8Array(e)],{type:t})}function jt(e,t){var r=t.prefix()[0],n=e._cache,i=n.get(r);return i||(i=new Map,n.set(r,i)),i}class Ot{constructor(){this._batch=[],this._cache=new Map}get(e,t,r){var n=jt(this,e),i=n.get(t);return i?I((function(){r(null,i)})):null===i?I((function(){r({name:"NotFoundError"})})):void e.get(t,(function(e,i){if(e)return"NotFoundError"===e.name&&n.set(t,null),r(e);n.set(t,i),r(null,i)}))}batch(e){for(var t=0,r=e.length;t<r;t++){var n=e[t],i=jt(this,n.prefix);"put"===n.type?i.set(n.key,n.value):i.set(n.key,null)}this._batch=this._batch.concat(e)}execute(e,t){for(var r=new Set,n=[],i=this._batch.length-1;i>=0;i--){var o=this._batch[i],a=o.prefix.prefix()[0]+"\xff"+o.key;r.has(a)||(r.add(a),n.push(o))}e.batch(n,t)}}var At=new Map,Rt={encode:function(e){try{return JSON.stringify(e)}catch(t){return d.stringify(e)}},decode:function(e){try{return JSON.parse(e)}catch(t){return d.parse(e)}},buffer:!1,type:"cheap-json"},Tt=new class extends f{constructor(){super(),this._listeners={},C()&&addEventListener("storage",e=>{this.emit(e.key)})}addListener(e,t,r,n){if(!this._listeners[t]){var i=!1,o=this;this._listeners[t]=a,this.on(e,a)}function a(){if(o._listeners[t])if(i)i="waiting";else{i=!0;var e=T(n,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);r.changes(e).on("change",(function(e){e.seq>n.since&&!n.cancelled&&(n.since=e.seq,n.onChange(e))})).on("complete",(function(){"waiting"===i&&I(a),i=!1})).on("error",(function(){i=!1}))}}}removeListener(e,t){t in this._listeners&&(super.removeListener(e,this._listeners[t]),delete this._listeners[t])}notifyLocalWindows(e){C()&&(localStorage[e]="a"===localStorage[e]?"b":"a")}notify(e){this.emit(e),this.notifyLocalWindows(e)}};function Mt(e){return"winningRev"in e?e.winningRev:me(e)}function Bt(e,t){return"deleted"in e?e.deleted:Le(e,t)}function Lt(e,t,r){var n=e.content_type;return new Promise((function(i,o){t.binaryStore.get(e.digest,(function(t,a){var s;if(t){if("NotFoundError"!==t.name)return o(t);s=r.binary?function(e,t){return fe([le(e)],{type:t})}("",n):""}else s=r.binary?xt(a,n):a.toString("base64");delete e.stub,delete e.length,e.data=s,i()}))}))}function Pt(e,t,r){var n=[];return e.forEach((function(e){e.doc&&e.doc._attachments&&Object.keys(e.doc._attachments).forEach((function(t){var r=e.doc._attachments[t];"data"in r||n.push(r)}))})),Promise.all(n.map((function(e){return Lt(e,t,r)})))}function Ct(e,r){e=O(e);var i,o,a=this,f={},l=e.revs_limit,d=e.name;void 0===e.createIfMissing&&(e.createIfMissing=!0);var h,p=e.db,y=ne(p);function g(){f.docStore=o.sublevel("document-store",{valueEncoding:Rt}),f.bySeqStore=o.sublevel("by-sequence",{valueEncoding:"json"}),f.attachmentStore=o.sublevel("attach-store",{valueEncoding:"json"}),f.binaryStore=o.sublevel("attach-binary-store",{valueEncoding:"binary"}),f.localStore=o.sublevel("local-store",{valueEncoding:"json"}),f.metaStore=o.sublevel("meta-store",{valueEncoding:"json"}),"object"==typeof e.migrate?e.migrate.doMigrationTwo(o,f,v):v()}function v(){f.metaStore.get("_local_last_update_seq",(function(e,t){void 0===o._updateSeq&&(o._updateSeq=t||0),f.metaStore.get("_local_doc_count",(function(e,t){o._docCount=e?0:t,f.metaStore.get("_local_uuid",(function(e,t){i=e?be():t,f.metaStore.put("_local_uuid",i,(function(){I((function(){r(null,a)}))}))}))}))}))}function b(e,t){try{e.apply(null,t)}catch(e){t[t.length-1](e)}}function m(){var e=o._queue.peekFront();"read"===e.type?function(e){var t=[e],r=1,n=o._queue.get(r);for(;void 0!==n&&"read"===n.type;)t.push(n),r++,n=o._queue.get(r);var i=0;t.forEach((function(e){var r=e.args,n=r[r.length-1];r[r.length-1]=function(...e){n.apply(null,e),++i===t.length&&I((function(){t.forEach((function(){o._queue.shift()})),o._queue.length&&m()}))},b(e.fun,r)}))}(e):function(e){var t=e.args,r=t[t.length-1];t[t.length-1]=function(...e){r.apply(null,e),I((function(){o._queue.shift(),o._queue.length&&m()}))},b(e.fun,t)}(e)}function _(e){return function(...t){o._queue.push({fun:e,args:t,type:"write"}),1===o._queue.length&&I(m)}}function w(e){return function(...t){o._queue.push({fun:e,args:t,type:"read"}),1===o._queue.length&&I(m)}}function E(e){return("0000000000000000"+e).slice(-16)}function k(e,t){"destroy"in p?p.destroy(e,t):t(null)}At.has(y)?h=At.get(y):(h=new Map,At.set(y,h)),h.has(d)?(o=h.get(d),g()):h.set(d,S(n(p(d),e,(function(t){if(t)return h.delete(d),r(t);(o=h.get(d))._docCount=-1,o._queue=new u,"object"==typeof e.migrate?e.migrate.doMigrationOne(d,o,g):g()})))),a._remote=!1,a.type=function(){return"leveldb"},a._id=function(e){e(null,i)},a._info=function(e){var t={doc_count:o._docCount,update_seq:o._updateSeq,backend_adapter:ne(p)};return I((function(){e(null,t)}))},a._get=w((function(e,t,r){t=O(t),f.docStore.get(e,(function(e,n){if(e||!n)return r(ee(U,"missing"));var i;if(t.rev)i=t.latest?function(e,t){for(var r,n=t.rev_tree.slice();r=n.pop();){var i=r.pos,o=r.ids,a=o[0],s=o[1],u=o[2],c=0===u.length,f=r.history?r.history.slice():[];if(f.push({id:a,pos:i,opts:s}),c)for(var l=0,d=f.length;l<d;l++){var h=f[l];if(h.pos+"-"+h.id===e)return i+"-"+a}for(var p=0,y=u.length;p<y;p++)n.push({pos:i+1,ids:u[p],history:f})}throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}(t.rev,n):t.rev;else if(i=Mt(n),Bt(n,i))return r(ee(U,"deleted"));var o=n.rev_map[i];f.bySeqStore.get(E(o),(function(e,t){if(!t)return r(ee(U));if("_id"in t&&t._id!==n.id)return r(new Error("wrong doc returned"));if(t._id=n.id,"_rev"in t){if(t._rev!==i)return r(new Error("wrong doc returned"))}else t._rev=i;return r(null,{doc:t,metadata:n})}))}))})),a._getAttachment=function(e,t,r,n,i){var o=r.digest,a=r.content_type;f.binaryStore.get(o,(function(e,t){if(e)return"NotFoundError"!==e.name?i(e):i(null,n.binary?function(e){return fe([""],{type:e})}(a):"");n.binary?i(null,xt(t,a)):i(null,t.toString("base64"))}))},a._bulkDocs=_((function(e,r,n){var i=r.new_edits,s=new Array(e.docs.length),u=new Map,h=new Map,p=new Ot,y=0,g=o._updateSeq,v=e.docs,b=v.map((function(e){if(e._id&&Pe(e._id))return e;var t=Et(e,i,a.__opts);return t.metadata&&!t.metadata.rev_map&&(t.metadata.rev_map={}),t})),m=b.filter((function(e){return e.error}));if(m.length)return n(m[0]);function _(e,t){var r=Promise.resolve();e.forEach((function(e,t){r=r.then((function(){return new Promise((function(r,n){a._doCompactionNoLock(t,e,{ctx:p},(function(e){if(e)return n(e);r()}))}))}))})),r.then((function(){t()}),t)}function w(e){var t=new Map;u.forEach((function(e,r){t.set(r,function(e){var t=[];return _e(e.rev_tree,(function(e,r,n,i,o){"available"!==o.status||e||(t.push(r+"-"+n),o.status="missing")})),t}(e))})),_(t,e)}function k(){_(h,(function(e){if(e&&O(e),a.auto_compaction)return w(O);O()}))}function S(e,r,i,o,a,l,d,v){y+=l;var b=null,m=0;e.metadata.winningRev=r,e.metadata.deleted=i,e.data._id=e.metadata.id,e.data._rev=e.metadata.rev,o&&(e.data._deleted=!0),e.stemmedRevs.length&&h.set(e.metadata.id,e.stemmedRevs);var _,w,k,S=e.data._attachments?Object.keys(e.data._attachments):[];function x(e){m++,b||(e?v(b=e):m===S.length&&L())}function O(e,r,n,i){return function(o){!function(e,r,n,i,o){var a=e.data._attachments[n];delete a.data,a.digest=r,a.length=i.length;var s=e.metadata.id,u=e.metadata.rev;a.revpos=parseInt(u,10),j(s,u,r,(function(e,n){return e||0===i.length?o(e):n?(p.batch([{type:"put",prefix:f.binaryStore,key:r,value:t.from(i,"binary")}]),void o()):o(e)}))}(e,"md5-"+o,r,n,i)}}function A(e,t,r){return function(n){!function(e,t){var r="string"==typeof e,n=r?e.length:e.size,i=Math.min(32768,n),o=Math.ceil(n/i),a=0,s=r?new c:new c.ArrayBuffer,u=r?ge:ye;function f(){he(d)}function l(){var e=pe(s.end(!0));t(e),s.destroy()}function d(){var t=a*i,r=t+i;a++,u(s,e,t,r,a<o?f:l)}d()}(n,O(e,t,n,r))}}for(var R=0;R<S.length;R++){var T,M=S[R],B=e.data._attachments[M];if(B.stub)j(e.data._id,e.data._rev,B.digest,x);else if("string"==typeof B.data){try{k=B.data,T=atob(k)}catch(e){return void n(ee(H,"Attachment is not a valid base64 string"))}A(e,M,x)(T)}else _=B.data,w=A(e,M,x),de(_,w)}function L(){var t=e.metadata.rev_map[e.metadata.rev];if(t)return v();t=++g,e.metadata.rev_map[e.metadata.rev]=e.metadata.seq=t;var r=[{key:E(t),value:e.data,prefix:f.bySeqStore,type:"put"},{key:e.metadata.id,value:e.metadata,prefix:f.docStore,type:"put"}];p.batch(r),s[d]={ok:!0,id:e.metadata.id,rev:e.metadata.rev},u.set(e.metadata.id,e.metadata),v()}S.length||L()}var x={};function j(e,t,r,n){function i(n){var i=[e,t].join("@"),o={};return n?n.refs&&(o.refs=n.refs,o.refs[i]=!0):(o.refs={},o.refs[i]=!0),new Promise((function(e){p.batch([{type:"put",prefix:f.attachmentStore,key:r,value:o}]),e(!n)}))}var o=x[r]||Promise.resolve();x[r]=o.then((function(){return new Promise((function(e,t){p.get(f.attachmentStore,r,(function(r,n){if(r&&"NotFoundError"!==r.name)return t(r);e(n)}))})).then(i).then((function(e){n(null,e)}),n)}))}function O(e){if(e)return I((function(){n(e)}));p.batch([{prefix:f.metaStore,type:"put",key:"_local_last_update_seq",value:g},{prefix:f.metaStore,type:"put",key:"_local_doc_count",value:o._docCount+y}]),p.execute(o,(function(e){if(e)return n(e);o._docCount+=y,o._updateSeq=g,Tt.notify(d),I((function(){n(null,s)}))}))}if(!b.length)return n(null,[]);!function(e){var t=[];if(v.forEach((function(e){e&&e._attachments&&Object.keys(e._attachments).forEach((function(r){var n=e._attachments[r];n.stub&&t.push(n.digest)}))})),!t.length)return e();var r,n=0;t.forEach((function(i){!function(e,t){p.get(f.attachmentStore,e,(function(r){if(r){var n=ee(Z,"unknown stub attachment with digest "+e);t(n)}else t()}))}(i,(function(i){i&&!r&&(r=i),++n===t.length&&e(r)}))}))}((function(e){if(e)return n(e);!function(e){var t,r=0;function n(){if(++r===v.length)return e(t)}v.forEach((function(e){if(e._id&&Pe(e._id))return n();p.get(f.docStore,e._id,(function(r,i){r?"NotFoundError"!==r.name&&(t=r):u.set(e._id,i),n()}))}))}((function(e){if(e)return n(e);St(l,b,a,u,p,s,S,r,k)}))}))})),a._allDocs=function(e,t){return"keys"in e?function(e,t){var r=t.keys,n={offset:t.skip};return Promise.all(r.map((function(r){var i=Object.assign({key:r,deleted:"ok"},t);return["limit","skip","keys"].forEach((function(e){delete i[e]})),new Promise((function(o,a){e._allDocs(i,(function(e,i){if(e)return a(e);t.update_seq&&void 0!==i.update_seq&&(n.update_seq=i.update_seq),n.total_rows=i.total_rows,o(i.rows[0]||{key:r,error:"not_found"})}))}))}))).then((function(e){return n.rows=e,n}))}(this,e):w((function(e,t){e=O(e),function(e){o.isClosed()?e(new Error("database is closed")):e(null,o._docCount)}((function(r,n){if(r)return t(r);var i,a={},u=e.skip||0;if(e.startkey&&(a.gte=e.startkey),e.endkey&&(a.lte=e.endkey),e.key&&(a.gte=a.lte=e.key),e.descending){a.reverse=!0;var c=a.lte;a.lte=a.gte,a.gte=c}if("number"==typeof e.limit&&(i=e.limit),0===i||"gte"in a&&"lte"in a&&a.gte>a.lte){var l={total_rows:n,offset:e.skip,rows:[]};return e.update_seq&&(l.update_seq=o._updateSeq),t(null,l)}var d=[],h=f.docStore.readStream(a),p=s.obj((function(t,r,n){var o=t.value,a=Mt(o),s=Bt(o,a);if(s){if("ok"!==e.deleted)return void n()}else{if(u-- >0)return void n();if("number"==typeof i&&i--<=0)return h.unpipe(),h.destroy(),void n()}function c(t){var r={id:o.id,key:o.id,value:{rev:a}};if(e.include_docs){if(r.doc=t,r.doc._rev=r.value.rev,e.conflicts){var i=ke(o);i.length&&(r.doc._conflicts=i)}for(var u in r.doc._attachments)Object.prototype.hasOwnProperty.call(r.doc._attachments,u)&&(r.doc._attachments[u].stub=!0)}if(!1===e.inclusive_end&&o.id===e.endkey)return n();if(s){if("ok"!==e.deleted)return n();r.value.deleted=!0,r.doc=null}d.push(r),n()}if(e.include_docs){var l=o.rev_map[a];f.bySeqStore.get(E(l),(function(e,t){c(t)}))}else c()}),(function(r){Promise.resolve().then((function(){if(e.include_docs&&e.attachments)return Pt(d,f,e)})).then((function(){var r={total_rows:n,offset:e.skip,rows:d};e.update_seq&&(r.update_seq=o._updateSeq),t(null,r)}),t),r()})).on("unpipe",(function(){p.end()}));h.on("error",t),h.pipe(p)}))}))(e,t)},a._changes=function(e){if((e=O(e)).continuous){var t=d+":"+be();return Tt.addListener(d,t,a,e),Tt.notify(d),{cancel:function(){Tt.removeListener(d,t)}}}var r,n=e.descending,i=[],u=e.since||0,c=0,l={reverse:n};"limit"in e&&e.limit>0&&(r=e.limit),l.reverse||(l.start=E(e.since||0));var h=e.doc_ids&&new Set(e.doc_ids),p=re(e),y=new Map;function g(){e.done=!0,e.return_docs&&e.limit&&e.limit<i.length&&(i.length=e.limit),v.unpipe(b),v.destroy(),e.continuous||e.cancelled||(e.include_docs&&e.attachments&&e.return_docs?Pt(i,f,e).then((function(){e.complete(null,{results:i,last_seq:u})})):e.complete(null,{results:i,last_seq:u}))}var v=f.bySeqStore.readStream(l),b=s.obj((function(t,a,s){if(r&&c>=r)return g(),s();if(e.cancelled||e.done)return s();var l,d,v=(l=t.key,parseInt(l,10)),b=t.value;if(v===e.since&&!n)return s();if(h&&!h.has(b._id))return s();function m(t){var r=Mt(t);function n(r){var n=e.processChange(r,t,e);n.seq=t.seq;var o=p(n);if("object"==typeof o)return e.complete(o);o&&(c++,e.attachments&&e.include_docs?Pt([n],f,e).then((function(){e.onChange(n)})):e.onChange(n),e.return_docs&&i.push(n)),s()}if(t.seq!==v)return s();if(u=v,r===b._rev)return n(b);var o=t.rev_map[r];f.bySeqStore.get(E(o),(function(e,t){n(t)}))}if(d=y.get(b._id))return m(d);f.docStore.get(b._id,(function(t,r){if(e.cancelled||e.done||o.isClosed()||Pe(r.id))return s();y.set(b._id,r),m(r)}))}),(function(t){if(e.cancelled)return t();e.return_docs&&e.limit&&e.limit<i.length&&(i.length=e.limit),t()})).on("unpipe",(function(){b.end(),g()}));return v.pipe(b),{cancel:function(){e.cancelled=!0,g()}}},a._close=function(e){if(o.isClosed())return e(ee(V));o.close((function(t){if(t)e(t);else{h.delete(d);var r=ne(p),n=At.get(r),i=He.prefix+d+"-mrview-";[...n.keys()].filter(e=>e.includes(i)).forEach(e=>{var t=n.get(e);t.removeAllListeners(),t.close(),n.delete(e)}),e()}}))},a._getRevisionTree=function(e,t){f.docStore.get(e,(function(e,r){e?t(ee(U)):t(null,r.rev_tree)}))},a._doCompaction=_((function(e,t,r,n){a._doCompactionNoLock(e,t,r,n)})),a._doCompactionNoLock=function(e,t,r,n){if("function"==typeof r&&(n=r,r={}),!t.length)return n();var i=r.ctx||new Ot;i.get(f.docStore,e,(function(a,s){if(a)return n(a);var u=t.map((function(e){var t=s.rev_map[e];return delete s.rev_map[e],t}));_e(s.rev_tree,(function(e,r,n,i,o){var a=r+"-"+n;-1!==t.indexOf(a)&&(o.status="missing")}));var c=[];c.push({key:s.id,value:s,type:"put",prefix:f.docStore});var l,d={},h=0;function p(r){if(r&&(l=r),++h===t.length){if(l)return n(l);!function(){var r=Object.keys(d);if(!r.length)return y();var n,o=0;function a(e){e&&(n=e),++o===r.length&&y(n)}var s=new Map;t.forEach((function(t){s.set(e+"@"+t,!0)})),r.forEach((function(e){i.get(f.attachmentStore,e,(function(t,r){if(t)return"NotFoundError"===t.name?a():a(t);var n=Object.keys(r.refs||{}).filter((function(e){return!s.has(e)})),i={};n.forEach((function(e){i[e]=!0})),n.length?c.push({key:e,type:"put",value:{refs:i},prefix:f.attachmentStore}):c=c.concat([{key:e,type:"del",prefix:f.attachmentStore},{key:e,type:"del",prefix:f.binaryStore}]),a()}))}))}()}}function y(e){return e?n(e):(i.batch(c),r.ctx?n():void i.execute(o,n))}u.forEach((function(e){c.push({key:E(e),type:"del",prefix:f.bySeqStore}),i.get(f.bySeqStore,E(e),(function(e,t){if(e)return"NotFoundError"===e.name?p():p(e);Object.keys(t._attachments||{}).forEach((function(e){var r=t._attachments[e].digest;d[r]=!0})),p()}))}))}))},a._getLocal=function(e,t){f.localStore.get(e,(function(e,r){e?t(ee(U)):t(null,r)}))},a._putLocal=function(e,t,r){"function"==typeof t&&(r=t,t={}),t.ctx?a._putLocalNoLock(e,t,r):a._putLocalWithLock(e,t,r)},a._putLocalWithLock=_((function(e,t,r){a._putLocalNoLock(e,t,r)})),a._putLocalNoLock=function(e,t,r){delete e._revisions;var n=e._rev,i=e._id,a=t.ctx||new Ot;a.get(f.localStore,i,(function(s,u){if(s&&n)return r(ee(F));if(u&&u._rev!==n)return r(ee(F));e._rev=n?"0-"+(parseInt(n.split("-")[1],10)+1):"0-1";var c=[{type:"put",prefix:f.localStore,key:i,value:e}];a.batch(c);var l={ok:!0,id:e._id,rev:e._rev};if(t.ctx)return r(null,l);a.execute(o,(function(e){if(e)return r(e);r(null,l)}))}))},a._removeLocal=function(e,t,r){"function"==typeof t&&(r=t,t={}),t.ctx?a._removeLocalNoLock(e,t,r):a._removeLocalWithLock(e,t,r)},a._removeLocalWithLock=_((function(e,t,r){a._removeLocalNoLock(e,t,r)})),a._removeLocalNoLock=function(e,t,r){var n=t.ctx||new Ot;n.get(f.localStore,e._id,(function(i,a){if(i)return"NotFoundError"!==i.name?r(i):r(ee(U));if(a._rev!==e._rev)return r(ee(F));n.batch([{prefix:f.localStore,type:"del",key:e._id}]);var s={ok:!0,id:e._id,rev:"0-0"};if(t.ctx)return r(null,s);n.execute(o,(function(e){if(e)return r(e);r(null,s)}))}))},a._destroy=function(e,t){var r,n=ne(p);if(!At.has(n))return k(d,t);(r=At.get(n)).has(d)?(Tt.removeAllListeners(d),r.get(d).close((function(){r.delete(d),k(d,t)}))):k(d,t)}}function It(e,t){var r=Object.assign({db:h},e);Ct.call(this,r,t)}It.valid=function(){return"undefined"!=typeof localStorage},It.use_prefix=!0,"undefined"==typeof PouchDB?q("error",'localstorage adapter plugin error: Cannot find global "PouchDB" object! Did you remember to include pouchdb.js?'):PouchDB.plugin((function(e){e.adapter("localstorage",It,!0)}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:9,"double-ended-queue":28,events:39,"level-codec":56,levelup:78,"localstorage-down":80,ltgt:87,"readable-stream":102,"spark-md5":105,through2:139,uuid:146,vuvuzela:161}]},{},[164]);
40//# sourceMappingURL=pouchdb.localstorage.min.js.map
\No newline at end of file