UNPKG

synthetix

Version:

The smart contracts which make up the Synthetix system. (synthetix.io)

8 lines 10.4 MB
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.synthetix=a():e.synthetix=a()}(window,(function(){return function(e){var a={};function b(f){if(a[f])return a[f].exports;var t=a[f]={i:f,l:!1,exports:{}};return e[f].call(t.exports,t,t.exports,b),t.l=!0,t.exports}return b.m=e,b.c=a,b.d=function(e,a,f){b.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:f})},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.t=function(e,a){if(1&a&&(e=b(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var f=Object.create(null);if(b.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var t in e)b.d(f,t,function(a){return e[a]}.bind(null,t));return f},b.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(a,"a",a),a},b.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},b.p="",b(b.s=18)}([function(e,a,b){(function(e,b){var f;!function(){var t="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},n=t._,d=Array.prototype,s=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,i=d.push,r=d.slice,u=s.toString,p=s.hasOwnProperty,y=Array.isArray,l=Object.keys,o=Object.create,m=function(){},x=function(e){return e instanceof x?e:this instanceof x?void(this._wrapped=e):new x(e)};a.nodeType?t._=x:(!b.nodeType&&b.exports&&(a=b.exports=x),a._=x),x.VERSION="1.9.1";var T,g=function(e,a,b){if(void 0===a)return e;switch(null==b?3:b){case 1:return function(b){return e.call(a,b)};case 3:return function(b,f,t){return e.call(a,b,f,t)};case 4:return function(b,f,t,n){return e.call(a,b,f,t,n)}}return function(){return e.apply(a,arguments)}},h=function(e,a,b){return x.iteratee!==T?x.iteratee(e,a):null==e?x.identity:x.isFunction(e)?g(e,a,b):x.isObject(e)&&!x.isArray(e)?x.matcher(e):x.property(e)};x.iteratee=T=function(e,a){return h(e,a,1/0)};var v=function(e,a){return a=null==a?e.length-1:+a,function(){for(var b=Math.max(arguments.length-a,0),f=Array(b),t=0;t<b;t++)f[t]=arguments[t+a];switch(a){case 0:return e.call(this,f);case 1:return e.call(this,arguments[0],f);case 2:return e.call(this,arguments[0],arguments[1],f)}var n=Array(a+1);for(t=0;t<a;t++)n[t]=arguments[t];return n[a]=f,e.apply(this,n)}},w=function(e){if(!x.isObject(e))return{};if(o)return o(e);m.prototype=e;var a=new m;return m.prototype=null,a},M=function(e){return function(a){return null==a?void 0:a[e]}},A=function(e,a){return null!=e&&p.call(e,a)},E=function(e,a){for(var b=a.length,f=0;f<b;f++){if(null==e)return;e=e[a[f]]}return b?e:void 0},C=Math.pow(2,53)-1,D=M("length"),S=function(e){var a=D(e);return"number"==typeof a&&a>=0&&a<=C};x.each=x.forEach=function(e,a,b){var f,t;if(a=g(a,b),S(e))for(f=0,t=e.length;f<t;f++)a(e[f],f,e);else{var n=x.keys(e);for(f=0,t=n.length;f<t;f++)a(e[n[f]],n[f],e)}return e},x.map=x.collect=function(e,a,b){a=h(a,b);for(var f=!S(e)&&x.keys(e),t=(f||e).length,n=Array(t),d=0;d<t;d++){var s=f?f[d]:d;n[d]=a(e[s],s,e)}return n};var B=function(e){var a=function(a,b,f,t){var n=!S(a)&&x.keys(a),d=(n||a).length,s=e>0?0:d-1;for(t||(f=a[n?n[s]:s],s+=e);s>=0&&s<d;s+=e){var c=n?n[s]:s;f=b(f,a[c],c,a)}return f};return function(e,b,f,t){var n=arguments.length>=3;return a(e,g(b,t,4),f,n)}};x.reduce=x.foldl=x.inject=B(1),x.reduceRight=x.foldr=B(-1),x.find=x.detect=function(e,a,b){var f=(S(e)?x.findIndex:x.findKey)(e,a,b);if(void 0!==f&&-1!==f)return e[f]},x.filter=x.select=function(e,a,b){var f=[];return a=h(a,b),x.each(e,(function(e,b,t){a(e,b,t)&&f.push(e)})),f},x.reject=function(e,a,b){return x.filter(e,x.negate(h(a)),b)},x.every=x.all=function(e,a,b){a=h(a,b);for(var f=!S(e)&&x.keys(e),t=(f||e).length,n=0;n<t;n++){var d=f?f[n]:n;if(!a(e[d],d,e))return!1}return!0},x.some=x.any=function(e,a,b){a=h(a,b);for(var f=!S(e)&&x.keys(e),t=(f||e).length,n=0;n<t;n++){var d=f?f[n]:n;if(a(e[d],d,e))return!0}return!1},x.contains=x.includes=x.include=function(e,a,b,f){return S(e)||(e=x.values(e)),("number"!=typeof b||f)&&(b=0),x.indexOf(e,a,b)>=0},x.invoke=v((function(e,a,b){var f,t;return x.isFunction(a)?t=a:x.isArray(a)&&(f=a.slice(0,-1),a=a[a.length-1]),x.map(e,(function(e){var n=t;if(!n){if(f&&f.length&&(e=E(e,f)),null==e)return;n=e[a]}return null==n?n:n.apply(e,b)}))})),x.pluck=function(e,a){return x.map(e,x.property(a))},x.where=function(e,a){return x.filter(e,x.matcher(a))},x.findWhere=function(e,a){return x.find(e,x.matcher(a))},x.max=function(e,a,b){var f,t,n=-1/0,d=-1/0;if(null==a||"number"==typeof a&&"object"!=typeof e[0]&&null!=e)for(var s=0,c=(e=S(e)?e:x.values(e)).length;s<c;s++)null!=(f=e[s])&&f>n&&(n=f);else a=h(a,b),x.each(e,(function(e,b,f){((t=a(e,b,f))>d||t===-1/0&&n===-1/0)&&(n=e,d=t)}));return n},x.min=function(e,a,b){var f,t,n=1/0,d=1/0;if(null==a||"number"==typeof a&&"object"!=typeof e[0]&&null!=e)for(var s=0,c=(e=S(e)?e:x.values(e)).length;s<c;s++)null!=(f=e[s])&&f<n&&(n=f);else a=h(a,b),x.each(e,(function(e,b,f){((t=a(e,b,f))<d||t===1/0&&n===1/0)&&(n=e,d=t)}));return n},x.shuffle=function(e){return x.sample(e,1/0)},x.sample=function(e,a,b){if(null==a||b)return S(e)||(e=x.values(e)),e[x.random(e.length-1)];var f=S(e)?x.clone(e):x.values(e),t=D(f);a=Math.max(Math.min(a,t),0);for(var n=t-1,d=0;d<a;d++){var s=x.random(d,n),c=f[d];f[d]=f[s],f[s]=c}return f.slice(0,a)},x.sortBy=function(e,a,b){var f=0;return a=h(a,b),x.pluck(x.map(e,(function(e,b,t){return{value:e,index:f++,criteria:a(e,b,t)}})).sort((function(e,a){var b=e.criteria,f=a.criteria;if(b!==f){if(b>f||void 0===b)return 1;if(b<f||void 0===f)return-1}return e.index-a.index})),"value")};var F=function(e,a){return function(b,f,t){var n=a?[[],[]]:{};return f=h(f,t),x.each(b,(function(a,t){var d=f(a,t,b);e(n,a,d)})),n}};x.groupBy=F((function(e,a,b){A(e,b)?e[b].push(a):e[b]=[a]})),x.indexBy=F((function(e,a,b){e[b]=a})),x.countBy=F((function(e,a,b){A(e,b)?e[b]++:e[b]=1}));var k=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;x.toArray=function(e){return e?x.isArray(e)?r.call(e):x.isString(e)?e.match(k):S(e)?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return null==e?0:S(e)?e.length:x.keys(e).length},x.partition=F((function(e,a,b){e[b?0:1].push(a)}),!0),x.first=x.head=x.take=function(e,a,b){return null==e||e.length<1?null==a?void 0:[]:null==a||b?e[0]:x.initial(e,e.length-a)},x.initial=function(e,a,b){return r.call(e,0,Math.max(0,e.length-(null==a||b?1:a)))},x.last=function(e,a,b){return null==e||e.length<1?null==a?void 0:[]:null==a||b?e[e.length-1]:x.rest(e,Math.max(0,e.length-a))},x.rest=x.tail=x.drop=function(e,a,b){return r.call(e,null==a||b?1:a)},x.compact=function(e){return x.filter(e,Boolean)};var _=function(e,a,b,f){for(var t=(f=f||[]).length,n=0,d=D(e);n<d;n++){var s=e[n];if(S(s)&&(x.isArray(s)||x.isArguments(s)))if(a)for(var c=0,i=s.length;c<i;)f[t++]=s[c++];else _(s,a,b,f),t=f.length;else b||(f[t++]=s)}return f};x.flatten=function(e,a){return _(e,a,!1)},x.without=v((function(e,a){return x.difference(e,a)})),x.uniq=x.unique=function(e,a,b,f){x.isBoolean(a)||(f=b,b=a,a=!1),null!=b&&(b=h(b,f));for(var t=[],n=[],d=0,s=D(e);d<s;d++){var c=e[d],i=b?b(c,d,e):c;a&&!b?(d&&n===i||t.push(c),n=i):b?x.contains(n,i)||(n.push(i),t.push(c)):x.contains(t,c)||t.push(c)}return t},x.union=v((function(e){return x.uniq(_(e,!0,!0))})),x.intersection=function(e){for(var a=[],b=arguments.length,f=0,t=D(e);f<t;f++){var n=e[f];if(!x.contains(a,n)){var d;for(d=1;d<b&&x.contains(arguments[d],n);d++);d===b&&a.push(n)}}return a},x.difference=v((function(e,a){return a=_(a,!0,!0),x.filter(e,(function(e){return!x.contains(a,e)}))})),x.unzip=function(e){for(var a=e&&x.max(e,D).length||0,b=Array(a),f=0;f<a;f++)b[f]=x.pluck(e,f);return b},x.zip=v(x.unzip),x.object=function(e,a){for(var b={},f=0,t=D(e);f<t;f++)a?b[e[f]]=a[f]:b[e[f][0]]=e[f][1];return b};var R=function(e){return function(a,b,f){b=h(b,f);for(var t=D(a),n=e>0?0:t-1;n>=0&&n<t;n+=e)if(b(a[n],n,a))return n;return-1}};x.findIndex=R(1),x.findLastIndex=R(-1),x.sortedIndex=function(e,a,b,f){for(var t=(b=h(b,f,1))(a),n=0,d=D(e);n<d;){var s=Math.floor((n+d)/2);b(e[s])<t?n=s+1:d=s}return n};var P=function(e,a,b){return function(f,t,n){var d=0,s=D(f);if("number"==typeof n)e>0?d=n>=0?n:Math.max(n+s,d):s=n>=0?Math.min(n+1,s):n+s+1;else if(b&&n&&s)return f[n=b(f,t)]===t?n:-1;if(t!=t)return(n=a(r.call(f,d,s),x.isNaN))>=0?n+d:-1;for(n=e>0?d:s-1;n>=0&&n<s;n+=e)if(f[n]===t)return n;return-1}};x.indexOf=P(1,x.findIndex,x.sortedIndex),x.lastIndexOf=P(-1,x.findLastIndex),x.range=function(e,a,b){null==a&&(a=e||0,e=0),b||(b=a<e?-1:1);for(var f=Math.max(Math.ceil((a-e)/b),0),t=Array(f),n=0;n<f;n++,e+=b)t[n]=e;return t},x.chunk=function(e,a){if(null==a||a<1)return[];for(var b=[],f=0,t=e.length;f<t;)b.push(r.call(e,f,f+=a));return b};var O=function(e,a,b,f,t){if(!(f instanceof a))return e.apply(b,t);var n=w(e.prototype),d=e.apply(n,t);return x.isObject(d)?d:n};x.bind=v((function(e,a,b){if(!x.isFunction(e))throw new TypeError("Bind must be called on a function");var f=v((function(t){return O(e,f,a,this,b.concat(t))}));return f})),x.partial=v((function(e,a){var b=x.partial.placeholder,f=function(){for(var t=0,n=a.length,d=Array(n),s=0;s<n;s++)d[s]=a[s]===b?arguments[t++]:a[s];for(;t<arguments.length;)d.push(arguments[t++]);return O(e,f,this,this,d)};return f})),x.partial.placeholder=x,x.bindAll=v((function(e,a){var b=(a=_(a,!1,!1)).length;if(b<1)throw new Error("bindAll must be passed function names");for(;b--;){var f=a[b];e[f]=x.bind(e[f],e)}})),x.memoize=function(e,a){var b=function(f){var t=b.cache,n=""+(a?a.apply(this,arguments):f);return A(t,n)||(t[n]=e.apply(this,arguments)),t[n]};return b.cache={},b},x.delay=v((function(e,a,b){return setTimeout((function(){return e.apply(null,b)}),a)})),x.defer=x.partial(x.delay,x,1),x.throttle=function(e,a,b){var f,t,n,d,s=0;b||(b={});var c=function(){s=!1===b.leading?0:x.now(),f=null,d=e.apply(t,n),f||(t=n=null)},i=function(){var i=x.now();s||!1!==b.leading||(s=i);var r=a-(i-s);return t=this,n=arguments,r<=0||r>a?(f&&(clearTimeout(f),f=null),s=i,d=e.apply(t,n),f||(t=n=null)):f||!1===b.trailing||(f=setTimeout(c,r)),d};return i.cancel=function(){clearTimeout(f),s=0,f=t=n=null},i},x.debounce=function(e,a,b){var f,t,n=function(a,b){f=null,b&&(t=e.apply(a,b))},d=v((function(d){if(f&&clearTimeout(f),b){var s=!f;f=setTimeout(n,a),s&&(t=e.apply(this,d))}else f=x.delay(n,a,this,d);return t}));return d.cancel=function(){clearTimeout(f),f=null},d},x.wrap=function(e,a){return x.partial(a,e)},x.negate=function(e){return function(){return!e.apply(this,arguments)}},x.compose=function(){var e=arguments,a=e.length-1;return function(){for(var b=a,f=e[a].apply(this,arguments);b--;)f=e[b].call(this,f);return f}},x.after=function(e,a){return function(){if(--e<1)return a.apply(this,arguments)}},x.before=function(e,a){var b;return function(){return--e>0&&(b=a.apply(this,arguments)),e<=1&&(a=null),b}},x.once=x.partial(x.before,2),x.restArguments=v;var I=!{toString:null}.propertyIsEnumerable("toString"),N=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],L=function(e,a){var b=N.length,f=e.constructor,t=x.isFunction(f)&&f.prototype||s,n="constructor";for(A(e,n)&&!x.contains(a,n)&&a.push(n);b--;)(n=N[b])in e&&e[n]!==t[n]&&!x.contains(a,n)&&a.push(n)};x.keys=function(e){if(!x.isObject(e))return[];if(l)return l(e);var a=[];for(var b in e)A(e,b)&&a.push(b);return I&&L(e,a),a},x.allKeys=function(e){if(!x.isObject(e))return[];var a=[];for(var b in e)a.push(b);return I&&L(e,a),a},x.values=function(e){for(var a=x.keys(e),b=a.length,f=Array(b),t=0;t<b;t++)f[t]=e[a[t]];return f},x.mapObject=function(e,a,b){a=h(a,b);for(var f=x.keys(e),t=f.length,n={},d=0;d<t;d++){var s=f[d];n[s]=a(e[s],s,e)}return n},x.pairs=function(e){for(var a=x.keys(e),b=a.length,f=Array(b),t=0;t<b;t++)f[t]=[a[t],e[a[t]]];return f},x.invert=function(e){for(var a={},b=x.keys(e),f=0,t=b.length;f<t;f++)a[e[b[f]]]=b[f];return a},x.functions=x.methods=function(e){var a=[];for(var b in e)x.isFunction(e[b])&&a.push(b);return a.sort()};var U=function(e,a){return function(b){var f=arguments.length;if(a&&(b=Object(b)),f<2||null==b)return b;for(var t=1;t<f;t++)for(var n=arguments[t],d=e(n),s=d.length,c=0;c<s;c++){var i=d[c];a&&void 0!==b[i]||(b[i]=n[i])}return b}};x.extend=U(x.allKeys),x.extendOwn=x.assign=U(x.keys),x.findKey=function(e,a,b){a=h(a,b);for(var f,t=x.keys(e),n=0,d=t.length;n<d;n++)if(a(e[f=t[n]],f,e))return f};var V,K,z=function(e,a,b){return a in b};x.pick=v((function(e,a){var b={},f=a[0];if(null==e)return b;x.isFunction(f)?(a.length>1&&(f=g(f,a[1])),a=x.allKeys(e)):(f=z,a=_(a,!1,!1),e=Object(e));for(var t=0,n=a.length;t<n;t++){var d=a[t],s=e[d];f(s,d,e)&&(b[d]=s)}return b})),x.omit=v((function(e,a){var b,f=a[0];return x.isFunction(f)?(f=x.negate(f),a.length>1&&(b=a[1])):(a=x.map(_(a,!1,!1),String),f=function(e,b){return!x.contains(a,b)}),x.pick(e,f,b)})),x.defaults=U(x.allKeys,!0),x.create=function(e,a){var b=w(e);return a&&x.extendOwn(b,a),b},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,a){return a(e),e},x.isMatch=function(e,a){var b=x.keys(a),f=b.length;if(null==e)return!f;for(var t=Object(e),n=0;n<f;n++){var d=b[n];if(a[d]!==t[d]||!(d in t))return!1}return!0},V=function(e,a,b,f){if(e===a)return 0!==e||1/e==1/a;if(null==e||null==a)return!1;if(e!=e)return a!=a;var t=typeof e;return("function"===t||"object"===t||"object"==typeof a)&&K(e,a,b,f)},K=function(e,a,b,f){e instanceof x&&(e=e._wrapped),a instanceof x&&(a=a._wrapped);var t=u.call(e);if(t!==u.call(a))return!1;switch(t){case"[object RegExp]":case"[object String]":return""+e==""+a;case"[object Number]":return+e!=+e?+a!=+a:0==+e?1/+e==1/a:+e==+a;case"[object Date]":case"[object Boolean]":return+e==+a;case"[object Symbol]":return c.valueOf.call(e)===c.valueOf.call(a)}var n="[object Array]"===t;if(!n){if("object"!=typeof e||"object"!=typeof a)return!1;var d=e.constructor,s=a.constructor;if(d!==s&&!(x.isFunction(d)&&d instanceof d&&x.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in a)return!1}f=f||[];for(var i=(b=b||[]).length;i--;)if(b[i]===e)return f[i]===a;if(b.push(e),f.push(a),n){if((i=e.length)!==a.length)return!1;for(;i--;)if(!V(e[i],a[i],b,f))return!1}else{var r,p=x.keys(e);if(i=p.length,x.keys(a).length!==i)return!1;for(;i--;)if(r=p[i],!A(a,r)||!V(e[r],a[r],b,f))return!1}return b.pop(),f.pop(),!0},x.isEqual=function(e,a){return V(e,a)},x.isEmpty=function(e){return null==e||(S(e)&&(x.isArray(e)||x.isString(e)||x.isArguments(e))?0===e.length:0===x.keys(e).length)},x.isElement=function(e){return!(!e||1!==e.nodeType)},x.isArray=y||function(e){return"[object Array]"===u.call(e)},x.isObject=function(e){var a=typeof e;return"function"===a||"object"===a&&!!e},x.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],(function(e){x["is"+e]=function(a){return u.call(a)==="[object "+e+"]"}})),x.isArguments(arguments)||(x.isArguments=function(e){return A(e,"callee")});var X=t.document&&t.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof X&&(x.isFunction=function(e){return"function"==typeof e||!1}),x.isFinite=function(e){return!x.isSymbol(e)&&isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&isNaN(e)},x.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===u.call(e)},x.isNull=function(e){return null===e},x.isUndefined=function(e){return void 0===e},x.has=function(e,a){if(!x.isArray(a))return A(e,a);for(var b=a.length,f=0;f<b;f++){var t=a[f];if(null==e||!p.call(e,t))return!1;e=e[t]}return!!b},x.noConflict=function(){return t._=n,this},x.identity=function(e){return e},x.constant=function(e){return function(){return e}},x.noop=function(){},x.property=function(e){return x.isArray(e)?function(a){return E(a,e)}:M(e)},x.propertyOf=function(e){return null==e?function(){}:function(a){return x.isArray(a)?E(e,a):e[a]}},x.matcher=x.matches=function(e){return e=x.extendOwn({},e),function(a){return x.isMatch(a,e)}},x.times=function(e,a,b){var f=Array(Math.max(0,e));a=g(a,b,1);for(var t=0;t<e;t++)f[t]=a(t);return f},x.random=function(e,a){return null==a&&(a=e,e=0),e+Math.floor(Math.random()*(a-e+1))},x.now=Date.now||function(){return(new Date).getTime()};var Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},q=x.invert(Z),H=function(e){var a=function(a){return e[a]},b="(?:"+x.keys(e).join("|")+")",f=RegExp(b),t=RegExp(b,"g");return function(e){return e=null==e?"":""+e,f.test(e)?e.replace(t,a):e}};x.escape=H(Z),x.unescape=H(q),x.result=function(e,a,b){x.isArray(a)||(a=[a]);var f=a.length;if(!f)return x.isFunction(b)?b.call(e):b;for(var t=0;t<f;t++){var n=null==e?void 0:e[a[t]];void 0===n&&(n=b,t=f),e=x.isFunction(n)?n.call(e):n}return e};var Q=0;x.uniqueId=function(e){var a=++Q+"";return e?e+a:a},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var W=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Y=/\\|'|\r|\n|\u2028|\u2029/g,$=function(e){return"\\"+G[e]};x.template=function(e,a,b){!a&&b&&(a=b),a=x.defaults({},a,x.templateSettings);var f,t=RegExp([(a.escape||W).source,(a.interpolate||W).source,(a.evaluate||W).source].join("|")+"|$","g"),n=0,d="__p+='";e.replace(t,(function(a,b,f,t,s){return d+=e.slice(n,s).replace(Y,$),n=s+a.length,b?d+="'+\n((__t=("+b+"))==null?'':_.escape(__t))+\n'":f?d+="'+\n((__t=("+f+"))==null?'':__t)+\n'":t&&(d+="';\n"+t+"\n__p+='"),a})),d+="';\n",a.variable||(d="with(obj||{}){\n"+d+"}\n"),d="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+d+"return __p;\n";try{f=new Function(a.variable||"obj","_",d)}catch(e){throw e.source=d,e}var s=function(e){return f.call(this,e,x)},c=a.variable||"obj";return s.source="function("+c+"){\n"+d+"}",s},x.chain=function(e){var a=x(e);return a._chain=!0,a};var j=function(e,a){return e._chain?x(a).chain():a};x.mixin=function(e){return x.each(x.functions(e),(function(a){var b=x[a]=e[a];x.prototype[a]=function(){var e=[this._wrapped];return i.apply(e,arguments),j(this,b.apply(x,e))}})),x},x.mixin(x),x.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var a=d[e];x.prototype[e]=function(){var b=this._wrapped;return a.apply(b,arguments),"shift"!==e&&"splice"!==e||0!==b.length||delete b[0],j(this,b)}})),x.each(["concat","join","slice"],(function(e){var a=d[e];x.prototype[e]=function(){return j(this,a.apply(this._wrapped,arguments))}})),x.prototype.value=function(){return this._wrapped},x.prototype.valueOf=x.prototype.toJSON=x.prototype.value,x.prototype.toString=function(){return String(this._wrapped)},void 0===(f=function(){return x}.apply(a,[]))||(b.exports=f)}()}).call(this,b(4),b(5)(e))},function(e,a,b){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var f=b(21),t=b(22),n=b(23);function d(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,a){if(d()<a)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(a)).__proto__=c.prototype:(null===e&&(e=new c(a)),e.length=a),e}function c(e,a,b){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,a,b);if("number"==typeof e){if("string"==typeof a)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return i(this,e,a,b)}function i(e,a,b,f){if("number"==typeof a)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&a instanceof ArrayBuffer?function(e,a,b,f){if(a.byteLength,b<0||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(f||0))throw new RangeError("'length' is out of bounds");a=void 0===b&&void 0===f?new Uint8Array(a):void 0===f?new Uint8Array(a,b):new Uint8Array(a,b,f);c.TYPED_ARRAY_SUPPORT?(e=a).__proto__=c.prototype:e=p(e,a);return e}(e,a,b,f):"string"==typeof a?function(e,a,b){"string"==typeof b&&""!==b||(b="utf8");if(!c.isEncoding(b))throw new TypeError('"encoding" must be a valid string encoding');var f=0|l(a,b),t=(e=s(e,f)).write(a,b);t!==f&&(e=e.slice(0,t));return e}(e,a,b):function(e,a){if(c.isBuffer(a)){var b=0|y(a.length);return 0===(e=s(e,b)).length||a.copy(e,0,0,b),e}if(a){if("undefined"!=typeof ArrayBuffer&&a.buffer instanceof ArrayBuffer||"length"in a)return"number"!=typeof a.length||(f=a.length)!=f?s(e,0):p(e,a);if("Buffer"===a.type&&n(a.data))return p(e,a.data)}var f;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,a)}function r(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,a){if(r(a),e=s(e,a<0?0:0|y(a)),!c.TYPED_ARRAY_SUPPORT)for(var b=0;b<a;++b)e[b]=0;return e}function p(e,a){var b=a.length<0?0:0|y(a.length);e=s(e,b);for(var f=0;f<b;f+=1)e[f]=255&a[f];return e}function y(e){if(e>=d())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d().toString(16)+" bytes");return 0|e}function l(e,a){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var b=e.length;if(0===b)return 0;for(var f=!1;;)switch(a){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*b;case"hex":return b>>>1;case"base64":return K(e).length;default:if(f)return V(e).length;a=(""+a).toLowerCase(),f=!0}}function o(e,a,b){var f=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===b||b>this.length)&&(b=this.length),b<=0)return"";if((b>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,a,b);case"utf8":case"utf-8":return C(this,a,b);case"ascii":return D(this,a,b);case"latin1":case"binary":return S(this,a,b);case"base64":return E(this,a,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,a,b);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),f=!0}}function m(e,a,b){var f=e[a];e[a]=e[b],e[b]=f}function x(e,a,b,f,t){if(0===e.length)return-1;if("string"==typeof b?(f=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,isNaN(b)&&(b=t?0:e.length-1),b<0&&(b=e.length+b),b>=e.length){if(t)return-1;b=e.length-1}else if(b<0){if(!t)return-1;b=0}if("string"==typeof a&&(a=c.from(a,f)),c.isBuffer(a))return 0===a.length?-1:T(e,a,b,f,t);if("number"==typeof a)return a&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?t?Uint8Array.prototype.indexOf.call(e,a,b):Uint8Array.prototype.lastIndexOf.call(e,a,b):T(e,[a],b,f,t);throw new TypeError("val must be string, number or Buffer")}function T(e,a,b,f,t){var n,d=1,s=e.length,c=a.length;if(void 0!==f&&("ucs2"===(f=String(f).toLowerCase())||"ucs-2"===f||"utf16le"===f||"utf-16le"===f)){if(e.length<2||a.length<2)return-1;d=2,s/=2,c/=2,b/=2}function i(e,a){return 1===d?e[a]:e.readUInt16BE(a*d)}if(t){var r=-1;for(n=b;n<s;n++)if(i(e,n)===i(a,-1===r?0:n-r)){if(-1===r&&(r=n),n-r+1===c)return r*d}else-1!==r&&(n-=n-r),r=-1}else for(b+c>s&&(b=s-c),n=b;n>=0;n--){for(var u=!0,p=0;p<c;p++)if(i(e,n+p)!==i(a,p)){u=!1;break}if(u)return n}return-1}function g(e,a,b,f){b=Number(b)||0;var t=e.length-b;f?(f=Number(f))>t&&(f=t):f=t;var n=a.length;if(n%2!=0)throw new TypeError("Invalid hex string");f>n/2&&(f=n/2);for(var d=0;d<f;++d){var s=parseInt(a.substr(2*d,2),16);if(isNaN(s))return d;e[b+d]=s}return d}function h(e,a,b,f){return z(V(a,e.length-b),e,b,f)}function v(e,a,b,f){return z(function(e){for(var a=[],b=0;b<e.length;++b)a.push(255&e.charCodeAt(b));return a}(a),e,b,f)}function w(e,a,b,f){return v(e,a,b,f)}function M(e,a,b,f){return z(K(a),e,b,f)}function A(e,a,b,f){return z(function(e,a){for(var b,f,t,n=[],d=0;d<e.length&&!((a-=2)<0);++d)b=e.charCodeAt(d),f=b>>8,t=b%256,n.push(t),n.push(f);return n}(a,e.length-b),e,b,f)}function E(e,a,b){return 0===a&&b===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(a,b))}function C(e,a,b){b=Math.min(e.length,b);for(var f=[],t=a;t<b;){var n,d,s,c,i=e[t],r=null,u=i>239?4:i>223?3:i>191?2:1;if(t+u<=b)switch(u){case 1:i<128&&(r=i);break;case 2:128==(192&(n=e[t+1]))&&(c=(31&i)<<6|63&n)>127&&(r=c);break;case 3:n=e[t+1],d=e[t+2],128==(192&n)&&128==(192&d)&&(c=(15&i)<<12|(63&n)<<6|63&d)>2047&&(c<55296||c>57343)&&(r=c);break;case 4:n=e[t+1],d=e[t+2],s=e[t+3],128==(192&n)&&128==(192&d)&&128==(192&s)&&(c=(15&i)<<18|(63&n)<<12|(63&d)<<6|63&s)>65535&&c<1114112&&(r=c)}null===r?(r=65533,u=1):r>65535&&(r-=65536,f.push(r>>>10&1023|55296),r=56320|1023&r),f.push(r),t+=u}return function(e){var a=e.length;if(a<=4096)return String.fromCharCode.apply(String,e);var b="",f=0;for(;f<a;)b+=String.fromCharCode.apply(String,e.slice(f,f+=4096));return b}(f)}a.Buffer=c,a.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},a.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),a.kMaxLength=d(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,a,b){return i(null,e,a,b)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,a,b){return function(e,a,b,f){return r(a),a<=0?s(e,a):void 0!==b?"string"==typeof f?s(e,a).fill(b,f):s(e,a).fill(b):s(e,a)}(null,e,a,b)},c.allocUnsafe=function(e){return u(null,e)},c.allocUnsafeSlow=function(e){return u(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,a){if(!c.isBuffer(e)||!c.isBuffer(a))throw new TypeError("Arguments must be Buffers");if(e===a)return 0;for(var b=e.length,f=a.length,t=0,n=Math.min(b,f);t<n;++t)if(e[t]!==a[t]){b=e[t],f=a[t];break}return b<f?-1:f<b?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,a){if(!n(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var b;if(void 0===a)for(a=0,b=0;b<e.length;++b)a+=e[b].length;var f=c.allocUnsafe(a),t=0;for(b=0;b<e.length;++b){var d=e[b];if(!c.isBuffer(d))throw new TypeError('"list" argument must be an Array of Buffers');d.copy(f,t),t+=d.length}return f},c.byteLength=l,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;a<e;a+=2)m(this,a,a+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<e;a+=4)m(this,a,a+3),m(this,a+1,a+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<e;a+=8)m(this,a,a+7),m(this,a+1,a+6),m(this,a+2,a+5),m(this,a+3,a+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):o.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",b=a.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,a,b,f,t){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===a&&(a=0),void 0===b&&(b=e?e.length:0),void 0===f&&(f=0),void 0===t&&(t=this.length),a<0||b>e.length||f<0||t>this.length)throw new RangeError("out of range index");if(f>=t&&a>=b)return 0;if(f>=t)return-1;if(a>=b)return 1;if(this===e)return 0;for(var n=(t>>>=0)-(f>>>=0),d=(b>>>=0)-(a>>>=0),s=Math.min(n,d),i=this.slice(f,t),r=e.slice(a,b),u=0;u<s;++u)if(i[u]!==r[u]){n=i[u],d=r[u];break}return n<d?-1:d<n?1:0},c.prototype.includes=function(e,a,b){return-1!==this.indexOf(e,a,b)},c.prototype.indexOf=function(e,a,b){return x(this,e,a,b,!0)},c.prototype.lastIndexOf=function(e,a,b){return x(this,e,a,b,!1)},c.prototype.write=function(e,a,b,f){if(void 0===a)f="utf8",b=this.length,a=0;else if(void 0===b&&"string"==typeof a)f=a,b=this.length,a=0;else{if(!isFinite(a))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");a|=0,isFinite(b)?(b|=0,void 0===f&&(f="utf8")):(f=b,b=void 0)}var t=this.length-a;if((void 0===b||b>t)&&(b=t),e.length>0&&(b<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");for(var n=!1;;)switch(f){case"hex":return g(this,e,a,b);case"utf8":case"utf-8":return h(this,e,a,b);case"ascii":return v(this,e,a,b);case"latin1":case"binary":return w(this,e,a,b);case"base64":return M(this,e,a,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,a,b);default:if(n)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),n=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(e,a,b){var f="";b=Math.min(e.length,b);for(var t=a;t<b;++t)f+=String.fromCharCode(127&e[t]);return f}function S(e,a,b){var f="";b=Math.min(e.length,b);for(var t=a;t<b;++t)f+=String.fromCharCode(e[t]);return f}function B(e,a,b){var f=e.length;(!a||a<0)&&(a=0),(!b||b<0||b>f)&&(b=f);for(var t="",n=a;n<b;++n)t+=U(e[n]);return t}function F(e,a,b){for(var f=e.slice(a,b),t="",n=0;n<f.length;n+=2)t+=String.fromCharCode(f[n]+256*f[n+1]);return t}function k(e,a,b){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+a>b)throw new RangeError("Trying to access beyond buffer length")}function _(e,a,b,f,t,n){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>t||a<n)throw new RangeError('"value" argument is out of bounds');if(b+f>e.length)throw new RangeError("Index out of range")}function R(e,a,b,f){a<0&&(a=65535+a+1);for(var t=0,n=Math.min(e.length-b,2);t<n;++t)e[b+t]=(a&255<<8*(f?t:1-t))>>>8*(f?t:1-t)}function P(e,a,b,f){a<0&&(a=4294967295+a+1);for(var t=0,n=Math.min(e.length-b,4);t<n;++t)e[b+t]=a>>>8*(f?t:3-t)&255}function O(e,a,b,f,t,n){if(b+f>e.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function I(e,a,b,f,n){return n||O(e,0,b,4),t.write(e,a,b,f,23,4),b+4}function N(e,a,b,f,n){return n||O(e,0,b,8),t.write(e,a,b,f,52,8),b+8}c.prototype.slice=function(e,a){var b,f=this.length;if((e=~~e)<0?(e+=f)<0&&(e=0):e>f&&(e=f),(a=void 0===a?f:~~a)<0?(a+=f)<0&&(a=0):a>f&&(a=f),a<e&&(a=e),c.TYPED_ARRAY_SUPPORT)(b=this.subarray(e,a)).__proto__=c.prototype;else{var t=a-e;b=new c(t,void 0);for(var n=0;n<t;++n)b[n]=this[n+e]}return b},c.prototype.readUIntLE=function(e,a,b){e|=0,a|=0,b||k(e,a,this.length);for(var f=this[e],t=1,n=0;++n<a&&(t*=256);)f+=this[e+n]*t;return f},c.prototype.readUIntBE=function(e,a,b){e|=0,a|=0,b||k(e,a,this.length);for(var f=this[e+--a],t=1;a>0&&(t*=256);)f+=this[e+--a]*t;return f},c.prototype.readUInt8=function(e,a){return a||k(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,a){return a||k(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,a){return a||k(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,a){return a||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,a){return a||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,a,b){e|=0,a|=0,b||k(e,a,this.length);for(var f=this[e],t=1,n=0;++n<a&&(t*=256);)f+=this[e+n]*t;return f>=(t*=128)&&(f-=Math.pow(2,8*a)),f},c.prototype.readIntBE=function(e,a,b){e|=0,a|=0,b||k(e,a,this.length);for(var f=a,t=1,n=this[e+--f];f>0&&(t*=256);)n+=this[e+--f]*t;return n>=(t*=128)&&(n-=Math.pow(2,8*a)),n},c.prototype.readInt8=function(e,a){return a||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,a){a||k(e,2,this.length);var b=this[e]|this[e+1]<<8;return 32768&b?4294901760|b:b},c.prototype.readInt16BE=function(e,a){a||k(e,2,this.length);var b=this[e+1]|this[e]<<8;return 32768&b?4294901760|b:b},c.prototype.readInt32LE=function(e,a){return a||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,a){return a||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,a){return a||k(e,4,this.length),t.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,a){return a||k(e,4,this.length),t.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,a){return a||k(e,8,this.length),t.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,a){return a||k(e,8,this.length),t.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,a,b,f){(e=+e,a|=0,b|=0,f)||_(this,e,a,b,Math.pow(2,8*b)-1,0);var t=1,n=0;for(this[a]=255&e;++n<b&&(t*=256);)this[a+n]=e/t&255;return a+b},c.prototype.writeUIntBE=function(e,a,b,f){(e=+e,a|=0,b|=0,f)||_(this,e,a,b,Math.pow(2,8*b)-1,0);var t=b-1,n=1;for(this[a+t]=255&e;--t>=0&&(n*=256);)this[a+t]=e/n&255;return a+b},c.prototype.writeUInt8=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[a]=255&e,a+1},c.prototype.writeUInt16LE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8):R(this,e,a,!0),a+2},c.prototype.writeUInt16BE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[a]=e>>>8,this[a+1]=255&e):R(this,e,a,!1),a+2},c.prototype.writeUInt32LE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e):P(this,e,a,!0),a+4},c.prototype.writeUInt32BE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e):P(this,e,a,!1),a+4},c.prototype.writeIntLE=function(e,a,b,f){if(e=+e,a|=0,!f){var t=Math.pow(2,8*b-1);_(this,e,a,b,t-1,-t)}var n=0,d=1,s=0;for(this[a]=255&e;++n<b&&(d*=256);)e<0&&0===s&&0!==this[a+n-1]&&(s=1),this[a+n]=(e/d>>0)-s&255;return a+b},c.prototype.writeIntBE=function(e,a,b,f){if(e=+e,a|=0,!f){var t=Math.pow(2,8*b-1);_(this,e,a,b,t-1,-t)}var n=b-1,d=1,s=0;for(this[a+n]=255&e;--n>=0&&(d*=256);)e<0&&0===s&&0!==this[a+n+1]&&(s=1),this[a+n]=(e/d>>0)-s&255;return a+b},c.prototype.writeInt8=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[a]=255&e,a+1},c.prototype.writeInt16LE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8):R(this,e,a,!0),a+2},c.prototype.writeInt16BE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[a]=e>>>8,this[a+1]=255&e):R(this,e,a,!1),a+2},c.prototype.writeInt32LE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24):P(this,e,a,!0),a+4},c.prototype.writeInt32BE=function(e,a,b){return e=+e,a|=0,b||_(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e):P(this,e,a,!1),a+4},c.prototype.writeFloatLE=function(e,a,b){return I(this,e,a,!0,b)},c.prototype.writeFloatBE=function(e,a,b){return I(this,e,a,!1,b)},c.prototype.writeDoubleLE=function(e,a,b){return N(this,e,a,!0,b)},c.prototype.writeDoubleBE=function(e,a,b){return N(this,e,a,!1,b)},c.prototype.copy=function(e,a,b,f){if(b||(b=0),f||0===f||(f=this.length),a>=e.length&&(a=e.length),a||(a=0),f>0&&f<b&&(f=b),f===b)return 0;if(0===e.length||0===this.length)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("sourceStart out of bounds");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),e.length-a<f-b&&(f=e.length-a+b);var t,n=f-b;if(this===e&&b<a&&a<f)for(t=n-1;t>=0;--t)e[t+a]=this[t+b];else if(n<1e3||!c.TYPED_ARRAY_SUPPORT)for(t=0;t<n;++t)e[t+a]=this[t+b];else Uint8Array.prototype.set.call(e,this.subarray(b,b+n),a);return n},c.prototype.fill=function(e,a,b,f){if("string"==typeof e){if("string"==typeof a?(f=a,a=0,b=this.length):"string"==typeof b&&(f=b,b=this.length),1===e.length){var t=e.charCodeAt(0);t<256&&(e=t)}if(void 0!==f&&"string"!=typeof f)throw new TypeError("encoding must be a string");if("string"==typeof f&&!c.isEncoding(f))throw new TypeError("Unknown encoding: "+f)}else"number"==typeof e&&(e&=255);if(a<0||this.length<a||this.length<b)throw new RangeError("Out of range index");if(b<=a)return this;var n;if(a>>>=0,b=void 0===b?this.length:b>>>0,e||(e=0),"number"==typeof e)for(n=a;n<b;++n)this[n]=e;else{var d=c.isBuffer(e)?e:V(new c(e,f).toString()),s=d.length;for(n=0;n<b-a;++n)this[n+a]=d[n%s]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,a){var b;a=a||1/0;for(var f=e.length,t=null,n=[],d=0;d<f;++d){if((b=e.charCodeAt(d))>55295&&b<57344){if(!t){if(b>56319){(a-=3)>-1&&n.push(239,191,189);continue}if(d+1===f){(a-=3)>-1&&n.push(239,191,189);continue}t=b;continue}if(b<56320){(a-=3)>-1&&n.push(239,191,189),t=b;continue}b=65536+(t-55296<<10|b-56320)}else t&&(a-=3)>-1&&n.push(239,191,189);if(t=null,b<128){if((a-=1)<0)break;n.push(b)}else if(b<2048){if((a-=2)<0)break;n.push(b>>6|192,63&b|128)}else if(b<65536){if((a-=3)<0)break;n.push(b>>12|224,b>>6&63|128,63&b|128)}else{if(!(b<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;n.push(b>>18|240,b>>12&63|128,b>>6&63|128,63&b|128)}}return n}function K(e){return f.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,a,b,f){for(var t=0;t<f&&!(t+b>=a.length||t>=e.length);++t)a[t+b]=e[t];return t}}).call(this,b(4))},function(e,a,b){(function(e){!function(e,a){"use strict";function f(e,a){if(!e)throw new Error(a||"Assertion failed")}function t(e,a){e.super_=a;var b=function(){};b.prototype=a.prototype,e.prototype=new b,e.prototype.constructor=e}function n(e,a,b){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(b=a,a=10),this._init(e||0,a||10,b||"be"))}var d;"object"==typeof e?e.exports=n:a.BN=n,n.BN=n,n.wordSize=26;try{d=b(27).Buffer}catch(e){}function s(e,a,b){for(var f=0,t=Math.min(e.length,b),n=a;n<t;n++){var d=e.charCodeAt(n)-48;f<<=4,f|=d>=49&&d<=54?d-49+10:d>=17&&d<=22?d-17+10:15&d}return f}function c(e,a,b,f){for(var t=0,n=Math.min(e.length,b),d=a;d<n;d++){var s=e.charCodeAt(d)-48;t*=f,t+=s>=49?s-49+10:s>=17?s-17+10:s}return t}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,a){return e.cmp(a)>0?e:a},n.min=function(e,a){return e.cmp(a)<0?e:a},n.prototype._init=function(e,a,b){if("number"==typeof e)return this._initNumber(e,a,b);if("object"==typeof e)return this._initArray(e,a,b);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var t=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&t++,16===a?this._parseHex(e,t):this._parseBase(e,a,t),"-"===e[0]&&(this.negative=1),this.strip(),"le"===b&&this._initArray(this.toArray(),a,b)},n.prototype._initNumber=function(e,a,b){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(f(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===b&&this._initArray(this.toArray(),a,b)},n.prototype._initArray=function(e,a,b){if(f("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var t=0;t<this.length;t++)this.words[t]=0;var n,d,s=0;if("be"===b)for(t=e.length-1,n=0;t>=0;t-=3)d=e[t]|e[t-1]<<8|e[t-2]<<16,this.words[n]|=d<<s&67108863,this.words[n+1]=d>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===b)for(t=0,n=0;t<e.length;t+=3)d=e[t]|e[t+1]<<8|e[t+2]<<16,this.words[n]|=d<<s&67108863,this.words[n+1]=d>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},n.prototype._parseHex=function(e,a){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var f,t,n=0;for(b=e.length-6,f=0;b>=a;b-=6)t=s(e,b,b+6),this.words[f]|=t<<n&67108863,this.words[f+1]|=t>>>26-n&4194303,(n+=24)>=26&&(n-=26,f++);b+6!==a&&(t=s(e,a,b+6),this.words[f]|=t<<n&67108863,this.words[f+1]|=t>>>26-n&4194303),this.strip()},n.prototype._parseBase=function(e,a,b){this.words=[0],this.length=1;for(var f=0,t=1;t<=67108863;t*=a)f++;f--,t=t/a|0;for(var n=e.length-b,d=n%f,s=Math.min(n,n-d)+b,i=0,r=b;r<s;r+=f)i=c(e,r,r+f,a),this.imuln(t),this.words[0]+i<67108864?this.words[0]+=i:this._iaddn(i);if(0!==d){var u=1;for(i=c(e,r,e.length,a),r=0;r<d;r++)u*=a;this.imuln(u),this.words[0]+i<67108864?this.words[0]+=i:this._iaddn(i)}},n.prototype.copy=function(e){e.words=new Array(this.length);for(var a=0;a<this.length;a++)e.words[a]=this.words[a];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var i=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,a,b){b.negative=a.negative^e.negative;var f=e.length+a.length|0;b.length=f,f=f-1|0;var t=0|e.words[0],n=0|a.words[0],d=t*n,s=67108863&d,c=d/67108864|0;b.words[0]=s;for(var i=1;i<f;i++){for(var r=c>>>26,u=67108863&c,p=Math.min(i,a.length-1),y=Math.max(0,i-e.length+1);y<=p;y++){var l=i-y|0;r+=(d=(t=0|e.words[l])*(n=0|a.words[y])+u)/67108864|0,u=67108863&d}b.words[i]=0|u,c=0|r}return 0!==c?b.words[i]=0|c:b.length--,b.strip()}n.prototype.toString=function(e,a){var b;if(a=0|a||1,16===(e=e||10)||"hex"===e){b="";for(var t=0,n=0,d=0;d<this.length;d++){var s=this.words[d],c=(16777215&(s<<t|n)).toString(16);b=0!==(n=s>>>24-t&16777215)||d!==this.length-1?i[6-c.length]+c+b:c+b,(t+=2)>=26&&(t-=26,d--)}for(0!==n&&(b=n.toString(16)+b);b.length%a!=0;)b="0"+b;return 0!==this.negative&&(b="-"+b),b}if(e===(0|e)&&e>=2&&e<=36){var p=r[e],y=u[e];b="";var l=this.clone();for(l.negative=0;!l.isZero();){var o=l.modn(y).toString(e);b=(l=l.idivn(y)).isZero()?o+b:i[p-o.length]+o+b}for(this.isZero()&&(b="0"+b);b.length%a!=0;)b="0"+b;return 0!==this.negative&&(b="-"+b),b}f(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,a){return f(void 0!==d),this.toArrayLike(d,e,a)},n.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},n.prototype.toArrayLike=function(e,a,b){var t=this.byteLength(),n=b||Math.max(1,t);f(t<=n,"byte array longer than desired length"),f(n>0,"Requested array length <= 0"),this.strip();var d,s,c="le"===a,i=new e(n),r=this.clone();if(c){for(s=0;!r.isZero();s++)d=r.andln(255),r.iushrn(8),i[s]=d;for(;s<n;s++)i[s]=0}else{for(s=0;s<n-t;s++)i[s]=0;for(s=0;!r.isZero();s++)d=r.andln(255),r.iushrn(8),i[n-s-1]=d}return i},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var a=e,b=0;return a>=4096&&(b+=13,a>>>=13),a>=64&&(b+=7,a>>>=7),a>=8&&(b+=4,a>>>=4),a>=2&&(b+=2,a>>>=2),b+a},n.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,b=0;return 0==(8191&a)&&(b+=13,a>>>=13),0==(127&a)&&(b+=7,a>>>=7),0==(15&a)&&(b+=4,a>>>=4),0==(3&a)&&(b+=2,a>>>=2),0==(1&a)&&b++,b},n.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;a<this.length;a++){var b=this._zeroBits(this.words[a]);if(e+=b,26!==b)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var a=0;a<e.length;a++)this.words[a]=this.words[a]|e.words[a];return this.strip()},n.prototype.ior=function(e){return f(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var b=0;b<a.length;b++)this.words[b]=this.words[b]&e.words[b];return this.length=a.length,this.strip()},n.prototype.iand=function(e){return f(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var a,b;this.length>e.length?(a=this,b=e):(a=e,b=this);for(var f=0;f<b.length;f++)this.words[f]=a.words[f]^b.words[f];if(this!==a)for(;f<a.length;f++)this.words[f]=a.words[f];return this.length=a.length,this.strip()},n.prototype.ixor=function(e){return f(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),b=e%26;this._expand(a),b>0&&a--;for(var t=0;t<a;t++)this.words[t]=67108863&~this.words[t];return b>0&&(this.words[t]=~this.words[t]&67108863>>26-b),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var b=e/26|0,t=e%26;return this._expand(b+1),this.words[b]=a?this.words[b]|1<<t:this.words[b]&~(1<<t),this.strip()},n.prototype.iadd=function(e){var a,b,f;if(0!==this.negative&&0===e.negative)return this.negative=0,a=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,a=this.isub(e),e.negative=1,a._normSign();this.length>e.length?(b=this,f=e):(b=e,f=this);for(var t=0,n=0;n<f.length;n++)a=(0|b.words[n])+(0|f.words[n])+t,this.words[n]=67108863&a,t=a>>>26;for(;0!==t&&n<b.length;n++)a=(0|b.words[n])+t,this.words[n]=67108863&a,t=a>>>26;if(this.length=b.length,0!==t)this.words[this.length]=t,this.length++;else if(b!==this)for(;n<b.length;n++)this.words[n]=b.words[n];return this},n.prototype.add=function(e){var a;return 0!==e.negative&&0===this.negative?(e.negative=0,a=this.sub(e),e.negative^=1,a):0===e.negative&&0!==this.negative?(this.negative=0,a=e.sub(this),this.negative=1,a):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var b,f,t=this.cmp(e);if(0===t)return this.negative=0,this.length=1,this.words[0]=0,this;t>0?(b=this,f=e):(b=e,f=this);for(var n=0,d=0;d<f.length;d++)n=(a=(0|b.words[d])-(0|f.words[d])+n)>>26,this.words[d]=67108863&a;for(;0!==n&&d<b.length;d++)n=(a=(0|b.words[d])+n)>>26,this.words[d]=67108863&a;if(0===n&&d<b.length&&b!==this)for(;d<b.length;d++)this.words[d]=b.words[d];return this.length=Math.max(this.length,d),b!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.c