All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.polymer.public.bower_components.pouchdb.dist.pouchdb.fruitdown.min.js Maven / Gradle / Ivy

The newest version!
// PouchDB fruitdown plugin 6.3.4
// Based on FruitDOWN: https://github.com/nolanlawson/fruitdown
// 
// (c) 2012-2017 Dale Harvey and the PouchDB team
// PouchDB may be freely distributed under the Apache license, version 2.0.
// For all details and documentation:
// http://pouchdb.com
!function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n||e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,s,a=e.length;o=r(e),s=new l(3*a/4-o),n=o>0?a-4:a;var u=0;for(t=0;t>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[63&e]}function a(e,t,n){for(var r,i=[],o=t;ou?u:s+16383));return 1===r?(t=e[n-1],i+=f[t>>2],i+=f[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=f[t>>10],i+=f[t>>4&63],i+=f[t<<2&63],i+="="),o.push(i),o.join("")}n.byteLength=i,n.toByteArray=o,n.fromByteArray=u;for(var f=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=h.length;d>>=0;var i=e.byteLength-t;if(i<0)throw new RangeError("'offset' is out of bounds");if(void 0===r)r=i;else if((r>>>=0)>i)throw new RangeError("'length' is out of bounds");return a?n.from(e.slice(t,t+r)):new n(new Uint8Array(e.slice(t,t+r)))}function i(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!n.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return a?n.from(e,t):new n(e,t)}function o(e,t,o){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return s(e)?r(e,t,o):"string"==typeof e?i(e,t):a?n.from(e):new n(e)}var s=e(34),a="function"==typeof n.alloc&&"function"==typeof n.allocUnsafe&&"function"==typeof n.from;t.exports=o}).call(this,e(8).Buffer)},{34:34,8:8}],8:[function(e,t,n){"use strict";function r(e){if(e>G)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(e)}return o(e,t,n)}function o(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?l(e,t,n):"string"==typeof e?f(e,t):h(e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function a(e,t,n){return s(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}function u(e){return s(e),r(e<0?0:0|d(e))}function f(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(e,t),o=r(n),s=o.write(e,t);return s!==n&&(o=o.slice(0,s)),o}function c(e){for(var t=e.length<0?0:0|d(e.length),n=r(t),i=0;i=G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");return 0|e}function p(e){return+e!=e&&(e=0),i.alloc(+e)}function y(e,t){if(i.isBuffer(e))return e.length;if(V(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return B(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,J(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}var f;if(i){var c=-1;for(f=n;fa&&(n=a-u),f=n;f>=0;f--){for(var l=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,f,c,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=e[i+1],f=e[i+2],128==(192&u)&&128==(192&f)&&(l=(15&o)<<12|(63&u)<<6|63&f)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=e[i+1],f=e[i+2],c=e[i+3],128==(192&u)&&128==(192&f)&&128==(192&c)&&(l=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&c)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return O(r)}function O(e){var t=e.length;if(t<=$)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,s){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,i){return t=+t,n>>>=0,i||N(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Y.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return t=+t,n>>>=0,i||N(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Y.write(e,t,n,r,52,8),n+8}function D(e){if(e=e.trim().replace(X,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function P(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function z(e){return H.toByteArray(D(e))}function K(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function V(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function J(e){return e!==e}var H=e(5),Y=e(31);n.Buffer=i,n.SlowBuffer=p,n.INSPECT_MAX_BYTES=50;var G=2147483647;n.kMaxLength=G,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.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."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,n){return o(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return a(e,t,n)},i.allocUnsafe=function(e){return u(e)},i.allocUnsafeSlow=function(e){return u(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},i.prototype.compare=function(e,t,n,r,o){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var s=o-r,a=n-t,u=Math.min(s,a),f=this.slice(r,o),c=e.slice(t,n),l=0;l>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),Y.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),Y.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),Y.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),Y.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(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},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(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},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(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},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(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},i.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s>2],i=(3&s)<<4;break;case 1:n+=e[i|s>>4],i=(15&s)<<2;break;case 2:n+=e[i|s>>6],n+=e[63&s],i=0}}return r%3&&(n+=e[i]),n},t.decode=function(e){for(var t=e.length,i=0,o=new r(~~(t/4*3)),s=0,a=0;a>4,s=u<<4&255;break;case 2:o[i++]=s|u>>2,s=u<<6&255;break;case 3:o[i++]=s|u}}return o},t},t.exports(i,t.exports)},{8:8}],11:[function(e,t,n){function r(e){o.call(this,e),this._options=e,this._iterator=null,this._operations=[]}var i=e(100),o=e(16).AbstractIterator;i.inherits(r,o),r.prototype.setDb=function(e){var t=this._iterator=e.iterator(this._options);this._operations.forEach(function(e){t[e.method].apply(t,e.args)})},r.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){r.prototype["_"+e]=function(){this._operation(e,arguments)}}),t.exports=r},{100:100,16:16}],12:[function(e,t,n){(function(n,r){function i(e){s.call(this,"string"==typeof e?e:""),this._db=void 0,this._operations=[],this._iterators=[]}var o=e(100),s=e(16).AbstractLevelDOWN,a=e(11);o.inherits(i,s),i.prototype.setDb=function(e){this._db=e,this._operations.forEach(function(t){e[t.method].apply(e,t.args)}),this._iterators.forEach(function(t){t.setDb(e)})},i.prototype._open=function(e,t){return r.nextTick(t)},i.prototype._operation=function(e,t){if(this._db)return this._db[e].apply(this._db,t);this._operations.push({method:e,args:t})},"put get del batch approximateSize".split(" ").forEach(function(e){i.prototype["_"+e]=function(){this._operation(e,arguments)}}),i.prototype._isBuffer=function(e){return n.isBuffer(e)},i.prototype._iterator=function(e){if(this._db)return this._db.iterator.apply(this._db,arguments);var t=new a(e);return this._iterators.push(t),t},t.exports=i,t.exports.DeferredIterator=a}).call(this,{isBuffer:e(35)},e(55))},{100:100,11:11,16:16,35:35,55:55}],13:[function(e,t,n){(function(e){function n(e){this._db=e,this._operations=[],this._written=!1}n.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},n.prototype.put=function(e,t){this._checkWritten();var n=this._db._checkKey(e,"key",this._db._isBuffer);if(n)throw n;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},n.prototype.del=function(e){this._checkWritten();var t=this._db._checkKey(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},n.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},n.prototype.write=function(t,n){if(this._checkWritten(),"function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("write() requires a callback argument");return"object"!=typeof t&&(t={}),this._written=!0,"function"==typeof this._write?this._write(n):"function"==typeof this._db._batch?this._db._batch(this._operations,t,n):void e.nextTick(n)},t.exports=n}).call(this,e(55))},{55:55}],14:[function(e,t,n){arguments[4][2][0].apply(n,arguments)},{2:2,55:55}],15:[function(e,t,n){(function(n,r){function i(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,this.status="new"}var o=e(18),s=e(14),a=e(13);i.prototype.open=function(e,t){var n=this,i=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"!=typeof e&&(e={}),e.createIfMissing=0!=e.createIfMissing,e.errorIfExists=!!e.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(e,function(e){if(e)return n.status=i,t(e);n.status="open",t()})):(this.status="open",r.nextTick(t))},i.prototype.close=function(e){var t=this,n=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(r){if(r)return t.status=n,e(r);t.status="closed",e()})):(this.status="closed",r.nextTick(e))},i.prototype.get=function(e,t,n){var i;if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("get() requires a callback argument");return(i=this._checkKey(e,"key",this._isBuffer))?n(i):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),t.asBuffer=0!=t.asBuffer,"function"==typeof this._get?this._get(e,t,n):void r.nextTick(function(){n(new Error("NotFound"))}))},i.prototype.put=function(e,t,n,i){var o;if("function"==typeof n&&(i=n),"function"!=typeof i)throw new Error("put() requires a callback argument");return(o=this._checkKey(e,"key",this._isBuffer))?i(o):(this._isBuffer(e)||(e=String(e)),null==t||this._isBuffer(t)||r.browser||(t=String(t)),"object"!=typeof n&&(n={}),"function"==typeof this._put?this._put(e,t,n,i):void r.nextTick(i))},i.prototype.del=function(e,t,n){var i;if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("del() requires a callback argument");return(i=this._checkKey(e,"key",this._isBuffer))?n(i):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,n):void r.nextTick(n))},i.prototype.batch=function(e,t,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(n=t),"function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return n(new Error("batch(array) requires an array argument"));t&&"object"==typeof t||(t={});for(var i,o,s=0,a=e.length;s>>=0,e-=1,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)+1}function s(e){if("number"!=typeof e){if(!a(e))return 16;e=e.length}return o(Math.min(Math.max(16,e),1073741824))}r.prototype.toArray=function(){for(var e=this._length,t=new Array(e),n=this._front,r=this._capacity,i=0;i1){var r=this._capacity;if(n+t>r){for(var i=0;i1){var r=this._capacity;if(t+n>r){for(var i=n-1;i>=0;i--){this._checkCapacity(t+1);var r=this._capacity,o=(this._front-1&r-1^r)-r;this[o]=arguments[i],t++,this._length=t,this._front=o}return t}for(var s=this._front,i=n-1;i>=0;i--){var o=(s-1&r-1^r)-r;this[o]=arguments[i],s=o}return this._front=s,this._length=t+n,t+n}if(0===n)return t;this._checkCapacity(t+1);var r=this._capacity,i=(this._front-1&r-1^r)-r;return this[i]=e,this._length=t+1,this._front=i,t+1},r.prototype.peekBack=function(){var e=this._length;if(0!==e){return this[this._front+e-1&this._capacity-1]}},r.prototype.peekFront=function(){if(0!==this._length)return this[this._front]},r.prototype.get=function(e){var t=e;if(t===(0|t)){var n=this._length;if(t<0&&(t+=n),!(t<0||t>=n))return this[this._front+t&this._capacity-1]}},r.prototype.isEmpty=function(){return 0===this._length},r.prototype.clear=function(){for(var e=this._length,t=this._front,n=this._capacity,r=0;rt){i(this,0,this,t,n+r&t-1)}};var a=Array.isArray;t.exports=r},{}],20:[function(e,t,n){function r(e,t,n){s(this,{type:e,name:e,cause:"string"!=typeof t?t:n,message:t&&"string"!=typeof t?t.message:t},"ewr")}function i(e,t){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),r.call(this,"CustomError",e,t)}function o(e,t,n){var o=function(n,i){r.call(this,t,n,i),"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,arguments.callee)};return o.prototype=n?new n:new i,o}var s=e(22);i.prototype=new Error,t.exports=function(e){var t=function(t,n){return o(e,t,n)};return{CustomError:i,FilesystemError:t("FilesystemError"),createError:t}}},{22:22}],21:[function(e,t,n){var r=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={},r.forEach(function(e){t.exports.errno[e.errno]=e,t.exports.code[e.code]=e}),t.exports.custom=e(20)(t.exports),t.exports.create=t.exports.custom.createError},{20:20}],22:[function(e,t,n){!function(e,n,r){void 0!==t&&t.exports?t.exports=r():n.prr=r()}(0,this,function(){var e="function"==typeof Object.defineProperty?function(e,t,n){return Object.defineProperty(e,t,n),e}:function(e,t,n){return e[t]=n.value,e},t=function(e,t){var n="object"==typeof t,r=!n&&"string"==typeof t,i=function(e){return n?!!t[e]:!!r&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}};return function(n,r,i,o){var s;if(o=t(i,o),"object"==typeof r){for(s in r)Object.hasOwnProperty.call(r,s)&&(o.value=r[s],e(n,s,o));return n}return e(n,r,o)}})},{}],23:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,u,f;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(s(n))for(o=Array.prototype.slice.call(arguments,1),f=n.slice(),r=f.length,u=0;u0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=o;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],24:[function(e,t,n){(function(e,n){"use strict";function r(e){this._dbName=e}function i(e,t){if(u[e])return a(function(){t(null,u[e])});var n=indexedDB.open(e,1);f[e]=n,n.onupgradeneeded=function(e){var t=e.target.result;1!==e.oldVersion&&t.createObjectStore(s).createIndex("fakeKey","fakeKey")},n.onsuccess=function(n){var r=u[e]=n.target.result;t(null,r)},n.onerror=function(e){console.error("Failed to open indexedDB, are you in private browsing mode?"),t(e)}}function o(e,t){try{return{txn:e.transaction(s,t)}}catch(e){return{error:e}}}var s="fruitdown",a=n.setImmediate||e.nextTick,u={},f={};r.prototype.getKeys=function(e){i(this._dbName,function(t,n){if(t)return e(t);var r=o(n,"readonly");if(r.error)return e(r.error);var i=r.txn,a=i.objectStore(s);i.onerror=e;var u=[];i.oncomplete=function(){e(null,u.sort())},a.index("fakeKey").openKeyCursor().onsuccess=function(e){var t=e.target.result;t&&(u.push(t.primaryKey),t.continue())}})},r.prototype.put=function(e,t,n){i(this._dbName,function(r,i){if(r)return n(r);var a=o(i,"readwrite");if(a.error)return n(a.error);var u=a.txn,f=u.objectStore(s),c="string"==typeof t?t:t.toString();u.onerror=n,u.oncomplete=function(){n()},f.put({value:c,fakeKey:0},e)})},r.prototype.get=function(e,t){i(this._dbName,function(n,r){if(n)return t(n);var i=o(r,"readonly");if(i.error)return t(i.error);var a,u=i.txn,f=u.objectStore(s);f.get(e).onsuccess=function(e){e.target.result&&(a=e.target.result.value)},u.onerror=t,u.oncomplete=function(){t(null,a)}})},r.prototype.remove=function(e,t){i(this._dbName,function(n,r){if(n)return t(n);var i=o(r,"readwrite");if(i.error)return t(i.error);var a=i.txn;a.objectStore(s).delete(e),a.onerror=t,a.oncomplete=function(){t()}})},r.destroy=function(e,t){a(function(){f[e]&&f[e].result&&(f[e].result.close(),delete u[e]);var n=indexedDB.deleteDatabase(e);n.onsuccess=function(){f[e]&&(f[e]=null),t(null)},n.onerror=t})},t.exports=r}).call(this,e(55),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{55:55}],25:[function(e,t,n){(function(n){"use strict";function r(e){this._store=new u(e),this._queue=new f}var i=new RegExp("^ArrayBuffer:"),o=new RegExp("^Uint8Array:"),s=new RegExp("^Buff:"),a=e(28),u=e(24),f=e(27),c=e(10);r.prototype.sequentialize=function(e,t){this._queue.add(t,e)},r.prototype.init=function(e){var t=this;t.sequentialize(e,function(e){t._store.getKeys(function(n,r){return n?e(n):(t._keys=r,e())})})},r.prototype.keys=function(e){var t=this;t.sequentialize(e,function(e){e(null,t._keys.slice())})},r.prototype.setItem=function(e,t,r){var i=this;i.sequentialize(r,function(r){n.isBuffer(t)&&(t="Buff:"+c.encode(t));var o=a.sortedIndexOf(i._keys,e);i._keys[o]!==e&&i._keys.splice(o,0,e),i._store.put(e,t,r)})},r.prototype.getItem=function(e,t){var n=this;n.sequentialize(t,function(t){n._store.get(e,function(e,n){return e?t(e):void 0===n||null===n?t(new Error("NotFound")):(void 0!==n&&(s.test(n)?n=c.decode(n.substring("Buff:".length)):i.test(n)?(n=n.substring("ArrayBuffer:".length),n=new ArrayBuffer(atob(n).split("").map(function(e){return e.charCodeAt(0)}))):o.test(n)&&(n=n.substring("Uint8Array:".length),n=new Uint8Array(atob(n).split("").map(function(e){return e.charCodeAt(0)})))),void t(null,n))})})},r.prototype.removeItem=function(e,t){var n=this;n.sequentialize(t,function(t){var r=a.sortedIndexOf(n._keys,e);n._keys[r]===e?(n._keys.splice(r,1),n._store.remove(e,function(e){if(e)return t(e);t()})):t()})},r.prototype.length=function(e){var t=this;t.sequentialize(e,function(e){e(null,t._keys.length)})},t.exports=r}).call(this,{isBuffer:e(35)})},{10:10,24:24,27:27,28:28,35:35}],26:[function(e,t,n){(function(n,r,i){"use strict";function o(e,t){c.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._limit=t.limit,this._count=0,this.onInitCompleteListeners=[]}function s(e){if(!(this instanceof s))return new s(e);f.call(this,e),this.container=new l(e)}function a(e,t){if(null===e||void 0===e)return new Error(t+" cannot be `null` or `undefined`");if(null===e||void 0===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(i.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")}var u=e(33),f=e(3).AbstractLevelDOWN,c=e(3).AbstractIterator,l=e(25),h=e(24),d=e(28),p=r.setImmediate||n.nextTick;u(o,c),o.prototype._init=function(e){p(function(){e()})},o.prototype._next=function(e){function t(){if(n._pos===n._keys.length||n._pos<0)return e();var t=n._keys[n._pos];return n._endkey&&(n._reverse?tn._endkey)?e():n._limit&&n._limit>0&&n._count++>=n._limit?e():n._lt&&t>=n._lt||n._lte&&t>n._lte||n._gt&&t<=n._gt||n._gte&&t=n._keys.length||o<0?void 0:n._keys[o];n._pos=o,n._reverse?(n._exclusiveStart||s!==n._startkey)&&n._pos--:n._exclusiveStart&&s===n._startkey&&n._pos++}else n._pos=n._reverse?n._keys.length-1:0;t(),n.initCompleted=!0;for(var a=-1;++a-1){r=JSON.parse(r).data}n(null,r)})},s.prototype._del=function(e,t,n){var r=a(e,"key");if(r)return p(function(){n(r)});i.isBuffer(e)||(e=String(e)),this.container.removeItem(e,n)},s.prototype._batch=function(e,t,n){var r=this;p(function(){function o(){++l===e.length&&n(c)}var s,u,f,c,l=0;if(Array.isArray(e)&&e.length)for(var h=0;h>>1,e[n]>1,c=-7,l=n?i-1:0,h=n?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+l],l+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=f}return(d?-1:1)*s*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var s,a,u,f=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+l>=1?h/u:h*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;e[n+d]=255&s,d+=p,s/=256,f-=8);e[n+d-p]|=128*y}},{}],32:[function(e,t,n){(function(e){"use strict";function n(){c=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e-1?t.encodeKey(e[r],e):e[r]}),n},r.prototype.createStreamDecoder=function(e){var t=this;return e.keys&&e.values?function(n,r){return{key:t.decodeKey(n,e),value:t.decodeValue(r,e)}}:e.keys?function(n){return t.decodeKey(n,e)}:e.values?function(n,r){return t.decodeValue(r,e)}:function(){}},r.prototype.keyAsBuffer=function(e){return this._keyEncoding(e).buffer},r.prototype.valueAsBuffer=function(e){return this._valueEncoding(e).buffer}},{41:41}],41:[function(e,t,n){(function(e){function t(e){return e}function r(t){return void 0===t||null===t||e.isBuffer(t)}n.utf8=n["utf-8"]={encode:function(e){return r(e)?e:String(e)},decode:function(e){return"string"==typeof e?e:String(e)},buffer:!1,type:"utf8"},n.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},n.binary={encode:function(t){return r(t)?t:new e(t)},decode:t,buffer:!0,type:"binary"},n.none={encode:function(e){
return e},decode:function(e){return e},buffer:!1,type:"id"},n.id=n.none,["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(t){n[t]={encode:function(n){return r(n)?n:new e(n,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t}})}).call(this,e(8).Buffer)},{8:8}],42:[function(e,t,n){var r=e(21).create,i=r("LevelUPError"),o=r("NotFoundError",i);o.prototype.notFound=!0,o.prototype.status=404,t.exports={LevelUPError:i,InitializationError:r("InitializationError",i),OpenError:r("OpenError",i),ReadError:r("ReadError",i),WriteError:r("WriteError",i),NotFoundError:o,EncodingError:r("EncodingError",i)}},{21:21}],43:[function(e,t,n){function r(e,t){if(!(this instanceof r))return new r(e,t);o.call(this,s(t,{objectMode:!0})),this._iterator=e,this._destroyed=!1,this._decoder=null,t&&t.decoder&&(this._decoder=t.decoder),this.on("end",this._cleanup.bind(this))}var i=e(33),o=e(63).Readable,s=e(44),a=e(42).EncodingError;t.exports=r,i(r,o),r.prototype._read=function(){var e=this;this._destroyed||this._iterator.next(function(t,n,r){if(!e._destroyed){if(t)return e.emit("error",t);if(void 0===n&&void 0===r)e.push(null);else{if(!e._decoder)return e.push({key:n,value:r});try{var r=e._decoder(n,r)}catch(t){return e.emit("error",new a(t)),void e.push(null)}e.push(r)}}})},r.prototype.destroy=r.prototype._cleanup=function(){var e=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(t){if(t)return e.emit("error",t);e.emit("close")}))}},{33:33,42:42,44:44,63:63}],44:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{18:18}],45:[function(e,t,n){function r(e,t){this._levelup=e,this._codec=t,this.batch=e.db.batch(),this.ops=[],this.length=0}var i=e(47),o=e(42).WriteError,s=i.getOptions,a=i.dispatchError;r.prototype.put=function(e,t,n){n=s(n);var r=this._codec.encodeKey(e,n),i=this._codec.encodeValue(t,n);try{this.batch.put(r,i)}catch(e){throw new o(e)}return this.ops.push({type:"put",key:r,value:i}),this.length++,this},r.prototype.del=function(e,t){t=s(t);var n=this._codec.encodeKey(e,t);try{this.batch.del(n)}catch(e){throw new o(e)}return this.ops.push({type:"del",key:n}),this.length++,this},r.prototype.clear=function(){try{this.batch.clear()}catch(e){throw new o(e)}return this.ops=[],this.length=0,this},r.prototype.write=function(e){var t=this._levelup,n=this.ops;try{this.batch.write(function(r){if(r)return a(t,new o(r),e);t.emit("batch",n),e&&e()})}catch(e){throw new o(e)}},t.exports=r},{42:42,47:47}],46:[function(e,t,n){(function(n){function r(e,t){return"function"==typeof e?e:t}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var o;if(f.call(this),this.setMaxListeners(1/0),"function"==typeof e?(t="object"==typeof t?t:{},t.db=e,e=null):"object"==typeof e&&"function"==typeof e.db&&(t=e,e=null),"function"==typeof t&&(r=t,t={}),(!t||"function"!=typeof t.db)&&"string"!=typeof e){if(o=new E("Must provide a location for the database"),r)return n.nextTick(function(){r(o)});throw o}t=A(t),this.options=h(O,t),this._codec=new B(this.options),this._status="new",d(this,"location",e,"e"),this.open(r)}function o(e,t,n){if(!e._isOpening()&&!e.isOpen())return L(e,new b("Database is not open"),n),!0}function s(e,t,n){L(e,new v(t),n)}function a(e,t,n){L(e,new b(t),n)}function u(e){return function(t,n){j()[e](t,n||function(){})}}var f=e(23).EventEmitter,c=e(100).inherits,l=e(100).deprecate,h=e(50),d=e(56),p=e(12),y=e(43),g=e(42),v=g.WriteError,b=g.ReadError,_=g.NotFoundError,m=g.OpenError,w=g.EncodingError,E=g.InitializationError,S=g.LevelUPError,k=e(47),x=e(45),B=e(48),A=k.getOptions,O=k.defaultOptions,j=e(6),L=k.dispatchError;k.isDefined;c(i,f),i.prototype.open=function(e){var t,r,i=this;if(this.isOpen())return e&&n.nextTick(function(){e(null,i)}),this;if(this._isOpening())return e&&this.once("open",function(){e(null,i)});if(this.emit("opening"),this._status="opening",this.db=new p(this.location),"function"!=typeof this.options.db&&"function"!=typeof j)throw new S("missing db factory, you need to set options.db");t=this.options.db||j(),r=t(this.location),r.open(this.options,function(t){if(t)return L(i,new m(t),e);i.db.setDb(r),i.db=r,i._status="open",e&&e(null,i),i.emit("open"),i.emit("ready")})},i.prototype.close=function(e){var t=this;if(this.isOpen())this._status="closing",this.db.close(function(){t._status="closed",t.emit("closed"),e&&e.apply(null,arguments)}),this.emit("closing"),this.db=new p(this.location);else{if("closed"==this._status&&e)return n.nextTick(e);"closing"==this._status&&e?this.once("closed",e):this._isOpening()&&this.once("open",function(){t.close(e)})}},i.prototype.isOpen=function(){return"open"==this._status},i.prototype._isOpening=function(){return"opening"==this._status},i.prototype.isClosed=function(){return/^clos/.test(this._status)},i.prototype.get=function(e,t,n){var i,s=this;if(n=r(t,n),!o(this,t,n)){if(null===e||void 0===e||"function"!=typeof n)return a(this,"get() requires key and callback arguments",n);t=k.getOptions(t),i=this._codec.encodeKey(e,t),t.asBuffer=this._codec.valueAsBuffer(t),this.db.get(i,t,function(r,i){if(r)return r=/notfound/i.test(r)||r.notFound?new _("Key not found in database ["+e+"]",r):new b(r),L(s,r,n);if(n){try{i=s._codec.decodeValue(i,t)}catch(e){return n(new w(e))}n(null,i)}})}},i.prototype.put=function(e,t,n,i){var a,u,f=this;if(i=r(n,i),null===e||void 0===e)return s(this,"put() requires a key argument",i);o(this,n,i)||(n=A(n),a=this._codec.encodeKey(e,n),u=this._codec.encodeValue(t,n),this.db.put(a,u,n,function(n){if(n)return L(f,new v(n),i);f.emit("put",e,t),i&&i()}))},i.prototype.del=function(e,t,n){var i,a=this;if(n=r(t,n),null===e||void 0===e)return s(this,"del() requires a key argument",n);o(this,t,n)||(t=A(t),i=this._codec.encodeKey(e,t),this.db.del(i,t,function(t){if(t)return L(a,new v(t),n);a.emit("del",e),n&&n()}))},i.prototype.batch=function(e,t,n){var i,a=this;return arguments.length?(n=r(t,n),Array.isArray(e)?void(o(this,t,n)||(t=A(t),i=a._codec.encodeBatch(e,t),i=i.map(function(e){return e.type||void 0===e.key||void 0===e.value||(e.type="put"),e}),this.db.batch(i,t,function(t){if(t)return L(a,new v(t),n);a.emit("batch",e),n&&n()}))):s(this,"batch() requires an array argument",n)):new x(this,this._codec)},i.prototype.approximateSize=l(function(e,t,n,i){var o,s,u=this;if(i=r(n,i),n=A(n),null===e||void 0===e||null===t||void 0===t||"function"!=typeof i)return a(this,"approximateSize() requires start, end and callback arguments",i);o=this._codec.encodeKey(e,n),s=this._codec.encodeKey(t,n),this.db.approximateSize(o,s,function(e,t){if(e)return L(u,new m(e),i);i&&i(null,t)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),i.prototype.readStream=i.prototype.createReadStream=function(e){return e=h({keys:!0,values:!0},this.options,e),e.keyEncoding=e.keyEncoding,e.valueEncoding=e.valueEncoding,e=this._codec.encodeLtgt(e),e.keyAsBuffer=this._codec.keyAsBuffer(e),e.valueAsBuffer=this._codec.valueAsBuffer(e),"number"!=typeof e.limit&&(e.limit=-1),new y(this.db.iterator(e),h(e,{decoder:this._codec.createStreamDecoder(e)}))},i.prototype.keyStream=i.prototype.createKeyStream=function(e){return this.createReadStream(h(e,{keys:!0,values:!1}))},i.prototype.valueStream=i.prototype.createValueStream=function(e){return this.createReadStream(h(e,{keys:!1,values:!0}))},i.prototype.toString=function(){return"LevelUP"},t.exports=i,t.exports.errors=e(42),t.exports.destroy=l(u("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),t.exports.repair=l(u("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(this,e(55))},{100:100,12:12,23:23,42:42,43:43,45:45,47:47,48:48,50:50,55:55,56:56,6:6}],47:[function(e,t,n){function r(e){return"string"==typeof e&&(e={valueEncoding:e}),"object"!=typeof e&&(e={}),e}function i(e,t,n){"function"==typeof n?n(t):e.emit("error",t)}function o(e){return void 0!==e}var s=(e(50),{createIfMissing:!0,errorIfExists:!1,keyEncoding:"utf8",valueEncoding:"utf8",compression:!0});t.exports={defaultOptions:s,getOptions:r,dispatchError:i,isDefined:o}},{50:50}],48:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{40:40,49:49}],49:[function(e,t,n){(function(e){function t(e){return e}function r(t){return void 0===t||null===t||e.isBuffer(t)}n.utf8=n["utf-8"]={encode:function(e){return r(e)?e:String(e)},decode:t,buffer:!1,type:"utf8"},n.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},n.binary={encode:function(t){return r(t)?t:new e(t)},decode:t,buffer:!0,type:"binary"},n.id={encode:function(e){return e},decode:function(e){return e},buffer:!1,type:"id"},["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(t){n[t]={encode:function(n){return r(n)?n:new e(n,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t}})}).call(this,e(8).Buffer)},{8:8}],50:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{18:18}],51:[function(e,t,n){"use strict";function r(){}function i(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=b,this.queue=[],this.outcome=void 0,e!==r&&u(this,e)}function o(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function s(e,t,n){p(function(){var r;try{r=t(n)}catch(t){return y.reject(e,t)}r===e?y.reject(e,new TypeError("Cannot resolve promise with itself")):y.resolve(e,r)})}function a(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function u(e,t){function n(t){o||(o=!0,y.reject(e,t))}function r(t){o||(o=!0,y.resolve(e,t))}function i(){t(r,n)}var o=!1,s=f(i);"error"===s.status&&n(s.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function c(e){return e instanceof this?e:y.resolve(new this(r),e)}function l(e){var t=new this(r);return y.reject(t,e)}function h(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,a=-1,u=new this(r);++an?1:0};var s=n.lowerBoundKey=function(e){return i(e,"gt")||i(e,"gte")||i(e,"min")||(e.reverse?i(e,"end"):i(e,"start"))||void 0},a=n.lowerBound=function(e,t){var n=s(e);return n?e[n]:t},u=n.lowerBoundInclusive=function(e){return!t(e,"gt")},f=n.upperBoundInclusive=function(e){return!t(e,"lt")},c=n.lowerBoundExclusive=function(e){return!u(e)},l=n.upperBoundExclusive=function(e){return!f(e)},h=n.upperBoundKey=function(e){return i(e,"lt")||i(e,"lte")||i(e,"max")||(e.reverse?i(e,"start"):i(e,"end"))||void 0},d=n.upperBound=function(e,t){var n=h(e);return n?e[n]:t};n.start=function(e,t){return e.reverse?d(e,t):a(e,t)},n.end=function(e,t){return e.reverse?a(e,t):d(e,t)},n.startInclusive=function(e){return e.reverse?f(e):u(e)},n.endInclusive=function(e){return e.reverse?u(e):f(e)},n.toLtgt=function(e,r,i,s,a){r=r||{},i=i||o;var u=arguments.length>3,f=n.lowerBoundKey(e),c=n.upperBoundKey(e);return f?"gt"===f?r.gt=i(e.gt,!1):r.gte=i(e[f],!1):u&&(r.gte=i(s,!1)),c?"lt"===c?r.lt=i(e.lt,!0):r.lte=i(e[c],!0):u&&(r.lte=i(a,!0)),null!=e.reverse&&(r.reverse=!!e.reverse),t(r,"max")&&delete r.max,t(r,"min")&&delete r.min,t(r,"start")&&delete r.start,t(r,"end")&&delete r.end,r},n.contains=function(e,t,i){i=i||n.compare;var o=a(e);if(r(o)){var s=i(t,o);if(s<0||0===s&&c(e))return!1}var u=d(e);if(r(u)){var s=i(t,u);if(s>0||0===s&&l(e))return!1}return!0},n.filter=function(e,t){return function(r){return n.contains(e,r,t)}}}).call(this,{isBuffer:e(35)})},{35:35}],54:[function(e,t,n){(function(e){"use strict";function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s1)for(var n=1;n0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||i||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(e),d(e,t);else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=j)e=j;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function f(e,t){var n=null;return k.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function c(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?l(e):m(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?n.nextTick(function(){h(e)}):h(e))}function h(e){e.emit("readable")}function d(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){p(e,t)}))}function p(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length0)return;if(0===r.pipesCount)return r.flowing=!1,void(x.listenerCount(e,"data")>0&&b(e));r.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function b(e,t){if(e._readableState.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=B.prototype.pipe,e.on=e.addListener=B.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?n.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function _(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!e||e>=i)n=o?r.join(""):k.concat(r,i),r.length=0;else if(e0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;n0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(0===(e=u(e,t))&&t.ended)return n=null,t.length>0&&t.decoder&&(n=_(e,t),t.length-=n.length),0===t.length&&m(this),n;var i=t.needReadable;return t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=u(r,t)),n=e>0?_(e,t):null,null===n&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&m(this),n},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function r(e){e===c&&o()}function i(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),c.removeListener("end",i),c.removeListener("end",o),e._writableState&&!e._writableState.needDrain||p()}function s(t){f(),e.removeListener("error",s),0===x.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),f()}function u(){e.removeListener("close",a),f()}function f(){c.unpipe(e)}var c=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1;var h=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,d=h?i:o;l.endEmitted?n.nextTick(d):c.once("end",d),e.on("unpipe",r);var p=y(c);return e.on("drain",p),e._events&&e._events.error?S(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",c),l.flowing||(this.on("readable",v),l.flowing=!0,n.nextTick(function(){g(c)})),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1;for(var i=0;i>>25)+r|0,
o+=(n&r|~n&i)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[2]+606105819|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[5]+1200080426|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[6]-1473231341|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[10]-42063|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[13]-40341101|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[14]-1502002290|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&o|i&~o)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[6]-1069501632|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[11]+643717713|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[10]+38016083|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[15]-660478335|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[14]-1019803690|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[3]-187363961|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[2]-51403784|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[7]+1735328473|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^o)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[8]-2022574463|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[11]+1839030562|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[4]+1272893353|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[7]-155497632|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[0]-358537222|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[3]-722521979|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[12]-421815835|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[15]+530742520|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~o))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[7]+1126891415|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[14]-1416354905|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[3]-1894986606|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[10]-1051523|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[15]-30611744|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[6]-1560198380|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[11]-1120210379|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[2]+718787259|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function r(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function i(e){var r,i,o,s,a,u,f=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=f;r+=64)t(c,n(e.substring(r-64,r)));for(e=e.substring(r-64),i=e.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r>2]|=e.charCodeAt(r)<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(t(c,o),r=0;r<16;r+=1)o[r]=0;return s=8*f,s=s.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,t(c,o),c}function o(e){var n,i,o,s,a,u,f=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=f;n+=64)t(c,r(e.subarray(n-64,n)));for(e=n-64>2]|=e[n]<<(n%4<<3);if(o[n>>2]|=128<<(n%4<<3),n>55)for(t(c,o),n=0;n<16;n+=1)o[n]=0;return s=8*f,s=s.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,t(c,o),c}function s(e){var t,n="";for(t=0;t<4;t+=1)n+=p[e>>8*t+4&15]+p[e>>8*t&15];return n}function a(e){var t;for(t=0;t>16)+(t>>16)+(n>>16)<<16|65535&n},"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return e=0|e||0,e<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var i,o,s,a,u=this.byteLength,f=t(n,u),c=u;return r!==e&&(c=t(r,u)),f>c?new ArrayBuffer(0):(i=c-f,o=new ArrayBuffer(i),s=new Uint8Array(o),a=new Uint8Array(this,f,i),s.set(a),o)}}(),d.prototype.append=function(e){return this.appendBinary(u(e)),this},d.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var r,i=this._buff.length;for(r=64;r<=i;r+=64)t(this._hash,n(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},d.prototype.end=function(e){var t,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),n=a(this._hash),e&&(n=h(n)),this.reset(),n},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},d.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(e,n){var r,i,o,s=n;if(e[s>>2]|=128<<(s%4<<3),s>55)for(t(this._hash,e),s=0;s<16;s+=1)e[s]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,e[14]=i,e[15]=o,t(this._hash,e)},d.hash=function(e,t){return d.hashBinary(u(e),t)},d.hashBinary=function(e,t){var n=i(e),r=a(n);return t?h(r):r},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(e){var n,i=l(this._buff.buffer,e,!0),o=i.length;for(this._length+=e.byteLength,n=64;n<=o;n+=64)t(this._hash,r(i.subarray(n-64,n)));return this._buff=n-64>2]|=r[t]<<(t%4<<3);return this._finish(o,i),n=a(this._hash),e&&(n=h(n)),this.reset(),n},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var e=d.prototype.getState.call(this);return e.buff=c(e.buff),e},d.ArrayBuffer.prototype.setState=function(e){return e.buff=f(e.buff,!0),d.prototype.setState.call(this,e)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(e,t){var n=o(new Uint8Array(e)),r=a(n);return t?h(r):r},d})},{}],66:[function(e,t,n){function r(){i.call(this)}t.exports=r;var i=e(23).EventEmitter;e(33)(r,i),r.Readable=e(77),r.Writable=e(79),r.Duplex=e(67),r.Transform=e(78),r.PassThrough=e(76),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function r(){f.readable&&f.resume&&f.resume()}function o(){c||(c=!0,e.end())}function s(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){f.removeListener("data",n),e.removeListener("drain",r),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),e.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),e.removeListener("close",u)}var f=this;f.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(f.on("end",o),f.on("close",s));var c=!1;return f.on("error",a),e.on("error",a),f.on("end",u),f.on("close",u),e.on("close",u),e.emit("pipe",f),e}},{23:23,33:33,67:67,76:76,77:77,78:78,79:79}],67:[function(e,t,n){t.exports=e(68)},{68:68}],68:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);f.call(this,e),c.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",i)}function i(){this.allowHalfOpen||this._writableState.ended||s(o,this)}function o(e){e.end()}var s=e(54),a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var u=e(9);u.inherits=e(33);var f=e(70),c=e(72);u.inherits(r,f);for(var l=a(c.prototype),h=0;h0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===q.prototype||(t=i(t)),r?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?c(e,s,t,!1):b(e,s)):c(e,s,t,!1))):r||(s.reading=!1)}return h(s)}function c(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&g(e)),b(e,t)}function l(e,t){var n;return o(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e){return!e.ended&&(e.needReadable||e.length=J?e=J:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(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=d(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function y(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,g(e)}}function g(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R(v,e):v(e))}function v(e){P("emit readable"),e.emit("readable"),k(e)}function b(e,t){t.readingMore||(t.readingMore=!0,R(_,e,t))}function _(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=B(e,t.buffer,t.decoder),n}function B(e,t,n){var r;return eo.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++r}return t.length-=r,i}function O(e,t){var n=q.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,s),0===(e-=s)){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}function j(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,R(L,t,e))}function L(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function C(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):g(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&j(this),null;var r=t.needReadable;P("need readable",r),(0===t.length||t.length-e0?x(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&j(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(e,t){function r(e,t){P("onunpipe"),e===h&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function i(){P("onend"),e.end()}function o(){P("cleanup"),e.removeListener("close",f),e.removeListener("finish",c),e.removeListener("drain",g),e.removeListener("error",u),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",l),h.removeListener("data",a),v=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function a(t){P("ondata"),b=!1,!1!==e.write(t)||b||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==C(d.pipes,e))&&!v&&(P("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,b=!0),h.pause())}function u(t){P("onerror",t),l(),e.removeListener("error",u),0===N(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",c),l()}function c(){P("onfinish"),e.removeListener("close",f),l()}function l(){P("unpipe"),h.unpipe(e)}var h=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,P("pipe count=%d opts=%j",d.pipesCount,t);var p=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,y=p?i:l;d.endEmitted?R(y):h.once("end",y),e.on("unpipe",r);var g=m(h);e.on("drain",g);var v=!1,b=!1;return h.on("data",a),s(e,"error",u),e.once("close",f),e.once("finish",c),e.emit("pipe",h),d.flowing||(P("pipe resume"),h.resume()),e},u.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?setImmediate:A;f.WritableState=u;var L=e(9);L.inherits=e(33);var C={deprecate:e(97)},R=e(75),T=e(64).Buffer,M=r.Uint8Array||function(){},N=e(74);L.inherits(f,R),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:C.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(f,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||e&&e._writableState instanceof u}})):I=function(e){return e instanceof this},f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},f.prototype.write=function(e,t,n){var r=this._writableState,i=!1,u=s(e)&&!r.objectMode;return u&&!T.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(n=t,t=null),u?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=a),r.ended?c(this,n):(u||l(this,r,e,n))&&(r.pendingcb++,i=d(this,r,u,e,t,n)),i},f.prototype.cork=function(){this._writableState.corked++},f.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||m(this,e))},f.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},f.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},f.prototype._writev=null,f.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||x(this,r,n)},Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),f.prototype.destroy=N.destroy,f.prototype._undestroy=N.undestroy,f.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e(55),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{33:33,54:54,55:55,64:64,68:68,74:74,75:75,9:9,97:97}],73:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){e.copy(t,n)}var o=e(64).Buffer;t.exports=function(){function e(){r(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,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)i(n.data,t,r),r+=n.data.length,n=n.next;return t},e}()},{64:64}],74:[function(e,t,n){"use strict";function r(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(r||i)return void(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||s(o,this,e));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(s(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}var s=e(54);t.exports={
destroy:r,undestroy:i}},{54:54}],75:[function(e,t,n){t.exports=e(23).EventEmitter},{23:23}],76:[function(e,t,n){t.exports=e(77).PassThrough},{77:77}],77:[function(e,t,n){n=t.exports=e(70),n.Stream=n,n.Readable=n,n.Writable=e(72),n.Duplex=e(68),n.Transform=e(71),n.PassThrough=e(69)},{68:68,69:69,70:70,71:71,72:72}],78:[function(e,t,n){t.exports=e(77).Transform},{77:77}],79:[function(e,t,n){t.exports=e(72)},{72:72}],80:[function(e,t,n){"use strict";function r(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}}function i(e){var t=r(e);if("string"!=typeof t&&(b.isEncoding===_||!_(e)))throw new Error("Unknown encoding: "+e);return t||e}function o(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=h,this.end=d,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=p,this.end=y,t=3;break;default:return this.write=g,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=b.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function a(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function u(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(n+2)}}function f(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n: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 c(e,t){var n=a(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function h(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?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-n))}function y(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}var b=e(64).Buffer,_=b.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}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=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,i)}return t},f.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},f.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{8:8}],82:[function(e,t,n){arguments[4][68][0].apply(n,arguments)},{33:33,54:54,68:68,84:84,86:86,9:9}],83:[function(e,t,n){arguments[4][69][0].apply(n,arguments)},{33:33,69:69,85:85,9:9}],84:[function(e,t,n){arguments[4][70][0].apply(n,arguments)},{23:23,33:33,39:39,54:54,55:55,6:6,64:64,70:70,82:82,87:87,88:88,89:89,9:9,92:92}],85:[function(e,t,n){arguments[4][71][0].apply(n,arguments)},{33:33,71:71,82:82,9:9}],86:[function(e,t,n){arguments[4][72][0].apply(n,arguments)},{33:33,54:54,55:55,64:64,72:72,82:82,88:88,89:89,9:9,97:97}],87:[function(e,t,n){arguments[4][73][0].apply(n,arguments)},{64:64,73:73}],88:[function(e,t,n){arguments[4][74][0].apply(n,arguments)},{54:54,74:74}],89:[function(e,t,n){arguments[4][75][0].apply(n,arguments)},{23:23,75:75}],90:[function(e,t,n){arguments[4][77][0].apply(n,arguments)},{77:77,82:82,83:83,84:84,85:85,86:86}],91:[function(e,t,n){arguments[4][78][0].apply(n,arguments)},{78:78,90:90}],92:[function(e,t,n){arguments[4][80][0].apply(n,arguments)},{64:64,80:80}],93:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{18:18}],94:[function(e,t,n){(function(n){function r(e){s.call(this,e),this._destroyed=!1}function i(e,t,n){n(null,e)}function o(e){return function(t,n,r){return"function"==typeof t&&(r=n,n=t,t={}),"function"!=typeof n&&(n=i),"function"!=typeof r&&(r=null),e(t,n,r)}}var s=e(91),a=e(100).inherits,u=e(93);a(r,s),r.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;n.nextTick(function(){e&&t.emit("error",e),t.emit("close")})}},t.exports=o(function(e,t,n){var i=new r(e);return i._transform=t,n&&(i._flush=n),i}),t.exports.ctor=o(function(e,t,n){function i(t){if(!(this instanceof i))return new i(t);this.options=u(e,t),r.call(this,this.options)}return a(i,r),i.prototype._transform=t,n&&(i.prototype._flush=n),i}),t.exports.obj=o(function(e,t,n){var i=new r(u({objectMode:!0,highWaterMark:16},e));return i._transform=t,n&&(i._flush=n),i})}).call(this,e(55))},{100:100,55:55,91:91,93:93}],95:[function(e,t,n){"use strict";function r(){this.length=0}r.prototype.push=function(e){var t={item:e};this.last?this.last=this.last.next=t:this.last=this.first=t,this.length++},r.prototype.shift=function(){var e=this.first;if(e)return this.first=e.next,--this.length||(this.last=void 0),e.item},r.prototype.slice=function(e,t){e=void 0===e?0:e,t=void 0===t?1/0:t;for(var n=[],r=0,i=this.first;i&&!(--t<0);i=i.next)++r>e&&n.push(i.item);return n},t.exports=r},{}],96:[function(e,t,n){"use strict";var r=e(52),i=e(106),o=Object.prototype.toString;t.exports=function(e){return r(e)?"[object Null]":i(e)?"[object Undefined]":o.call(e)}},{106:106,52:52}],97:[function(e,t,n){(function(e){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],98:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{33:33}],99:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],100:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(t)?r.showHidden=t:t&&n._extend(r,t),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&B(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return _(i)||(i=u(e,i,r)),i}var o=f(e,t);if(o)return o;var s=Object.keys(t),y=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),x(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(t);if(0===s.length){if(B(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(x(t))return c(t)}var v="",b=!1,m=["{","}"];if(p(t)&&(b=!0,m=["[","]"]),B(t)){v=" [Function"+(t.name?": "+t.name:"")+"]"}if(E(t)&&(v=" "+RegExp.prototype.toString.call(t)),k(t)&&(v=" "+Date.prototype.toUTCString.call(t)),x(t)&&(v=" "+c(t)),0===s.length&&(!b||0==t.length))return m[0]+v+m[1];if(r<0)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var w;return w=b?l(e,t,r,y,s):s.map(function(n){return h(e,t,r,y,n,b)}),e.seen.pop(),d(w,v,m)}function f(e,t){if(w(t))return e.stylize("undefined","undefined");if(_(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return b(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i){for(var o=[],s=0,a=t.length;s-1&&(a=o?a.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return"   "+e}).join("\n"))):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function d(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function p(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return null==e}function b(e){return"number"==typeof e}function _(e){return"string"==typeof e}function m(e){return"symbol"==typeof e}function w(e){return void 0===e}function E(e){return S(e)&&"[object RegExp]"===O(e)}function S(e){return"object"==typeof e&&null!==e}function k(e){return S(e)&&"[object Date]"===O(e)}function x(e){return S(e)&&("[object Error]"===O(e)||e instanceof Error)}function B(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function O(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}function L(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.format=function(e){if(!_(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),a=r[n];n>>((3&t)<<3)&255;return o}}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],104:[function(e,t,n){function r(e,t,n){var r=t&&n||0,i=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:u,l=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:c+1,d=l-f+(h-c)/1e4;if(d<0&&void 0===e.clockseq&&(s=s+1&16383),(d<0||l>f)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=l,c=h,u=s,l+=122192928e5;var p=(1e4*(268435455&l)+h)%4294967296;i[r++]=p>>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var y=l/4294967296*1e4&268435455;i[r++]=y>>>8&255,i[r++]=255&y,i[r++]=y>>>24&15|16,i[r++]=y>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(var g=e.node||a,v=0;v<6;++v)i[r+v]=g[v];return t||o(i)}var i=e(103),o=e(102),s=i(),a=[1|s[0],s[1],s[2],s[3],s[4],s[5]],u=16383&(s[6]<<8|s[7]),f=0,c=0;t.exports=r},{102:102,103:103}],105:[function(e,t,n){function r(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[r+a]=s[a];return t||o(s)}var i=e(103),o=e(102);t.exports=r},{102:102,103:103}],106:[function(e,t,n){"use strict";function r(e){return void 0===e}t.exports=r},{}],107:[function(e,t,n){"use strict";function r(e,t,n){var r=n[n.length-1];e===r.element&&(n.pop(),r=n[n.length-1]);var i=r.element,o=r.index;if(Array.isArray(i))i.push(e);else if(o===t.length-2){var s=t.pop();i[s]=e}else t.push(e)}n.stringify=function(e){var t=[];t.push({obj:e});for(var n,r,i,o,s,a,u,f,c,l,h,d="";n=t.pop();)if(r=n.obj,i=n.prefix||"",o=n.val||"",d+=i,o)d+=o;else if("object"!=typeof r)d+=void 0===r?null:JSON.stringify(r);else if(null===r)d+="null";else if(Array.isArray(r)){for(t.push({val:"]"}),s=r.length-1;s>=0;s--)a=0===s?"":",",t.push({obj:r[s],prefix:a});t.push({val:"["})}else{u=[];for(f in r)r.hasOwnProperty(f)&&u.push(f);for(t.push({val:"}"}),s=u.length-1;s>=0;s--)c=u[s],l=r[c],h=s>0?",":"",h+=JSON.stringify(c)+":",t.push({obj:l,prefix:h});t.push({val:"{"})}return d},n.parse=function(e){for(var t,n,i,o,s,a,u,f,c,l=[],h=[],d=0;;)if("}"!==(t=e[d++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":d+=3,r(null,l,h);break;case"t":d+=3,r(!0,l,h);break;case"f":d+=4,r(!1,l,h);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",d--;;){if(i=e[d++],!/[\d\.\-e\+]/.test(i)){d--;break}n+=i}r(parseFloat(n),l,h);break;case'"':for(o="",s=void 0,a=0;;){if('"'===(u=e[d++])&&("\\"!==s||a%2!=1))break;o+=u,s=u,"\\"===s?a++:a=0}r(JSON.parse('"'+o+'"'),l,h);break;case"[":f={element:[],index:l.length},l.push(f.element),h.push(f);break;case"{":c={element:{},index:l.length},l.push(c.element),h.push(c);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,h)}}},{}],108:[function(e,t,n){function r(){for(var e={},t=0;t>>1,n(e[r],t)<0?i=r+1:o=r;return i}function K(e,t,n){var r=z(e,t,n);e.splice(r,0,t)}function V(e,t){for(var n,r,i=t,o=e.length;i0;){var i=n.pop(),o=i.tree1,s=i.tree2;(o[1].status||s[1].status)&&(o[1].status="available"===o[1].status||"available"===s[1].status?"available":"missing");for(var a=0;a0;){var y=p.pop();if(0!==y.diff)for(var g=y.ids[2],v=0,b=g.length;vt){n||(n={});var c=f.length-t;a={pos:u.pos+c,ids:V(f,c)};for(var l=0;l0||r0||ri.end)return t(null,{total_rows:r,offset:e.skip,rows:[]});var u=[],f=_.docStore.readStream(i),c=Fe.obj(function(t,n,r){function i(t){var n={id:s.id,key:s.id,value:{rev:c}};if(e.include_docs){if(n.doc=t,n.doc._rev=n.value.rev,e.conflicts){var i=U(s);i.length&&(n.doc._conflicts=i)}for(var o in n.doc._attachments)n.doc._attachments.hasOwnProperty(o)&&(n.doc._attachments[o].stub=!0)}if(!1===e.inclusive_end&&s.id===e.endkey)return r();if(l){if("ok"!==e.deleted)return r();n.value.deleted=!0,n.doc=null}u.push(n),r()}var s=t.value,c=Se(s),l=ke(s,c);if(l){if("ok"!==e.deleted)return void r()}else{if(o-- >0)return void r();if("number"==typeof a&&a--<=0)return f.unpipe(),f.destroy(),void r()}if(e.include_docs){var d=s.rev_map[c];_.bySeqStore.get(h(d),function(e,t){i(t)})}else i()},function(n){Je.resolve().then(function(){if(e.include_docs&&e.attachments)return Be(u,_,e)}).then(function(){t(null,{total_rows:r,offset:e.skip,rows:u})},t),n()}).on("unpipe",function(){c.end()});f.on("error",t),f.pipe(c)})}),v._changes=function(e){function t(){e.done=!0,c&&e.limit&&e.limit0&&(r=e.limit),f.reverse||(f.start=h(e.since||0));var c,l=e.doc_ids&&new Ge(e.doc_ids),p=m(e),y=new $e;c="return_docs"in e?e.return_docs:!("returnDocs"in e)||e.returnDocs;var b=_.bySeqStore.readStream(f),w=Fe.obj(function(n,a,f){function v(t){function n(n){var r=e.processChange(n,t,e);r.seq=t.seq;var i=p(r);if("object"==typeof i)return e.complete(i);i&&(u++,e.attachments&&e.include_docs?Be([r],_,e).then(function(){e.onChange(r)}):e.onChange(r),c&&o.push(r)),f()}var r=Se(t);if(t.seq!==b)return f();if(s=b,r===m._rev)return n(m);var i=t.rev_map[r];_.bySeqStore.get(h(i),function(e,t){n(t)})}if(r&&u>=r)return t(),f();if(e.cancelled||e.done)return f();var b=d(n.key),m=n.value;if(b===e.since&&!i)return f();if(l&&!l.has(m._id))return f();var w;if(w=y.get(m._id))return v(w);_.docStore.get(m._id,function(t,n){if(e.cancelled||e.done||g.isClosed()||ee(n.id))return f();y.set(m._id,n),v(n)})},function(t){if(e.cancelled)return t();c&&e.limit&&e.limitr.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))}).on("complete",function(){"waiting"===s&&Ne(i),s=!1}).on("error",e)}}if(!this._listeners[t]){var o=this,s=!1;this._listeners[t]=i,this.on(e,i)}},g.prototype.removeListener=function(e,t){t in this._listeners&&(Re.EventEmitter.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},g.prototype.notifyLocalWindows=function(e){d()?chrome.storage.local.set({dbName:e}):p()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},g.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)};var Ze;Ze="function"==typeof Object.assign?Object.assign:function(e){for(var t=Object(e),n=1;n=0;i--){var o=this._batch[i],s=o.prefix.prefix()[0]+"ÿ"+o.key;n.has(s)||(n.add(s),r.push(o))}e.batch(r,t)};var At="document-store",Ot="by-sequence",jt="attach-store",Lt="attach-binary-store",Ct="local-store",Rt="meta-store",Tt=new $e,Mt="_local_last_update_seq",Nt="_local_doc_count",It="_local_uuid",qt="md5-",Dt={encode:ve,decode:ge,buffer:!1,type:"cheap-json"},Ut=new g;Oe.valid=function(){return!!t.indexedDB},Oe.use_prefix=!0;var Ft=function(e){e.adapter("fruitdown",Oe,!0)};"undefined"==typeof PouchDB?function(e){if("undefined"!==console&&e in console){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}("error",'fruitdown adapter plugin error: Cannot find global "PouchDB" object! Did you remember to include pouchdb.js?'):PouchDB.plugin(Ft)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{101:101,107:107,19:19,23:23,26:26,32:32,33:33,4:4,40:40,46:46,51:51,53:53,63:63,65:65,7:7,94:94}]},{},[109]);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy