-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbundle.js
7 lines (7 loc) · 197 KB
/
bundle.js
1
2
3
4
5
6
7
!function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){function n(t){return this instanceof n?(this.length=0,this.parent=void 0,"number"==typeof t?i(this,t):"string"==typeof t?o(this,t,arguments.length>1?arguments[1]:"utf8"):s(this,t)):arguments.length>1?new n(t,arguments[1]):new n(t)}function i(t,e){if(t=h(t,0>e?0:0|p(e)),!n.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;r++)t[r]=0;return t}function o(t,e,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|v(e,r);return t=h(t,n),t.write(e,r),t}function s(t,e){if(n.isBuffer(e))return a(t,e);if(Y(e))return u(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer?c(t,e):e.length?l(t,e):f(t,e)}function a(t,e){var r=0|p(e.length);return t=h(t,r),e.copy(t,0,0,r),t}function u(t,e){var r=0|p(e.length);t=h(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function c(t,e){var r=0|p(e.length);t=h(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function l(t,e){var r=0|p(e.length);t=h(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function f(t,e){var r,n=0;"Buffer"===e.type&&Y(e.data)&&(r=e.data,n=0|p(r.length)),t=h(t,n);for(var i=0;n>i;i+=1)t[i]=255&r[i];return t}function h(t,e){n.TYPED_ARRAY_SUPPORT?t=n._augment(new Uint8Array(e)):(t.length=e,t._isBuffer=!0);var r=0!==e&&e<=n.poolSize>>>1;return r&&(t.parent=W),t}function p(t){if(t>=X)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+X.toString(16)+" bytes");return 0|t}function d(t,e){if(!(this instanceof d))return new d(t,e);var r=new n(t,e);return delete r.parent,r}function v(t,e){if("string"!=typeof t&&(t=String(t)),0===t.length)return 0;switch(e||"utf8"){case"ascii":case"binary":case"raw":return t.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t.length;case"hex":return t.length>>>1;case"utf8":case"utf-8":return M(t).length;case"base64":return U(t).length;default:return t.length}}function y(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");t[r+s]=a}return s}function _(t,e,r,n){return q(M(e,t.length-r),t,r,n)}function g(t,e,r,n){return q(V(e),t,r,n)}function m(t,e,r,n){return g(t,e,r,n)}function b(t,e,r,n){return q(U(e),t,r,n)}function w(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?z.fromByteArray(t):z.fromByteArray(t.slice(e,r))}function E(t,e,r){var n="",i="";r=Math.min(t.length,r);for(var o=e;r>o;o++)t[o]<=127?(n+=H(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return n+H(i)}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;i++)n+=String.fromCharCode(t[i]);return n}function F(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;o++)i+=O(t[o]);return i}function S(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function j(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,o,s){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||s>e)throw new RangeError("value is out of bounds");if(r+i>t.length)throw new RangeError("index out of range")}function A(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;i++)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function T(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;i++)t[r+i]=e>>>8*(n?i:3-i)&255}function R(t,e,r,n,i,o){if(e>i||o>e)throw new RangeError("value is out of bounds");if(r+n>t.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function I(t,e,r,n,i){return i||R(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),G.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||R(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),G.write(t,e,r,n,52,8),r+8}function L(t){if(t=D(t).replace(K,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function D(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function O(t){return 16>t?"0"+t.toString(16):t.toString(16)}function M(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;n>s;s++){if(r=t.charCodeAt(s),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&((e-=3)>-1&&o.push(239,191,189),i=null);if(128>r){if((e-=1)<0)break;o.push(r)}else if(2048>r){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(2097152>r))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e}function N(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);s++)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function U(t){return z.toByteArray(L(t))}function q(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);i++)e[i+r]=t[i];return i}function H(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}var z=t("base64-js"),G=t("ieee754"),Y=t("is-array");r.Buffer=n,r.SlowBuffer=d,r.INSPECT_MAX_BYTES=50,n.poolSize=8192;var X=1073741823,W={};n.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(r){return!1}}(),n.isBuffer=function(t){return!(null==t||!t._isBuffer)},n.compare=function(t,e){if(!n.isBuffer(t)||!n.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,s=Math.min(r,i);s>o&&t[o]===e[o];)++o;return o!==s&&(r=t[o],i=e[o]),i>r?-1:r>i?1:0},n.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(t,e){if(!Y(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new n(0);if(1===t.length)return t[0];var r;if(void 0===e)for(e=0,r=0;r<t.length;r++)e+=t[r].length;var i=new n(e),o=0;for(r=0;r<t.length;r++){var s=t[r];s.copy(i,o),o+=s.length}return i},n.byteLength=v,n.prototype.length=void 0,n.prototype.parent=void 0,n.prototype.toString=function(t,e,r){var n=!1;if(e=0|e,r=void 0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return k(this,e,r);case"binary":return C(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}},n.prototype.equals=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===n.compare(this,t)},n.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},n.prototype.compare=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:n.compare(this,t)},n.prototype.indexOf=function(t,e){function r(t,e,r){for(var n=-1,i=0;r+i<t.length;i++)if(t[r+i]===e[-1===n?0:i-n]){if(-1===n&&(n=i),i-n+1===e.length)return r+n}else n=-1;return-1}if(e>2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(n.isBuffer(t))return r(this,t,e);if("number"==typeof t)return n.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):r(this,[t],e);throw new TypeError("val must be string, number or Buffer")},n.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},n.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},n.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var i=n;n=e,e=0|r,r=i}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return g(this,t,e,r);case"binary":return m(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var i;if(n.TYPED_ARRAY_SUPPORT)i=n._augment(this.subarray(t,e));else{var o=e-t;i=new n(o,void 0);for(var s=0;o>s;s++)i[s]=this[s+t]}return i.length&&(i.parent=this.parent||this),i},n.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},n.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},n.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},n.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},n.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},n.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||j(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},n.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},n.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),G.read(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),G.read(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),G.read(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),G.read(this,t,!1,52,8)},n.prototype.writeUIntLE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||P(this,t,e,r,Math.pow(2,8*r),0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},n.prototype.writeUIntBE=function(t,e,r,n){t=+t,e=0|e,r=0|r,n||P(this,t,e,r,Math.pow(2,8*r),0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},n.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,1,255,0),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t,e+1},n.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},n.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):A(this,t,e,!1),e+2},n.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t):T(this,t,e,!0),e+4},n.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):T(this,t,e,!1),e+4},n.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,s=1,a=0>t?1:0;for(this[e]=255&t;++o<r&&(s*=256);)this[e+o]=(t/s>>0)-a&255;return e+r},n.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0>t?1:0;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=(t/s>>0)-a&255;return e+r},n.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,1,127,-128),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=t,e+1},n.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},n.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):A(this,t,e,!1),e+2},n.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):T(this,t,e,!0),e+4},n.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||P(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):T(this,t,e,!1),e+4},n.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},n.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},n.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},n.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},n.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&r>i&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>i)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o=i-r;if(1e3>o||!n.TYPED_ARRAY_SUPPORT)for(var s=0;o>s;s++)t[s+e]=this[s+r];else t._set(this.subarray(r,r+o),e);return o},n.prototype.fill=function(t,e,r){if(t||(t=0),e||(e=0),r||(r=this.length),e>r)throw new RangeError("end < start");if(r!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=e;r>n;n++)this[n]=t;else{var i=M(t.toString()),o=i.length;for(n=e;r>n;n++)this[n]=i[n%o]}return this}},n.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(n.TYPED_ARRAY_SUPPORT)return new n(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;r>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var $=n.prototype;n._augment=function(t){return t.constructor=n,t._isBuffer=!0,t._set=t.set,t.get=$.get,t.set=$.set,t.write=$.write,t.toString=$.toString,t.toLocaleString=$.toString,t.toJSON=$.toJSON,t.equals=$.equals,t.compare=$.compare,t.indexOf=$.indexOf,t.copy=$.copy,t.slice=$.slice,t.readUIntLE=$.readUIntLE,t.readUIntBE=$.readUIntBE,t.readUInt8=$.readUInt8,t.readUInt16LE=$.readUInt16LE,t.readUInt16BE=$.readUInt16BE,t.readUInt32LE=$.readUInt32LE,t.readUInt32BE=$.readUInt32BE,t.readIntLE=$.readIntLE,t.readIntBE=$.readIntBE,t.readInt8=$.readInt8,t.readInt16LE=$.readInt16LE,t.readInt16BE=$.readInt16BE,t.readInt32LE=$.readInt32LE,t.readInt32BE=$.readInt32BE,t.readFloatLE=$.readFloatLE,t.readFloatBE=$.readFloatBE,t.readDoubleLE=$.readDoubleLE,t.readDoubleBE=$.readDoubleBE,t.writeUInt8=$.writeUInt8,t.writeUIntLE=$.writeUIntLE,t.writeUIntBE=$.writeUIntBE,t.writeUInt16LE=$.writeUInt16LE,t.writeUInt16BE=$.writeUInt16BE,t.writeUInt32LE=$.writeUInt32LE,t.writeUInt32BE=$.writeUInt32BE,t.writeIntLE=$.writeIntLE,t.writeIntBE=$.writeIntBE,t.writeInt8=$.writeInt8,t.writeInt16LE=$.writeInt16LE,t.writeInt16BE=$.writeInt16BE,t.writeInt32LE=$.writeInt32LE,t.writeInt32BE=$.writeInt32BE,t.writeFloatLE=$.writeFloatLE,t.writeFloatBE=$.writeFloatBE,t.writeDoubleLE=$.writeDoubleLE,t.writeDoubleBE=$.writeDoubleBE,t.fill=$.fill,t.inspect=$.inspect,t.toArrayBuffer=$.toArrayBuffer,t};var K=/[^+\/0-9A-z\-]/g},{"base64-js":2,ieee754:3,"is-array":4}],2:[function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s||e===f?62:e===a||e===h?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function r(t){function r(t){c[f++]=t}var n,i,s,a,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),s=u>0?t.length-4:t.length;var f=0;for(n=0,i=0;s>n;n+=4,i+=3)a=e(t.charAt(n))<<18|e(t.charAt(n+1))<<12|e(t.charAt(n+2))<<6|e(t.charAt(n+3)),r((16711680&a)>>16),r((65280&a)>>8),r(255&a);return 2===u?(a=e(t.charAt(n))<<2|e(t.charAt(n+1))>>4,r(255&a)):1===u&&(a=e(t.charAt(n))<<10|e(t.charAt(n+1))<<4|e(t.charAt(n+2))>>2,r(a>>8&255),r(255&a)),c}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,u="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=r(o);switch(a){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0),f="-".charCodeAt(0),h="_".charCodeAt(0);t.toByteArray=r,t.fromByteArray=i}("undefined"==typeof r?this.base64js={}:r)},{}],3:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,v=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*v}},{}],4:[function(t,e,r){var n=Array.isArray,i=Object.prototype.toString;e.exports=n||function(t){return!!t&&"[object Array]"==i.call(t)}},{}],5:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"number"==typeof t}function s(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!o(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,o,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],a(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),u=1;n>u;u++)o[u-1]=arguments[u];r.apply(this,o)}else if(s(r)){for(n=arguments.length,o=new Array(n-1),u=1;n>u;u++)o[u-1]=arguments[u];for(c=r.slice(),n=c.length,u=0;n>u;u++)c[u].apply(this,o)}return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?s(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,s(this._events[t])&&!this._events[t].warned){var r;r=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(r)){for(a=o;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(0>n)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?i(t._events[e])?1:t._events[e].length:0}},{}],6:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],7:[function(t,e,r){function n(){l=!1,a.length?c=a.concat(c):f=-1,c.length&&i()}function i(){if(!l){var t=setTimeout(n);l=!0;for(var e=c.length;e;){for(a=c,c=[];++f<e;)a[f].run();f=-1,e=c.length}a=null,l=!1,clearTimeout(t)}}function o(t,e){this.fun=t,this.array=e}function s(){}var a,u=e.exports={},c=[],l=!1,f=-1;u.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new o(t,e)),l||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(t){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(t){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],8:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],9:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(e)?n.showHidden=e:e&&r._extend(n,e),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function s(t,e){return t}function a(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,n){if(t.customInspect&&e&&F(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return m(i)||(i=u(t,i,n)),i}var o=c(t,e);if(o)return o;var s=Object.keys(e),v=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),C(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(e);if(0===s.length){if(F(e)){var y=e.name?": "+e.name:"";return t.stylize("[Function"+y+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(k(e))return t.stylize(Date.prototype.toString.call(e),"date");if(C(e))return l(e)}var _="",g=!1,b=["{","}"];if(d(e)&&(g=!0,b=["[","]"]),F(e)){var w=e.name?": "+e.name:"";_=" [Function"+w+"]"}if(x(e)&&(_=" "+RegExp.prototype.toString.call(e)),k(e)&&(_=" "+Date.prototype.toUTCString.call(e)),C(e)&&(_=" "+l(e)),0===s.length&&(!g||0==e.length))return b[0]+_+b[1];if(0>n)return x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=g?f(t,e,n,v,s):s.map(function(r){return h(t,e,n,v,r,g)}),t.seen.pop(),p(E,_,b)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):v(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],s=0,a=e.length;a>s;++s)T(e,String(s))?o.push(h(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,r,n,i,!0))}),o}function h(t,e,r,n,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),T(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=y(r)?u(t,c.value,null):u(t,c.value,r-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.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=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function v(t){return"boolean"==typeof t}function y(t){return null===t}function _(t){return null==t}function g(t){return"number"==typeof t}function m(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function w(t){return void 0===t}function x(t){return E(t)&&"[object RegExp]"===j(t)}function E(t){return"object"==typeof t&&null!==t}function k(t){return E(t)&&"[object Date]"===j(t)}function C(t){return E(t)&&("[object Error]"===j(t)||t instanceof Error)}function F(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function j(t){return Object.prototype.toString.call(t)}function P(t){return 10>t?"0"+t.toString(10):t.toString(10)}function A(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var R=/%[sdj%]/g;r.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(t).replace(R,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),a=n[r];o>r;a=n[++r])s+=y(a)||!E(a)?" "+a:" "+i(a);return s},r.deprecate=function(t,i){function o(){if(!s){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),s=!0}return t.apply(this,arguments)}if(w(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var s=!1;return o};var I,B={};r.debuglog=function(t){if(w(I)&&(I=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!B[t])if(new RegExp("\\b"+t+"\\b","i").test(I)){var n=e.pid;B[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else B[t]=function(){};return B[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=v,r.isNull=y,r.isNullOrUndefined=_,r.isNumber=g,r.isString=m,r.isSymbol=b,r.isUndefined=w,r.isRegExp=x,r.isObject=E,r.isDate=k,r.isError=C,r.isFunction=F,r.isPrimitive=S,r.isBuffer=t("./support/isBuffer");var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",A(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":8,_process:7,inherits:6}],10:[function(t,e,r){var n=t("bluebird"),i=t("pbf"),o=t("vector-tile").VectorTile;L.VectorGrid.Leveldb=L.VectorGrid.extend({options:{},initialize:function(t,e){this._db=n.promisifyAll(t),L.VectorGrid.prototype.initialize.call(this,e)},_getVectorTilePromise:function(t){return this._db.getAsync([t.z,t.x,t.y].toString()).then(function(t){var e=new o(new i(t));return e})["catch"](function(t){return"NotFound"===t.message?{layers:[]}:void console.error(t);
}).then(function(t){for(var e in t.layers){for(var r=[],n=0;n<t.layers[e].length;n++){var i=t.layers[e].feature(n);i.geometry=i.loadGeometry(),r.push(i)}t.layers[e].features=r}return t})}}),L.vectorGrid.leveldb=function(t,e){return new L.VectorGrid.Leveldb(t,e)}},{bluebird:19,pbf:51,"vector-tile":61}],11:[function(t,e,r){(function(r){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);var i=this;c.call(i),i.db=e,r=r||{},i.zMin=r.zMin||0,i.zMax=r.zMax||14,i.bbox=r.bbox||[-(1/0),-(1/0),1/0,1/0],i.data=t,i.on("update",function(){i._pending&&(i._pending=!1,i.regenerateIndex())}),i.on("error",function(t){console.error(t)}),i.regenerateIndex()}function i(t,e){return{xMin:o(t[0],e),xMax:o(t[2],e),yMin:s(t[3],e),yMax:s(t[1],e)}}function o(t,e){return Math.floor((t+180)/360*Math.pow(2,e))}function s(t,e){return Math.floor((1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,e))}var a=t("geojson-vt"),u=t("inherits"),c=t("events").EventEmitter,l=t("vt-pbf"),f=t("range").range,h=t("run-series");e.exports=n,u(n,c),n.prototype.regenerateIndex=function(){var t=this;if(t._updating)return void(t._pending=!0);t._updating=!0,t._tileIndexes={};for(var e in t.data)t._tileIndexes[e]=a(t.data[e],{maxZoom:t.zMax,indexMaxZoom:t.zMax});var r=f(t.zMin,t.zMax+1);h(r.map(function(e){var r=i(t.bbox,e);return function(n){console.log(e,JSON.stringify(r)),h(f(r.xMin,r.xMax+1).map(function(n){return function(i){console.log(e,n),h(f(r.yMin,r.yMax+1).map(function(r){return function(i){console.log(e,n,r);var o={};for(var s in t._tileIndexes){var a=t._tileIndexes[s].getTile(e,n,r);null!==a&&(o[s]=a)}var u=l.fromGeojsonVt(o);u.length>0?t.db.put([e,n,r],u,i):i()}}),i)}}),n)}}),function(e){e&&t.emit(e),t._updating=!1,t.emit("update")})},n.prototype.ready=function(t){var e=this;e._updating?e.once("update",function(){e.ready(t)}):r.nextTick(t)}}).call(this,t("_process"))},{_process:7,events:5,"geojson-vt":24,inherits:32,range:56,"run-series":58,"vt-pbf":65}],12:[function(t,e,r){var n=t("nets"),i=t("xtend"),o=t("backoff");e.exports=function(t,e){"function"==typeof t&&(e=t);var r=i(t,{json:!0}),s=o.fibonacci({initialDelay:1e3,maxDelay:3e4});s.on("backoff",function(t,e){console.log("backoff",t,e)}),s.on("ready",function(){n(r,function(t,r,n){t?e(t):404===r.statusCode?e(r.statusMessage||"Not Found"):202===r.statusCode?s.backoff():(s.reset(),e(null,n))})}),s.backoff()}},{backoff:13,nets:45,xtend:71}],13:[function(t,e,r){var n=t("./lib/backoff"),i=t("./lib/strategy/exponential"),o=t("./lib/strategy/fibonacci"),s=t("./lib/function_call.js");e.exports.Backoff=n,e.exports.FunctionCall=s,e.exports.FibonacciStrategy=o,e.exports.ExponentialStrategy=i,e.exports.fibonacci=function(t){return new n(new o(t))},e.exports.exponential=function(t){return new n(new i(t))},e.exports.call=function(t,e,r){var n=Array.prototype.slice.call(arguments);return t=n[0],e=n.slice(1,n.length-1),r=n[n.length-1],new s(t,e,r)}},{"./lib/backoff":14,"./lib/function_call.js":15,"./lib/strategy/exponential":16,"./lib/strategy/fibonacci":17}],14:[function(t,e,r){function n(t){i.EventEmitter.call(this),this.backoffStrategy_=t,this.maxNumberOfRetry_=-1,this.backoffNumber_=0,this.backoffDelay_=0,this.timeoutID_=-1,this.handlers={backoff:this.onBackoff_.bind(this)}}var i=t("events"),o=t("precond"),s=t("util");s.inherits(n,i.EventEmitter),n.prototype.failAfter=function(t){o.checkArgument(t>0,"Expected a maximum number of retry greater than 0 but got %s.",t),this.maxNumberOfRetry_=t},n.prototype.backoff=function(t){o.checkState(-1===this.timeoutID_,"Backoff in progress."),this.backoffNumber_===this.maxNumberOfRetry_?(this.emit("fail",t),this.reset()):(this.backoffDelay_=this.backoffStrategy_.next(),this.timeoutID_=setTimeout(this.handlers.backoff,this.backoffDelay_),this.emit("backoff",this.backoffNumber_,this.backoffDelay_,t))},n.prototype.onBackoff_=function(){this.timeoutID_=-1,this.emit("ready",this.backoffNumber_,this.backoffDelay_),this.backoffNumber_++},n.prototype.reset=function(){this.backoffNumber_=0,this.backoffStrategy_.reset(),clearTimeout(this.timeoutID_),this.timeoutID_=-1},e.exports=n},{events:5,precond:53,util:9}],15:[function(t,e,r){function n(t,e,r){i.EventEmitter.call(this),o.checkIsFunction(t,"Expected fn to be a function."),o.checkIsArray(e,"Expected args to be an array."),o.checkIsFunction(r,"Expected callback to be a function."),this.function_=t,this.arguments_=e,this.callback_=r,this.lastResult_=[],this.numRetries_=0,this.backoff_=null,this.strategy_=null,this.failAfter_=-1,this.retryPredicate_=n.DEFAULT_RETRY_PREDICATE_,this.state_=n.State_.PENDING}var i=t("events"),o=t("precond"),s=t("util"),a=t("./backoff"),u=t("./strategy/fibonacci");s.inherits(n,i.EventEmitter),n.State_={PENDING:0,RUNNING:1,COMPLETED:2,ABORTED:3},n.DEFAULT_RETRY_PREDICATE_=function(t){return!0},n.prototype.isPending=function(){return this.state_==n.State_.PENDING},n.prototype.isRunning=function(){return this.state_==n.State_.RUNNING},n.prototype.isCompleted=function(){return this.state_==n.State_.COMPLETED},n.prototype.isAborted=function(){return this.state_==n.State_.ABORTED},n.prototype.setStrategy=function(t){return o.checkState(this.isPending(),"FunctionCall in progress."),this.strategy_=t,this},n.prototype.retryIf=function(t){return o.checkState(this.isPending(),"FunctionCall in progress."),this.retryPredicate_=t,this},n.prototype.getLastResult=function(){return this.lastResult_.concat()},n.prototype.getNumRetries=function(){return this.numRetries_},n.prototype.failAfter=function(t){return o.checkState(this.isPending(),"FunctionCall in progress."),this.failAfter_=t,this},n.prototype.abort=function(){this.isCompleted()||this.isAborted()||(this.isRunning()&&this.backoff_.reset(),this.state_=n.State_.ABORTED,this.lastResult_=[new Error("Backoff aborted.")],this.emit("abort"),this.doCallback_())},n.prototype.start=function(t){o.checkState(!this.isAborted(),"FunctionCall is aborted."),o.checkState(this.isPending(),"FunctionCall already started.");var e=this.strategy_||new u;this.backoff_=t?t(e):new a(e),this.backoff_.on("ready",this.doCall_.bind(this,!0)),this.backoff_.on("fail",this.doCallback_.bind(this)),this.backoff_.on("backoff",this.handleBackoff_.bind(this)),this.failAfter_>0&&this.backoff_.failAfter(this.failAfter_),this.state_=n.State_.RUNNING,this.doCall_(!1)},n.prototype.doCall_=function(t){t&&this.numRetries_++;var e=["call"].concat(this.arguments_);i.EventEmitter.prototype.emit.apply(this,e);var r=this.handleFunctionCallback_.bind(this);this.function_.apply(null,this.arguments_.concat(r))},n.prototype.doCallback_=function(){this.callback_.apply(null,this.lastResult_)},n.prototype.handleFunctionCallback_=function(){if(!this.isAborted()){var t=Array.prototype.slice.call(arguments);this.lastResult_=t,i.EventEmitter.prototype.emit.apply(this,["callback"].concat(t));var e=t[0];e&&this.retryPredicate_(e)?this.backoff_.backoff(e):(this.state_=n.State_.COMPLETED,this.doCallback_())}},n.prototype.handleBackoff_=function(t,e,r){this.emit("backoff",t,e,r)},e.exports=n},{"./backoff":14,"./strategy/fibonacci":17,events:5,precond:53,util:9}],16:[function(t,e,r){function n(t){s.call(this,t),this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay(),this.factor_=n.DEFAULT_FACTOR,t&&void 0!==t.factor&&(o.checkArgument(t.factor>1,"Exponential factor should be greater than 1 but got %s.",t.factor),this.factor_=t.factor)}var i=t("util"),o=t("precond"),s=t("./strategy");i.inherits(n,s),n.DEFAULT_FACTOR=2,n.prototype.next_=function(){return this.backoffDelay_=Math.min(this.nextBackoffDelay_,this.getMaxDelay()),this.nextBackoffDelay_=this.backoffDelay_*this.factor_,this.backoffDelay_},n.prototype.reset_=function(){this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()},e.exports=n},{"./strategy":18,precond:53,util:9}],17:[function(t,e,r){function n(t){o.call(this,t),this.backoffDelay_=0,this.nextBackoffDelay_=this.getInitialDelay()}var i=t("util"),o=t("./strategy");i.inherits(n,o),n.prototype.next_=function(){var t=Math.min(this.nextBackoffDelay_,this.getMaxDelay());return this.nextBackoffDelay_+=this.backoffDelay_,this.backoffDelay_=t,t},n.prototype.reset_=function(){this.nextBackoffDelay_=this.getInitialDelay(),this.backoffDelay_=0},e.exports=n},{"./strategy":18,util:9}],18:[function(t,e,r){function n(t){return void 0!==t&&null!==t}function i(t){if(t=t||{},n(t.initialDelay)&&t.initialDelay<1)throw new Error("The initial timeout must be greater than 0.");if(n(t.maxDelay)&&t.maxDelay<1)throw new Error("The maximal timeout must be greater than 0.");if(this.initialDelay_=t.initialDelay||100,this.maxDelay_=t.maxDelay||1e4,this.maxDelay_<=this.initialDelay_)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");if(n(t.randomisationFactor)&&(t.randomisationFactor<0||t.randomisationFactor>1))throw new Error("The randomisation factor must be between 0 and 1.");this.randomisationFactor_=t.randomisationFactor||0}t("events"),t("util");i.prototype.getMaxDelay=function(){return this.maxDelay_},i.prototype.getInitialDelay=function(){return this.initialDelay_},i.prototype.next=function(){var t=this.next_(),e=1+Math.random()*this.randomisationFactor_,r=Math.round(t*e);return r},i.prototype.next_=function(){throw new Error("BackoffStrategy.next_() unimplemented.")},i.prototype.reset=function(){this.reset_()},i.prototype.reset_=function(){throw new Error("BackoffStrategy.reset_() unimplemented.")},e.exports=i},{events:5,util:9}],19:[function(t,e,r){(function(t,n){!function(t){if("object"==typeof r&&"undefined"!=typeof e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:"undefined"!=typeof n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=t()}}(function(){var e,r,i;return function o(t,e,r){function n(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,o,t,e,r)}return e[s].exports}for(var i="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(t,e,r){"use strict";e.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(e,r,n){"use strict";function i(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new f(16),this._normalQueue=new f(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=l}function o(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()}function s(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()}function a(t){this._normalQueue._pushOne(t),this._queueTick()}var u;try{throw new Error}catch(c){u=c}var l=e("./schedule"),f=e("./queue"),h=e("./util");i.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},i.prototype.hasCustomScheduler=function(){return this._customScheduler},i.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},i.prototype.disableTrampolineIfNecessary=function(){h.hasDevTools&&(this._trampolineEnabled=!1)},i.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},i.prototype.fatalError=function(e,r){r?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},i.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},h.hasDevTools?(i.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?o.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},i.prototype.invoke=function(t,e,r){this._trampolineEnabled?s.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},i.prototype.settlePromises=function(t){this._trampolineEnabled?a.call(this,t):this._schedule(function(){t._settlePromises()})}):(i.prototype.invokeLater=o,i.prototype.invoke=s,i.prototype.settlePromises=a),i.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},i.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},i.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},i.prototype._reset=function(){this._isTickUsed=!1},r.exports=i,r.exports.firstLineError=u},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var c=r(o),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof t){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(e,s,void 0,l,h),c._then(a,u,void 0,l,h),l._setOnCancel(c)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=n,e.exports=o},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),u=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(n,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,u=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r<t.length;++r)this._doInvokeOnCancel(t[r],e);else if(void 0!==t)if("function"==typeof t){if(!e){var n=s(t).call(this._boundValue());n===a&&(this._attachExtraTrace(n.e),u.throwLater(n.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,r){"use strict";e.exports=function(e){function r(t,r,a){return function(u){var c=a._boundValue();t:for(var l=0;l<t.length;++l){var f=t[l];if(f===Error||null!=f&&f.prototype instanceof Error){if(u instanceof f)return o(r).call(c,u)}else if("function"==typeof f){var h=o(f).call(c,u);if(h===s)return h;if(h)return o(r).call(c,u)}else if(n.isObject(u)){for(var p=i(f),d=0;d<p.length;++d){var v=p[d];if(f[v]!=u[v])continue t}return o(r).call(c,u)}}return e}}var n=t("./util"),i=t("./es5").keys,o=n.tryCatch,s=n.errorObj;return r}},{"./es5":13,"./util":36}],8:[function(t,e,r){"use strict";e.exports=function(t){function e(){this._trace=new e.CapturedTrace(n())}function r(){return i?new e:void 0}function n(){var t=o.length-1;return t>=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=r,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=u,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=n,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){function i(t,e){return{promise:e}}function o(){return!1}function s(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+V.toString(t));n._attachCancellationCallback(t)})}catch(i){return i}}function a(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?V.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function d(){this._trace=new R(this._peekContext())}function v(t,e){if(N(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=k(t);V.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),V.notEnumerableProp(t,"__stackCleaned__",!0)}}}function y(t,e,r,n,i){if(void 0===t&&null!==e&&K){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&n._bitField))return;r&&(r+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),u=x(a),c=u.length-1;c>=0;--c){var l=u[c];if(!q.test(l)){var f=l.match(H);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var h=u[0],c=0;c<a.length;++c)if(a[c]===h){c>0&&(s="\n"+a[c-1]);break}}var p="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;n._warn(p,!0,e)}}function _(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),g(r)}function g(t,e,n){if(st.warnings){var i,o=new M(t);if(e)n._attachExtraTrace(o);else if(st.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var s=k(o);o.stack=s.message+"\n"+s.stack.join("\n")}et("warning",o)||C(o,"",!0)}}function m(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function b(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function w(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function x(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=" (No stack trace)"===n||z.test(n),o=i&&nt(n);i&&!o&&(Y&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function E(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||z.test(n))break}return r>0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}function k(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?E(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:x(e)}}function C(t,e,r){if("undefined"!=typeof console){var n;if(V.isObject(t)){var i=t.stack;n=e+G(i,t)}else n=e+String(t);"function"==typeof L?L(n,r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(n)}}function F(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(o){O.throwLater(o)}"unhandledRejection"===t?et(t,r,n)||i||C(r,"Unhandled rejection "):et(t,n)}function S(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():V.toString(t);var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+j(e)+">, no stack trace)"}function j(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function P(){return"function"==typeof ot}function A(t){var e=t.match(it);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}function T(t,e){if(P()){for(var r,n,i=t.stack.split("\n"),o=e.stack.split("\n"),s=-1,a=-1,u=0;u<i.length;++u){var c=A(i[u]);if(c){r=c.fileName,s=c.line;break}}for(var u=0;u<o.length;++u){var c=A(o[u]);if(c){n=c.fileName,a=c.line;break}}0>s||0>a||!r||!n||r!==n||s>=a||(nt=function(t){if(U.test(t))return!0;var e=A(t);return e&&e.fileName===r&&s<=e.line&&e.line<=a?!0:!1})}}function R(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);ot(this,R),e>32&&this.uncycle()}var I,B,L,D=r._getDomain,O=r._async,M=e("./errors").Warning,V=e("./util"),N=V.canAttachTrace,U=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,q=/\((?:timers\.js):\d+:\d+\)/,H=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,z=null,G=null,Y=!1,X=!(0==V.env("BLUEBIRD_DEBUG")),W=!(0==V.env("BLUEBIRD_WARNINGS")||!X&&!V.env("BLUEBIRD_WARNINGS")),$=!(0==V.env("BLUEBIRD_LONG_STACK_TRACES")||!X&&!V.env("BLUEBIRD_LONG_STACK_TRACES")),K=0!=V.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(W||!!V.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),O.invokeLater(this._notifyUnhandledRejection,this,void 0))},r.prototype._notifyUnhandledRejectionIsHandled=function(){F("rejectionHandled",I,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),F("unhandledRejection",B,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return g(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=D();B="function"==typeof t?null===e?t:V.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=D();I="function"==typeof t?null===e?t:V.domainBind(e,t):void 0};var Q=function(){};r.longStackTraces=function(){if(O.haveItemsQueued()&&!st.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!st.longStackTraces&&P()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace;st.longStackTraces=!0,Q=function(){if(O.haveItemsQueued()&&!st.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,n.deactivateLongStackTraces(),O.enableTrampoline(),st.longStackTraces=!1},r.prototype._captureStackTrace=d,r.prototype._attachExtraTrace=v,n.activateLongStackTraces(),O.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return st.longStackTraces&&P()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return V.global.dispatchEvent(t),function(t,e){var r=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!V.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return V.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,!V.global.dispatchEvent(r)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),V.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!V.global.dispatchEvent(r)}}catch(e){}return function(){return!1}}(),Z=function(){return V.isNode?function(){return t.emit.apply(t,arguments)}:V.global?function(t){var e="on"+t.toLowerCase(),r=V.global[e];return r?(r.apply(V.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),tt={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:i},et=function(t){var e=!1;try{e=Z.apply(null,arguments)}catch(r){O.throwLater(r),e=!0}var n=!1;try{n=J(t,tt[t].apply(null,arguments))}catch(r){O.throwLater(r),n=!0}return n||e};r.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&Q()),"warnings"in t){var e=t.warnings;st.warnings=!!e,K=st.warnings,V.isObject(e)&&"wForgottenReturn"in e&&(K=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!st.cancellation){if(O.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=l,r.prototype._propagateFrom=f,r.prototype._onCancel=u,r.prototype._setOnCancel=c,r.prototype._attachCancellationCallback=a,r.prototype._execute=s,rt=f,st.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!st.monitoring?(st.monitoring=!0,r.prototype._fireEvent=et):!t.monitoring&&st.monitoring&&(st.monitoring=!1,r.prototype._fireEvent=o)),r},r.prototype._fireEvent=o,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(n){return n}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var rt=h,nt=function(){return!1},it=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;V.inherits(R,Error),n.CapturedTrace=R,R.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},R.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=k(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(x(i.stack.split("\n"))),i=i._parent;w(n),b(n),V.notEnumerableProp(t,"stack",m(r,n)),V.notEnumerableProp(t,"__stackCleaned__",!0)}};var ot=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():S(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,z=t,G=e;var r=Error.captureStackTrace;return nt=function(t){return U.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return z=/@/,G=e,Y=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(G=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?S(e):e.toString()},null):(z=t,G=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(L=function(t){console.warn(t)},V.isNode&&t.stderr.isTTY?L=function(t,e){var r=e?"[33m":"[31m";console.warn(r+t+"[0m\n")}:V.isNode||"string"!=typeof(new Error).stack||(L=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var st={warnings:W,longStackTraces:!1,cancellation:!1,monitoring:!1};return $&&r.longStackTraces(),{longStackTraces:function(){return st.longStackTraces},warnings:function(){return st.warnings},cancellation:function(){return st.cancellation},monitoring:function(){return st.monitoring},propagateFromFunction:function(){return rt},boundValueFunction:function(){return p},checkForgottenReturns:y,setBounds:T,warn:g,deprecated:_,CapturedTrace:R,fireDomEvent:J,fireGlobalEvent:Z}}},{"./errors":12,"./util":36}],10:[function(t,e,r){
"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var i=function(){return n};return this.caught(r,i)}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){function r(){return o(this)}function n(t,r){return i(t,r,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,n){return i(t,n,e,0)._then(r,void 0,void 0,t,void 0)},t.mapSeries=n}},{}],12:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(f(this,"message","string"==typeof n?n:e),f(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function i(t){return this instanceof i?(f(this,"name","OperationalError"),f(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(f(this,"message",t.message),f(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),u=a.freeze,c=t("./util"),l=c.inherits,f=c.notEnumerableProp,h=n("Warning","warning"),p=n("CancellationError","cancellation error"),d=n("TimeoutError","timeout error"),v=n("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(y){o=n("TypeError","type error"),s=n("RangeError","range error")}for(var _="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<_.length;++g)"function"==typeof Array.prototype[_[g]]&&(v.prototype[_[g]]=Array.prototype[_[g]]);a.defineProperty(v.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),v.prototype.isOperational=!0;var m=0;v.prototype.toString=function(){var t=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return m--,e},l(i,Error);var b=Error.__BluebirdErrorTypes__;b||(b=u({CancellationError:p,TimeoutError:d,OperationalError:i,RejectionError:i,AggregateError:v}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:b,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:h}},{"./es5":13,"./util":36}],13:[function(t,e,r){var n=function(){"use strict";return void 0===this}();if(n)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var r in t)i.call(t,r)&&e.push(r);return e},u=function(t,e){return{value:t[e]}},c=function(t,e,r){return t[e]=r.value,t},l=function(t){return t},f=function(t){try{return Object(t).constructor.prototype}catch(e){return s}},h=function(t){try{return"[object Array]"===o.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:a,names:a,defineProperty:c,getDescriptor:u,freeze:l,getPrototypeOf:f,isES5:n,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},{}],15:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t,e,r){this.promise=t,this.type=e,this.handler=r,this.called=!1,this.cancelPromise=null}function o(t){this.finallyHandler=t}function s(t,e){return null!=t.cancelPromise?(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function a(){return c.call(this,this.promise._target()._settledValue())}function u(t){return s(this,t)?void 0:(h.e=t,h)}function c(t){var i=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(i._boundValue()):c.call(i._boundValue(),t);if(l===n)return l;if(void 0!==l){i._setReturnedNonUndefined();var p=r(l,i);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new f("late cancellation observer");return i._attachExtraTrace(d),h.e=d,h}p.isPending()&&p._attachCancellationCallback(new o(this))}return p._then(a,u,void 0,this,void 0)}}}return i.isRejected()?(s(this),h.e=t,h):(s(this),t)}var l=t("./util"),f=e.CancellationError,h=l.errorObj,p=t("./catch_filter")(n);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){s(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new i(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,c);var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if(!l.isObject(s))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+l.classString(s)));i[o++]=s}i.length=o;var a=arguments[n];return this._passThrough(p(i,a,this),1,void 0,c)},i}},{"./catch_filter":7,"./util":36}],16:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,s){function a(t,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=p(r[o])(t);if(n._popContext(),s===h){n._pushContext();var a=e.reject(h.e);return n._popContext(),a}var u=i(s,n);if(u instanceof e)return u}return null}function u(t,r,i,o){if(s.cancellation()){var a=new e(n),u=this._finallyPromise=new e(n);this._promise=a.lastly(function(){return u}),a._captureStackTrace(),a._setOnCancel(this)}else{var c=this._promise=new e(n);c._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(d):d,this._yieldedPromise=null,this._cancellationPhase=!1}var c=t("./errors"),l=c.TypeError,f=t("./util"),h=f.errorObj,p=f.tryCatch,d=[];f.inherits(u,o),u.prototype._isResolved=function(){return null===this._promise},u.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},u.prototype._promiseCancelled=function(){if(!this._isResolved()){var t,r="undefined"!=typeof this._generator["return"];if(r)this._promise._pushContext(),t=p(this._generator["return"]).call(this._generator,void 0),this._promise._popContext();else{var n=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=n,this._promise._attachExtraTrace(n),this._promise._pushContext(),t=p(this._generator["throw"]).call(this._generator,n),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},u.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=p(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},u.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=p(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},u.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},u.prototype.promise=function(){return this._promise},u.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},u.prototype._continue=function(t){var r=this._promise;if(t===h)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(t.e,!1);var n=t.value;if(t.done===!0)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var o=i(n,this._promise);if(!(o instanceof e)&&(o=a(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new l("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();var s=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?e._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&s)?e._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if("function"!=typeof t)throw new l("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(e).yieldHandler,n=u,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new l("expecting a function but got "+f.classString(t));d.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return r("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new u(t,this),i=n.promise();return n._run(e.spawn),i}}},{"./errors":12,"./util":36}],17:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,s){var a=t("./util");a.canEvaluate,a.tryCatch,a.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var n}var i=[].slice.call(arguments);t&&i.pop();var n=new r(i).promise();return void 0!==t?n.spread(t):n}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,s){function a(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:l.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],p.invoke(this._asyncInit,this,void 0)}function u(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+l.classString(r));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,r,s,o).promise()}var c=e._getDomain,l=t("./util"),f=l.tryCatch,h=l.errorObj,p=e._async;l.inherits(a,r),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),a=this._preservedValues,u=this._limit;if(0>r){if(r=-1*r-1,n[r]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==a&&(a[r]=t);var c=this._promise,l=this._callback,p=c._boundValue();c._pushContext();var d=f(l).call(p,t,r,o),v=c._popContext();if(s.checkForgottenReturns(d,v,null!==a?"Promise.filter":"Promise.map",c),d===h)return this._reject(d.e),!0;var y=i(d,this._promise);if(y instanceof e){y=y._target();var _=y._bitField;if(0===(50397184&_))return u>=1&&this._inFlight++,n[r]=y,y._proxy(this,-1*(r+1)),!1;if(0===(33554432&_))return 0!==(16777216&_)?(this._reject(y._reason()),!0):(this._cancel(),!0);d=y._value()}n[r]=d}var g=++this._totalResolved;return g>=o?(null!==a?this._filter(n,a):this._resolve(n),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},a.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;r>o;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return u(this,t,e,null)},e.map=function(t,e,r,n){return u(t,e,r,n)}}},{"./util":36}],19:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=a(t).apply(this,arguments),s=n._popContext();return o.checkForgottenReturns(i,s,"Promise.method",n),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var n=new e(r);n._captureStackTrace(),n._pushContext();var u;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=s.isArray(c)?a(t).apply(l,c):a(t).call(l,c)}else u=a(t)();var f=n._popContext();return o.checkForgottenReturns(u,f,"Promise.try",n),n._resolveFromSyncValue(u),n},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(n(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=l.keys(t),i=0;i<r.length;++i){var o=r[i];f.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(r,n){if(null!==t){if(r){var o=i(a(r));t._attachExtraTrace(o),t._reject(o)}else if(e){var s=[].slice.call(arguments,1);t._fulfill(s)}else t._fulfill(n);t=null}}}var s=t("./util"),a=s.maybeWrapAsError,u=t("./errors"),c=u.OperationalError,l=t("./es5"),f=/^(?:name|message|stack|cause)$/;e.exports=o},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,r){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundValue(),[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundValue(),i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=new Error(t+"");n.cause=t,t=n}var i=a(e).call(r._boundValue(),t);i===u&&s.throwLater(i.e)}var o=t("./util"),s=e._async,a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./util":36}],22:[function(e,r,n){"use strict";r.exports=function(){function n(){}function i(t,e){if(null==t||t.constructor!==o)throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new m("expecting a function but got "+d.classString(e))}function o(t){t!==w&&i(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function s(t){this.promise._resolveCallback(t)}function a(t){this.promise._rejectCallback(t,!1)}function u(t){var e=new o(w);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}var c,l=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},f=function(){return new o.PromiseInspection(this._target())},h=function(t){return o.reject(new m(t))},p={},d=e("./util");c=d.isNode?function(){var e=t.domain;return void 0===e&&(e=null),e}:function(){return null},d.notEnumerableProp(o,"_getDomain",c);var v=e("./es5"),y=e("./async"),_=new y;v.defineProperty(o,"_async",{value:_});var g=e("./errors"),m=o.TypeError=g.TypeError;o.RangeError=g.RangeError;var b=o.CancellationError=g.CancellationError;o.TimeoutError=g.TimeoutError,o.OperationalError=g.OperationalError,o.RejectionError=g.OperationalError,o.AggregateError=g.AggregateError;var w=function(){},x={},E={},k=e("./thenables")(o,w),C=e("./promise_array")(o,w,k,h,n),F=e("./context")(o),S=F.create,j=e("./debuggability")(o,F),P=(j.CapturedTrace,e("./finally")(o,k,E)),A=e("./catch_filter")(E),T=e("./nodeback"),R=d.errorObj,I=d.tryCatch;return o.prototype.toString=function(){return"[object Promise]"},o.prototype.caught=o.prototype["catch"]=function(t){var e=arguments.length;if(e>1){var r,n=new Array(e-1),i=0;for(r=0;e-1>r;++r){var o=arguments[r];if(!d.isObject(o))return h("Catch statement predicate: expecting an object but got "+d.classString(o));n[i++]=o}return n.length=i,t=arguments[r],this.then(void 0,A(n,t,this))}return this.then(void 0,t)},o.prototype.reflect=function(){return this._then(f,f,void 0,this,void 0)},o.prototype.then=function(t,e){if(j.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+d.classString(t);arguments.length>1&&(r+=", "+d.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},o.prototype.done=function(t,e){var r=this._then(t,e,void 0,void 0,void 0);r._setIsFinal()},o.prototype.spread=function(t){return"function"!=typeof t?h("expecting a function but got "+d.classString(t)):this.all()._then(t,void 0,void 0,x,void 0)},o.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new C(this).promise()},o.prototype.error=function(t){return this.caught(d.originatesFromRejection,t)},o.getNewLibraryCopy=r.exports,o.is=function(t){return t instanceof o},o.fromNode=o.fromCallback=function(t){var e=new o(w);e._captureStackTrace();var r=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,n=I(t)(T(e,r));return n===R&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},o.all=function(t){return new C(t).promise()},o.cast=function(t){var e=k(t);return e instanceof o||(e=new o(w),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(t){var e=new o(w);return e._captureStackTrace(),e._rejectCallback(t,!0),e},o.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+d.classString(t));return _.setScheduler(t)},o.prototype._then=function(t,e,r,n,i){var s=void 0!==i,a=s?i:new o(w),u=this._target(),l=u._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!==(2097152&this._bitField)&&(n=0!==(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=c();if(0!==(50397184&l)){var h,p,v=u._settlePromiseCtx;0!==(33554432&l)?(p=u._rejectionHandler0,h=t):0!==(16777216&l)?(p=u._fulfillmentHandler0,h=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,p=new b("late cancellation observer"),u._attachExtraTrace(p),h=e),_.invoke(v,u,{handler:null===f?h:"function"==typeof h&&d.domainBind(f,h),promise:a,receiver:n,value:p})}else u._addCallbacks(t,e,a,n,f);return a},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){_.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},o.prototype._promiseAt=function(t){return this[4*t-4+2]},o.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},o.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,r,n,i,null)},o.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(r,n,i,o,null)},o.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:d.domainBind(i,e));else{var s=4*o-4;this[s+2]=r,this[s+3]=n,"function"==typeof t&&(this[s+0]=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:d.domainBind(i,e))}return this._setLength(o+1),o},o.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},o.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var r=k(t,this);if(!(r instanceof o))return this._fulfill(t);e&&this._propagateFrom(r,2);var n=r._target();if(n===this)return void this._reject(l());var i=n._bitField;if(0===(50397184&i)){var s=this._length();s>0&&n._migrateCallback0(this);for(var a=1;s>a;++a)n._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!==(33554432&i))this._fulfill(n._value());else if(0!==(16777216&i))this._reject(n._reason());else{var u=new b("late cancellation observer");n._attachExtraTrace(u),this._reject(u)}}},o.prototype._rejectCallback=function(t,e,r){var n=d.ensureErrorObject(t),i=n===t;if(!i&&!r&&j.warnings()){var o="a promise was rejected with a non-error: "+d.classString(t);this._warn(o,!0)}this._attachExtraTrace(n,e?i:!1),this._reject(t)},o.prototype._resolveFromExecutor=function(t){if(t!==w){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,r)});r=!1,this._popContext(),void 0!==n&&e._rejectCallback(n,!0)}},o.prototype._settlePromiseFromHandler=function(t,e,r,n){var i=n._bitField;if(0===(65536&i)){n._pushContext();var o;e===x?r&&"number"==typeof r.length?o=I(t).apply(this._boundValue(),r):(o=R,o.e=new m("cannot .spread() a non-array: "+d.classString(r))):o=I(t).call(e,r);var s=n._popContext();i=n._bitField,0===(65536&i)&&(o===E?n._reject(r):o===R?n._rejectCallback(o.e,!1):(j.checkForgottenReturns(o,s,"",n,this),n._resolveCallback(o)))}},o.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},o.prototype._followee=function(){return this._rejectionHandler0},o.prototype._setFollowee=function(t){this._rejectionHandler0=t},o.prototype._settlePromise=function(t,e,r,i){var s=t instanceof o,a=this._bitField,u=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof P&&r.isFinallyHandler()?(r.cancelPromise=t,I(e).call(r,i)===R&&t._reject(R.e)):e===f?t._fulfill(f.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof C?t._cancel():r.cancel()):"function"==typeof e?s?(u&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,i,t)):e.call(r,i,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(i,t):r._promiseRejected(i,t)):s&&(u&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(i):t._reject(i))},o.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,r=t.promise,n=t.receiver,i=t.value;"function"==typeof e?r instanceof o?this._settlePromiseFromHandler(e,n,i,r):e.call(n,i,r):r instanceof o&&r._reject(i)},o.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},o.prototype._settlePromise0=function(t,e,r){var n=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,t,i,e)},o.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},o.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var r=l();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():_.settlePromises(this))}},o.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?_.fatalError(t,d.isNode):void((65535&e)>0?_.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(t,e){for(var r=1;t>r;r++){var n=this._fulfillmentHandlerAt(r),i=this._promiseAt(r),o=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(i,n,o,e)}},o.prototype._rejectPromises=function(t,e){for(var r=1;t>r;r++){var n=this._rejectionHandlerAt(r),i=this._promiseAt(r),o=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(i,n,o,e)}},o.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){j.deprecated("Promise.defer","new Promise");var t=new o(w);return{promise:t,resolve:s,reject:a}},d.notEnumerableProp(o,"_makeSelfResolutionError",l),e("./method")(o,w,k,h,j),e("./bind")(o,w,k,j),e("./cancel")(o,C,h,j),e("./direct_resolve")(o),e("./synchronous_inspection")(o),e("./join")(o,C,k,w,_,c),o.Promise=o,o.version="3.5.0",e("./map.js")(o,C,h,k,w,j),e("./call_get.js")(o),e("./using.js")(o,h,k,S,w,j),e("./timers.js")(o,w,j),e("./generators.js")(o,h,w,k,n,j),e("./nodeify.js")(o),e("./promisify.js")(o,w),e("./props.js")(o,C,k,h),e("./race.js")(o,w,k,h),e("./reduce.js")(o,C,h,k,w,j),e("./settle.js")(o,C,j),e("./some.js")(o,C,h),e("./filter.js")(o,w),e("./each.js")(o,w),e("./any.js")(o),d.toFastProperties(o),d.toFastProperties(o.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new o(w)),j.setBounds(y.firstLineError,d.lastLineError),o}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function s(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function a(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=t("./util");u.isArray;return u.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function c(t,r){var o=n(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(c,this._reject,void 0,this,r);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=u.asArray(o),null===o){var l=i("expecting an array or an iterable object but got "+u.classString(o)).reason();return void this._promise._rejectCallback(l,!1)}return 0===o.length?void(-5===r?this._resolveEmptyArray():this._resolve(s(r))):void this._iterate(o)},a.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,s=null,a=0;r>a;++a){var u=n(t[a],i);u instanceof e?(u=u._target(),s=u._bitField):s=null,o?null!==s&&u.suppressUnhandledRejections():null!==s?0===(50397184&s)?(u._proxy(this,a),this._values[a]=u):o=0!==(33554432&s)?this._promiseFulfilled(u._value(),a):0!==(16777216&s)?this._promiseRejected(u._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(u,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;return r>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r<t.length;++r)t[r]instanceof e&&t[r].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},{"./util":36}],24:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){return!x.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=p.getDataPropertyOrDefault(t,e+r,b);return n?i(n):!1}function s(t,e,r){for(var n=0;n<t.length;n+=2){var i=t[n];if(r.test(i))for(var o=i.replace(r,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}function a(t,e,r,n){for(var a=p.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],f=t[l],h=n===E?!0:E(l,f,t);"function"!=typeof f||i(f)||o(t,l,e)||!n(l,f,t,h)||u.push(l,f)}return s(u,e,r),u}function u(t,n,i,o,s,a){function u(){var i=n;n===h&&(i=this);var o=new e(r);
o._captureStackTrace();var s="string"==typeof l&&this!==c?this[l]:t,u=d(o,a);try{s.apply(i,v(arguments,u))}catch(f){o._rejectCallback(y(f),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var c=function(){return this}(),l=t;return"string"==typeof l&&(t=o),p.notEnumerableProp(u,"__isPromisified__",!0),u}function c(t,e,r,n,i){for(var o=new RegExp(k(e)+"$"),s=a(t,e,o,r),u=0,c=s.length;c>u;u+=2){var l=s[u],f=s[u+1],d=l+e;if(n===C)t[d]=C(l,h,l,f,e,i);else{var v=n(f,function(){return C(l,h,l,f,e,i)});p.notEnumerableProp(v,"__isPromisified__",!0),t[d]=v}}return p.toFastProperties(t),t}function l(t,e,r){return C(t,e,void 0,t,null,r)}var f,h={},p=t("./util"),d=t("./nodeback"),v=p.withAppended,y=p.maybeWrapAsError,_=p.canEvaluate,g=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],x=new RegExp("^(?:"+w.join("|")+")$"),E=function(t){return p.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){return t.replace(/([$])/,"\\$")},C=_?f:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("expecting a function but got "+p.classString(t));if(i(t))return t;e=Object(e);var r=void 0===e.context?h:e.context,o=!!e.multiArgs,s=l(t,r,o);return p.copyDescriptors(t,s,n),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var r=!!e.multiArgs,n=e.suffix;"string"!=typeof n&&(n=m);var i=e.filter;"function"!=typeof i&&(i=E);var o=e.promisifier;if("function"!=typeof o&&(o=C),!p.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=p.inheritedDataKeys(t),a=0;a<s.length;++a){var u=t[s[a]];"constructor"!==s[a]&&p.isClass(u)&&(c(u.prototype,n,i,o,r),c(u,n,i,o,r))}return c(t,n,i,o,r)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t){var e,r=!1;if(void 0!==a&&t instanceof a)e=f(t),r=!0;else{var n=l.keys(t),i=n.length;e=new Array(2*i);for(var o=0;i>o;++o){var s=n[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=r,this._init$(void 0,r?-6:-3)}function s(t){var r,s=n(t);return c(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,2),r):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,u=t("./util"),c=u.isObject,l=t("./es5");"function"==typeof Map&&(a=Map);var f=function(){function t(t,n){this[e]=t,this[e+r]=n,e++}var e=0,r=0;return function(n){r=n.size,e=0;var i=new Array(2*n.size);return n.forEach(t,i),i}}(),h=function(t){for(var e=new a,r=t.length/2|0,n=0;r>n;++n){var i=t[r+n],o=t[n];e.set(i,o)}return e};u.inherits(o,r),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){var n;if(this._isMap)n=h(this._values);else{n={};for(var i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o]}return this._resolve(n),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var r=this._front+e&this._capacity-1;this[r]=t,this._length=e+1},i.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=r,this._length=n},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var r=this._front,i=this._length,o=r+i&e-1;n(this,0,this,e,o)},e.exports=i},{}],27:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t,o){var u=n(t);if(u instanceof e)return a(u);if(t=s.asArray(t),null===t)return i("expecting an array or an iterable object but got "+s.classString(t));var c=new e(r);void 0!==o&&c._propagateFrom(o,3);for(var l=c._fulfill,f=c._reject,h=0,p=t.length;p>h;++h){var d=t[h];(void 0!==d||h in t)&&e.cast(d)._then(l,f,void 0,c,null)}return c}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,s){function a(t,r,n,i){this.constructor$(t);var s=h();this._fn=null===s?r:p.domainBind(s,r),void 0!==n&&(n=e.resolve(n),n._attachCancellationCallback(this)),this._initialValue=n,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function u(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function c(t,e,r,i){if("function"!=typeof e)return n("expecting a function but got "+p.classString(e));var o=new a(t,e,r,i);return o.promise()}function l(t){this.accum=t,this.array._gotAccum(t);var r=i(this.value,this.array._promise);return r instanceof e?(this.array._currentCancellable=r,r._then(f,void 0,void 0,this,void 0)):f.call(this,r)}function f(t){var r=this.array,n=r._promise,i=d(r._fn);n._pushContext();var o;o=void 0!==r._eachValues?i.call(n._boundValue(),t,this.index,this.length):i.call(n._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(r._currentCancellable=o);var a=n._popContext();return s.checkForgottenReturns(o,a,void 0!==r._eachValues?"Promise.each":"Promise.reduce",n),o}var h=e._getDomain,p=t("./util"),d=p.tryCatch;p.inherits(a,r),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var r,n,i=t.length;if(void 0!==this._initialValue?(r=this._initialValue,n=0):(r=e.resolve(t[0]),n=1),this._currentCancellable=r,!r.isRejected())for(;i>n;++n){var o={accum:null,value:t[n],index:n,length:i,array:this};r=r._then(l,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(u,u,void 0,r,this)},e.prototype.reduce=function(t,e){return c(this,t,e,null)},e.reduce=function(t,e,r,n){return c(t,e,r,n)}}},{"./util":36}],29:[function(e,r,i){"use strict";var o,s=e("./util"),a=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},u=s.getNativePromise();if(s.isNode&&"undefined"==typeof MutationObserver){var c=n.setImmediate,l=t.nextTick;o=s.isRecentNode?function(t){c.call(n,t)}:function(e){l.call(t,e)}}else if("function"==typeof u&&"function"==typeof u.resolve){var f=u.resolve();o=function(t){f.then(t)}}else o="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:a:function(){var t=document.createElement("div"),e={attributes:!0},r=!1,n=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),r=!1});i.observe(n,e);var o=function(){r||(r=!0,n.classList.toggle("foo"))};return function(r){var n=new MutationObserver(function(){n.disconnect(),r()});n.observe(t,e),o()}}();r.exports=o},{"./util":36}],30:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,r),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;return r>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var r=new o;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},i.prototype._promiseRejected=function(t,e){var r=new o;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util"),a=t("./errors").RangeError,u=t("./errors").AggregateError,c=s.isArray,l={};s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u,e=this.length();e<this._values.length;++e)this._values[e]!==l&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(l(t)){if(t instanceof e)return t;var i=o(t);if(i===c){n&&n._pushContext();var u=e.reject(i.e);return n&&n._popContext(),u}if("function"==typeof i){if(s(t)){var u=new e(r);return t._then(u._fulfill,u._reject,void 0,u,null),u}return a(t,i,n)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return c.e=e,c}}function s(t){try{return f.call(t,"_promise0")}catch(e){return!1}}function a(t,n,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,f,!0),a=null)}var a=new e(r),l=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var f=!0,h=u.tryCatch(n).call(t,o,s);return f=!1,a&&h===c&&(a._rejectCallback(h.e,!0,!0),a=null),l}var u=t("./util"),c=u.errorObj,l=u.isObject,f={}.hasOwnProperty;return n}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),u=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(c,null,null,t,void 0),n.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(r),a=setTimeout(function(){s._fulfill()},+t),n.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return l(t,this)};var f=function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),a.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()};e.prototype.timeout=function(t,e){t=+t;var r,a,u=new i(setTimeout(function(){r.isPending()&&f(r,e,a)},t));return n.cancellation()?(a=this.then(),r=a._then(o,s,void 0,u,void 0),r._setOnCancel(u)):r=this._then(o,s,void 0,u,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,s){function a(t){setTimeout(function(){throw t},0)}function u(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function c(t,r){function i(){if(s>=c)return l._fulfill();var o=u(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=n(o._getDisposer().tryDispose(r),t.promise)}catch(f){return a(f)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,c=t.length,l=new e(o);return i(),l}function l(t,e,r){this._data=t,this._promise=e,this._context=r}function f(t,e,r){this.constructor$(t,e,r)}function h(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function p(t){this.length=t,this.promise=null,this[t-1]=null}var d=t("./util"),v=t("./errors").TypeError,y=t("./util").inherits,_=d.errorObj,g=d.tryCatch,m={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},l.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==m?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},y(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},p.prototype._resultCancelled=function(){for(var t=this.length,r=0;t>r;++r){var n=this[r];n instanceof e&&n.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("expecting a function but got "+d.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var u=new p(t),f=0;t>f;++f){var v=o[f];if(l.isDisposer(v)){var y=v;v=v.promise(),v._setDisposable(y)}else{var m=n(v);m instanceof e&&(v=m._then(h,null,null,{resources:u,index:f},void 0))}u[f]=v}for(var b=new Array(u.length),f=0;f<b.length;++f)b[f]=e.resolve(u[f]).reflect();var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var r=t[e];if(r.isRejected())return _.e=r.error(),_;if(!r.isFulfilled())return void w.cancel();t[e]=r.value()}x._pushContext(),i=g(i);var n=a?i.apply(void 0,t):i(t),o=x._popContext();return s.checkForgottenReturns(n,o,"Promise.using",x),n}),x=w.lastly(function(){var t=new e.PromiseInspection(w);return c(u,t)});return u.promise=x,x._setOnCancel(u),x},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this,i());throw new v}}},{"./errors":12,"./util":36}],36:[function(e,r,i){"use strict";function o(){try{var t=T;return T=null,t.apply(this,arguments)}catch(e){return A.e=e,A}}function s(t){return T=t,o}function a(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return a(t)?new Error(g(t)):t}function l(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function f(t,e,r){if(!j.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function h(t,e,r){if(a(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return j.defineProperty(t,e,n),t}function p(t){throw t}function d(t){try{if("function"==typeof t){var e=j.names(t.prototype),r=j.isES5&&e.length>1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=L.test(t+"")&&j.names(t).length>0;if(r||n||i)return!0}return!1}catch(o){return!1}}function v(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function y(t){return D.test(t)}function _(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function g(t){try{return t+""}catch(e){return"[no string representation]"}}function m(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function b(t){try{h(t,"isOperational",!0)}catch(e){}}function w(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function x(t){return m(t)&&j.propertyIsWritable(t,"stack")}function E(t){return{}.toString.call(t)}function k(t,e,r){for(var n=j.names(t),i=0;i<n.length;++i){var o=n[i];if(r(o))try{j.defineProperty(e,o,j.getDescriptor(t,o))}catch(s){}}}function C(e){return U?t.env[e]:void 0}function F(){if("function"==typeof Promise)try{var t=new Promise(function(){});if("[object Promise]"==={}.toString.call(t))return Promise}catch(e){}}function S(t,e){return t.bind(e)}var j=e("./es5"),P="undefined"==typeof navigator,A={e:{}},T,R="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof n?n:void 0!==this?this:null,I=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},B=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1};if(j.isES5){var r=Object.getOwnPropertyNames;return function(t){for(var n=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=r(t)}catch(s){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(t,u);null!=c&&null==c.get&&null==c.set&&n.push(u)}}t=j.getPrototypeOf(t)}return n}}var n={}.hasOwnProperty;return function(r){if(e(r))return[];var i=[];t:for(var o in r)if(n.call(r,o))i.push(o);else{for(var s=0;s<t.length;++s)if(n.call(t[s],o))continue t;i.push(o)}return i}}(),L=/this\s*\.\s*\S+\s*=/,D=/^[a-z$_][a-z$_0-9]*$/i,O=function(){return"stack"in new Error?function(t){return x(t)?t:new Error(g(t))}:function(t){if(x(t))return t;try{throw new Error(g(t))}catch(e){return e}}}(),M=function(t){return j.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var V="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,r=[],n=t[Symbol.iterator]();!(e=n.next()).done;)r.push(e.value);return r};M=function(t){return j.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?V(t):null}}var N="undefined"!=typeof t&&"[object process]"===E(t).toLowerCase(),U="undefined"!=typeof t&&"undefined"!=typeof t.env,q={isClass:d,isIdentifier:y,inheritedDataKeys:B,getDataPropertyOrDefault:f,thrower:p,isArray:j.isArray,asArray:M,notEnumerableProp:h,isPrimitive:a,isObject:u,isError:m,canEvaluate:P,errorObj:A,tryCatch:s,inherits:I,withAppended:l,maybeWrapAsError:c,toFastProperties:v,filledRange:_,toString:g,canAttachTrace:x,ensureErrorObject:O,originatesFromRejection:w,markAsOriginatingFromRejection:b,classString:E,copyDescriptors:k,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:N,hasEnvVariables:U,env:C,global:R,getNativePromise:F,domainBind:S};q.isRecentNode=q.isNode&&function(){var e=t.versions.node.split(".").map(Number);return 0===e[0]&&e[1]>10||e[0]>0}(),q.isNode&&q.toFastProperties(t);try{throw new Error}catch(H){q.lastLineError=H}r.exports=q},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:7}],20:[function(t,e,r){function n(t,e,r){if(!a(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===u.call(t)?i(t,e,r):"string"==typeof t?o(t,e,r):s(t,e,r)}function i(t,e,r){for(var n=0,i=t.length;i>n;n++)c.call(t,n)&&e.call(r,t[n],n,t)}function o(t,e,r){for(var n=0,i=t.length;i>n;n++)e.call(r,t.charAt(n),n,t)}function s(t,e,r){for(var n in t)c.call(t,n)&&e.call(r,t[n],n,t)}var a=t("is-function");e.exports=n;var u=Object.prototype.toString,c=Object.prototype.hasOwnProperty},{"is-function":33}],21:[function(t,e,r){"use strict";function n(t,e,r,n,s,u,c,l){if(r/=e,n/=e,c>=r&&n>=l)return t;if(c>n||r>l)return null;for(var f=[],h=0;h<t.length;h++){var p,d,v=t[h],y=v.geometry,_=v.type;if(p=v.min[s],d=v.max[s],p>=r&&n>=d)f.push(v);else if(!(p>n||r>d)){var g=1===_?i(y,r,n,s):o(y,r,n,s,u,3===_);g.length&&f.push(a(v.tags,_,g,v.id))}}return f.length?f:null}function i(t,e,r,n){for(var i=[],o=0;o<t.length;o++){var s=t[o],a=s[n];a>=e&&r>=a&&i.push(s)}return i}function o(t,e,r,n,i,o){for(var a=[],u=0;u<t.length;u++){var c,l,f,h=0,p=0,d=null,v=t[u],y=v.area,_=v.dist,g=v.outer,m=v.length,b=[];for(l=0;m-1>l;l++)c=d||v[l],d=v[l+1],h=p||c[n],p=d[n],e>h?p>r?(b.push(i(c,d,e),i(c,d,r)),o||(b=s(a,b,y,_,g))):p>=e&&b.push(i(c,d,e)):h>r?e>p?(b.push(i(c,d,r),i(c,d,e)),o||(b=s(a,b,y,_,g))):r>=p&&b.push(i(c,d,r)):(b.push(c),e>p?(b.push(i(c,d,e)),o||(b=s(a,b,y,_,g))):p>r&&(b.push(i(c,d,r)),o||(b=s(a,b,y,_,g))));c=v[m-1],h=c[n],h>=e&&r>=h&&b.push(c),f=b[b.length-1],o&&f&&(b[0][0]!==f[0]||b[0][1]!==f[1])&&b.push(b[0]),s(a,b,y,_,g)}return a}function s(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var a=t("./feature")},{"./feature":23}],22:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else"Feature"===t.type?i(r,t,e):i(r,{geometry:t},e);return r}function i(t,e,r){if(null!==e.geometry){var n,a,u,l,f=e.geometry,h=f.type,p=f.coordinates,d=e.properties,v=e.id;if("Point"===h)t.push(c(d,1,[s(p)],v));else if("MultiPoint"===h)t.push(c(d,1,o(p),v));else if("LineString"===h)t.push(c(d,2,[o(p,r)],v));else if("MultiLineString"===h||"Polygon"===h){for(u=[],n=0;n<p.length;n++)l=o(p[n],r),"Polygon"===h&&(l.outer=0===n),u.push(l);t.push(c(d,"Polygon"===h?3:2,u,v))}else if("MultiPolygon"===h){for(u=[],n=0;n<p.length;n++)for(a=0;a<p[n].length;a++)l=o(p[n][a],r),l.outer=0===a,u.push(l);t.push(c(d,3,u,v))}else{if("GeometryCollection"!==h)throw new Error("Input data is not a valid GeoJSON object.");for(n=0;n<f.geometries.length;n++)i(t,{geometry:f.geometries[n],properties:d},r)}}}function o(t,e){for(var r=[],n=0;n<t.length;n++)r.push(s(t[n]));return e&&(u(r,e),a(r)),r}function s(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=0>n?0:n>1?1:n,[r,n,0]}function a(t){for(var e,r,n=0,i=0,o=0;o<t.length-1;o++)e=r||t[o],r=t[o+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}e.exports=n;var u=t("./simplify"),c=t("./feature")},{"./feature":23,"./simplify":25}],23:[function(t,e,r){"use strict";function n(t,e,r,n){var o={id:n||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-(1/0),-(1/0)]};return i(o),o}function i(t){var e=t.geometry,r=t.min,n=t.max;if(1===t.type)o(r,n,e);else for(var i=0;i<e.length;i++)o(r,n,e[i]);return t}function o(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=n},{}],24:[function(t,e,r){"use strict";function n(t,e){return new i(t,e)}function i(t,e){e=this.options=u(Object.create(this.options),e);var r=e.debug;r&&console.time("preprocess data");var n=1<<e.maxZoom,i=l(t,e.tolerance/(n*e.extent));this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=p(i,e.buffer/e.extent,s),i.length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function o(t,e,r){return 32*((1<<t)*r+e)+t}function s(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function a(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function u(t,e){for(var r in e)t[r]=e[r];return t}function c(t,e,r){var n=t.source;if(1!==n.length)return!1;var i=n[0];if(3!==i.type||i.geometry.length>1)return!1;var o=i.geometry[0].length;if(5!==o)return!1;for(var s=0;o>s;s++){var a=f.point(i.geometry[0][s],e,t.z2,t.x,t.y);if(a[0]!==-r&&a[0]!==e+r||a[1]!==-r&&a[1]!==e+r)return!1}return!0}e.exports=n;var l=t("./convert"),f=t("./transform"),h=t("./clip"),p=t("./wrap"),d=t("./tile");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,n,i,u,l){for(var f=[t,e,r,n],p=this.options,v=p.debug,y=null;f.length;){n=f.pop(),r=f.pop(),e=f.pop(),t=f.pop();var _=1<<e,g=o(e,r,n),m=this.tiles[g],b=e===p.maxZoom?0:p.tolerance/(_*p.extent);if(!m&&(v>1&&console.time("creation"),m=this.tiles[g]=d(t,_,r,n,b,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),v)){v>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd("creation"));var w="z"+e;this.stats[w]=(this.stats[w]||0)+1,this.total++}if(m.source=t,i){if(e===p.maxZoom||e===i)continue;var x=1<<i-e;if(r!==Math.floor(u/x)||n!==Math.floor(l/x))continue}else if(e===p.indexMaxZoom||m.numPoints<=p.indexMaxPoints)continue;if(p.solidChildren||!c(m,p.extent,p.buffer)){m.source=null,v>1&&console.time("clipping");var E,k,C,F,S,j,P=.5*p.buffer/p.extent,A=.5-P,T=.5+P,R=1+P;E=k=C=F=null,S=h(t,_,r-P,r+T,0,s,m.min[0],m.max[0]),j=h(t,_,r+A,r+R,0,s,m.min[0],m.max[0]),S&&(E=h(S,_,n-P,n+T,1,a,m.min[1],m.max[1]),k=h(S,_,n+A,n+R,1,a,m.min[1],m.max[1])),j&&(C=h(j,_,n-P,n+T,1,a,m.min[1],m.max[1]),F=h(j,_,n+A,n+R,1,a,m.min[1],m.max[1])),v>1&&console.timeEnd("clipping"),t.length&&(f.push(E||[],e+1,2*r,2*n),f.push(k||[],e+1,2*r,2*n+1),f.push(C||[],e+1,2*r+1,2*n),f.push(F||[],e+1,2*r+1,2*n+1))}else i&&(y=e)}return y},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,s=n.debug,a=1<<t;e=(e%a+a)%a;var u=o(t,e,r);if(this.tiles[u])return f.tile(this.tiles[u],i);s>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,h=t,p=e,d=r;!l&&h>0;)h--,p=Math.floor(p/2),d=Math.floor(d/2),l=this.tiles[o(h,p,d)];if(!l||!l.source)return null;if(s>1&&console.log("found parent tile z%d-%d-%d",h,p,d),c(l,i,n.buffer))return f.tile(l,i);s>1&&console.time("drilling down");var v=this.splitTile(l.source,h,p,d,t,e,r);if(s>1&&console.timeEnd("drilling down"),null!==v){var y=1<<t-v;u=o(v,Math.floor(e/y),Math.floor(r/y))}return this.tiles[u]?f.tile(this.tiles[u],i):null}},{"./clip":21,"./convert":22,"./tile":26,"./transform":27,"./wrap":28}],25:[function(t,e,r){"use strict";function n(t,e){var r,n,o,s,a=e*e,u=t.length,c=0,l=u-1,f=[];for(t[c][2]=1,t[l][2]=1;l;){for(n=0,r=c+1;l>r;r++)o=i(t[r],t[c],t[l]),o>n&&(s=r,n=o);n>a?(t[s][2]=n,f.push(c),f.push(s),c=s):(l=f.pop(),c=f.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],s=r[1],a=t[0],u=t[1],c=o-n,l=s-i;if(0!==c||0!==l){var f=((a-n)*c+(u-i)*l)/(c*c+l*l);f>1?(n=o,i=s):f>0&&(n+=c*f,i+=l*f)}return c=a-n,l=u-i,c*c+l*l}e.exports=n},{}],26:[function(t,e,r){"use strict";function n(t,e,r,n,o,s){for(var a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;u<t.length;u++){a.numFeatures++,i(a,t[u],o,s);var c=t[u].min,l=t[u].max;c[0]<a.min[0]&&(a.min[0]=c[0]),c[1]<a.min[1]&&(a.min[1]=c[1]),l[0]>a.max[0]&&(a.max[0]=l[0]),l[1]>a.max[1]&&(a.max[1]=l[1])}return a}function i(t,e,r,n){var i,s,a,u,c=e.geometry,l=e.type,f=[],h=r*r;if(1===l)for(i=0;i<c.length;i++)f.push(c[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<c.length;i++)if(a=c[i],n||!(2===l&&a.dist<r||3===l&&a.area<h)){var p=[];for(s=0;s<a.length;s++)u=a[s],(n||u[2]>h)&&(p.push(u),t.numSimplified++),t.numPoints++;3===l&&o(p,a.outer),f.push(p)}else t.numPoints+=a.length;if(f.length){var d={geometry:f,type:l,tags:e.tags||null
};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=s(t);0>r===e&&t.reverse()}function s(t){for(var e,r,n=0,i=0,o=t.length,s=o-1;o>i;s=i++)e=t[i],r=t[s],n+=(r[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],27:[function(t,e,r){"use strict";function n(t,e){if(t.transformed)return t;var r,n,o,s=t.z2,a=t.x,u=t.y;for(r=0;r<t.features.length;r++){var c=t.features[r],l=c.geometry,f=c.type;if(1===f)for(n=0;n<l.length;n++)l[n]=i(l[n],e,s,a,u);else for(n=0;n<l.length;n++){var h=l[n];for(o=0;o<h.length;o++)h[o]=i(h[o],e,s,a,u)}}return t.transformed=!0,t}function i(t,e,r,n,i){var o=Math.round(e*(t[0]*r-n)),s=Math.round(e*(t[1]*r-i));return[o,s]}r.tile=n,r.point=i},{}],28:[function(t,e,r){"use strict";function n(t,e,r){var n=t,o=s(t,1,-1-e,e,0,r,-1,2),a=s(t,1,1-e,2+e,0,r,-1,2);return(o||a)&&(n=s(t,1,-e,1+e,0,r,-1,2)||[],o&&(n=i(o,1).concat(n)),a&&(n=n.concat(i(a,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,s=t[n],u=s.type;if(1===u)i=o(s.geometry,e);else{i=[];for(var c=0;c<s.geometry.length;c++)i.push(o(s.geometry[c],e))}r.push(a(s.tags,u,i,s.id))}return r}function o(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var s=t("./clip"),a=t("./feature");e.exports=n},{"./clip":21,"./feature":23}],29:[function(t,e,r){(function(t){"undefined"!=typeof window?e.exports=window:"undefined"!=typeof t?e.exports=t:"undefined"!=typeof self?e.exports=self:e.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],30:[function(t,e,r){!function(t,r,n){"use strict";"function"==typeof define?define(r):"undefined"!=typeof e&&e.exports?e.exports=r():n[t]=r()}("IDBStore",function(){"use strict";function t(t,e){var r,n;for(r in e)n=e[r],n!==a[r]&&n!==t[r]&&(t[r]=n);return t}function e(t){return"error"in t.target?"VersionError"==t.target.error.name:"errorCode"in t.target?12==t.target.errorCode:!1}var r=function(t){throw t},n=function(){},i={storeName:"Store",storePrefix:"IDBWrapper-",dbVersion:1,keyPath:"id",autoIncrement:!0,onStoreReady:function(){},onError:r,indexes:[],implementationPreference:["indexedDB","webkitIndexedDB","mozIndexedDB","shimIndexedDB"]},o=function(t,e){"undefined"==typeof e&&"function"==typeof t&&(e=t),"[object Object]"!=Object.prototype.toString.call(t)&&(t={});for(var r in i)this[r]="undefined"!=typeof t[r]?t[r]:i[r];this.dbName=this.storePrefix+this.storeName,this.dbVersion=parseInt(this.dbVersion,10)||1,e&&(this.onStoreReady=e);var n="object"==typeof window?window:self,o=this.implementationPreference.filter(function(t){return t in n});this.implementation=o[0],this.idb=n[this.implementation],this.keyRange=n.IDBKeyRange||n.webkitIDBKeyRange||n.mozIDBKeyRange,this.consts={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchange",NEXT:"next",NEXT_NO_DUPLICATE:"nextunique",PREV:"prev",PREV_NO_DUPLICATE:"prevunique"},this.openDB()},s={constructor:o,version:"1.7.1",db:null,dbName:null,dbVersion:null,store:null,storeName:null,storePrefix:null,keyPath:null,autoIncrement:null,indexes:null,implementationPreference:null,implementation:"",onStoreReady:null,onError:null,_insertIdCount:0,openDB:function(){var t=this.idb.open(this.dbName,this.dbVersion),r=!1;t.onerror=function(t){if(e(t))this.onError(new Error("The version number provided is lower than the existing one."));else{var r;if(t.target.error)r=t.target.error;else{var n="IndexedDB unknown error occurred when opening DB "+this.dbName+" version "+this.dbVersion;"errorCode"in t.target&&(n+=" with error code "+t.target.errorCode),r=new Error(n)}this.onError(r)}}.bind(this),t.onsuccess=function(t){if(!r){if(this.db)return void this.onStoreReady();if(this.db=t.target.result,"string"==typeof this.db.version)return void this.onError(new Error("The IndexedDB implementation in this browser is outdated. Please upgrade your browser."));if(!this.db.objectStoreNames.contains(this.storeName))return void this.onError(new Error("Object store couldn't be created."));var e=this.db.transaction([this.storeName],this.consts.READ_ONLY);this.store=e.objectStore(this.storeName);var n=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(t){var e=t.name;if(!e)return r=!0,void this.onError(new Error("Cannot create index: No index name given."));if(this.normalizeIndexData(t),this.hasIndex(e)){var i=this.store.index(e),o=this.indexComplies(i,t);o||(r=!0,this.onError(new Error('Cannot modify index "'+e+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),n.splice(n.indexOf(e),1)}else r=!0,this.onError(new Error('Cannot create new index "'+e+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))},this),n.length&&(r=!0,this.onError(new Error('Cannot delete index(es) "'+n.toString()+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),r||this.onStoreReady()}}.bind(this),t.onupgradeneeded=function(t){if(this.db=t.target.result,this.db.objectStoreNames.contains(this.storeName))this.store=t.target.transaction.objectStore(this.storeName);else{var e={autoIncrement:this.autoIncrement};null!==this.keyPath&&(e.keyPath=this.keyPath),this.store=this.db.createObjectStore(this.storeName,e)}var n=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(t){var e=t.name;if(e||(r=!0,this.onError(new Error("Cannot create index: No index name given."))),this.normalizeIndexData(t),this.hasIndex(e)){var i=this.store.index(e),o=this.indexComplies(i,t);o||(this.store.deleteIndex(e),this.store.createIndex(e,t.keyPath,{unique:t.unique,multiEntry:t.multiEntry})),n.splice(n.indexOf(e),1)}else this.store.createIndex(e,t.keyPath,{unique:t.unique,multiEntry:t.multiEntry})},this),n.length&&n.forEach(function(t){this.store.deleteIndex(t)},this)}.bind(this)},deleteDatabase:function(t,e){if(this.idb.deleteDatabase){this.db.close();var r=this.idb.deleteDatabase(this.dbName);r.onsuccess=t,r.onerror=e}else e(new Error("Browser does not support IndexedDB deleteDatabase!"))},put:function(t,e,i,o){null!==this.keyPath&&(o=i,i=e,e=t),o||(o=r),i||(i=n);var s,a=!1,u=null,c=this.db.transaction([this.storeName],this.consts.READ_WRITE);return c.oncomplete=function(){var t=a?i:o;t(u)},c.onabort=o,c.onerror=o,null!==this.keyPath?(this._addIdPropertyIfNeeded(e),s=c.objectStore(this.storeName).put(e)):s=c.objectStore(this.storeName).put(e,t),s.onsuccess=function(t){a=!0,u=t.target.result},s.onerror=o,c},get:function(t,e,i){i||(i=r),e||(e=n);var o=!1,s=null,a=this.db.transaction([this.storeName],this.consts.READ_ONLY);a.oncomplete=function(){var t=o?e:i;t(s)},a.onabort=i,a.onerror=i;var u=a.objectStore(this.storeName).get(t);return u.onsuccess=function(t){o=!0,s=t.target.result},u.onerror=i,a},remove:function(t,e,i){i||(i=r),e||(e=n);var o=!1,s=null,a=this.db.transaction([this.storeName],this.consts.READ_WRITE);a.oncomplete=function(){var t=o?e:i;t(s)},a.onabort=i,a.onerror=i;var u=a.objectStore(this.storeName)["delete"](t);return u.onsuccess=function(t){o=!0,s=t.target.result},u.onerror=i,a},batch:function(t,e,i){if(i||(i=r),e||(e=n),"[object Array]"!=Object.prototype.toString.call(t))i(new Error("dataArray argument must be of type Array."));else if(0===t.length)return e(!0);var o=t.length,s=!1,a=!1,u=this.db.transaction([this.storeName],this.consts.READ_WRITE);u.oncomplete=function(){var t=a?e:i;t(a)},u.onabort=i,u.onerror=i;var c=function(){o--,0!==o||s||(s=!0,a=!0)};return t.forEach(function(t){var e=t.type,r=t.key,n=t.value,o=function(t){u.abort(),s||(s=!0,i(t,e,r))};if("remove"==e){var a=u.objectStore(this.storeName)["delete"](r);a.onsuccess=c,a.onerror=o}else if("put"==e){var l;null!==this.keyPath?(this._addIdPropertyIfNeeded(n),l=u.objectStore(this.storeName).put(n)):l=u.objectStore(this.storeName).put(n,r),l.onsuccess=c,l.onerror=o}},this),u},putBatch:function(t,e,r){var n=t.map(function(t){return{type:"put",value:t}});return this.batch(n,e,r)},upsertBatch:function(t,e,i,o){"function"==typeof e&&(i=e,o=i,e={}),o||(o=r),i||(i=n),e||(e={}),"[object Array]"!=Object.prototype.toString.call(t)&&o(new Error("dataArray argument must be of type Array."));var s=e.keyField||this.keyPath,a=t.length,u=!1,c=!1,l=0,f=this.db.transaction([this.storeName],this.consts.READ_WRITE);f.oncomplete=function(){c?i(t):o(!1)},f.onabort=o,f.onerror=o;var h=function(e){var r=t[l++];r[s]=e.target.result,a--,0!==a||u||(u=!0,c=!0)};return t.forEach(function(t){var e,r=t.key,n=function(t){f.abort(),u||(u=!0,o(t))};null!==this.keyPath?(this._addIdPropertyIfNeeded(t),e=f.objectStore(this.storeName).put(t)):e=f.objectStore(this.storeName).put(t,r),e.onsuccess=h,e.onerror=n},this),f},removeBatch:function(t,e,r){var n=t.map(function(t){return{type:"remove",key:t}});return this.batch(n,e,r)},getBatch:function(t,e,i,o){if(i||(i=r),e||(e=n),o||(o="sparse"),"[object Array]"!=Object.prototype.toString.call(t))i(new Error("keyArray argument must be of type Array."));else if(0===t.length)return e([]);var s=[],a=t.length,u=!1,c=!1,l=null,f=this.db.transaction([this.storeName],this.consts.READ_ONLY);f.oncomplete=function(){var t=c?e:i;t(l)},f.onabort=i,f.onerror=i;var h=function(t){t.target.result||"dense"==o?s.push(t.target.result):"sparse"==o&&s.length++,a--,0===a&&(u=!0,c=!0,l=s)};return t.forEach(function(t){var e=function(t){u=!0,l=t,i(t),f.abort()},r=f.objectStore(this.storeName).get(t);r.onsuccess=h,r.onerror=e},this),f},getAll:function(t,e){e||(e=r),t||(t=n);var i=this.db.transaction([this.storeName],this.consts.READ_ONLY),o=i.objectStore(this.storeName);return o.getAll?this._getAllNative(i,o,t,e):this._getAllCursor(i,o,t,e),i},_getAllNative:function(t,e,r,n){var i=!1,o=null;t.oncomplete=function(){var t=i?r:n;t(o)},t.onabort=n,t.onerror=n;var s=e.getAll();s.onsuccess=function(t){i=!0,o=t.target.result},s.onerror=n},_getAllCursor:function(t,e,r,n){var i=[],o=!1,s=null;t.oncomplete=function(){var t=o?r:n;t(s)},t.onabort=n,t.onerror=n;var a=e.openCursor();a.onsuccess=function(t){var e=t.target.result;e?(i.push(e.value),e["continue"]()):(o=!0,s=i)},a.onError=n},clear:function(t,e){e||(e=r),t||(t=n);var i=!1,o=null,s=this.db.transaction([this.storeName],this.consts.READ_WRITE);s.oncomplete=function(){var r=i?t:e;r(o)},s.onabort=e,s.onerror=e;var a=s.objectStore(this.storeName).clear();return a.onsuccess=function(t){i=!0,o=t.target.result},a.onerror=e,s},_addIdPropertyIfNeeded:function(t){"undefined"==typeof t[this.keyPath]&&(t[this.keyPath]=this._insertIdCount++ +Date.now())},getIndexList:function(){return this.store.indexNames},hasIndex:function(t){return this.store.indexNames.contains(t)},normalizeIndexData:function(t){t.keyPath=t.keyPath||t.name,t.unique=!!t.unique,t.multiEntry=!!t.multiEntry},indexComplies:function(t,e){var r=["keyPath","unique","multiEntry"].every(function(r){if("multiEntry"==r&&void 0===t[r]&&e[r]===!1)return!0;if("keyPath"==r&&"[object Array]"==Object.prototype.toString.call(e[r])){var n=e.keyPath,i=t.keyPath;if("string"==typeof i)return n.toString()==i;if("function"!=typeof i.contains&&"function"!=typeof i.indexOf)return!1;if(i.length!==n.length)return!1;for(var o=0,s=n.length;s>o;o++)if(!(i.contains&&i.contains(n[o])||i.indexOf(-1!==n[o])))return!1;return!0}return e[r]==t[r]});return r},iterate:function(e,n){n=t({index:null,order:"ASC",autoContinue:!0,filterDuplicates:!1,keyRange:null,writeAccess:!1,onEnd:null,onError:r,limit:1/0,offset:0,allowItemRejection:!1},n||{});var i="desc"==n.order.toLowerCase()?"PREV":"NEXT";n.filterDuplicates&&(i+="_NO_DUPLICATE");var o=!1,s=this.db.transaction([this.storeName],this.consts[n.writeAccess?"READ_WRITE":"READ_ONLY"]),a=s.objectStore(this.storeName);n.index&&(a=a.index(n.index));var u=0;s.oncomplete=function(){return o?void(n.onEnd?n.onEnd():e(null)):void n.onError(null)},s.onabort=n.onError,s.onerror=n.onError;var c=a.openCursor(n.keyRange,this.consts[i]);return c.onerror=n.onError,c.onsuccess=function(t){var r=t.target.result;if(r)if(n.offset)r.advance(n.offset),n.offset=0;else{var i=e(r.value,r,s);n.allowItemRejection&&i===!1||u++,n.autoContinue&&(u+n.offset<n.limit?r["continue"]():o=!0)}else o=!0},s},query:function(t,e){var r=[],n=0;return e=e||{},e.autoContinue=!0,e.writeAccess=!1,e.allowItemRejection=!!e.filter,e.onEnd=function(){t(r,n)},this.iterate(function(t){n++;var i=e.filter?e.filter(t):!0;return i!==!1&&r.push(t),i},e)},count:function(e,n){n=t({index:null,keyRange:null},n||{});var i=n.onError||r,o=!1,s=null,a=this.db.transaction([this.storeName],this.consts.READ_ONLY);a.oncomplete=function(){var t=o?e:i;t(s)},a.onabort=i,a.onerror=i;var u=a.objectStore(this.storeName);n.index&&(u=u.index(n.index));var c=u.count(n.keyRange);return c.onsuccess=function(t){o=!0,s=t.target.result},c.onError=i,a},makeKeyRange:function(t){var e,r="undefined"!=typeof t.lower,n="undefined"!=typeof t.upper,i="undefined"!=typeof t.only;switch(!0){case i:e=this.keyRange.only(t.only);break;case r&&n:e=this.keyRange.bound(t.lower,t.upper,t.excludeLower,t.excludeUpper);break;case r:e=this.keyRange.lowerBound(t.lower,t.excludeLower);break;case n:e=this.keyRange.upperBound(t.upper,t.excludeUpper);break;default:throw new Error('Cannot create KeyRange. Provide one or both of "lower" or "upper" value, or an "only" value.')}return e}},a={};return o.prototype=s,o.version=s.version,o},this)},{}],31:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,v=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*v}},{}],32:[function(t,e,r){arguments[4][6][0].apply(r,arguments)},{dup:6}],33:[function(t,e,r){function n(t){var e=i.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}e.exports=n;var i=Object.prototype.toString},{}],34:[function(t,e,r){function n(t){return i.isBuffer(t)||/\[object (.+Array|Array.+)\]/.test(Object.prototype.toString.call(t))}var i=t("buffer").Buffer;e.exports=n},{buffer:1}],35:[function(t,e,r){!function(){function t(t,r){this.title=t.title,this.stateName=t.stateName?t.stateName:"unnamed-state",this.icon=L.DomUtil.create("span",""),L.DomUtil.addClass(this.icon,"button-state state-"+this.stateName.replace(/(^\s*|\s*$)/g,"")),this.icon.innerHTML=e(t.icon),this.onClick=L.Util.bind(t.onClick?t.onClick:function(){},r)}function e(t){var e;return t.match(/[&;=<>"']/)?e=t:(t=t.replace(/(^\s*|\s*$)/g,""),e=L.DomUtil.create("span",""),0===t.indexOf("fa-")?L.DomUtil.addClass(e,"fa "+t):0===t.indexOf("glyphicon-")?L.DomUtil.addClass(e,"glyphicon "+t):L.DomUtil.addClass(e,t),e=e.outerHTML),e}L.Control.EasyBar=L.Control.extend({options:{position:"topleft",id:null,leafletClasses:!0},initialize:function(t,e){e&&L.Util.setOptions(this,e),this._buildContainer(),this._buttons=[];for(var r=0;r<t.length;r++)t[r]._bar=this,t[r]._container=t[r].button,this._buttons.push(t[r]),this.container.appendChild(t[r].button)},_buildContainer:function(){this._container=this.container=L.DomUtil.create("div",""),this.options.leafletClasses&&L.DomUtil.addClass(this.container,"leaflet-bar easy-button-container leaflet-control"),this.options.id&&(this.container.id=this.options.id)},enable:function(){return L.DomUtil.addClass(this.container,"enabled"),L.DomUtil.removeClass(this.container,"disabled"),this.container.setAttribute("aria-hidden","false"),this},disable:function(){return L.DomUtil.addClass(this.container,"disabled"),L.DomUtil.removeClass(this.container,"enabled"),this.container.setAttribute("aria-hidden","true"),this},onAdd:function(){return this.container},addTo:function(t){this._map=t;for(var e=0;e<this._buttons.length;e++)this._buttons[e]._map=t;var r=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return L.DomUtil.addClass(r,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}}),L.easyBar=function(){for(var t=[L.Control.EasyBar],e=0;e<arguments.length;e++)t.push(arguments[e]);return new(Function.prototype.bind.apply(L.Control.EasyBar,t))},L.Control.EasyButton=L.Control.extend({options:{position:"topleft",id:null,type:"replace",states:[],leafletClasses:!0,tagName:"button"},initialize:function(e,r,n,i){this.options.states=[],null!=i&&(this.options.id=i),this.storage={},"object"==typeof arguments[arguments.length-1]&&L.Util.setOptions(this,arguments[arguments.length-1]),0===this.options.states.length&&"string"==typeof e&&"function"==typeof r&&this.options.states.push({icon:e,onClick:r,title:"string"==typeof n?n:""}),this._states=[];for(var o=0;o<this.options.states.length;o++)this._states.push(new t(this.options.states[o],this));this._buildButton(),this._activateState(this._states[0])},_buildButton:function(){if(this.button=L.DomUtil.create(this.options.tagName,""),"button"===this.tagName&&(this.button.type="button"),this.options.id&&(this.button.id=this.options.id),this.options.leafletClasses&&L.DomUtil.addClass(this.button,"easy-button-button leaflet-bar-part leaflet-interactive"),L.DomEvent.addListener(this.button,"dblclick",L.DomEvent.stop),L.DomEvent.addListener(this.button,"mousedown",L.DomEvent.stop),L.DomEvent.addListener(this.button,"click",function(t){L.DomEvent.stop(t),this._currentState.onClick(this,this._map?this._map:null),this._map.getContainer().focus()},this),"replace"==this.options.type)this.button.appendChild(this._currentState.icon);else for(var t=0;t<this._states.length;t++)this.button.appendChild(this._states[t].icon)},_currentState:{stateName:"unnamed",icon:function(){return document.createElement("span")}()},_states:null,state:function(t){return"string"==typeof t?this._activateStateNamed(t):"number"==typeof t&&this._activateState(this._states[t]),this},_activateStateNamed:function(t){for(var e=0;e<this._states.length;e++)this._states[e].stateName==t&&this._activateState(this._states[e])},_activateState:function(t){if(t!==this._currentState){"replace"==this.options.type&&(this.button.appendChild(t.icon),this.button.removeChild(this._currentState.icon)),t.title?this.button.title=t.title:this.button.removeAttribute("title");for(var e=0;e<this._states.length;e++)L.DomUtil.removeClass(this._states[e].icon,this._currentState.stateName+"-active"),L.DomUtil.addClass(this._states[e].icon,t.stateName+"-active");L.DomUtil.removeClass(this.button,this._currentState.stateName+"-active"),L.DomUtil.addClass(this.button,t.stateName+"-active"),this._currentState=t}},enable:function(){return L.DomUtil.addClass(this.button,"enabled"),L.DomUtil.removeClass(this.button,"disabled"),this.button.setAttribute("aria-hidden","false"),this},disable:function(){return L.DomUtil.addClass(this.button,"disabled"),L.DomUtil.removeClass(this.button,"enabled"),this.button.setAttribute("aria-hidden","true"),this},removeFrom:function(t){return this._container.parentNode.removeChild(this._container),this._map=null,this},onAdd:function(){var t=L.easyBar([this],{position:this.options.position,leafletClasses:this.options.leafletClasses});return this._container=t.container,this._container}}),L.easyButton=function(){var t=Array.prototype.concat.apply([L.Control.EasyButton],arguments);return new(Function.prototype.bind.apply(L.Control.EasyButton,t))}}()},{}],36:[function(t,e,r){(function(r){function n(t){if(!(this instanceof n))return new n(t);if(!t)throw new Error("constructor requires at least a location argument");this.IDBOptions={},this.location=t}e.exports=n;var i=t("idb-wrapper"),o=t("abstract-leveldown").AbstractLevelDOWN,s=t("util"),a=t("./iterator"),u=t("isbuffer"),c=t("xtend"),l=t("typedarray-to-buffer");s.inherits(n,o),n.prototype._open=function(t,e){var r=this,n={storeName:this.location,autoIncrement:!1,keyPath:null,onStoreReady:function(){e&&e(null,r.idb)},onError:function(t){e&&e(t)}};c(n,t),this.IDBOptions=n,this.idb=new i(n)},n.prototype._get=function(t,e,n){this.idb.get(t,function(i){if(void 0===i)return n(new Error("NotFound"));var o=!0;return e.asBuffer===!1&&(o=!1),e.raw&&(o=!1),o&&(i=i instanceof Uint8Array?l(i):new r(String(i))),n(null,i,t)},n)},n.prototype._del=function(t,e,r){this.idb.remove(t,r,r)},n.prototype._put=function(t,e,n,i){e instanceof ArrayBuffer&&(e=l(new Uint8Array(e)));var o=this.convertEncoding(t,e,n);r.isBuffer(o.value)&&("function"==typeof e.toArrayBuffer?o.value=new Uint8Array(e.toArrayBuffer()):o.value=new Uint8Array(e)),this.idb.put(o.key,o.value,function(){i()},i)},n.prototype.convertEncoding=function(t,e,r){if(r.raw)return{key:t,value:e};if(e){var n=e.toString();"NaN"===n&&(e="NaN")}var i=r.valueEncoding,o={key:t,value:e};return!e||i&&"binary"===i||"object"!=typeof o.value&&(o.value=n),o},n.prototype.iterator=function(t){return"object"!=typeof t&&(t={}),new a(this.idb,t)},n.prototype._batch=function(t,e,r){var n,i,o,s,a=[];if(0===t.length)return setTimeout(r,0);for(n=0;n<t.length;n++){o={},s=t[n],a[n]=o;var u=this.convertEncoding(s.key,s.value,e);s.key=u.key,s.value=u.value;for(i in s)"type"===i&&"del"==s[i]?o[i]="remove":o[i]=s[i]}return this.idb.batch(a,function(){r()},r)},n.prototype._close=function(t){this.idb.db.close(),t()},n.prototype._approximateSize=function(t,e,r){var n=new Error("Not implemented");if(r)return r(n);throw n},n.prototype._isBuffer=function(t){return r.isBuffer(t)},n.destroy=function(t,e){if("object"==typeof t)var r=t.IDBOptions.storePrefix||"IDBWrapper-",n=t.location;else var r="IDBWrapper-",n=t;var i=indexedDB.deleteDatabase(r+n);i.onsuccess=function(){e()},i.onerror=function(t){e(t)}};n.prototype._checkKeyValue=function(t,e){return null===t||void 0===t?new Error(e+" cannot be `null` or `undefined`"):null===t||void 0===t?new Error(e+" cannot be `null` or `undefined`"):u(t)&&0===t.byteLength?new Error(e+" cannot be an empty ArrayBuffer"):""===String(t)?new Error(e+" cannot be an empty String"):0===t.length?new Error(e+" cannot be an empty Array"):void 0}}).call(this,t("buffer").Buffer)},{"./iterator":37,"abstract-leveldown":40,buffer:1,"idb-wrapper":30,isbuffer:34,"typedarray-to-buffer":60,util:9,xtend:43}],37:[function(t,e,r){function n(t,e){e||(e={}),this.options=e,o.call(this,t),this._order=e.reverse?"DESC":"ASC",this._limit=e.limit,this._count=0,this._done=!1;var r=s.lowerBound(e),n=s.upperBound(e);try{this._keyRange=r||n?this.db.makeKeyRange({lower:r,upper:n,excludeLower:s.lowerBoundExclusive(e),excludeUpper:s.upperBoundExclusive(e)}):null}catch(i){this._keyRangeError=!0}this.callback=null}var i=t("util"),o=t("abstract-leveldown").AbstractIterator,s=t("ltgt");e.exports=n,i.inherits(n,o),n.prototype.createIterator=function(){var t=this;t.iterator=t.db.iterate(function(){t.onItem.apply(t,arguments)},{keyRange:t._keyRange,autoContinue:!1,order:t._order,onError:function(t){console.log("horrible error",t)}})},n.prototype.onItem=function(t,e,r){if(!e&&this.callback)return this.callback(),void(this.callback=!1);var n=!0;this._limit&&this._limit>0&&this._count++>=this._limit&&(n=!1),n&&this.callback(!1,e.key,e.value),e&&e["continue"]()},n.prototype._next=function(t){return t?this._keyRangeError?t():(this._started||(this.createIterator(),this._started=!0),void(this.callback=t)):new Error("next() requires a callback argument")}},{"abstract-leveldown":40,ltgt:44,util:9}],38:[function(t,e,r){(function(t){function r(t){this._db=t,this._operations=[],this._written=!1}r.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},r.prototype.put=function(t,e){this._checkWritten();var r=this._db._checkKeyValue(t,"key",this._db._isBuffer);if(r)throw r;if(r=this._db._checkKeyValue(e,"value",this._db._isBuffer))throw r;return this._db._isBuffer(t)||(t=String(t)),this._db._isBuffer(e)||(e=String(e)),"function"==typeof this._put?this._put(t,e):this._operations.push({type:"put",key:t,value:e}),this},r.prototype.del=function(t){this._checkWritten();var e=this._db._checkKeyValue(t,"key",this._db._isBuffer);if(e)throw e;return this._db._isBuffer(t)||(t=String(t)),"function"==typeof this._del?this._del(t):this._operations.push({type:"del",key:t}),this},r.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},r.prototype.write=function(e,r){if(this._checkWritten(),"function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("write() requires a callback argument");return"object"!=typeof e&&(e={}),this._written=!0,"function"==typeof this._write?this._write(r):"function"==typeof this._db._batch?this._db._batch(this._operations,e,r):void t.nextTick(r)},e.exports=r}).call(this,t("_process"))},{_process:7}],39:[function(t,e,r){(function(t){function r(t){this.db=t,this._ended=!1,this._nexting=!1}r.prototype.next=function(e){var r=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return r._ended?e(new Error("cannot call next() after end()")):r._nexting?e(new Error("cannot call next() before previous next() has completed")):(r._nexting=!0,"function"==typeof r._next?r._next(function(){r._nexting=!1,e.apply(null,arguments)}):void t.nextTick(function(){r._nexting=!1,e()}))},r.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");return this._ended?e(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(e):void t.nextTick(e))},e.exports=r}).call(this,t("_process"))},{_process:7}],40:[function(t,e,r){(function(r,n){function i(t){if(!arguments.length||void 0===t)throw new Error("constructor requires at least a location argument");if("string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t}var o=t("xtend"),s=t("./abstract-iterator"),a=t("./abstract-chained-batch");i.prototype.open=function(t,e){if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");return"object"!=typeof t&&(t={}),"function"==typeof this._open?this._open(t,e):void r.nextTick(e)},i.prototype.close=function(t){if("function"!=typeof t)throw new Error("close() requires a callback argument");return"function"==typeof this._close?this._close(t):void r.nextTick(t)},i.prototype.get=function(t,e,n){var i;if("function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("get() requires a callback argument");return(i=this._checkKeyValue(t,"key",this._isBuffer))?n(i):(this._isBuffer(t)||(t=String(t)),"object"!=typeof e&&(e={}),"function"==typeof this._get?this._get(t,e,n):void r.nextTick(function(){n(new Error("NotFound"))}))},i.prototype.put=function(t,e,n,i){var o;if("function"==typeof n&&(i=n),"function"!=typeof i)throw new Error("put() requires a callback argument");return(o=this._checkKeyValue(t,"key",this._isBuffer))?i(o):(o=this._checkKeyValue(e,"value",this._isBuffer))?i(o):(this._isBuffer(t)||(t=String(t)),this._isBuffer(e)||r.browser||(e=String(e)),"object"!=typeof n&&(n={}),"function"==typeof this._put?this._put(t,e,n,i):void r.nextTick(i))},i.prototype.del=function(t,e,n){var i;if("function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("del() requires a callback argument");return(i=this._checkKeyValue(t,"key",this._isBuffer))?n(i):(this._isBuffer(t)||(t=String(t)),"object"!=typeof e&&(e={}),"function"==typeof this._del?this._del(t,e,n):void r.nextTick(n))},i.prototype.batch=function(t,e,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(t))return n(new Error("batch(array) requires an array argument"));"object"!=typeof e&&(e={});for(var i,o,s=0,a=t.length;a>s;s++)if(i=t[s],"object"==typeof i){if(o=this._checkKeyValue(i.type,"type",this._isBuffer))return n(o);if(o=this._checkKeyValue(i.key,"key",this._isBuffer))return n(o);if("put"==i.type&&(o=this._checkKeyValue(i.value,"value",this._isBuffer)))return n(o)}return"function"==typeof this._batch?this._batch(t,e,n):void r.nextTick(n)},i.prototype.approximateSize=function(t,e,n){if(null==t||null==e||"function"==typeof t||"function"==typeof e)throw new Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof n)throw new Error("approximateSize() requires a callback argument");return this._isBuffer(t)||(t=String(t)),this._isBuffer(e)||(e=String(e)),"function"==typeof this._approximateSize?this._approximateSize(t,e,n):void r.nextTick(function(){n(null,0)})},i.prototype._setupIteratorOptions=function(t){var e=this;return t=o(t),["start","end","gt","gte","lt","lte"].forEach(function(r){t[r]&&e._isBuffer(t[r])&&0===t[r].length&&delete t[r]}),t.reverse=!!t.reverse,t.reverse&&t.lt&&(t.start=t.lt),t.reverse&&t.lte&&(t.start=t.lte),!t.reverse&&t.gt&&(t.start=t.gt),!t.reverse&&t.gte&&(t.start=t.gte),(t.reverse&&t.lt&&!t.lte||!t.reverse&&t.gt&&!t.gte)&&(t.exclusiveStart=!0),t},i.prototype.iterator=function(t){return"object"!=typeof t&&(t={}),t=this._setupIteratorOptions(t),"function"==typeof this._iterator?this._iterator(t):new s(this)},i.prototype._chainedBatch=function(){return new a(this)},i.prototype._isBuffer=function(t){return n.isBuffer(t)},i.prototype._checkKeyValue=function(t,e){if(null===t||void 0===t)return new Error(e+" cannot be `null` or `undefined`");if(this._isBuffer(t)){if(0===t.length)return new Error(e+" cannot be an empty Buffer")}else if(""===String(t))return new Error(e+" cannot be an empty String")},e.exports.AbstractLevelDOWN=i,e.exports.AbstractIterator=s,e.exports.AbstractChainedBatch=a}).call(this,t("_process"),t("buffer").Buffer)},{"./abstract-chained-batch":38,"./abstract-iterator":39,_process:7,buffer:1,xtend:41}],41:[function(t,e,r){function n(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}return t}e.exports=n},{}],42:[function(t,e,r){function n(t){return null!==t&&("object"==typeof t||"function"==typeof t)}e.exports=n},{}],43:[function(t,e,r){function n(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];if(o(r))for(var n=i(r),s=0;s<n.length;s++){var a=n[s];t[a]=r[a]}}return t}var i=t("object-keys"),o=t("./has-keys");e.exports=n},{"./has-keys":42,"object-keys":47}],44:[function(t,e,r){(function(t){function e(t,e){return Object.hasOwnProperty.call(t,e)}function n(t){return void 0!==t&&""!==t}function e(t,e){return Object.hasOwnProperty.call(t,e)}function i(t,e){return Object.hasOwnProperty.call(t,e)&&e}function o(t){return t}r.compare=function(e,r){if(t.isBuffer(e)){for(var n=Math.min(e.length,r.length),i=0;n>i;i++){var o=e[i]-r[i];if(o)return o}return e.length-r.length}return r>e?-1:e>r?1:0};var s=r.lowerBoundKey=function(t){return i(t,"gt")||i(t,"gte")||i(t,"min")||(t.reverse?i(t,"end"):i(t,"start"))||void 0},a=r.lowerBound=function(t){var e=s(t);return e&&t[e]},u=r.lowerBoundInclusive=function(t){return e(t,"gt")?!1:!0},c=r.upperBoundInclusive=function(t){return e(t,"lt")?!1:!0},l=r.lowerBoundExclusive=function(t){return!u(t)},f=r.upperBoundExclusive=function(t){return!c(t)},h=r.upperBoundKey=function(t){return i(t,"lt")||i(t,"lte")||i(t,"max")||(t.reverse?i(t,"start"):i(t,"end"))||void 0},p=r.upperBound=function(t){var e=h(t);return e&&t[e]};r.toLtgt=function(t,n,i,s,a){n=n||{},i=i||o;var u=arguments.length>3,c=r.lowerBoundKey(t),l=r.upperBoundKey(t);return c?"gt"===c?n.gt=i(t.gt,!1):n.gte=i(t[c],!1):u&&(n.gte=i(s,!1)),
l?"lt"===l?n.lt=i(t.lt,!0):n.lte=i(t[l],!0):u&&(n.lte=i(a,!0)),null!=t.reverse&&(n.reverse=!!t.reverse),e(n,"max")&&delete n.max,e(n,"min")&&delete n.min,e(n,"start")&&delete n.start,e(n,"end")&&delete n.end,n},r.contains=function(t,e,i){i=i||r.compare;var o=a(t);if(n(o)){var s=i(e,o);if(0>s||0===s&&l(t))return!1}var u=p(t);if(n(u)){var s=i(e,u);if(s>0||0===s&&f(t))return!1}return!0},r.filter=function(t,e){return function(n){return r.contains(t,n,e)}}}).call(this,t("buffer").Buffer)},{buffer:1}],45:[function(t,e,r){(function(r,n){function i(t,e){function i(t,e,r){r&&(r=new n(new Uint8Array(r))),s(t,e,r)}if("string"==typeof t&&(t={uri:t}),t.hasOwnProperty("encoding")||(t.encoding=null),r.browser&&!t.hasOwnProperty("json")&&null===t.encoding){t.responseType="arraybuffer";var s=e;e=i}return o(t,e)}var o=t("request");e.exports=i}).call(this,t("_process"),t("buffer").Buffer)},{_process:7,buffer:1,request:70}],46:[function(t,e,r){var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=function(t){var e="function"==typeof t&&!(t instanceof RegExp)||"[object Function]"===i.call(t);return e||"undefined"==typeof window||(e=t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt),e};e.exports=function(t,e){if(!o(e))throw new TypeError("iterator must be a function");var r,i,s="string"==typeof t,a=t.length,u=arguments.length>2?arguments[2]:null;if(a===+a)for(r=0;a>r;r++)null===u?e(s?t.charAt(r):t[r],r,t):e.call(u,s?t.charAt(r):t[r],r,t);else for(i in t)n.call(t,i)&&(null===u?e(t[i],i,t):e.call(u,t[i],i,t))}},{}],47:[function(t,e,r){e.exports=Object.keys||t("./shim")},{"./shim":49}],48:[function(t,e,r){var n=Object.prototype.toString;e.exports=function i(t){var e=n.call(t),i="[object Arguments]"===e;return i||(i="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),i}},{}],49:[function(t,e,r){!function(){"use strict";var r,n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=t("./foreach"),s=t("./isArguments"),a=!{toString:null}.propertyIsEnumerable("toString"),u=function(){}.propertyIsEnumerable("prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];r=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),l=s(t),f=[];if(!e&&!r&&!l)throw new TypeError("Object.keys called on a non-object");if(l)o(t,function(t){f.push(t)});else{var h,p=u&&r;for(h in t)p&&"prototype"===h||!n.call(t,h)||f.push(h)}if(a){var d=t.constructor,v=d&&d.prototype===t;o(c,function(e){v&&"constructor"===e||!n.call(t,e)||f.push(e)})}return f},e.exports=r}()},{"./foreach":46,"./isArguments":48}],50:[function(t,e,r){var n=t("trim"),i=t("for-each"),o=function(t){return"[object Array]"===Object.prototype.toString.call(t)};e.exports=function(t){if(!t)return{};var e={};return i(n(t).split("\n"),function(t){var r=t.indexOf(":"),i=n(t.slice(0,r)).toLowerCase(),s=n(t.slice(r+1));"undefined"==typeof e[i]?e[i]=s:o(e[i])?e[i].push(s):e[i]=[e[i],s]}),e}},{"for-each":20,trim:59}],51:[function(t,e,r){"use strict";function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function i(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,128>i)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,128>i)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,128>i)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,128>i)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,128>i)return s(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,128>i)return s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}function o(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function a(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),4294967295^r?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||-0x10000000000000000>t)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),u(r,n,e),c(n,e)}function u(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}function c(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}function l(t,e,r){var n=16383>=e?1:2097151>=e?2:268435455>=e?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function f(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function v(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function y(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function _(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function b(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function E(t,e,r){for(var n="",i=e;r>i;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a>r)break;var u,c,l;1===a?128>o&&(s=o):2===a?(u=t[i+1],128===(192&u)&&(s=(31&o)<<6|63&u,127>=s&&(s=null))):3===a?(u=t[i+1],c=t[i+2],128===(192&u)&&128===(192&c)&&(s=(15&o)<<12|(63&u)<<6|63&c,(2047>=s||s>=55296&&57343>=s)&&(s=null))):4===a&&(u=t[i+1],c=t[i+2],l=t[i+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(s=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l,(65535>=s||s>=1114112)&&(s=null))),null===s?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|1023&s),n+=String.fromCharCode(s),i+=a}return n}function k(t,e,r){for(var n,i,o=0;o<e.length;o++){if(n=e.charCodeAt(o),n>55295&&57344>n){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(56320>n){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);128>n?t[r++]=n:(2048>n?t[r++]=n>>6|192:(65536>n?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}e.exports=n;var C=t("ieee754");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var F=4294967296,S=1/F;n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+b(this.buf,this.pos+4)*F;return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+x(this.buf,this.pos+4)*F;return this.pos+=8,t},readFloat:function(){var t=C.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=C.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return r=n[this.pos++],e=127&r,128>r?e:(r=n[this.pos++],e|=(127&r)<<7,128>r?e:(r=n[this.pos++],e|=(127&r)<<14,128>r?e:(r=n[this.pos++],e|=(127&r)<<21,128>r?e:(r=n[this.pos],e|=(15&r)<<28,i(e,t,this)))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=E(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=o(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*S),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*S),this.pos+4),this.pos+=8},writeVarint:function(t){return t=+t||0,t>268435455||0>t?void a(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(127>=t||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),127>=t||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),127>=t||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(0>t?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=k(this.buf,t,this.pos);var r=this.pos-e;r>=128&&l(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),C.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),C.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;e>r;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&l(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,f,e)},writePackedSVarint:function(t,e){this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){this.writeMessage(t,v,e)},writePackedFloat:function(t,e){this.writeMessage(t,p,e)},writePackedDouble:function(t,e){this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){this.writeMessage(t,y,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,_,e)},writePackedFixed64:function(t,e){this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},{ieee754:31}],52:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],53:[function(t,e,r){e.exports=t("./lib/checks")},{"./lib/checks":54}],54:[function(t,e,r){function n(t,e,r,n){r=r||"";var i=u.format.apply(this,[r].concat(n)),o=new t(i);throw Error.captureStackTrace(o,e),o}function i(t,e,r){n(c.IllegalArgumentError,t,e,r)}function o(t,e,r){n(c.IllegalStateError,t,e,r)}function s(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array"}return e}function a(t){return function(e,r){var n=s(e);return n==t?e:void i(arguments.callee,r||'Expected "'+t+'" but got "'+n+'".',Array.prototype.slice.call(arguments,2))}}var u=t("util"),c=e.exports=t("./errors");e.exports.checkArgument=function(t,e){t||i(arguments.callee,e,Array.prototype.slice.call(arguments,2))},e.exports.checkState=function(t,e){t||o(arguments.callee,e,Array.prototype.slice.call(arguments,2))},e.exports.checkIsDef=function(t,e){return void 0!==t?t:void i(arguments.callee,e||"Expected value to be defined but was undefined.",Array.prototype.slice.call(arguments,2))},e.exports.checkIsDefAndNotNull=function(t,e){return null!=t?t:void i(arguments.callee,e||'Expected value to be defined and not null but got "'+s(t)+'".',Array.prototype.slice.call(arguments,2))},e.exports.checkIsString=a("string"),e.exports.checkIsArray=a("array"),e.exports.checkIsNumber=a("number"),e.exports.checkIsBoolean=a("boolean"),e.exports.checkIsFunction=a("function"),e.exports.checkIsObject=a("object")},{"./errors":55,util:9}],55:[function(t,e,r){function n(t){Error.call(this,t),this.message=t}function i(t){Error.call(this,t),this.message=t}var o=t("util");o.inherits(n,Error),n.prototype.name="IllegalArgumentError",o.inherits(i,Error),i.prototype.name="IllegalStateError",e.exports.IllegalStateError=i,e.exports.IllegalArgumentError=n},{util:9}],56:[function(t,e,r){"use strict";function n(t,e,r){1===arguments.length&&(e=t,t=0),r=r||1;var n,i=[];for(n=t;(e-n)*r>0;n+=r)i.push(n);return i}r.range=n},{}],57:[function(t,e,r){(function(t){e.exports=function(e,r){function n(e){function n(){r&&r(e,o),r=null}u?t.nextTick(n):n()}function i(t,e,r){o[t]=r,(0===--s||e)&&n(e)}var o,s,a,u=!0;Array.isArray(e)?(o=[],s=e.length):(a=Object.keys(e),o={},s=a.length),s?a?a.forEach(function(t){e[t](function(e,r){i(t,e,r)})}):e.forEach(function(t,e){t(function(t,r){i(e,t,r)})}):n(null),u=!1}}).call(this,t("_process"))},{_process:7}],58:[function(t,e,r){(function(t){e.exports=function(e,r){function n(e){function n(){r&&r(e,s)}a?t.nextTick(n):n()}function i(t,r){s.push(r),++o>=e.length||t?n(t):e[o](i)}var o=0,s=[],a=!0;e.length>0?e[0](i):n(null),a=!1}}).call(this,t("_process"))},{_process:7}],59:[function(t,e,r){function n(t){return t.replace(/^\s*|\s*$/g,"")}r=e.exports=n,r.left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],60:[function(t,e,r){(function(t){e.exports=function(e){return"function"==typeof t._augment&&t.TYPED_ARRAY_SUPPORT?t._augment(e):new t(e)}}).call(this,t("buffer").Buffer)},{buffer:1}],61:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":62,"./lib/vectortilefeature.js":63,"./lib/vectortilelayer.js":64}],62:[function(t,e,r){"use strict";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new o(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var o=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":64}],63:[function(t,e,r){"use strict";function n(t,e,r,n,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=o,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?o(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function o(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}function s(t){var e=t.length;if(1>=e)return[t];for(var r,n,i=[],o=0;e>o;o++){var s=a(t[o]);0!==s&&(void 0===n&&(n=0>s),n===0>s?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}return r&&i.push(r),i}function a(t){for(var e,r,n=0,i=0,o=t.length,s=o-1;o>i;s=i++)e=t[i],r=t[s],n+=(r.x-e.x)*(e.y+r.y);return n}var u=t("point-geometry");e.exports=n,n.types=["Unknown","Point","LineString","Polygon"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,s=0,a=[];t.pos<r;){if(!i){var c=t.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&a.push(e),e=[]),e.push(new u(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&a.push(e),a},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,s=1/0,a=-(1/0),u=1/0,c=-(1/0);t.pos<e;){if(!n){var l=t.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)i+=t.readSVarint(),o+=t.readSVarint(),s>i&&(s=i),i>a&&(a=i),u>o&&(u=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[s,u,a,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+l)/u;t[e]=[360*(r.x+c)/u-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var o,a,u=this.extent*Math.pow(2,r),c=this.extent*t,l=this.extent*e,f=this.loadGeometry(),h=n.types[this.type];switch(this.type){case 1:var p=[];for(o=0;o<f.length;o++)p[o]=f[o][0];f=p,i(f);break;case 2:for(o=0;o<f.length;o++)i(f[o]);break;case 3:for(f=s(f),o=0;o<f.length;o++)for(a=0;a<f[o].length;a++)i(f[o][a])}1===f.length?f=f[0]:h="Multi"+h;var d={type:"Feature",geometry:{type:h,coordinates:f},properties:this.properties};return"id"in this&&(d.id=this.id),d}},{"point-geometry":52}],64:[function(t,e,r){"use strict";function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(i,this,e),this.length=this._features.length}function i(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(o(r))}function o(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var s=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(0>t||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new s(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":63}],65:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(o(t.layers[r]));var n=new l;return f.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new h(t[r].features),e[r].name=r;return n({layers:e})}function o(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i<t.length;i++){var o=t.feature(i);o.geometry=u(o.loadGeometry());var s=[];for(var a in o.properties){var l=r[a];"undefined"==typeof l&&(e.keys.push(a),l=e.keys.length-1,r[a]=l);var f=c(o.properties[a]),h=n[f.key];"undefined"==typeof h&&(e.values.push(f),h=e.values.length-1,n[f.key]=h),s.push(l),s.push(h)}o.tags=s,e.features.push(o)}return e}function s(t,e){return(e<<3)+(7&t)}function a(t){return t<<1^t>>31}function u(t){for(var e=[],r=0,n=0,i=t.length,o=0;i>o;o++){var u=t[o];e.push(s(1,1));for(var c=0;c<u.length;c++){1===c&&e.push(s(2,u.length-1));var l=u[c].x-r,f=u[c].y-n;e.push(a(l),a(f)),r+=l,n+=f}}return e}function c(t){var e,r=typeof t;return"string"===r?e={string_value:t}:"boolean"===r?e={bool_value:t}:"number"===r?e=t%1!==0?{double_value:t}:0>t?{sint_value:t}:{uint_value:t}:(t=JSON.stringify(t),e={string_value:t}),e.key=r+":"+t,e}var l=t("pbf"),f=t("./vector-tile-pb"),h=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=i,e.exports.GeoJSONWrapper=h},{"./lib/geojson_wrapper":66,"./vector-tile-pb":69,pbf:68}],66:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var o=t("point-geometry"),s=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new o(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-(1/0),n=1/0,i=-(1/0),o=0;o<t.length;o++)for(var s=t[o],a=0;a<s.length;a++){var u=s[a];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},i.prototype.toGeoJSON=s.prototype.toGeoJSON},{"point-geometry":52,"vector-tile":61}],67:[function(t,e,r){"use strict";function n(t){var e;t&&t.length&&(e=t,t=e.length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=o.readUInt32LE,r.writeUInt32LE=o.writeUInt32LE,r.readInt32LE=o.readInt32LE,r.writeInt32LE=o.writeInt32LE,r.readFloatLE=o.readFloatLE,r.writeFloatLE=o.writeFloatLE,r.readDoubleLE=o.readDoubleLE,r.writeDoubleLE=o.writeDoubleLE,r.toString=o.toString,r.write=o.write,r.slice=o.slice,r.copy=o.copy,r._isBuffer=!0,r}function i(t){for(var e,r,n=t.length,i=[],o=0;n>o;o++){if(e=t.charCodeAt(o),e>55295&&57344>e){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(56320>e){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);128>e?i.push(e):2048>e?i.push(e>>6|192,63&e|128):65536>e?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var o,s,a,u=t("ieee754");o={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;r>o;o++){var s=this[o];127>=s?(n+=decodeURIComponent(i)+String.fromCharCode(s),i=""):i+="%"+s.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===s?a:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},o.writeInt32LE=o.writeUInt32LE,n.byteLength=function(t){return s=t,a=i(t),a.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:31}],68:[function(t,e,r){(function(r){"use strict";function n(t){this.buf=y.isBuffer(t)?t:new y(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),128>r)return t;if(r=n[e.pos++],t+=34359738368*(127&r),128>r)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),128>r)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),128>r)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),128>r)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),128>r)return t;throw new Error("Expected varint not more than 10 bytes")}function o(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function s(t,e,r){var n=16383>=e?1:2097151>=e?2:268435455>=e?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function a(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function v(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var y=r.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var _=4294967296,g=1/_,m=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*_;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*_;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,128>e?t:(e=r[this.pos++],t|=(127&e)<<7,128>e?t:(e=r[this.pos++],t|=(127&e)<<14,128>e?t:(e=r[this.pos++],t|=(127&e)<<21,128>e?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(m>e)return e;for(var r=this.pos-2;255===this.buf[r];)r--;t>r&&(r=t),e=0;for(var n=0;r-t+1>n;n++){var i=127&~this.buf[t+n];e+=4>n?i<<7*n:i*Math.pow(2,7*n)}return-e-1},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.buf.toString("utf8",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new y(e);this.buf.copy(r),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeUInt32LE(Math.floor(t*g),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(-1&t,this.pos),this.buf.writeInt32LE(Math.floor(t*g),this.pos+4),this.pos+=8},writeVarint:function(t){return t=+t,t>268435455?void o(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),void(127>=t||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),127>=t||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),127>=t||(this.buf[this.pos++]=t>>>7&127)))))},writeSVarint:function(t){this.writeVarint(0>t?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=y.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;e>r;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&s(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,a,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,f,e)},writePackedFloat:function(t,e){this.writeMessage(t,c,e)},writePackedDouble:function(t,e){
this.writeMessage(t,l,e)},writePackedFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,p,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":67}],69:[function(t,e,r){"use strict";function n(t,e){return t.readFields(i,{layers:[]},e)}function i(t,e,r){3===t&&e.layers.push(h(r,r.readVarint()+r.pos))}function o(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,d,t.layers[r])}function s(t,e){return t.readFields(a,{},e)}function a(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function u(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function c(t,e){var r=t.readFields(l,{},e);return void 0===r.type&&(r.type="Unknown"),r}function l(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function f(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function h(t,e){return t.readFields(p,{features:[],keys:[],values:[]},e)}function p(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(c(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(s(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function d(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,f,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,u,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var v=r.tile={read:n,write:o};v.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},v.value={read:s,write:u},v.feature={read:c,write:f},v.layer={read:h,write:d}},{}],70:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t.length;r++)e(t[r])}function i(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function o(t,e,r){var n=t;return f(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=p(e,{uri:t}),n.callback=r,n}function s(t,e,r){return e=o(t,e,r),a(e)}function a(t){function e(){4===l.readyState&&setTimeout(o,0)}function r(){var t=void 0;if(t=l.response?l.response:l.responseText||u(l),b)try{t=JSON.parse(t)}catch(e){}return t}function n(t){return clearTimeout(d),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,c(t,w)}function o(){if(!p){var e;clearTimeout(d),e=t.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var n=w,i=null;return 0!==e?(n={body:r(),statusCode:e,method:y,headers:{},url:v,rawRequest:l},l.getAllResponseHeaders&&(n.headers=h(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),c(i,n,n.body)}}if("undefined"==typeof t.callback)throw new Error("callback argument missing");var a=!1,c=function(e,r,n){a||(a=!0,t.callback(e,r,n))},l=t.xhr||null;l||(l=t.cors||t.useXDR?new s.XDomainRequest:new s.XMLHttpRequest);var f,p,d,v=l.url=t.uri||t.url,y=l.method=t.method||"GET",_=t.body||t.data,g=l.headers=t.headers||{},m=!!t.sync,b=!1,w={body:void 0,headers:{},statusCode:0,method:y,url:v,rawRequest:l};if("json"in t&&t.json!==!1&&(b=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==y&&"HEAD"!==y&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),_=JSON.stringify(t.json===!0?_:t.json))),l.onreadystatechange=e,l.onload=o,l.onerror=n,l.onprogress=function(){},l.onabort=function(){p=!0},l.ontimeout=n,l.open(y,v,!m,t.username,t.password),m||(l.withCredentials=!!t.withCredentials),!m&&t.timeout>0&&(d=setTimeout(function(){if(!p){p=!0,l.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),l.setRequestHeader)for(f in g)g.hasOwnProperty(f)&&l.setRequestHeader(f,g[f]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(l),l.send(_||null),l}function u(t){if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function c(){}var l=t("global/window"),f=t("is-function"),h=t("parse-headers"),p=t("xtend");e.exports=s,s.XMLHttpRequest=l.XMLHttpRequest||c,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:l.XDomainRequest,n(["get","put","post","patch","head","delete"],function(t){s["delete"===t?"del":t]=function(e,r,n){return r=o(e,r,n),r.method=t.toUpperCase(),a(r)}})},{"global/window":29,"is-function":33,"parse-headers":50,xtend:71}],71:[function(t,e,r){function n(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)i.call(r,n)&&(t[n]=r[n])}return t}e.exports=n;var i=Object.prototype.hasOwnProperty},{}],72:[function(t,e,r){function n(t,e){var r=Object.keys(t).map(function(e){return function(r){a({url:t[e]},function(t,n){t&&r(t),r(null,{name:e,data:n})})}});u(r,e)}function i(t){return o(t,l,{zMin:0,zMax:5,bbox:[-179,-89,179,89]})}var o=t("./lib/VectorTileIndex.js"),s=t("level-js"),a=t("./lib/ags-opendata-request"),u=t("run-parallel");t("./lib/Leaflet.VectorGrid.Leveldb"),t("leaflet-easybutton");var c,l=s("vt"),f={fill:!0,weight:1.2,fillColor:"#e1e1e1",color:"#343434",fillOpacity:.2,opacity:.4},h={weight:1,fillColor:"#636363",color:"#636363",fillOpacity:1,opacity:1,radius:1.2},p={weight:1,fillColor:"#676767",color:"#676767",fillOpacity:.2,opacity:.4},d={weight:.4,fillColor:"#676767",color:"#676767",fillOpacity:.2,opacity:.4},v={rendererFactory:L.canvas.tile,attribution:"Natural Earth",vectorTileLayerStyles:{land110:function(t,e){return 3>=e?f:[]},land50:function(t,e){return e>3&&8>=e?f:[]},popPlaces110:function(t,e){return 3>=e?h:[]},popPlaces50:function(t,e){return e>3&&8>=e?h:[]},boundary110:function(t,e){return 3>=e?p:[]},boundary50:function(t,e){return e>3&&5>=e?p:[]},statesProvinces50:function(t,e){return e>3&&5>=e?d:[]},roads:{weight:1,fillColor:"#676767",color:"#676767",fillOpacity:.2,opacity:.4},driveways:{weight:.4,fillColor:"#676767",color:"#676767",fillOpacity:.2,opacity:.4},addresses:{weight:1,fillColor:"#636363",color:"#636363",fillOpacity:.2,opacity:.4,radius:1}}},y={land110:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_land.geojson",land50:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_land.geojson",popPlaces110:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_populated_places_simple.geojson",popPlaces50:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_populated_places_simple.geojson",boundary110:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_admin_0_boundary_lines_land.geojson",boundary50:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_admin_0_boundary_lines_land.geojson",statesProvinces50:"https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_admin_1_states_provinces_lines.geojson"},_=L.map("leaflet-map",{center:[0,0],zoom:1,maxZoom:5});l.open(function(){c=L.vectorGrid.leveldb(l,v),c.addTo(_)}),L.easyButton({states:[{stateName:"ready",icon:'<span class="icon">✓</span>',title:"Click to refresh the cache",onClick:function(t){t.state("loading"),n(y,function(e,r){if(e)throw e;var n=r.reduce(function(t,e){return t[e.name]=e.data,t},{}),o=i(n);o.ready(function(){console.log("ready"),t.state("ready"),c.redraw()})})}},{stateName:"loading",icon:'<span class="icon">¤</span>',title:"Refreshing the cache...",onClick:function(t){t.state("ready")}}]}).addTo(_)},{"./lib/Leaflet.VectorGrid.Leveldb":10,"./lib/VectorTileIndex.js":11,"./lib/ags-opendata-request":12,"leaflet-easybutton":35,"level-js":36,"run-parallel":57}]},{},[72]);