Files
elasticsearch-js/dist/elasticsearch.min.js

9 lines
114 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! elasticsearch-js - v0.0.1 - 2013-11-11
* https://github.com/elasticsearch/elasticsearch-js
* Copyright (c) 2013 Spencer Alger; Licensed Apache License */
// built using browserify
!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.elasticsearch=a():"undefined"!=typeof global?global.elasticsearch=a():"undefined"!=typeof self&&(self.elasticsearch=a())}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(){},{}],2:[function(a,b,c){function d(a){return"[object Array]"===j.call(a)}function e(a,b){var c;if(null===a)c={__proto__:null};else{if("object"!=typeof a)throw new TypeError("typeof prototype["+typeof a+"] != 'object'");var d=function(){};d.prototype=a,c=new d,c.__proto__=a}return"undefined"!=typeof b&&Object.defineProperties&&Object.defineProperties(c,b),c}function f(a){return"object"!=typeof a&&"function"!=typeof a||null===a}function g(a){if(f(a))throw new TypeError("Object.keys called on a non-object");var b=[];for(var c in a)k.call(a,c)&&b.push(c);return b}function h(a){if(f(a))throw new TypeError("Object.getOwnPropertyNames called on a non-object");var b=g(a);return c.isArray(a)&&-1===c.indexOf(a,"length")&&b.push("length"),b}function i(a,b){return{value:a[b]}}var j=Object.prototype.toString,k=Object.prototype.hasOwnProperty;c.isArray="function"==typeof Array.isArray?Array.isArray:d,c.indexOf=function(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0;c<a.length;c++)if(b===a[c])return c;return-1},c.filter=function(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c},c.forEach=function(a,b,c){if(a.forEach)return a.forEach(b,c);for(var d=0;d<a.length;d++)b.call(c,a[d],d,a)},c.map=function(a,b){if(a.map)return a.map(b);for(var c=new Array(a.length),d=0;d<a.length;d++)c[d]=b(a[d],d,a);return c},c.reduce=function(a,b,c){if(a.reduce)return a.reduce(b,c);var d,e=!1;2<arguments.length&&(d=c,e=!0);for(var f=0,g=a.length;g>f;++f)a.hasOwnProperty(f)&&(e?d=b(d,a[f],f,a):(d=a[f],e=!0));return d},c.substr="b"!=="ab".substr(-1)?function(a,b,c){return 0>b&&(b=a.length+b),a.substr(b,c)}:function(a,b,c){return a.substr(b,c)},c.trim=function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},c.bind=function(){var a=Array.prototype.slice.call(arguments),b=a.shift();if(b.bind)return b.bind.apply(b,a);var c=a.shift();return function(){b.apply(c,a.concat([Array.prototype.slice.call(arguments)]))}},c.create="function"==typeof Object.create?Object.create:e;var l="function"==typeof Object.keys?Object.keys:g,m="function"==typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:h;if((new Error).hasOwnProperty("description")){var n=function(a,b){return"[object Error]"===j.call(a)&&(b=c.filter(b,function(a){return"description"!==a&&"number"!==a&&"message"!==a})),b};c.keys=function(a){return n(a,l(a))},c.getOwnPropertyNames=function(a){return n(a,m(a))}}else c.keys=l,c.getOwnPropertyNames=m;if("function"==typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),c.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(o){c.getOwnPropertyDescriptor=function(a,b){try{return Object.getOwnPropertyDescriptor(a,b)}catch(c){return i(a,b)}}}else c.getOwnPropertyDescriptor=i},{}],3:[function(a,b){function c(a,b){return m.isUndefined(b)?""+b:!m.isNumber(b)||!isNaN(b)&&isFinite(b)?m.isFunction(b)||m.isRegExp(b)?b.toString():b:b.toString()}function d(a,b){return m.isString(a)?a.length<b?a:a.slice(0,b):a}function e(a){return d(JSON.stringify(a.actual,c),128)+" "+a.operator+" "+d(JSON.stringify(a.expected,c),128)}function f(a,b,c,d,e){throw new p.AssertionError({message:c,actual:a,expected:b,operator:d,stackStartFunction:e})}function g(a,b){a||f(a,!0,b,"==",p.ok)}function h(a,b){if(a===b)return!0;if(m.isBuffer(a)&&m.isBuffer(b)){if(a.length!=b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return m.isDate(a)&&m.isDate(b)?a.getTime()===b.getTime():m.isRegExp(a)&&m.isRegExp(b)?a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.lastIndex===b.lastIndex&&a.ignoreCase===b.ignoreCase:m.isObject(a)||m.isObject(b)?j(a,b):a==b}function i(a){return"[object Arguments]"==Object.prototype.toString.call(a)}function j(a,b){if(m.isNullOrUndefined(a)||m.isNullOrUndefined(b))return!1;if(a.prototype!==b.prototype)return!1;if(i(a))return i(b)?(a=o.call(a),b=o.call(b),h(a,b)):!1;try{var c,d,e=n.keys(a),f=n.keys(b)}catch(g){return!1}if(e.length!=f.length)return!1;for(e.sort(),f.sort(),d=e.length-1;d>=0;d--)if(e[d]!=f[d])return!1;for(d=e.length-1;d>=0;d--)if(c=e[d],!h(a[c],b[c]))return!1;return!0}function k(a,b){return a&&b?"[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b?!0:b.call({},a)===!0?!0:!1:!1}function l(a,b,c,d){var e;m.isString(c)&&(d=c,c=null);try{b()}catch(g){e=g}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&f(e,c,"Missing expected exception"+d),!a&&k(e,c)&&f(e,c,"Got unwanted exception"+d),a&&e&&c&&!k(e,c)||!a&&e)throw e}var m=a("util"),n=a("_shims"),o=Array.prototype.slice,p=b.exports=g;p.AssertionError=function(a){this.name="AssertionError",this.actual=a.actual,this.expected=a.expected,this.operator=a.operator,this.message=a.message||e(this)},m.inherits(p.AssertionError,Error),p.fail=f,p.ok=g,p.equal=function(a,b,c){a!=b&&f(a,b,c,"==",p.equal)},p.notEqual=function(a,b,c){a==b&&f(a,b,c,"!=",p.notEqual)},p.deepEqual=function(a,b,c){h(a,b)||f(a,b,c,"deepEqual",p.deepEqual)},p.notDeepEqual=function(a,b,c){h(a,b)&&f(a,b,c,"notDeepEqual",p.notDeepEqual)},p.strictEqual=function(a,b,c){a!==b&&f(a,b,c,"===",p.strictEqual)},p.notStrictEqual=function(a,b,c){a===b&&f(a,b,c,"!==",p.notStrictEqual)},p.throws=function(){l.apply(this,[!0].concat(o.call(arguments)))},p.doesNotThrow=function(){l.apply(this,[!1].concat(o.call(arguments)))},p.ifError=function(a){if(a)throw a}},{_shims:2,util:8}],4:[function(a,b){function c(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var d=a("util");b.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._maxListeners=void 0,c.defaultMaxListeners=10,c.prototype.setMaxListeners=function(a){if(!d.isNumber(a)||0>a)throw TypeError("n must be a positive number");return this._maxListeners=a,this},c.prototype.emit=function(a){var b,c,e,f,g,h;if(this._events||(this._events={}),"error"===a&&(!this._events.error||d.isObject(this._events.error)&&!this._events.error.length))throw b=arguments[1],b instanceof Error?b:TypeError('Uncaught, unspecified "error" event.');if(c=this._events[a],d.isUndefined(c))return!1;if(d.isFunction(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(e=arguments.length,f=new Array(e-1),g=1;e>g;g++)f[g-1]=arguments[g];c.apply(this,f)}else if(d.isObject(c)){for(e=arguments.length,f=new Array(e-1),g=1;e>g;g++)f[g-1]=arguments[g];for(h=c.slice(),e=h.length,g=0;e>g;g++)h[g].apply(this,f)}return!0},c.prototype.addListener=function(a,b){var e;if(!d.isFunction(b))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,d.isFunction(b.listener)?b.listener:b),this._events[a]?d.isObject(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,d.isObject(this._events[a])&&!this._events[a].warned){var e;e=d.isUndefined(this._maxListeners)?c.defaultMaxListeners:this._maxListeners,e&&e>0&&this._events[a].length>e&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),console.trace())}return this},c.prototype.on=c.prototype.addListener,c.prototype.once=function(a,b){function c(){this.removeListener(a,c),b.apply(this,arguments)}if(!d.isFunction(b))throw TypeError("listener must be a function");return c.listener=b,this.on(a,c),this},c.prototype.removeListener=function(a,b){var c,e,f,g;if(!d.isFunction(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,e=-1,c===b||d.isFunction(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(d.isObject(c)){for(g=f;g-->0;)if(c[g]===b||c[g].listener&&c[g].listener===b){e=g;break}if(0>e)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(e,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},c.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],d.isFunction(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},c.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?d.isFunction(this._events[a])?[this._events[a]]:this._events[a].slice():[]},c.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?d.isFunction(a._events[b])?1:a._events[b].length:0}},{util:8}],5:[function(a,b,c){function d(a,b){for(var c=0,d=a.length-1;d>=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var e=a("__browserify_process"),f=a("util"),g=a("_shims"),h=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(a){return h.exec(a).slice(1)};c.resolve=function(){for(var a="",b=!1,c=arguments.length-1;c>=-1&&!b;c--){var h=c>=0?arguments[c]:e.cwd();if(!f.isString(h))throw new TypeError("Arguments to path.resolve must be strings");h&&(a=h+"/"+a,b="/"===h.charAt(0))}return a=d(g.filter(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=c.isAbsolute(a),e="/"===g.substr(a,-1);return a=d(g.filter(a.split("/"),function(a){return!!a}),!b).join("/"),a||b||(a="."),a&&e&&(a+="/"),(b?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(g.filter(a,function(a){if(!f.isString(a))throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;c>=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;g>i;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;i<e.length;i++)j.push("..");return j=j.concat(f.slice(h)),j.join("/")},c.sep="/",c.delimiter=":",c.dirname=function(a){var b=i(a),c=b[0],d=b[1];return c||d?(d&&(d=d.substr(0,d.length-1)),c+d):"."},c.basename=function(a,b){var c=i(a)[2];return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return i(a)[3]}},{__browserify_process:12,_shims:2,util:8}],6:[function(a,b,c){function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function e(a){return a.charCodeAt(0)}var f=c,g=a("util"),h=a("_shims"),i=a("buffer").Buffer;f.unescapeBuffer=function(a,b){for(var c,d,f,g=new i(a.length),h="CHAR",j=0,k=0;j<=a.length;j++){var l=a.charCodeAt(j);switch(h){case"CHAR":switch(l){case e("%"):c=0,d=0,h="HEX0";break;case e("+"):b&&(l=e(" "));default:g[k++]=l}break;case"HEX0":if(h="HEX1",f=l,e("0")<=l&&l<=e("9"))c=l-e("0");else if(e("a")<=l&&l<=e("f"))c=l-e("a")+10;else{if(!(e("A")<=l&&l<=e("F"))){g[k++]=e("%"),g[k++]=l,h="CHAR";break}c=l-e("A")+10}break;case"HEX1":if(h="CHAR",e("0")<=l&&l<=e("9"))d=l-e("0");else if(e("a")<=l&&l<=e("f"))d=l-e("a")+10;else{if(!(e("A")<=l&&l<=e("F"))){g[k++]=e("%"),g[k++]=f,g[k++]=l;break}d=l-e("A")+10}g[k++]=16*c+d}}return g.slice(0,k-1)},f.unescape=function(a,b){return f.unescapeBuffer(a,b).toString()},f.escape=function(a){return encodeURIComponent(a)};var j=function(a){return g.isString(a)?a:g.isBoolean(a)?a?"true":"false":g.isNumber(a)?isFinite(a)?a:"":""};f.stringify=f.encode=function(a,b,c,d){return b=b||"&",c=c||"=",g.isNull(a)&&(a=void 0),g.isObject(a)?h.map(h.keys(a),function(d){var e=f.escape(j(d))+c;return g.isArray(a[d])?h.map(a[d],function(a){return e+f.escape(j(a))}).join(b):e+f.escape(j(a[d]))}).join(b):d?f.escape(j(d))+c+f.escape(j(a)):""},f.parse=f.decode=function(a,b,c,e){b=b||"&",c=c||"=";var h={};if(!g.isString(a)||0===a.length)return h;var i=/\+/g;a=a.split(b);var j=1e3;e&&g.isNumber(e.maxKeys)&&(j=e.maxKeys);var k=a.length;j>0&&k>j&&(k=j);for(var l=0;k>l;++l){var m,n,o,p,q=a[l].replace(i,"%20"),r=q.indexOf(c);r>=0?(m=q.substr(0,r),n=q.substr(r+1)):(m=q,n="");try{o=decodeURIComponent(m),p=decodeURIComponent(n)}catch(s){o=f.unescape(m,!0),p=f.unescape(n,!0)}d(h,o)?g.isArray(h[o])?h[o].push(p):h[o]=[h[o],p]:h[o]=p}return h}},{_shims:2,buffer:10,util:8}],7:[function(a,b,c){function d(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function e(a,b,c){if(a&&j.isObject(a)&&a instanceof d)return a;var e=new d;return e.parse(a,b,c),e}function f(a){return j.isString(a)&&(a=e(a)),a instanceof d?a.format():d.prototype.format.call(a)}function g(a,b){return e(a,!1,!0).resolve(b)}function h(a,b){return a?e(a,!1,!0).resolveObject(b):b}var i={encode:function(a){return a}},j=a("util"),k=a("_shims");c.parse=e,c.resolve=g,c.resolveObject=h,c.format=f,c.Url=d;var l=/^([a-z0-9.+-]+:)/i,m=/:[0-9]*$/,n=["<",">",'"',"`"," ","\r","\n"," "],o=["{","}","|","\\","^","`"].concat(n),p=["'"].concat(o),q=["%","/","?",";","#"].concat(p),r=["/","?","#"],s=255,t=/^[a-z0-9A-Z_-]{0,63}$/,u=/^([a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=a("querystring");d.prototype.parse=function(a,b,c){if(!j.isString(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var d=a;d=k.trim(d);var e=l.exec(d);if(e){e=e[0];var f=e.toLowerCase();this.protocol=f,d=d.substr(e.length)}if(c||e||d.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===d.substr(0,2);!g||e&&w[e]||(d=d.substr(2),this.slashes=!0)}if(!w[e]&&(g||e&&!x[e])){for(var h=-1,m=0;m<r.length;m++){var n=d.indexOf(r[m]);-1!==n&&(-1===h||h>n)&&(h=n)}var o,z;z=-1===h?d.lastIndexOf("@"):d.lastIndexOf("@",h),-1!==z&&(o=d.slice(0,z),d=d.slice(z+1),this.auth=decodeURIComponent(o)),h=-1;for(var m=0;m<q.length;m++){var n=d.indexOf(q[m]);-1!==n&&(-1===h||h>n)&&(h=n)}-1===h&&(h=d.length),this.host=d.slice(0,h),d=d.slice(h),this.parseHost(),this.hostname=this.hostname||"";var A="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!A)for(var B=this.hostname.split(/\./),m=0,C=B.length;C>m;m++){var D=B[m];if(D&&!D.match(t)){for(var E="",F=0,G=D.length;G>F;F++)E+=D.charCodeAt(F)>127?"x":D[F];if(!E.match(t)){var H=B.slice(0,m),I=B.slice(m+1),J=D.match(u);J&&(H.push(J[1]),I.unshift(J[2])),I.length&&(d="/"+I.join(".")+d),this.hostname=H.join(".");break}}}if(this.hostname=this.hostname.length>s?"":this.hostname.toLowerCase(),!A){for(var K=this.hostname.split("."),L=[],m=0;m<K.length;++m){var M=K[m];L.push(M.match(/[^A-Za-z0-9_-]/)?"xn--"+i.encode(M):M)}this.hostname=L.join(".")}var N=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+N,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==d[0]&&(d="/"+d))}if(!v[f])for(var m=0,C=p.length;C>m;m++){var P=p[m],Q=encodeURIComponent(P);Q===P&&(Q=escape(P)),d=d.split(P).join(Q)}var R=d.indexOf("#");-1!==R&&(this.hash=d.substr(R),d=d.slice(0,R));var S=d.indexOf("?");if(-1!==S?(this.search=d.substr(S),this.query=d.substr(S+1),b&&(this.query=y.parse(this.query)),d=d.slice(0,S)):b&&(this.search="",this.query={}),d&&(this.pathname=d),x[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var N=this.pathname||"",M=this.search||"";this.path=N+M}return this.href=this.format(),this},d.prototype.format=function(){var a=this.auth||"";a&&(a=encodeURIComponent(a),a=a.replace(/%3A/i,":"),a+="@");var b=this.protocol||"",c=this.pathname||"",d=this.hash||"",e=!1,f="";this.host?e=a+this.host:this.hostname&&(e=a+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(e+=":"+this.port)),this.query&&j.isObject(this.query)&&k.keys(this.query).length&&(f=y.stringify(this.query));var g=this.search||f&&"?"+f||"";return b&&":"!==k.substr(b,-1)&&(b+=":"),this.slashes||(!b||x[b])&&e!==!1?(e="//"+(e||""),c&&"/"!==c.charAt(0)&&(c="/"+c)):e||(e=""),d&&"#"!==d.charAt(0)&&(d="#"+d),g&&"?"!==g.charAt(0)&&(g="?"+g),c=c.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),g=g.replace("#","%23"),b+e+c+g+d},d.prototype.resolve=function(a){return this.resolveObject(e(a,!1,!0)).format()},d.prototype.resolveObject=function(a){if(j.isString(a)){var b=new d;b.parse(a,!1,!0),a=b}var c=new d;if(k.forEach(k.keys(this),function(a){c[a]=this[a]},this),c.hash=a.hash,""===a.href)return c.href=c.format(),c;if(a.slashes&&!a.protocol)return k.forEach(k.keys(a),function(b){"protocol"!==b&&(c[b]=a[b])}),x[c.protocol]&&c.hostname&&!c.pathname&&(c.path=c.pathname="/"),c.href=c.format(),c;if(a.protocol&&a.protocol!==c.protocol){if(!x[a.protocol])return k.forEach(k.keys(a),function(b){c[b]=a[b]}),c.href=c.format(),c;if(c.protocol=a.protocol,a.host||w[a.protocol])c.pathname=a.pathname;else{for(var e=(a.pathname||"").split("/");e.length&&!(a.host=e.shift()););a.host||(a.host=""),a.hostname||(a.hostname=""),""!==e[0]&&e.unshift(""),e.length<2&&e.unshift(""),c.pathname=e.join("/")}if(c.search=a.search,c.query=a.query,c.host=a.host||"",c.auth=a.auth,c.hostname=a.hostname||a.host,c.port=a.port,c.pathname||c.search){var f=c.pathname||"",g=c.search||"";c.path=f+g}return c.slashes=c.slashes||a.slashes,c.href=c.format(),c}var h=c.pathname&&"/"===c.pathname.charAt(0),i=a.host||a.pathname&&"/"===a.pathname.charAt(0),l=i||h||c.host&&a.pathname,m=l,n=c.pathname&&c.pathname.split("/")||[],e=a.pathname&&a.pathname.split("/")||[],o=c.protocol&&!x[c.protocol];if(o&&(c.hostname="",c.port=null,c.host&&(""===n[0]?n[0]=c.host:n.unshift(c.host)),c.host="",a.protocol&&(a.hostname=null,a.port=null,a.host&&(""===e[0]?e[0]=a.host:e.unshift(a.host)),a.host=null),l=l&&(""===e[0]||""===n[0])),i)c.host=a.host||""===a.host?a.host:c.host,c.hostname=a.hostname||""===a.hostname?a.hostname:c.hostname,c.search=a.search,c.query=a.query,n=e;else if(e.length)n||(n=[]),n.pop(),n=n.concat(e),c.search=a.search,c.query=a.query;else if(!j.isNullOrUndefined(a.search)){if(o){c.hostname=c.host=n.shift();var p=c.host&&c.host.indexOf("@")>0?c.host.split("@"):!1;p&&(c.auth=p.shift(),c.host=c.hostname=p.shift())}return c.search=a.search,c.query=a.query,j.isNull(c.pathname)&&j.isNull(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c}if(!n.length)return c.pathname=null,c.path=c.search?"/"+c.search:null,c.href=c.format(),c;for(var q=n.slice(-1)[0],r=(c.host||a.host)&&("."===q||".."===q)||""===q,s=0,t=n.length;t>=0;t--)q=n[t],"."==q?n.splice(t,1):".."===q?(n.splice(t,1),s++):s&&(n.splice(t,1),s--);if(!l&&!m)for(;s--;s)n.unshift("..");!l||""===n[0]||n[0]&&"/"===n[0].charAt(0)||n.unshift(""),r&&"/"!==k.substr(n.join("/"),-1)&&n.push("");var u=""===n[0]||n[0]&&"/"===n[0].charAt(0);if(o){c.hostname=c.host=u?"":n.length?n.shift():"";var p=c.host&&c.host.indexOf("@")>0?c.host.split("@"):!1;p&&(c.auth=p.shift(),c.host=c.hostname=p.shift())}return l=l||c.host&&n.length,l&&!u&&n.unshift(""),n.length?c.pathname=n.join("/"):(c.pathname=null,c.path=null),j.isNull(c.pathname)&&j.isNull(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=a.auth||c.auth,c.slashes=c.slashes||a.slashes,c.href=c.format(),c},d.prototype.parseHost=function(){var a=this.host,b=m.exec(a);b&&(b=b[0],":"!==b&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)}},{_shims:2,querystring:6,util:8}],8:[function(a,b,c){function d(a,b){var d={seen:[],stylize:f};return arguments.length>=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),o(b)?d.showHidden=b:b&&c._extend(d,b),u(d.showHidden)&&(d.showHidden=!1),u(d.depth)&&(d.depth=2),u(d.colors)&&(d.colors=!1),u(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=e),h(d,a,d.depth)}function e(a,b){var c=d.styles[b];return c?"["+d.colors[c][0]+"m"+a+"["+d.colors[c][1]+"m":a}function f(a){return a}function g(a){var b={};return G.forEach(a,function(a){b[a]=!0}),b}function h(a,b,d){if(a.customInspect&&b&&z(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d);return s(e)||(e=h(a,e,d)),e}var f=i(a,b);if(f)return f;var o=G.keys(b),p=g(o);if(a.showHidden&&(o=G.getOwnPropertyNames(b)),0===o.length){if(z(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(v(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(x(b))return a.stylize(Date.prototype.toString.call(b),"date");if(y(b))return j(b)}var r="",t=!1,u=["{","}"];if(n(b)&&(t=!0,u=["[","]"]),z(b)){var w=b.name?": "+b.name:"";r=" [Function"+w+"]"}if(v(b)&&(r=" "+RegExp.prototype.toString.call(b)),x(b)&&(r=" "+Date.prototype.toUTCString.call(b)),y(b)&&(r=" "+j(b)),0===o.length&&(!t||0==b.length))return u[0]+r+u[1];if(0>d)return v(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var A;return A=t?k(a,b,d,p,o):o.map(function(c){return l(a,b,d,p,c,t)}),a.seen.pop(),m(A,r,u)}function i(a,b){if(u(b))return a.stylize("undefined","undefined");if(s(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return r(b)?a.stylize(""+b,"number"):o(b)?a.stylize(""+b,"boolean"):p(b)?a.stylize("null","null"):void 0}function j(a){return"["+Error.prototype.toString.call(a)+"]"}function k(a,b,c,d,e){for(var f=[],g=0,h=b.length;h>g;++g)F(b,String(g))?f.push(l(a,b,c,d,String(g),!0)):f.push("");return G.forEach(e,function(e){e.match(/^\d+$/)||f.push(l(a,b,c,d,e,!0))}),f}function l(a,b,c,d,e,f){var g,i,j;if(j=G.getOwnPropertyDescriptor(b,e)||{value:b[e]},j.get?i=j.set?a.stylize("[Getter/Setter]","special"):a.stylize("[Getter]","special"):j.set&&(i=a.stylize("[Setter]","special")),F(d,e)||(g="["+e+"]"),i||(G.indexOf(a.seen,j.value)<0?(i=p(c)?h(a,j.value,null):h(a,j.value,c-1),i.indexOf("\n")>-1&&(i=f?i.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+i.split("\n").map(function(a){return" "+a}).join("\n"))):i=a.stylize("[Circular]","special")),u(g)){if(f&&e.match(/^\d+$/))return i;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+i}function m(a,b,c){var d=0,e=G.reduce(a,function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0);return e>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function n(a){return G.isArray(a)}function o(a){return"boolean"==typeof a}function p(a){return null===a}function q(a){return null==a}function r(a){return"number"==typeof a}function s(a){return"string"==typeof a}function t(a){return"symbol"==typeof a}function u(a){return void 0===a}function v(a){return w(a)&&"[object RegExp]"===C(a)}function w(a){return"object"==typeof a&&a}function x(a){return w(a)&&"[object Date]"===C(a)}function y(a){return w(a)&&"[object Error]"===C(a)}function z(a){return"function"==typeof a}function A(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function B(a){return a&&"object"==typeof a&&"function"==typeof a.copy&&"function"==typeof a.fill&&"function"==typeof a.binarySlice}function C(a){return Object.prototype.toString.call(a)}function D(a){return 10>a?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),I[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=a("_shims"),H=/%[sdj%]/g;c.format=function(a){if(!s(a)){for(var b=[],c=0;c<arguments.length;c++)b.push(d(arguments[c]));return b.join(" ")}for(var c=1,e=arguments,f=e.length,g=String(a).replace(H,function(a){if("%%"===a)return"%";if(c>=f)return a;switch(a){case"%s":return String(e[c++]);case"%d":return Number(e[c++]);case"%j":try{return JSON.stringify(e[c++])}catch(b){return"[Circular]"}default:return a}}),h=e[c];f>c;h=e[++c])g+=p(h)||!w(h)?" "+h:" "+d(h);return g},c.inspect=d,d.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]},d.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},c.isArray=n,c.isBoolean=o,c.isNull=p,c.isNullOrUndefined=q,c.isNumber=r,c.isString=s,c.isSymbol=t,c.isUndefined=u,c.isRegExp=v,c.isObject=w,c.isDate=x,c.isError=y,c.isFunction=z,c.isPrimitive=A,c.isBuffer=B;var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];c.log=function(){console.log("%s - %s",E(),c.format.apply(c,arguments))},c.inherits=function(a,b){a.super_=b,a.prototype=G.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})},c._extend=function(a,b){if(!b||!w(b))return a;for(var c=G.keys(b),d=c.length;d--;)a[c[d]]=b[c[d]];return a}},{_shims:2}],9:[function(a,b,c){c.readIEEE754=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?0:e-1,m=c?1:-1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.writeIEEE754=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?f-1:0,o=d?-1:1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],10:[function(a,b,c){function d(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function e(b,c,f){if(E||(E=a("assert")),!(this instanceof e))return new e(b,c,f);if(this.parent=this,this.offset=0,"base64"==c&&"string"==typeof b)for(b=d(b);b.length%4!=0;)b+="=";var h;if("number"==typeof f){this.length=g(c);for(var j=0;j<this.length;j++)this[j]=b.get(j+f)}else{switch(h=typeof b){case"number":this.length=g(b);break;case"string":this.length=e.byteLength(b,c);break;case"object":this.length=g(b.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(i(b))for(var j=0;j<this.length;j++)this[j]=b instanceof e?b.readUInt8(j):b[j];else if("string"==h)this.length=this.write(b,0,c);else if("number"===h)for(var j=0;j<this.length;j++)this[j]=0}}function f(a,b,c){return"number"!=typeof a?c:(a=~~a,a>=b?b:a>=0?a:(a+=b,a>=0?a:0))}function g(a){return a=~~Math.ceil(+a),0>a?0:a}function h(a){return(Array.isArray||function(a){return"[object Array]"=={}.toString.apply(a)})(a)}function i(a){return h(a)||e.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length}function j(a){return 16>a?"0"+a.toString(16):a.toString(16)}function k(a){for(var b=[],c=0;c<a.length;c++)if(a.charCodeAt(c)<=127)b.push(a.charCodeAt(c));else for(var d=encodeURIComponent(a.charAt(c)).substr(1).split("%"),e=0;e<d.length;e++)b.push(parseInt(d[e],16));return b}function l(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function m(b){return a("base64-js").toByteArray(b)}function n(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);)b[e+c]=a[e],e++;return e}function o(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}function p(a,b,c,d){var e=0;return d||(E.ok("boolean"==typeof c,"missing or invalid endian"),E.ok(void 0!==b&&null!==b,"missing offset"),E.ok(b+1<a.length,"Trying to read beyond buffer length")),b>=a.length?0:(c?(e=a[b]<<8,b+1<a.length&&(e|=a[b+1])):(e=a[b],b+1<a.length&&(e|=a[b+1]<<8)),e)}function q(a,b,c,d){var e=0;return d||(E.ok("boolean"==typeof c,"missing or invalid endian"),E.ok(void 0!==b&&null!==b,"missing offset"),E.ok(b+3<a.length,"Trying to read beyond buffer length")),b>=a.length?0:(c?(b+1<a.length&&(e=a[b+1]<<16),b+2<a.length&&(e|=a[b+2]<<8),b+3<a.length&&(e|=a[b+3]),e+=a[b]<<24>>>0):(b+2<a.length&&(e=a[b+2]<<16),b+1<a.length&&(e|=a[b+1]<<8),e|=a[b],b+3<a.length&&(e+=a[b+3]<<24>>>0)),e)}function r(a,b,c,d){var e,f;return d||(E.ok("boolean"==typeof c,"missing or invalid endian"),E.ok(void 0!==b&&null!==b,"missing offset"),E.ok(b+1<a.length,"Trying to read beyond buffer length")),f=p(a,b,c,d),e=32768&f,e?-1*(65535-f+1):f}function s(a,b,c,d){var e,f;return d||(E.ok("boolean"==typeof c,"missing or invalid endian"),E.ok(void 0!==b&&null!==b,"missing offset"),E.ok(b+3<a.length,"Trying to read beyond buffer length")),f=q(a,b,c,d),e=2147483648&f,e?-1*(4294967295-f+1):f}function t(b,c,d,e){return e||(E.ok("boolean"==typeof d,"missing or invalid endian"),E.ok(c+3<b.length,"Trying to read beyond buffer length")),a("./buffer_ieee754").readIEEE754(b,c,d,23,4)}function u(b,c,d,e){return e||(E.ok("boolean"==typeof d,"missing or invalid endian"),E.ok(c+7<b.length,"Trying to read beyond buffer length")),a("./buffer_ieee754").readIEEE754(b,c,d,52,8)}function v(a,b){E.ok("number"==typeof a,"cannot write a non-number as a number"),E.ok(a>=0,"specified a negative value for writing an unsigned value"),E.ok(b>=a,"value is larger than maximum value for type"),E.ok(Math.floor(a)===a,"value has a fractional component")}function w(a,b,c,d,e){e||(E.ok(void 0!==b&&null!==b,"missing value"),E.ok("boolean"==typeof d,"missing or invalid endian"),E.ok(void 0!==c&&null!==c,"missing offset"),E.ok(c+1<a.length,"trying to write beyond buffer length"),v(b,65535));for(var f=0;f<Math.min(a.length-c,2);f++)a[c+f]=(b&255<<8*(d?1-f:f))>>>8*(d?1-f:f)}function x(a,b,c,d,e){e||(E.ok(void 0!==b&&null!==b,"missing value"),E.ok("boolean"==typeof d,"missing or invalid endian"),E.ok(void 0!==c&&null!==c,"missing offset"),E.ok(c+3<a.length,"trying to write beyond buffer length"),v(b,4294967295));for(var f=0;f<Math.min(a.length-c,4);f++)a[c+f]=b>>>8*(d?3-f:f)&255}function y(a,b,c){E.ok("number"==typeof a,"cannot write a non-number as a number"),E.ok(b>=a,"value larger than maximum allowed value"),E.ok(a>=c,"value smaller than minimum allowed value"),E.ok(Math.floor(a)===a,"value has a fractional component")}function z(a,b,c){E.ok("number"==typeof a,"cannot write a non-number as a number"),E.ok(b>=a,"value larger than maximum allowed value"),E.ok(a>=c,"value smaller than minimum allowed value")}function A(a,b,c,d,e){e||(E.ok(void 0!==b&&null!==b,"missing value"),E.ok("boolean"==typeof d,"missing or invalid endian"),E.ok(void 0!==c&&null!==c,"missing offset"),E.ok(c+1<a.length,"Trying to write beyond buffer length"),y(b,32767,-32768)),b>=0?w(a,b,c,d,e):w(a,65535+b+1,c,d,e)}function B(a,b,c,d,e){e||(E.ok(void 0!==b&&null!==b,"missing value"),E.ok("boolean"==typeof d,"missing or invalid endian"),E.ok(void 0!==c&&null!==c,"missing offset"),E.ok(c+3<a.length,"Trying to write beyond buffer length"),y(b,2147483647,-2147483648)),b>=0?x(a,b,c,d,e):x(a,4294967295+b+1,c,d,e)
}function C(b,c,d,e,f){f||(E.ok(void 0!==c&&null!==c,"missing value"),E.ok("boolean"==typeof e,"missing or invalid endian"),E.ok(void 0!==d&&null!==d,"missing offset"),E.ok(d+3<b.length,"Trying to write beyond buffer length"),z(c,3.4028234663852886e38,-3.4028234663852886e38)),a("./buffer_ieee754").writeIEEE754(b,c,d,e,23,4)}function D(b,c,d,e,f){f||(E.ok(void 0!==c&&null!==c,"missing value"),E.ok("boolean"==typeof e,"missing or invalid endian"),E.ok(void 0!==d&&null!==d,"missing offset"),E.ok(d+7<b.length,"Trying to write beyond buffer length"),z(c,1.7976931348623157e308,-1.7976931348623157e308)),a("./buffer_ieee754").writeIEEE754(b,c,d,e,52,8)}var E;c.Buffer=e,c.SlowBuffer=e,e.poolSize=8192,c.INSPECT_MAX_BYTES=50,e.prototype.get=function(a){if(0>a||a>=this.length)throw new Error("oob");return this[a]},e.prototype.set=function(a,b){if(0>a||a>=this.length)throw new Error("oob");return this[a]=b},e.byteLength=function(a,b){switch(b||"utf8"){case"hex":return a.length/2;case"utf8":case"utf-8":return k(a).length;case"ascii":case"binary":return a.length;case"base64":return m(a).length;default:throw new Error("Unknown encoding")}},e.prototype.utf8Write=function(a,b,c){return e._charsWritten=n(k(a),this,b,c)},e.prototype.asciiWrite=function(a,b,c){return e._charsWritten=n(l(a),this,b,c)},e.prototype.binaryWrite=e.prototype.asciiWrite,e.prototype.base64Write=function(a,b,c){return e._charsWritten=n(m(a),this,b,c)},e.prototype.base64Slice=function(){var b=Array.prototype.slice.apply(this,arguments);return a("base64-js").fromByteArray(b)},e.prototype.utf8Slice=function(){for(var a=Array.prototype.slice.apply(this,arguments),b="",c="",d=0;d<a.length;)a[d]<=127?(b+=o(c)+String.fromCharCode(a[d]),c=""):c+="%"+a[d].toString(16),d++;return b+o(c)},e.prototype.asciiSlice=function(){for(var a=Array.prototype.slice.apply(this,arguments),b="",c=0;c<a.length;c++)b+=String.fromCharCode(a[c]);return b},e.prototype.binarySlice=e.prototype.asciiSlice,e.prototype.inspect=function(){for(var a=[],b=this.length,d=0;b>d;d++)if(a[d]=j(this[d]),d==c.INSPECT_MAX_BYTES){a[d+1]="...";break}return"<Buffer "+a.join(" ")+">"},e.prototype.hexSlice=function(a,b){var c=this.length;(!a||0>a)&&(a=0),(!b||0>b||b>c)&&(b=c);for(var d="",e=a;b>e;e++)d+=j(this[e]);return d},e.prototype.toString=function(a,b,c){if(a=String(a||"utf8").toLowerCase(),b=+b||0,"undefined"==typeof c&&(c=this.length),+c==b)return"";switch(a){case"hex":return this.hexSlice(b,c);case"utf8":case"utf-8":return this.utf8Slice(b,c);case"ascii":return this.asciiSlice(b,c);case"binary":return this.binarySlice(b,c);case"base64":return this.base64Slice(b,c);case"ucs2":case"ucs-2":return this.ucs2Slice(b,c);default:throw new Error("Unknown encoding")}},e.prototype.hexWrite=function(a,b,c){b=+b||0;var d=this.length-b;c?(c=+c,c>d&&(c=d)):c=d;var f=a.length;if(f%2)throw new Error("Invalid hex string");c>f/2&&(c=f/2);for(var g=0;c>g;g++){var h=parseInt(a.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");this[b+g]=h}return e._charsWritten=2*g,g},e.prototype.write=function(a,b,c,d){if(isFinite(b))isFinite(c)||(d=c,c=void 0);else{var e=d;d=b,b=c,c=e}b=+b||0;var f=this.length-b;switch(c?(c=+c,c>f&&(c=f)):c=f,d=String(d||"utf8").toLowerCase()){case"hex":return this.hexWrite(a,b,c);case"utf8":case"utf-8":return this.utf8Write(a,b,c);case"ascii":return this.asciiWrite(a,b,c);case"binary":return this.binaryWrite(a,b,c);case"base64":return this.base64Write(a,b,c);case"ucs2":case"ucs-2":return this.ucs2Write(a,b,c);default:throw new Error("Unknown encoding")}},e.prototype.slice=function(a,b){var c=this.length;return a=f(a,c,0),b=f(b,c,c),new e(this,b-a,+a)},e.prototype.copy=function(a,b,c,d){var e=this;if(c||(c=0),(void 0===d||isNaN(d))&&(d=this.length),b||(b=0),c>d)throw new Error("sourceEnd < sourceStart");if(d===c)return 0;if(0==a.length||0==e.length)return 0;if(0>b||b>=a.length)throw new Error("targetStart out of bounds");if(0>c||c>=e.length)throw new Error("sourceStart out of bounds");if(0>d||d>e.length)throw new Error("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);for(var f=[],g=c;d>g;g++)E.ok("undefined"!=typeof this[g],"copying undefined buffer bytes!"),f.push(this[g]);for(var g=b;g<b+f.length;g++)a[g]=f[g-b]},e.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),"string"==typeof a&&(a=a.charCodeAt(0)),"number"!=typeof a||isNaN(a))throw new Error("value is not a number");if(b>c)throw new Error("end < start");if(c===b)return 0;if(0==this.length)return 0;if(0>b||b>=this.length)throw new Error("start out of bounds");if(0>c||c>this.length)throw new Error("end out of bounds");for(var d=b;c>d;d++)this[d]=a},e.isBuffer=function(a){return a instanceof e||a instanceof e},e.concat=function(a,b){if(!h(a))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===a.length)return new e(0);if(1===a.length)return a[0];if("number"!=typeof b){b=0;for(var c=0;c<a.length;c++){var d=a[c];b+=d.length}}for(var f=new e(b),g=0,c=0;c<a.length;c++){var d=a[c];d.copy(f,g),g+=d.length}return f},e.isEncoding=function(a){switch((a+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},e.prototype.readUInt8=function(a,b){var c=this;return b||(E.ok(void 0!==a&&null!==a,"missing offset"),E.ok(a<c.length,"Trying to read beyond buffer length")),a>=c.length?void 0:c[a]},e.prototype.readUInt16LE=function(a,b){return p(this,a,!1,b)},e.prototype.readUInt16BE=function(a,b){return p(this,a,!0,b)},e.prototype.readUInt32LE=function(a,b){return q(this,a,!1,b)},e.prototype.readUInt32BE=function(a,b){return q(this,a,!0,b)},e.prototype.readInt8=function(a,b){var c,d=this;return b||(E.ok(void 0!==a&&null!==a,"missing offset"),E.ok(a<d.length,"Trying to read beyond buffer length")),a>=d.length?void 0:(c=128&d[a],c?-1*(255-d[a]+1):d[a])},e.prototype.readInt16LE=function(a,b){return r(this,a,!1,b)},e.prototype.readInt16BE=function(a,b){return r(this,a,!0,b)},e.prototype.readInt32LE=function(a,b){return s(this,a,!1,b)},e.prototype.readInt32BE=function(a,b){return s(this,a,!0,b)},e.prototype.readFloatLE=function(a,b){return t(this,a,!1,b)},e.prototype.readFloatBE=function(a,b){return t(this,a,!0,b)},e.prototype.readDoubleLE=function(a,b){return u(this,a,!1,b)},e.prototype.readDoubleBE=function(a,b){return u(this,a,!0,b)},e.prototype.writeUInt8=function(a,b,c){var d=this;c||(E.ok(void 0!==a&&null!==a,"missing value"),E.ok(void 0!==b&&null!==b,"missing offset"),E.ok(b<d.length,"trying to write beyond buffer length"),v(a,255)),b<d.length&&(d[b]=a)},e.prototype.writeUInt16LE=function(a,b,c){w(this,a,b,!1,c)},e.prototype.writeUInt16BE=function(a,b,c){w(this,a,b,!0,c)},e.prototype.writeUInt32LE=function(a,b,c){x(this,a,b,!1,c)},e.prototype.writeUInt32BE=function(a,b,c){x(this,a,b,!0,c)},e.prototype.writeInt8=function(a,b,c){var d=this;c||(E.ok(void 0!==a&&null!==a,"missing value"),E.ok(void 0!==b&&null!==b,"missing offset"),E.ok(b<d.length,"Trying to write beyond buffer length"),y(a,127,-128)),a>=0?d.writeUInt8(a,b,c):d.writeUInt8(255+a+1,b,c)},e.prototype.writeInt16LE=function(a,b,c){A(this,a,b,!1,c)},e.prototype.writeInt16BE=function(a,b,c){A(this,a,b,!0,c)},e.prototype.writeInt32LE=function(a,b,c){B(this,a,b,!1,c)},e.prototype.writeInt32BE=function(a,b,c){B(this,a,b,!0,c)},e.prototype.writeFloatLE=function(a,b,c){C(this,a,b,!1,c)},e.prototype.writeFloatBE=function(a,b,c){C(this,a,b,!0,c)},e.prototype.writeDoubleLE=function(a,b,c){D(this,a,b,!1,c)},e.prototype.writeDoubleBE=function(a,b,c){D(this,a,b,!0,c)}},{"./buffer_ieee754":9,assert:3,"base64-js":11}],11:[function(a,b){!function(){"use strict";function a(a){var b,c,e,f,g,h;if(a.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(g=a.indexOf("="),g=g>0?a.length-g:0,h=[],e=g>0?a.length-4:a.length,b=0,c=0;e>b;b+=4,c+=3)f=d.indexOf(a[b])<<18|d.indexOf(a[b+1])<<12|d.indexOf(a[b+2])<<6|d.indexOf(a[b+3]),h.push((16711680&f)>>16),h.push((65280&f)>>8),h.push(255&f);return 2===g?(f=d.indexOf(a[b])<<2|d.indexOf(a[b+1])>>4,h.push(255&f)):1===g&&(f=d.indexOf(a[b])<<10|d.indexOf(a[b+1])<<4|d.indexOf(a[b+2])>>2,h.push(f>>8&255),h.push(255&f)),h}function c(a){function b(a){return d[a>>18&63]+d[a>>12&63]+d[a>>6&63]+d[63&a]}var c,e,f,g=a.length%3,h="";for(c=0,f=a.length-g;f>c;c+=3)e=(a[c]<<16)+(a[c+1]<<8)+a[c+2],h+=b(e);switch(g){case 1:e=a[a.length-1],h+=d[e>>2],h+=d[e<<4&63],h+="==";break;case 2:e=(a[a.length-2]<<8)+a[a.length-1],h+=d[e>>10],h+=d[e>>4&63],h+=d[e<<2&63],h+="="}return h}var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";b.exports.toByteArray=a,b.exports.fromByteArray=c}()},{}],12:[function(a,b){var c=b.exports={};c.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){if(a.source===window&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var b=c.shift();b()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),c.title="browser",c.browser=!0,c.env={},c.argv=[],c.binding=function(){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(){throw new Error("process.chdir is not supported")}},{}],13:[function(b,c,d){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:{};(function(){function b(a,b,c){for(var d=(c||0)-1,e=a?a.length:0;++d<e;)if(a[d]===b)return d;return-1}function f(a,c){var d=typeof c;if(a=a.cache,"boolean"==d||null==c)return a[c]?0:-1;"number"!=d&&"string"!=d&&(d="object");var e="number"==d?c:v+c;return a=(a=a[d])&&a[e],"object"==d?a&&b(a,c)>-1?0:-1:a?0:-1}function g(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:v+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function h(a){return a.charCodeAt(0)}function i(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||"undefined"==typeof c)return 1;if(d>c||"undefined"==typeof d)return-1}return a.index-b.index}function j(a){var b=-1,c=a.length,d=a[0],e=a[c/2|0],f=a[c-1];if(d&&"object"==typeof d&&e&&"object"==typeof e&&f&&"object"==typeof f)return!1;var h=m();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=m();for(i.array=a,i.cache=h,i.push=g;++b<c;)i.push(a[b]);return i}function k(a){return"\\"+Z[a]}function l(){return s.pop()||[]}function m(){return t.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function n(a){a.length=0,s.length<x&&s.push(a)}function o(a){var b=a.cache;b&&o(b),a.array=a.cache=a.criteria=a.object=a.number=a.string=a.value=null,t.length<x&&t.push(a)}function p(a,b,c){b||(b=0),"undefined"==typeof c&&(c=a?a.length:0);for(var d=-1,e=c-b||0,f=Array(0>e?0:e);++d<e;)f[d]=a[b+d];return f}function q(a){function c(a){return a&&"object"==typeof a&&!Yd(a)&&Fd.call(a,"__wrapped__")?a:new d(a)}function d(a,b){this.__chain__=!!b,this.__wrapped__=a}function e(a){function b(){if(d){var a=d.slice();Hd.apply(a,arguments)}if(this instanceof b){var f=s(c.prototype),g=c.apply(f,a||arguments);return Fb(g)?g:f}return c.apply(e,a||arguments)}var c=a[0],d=a[2],e=a[4];return Xd(b,a),b}function g(a,b,c,d,e){if(c){var f=c(a);if("undefined"!=typeof f)return f}var h=Fb(a);if(!h)return a;var i=yd.call(a);if(!V[i])return a;var j=Vd[i];switch(i){case O:case P:return new j(+a);case R:case U:return new j(a);case T:return f=j(a.source,D.exec(a)),f.lastIndex=a.lastIndex,f}var k=Yd(a);if(b){var m=!d;d||(d=l()),e||(e=l());for(var o=d.length;o--;)if(d[o]==a)return e[o];f=k?j(a.length):{}}else f=k?p(a):de({},a);return k&&(Fd.call(a,"index")&&(f.index=a.index),Fd.call(a,"input")&&(f.input=a.input)),b?(d.push(a),e.push(f),(k?Yb:ge)(a,function(a,h){f[h]=g(a,b,c,d,e)}),m&&(n(d),n(e)),f):f}function s(a){return Fb(a)?Md(a):{}}function t(a,b,c){if("function"!=typeof a)return Yc;if("undefined"==typeof b||!("prototype"in a))return a;var d=a.__bindData__;if("undefined"==typeof d&&(Wd.funcNames&&(d=!a.name),d=d||!Wd.funcDecomp,!d)){var e=Dd.call(a);Wd.funcNames||(d=!E.test(e)),d||(d=I.test(e),Xd(a,d))}if(d===!1||d!==!0&&1&d[1])return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return Ic(a,b)}function x(a){function b(){var a=i?g:this;if(e){var n=e.slice();Hd.apply(n,arguments)}if((f||k)&&(n||(n=p(arguments)),f&&Hd.apply(n,f),k&&n.length<h))return d|=16,x([c,l?d:-4&d,n,null,g,h]);if(n||(n=arguments),j&&(c=a[m]),this instanceof b){a=s(c.prototype);var o=c.apply(a,n);return Fb(o)?o:a}return c.apply(a,n)}var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i=1&d,j=2&d,k=4&d,l=8&d,m=c;return Xd(b,a),b}function Z(a,c){var d=-1,e=kb(),g=a?a.length:0,h=g>=w&&e===b,i=[];if(h){var k=j(c);k?(e=f,c=k):h=!1}for(;++d<g;){var l=a[d];e(c,l)<0&&i.push(l)}return h&&o(c),i}function _(a,b,c,d){for(var e=(d||0)-1,f=a?a.length:0,g=[];++e<f;){var h=a[e];if(h&&"object"==typeof h&&"number"==typeof h.length&&(Yd(h)||nb(h))){b||(h=_(h,b,c));var i=-1,j=h.length,k=g.length;for(g.length+=j;++i<j;)g[k++]=h[i]}else c||g.push(h)}return g}function ab(a,b,c,d,e,f){if(c){var g=c(a,b);if("undefined"!=typeof g)return!!g}if(a===b)return 0!==a||1/a==1/b;var h=typeof a,i=typeof b;if(!(a!==a||a&&Y[h]||b&&Y[i]))return!1;if(null==a||null==b)return a===b;var j=yd.call(a),k=yd.call(b);if(j==M&&(j=S),k==M&&(k=S),j!=k)return!1;switch(j){case O:case P:return+a==+b;case R:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case T:case U:return a==td(b)}var m=j==N;if(!m){var o=Fd.call(a,"__wrapped__"),p=Fd.call(b,"__wrapped__");if(o||p)return ab(o?a.__wrapped__:a,p?b.__wrapped__:b,c,d,e,f);if(j!=S)return!1;var q=a.constructor,r=b.constructor;if(q!=r&&!(Eb(q)&&q instanceof q&&Eb(r)&&r instanceof r)&&"constructor"in a&&"constructor"in b)return!1}var s=!e;e||(e=l()),f||(f=l());for(var t=e.length;t--;)if(e[t]==a)return f[t]==b;var u=0;if(g=!0,e.push(a),f.push(b),m){if(t=a.length,u=b.length,g=u==a.length,!g&&!d)return g;for(;u--;){var v=t,w=b[u];if(d)for(;v--&&!(g=ab(a[v],w,c,d,e,f)););else if(!(g=ab(a[u],w,c,d,e,f)))break}return g}return fe(b,function(b,h,i){return Fd.call(i,h)?(u++,g=Fd.call(a,h)&&ab(a[h],b,c,d,e,f)):void 0}),g&&!d&&fe(a,function(a,b,c){return Fd.call(c,b)?g=--u>-1:void 0}),s&&(n(e),n(f)),g}function eb(a,b,c,d,e){(Yd(b)?Yb:ge)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Yd(b))||he(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Yd(j)?j:[]:he(j)?j:{}),d.push(b),e.push(j),l||eb(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function fb(a,b){return a+Cd(Ud()*(b-a+1))}function gb(a,c,d){var e=-1,g=kb(),h=a?a.length:0,i=[],k=!c&&h>=w&&g===b,m=d||k?l():i;if(k){var p=j(m);p?(g=f,m=p):(k=!1,m=d?m:(n(m),i))}for(;++e<h;){var q=a[e],r=d?d(q,e,a):q;(c?!e||m[m.length-1]!==r:g(m,r)<0)&&((d||k)&&m.push(r),i.push(q))}return k?(n(m.array),o(m)):d&&n(m),i}function hb(a){return function(b,d,e){var f={};d=c.createCallback(d,e,3);var g=-1,h=b?b.length:0;if("number"==typeof h)for(;++g<h;){var i=b[g];a(f,i,d(i,g,b),b)}else ge(b,function(b,c,e){a(f,b,d(b,c,e),e)});return f}}function ib(a,b,c,d,f,g){var h=1&b,i=2&b,j=4&b,k=16&b,l=32&b;if(!i&&!Eb(a))throw new ud;k&&!c.length&&(b&=-17,k=c=!1),l&&!d.length&&(b&=-33,l=d=!1);var m=a&&a.__bindData__;if(m&&m!==!0)return m=m.slice(),!h||1&m[1]||(m[4]=f),!h&&1&m[1]&&(b|=8),!j||4&m[1]||(m[5]=g),k&&Hd.apply(m[2]||(m[2]=[]),c),l&&Hd.apply(m[3]||(m[3]=[]),d),m[1]|=b,ib.apply(null,m);var n=1==b||17===b?e:x;return n([a,b,c,d,f,g])}function jb(a){return _d[a]}function kb(){var a=(a=c.indexOf)===sc?b:a;return a}function lb(a){var b,c;return a&&yd.call(a)==S&&(b=a.constructor,!Eb(b)||b instanceof b)?(fe(a,function(a,b){c=b}),"undefined"==typeof c||Fd.call(a,c)):!1}function mb(a){return ae[a]}function nb(a){return a&&"object"==typeof a&&"number"==typeof a.length&&yd.call(a)==M||!1}function ob(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=b,b=!1),g(a,b,"function"==typeof c&&t(c,d,1))}function pb(a,b,c){return g(a,!0,"function"==typeof b&&t(b,c,1))}function qb(a,b){var c=s(a);return b?de(c,b):c}function rb(a,b,d){var e;return b=c.createCallback(b,d,3),ge(a,function(a,c,d){return b(a,c,d)?(e=c,!1):void 0}),e}function sb(a,b,d){var e;return b=c.createCallback(b,d,3),ub(a,function(a,c,d){return b(a,c,d)?(e=c,!1):void 0}),e}function tb(a,b,c){var d=[];fe(a,function(a,b){d.push(b,a)});var e=d.length;for(b=t(b,c,3);e--&&b(d[e--],d[e],a)!==!1;);return a}function ub(a,b,c){var d=$d(a),e=d.length;for(b=t(b,c,3);e--;){var f=d[e];if(b(a[f],f,a)===!1)break}return a}function vb(a){var b=[];return fe(a,function(a,c){Eb(a)&&b.push(c)}),b.sort()}function wb(a,b){return a?Fd.call(a,b):!1}function xb(a){for(var b=-1,c=$d(a),d=c.length,e={};++b<d;){var f=c[b];e[a[f]]=f}return e}function yb(a){return a===!0||a===!1||a&&"object"==typeof a&&yd.call(a)==O||!1}function zb(a){return a&&"object"==typeof a&&yd.call(a)==P||!1}function Ab(a){return a&&1===a.nodeType||!1}function Bb(a){var b=!0;if(!a)return b;var c=yd.call(a),d=a.length;return c==N||c==U||c==M||c==S&&"number"==typeof d&&Eb(a.splice)?!d:(ge(a,function(){return b=!1}),b)}function Cb(a,b,c,d){return ab(a,b,"function"==typeof c&&t(c,d,2))}function Db(a){return Od(a)&&!Pd(parseFloat(a))}function Eb(a){return"function"==typeof a}function Fb(a){return!(!a||!Y[typeof a])}function Gb(a){return Ib(a)&&a!=+a}function Hb(a){return null===a}function Ib(a){return"number"==typeof a||a&&"object"==typeof a&&yd.call(a)==R||!1}function Jb(a){return a&&"object"==typeof a&&yd.call(a)==T||!1}function Kb(a){return"string"==typeof a||a&&"object"==typeof a&&yd.call(a)==U||!1}function Lb(a){return"undefined"==typeof a}function Mb(a){var b=arguments,c=2;if(!Fb(a))return a;if("number"!=typeof b[2]&&(c=b.length),c>3&&"function"==typeof b[c-2])var d=t(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=p(arguments,1,c),f=-1,g=l(),h=l();++f<c;)eb(a,e[f],d,g,h);return n(g),n(h),a}function Nb(a,b,d){var e={};if("function"!=typeof b){var f=[];fe(a,function(a,b){f.push(b)}),f=Z(f,_(arguments,!0,!1,1));for(var g=-1,h=f.length;++g<h;){var i=f[g];e[i]=a[i]}}else b=c.createCallback(b,d,3),fe(a,function(a,c,d){b(a,c,d)||(e[c]=a)});return e}function Ob(a){for(var b=-1,c=$d(a),d=c.length,e=ld(d);++b<d;){var f=c[b];e[b]=[f,a[f]]}return e}function Pb(a,b,d){var e={};if("function"!=typeof b)for(var f=-1,g=_(arguments,!0,!1,1),h=Fb(a)?g.length:0;++f<h;){var i=g[f];i in a&&(e[i]=a[i])}else b=c.createCallback(b,d,3),fe(a,function(a,c,d){b(a,c,d)&&(e[c]=a)});return e}function Qb(a,b,d,e){var f=Yd(a);if(null==d)if(f)d=[];else{var g=a&&a.constructor,h=g&&g.prototype;d=s(h)}return b&&(b=c.createCallback(b,e,4),(f?Yb:ge)(a,function(a,c,e){return b(d,a,c,e)})),d}function Rb(a){for(var b=-1,c=$d(a),d=c.length,e=ld(d);++b<d;)e[b]=a[c[b]];return e}function Sb(a){for(var b=arguments,c=-1,d=_(b,!0,!1,1),e=b[2]&&b[2][b[1]]===a?1:d.length,f=ld(e);++c<e;)f[c]=a[d[c]];return f}function Tb(a,b,c){var d=-1,e=kb(),f=a?a.length:0,g=!1;return c=(0>c?Rd(0,f+c):c)||0,Yd(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Kb(a)?a.indexOf(b,c):e(a,b,c))>-1:ge(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ub(a,b,d){var e=!0;b=c.createCallback(b,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g&&(e=!!b(a[f],f,a)););else ge(a,function(a,c,d){return e=!!b(a,c,d)});return e}function Vb(a,b,d){var e=[];b=c.createCallback(b,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g;){var h=a[f];b(h,f,a)&&e.push(h)}else ge(a,function(a,c,d){b(a,c,d)&&e.push(a)});return e}function Wb(a,b,d){b=c.createCallback(b,d,3);var e=-1,f=a?a.length:0;if("number"!=typeof f){var g;return ge(a,function(a,c,d){return b(a,c,d)?(g=a,!1):void 0}),g}for(;++e<f;){var h=a[e];if(b(h,e,a))return h}}function Xb(a,b,d){var e;return b=c.createCallback(b,d,3),Zb(a,function(a,c,d){return b(a,c,d)?(e=a,!1):void 0}),e}function Yb(a,b,c){var d=-1,e=a?a.length:0;if(b=b&&"undefined"==typeof c?b:t(b,c,3),"number"==typeof e)for(;++d<e&&b(a[d],d,a)!==!1;);else ge(a,b);return a}function Zb(a,b,c){var d=a?a.length:0;if(b=b&&"undefined"==typeof c?b:t(b,c,3),"number"==typeof d)for(;d--&&b(a[d],d,a)!==!1;);else{var e=$d(a);d=e.length,ge(a,function(a,c,f){return c=e?e[--d]:--d,b(f[c],c,f)})}return a}function $b(a,b){var c=p(arguments,2),d=-1,e="function"==typeof b,f=a?a.length:0,g=ld("number"==typeof f?f:0);return Yb(a,function(a){g[++d]=(e?b:a[b]).apply(a,c)}),g}function _b(a,b,d){var e=-1,f=a?a.length:0;if(b=c.createCallback(b,d,3),"number"==typeof f)for(var g=ld(f);++e<f;)g[e]=b(a[e],e,a);else g=[],ge(a,function(a,c,d){g[++e]=b(a,c,d)});return g}function ac(a,b,d){var e=-1/0,f=e;if("function"!=typeof b&&d&&d[b]===a&&(b=null),null==b&&Yd(a))for(var g=-1,i=a.length;++g<i;){var j=a[g];j>f&&(f=j)}else b=null==b&&Kb(a)?h:c.createCallback(b,d,3),Yb(a,function(a,c,d){var g=b(a,c,d);g>e&&(e=g,f=a)});return f}function bc(a,b,d){var e=1/0,f=e;if("function"!=typeof b&&d&&d[b]===a&&(b=null),null==b&&Yd(a))for(var g=-1,i=a.length;++g<i;){var j=a[g];f>j&&(f=j)}else b=null==b&&Kb(a)?h:c.createCallback(b,d,3),Yb(a,function(a,c,d){var g=b(a,c,d);e>g&&(e=g,f=a)});return f}function cc(a,b){var c=-1,d=a?a.length:0;if("number"==typeof d)for(var e=ld(d);++c<d;)e[c]=a[c][b];return e||_b(a,b)}function dc(a,b,d,e){if(!a)return d;var f=arguments.length<3;b=c.createCallback(b,e,4);var g=-1,h=a.length;if("number"==typeof h)for(f&&(d=a[++g]);++g<h;)d=b(d,a[g],g,a);else ge(a,function(a,c,e){d=f?(f=!1,a):b(d,a,c,e)});return d}function ec(a,b,d,e){var f=arguments.length<3;return b=c.createCallback(b,e,4),Zb(a,function(a,c,e){d=f?(f=!1,a):b(d,a,c,e)}),d}function fc(a,b,d){return b=c.createCallback(b,d,3),Vb(a,function(a,c,d){return!b(a,c,d)})}function gc(a,b,c){if(a&&"number"!=typeof a.length&&(a=Rb(a)),null==b||c)return a?a[fb(0,a.length-1)]:r;var d=hc(a);return d.length=Sd(Rd(0,b),d.length),d}function hc(a){var b=-1,c=a?a.length:0,d=ld("number"==typeof c?c:0);return Yb(a,function(a){var c=fb(0,++b);d[b]=d[c],d[c]=a}),d}function ic(a){var b=a?a.length:0;return"number"==typeof b?b:$d(a).length}function jc(a,b,d){var e;b=c.createCallback(b,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g&&!(e=b(a[f],f,a)););else ge(a,function(a,c,d){return!(e=b(a,c,d))});return!!e}function kc(a,b,d){var e=-1,f=a?a.length:0,g=ld("number"==typeof f?f:0);for(b=c.createCallback(b,d,3),Yb(a,function(a,c,d){var f=g[++e]=m();f.criteria=b(a,c,d),f.index=e,f.value=a}),f=g.length,g.sort(i);f--;){var h=g[f];g[f]=h.value,o(h)}return g}function lc(a){return a&&"number"==typeof a.length?p(a):Rb(a)}function mc(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function nc(a){return Z(a,_(arguments,!0,!0,1))}function oc(a,b,d){var e=-1,f=a?a.length:0;for(b=c.createCallback(b,d,3);++e<f;)if(b(a[e],e,a))return e;return-1}function pc(a,b,d){var e=a?a.length:0;for(b=c.createCallback(b,d,3);e--;)if(b(a[e],e,a))return e;return-1}function qc(a,b,d){var e=0,f=a?a.length:0;if("number"!=typeof b&&null!=b){var g=-1;for(b=c.createCallback(b,d,3);++g<f&&b(a[g],g,a);)e++}else if(e=b,null==e||d)return a?a[0]:r;return p(a,0,Sd(Rd(0,e),f))}function rc(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c="function"!=typeof b&&d&&d[b]===a?null:b,b=!1),null!=c&&(a=_b(a,c,d)),_(a,b)}function sc(a,c,d){if("number"==typeof d){var e=a?a.length:0;d=0>d?Rd(0,e+d):d||0}else if(d){var f=Bc(a,c);return a[f]===c?f:-1}return b(a,c,d)}function tc(a,b,d){var e=0,f=a?a.length:0;if("number"!=typeof b&&null!=b){var g=f;for(b=c.createCallback(b,d,3);g--&&b(a[g],g,a);)e++}else e=null==b||d?1:b||e;return p(a,0,Sd(Rd(0,f-e),f))}function uc(a){for(var c=arguments,d=c.length,e=-1,g=l(),h=-1,i=kb(),k=a?a.length:0,m=[],p=l();++e<d;){var q=c[e];g[e]=i===b&&(q?q.length:0)>=w&&j(e?c[e]:p)}a:for(;++h<k;){var r=g[0];if(q=a[h],(r?f(r,q):i(p,q))<0){for(e=d,(r||p).push(q);--e;)if(r=g[e],(r?f(r,q):i(c[e],q))<0)continue a;m.push(q)}}for(;d--;)r=g[d],r&&o(r);return n(g),n(p),m}function vc(a,b,d){var e=0,f=a?a.length:0;if("number"!=typeof b&&null!=b){var g=f;for(b=c.createCallback(b,d,3);g--&&b(a[g],g,a);)e++}else if(e=b,null==e||d)return a?a[f-1]:r;return p(a,Rd(0,f-e))}function wc(a,b,c){var d=a?a.length:0;for("number"==typeof c&&(d=(0>c?Rd(0,d+c):Sd(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function xc(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++c<d;)for(var f=-1,g=b[c];++f<e;)a[f]===g&&(Jd.call(a,f--,1),e--);return a}function yc(a,b,c){a=+a||0,c="number"==typeof c?c:+c||1,null==b&&(b=a,a=0);for(var d=-1,e=Rd(0,Ad((b-a)/(c||1))),f=ld(e);++d<e;)f[d]=a,a+=c;return f}function zc(a,b,d){var e=-1,f=a?a.length:0,g=[];for(b=c.createCallback(b,d,3);++e<f;){var h=a[e];b(h,e,a)&&(g.push(h),Jd.call(a,e--,1),f--)}return g}function Ac(a,b,d){if("number"!=typeof b&&null!=b){var e=0,f=-1,g=a?a.length:0;for(b=c.createCallback(b,d,3);++f<g&&b(a[f],f,a);)e++}else e=null==b||d?1:Rd(0,b);return p(a,e)}function Bc(a,b,d,e){var f=0,g=a?a.length:f;for(d=d?c.createCallback(d,e,1):Yc,b=d(b);g>f;){var h=f+g>>>1;d(a[h])<b?f=h+1:g=h}return f}function Cc(){return gb(_(arguments,!0,!0))}function Dc(a,b,d,e){return"boolean"!=typeof b&&null!=b&&(e=d,d="function"!=typeof b&&e&&e[b]===a?null:b,b=!1),null!=d&&(d=c.createCallback(d,e,3)),gb(a,b,d)}function Ec(a){return Z(a,p(arguments,1))}function Fc(){for(var a=arguments.length>1?arguments:arguments[0],b=-1,c=a?ac(cc(a,"length")):0,d=ld(0>c?0:c);++b<c;)d[b]=cc(a,b);return d}function Gc(a,b){for(var c=-1,d=a?a.length:0,e={};++c<d;){var f=a[c];b?e[f]=b[c]:f&&(e[f[0]]=f[1])}return e}function Hc(a,b){if(!Eb(b))throw new ud;return function(){return--a<1?b.apply(this,arguments):void 0}}function Ic(a,b){return arguments.length>2?ib(a,17,p(arguments,2),null,b):ib(a,1,null,null,b)}function Jc(a){for(var b=arguments.length>1?_(arguments,!0,!1,1):vb(a),c=-1,d=b.length;++c<d;){var e=b[c];a[e]=ib(a[e],1,null,null,a)}return a}function Kc(a,b){return arguments.length>2?ib(b,19,p(arguments,2),null,a):ib(b,3,null,null,a)}function Lc(){for(var a=arguments,b=a.length;b--;)if(!Eb(a[b]))throw new ud;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mc(a,b,c){var d=typeof a;if(null==a||"function"==d)return t(a,b,c);if("object"!=d)return function(b){return b[a]};var e=$d(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Fb(g)?function(b){for(var c=e.length,d=!1;c--&&(d=ab(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Nc(a,b){return b="number"==typeof b?b:+b||a.length,ib(a,4,null,null,null,b)}function Oc(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Eb(a))throw new ud;if(b=Rd(0,b)||0,c===!0){var n=!0;m=!1}else Fb(c)&&(n=c.leading,l="maxWait"in c&&(Rd(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var o=function(){var c=b-(Gd()-g);if(0>=c){e&&Bd(e);var l=j;e=i=j=r,l&&(k=Gd(),f=a.apply(h,d),i||e||(d=h=null))}else i=Id(o,c)},p=function(){i&&Bd(i),e=i=j=r,(m||l!==b)&&(k=Gd(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=Gd(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var q=l-(g-k),r=0>=q;r?(e&&(e=Bd(e)),k=g,f=a.apply(h,d)):e||(e=Id(p,q))}return r&&i?i=Bd(i):i||b===l||(i=Id(o,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Pc(a){if(!Eb(a))throw new ud;var b=p(arguments,1);return Id(function(){a.apply(r,b)},1)}function Qc(a,b){if(!Eb(a))throw new ud;var c=p(arguments,2);return Id(function(){a.apply(r,c)},b)}function Rc(a,b){if(!Eb(a))throw new ud;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):v+arguments[0];return Fd.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Sc(a){var b,c;if(!Eb(a))throw new ud;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Tc(a){return ib(a,16,p(arguments,1))}function Uc(a){return ib(a,32,null,p(arguments,1))}function Vc(a,b,c){var d=!0,e=!0;if(!Eb(a))throw new ud;return c===!1?d=!1:Fb(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),W.leading=d,W.maxWait=b,W.trailing=e,Oc(a,b,W)}function Wc(a,b){return ib(b,16,[a])}function Xc(a){return null==a?"":td(a).replace(ce,jb)}function Yc(a){return a}function Zc(a,b){var e=a,f=!b||Eb(e);b||(e=d,b=a,a=c),Yb(vb(b),function(c){var d=a[c]=b[c];f&&(e.prototype[c]=function(){var b=this.__wrapped__,c=[b];Hd.apply(c,arguments);var f=d.apply(a,c);return b&&"object"==typeof b&&b===f?this:(f=new e(f),f.__chain__=this.__chain__,f)})})}function $c(){return a._=xd,this}function _c(){}function ad(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Ud();return Sd(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return fb(a,b)}function bd(a,b){if(a){var c=a[b];return Eb(c)?a[b]():c}}function cd(a,b,d){var e=c.templateSettings;a=td(a||""),d=ee({},d,e);var f,g=ee({},d.imports,e.imports),h=$d(g),i=Rb(g),j=0,l=d.interpolate||H,m="__p += '",n=sd((d.escape||H).source+"|"+l.source+"|"+(l===F?C:H).source+"|"+(d.evaluate||H).source+"|$","g");a.replace(n,function(b,c,d,e,g,h){return d||(d=e),m+=a.slice(j,h).replace(J,k),c&&(m+="' +\n__e("+c+") +\n'"),g&&(f=!0,m+="';\n"+g+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),j=h+b.length,b}),m+="';\n";var o=d.variable,p=o;p||(o="obj",m="with ("+o+") {\n"+m+"\n}\n"),m=(f?m.replace(z,""):m).replace(A,"$1").replace(B,"$1;"),m="function("+o+") {\n"+(p?"":o+" || ("+o+" = {});\n")+"var __t, __p = '', __e = _.escape"+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var q="\n/*\n//# sourceURL="+(d.sourceURL||"/lodash/template/source["+L++ +"]")+"\n*/";try{var s=od(h,"return "+m+q).apply(r,i)}catch(t){throw t.source=m,t}return b?s(b):(s.source=m,s)}function dd(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=ld(a);for(b=t(b,c,1);++d<a;)e[d]=b(d);return e}function ed(a){return null==a?"":td(a).replace(be,mb)}function fd(a){var b=++u;return td(null==a?"":a)+b}function gd(a){return a=new d(a),a.__chain__=!0,a}function hd(a,b){return b(a),a}function id(){return this.__chain__=!0,this}function jd(){return td(this.__wrapped__)}function kd(){return this.__wrapped__}a=a?db.defaults($.Object(),a,db.pick($,K)):$;var ld=a.Array,md=a.Boolean,nd=a.Date,od=a.Function,pd=a.Math,qd=a.Number,rd=a.Object,sd=a.RegExp,td=a.String,ud=a.TypeError,vd=[],wd=rd.prototype,xd=a._,yd=wd.toString,zd=sd("^"+td(yd).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Ad=pd.ceil,Bd=a.clearTimeout,Cd=pd.floor,Dd=od.prototype.toString,Ed=zd.test(Ed=rd.getPrototypeOf)&&Ed,Fd=wd.hasOwnProperty,Gd=zd.test(Gd=nd.now)&&Gd||function(){return+new nd},Hd=vd.push,Id=a.setTimeout,Jd=vd.splice,Kd="function"==typeof(Kd=cb&&bb&&cb.setImmediate)&&!zd.test(Kd)&&Kd,Ld=function(){try{var a={},b=zd.test(b=rd.defineProperty)&&b,c=b(a,a,a)&&b}catch(d){}return c}(),Md=zd.test(Md=rd.create)&&Md,Nd=zd.test(Nd=ld.isArray)&&Nd,Od=a.isFinite,Pd=a.isNaN,Qd=zd.test(Qd=rd.keys)&&Qd,Rd=pd.max,Sd=pd.min,Td=a.parseInt,Ud=pd.random,Vd={};Vd[N]=ld,Vd[O]=md,Vd[P]=nd,Vd[Q]=od,Vd[S]=rd,Vd[R]=qd,Vd[T]=sd,Vd[U]=td,d.prototype=c.prototype;var Wd=c.support={};Wd.funcDecomp=!zd.test(a.WinRTError)&&I.test(q),Wd.funcNames="string"==typeof od.name,c.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:c}},Md||(s=function(){function b(){}return function(c){if(Fb(c)){b.prototype=c;var d=new b;b.prototype=null}return d||a.Object()}}());var Xd=Ld?function(a,b){X.value=b,Ld(a,"__bindData__",X)}:_c,Yd=Nd||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&yd.call(a)==N||!1},Zd=function(a){var b,c=a,d=[];
if(!c)return d;if(!Y[typeof a])return d;for(b in c)Fd.call(c,b)&&d.push(b);return d},$d=Qd?function(a){return Fb(a)?Qd(a):[]}:Zd,_d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ae=xb(_d),be=sd("("+$d(ae).join("|")+")","g"),ce=sd("["+$d(_d).join("")+"]","g"),de=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=t(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h<i;)if(e=g[h],e&&Y[typeof e])for(var k=-1,l=Y[typeof e]&&$d(e),m=l?l.length:0;++k<m;)d=l[k],f[d]=j?j(f[d],e[d]):e[d];return f},ee=function(a,b,c){var d,e=a,f=e;if(!e)return f;for(var g=arguments,h=0,i="number"==typeof c?2:g.length;++h<i;)if(e=g[h],e&&Y[typeof e])for(var j=-1,k=Y[typeof e]&&$d(e),l=k?k.length:0;++j<l;)d=k[j],"undefined"==typeof f[d]&&(f[d]=e[d]);return f},fe=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!Y[typeof e])return f;b=b&&"undefined"==typeof c?b:t(b,c,3);for(d in e)if(b(e[d],d,a)===!1)return f;return f},ge=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!Y[typeof e])return f;b=b&&"undefined"==typeof c?b:t(b,c,3);for(var g=-1,h=Y[typeof e]&&$d(e),i=h?h.length:0;++g<i;)if(d=h[g],b(e[d],d,a)===!1)return f;return f},he=function(a){if(!a||yd.call(a)!=S)return!1;var b=a.valueOf,c="function"==typeof b&&(c=Ed(b))&&Ed(c);return c?a==c||Ed(a)==c:lb(a)},ie=hb(function(a,b,c){Fd.call(a,c)?a[c]++:a[c]=1}),je=hb(function(a,b,c){(Fd.call(a,c)?a[c]:a[c]=[]).push(b)}),ke=hb(function(a,b,c){a[c]=b}),le=Vb;Kd&&(Pc=function(b){if(!Eb(b))throw new ud;return Kd.apply(a,arguments)});var me=8==Td(y+"08")?Td:function(a,b){return Td(Kb(a)?a.replace(G,""):a,b||0)};return c.after=Hc,c.assign=de,c.at=Sb,c.bind=Ic,c.bindAll=Jc,c.bindKey=Kc,c.chain=gd,c.compact=mc,c.compose=Lc,c.countBy=ie,c.create=qb,c.createCallback=Mc,c.curry=Nc,c.debounce=Oc,c.defaults=ee,c.defer=Pc,c.delay=Qc,c.difference=nc,c.filter=Vb,c.flatten=rc,c.forEach=Yb,c.forEachRight=Zb,c.forIn=fe,c.forInRight=tb,c.forOwn=ge,c.forOwnRight=ub,c.functions=vb,c.groupBy=je,c.indexBy=ke,c.initial=tc,c.intersection=uc,c.invert=xb,c.invoke=$b,c.keys=$d,c.map=_b,c.max=ac,c.memoize=Rc,c.merge=Mb,c.min=bc,c.omit=Nb,c.once=Sc,c.pairs=Ob,c.partial=Tc,c.partialRight=Uc,c.pick=Pb,c.pluck=cc,c.pull=xc,c.range=yc,c.reject=fc,c.remove=zc,c.rest=Ac,c.shuffle=hc,c.sortBy=kc,c.tap=hd,c.throttle=Vc,c.times=dd,c.toArray=lc,c.transform=Qb,c.union=Cc,c.uniq=Dc,c.values=Rb,c.where=le,c.without=Ec,c.wrap=Wc,c.zip=Fc,c.zipObject=Gc,c.collect=_b,c.drop=Ac,c.each=Yb,c.eachRight=Zb,c.extend=de,c.methods=vb,c.object=Gc,c.select=Vb,c.tail=Ac,c.unique=Dc,c.unzip=Fc,Zc(c),c.clone=ob,c.cloneDeep=pb,c.contains=Tb,c.escape=Xc,c.every=Ub,c.find=Wb,c.findIndex=oc,c.findKey=rb,c.findLast=Xb,c.findLastIndex=pc,c.findLastKey=sb,c.has=wb,c.identity=Yc,c.indexOf=sc,c.isArguments=nb,c.isArray=Yd,c.isBoolean=yb,c.isDate=zb,c.isElement=Ab,c.isEmpty=Bb,c.isEqual=Cb,c.isFinite=Db,c.isFunction=Eb,c.isNaN=Gb,c.isNull=Hb,c.isNumber=Ib,c.isObject=Fb,c.isPlainObject=he,c.isRegExp=Jb,c.isString=Kb,c.isUndefined=Lb,c.lastIndexOf=wc,c.mixin=Zc,c.noConflict=$c,c.noop=_c,c.parseInt=me,c.random=ad,c.reduce=dc,c.reduceRight=ec,c.result=bd,c.runInContext=q,c.size=ic,c.some=jc,c.sortedIndex=Bc,c.template=cd,c.unescape=ed,c.uniqueId=fd,c.all=Ub,c.any=jc,c.detect=Wb,c.findWhere=Wb,c.foldl=dc,c.foldr=ec,c.include=Tb,c.inject=dc,ge(c,function(a,b){c.prototype[b]||(c.prototype[b]=function(){var b=[this.__wrapped__],e=this.__chain__;Hd.apply(b,arguments);var f=a.apply(c,b);return e?new d(f,e):f})}),c.first=qc,c.last=vc,c.sample=gc,c.take=qc,c.head=qc,ge(c,function(a,b){var e="sample"!==b;c.prototype[b]||(c.prototype[b]=function(b,c){var f=this.__chain__,g=a(this.__wrapped__,b,c);return f||null!=b&&(!c||e&&"function"==typeof b)?new d(g,f):g})}),c.VERSION="2.3.0",c.prototype.chain=id,c.prototype.toString=jd,c.prototype.value=kd,c.prototype.valueOf=kd,Yb(["join","pop","shift"],function(a){var b=vd[a];c.prototype[a]=function(){var a=this.__chain__,c=b.apply(this.__wrapped__,arguments);return a?new d(c,a):c}}),Yb(["push","reverse","sort","unshift"],function(a){var b=vd[a];c.prototype[a]=function(){return b.apply(this.__wrapped__,arguments),this}}),Yb(["concat","slice","splice"],function(a){var b=vd[a];c.prototype[a]=function(){return new d(b.apply(this.__wrapped__,arguments),this.__chain__)}}),c}var r,s=[],t=[],u=0,v=+new Date+"",w=75,x=40,y=" \f \n\r\u2028\u2029  ",z=/\b__p \+= '';/g,A=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,D=/\w*$/,E=/^\s*function[ \n\r\t]+\w/,F=/<%=([\s\S]+?)%>/g,G=RegExp("^["+y+"]*0+(?=.$)"),H=/($^)/,I=/\bthis\b/,J=/['\n\r\t\u2028\u2029\\]/g,K=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],L=0,M="[object Arguments]",N="[object Array]",O="[object Boolean]",P="[object Date]",Q="[object Function]",R="[object Number]",S="[object Object]",T="[object RegExp]",U="[object String]",V={};V[Q]=!1,V[M]=V[N]=V[O]=V[P]=V[R]=V[S]=V[T]=V[U]=!0;var W={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=Y[typeof window]&&window||this,_=Y[typeof d]&&d&&!d.nodeType&&d,ab=Y[typeof c]&&c&&!c.nodeType&&c,bb=ab&&ab.exports===_&&_,cb=Y[typeof e]&&e;!cb||cb.global!==cb&&cb.window!==cb||($=cb);var db=q();"function"==typeof a&&"object"==typeof a.amd&&a.amd?($._=db,a(function(){return db})):_&&ab?bb?(ab.exports=db)._=db:_._=db:$._=db}).call(this)},{}],14:[function(a,b){var c={Client:a("./lib/client")};b.exports=c},{"./lib/client":16}],15:[function(a,b){var c=a("./client_action"),d=(a("./errors"),b.exports={});d._namespaces=["cluster","indices"],d.bulk=c({methods:["POST","PUT"],params:{consistency:{type:"enum",options:["one","quorum","all"]},refresh:{type:"boolean"},replication:{type:"enum","default":"sync",options:["sync","async"]},type:{type:"string"}},urls:[{fmt:"/<%=index%>/<%=type%>/_bulk",req:{index:{type:"string"},type:{type:"string"}}},{fmt:"/<%=index%>/_bulk",req:{index:{type:"string"}}},{fmt:"/_bulk"}],bulkBody:!0}),d.clearScroll=c({methods:["DELETE"],params:{},urls:[{fmt:"/_search/scroll/<%=scrollId%>",req:{scrollId:{type:"list"}}}]}),d.cluster=function e(a){return this instanceof e?(this.client=a,void 0):new e(a)},d.cluster.prototype.getSettings=c({methods:["GET"],params:{},urls:[{fmt:"/_cluster/settings"}]}),d.cluster.prototype.health=c({methods:["GET"],params:{level:{type:"enum","default":"cluster",options:["cluster","indices","shards"]},local:{type:"boolean"},masterTimeout:{type:"time",name:"master_timeout"},timeout:{type:"time"},waitForActiveShards:{type:"number",name:"wait_for_active_shards"},waitForNodes:{type:"string",name:"wait_for_nodes"},waitForRelocatingShards:{type:"number",name:"wait_for_relocating_shards"},waitForStatus:{type:"enum","default":null,options:["green","yellow","red"],name:"wait_for_status"}},urls:[{fmt:"/_cluster/health/<%=index%>",req:{index:{type:"string"}}},{fmt:"/_cluster/health"}]}),d.cluster.prototype.nodeHotThreads=c({methods:["GET"],params:{interval:{type:"time"},snapshots:{type:"number"},threads:{type:"number"},type:{type:"enum",options:["cpu","wait","block"]}},urls:[{fmt:"/_nodes/<%=nodeId%>/hotthreads",req:{nodeId:{type:"list"}}},{fmt:"/_nodes/hotthreads"}]}),d.cluster.prototype.nodeInfo=c({methods:["GET"],params:{all:{type:"boolean"},clear:{type:"boolean"},http:{type:"boolean"},jvm:{type:"boolean"},network:{type:"boolean"},os:{type:"boolean"},plugin:{type:"boolean"},process:{type:"boolean"},settings:{type:"boolean"},threadPool:{type:"boolean",name:"thread_pool"},timeout:{type:"time"},transport:{type:"boolean"}},urls:[{fmt:"/_nodes/<%=nodeId%>",req:{nodeId:{type:"list"}}},{fmt:"/_nodes"}]}),d.cluster.prototype.nodeShutdown=c({methods:["POST"],params:{delay:{type:"time"},exit:{type:"boolean"}},urls:[{fmt:"/_cluster/nodes/<%=nodeId%>/_shutdown",req:{nodeId:{type:"list"}}},{fmt:"/_shutdown"}]}),d.cluster.prototype.nodeStats=c({methods:["GET"],params:{all:{type:"boolean"},clear:{type:"boolean"},fields:{type:"list"},fs:{type:"boolean"},http:{type:"boolean"},indices:{type:"boolean"},jvm:{type:"boolean"},network:{type:"boolean"},os:{type:"boolean"},process:{type:"boolean"},threadPool:{type:"boolean",name:"thread_pool"},transport:{type:"boolean"}},urls:[{fmt:"/_nodes/<%=nodeId%>/stats",req:{nodeId:{type:"list"}}},{fmt:"/_nodes/stats"}]}),d.cluster.prototype.putSettings=c({methods:["PUT"],params:{},urls:[{fmt:"/_cluster/settings"}]}),d.cluster.prototype.reroute=c({methods:["POST"],params:{dryRun:{type:"boolean",name:"dry_run"},filterMetadata:{type:"boolean",name:"filter_metadata"}},urls:[{fmt:"/_cluster/reroute"}]}),d.cluster.prototype.state=c({methods:["GET"],params:{filterBlocks:{type:"boolean",name:"filter_blocks"},filterIndexTemplates:{type:"boolean",name:"filter_index_templates"},filterIndices:{type:"list",name:"filter_indices"},filterMetadata:{type:"boolean",name:"filter_metadata"},filterNodes:{type:"boolean",name:"filter_nodes"},filterRoutingTable:{type:"boolean",name:"filter_routing_table"},local:{type:"boolean"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/_cluster/state"}]}),d.count=c({methods:["POST","GET"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},minScore:{type:"number",name:"min_score"},preference:{type:"string"},routing:{type:"string"},source:{type:"string"}},urls:[{fmt:"/<%=index%>/<%=type%>/_count",req:{index:{type:"list"},type:{type:"list"}}},{fmt:"/<%=index%>/_count",req:{index:{type:"list"}}},{fmt:"/_count"}]}),d.create=c({methods:["POST","PUT"],params:{consistency:{type:"enum",options:["one","quorum","all"]},id:{type:"string"},parent:{type:"string"},percolate:{type:"string"},refresh:{type:"boolean"},replication:{type:"enum","default":"sync",options:["sync","async"]},routing:{type:"string"},timeout:{type:"time"},timestamp:{type:"time"},ttl:{type:"duration"},version:{type:"number"},versionType:{type:"enum",options:["internal","external"],name:"version_type"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>/_create",req:{index:{type:"string"},type:{type:"string"},id:{type:"string"}}},{fmt:"/<%=index%>/<%=type%>",req:{index:{type:"string"},type:{type:"string"}}}]}),d["delete"]=c({methods:["DELETE"],params:{consistency:{type:"enum",options:["one","quorum","all"]},parent:{type:"string"},refresh:{type:"boolean"},replication:{type:"enum","default":"sync",options:["sync","async"]},routing:{type:"string"},timeout:{type:"time"},version:{type:"number"},versionType:{type:"enum",options:["internal","external"],name:"version_type"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>",req:{index:{type:"string"},type:{type:"string"},id:{type:"string"}}}]}),d.deleteByQuery=c({methods:["DELETE"],params:{analyzer:{type:"string"},consistency:{type:"enum",options:["one","quorum","all"]},defaultOperator:{type:"enum","default":"OR",options:["AND","OR"],name:"default_operator"},df:{type:"string"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},replication:{type:"enum","default":"sync",options:["sync","async"]},q:{type:"string"},routing:{type:"string"},source:{type:"string"},timeout:{type:"time"}},urls:[{fmt:"/<%=index%>/<%=type%>/_query",req:{index:{type:"list"},type:{type:"list"}}},{fmt:"/<%=index%>/_query",req:{index:{type:"list"}}}]}),d.exists=c({methods:["HEAD"],params:{parent:{type:"string"},preference:{type:"string"},realtime:{type:"boolean"},refresh:{type:"boolean"},routing:{type:"string"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>",opt:{type:{type:"string","default":"_all"}},req:{index:{type:"string"},id:{type:"string"}}}],castExists:!0}),d.explain=c({methods:["GET","POST"],params:{analyzeWildcard:{type:"boolean",name:"analyze_wildcard"},analyzer:{type:"string"},defaultOperator:{type:"enum","default":"OR",options:["AND","OR"],name:"default_operator"},df:{type:"string"},fields:{type:"list"},lenient:{type:"boolean"},lowercaseExpandedTerms:{type:"boolean",name:"lowercase_expanded_terms"},parent:{type:"string"},preference:{type:"string"},q:{type:"string"},routing:{type:"string"},source:{type:"list",name:"_source"},sourceExclude:{type:"list",name:"_source_exclude"},sourceInclude:{type:"list",name:"_source_include"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>/_explain",req:{index:{type:"string"},type:{type:"string"},id:{type:"string"}}}]}),d.get=c({methods:["GET"],params:{fields:{type:"list"},parent:{type:"string"},preference:{type:"string"},realtime:{type:"boolean"},refresh:{type:"boolean"},routing:{type:"string"},source:{type:"list",name:"_source"},sourceExclude:{type:"list",name:"_source_exclude"},sourceInclude:{type:"list",name:"_source_include"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>",opt:{type:{type:"string","default":"_all"}},req:{index:{type:"string"},id:{type:"string"}}}]}),d.getSource=c({methods:["GET"],params:{exclude:{type:"list"},include:{type:"list"},parent:{type:"string"},preference:{type:"string"},realtime:{type:"boolean"},refresh:{type:"boolean"},routing:{type:"string"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>/_source",opt:{type:{type:"string","default":"_all"}},req:{index:{type:"string"},id:{type:"string"}}}]}),d.index=c({methods:["POST","PUT"],params:{consistency:{type:"enum",options:["one","quorum","all"]},opType:{type:"enum","default":"index",options:["index","create"],name:"op_type"},parent:{type:"string"},percolate:{type:"string"},refresh:{type:"boolean"},replication:{type:"enum","default":"sync",options:["sync","async"]},routing:{type:"string"},timeout:{type:"time"},timestamp:{type:"time"},ttl:{type:"duration"},version:{type:"number"},versionType:{type:"enum",options:["internal","external"],name:"version_type"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>",req:{index:{type:"string"},type:{type:"string"},id:{type:"string"}}},{fmt:"/<%=index%>/<%=type%>",req:{index:{type:"string"},type:{type:"string"}}}]}),d.indices=function f(a){return this instanceof f?(this.client=a,void 0):new f(a)},d.indices.prototype.analyze=c({methods:["GET","POST"],params:{analyzer:{type:"string"},field:{type:"string"},filters:{type:"list"},index:{type:"string"},preferLocal:{type:"boolean",name:"prefer_local"},text:{type:"string"},tokenizer:{type:"string"},format:{type:"enum","default":"detailed",options:["detailed","text"]}},urls:[{fmt:"/<%=index%>/_analyze",req:{index:{type:"string"}}},{fmt:"/_analyze"}]}),d.indices.prototype.clearCache=c({methods:["POST","GET"],params:{fieldData:{type:"boolean",name:"field_data"},fielddata:{type:"boolean"},fields:{type:"list"},filter:{type:"boolean"},filterCache:{type:"boolean",name:"filter_cache"},filterKeys:{type:"boolean",name:"filter_keys"},id:{type:"boolean"},idCache:{type:"boolean",name:"id_cache"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},index:{type:"list"},recycler:{type:"boolean"}},urls:[{fmt:"/<%=index%>/_cache/clear",req:{index:{type:"list"}}},{fmt:"/_cache/clear"}]}),d.indices.prototype.close=c({methods:["POST"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/_close",req:{index:{type:"string"}}}]}),d.indices.prototype.create=c({methods:["PUT","POST"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>",req:{index:{type:"string"}}}]}),d.indices.prototype["delete"]=c({methods:["DELETE"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>",req:{index:{type:"list"}}},{fmt:"/"}]}),d.indices.prototype.deleteAlias=c({methods:["DELETE"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/_alias/<%=name%>",req:{index:{type:"string"},name:{type:"string"}}}]}),d.indices.prototype.deleteMapping=c({methods:["DELETE"],params:{masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/<%=type%>",req:{index:{type:"list"},type:{type:"string"}}}]}),d.indices.prototype.deleteTemplate=c({methods:["DELETE"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/_template/<%=name%>",req:{name:{type:"string"}}}]}),d.indices.prototype.deleteWarmer=c({methods:["DELETE"],params:{masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/<%=type%>/_warmer/<%=name%>",req:{index:{type:"list"},type:{type:"list"},name:{type:"string"}}},{fmt:"/<%=index%>/_warmer/<%=name%>",req:{index:{type:"list"},name:{type:"string"}}},{fmt:"/<%=index%>/_warmer",req:{index:{type:"list"}}}]}),d.indices.prototype.exists=c({methods:["HEAD"],params:{},urls:[{fmt:"/<%=index%>",req:{index:{type:"list"}}}],castExists:!0}),d.indices.prototype.existsAlias=c({methods:["HEAD"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"}},urls:[{fmt:"/<%=index%>/_alias/<%=name%>",req:{index:{type:"list"},name:{type:"list"}}},{fmt:"/_alias/<%=name%>",req:{name:{type:"list"}}}],castExists:!0}),d.indices.prototype.existsType=c({methods:["HEAD"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"}},urls:[{fmt:"/<%=index%>/<%=type%>",req:{index:{type:"list"},type:{type:"list"}}}],castExists:!0}),d.indices.prototype.flush=c({methods:["POST","GET"],params:{force:{type:"boolean"},full:{type:"boolean"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},refresh:{type:"boolean"}},urls:[{fmt:"/<%=index%>/_flush",req:{index:{type:"list"}}},{fmt:"/_flush"}]}),d.indices.prototype.getAlias=c({methods:["GET"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"}},urls:[{fmt:"/<%=index%>/_alias/<%=name%>",req:{index:{type:"list"},name:{type:"list"}}},{fmt:"/_alias/<%=name%>",req:{name:{type:"list"}}}]}),d.indices.prototype.getAliases=c({methods:["GET"],params:{timeout:{type:"time"}},urls:[{fmt:"/<%=index%>/_aliases",req:{index:{type:"list"}}},{fmt:"/_aliases"}]}),d.indices.prototype.getFieldMapping=c({methods:["GET"],params:{includeDefaults:{type:"boolean",name:"include_defaults"}},urls:[{fmt:"/<%=index%>/<%=type%>/_mapping/field/<%=field%>",req:{index:{type:"list"},type:{type:"list"},field:{type:"list"}}},{fmt:"/<%=index%>/_mapping/field/<%=field%>",req:{index:{type:"list"},field:{type:"list"}}},{fmt:"/_mapping/field/<%=field%>",req:{field:{type:"list"}}}]}),d.indices.prototype.getMapping=c({methods:["GET"],params:{},urls:[{fmt:"/<%=index%>/<%=type%>/_mapping",req:{index:{type:"list"},type:{type:"list"}}},{fmt:"/<%=index%>/_mapping",req:{index:{type:"list"}}},{fmt:"/_mapping"}]}),d.indices.prototype.getSettings=c({methods:["GET"],params:{},urls:[{fmt:"/<%=index%>/_settings",req:{index:{type:"list"}}},{fmt:"/_settings"}]}),d.indices.prototype.getTemplate=c({methods:["GET"],params:{},urls:[{fmt:"/_template/<%=name%>",req:{name:{type:"string"}}},{fmt:"/_template"}]}),d.indices.prototype.getWarmer=c({methods:["GET"],params:{},urls:[{fmt:"/<%=index%>/<%=type%>/_warmer/<%=name%>",req:{index:{type:"list"},type:{type:"list"},name:{type:"string"}}},{fmt:"/<%=index%>/_warmer/<%=name%>",req:{index:{type:"list"},name:{type:"string"}}},{fmt:"/<%=index%>/_warmer",req:{index:{type:"list"}}}]}),d.indices.prototype.open=c({methods:["POST"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/_open",req:{index:{type:"string"}}}]}),d.indices.prototype.optimize=c({methods:["POST","GET"],params:{flush:{type:"boolean"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},maxNumSegments:{type:"number",name:"max_num_segments"},onlyExpungeDeletes:{type:"boolean",name:"only_expunge_deletes"},operationThreading:{name:"operation_threading"},refresh:{type:"boolean"},waitForMerge:{type:"boolean",name:"wait_for_merge"}},urls:[{fmt:"/<%=index%>/_optimize",req:{index:{type:"list"}}},{fmt:"/_optimize"}]}),d.indices.prototype.putAlias=c({methods:["PUT"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/_alias/<%=name%>",req:{index:{type:"string"},name:{type:"string"}}},{fmt:"/_alias/<%=name%>",req:{name:{type:"string"}}},{fmt:"/<%=index%>/_alias",req:{index:{type:"string"}}},{fmt:"/_alias"}]}),d.indices.prototype.putMapping=c({methods:["PUT","POST"],params:{ignoreConflicts:{type:"boolean",name:"ignore_conflicts"},timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/<%=type%>/_mapping",req:{index:{type:"list"},type:{type:"string"}}}]}),d.indices.prototype.putSettings=c({methods:["PUT"],params:{masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/_settings",req:{index:{type:"list"}}},{fmt:"/_settings"}]}),d.indices.prototype.putTemplate=c({methods:["PUT","POST"],params:{order:{type:"number"},timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/_template/<%=name%>",req:{name:{type:"string"}}}]}),d.indices.prototype.putWarmer=c({methods:["PUT"],params:{masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/<%=index%>/<%=type%>/_warmer/<%=name%>",req:{index:{type:"list"},type:{type:"list"},name:{type:"string"}}},{fmt:"/<%=index%>/_warmer/<%=name%>",req:{index:{type:"list"},name:{type:"string"}}}]}),d.indices.prototype.refresh=c({methods:["POST","GET"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},operationThreading:{name:"operation_threading"}},urls:[{fmt:"/<%=index%>/_refresh",req:{index:{type:"list"}}},{fmt:"/_refresh"}]}),d.indices.prototype.segments=c({methods:["GET"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},operationThreading:{name:"operation_threading"}},urls:[{fmt:"/<%=index%>/_segments",req:{index:{type:"list"}}},{fmt:"/_segments"}]}),d.indices.prototype.snapshotIndex=c({methods:["POST"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"}},urls:[{fmt:"/<%=index%>/_gateway/snapshot",req:{index:{type:"list"}}},{fmt:"/_gateway/snapshot"}]}),d.indices.prototype.stats=c({methods:["GET"],params:{all:{type:"boolean"},clear:{type:"boolean"},completion:{type:"boolean"},completionFields:{type:"list",name:"completion_fields"},docs:{type:"boolean"},fielddata:{type:"boolean"},fielddataFields:{type:"list",name:"fielddata_fields"},fields:{type:"list"},filterCache:{type:"boolean",name:"filter_cache"},flush:{type:"boolean"},get:{type:"boolean"},groups:{type:"boolean"},idCache:{type:"boolean",name:"id_cache"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},indexing:{type:"boolean"},merge:{type:"boolean"},refresh:{type:"boolean"},search:{type:"boolean"},store:{type:"boolean"},warmer:{type:"boolean"}},urls:[{fmt:"/<%=index%>/_stats",req:{index:{type:"list"}}},{fmt:"/_stats"}]}),d.indices.prototype.status=c({methods:["GET"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},operationThreading:{name:"operation_threading"},recovery:{type:"boolean"},snapshot:{type:"boolean"}},urls:[{fmt:"/<%=index%>/_status",req:{index:{type:"list"}}},{fmt:"/_status"}]}),d.indices.prototype.updateAliases=c({methods:["POST"],params:{timeout:{type:"time"},masterTimeout:{type:"time",name:"master_timeout"}},urls:[{fmt:"/_aliases"}]}),d.indices.prototype.validateQuery=c({methods:["GET","POST"],params:{explain:{type:"boolean"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},operationThreading:{name:"operation_threading"},source:{type:"string"},q:{type:"string"}},urls:[{fmt:"/<%=index%>/<%=type%>/_validate/query",req:{index:{type:"list"},type:{type:"list"}}},{fmt:"/<%=index%>/_validate/query",req:{index:{type:"list"}}},{fmt:"/_validate/query"}]}),d.info=c({methods:["GET","HEAD"],params:{},urls:[{fmt:"/"}]}),d.mget=c({methods:["GET","POST"],params:{fields:{type:"list"},preference:{type:"string"},realtime:{type:"boolean"},refresh:{type:"boolean"},source:{type:"list",name:"_source"},sourceExclude:{type:"list",name:"_source_exclude"},sourceInclude:{type:"list",name:"_source_include"}},urls:[{fmt:"/<%=index%>/<%=type%>/_mget",req:{index:{type:"string"},type:{type:"string"}}},{fmt:"/<%=index%>/_mget",req:{index:{type:"string"}}},{fmt:"/_mget"}]}),d.mlt=c({methods:["GET","POST"],params:{boostTerms:{type:"number",name:"boost_terms"},maxDocFreq:{type:"number",name:"max_doc_freq"},maxQueryTerms:{type:"number",name:"max_query_terms"},maxWordLen:{type:"number",name:"max_word_len"},minDocFreq:{type:"number",name:"min_doc_freq"},minTermFreq:{type:"number",name:"min_term_freq"},minWordLen:{type:"number",name:"min_word_len"},mltFields:{type:"list",name:"mlt_fields"},percentTermsToMatch:{type:"number",name:"percent_terms_to_match"},routing:{type:"string"},searchFrom:{type:"number",name:"search_from"},searchIndices:{type:"list",name:"search_indices"},searchQueryHint:{type:"string",name:"search_query_hint"},searchScroll:{type:"string",name:"search_scroll"},searchSize:{type:"number",name:"search_size"},searchSource:{type:"string",name:"search_source"},searchType:{type:"string",name:"search_type"},searchTypes:{type:"list",name:"search_types"},stopWords:{type:"list",name:"stop_words"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>/_mlt",req:{index:{type:"string"},type:{type:"string"},id:{type:"string"}}}]}),d.msearch=c({methods:["GET","POST"],params:{searchType:{type:"enum",options:["query_then_fetch","query_and_fetch","dfs_query_then_fetch","dfs_query_and_fetch","count","scan"],name:"search_type"}},urls:[{fmt:"/<%=index%>/<%=type%>/_msearch",req:{index:{type:"list"},type:{type:"list"}}},{fmt:"/<%=index%>/_msearch",req:{index:{type:"list"}}},{fmt:"/_msearch"}],bulkBody:!0}),d.percolate=c({methods:["GET","POST"],params:{preferLocal:{type:"boolean",name:"prefer_local"}},urls:[{fmt:"/<%=index%>/<%=type%>/_percolate",req:{index:{type:"string"},type:{type:"string"}}}]}),d.scroll=c({methods:["GET","POST"],params:{scroll:{type:"duration"},scrollId:{type:"string",name:"scroll_id"}},urls:[{fmt:"/_search/scroll/<%=scrollId%>",req:{scrollId:{type:"string"}}},{fmt:"/_search/scroll"}]}),d.search=c({methods:["GET","POST"],params:{analyzer:{type:"string"},analyzeWildcard:{type:"boolean",name:"analyze_wildcard"},defaultOperator:{type:"enum","default":"OR",options:["AND","OR"],name:"default_operator"},df:{type:"string"},explain:{type:"boolean"},fields:{type:"list"},from:{type:"number"},ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},indicesBoost:{type:"list",name:"indices_boost"},lenient:{type:"boolean"},lowercaseExpandedTerms:{type:"boolean",name:"lowercase_expanded_terms"},preference:{type:"string"},q:{type:"string"},routing:{type:"list"},scroll:{type:"duration"},searchType:{type:"enum",options:["query_then_fetch","query_and_fetch","dfs_query_then_fetch","dfs_query_and_fetch","count","scan"],name:"search_type"},size:{type:"number"},sort:{type:"list"},source:{type:"list",name:"_source"},sourceExclude:{type:"list",name:"_source_exclude"},sourceInclude:{type:"list",name:"_source_include"},stats:{type:"list"},suggestField:{type:"string",name:"suggest_field"},suggestMode:{type:"enum","default":"missing",options:["missing","popular","always"],name:"suggest_mode"},suggestSize:{type:"number",name:"suggest_size"},suggestText:{type:"text",name:"suggest_text"},timeout:{type:"time"},version:{type:"boolean"}},urls:[{fmt:"/<%=index%>/<%=type%>/_search",opt:{index:{type:"list","default":"_all"}},req:{type:{type:"list"}}},{fmt:"/<%=index%>/_search",opt:{index:{type:"list","default":"_all"}}}]}),d.suggest=c({methods:["POST","GET"],params:{ignoreIndices:{type:"enum","default":"none",options:["none","missing"],name:"ignore_indices"},preference:{type:"string"},routing:{type:"string"},source:{type:"string"}},urls:[{fmt:"/<%=index%>/_suggest",req:{index:{type:"list"}}},{fmt:"/_suggest"}]}),d.update=c({methods:["POST"],params:{consistency:{type:"enum",options:["one","quorum","all"]},fields:{type:"list"},lang:{type:"string"},parent:{type:"string"},percolate:{type:"string"},refresh:{type:"boolean"},replication:{type:"enum","default":"sync",options:["sync","async"]},retryOnConflict:{type:"number",name:"retry_on_conflict"},routing:{type:"string"},script:{},timeout:{type:"time"},timestamp:{type:"time"},ttl:{type:"duration"},version:{type:"number"},versionType:{type:"enum",options:["internal","external"],name:"version_type"}},urls:[{fmt:"/<%=index%>/<%=type%>/<%=id%>/_update",req:{index:{type:"string"},type:{type:"string"},id:{type:"string"}}}]})},{"./client_action":17,"./errors":22}],16:[function(a,b){function c(a){this.client=this,Object.defineProperty(this,"config",{configurable:!1,enumerable:!1,writable:!1,value:!a||d.isPlainObject(a)?new e(a):a}),this.config.client=this;for(var b=0;b<this._namespaces.length;b++)this[this._namespaces[b]]=new this[this._namespaces[b]](this)}b.exports=c;var d=a("./utils"),e=a("./client_config"),f=a("./api.js");c.prototype=d.clone(f),c.prototype.ping=function(a,b){"function"==typeof a&&(b=a,a={}),this.config.transport.request({method:"HEAD",path:"/",timeout:100},b)},c.prototype.close=function(){this.config.close()}},{"./api.js":15,"./client_config":18,"./utils":33}],17:[function(a,b){function c(a,b){var c,d,g={};if(a.req)for(a.reqParamKeys||(a.reqParamKeys=e.keys(a.req)),c=0;c<a.reqParamKeys.length;c++){if(d=a.reqParamKeys[c],!b.hasOwnProperty(d))return!1;g[d]=b[d]}if(a.opt)for(a.optParamKeys||(a.optParamKeys=e.keys(a.opt)),c=0;c<a.optParamKeys.length;c++)d=a.optParamKeys[c],g[d]=b[d]?f[a.opt[d].type]?f[a.opt[d].type](a.opt[d],b[d],d):b[d]:a.opt[d]["default"];return a.template||(a.template=e.template(a.fmt)),a.template(e.transform(g,function(a,c,d){a[d]=encodeURIComponent(c),delete b[d]},{}))}function d(a,b,d,g){"function"==typeof d?(g=d,d={}):(d=d||{},g="function"==typeof g?g:e.noop);var h,i={},j={};if(b.needsBody&&!d.body)return e.nextTick(g,new TypeError("A request body is required."));if(d.body&&(i.body=d.body),d.ignore&&(i.ignore=e.isArray(d.ignore)?d.ignore:[d.ignore]),i.timeout=void 0===d.timeout?1e4:d.timeout,b.bulkBody&&(i.bulkBody=!0),b.castExists&&(i.castExists=!0),1===b.methods.length)i.method=b.methods[0];else if(i.method=e.toUpperString(d.method),i.method){if(!e.contains(b.methods,i.method))return e.nextTick(g,new TypeError("Invalid method: should be one of "+b.methods.join(", ")))}else i.method=i.body?b.methodWithBody||(b.methodWithBody=e.find(b.methods,function(a){return"GET"!==a})):b.methods[0];if(b.url)i.path=c(b.url,d);else for(h=0;h<b.urls.length&&!(i.path=c(b.urls[h],d));h++);if(!i.path)return e.nextTick(g,new TypeError("Unable to build a path with those params. Supply at least "+e.keys(b.urls[b.urls.length-1].req).join(", ")));b.paramKeys||(b.paramKeys=e.keys(b.params));var k,l,m;for(h=0;h<b.paramKeys.length;h++){k=b.paramKeys[h],l=b.params[k],m=l.name||k;try{if(null!=d[k])j[m]=f[l.type]?f[l.type](l,d[k],k):d[k],l["default"]&&j[m]===l["default"]&&delete j[m];else if(l.required)throw new TypeError("Missing required parameter "+k)}catch(n){return e.nextTick(g,n)}}return i.query=j,a.request(i,g)}b.exports=function(a,b){return function(c,e){return d((b||this.client).config.transport,a,c,e)}};var e=(a("./errors"),a("./utils")),f={"enum":function(a,b,c){if(e.contains(a.options,b))return b;throw new TypeError("Invalid "+c+": expected one of "+a.options.join(","))},duration:function(a,b,c){if(e.isNumeric(b)||e.isInterval(b))return b;throw new TypeError("Invalid "+c+": expected a number or interval (an integer followed by one of Mwdhmsy).")},list:function(a,b,c){switch(typeof b){case"string":return b;case"object":if(e.isArray(b))return b.join(",");throw new TypeError("Invalid "+c+": expected be a comma seperated list, array, or boolean.");
default:return!!b}},"boolean":function(a,b){return b=e.isString(b)?b.toLowerCase():b,"no"===b||"off"===b?!1:!!b},number:function(a,b,c){if(e.isNumeric(b))return 1*b;throw new TypeError("Invalid "+c+": expected a number.")},string:function(a,b,c){if("object"!=typeof b&&b)return""+b;throw new TypeError("Invalid "+c+": expected a string.")},time:function(a,b,c){if("string"==typeof b||e.isNumeric(b))return b;if(b instanceof Date)return b.getTime();throw new TypeError("Invalid "+c+": expected some sort of time.")}}},{"./errors":22,"./utils":33}],18:[function(a,b){function c(a){if(e.extend(this,l,a),this.log&&(this.loggers=this.log,delete this.log),"string"==typeof this.connectionClass&&(this.connectionClass=h[e.studlyCase(this.connectionClass)]),"function"!=typeof this.connectionClass)throw new TypeError('Invalid connectionClass "'+this.connectionClass+'". Expected a constructor or one of '+e.keys(h).join(", "));if("string"==typeof this.selector&&(this.selector=g[e.camelCase(this.selector)]),"function"!=typeof this.selector)throw new TypeError('Invalid Selector "'+this.selector+'". Expected a function or one of '+e.keys(g).join(", "));e.each(k,function(a,b){this[b]="function"==typeof this[b]?new this[b](this):new a(this)},this),this.connectionPool.setNodes(this.prepareHosts(this.hosts)),delete this.hosts}var d=a("__browserify_process");b.exports=c;var e=(a("url"),a("./utils")),f=a("./host"),g=a("./selectors"),h={};d.browser?(h.Xhr=a("./connectors/xhr"),h.Angular=a("./connectors/angular"),h.jQuery=a("./connectors/jquery")):h.Http=a("./connectors/http"),e.each(h,function(a,b){"function"!=typeof a&&delete h[b]});var i={Json:a("./serializers/json")},j=/\[([^:]+):(\d+)]/,k={log:a("./log"),serializer:i.Json,connectionPool:a("./connection_pool"),transport:a("./transport")},l={loggers:[{level:"warning"}],hosts:[{host:"localhost",port:9200,protocol:"http"}],connectionClass:d.browser?h.Xhr:h.Http,selector:g.roundRobin,sniffOnStart:!1,sniffAfterRequests:null,sniffOnConnectionFail:!1,maxRetries:3,timeout:1e4,deadTimeout:6e4,maxSockets:10,nodesToHostCallback:function(a){var b=[];return e.each(a,function(a,c){var d=j.exec(a.host);b.push({host:d[1],port:d[2],_meta:{id:c,name:a.name,servername:a.host,version:a.version}})}),b}};h=e.transform(h,function(a,b,c){b&&(a[c]=b)},{}),c.prototype.prepareHosts=function(a){return e.isArray(a)||(a=[a]),e.map(a,function(a){return new f(a)})},c.prototype.close=function(){this.log.close(),this.connectionPool.close()}},{"./connection_pool":20,"./connectors/angular":1,"./connectors/http":1,"./connectors/jquery":1,"./connectors/xhr":21,"./host":23,"./log":24,"./selectors":27,"./serializers/json":30,"./transport":31,"./utils":33,__browserify_process:12,url:7}],19:[function(a,b){function c(a,b){if(e.call(this),this.config=b,this.host=a,this.requestCount=0,!this.host)throw new Error("Missing host config");d.makeBoundMethods(this)}b.exports=c;var d=a("./utils"),e=a("events").EventEmitter;d.inherits(c,e),c.prototype.request=function(){throw new Error("Connection#request must be overwritten by the Connector")},c.prototype.ping=function(a,b){if("function"==typeof a)b=a;else if("function"!=typeof b)throw new TypeError("Callback must be a function");return this.request({path:"/",method:"HEAD",timeout:100},b)},c.prototype.setStatus=function(a){var b=this.status;this.status=a,("dead"===a||"closed"===a)&&(this.__deadTimeout&&clearTimeout(this.__deadTimeout),"dead"===a&&(this.__deadTimeout=setTimeout(this.bound.resuscitate,this.config.deadTimeout))),this.emit("status changed",a,b,this)},c.prototype.resuscitate=d.scheduled(function(){var a=this;"dead"===a.status&&a.ping(function(b){b?a.emit("dead"):a.setStatus("alive")})})},{"./utils":33,events:4}],20:[function(a,b){function c(a){d.makeBoundMethods(this),this.config=a,this.index={},this.connections={alive:[],dead:[]}}b.exports=c;var d=a("./utils"),e=(a("./selectors"),a("events").EventEmitter,a("./errors"),a("./host"));c.prototype.select=function(a){if(this.connections.alive.length)if(this.config.selector.length>1)this.config.selector(this.connections.alive,a);else try{d.nextTick(a,null,this.config.selector(this.connections.alive))}catch(b){this.config.log.error(b),a(b)}else a()},c.prototype.onStatusChanged=d.handler(function(a,b,c){var d,e,f;if(b===a)return!0;switch(this.config.log.info("connection id:",c.__id,"is",a),a){case"alive":d=this.connections.dead,e=this.connections.alive;break;case"dead":d=this.connections.alive,e=this.connections.dead;break;case"closed":d=this.connections[b]}d&&d.indexOf&&(f=d.indexOf(c),~f&&d.splice(f,1)),e&&e.indexOf&&(f=e.indexOf(c),~f||e.push(c))}),c.prototype._add=function(a){this.index[a.__id]||(this.index[a.__id]=a,a.on("status changed",this.bound.onStatusChanged),a.setStatus("alive"))},c.prototype._remove=function(a){this.index[a.__id]&&(delete this.index[a.__id],a.setStatus("closed"),a.removeListener("status changed",this.bound.onStatusChanged))},c.prototype.setNodes=function(a){var b,c,f,g,h=d.clone(this.index);for(c=0;c<a.length;c++)g=a[c],g instanceof e&&(f=g.toString(),this.index[f]?delete h[f]:(b=new this.config.connectionClass(g,this.config),b.__id=f,this._add(b)));d.each(h,this._remove,this)},c.prototype.close=function(){this.setNodes([])},c.prototype.empty=c.prototype.close},{"./errors":22,"./host":23,"./selectors":27,"./utils":33,events:4}],21:[function(a,b){function c(a,b){e.call(this,a,b)}b.exports=c;var d=a("../utils"),e=a("../connection"),f=a("../errors").ConnectionFault,g=a("../errors").RequestTimeout,h=!(navigator&&/PhantomJS/i.test(navigator.userAgent));d.inherits(c,e);var i=d.noop;if(i="undefined"!=typeof XMLHttpRequest?function(){return new XMLHttpRequest}:d.first(["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],function(a){try{{new window.ActiveXObject(a)}return function(){return new window.ActiveXObject(a)}}catch(b){return null}}),!i)throw new Error("getXhr(): XMLHttpRequest not available");c.prototype.request=function(a,b){var c,e=i(),j=a.timeout?a.timeout:1e4,k=this.host.makeUrl(a),l=this.config.log,m=a.async===!1?!1:h;a.auth?e.open(a.method,k,m,a.auth.user,a.auth.pass):e.open(a.method,k,m),e.onreadystatechange=function(){if(4===e.readyState){clearTimeout(c),l.trace(a.method,k,a.body,e.responseText,e.status);var d=e.status?void 0:new f(e.statusText||"Request failed to complete.");b(d,e.responseText,e.status)}},1/0!==j&&(c=setTimeout(function(){e.onreadystatechange=d.noop,e.abort(),b(new g)},j)),e.send(a.body||void 0)}},{"../connection":19,"../errors":22,"../utils":33}],22:[function(a,b){function c(a,b){this.message=a,Error.call(this,this.message),d.browser?this.stack="":Error.captureStackTrace(this,b)}var d=a("__browserify_process"),e=a("./utils"),f=b.exports;e.inherits(c,Error),f.ConnectionFault=function(a){c.call(this,a||"Connection Failure",f.ConnectionFault)},e.inherits(f.ConnectionFault,c),f.NoConnections=function(a){c.call(this,a||"No Living connections",f.NoConnections)},e.inherits(f.NoConnections,c),f.Generic=function(a){c.call(this,a||"Generic Error",f.Generic)},e.inherits(f.Generic,c),f.RequestTimeout=function(a){c.call(this,a||"Request Timeout",f.RequestTimeout)},e.inherits(f.RequestTimeout,c),f.Serialization=function(a){c.call(this,a||"Unable to parse/serialize body",f.Serialization)},e.inherits(f.Serialization,c);var g={503:"Service Unavailable",500:"Internal Server Error",412:"Precondition Failed",409:"Conflict",403:"Forbidden",404:"Not Found",400:"Bad Request",301:"Moved Permanently"};e.each(g,function(a,b){function d(b){c.call(this,b||a,f[g])}var g=e.studlyCase(a);e.inherits(d,c),f[g]=d,f[b]=d})},{"./utils":33,__browserify_process:12}],23:[function(a,b){function c(a){return this instanceof c?"string"==typeof a?c.fromString(a):(f.extend(this,a||{}),void 0):new c(a)}b.exports=c;var d=a("url"),e=a("querystring"),f=a("./utils"),g=/^([a-z]+:)?\/\//,h={http:80,https:443};c.fromString=function(a){g.test(a)||(a="http://"+a);var b=d.parse(a,!0,!0);return new c({protocol:b.protocol?b.protocol.substring(0,b.protocol.length-1):"http",host:b.hostname||"localhost",port:b.port||9200,auth:b.auth||"",path:b.pathname,query:b.query})},c.prototype={protocol:"http",host:"localhost",port:9200,auth:"",path:"",query:!1},c.prototype.makeUrl=function(a){a=a||{};var b="";this.port!==h[this.protocol]&&(b=":"+this.port);var c="";this.path&&(c+=this.path),a.path&&(c+=a.path),c&&"/"!==c.charAt(0)&&(c="/"+c);var d="";return a.query?d=e.stringify(f.defaults("string"==typeof a.query?e.parse(a.query):a.query,this.query)):this.query&&(d=e.stringify(this.query)),this.protocol+"://"+this.host+b+c+(d?"?"+d:"")}},{"./utils":33,querystring:6,url:7}],24:[function(a,b){function c(a){this.config=a||{};var b,c=a.loggers?a.loggers:"warning";if(e.isString(c)||e.isFinite(c))c=[{level:c}];else if(e.isPlainObject(c))c=[c];else if(e.isArray(c))for(b=0;b<c.length;b++)e.isString(c[b])&&(c[b]={level:c[b]});if(!e.isArrayOfPlainObjects(c))throw new TypeError("Invalid Logging output config");for(b=0;b<c.length;b++)this.addOutput(c[b])}var d=a("__browserify_process"),e=a("./utils"),f=a("url"),g=a("events").EventEmitter;if(d.browser)var h={Console:a("./loggers/console")};else var h={File:a("./loggers/file"),Stream:a("./loggers/file"),Stdio:a("./loggers/stdio")};e.inherits(c,g),c.prototype.close=function(){this.emit("closing"),this.listenerCount()&&(console.error("Something is still listening for log events, but the logger is closing."),this.clearAllListeners())},c.prototype.listenerCount=function(a){return g.listenerCount?g.listenerCount(this,a):this.listeners(a).length},c.levels=["error","warning","info","debug","trace"],c.parseLevels=function(a){return e.isString(a)?c.levels.slice(0,e.indexOf(c.levels,a)+1):e.isArray(a)?e.intersection(a,c.levels):void 0},c.join=function(a){return e.map(a,function(a){return e.isPlainObject(a)?e.inspect(a)+"\n":a.toString()}).join(" ")},c.prototype.addOutput=function(a){var b=c.parseLevels(a.levels||a.level||"warning");e.defaults(a||{},{type:d.browser?"Console":"Stdio"}),delete a.level,a.levels=b;var f=h[e.studlyCase(a.type)];if(f)return new f(a,this);throw new Error('Invalid logger type "'+a.type+'". Expected one of '+e.keys(h).join(", "))},c.prototype.error=function(a){return this.listenerCount("error")?this.emit("error",a instanceof Error?a:new Error(a)):void 0},c.prototype.warning=function(){return this.listenerCount("warning")?this.emit("warning",c.join(arguments)):void 0},c.prototype.info=function(){return this.listenerCount("info")?this.emit("info",c.join(arguments)):void 0},c.prototype.debug=function(){return this.listenerCount("debug")?this.emit("debug",c.join(arguments)):void 0},c.prototype.trace=function(a,b,c,d,g){return this.listenerCount("trace")?("string"==typeof b&&(b=f.parse(b,!0,!0)),b=e.defaults({host:"localhost:9200",query:e.defaults({pretty:!0},b.query)},b),delete b.auth,!b.pathname&&b.path&&(b.pathname=b.path.split("?").shift()),this.emit("trace",a,f.format(b),c,d,g)):void 0},b.exports=c},{"./loggers/console":26,"./loggers/file":1,"./loggers/stdio":1,"./utils":33,__browserify_process:12,events:4,url:7}],25:[function(a,b){function c(a,b){this.bridge=b,this.listeningLevels=[],f.makeBoundMethods(this),this.bridge.on("closing",this.bound.cleanUpListeners),this.setupListeners(a.levels)}function d(a){return 10>a?"0"+a.toString(10):a.toString(10)}function e(a,b){var c=f.repeat(" ",b||2);return a.split(/\r?\n/).map(function(a){return c+a}).join("\n")}var f=(a("./log"),a("./utils"));c.prototype.timestamp=function(){var a=new Date;return a.getUTCFullYear()+"-"+d(a.getUTCMonth()+1)+"-"+d(a.getUTCDate())+"T"+d(a.getUTCHours())+":"+d(a.getUTCMinutes())+":"+d(a.getUTCSeconds())+"Z"},c.prototype.format=function(a,b){return a+": "+this.timestamp()+"\n"+e(b)+"\n\n"},c.prototype.write=function(){throw new Error("This should be overwritten by the logger")},c.prototype.setupListeners=function(a){this.cleanUpListeners(),this.listeningLevels=a,f.each(this.listeningLevels,function(a){var b="on"+f.ucfirst(a);if(!this.bound[b])throw new Error(b+" is not a function");this.bridge.on(a,this.bound[b])},this)},c.prototype.cleanUpListeners=f.handler(function(){f.each(this.listeningLevels,function(a){this.bridge.removeListener(a,this.bound["on"+f.ucfirst(a)])},this)}),c.prototype.onError=f.handler(function(a){this.write("Error"===a.name?"ERROR":a.name,a.stack)}),c.prototype.onWarning=f.handler(function(a){this.write("WARNING",a)}),c.prototype.onInfo=f.handler(function(a){this.write("INFO",a)}),c.prototype.onDebug=f.handler(function(a){this.write("DEBUG",a)}),c.prototype.onTrace=f.handler(function(a,b,c,d,e){var f='curl "'+b.replace(/"/g,'\\"')+'" -X'+a.toUpperCase();c&&(f+=' -d "'+c.replace(/"/g,'\\"')+'"'),f+="\n<- "+e+"\n"+d,this.write("TRACE",f)}),b.exports=c},{"./log":24,"./utils":33}],26:[function(a,b){function c(a,b){d.call(this,a,b),this.color=e.has(a,"color")?!!a.color:!0}b.exports=c;var d=a("../logger"),e=a("../utils");e.inherits(c,d),c.prototype.setupListeners=function(a){this.bound.onWarning=this.onWarning,this.bound.onInfo=this.onInfo,this.bound.onDebug=this.onDebug,d.prototype.setupListeners.call(this,a)},c.prototype.onError=e.handler(function(a){console.error&&console.trace?console.error("Error"===a.name?"ERROR":a.name,a.stack||a.message):console.log("Error"===a.name?"ERROR":a.name,a.stack||a.message)}),c.prototype.onWarning=function(a){console[console.warn?"warn":"log"]("WARNING",a)},c.prototype.onInfo=function(a){console[console.warn?"info":"log"]("INFO",a)},c.prototype.onDebug=function(a){console[console.debug?"debug":"log"]("DEBUG",a)},c.prototype.onTrace=e.handler(function(a,b,c,d,e){var f='curl "'+b.replace(/"/g,'\\"')+'" -X'+a.toUpperCase();c&&(f+=' -d "'+c.replace(/"/g,'\\"')+'"'),f+="\n<- "+e+"\n"+d,console.log("TRACE:\n"+f+"\n\n")})},{"../logger":25,"../utils":33}],27:[function(a,b){b.exports={random:a("./random"),roundRobin:a("./round_robin")}},{"./random":28,"./round_robin":29}],28:[function(a,b){function c(a){return a[Math.floor(Math.random()*a.length)]}b.exports=c},{}],29:[function(a,b){function c(a){return a.unshift(a.pop()),a[0]}b.exports=c},{}],30:[function(a,b){function c(a){this.client=a}b.exports=c;var d=a("../utils");c.prototype.serialize=function(a,b,c){return null==a?null:"string"==typeof a?a:JSON.stringify(a,b,c)},c.prototype.unserialize=function(a){if("string"!=typeof a)return a;try{return JSON.parse(a)}catch(b){return this.client.log.error(new Error("unable to parse",a)),null}},c.prototype.bulkBody=function(a){var b,c="";if(d.isArray(a))for(b=0;b<a.length;b++)c+=this.serialize(a[b])+"\n";else{if("string"!=typeof a)throw new TypeError("Bulk body should either be an Array of commands/string, or a String");c=a+("\n"===a[a.length-1]?"":"\n")}return c}},{"../utils":33}],31:[function(a,b){function c(a){this.config=a}b.exports=c;{var d=a("./utils"),e=a("./transport_request");a("./errors")}c.prototype.request=function(a,b){return new e(this.config,a,b)},c.prototype.sniff=function(a){var b=this.config;a="function"==typeof a?a:d.noop,this.request({path:"/_cluster/nodes",method:"GET"},function(c,d){if(!c&&d&&d.nodes){var e=b.nodesToHostCallback(d.nodes);b.connectionPool.setNodes(e)}a(c,d)})}},{"./errors":22,"./transport_request":32,"./utils":33}],32:[function(a,b){function c(a,b,c){f.call(this),e.makeBoundMethods(this),this._params=b,this._log=a.log,this._serializer=a.serializer,this._connectionPool=a.connectionPool,this._remainingRetries=a.maxRetries,"function"==typeof c&&this.once("done",c),this._startRequest()}var d=a("__browserify_process");b.exports=c;var e=a("./utils"),f=a("events").EventEmitter,g=a("./errors");e.inherits(c,f),c.prototype._startRequest=function(){var a=this._params;return this._log.debug("starting request",a),a.body&&"GET"===a.method?(d.nextTick(e.bindKey(this,"respond",new TypeError('Body can not be sent with method "GET"'))),void 0):(a.body&&(a.body=this._serializer[a.bulkBody?"bulkBody":"serialize"](a.body)),a.req={timeout:a.timeout,path:a.path,query:a.query,method:a.method,body:a.body},this._connectionPool.select(this.bound._sendReqWithCon),void 0)},c.prototype._sendReqWithCon=e.handler(function(a,b){a?this._respond(a):b?(this._connection=b,this._log.info("Selected",b.status,"Connection, making request"),this._request=b.request(this._params.req,this.bound._checkRespForFail)):(this._log.warning("No living connections"),this._respond(new g.NoConnections))}),c.prototype._checkRespForFail=e.handler(function(a,b,c){a&&this._remainingRetries?(this._remainingRetries--,this._log.error(a.message,"-- retrying"),this._connectionPool.select(this.bound._sendReqWithCon)):(this._log.info("Request complete"),this._respond(a,b,c))}),c.prototype._respond=e.handler(function(a,b,c){if(this._response)throw new Error("Request responded twice");var d,f=this._serializer,h=this._params.ignore;h&&!e.isArray(h)&&(h=[h]),!a&&b&&(d=f.unserialize(b),null==d&&(a=new g.Serialization)),a||(200>c||c>=300)&&!e.contains(h,c)&&(a=g[c]?new g[c](d&&d.error):new g.Generic("unknown error")),this._params.castExists&&(a&&a instanceof g.NotFound?(d=!1,a=void 0):d=!a),this._error=a,this._response={body:d,status:c},this.emit("done",this._error,this._response.body,this._response.status)}),c.prototype.abort=function(){return this.aborted=!0,this.__request?(this.__request.abort(),!0):!1},c.prototype.then=function(a,b){this._error?b(this._error):this._response?a(this._response):this.once("done",e.bindKey(this,"then",a,b))}},{"./errors":22,"./utils":33,__browserify_process:12,events:4}],33:[function(a,b){function c(a,b,c){return function(d){for(var e,f,g,h,i=0,j=[],k="";i<d.length;i++)e=d.charCodeAt(i),f=d.charAt(i),h=e>=97&&122>=e,g=e>=65&&90>=e,(g||!h)&&(k.length&&j.push(k),k=""),(g||h)&&(h&&k.length?k+=f:k=!j.length&&a||j.length&&b?f.toUpperCase():f.toLowerCase());return k.length&&j.push(k),j.lenth&&"_"===d.charAt(0)&&(j[0]="_"+j[0]),j.join(c)}}var d=a("__browserify_process"),e=a("path"),f=a("lodash"),g=a("util"),h=f.extend({},f,g);f=h,h.inspect=function(a,b){return g.inspect(a,f.defaults(b||{},{showHidden:!0,depth:null,color:!0}))},h.joinPath=e.join,h.reKey=function(a,b,c){if(void 0===c&&(c=!0),"function"!=typeof b)throw new TypeError("invalid transform function");var d={};return f.each(a,function(a,e){d[b(e)]=c&&"object"==typeof a?h.reKey(a,b,c):a}),d},h.deepMerge=function(a,b){return Object.keys(b).forEach(function(c){switch(typeof a[c]){case"undefined":a[c]=b[c];break;case"object":f.isArray(a[c])&&f.isArray(b[c])?a[c]=a[c].concat(b[c]):f.isPlainObject(a[c])&&f.isPlainObject(b[c])&&h.deepMerge(a[c],b[c])}}),a},"String Object PlainObject Array Finite Function RegExp".split(" ").forEach(function(a){var b=f.bindKey(f,"is"+a);h["isArrayOf"+a+"s"]=function(a){return f.isArray(a)&&f.every(a.slice(0,10),b)}}),h.ucfirst=function(a){return a[0].toUpperCase()+a.substring(1).toLowerCase()},h.studlyCase=c(!0,!0,""),h.camelCase=c(!1,!0,""),h.snakeCase=c(!1,!1,"_"),h.toLowerString=function(a){return a?"string"!=typeof a&&(a=a.toString()):a="",a.toLowerCase()},h.toUpperString=function(a){return a?"string"!=typeof a&&(a=a.toString()):a="",a.toUpperCase()},h.isNumeric=function(a){return!isNaN(null===a?0/0:1*a)};var i=/^(\d+(?:\.\d+)?)([Mwdhmsy])$/;h.isInterval=function(a){return!(!a.match||!a.match(i))},h.repeat=function(a,b){return new Array(b+1).join(a)},h.inherits=function(a,b){g.inherits(a,b),a.callSuper=function(a,c){c?f.isArguments(c)?h.applyArgs(b,a,c):h.applyArgs(b,a,arguments,1):b.call(a)}},h.trim=function(a){return"string"==typeof a?a.replace(/^\s+|\s+$/g,""):""},h.collectMatches=function(a,b){for(var c,d=[];(c=b.exec(a))&&(d.push(c),b.global===!0););return d},h.applyArgs=function(a,b,c,d){switch(d=d||0,c.length-d){case 0:return a.call(b);case 1:return a.call(b,c[0+d]);case 2:return a.call(b,c[0+d],c[1+d]);case 3:return a.call(b,c[0+d],c[1+d],c[2+d]);case 4:return a.call(b,c[0+d],c[1+d],c[2+d],c[3+d]);case 5:return a.call(b,c[0+d],c[1+d],c[2+d],c[3+d],c[4+d]);default:return a.apply(b,Array.prototype.slice.call(c,d))}},f.nextTick=function(a){d.nextTick(f.bindKey(f,"applyArgs",a,null,arguments,1))},f.handler=function(a){return a._provideBound=!0,a},f.scheduled=f.handler,f.makeBoundMethods=function(a,b){if(a.bound={},b)f.each(b,function(b){a.bound[b]=f.bindKey(a,b)});else{b=[];for(var c in a)"function"==typeof a[c]&&a[c]._provideBound===!0&&(a.bound[c]=f.bind(a[c],a))}},f.noop=function(){},b.exports=h},{__browserify_process:12,lodash:13,path:5,util:8}]},{},[14])(14)});